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

Go to the source code of this file.


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, unsigned int mask)
static void mroute_get_in6_addr (struct mroute_addr *ma, const struct in6_addr src, unsigned int mask)
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, struct mroute_addr *esrc, struct mroute_addr *edest, 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)
uint32_t mroute_addr_hash_function (const void *key, uint32_t iv)
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_helpermroute_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()

static bool is_mac_mcast_addr ( const uint8_t *  mac)

Definition at line 51 of file mroute.c.

Referenced by is_mac_mcast_maddr(), and mroute_extract_addr_ether().

◆ is_mac_mcast_maddr()

static bool is_mac_mcast_maddr ( const struct mroute_addr addr)

◆ mroute_addr_compare_function()

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

Definition at line 441 of file mroute.c.

References mroute_addr_equal().

Referenced by multi_init().

◆ mroute_addr_hash_function()

uint32_t mroute_addr_hash_function ( const void *  key,
uint32_t  iv 

Definition at line 433 of file mroute.c.

References hash_func(), mroute_addr_hash_len(), and mroute_addr_hash_ptr().

Referenced by multi_init().

◆ mroute_addr_init()

void mroute_addr_init ( struct mroute_addr addr)

Definition at line 41 of file mroute.c.

References CLEAR.

Referenced by multi_create_instance().

◆ mroute_addr_mask_host_bits()

void mroute_addr_mask_host_bits ( struct mroute_addr ma)

◆ mroute_addr_print()

const char* mroute_addr_print ( const struct mroute_addr ma,
struct gc_arena gc 

◆ mroute_addr_print_ex()

const char* mroute_addr_print_ex ( const struct mroute_addr ma,
const unsigned int  flags,
struct gc_arena gc 

◆ mroute_copy_ether_to_addr()

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

◆ mroute_extract_addr_ether()

unsigned int mroute_extract_addr_ether ( struct mroute_addr src,
struct mroute_addr dest,
struct mroute_addr esrc,
struct mroute_addr edest,
uint16_t  vid,
const struct buffer buf 

◆ mroute_extract_addr_ip()

unsigned int mroute_extract_addr_ip ( struct mroute_addr src,
struct mroute_addr dest,
const struct buffer buf 

◆ mroute_extract_openvpn_sockaddr()

bool mroute_extract_openvpn_sockaddr ( struct mroute_addr addr,
const struct openvpn_sockaddr osaddr,
bool  use_port 

◆ mroute_get_in6_addr()

static void mroute_get_in6_addr ( struct mroute_addr ma,
const struct in6_addr  src,
unsigned int  mask 

◆ mroute_get_in_addr_t()

static void mroute_get_in_addr_t ( struct mroute_addr ma,
const in_addr_t  src,
unsigned int  mask 

◆ 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 612 of file mroute.c.

References free.

Referenced by multi_uninit().

◆ mroute_helper_init()

struct mroute_helper* mroute_helper_init ( int  ageable_ttl_secs)

Definition at line 543 of file mroute.c.

References mroute_helper::ageable_ttl_secs, and ALLOC_OBJ_CLEAR.

Referenced by multi_init().

◆ mroute_helper_regenerate()

static void mroute_helper_regenerate ( struct mroute_helper mh)

◆ mroute_is_mcast()

static bool mroute_is_mcast ( const in_addr_t  addr)

Definition at line 137 of file mroute.c.


Referenced by mroute_extract_addr_ip(), and mroute_is_mcast_ipv6().

◆ mroute_is_mcast_ipv6()

static bool mroute_is_mcast_ipv6 ( const struct in6_addr  addr)

◆ mroute_learnable_address()

bool mroute_learnable_address ( const struct mroute_addr addr,
struct gc_arena gc