Commit Graph

1893 Commits

Author SHA1 Message Date
Jakub Zawadzki 33bfa85452 Initial support for D-Bus dissection (bug #5502)
svn path=/trunk/; revision=43542
2012-06-29 15:23:21 +00:00
Jakub Zawadzki bf81b42e1e Update Free Software Foundation address.
(COPYING will be updated in next commit)

svn path=/trunk/; revision=43536
2012-06-28 22:56:06 +00:00
Gerald Combs ff0d1ec3fa ascend_scanner.c includes ascend.h. Add corresponding makefile
dependencies, otherwise we might have a race condition when doing
parallel makes. Hopefully this will fix intermitten buildbot failures
we've been getting lately.

svn path=/trunk/; revision=43387
2012-06-19 19:53:03 +00:00
Guy Harris fc2d1024de Forgot to use wtap_dump_can_write_encaps()'s final name.
svn path=/trunk/; revision=43317
2012-06-17 16:53:31 +00:00
Guy Harris 2bd813507a Export a wtap_dump_can_write_encaps() routine from Wiretap; it takes a
file type and a GArray of encapsulation types and returns TRUE if a
capture with all those encapsulation types can be written to a file in
that file type and FALSE otherwise.  Use it where appropriate.

svn path=/trunk/; revision=43315
2012-06-17 16:44:09 +00:00
Guy Harris c63aa61658 Have wtap_get_savable_file_types() take an array of encapsulations and
only return file types that could handle a single file with all those
encapsulations - this means that

	1) if there's more then one encapsulation, the file format has
to handle per-packet encapsulation;

	2) just because a file format handles per-packet encapsulation,
that doesn't mean that it can handle the *particular* encapsulations
being handed to it.

This fixes some cases where we were claiming that a file could be saved
in a format that doesn't actually support it (e.g., ISDN files being
reported as savable in pcap-NG format - there's no LINKTYPE_ value for
ISDN including B and D channels).

svn path=/trunk/; revision=43300
2012-06-17 01:32:50 +00:00
Gerald Combs 1a7470c6be Forward-port r43165 and r43168 from trunk-1.6.
------------------------------------------------------------------------
  r43165 | gerald | 2012-06-08 14:23:25 -0700 (Fri, 08 Jun 2012) | 4 lines
  Changed paths:
     M /trunk-1.6/epan/Makefile.am
     M /trunk-1.6/wiretap/Makefile.am
     M /trunk-1.6/wsutil/Makefile.am
  
  Use separate commands in the dumpabi recipes instead a big huge long
  chain. If abi-compliance-checker fails print the contents of its
  log file.
  ------------------------------------------------------------------------
  r43168 | gerald | 2012-06-08 15:43:50 -0700 (Fri, 08 Jun 2012) | 2 lines
  Changed paths:
     M /trunk-1.6/epan/Makefile.am
     M /trunk-1.6/wiretap/Makefile.am
     M /trunk-1.6/wsutil/Makefile.am
  
  Make sure ln happens in the right directory.
  ------------------------------------------------------------------------

We don't currently have a usable tag for "git describe --tags
--abbrev=0" to latch onto so just use the first 1.9 commit.

svn path=/trunk/; revision=43170
2012-06-08 23:54:22 +00:00
Gerald Combs 39dbd45c9f Fix some dead assignments.
svn path=/trunk/; revision=43157
2012-06-08 17:20:44 +00:00
Anders Broman 7881fe8493 From Stephen Donnelly: Correct ERF name, add WTAP_ENCAP string display https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7313
svn path=/trunk/; revision=43141
2012-06-06 20:35:37 +00:00
Jakub Zawadzki 9435b3f693 Fix bug #7340
interface name can also contain hyphen (v1-untrust, v1-trust).

svn path=/trunk/; revision=43139
2012-06-06 19:59:55 +00:00
Anders Broman 5bd0c263f2 From Andrew Kampjes:
SDH support for wireshark.

