Commit Graph

2064 Commits

Author SHA1 Message Date
Guy Harris 6b4c30b69d When allocating the frame table for a NetMon file, use g_try_malloc(),
and fail with ENOMEM if that fails (and the frame table is not empty -
g_try_malloc() will return NULL if you ask it to allocate zero bytes).

Have an error message for ENOMEM on an open that attempts to tell the
user what the problem is without making their head explode.

svn path=/trunk/; revision=49673
2013-06-01 06:48:37 +00:00
Guy Harris 6e336d74a1 Move the record header processing code into a common routine, and read
that header in both the read and seek-read routines.

svn path=/trunk/; revision=49671
2013-06-01 02:58:58 +00:00
Pascal Quantin 55da3a2254 From Chris Bontje via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8644 :
SEL RTAC (Real Time Automation Controller) EIA-232 Serial-Line Dissection

svn path=/trunk/; revision=49635
2013-05-30 20:51:18 +00:00
Jörg Mayer d9dd3f3e4e Fix "set but not used" compile warning turning error
svn path=/trunk/; revision=49405
2013-05-18 08:13:51 +00:00
Guy Harris 82f74c35fc Fill in the struct wtap_pkthdr in the seek-read routine.
svn path=/trunk/; revision=49404
2013-05-18 03:42:06 +00:00
Guy Harris 3fc0506b41 In libpcap_process_header(), fill in what phdr points to, not wth->phdr.
svn path=/trunk/; revision=49403
2013-05-18 03:15:06 +00:00
Guy Harris 4097d6e676 Fill in the struct wtap_pkthdr in the seek-read routine.
svn path=/trunk/; revision=49402
2013-05-18 03:02:04 +00:00
Guy Harris 33e1232f23 In the pcapng seek-read routine, *don't* fill in wth->phdr; seek-read
routines are passed a separate struct wtap_pkthdr to be filled in.

Get rid of the pseudo_header member of the wblock structure - the
pseudo-header is part of the struct wtap_pkthdr.

Get rid of the union wtap_pseudo_header * argument to
pcap_process_pseudo_header() - it's passed a pointer to a struct
pcap_pkthdr, and that structure contains the union in question.

Have libpcap_read_header() take a FILE_T argument, rather than using
only the "sequential" handle of the wtap it's handed.  Have the libpcap
read routine return the offset of the beginning of the pcap record, and
have the seek-read routine read the header and fill in the struct
wtap_pkthdr handed to it.

svn path=/trunk/; revision=49401
2013-05-18 02:36:00 +00:00
Guy Harris 055ff08c2f Use g_array_index() to get at elements of the encapsulation table array;
this avoids some compiler warnings from clang about alignment.

svn path=/trunk/; revision=49398
2013-05-18 00:41:30 +00:00
Guy Harris 288e81e40f Put the code to read trace record headers into a common routine used by
both the read and the seek-read routines.  Have the read routine return
the offset of the record header as the record's offset, so that the
seek-read routine can read that header.

svn path=/trunk/; revision=49397
2013-05-18 00:08:43 +00:00
Guy Harris ed76ed8c88 Don't pass globals as arguments to k12text_set_headers(), just use the
globals directly.  If we ever manage to make them *not* globals (which
might only be possible with newer versions of Flex), then we can do
better.

Get rid of an unused variable.

Squelch a 64-bit-to-32-bit conversion warning.

svn path=/trunk/; revision=49396
2013-05-17 23:53:44 +00:00
Guy Harris 4c679fb01a Rename k12text_set_pseudo_header() to k12text_set_headers() and have it
fill in the entire struct wtap_pkthdr.

svn path=/trunk/; revision=49388
2013-05-17 21:55:33 +00:00
Pascal Quantin 5c56d95afe Prevent "'len' may be used uninitialized in this function" error when compiling with gcc 4.3.2
svn path=/trunk/; revision=49378
2013-05-17 13:37:36 +00:00
Guy Harris 08889b5e75 Pull some functions that fill in a struct wtap_pkthdr into common code,
and use it in both the read and seek-read routines.

