OpenVPN
Macros | Functions
route.c File Reference
#include <stddef.h>
#include <stdbool.h>
#include "syshead.h"
#include "common.h"
#include "error.h"
#include "route.h"
#include "run_command.h"
#include "socket.h"
#include "manage.h"
#include "win32.h"
#include "options.h"
#include "networking.h"
#include "integer.h"
#include "memdbg.h"
#include "openvpn-msg.h"
Include dependency graph for route.c:

Go to the source code of this file.

Macros

#define METRIC_NOT_USED   ((DWORD)-1)
 
#define RTA_ERROR   0 /* route addition failed */
 
#define RTA_SUCCESS   1 /* route addition succeeded */
 
#define RTA_EEXIST   2 /* route not added as it already exists */
 
#define LR_NOMATCH   0 /* route is not local */
 
#define LR_MATCH   1 /* route is local */
 
#define LR_ERROR   2 /* caller should abort adding route */
 

Functions

static int add_route_service (const struct route_ipv4 *, const struct tuntap *)
 
static bool del_route_service (const struct route_ipv4 *, const struct tuntap *)
 
static int add_route_ipv6_service (const struct route_ipv6 *, const struct tuntap *)
 
static bool del_route_ipv6_service (const struct route_ipv6 *, const struct tuntap *)
 
static int route_ipv6_ipapi (bool add, const struct route_ipv6 *, const struct tuntap *)
 
static int add_route_ipapi (const struct route_ipv4 *r, const struct tuntap *tt, DWORD adapter_index)
 
static bool del_route_ipapi (const struct route_ipv4 *r, const struct tuntap *tt)
 
static void delete_route (struct route_ipv4 *r, const struct tuntap *tt, unsigned int flags, const struct route_gateway_info *rgi, const struct env_set *es, openvpn_net_ctx_t *ctx)
 
static void get_bypass_addresses (struct route_bypass *rb, const unsigned int flags)
 
static bool add_bypass_address (struct route_bypass *rb, const in_addr_t a)
 
struct route_option_listnew_route_option_list (struct gc_arena *a)
 
struct route_ipv6_option_listnew_route_ipv6_option_list (struct gc_arena *a)
 
struct route_option_listclone_route_option_list (const struct route_option_list *src, struct gc_arena *a)
 
struct route_ipv6_option_listclone_route_ipv6_option_list (const struct route_ipv6_option_list *src, struct gc_arena *a)
 
void copy_route_option_list (struct route_option_list *dest, const struct route_option_list *src, struct gc_arena *a)
 
void copy_route_ipv6_option_list (struct route_ipv6_option_list *dest, const struct route_ipv6_option_list *src, struct gc_arena *a)
 
static const char * route_string (const struct route_ipv4 *r, struct gc_arena *gc)
 
static bool is_route_parm_defined (const char *parm)
 
static void setenv_route_addr (struct env_set *es, const char *key, const in_addr_t addr, int i)
 
static bool get_special_addr (const struct route_list *rl, const char *string, in_addr_t *out, bool *status)
 
bool is_special_addr (const char *addr_str)
 
static bool init_route (struct route_ipv4 *r, struct addrinfo **network_list, const struct route_option *ro, const struct route_list *rl)
 
static bool init_route_ipv6 (struct route_ipv6 *r6, const struct route_ipv6_option *r6o, const struct route_ipv6_list *rl6)
 
void add_route_to_option_list (struct route_option_list *l, const char *network, const char *netmask, const char *gateway, const char *metric)
 
void add_route_ipv6_to_option_list (struct route_ipv6_option_list *l, const char *prefix, const char *gateway, const char *metric)
 
static void clear_route_list (struct route_list *rl)
 
static void clear_route_ipv6_list (struct route_ipv6_list *rl6)
 
void route_list_add_vpn_gateway (struct route_list *rl, struct env_set *es, const in_addr_t addr)
 
static void add_block_local_item (struct route_list *rl, const struct route_gateway_address *gateway, in_addr_t target)
 
