Commit Graph

48 Commits

Author SHA1 Message Date
Guy Harris ef76d65fc6 Fix checks for "do we have an ERSPAN header?"
For a GRE protocol type of 0x008E, check the "sequence number present"
bit in the GRE header, if it's available, to see if the packet has an
ERSPAN header or not, rather than checking the entire header to see if
it's zero.  (If the GRE header isn't available, assume no ERSPAN
header.)

For a GRE protocol type of 0x22EB, always treat the packet as having an
ERSPAN header.

That matches more closely what the most recent I-D for ERSPAN said.

Bug: 16089
Change-Id: I21119411e8485854fca85fa701b994bfa4e73941
Reviewed-on: https://code.wireshark.org/review/34664
Petri-Dish: Guy Harris <guy@alum.mit.edu>
Tested-by: Petri Dish Buildbot
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2019-10-01 00:38:21 +00:00
Guy Harris 486c6fd07c Fix interpretation of BSO field in Type III headers.
Use a correct right value_string table.

Change-Id: I75ca54dc040b123a460d67fc1b6d49d9e062a49e
Reviewed-on: https://code.wireshark.org/review/34651
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2019-09-29 23:24:46 +00:00
Guy Harris 3367cbab17 Improve the handling of the FT (Frame Type) field in Type III headers.
Show the value symbolically, and don't dissect the payload as an
Ethernet packet if the value isn't 0, meaning "Ethernet".

This gets rid of the mis-dissection of the payload in the capture
atttached to bug 16089, although it doesn't dissect it any further, as
we don't know how to dissect it.

Change-Id: I97fce0f7a4f4336339bc90271aa7b19c97831abe
Ping-Bug: 16089
Reviewed-on: https://code.wireshark.org/review/34649
Petri-Dish: Guy Harris <guy@alum.mit.edu>
Tested-by: Petri Dish Buildbot
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2019-09-29 23:13:01 +00:00
Guy Harris 20800366dd HTTPS (almost) everywhere.
Change all wireshark.org URLs to use https.

Fix some broken links while we're at it.

Change-Id: I161bf8eeca43b8027605acea666032da86f5ea1c
Reviewed-on: https://code.wireshark.org/review/34089
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2019-07-26 18:44:40 +00:00
Guy Harris 1ea82e4ff7 Don't crash for ERSPAN packets in Linux cooked captures.
Sadly, "cooked" means the GRE header isn't available; the extra data
pointer is null, so we can't dereference it.

Bug: 14548
Change-Id: I51ae67dcc144b7f5ab3c82dd9adf09b342b29ced
Reviewed-on: https://code.wireshark.org/review/26595
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-03-22 21:16:40 +00:00
Joerg Mayer b446ab2b69 ERSPAN: Remove redundant version check
Change-Id: I6f7601983c8bda52d6687a7e1f02e8611f468df3
Reviewed-on: https://code.wireshark.org/review/26531
Reviewed-by: Jörg Mayer <jmayer@loplof.de>
2018-03-18 11:12:35 +00:00
Joerg Mayer aeca321f36 ERSPAN: Various small cleanups and enhancements
Pass Type I vs. II/III via dissector data instead of pinfo
Append type to protocol name
Put vlan number into pinfo when appropriate
Put version 1 and version 2 dissection into separate blocks
Rename priority into cos (as per draft-rfc)
Add new subheader from draft-3

Change-Id: I6eb7fe7073a6cc92e2028b0491de5e0f3f036b4e
Reviewed-on: https://code.wireshark.org/review/26512
Petri-Dish: Jörg Mayer <jmayer@loplof.de>
Tested-by: Petri Dish Buildbot
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Jörg Mayer <jmayer@loplof.de>
2018-03-18 10:14:03 +00:00
Dario Lombardo fe219637a6 dissectors: use SPDX identifiers.
Change-Id: I92c94448e6641716d03158a5f332c8b53709423a
Reviewed-on: https://code.wireshark.org/review/25756
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-02-12 16:49:58 +00:00
Joerg Mayer fb2fa4d776 Get rid of the necessity to use a preference to dissect ERSPAN type I packets.
Change-Id: I52c4c1fa5601bc66396f397ad23a9e53285a5926
Reviewed-on: https://code.wireshark.org/review/25463
Reviewed-by: Jörg Mayer <jmayer@loplof.de>
2018-01-25 21:33:47 +00:00
Alexis La Goutte 5472190316 cisco-erspan: fix no newline at end of file [-Wnewline-eof]
Change-Id: I155a2293d48a62bd198aa20f0fb68f76934cdb6a
Reviewed-on: https://code.wireshark.org/review/18031
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-10-03 04:58:08 +00:00
William Tu 147cac3af7 ERSPAN: support platform specific sub-header.
The patch adds support for parsing the 4 types of ERSPAN III platform
specific sub-header, if presented.

