diff options
author | John Lo <loj@cisco.com> | 2018-10-03 16:32:44 -0400 |
---|---|---|
committer | Neale Ranns <nranns@cisco.com> | 2018-10-04 07:46:10 +0000 |
commit | 06fda9cea94e0009fd0238a77d2e0f39e46f666c (patch) | |
tree | 9fc05d35f1ba7012cbf112e202849b560ea3c87f /src/vpp | |
parent | 744da656d3442bb812f50d6e8746f0f11adee8b3 (diff) |
Fix handling of mpls_tunnel_add_del API
Handles next_hop_weight, next_hop_preference and next_hop_table_id
properly in vl_api_mpls_tunnel_add_del_t_handler(). Also updated
vpp_api_test and custom_dump handling of related APIs.
Change-Id: I89e211bfa3b9d8ead396b24b3c46b7c7f6511f44
Signed-off-by: John Lo <loj@cisco.com>
Diffstat (limited to 'src/vpp')
-rw-r--r-- | src/vpp/api/custom_dump.c | 29 |
1 files changed, 22 insertions, 7 deletions
diff --git a/src/vpp/api/custom_dump.c b/src/vpp/api/custom_dump.c index aa635668593..8fd4a8deeb1 100644 --- a/src/vpp/api/custom_dump.c +++ b/src/vpp/api/custom_dump.c @@ -944,19 +944,34 @@ static void *vl_api_mpls_tunnel_add_del_t_print s = format (0, "SCRIPT: mpls_tunnel_add_del "); - if (mp->mt_next_hop_sw_if_index) - s = format (s, "sw_if_index %d ", ntohl (mp->mt_next_hop_sw_if_index)); + if (mp->mt_is_add == 0) + s = format (s, "del sw_if_index %d ", ntohl (mp->mt_sw_if_index)); - if (mp->mt_next_hop_proto_is_ip4) - s = format (s, "%U ", format_ip4_address, mp->mt_next_hop); + mpls_label_t label = ntohl (mp->mt_next_hop_via_label); + if (label != MPLS_LABEL_INVALID) + s = format (s, "via-label %d ", label); + else if (mp->mt_next_hop_proto_is_ip4) + s = format (s, "via %U ", format_ip4_address, mp->mt_next_hop); else - s = format (s, "%U ", format_ip6_address, mp->mt_next_hop); + s = format (s, "via %U ", format_ip6_address, mp->mt_next_hop); + + if (mp->mt_next_hop_sw_if_index != ~0) + s = format (s, "sw_if_index %d ", ntohl (mp->mt_next_hop_sw_if_index)); + else if (mp->mt_next_hop_table_id) + s = format (s, "next-hop-table %d ", ntohl (mp->mt_next_hop_table_id)); if (mp->mt_l2_only) s = format (s, "l2-only "); - if (mp->mt_is_add == 0) - s = format (s, "del "); + if (mp->mt_next_hop_n_out_labels) + { + u8 i; + for (i = 0; i < mp->mt_next_hop_n_out_labels; i++) + { + s = format (s, "out-label %d ", + ntohl (mp->mt_next_hop_out_label_stack[i].label)); + } + } FINISH; } |