- Added GPL license.
- Removed not needed includes.
- Skipped th .h file as it wasn't used.

svn path=/trunk/; revision=43106
2012-06-05 10:42:38 +00:00
Guy Harris 00d329575d Casting a negative value to unsigned makes it positive; I'm not sure
that will do the right thing here.  Instead, cast its negative (which is
positive) to unsigned, use that value as the adjustment, and flip the
signs of the subsequent adjustment operations.

svn path=/trunk/; revision=43105
2012-06-05 08:59:37 +00:00
Anders Broman af9f210f5c Add another cast to make it build on Win32.
svn path=/trunk/; revision=43104
2012-06-05 08:39:58 +00:00
Guy Harris 92bd70a380 Making "had" a ptrdiff_t caused warnings, even if it eliminated a
warning about assigning the difference between two (64-bit) pointers to
a (32-bit) variable.  That difference is guaranteed to fit in an
unsigned int; make "had" an unsigned int, and cast the difference to
unsigned int before assigning it to "had".

svn path=/trunk/; revision=43103
2012-06-05 08:04:15 +00:00
Guy Harris 7ed3d0e959 From Jakub Zawadzki: when seeking backwards, if the seek will put you at
a position that's in our data buffer, just reposition within the
buffer, don't do any seeks or I/O on the underlying file.  This lets us
do some backwards seeking on a pipe, to allow the rewind-and-try scheme
we use to try to identify capture file types to work, at least for some
capture file formats (those that have magic numbers at the beginning or
have heuristics that don't require much data), on pipes, allowing, for
example, TShark to read those formats from a pipe.

svn path=/trunk/; revision=43102
2012-06-05 07:24:17 +00:00
Gerald Combs a0c9661fa5 There doesn't appear to be a way to convey the message "This library is
under development. Maybe you should use a stable version." via the
version number. Use the next best thing and set each number to zero.

svn path=/trunk/; revision=43073
2012-06-04 18:33:21 +00:00
Anders Broman cd7c20c9d9 Try to squelch warnings
svn path=/trunk/; revision=43000
2012-06-02 15:32:34 +00:00
Anders Broman 19507efa88 Try to squelch warnings
svn path=/trunk/; revision=42999
2012-06-02 14:56:18 +00:00
Anders Broman 2bc42dc547 Try to squelch warnings
svn path=/trunk/; revision=42998
2012-06-02 14:13:14 +00:00
Guy Harris ca28647268 Export those file_ routines that Wiretap plugins would use (others
should only be used inside Wiretap).

svn path=/trunk/; revision=42986
2012-06-01 19:05:28 +00:00
Guy Harris e51c05a836 TShark doesn't need wtap_fdreopen(), as it doesn't do saves and thus
doesn't do safe saves, so wtap_fdreopen() always needs to reopen the
random file descriptor.

At the point where a safe save is done, the sequential read is done, so
the sequential stream is closed; there's no need to reopen it.

(The former fourth argument to wtap_fdreopen() wasn't an indication of
whether the file was compressed, it was an indicationof whether the
random stream should be reopened.)

svn path=/trunk/; revision=42977
2012-06-01 16:55:10 +00:00
Guy Harris b8646937d4 Move wtap_fdreopen() to file_access.c for now, as it requires many of
the same #includes.

svn path=/trunk/; revision=42963
2012-06-01 08:45:39 +00:00
Guy Harris 5f4a8a8c32 Need fcntl.h for the O_ #defines on Windows.
svn path=/trunk/; revision=42962
2012-06-01 08:33:25 +00:00
Guy Harris 129c881fcf Sigh. There appears to be no way to get Windows to allow us to rename a
file that we ourselves have open.  In the "safe save" code path for
capture files, on Windows temporarily close the file descriptors for the
currently-open capture before doing the rename and then, if the rename
failed, reopen them, leaving the rest of the wtap and capture_file
structures intact.

Rename filed_open() to file_fdopen(), to make its name match what it
does a bit better (it's an fdopen()-style routine, i.e. do the
equivalent of an open with an already-open file descriptor rather than a
pathname, in the file_wrappers.c set of routines).

Remove the file_ routines from the .def file for Wiretap - they should
only be called by code inside Wiretap.

Closing a descriptor open for input has no reason to fail (closing a
descriptor open for *writing* could fail if the file is on a server and
dirty pages are pushed asynchronously to the server and synchronously on
a close), so just have file_close() return void.

svn path=/trunk/; revision=42961
2012-06-01 08:05:12 +00:00
Guy Harris e954e00926 Interface lists currently have to be constructed in the open routine
(otherwise, nobody sees them); do so.

Fix some cases where we weren't doing the proper post-processing after
doing the heuristics for format changes that didn't involve magic-number
changes (discovered because constructing the interface list is now being
done as part of that post-processing).

Fixes bug 7287.

svn path=/trunk/; revision=42872
2012-05-28 00:43:13 +00:00
Guy Harris a66097145d Clean up indentation (remove tabs from one structure definition).
svn path=/trunk/; revision=42869
2012-05-27 23:41:03 +00:00
Guy Harris bd5060b836 vwr_read_rec_header()'s return value is used only to distinguish success
(read a record header) from failure (got an EOF or an error).  Make it
just return a Boolean.

If it fails in vwr_read(), don't overwrite *err_info (yes,
vwr_read_rec_header() might have set *err_info, so don't lose - and
leak! - the value it returned) - trust vwr_read_rec_header(), or the
routines it calls, to have set it.  (If there's a code path where that
doesn't happen, that code path needs to be fixed; the setting of
*err_info in vwr_read() should *not* be restored.)

