9 #if defined(TARGET_FREEBSD)
12 net_route_v4(
const char *op,
const in_addr_t *dst,
int prefixlen,
13 const in_addr_t *gw,
const char *
iface, uint32_t table,
16 char buf1[INET_ADDRSTRLEN], buf2[INET_ADDRSTRLEN];
26 inet_ntop(AF_INET, &_dst, buf1,
sizeof(buf1)),
28 inet_ntop(AF_INET, &_gw, buf2,
sizeof(buf2)),
33 "ERROR: FreeBSD route command failed");
41 net_route_v6(
const char *op,
const struct in6_addr *dst,
42 int prefixlen,
const struct in6_addr *gw,
const char *
iface,
43 uint32_t table,
int metric)
45 char buf1[INET6_ADDRSTRLEN], buf2[INET6_ADDRSTRLEN];
51 inet_ntop(AF_INET6, dst, buf1,
sizeof(buf1)),
53 inet_ntop(AF_INET6, gw, buf2,
sizeof(buf2)),
58 "ERROR: FreeBSD route command failed");
67 const in_addr_t *gw,
const char *
iface, uint32_t table,
70 return net_route_v4(
"add", dst, prefixlen, gw,
iface, table, metric);
75 int prefixlen,
const struct in6_addr *gw,
const char *
iface,
76 uint32_t table,
int metric)
78 return net_route_v6(
"add", dst, prefixlen, gw,
iface, table, metric);
83 const in_addr_t *gw,
const char *
iface, uint32_t table,
86 return net_route_v4(
"del", dst, prefixlen, gw,
iface, table, metric);
91 int prefixlen,
const struct in6_addr *gw,
const char *
iface,
92 uint32_t table,
int metric)
94 return net_route_v6(
"del", dst, prefixlen, gw,
iface, table, metric);