summaryrefslogtreecommitdiff
path: root/anyctrOptions.cpp
diff options
context:
space:
mode:
authorErwin Nindl <nine@wirdorange.org>2008-02-29 14:29:00 +0000
committerErwin Nindl <nine@wirdorange.org>2008-02-29 14:29:00 +0000
commit23acebd364d21086d73e2cf5fcb6f23a9d6eddcb (patch)
tree09fa7bcb4435be41c7dfb5b2aac20e3c9f26be17 /anyctrOptions.cpp
parentrouting (diff)
output route on anytun-showtables;
cl option to anyctr
Diffstat (limited to 'anyctrOptions.cpp')
-rw-r--r--anyctrOptions.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/anyctrOptions.cpp b/anyctrOptions.cpp
index e1ff47f..17a8f3f 100644
--- a/anyctrOptions.cpp
+++ b/anyctrOptions.cpp
@@ -59,6 +59,7 @@ Options::Options() : key_(u_int32_t(0)), salt_(u_int32_t(0))
seq_window_size_ = 100;
kd_prf_ = "aes-ctr";
mux_ = 0;
+ network_prefix_length_ = 32;
}
Options::~Options()
@@ -144,6 +145,7 @@ bool Options::parse(int argc, char* argv[])
PARSE_SCALAR_PARAM2("-n","--ifconfig", ifconfig_param_local_, ifconfig_param_remote_netmask_)
PARSE_SCALAR_PARAM("-w","--window-size", seq_window_size_)
PARSE_SCALAR_PARAM("-m","--mux", mux_)
+ PARSE_SCALAR_PARAM("-l","--prefix-len", network_prefix_length_)
PARSE_HEXSTRING_PARAM("-K","--key", key_)
PARSE_HEXSTRING_PARAM("-a","--salt", salt_)
PARSE_SCALAR_PARAM("-k","--kd-prf", kd_prf_)
@@ -175,6 +177,7 @@ void Options::printUsage()
<< " <remote|netmask> the remote address(tun) or netmask(tap)" << std::endl;
std::cout << " [-w|--window-size] <window size> seqence number window size" << std::endl;
std::cout << " [-m|--mux] <mux-id> the multiplex id to use" << std::endl;
+ std::cout << " [-l|--prefix-len] <prefix length> network prefix length" << std::endl;
std::cout << " [-K|--key] <master key> master key to use for encryption" << std::endl;
std::cout << " [-a|--salt] <master salt> master salt to use for encryption" << std::endl;
std::cout << " [-k|--kd-prf] <kd-prf type> key derivation pseudo random function" << std::endl;
@@ -190,6 +193,7 @@ void Options::printOptions()
std::cout << "ifconfig_param_remote_netmask='" << ifconfig_param_remote_netmask_ << "'" << std::endl;
std::cout << "seq_window_size='" << seq_window_size_ << "'" << std::endl;
std::cout << "mux_id='" << mux_ << "'" << std::endl;
+ std::cout << "network_prefix_length='" << network_prefix_length_ << "'" << std::endl;
std::cout << "key=" << key_.getHexDumpOneLine() << std::endl;
std::cout << "salt=" << salt_.getHexDumpOneLine() << std::endl;
std::cout << "kd_prf='" << kd_prf_ << "'" << std::endl;
@@ -293,6 +297,19 @@ Options& Options::setMux(u_int16_t m)
return *this;
}
+u_int16_t Options::getNetworkPrefixLength()
+{
+ Lock lock(mutex);
+ return network_prefix_length_;
+}
+
+Options& Options::setNetworkPrefixLength(u_int16_t l)
+{
+ Lock lock(mutex);
+ network_prefix_length_ = l;
+ return *this;
+}
+
Buffer Options::getKey()
{
Lock lock(mutex);