static void add_block_local_routes (struct route_list *rl)
 
bool block_local_needed (const struct route_list *rl)
 Get the decision whether to block traffic to local networks while the VPN is connected. More...
 
bool init_route_list (struct route_list *rl, const struct route_option_list *opt, const char *remote_endpoint, int default_metric, in_addr_t remote_host, struct env_set *es, openvpn_net_ctx_t *ctx)
 
static bool route_ipv6_match_host (const struct route_ipv6 *r6, const struct in6_addr *host)
 
bool init_route_ipv6_list (struct route_ipv6_list *rl6, const struct route_ipv6_option_list *opt6, const char *remote_endpoint, int default_metric, const struct in6_addr *remote_host_ipv6, struct env_set *es, openvpn_net_ctx_t *ctx)
 
static bool add_route3 (in_addr_t network, in_addr_t netmask, in_addr_t gateway, const struct tuntap *tt, unsigned int flags, const struct route_gateway_info *rgi, const struct env_set *es, openvpn_net_ctx_t *ctx)
 
static void del_route3 (in_addr_t network, in_addr_t netmask, in_addr_t gateway, const struct tuntap *tt, unsigned int flags, const struct route_gateway_info *rgi, const struct env_set *es, openvpn_net_ctx_t *ctx)
 
static bool add_bypass_routes (struct route_bypass *rb, in_addr_t gateway, const struct tuntap *tt, unsigned int flags, const struct route_gateway_info *rgi, const struct env_set *es, openvpn_net_ctx_t *ctx)
 
static void del_bypass_routes (struct route_bypass *rb, in_addr_t gateway, const struct tuntap *tt, unsigned int flags, const struct route_gateway_info *rgi, const struct env_set *es, openvpn_net_ctx_t *ctx)
 
static bool redirect_default_route_to_vpn (struct route_list *rl, const struct tuntap *tt, unsigned int flags, const struct env_set *es, openvpn_net_ctx_t *ctx)
 
static void undo_redirect_default_route_to_vpn (struct route_list *rl, const struct tuntap *tt, unsigned int flags, const struct env_set *es, openvpn_net_ctx_t *ctx)
 
bool add_routes (struct route_list *rl, struct route_ipv6_list *rl6, const struct tuntap *tt, unsigned int flags, const struct env_set *es, openvpn_net_ctx_t *ctx)
 
void delete_routes (struct route_list *rl, struct route_ipv6_list *rl6, const struct tuntap *tt, unsigned int flags, const struct env_set *es, openvpn_net_ctx_t *ctx)
 
static const char * show_opt (const char *option)
 
static void print_route_option (const struct route_option *ro, int level)
 
void print_route_options (const struct route_option_list *rol, int level)
 
void print_default_gateway (const int msglevel, const struct route_gateway_info *rgi, const struct route_ipv6_gateway_info *rgi6)
 
static void print_route (const struct route_ipv4 *r, int level)
 
void print_routes (const struct route_list *rl, int level)
 
static void setenv_route (struct env_set *es, const struct route_ipv4 *r, int i)
 
void setenv_routes (struct env_set *es, const struct route_list *rl)
 
static void setenv_route_ipv6 (struct env_set *es, const struct route_ipv6 *r6, int i)
 
void setenv_routes_ipv6 (struct env_set *es, const struct route_ipv6_list *rl6)
 
static int local_route (in_addr_t network, in_addr_t netmask, in_addr_t gateway, const struct route_gateway_info *rgi)
 
static bool is_on_link (const int is_local_route, const unsigned int flags, const struct route_gateway_info *rgi)
 
bool add_route (struct route_ipv4 *r, const struct tuntap *tt, unsigned int flags, const struct route_gateway_info *rgi, const struct env_set *es, openvpn_net_ctx_t *ctx)
 
void route_ipv6_clear_host_bits (struct route_ipv6 *r6)
 
bool add_route_ipv6 (struct route_ipv6 *r6, const struct tuntap *tt, unsigned int flags, const struct env_set *es, openvpn_net_ctx_t *ctx)
 
