Commit Graph

282 Commits

Author SHA1 Message Date
Michael Mann ad6fc87d64 Add proto_tree_add_checksum.
This is an attempt to standardize display/handling of checksum fields for all dissectors.
The main target is for dissectors that do validation, but dissectors that just report the
checksum were also included just to make them easier to find in the future.

Bug: 10620
Bug: 12058
Ping-Bug: 8859
Change-Id: Ia8abd86e42eaf8ed50de6b173409e914b17993bf
Reviewed-on: https://code.wireshark.org/review/16380
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Jeff Morriss <jeff.morriss.ws@gmail.com>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-07-21 12:35:22 +00:00
João Valverde e07b4aa667 IPv6: Add option type encodings
Change-Id: I9c8811dd30fed59591edb84166d2c854fd5b1885
Reviewed-on: https://code.wireshark.org/review/16553
Reviewed-by: João Valverde <j@v6e.pt>
2016-07-20 18:12:28 +00:00
João Valverde 31f5e81449 IPv6: Mark ENDI option as deprecated (do not ignore)
As requested by Alexis.

Change-Id: I33e91aa0234e7c07869d69b5da6d0df8f94254ba
Reviewed-on: https://code.wireshark.org/review/16559
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2016-07-20 13:07:00 +00:00
João Valverde f7e078cca6 IPv6: Fix LIO option dissection
It was passing the wrong offset for an FT_UINT_STRING type.

Change-Id: I739eb5bbf86768f6bf953662d407270cc8e27f2b
Reviewed-on: https://code.wireshark.org/review/16547
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: João Valverde <j@v6e.pt>
2016-07-20 08:29:30 +00:00
João Valverde 91ceccb19e IPv6: Mark ENDI option as deprecated (ignore)
In accordance with the IANA registry. This option was never used.

Change-Id: I2fc16579b084a0d537f16b9104b025d97a0afd8d
Reviewed-on: https://code.wireshark.org/review/16552
Reviewed-by: João Valverde <j@v6e.pt>
2016-07-20 06:02:27 +00:00
Pascal Quantin d75de9f755 VXLAN: use the newly created vxlan.next_proto dissector table everywhere
Change-Id: Ib6f44e0f1d3d8c76d2b6e6c778af8c243af4389c
Reviewed-on: https://code.wireshark.org/review/16543
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: Anders Broman <a.broman58@gmail.com>
2016-07-19 11:46:59 +00:00
João Valverde d08e7679fa IPv6: Export ipv6_pinfo interface for sub-dissectors
Change-Id: If39838f6952356aa3417ea9241d974f4c64f9898
Reviewed-on: https://code.wireshark.org/review/16530
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: João Valverde <j@v6e.pt>
2016-07-18 19:42:35 +00:00
João Valverde 994d418a0e IPv6: Remove unknown extension header dissection
It's not being used and makes some things more difficult so kill it.

It's not possible in general to distinguish an unknown extension header from
an unknown IP protocol and the concept is fuzzy anyway (for example ESP is
officially an extension header but meh) so don't bother trying for now.

Change-Id: I3bdfcc2b76b47e8c1588e91838225b14808e43a7
Reviewed-on: https://code.wireshark.org/review/16529
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: João Valverde <j@v6e.pt>
2016-07-18 19:42:25 +00:00
João Valverde 83733a340f IPv6: Set (jumbo) length by inspecting hop-by-hop header, if existing
Change-Id: I84bade7526ef3f094875eaf207b2650d734ed10f
Reviewed-on: https://code.wireshark.org/review/16523
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: João Valverde <j@v6e.pt>
2016-07-18 16:39:26 +00:00
João Valverde de7241c13b IPv6: Dissect as much as possible in case of errors
Don't require 40 bytes upfront, do it by field.

Miscellaneous cleanups.

Change-Id: Ib40b43eb3cf9aa52aa490cdabc6de26b0e977483
Reviewed-on: https://code.wireshark.org/review/16522
Reviewed-by: João Valverde <j@v6e.pt>
2016-07-18 16:39:11 +00:00
João Valverde 4b8cb97ab4 Rename iph->ip_p to iph->ip_nxt
struct ws_ip is IP version agnostic. "ip_p" is too terse and less
appropriate.

Change-Id: I06b8740ab420e20781bf7b9efcf5dce19ad22ab2
Reviewed-on: https://code.wireshark.org/review/16519
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: João Valverde <j@v6e.pt>
2016-07-18 01:33:32 +00:00
João Valverde 1a3fc2e7af IPv6: Remove union from struct ip6_hdr
The field macros are a particularly obnoxious form of namespace pollution.

