Commit graph

100 commits

Author SHA1 Message Date
Chris Maynard
7d10a416a3 Reject the packet if data is NULL.
svn path=/trunk/; revision=53835
2013-12-07 23:27:36 +00:00
Michael Mann
9b7fb8a811 Create the ability to have packet scoped "proto" data. Bug 9470 (https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9470)
I'm not sold on the name or module the proto_data functions live in, but I believe the function arguments are solid and gives us the most flexibility for the future.  And search/replace of a function name is easy enough to do.

The big driving force for getting this in sooner rather than later is the saved memory on ethernet packets (and IP packets soon), that used to have file_scope() proto data when all it needed was packet_scope() data (technically packet_info->pool scoped), strictly for Decode As.

All dissectors that use p_add_proto_data() only for Decode As functionality have been converted to using packet_scope().  All other dissectors were converted to using file_scope() which was the original scope for "proto" data.

svn path=/trunk/; revision=53520
2013-11-23 02:20:13 +00:00
Guy Harris
63c8b20360 Widen the Ethertype to a guint, to avoid compiler warnings.
Fix indentation while we're at it.

svn path=/trunk/; revision=53493
2013-11-21 20:50:13 +00:00
Michael Mann
eabaddaca9 Remove ethertype, mpls_label and ppids from packet_info structure.
The information was converted to "proto" data within their respective dissectors strictly for use in "Decode As".

svn path=/trunk/; revision=53489
2013-11-21 20:08:20 +00:00
Michael Mann
76ab93ea94 Provide "Decode As" functionality through dissectors themselves instead of the GUI. Bug 9450 (https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9450)
The basic idea behind this design is to have dissectors register with a "decode as list" with their name and dissector table.  When "Decode As" dialog is launched, any "registered" dissector found in the packet will cause a tab to be created in the dialog.

This patch includes just the dissector portion of the functionality (minus packet-dcerpc.[ch] because it has hooks to the current GUI)

svn path=/trunk/; revision=53445
2013-11-20 19:17:08 +00:00
Michael Mann
f34e11fabe Convert ethertype() function into a pure dissector. Bug 9454 (https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9454)
The main driving force for this was my new Decode As functionality (https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9450) that wants a dissector/subdissector table relationship for all dissectors wanting to use Decode As functionality.  The ethertype() function provides the value to the "ethertype" subdissector table, so I think it should be matched to a dissector.  Only odd side effect is the display filter of "ethertype" returns no packets because there is no "item" associated with the dissector.


svn path=/trunk/; revision=53443
2013-11-20 02:28:14 +00:00
Jakub Zawadzki
ae59b09443 Add missing includes in order to remove exceptions.h from proto.h (next commit).
svn path=/trunk/; revision=53230
2013-11-10 15:59:37 +00:00
Chris Maynard
3616fa1549 Remove if (fh_tree) checks as add_ethernet_trailer() calls such functions as dissector_try_heuristic(), expert_add_info(), and col_append_str(), which all need to be called whether fh_tree is NULL or not.
#BACKPORT(1.10,1.8)

svn path=/trunk/; revision=52738
2013-10-21 17:31:22 +00:00
Jörg Mayer
1318ec2c5e Beginnings of Motrola's MiNT protocol.
Most important missing item: Fill in the test functions
to avoid using all packets to the (fixed) ports.

svn path=/trunk/; revision=52669
2013-10-18 13:09:22 +00:00
Jeff Morriss
a018f63bca From Vaibhav Katkade via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9011 :
Add support for the Cisco MetaData (0x8909) ethertype.

From me:

Don't try to register the "eth.type" abbreviation; use "cmd.type" instead.
Add SVN id.
Clean up trailing white space and fix up some indentation.
Don't declare a variable static that need not be.

svn path=/trunk/; revision=51198
2013-08-07 22:52:43 +00:00
Evan Huus
37600a157b Rename value string (and similar) functions to use a consistent pattern. This
was done using textual search+replace, not anything syntax-aware, so presumably
it got most comments as well (except where there were typos).

Use a consistent coding style, and make proper use of the WS_DLL_* defines.

Group the functions appropriately in the header.

I ended up getting rid of most of the explanatory comments since many of them
duplicated what was in the value_string.c file (and were out of sync with the
recent updates I made to those in r48633). Presumably most of the comments
should be in the .h file not the .c file, but there's enough churn ahead that
it's not worth fixing yet.