void delete_route_ipv6 (const struct route_ipv6 *r6, const struct tuntap *tt, unsigned int flags, const struct env_set *es, openvpn_net_ctx_t *ctx)
 
static const MIB_IPFORWARDTABLE * get_windows_routing_table (struct gc_arena *gc)
 
static int test_route (const IP_ADAPTER_INFO *adapters, const in_addr_t gateway, DWORD *index)
 
static void test_route_helper (bool *ret, int *count, int *good, int *ambig, const IP_ADAPTER_INFO *adapters, const in_addr_t gateway)
 
bool test_routes (const struct route_list *rl, const struct tuntap *tt)
 
static const MIB_IPFORWARDROW * get_default_gateway_row (const MIB_IPFORWARDTABLE *routes)
 
void get_default_gateway (struct route_gateway_info *rgi, openvpn_net_ctx_t *ctx)
 
static DWORD windows_route_find_if_index (const struct route_ipv4 *r, const struct tuntap *tt)
 
void get_default_gateway_ipv6 (struct route_ipv6_gateway_info *rgi6, const struct in6_addr *dest, openvpn_net_ctx_t *ctx)
 
static int do_route_service (const bool add, const route_message_t *rt, const size_t size, HANDLE pipe)
 
static int do_route_ipv4_service (const bool add, const struct route_ipv4 *r, const struct tuntap *tt)
 
static int do_route_ipv6_service (const bool add, const struct route_ipv6 *r, const struct tuntap *tt)
 
static const char * format_route_entry (const MIB_IPFORWARDROW *r, struct gc_arena *gc)
 
void show_routes (int msglev)
 
bool netmask_to_netbits (const in_addr_t network, const in_addr_t netmask, int *netbits)
 
int netmask_to_netbits2 (in_addr_t netmask)
 
static void add_host_route_if_nonlocal (struct route_bypass *rb, const in_addr_t addr)
 
static void add_host_route_array (struct route_bypass *rb, const IP_ADDR_STRING *iplist)
 
int test_local_addr (const in_addr_t addr, const struct route_gateway_info *rgi)
 

Macro Definition Documentation

◆ LR_ERROR

#define LR_ERROR   2 /* caller should abort adding route */

Definition at line 1518 of file route.c.

◆ LR_MATCH

#define LR_MATCH   1 /* route is local */

Definition at line 1517 of file route.c.

◆ LR_NOMATCH

#define LR_NOMATCH   0 /* route is not local */

Definition at line 1516 of file route.c.

◆ METRIC_NOT_USED

#define METRIC_NOT_USED   ((DWORD)-1)

Definition at line 60 of file route.c.

◆ RTA_EEXIST

#define RTA_EEXIST   2 /* route not added as it already exists */

Definition at line 105 of file route.c.

◆ RTA_ERROR

#define RTA_ERROR   0 /* route addition failed */

Definition at line 103 of file route.c.

◆ RTA_SUCCESS

#define RTA_SUCCESS   1 /* route addition succeeded */

Definition at line 104 of file route.c.

Function Documentation

◆ add_block_local_item()

static void add_block_local_item ( struct route_list rl,
const struct route_gateway_address gateway,
in_addr_t  target 
)
static

◆ add_block_local_routes()

static void add_block_local_routes ( struct route_list rl)
static

◆ add_bypass_address()

static bool add_bypass_address ( struct route_bypass rb,
const in_addr_t  a 
)
static

◆ add_bypass_routes()

static bool add_bypass_routes ( struct route_bypass rb,
in_addr_t  gateway,
const struct tuntap tt,
unsigned int  flags,
const struct route_gateway_info rgi,
const struct env_set es,
openvpn_net_ctx_t ctx 
)
static

◆ add_host_route_array()

static void add_host_route_array ( struct route_bypass rb,
const IP_ADDR_STRING *  iplist 
)
static

Definition at line 3994 of file route.c.

References add_host_route_if_nonlocal(), getaddr(), and GETADDR_HOST_ORDER.

Referenced by get_bypass_addresses().

