Commit Graph

320 Commits

Author SHA1 Message Date
Peter Wu 717ca58264 ipv6: fix build with old 32-bit glib headers (master only)
Introduced with v2.3.0rc0-112-gdcb7b71, nxt is only a guint8* which
fails on 32-bit glib before 2.31.2.

Change-Id: Ide1816a971fa213f5669a7fa71bc111d5b1cc921
Reviewed-on: https://code.wireshark.org/review/17418
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2016-09-01 08:22:35 +00:00
João Valverde 917d34c4de Add PI_DEPRECATED expert info group
Change-Id: Ibc43b1976d5827e8c40252a5200852fbcd00b70c
Reviewed-on: https://code.wireshark.org/review/16763
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>
Reviewed-by: João Valverde <j@v6e.pt>
2016-08-05 13:59:25 +00:00
João Valverde 50b56c8cde IPv6: Display reassembly information under root_tree
Change-Id: Ibfa934dba59f96b8820d2616d4d3d3990af00918
Reviewed-on: https://code.wireshark.org/review/16822
Reviewed-by: João Valverde <j@v6e.pt>
2016-08-01 09:27:21 +00:00
João Valverde 3096063d44 IPv6: Expand blurb for IPv4 embedded addresses
Change-Id: I540e80517092ab1e475532d8e20a54be24858c5d
Reviewed-on: https://code.wireshark.org/review/16816
Reviewed-by: Binh Trinh <beango@gmail.com>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-07-31 22:18:59 +00:00
João Valverde 3c47d97412 IPv6: Remove an unused #define and two macros
Change-Id: I0866e4b28b660063ab351022ac943bb5717b5a23
Reviewed-on: https://code.wireshark.org/review/16811
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-31 17:35:26 +00:00
Binh Trinh e811e82c4c IPv6: Fix typo in comment from gd2cd779
Change-Id: Id1a053c189fdd374da2447123e5e47d80000b802
Reviewed-on: https://code.wireshark.org/review/16805
Reviewed-by: João Valverde <j@v6e.pt>
2016-07-31 15:10:58 +00:00
Binh Trinh d2cd779d2f IPv6: Add support for embedded IPv4 addressess (RFC 6052)
For Well-Known Prefix 64:ff9b::/96.

Change-Id: Ib2d7b42b9c7e6bbe388dca46d6a5eb516242c881
Reviewed-on: https://code.wireshark.org/review/16780
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-31 13:00:36 +00:00
João Valverde 52ff3ae729 IPv6: Move a declaration
Change-Id: I94ace6b1837e1f3398a2784945322cde91d4d232
Reviewed-on: https://code.wireshark.org/review/16796
Reviewed-by: João Valverde <j@v6e.pt>
2016-07-31 03:57:30 +00:00
João Valverde 665738d49d IPv6: Capitalize some field names
Change-Id: Ie1d95b521a354df69b4a70b0a8fb209eb97a07fd
Reviewed-on: https://code.wireshark.org/review/16795
Reviewed-by: João Valverde <j@v6e.pt>
2016-07-31 03:47:35 +00:00
João Valverde e3d78be0b4 Move IPv6 inet definitions to wsutil/inet_ipv6.h
Change-Id: I880adf7fc1e131639f318cdecf7d8e59262d89fb
Reviewed-on: https://code.wireshark.org/review/16784
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-30 13:14:43 +00:00
João Valverde fd84add714 IPv6: Add deprecation expert infos
Change-Id: I111fd8f74388e9e4b7a9d7fd1b582d2fff86cf59
Reviewed-on: https://code.wireshark.org/review/16764
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-30 09:09:55 +00:00
João Valverde a637026a13 IPv6: Add experimental routing header types
Change-Id: I22dfa604abd8ade21d240104bf84af815aa2bc24
Reviewed-on: https://code.wireshark.org/review/16783
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-30 07:58:44 +00:00
João Valverde 4d4a7a6c84 IPv6: Use some macros to set/allocate addresses
Change-Id: I30430841ff6f3b89cb778aed9e109a885b412a01
Reviewed-on: https://code.wireshark.org/review/16766
Reviewed-by: João Valverde <j@v6e.pt>
2016-07-29 19:54:00 +00:00
João Valverde 3da56e4771 IPv6: Dissect unknown routing header types as data
Change-Id: I1fa840d24d56643515c6fc8d73967307bf1951d6
Reviewed-on: https://code.wireshark.org/review/16762
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-29 16:41:06 +00:00
João Valverde b6d13ef90d Register IPv6 extension header dissectors to "ip.proto" table
We may want to add expert infos for IPv6 extension headers over IPv4 (TODO).
Any side-effects that don't make sense (e.g: IPv6 Routing over IPv4) are
ignored.

