Clean up binary api message handler registration issues
[vpp.git] / src / vnet / interface_api.c
index 42fd14e..60cd6d4 100644 (file)
@@ -50,7 +50,6 @@ _(SW_INTERFACE_SET_FLAGS, sw_interface_set_flags)               \
 _(SW_INTERFACE_SET_MTU, sw_interface_set_mtu)                   \
 _(WANT_INTERFACE_EVENTS, want_interface_events)                 \
 _(SW_INTERFACE_DUMP, sw_interface_dump)                         \
-_(SW_INTERFACE_DETAILS, sw_interface_details)                   \
 _(SW_INTERFACE_ADD_DEL_ADDRESS, sw_interface_add_del_address)   \
 _(SW_INTERFACE_SET_TABLE, sw_interface_set_table)               \
 _(SW_INTERFACE_GET_TABLE, sw_interface_get_table)               \
@@ -203,6 +202,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);
@@ -664,12 +683,6 @@ out:
   REPLY_MACRO (VL_API_SW_INTERFACE_TAG_ADD_DEL_REPLY);
 }
 
-static void
-vl_api_sw_interface_details_t_handler (vl_api_sw_interface_details_t * mp)
-{
-  clib_warning ("BUG");
-}
-
 /*
  * vpe_api_hookup
  * Add vpe's API message handlers to the table.