Commit Graph

49 Commits

Author SHA1 Message Date
Bill Meier 30cee99009 Fix a number of proto_tree_add_item() encoding args.
svn path=/trunk/; revision=39774
2011-11-09 17:33:18 +00:00
Chris Maynard 647c5c0b27 packet_info's in_error_pkt is now a bitfield like in_gre_pkt.
svn path=/trunk/; revision=39764
2011-11-08 18:39:11 +00:00
Stephen Fisher 55b1e9a877 Add expert info to UDP dissector for showing possible (Unix-style)
traceroute packets: if the port number range is 33434 to 33434 + 30.


svn path=/trunk/; revision=36194
2011-03-14 22:01:49 +00:00
Guy Harris a8bc4a0d13 Rename the routines that handle dissector tables with unsigned integer
keys to have _uint in their names, to match the routines that handle
dissector tables with string keys.  (Using _port can confuse people into
thinking they're intended solely for use with TCP/UDP/etc. ports when,
in fact, they work better for things such as Ethernet types, where the
binding of particular values to particular protocols are a lot
stronger.)

svn path=/trunk/; revision=35224
2010-12-20 05:35:29 +00:00
Stig Bjørlykke faeed4e56e Avoid a possible dereference of null pointer.
svn path=/trunk/; revision=33707
2010-08-04 13:32:09 +00:00
Jeff Morriss 729de1a635 As suggested in http://www.wireshark.org/lists/wireshark-dev/200809/msg00075.html
(as referenced in https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=2907 ) and
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=3411 :

Write a new convenience routine for finding a conversation and, if it is not
found, create it.  The frame number and addresses are taken from pinfo (as is
the common case).

Use this function in a bunch of dissectors.

svn path=/trunk/; revision=32790
2010-05-13 18:28:34 +00:00
Bill Meier 09764dd969 Remove unneeded #include <stdio.h>
svn path=/trunk/; revision=32367
2010-04-03 21:55:23 +00:00
Stephen Fisher c8ea785b2a Make the good/bad checksum values as generated even when the UDP checksum is 0.
svn path=/trunk/; revision=31694
2010-01-27 05:17:09 +00:00
Kovarththanan Rajaratnam f6dfb9f323 Avoid possible NULL pointer dereference
svn path=/trunk/; revision=30851
2009-11-07 08:07:12 +00:00
Anders Broman 88bb44a51e From Jakub Zawadzki:
Cleanup dissector code - use proper memory functions.
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=4164

svn path=/trunk/; revision=30691
2009-10-25 11:43:30 +00:00
Anders Broman 0b0ff6cdcf Get rid of check_col() in some of the more frequently used dissectors.
svn path=/trunk/; revision=29170
2009-07-22 21:33:47 +00:00
Stig Bjørlykke b228488bc0 From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
    for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
    FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero

svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
Jörg Mayer c321f29518 Trivial warning fixes:
- Might be used uninitialized
- not a prototype
- comma at end of enum


svn path=/trunk/; revision=28730
2009-06-15 02:34:53 +00:00
Gerald Combs 93471e8eeb Remove an unused variable.
svn path=/trunk/; revision=28367
2009-05-15 00:07:10 +00:00
Gerald Combs 9a72434b1e Add support for process flow records to IPFIX, which required adding
support for vendor-specific IEs. Fix variable-length record handling. Add
conversation tracking to the UDP dissector and add process flow
information to TCP and UDP conversations.

This lets us run process flow collectors on one or more machines and
have the process username, PID, command name, etc. show up in the TCP
and UDP protocol trees.

svn path=/trunk/; revision=28366
2009-05-14 23:33:17 +00:00
Jeff Morriss f6318061b8 If we can't calculate the UDP checksum (e.g., because the packet is truncated)
make it obvious to the user: add [unchecked, not all data available] to the
tree item (like we do in TCP).

svn path=/trunk/; revision=27351
2009-02-02 15:47:32 +00:00
Jaap Keuter 0c854831fc From Didier Gautheron:
If udp summary is not set dissector doesn't test for udp/udplite in proto_tree_add_item

