Commit Graph

29 Commits

Author SHA1 Message Date
Guy Harris 6b629c4d92 Move show_exception() and show_reported_bounds_error() to
epan/show_exception.c, as it's used outside
epan/dissectors/packet-frame.c.  Update their callers to include
<epan/show_exception.h> to get their declaration.

Add a CATCH_NONFATAL_ERRORS macro that catches all exceptions that, if
there's more stuff in the packet to dissect after the dissector call
that threw the exception, doesn't mean you shouldn't go ahead and
dissect that stuff.  Use it in all those cases, including ones where
BoundsError was inappropriately being caught (you want those passed up
to the top level, so that the packet is reported as having been cut
short in the capture process).

Add a CATCH_BOUNDS_ERRORS macro that catches all exceptions that
correspond to running past the end of the data for a tvbuff; use it
rather than explicitly catching those exceptions individually, and
rather than just catching all exceptions (the only place that
DissectorError should be caught, for example, is at the top level, so
dissector bugs show up in the protocol tree).

Don't catch and then immediately rethrow exceptions without doing
anything else; just let the exceptions go up to the final catcher.

Use show_exception() to report non-fatal errors, rather than doing it
yourself.
 
If a dissector is called from Lua, catch all non-fatal errors and use
show_exception() to report them rather than catching only
ReportedBoundsError and adding a proto_malformed item.

Don't catch exceptions when constructing a trailer tvbuff in
packet-ieee8023.c - just construct it after the payload has been
dissected, and let whatever exceptions that throws be handled at the top
level.

Avoid some TRY/CATCH/ENDTRY cases by using checks such as
tvb_bytes_exist() before even looking in the tvbuff.

svn path=/trunk/; revision=47924
2013-02-27 22:43:54 +00:00
Bill Meier c439b805e2 Comment out unused hf[] entries & etc.
(found by checkhf)

svn path=/trunk/; revision=47389
2013-01-31 17:55:31 +00:00
Jeff Morriss 2552c750e5 We always HAVE_CONFIG_H so don't bother checking whether we have it or not.
svn path=/trunk/; revision=45017
2012-09-20 02:03:38 +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
Bill Meier d65261d344 Use ENC_NA as proto_tree_add_item() encoding arg for FT_ETHER hf[] field type.
(Some minor whitespace cleanup).

svn path=/trunk/; revision=39488
2011-10-20 14:07:54 +00:00
Bill Meier 67ee5049d4 Convert 'encoding' parameter of certain proto_tree_add_item() calls in non-autogenerated epan/dissectors:
Specifically:  Replace FALSE|0 and TRUE|1 by ENC_BIG_ENDIAN|ENC_LITTLE_ENDIAN as
  the encoding parameter for proto_tree_add_item() calls which directly reference
  an item in hf[] which has a type of:
     FT_BOOLEAN
     FT_IPv4
     FT_EUI64
     FT_GUID
     FT_UINT_STRING

Also: For type FT_ITv6 use ENC_NA. (This was missed in SVN #39260)

svn path=/trunk/; revision=39328
2011-10-10 00:39:31 +00:00
Bill Meier 4e57694d4a Convert 'encoding' parameter of certain proto_tree_add_item() calls in non-autogenerated epan/dissectors:
Specifically:  Replace FALSE|0 and TRUE|1 by ENC_BIG_ENDIAN|ENC_LITTLE_ENDIAN as
 the encoding parameter for proto_tree_add_item() calls which directly reference
 an item in hf[] which has a type of:
    FT_UINT8
    FT_UINT16
    FT_UINT24
    FT_UINT32
    FT_UINT64
    FT_INT8
    FT_INT16
    FT_INT24
    FT_INT32
    FT_INT64
    FT_FLOAT
    FT_DOUBLE


svn path=/trunk/; revision=39288
2011-10-06 03:35:44 +00:00
Jeff Morriss 33f116a46d Restore pinfo->private_data after an exception was thrown by a subdissector.
This is necessary in case a subdissector had changed it but was unable to
restore it (due to the exception).

Remove check_col().

svn path=/trunk/; revision=34436
2010-10-08 17:48:22 +00:00
Jeff Morriss 0ff5638f37 Replace blurbs that match the name (case insensitive) with NULL.
svn path=/trunk/; revision=34227
2010-09-23 21:46:31 +00:00
Stig Bjørlykke 286aaddb05 Use top level tree when using dissectors from "eth.trailer" heuristics.
svn path=/trunk/; revision=33255
2010-06-19 01:16:29 +00:00
Stig Bjørlykke d298ea10e7 Terminate value_string user_vals.
svn path=/trunk/; revision=31448
2010-01-05 14:46:53 +00:00
Stephen Fisher bf2aae7784 More updates to the ISL dissector:
1) Rollback r14139 in two parts:

    a) Change user priority back to what Cisco's ISL documentation states that
       the values mean instead of the 802.1Q CoS values (see also note below).
    b) Change the destination address back to type FT_ETHER since the
       ISL-Frame values were added to manuf/wka.tmpl in r16741 with a /40
       mask.

