diff options
author | Jaap Keuter <jaap.keuter@xs4all.nl> | 2019-04-22 22:40:53 +0200 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2019-04-23 04:10:12 +0000 |
commit | 603569d159489d89d5078db497181b4f3a85d0f5 (patch) | |
tree | b68ab17f72ed03137496c406e560b5926d008531 /epan/dissectors | |
parent | 83b2f1bca578360712005ec22bf020ba523fd3b0 (diff) |
IS-IS: add dissection of BFD-Enabled TLV
As per RFC 6213 make an attempt to dissect the BFD-Enabled TLV.
Change-Id: I9a210c0cc119d66dfb091cd85203b9673cbe4a01
Reviewed-on: https://code.wireshark.org/review/32947
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'epan/dissectors')
-rw-r--r-- | epan/dissectors/packet-isis-clv.h | 1 | ||||
-rw-r--r-- | epan/dissectors/packet-isis-hello.c | 55 |
2 files changed, 56 insertions, 0 deletions
diff --git a/epan/dissectors/packet-isis-clv.h b/epan/dissectors/packet-isis-clv.h index 5861a6ff07..e55229e363 100644 --- a/epan/dissectors/packet-isis-clv.h +++ b/epan/dissectors/packet-isis-clv.h @@ -56,6 +56,7 @@ #define ISIS_CLV_MT_PORT_CAP 143 /* rfc6165, rfc7176 */ #define ISIS_CLV_MT_CAP 144 /* rfc6329, rfc7176 */ #define ISIS_CLV_TRILL_NEIGHBOR 145 /* rfc7176 */ +#define ISIS_CLV_BFD_ENABLED 148 /* rfc6213 */ #define ISIS_CLV_SID_LABEL_BINDING 149 /* draft-previdi-isis-segment-routing-extensions-05 */ #define ISIS_CLV_RESTART 211 /* draft-ietf-isis-restart-01 */ #define ISIS_CLV_MT_IS_REACH 222 /* draft-ietf-isis-wg-multi-topology-05 */ diff --git a/epan/dissectors/packet-isis-hello.c b/epan/dissectors/packet-isis-hello.c index f559b9e387..c1703f8d42 100644 --- a/epan/dissectors/packet-isis-hello.c +++ b/epan/dissectors/packet-isis-hello.c @@ -14,6 +14,7 @@ #include <epan/packet.h> #include <epan/expert.h> +#include <epan/nlpid.h> #include "packet-osi.h" #include "packet-isis.h" #include "packet-isis-clv.h" @@ -110,6 +111,7 @@ static int hf_isis_hello_reverse_metric_flag_w = -1; static int hf_isis_hello_reverse_metric_metric = -1; static int hf_isis_hello_reverse_metric_sub_length = -1; static int hf_isis_hello_reverse_metric_sub_data = -1; +static int hf_isis_hello_bfd_enabled_nlpid = -1; static int hf_isis_hello_neighbor_extended_local_circuit_id = -1; static int hf_isis_hello_vlan_flags_port_id = -1; static int hf_isis_hello_vlan_flags_nickname = -1; @@ -160,6 +162,7 @@ static gint ett_isis_hello_clv_mt_port_cap_vlans_appointed = -1; static gint ett_isis_hello_clv_trill_neighbor = -1; static gint ett_isis_hello_clv_checksum = -1; static gint ett_isis_hello_clv_reverse_metric = -1; +static gint ett_isis_hello_clv_bfd_enabled = -1; static gint ett_isis_hello_clv_ipv6_glb_int_addr = -1; static expert_field ei_isis_hello_short_packet = EI_INIT; @@ -758,6 +761,38 @@ dissect_hello_reverse_metric_clv(tvbuff_t *tvb, packet_info* pinfo _U_, } /* + * Name: dissect_hello_bfd_enabled_clv + * + * Description: + * Decode for a hello packets BFD enabled clv. + * + * Input: + * tvbuff_t * : tvbuffer for packet data + * proto_tree * : proto tree to build on (may be null) + * int : current offset into packet data + * int : length of IDs in packet. + * int : length of this clv + * + * Output: + * void, will modify proto_tree if not null. + */ +static void +dissect_hello_bfd_enabled_clv(tvbuff_t *tvb, packet_info* pinfo _U_, + proto_tree *tree, int offset, int id_length _U_, int length) { + + while (length >= 3) { + /* mtid */ + proto_tree_add_item(tree, hf_isis_hello_mtid, tvb, offset, 2, ENC_BIG_ENDIAN); + length -= 2; + offset += 2; + /* nlpid */ + proto_tree_add_item(tree, hf_isis_hello_bfd_enabled_nlpid, tvb, offset, 1, ENC_NA); + length -= 1; + offset += 1; + }; +} + +/* * Name: dissect_hello_checksum_clv() * * Description: @@ -1078,6 +1113,12 @@ static const isis_clv_handle_t clv_l1_hello_opts[] = { dissect_hello_reverse_metric_clv }, { + ISIS_CLV_BFD_ENABLED, + "BFD Enabled", + &ett_isis_hello_clv_bfd_enabled, + dissect_hello_bfd_enabled_clv + }, + { 0, "", NULL, @@ -1165,6 +1206,12 @@ static const isis_clv_handle_t clv_l2_hello_opts[] = { dissect_hello_ipv6_glb_int_addr_clv }, { + ISIS_CLV_BFD_ENABLED, + "BFD Enabled", + &ett_isis_hello_clv_bfd_enabled, + dissect_hello_bfd_enabled_clv + }, + { 0, "", NULL, @@ -1258,6 +1305,12 @@ static const isis_clv_handle_t clv_ptp_hello_opts[] = { dissect_hello_ipv6_glb_int_addr_clv }, { + ISIS_CLV_BFD_ENABLED, + "BFD Enabled", + &ett_isis_hello_clv_bfd_enabled, + dissect_hello_bfd_enabled_clv + }, + { 0, "", NULL, @@ -1527,6 +1580,7 @@ proto_register_isis_hello(void) { &hf_isis_hello_reverse_metric_metric, { "Metric", "isis.hello.reverse_metric.metric", FT_UINT24, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_isis_hello_reverse_metric_sub_length, { "Sub-TLV length", "isis.hello.reverse_metric.sub_length", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_isis_hello_reverse_metric_sub_data, { "Sub-TLV data", "isis.hello.reverse_metric.sub_data", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, + { &hf_isis_hello_bfd_enabled_nlpid, { "NLPID", "isis.hello.bfd_enabled.nlpid", FT_UINT8, BASE_HEX, VALS(nlpid_vals), 0x0, NULL, HFILL }}, /* rfc6119 */ { &hf_isis_hello_clv_ipv6_glb_int_addr, @@ -1562,6 +1616,7 @@ proto_register_isis_hello(void) &ett_isis_hello_clv_trill_neighbor, &ett_isis_hello_clv_checksum, &ett_isis_hello_clv_reverse_metric, + &ett_isis_hello_clv_bfd_enabled, &ett_isis_hello_clv_ipv6_glb_int_addr /* CLV 233, rfc6119 */ }; |