OpenVPN
|
Go to the source code of this file.
Data Structures | |
struct | mroute_addr |
struct | mroute_helper |
Macros | |
#define | IP_MCAST_SUBNET_MASK ((in_addr_t)240<<24) |
#define | IP_MCAST_NETWORK ((in_addr_t)224<<24) |
#define | MROUTE_EXTRACT_SUCCEEDED (1<<0) |
#define | MROUTE_EXTRACT_BCAST (1<<1) |
#define | MROUTE_EXTRACT_MCAST (1<<2) |
#define | MROUTE_EXTRACT_IGMP (1<<3) |
#define | MROUTE_SEC_EXTRACT_SUCCEEDED (1<<(0+MROUTE_SEC_SHIFT)) |
#define | MROUTE_SEC_EXTRACT_BCAST (1<<(1+MROUTE_SEC_SHIFT)) |
#define | MROUTE_SEC_EXTRACT_MCAST (1<<(2+MROUTE_SEC_SHIFT)) |
#define | MROUTE_SEC_EXTRACT_IGMP (1<<(3+MROUTE_SEC_SHIFT)) |
#define | MROUTE_SEC_SHIFT 4 |
#define | MR_MAX_ADDR_LEN 20 |
#define | MR_ADDR_NONE 0 |
#define | MR_ADDR_ETHER 1 |
#define | MR_ADDR_IPV4 2 |
#define | MR_ADDR_IPV6 3 |
#define | MR_ADDR_MASK 3 |
#define | MR_WITH_PORT 4 |
#define | MR_WITH_NETBITS 8 |
#define | MR_ARP 16 |
#define | raw_addr mroute_union.raw_addr |
#define | ether mroute_union.ether |
#define | v4 mroute_union.v4 |
#define | v6 mroute_union.v6 |
#define | v4mappedv6 mroute_union.v4mappedv6 |
#define | MR_HELPER_NET_LEN 129 |
#define | MAPF_SUBNET (1<<0) |
#define | MAPF_IA_EMPTY_IF_UNDEF (1<<1) |
#define | MAPF_SHOW_ARP (1<<2) |
Functions | |
bool | mroute_extract_openvpn_sockaddr (struct mroute_addr *addr, const struct openvpn_sockaddr *osaddr, bool use_port) |
bool | mroute_learnable_address (const struct mroute_addr *addr, struct gc_arena *gc) |
uint32_t | mroute_addr_hash_function (const void *key, uint32_t iv) |
bool | mroute_addr_compare_function (const void *key1, const void *key2) |
void | mroute_addr_init (struct mroute_addr *addr) |
const char * | mroute_addr_print (const struct mroute_addr *ma, struct gc_arena *gc) |
const char * | mroute_addr_print_ex (const struct mroute_addr *ma, const unsigned int flags, struct gc_arena *gc) |
void | mroute_addr_mask_host_bits (struct mroute_addr *ma) |
struct mroute_helper * | mroute_helper_init (int ageable_ttl_secs) |
void | mroute_helper_free (struct mroute_helper *mh) |
void | mroute_helper_add_iroute46 (struct mroute_helper *mh, int netbits) |
void | mroute_helper_del_iroute46 (struct mroute_helper *mh, int netbits) |
unsigned int | mroute_extract_addr_ip (struct mroute_addr *src, struct mroute_addr *dest, const struct buffer *buf) |
unsigned int | mroute_extract_addr_ether (struct mroute_addr *src, struct mroute_addr *dest, uint16_t vid, const struct buffer *buf) |
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) |
static bool | mroute_addr_equal (const struct mroute_addr *a1, const struct mroute_addr *a2) |
static const uint8_t * | mroute_addr_hash_ptr (const struct mroute_addr *a) |
static uint32_t | mroute_addr_hash_len (const struct mroute_addr *a) |
static void | mroute_extract_in_addr_t (struct mroute_addr *dest, const in_addr_t src) |
static in_addr_t | in_addr_t_from_mroute_addr (const struct mroute_addr *addr) |
static void | mroute_addr_reset (struct mroute_addr *ma) |
#define ether mroute_union.ether |
#define MROUTE_SEC_EXTRACT_BCAST (1<<(1+MROUTE_SEC_SHIFT)) |
#define MROUTE_SEC_EXTRACT_IGMP (1<<(3+MROUTE_SEC_SHIFT)) |
#define MROUTE_SEC_EXTRACT_MCAST (1<<(2+MROUTE_SEC_SHIFT)) |
#define MROUTE_SEC_EXTRACT_SUCCEEDED (1<<(0+MROUTE_SEC_SHIFT)) |
#define raw_addr mroute_union.raw_addr |
#define v4 mroute_union.v4 |
#define v4mappedv6 mroute_union.v4mappedv6 |
#define v6 mroute_union.v6 |
|
inlinestatic |
Definition at line 248 of file mroute.h.
References mroute_addr::len, MR_ADDR_IPV4, MR_ADDR_MASK, mroute_addr::netbits, mroute_addr::type, and mroute_addr::v4.
bool mroute_addr_compare_function | ( | const void * | key1, |
const void * | key2 | ||
) |
Definition at line 369 of file mroute.c.
References key1, and mroute_addr_equal().
Referenced by multi_init().
|
inlinestatic |
Definition at line 208 of file mroute.h.
References mroute_addr::len, mroute_addr::netbits, mroute_addr::raw_addr, and mroute_addr::type.
Referenced by management_callback_kill_by_addr(), mroute_addr_compare_function(), multi_get_instance_by_virtual_addr(), and multi_learn_addr().
uint32_t mroute_addr_hash_function | ( | const void * | key, |
uint32_t | iv | ||
) |
Definition at line 361 of file mroute.c.
References hash_func(), mroute_addr_hash_len(), and mroute_addr_hash_ptr().
Referenced by multi_init().
|
inlinestatic |
Definition at line 233 of file mroute.h.
References mroute_addr::len.
Referenced by mroute_addr_hash_function().
|
inlinestatic |
Definition at line 226 of file mroute.h.
References mroute_addr::type.
Referenced by mroute_addr_hash_function().
void mroute_addr_init | ( | struct mroute_addr * | addr | ) |
void mroute_addr_mask_host_bits | ( | struct mroute_addr * | ma | ) |
Definition at line 321 of file mroute.c.
References ASSERT, IPV4_NETMASK_HOST, MR_ADDR_IPV4, MR_ADDR_IPV6, MR_ADDR_MASK, mroute_addr::netbits, netbits_to_netmask(), mroute_addr::type, mroute_addr::v4, and mroute_addr::v6.
Referenced by multi_get_instance_by_virtual_addr(), and multi_learn_in6_addr().
const char* mroute_addr_print | ( | const struct mroute_addr * | ma, |
struct gc_arena * | gc | ||
) |
Definition at line 376 of file mroute.c.
References MAPF_IA_EMPTY_IF_UNDEF, and mroute_addr_print_ex().
Referenced by check_stale_routes(), learn_address_script(), mroute_learnable_address(), multi_create_instance(), multi_create_instance_tcp(), multi_get_create_instance_udp(), multi_get_instance_by_virtual_addr(), multi_instance_string(), multi_learn_addr(), multi_print_status(), multi_process_float(), multi_process_incoming_link(), and multi_reap_range().
const char* mroute_addr_print_ex | ( | const struct mroute_addr * | ma, |
const unsigned int | flags, | ||
struct gc_arena * | gc | ||
) |
Definition at line 383 of file mroute.c.
References alloc_buf_gc(), BSTR, buf_printf(), mroute_addr::ether, format_hex_ex(), IA_EMPTY_IF_UNDEF, IA_NET_ORDER, MAPF_IA_EMPTY_IF_UNDEF, MAPF_SHOW_ARP, MAPF_SUBNET, MR_ADDR_ETHER, MR_ADDR_IPV4, MR_ADDR_IPV6, MR_ADDR_MASK, MR_ARP, MR_WITH_NETBITS, MR_WITH_PORT, mroute_addr::netbits, netbits_to_netmask(), print_in6_addr(), print_in_addr_t(), mroute_addr::type, mroute_addr::v4, mroute_addr::v4mappedv6, and mroute_addr::v6.
Referenced by management_learn_addr(), and mroute_addr_print().
|
inlinestatic |
Definition at line 261 of file mroute.h.
References mroute_addr::len, MR_ADDR_NONE, and mroute_addr::type.
unsigned int mroute_extract_addr_ether | ( | struct mroute_addr * | src, |
struct mroute_addr * | dest, | ||
uint16_t | vid, | ||
const struct buffer * | buf | ||
) |
Definition at line 229 of file mroute.c.
References BLEN, BPTR, openvpn_ethhdr::dest, is_mac_mcast_addr(), mroute_copy_ether_to_addr(), MROUTE_EXTRACT_BCAST, MROUTE_EXTRACT_SUCCEEDED, and openvpn_ethhdr::source.
Referenced by mroute_extract_addr_from_packet().
|
inlinestatic |
Definition at line 188 of file mroute.h.
References DEV_TYPE_TAP, DEV_TYPE_TUN, mroute_extract_addr_ether(), mroute_extract_addr_ip(), and verify_align_4.
Referenced by multi_process_incoming_link(), and multi_process_incoming_tun().
unsigned int mroute_extract_addr_ip | ( | struct mroute_addr * | src, |
struct mroute_addr * | dest, | ||
const struct buffer * | buf | ||
) |
Definition at line 151 of file mroute.c.
References BLEN, BPTR, openvpn_iphdr::daddr, openvpn_ipv6hdr::daddr, gc_free(), gc_new(), M_INFO, M_WARN, MROUTE_EXTRACT_IGMP, MROUTE_EXTRACT_MCAST, MROUTE_EXTRACT_SUCCEEDED, mroute_get_in6_addr(), mroute_get_in_addr_t(), mroute_is_mcast(), mroute_is_mcast_ipv6(), msg, OPENVPN_IPH_GET_VER, OPENVPN_IPPROTO_IGMP, print_in6_addr(), openvpn_iphdr::protocol, openvpn_iphdr::saddr, and openvpn_ipv6hdr::saddr.
Referenced by mroute_extract_addr_from_packet().
|
inlinestatic |
Definition at line 239 of file mroute.h.
References mroute_addr::len, MR_ADDR_IPV4, mroute_addr::netbits, mroute_addr::type, and mroute_addr::v4.
Referenced by multi_init().
bool mroute_extract_openvpn_sockaddr | ( | struct mroute_addr * | addr, |
const struct openvpn_sockaddr * | osaddr, | ||
bool | use_port | ||
) |
Definition at line 264 of file mroute.c.
References openvpn_sockaddr::addr, openvpn_sockaddr::in4, openvpn_sockaddr::in6, mroute_addr::len, MR_ADDR_IPV4, MR_ADDR_IPV6, MR_WITH_PORT, mroute_addr::netbits, openvpn_sockaddr::sa, mroute_addr::type, mroute_addr::v4, and mroute_addr::v6.
Referenced by management_callback_kill_by_addr(), multi_get_create_instance_udp(), multi_learn_in_addr_t(), multi_process_float(), and multi_tcp_instance_specific_init().
void mroute_helper_add_iroute46 | ( | struct mroute_helper * | mh, |
int | netbits | ||
) |
Definition at line 509 of file mroute.c.
References ASSERT, mroute_helper::cache_generation, MR_HELPER_NET_LEN, mroute_helper_regenerate(), and mroute_helper::net_len_refcount.
Referenced by multi_add_iroutes().
void mroute_helper_del_iroute46 | ( | struct mroute_helper * | mh, |
int | netbits | ||
) |
Definition at line 524 of file mroute.c.
References ASSERT, mroute_helper::cache_generation, MR_HELPER_NET_LEN, mroute_helper_regenerate(), and mroute_helper::net_len_refcount.
Referenced by multi_del_iroutes().
void mroute_helper_free | ( | struct mroute_helper * | mh | ) |
Definition at line 540 of file mroute.c.
Referenced by multi_uninit().
struct mroute_helper* mroute_helper_init | ( | int | ageable_ttl_secs | ) |
Definition at line 471 of file mroute.c.
References mroute_helper::ageable_ttl_secs, and ALLOC_OBJ_CLEAR.
Referenced by multi_init().
bool mroute_learnable_address | ( | const struct mroute_addr * | addr, |
struct gc_arena * | gc | ||
) |
Definition at line 65 of file mroute.c.
References D_MULTI_LOW, is_mac_mcast_maddr(), mroute_addr::len, MR_WITH_NETBITS, mroute_addr_print(), msg, mroute_addr::netbits, mroute_addr::raw_addr, and mroute_addr::type.
Referenced by multi_learn_addr().