9#if defined(TARGET_FREEBSD)
12net_route_v4(
const char *op,
const in_addr_t *dst,
int prefixlen,
const in_addr_t *gw,
13 const char *
iface, uint32_t table,
int metric)
15 char buf1[INET_ADDRSTRLEN], buf2[INET_ADDRSTRLEN];
24 inet_ntop(AF_INET, &_dst, buf1,
sizeof(buf1)), prefixlen,
25 inet_ntop(AF_INET, &_gw, buf2,
sizeof(buf2)), table);
36net_route_v6(
const char *op,
const struct in6_addr *dst,
int prefixlen,
const struct in6_addr *gw,
37 const char *
iface, uint32_t table,
int metric)
39 char buf1[INET6_ADDRSTRLEN], buf2[INET6_ADDRSTRLEN];
44 inet_ntop(AF_INET6, dst, buf1,
sizeof(buf1)), prefixlen,
45 inet_ntop(AF_INET6, gw, buf2,
sizeof(buf2)), table);
56net_route_v4_add(
openvpn_net_ctx_t *ctx,
const in_addr_t *dst,
int prefixlen,
const in_addr_t *gw,
57 const char *
iface, uint32_t table,
int metric)
59 return net_route_v4(
"add", dst, prefixlen, gw,
iface, table, metric);
63net_route_v6_add(
openvpn_net_ctx_t *ctx,
const struct in6_addr *dst,
int prefixlen,
64 const struct in6_addr *gw,
const char *
iface, uint32_t table,
int metric)
66 return net_route_v6(
"add", dst, prefixlen, gw,
iface, table, metric);
70net_route_v4_del(
openvpn_net_ctx_t *ctx,
const in_addr_t *dst,
int prefixlen,
const in_addr_t *gw,
71 const char *
iface, uint32_t table,
int metric)
73 return net_route_v4(
"del", dst, prefixlen, gw,
iface, table, metric);
77net_route_v6_del(
openvpn_net_ctx_t *ctx,
const struct in6_addr *dst,
int prefixlen,
78 const struct in6_addr *gw,
const char *
iface, uint32_t table,
int metric)
80 return net_route_v6(
"del", dst, prefixlen, gw,
iface, table, 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.
struct argv argv_new(void)
Allocates a new struct argv and ensures it is initialised.
static SERVICE_STATUS status
int openvpn_execve_check(const struct argv *a, const struct env_set *es, const unsigned int flags, const char *error_message)