From 21e0acb3aefc75d191b007e00f371836f42e3a42 Mon Sep 17 00:00:00 2001 From: Othmar Gsenger Date: Fri, 29 Feb 2008 18:30:47 +0000 Subject: new anyctr options --- anyctrOptions.cpp | 5 ++--- anytun.cpp | 4 +++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/anyctrOptions.cpp b/anyctrOptions.cpp index 17a8f3f..3513857 100644 --- a/anyctrOptions.cpp +++ b/anyctrOptions.cpp @@ -142,7 +142,7 @@ bool Options::parse(int argc, char* argv[]) return false; PARSE_SCALAR_PARAM("-r","--remote-host", remote_addr_) PARSE_SCALAR_PARAM("-o","--remote-port", remote_port_) - PARSE_SCALAR_PARAM2("-n","--ifconfig", ifconfig_param_local_, ifconfig_param_remote_netmask_) + PARSE_SCALAR_PARAM("-n","--prefix", 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_) @@ -173,8 +173,7 @@ void Options::printUsage() std::cout << "anyctr [-h|--help] prints this..." << std::endl; std::cout << " [-r|--remote-host] remote host" << std::endl; std::cout << " [-o|--remote-port] remote port" << 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 << " [-n|--prefix] remote subnet for route" << std::endl; std::cout << " [-w|--window-size] seqence number window size" << std::endl; std::cout << " [-m|--mux] the multiplex id to use" << std::endl; std::cout << " [-l|--prefix-len] network prefix length" << std::endl; diff --git a/anytun.cpp b/anytun.cpp index 616e1e2..75ca704 100644 --- a/anytun.cpp +++ b/anytun.cpp @@ -158,7 +158,9 @@ void* sender(void* p) if(cit==param->cl.getEnd()) continue; ConnectionParam & conn = cit->second; - + + if(conn.remote_host_==""||!conn.remote_port_) + continue; // generate packet-key conn.kd_.generate(LABEL_SATP_ENCRYPTION, conn.seq_nr_, session_key); conn.kd_.generate(LABEL_SATP_SALT, conn.seq_nr_, session_salt); -- cgit v1.2.3