Change-Id: I9010a767625fd1c4b4a48c9d75481c577915fce6
Reviewed-on: https://code.wireshark.org/review/16520
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: João Valverde <j@v6e.pt>
2016-07-18 01:32:04 +00:00
João Valverde ed307484a7 IPv6: Improve offset handling for options sub-dissectors
We pass the Option Data offset to sub-dissectors.

Change-Id: I4a20514f3f1c31179f93c86e251ba67d671844b3
Reviewed-on: https://code.wireshark.org/review/16484
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: João Valverde <j@v6e.pt>
2016-07-16 16:07:20 +00:00
João Valverde 9dd2674fad IPv6: Minor loop cleanup
Change-Id: I73e11c353695a565d9c4222f2a3646d0530c3c40
Reviewed-on: https://code.wireshark.org/review/16482
Reviewed-by: João Valverde <j@v6e.pt>
2016-07-15 22:07:18 +00:00
João Valverde 4bf78ca75b IPv6: Register fragment header dissector handle
Change-Id: Ie49c8cdc010630c8963a730562aaf33f61236058
Reviewed-on: https://code.wireshark.org/review/16443
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: João Valverde <j@v6e.pt>
2016-07-15 21:43:14 +00:00
João Valverde 2c2bdc1211 IPv6: Fix comment
Change-Id: Ib5c44f806e5844e1eb1579ade4b92d2b719564c1
Reviewed-on: https://code.wireshark.org/review/16474
Reviewed-by: João Valverde <j@v6e.pt>
2016-07-15 15:35:29 +00:00
João Valverde eb668002ec IPv6: Register extension headers ett/ei arrays
Change-Id: I1208638580efe06a94a055613a0de3ecf2acdb26
Reviewed-on: https://code.wireshark.org/review/16442
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: João Valverde <j@v6e.pt>
2016-07-15 14:23:48 +00:00
João Valverde cfaf756669 Move Shim6 dissector to packet-shim6.c
Change-Id: Ia0bfbf48e8a4eb23d62c8c5cdccad350caedef9e
Reviewed-on: https://code.wireshark.org/review/16425
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: João Valverde <j@v6e.pt>
2016-07-15 14:21:46 +00:00
João Valverde 710b0a8483 IPv6: Check pinfo->layers for hop-by-hop exthdr order
Change-Id: I0467417c4d9a62013d8fe5cbcc03c09147f92cf1
Reviewed-on: https://code.wireshark.org/review/16435
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: João Valverde <j@v6e.pt>
2016-07-15 13:09:32 +00:00
João Valverde 7533c72c4b IPv6: Remove null check (CID 1364087)
Change-Id: Ia35a78ccaa4f61fbbbfff304f12d813fdbdd009d
Reviewed-on: https://code.wireshark.org/review/16452
Reviewed-by: João Valverde <j@v6e.pt>
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-07-15 12:31:28 +00:00
João Valverde 530e7f08d2 IPv6: Fix jumbo payload length offset
Change-Id: I52fb082782674cc851b246d3b6afa7b4f14bbe34
Reviewed-on: https://code.wireshark.org/review/16434
Reviewed-by: João Valverde <j@v6e.pt>
2016-07-14 17:48:33 +00:00
João Valverde 43f7d22275 IPv6: Fix Jumbogram hop-by-hop expert info
Change-Id: I751acad2fad501b700c01a37bafa96d2add8fb36
Reviewed-on: https://code.wireshark.org/review/16433
Reviewed-by: João Valverde <j@v6e.pt>
2016-07-14 17:48:03 +00:00
João Valverde b849d3c04b IPv6: Add support for more option types
Change-Id: I1027e6e2481774953216ade6da4785e1a3c5ca63
Reviewed-on: https://code.wireshark.org/review/16357
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: João Valverde <j@v6e.pt>
2016-07-14 02:14:05 +00:00
João Valverde 76c0325b62 IPv6: Refactor dissect_opts() into type-specific dissectors
Change-Id: Ife8a7da3bd9bfea347321413bf05ea454186bc6d
Reviewed-on: https://code.wireshark.org/review/16356
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: João Valverde <j@v6e.pt>
2016-07-14 02:06:42 +00:00
João Valverde 3124cf855f IPv6: Simplify RPL routing header dissector
Use a wmem_array to perform strict checking.

Fold cmprI/cmprE dissection into a single loop.

