api: deprecate vl_msg_api_set_handlers
[vpp.git] / src / vnet / vxlan / vxlan.c
index 8568d5b..f670ee9 100644 (file)
@@ -52,6 +52,14 @@ vxlan_eth_flag_change (vnet_main_t *vnm, vnet_hw_interface_t *hi, u32 flags)
   return 0;
 }
 
+static clib_error_t *
+vxlan_eth_set_max_frame_size (vnet_main_t *vnm, vnet_hw_interface_t *hw,
+                             u32 frame_size)
+{
+  /* nothing for now */
+  return 0;
+}
+
 static u8 *
 format_decap_next (u8 * s, va_list * args)
 {
@@ -454,6 +462,7 @@ int vnet_vxlan_add_del_tunnel
                                   vxlan_hw_class.index, dev_instance);
       else
        {
+         vnet_eth_interface_registration_t eir = {};
          f64 now = vlib_time_now (vm);
          u32 rnd;
          rnd = (u32) (now * 1e6);
@@ -461,15 +470,13 @@ int vnet_vxlan_add_del_tunnel
          memcpy (hw_addr + 2, &rnd, sizeof (rnd));
          hw_addr[0] = 2;
          hw_addr[1] = 0xfe;
-         if (ethernet_register_interface (
-               vnm, vxlan_device_class.index, dev_instance, hw_addr,
-               &t->hw_if_index, vxlan_eth_flag_change))
-           {
-             hash_unset (vxm->instance_used, t->user_instance);
 
-             pool_put (vxm->tunnels, t);
-             return VNET_API_ERROR_SYSCALL_ERROR_2;
-           }
+         eir.dev_class_index = vxlan_device_class.index;
+         eir.dev_instance = dev_instance;
+         eir.address = hw_addr;
+         eir.cb.flag_change = vxlan_eth_flag_change;
+         eir.cb.set_max_frame_size = vxlan_eth_set_max_frame_size;
+         t->hw_if_index = vnet_eth_register_interface (vnm, &eir);
        }
 
       vnet_hw_interface_t *hi = vnet_get_hw_interface (vnm, t->hw_if_index);