VPP-130: MagLev-like Load Balancer
[vpp.git] / vnet / vnet / ethernet / ethernet.h
index f519f4f..4735e20 100644 (file)
@@ -264,6 +264,7 @@ ethernet_register_l3_redirect (vlib_main_t * vm,
 /* Formats ethernet address X:X:X:X:X:X */
 u8 * format_ethernet_address (u8 * s, va_list * args);
 u8 * format_ethernet_type (u8 * s, va_list * args);
+u8 * format_ethernet_vlan_tci (u8 * s, va_list * va);
 u8 * format_ethernet_header (u8 * s, va_list * args);
 u8 * format_ethernet_header_with_length (u8 * s, va_list * args);
 
@@ -472,6 +473,14 @@ eth_identify_subint (vnet_hw_interface_t * hi,
   return 1;
 }
 
+// Compare two ethernet macs. Return 1 if they are the same, 0 if different
+always_inline u32
+eth_mac_equal (u8 * mac1, u8 * mac2) {
+  return (*((u32 *)(mac1+0)) == *((u32 *)(mac2+0)) &&
+          *((u32 *)(mac1+2)) == *((u32 *)(mac2+2)));
+}
+
+
 always_inline ethernet_main_t * 
 vnet_get_ethernet_main (void)
 {