OpenVPN
mroute.c File Reference
#include "syshead.h"
#include "mroute.h"
#include "proto.h"
#include "error.h"
#include "socket_util.h"
#include "memdbg.h"
#include "siphash.h"
Include dependency graph for mroute.c:

Go to the source code of this file.

Functions

void mroute_addr_init (struct mroute_addr *addr)
static bool is_mac_mcast_addr (const uint8_t *mac)
static bool is_mac_mcast_maddr (const struct mroute_addr *addr)
bool mroute_learnable_address (const struct mroute_addr *addr, struct gc_arena *gc)
static void mroute_get_in_addr_t (struct mroute_addr *ma, const in_addr_t src)
static void mroute_get_in6_addr (struct mroute_addr *ma, const struct in6_addr src)
static bool mroute_is_mcast (const in_addr_t addr)
static bool mroute_is_mcast_ipv6 (const struct in6_addr addr)
unsigned int mroute_extract_addr_ip (struct mroute_addr *src, struct mroute_addr *dest, const struct buffer *buf)
static void mroute_copy_ether_to_addr (struct mroute_addr *maddr, const uint8_t *ether_addr, uint16_t vid)
unsigned int mroute_extract_addr_ether (struct mroute_addr *src, struct mroute_addr *dest, uint16_t vid, const struct buffer *buf)
bool mroute_extract_openvpn_sockaddr (struct mroute_addr *addr, const struct openvpn_sockaddr *osaddr, bool use_port)
void mroute_addr_mask_host_bits (struct mroute_addr *ma)
uint64_t mroute_addr_hash_function (const void *key, const uint8_t hash_key[HASH_KEY_LEN])
bool mroute_addr_compare_function (const void *key1, const void *key2)
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)
struct mroute_helper * mroute_helper_init (int ageable_ttl_secs)
static void mroute_helper_regenerate (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)
void mroute_helper_free (struct mroute_helper *mh)

Function Documentation

◆ is_mac_mcast_addr()

bool is_mac_mcast_addr ( const uint8_t * mac)
inlinestatic

Definition at line 49 of file mroute.c.

Referenced by is_mac_mcast_maddr(), and mroute_extract_addr_ether().

◆ is_mac_mcast_maddr()

bool is_mac_mcast_maddr ( const struct mroute_addr * addr)
inlinestatic

◆ mroute_addr_compare_function()

bool mroute_addr_compare_function ( const void * key1,
const void * key2 )

Definition at line 366 of file mroute.c.

References mroute_addr_equal().

Referenced by multi_init().

◆ mroute_addr_hash_function()

uint64_t mroute_addr_hash_function ( const void * key,
const uint8_t hash_key[HASH_KEY_LEN] )

Definition at line 359 of file mroute.c.

References HASH_KEY_LEN, mroute_addr_hash_len(), mroute_addr_hash_ptr(), and siphash_hash_func().

Referenced by multi_init().

◆ mroute_addr_init()

void mroute_addr_init ( struct mroute_addr * addr)

Definition at line 39 of file mroute.c.

References CLEAR.

Referenced by multi_create_instance().

◆ mroute_addr_mask_host_bits()

◆ mroute_addr_print()

◆ mroute_addr_print_ex()

◆ mroute_copy_ether_to_addr()

void mroute_copy_ether_to_addr ( struct mroute_addr * maddr,
const uint8_t * ether_addr,
uint16_t vid )
static

◆ mroute_extract_addr_ether()

unsigned int mroute_extract_addr_ether ( struct mroute_addr * src,
struct mroute_addr * dest,
uint16_t vid,
const struct buffer * buf )

◆ mroute_extract_addr_ip()

◆ mroute_extract_openvpn_sockaddr()

◆ mroute_get_in6_addr()

void mroute_get_in6_addr ( struct mroute_addr * ma,
const struct in6_addr src )
inlinestatic

◆ mroute_get_in_addr_t()

void mroute_get_in_addr_t ( struct mroute_addr * ma,
const in_addr_t src )
inlinestatic

◆ mroute_helper_add_iroute46()

void mroute_helper_add_iroute46 ( struct mroute_helper * mh,
int netbits )

◆ mroute_helper_del_iroute46()

void mroute_helper_del_iroute46 ( struct mroute_helper * mh,
int netbits )

◆ mroute_helper_free()

void mroute_helper_free ( struct mroute_helper * mh)

Definition at line 552 of file mroute.c.

Referenced by multi_uninit().

◆ mroute_helper_init()

struct mroute_helper * mroute_helper_init ( int ageable_ttl_secs)

Definition at line 483 of file mroute.c.

References mroute_helper::ageable_ttl_secs, and ALLOC_OBJ_CLEAR.

Referenced by multi_init().

◆ mroute_helper_regenerate()

◆ mroute_is_mcast()

bool mroute_is_mcast ( const in_addr_t addr)
inlinestatic

Definition at line 132 of file mroute.c.

References IP_MCAST_NETWORK, and IP_MCAST_SUBNET_MASK.

Referenced by mroute_extract_addr_ip().

◆ mroute_is_mcast_ipv6()

bool mroute_is_mcast_ipv6 ( const struct in6_addr addr)
inlinestatic

Definition at line 141 of file mroute.c.

Referenced by mroute_extract_addr_ip().

◆ mroute_learnable_address()

bool mroute_learnable_address ( const struct mroute_addr * addr,
struct gc_arena * gc )