diff options
author | james <james@e7ae566f-a301-0410-adde-c780ea21d3b5> | 2008-05-12 20:31:43 +0000 |
---|---|---|
committer | james <james@e7ae566f-a301-0410-adde-c780ea21d3b5> | 2008-05-12 20:31:43 +0000 |
commit | 1bda73a7b0f45a2502ae93e33e30b98152d893f3 (patch) | |
tree | 7bdf8f59ec2c6443a071a0217f78f8a999596030 /route.c | |
parent | Misc XGUI fixes. (diff) | |
download | openvpn-1bda73a7b0f45a2502ae93e33e30b98152d893f3.tar.xz |
Moved branch into official BETA21 position.
git-svn-id: http://svn.openvpn.net/projects/openvpn/branches/BETA21/openvpn@2959 e7ae566f-a301-0410-adde-c780ea21d3b5
Diffstat (limited to 'route.c')
-rw-r--r-- | route.c | 35 |
1 files changed, 28 insertions, 7 deletions
@@ -26,12 +26,6 @@ * Support routines for adding/deleting network routes. */ -#ifdef WIN32 -#include "config-win32.h" -#else -#include "config.h" -#endif - #include "syshead.h" #include "common.h" @@ -871,6 +865,23 @@ add_route (struct route *r, const struct tuntap *tt, unsigned int flags, const s msg (D_ROUTE, "%s", BSTR (&buf)); status = system_check (BSTR (&buf), es, 0, "ERROR: FreeBSD route add command failed"); +#elif defined(TARGET_DRAGONFLY) + + buf_printf (&buf, ROUTE_PATH " add"); + +#if 0 + if (r->metric_defined) + buf_printf (&buf, " -rtt %d", r->metric); +#endif + + buf_printf (&buf, " -net %s %s %s", + network, + gateway, + netmask); + + msg (D_ROUTE, "%s", BSTR (&buf)); + status = system_check (BSTR (&buf), es, 0, "ERROR: DragonFly route add command failed"); + #elif defined(TARGET_DARWIN) buf_printf (&buf, ROUTE_PATH " add"); @@ -1007,6 +1018,16 @@ delete_route (const struct route *r, const struct tuntap *tt, unsigned int flags msg (D_ROUTE, "%s", BSTR (&buf)); system_check (BSTR (&buf), es, 0, "ERROR: FreeBSD route delete command failed"); +#elif defined(TARGET_DRAGONFLY) + + buf_printf (&buf, ROUTE_PATH " delete -net %s %s %s", + network, + gateway, + netmask); + + msg (D_ROUTE, "%s", BSTR (&buf)); + system_check (BSTR (&buf), es, 0, "ERROR: DragonFly route delete command failed"); + #elif defined(TARGET_DARWIN) buf_printf (&buf, ROUTE_PATH " delete -net %s %s %s", @@ -1462,7 +1483,7 @@ get_default_gateway (in_addr_t *gateway) return ret; } -#elif defined(TARGET_FREEBSD) +#elif defined(TARGET_FREEBSD)||defined(TARGET_DRAGONFLY) #include <sys/types.h> #include <sys/socket.h> |