115 if ((a & subnet) != (b & subnet))
117 msg(
M_USAGE,
"%s IP addresses %s and %s are not in the same %s subnet", opt,
185 msg(
M_USAGE,
"--server-ipv6 and --client cannot be used together");
190 msg(
M_USAGE,
"--server-ipv6 is incompatible with 'nopool' option");
195 "--server-ipv6 already defines an ifconfig-ipv6-pool, so you can't also specify --ifconfig-pool explicitly");
261 msg(
M_USAGE,
"--server and --client cannot be used together");
266 msg(
M_USAGE,
"--server and --server-bridge cannot be used together");
272 "--server and --secret cannot be used together (you must use SSL/TLS keys)");
278 "--server already defines an ifconfig-pool, so you can't also specify --ifconfig-pool explicitly");
283 msg(
M_USAGE,
"--server directive only makes sense with --dev tun or --dev tap");
289 msg(
M_USAGE,
"--server directive network/netmask combination is invalid");
294 msg(
M_USAGE,
"--server directive netmask is invalid");
300 "--server directive netmask allows for too many host addresses (subnet must be %s or higher)",
306 int pool_end_reserve = 4;
311 "--server directive when used with --dev tun must define a subnet of %s or lower",
317 pool_end_reserve = 0;
381 msg(
M_WARN,
"WARNING: --topology net30 support for server "
382 "configs with IPv4 pools will be removed in a future "
383 "release. Please migrate to --topology subnet as soon "
392 "--server directive when used with --dev tap must define a subnet of %s or lower",
455 msg(
M_USAGE,
"--server-bridge and --client cannot be used together");
461 "--server-bridge already defines an ifconfig-pool, so you can't also specify --ifconfig-pool explicitly");
467 "--server-bridge and --secret cannot be used together (you must use SSL/TLS keys)");
472 msg(
M_USAGE,
"--server-bridge directive only makes sense with --dev tap");
550 "The second parameter to --keepalive (restart timeout=%d) must be at least twice the value of the first parameter (ping interval=%d). A ratio of 1:5 or 1:6 would be even better. Recommended setting is --keepalive 10 60.",
556 "--keepalive conflicts with --ping, --ping-exit, or --ping-restart. If you use --keepalive, you don't need any of the other --ping directives.");
561 "The second parameter to --keepalive must not exceed %d in server mode.",
bool buf_printf(struct buffer *buf, const char *format,...)
printf-style append to a buffer with overflow check.
struct buffer alloc_buf_gc(size_t size, struct gc_arena *gc)
Allocate a buffer of the given size under garbage collection.
#define BSTR(buf)
Return the buffer content pointer cast to char *.
static void gc_free(struct gc_arena *a)
Free all allocations in a garbage collection arena.
static struct gc_arena gc_new(void)
Allocate and return a new, empty garbage collection arena.
Interface functions to the internal and external multiplexers.
void helper_setdefault_topology(struct options *o)
Set –topology default depending on –mode.
static const char * print_opt_route_gateway_dhcp(struct gc_arena *gc)
void helper_tcp_nodelay(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)
static void helper_add_route(const in_addr_t network, const in_addr_t netmask, struct options *o)
static const char * print_opt_route_gateway(const in_addr_t route_gateway, struct gc_arena *gc)
static const char * print_opt_route(const in_addr_t network, const in_addr_t netmask, struct gc_arena *gc)
void helper_client_server(struct options *o)
void helper_keepalive(struct options *o)
static const char * print_str_int(const char *str, const int i, struct gc_arena *gc)
static const char * print_netmask(int netbits, struct gc_arena *gc)
static const char * print_opt_topology(const int topology, struct gc_arena *gc)
static SERVICE_STATUS status
void rol_check_alloc(struct options *options)
const char * print_topology(const int topology)
#define MODE_POINT_TO_POINT
#define SF_TCP_NODELAY_HELPER
#define SF_NO_PUSH_ROUTE_GATEWAY
bool ifconfig_pool_verify_range(const msglvl_t msglevel, const in_addr_t start, const in_addr_t end)
#define IFCONFIG_POOL_MIN_NETBITS
void push_option(struct options *o, const char *opt, msglvl_t msglevel)
bool netmask_to_netbits(const in_addr_t network, const in_addr_t netmask, int *netbits)
void add_route_to_option_list(struct route_option_list *l, const char *network, const char *netmask, const char *gateway, const char *metric, int table_id)
static in_addr_t netbits_to_netmask(const int netbits)
struct in6_addr add_in6_addr(struct in6_addr base, uint32_t add)
const char * print_in6_addr(struct in6_addr a6, unsigned int flags, struct gc_arena *gc)
const char * print_in_addr_t(in_addr_t addr, unsigned int flags, struct gc_arena *gc)
Wrapper structure for dynamically allocated memory.
Garbage collection arena used to keep track of dynamically allocated memory.
const char * ifconfig_ipv6_remote
in_addr_t push_ifconfig_constraint_network
struct in6_addr server_network_ipv6
bool server_bridge_defined
in_addr_t ifconfig_pool_netmask
bool server_bridge_proxy_dhcp
const char * ifconfig_ipv6_local
bool ifconfig_pool_defined
in_addr_t server_bridge_netmask
struct route_option_list * routes
in_addr_t ifconfig_pool_end
bool ifconfig_ipv6_pool_defined
unsigned int server_flags
const char * ifconfig_local
const char * route_default_gateway
int ifconfig_ipv6_pool_netbits
in_addr_t push_ifconfig_constraint_netmask
int ping_rec_timeout_action
int route_default_table_id
bool push_ifconfig_constraint_defined
in_addr_t server_bridge_pool_start
const char * ifconfig_remote_netmask
in_addr_t server_bridge_pool_end
in_addr_t ifconfig_pool_start
unsigned int server_netbits_ipv6
in_addr_t server_bridge_ip
const char * shared_secret_file
struct in6_addr ifconfig_ipv6_pool_base
int ifconfig_ipv6_netbits
int dev_type_enum(const char *dev, const char *dev_type)