◆ add_host_route_if_nonlocal()

static void add_host_route_if_nonlocal ( struct route_bypass rb,
const in_addr_t  addr 
)
static

Definition at line 3985 of file route.c.

References add_bypass_address(), IPV4_NETMASK_HOST, test_local_addr(), and TLA_NONLOCAL.

Referenced by add_host_route_array().

◆ add_route()

bool add_route ( struct route_ipv4 r,
const struct tuntap tt,
unsigned int  flags,
const struct route_gateway_info rgi,
const struct env_set es,
openvpn_net_ctx_t ctx 
)

◆ add_route3()

static bool add_route3 ( in_addr_t  network,
in_addr_t  netmask,
in_addr_t  gateway,
const struct tuntap tt,
unsigned int  flags,
const struct route_gateway_info rgi,
const struct env_set es,
openvpn_net_ctx_t ctx 
)
static

◆ add_route_ipapi()

static int add_route_ipapi ( const struct route_ipv4 r,
const struct tuntap tt,
DWORD  adapter_index 
)
static

◆ add_route_ipv6()

bool add_route_ipv6 ( struct route_ipv6 r6,
const struct tuntap tt,
unsigned int  flags,
const struct env_set es,
openvpn_net_ctx_t ctx 
)

◆ add_route_ipv6_service()

static int add_route_ipv6_service ( const struct route_ipv6 r,
const struct tuntap tt 
)
static

Definition at line 3172 of file route.c.

References do_route_ipv6_service().

Referenced by add_route_ipv6().

◆ add_route_ipv6_to_option_list()

void add_route_ipv6_to_option_list ( struct route_ipv6_option_list l,
const char *  prefix,
const char *  gateway,
const char *  metric 
)

◆ add_route_service()

static int add_route_service ( const struct route_ipv4 r,
const struct tuntap tt 
)
static

Definition at line 3159 of file route.c.

References do_route_ipv4_service().

Referenced by add_route().

◆ add_route_to_option_list()

void add_route_to_option_list ( struct route_option_list l,
const char *  network,
const char *  netmask,
const char *  gateway,
const char *  metric 
)

◆ add_routes()

bool add_routes ( struct route_list rl,
struct route_ipv6_list rl6,
const struct tuntap tt,
unsigned int  flags,
const struct env_set es,
openvpn_net_ctx_t ctx 
)

◆ block_local_needed()

bool block_local_needed ( const struct route_list rl)

Get the decision whether to block traffic to local networks while the VPN is connected.

This definitely returns false when not redirecting the gateway or when the 'block-local' flag is not set. Also checks for other prerequisites to redirect local networks into the tunnel.

Parameters
rlconst pointer to the struct route_list to base the decision on.
Returns
boolean indicating whether local traffic should be blocked.

Definition at line 621 of file route.c.

References route_special_addr::flags, route_gateway_info::flags, route_list::flags, route_special_addr::remote_host_local, RG_BLOCK_LOCAL, route_list::rgi, RGI_ADDR_DEFINED, RGI_NETMASK_DEFINED, RTSA_REMOTE_ENDPOINT, route_list::spec, and TLA_LOCAL.

Referenced by add_wfp_block(), del_wfp_block(), and init_route_list().

◆ clear_route_ipv6_list()

static void clear_route_ipv6_list ( struct route_ipv6_list rl6)
static

Definition at line 550 of file route.c.

References CLEAR, route_ipv6_list::gc, and gc_free().

Referenced by delete_routes(), and init_route_ipv6_list().

◆ clear_route_list()

static void clear_route_list ( struct route_list rl)
static

Definition at line 543 of file route.c.

References CLEAR, route_list::gc, and gc_free().

Referenced by delete_routes(), and init_route_list().

◆ clone_route_ipv6_option_list()

struct route_ipv6_option_list* clone_route_ipv6_option_list ( const struct route_ipv6_option_list src,
struct gc_arena a 
)

Definition at line 164 of file route.c.

References ALLOC_OBJ_GC.

