diff options
author | Christian Pointner <equinox@spreadspace.org> | 2010-12-02 22:25:46 +0000 |
---|---|---|
committer | Christian Pointner <equinox@spreadspace.org> | 2010-12-02 22:25:46 +0000 |
commit | eb2b719951d3bb2994142f2821073f7f052cdd13 (patch) | |
tree | 622f96853e2de218d9911674d0cd3f19e4802d60 /src | |
parent | fixed handling of client read (diff) |
removed useless source address resolving type option
git-svn-id: https://svn.spreadspace.org/tcpproxy/trunk@23 e61f0598-a718-4e21-a8f0-0aadfa62ad6b
Diffstat (limited to 'src')
-rw-r--r-- | src/listener.c | 4 | ||||
-rw-r--r-- | src/listener.h | 2 | ||||
-rw-r--r-- | src/options.c | 8 | ||||
-rw-r--r-- | src/options.h | 1 | ||||
-rw-r--r-- | src/tcpproxy.c | 2 |
5 files changed, 5 insertions, 12 deletions
diff --git a/src/listener.c b/src/listener.c index a9cfa1e..a396ea4 100644 --- a/src/listener.c +++ b/src/listener.c @@ -66,7 +66,7 @@ void listener_clear(listeners_t* list) slist_clear(list); } -int listener_add(listeners_t* list, const char* laddr, resolv_type_t lrt, const char* lport, const char* raddr, resolv_type_t rrt, const char* rport, const char* saddr, resolv_type_t srt) +int listener_add(listeners_t* list, const char* laddr, resolv_type_t lrt, const char* lport, const char* raddr, resolv_type_t rrt, const char* rport, const char* saddr) { if(!list) return -1; @@ -78,7 +78,7 @@ int listener_add(listeners_t* list, const char* laddr, resolv_type_t lrt, const struct addrinfo* se = NULL; if(saddr) { - se = tcp_resolve_endpoint(saddr, NULL, srt); + se = tcp_resolve_endpoint(saddr, NULL, rrt); if(!se) { freeaddrinfo(re); return -1; diff --git a/src/listener.h b/src/listener.h index fc3feed..91b527f 100644 --- a/src/listener.h +++ b/src/listener.h @@ -47,7 +47,7 @@ typedef slist_t listeners_t; int listener_init(listeners_t* list); void listener_clear(listeners_t* list); -int listener_add(listeners_t* list, const char* laddr, resolv_type_t lrt, const char* lport, const char* raddr, resolv_type_t rrt, const char* rport, const char* saddr, resolv_type_t srt); +int listener_add(listeners_t* list, const char* laddr, resolv_type_t lrt, const char* lport, const char* raddr, resolv_type_t rrt, const char* rport, const char* saddr); void listener_remove(listeners_t* list, int fd); listener_t* listener_find(listeners_t* list, int fd); void listener_print(listeners_t* list); diff --git a/src/options.c b/src/options.c index 1f10b5c..bc49a44 100644 --- a/src/options.c +++ b/src/options.c @@ -204,7 +204,6 @@ int options_parse(options_t* opt, int argc, char* argv[]) PARSE_RESOLV_TYPE("-R","--remote-resolv", opt->rresolv_type_) PARSE_STRING_PARAM("-o","--remote-port", opt->remote_port_) PARSE_STRING_PARAM("-s","--source-addr", opt->source_addr_) - PARSE_RESOLV_TYPE("-S","--source-resolv", opt->sresolv_type_) PARSE_STRING_PARAM("-c","--config", opt->config_file_) PARSE_INT_PARAM("-b","--buffer-size", opt->buffer_size_) else @@ -252,7 +251,6 @@ void options_default(options_t* opt) opt->rresolv_type_ = ANY; opt->remote_port_ = NULL; opt->source_addr_ = NULL; - opt->sresolv_type_ = ANY; opt->config_file_ = strdup(CONFFILE); string_list_init(&opt->log_targets_); opt->buffer_size_ = 10 * 1024; @@ -306,10 +304,9 @@ void options_print_usage() printf(" [-t|--local-resolv] (ipv4|4|ipv6|6) set IPv4 or IPv6 only resolving for the local address\n"); printf(" [-p|--local-port] <service> local port to listen on\n"); printf(" [-r|--remote-addr] <host> remote address to connect to\n"); - printf(" [-R|--remote-resolv] (ipv4|4|ipv6|6) set IPv4 or IPv6 only resolving for the remote address\n"); + printf(" [-R|--remote-resolv] (ipv4|4|ipv6|6) set IPv4 or IPv6 only resolving for remote and source address\n"); printf(" [-o|--remote-port] <service> remote port to connect to\n"); printf(" [-s|--source-addr] <host> source address to connect from\n"); - printf(" [-S|--source-resolv] (ipv4|4|ipv6|6) set IPv4 or IPv6 only resolving for the source address\n"); printf(" [-b|--buffer-size] <size> size of transmit buffers\n"); printf(" [-c|--config] <file> configuration file\n"); } @@ -344,9 +341,6 @@ void options_print(options_t* opt) else printf("rresolv_type: Both\n"); printf("remote_port: '%s'\n", opt->remote_port_); printf("source_addr: '%s'\n", opt->source_addr_); - if(opt->sresolv_type_ == IPV4_ONLY) printf("sresolv_type: IPv4\n"); - else if(opt->sresolv_type_ == IPV6_ONLY) printf("sresolv_type: IPv6\n"); - else printf("sresolv_type: Both\n"); printf("buffer-size: %d\n", opt->buffer_size_); printf("config_file: '%s'\n", opt->config_file_); printf("debug: %s\n", !opt->debug_ ? "false" : "true"); diff --git a/src/options.h b/src/options.h index 085544c..9a45c47 100644 --- a/src/options.h +++ b/src/options.h @@ -47,7 +47,6 @@ struct options_struct { resolv_type_t rresolv_type_; char* remote_port_; char* source_addr_; - resolv_type_t sresolv_type_; char* config_file_; int32_t buffer_size_; int debug_; diff --git a/src/tcpproxy.c b/src/tcpproxy.c index 5423036..149fdf0 100644 --- a/src/tcpproxy.c +++ b/src/tcpproxy.c @@ -145,7 +145,7 @@ int main(int argc, char* argv[]) log_close(); exit(-1); } - ret = listener_add(&listeners, opt.local_addr_, opt.lresolv_type_, opt.local_port_, opt.remote_addr_, opt.rresolv_type_, opt.remote_port_, opt.source_addr_, opt.sresolv_type_); + ret = listener_add(&listeners, opt.local_addr_, opt.lresolv_type_, opt.local_port_, opt.remote_addr_, opt.rresolv_type_, opt.remote_port_, opt.source_addr_); if(ret) { listener_clear(&listeners); options_clear(&opt); |