From 1bda73a7b0f45a2502ae93e33e30b98152d893f3 Mon Sep 17 00:00:00 2001 From: james Date: Mon, 12 May 2008 20:31:43 +0000 Subject: Moved branch into official BETA21 position. git-svn-id: http://svn.openvpn.net/projects/openvpn/branches/BETA21/openvpn@2959 e7ae566f-a301-0410-adde-c780ea21d3b5 --- route.c | 35 ++++++++++++++++++++++++++++------- 1 file changed, 28 insertions(+), 7 deletions(-) (limited to 'route.c') diff --git a/route.c b/route.c index 507ef38..0a7e032 100644 --- a/route.c +++ b/route.c @@ -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 #include -- cgit