Thanks to Evan Huus for finding a useless variable with cppcheck, and
reporting it in bug 7295, provoking me to look at this.

svn path=/trunk/; revision=42865
2012-05-27 20:40:09 +00:00
Chris Maynard b2f2e1a675 In ns_hrtime2nsec(), cast "val" to guint64 to fix Coverity CID 702389 Unintentional integer overflow.
svn path=/trunk/; revision=42846
2012-05-25 02:04:29 +00:00
Anders Broman 8a62ebc28d From Stephen Donnelly:
Add frame.interface_id support for pcap DLT_ERF file format

https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7281

svn path=/trunk/; revision=42824
2012-05-24 09:24:05 +00:00
Guy Harris cf6d9841e3 Keep track, in Wiretap, of whether the file is compressed, and provide
an API to fetch that.

When doing "Save" on a compressed file, write it out compressed.

In the Statistics -> Summary dialog and in capinfos, report whether the
file is gzip-compressed.

svn path=/trunk/; revision=42818
2012-05-24 05:05:29 +00:00
Anders Broman 00ba6b0dc5 From Stephen Donnelly:
Add frame.interface_id support for ERF file format

https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7266

svn path=/trunk/; revision=42807
2012-05-23 06:41:37 +00:00
Guy Harris e6a57c8e93 In Windows, in the Save As and Export Selected Packets dialog, append
the default extension for the file type iff

	the file type we're using has a list of extensions;

	the file has no extension or it has one but it's not one of the
	ones in the list.

*Don't* expect a file extension to be at most 5 characters plus the dot
- the extension for pcap-ng, our default capture file type, is "pcapng",
and that's 6 characters!

svn path=/trunk/; revision=42800
2012-05-23 03:05:17 +00:00
Jakub Zawadzki 63d6b6bf2a Z_BLOCK was added in zlib-1.2.0.5
Pass Z_NO_FLUSH to inflate() when Z_BLOCK is not defined,
just in case also disable fast seeking when it's not defined.

References: http://www.wireshark.org/lists/wireshark-dev/201205/msg00145.html 

svn path=/trunk/; revision=42714
2012-05-19 13:27:43 +00:00
Gerald Combs bdb614e264 Fix a bunch of uninitialized variables found by Coverity Scan. CIDs
702403, 702404, 702405, 702406, 702407, 702408, 702409, 702410, 702411,
and 702412.

