128 if ((a & subnet) != (b & subnet))
130 msg(
M_USAGE,
"%s IP addresses %s and %s are not in the same %s subnet",
200 msg(
M_USAGE,
"--server-ipv6 and --client cannot be used together");
205 msg(
M_USAGE,
"--server-ipv6 is incompatible with 'nopool' option");
209 msg(
M_USAGE,
"--server-ipv6 already defines an ifconfig-ipv6-pool, so you can't also specify --ifconfig-pool explicitly");
276 msg(
M_USAGE,
"--server and --client cannot be used together");
281 msg(
M_USAGE,
"--server and --server-bridge cannot be used together");
286 msg(
M_USAGE,
"--server and --secret cannot be used together (you must use SSL/TLS keys)");
291 msg(
M_USAGE,
"--server already defines an ifconfig-pool, so you can't also specify --ifconfig-pool explicitly");
296 msg(
M_USAGE,
"--server directive only makes sense with --dev tun or --dev tap");
302 msg(
M_USAGE,
"--server directive network/netmask combination is invalid");
307 msg(
M_USAGE,
"--server directive netmask is invalid");
312 msg(
M_USAGE,
"--server directive netmask allows for too many host addresses (subnet must be %s or higher)",
318 int pool_end_reserve = 4;
322 msg(
M_USAGE,
"--server directive when used with --dev tun must define a subnet of %s or lower",
328 pool_end_reserve = 0;
388 msg(
M_WARN,
"WARNING: --topology net30 support for server "
389 "configs with IPv4 pools will be removed in a future "
390 "release. Please migrate to --topology subnet as soon "
398 msg(
M_USAGE,
"--server directive when used with --dev tap must define a subnet of %s or lower",
461 msg(
M_USAGE,
"--server-bridge and --client cannot be used together");
466 msg(
M_USAGE,
"--server-bridge already defines an ifconfig-pool, so you can't also specify --ifconfig-pool explicitly");
471 msg(
M_USAGE,
"--server-bridge and --secret cannot be used together (you must use SSL/TLS keys)");
476 msg(
M_USAGE,
"--server-bridge directive only makes sense with --dev tap");
550 msg(
M_USAGE,
"--keepalive parameters must be > 0");
554 msg(
M_USAGE,
"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.",
560 msg(
M_USAGE,
"--keepalive conflicts with --ping, --ping-exit, or --ping-restart. If you use --keepalive, you don't need any of the other --ping directives.");
bool buf_printf(struct buffer *buf, const char *format,...)
struct buffer alloc_buf_gc(size_t size, struct gc_arena *gc)
static void gc_free(struct gc_arena *a)
static struct gc_arena gc_new(void)
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)
static const char * print_str(const char *str, 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 int 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, int msglevel)
void add_route_to_option_list(struct route_option_list *l, const char *network, const char *netmask, const char *gateway, const char *metric)
bool netmask_to_netbits(const in_addr_t network, const in_addr_t netmask, int *netbits)
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.
int len
Length in bytes of the actual content within the 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
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
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)