summaryrefslogtreecommitdiffstats
path: root/options.c
diff options
context:
space:
mode:
authorjames <james@e7ae566f-a301-0410-adde-c780ea21d3b5>2006-04-13 20:40:39 +0000
committerjames <james@e7ae566f-a301-0410-adde-c780ea21d3b5>2006-04-13 20:40:39 +0000
commit40ac3d7ac1cb29bf5d482e162c102c56a5e2e5e6 (patch)
treefb5ea6dc09883fcbc031da30ce5544ddd9a41822 /options.c
parent151ea252ee3e32a9499acd5ead242f76491c8d8a (diff)
downloadopenvpn-40ac3d7ac1cb29bf5d482e162c102c56a5e2e5e6.tar.gz
openvpn-40ac3d7ac1cb29bf5d482e162c102c56a5e2e5e6.tar.xz
openvpn-40ac3d7ac1cb29bf5d482e162c102c56a5e2e5e6.zip
Added --route-metric option to set a default route metric
for --route (Roy Marples). git-svn-id: http://svn.openvpn.net/projects/openvpn/branches/BETA21/openvpn@1011 e7ae566f-a301-0410-adde-c780ea21d3b5
Diffstat (limited to 'options.c')
-rw-r--r--options.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/options.c b/options.c
index 793ae66..effe1b1 100644
--- a/options.c
+++ b/options.c
@@ -166,6 +166,7 @@ static const char usage_message[] =
" gateway default: taken from --route-gateway or --ifconfig\n"
" Specify default by leaving blank or setting to \"nil\".\n"
"--route-gateway gw : Specify a default gateway for use with --route.\n"
+ "--route-metric m : Specify a default metric for use with --route.\n"
"--route-delay n [w] : Delay n seconds after connection initiation before\n"
" adding routes (may be 0). If not specified, routes will\n"
" be added immediately after tun/tap open. On Windows, wait\n"
@@ -1175,6 +1176,7 @@ show_settings (const struct options *o)
SHOW_STR (route_script);
SHOW_STR (route_default_gateway);
+ SHOW_INT (route_default_metric);
SHOW_BOOL (route_noexec);
SHOW_INT (route_delay);
SHOW_INT (route_delay_window);
@@ -3938,6 +3940,11 @@ add_option (struct options *options,
VERIFY_PERMISSION (OPT_P_ROUTE_EXTRAS);
options->route_default_gateway = p[1];
}
+ else if (streq (p[0], "route-metric") && p[1])
+ {
+ VERIFY_PERMISSION (OPT_P_ROUTE);
+ options->route_default_metric = positive_atoi (p[1]);
+ }
else if (streq (p[0], "route-delay"))
{
VERIFY_PERMISSION (OPT_P_ROUTE_EXTRAS);