svn path=/trunk/; revision=27038
2008-12-17 19:27:19 +00:00
Bill Meier aa30dcd129 Minor proto_reg_handoff cleanup: use find_dissector when appropriate.
svn path=/trunk/; revision=26308
2008-09-30 14:49:44 +00:00
Bill Meier 44af6ef887 Fix some of the Errors/warnings detected by checkapi.
svn path=/trunk/; revision=25290
2008-05-14 01:47:41 +00:00
Ulf Lamping ee7e528117 as discussed on SharkFest: switch off checksum checks by default
svn path=/trunk/; revision=24778
2008-04-05 00:15:29 +00:00
Tomas Kukosa 27a531e06a more sophisticated H245 OLC handling focusing on more reliable T.38 establishment
svn path=/trunk/; revision=24043
2008-01-09 13:30:31 +00:00
Sebastien Tandel d580971f07 Update error handling of UDP Light Illegal Checksum value 0
* change expert group from PI_MALFORMED to PI_CHECKSUM (as it should be!!!).
  * set item hf_udp_checksum_[good|bad] as generated


svn path=/trunk/; revision=23599
2007-11-26 14:42:38 +00:00
Sebastien Tandel 6c4f9f0479 iUpdate error handling of UDP Light Illegal Checksum value 0
* Adding PI_MALFORMED expert field for this case.
  * Adding an error string in COL_INFO.


svn path=/trunk/; revision=23598
2007-11-26 14:30:40 +00:00
Stephen Fisher 700d8194b8 - Future improve/clean up the now generic follow stream code
- Add "Follow UDP Stream" feature


svn path=/trunk/; revision=23346
2007-11-03 04:45:35 +00:00
Stig Bjørlykke 727d42fa9b Do not indicate bogus length if inside an icmp.
svn path=/trunk/; revision=23049
2007-10-02 15:46:17 +00:00
Gerald Combs 54df000b3a Extend the bad checksum description to include '(maybe caused by "UDP
checksum offload"?)', similar to the TCP dissector.

Minor whitespace fixups.

svn path=/trunk/; revision=21067
2007-03-19 20:13:01 +00:00
Jörg Mayer 4bc0860be2 Dissect the Cisco proprietary encapsulation of IPSEC/ISAKMP
in TCP (incomplete).
Add preference to select the tcp port (default: 10000)

svn path=/trunk/; revision=20809
2007-02-14 13:22:55 +00:00
Guy Harris 49808356a3 The length of the UDP packet, according to IP, is the reported length,
not the data length (the packet might've been cut short by a snapshot
length).

Fetch the reported length with an accessor.

svn path=/trunk/; revision=20743
2007-02-08 10:26:15 +00:00
Jaap Keuter 352f0eeb68 From Andrej Mikus:
Wireshark complains about bogus udp length when processing last fragment of UDP data.
It compares length field from UDP header with payload size of last fragment.
Attached is my attempt to fix this by referring to tvp->length instead of pinfo->iplen - pinfo->iphdrlen.

Also set some items attribute to generated.

svn path=/trunk/; revision=20722
2007-02-05 21:42:41 +00:00
Ronnie Sahlberg 78042d4e77 replace a rotating buffer for the udp header structure with ep allocated memory
svn path=/trunk/; revision=20682
2007-02-02 08:47:43 +00:00
Guy Harris c5b7476a35 For length errors, add an error item for the expert info, and put a tag
in the summary line.

svn path=/trunk/; revision=20111
2006-12-11 09:55:22 +00:00
Guy Harris ee74b05478 Treat the UDP checksum the same way the TCP checksum is treated - mark
the "checksum bad" and "checksum good" flags as generated fields, add
an expert info item on a checksum error, and put a "checksum incorrect"
indication in the Info column.

Clean up indentation.

svn path=/trunk/; revision=20092
2006-12-10 04:12:35 +00:00
Ulf Lamping 68187697a0 make the checksum fields visible for TCP and UDP
svn path=/trunk/; revision=19727
2006-10-29 13:53:07 +00:00
Jaap Keuter c83da65208 From Stephen Fisher:
Attached is a patch to allow the disabling of the UDP/UDPlite checksum
verification for cards that offload it and report it incorrectly.

svn path=/trunk/; revision=19725
2006-10-29 11:50:30 +00:00
Jaap Keuter 6be339868d Fix length check for IP packets with options.
svn path=/trunk/; revision=19062
2006-08-28 19:15:08 +00:00
Ronnie Sahlberg feab79e328 change a whole bunch of ethereal into wireshark
svn path=/trunk/; revision=18196
2006-05-21 04:49:01 +00:00
Jaap Keuter 6e80585275 Add warning when UDP length field is too large.
Patch by Graeme Hewson

svn path=/trunk/; revision=17023
2006-01-12 22:16:20 +00:00
Anders Broman 2c7bbf1fb1 From Jaap Keuter:
> Two patch files are attached adding UDP-Lite dissection to the UDP 
> dissector. Wiki page is available at the normal location, including 
> sample captures courtesy of Gerrit Renker of the University of 
> Aberdeen Electronics Research Group. The patch has been tested with 
> both the sample captures and Fuzz test.

