From cf6655a6e29d23132190b6c04c08ab372214b9a4 Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Fri, 7 Feb 2014 19:07:48 +0000 Subject: * inital commit for RAIL mode - added information about it at manpage - updated output for --help * white space cleanups * updated copyright header --- src/options.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'src/options.c') diff --git a/src/options.c b/src/options.c index 331a3c3..d3116ba 100644 --- a/src/options.c +++ b/src/options.c @@ -13,9 +13,9 @@ * message authentication based on the methodes used by SRTP. It is * intended to deliver a generic, scaleable and secure solution for * tunneling and relaying of packets of any protocol. - * * - * Copyright (C) 2007-2010 Christian Pointner + * + * Copyright (C) 2007-2014 Christian Pointner * * This file is part of uAnytun. * @@ -152,9 +152,9 @@ int options_parse_hex_string(const char* hex, buffer_t* buffer) if(hex_len%2) return 1; - if(buffer->buf_) + if(buffer->buf_) free(buffer->buf_); - + buffer->length_ = hex_len/2; buffer->buf_ = malloc(buffer->length_); if(!buffer->buf_) { @@ -189,7 +189,7 @@ int options_parse_ifconfig(const char* arg, ifconfig_param_t* ifcfg) free(str); return 1; } - + ifcfg->prefix_length_ = atoi(ptr); ifcfg->net_addr_ = strdup(str); free(str); @@ -268,7 +268,7 @@ int options_parse(options_t* opt, int argc, char* argv[]) PARSE_STRING_PARAM("-a","--auth-algo", opt->auth_algo_) PARSE_INT_PARAM("-b","--auth-tag-length", opt->auth_tag_length_) #endif - else + else return i; } if(ipv4_only && ipv6_only) @@ -308,13 +308,13 @@ void options_parse_post(options_t* opt) return; #ifndef NO_CRYPT - if(!strcmp(opt->cipher_, "null") && !strcmp(opt->auth_algo_, "null") && + if(!strcmp(opt->cipher_, "null") && !strcmp(opt->auth_algo_, "null") && strcmp(opt->kd_prf_, "null")) { if(opt->kd_prf_) free(opt->kd_prf_); opt->kd_prf_ = strdup("null"); } - if((strcmp(opt->cipher_, "null") || strcmp(opt->auth_algo_, "null")) && + if((strcmp(opt->cipher_, "null") || strcmp(opt->auth_algo_, "null")) && !strcmp(opt->kd_prf_, "null")) { log_printf(WARNING, "using NULL key derivation with encryption and or authentication enabled!"); } @@ -433,14 +433,14 @@ void options_print_usage() printf(" [-C|--chroot] chroot to this directory\n"); printf(" [-P|--write-pid] write pid to this file\n"); printf(" [-i|--interface] local ip address to bind to\n"); - printf(" [-p|--port] local port to bind to\n"); + printf(" [-p|--port] local port to bind to (use port:port for range - RAIL)\n"); printf(" [-s|--sender-id ] the sender id to use\n"); printf(" [-L|--log] :[,[,..]]\n"); printf(" add a log target, can be invoked several times\n"); printf(" [-U|--debug] don't daemonize and log to stdout with maximum log level\n"); printf(" [-r|--remote-host] remote host\n"); - printf(" [-o|--remote-port] remote port\n"); + printf(" [-o|--remote-port] remote port (use port:port for range - RAIL)\n"); printf(" [-4|--ipv4-only] always resolv IPv4 addresses\n"); printf(" [-6|--ipv6-only] always resolv IPv6 addresses\n"); printf(" [-d|--dev] device name\n"); -- cgit v1.2.3