Commit Graph

113 Commits

Author SHA1 Message Date
Cody Doucette 6ac0d846ec nwp: add support for NWP packets
Neighborhood Watch Protocol (NWP) is an XIA protocol for resolving network
addresses to link-layer addresses. Hosts on a LAN send NWP Announcement
packets with their host identifiers (HIDs), and neighbors in the LAN respond
with NWP Neighbor List packets containing their HIDs and associated link-layer
addresses.

Bug: 11492
Change-Id: Ib1e801474b1aa72f5dd3d8303eeec36b96ee0a99
Reviewed-on: https://code.wireshark.org/review/10316
Reviewed-by: Michael Mann <mmann78@netscape.net>
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-09-30 04:48:31 +00:00
João Valverde bc4bc72bd3 Detect mismatched ethertype protocol ID (IPv4) and encapsulated IP packet (IPv6)
Bug: 11458
Change-Id: I66b51654d268196da366b0e9aea6ced0076d4737
Reviewed-on: https://code.wireshark.org/review/10407
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2015-09-08 15:38:55 +00:00
Cody Doucette b820d749bf xip: add support for XIP packets
The eXpressive Internet Protocol (XIP) is the network layer
protocol for the eXpressive Internet Architecture (XIA), a
future Internet architecture project. The addresses in XIP are
directed acyclic graphs, so much of the code included in this
addition verifies the correctness of the DAGs and displays them
in human-readable form.

Bug: 11265
Change-Id: I948aaa73b927f8afc162d89689d184c5657f60b1
Reviewed-on: https://code.wireshark.org/review/8881
Reviewed-by: Evan Huus <eapache@gmail.com>
Petri-Dish: Evan Huus <eapache@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-07-10 02:55:24 +00:00
Michael Mann cf8eed97cb Dissect 802.3 Jumbo frames while capturing.
Following the code Olivier Montanuy's code suggestion from bug 5390.

Bug: 5390
Change-Id: Ie7425a76fd65fc9d50474c010b4a5beb1b3cf73e
Reviewed-on: https://code.wireshark.org/review/7588
Reviewed-by: Evan Huus <eapache@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-06-24 22:33:17 +00:00
Evan Huus 6fd7e5ba33 Remove more deprecated tvb_length calls
Change-Id: I56260a82b19001ab2f87f4be34a9510f127f841f
Reviewed-on: https://code.wireshark.org/review/9050
Reviewed-by: Evan Huus <eapache@gmail.com>
2015-06-23 03:54:13 +00:00
Michael Mann 344c990159 Improve VN-Tag dissector.
Bug: 7496
Change-Id: Ic1648f1c111913b7370b2eaf5557c4d8ea078033
Reviewed-on: https://code.wireshark.org/review/8546
Reviewed-by: Michael Mann <mmann78@netscape.net>
Petri-Dish: Michael Mann <mmann78@netscape.net>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-05-20 14:57:51 +00:00
Bill Meier b5d7b7ab6e Cleanup use of #includes in non-generated epan/dissector/*.c
Specifically:
- Set packet.h to be the first wireshark #include after
   config.h and "system" #includes.
   packet.h added as an #include in some cases when missing.
- Remove some #includes included (directly/indirectly) in
   packet.h. E.g., glib.h.
   (Done only for those files including packet.h).
- As needed, move "system" #includes to be after config.h and
   before wireshark #includes.
- Rework various #include file specifications for consistency.
- Misc.

Change-Id: Ifaa1a14b50b69fbad38ea4838a49dfe595c54c95
Reviewed-on: https://code.wireshark.org/review/5923
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-12-21 05:46:22 +00:00
Pascal Quantin 80d44af6b2 dissector_try_uint(_new) and dissector_try_string now return the number of bytes consumed
Change-Id: I528ad736caee1f29e2f0abfc0afcca6587d74eca
Reviewed-on: https://code.wireshark.org/review/5743
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-12-13 16:36:13 +00:00
Michael Mann a2c2f872f4 Remove the use of pinfo->private_data from dissectors that just save it to restore it.
Change-Id: I13197cc48068bb35ee12a7023cfe5f76bbc4e264
Reviewed-on: https://code.wireshark.org/review/5486
Petri-Dish: Michael Mann <mmann78@netscape.net>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-11-26 16:20:59 +00:00
Bill Meier ebfe8f6d28 Add editor modelines; Reformat as appropriate.
Change-Id: I8e9c58b75eea85877d22024201e5d8d0e9a3dbfd
Reviewed-on: https://code.wireshark.org/review/4459
Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-10-04 15:34:02 +00:00
Michael Mann 14824e6adf Revert "Fixup: tvb_* -> tvb_captured"
https://www.wireshark.org/lists/wireshark-dev/201406/msg00131.html

This reverts commit 246fe2ca4c.

Change-Id: Ib24bae0198c13a84bd7f731bf4af921212109a8f
Reviewed-on: https://code.wireshark.org/review/2430
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-06-19 18:25:59 +00:00
Dario Lombardo 246fe2ca4c Fixup: tvb_* -> tvb_captured
Change-Id: I9209c1271967405c34c1b6fa43e1726a4d3a5a3f
Reviewed-on: https://code.wireshark.org/review/2377
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-06-18 14:14:58 +00:00
Alexis La Goutte 296591399f Remove all $Id$ from top of file
(Using sed : sed -i '/^ \* \$Id\$/,+1 d')

Fix manually some typo (in export_object_dicom.c and crc16-plain.c)

Change-Id: I4c1ae68d1c4afeace8cb195b53c715cf9e1227a8
Reviewed-on: https://code.wireshark.org/review/497
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-03-04 14:27:33 +00:00
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