And add Marc Petit-Huguenin to AUTHORS

svn path=/trunk/; revision=16801
2005-12-14 21:14:57 +00:00
Guy Harris f6ef22c553 Have show_exception() take a "const char *" as its exception message,
and not free the string to which it points.  Pass to
REPORT_DISSECTOR_BUG() strings allocated with ep_strdup_printf(), so
that they're freed automatically.

svn path=/trunk/; revision=16039
2005-09-28 16:16:37 +00:00
Ulf Lamping fdb5b1af02 just to get things straight: a dissector should *never* do any g_assert() calls!
in a simple approach, I've replaced all g_assert() and g_assert_not_reached() calls by their exception throwing counterparts DISSECTOR_ASSERT() and DISSECTOR_ASSERT_NOT_REACHED()

this will replace application crash by showing a dissector bug, which is the desired behaviour

there were some g_assert calls in the protocol registering functions, which might not be acting as expected now, but to be able to simply search for g_assert in the future I've replaced that calls too

one g_assert remained, the one when someone throws an unknown exception "into" packet_frame.c, but IMHO this one should remain.

svn path=/trunk/; revision=14608
2005-06-10 18:28:22 +00:00
Ulf Lamping b575d97309 use [] not () brackets to indicate [correct] UDP checksum, as this is a generated field
svn path=/trunk/; revision=14530
2005-06-02 20:52:13 +00:00
Ronnie Sahlberg fcab322ada Some applications do very naughty things like reusing a port for a different protocol during different stages of an application cycle.
This is very naughty and will cause problems when we have assigned a dissector to a dynamic port using conversation_set_dissector().


To make ethereal handle this case I have changed the try_conversation_dissector() to allow it to fail and return 0,   meaning   yes there is indeed a protocol registered for this conversation but that protocol rejected this packet.
(which only happens for "new" style dissectors, "old" style dissectors will never reject a packet that way)

When this happens  the decode_udp_port() helper will still allow other dissectors to be tried, in the hope that the conversation is now used for some other protocol and thus someone else might be able to decode the packet.


Update SNMP and TFTP dissectors to  check that even if there already is a conversation but that conversation does NOT have snmp/tftp registered as the dissector for it, then create a new conversation anyway and attach the proper dissector.

Since ethereal keeps track of which frame number a conversation started in, this actually works really well.



svn path=/trunk/; revision=14345
2005-05-11 10:40:53 +00:00
Guy Harris 1f02604dcd from Mark Phillips: the length field in the UDP header includes the
length of the UDP header itself, so subtract the length of the header
when using it to limit the length of the payload tvbuff.

Clean up the computing of the captured length of the payload tvbuff (we
really should get rid of the "length" argument to "tvb_new_subset()",
and have it compute the captured length based on the supplied reported
length and the amount of that data actually present in the parent
tvbuff).

Don't fetch the length and checksum fields until we use them (so that we
don't throw an exception until then, and fail to process the source and
destination ports), and check whether the length is bogus regardless of
whether we're building a protocol tree or not.

svn path=/trunk/; revision=12444
2004-10-30 10:04:35 +00:00
Guy Harris eaadcc4c62 Move various tables into the epan directory.
svn path=/trunk/; revision=12130
2004-09-29 00:52:45 +00:00
Guy Harris 6472876ab3 Move the tap infrastructure to the epan directory.
svn path=/trunk/; revision=12128
2004-09-29 00:06:36 +00:00
Guy Harris ac98f225a8 Move various checksum routines and headers to epan.
svn path=/trunk/; revision=12117
2004-09-28 00:06:32 +00:00
Guy Harris bbe7f89742 Move prefs.c and prefs.h into the epan subdirectory.
svn path=/trunk/; revision=12115
2004-09-27 22:55:15 +00:00
Guy Harris 3a583aeb59 From Albert Chin: rename resolv.{ch} to addr_resolv.{ch}, so that an
include of <resolv.h> in any system header file gets the system
<resolv.h> (needed for builds on Tru64 with GTK+ 1.2[.x]).

svn path=/trunk/; revision=11615
2004-08-06 19:57:49 +00:00
Gilbert Ramirez 669db206cb Move dissectors to epan/dissectors directory.
Also move ncp222.py, x11-fields, process-x11-fields.pl,
make-reg-dotc, and make-reg-dotc.py.

Adjust #include lines in files that include packet-*.h
files.

svn path=/trunk/; revision=11410
2004-07-18 18:06:47 +00:00