Part of https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8467

svn path=/trunk/; revision=48634
2013-03-29 00:26:23 +00:00
Anders Broman
2e52e2ac99 [-Wmissing-prototypes]
Use explicit casts.

svn path=/trunk/; revision=48347
2013-03-17 09:11:21 +00:00
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
Jörg Mayer
b5efdcf02c Add Ethertype for Network Controller Sideband Interface
svn path=/trunk/; revision=47691
2013-02-16 10:31:20 +00:00
Anders Broman
01432aaf5c Add Media Independent Handover Protocol ethertype
svn path=/trunk/; revision=46801
2012-12-27 11:19:46 +00:00
Anders Broman
fa3cca29dd Add ETHERTYPE_ATMOE
svn path=/trunk/; revision=45951
2012-11-06 19:56:37 +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
Guy Harris
931a1077ea From Richard Stearn: add support for BPQ (AX.25 on Ethernet).
svn path=/trunk/; revision=44232
2012-08-02 23:55:42 +00:00
Jaap Keuter
c4702a40ef Add some relevant ethertypes.
svn path=/trunk/; revision=43850
2012-07-20 06:26:35 +00:00
Bill Meier
f0c3ee5c4a Whitespace cleanup: Indentation, trailing, ...
svn path=/trunk/; revision=42266
2012-04-26 16:05:05 +00:00
Alexis La Goutte
b17be73489 From Martin Renold via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5730
Dissector for HSR and PRP-1

Here is a patch that adds a dissector for HSR and for PRP-1. Both protocols are defined in IEC62439 Part 3. (High-availability Seamless Redundancy / Parallel Redundancy Protocol)

The existing PRP dissector has been refactored to support both the old PRP (now called PRP-0) and the new PRP-1.

There are three distinct dissectors:
- HSR (ethertype 892F)
- HSR/PRP supervision (ethertype 88FB)
- PRP-0 and PRP-1 (trailer dissector; disabled by default)

From me :
* Fix Clang Warning
* Add modification for CMakeLists.txt

svn path=/trunk/; revision=39692
2011-10-31 18:37:58 +00:00
Anders Broman
d150a694cb Remove code commited by misstake.
svn path=/trunk/; revision=39101
2011-09-23 11:22:48 +00:00
Anders Broman
7c0741ad15 Revert Revision 34838 "Resolve bug #2254: Migrate the 802.1q VLAN dissector into the Ethernet II."
as this causes a lot of problems.
See 
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5680
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6305
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6366

Original bug:
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=2254

svn path=/trunk/; revision=39100
2011-09-23 11:01:13 +00:00
Anders Broman
0beb8db2a3 Add ethertype #8903
svn path=/trunk/; revision=38912
2011-09-07 08:26:36 +00:00
Jaap Keuter
f1bb0e1735 From Dejan Bucar:
Added support new multicore header in the LINX Ethernet protocol.
Added linx/tcp.

svn path=/trunk/; revision=37777
2011-06-23 21:52:58 +00:00
Anders Broman
570ffe5f7d From Florian Fainelli:
Patch adding the Homeplug AV ethertype.
Part of https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5943

svn path=/trunk/; revision=37388
2011-05-25 05:33:00 +00:00
Jeff Morriss
cf485a2ea1 From Johannes Jochen via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5900 :
I have created a dissector for the Multiple MAC Registration Protocol based on
the exiting dissector of the Multiple Stream Reservation Protocol (bugzilla id:
4757 ) You can found the documentation of the Protocol here:
http://standards.ieee.org/getieee802/download/802.1ak-2007.pdf It's also
includes the corrections of the protocol you will found here:
http://standards.ieee.org/getieee802/download/802.1Q-2005_Cor1-2008.pdf

svn path=/trunk/; revision=37104
2011-05-12 21:37:55 +00:00
Anders Broman
cd8af5a050 Add RoHC to the ethertypes.
svn path=/trunk/; revision=36499
2011-04-06 18:48:07 +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
Anders Broman
96659d0252 From Jouni Malinen:
Add support for dissecting TDLS (IEEE 802.11z) frames.
These are mostly used as Action frames that are encapsulated in Data frames (to go through any AP).
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5493

