From 675adabaedd6e989ad1849727a9928695f30e0b4 Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Fri, 11 Apr 2008 18:18:20 +0000 Subject: added control host option added post up script --- options.cpp | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'options.cpp') diff --git a/options.cpp b/options.cpp index 86fd50a..ad70459 100644 --- a/options.cpp +++ b/options.cpp @@ -70,6 +70,7 @@ Options::Options() : key_(u_int32_t(0)), salt_(u_int32_t(0)) dev_type_ = ""; ifconfig_param_local_ = ""; ifconfig_param_remote_netmask_ = ""; + post_up_script_ = ""; seq_window_size_ = 100; cipher_ = "aes-ctr"; kd_prf_ = "aes-ctr"; @@ -172,6 +173,7 @@ bool Options::parse(int argc, char* argv[]) PARSE_SCALAR_PARAM("-d","--dev", dev_name_) PARSE_SCALAR_PARAM("-t","--type", dev_type_) PARSE_SCALAR_PARAM2("-n","--ifconfig", ifconfig_param_local_, ifconfig_param_remote_netmask_) + PARSE_SCALAR_PARAM("-x","--post-up-script", post_up_script_) PARSE_SCALAR_PARAM("-w","--window-size", seq_window_size_) PARSE_SCALAR_PARAM("-m","--mux", mux_) PARSE_SCALAR_PARAM("-c","--cipher", cipher_) @@ -180,6 +182,7 @@ bool Options::parse(int argc, char* argv[]) PARSE_SCALAR_PARAM("-k","--kd-prf", kd_prf_) PARSE_SCALAR_PARAM("-a","--auth-algo", auth_algo_) PARSE_CSLIST_PARAM("-M","--sync-hosts", host_port_queue) + PARSE_CSLIST_PARAM("-X","--control-host", host_port_queue) else return false; } @@ -220,18 +223,21 @@ void Options::printUsage() std::cout << " [-S|--sync-port] local unicast(sync) port to bind to" << std::endl; std::cout << " [-M|--sync-hosts] :[,:[...]]"<< std::endl; std::cout << " remote hosts to sync with" << std::endl; + std::cout << " [-X|--control-host] :"<< std::endl; + std::cout << " fetch the config from this host" << std::endl; std::cout << " [-r|--remote-host] remote host" << std::endl; std::cout << " [-o|--remote-port] remote port" << std::endl; std::cout << " [-d|--dev] device name" << std::endl; std::cout << " [-t|--type] device type" << std::endl; std::cout << " [-n|--ifconfig] the local address for the tun/tap device" << std::endl << " the remote address(tun) or netmask(tap)" << std::endl; + std::cout << " [-x|--post-up-script]