The IPv6 Next Header decode as is replaced by IP Proto decode as. It
didn't fit a conceptual model well and it also was not working very well
in practice (for multiple extension headers).

We now support decoding any IP Protocol number as an extension header.

Bug: 12673
Change-Id: Icbde019aba8990cc556ef2bd832f64cba76c24b6
Reviewed-on: https://code.wireshark.org/review/16681
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-29 16:36:32 +00:00
João Valverde dcb7b71e61 IPv6: Fix Decode As to distinguish a null from a hop-by-hop next header.
Both display as zero in the UI. We shouldn't have null values for
decode as, but we do for IPv6, and the user (also the developer) can't
tell them apart from an IPv6 Hop-by-hop Option extension header.

NULL values are represented as IP Protocol 255 (Reserved) in the UI,
intead of IP Protocol 0 (Hop-By-Hop extension header).

Change-Id: I840db99df212a3bee03027b91fdec9c01886004d
Reviewed-on: https://code.wireshark.org/review/16746
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-28 15:46:07 +00:00
João Valverde 7c2044801e IPv6: Reduce some expert info PI_PROTOCOL severities
Change-Id: I87bcc47eeee05ea22c646f7ecce9374c070b1ea6
Reviewed-on: https://code.wireshark.org/review/16743
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-28 15:44:14 +00:00
João Valverde 7ff07618a0 IPv6: Fix an incorrect bitmask
Change-Id: I81dfcb4fb4b10a9d951247460783f81f464c50b7
Reviewed-on: https://code.wireshark.org/review/16747
Reviewed-by: João Valverde <j@v6e.pt>
2016-07-28 11:57:37 +00:00
João Valverde 4d925d3acc IPv6: Add expert info for option extension header type mismatch
Change-Id: If9c4e609528a1b72e6d5a002292734e21650e1eb
Reviewed-on: https://code.wireshark.org/review/16713
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-28 06:25:25 +00:00
João Valverde d8f67efa0c IPv6: Add support for SMF_DPD option (RFC 6621)
Change-Id: I61a1246a3f68aa03e12949e8271dd4cac055b9db
Reviewed-on: https://code.wireshark.org/review/16712
Reviewed-by: João Valverde <j@v6e.pt>
2016-07-28 02:58:45 +00:00
João Valverde fc6c9e4987 IPv6: Fix dissection with IPv6 No Next Header
Change-Id: I250e1a7ee236ab50b6da1a9b5d846adc9c970e7e
Reviewed-on: https://code.wireshark.org/review/16710
Reviewed-by: João Valverde <j@v6e.pt>
2016-07-27 05:27:01 +00:00
Gerald Combs 18ae0c8672 IPv6: Remove an unused function and unused macros.
Remove _ipv6_hdr_tcls, IPv6_HDR_VERS, IPv6_HDR_TCLS, and IPv6_HDR_FLOW.

Change-Id: Idd18c101db6aa6d523a236e81086ff7ef25e6923
Reviewed-on: https://code.wireshark.org/review/16709
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: João Valverde <j@v6e.pt>
2016-07-27 01:29:25 +00:00
João Valverde a5a7c27d40 IPv6: Add "ipv6_ws" tap providing a ws_ip structure
Also remove code dependency on ip6_hdr pointer. It is used solely for the
"ipv6" tap now.

Change-Id: I07150bfae8bf94bf3c585f20c27b60db78688a7b
Reviewed-on: https://code.wireshark.org/review/16655
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-26 17:35:15 +00:00
João Valverde 2bec34aedc IPv6: Add fragment header size #define
Change-Id: I536324da9ec761279cc3d3d5df681a4217d5b5fc
Reviewed-on: https://code.wireshark.org/review/16676
Reviewed-by: João Valverde <j@v6e.pt>
2016-07-26 01:30:07 +00:00
João Valverde 095a3c8954 IPv6: Use wmem_packet_scope for ws_ip address allocation
Change-Id: I7e386fe0f8cb3a19a91a16c1152ce500367c13fd
Reviewed-on: https://code.wireshark.org/review/16654
Reviewed-by: João Valverde <j@v6e.pt>
2016-07-25 10:11:43 +00:00
João Valverde 00e74ac6e5 IPv6: Use pinfo->pool scope for ipv6_pinfo
Change-Id: I415103eaba23b1a616667cf7c72af3b391a9e5ab
Reviewed-on: https://code.wireshark.org/review/16653
Reviewed-by: João Valverde <j@v6e.pt>
2016-07-25 10:11:16 +00:00
João Valverde 80f7d9c2c0 IPv6: Say "unknown" for unknown ip protocol column info
Change-Id: I99424f9382dd602d3f29251cdbf7d32666409d90
Reviewed-on: https://code.wireshark.org/review/16652
Reviewed-by: João Valverde <j@v6e.pt>
2016-07-25 10:10:50 +00:00
João Valverde 7791505168 IPv6: Use ipv6_pinfo_t instead of ws_ip to keep some state
To perform IPv6 defragmentation we need to compute the IPv6 fragment header
payload length by subtracting the length of intermediate extension headers
from the IPv6 payload length.

