Go to the documentation of this file.
33 #define IP_MCAST_SUBNET_MASK ((in_addr_t)240<<24)
34 #define IP_MCAST_NETWORK ((in_addr_t)224<<24)
38 #define MROUTE_EXTRACT_SUCCEEDED (1<<0)
39 #define MROUTE_EXTRACT_BCAST (1<<1)
40 #define MROUTE_EXTRACT_MCAST (1<<2)
41 #define MROUTE_EXTRACT_IGMP (1<<3)
43 #define MROUTE_SEC_EXTRACT_SUCCEEDED (1<<(0+MROUTE_SEC_SHIFT))
44 #define MROUTE_SEC_EXTRACT_BCAST (1<<(1+MROUTE_SEC_SHIFT))
45 #define MROUTE_SEC_EXTRACT_MCAST (1<<(2+MROUTE_SEC_SHIFT))
46 #define MROUTE_SEC_EXTRACT_IGMP (1<<(3+MROUTE_SEC_SHIFT))
48 #define MROUTE_SEC_SHIFT 4
55 #define MR_MAX_ADDR_LEN 20
60 #define MR_ADDR_NONE 0
61 #define MR_ADDR_ETHER 1
62 #define MR_ADDR_IPV4 2
63 #define MR_ADDR_IPV6 3
64 #define MR_ADDR_MASK 3
67 #define MR_WITH_PORT 4
70 #define MR_WITH_NETBITS 8
100 #ifndef HAVE_ANONYMOUS_UNION_SUPPORT
103 #define raw_addr mroute_union.raw_addr
104 #define ether mroute_union.ether
105 #define v4 mroute_union.v4
106 #define v6 mroute_union.v6
107 #define v4mappedv6 mroute_union.v4mappedv6
115 "Unexpected struct packing of v4");
118 "Unexpected struct packing of v6");
121 "Unexpected struct packing of v4mappedv6");
126 #define MR_HELPER_NET_LEN 129
157 #define MAPF_SUBNET (1<<0)
158 #define MAPF_IA_EMPTY_IF_UNDEF (1<<1)
159 #define MAPF_SHOW_ARP (1<<2)
161 const unsigned int flags,
176 const struct buffer *buf);
181 const struct buffer *buf);
187 static inline unsigned int
194 unsigned int ret = 0;
225 static inline const uint8_t *
229 return (uint8_t *) &a->
type;
232 static inline uint32_t
235 return (uint32_t) a->
len + 2;
244 dest->
v4.addr = htonl(src);
247 static inline in_addr_t
252 return ntohl(addr->
v4.addr);
void mroute_addr_init(struct mroute_addr *addr)
uint32_t mroute_addr_hash_function(const void *key, uint32_t iv)
union openvpn_sockaddr::@14 addr
static void mroute_addr_reset(struct mroute_addr *ma)
#define static_assert(expr, diagnostic)
static const char *const key1
int net_len_refcount[MR_HELPER_NET_LEN]
unsigned int mroute_extract_addr_ip(struct mroute_addr *src, struct mroute_addr *dest, const struct buffer *buf)
bool mroute_learnable_address(const struct mroute_addr *addr, struct gc_arena *gc)
struct mroute_helper * mroute_helper_init(int ageable_ttl_secs)
const char * mroute_addr_print(const struct mroute_addr *ma, struct gc_arena *gc)
struct mroute_addr::@1::@2 ether
uint8_t net_len[MR_HELPER_NET_LEN]
void mroute_addr_mask_host_bits(struct mroute_addr *ma)
Container for unidirectional cipher and HMAC key material.
void mroute_helper_add_iroute46(struct mroute_helper *mh, int netbits)
#define MR_HELPER_NET_LEN
struct mroute_addr::@1::@3 v4
static uint32_t mroute_addr_hash_len(const struct mroute_addr *a)
uint8_t addr[OPENVPN_ETH_ALEN]
unsigned int cache_generation
#define verify_align_4(ptr)
struct mroute_addr::@1::@5 v4mappedv6
bool mroute_addr_compare_function(const void *key1, const void *key2)
Wrapper structure for dynamically allocated memory.
Garbage collection arena used to keep track of dynamically allocated memory.
unsigned int mroute_extract_addr_ether(struct mroute_addr *src, struct mroute_addr *dest, uint16_t vid, const struct buffer *buf)
static in_addr_t in_addr_t_from_mroute_addr(const struct mroute_addr *addr)
struct mroute_addr::@1::@4 v6
Container for bidirectional cipher and HMAC key material.
static unsigned int mroute_extract_addr_from_packet(struct mroute_addr *src, struct mroute_addr *dest, uint16_t vid, const struct buffer *buf, int tunnel_type)
uint8_t raw_addr[MR_MAX_ADDR_LEN]
const char * mroute_addr_print_ex(const struct mroute_addr *ma, const unsigned int flags, struct gc_arena *gc)
void mroute_helper_free(struct mroute_helper *mh)
void mroute_helper_del_iroute46(struct mroute_helper *mh, int netbits)
static const uint8_t * mroute_addr_hash_ptr(const struct mroute_addr *a)
bool mroute_extract_openvpn_sockaddr(struct mroute_addr *addr, const struct openvpn_sockaddr *osaddr, bool use_port)
static void mroute_extract_in_addr_t(struct mroute_addr *dest, const in_addr_t src)
static bool mroute_addr_equal(const struct mroute_addr *a1, const struct mroute_addr *a2)