Commit Graph

336 Commits

Author SHA1 Message Date
Alexis La Goutte 6dcfb07b7d BGP: Fix (reader_)offset for IGMP
fix typo (offset => reader_offset)

Close #18660
2022-11-22 13:04:18 +00:00
Uli Heilmeier 5723e43293 BGP: Adding support for RFC8365
Fixes: #18393
2022-11-01 15:47:31 +00:00
garrymar 603cbd82ad Mixed-up interpretation of bgp.ext_com.type.auth 2022-10-04 06:09:27 +00:00
Alexis La Goutte 2d22f72d4d ciscodump(extcap): Fix DeadStore 2022-09-20 06:27:46 +00:00
Alexis La Goutte 4ad78f8f12 bgp: fix deadcode found by Clang Analyzer
packet-bgp.c:6886:9: warning: Value stored to 'reader_offset' is never read [deadcode.DeadStores]
packet-bgp.c:6903:13: warning: Value stored to 'reader_offset' is never read [deadcode.DeadStores]
packet-bgp.c:6907:13: warning: Value stored to 'reader_offset' is never read [deadcode.DeadStores]
packet-bgp.c:6917:9: warning: Value stored to 'reader_offset' is never read [deadcode.DeadStores]
packet-bgp.c:6925:9: warning: Value stored to 'reader_offset' is never read [deadcode.DeadStores]
2022-09-20 06:27:46 +00:00
Martin Mathieson 6d46a532a2 Fix some spelling errors. 2022-09-06 10:15:11 +01:00
Yuya Kusakabe 189611504a BGP: add SRv6 Endpoint Behaviors for MUP
https://www.iana.org/assignments/segment-routing/segment-routing.xhtml
2022-09-01 11:01:18 +00:00
Yuya Kawakami d8886a2c76 packet-bgp: Support BGP-MUP SAFI and Extended Community 2022-09-01 11:00:33 +00:00
Michael Pergament bd6c21696a Add support for Addd Path in EVPN NLRI 2022-08-17 18:22:17 +00:00
Uli Heilmeier f9cf0a0ae7 BGP: Check nhlen
Only call tvb_bytes_to_str() when nhlen > 0

Fixes: #18248
2022-08-06 20:42:15 +00:00
easonweii 52ddd86929 BGP: Fix dissector bug when BGP Update packets containing BGP Flowspec updates
Add support for BGP Update packets containing BGP Flowspec updates
Fixs #18198
2022-07-15 13:28:56 +00:00
Alexis La Goutte 69ea1930a7 BGP: fix typo for EVPN Router's MAC (RFC9135)
Reported by Joe Neville => https://twitter.com/joeneville_/status/1544020405530279938
2022-07-13 18:59:56 +00:00
João Valverde 8efad466c4 Tools: Fix fix-encoding-args.pl ASCII string validation
Do not require a useless ENC_NA parameter for string encodings.
FT_STRING and FT_STRINGZ types don't have any ndianness.

Follow-up to 6ec429622c.
2022-02-15 11:38:16 +00:00
Uli Heilmeier b587d6a266 BGP: Fix next_hop decoding
Related to wireshark/wireshark#17836
2022-01-06 11:12:30 +01:00
João Valverde dec5590b5b Fix errors found by fix-encoding-args.pl 2021-12-19 22:55:37 +00:00
João Valverde 22ee2764a7 Replace g_snprintf() with snprintf() (dissectors)
Use macros from inttypes.h with format strings.
2021-12-19 20:25:11 +00:00
João Valverde 19dcb725b6 epan: Remove STR_ASCII and STR_UNICODE
These display bases work to replace unprintable characters so the
name is a misnomer. In addition they are the same option and this
display behaviour is not something that is configurable.

This does not affect encodings because all our internal text strings
need to be valid UTF-8 and the source encoding is specified using
ENC_*.

