ethernet-input: fix assert in l2 mode
[vpp.git] / src / vnet / ethernet / arp_packet.h
index e762ffa..206be41 100644 (file)
@@ -109,11 +109,11 @@ typedef enum
 
 typedef enum
 {
-  IP4_ARP_ERROR_DROP,
+  IP4_ARP_ERROR_THROTTLED,
+  IP4_ARP_ERROR_RESOLVED,
+  IP4_ARP_ERROR_NO_BUFFERS,
   IP4_ARP_ERROR_REQUEST_SENT,
   IP4_ARP_ERROR_NON_ARP_ADJ,
-  IP4_ARP_ERROR_REPLICATE_DROP,
-  IP4_ARP_ERROR_REPLICATE_FAIL,
   IP4_ARP_ERROR_NO_SOURCE_ADDRESS,
 } ip4_arp_error_t;
 
@@ -140,6 +140,13 @@ typedef struct
   };
 } ethernet_arp_header_t;
 
+typedef enum ethernet_arp_entry_flags_t_
+{
+  ETHERNET_ARP_IP4_ENTRY_FLAG_STATIC = (1 << 0),
+  ETHERNET_ARP_IP4_ENTRY_FLAG_DYNAMIC = (1 << 1),
+  ETHERNET_ARP_IP4_ENTRY_FLAG_NO_FIB_ENTRY = (1 << 2),
+} __attribute__ ((packed)) ethernet_arp_entry_flags_t;
+
 typedef struct
 {
   u32 sw_if_index;
@@ -147,11 +154,9 @@ typedef struct
 
   u8 ethernet_address[6];
 
-  u16 flags;
-#define ETHERNET_ARP_IP4_ENTRY_FLAG_STATIC  (1 << 0)
-#define ETHERNET_ARP_IP4_ENTRY_FLAG_DYNAMIC (1 << 1)
+  ethernet_arp_entry_flags_t flags;
 
-  u64 cpu_time_last_updated;
+  f64 time_last_updated;
 
   /**
    * The index of the adj-fib entry created
@@ -159,9 +164,14 @@ typedef struct
   fib_node_index_t fib_entry_index;
 } ethernet_arp_ip4_entry_t;
 
+ethernet_arp_ip4_entry_t *ip4_neighbors_pool (void);
 ethernet_arp_ip4_entry_t *ip4_neighbor_entries (u32 sw_if_index);
 u8 *format_ethernet_arp_ip4_entry (u8 * s, va_list * va);
 
+void send_ip4_garp (vlib_main_t * vm, u32 sw_if_index);
+void send_ip4_garp_w_addr (vlib_main_t * vm,
+                          const ip4_address_t * ip4_addr, u32 sw_if_index);
+
 #endif /* included_ethernet_arp_packet_h */
 
 /*