Commit Graph

331 Commits

Author SHA1 Message Date
João Valverde 55b3de86c2 IPv6: Update SRH dissection to draft-*-05
Change-Id: Ia61e8ffb4499e2ea25e66e9e05a6d2881f15d6ae
Reviewed-on: https://code.wireshark.org/review/19914
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>
2017-02-04 21:26:11 +00:00
Michael Mann af54b292e6 Register reassembly tables
Register all reassembly tables with a central unit, allowing the
central unit to have the callback that initializes and destroys
the reassembly tables, rather than have dissectors do it individually.

Change-Id: Ic92619c06fb5ba6f1c3012f613cae14982e101d4
Reviewed-on: https://code.wireshark.org/review/19834
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-01-29 13:29:04 +00:00
Michael Mann f4b0abc729 Dissectors don't need a journey of self discovery.
They already know who they are when they register themselves.  Saving the
handle then to avoid finding it later.
Not sure if this will increase unnecessary register_dissector functions
(instead of using create_dissector_handle in proto_reg_handoff function)
when other dissectors copy/paste, but it should make startup time
a few microseconds better.

Change-Id: I3839be791b32b84887ac51a6a65fb5733e9f1f43
Reviewed-on: https://code.wireshark.org/review/19481
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-12-31 07:31:42 +00:00
João Valverde 2892cc6603 IPv6: Fix IPv6 fragment header offset unit display
Fragment offset unit is 8-octet, not bytes.

Reverts regression introduced in 232cb9a2dd.

Change-Id: Id015209b45e15cd630f42ed2c3bbf342094b8ba6
Reviewed-on: https://code.wireshark.org/review/19307
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-12-16 22:49:17 +00:00
Michael Mann 232cb9a2dd Remove proto_item_append_text calls in favor of BASE_UNIT_STRING.
Many proto_item_append_text calls were just adding a unit string to a field.
There's a better way to do that now.

Change-Id: Id18d5ac1ea4d8ecdc4cbe7ebaec07fbd2eab6e78
Reviewed-on: https://code.wireshark.org/review/19289
Petri-Dish: Michael Mann <mmann78@netscape.net>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-12-16 03:04:11 +00:00
Gerald Combs cbf89c8ed8 Check preference titles and descriptions.
When registering preferences, make sure our titles and descriptions are
valid UTF-8. Make sure our titles are short and only contain printable
characters.

Fix problematic titles and descriptions.

Change-Id: I20d3f93438f2b3c30266f934297feb79897f2ee5
Reviewed-on: https://code.wireshark.org/review/18998
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: Michael Mann <mmann78@netscape.net>
2016-12-01 01:26:39 +00:00
Alexis La Goutte 40b98600bd fix no previous prototype for ‘capture_*’ [-Wmissing-prototypes]
Change-Id: Ie5bfe4d366a679ebcb561716f23d174e7b9bf487
Reviewed-on: https://code.wireshark.org/review/18754
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-11-12 19:51:54 +00:00
Jaap Keuter d7e874c5d0 PW_ACH: Use proper symbolic names
Collect all used PW Associated Channel Types and use them in the
subdissector table registrations.

Change-Id: I5d196bceefdb4560b1f4388ff86898e316e5e2ae
Reviewed-on: https://code.wireshark.org/review/18590
Reviewed-by: Jaap Keuter <jaap.keuter@xs4all.nl>
Petri-Dish: Jaap Keuter <jaap.keuter@xs4all.nl>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-10-31 11:38:55 +00:00
João Valverde d47551982b Implement registration of capture dissectors by name
Mirror it after protocol dissector API.

Change-Id: I7985bcfa9e07654c7cf005efec94efc205d7a304
Reviewed-on: https://code.wireshark.org/review/18496
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-10-28 17:39:04 +00:00
João Valverde a9ec5f89ce IPv6: Remove some duplicate address code
Change-Id: I3736d7f40479a05130db9da3032a952633180b0e
Reviewed-on: https://code.wireshark.org/review/18426
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-10-24 17:45:32 +00:00
Michael Mann 2eb7b05b8c Convert most UDP dissectors to use "auto" preferences.
Similar to the "tcp.port" changes in I99604f95d426ad345f4b494598d94178b886eb67,
convert dissectors that use "udp.port".

More cleanup done on dissectors that use both TCP and UDP dissector
tables, so that less preference callbacks exist.

Change-Id: If07be9b9e850c244336a7069599cd554ce312dd3
Reviewed-on: https://code.wireshark.org/review/18120
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-10-13 02:51:18 +00:00
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