svn path=/trunk/; revision=49377
2013-05-17 10:13:12 +00:00
Guy Harris 4dd1504036 Have iseries_parse_packet() fill in a struct wtap_pkthdr; that means it
doesn't need to return the number of bytes of captured packet data (it
can just stuff that into the struct wtap_pkthdr), so have it return a
Boolean success/failure indication.

svn path=/trunk/; revision=49376
2013-05-17 09:48:19 +00:00
Guy Harris adb9282b0e If iseries_seek_next_packet() hits the EOF, *err will be set to 0; just
have it return -1 for errors or EOF, and have iseries_read() check for a
negative return value and return FALSE.  That simplifies it a bit, and
handles the "no more records in the file" case
(iseries_seek_next_packet() will hit EOF and return -1 with *err set to
0, which is what the callers of a read routine expect at EOF).

Get rid of duplicate (and incorrect before the change) comment.

svn path=/trunk/; revision=49375
2013-05-17 09:37:02 +00:00
Guy Harris 13694fde7b Get rid of duplicate code.
svn path=/trunk/; revision=49374
2013-05-17 08:56:43 +00:00
Guy Harris ab74872031 Pull the reading of record data and ATM post-processing into another
common routine.

svn path=/trunk/; revision=49373
2013-05-17 08:53:04 +00:00
Guy Harris 54d630d8c5 Add iptrace_process_rec_header_ routines to read record headers and fill
in a wtap_pkthdr, as well as skipping FDDI padding, etc..

svn path=/trunk/; revision=49372
2013-05-17 08:19:51 +00:00
Guy Harris 7634be8b27 IPFIX records have a time stamp (and, according to RFC 5101, it's UNIX
time, i.e. seconds since January 1, 1970, 00:00:00 UTC).

svn path=/trunk/; revision=49370
2013-05-17 07:45:36 +00:00
Guy Harris 04d33bca00 We need ipfix_read_message_header() for the open routine; have
ipfix_read_and_process_message_header() call it and then fill in the
wtap_pkthdr structure, and use the latter routine in the read and
seek-read routines.

Expand a comment, and fix indentation.

svn path=/trunk/; revision=49369
2013-05-17 07:28:34 +00:00
Guy Harris 4b1623d619 Pull the code that fills in a wtap_pkthdr structure into
ipfix_read_message_header() and rename it
ipfix_process_message_header().  Use it in the read and seek-read
routines.

svn path=/trunk/; revision=49368
2013-05-17 06:41:20 +00:00
Guy Harris 2c07003e67 Pull the record header processing code into i4b_read_rec_header(),
renaming it to i4b_process_rec_header(), so that it's used in the read
and the seek-read routines.

svn path=/trunk/; revision=49367
2013-05-17 06:08:40 +00:00
Guy Harris a335cd8d87 Pull code to fill in a wtap_pkthdr into a hcidump_process_header()
routine, and use it in both the read and seek-read routines.

svn path=/trunk/; revision=49365
2013-05-17 05:31:21 +00:00
Guy Harris 26a909d980 Fill in the wtap_pkthdr in dct3trace_get_packet().
svn path=/trunk/; revision=49360
2013-05-17 00:21:16 +00:00
Guy Harris 7532c175b6 Set *data_offset early in the read process, to emphasize that it's the
offset of the entire packet, not the offset of the data.

Pull the setting of the FCS length into a common routine.

svn path=/trunk/; revision=49359
2013-05-17 00:15:58 +00:00
Guy Harris a6d35a28dd Pass parse_dbs_etherwatch_packet() a pointer to a struct wtap_pkthdr,
not a wtap *, and have it fill in the specified struct wtap_pkthdr. 
That makes the seek-read routine do the right thing.

svn path=/trunk/; revision=49358
2013-05-17 00:07:42 +00:00
Guy Harris b5561ed4f0 Move the header-processing code into a common daintree_sna_scan_header()
routine.

