};
};
+/* Ethernet address constant, e.g. ETH_ADDR_C(01,23,45,67,89,ab) is
+ * 01:23:45:67:89:ab. */
+#define ETH_ADDR_C(A,B,C,D,E,F) (struct eth_addr) \
+ { { .ea = { 0x##A, 0x##B, 0x##C, 0x##D, 0x##E, 0x##F } } }
+
/* Similar to struct eth_addr, for EUI-64 addresses. */
struct eth_addr64 {
union {
};
};
+/* EUI-64 address constant, e.g. ETH_ADDR_C(01,23,45,67,89,ab,cd,ef) is
+ * 01:23:45:67:89:ab:cd:ef. */
+#define ETH_ADDR64_C(A,B,C,D,E,F,G,H) (struct eth_addr64) \
+ { { .ea64 = { 0x##A, 0x##B, 0x##C, 0x##D, \
+ 0x##E, 0x##F, 0x##G, 0x##H} } }
+
#ifdef __cplusplus
}
#endif
#define CFM_MAX_RMPS 256
/* Ethernet destination address of CCM packets. */
-static const struct eth_addr eth_addr_ccm = {
- { { 0x01, 0x80, 0xC2, 0x00, 0x00, 0x30 } } };
-static const struct eth_addr eth_addr_ccm_x = {
- { { 0x01, 0x23, 0x20, 0x00, 0x00, 0x30 } } };
+static const struct eth_addr eth_addr_ccm = ETH_ADDR_C(01,80,c2,00,00,30);
+static const struct eth_addr eth_addr_ccm_x = ETH_ADDR_C(01,23,20,00,00,30);
#define ETH_TYPE_CFM 0x8902
#ifndef _LLDP_TLV_H
#define _LLDP_TLV_H
-#define LLDP_MULTICAST_ADDR { \
- { { 0x01, 0x80, 0xc2, 0x00, 0x00, 0x0e } } \
-}
+#define LLDP_MULTICAST_ADDR ETH_ADDR_C(01,80,c2,00,00,0e)
#define LLDP_TLV_END 0
#define LLDP_TLV_CHASSIS_ID 1
{
struct lldpd *mylldpd = lldp->lldpd;
struct lldpd_hardware *hw = lldpd_first_hardware(mylldpd);
- static const struct eth_addr eth_addr_lldp =
- { { { 0x01, 0x80, 0xC2, 0x00, 0x00, 0x0e } } };
+ static const struct eth_addr eth_addr_lldp = ETH_ADDR_C(01,80,c2,00,00,0e);
ovs_mutex_lock(&mutex);
#define ETH_ADDR_LEN 6
static const struct eth_addr eth_addr_broadcast OVS_UNUSED
- = { { { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff } } };
+ = ETH_ADDR_C(ff,ff,ff,ff,ff,ff);
static const struct eth_addr eth_addr_exact OVS_UNUSED
- = { { { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff } } };
+ = ETH_ADDR_C(ff,ff,ff,ff,ff,ff);
static const struct eth_addr eth_addr_zero OVS_UNUSED
- = { { { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } } };
+ = ETH_ADDR_C(00,00,00,00,00,00);
static const struct eth_addr64 eth_addr64_zero OVS_UNUSED
- = { { { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } } };
+ = ETH_ADDR64_C(00,00,00,00,00,00,00,00);
static const struct eth_addr eth_addr_stp OVS_UNUSED
- = { { { 0x01, 0x80, 0xC2, 0x00, 0x00, 0x00 } } };
+ = ETH_ADDR_C(01,80,c2,00,00,00);
static const struct eth_addr eth_addr_lacp OVS_UNUSED
- = { { { 0x01, 0x80, 0xC2, 0x00, 0x00, 0x02 } } };
+ = ETH_ADDR_C(01,80,c2,00,00,02);
static const struct eth_addr eth_addr_bfd OVS_UNUSED
- = { { { 0x00, 0x23, 0x20, 0x00, 0x00, 0x01 } } };
+ = ETH_ADDR_C(00,23,20,00,00,01);
static inline bool eth_addr_is_broadcast(const struct eth_addr a)
{
#define ETH_TYPE_LLDP 0x88cc
/* Dummy MAC addresses */
-static const struct eth_addr chassis_mac = { { { 0x5e, 0x10, 0x8e, 0xe7, 0x84, 0xad } } };
-static const struct eth_addr eth_src = { { { 0x5e, 0x10, 0x8e, 0xe7, 0x84, 0xad } } };
+static const struct eth_addr chassis_mac = ETH_ADDR_C(5e,10,8e,e7,84,ad);
+static const struct eth_addr eth_src = ETH_ADDR_C(5e,10,8e,e7,84,ad);
/* LLDP multicast address */
-static const struct eth_addr eth_addr_lldp = { { { 0x01, 0x80, 0xC2, 0x00, 0x00, 0x0e } } };
+static const struct eth_addr eth_addr_lldp = ETH_ADDR_C(01,80,c2,00,00,0e);
/* Count of tests run */
static int num_tests = 0;
CONSTANT_HTONS(80) };
static ovs_be16 tp_dst_values[] = { CONSTANT_HTONS(6667), CONSTANT_HTONS(22) };
static struct eth_addr dl_src_values[] = {
- { { { 0x00, 0x02, 0xe3, 0x0f, 0x80, 0xa4 } } },
- { { { 0x5e, 0x33, 0x7f, 0x5f, 0x1e, 0x99 } } } };
+ ETH_ADDR_C(00,02,e3,0f,80,a4),
+ ETH_ADDR_C(5e,33,7f,5f,1e,99)
+};
static struct eth_addr dl_dst_values[] = {
- { { { 0x4a, 0x27, 0x71, 0xae, 0x64, 0xc1 } } },
- { { { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff } } } };
+ ETH_ADDR_C(4a,27,71,ae,64,c1),
+ ETH_ADDR_C(ff,ff,ff,ff,ff,ff)
+};
static uint8_t nw_proto_values[] = { IPPROTO_TCP, IPPROTO_ICMP };
static uint8_t nw_dscp_values[] = { 48, 0 };