Referenced by pre_connect_save().

◆ clone_route_option_list()

struct route_option_list* clone_route_option_list ( const struct route_option_list src,
struct gc_arena a 
)

Definition at line 155 of file route.c.

References ALLOC_OBJ_GC.

Referenced by pre_connect_save().

◆ copy_route_ipv6_option_list()

void copy_route_ipv6_option_list ( struct route_ipv6_option_list dest,
const struct route_ipv6_option_list src,
struct gc_arena a 
)

Definition at line 180 of file route.c.

References route_ipv6_option_list::gc.

Referenced by pre_connect_restore().

◆ copy_route_option_list()

void copy_route_option_list ( struct route_option_list dest,
const struct route_option_list src,
struct gc_arena a 
)

Definition at line 173 of file route.c.

References route_option_list::gc.

Referenced by pre_connect_restore().

◆ del_bypass_routes()

static void del_bypass_routes ( struct route_bypass rb,
in_addr_t  gateway,
const struct tuntap tt,
unsigned int  flags,
const struct route_gateway_info rgi,
const struct env_set es,
openvpn_net_ctx_t ctx 
)
static

◆ del_route3()

static void del_route3 ( in_addr_t  network,
in_addr_t  netmask,
in_addr_t  gateway,
const struct tuntap tt,
unsigned int  flags,
const struct route_gateway_info rgi,
const struct env_set es,
openvpn_net_ctx_t ctx 
)
static

◆ del_route_ipapi()

static bool del_route_ipapi ( const struct route_ipv4 r,
const struct tuntap tt 
)
static

◆ del_route_ipv6_service()

static bool del_route_ipv6_service ( const struct route_ipv6 r,
const struct tuntap tt 
)
static

Definition at line 3178 of file route.c.

References do_route_ipv6_service().

Referenced by delete_route_ipv6().

◆ del_route_service()

static bool del_route_service ( const struct route_ipv4 r,
const struct tuntap tt 
)
static

Definition at line 3165 of file route.c.

References do_route_ipv4_service().

Referenced by delete_route().

◆ delete_route()

static void delete_route ( struct route_ipv4 r,
const struct tuntap tt,
unsigned int  flags,
const struct route_gateway_info rgi,
const struct env_set es,
openvpn_net_ctx_t ctx 
)
static

◆ delete_route_ipv6()

void delete_route_ipv6 ( const struct route_ipv6 r6,
const struct tuntap tt,
unsigned int  flags,
const struct env_set es,
openvpn_net_ctx_t ctx 
)

◆ delete_routes()

void delete_routes ( struct route_list rl,
struct route_ipv6_list rl6,
const struct tuntap tt,
unsigned int  flags,
const struct env_set es,
openvpn_net_ctx_t ctx 
)

◆ do_route_ipv4_service()

static int do_route_ipv4_service ( const bool  add,
const struct route_ipv4 r,
const struct tuntap tt 
)
static

◆ do_route_ipv6_service()

static int do_route_ipv6_service ( const bool  add,
const struct route_ipv6 r,
const struct tuntap tt 
)
static

◆ do_route_service()

static int do_route_service ( const bool  add,
const route_message_t rt,
const size_t  size,
HANDLE  pipe 
)
static

◆ format_route_entry()

static const char* format_route_entry ( const MIB_IPFORWARDROW *  r,
struct gc_arena gc 
)
static

Definition at line 3184 of file route.c.

References alloc_buf_gc(), BSTR, buf_printf(), IA_NET_ORDER, and print_in_addr_t().

Referenced by show_routes().

◆ get_bypass_addresses()

static void get_bypass_addresses ( struct route_bypass rb,
const unsigned int  flags 
)
static

◆ get_default_gateway()

void get_default_gateway ( struct route_gateway_info rgi,
openvpn_net_ctx_t ctx 
)

◆ get_default_gateway_ipv6()

void get_default_gateway_ipv6 ( struct route_ipv6_gateway_info rgi6,
const struct in6_addr *  dest,
openvpn_net_ctx_t ctx 
)