Remove the assertion for valid UTF-8 in proto.c because
tvb_get_*_string() must return a valid UTF-8 string, always, and we
don't need to assert that, it is expensive.
2021-12-03 04:35:56 +00:00
Evan Huus 0eda51a646 to_str: scope tvb_ip6_to_str 2021-10-07 13:31:23 -04:00
Evan Huus 07f5472aa7 to_str: scope tvb_ip_to_str 2021-10-07 10:25:12 -04:00
Evan Huus e578c6caee to_str: pull scope arg up into tvb_ether_to_str
There are a bunch of near-identical macros here, but I'm gonna change
one at a time or else the builder times out at the number of files
changed in one merge.
2021-10-04 17:10:17 +00:00
Taisuke Sasaki b9687f7d85 BGP: Add BGP-LS BGP Egress Peer Engineering (rfc9086) 2021-09-21 13:32:20 +00:00
Martin Mathieson dd667dddf0 Some spelling fixes 2021-09-18 20:52:04 +00:00
Taisuke Sasaki 806599b923 BGP: Add BGP-LS Flex Algorithm (draft-ietf-idr-bgp-ls-flex-algo-07) 2021-09-15 05:42:44 +00:00
Uli Heilmeier 2d08611d54 BGP: Add RFC 9104 Extended Administrative Groups
Added support for RFC 9104 "Distribution of Traffic Engineering
Extended Administrative Groups Using the Border Gateway Protocol
- Link State (BGP-LS)"
2021-09-13 04:30:36 +00:00
Taisuke Sasaki 42372c0dfa BGP: Add BGP-LS SR Local Block TLV (rfc9085)
- Add BGP-LS Prefix Attribute Flags TLV (rfc9085)
- Add BGP-LS Node/Link MSD (rfc8814)
- Add BGP-LS Link Local/Remote Identifiers TLV (rfc5307)
- Modified from error to warning for unsupported BGP-LS Attribute TLVs
2021-09-09 06:22:09 +00:00
Taisuke Sasaki b4ef378e5e BGP: Fix BGP-LS TLV offset of IGP TE Metric (RFC8571) 2021-09-03 05:51:39 +00:00
Martin Mathieson d34d1a1e13 More fussing with masks.
Mostly longer masks with odd numbers of digits.
2021-07-29 10:15:58 +00:00
David Perry 6e8c7283d6 Change some `wmem_packet_scope()` to `pinfo->pool` 2021-07-27 21:36:43 +00:00
John Thacker a682f45c23 BGP: Update and fix handling of Multiprotocol Extensions
In the MP_REACH_NLRI attribute, break out the Next Hop field into
constituent subfields for different address types. Add a field name
for the NLRI to make it filterable and consistent with the standard
NLRI attribute. Also add a field name for the withdrawn routes for
the MP_UNREACH_NLRI attribute.

Correct a comment about RFC 2545 and the handling of what it allows,
viz. IPv6 next hop addresses being optionally followed by link-local
next hop addresses.

The above has nothing to do with RFC 2283 allowing multiple <afi, safi,
..., NLRI> tuples (which was impossible to implement, and RFC 2858
later explicitly disallowed), so correct the comment about that.
2021-05-01 09:07:21 -04:00
John Thacker 9569288c3b BGP: Update Subsequent Address Family Identifiers (SAFI)
Update SAFI defines and value string from last update at
https://www.iana.org/assignments/safi-namespace/safi-namespace.xhtml
2021-04-24 08:28:10 +00:00
Uli Heilmeier 94628dc8fb BGP: Add support for draft-filsfils-spring-net-pgm-extension-srv6-usid
Adding additional endpoint behavior as defined in
https://tools.ietf.org/html/draft-filsfils-spring-net-pgm-extension-srv6-usid-10#section-10

Fixes: wireshark/wireshark#17343
2021-04-17 05:20:14 +00:00
Yuya Kawakami 861054fb83 epan: fix proto register bgp to make mp_[un]reach_nlri.safi available 2021-04-09 13:04:50 +00:00
Martin Mathieson 678914ca0b Fix some item lengths.
As seen by tools/check_type_item_lengths.py
2021-03-29 05:30:27 +00:00
Martin Mathieson 2753c4c27e Expert info: check group and severity
Add a check for valid group and severity values, and fix violations foud.
2021-03-09 19:14:29 +00:00
Martin Mathieson cd77e5aa5f Some more spelling fixes.
Also add more words to dictionary file.
2021-02-21 09:59:04 +00:00
Uli Heilmeier f6af99045f BGP: Support for RFC9003
RFC9003 obsoletes RFC8203 and updates max length for Shutdown
Communication field from 128 to 255 bytes.
2021-01-10 19:43:44 +00:00
Uli Heilmeier f652c79d5e BGP: Require min length Add-Path-Prefix check
detect_add_path_prefix46() is too greedy when there is a normal NLRI
(non Add-Path) with multiple <length, prefix> tuples containing a zero
length prefix at the start or in the middle.

According to [1] we don't know the amount of tuples, only the overall
length. As the Open message may be missing we still need the heuristic
to detect Add-Path prefix usage.

[1] https://tools.ietf.org/html/rfc4271#section-4.3

Related to wireshark/wireshark#16820
2020-12-31 10:10:53 +00:00
Alexis La Goutte 692ab543e6 BGP: fix item length
reported by check_typed_proto_items.py
packet-bgp.c:8440 proto_tree_add_item called for hf_bgp_update_encaps_tunnel_subtlv_lb_block_length  -  item type is FT_UINT16 but call has len  4
packet-bgp.c:9152 proto_tree_add_item called for hf_bgp_route_refresh_orf_entry_sequence  -  item type is FT_UINT8 but call has len  4
2020-11-15 10:02:43 +00:00
Martin Mathieson 580de09849 Fix a few spelling mistakes. 2020-11-12 09:52:52 +00:00
Hideaki HAYASHI 986a4712ba epan: BGP Prefix-SID attribute SRv6 SID support
[Update] BGP Prefix-SID definition (from draft-ietf-idr-bgp-prefix-sid-05 to RFC8669).
[Support] BGP Prefix-SID SRv6 SID (draft-ietf-bess-srv6-services-05)
2020-11-11 13:26:18 +00:00
Pascal Quantin 1afe9a96d4 BGP: remove useless assignments
Closes #16896
2020-10-07 10:42:14 +00:00
Martin Mathieson 08ab0e5d1f Fix some wrong filter names.
These were detected by running check_typed_item_calls.py
with --consecutive, which flags items that have different
labels but the same filter string.  Usually this is because
of copy/paste.

