X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=vnet%2Fvnet%2Fethernet%2Farp_packet.h;h=e762ffa4018e21d6b158af5ada8e822e749a9b0e;hb=3e046ea96e7e9d98a8dd67eab84031e1d71b4422;hp=c2214949d8953f902bbe84bba10b0a9fff9acea0;hpb=cb9cadad578297ffd78fa8a33670bdf1ab669e7e;p=vpp.git diff --git a/vnet/vnet/ethernet/arp_packet.h b/vnet/vnet/ethernet/arp_packet.h index c2214949d89..e762ffa4018 100644 --- a/vnet/vnet/ethernet/arp_packet.h +++ b/vnet/vnet/ethernet/arp_packet.h @@ -86,44 +86,53 @@ _ (exp1) \ _ (exp2) -typedef enum { +typedef enum +{ #define _(n,f) ETHERNET_ARP_HARDWARE_TYPE_##f = (n), foreach_ethernet_arp_hardware_type #undef _ } ethernet_arp_hardware_type_t; -typedef enum { +typedef enum +{ #define _(f) ETHERNET_ARP_OPCODE_##f, foreach_ethernet_arp_opcode #undef _ - ETHERNET_ARP_N_OPCODE, + ETHERNET_ARP_N_OPCODE, } ethernet_arp_opcode_t; -typedef enum { +typedef enum +{ IP4_ARP_NEXT_DROP, IP4_ARP_N_NEXT, } ip4_arp_next_t; -typedef enum { +typedef enum +{ IP4_ARP_ERROR_DROP, IP4_ARP_ERROR_REQUEST_SENT, IP4_ARP_ERROR_NON_ARP_ADJ, IP4_ARP_ERROR_REPLICATE_DROP, - IP4_ARP_ERROR_REPLICATE_FAIL + IP4_ARP_ERROR_REPLICATE_FAIL, + IP4_ARP_ERROR_NO_SOURCE_ADDRESS, } ip4_arp_error_t; +/* *INDENT-OFF* */ typedef CLIB_PACKED (struct { u8 ethernet[6]; ip4_address_t ip4; }) ethernet_arp_ip4_over_ethernet_address_t; +/* *INDENT-ON* */ -typedef struct { +typedef struct +{ u16 l2_type; u16 l3_type; u8 n_l2_address_bytes; u8 n_l3_address_bytes; u16 opcode; - union { + union + { ethernet_arp_ip4_over_ethernet_address_t ip4_over_ethernet[2]; /* Others... */ @@ -131,4 +140,34 @@ typedef struct { }; } ethernet_arp_header_t; +typedef struct +{ + u32 sw_if_index; + ip4_address_t ip4_address; + + u8 ethernet_address[6]; + + u16 flags; +#define ETHERNET_ARP_IP4_ENTRY_FLAG_STATIC (1 << 0) +#define ETHERNET_ARP_IP4_ENTRY_FLAG_DYNAMIC (1 << 1) + + u64 cpu_time_last_updated; + + /** + * The index of the adj-fib entry created + */ + fib_node_index_t fib_entry_index; +} ethernet_arp_ip4_entry_t; + +ethernet_arp_ip4_entry_t *ip4_neighbor_entries (u32 sw_if_index); +u8 *format_ethernet_arp_ip4_entry (u8 * s, va_list * va); + #endif /* included_ethernet_arp_packet_h */ + +/* + * fd.io coding-style-patch-verification: ON + * + * Local Variables: + * eval: (c-set-style "gnu") + * End: + */