Commit Graph

46667 Commits

Author SHA1 Message Date
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 ba8ead5e61 Add some casts for C++ compatibility.
Make conv_get_fid() return a "const char *", as it can return a string
constant, and they are usually *not* writable.

svn path=/trunk/; revision=49400
2013-05-18 01:42:20 +00:00
Guy Harris a274d9de4a A "pointer to something" is a "void *", not a "char *". Using "void *"
avoids some alignment warnings from clang.

svn path=/trunk/; revision=49399
2013-05-18 00:45:20 +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
Evan Huus 48285bb16b From Robert Bullen via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8643
When a TCP segment contains the end of two or more SSL PDUs, the TCP reassembly
code passes that segment up to the SSL dissector multiple times--one for each
SSL PDU. The SSL dissector queues the packet for SSL tap listeners each time it
is invoked. Therefore a single packet can be processed by SSL tap listeners
multiple times. But the tap data that the SSL dissector sends to its tap
listeners is a linked list of all PDUs in the packet.

The SSL tap listener responsible for populating the Follow SSL Stream dialog
did not account for the possibility of seeing a packet multiple times. As a
result, it would process the entire linked list of PDUs each time it received a
packet, and that would result in some SSL PDUs showing up two or more times in
the dialog.

This patch fixes the described bug. It also implements a few slight
improvements in closely related code. See bugzilla for details.


svn path=/trunk/; revision=49387
2013-05-17 21:50:27 +00:00
Pascal Quantin 0091c984df From Chris Bontje via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8695 :
packet-synphasor.c: use 'new_' versions of dissector registration and initialization

svn path=/trunk/; revision=49386
2013-05-17 21:24:20 +00:00
Pascal Quantin c080dd0474 More compilation fixes when having HAVE_KERBEROS
svn path=/trunk/; revision=49385
2013-05-17 19:31:44 +00:00
Anders Broman 6cfe8894b3 set col fence, in case there are more Diameter PDU:s in a transport message.
svn path=/trunk/; revision=49381
2013-05-17 16:24:46 +00:00
Jeff Morriss 86744b65da As suggested by Jakub: don't ep_alloc buffers for TVBs, use g_malloc()'d
memory with tvb-free-callback.

Fixes one of the "read after free" warnings from Valgrind reported in
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8197 and the one reported
in https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8653

svn path=/trunk/; revision=49379
2013-05-17 14:38:36 +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 d4ad2e087c Fix some more warnings that show up on platforms with 32-bit time_t.
Get rid of double semicolons.

svn path=/trunk/; revision=49371
2013-05-17 08:09:39 +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
Anders Broman 4b85b45281 Squelch more warnings about empty structures.
svn path=/trunk/; revision=49366
2013-05-17 05:33:53 +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 f296630024 Squelch warnings about empty structures and chopping off 64-bit values
at 32 bits.

svn path=/trunk/; revision=49364
2013-05-17 05:25:11 +00:00
Jeff Morriss 504d830981 From Dominique Martinet via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8589 :
Theses patches add alot of new message types for the 9P protocol and its
extensions (most specifically 9P2000.L), while staying compatible with the
legacy protocol (hence the hashtable with conversation information, since
version is only known at handshake)

It is still missing alot of 9P2000.u specifics, but I don't have any server
to test it with. I'm also missing some dump to test legacy, but I'm pretty
confident I didn't break much there as it is mostly compatible, most
differences are handled using different messages, the only one that was
changed would be RERROR.


second diff also adds deeper interpretation of the protocol, by following
the conversation stream and keeping a bigger hashtable associating fid (file
handles) and file names, for easier debugging.


From me: roll the contents of the (new) packet-9p.h back into the C file.

svn path=/trunk/; revision=49363
2013-05-17 02:00:05 +00:00
Evan Huus 5dc6e4598e Use proto_tree_add_int64 for 64-bit values.
svn path=/trunk/; revision=49362
2013-05-17 00:56:54 +00:00
Jeff Morriss 2572f8ac1e From Cal Turney via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8690 :
Change "Edit" to "Rename" and add icons to "Manage Profiles..." and "Switch
to...". Update the associated widget, routine, and variable names in order
to facilitate future maintenance.

svn path=/trunk/; revision=49361
2013-05-17 00:42:45 +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
Evan Huus 0c2e3fb3a7 From Florian Forster via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8472
Starting with collectd 5.0, the representation of time has changed. The new
fields "TIME_HR" and "INTERVAL_HR" contain the seconds since the epoch in steps
of 2^{-30} seconds (roughly nanosecond precision). This patch adds support for
both time formats.

From me:
Permit using 64-bit integers with value-strings, as this protocol actually 
seems to needs it. We'll misbehave for named values > 2^32 but there aren't any
of those despite the field being 64 bits.


svn path=/trunk/; revision=49357
2013-05-17 00:06:26 +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
Evan Huus f2bdbd2b32 Use a readable name for the wmem callback test. Warn that reallocing memory
for which a callback is registered is also a fairly stupid thing to do.

svn path=/trunk/; revision=49354
2013-05-16 23:38:31 +00:00
Evan Huus 4b6ff3d829 Use slice memory for data sources, since we never have to realloc it.
svn path=/trunk/; revision=49353
2013-05-16 23:34:19 +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
Pascal Quantin c3836c576e Fix link failure with Windows
svn path=/trunk/; revision=49349
2013-05-16 22:23:16 +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
Pascal Quantin 67c9aa88c7 Fix compilation for Linux (defined but not used errors, C++ incompatibilities, shadowed variables)
svn path=/trunk/; revision=49344
2013-05-16 21:16:45 +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