Change-Id: I67443a604b47cd9cbca32c7f7276a7e2229580f1
Reviewed-on: https://code.wireshark.org/review/16348
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: João Valverde <j@v6e.pt>
2016-07-13 12:39:37 +00:00
João Valverde 7083839526 IPv6: refactor dissect_routing6() into type-specific dissectors
Change-Id: I153c39bb76dc30cecede9dbf5fe4abf234fcd719
Reviewed-on: https://code.wireshark.org/review/16347
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: João Valverde <j@v6e.pt>
2016-07-11 10:41:57 +00:00
João Valverde 4feb116437 IPv6: Remove a memcpy()
Replace CamelCase and remove unnecessary casts too.

Change-Id: Iacf56912448c0e0dc0fe21477d6b71ba9caba69a
Reviewed-on: https://code.wireshark.org/review/16344
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: João Valverde <j@v6e.pt>
2016-07-08 19:51:55 +00:00
João Valverde fdcfd3a6f3 IPv6: Don't check payload length for ICMPv6 encapsulation
Change-Id: I783df2ddc98da1c78020837a32005ea143321990
Reviewed-on: https://code.wireshark.org/review/16081
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: João Valverde <j@v6e.pt>
2016-06-23 06:50:16 +00:00
João Valverde 9ba9a05ef0 Display "IP DSCP" column as short text
Ping-Bug: 12429
Change-Id: I618b2017e161d89f0efa25ce2fb82a1808e8d315
Reviewed-on: https://code.wireshark.org/review/10701
Reviewed-by: João Valverde <j@v6e.pt>
2016-06-15 17:34:34 +00:00
João Valverde 4ca4768b56 IPv6: Add text marker for SRH next segment
Change-Id: If13ffe4ddb9ae08e738ccf0c715dc12ce7a076e8
Reviewed-on: https://code.wireshark.org/review/15834
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-06-13 21:15:10 +00:00
João Valverde db8dd0f020 Rename a variable
Change-Id: Ie5d859e166fbc8073be88cbbd96bffa877e6b654
Reviewed-on: https://code.wireshark.org/review/15865
Reviewed-by: João Valverde <j@v6e.pt>
2016-06-13 02:55:12 +00:00
João Valverde bc35660fbc IPv6: Add dissection for SRH flags
Change-Id: I535aba36cc906e8d78cb594900e9a7fdcbd26c83
Reviewed-on: https://code.wireshark.org/review/15828
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: João Valverde <j@v6e.pt>
2016-06-12 19:31:07 +00:00
Thibault Gerondal d6e9665872 IPv6: Add support for Segment Routing (Type 4) Extension Header
Bug: 12512
Change-Id: I5672ff3b8c4e8afcc82e957933330e0bf9454b08
Reviewed-on: https://code.wireshark.org/review/15593
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: João Valverde <j@v6e.pt>
2016-06-12 19:30:50 +00:00
João Valverde 745a6021bc IPv6: Don't disable relevant RPL expert infos with "strict" preference
We keep the preference only for the single check that could be somewhat costly.

Change-Id: If43a6965a0cf50e0e1864cf1900e529c773b5710
Reviewed-on: https://code.wireshark.org/review/15695
Reviewed-by: João Valverde <j@v6e.pt>
2016-06-02 03:43:09 +00:00
João Valverde 90235f07f2 IPv6: Add indexes to routing header address vector
Change-Id: I8a08c2b0a2845b36d341d585b5408ee4b5f3f510
Reviewed-on: https://code.wireshark.org/review/15687
Reviewed-by: João Valverde <j@v6e.pt>
Tested-by: João Valverde <j@v6e.pt>
2016-06-02 03:40:59 +00:00
João Valverde a92c9cd4e1 IPv6: Try to dissect routing exthdr even if length is not aligned.
Change-Id: Ic88a862559fcd1d4bd04747d3fb727bcd3a6138e
Reviewed-on: https://code.wireshark.org/review/15693
Reviewed-by: João Valverde <j@v6e.pt>
2016-06-02 02:53:41 +00:00
João Valverde 83cecaad90 IPv6: Add option for extension header length field in octets
Change-Id: Ifacf00247f457d710e16044b6805c2f41dacddc1
Reviewed-on: https://code.wireshark.org/review/15686
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: Michael Mann <mmann78@netscape.net>
2016-06-01 23:25:53 +00:00
João Valverde 320726b83e Move IPv6 address utility functions to wsutil
Change-Id: Ica8babbf4760b02e4840557fc61241152b2763c5
Reviewed-on: https://code.wireshark.org/review/13025
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: João Valverde <j@v6e.pt>
2016-04-09 23:36:44 +00:00
Michael Mann 1e60d63c8c Create call_data_dissector() to call data dissector.
This saves many dissectors the need to find the data dissector and store a handle to it.

There were also some that were finding it, but not using it.
For others this was the only reason for their handoff function, so it could be eliminated.