Rename daintree_sna_hex_char() to daintree_sna_process_hex_data() (to
more clearly indicate what it does - it doesn't process a single
character, it processes a whole bunch of them), and have it do some
error checking and fill in the length field in the wtap_pkthdr.

svn path=/trunk/; revision=49356
2013-05-17 00:00:13 +00:00
Guy Harris 754ccf4f7f Pull code to read and process the packet header, and to read and process
the packet data, into common routines.

svn path=/trunk/; revision=49355
2013-05-16 23:42:10 +00:00
Guy Harris 99aee757d4 Fill in the presence flags in parse_cosine_rec_hdr(), so it's done at
the same point at which the rest of the wtap_pkthdr is filled in (so
it's done in seek-read routines).

parse_cosine_hex_dump()'s return value is used as the return value of
read routines, so it should be Boolean.  Make it so (and have it stuff
the actual length of packet data read into a wtap_pkthdr, which also
ensure that this is done in seek-read routines).

svn path=/trunk/; revision=49352
2013-05-16 23:34:12 +00:00
Guy Harris 384e4bc54e Pull up the code to read the packet data and check for errors into a
common routine.

svn path=/trunk/; revision=49351
2013-05-16 23:23:08 +00:00
Guy Harris e53fb07cae Move the code to read the CommView record header, check for an unhandled
encapsulation, and to process it into a
commview_read_and_process_header() routine.

svn path=/trunk/; revision=49350
2013-05-16 23:14:17 +00:00
Guy Harris 5e1da6c1a6 Pull code to fill in the wtap_pkthdr into a btsnoop_read_record_header()
routine, for use both by the seek and read routines, and move some
common code there.

Make the delta between Symbian and UNIX time a static value.

Make the prefix for all routine names "btsnoop" rather than "snoop".

svn path=/trunk/; revision=49348
2013-05-16 22:14:11 +00:00
Guy Harris 13262726bc Pull the code to set the wtap_pkthdr into a common routine, so it's done
for read and seek-read.

Clarify a comment.  (wtap_open_offline() only rewinds the file before
calling each open routine; once one of those routines has decided the
file belongs to it, the seek offset belongs to it, so it needs to do all
the seeking necessary - files with a file header *don't* want a rewind,
they want to leave the seek offset positioned *past* the file header so
it can read the records that follow the file header.)

svn path=/trunk/; revision=49347
2013-05-16 22:01:44 +00:00
Guy Harris 609dac2f9e Move some packet-header handling code into aethra_read_rec_header(), so
it's done in both the read and seek-read routines.

svn path=/trunk/; revision=49346
2013-05-16 21:40:04 +00:00
Guy Harris 11a01e50bf Pull the code to set the struct wtap_pkthdr into _5views_read_header(),
so it's done by both the read and seek-read routines.

svn path=/trunk/; revision=49345
2013-05-16 21:19:53 +00:00
Guy Harris 887c604334 Hoist a bunch of common code between ascend_read() and
ascend_seek_read() into parse_ascend().

Adjust the buffer size *before* attempting to fill it up.

svn path=/trunk/; revision=49343
2013-05-16 21:04:41 +00:00
Guy Harris 78ee09dfeb Get rid of unused global variable.
svn path=/trunk/; revision=49341
2013-05-16 20:25:44 +00:00
Guy Harris e6e5aa7fa4 wth->priv is always set in the open routine; no need to check that it's
non-null.

svn path=/trunk/; revision=49338
2013-05-16 18:30:24 +00:00
Guy Harris d9d8174f12 Pull all the post-processing for a parsed line into a common routine,
used in both the seek and seek_read routines.

(And, yes, the time stamp *is* supposed to be filled in by seek_read
routines.)

Pull some now-used-only-once routines into the new routine.

svn path=/trunk/; revision=49335
2013-05-16 18:27:27 +00:00
Pascal Quantin ba4cb4bad7 From Weston Schmidt via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8689:
csids wiretap heuristic overriding mp2t

svn path=/trunk/; revision=49334
2013-05-16 18:27:03 +00:00
Evan Huus 930d0c1ed6 From Ravi Kondamuru via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8637
Add support for version 2.6 of netscaler capture format.

svn path=/trunk/; revision=49250
2013-05-11 18:43:53 +00:00
Jörg Mayer 7e51c9713b dumpabi: This would create the directories in the sourcedir instead
of the binary dir. Fixed that.
  NOTE: It fails with and without this patch for out of tree builds:

jmayer@egg:~/work/wireshark/svn/build/qt-gtk3> make dumpabi
[  1%] Built target wsutil
[  1%] Generating libwsutil.abi.tar.gz
ERROR: can't find modules
cp: cannot stat `abi_dumps/libwsutil/libwsutil_*': No such file or directory
make[3]: *** [wsutil/libwsutil.abi.tar.gz] Error 1
make[2]: *** [wsutil/CMakeFiles/dumpabi-libwsutil.dir/all] Error 2
make[1]: *** [CMakeFiles/dumpabi.dir/rule] Error 2
make: *** [dumpabi] Error 2
jmayer@egg:~/work/wireshark/svn/build/qt-gtk3>


svn path=/trunk/; revision=49014
2013-04-24 12:57:56 +00:00
Gerald Combs ea19c7f952 1.9.3 → 1.11.0.
svn path=/trunk/; revision=48972
2013-04-22 17:59:38 +00:00
Pascal Quantin 6910f9428f From Tomasz Mon via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8503 :
Add USBPcap support

svn path=/trunk/; revision=48847
2013-04-14 16:00:34 +00:00
Guy Harris c5d1d8d80e From Anthony Coddington: don't check for MPEG-2 Transport before
checking for ERF.

From me: note some heuristic checkers that are in the "magic number" set.

#BACKPORT 1.8

svn path=/trunk/; revision=48724
2013-04-04 04:35:09 +00:00
Guy Harris d517ab3698 In the Lua dumper code, don't bother checking whether the encapsulation
is supported before trying to open for writing - the attempt to open for
writing will do the check for you.  Instead, check for specific errors
if the attempt to open for writing fails, and use somewhat more specific
error messages for certain error codes.  (We should perhaps check for
even more error codes in those cases.)

That gets rid of all external calls to wtap_dump_can_write_encap(), so
remove it from wtap.h and make it static.

svn path=/trunk/; revision=48691
2013-04-01 21:39:28 +00:00
Guy Harris b1ecd8d217 Add a wtap_dump_can_write() routine that indicates whether Wiretap
supports writing files with a given set of encapsulations and comment
types.  Use it, rather than asking for a list of file formats that
support the given set of encapsulation and comment types and checking
whether we got back such a list, or duplicating its logic.

Having file.c use it means that nobody's using
wtap_dump_can_write_encaps() any more; get rid of it.  Instead, have a
private routine that checks whether a given file format supports a given
set of encapsulations *and* comment types, and use that internally.

svn path=/trunk/; revision=48690
2013-04-01 21:17:50 +00:00
Guy Harris 82a602d697 Define a collection of bits for different types of capture file comments.
For each capture file type, have a bitset of comment types supported by
that capture file type.

Add a Wiretap routine that, for a given file type, returns the bitset of
comment types it supports.

Have wtap_get_savable_file_types() take a bitset of comment types that
need to be supported by the file types it returns.

Replace cf_has_comments() with a routine that returns a bitset of
capture file comment types in the capture file.

Use those routines in the capture file dialogs; don't wire in the notion
that pcap-NG supports all comment types and no other file formats
support any comment types.  (That's currently true, but we don't want to
wire that in as being forever true.)

svn path=/trunk/; revision=48689
2013-04-01 20:36:42 +00:00
Martin Kaiser 7a2bdedff6 wiretap support for the CAM Inspector file format
svn path=/trunk/; revision=48647
2013-03-30 09:56:57 +00:00