Quite a few similar bugs still exist, will address in a future commit.
2020-09-27 18:40:13 +00:00
Martin Mathieson fc64ba242a More dissector spelling fixes. 2020-09-24 16:40:51 +00:00
Alexis La Goutte 563a270019 BMP: Add Route Policy (draft-xu-grow-bmp-route-policy-attr-trace-04)
new BMP Message type (Section 2.1).
  o  Type = TBD: Route Policy and Attribute Trace Message. (100)

new TLV types for the Route  Policy and Attribute Trace Message (Section 2.3).
   o  Type = TBD1 (2 Byte): VRF/Table TLV. (0)
   o  Type = TBD2 (2 Byte): Policy TLV. (1)
   o  Type = TBD3 (2 Byte): Pre Policy Attribute TLV. (2)
   o  Type = TBD4 (2 Byte): Post Policy Attribute TLV. (3)
   o  Type = TBD5 (2 Byte): String TLV. (4)

Bug: 16749
Change-Id: I9858c94fb8fe5a9f3341204646030e59e13509bf
Reviewed-on: https://code.wireshark.org/review/37911
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Uli Heilmeier <openid@heilmeier.eu>
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-08-14 04:34:31 +00:00
Uli Heilmeier 3526ecd623 BGP: Fix scope for path attribute packet_data
We need wmem_file_scope() to handle path attribute info after
MPLS/VNI label.

Bug: 16678
Change-Id: Ib487b271110c78d2d4ae10f01fc24cda3edc0713
Reviewed-on: https://code.wireshark.org/review/37790
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-07-09 07:24:13 +00:00
Uli Heilmeier 006a7f5115 BGP: Use VNI when VXLAN/VXLAN-GPE encapsulation is specified
RFC8365 and draft-ietf-idr-tunnel-encaps-15 defines to use the
MPLS Label field to carry the VNI in the presence of a Tunnel
Encapsulation Extended Community specifying the use of a VNI.

This is the case for VXLAN and VXLAN-GPE tunnel types.

Bug: 16643
Change-Id: I4ffc8b024c2102b7fab4d7cb3dd1a5d69c569c12
Reviewed-on: https://code.wireshark.org/review/37551
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-06-24 10:46:39 +00:00
Jaap Keuter cac1426dd6 BGP: MP_REACH_NLRI dissect Next hop network address for EVPN
Add EVPN to the set of SAFI's of the L2VPN AFI to dissect the
Net hop network address for.

Bug: 16644
Change-Id: Ib335e765907d72945a5e58e6e992f84b92f9f261
Reviewed-on: https://code.wireshark.org/review/37536
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-06-22 15:43:53 +00:00
Guy Harris e1d9a226a2 Fix the type of arrays of pointers to hf_ values for bitfield routines.
The static arrays are supposed to be arrays of const pointers to int,
not arrays of non-const pointers to const int.

Fixing that means some bugs (scribbling on what's *supposed* to be a
const array) will be caught (see packet-ieee80211-radiotap.c for
examples, the first of which inspired this change and the second of
which was discovered while testing compiles with this change), and
removes the need for some annoying casts.

Also make some of those arrays static while we're at it.

Update documentation and dissector-generator tools.

Change-Id: I789da5fc60aadc15797cefecfd9a9fbe9a130ccc
Reviewed-on: https://code.wireshark.org/review/37517
Petri-Dish: Guy Harris <gharris@sonic.net>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-06-19 11:32:26 +00:00
Jaap Keuter 9750d00ff1 Introduce tfs_get_string helper
true_false_strings have no helper function to properly retrieve the
string representing the true or false value, much like unit_strings,
even though this is not uncommon in dissectors.
This change introduces the helper function and modifies the dissectors,
so that they use this helper i.s.o. their own expressions.

Change-Id: I477ed2d90a9a529fc5dcfef7e3ea42ec180d27ae
Reviewed-on: https://code.wireshark.org/review/36920
Reviewed-by: Jaap Keuter <jaap.keuter@xs4all.nl>
Petri-Dish: Jaap Keuter <jaap.keuter@xs4all.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-04-25 04:39:46 +00:00
Dario Lombardo d3c4dfa9ee wsutil: use ws_in4_addr in tvb_get_ipv4_addr_with_prefix_len.
Instead of guint8* the used type looks more precise. Moreover there
is no need to use local unions in the dissectors to switch between
the actual address and address bytes.

bgp, eigrp and isis-lsp dissectors have been updated accordingly.

Change-Id: I7785fe4c12913a09bd31cd6ef26e53027646d35c
Reviewed-on: https://code.wireshark.org/review/36836
Petri-Dish: Guy Harris <gharris@sonic.net>
Tested-by: Petri Dish Buildbot
Reviewed-by: Guy Harris <gharris@sonic.net>
2020-04-14 08:31:11 +00:00