Change-Id: I1719fceb71ed40918e6b16f25a6355d78840f6c6
Signed-off-by: William Tu <u9012063@gmail.com>
Reviewed-on: https://code.wireshark.org/review/16702
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-07-27 03:46:13 +00:00
William Tu 03bc58d072 ERSPAN: add link to protocol spec and refactoring.
Add link to ERSPAN protocol spec, remove obsolete comments, and
remove unnecessary 'if(tree)' check.

Change-Id: I1b4950777c84d62301c322afdfc876949db0d4ed
Signed-off-by: William Tu <u9012063@gmail.com>
Reviewed-on: https://code.wireshark.org/review/16675
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>
2016-07-26 06:02:56 +00:00
William Tu e3a15cfbb2 Fix ERSPAN type II and type III offset.
For ERSPAN type II (version == 1), the offset is shifted by 4 at the
end. As a result, the 'offset+=2' at the end of ERSPAN type III should
be in its own 'else' scope.

Change-Id: I64a55d5722e3f4f5672ca2a4228583b3b51559e1
Reviewed-on: https://code.wireshark.org/review/16568
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Jaap Keuter <jaap.keuter@xs4all.nl>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-07-22 04:11:28 +00:00
William Tu 67457e9266 Add ERSPAN II support for field EN and Index.
Current ERSPAN II dissector does not support parsing EN field and Index.
The patch follows the field description in draft:
https://tools.ietf.org/html/draft-foschiano-erspan-01

Change-Id: I92ce56264be0fb2560c4d1a5da35738cf45a8c96
Reviewed-on: https://code.wireshark.org/review/16400
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>
2016-07-14 07:14:21 +00:00
Michael Mann 9bcac48403 Manually add protocol dependencies derived from find_dissector.
Started by grepping call_dissector_with_data, call_dissector_only and call_dissector and traced the handles passed into them to a find_dissector within the dissector.  Then replaced find_dissector with find_dissector_add_dependency and added the protocol id from the dissector.
"data" dissector was not considered to be a dependency.

Change-Id: I15d0d77301306587ef8e7af5876e74231816890d
Reviewed-on: https://code.wireshark.org/review/14509
Petri-Dish: Michael Mann <mmann78@netscape.net>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-03-20 12:48:48 +00:00
Michael Mann 443a7ed259 new_create_dissector_handle -> create_dissector_handle for dissector directory.
Some of the ASN.1 dissectors still generate a new_create_dissector_handle from the tool itself, so leave those for now.

Change-Id: Ic6e5803b1444d7ac24070949f5fd557909a5641f
Reviewed-on: https://code.wireshark.org/review/12484
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-12-09 12:37:36 +00:00
Peter Membrey a2a6b6c06a Enhance ERSPAN decoder to correctly support ERSPAN3 (current version
mangles packets)

Change-Id: I3dce1a4c5f14e2fc11c3f97e216df1f68340fba4
Reviewed-on: https://code.wireshark.org/review/11957
Petri-Dish: Anders Broman <a.broman58@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-11-20 12:35:31 +00:00
Michael Mann bbdd89b973 create_dissector_handle -> new_create_dissector_handle
Picking off "easy" dissectors that only have one or two exit points at most.

Change-Id: Ie514f126352e7598acc4f7c38db9c61d105d5e48
Reviewed-on: https://code.wireshark.org/review/11850
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-11-16 03:50:05 +00:00
Gerald Combs 3f765b3ef9 Add a CF_FUNC macro for casting BASE_CUSTOM functions.
Add a CF_FUNC macro to match VALS, TFS, etc. This should help us to avoid
the following warning:

    warning: ISO C forbids initialization between function pointer and 'void *' [-Wpedantic]

We could start adding DIAG_OFF+DIAG_ON everywhere but this seems to be
more consistent with the other macros in proto.h. Update each instance
of BASE_CUSTOM to use CF_FUNC.

Adjust a dummy variable name generated by asn2wrs.py that was triggering
an invalid error in checkhf.pl.

Fix an encoding arguement in packet-elasticsearch.c found by
fix-encoding-args.pl.

Change-Id: Id0e75076c2d71736639d486f47b87bab84e07d22
Reviewed-on: https://code.wireshark.org/review/7150
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-02-18 00:05:38 +00:00
Michael Mann 155fc8f16a Move #defines of epan/greproto.h to packet-gre.h
Change-Id: I5de4c34e2acafbe47a8ca3f07040a774e72d0d3e
Reviewed-on: https://code.wireshark.org/review/6787
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-01-26 01:01:18 +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
Bill Meier 9b181b97c6 Add editor modelines; Adjust whitespace; Remove boilerplate comments
Change-Id: I1f5f83ed441f6009125cf2cbe5023af04986898a
Reviewed-on: https://code.wireshark.org/review/4392
Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-09-30 21:06:37 +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
Jakub Zawadzki c45475ab45 Fix [-Wmissing-prototypes]
svn path=/trunk/; revision=54135
2013-12-15 23:44:12 +00:00
Michael Mann 7e8e5b347e Batch of filterable expert_infos.
svn path=/trunk/; revision=49581
2013-05-25 17:06:40 +00:00
Chris Maynard f9bc424a05 Fix Coverity CID 280362: Logically dead code.
#BACKPORT (1.8, 1.6)

