24#if defined(TARGET_LINUX) && defined(ENABLE_IPROUTE)
36#include <netinet/in.h>
81 msg(
M_WARN,
"%s: operation not supported by iproute2 backend", __func__);
212 const in_addr_t *remote)
230 const in_addr_t *remote)
247net_route_v4_add(
openvpn_net_ctx_t *ctx,
const in_addr_t *dst,
int prefixlen,
const in_addr_t *gw,
248 const char *
iface, uint32_t table,
int metric)
254 argv_printf(&
argv,
"%s route add %s/%d", iproute_path, dst_str, prefixlen);
285net_route_v6_add(
openvpn_net_ctx_t *ctx,
const struct in6_addr *dst,
int prefixlen,
286 const struct in6_addr *gw,
const char *
iface, uint32_t table,
int metric)
318net_route_v4_del(
openvpn_net_ctx_t *ctx,
const in_addr_t *dst,
int prefixlen,
const in_addr_t *gw,
319 const char *
iface, uint32_t table,
int metric)
325 argv_printf(&
argv,
"%s route del %s/%d", iproute_path, dst_str, prefixlen);
344net_route_v6_del(
openvpn_net_ctx_t *ctx,
const struct in6_addr *dst,
int prefixlen,
345 const struct in6_addr *gw,
const char *
iface, uint32_t table,
int metric)
void argv_msg(const int msglev, const struct argv *a)
Write the arguments stored in a struct argv via the msg() command.
void argv_free(struct argv *a)
Frees all memory allocations allocated by the struct argv related functions.
bool argv_printf(struct argv *argres, const char *format,...)
printf() variant which populates a struct argv.
bool argv_printf_cat(struct argv *argres, const char *format,...)
printf() inspired argv concatenation.
struct argv argv_new(void)
Allocates a new struct argv and ensures it is initialised.
static void gc_reset(struct gc_arena *a)
static void gc_free(struct gc_arena *a)
static struct gc_arena gc_new(void)
#define MAC_PRINT_ARG(_mac)
static void net_ctx_reset(openvpn_net_ctx_t *ctx)
void * openvpn_net_iface_t
#define IFACE_TYPE_LEN_MAX
static int net_ctx_init(struct context *c, openvpn_net_ctx_t *ctx)
static void net_ctx_free(openvpn_net_ctx_t *ctx)
int openvpn_execve_check(const struct argv *a, const struct env_set *es, const unsigned int flags, const char *error_message)
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)
Contains all state information for one tunnel.
struct env_set * es
Set of environment variables.