Change-Id: I5d3f951ee1daa3d30c060d21bd12bbc881a8027b
Reviewed-on: https://code.wireshark.org/review/14530
Petri-Dish: Michael Mann <mmann78@netscape.net>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-03-20 17:38:03 +00:00
Michael Mann e37275bfde Associate dissector tables and heuristic subdissector lists with a protocol.
This will make it easier to determine protocol dependencies.

Some LLC OUI dissector tables didn't have an associated protocol, so they were left without one (-1 used)

Change-Id: I6339f16476510ef3f393d6fb5d8946419bfb4b7d
Reviewed-on: https://code.wireshark.org/review/14446
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-03-17 00:05:17 +00:00
Guy Harris 099698445b Move the proto data stuff out of frame_data.[ch].
It's not tied to the frame_data structure any more, so it belongs by
itself.

Clean up some #includes while we're at it; in particular, frame_data.h
doesn't use anything related to tvbuffs, so don't have it gratuitiously
include tvbuff.h.

Change-Id: Ic32922d4a3840bac47007c5d4c546b8842245e0c
Reviewed-on: https://code.wireshark.org/review/13518
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-01-25 02:24:34 +00:00
Kevin Bracey 9eda2fa063 Set width of hex output according to bitmask
Output from BASE_HEX et al has always been zero-padded to according to
the field type - 8 digits for FT_UINT32, etc.

When the field has a bitmask, this is definitely not appropriate - the
field type is used to indicate the size of the bitfield container, and
tells us nothing about the size of this field.

Instead, determine the actual size of the field by inspecting the
bitmask, and output the corresponding number of hex digits.

Change-Id: I10ec4e93e1e40e8b1354d5368cc8945cf671a617
Reviewed-on: https://code.wireshark.org/review/13225
Reviewed-by: João Valverde <j@v6e.pt>
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-01-24 00:03:18 +00:00
Guy Harris 9141bd9700 Add more fields to packet_info structure and use them.
Add fields for the absolute time stamp (and another field for a presence
flag for the absolute time stamp) and the packet encapsulation for the
packet.

This lets us remove the field for the packet encapsulation in the
frame_data structure; do so.

Change-Id: Ifb910a9a192414e2a53086f3f7b97f39ed36aa39
Reviewed-on: https://code.wireshark.org/review/13499
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-01-23 03:50:58 +00:00
Kevin Bracey 6e90ca04ac IPv6 fragment header's reserved octet is 8 bits
Change-Id: I14d8245ee5ca51d15c7b6eda3d5993a805680530
Reviewed-on: https://code.wireshark.org/review/13287
Reviewed-by: João Valverde <j@v6e.pt>
2016-01-14 12:42:40 +00:00
Kevin Bracey acffba2e5c Change IPv6 "Flowlabel" to "Flow label"
Flow label has never been one word.

Change-Id: I61863cb1d7aca0ee7b48e64c4abad700555e57f2
Reviewed-on: https://code.wireshark.org/review/13236
Reviewed-by: João Valverde <j@v6e.pt>
2016-01-12 16:49:32 +00:00
João Valverde 9bf97f9886 IPv6: Don't export Shim6 protocol parameters
Change-Id: Ic279965ec4fff22825a9cf8e4819fb24f3cf8475
Reviewed-on: https://code.wireshark.org/review/13026
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>
2016-01-04 08:21:54 +00:00
João Valverde 6326894a40 IPv6: Minor rename, cleanup (Shim6)
Change-Id: Ia799910f72674702c98f146525171d29f1b35432
Reviewed-on: https://code.wireshark.org/review/13006
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-01-03 02:15:50 +00:00
João Valverde ff021e0d39 IPv6: Update option type parameters, make value_string_ext
Also correct IANA registry URL.

Change-Id: I362ddc797b51f6f77c3da86dcdf30ad95a674069
Reviewed-on: https://code.wireshark.org/review/12892
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2015-12-29 11:29:07 +00:00
Michael Mann f2b8504740 Don't limit capture packet counts to a fixed set of protocols.
Kept backwards compatibility with GTK+ capture info dialog by keeping the protocols tracked hardcoded, but Qt should have more freedom.

Change-Id: I497be71ec761d53f312e14858daa7152d01b8c72
Reviewed-on: https://code.wireshark.org/review/12724
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-12-22 05:23:06 +00:00
Stig Bjørlykke e1ed7598ee Removed local definitions of offsetof().
The offsetof() macro is an ANSI C library feature.

Change-Id: I2ac91b0b4c94c6f6baf14133b076fdc5ed2e182b
Reviewed-on: https://code.wireshark.org/review/12707
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-12-18 05:49:45 +00:00