svn path=/trunk/; revision=47965
2013-03-01 05:29:12 +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
Pascal Quantin 765c81a932 Revert r44441: pinfo may be NULL only when pi is not NULL
svn path=/trunk/; revision=44445
2012-08-11 17:57:18 +00:00
Jörg Mayer f0486d582a After commit r44435: pinfo -> NULL
svn path=/trunk/; revision=44441
2012-08-11 07:10:40 +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
Gerald Combs 18cbe2f0e0 Fix spelling.
svn path=/trunk/; revision=39721
2011-11-02 20:43:10 +00:00
Alexis La Goutte 695249537e From me via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6462 & 6505
Wireshark unable to parse ERSPAN from HP Comware platforms
Huawei GRE ERSPAN is not decoded properly 

Add a pref to FORCE to decode directly Ethernet frame in GRE (with no ERSPAN Header)

svn path=/trunk/; revision=39687
2011-10-31 13:45:21 +00:00
Bill Meier 794757ae8f For proto_tree_add_item(..., proto_xxx, ...)use ENC_NA as the encoding arg.
Also: remove trailing whitespace for a number of files.

svn path=/trunk/; revision=39503
2011-10-21 02:10:19 +00:00
Bill Meier 94f36ca4ff Use ENC_NA as encoding for proto_tree_add_item() calls which directly reference an hf item (in hf[] with types:
FT_NONE
   FT_BYTES
   FT_IPV6
   FT_IPXNET
   FT_OID

Note: Encoding field set to ENC_NA only if the field was previously TRUE|FALSE|ENC_LITTLE_ENDIAN|ENC_BIG_ENDIAN

svn path=/trunk/; revision=39260
2011-10-04 22:44:31 +00:00
Jörg Mayer 18735eaba5 Replace TRUE/FALSE with the new ENCAP stuff where appropriate
svn path=/trunk/; revision=38746
2011-08-26 17:02:33 +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
Jörg Mayer c749fe000c Comparing type II and III traces of the same packet
indicate that the last 4 bytes of both types are similar.
So the extra bytes in type III are inserted before those
last bytes.

svn path=/trunk/; revision=34238
2010-09-24 18:12:45 +00:00
Jörg Mayer 72c3e35672 - trunkated -> truncated
- Print "Type II" and "Type III" as versionstrings.
- Make sure that version = 1 or 2

svn path=/trunk/; revision=34222
2010-09-23 20:44:11 +00:00
Jörg Mayer 320de7eb14 Jason Masker:
- Add decoding of direction bit for version 2 (type III) erspan.

Me:
- Decode the original direction bit as unknown in case of version 2.
- The original unknown3 value seems to indicate whether the packet
  was too long to fit into a single mtu (trunkated).
- "Timestamp(s)" -> "Timestamp"


svn path=/trunk/; revision=34221
2010-09-23 19:42:20 +00:00
Jörg Mayer 527f5d5653 Jason Masker <jason at masker.net>:
Updates for the Cisco ERSPAN type III (version 2) protocol.

svn path=/trunk/; revision=34209
2010-09-23 13:31:28 +00:00
Anders Broman 440c3f9261 From Didier Gautheron:
check_col.diff
Remove redundant calls to check_col() if it guards only one columns function with one parameter after the column type.
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=4394

svn path=/trunk/; revision=31519
2010-01-13 20:32:01 +00:00
Anders Broman 4d2e653901 From Didier Gautheron:
Dissectors using call_dissector() function inside a 'if (tree) {}' block.
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=4107

svn path=/trunk/; revision=30415
2009-10-09 07:24:33 +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
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
Guy Harris cc793a8230 Get rid of non-ASCII characters.
svn path=/trunk/; revision=24170
2008-01-23 20:12:23 +00:00
Stig Bjørlykke f8f58fceaa From Munenori Ohuchi:
1. Priority field decode.
   The 802.1q tag field of a frame is separated from its frame body in 
   a ERSPAN packet. 
   Current packet-cisco-erspan.c decodes only the vlan id field of the 
   802.1q tag.
   This patch can also decode the priority field of the 802.1q tag.

2. Direction of a captured frame decode.
   A ERSPAN packet includes the additional information of the direction
   a captured frame as below.

   If a caputred frame comes from outside to a switch port, this means an
   'Incoming' frame.  If a caputred frame goes out of a switch port, 
   this is an 'Outgoing' frame.


Added an extra unknown value for the bit between direction and spanid.

svn path=/trunk/; revision=22649
2007-08-25 00:29:40 +00:00
Sebastien Tandel 454e23c936 typo fix
svn path=/trunk/; revision=21428
2007-04-14 07:55:43 +00:00
Jörg Mayer 8f3934e243 Beginnings of a Cisco ERSPAN dissector - the only thing missing is the code
to actually call this (aka to handle the ambiguities of DLT values).

svn path=/trunk/; revision=21427
2007-04-14 01:07:36 +00:00