aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/ethernet/arp_packet.h
diff options
context:
space:
mode:
authorNeale Ranns <nranns@cisco.com>2018-08-10 05:30:06 -0700
committerDamjan Marion <dmarion@me.com>2019-01-30 19:47:53 +0000
commit37029305c671f4e2d091d6f6c22142634e409043 (patch)
treef47257c77b860213fcd1901686874dee43ad1f73 /src/vnet/ethernet/arp_packet.h
parent13b2ba2ad5527c8185dce368993a3877e7daf7a2 (diff)
Use IP and MAC API types for neighbors
use address_t and mac_address_t for IPv6 and ARP entries and all other API calls in ip.api aprat from the route ones, that will follow in a separate commit Change-Id: I67161737c2184d3f8fc1e79ebd2b55121c5b0191 Signed-off-by: Neale Ranns <nranns@cisco.com>
Diffstat (limited to 'src/vnet/ethernet/arp_packet.h')
-rw-r--r--src/vnet/ethernet/arp_packet.h35
1 files changed, 6 insertions, 29 deletions
diff --git a/src/vnet/ethernet/arp_packet.h b/src/vnet/ethernet/arp_packet.h
index 206be4162d2..b4e021cce19 100644
--- a/src/vnet/ethernet/arp_packet.h
+++ b/src/vnet/ethernet/arp_packet.h
@@ -18,6 +18,8 @@
#ifndef included_ethernet_arp_packet_h
#define included_ethernet_arp_packet_h
+#include <vnet/ethernet/mac_address.h>
+
#define foreach_ethernet_arp_hardware_type \
_ (0, reserved) \
_ (1, ethernet) \
@@ -119,11 +121,14 @@ typedef enum
/* *INDENT-OFF* */
typedef CLIB_PACKED (struct {
- u8 ethernet[6];
+ mac_address_t mac;
ip4_address_t ip4;
}) ethernet_arp_ip4_over_ethernet_address_t;
/* *INDENT-ON* */
+STATIC_ASSERT (sizeof (ethernet_arp_ip4_over_ethernet_address_t) == 10,
+ "Packet ethernet address and IP4 address too big");
+
typedef struct
{
u16 l2_type;
@@ -140,34 +145,6 @@ 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;
- ip4_address_t ip4_address;
-
- u8 ethernet_address[6];
-
- ethernet_arp_entry_flags_t flags;
-
- f64 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_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);