VPP-363: add ability to change mac address of the interface
[vpp.git] / vnet / vnet / interface.h
index 7738bb6..5fbf830 100644 (file)
@@ -55,6 +55,10 @@ typedef clib_error_t *(vnet_subif_add_del_function_t)
   (struct vnet_main_t * vnm, u32 if_index,
    struct vnet_sw_interface_t * template, int is_add);
 
+/* Interface set mac address callback. */
+typedef clib_error_t *(vnet_interface_set_mac_address_function_t)
+  (struct vnet_hw_interface_t * hi, char *address);
+
 typedef struct _vnet_interface_function_list_elt
 {
   struct _vnet_interface_function_list_elt *next_interface_function;
@@ -151,6 +155,9 @@ typedef struct _vnet_device_class
   /* Do not splice vnet_interface_output_node into TX path */
   u8 no_flatten_output_chains;
 
+  /* Function to set mac address. */
+  vnet_interface_set_mac_address_function_t *mac_addr_change_function;
+
 } vnet_device_class_t;
 
 #define VNET_DEVICE_CLASS(x,...)                                        \
@@ -459,7 +466,8 @@ typedef enum
   VNET_INTERFACE_COUNTER_RX_MISS = 5,
   VNET_INTERFACE_COUNTER_RX_ERROR = 6,
   VNET_INTERFACE_COUNTER_TX_ERROR = 7,
-  VNET_N_SIMPLE_INTERFACE_COUNTER = 8,
+  VNET_INTERFACE_COUNTER_MPLS = 8,
+  VNET_N_SIMPLE_INTERFACE_COUNTER = 9,
   /* Combined counters. */
   VNET_INTERFACE_COUNTER_RX = 0,
   VNET_INTERFACE_COUNTER_TX = 1,