diff options
author | Taisuke Sasaki <taisasak@cisco.com> | 2020-10-29 17:58:21 +0900 |
---|---|---|
committer | Wireshark GitLab Utility <gerald+gitlab-utility@wireshark.org> | 2020-11-02 22:22:24 +0000 |
commit | 22e595666c0e701c05bcd951aac6a04e23818290 (patch) | |
tree | 1d1ea1c4488207f574229ad3aa110d1154566047 /epan | |
parent | 321f231bd97d56dcd8c13e67c40136e1a3cc8ba0 (diff) |
ISIS: Add Purge Originator ID TLV (rfc6232)
Diffstat (limited to 'epan')
-rw-r--r-- | epan/dissectors/packet-isis-clv.h | 1 | ||||
-rw-r--r-- | epan/dissectors/packet-isis-lsp.c | 86 |
2 files changed, 87 insertions, 0 deletions
diff --git a/epan/dissectors/packet-isis-clv.h b/epan/dissectors/packet-isis-clv.h index 2833745f2c..a683b80106 100644 --- a/epan/dissectors/packet-isis-clv.h +++ b/epan/dissectors/packet-isis-clv.h @@ -35,6 +35,7 @@ #define ISIS_CLV_LSP_ENTRIES 9 /* iso10589 */ #define ISIS_CLV_AUTHENTICATION 10 /* iso10589, rfc3567 */ #define ISIS_CLV_CHECKSUM 12 /* rfc3358 */ +#define ISIS_CLV_PURGE_ORIG_ID 13 /* rfc6232 */ #define ISIS_CLV_LSP_BUFFERSIZE 14 /* iso10589 rev2 */ #define ISIS_CLV_REVERSE_METRIC 16 /* rfc8500 */ #define ISIS_CLV_EXTD_IS_REACH 22 /* draft-ietf-isis-traffic-05 */ diff --git a/epan/dissectors/packet-isis-lsp.c b/epan/dissectors/packet-isis-lsp.c index de5c076839..1635919861 100644 --- a/epan/dissectors/packet-isis-lsp.c +++ b/epan/dissectors/packet-isis-lsp.c @@ -455,6 +455,8 @@ static int hf_isis_lsp_clv_srv6_end_sid_flags = -1; static int hf_isis_lsp_clv_srv6_end_sid_endpoint_func = -1; static int hf_isis_lsp_clv_srv6_end_sid_sid = -1; static int hf_isis_lsp_clv_srv6_end_sid_subsubclvs_len = -1; +static int hf_isis_lsp_purge_orig_id_num = -1; +static int hf_isis_lsp_purge_orig_id_system_id = -1; static gint ett_isis_lsp = -1; static gint ett_isis_lsp_info = -1; @@ -522,6 +524,7 @@ static gint ett_isis_lsp_clv_grp_macaddr = -1; static gint ett_isis_lsp_clv_grp_ipv4addr = -1; static gint ett_isis_lsp_clv_grp_ipv6addr = -1; static gint ett_isis_lsp_clv_grp_unknown = -1; +static gint ett_isis_lsp_clv_purge_orig_id = -1; /* CLV 13 */ static gint ett_isis_lsp_clv_originating_buff_size = -1; /* CLV 14 */ static gint ett_isis_lsp_sl_flags = -1; static gint ett_isis_lsp_sl_sub_tlv = -1; @@ -3708,6 +3711,64 @@ dissect_lsp_srv6_locator_clv(tvbuff_t *tvb, packet_info* pinfo, proto_tree *tree } } +/* + * Name: dissect_lsp_purge_orig_id_clv() + * + * Description: Decode a Purge Originator ID CLV - code 13. + * + * CALLED BY TLV 13 DISSECTOR + * + * Input: + * tvbuff_t * : tvbuffer for packet data + * packet_info * : expert error misuse reporting + * proto_tree * : proto tree to build on (may be null) + * int : current offset into packet data + * isis_data_t : data given to subdissectors + * int : length of clv we are decoding + * + * Output: + * void, will modify proto_tree if not null. + */ +static void +dissect_lsp_purge_orig_id_clv(tvbuff_t *tvb, packet_info* pinfo, proto_tree *tree, int offset, + isis_data_t *isis _U_, int length) +{ + int min_tlv_len = 7; + guint8 num_of_system_ids; + int i; + + if (length < min_tlv_len) { + proto_tree_add_expert_format(tree, pinfo, &ei_isis_lsp_short_clv, tvb, offset, length, + "Too short LSP Purge Originator ID (%d vs %d)", + length, min_tlv_len); + return; + } + + /* Number of System IDs */ + num_of_system_ids = tvb_get_guint8(tvb, offset); + proto_tree_add_item(tree, hf_isis_lsp_purge_orig_id_num, tvb, offset, 1, ENC_NA); + offset++; + length--; + + if (num_of_system_ids != 1 && num_of_system_ids != 2) { + proto_tree_add_expert_format(tree, pinfo, &ei_isis_lsp_malformed_subtlv, tvb, offset, length, + "Invalid number of System IDs: %u (should be 1 or 2)", + num_of_system_ids); + return; + } + if (length < num_of_system_ids * 6) { + proto_tree_add_expert_format(tree, pinfo, &ei_isis_lsp_malformed_subtlv, tvb, offset, length, + "Invalid Purge Originator ID TLV length: %u ", + length+1); + return; + } + for (i = 0; i < num_of_system_ids; i++) { + proto_tree_add_item(tree, hf_isis_lsp_purge_orig_id_system_id, tvb, offset, 6, ENC_NA); + offset += 6; + length -= 6; + } +} + static const isis_clv_handle_t clv_l1_lsp_opts[] = { { ISIS_CLV_AREA_ADDRESS, @@ -3878,6 +3939,12 @@ static const isis_clv_handle_t clv_l1_lsp_opts[] = { dissect_lsp_srv6_locator_clv }, { + ISIS_CLV_PURGE_ORIG_ID, + "Purge Originator ID", + &ett_isis_lsp_clv_purge_orig_id, + dissect_lsp_purge_orig_id_clv + }, + { 0, "", NULL, @@ -4055,6 +4122,12 @@ static const isis_clv_handle_t clv_l2_lsp_opts[] = { dissect_lsp_srv6_locator_clv }, { + ISIS_CLV_PURGE_ORIG_ID, + "Purge Originator ID", + &ett_isis_lsp_clv_purge_orig_id, + dissect_lsp_purge_orig_id_clv + }, + { 0, "", NULL, @@ -5678,6 +5751,18 @@ proto_register_isis_lsp(void) NULL, HFILL } }, + /* rfc6232 */ + { &hf_isis_lsp_purge_orig_id_num, + { "Number of System IDs", "isis.lsp.purge_originator_id.num", + FT_UINT8, BASE_DEC, NULL, 0x0, + NULL, HFILL } + }, + { &hf_isis_lsp_purge_orig_id_system_id, + { "System ID", "isis.lsp.purge_originator_id.system_id", + FT_SYSTEM_ID, BASE_NONE, NULL, 0x0, + NULL, HFILL } + }, + { &hf_isis_lsp_area_address, { "Area address", "isis.lsp.area_address", FT_BYTES, BASE_NONE, NULL, 0x0, @@ -5885,6 +5970,7 @@ proto_register_isis_lsp(void) &ett_isis_lsp_clv_grp_unknown, &ett_isis_lsp_clv_mt_reachable_IPv4_prefx, &ett_isis_lsp_clv_mt_reachable_IPv6_prefx, + &ett_isis_lsp_clv_purge_orig_id, /* CLV 13 */ &ett_isis_lsp_clv_originating_buff_size, /* CLV 14 */ &ett_isis_lsp_clv_sr_cap, &ett_isis_lsp_clv_sr_sid_label, |