summaryrefslogtreecommitdiffstats
path: root/src/vnet/interface_api.c
diff options
context:
space:
mode:
authorPavel Kotucek <pkotucek@cisco.com>2017-01-16 17:01:56 +0100
committerJohn Lo <loj@cisco.com>2017-02-21 00:00:12 +0000
commit65e845785f21e6b43c026f092e982171eec1f641 (patch)
treeb0fed4d7d055d61e1c659030eef8950ab8460151 /src/vnet/interface_api.c
parent9745aceb240d4586c47869203f48479c58e0f86e (diff)
VPP-540 : pbb tag rewrite details
Extended sw_interface_dump to provide 802.1ah (pbb) tag rewrite info if present. Extended log "l2-output" to provide raw data to display result of prospetive pbb tag rewrite. Tracing is moved after l2output_vtr to show these changes. Change-Id: I8b7cb865dc67ce21afab402cc086dac35f7c0f07 Signed-off-by: Pavel Kotucek <pkotucek@cisco.com>
Diffstat (limited to 'src/vnet/interface_api.c')
-rw-r--r--src/vnet/interface_api.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/vnet/interface_api.c b/src/vnet/interface_api.c
index 42fd14ee19d..63f7cad44a8 100644
--- a/src/vnet/interface_api.c
+++ b/src/vnet/interface_api.c
@@ -203,6 +203,26 @@ send_sw_interface_details (vpe_api_main_t * am,
}
}
+ /* pbb tag rewrite data */
+ u32 vtr_op = L2_VTR_DISABLED;
+ u16 outer_tag = 0;
+ u8 b_dmac[6];
+ u8 b_smac[6];
+ u16 b_vlanid = 0;
+ u32 i_sid = 0;
+ memset (b_dmac, 0, sizeof (b_dmac));
+ memset (b_smac, 0, sizeof (b_smac));
+
+ if (!l2pbb_get (am->vlib_main, am->vnet_main, swif->sw_if_index,
+ &vtr_op, &outer_tag, b_dmac, b_smac, &b_vlanid, &i_sid))
+ {
+ mp->sub_dot1ah = 1;
+ clib_memcpy (mp->b_dmac, b_dmac, sizeof (b_dmac));
+ clib_memcpy (mp->b_smac, b_smac, sizeof (b_smac));
+ mp->b_vlanid = b_vlanid;
+ mp->i_sid = i_sid;
+ }
+
tag = vnet_get_sw_interface_tag (vnm, swif->sw_if_index);
if (tag)
strncpy ((char *) mp->tag, (char *) tag, ARRAY_LEN (mp->tag) - 1);