◆ get_default_gateway_row()

static const MIB_IPFORWARDROW* get_default_gateway_row ( const MIB_IPFORWARDTABLE *  routes)
static

Definition at line 2640 of file route.c.

References D_ROUTE_DEBUG, dmsg, gc_free(), gc_new(), and print_in_addr_t().

Referenced by get_bypass_addresses(), and get_default_gateway().

◆ get_special_addr()

static bool get_special_addr ( const struct route_list rl,
const char *  string,
in_addr_t *  out,
bool *  status 
)
static

◆ get_windows_routing_table()

static const MIB_IPFORWARDTABLE* get_windows_routing_table ( struct gc_arena gc)
static

◆ init_route()

static bool init_route ( struct route_ipv4 r,
struct addrinfo **  network_list,
const struct route_option ro,
const struct route_list rl 
)
static

◆ init_route_ipv6()

static bool init_route_ipv6 ( struct route_ipv6 r6,
const struct route_ipv6_option r6o,
const struct route_ipv6_list rl6 
)
static

◆ init_route_ipv6_list()

bool init_route_ipv6_list ( struct route_ipv6_list rl6,
const struct route_ipv6_option_list opt6,
const char *  remote_endpoint,
int  default_metric,
const struct in6_addr *  remote_host_ipv6,
struct env_set es,
openvpn_net_ctx_t ctx 
)

◆ init_route_list()

bool init_route_list ( struct route_list rl,
const struct route_option_list opt,
const char *  remote_endpoint,
int  default_metric,
in_addr_t  remote_host,
struct env_set es,
openvpn_net_ctx_t ctx 
)

◆ is_on_link()

static bool is_on_link ( const int  is_local_route,
const unsigned int  flags,
const struct route_gateway_info rgi 
)
inlinestatic

Definition at line 1558 of file route.c.

References route_gateway_info::flags, LR_MATCH, RGI_ON_LINK, and ROUTE_REF_GW.

Referenced by add_route(), and delete_route().

◆ is_route_parm_defined()

static bool is_route_parm_defined ( const char *  parm)
static

Definition at line 205 of file route.c.

Referenced by init_route(), init_route_ipv6(), init_route_ipv6_list(), and init_route_list().

◆ is_special_addr()

bool is_special_addr ( const char *  addr_str)

Definition at line 306 of file route.c.

References get_special_addr().

Referenced by add_option().

◆ local_route()

static int local_route ( in_addr_t  network,
in_addr_t  netmask,
in_addr_t  gateway,
const struct route_gateway_info rgi 
)
static

◆ netmask_to_netbits()

bool netmask_to_netbits ( const in_addr_t  network,
const in_addr_t  netmask,
int *  netbits 
)

Definition at line 3928 of file route.c.

References netbits_to_netmask().

Referenced by do_route_ipv4_service(), and helper_client_server().

◆ netmask_to_netbits2()

int netmask_to_netbits2 ( in_addr_t  netmask)

◆ new_route_ipv6_option_list()

struct route_ipv6_option_list* new_route_ipv6_option_list ( struct gc_arena a)

Definition at line 139 of file route.c.

References ALLOC_OBJ_CLEAR_GC, and route_ipv6_option_list::gc.

Referenced by rol6_check_alloc().

◆ new_route_option_list()

struct route_option_list* new_route_option_list ( struct gc_arena a)

Definition at line 130 of file route.c.

References ALLOC_OBJ_CLEAR_GC, and route_option_list::gc.

Referenced by rol_check_alloc().

◆ print_default_gateway()

void print_default_gateway ( const int  msglevel,
const struct route_gateway_info rgi,
const struct route_ipv6_gateway_info rgi6 
)

◆ print_route()

static void print_route ( const struct route_ipv4 r,
int  level 
)
static

Definition at line 1408 of file route.c.

References route_ipv4::flags, gc_free(), gc_new(), msg, route_string(), and RT_DEFINED.

Referenced by print_routes().

◆ print_route_option()

static void print_route_option ( const struct route_option ro,
int  level 
)
static

