BGP: Add LS Advertisment of IGP TE Metric (RFC8571)

Adding support for RFC8571 (BGP - Link State (BGP-LS)
Advertisement of IGP Traffic Engineering Performance Metric Extensions)

Change-Id: I2f0b415a1a5c3e5f0eb79a6e3758b17c5beba851
Reviewed-on: https://code.wireshark.org/review/32497
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
This commit is contained in:
Uli Heilmeier 2019-03-20 22:51:43 +01:00 committed by Anders Broman
parent 64e02c943a
commit d4c8f700e6
1 changed files with 142 additions and 1 deletions

View File

@ -690,6 +690,18 @@ static dissector_handle_t bgp_handle;
#define BGP_LS_SR_SUBTLV_BINDING_IPV6_BAK_ERO 1167
#define BGP_LS_SR_SUBTLV_BINDING_UNNUM_IFID_BAK_ERO 1168
/* RFC8571 BGP-LS Advertisement of IGP TE Metric Extensions */
#define BGP_LS_IGP_TE_METRIC_DELAY 1114
#define BGP_LS_IGP_TE_METRIC_DELAY_MIN_MAX 1115
#define BGP_LS_IGP_TE_METRIC_DELAY_VARIATION 1116
#define BGP_LS_IGP_TE_METRIC_LOSS 1117
#define BGP_LS_IGP_TE_METRIC_BANDWIDTH_RESIDUAL 1118
#define BGP_LS_IGP_TE_METRIC_BANDWIDTH_AVAILABLE 1119
#define BGP_LS_IGP_TE_METRIC_BANDWIDTH_UTILIZED 1120
#define BGP_LS_IGP_TE_METRIC_FLAG_A 0x80
#define BGP_LS_IGP_TE_METRIC_FLAG_RESERVED 0x7F
/* Prefix-SID TLV flags, draft-gredler-idr-bgp-ls-segment-routing-ext-01:
0 1 2 3 4 5 6 7
@ -2032,6 +2044,33 @@ static int hf_bgp_ext_com_eigrp_e_rid = -1;
static int hf_bgp_ext_com_eigrp_e_pid = -1;
static int hf_bgp_ext_com_eigrp_e_m = -1;
/* RFC8571 BGP-LS Advertisement of IGP TE Metric Extensions */
static int hf_bgp_ls_igp_te_metric_flags = -1;
static int hf_bgp_ls_igp_te_metric_flags_a = -1;
static int hf_bgp_ls_igp_te_metric_flags_reserved = -1;
static int hf_bgp_ls_igp_te_metric_delay = -1;
static int hf_bgp_ls_igp_te_metric_delay_value = -1;
static int hf_bgp_ls_igp_te_metric_delay_min_max = -1;
static int hf_bgp_ls_igp_te_metric_delay_min = -1;
static int hf_bgp_ls_igp_te_metric_delay_max = -1;
static int hf_bgp_ls_igp_te_metric_delay_variation = -1;
static int hf_bgp_ls_igp_te_metric_delay_variation_value = -1;
static int hf_bgp_ls_igp_te_metric_link_loss = -1;
static int hf_bgp_ls_igp_te_metric_link_loss_value = -1;
static int hf_bgp_ls_igp_te_metric_bandwidth_residual = -1;
static int hf_bgp_ls_igp_te_metric_bandwidth_residual_value = -1;
static int hf_bgp_ls_igp_te_metric_bandwidth_available = -1;
static int hf_bgp_ls_igp_te_metric_bandwidth_available_value = -1;
static int hf_bgp_ls_igp_te_metric_bandwidth_utilized = -1;
static int hf_bgp_ls_igp_te_metric_bandwidth_utilized_value = -1;
static int hf_bgp_ls_igp_te_metric_reserved = -1;
static const int *ls_igp_te_metric_flags[] = {
&hf_bgp_ls_igp_te_metric_flags_a,
&hf_bgp_ls_igp_te_metric_flags_reserved,
NULL
};
static gint ett_bgp = -1;
static gint ett_bgp_prefix = -1;
static gint ett_bgp_unfeas = -1;
@ -4480,6 +4519,51 @@ decode_link_state_attribute_tlv(proto_tree *tree, tvbuff_t *tvb, gint offset, pa
case BGP_LS_SR_TLV_BINDING_SID:
break;
case BGP_LS_IGP_TE_METRIC_DELAY:
tlv_item = proto_tree_add_item(tree, hf_bgp_ls_igp_te_metric_delay, tvb, offset, length+4, ENC_NA);
tlv_tree = proto_item_add_subtree(tlv_item, ett_bgp_link_state);
proto_tree_add_bitmask(tlv_tree, tvb, offset, hf_bgp_ls_igp_te_metric_flags,
ett_bgp_link_state, ls_igp_te_metric_flags, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_bgp_ls_igp_te_metric_delay_value, tvb, offset + 1, 3, ENC_BIG_ENDIAN);
break;
case BGP_LS_IGP_TE_METRIC_DELAY_MIN_MAX:
tlv_item = proto_tree_add_item(tree, hf_bgp_ls_igp_te_metric_delay_min_max, tvb, offset, length+4, ENC_NA);
tlv_tree = proto_item_add_subtree(tlv_item, ett_bgp_link_state);
proto_tree_add_bitmask(tlv_tree, tvb, offset, hf_bgp_ls_igp_te_metric_flags,
ett_bgp_link_state, ls_igp_te_metric_flags, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_bgp_ls_igp_te_metric_delay_min, tvb, offset + 1, 3, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_bgp_ls_igp_te_metric_reserved, tvb, offset + 4, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_bgp_ls_igp_te_metric_delay_max, tvb, offset + 5, 3, ENC_BIG_ENDIAN);
break;
case BGP_LS_IGP_TE_METRIC_DELAY_VARIATION:
tlv_item = proto_tree_add_item(tree, hf_bgp_ls_igp_te_metric_delay_variation, tvb, offset, length+4, ENC_NA);
tlv_tree = proto_item_add_subtree(tlv_item, ett_bgp_link_state);
proto_tree_add_item(tlv_tree, hf_bgp_ls_igp_te_metric_reserved, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_bgp_ls_igp_te_metric_delay_variation_value, tvb, offset + 1, 3, ENC_BIG_ENDIAN);
break;
case BGP_LS_IGP_TE_METRIC_LOSS:
tlv_item = proto_tree_add_item(tree, hf_bgp_ls_igp_te_metric_link_loss, tvb, offset, length+4, ENC_NA);
tlv_tree = proto_item_add_subtree(tlv_item, ett_bgp_link_state);
proto_tree_add_bitmask(tlv_tree, tvb, offset, hf_bgp_ls_igp_te_metric_flags,
ett_bgp_link_state, ls_igp_te_metric_flags, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_bgp_ls_igp_te_metric_link_loss_value, tvb, offset + 1, 3, ENC_BIG_ENDIAN);
break;
case BGP_LS_IGP_TE_METRIC_BANDWIDTH_RESIDUAL:
tlv_item = proto_tree_add_item(tree, hf_bgp_ls_igp_te_metric_bandwidth_residual, tvb, offset, length+4, ENC_NA);
tlv_tree = proto_item_add_subtree(tlv_item, ett_bgp_link_state);
proto_tree_add_item(tlv_tree, hf_bgp_ls_igp_te_metric_bandwidth_residual_value, tvb, offset, 4, ENC_BIG_ENDIAN);
break;
case BGP_LS_IGP_TE_METRIC_BANDWIDTH_AVAILABLE:
tlv_item = proto_tree_add_item(tree, hf_bgp_ls_igp_te_metric_bandwidth_available, tvb, offset, length+4, ENC_NA);
tlv_tree = proto_item_add_subtree(tlv_item, ett_bgp_link_state);
proto_tree_add_item(tlv_tree, hf_bgp_ls_igp_te_metric_bandwidth_available_value, tvb, offset, 4, ENC_BIG_ENDIAN);
break;
case BGP_LS_IGP_TE_METRIC_BANDWIDTH_UTILIZED:
tlv_item = proto_tree_add_item(tree, hf_bgp_ls_igp_te_metric_bandwidth_utilized, tvb, offset, length+4, ENC_NA);
tlv_tree = proto_item_add_subtree(tlv_item, ett_bgp_link_state);
proto_tree_add_item(tlv_tree, hf_bgp_ls_igp_te_metric_bandwidth_utilized_value, tvb, offset, 4, ENC_BIG_ENDIAN);
break;
default:
expert_add_info_format(pinfo, tree, &ei_bgp_ls_error,
"Unknown Prefix Descriptor TLV Code (%u)!", type);
@ -10043,7 +10127,64 @@ proto_register_bgp(void)
BASE_DEC, NULL, 0x0FFFFF, NULL, HFILL}},
{ &hf_bgp_ls_sr_tlv_adjacency_sid_index,
{ "SID/Index", "bgp.ls.sr.tlv.adjacency.sid.index", FT_UINT32,
BASE_DEC, NULL, 0x0, NULL, HFILL}}
BASE_DEC, NULL, 0x0, NULL, HFILL}},
{ &hf_bgp_ls_igp_te_metric_flags,
{ "TE Metric Flags", "bgp.ls.igp_te_metric.flags", FT_UINT8,
BASE_HEX, NULL, 0x0, NULL, HFILL}},
{ &hf_bgp_ls_igp_te_metric_flags_a,
{ "Anomalous (A) bit", "bgp.ls.igp_te_metric.flags.a", FT_BOOLEAN,
8, TFS(&tfs_set_notset), BGP_LS_IGP_TE_METRIC_FLAG_A, NULL, HFILL}},
{ &hf_bgp_ls_igp_te_metric_flags_reserved,
{ "Reserved", "bgp.ls.igp_te_metric.flags.reserved", FT_UINT8,
BASE_HEX, NULL, BGP_LS_IGP_TE_METRIC_FLAG_RESERVED, NULL, HFILL}},
{ &hf_bgp_ls_igp_te_metric_delay,
{ "Unidirectional Link Delay TLV", "bgp.ls.igp_te_metric.delay", FT_NONE,
BASE_NONE, NULL, 0x0, NULL, HFILL}},
{ &hf_bgp_ls_igp_te_metric_delay_value,
{ "Delay", "bgp.ls.igp_te_metric.delay_value", FT_UINT24,
BASE_DEC, NULL, 0x0, NULL, HFILL}},
{ &hf_bgp_ls_igp_te_metric_delay_min_max,
{ "Min/Max Unidirectional Link Delay TLV", "bgp.ls.igp_te_metric.delay_min_max", FT_NONE,
BASE_NONE, NULL, 0x0, NULL, HFILL}},
{ &hf_bgp_ls_igp_te_metric_delay_min,
{ "Min Delay", "bgp.ls.igp_te_metric.delay_min", FT_UINT24,
BASE_DEC, NULL, 0x0, NULL, HFILL}},
{ &hf_bgp_ls_igp_te_metric_delay_max,
{ "Max Delay", "bgp.ls.igp_te_metric.delay_max", FT_UINT24,
BASE_DEC, NULL, 0x0, NULL, HFILL}},
{ &hf_bgp_ls_igp_te_metric_delay_variation,
{ "Unidirectional Delay Variation TLV", "bgp.ls.igp_te_metric.delay_variation", FT_NONE,
BASE_NONE, NULL, 0x0, NULL, HFILL}},
{ &hf_bgp_ls_igp_te_metric_delay_variation_value,
{ "Delay Variation", "bgp.ls.igp_te_metric.delay_variation_value", FT_UINT24,
BASE_DEC, NULL, 0x0, NULL, HFILL}},
{ &hf_bgp_ls_igp_te_metric_link_loss,
{ "Unidirectional Link Loss TLV", "bgp.ls.igp_te_metric.link_loss", FT_NONE,
BASE_NONE, NULL, 0x0, NULL, HFILL}},
{ &hf_bgp_ls_igp_te_metric_link_loss_value,
{ "Link Loss", "bgp.ls.igp_te_metric.link_loss_value", FT_UINT24,
BASE_DEC, NULL, 0x0, NULL, HFILL}},
{ &hf_bgp_ls_igp_te_metric_bandwidth_residual,
{ "Unidirectional Residual Bandwidth TLV", "bgp.ls.igp_te_metric.residual_bandwidth", FT_NONE,
BASE_NONE, NULL, 0x0, NULL, HFILL}},
{ &hf_bgp_ls_igp_te_metric_bandwidth_residual_value,
{ "Residual Bandwidth", "bgp.ls.igp_te_metric.residual_bandwidth_value", FT_UINT32,
BASE_DEC, NULL, 0x0, NULL, HFILL}},
{ &hf_bgp_ls_igp_te_metric_bandwidth_available,
{ "Unidirectional Available Bandwidth TLV", "bgp.ls.igp_te_metric.available_bandwidth", FT_NONE,
BASE_NONE, NULL, 0x0, NULL, HFILL}},
{ &hf_bgp_ls_igp_te_metric_bandwidth_available_value,
{ "Residual Bandwidth", "bgp.ls.igp_te_metric.available_bandwidth_value", FT_UINT32,
BASE_DEC, NULL, 0x0, NULL, HFILL}},
{ &hf_bgp_ls_igp_te_metric_bandwidth_utilized,
{ "Unidirectional Utilized Bandwidth TLV", "bgp.ls.igp_te_metric.utilized_bandwidth", FT_NONE,
BASE_NONE, NULL, 0x0, NULL, HFILL}},
{ &hf_bgp_ls_igp_te_metric_bandwidth_utilized_value,
{ "Utilized Bandwidth", "bgp.ls.igp_te_metric.utilized_bandwidth_value", FT_UINT32,
BASE_DEC, NULL, 0x0, NULL, HFILL}},
{ &hf_bgp_ls_igp_te_metric_reserved,
{ "Reserved", "bgp.ls.igp_te_metric.reserved", FT_UINT8,
BASE_HEX, NULL, 0x0, NULL, HFILL}}
};
static gint *ett[] = {