2) Add 03-00-0C-00-00/40 to manuf/wka.tmpl for ISL over Token Ring.

3) Move the type and user fields to a tree elow the destination address since
   that is where the values come from. 

NOTE: Regarding change 1a, I noticed in the Wiki's isl-2-dot1q.cap sample
      capture file that bit #2 is being set to 1 when bits 0 and 1 are set to
      1.  When bits 0 and 1 are both set to 0, bit 2 is not set.  I cannot
      find a reference to this bit being used in Cisco's documentation. 


svn path=/trunk/; revision=31446
2010-01-05 10:15:11 +00:00
Stephen Fisher eb3313be94 Minor updates to ISL dissector:
- Bring URLs at top of file up to date.
- Replace redundant true false string (bpdu_tfs) with built-in one (tfs_yes_no)
- Change VLAN ID representations from hex to decimal 
- Change description (but not filter name) for BPDU indicator to indicate that,
  per Cisco documentation, it is set when it is not only a BPDU frame but also
  set for CDP and VTP frames.
- Add "(Color)" to VLAN ID field descriptions for nostalgic reasons :)


svn path=/trunk/; revision=31444
2010-01-05 08:17:09 +00:00
Kovarththanan Rajaratnam 8b515e9340 Switch a bunch of dissectors over to using tvb_new_subset_remaining()
svn path=/trunk/; revision=29446
2009-08-16 12:36:22 +00:00
Kovarththanan Rajaratnam 0a5b014cec Don't guard col_clear with col_check
svn path=/trunk/; revision=29344
2009-08-09 07:36:13 +00:00
Kovarththanan Rajaratnam e971354a54 Don't guard col_set_str (COL_PROTOCOL) with col_check
svn path=/trunk/; revision=29340
2009-08-09 06:26:46 +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
Stig Bjørlykke 9a0020f2f9 From Peter (bug 2942):
Allow optimalization with -ftracer.

svn path=/trunk/; revision=26822
2008-11-22 15:55:01 +00:00
Bill Meier 931cc922a1 Fix some of the Errors/warnings detected by checkapi.
svn path=/trunk/; revision=25305
2008-05-15 01:44:53 +00:00
Sake Blok 4f05930abe Big 2104 - From Benn Bollay:
This patch adds a heuristic dissector to the ethernet trailer under the
keystring "eth.trailer".  This allows for other protocol plugins which coopt
the ethernet trailer for their own devices to register for trailer traffic
without requiring any further changes to the executable.


svn path=/trunk/; revision=23880
2007-12-16 00:35:34 +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
Guy Harris b7b80d94be Move a pile of protocol-related headers from the top-level source
directory to the epan directory.  Some of them should perhaps ultimately
be moved to epan/dissectors, if they pertain only to stuff exported by a
particular dissector.

Fix Gerald's e-mail address in files we're moving.

svn path=/trunk/; revision=15844
2005-09-17 00:02:31 +00:00
Gerald Combs 923446f1f5 From Steve Grubb: Initialize some variables. Fixes part of bug 217.
svn path=/trunk/; revision=14497
2005-05-30 21:00:05 +00:00
Gerald Combs f907a1085b Add a tvb_ensure_bytes_exist(). Fixes bug 68 and its many duplicates.
svn path=/trunk/; revision=14158
2005-04-21 15:11:38 +00:00
Gerald Combs a78465a839 From Peter Johansson:
My patch changes the decoding of the Destination address to conform with the
spec found at http://www.cisco.com/univercd/cc/td/doc/product/lan/trsrb/frames.htm#xtocid75
and adds decoding of user field values 4-7 while updating the description of
user field values 0-3 according to IEEE 802.1D-2004, annex G.


svn path=/trunk/; revision=14139
2005-04-19 20:53:42 +00:00
Ulf Lamping 1c9781b4ec throw the new FieldError exception, if a dissector tries to add a field with invalid parameters
add a message parameter to the show_exception function

svn path=/trunk/; revision=13074
2005-01-16 16:06:15 +00:00
Guy Harris 7c3027c5e9 Export two versions of the Ethereal dissector, for use with encapsulated
Ethernet frames, one for encapsulated frames that include an FCS and one
for encapsulated frames that don't include an FCS.  Use the appropriate
versions.

In the ISL dissector, do the same sort of processing we do in the
Ethernet dissector to figure out whether the frame has a trailer or not
and whether it has an FCS or not.

svn path=/trunk/; revision=12593
2004-11-24 09:13:52 +00:00
Guy Harris 2a12cdec29 Add a new URL for ISL information.
svn path=/trunk/; revision=12483
2004-11-03 20:18:30 +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