svn path=/trunk/; revision=42658
2012-05-16 16:29:12 +00:00
Gerald Combs 88ae29c149 Use "%parse-param" instead of a global variable. Fixes a scan-build
warning.

svn path=/trunk/; revision=42578
2012-05-11 17:15:12 +00:00
Guy Harris 1fc695a022 Directly calculate the time stamp based on the offset in the stream from
the first bit in the stream.  This prevents accumulated truncation
errors.

Get the seek offset from file_tell().

svn path=/trunk/; revision=42436
2012-05-05 02:52:41 +00:00
Guy Harris c7ee2fb1e3 Clean up indentation.
svn path=/trunk/; revision=42427
2012-05-04 21:18:01 +00:00
Guy Harris 9bad4b330d ng_file_seek_rand() is supposed to return a Boolean; make it do so.
svn path=/trunk/; revision=42424
2012-05-04 17:18:15 +00:00
Guy Harris 33bb54a945 file_seek() used to be a wrapper around fseek() or gzseek(), both of
which could use lseek() and were thus expensive due to system call
overhead.  To avoid making a system call for every packet on a
sequential read, we maintained a data_offset field in the wtap structure
for sequential reads.

It's now a routine that just returns information from the FILE_T data
structure, so it's cheap.  Use it, rather than maintaining the data_offset
field.

Readers for some file formats need to maintain file offset themselves;
have them do so in their private data structures.

svn path=/trunk/; revision=42423
2012-05-04 16:56:18 +00:00
Guy Harris ba78859f64 Fix comments.
svn path=/trunk/; revision=42413
2012-05-04 05:43:48 +00:00
Guy Harris 739f7c2f1d Get rid of declaration of non-existent routine.
svn path=/trunk/; revision=42412
2012-05-04 05:42:42 +00:00
Guy Harris 9467af6931 Make everything static that doesn't need to be exported.
svn path=/trunk/; revision=42409
2012-05-04 02:35:12 +00:00
Guy Harris daa7f8851e Fix indentation.
svn path=/trunk/; revision=42408
2012-05-04 02:16:51 +00:00
Guy Harris ecacaacbe2 Add a file_skip() routine to skip N bytes forward in the file - it's
currently just a wrapper around file_seek(), but could be implemented by
reading forward if, for example, we add support for reading
(sequentially only!) from a pipe.

Sort the declarations of file-reading routines into one block.

svn path=/trunk/; revision=42391
2012-05-02 21:25:48 +00:00
Guy Harris e1ee9ca907 Put all the comments about the "don't check the CRC" flag together, and
expand the resulting comment a bit.

svn path=/trunk/; revision=42390
2012-05-02 21:11:28 +00:00
Guy Harris 0275247b97 Use WTAP_ENCAP_IEEE_802_11_xxx for all the "802.11 plus radio header"
encapsulations.

For pre-V9 AiroPeek captures, leave the radio information in the packet
data, just as we do with the Prism, AVS, radiotap, and NetMon headers. 
Add a dissector for it.

svn path=/trunk/; revision=42379
2012-05-02 03:11:00 +00:00
Guy Harris 7ed15c8deb Remove unnecessary null-pointer check.
svn path=/trunk/; revision=42376
2012-05-01 22:29:08 +00:00
Chris Maynard 73f3d23999 Fix 2 redundant redeclaration warnings and a bug where logical AND (&&) was incorrectly used where bit-wise AND (&) was meant.
svn path=/trunk/; revision=42373
2012-05-01 02:47:52 +00:00
Guy Harris 4021d7c5ea Add ".dmp" as a suffix for pcap files of various flavors. Add ".ntar"
as a suffix for pcap-ng files.

svn path=/trunk/; revision=42330
2012-04-29 02:49:17 +00:00
Guy Harris 3684bb31a0 Remove _U_ from arguments that are actually used.
Fix a comment.

svn path=/trunk/; revision=42311
2012-04-28 16:05:18 +00:00