diff options
author | Christian Pointner <equinox@spreadspace.org> | 2010-11-28 22:55:24 +0000 |
---|---|---|
committer | Christian Pointner <equinox@spreadspace.org> | 2010-11-28 22:55:24 +0000 |
commit | 174a9f39da1f09c6ffd9c6f0b3a6a42da5ec4163 (patch) | |
tree | 74bb2be118291b2df2ad7d18d33a6816626a32e6 /src/options.c | |
parent | first minial version working (diff) |
source address to connect from can now be specified
git-svn-id: https://svn.spreadspace.org/tcpproxy/trunk@13 e61f0598-a718-4e21-a8f0-0aadfa62ad6b
Diffstat (limited to 'src/options.c')
-rw-r--r-- | src/options.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/options.c b/src/options.c index 27c97d0..39e53ee 100644 --- a/src/options.c +++ b/src/options.c @@ -182,6 +182,7 @@ int options_parse(options_t* opt, int argc, char* argv[]) PARSE_STRING_PARAM("-p","--local-port", opt->local_port_) PARSE_STRING_PARAM("-r","--remote-addr", opt->remote_addr_) PARSE_STRING_PARAM("-o","--remote-port", opt->remote_port_) + PARSE_STRING_PARAM("-s","--source-addr", opt->source_addr_) PARSE_STRING_PARAM("-c","--config", opt->config_file_) else return i; @@ -222,6 +223,7 @@ void options_default(options_t* opt) opt->local_port_ = NULL; opt->remote_addr_ = NULL; opt->remote_port_ = NULL; + opt->source_addr_ = NULL; opt->config_file_ = strdup(CONFFILE); string_list_init(&opt->log_targets_); opt->debug_ = 0; @@ -251,6 +253,8 @@ void options_clear(options_t* opt) free(opt->remote_addr_); if(opt->remote_port_) free(opt->remote_port_); + if(opt->source_addr_) + free(opt->source_addr_); if(opt->config_file_) free(opt->config_file_); } @@ -272,6 +276,7 @@ void options_print_usage() printf(" [-p|--local-port] <service> local port to listen on\n"); printf(" [-r|--remote-addr] <host> remote address to connect to\n"); printf(" [-o|--remote-port] <service> remote port to connect to\n"); + printf(" [-r|--source-addr] <host> source address to connect from\n"); printf(" [-c|--config] <file> configuration file\n"); } @@ -298,6 +303,7 @@ void options_print(options_t* opt) printf("local_port: '%s'\n", opt->local_port_); printf("remote_addr: '%s'\n", opt->remote_addr_); printf("remote_port: '%s'\n", opt->remote_port_); + printf("source_addr: '%s'\n", opt->source_addr_); printf("config_file: '%s'\n", opt->config_file_); printf("debug: %s\n", !opt->debug_ ? "false" : "true"); } |