aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet
diff options
context:
space:
mode:
Diffstat (limited to 'src/vnet')
-rw-r--r--src/vnet/ethernet/arp_packet.h3
-rw-r--r--src/vnet/ethernet/mac_address.h6
2 files changed, 9 insertions, 0 deletions
diff --git a/src/vnet/ethernet/arp_packet.h b/src/vnet/ethernet/arp_packet.h
index a35adf17c85..6b4dfa6ab3d 100644
--- a/src/vnet/ethernet/arp_packet.h
+++ b/src/vnet/ethernet/arp_packet.h
@@ -146,6 +146,9 @@ typedef struct
};
} ethernet_arp_header_t;
+#define ARP_SENDER 0
+#define ARP_TARGET 1
+
extern u8 *format_ethernet_arp_header (u8 * s, va_list * va);
extern u8 *format_ethernet_arp_opcode (u8 * s, va_list * va);
extern u8 *format_ethernet_arp_hardware_type (u8 * s, va_list * va);
diff --git a/src/vnet/ethernet/mac_address.h b/src/vnet/ethernet/mac_address.h
index aa773c5c449..68feb3977f0 100644
--- a/src/vnet/ethernet/mac_address.h
+++ b/src/vnet/ethernet/mac_address.h
@@ -149,6 +149,12 @@ mac_address_set_zero (mac_address_t * mac)
mac->u.last_2 = 0;
}
+static_always_inline int
+mac_address_n_bits_set (const mac_address_t * a)
+{
+ return (count_set_bits (mac_address_as_u64 (a)));
+}
+
extern void mac_address_increment (mac_address_t * mac);
extern uword unformat_mac_address_t (unformat_input_t * input,
va_list * args);