◆ print_route_options()

void print_route_options ( const struct route_option_list rol,
int  level 
)

◆ print_routes()

void print_routes ( const struct route_list rl,
int  level 
)

Definition at line 1419 of file route.c.

References route_ipv4::next, print_route(), and route_list::routes.

◆ redirect_default_route_to_vpn()

static bool redirect_default_route_to_vpn ( struct route_list rl,
const struct tuntap tt,
unsigned int  flags,
const struct env_set es,
openvpn_net_ctx_t ctx 
)
static

◆ route_ipv6_clear_host_bits()

void route_ipv6_clear_host_bits ( struct route_ipv6 r6)

Definition at line 1876 of file route.c.

References route_ipv6::netbits, and route_ipv6::network.

Referenced by add_route_ipv6(), and delete_route_connected_v6_net().

◆ route_ipv6_ipapi()

static int route_ipv6_ipapi ( bool  add,
const struct route_ipv6 r,
const struct tuntap tt 
)
static

◆ route_ipv6_match_host()

static bool route_ipv6_match_host ( const struct route_ipv6 r6,
const struct in6_addr *  host 
)
static

Definition at line 754 of file route.c.

References route_ipv6::netbits, and route_ipv6::network.

Referenced by init_route_ipv6_list().

◆ route_list_add_vpn_gateway()

void route_list_add_vpn_gateway ( struct route_list rl,
struct env_set es,
const in_addr_t  addr 
)

◆ route_string()

static const char* route_string ( const struct route_ipv4 r,
struct gc_arena gc 
)
static

◆ setenv_route()

static void setenv_route ( struct env_set es,
const struct route_ipv4 r,
int  i 
)
static

◆ setenv_route_addr()

static void setenv_route_addr ( struct env_set es,
const char *  key,
const in_addr_t  addr,
int  i 
)
static

◆ setenv_route_ipv6()

static void setenv_route_ipv6 ( struct env_set es,
const struct route_ipv6 r6,
int  i 
)
static

◆ setenv_routes()

void setenv_routes ( struct env_set es,
const struct route_list rl 
)

Definition at line 1449 of file route.c.

References es, route_ipv4::next, route_list::routes, and setenv_route().

Referenced by do_init_route_list().

◆ setenv_routes_ipv6()

void setenv_routes_ipv6 ( struct env_set es,
const struct route_ipv6_list rl6 
)

Definition at line 1487 of file route.c.

References es, route_ipv6::next, route_ipv6_list::routes_ipv6, and setenv_route_ipv6().

Referenced by do_init_route_ipv6_list().

◆ show_opt()

static const char* show_opt ( const char *  option)
static

Definition at line 1294 of file route.c.

Referenced by print_route_option().

◆ show_routes()

void show_routes ( int  msglev)

◆ test_local_addr()

int test_local_addr ( const in_addr_t  addr,
const struct route_gateway_info rgi 
)

◆ test_route()

static int test_route ( const IP_ADAPTER_INFO *  adapters,
const in_addr_t  gateway,
DWORD *  index 
)
static

Definition at line 2549 of file route.c.

References adapter_index_of_ip().

Referenced by test_route_helper(), and windows_route_find_if_index().

◆ test_route_helper()

static void test_route_helper ( bool *  ret,
int *  count,
int *  good,
int *  ambig,
const IP_ADAPTER_INFO *  adapters,
const in_addr_t  gateway 
)
static

Definition at line 2563 of file route.c.

References test_route().

Referenced by test_routes().

◆ test_routes()

bool test_routes ( const struct route_list rl,
const struct tuntap tt 
)

◆ undo_redirect_default_route_to_vpn()

static void undo_redirect_default_route_to_vpn ( struct route_list rl,
const struct tuntap tt,
unsigned int  flags,
const struct env_set es,
openvpn_net_ctx_t ctx 
)
static

◆ windows_route_find_if_index()

static DWORD windows_route_find_if_index ( const struct route_ipv4 r,
const struct tuntap tt 
)
static