Add a new frag_plen field to ipv6_pinfo_t to do that instead of (ab)using
struct ws_ip.

Note: The RFC 2460 rules for fragment header order are stricter than the code
suggests but that shouldn't be a problem here.

Change-Id: I76f3cb3a1a29d96b080d3d53c0f493f9d0b2786c
Reviewed-on: https://code.wireshark.org/review/16637
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-25 10:04:49 +00:00
João Valverde 363617ffed Use 'nxt' argument in ipv6_dissect_next()
Change-Id: I7190aa5301ba54be4c179dc7815c4be82987c949
Reviewed-on: https://code.wireshark.org/review/16636
Reviewed-by: João Valverde <j@v6e.pt>
2016-07-24 18:22:52 +00:00
Guy Harris fff601949f Fix indentation (no tabs).
Change-Id: Ic45c0aa526e90bd51c0c501cdd349255ce0b43f5
Reviewed-on: https://code.wireshark.org/review/16621
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-07-24 08:47:44 +00:00
Guy Harris 2101af4b67 More null "IP information" pointer checks.
Bug: 12645

Change-Id: I356b6570f9a33fd495523a5e1fa6ada56047dc45
Reviewed-on: https://code.wireshark.org/review/16620
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-07-24 08:45:40 +00:00
Guy Harris 284aed2c66 More null "IP information" pointer checks.
Bug: 12645
Change-Id: Iac662bec3c23b0b3d228766ad7a094f615770072
Reviewed-on: https://code.wireshark.org/review/16618
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-07-24 08:22:07 +00:00
Guy Harris 00961a0df2 Pass the next protocol value to ip_try_dissect() as an argument.
That way, we don't rely on the ws_ip pointer being non-null.

Based on changes from Ib73410fd8575ad6c836311bbda87a0580e5640ac.

Change-Id: If8c437572c725481ac4148c8095a1a479b4fb0f8
Reviewed-on: https://code.wireshark.org/review/16617
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-07-24 08:05:57 +00:00
Guy Harris 523e8c3cc5 Pass the next header value to ipv6_dissect_next() as an argument.
That way, we don't rely on the ws_ip pointer being non-null.

Based on changes from Ib73410fd8575ad6c836311bbda87a0580e5640ac.

Bug: 12645
Change-Id: I8c74ba57637b6a125593c4711d7c21b9693c2c85
Reviewed-on: https://code.wireshark.org/review/16616
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-07-24 08:00:39 +00:00
João Valverde 904d9fc2c3 Update struct ws_ip with flow label and comments
Change field ip_v_hl to version.

Change-Id: Ic7ce8d6d083f6413284a7b9ba91a2387b11b29fb
Reviewed-on: https://code.wireshark.org/review/16555
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-23 03:46:58 +00:00
João Valverde c11cdd6493 Use wmem_new0() to allocate struct ws_ip
Change-Id: I0e76ffc2dc0c3e3d7bd081ff433c95741b9aa906
Reviewed-on: https://code.wireshark.org/review/16598
Reviewed-by: João Valverde <j@v6e.pt>
2016-07-23 03:46:40 +00:00
João Valverde 752b5de27c IPv6: Another get_jumbo_plen cleanup
Change-Id: I81e618cd889aa1425e03b7dcb6e0af3d995b1d54
Reviewed-on: https://code.wireshark.org/review/16595
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-22 23:57:28 +00:00
João Valverde 0903568bf3 Decouple extension headers from the IPv6 dissector loop
Register MIPv6 too in "ipv6.nxt". Fixes bug 10705.

Bug: 10705
Change-Id: I297d8983d65ee7585e1201a81d10396001e0d167
Reviewed-on: https://code.wireshark.org/review/16561
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-22 13:41:17 +00:00
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