OpenVPN
Functions
helper.c File Reference
#include "syshead.h"
#include "forward.h"
#include "helper.h"
#include "pool.h"
#include "push.h"
#include "memdbg.h"
Include dependency graph for helper.c:

Go to the source code of this file.

Functions

static const char * print_netmask (int netbits, struct gc_arena *gc)
 
static const char * print_opt_route_gateway (const in_addr_t route_gateway, struct gc_arena *gc)
 
static const char * print_opt_route_gateway_dhcp (struct gc_arena *gc)
 
static const char * print_opt_route (const in_addr_t network, const in_addr_t netmask, struct gc_arena *gc)
 
static const char * print_opt_topology (const int topology, struct gc_arena *gc)
 
static const char * print_str_int (const char *str, const int i, struct gc_arena *gc)
 
static const char * print_str (const char *str, struct gc_arena *gc)
 
static void helper_add_route (const in_addr_t network, const in_addr_t netmask, struct options *o)
 
static void verify_common_subnet (const char *opt, const in_addr_t a, const in_addr_t b, const in_addr_t subnet)
 
void helper_client_server (struct options *o)
 
void helper_keepalive (struct options *o)
 
void helper_tcp_nodelay (struct options *o)
 

Function Documentation

◆ helper_add_route()

static void helper_add_route ( const in_addr_t  network,
const in_addr_t  netmask,
struct options o 
)
static

◆ helper_client_server()

void helper_client_server ( struct options o)

Definition at line 150 of file helper.c.

References add_in6_addr(), ASSERT, options::client, options::dev, options::dev_type, dev_type_enum(), DEV_TYPE_TAP, DEV_TYPE_TUN, options::enable_c2c, options::gc, gc_free(), gc_new(), helper_add_route(), options::ifconfig_ipv6_local, options::ifconfig_ipv6_netbits, options::ifconfig_ipv6_pool_base, options::ifconfig_ipv6_pool_defined, options::ifconfig_ipv6_pool_netbits, options::ifconfig_ipv6_remote, options::ifconfig_local, options::ifconfig_pool_defined, options::ifconfig_pool_end, IFCONFIG_POOL_MIN_NETBITS, options::ifconfig_pool_netmask, options::ifconfig_pool_start, ifconfig_pool_verify_range(), options::ifconfig_remote_netmask, options::key_method, M_USAGE, options::mode, MODE_SERVER, msg, netmask_to_netbits(), print_in6_addr(), print_in_addr_t(), print_netmask(), print_opt_route(), print_opt_route_gateway(), print_opt_route_gateway_dhcp(), print_opt_topology(), options::pull, options::push_ifconfig_constraint_defined, options::push_ifconfig_constraint_netmask, options::push_ifconfig_constraint_network, push_option(), options::route_default_gateway, options::server_bridge_defined, options::server_bridge_ip, options::server_bridge_netmask, options::server_bridge_pool_end, options::server_bridge_pool_start, options::server_bridge_proxy_dhcp, options::server_defined, options::server_flags, options::server_ipv6_defined, options::server_netbits_ipv6, options::server_netmask, options::server_network, options::server_network_ipv6, SF_NO_PUSH_ROUTE_GATEWAY, SF_NOPOOL, options::shared_secret_file, status, options::tls_client, options::tls_server, TOP_NET30, TOP_P2P, TOP_SUBNET, options::topology, and verify_common_subnet().

Referenced by options_postprocess_mutate().

◆ helper_keepalive()

void helper_keepalive ( struct options o)

◆ helper_tcp_nodelay()

void helper_tcp_nodelay ( struct options o)

◆ print_netmask()

static const char* print_netmask ( int  netbits,
struct gc_arena gc 
)
static

Definition at line 42 of file helper.c.

References alloc_buf_gc(), BSTR, buf_printf(), in_addr_t, netbits_to_netmask(), and print_in_addr_t().

Referenced by helper_client_server().

◆ print_opt_route()

static const char* print_opt_route ( const in_addr_t  network,
const in_addr_t  netmask,
struct gc_arena gc 
)
static

Definition at line 70 of file helper.c.

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

Referenced by helper_client_server().

◆ print_opt_route_gateway()

static const char* print_opt_route_gateway ( const in_addr_t  route_gateway,
struct gc_arena gc 
)
static

Definition at line 53 of file helper.c.

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

Referenced by helper_client_server().

◆ print_opt_route_gateway_dhcp()

static const char* print_opt_route_gateway_dhcp ( struct gc_arena gc)
static

Definition at line 62 of file helper.c.

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

Referenced by helper_client_server().

◆ print_opt_topology()

static const char* print_opt_topology ( const int  topology,
struct gc_arena gc 
)
static

Definition at line 91 of file helper.c.

References alloc_buf_gc(), BSTR, buf_printf(), and print_topology().

Referenced by helper_client_server().

◆ print_str()

static const char* print_str ( const char *  str,
struct gc_arena gc 
)
static

Definition at line 109 of file helper.c.

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

Referenced by helper_tcp_nodelay().

◆ print_str_int()

static const char* print_str_int ( const char *  str,
const int  i,
struct gc_arena gc 
)
static

Definition at line 101 of file helper.c.

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

Referenced by helper_keepalive().

◆ verify_common_subnet()

static void verify_common_subnet ( const char *  opt,
const in_addr_t  a,
const in_addr_t  b,
const in_addr_t  subnet 
)
static

Definition at line 128 of file helper.c.

References gc_free(), gc_new(), M_USAGE, msg, and print_in_addr_t().

Referenced by helper_client_server().