svn path=/trunk/; revision=35208
2010-12-16 21:49:55 +00:00
Stephen Fisher
b18e8fd1ca Resolve bug #2254: Migrate the 802.1q VLAN dissector into the Ethernet II.
svn path=/trunk/; revision=34838
2010-11-10 22:37:30 +00:00
Jaap Keuter
9a1a03eca9 From Daniel Ginsburg:
draft-ietf-isis-ext-eth specifies an extension to current Ethernet Frame
specifications for hardware and frame format to support payloads greater than
1500 Bytes for Type interpretation and Length interpretation frames.

The extension introduced by draft-ietf-isis-ext-eth is currently used by Cisco
Systems' IS-IS routing protocol implementation when running IS-IS over Ethernet
links with large MTU.

svn path=/trunk/; revision=34748
2010-11-02 07:54:24 +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
Stig Bjørlykke
df7f6aa8ff From Lukasz Kotasa via bug 5248:
Added ETHERTYPE_WAI.

svn path=/trunk/; revision=34180
2010-09-22 13:14:46 +00:00
Anders Broman
dff27826ec From Slava:
Infiniband RoCE dissection.
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5060

svn path=/trunk/; revision=33702
2010-08-03 16:57:02 +00:00
Bill Meier
d7b4bbc98a From Haakon Nessjoen: New dissector for Digiums TDMoE protocol
From me: A few minor changes:
- col-clear() not req'd;
- Use 'gint32 length' rather than 'guint8 length';
- Use ENC_NA instead of FALSE/TRUE in two cases;
- Move global tdmoe_handle to be local to proto_reg_handoff...

svn path=/trunk/; revision=33307
2010-06-23 20:08:11 +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
Anders Broman
cd4cfa05ac Add the Gigamon ethertype.
svn path=/trunk/; revision=33250
2010-06-18 04:18:08 +00:00
Anders Broman
a11836dc8b Move VLAN and ARP closer to the top.
svn path=/trunk/; revision=32927
2010-05-24 04:09:03 +00:00
Bill Meier
1f1a38f961 From Torrey Atcitty: IEEE 1722(AVB Transport Protocol) Dissector
See Bug #4764 (https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=4764)

svn path=/trunk/; revision=32841
2010-05-17 04:08:08 +00:00
Bill Meier
7a0a969036 From Torrey Atcitty: IEEE 802.1Qat (Multiple Stream Reservation Protocol) dissector
See: Bug #4757: https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=4757

svn path=/trunk/; revision=32816
2010-05-14 22:55:55 +00:00
Anders Broman
57229a36fa From David Aggeler:
Added 0x88DE to etypes.h
Added ETHERTYPE_VMLAB 
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=4186

svn path=/trunk/; revision=32378
2010-04-05 09:21:48 +00:00
Stephen Fisher
af48a878d4 Reformat value_string, its comments and whitespace.
svn path=/trunk/; revision=31415
2010-01-03 10:05:50 +00:00
Jaap Keuter
585e448083 From Juha Siltanen :
This is a patch for a new dissector that decodes Nokia Siemens Networks'
proprietary Flow Layer Internal Protocol (Ethertype 0x8901).

svn path=/trunk/; revision=31069
2009-11-24 23:11:11 +00:00
Anders Broman
57ec611fa1 From dragonlinux:
Add QNX OS VER 6's qnet ethernet protocol number.
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=3934

svn path=/trunk/; revision=29558
2009-08-26 05:10:12 +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
Anders Broman
298feb719f From Joakim Wiberg:
Device Level Ring protocol addition.
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=3685

With some minor changes (blurb NULL whem text equal).

svn path=/trunk/; revision=29044
2009-07-09 20:44:28 +00:00
Guy Harris
9ed2e2b4fb The only callers of ethertype() should be dissectors for protocols with
Ethernet-type trailers; no callers are left that don't at least purport
to care about them.

svn path=/trunk/; revision=28284
2009-05-05 21:05:06 +00:00
Anders Broman
a02bbff000 Add XiMeta Technology's ethertype.
(https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=3392)

svn path=/trunk/; revision=28040
2009-04-13 18:32:24 +00:00
Jaap Keuter
66d54fa2ce From Benjamin Roch:
This contains the source for dissecting TTEthernet packets (including Protocol Control Frames) conforming to our TTEthernet specification as dissector for Wireshark.

svn path=/trunk/; revision=26955
2008-12-10 07:00:26 +00:00