diff options
| author | David Lamparter <equinox@opensourcerouting.org> | 2017-07-10 23:22:46 +0200 |
|---|---|---|
| committer | David Lamparter <equinox@opensourcerouting.org> | 2017-07-10 23:22:46 +0200 |
| commit | 1c95bad18a0256bc7f85db773a39bbc7484078de (patch) | |
| tree | 6230beb732c4faeac5a5a81530a8f043746172ad /lib/prefix.h | |
| parent | 4ad79cbd11be1d08a73bf0fd389139dbedee76bc (diff) | |
| parent | 7fb9d20fcfe5619a2dfb05085f9da5590820ecb5 (diff) | |
Merge branch 'evpn-prep'
First 12-and-a-half commits from PR #619
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Diffstat (limited to 'lib/prefix.h')
| -rw-r--r-- | lib/prefix.h | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/lib/prefix.h b/lib/prefix.h index 24144e80a3..549798e92e 100644 --- a/lib/prefix.h +++ b/lib/prefix.h @@ -32,6 +32,7 @@ # endif #endif #include "sockunion.h" +#include "ipaddr.h" #ifndef ETHER_ADDR_LEN #ifdef ETHERADDRL @@ -62,30 +63,23 @@ struct ethaddr { struct evpn_addr { u_char route_type; - u_char flags; -#define IP_ADDR_NONE 0x0 -#define IP_ADDR_V4 0x1 -#define IP_ADDR_V6 0x2 -#define IP_PREFIX_V4 0x4 -#define IP_PREFIX_V6 0x8 + u_char ip_prefix_length; struct ethaddr mac; uint32_t eth_tag; - u_char ip_prefix_length; + struct ipaddr ip; +#if 0 union { u_char addr; struct in_addr v4_addr; struct in6_addr v6_addr; } ip; +#endif }; -/* EVPN prefix structure. */ -struct prefix_evpn -{ - u_char family; - u_char prefixlen; - struct evpn_addr prefix __attribute__ ((aligned (8))); -}; +#define IS_EVPN_PREFIX_IPADDR_NONE(evp) IS_IPADDR_NONE(&(evp)->prefix.ip) +#define IS_EVPN_PREFIX_IPADDR_V4(evp) IS_IPADDR_V4(&(evp)->prefix.ip) +#define IS_EVPN_PREFIX_IPADDR_V6(evp) IS_IPADDR_V6(&(evp)->prefix.ip) /* * A struct prefix contains an address family, a prefix length, and an @@ -167,6 +161,14 @@ struct prefix_eth struct ethaddr eth_addr __attribute__ ((aligned (8))); /* AF_ETHERNET */ }; +/* EVPN prefix structure. */ +struct prefix_evpn +{ + u_char family; + u_char prefixlen; + struct evpn_addr prefix __attribute__ ((aligned (8))); +}; + /* Prefix for a generic pointer */ struct prefix_ptr { |
