diff options
author | Christian Pointner <equinox@spreadspace.org> | 2013-10-07 11:55:08 +0000 |
---|---|---|
committer | Christian Pointner <equinox@spreadspace.org> | 2013-10-07 11:55:08 +0000 |
commit | 6c40ae29a879eb7d7a70cbea9e3ff16e643ccce7 (patch) | |
tree | 4c05ef3d015aa4747668cccc00238de88d1e25af /src | |
parent | fixed build with -Wall (diff) |
whitespace cleanups
updated copyright notice
git-svn-id: https://svn.spreadspace.org/tcpproxy/trunk@68 e61f0598-a718-4e21-a8f0-0aadfa62ad6b
Diffstat (limited to 'src')
-rw-r--r-- | src/Makefile | 12 | ||||
-rw-r--r-- | src/cfg_parser.h | 12 | ||||
-rw-r--r-- | src/cfg_parser.rl | 2 | ||||
-rw-r--r-- | src/clients.c | 2 | ||||
-rw-r--r-- | src/clients.h | 12 | ||||
-rwxr-xr-x | src/configure | 2 | ||||
-rw-r--r-- | src/daemon.h | 13 | ||||
-rw-r--r-- | src/datatypes.h | 12 | ||||
-rw-r--r-- | src/listener.c | 2 | ||||
-rw-r--r-- | src/listener.h | 12 | ||||
-rw-r--r-- | src/log.c | 16 | ||||
-rw-r--r-- | src/log.h | 12 | ||||
-rw-r--r-- | src/log_targets.h | 28 | ||||
-rw-r--r-- | src/options.c | 18 | ||||
-rw-r--r-- | src/options.h | 12 | ||||
-rw-r--r-- | src/sig_handler.c | 12 | ||||
-rw-r--r-- | src/sig_handler.h | 12 | ||||
-rw-r--r-- | src/slist.c | 28 | ||||
-rw-r--r-- | src/slist.h | 12 | ||||
-rw-r--r-- | src/string_list.c | 16 | ||||
-rw-r--r-- | src/string_list.h | 12 | ||||
-rw-r--r-- | src/tcp.c | 16 | ||||
-rw-r--r-- | src/tcp.h | 12 | ||||
-rw-r--r-- | src/tcpproxy.c | 4 |
24 files changed, 145 insertions, 146 deletions
diff --git a/src/Makefile b/src/Makefile index 4c5fe37..4524b29 100644 --- a/src/Makefile +++ b/src/Makefile @@ -1,14 +1,14 @@ ## ## tcpproxy ## -## tcpproxy is a simple tcp connection proxy which combines the -## features of rinetd and 6tunnel. tcpproxy supports IPv4 and -## IPv6 and also supports connections from IPv6 to IPv4 +## tcpproxy is a simple tcp connection proxy which combines the +## features of rinetd and 6tunnel. tcpproxy supports IPv4 and +## IPv6 and also supports connections from IPv6 to IPv4 ## endpoints and vice versa. -## ## -## Copyright (C) 2010-2011 Christian Pointner <equinox@spreadspace.org> -## +## +## Copyright (C) 2010-2013 Christian Pointner <equinox@spreadspace.org> +## ## This file is part of tcpproxy. ## ## tcpproxy is free software: you can redistribute it and/or modify diff --git a/src/cfg_parser.h b/src/cfg_parser.h index d96c705..a373154 100644 --- a/src/cfg_parser.h +++ b/src/cfg_parser.h @@ -1,14 +1,14 @@ /* * tcpproxy * - * tcpproxy is a simple tcp connection proxy which combines the - * features of rinetd and 6tunnel. tcpproxy supports IPv4 and - * IPv6 and also supports connections from IPv6 to IPv4 + * tcpproxy is a simple tcp connection proxy which combines the + * features of rinetd and 6tunnel. tcpproxy supports IPv4 and + * IPv6 and also supports connections from IPv6 to IPv4 * endpoints and vice versa. - * * - * Copyright (C) 2010-2011 Christian Pointner <equinox@spreadspace.org> - * + * + * Copyright (C) 2010-2013 Christian Pointner <equinox@spreadspace.org> + * * This file is part of tcpproxy. * * tcpproxy is free software: you can redistribute it and/or modify diff --git a/src/cfg_parser.rl b/src/cfg_parser.rl index 03adbcc..918501c 100644 --- a/src/cfg_parser.rl +++ b/src/cfg_parser.rl @@ -7,7 +7,7 @@ * endpoints and vice versa. * * - * Copyright (C) 2010-2011 Christian Pointner <equinox@spreadspace.org> + * Copyright (C) 2010-2013 Christian Pointner <equinox@spreadspace.org> * * This file is part of tcpproxy. * diff --git a/src/clients.c b/src/clients.c index 869733b..7dd6a85 100644 --- a/src/clients.c +++ b/src/clients.c @@ -7,7 +7,7 @@ * endpoints and vice versa. * * - * Copyright (C) 2010-2011 Christian Pointner <equinox@spreadspace.org> + * Copyright (C) 2010-2013 Christian Pointner <equinox@spreadspace.org> * * This file is part of tcpproxy. * diff --git a/src/clients.h b/src/clients.h index 8085b97..febc91c 100644 --- a/src/clients.h +++ b/src/clients.h @@ -1,14 +1,14 @@ /* * tcpproxy * - * tcpproxy is a simple tcp connection proxy which combines the - * features of rinetd and 6tunnel. tcpproxy supports IPv4 and - * IPv6 and also supports connections from IPv6 to IPv4 + * tcpproxy is a simple tcp connection proxy which combines the + * features of rinetd and 6tunnel. tcpproxy supports IPv4 and + * IPv6 and also supports connections from IPv6 to IPv4 * endpoints and vice versa. - * * - * Copyright (C) 2010-2011 Christian Pointner <equinox@spreadspace.org> - * + * + * Copyright (C) 2010-2013 Christian Pointner <equinox@spreadspace.org> + * * This file is part of tcpproxy. * * tcpproxy is free software: you can redistribute it and/or modify diff --git a/src/configure b/src/configure index aa9cb83..482c894 100755 --- a/src/configure +++ b/src/configure @@ -8,7 +8,7 @@ # endpoints and vice versa. # # -# Copyright (C) 2010-2011 Christian Pointner <equinox@spreadspace.org> +# Copyright (C) 2010-2013 Christian Pointner <equinox@spreadspace.org> # # This file is part of tcpproxy. # diff --git a/src/daemon.h b/src/daemon.h index ebb7780..42f59a6 100644 --- a/src/daemon.h +++ b/src/daemon.h @@ -1,14 +1,14 @@ /* * tcpproxy * - * tcpproxy is a simple tcp connection proxy which combines the - * features of rinetd and 6tunnel. tcpproxy supports IPv4 and - * IPv6 and also supports connections from IPv6 to IPv4 + * tcpproxy is a simple tcp connection proxy which combines the + * features of rinetd and 6tunnel. tcpproxy supports IPv4 and + * IPv6 and also supports connections from IPv6 to IPv4 * endpoints and vice versa. - * * - * Copyright (C) 2010-2011 Christian Pointner <equinox@spreadspace.org> - * + * + * Copyright (C) 2010-2013 Christian Pointner <equinox@spreadspace.org> + * * This file is part of tcpproxy. * * tcpproxy is free software: you can redistribute it and/or modify @@ -164,4 +164,3 @@ void daemonize() } #endif - diff --git a/src/datatypes.h b/src/datatypes.h index deac84d..328829b 100644 --- a/src/datatypes.h +++ b/src/datatypes.h @@ -1,14 +1,14 @@ /* * tcpproxy * - * tcpproxy is a simple tcp connection proxy which combines the - * features of rinetd and 6tunnel. tcpproxy supports IPv4 and - * IPv6 and also supports connections from IPv6 to IPv4 + * tcpproxy is a simple tcp connection proxy which combines the + * features of rinetd and 6tunnel. tcpproxy supports IPv4 and + * IPv6 and also supports connections from IPv6 to IPv4 * endpoints and vice versa. - * * - * Copyright (C) 2010-2011 Christian Pointner <equinox@spreadspace.org> - * + * + * Copyright (C) 2010-2013 Christian Pointner <equinox@spreadspace.org> + * * This file is part of tcpproxy. * * tcpproxy is free software: you can redistribute it and/or modify diff --git a/src/listener.c b/src/listener.c index abb0f6f..02dd149 100644 --- a/src/listener.c +++ b/src/listener.c @@ -7,7 +7,7 @@ * endpoints and vice versa. * * - * Copyright (C) 2010-2011 Christian Pointner <equinox@spreadspace.org> + * Copyright (C) 2010-2013 Christian Pointner <equinox@spreadspace.org> * * This file is part of tcpproxy. * diff --git a/src/listener.h b/src/listener.h index 6b95498..d7319c2 100644 --- a/src/listener.h +++ b/src/listener.h @@ -1,14 +1,14 @@ /* * tcpproxy * - * tcpproxy is a simple tcp connection proxy which combines the - * features of rinetd and 6tunnel. tcpproxy supports IPv4 and - * IPv6 and also supports connections from IPv6 to IPv4 + * tcpproxy is a simple tcp connection proxy which combines the + * features of rinetd and 6tunnel. tcpproxy supports IPv4 and + * IPv6 and also supports connections from IPv6 to IPv4 * endpoints and vice versa. - * * - * Copyright (C) 2010-2011 Christian Pointner <equinox@spreadspace.org> - * + * + * Copyright (C) 2010-2013 Christian Pointner <equinox@spreadspace.org> + * * This file is part of tcpproxy. * * tcpproxy is free software: you can redistribute it and/or modify @@ -1,14 +1,14 @@ /* * tcpproxy * - * tcpproxy is a simple tcp connection proxy which combines the - * features of rinetd and 6tunnel. tcpproxy supports IPv4 and - * IPv6 and also supports connections from IPv6 to IPv4 + * tcpproxy is a simple tcp connection proxy which combines the + * features of rinetd and 6tunnel. tcpproxy supports IPv4 and + * IPv6 and also supports connections from IPv6 to IPv4 * endpoints and vice versa. - * * - * Copyright (C) 2010-2011 Christian Pointner <equinox@spreadspace.org> - * + * + * Copyright (C) 2010-2013 Christian Pointner <equinox@spreadspace.org> + * * This file is part of tcpproxy. * * tcpproxy is free software: you can redistribute it and/or modify @@ -77,7 +77,7 @@ int log_targets_target_exists(log_targets_t* targets, log_target_type_t type) if(tmp->type_ == type) return 1; tmp = tmp->next_; - } + } return 0; } @@ -140,7 +140,7 @@ int log_targets_add(log_targets_t* targets, const char* conf) log_target_t* tmp = targets->first_; while(tmp->next_) tmp = tmp->next_; - + tmp->next_ = new_target; } return 0; @@ -1,14 +1,14 @@ /* * tcpproxy * - * tcpproxy is a simple tcp connection proxy which combines the - * features of rinetd and 6tunnel. tcpproxy supports IPv4 and - * IPv6 and also supports connections from IPv6 to IPv4 + * tcpproxy is a simple tcp connection proxy which combines the + * features of rinetd and 6tunnel. tcpproxy supports IPv4 and + * IPv6 and also supports connections from IPv6 to IPv4 * endpoints and vice versa. - * * - * Copyright (C) 2010-2011 Christian Pointner <equinox@spreadspace.org> - * + * + * Copyright (C) 2010-2013 Christian Pointner <equinox@spreadspace.org> + * * This file is part of tcpproxy. * * tcpproxy is free software: you can redistribute it and/or modify diff --git a/src/log_targets.h b/src/log_targets.h index 5ee3a39..8257a2d 100644 --- a/src/log_targets.h +++ b/src/log_targets.h @@ -1,14 +1,14 @@ /* * tcpproxy * - * tcpproxy is a simple tcp connection proxy which combines the - * features of rinetd and 6tunnel. tcpproxy supports IPv4 and - * IPv6 and also supports connections from IPv6 to IPv4 + * tcpproxy is a simple tcp connection proxy which combines the + * features of rinetd and 6tunnel. tcpproxy supports IPv4 and + * IPv6 and also supports connections from IPv6 to IPv4 * endpoints and vice versa. - * * - * Copyright (C) 2010-2011 Christian Pointner <equinox@spreadspace.org> - * + * + * Copyright (C) 2010-2013 Christian Pointner <equinox@spreadspace.org> + * * This file is part of tcpproxy. * * tcpproxy is free software: you can redistribute it and/or modify @@ -34,7 +34,7 @@ static char* get_time_formatted() { char* time_string; time_t t = time(NULL); - if(t < 0) + if(t < 0) time_string = "<time read error>"; else { time_string = ctime(&t); @@ -72,7 +72,7 @@ int log_target_syslog_init(log_target_t* self, const char* conf) { if(!self || (conf && conf[0] == 0)) return -1; - + self->param_ = malloc(sizeof(log_target_syslog_param_t)); if(!self->param_) return -2; @@ -88,7 +88,7 @@ int log_target_syslog_init(log_target_t* self, const char* conf) if(!len) { free(self->param_); return -1; - } + } logname = malloc(len+1); if(logname) { strncpy(logname, conf, len); @@ -109,13 +109,13 @@ int log_target_syslog_init(log_target_t* self, const char* conf) ((log_target_syslog_param_t*)(self->param_))->facility_ = DAEMON; return 0; } - + if(end[1] == 0 || end[1] == ',') { free(logname); free(self->param_); return -1; } - + const char* start = end + 1; end = strchr(start, ','); int i; @@ -150,7 +150,7 @@ void log_target_syslog_log(log_target_t* self, log_prio_t prio, const char* msg) if(!self || !self->param_ || !self->opened_) return; - syslog((prio + 2) | ((log_target_syslog_param_t*)(self->param_))->facility_, "%s", msg); + syslog((prio + 2) | ((log_target_syslog_param_t*)(self->param_))->facility_, "%s", msg); } void log_target_syslog_close(log_target_t* self) @@ -202,7 +202,7 @@ int log_target_file_init(log_target_t* self, const char* conf) { if(!self || (conf && conf[0] == 0)) return -1; - + self->param_ = malloc(sizeof(log_target_file_param_t)); if(!self->param_) return -2; @@ -217,7 +217,7 @@ int log_target_file_init(log_target_t* self, const char* conf) if(!len) { free(self->param_); return -1; - } + } logfilename = malloc(len+1); if(logfilename) { strncpy(logfilename, conf, len); diff --git a/src/options.c b/src/options.c index 116cb52..f2fc0b6 100644 --- a/src/options.c +++ b/src/options.c @@ -1,14 +1,14 @@ /* * tcpproxy * - * tcpproxy is a simple tcp connection proxy which combines the - * features of rinetd and 6tunnel. tcpproxy supports IPv4 and - * IPv6 and also supports connections from IPv6 to IPv4 + * tcpproxy is a simple tcp connection proxy which combines the + * features of rinetd and 6tunnel. tcpproxy supports IPv4 and + * IPv6 and also supports connections from IPv6 to IPv4 * endpoints and vice versa. - * * - * Copyright (C) 2010-2011 Christian Pointner <equinox@spreadspace.org> - * + * + * Copyright (C) 2010-2013 Christian Pointner <equinox@spreadspace.org> + * * This file is part of tcpproxy. * * tcpproxy is free software: you can redistribute it and/or modify @@ -142,9 +142,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_) { @@ -206,7 +206,7 @@ int options_parse(options_t* opt, int argc, char* argv[]) PARSE_STRING_PARAM("-s","--source-addr", opt->source_addr_) PARSE_STRING_PARAM("-c","--config", opt->config_file_) PARSE_INT_PARAM("-b","--buffer-size", opt->buffer_size_) - else + else return i; } diff --git a/src/options.h b/src/options.h index 9a45c47..8d17bba 100644 --- a/src/options.h +++ b/src/options.h @@ -1,14 +1,14 @@ /* * tcpproxy * - * tcpproxy is a simple tcp connection proxy which combines the - * features of rinetd and 6tunnel. tcpproxy supports IPv4 and - * IPv6 and also supports connections from IPv6 to IPv4 + * tcpproxy is a simple tcp connection proxy which combines the + * features of rinetd and 6tunnel. tcpproxy supports IPv4 and + * IPv6 and also supports connections from IPv6 to IPv4 * endpoints and vice versa. - * * - * Copyright (C) 2010-2011 Christian Pointner <equinox@spreadspace.org> - * + * + * Copyright (C) 2010-2013 Christian Pointner <equinox@spreadspace.org> + * * This file is part of tcpproxy. * * tcpproxy is free software: you can redistribute it and/or modify diff --git a/src/sig_handler.c b/src/sig_handler.c index 9ee05c4..cc7276d 100644 --- a/src/sig_handler.c +++ b/src/sig_handler.c @@ -1,14 +1,14 @@ /* * tcpproxy * - * tcpproxy is a simple tcp connection proxy which combines the - * features of rinetd and 6tunnel. tcpproxy supports IPv4 and - * IPv6 and also supports connections from IPv6 to IPv4 + * tcpproxy is a simple tcp connection proxy which combines the + * features of rinetd and 6tunnel. tcpproxy supports IPv4 and + * IPv6 and also supports connections from IPv6 to IPv4 * endpoints and vice versa. - * * - * Copyright (C) 2010-2011 Christian Pointner <equinox@spreadspace.org> - * + * + * Copyright (C) 2010-2013 Christian Pointner <equinox@spreadspace.org> + * * This file is part of tcpproxy. * * tcpproxy is free software: you can redistribute it and/or modify diff --git a/src/sig_handler.h b/src/sig_handler.h index eb19abf..efcdf66 100644 --- a/src/sig_handler.h +++ b/src/sig_handler.h @@ -1,14 +1,14 @@ /* * tcpproxy * - * tcpproxy is a simple tcp connection proxy which combines the - * features of rinetd and 6tunnel. tcpproxy supports IPv4 and - * IPv6 and also supports connections from IPv6 to IPv4 + * tcpproxy is a simple tcp connection proxy which combines the + * features of rinetd and 6tunnel. tcpproxy supports IPv4 and + * IPv6 and also supports connections from IPv6 to IPv4 * endpoints and vice versa. - * * - * Copyright (C) 2010-2011 Christian Pointner <equinox@spreadspace.org> - * + * + * Copyright (C) 2010-2013 Christian Pointner <equinox@spreadspace.org> + * * This file is part of tcpproxy. * * tcpproxy is free software: you can redistribute it and/or modify diff --git a/src/slist.c b/src/slist.c index 24da141..3195833 100644 --- a/src/slist.c +++ b/src/slist.c @@ -1,14 +1,14 @@ /* * tcpproxy * - * tcpproxy is a simple tcp connection proxy which combines the - * features of rinetd and 6tunnel. tcpproxy supports IPv4 and - * IPv6 and also supports connections from IPv6 to IPv4 + * tcpproxy is a simple tcp connection proxy which combines the + * features of rinetd and 6tunnel. tcpproxy supports IPv4 and + * IPv6 and also supports connections from IPv6 to IPv4 * endpoints and vice versa. - * * - * Copyright (C) 2010-2011 Christian Pointner <equinox@spreadspace.org> - * + * + * Copyright (C) 2010-2013 Christian Pointner <equinox@spreadspace.org> + * * This file is part of tcpproxy. * * tcpproxy is free software: you can redistribute it and/or modify @@ -36,10 +36,10 @@ slist_element_t* slist_get_last(slist_element_t* first) { if(!first) return NULL; - + while(first->next_) first = first->next_; - + return first; } @@ -62,7 +62,7 @@ slist_element_t* slist_add(slist_t* lst, void* data) slist_element_t* new_element = malloc(sizeof(slist_element_t)); if(!new_element) return NULL; - + new_element->data_ = data; new_element->next_ = NULL; @@ -70,7 +70,7 @@ slist_element_t* slist_add(slist_t* lst, void* data) lst->first_ = new_element; else slist_get_last(lst->first_)->next_ = new_element; - + return new_element; } @@ -104,7 +104,7 @@ void slist_clear(slist_t* lst) { if(!lst || !lst->first_) return; - + do { slist_element_t* deletee = lst->first_; lst->first_ = lst->first_->next_; @@ -112,7 +112,7 @@ void slist_clear(slist_t* lst) free(deletee); } while(lst->first_); - + lst->first_ = NULL; } @@ -120,11 +120,11 @@ int slist_length(slist_t* lst) { if(!lst || !lst->first_) return 0; - + int len = 0; slist_element_t* tmp; for(tmp = lst->first_; tmp; tmp = tmp->next_) len++; - + return len; } diff --git a/src/slist.h b/src/slist.h index f036bf3..bf6b394 100644 --- a/src/slist.h +++ b/src/slist.h @@ -1,14 +1,14 @@ /* * tcpproxy * - * tcpproxy is a simple tcp connection proxy which combines the - * features of rinetd and 6tunnel. tcpproxy supports IPv4 and - * IPv6 and also supports connections from IPv6 to IPv4 + * tcpproxy is a simple tcp connection proxy which combines the + * features of rinetd and 6tunnel. tcpproxy supports IPv4 and + * IPv6 and also supports connections from IPv6 to IPv4 * endpoints and vice versa. - * * - * Copyright (C) 2010-2011 Christian Pointner <equinox@spreadspace.org> - * + * + * Copyright (C) 2010-2013 Christian Pointner <equinox@spreadspace.org> + * * This file is part of tcpproxy. * * tcpproxy is free software: you can redistribute it and/or modify diff --git a/src/string_list.c b/src/string_list.c index e197749..8715f65 100644 --- a/src/string_list.c +++ b/src/string_list.c @@ -1,14 +1,14 @@ /* * tcpproxy * - * tcpproxy is a simple tcp connection proxy which combines the - * features of rinetd and 6tunnel. tcpproxy supports IPv4 and - * IPv6 and also supports connections from IPv6 to IPv4 + * tcpproxy is a simple tcp connection proxy which combines the + * features of rinetd and 6tunnel. tcpproxy supports IPv4 and + * IPv6 and also supports connections from IPv6 to IPv4 * endpoints and vice versa. - * * - * Copyright (C) 2010-2011 Christian Pointner <equinox@spreadspace.org> - * + * + * Copyright (C) 2010-2013 Christian Pointner <equinox@spreadspace.org> + * * This file is part of tcpproxy. * * tcpproxy is free software: you can redistribute it and/or modify @@ -46,7 +46,7 @@ int string_list_add(string_list_t* list, const char* string) { if(!list) return -1; - + char* tmp = strdup(string); if(slist_add(list, tmp) == NULL) { free(tmp); @@ -60,7 +60,7 @@ void string_list_print(string_list_t* list, const char* head, const char* tail) { if(!list) return; - + slist_element_t* tmp = list->first_; while(tmp) { printf("%s%s%s", head, (char*)(tmp->data_), tail); diff --git a/src/string_list.h b/src/string_list.h index e748e43..b60e7db 100644 --- a/src/string_list.h +++ b/src/string_list.h @@ -1,14 +1,14 @@ /* * tcpproxy * - * tcpproxy is a simple tcp connection proxy which combines the - * features of rinetd and 6tunnel. tcpproxy supports IPv4 and - * IPv6 and also supports connections from IPv6 to IPv4 + * tcpproxy is a simple tcp connection proxy which combines the + * features of rinetd and 6tunnel. tcpproxy supports IPv4 and + * IPv6 and also supports connections from IPv6 to IPv4 * endpoints and vice versa. - * * - * Copyright (C) 2010-2011 Christian Pointner <equinox@spreadspace.org> - * + * + * Copyright (C) 2010-2013 Christian Pointner <equinox@spreadspace.org> + * * This file is part of tcpproxy. * * tcpproxy is free software: you can redistribute it and/or modify @@ -1,14 +1,14 @@ /* * tcpproxy * - * tcpproxy is a simple tcp connection proxy which combines the - * features of rinetd and 6tunnel. tcpproxy supports IPv4 and - * IPv6 and also supports connections from IPv6 to IPv4 + * tcpproxy is a simple tcp connection proxy which combines the + * features of rinetd and 6tunnel. tcpproxy supports IPv4 and + * IPv6 and also supports connections from IPv6 to IPv4 * endpoints and vice versa. - * * - * Copyright (C) 2010-2011 Christian Pointner <equinox@spreadspace.org> - * + * + * Copyright (C) 2010-2013 Christian Pointner <equinox@spreadspace.org> + * * This file is part of tcpproxy. * * tcpproxy is free software: you can redistribute it and/or modify @@ -43,13 +43,13 @@ char* tcp_endpoint_to_string(tcp_endpoint_t e) { char addrstr[INET6_ADDRSTRLEN + 1], portstr[6], *ret; char addrport_sep = ':'; - + switch(e.addr_.ss_family) { case AF_INET: addrport_sep = ':'; break; case AF_INET6: addrport_sep = '.'; break; case AF_UNSPEC: return NULL; - default: return strdup("unknown address type"); + default: return strdup("unknown address type"); } int errcode = getnameinfo((struct sockaddr *)&(e.addr_), e.len_, addrstr, sizeof(addrstr), portstr, sizeof(portstr), NI_NUMERICHOST | NI_NUMERICSERV); @@ -1,14 +1,14 @@ /* * tcpproxy * - * tcpproxy is a simple tcp connection proxy which combines the - * features of rinetd and 6tunnel. tcpproxy supports IPv4 and - * IPv6 and also supports connections from IPv6 to IPv4 + * tcpproxy is a simple tcp connection proxy which combines the + * features of rinetd and 6tunnel. tcpproxy supports IPv4 and + * IPv6 and also supports connections from IPv6 to IPv4 * endpoints and vice versa. - * * - * Copyright (C) 2010-2011 Christian Pointner <equinox@spreadspace.org> - * + * + * Copyright (C) 2010-2013 Christian Pointner <equinox@spreadspace.org> + * * This file is part of tcpproxy. * * tcpproxy is free software: you can redistribute it and/or modify diff --git a/src/tcpproxy.c b/src/tcpproxy.c index 382b8eb..baa5214 100644 --- a/src/tcpproxy.c +++ b/src/tcpproxy.c @@ -7,7 +7,7 @@ * endpoints and vice versa. * * - * Copyright (C) 2010-2011 Christian Pointner <equinox@spreadspace.org> + * Copyright (C) 2010-2013 Christian Pointner <equinox@spreadspace.org> * * This file is part of tcpproxy. * @@ -238,5 +238,5 @@ int main(int argc, char* argv[]) log_close(); - return ret; + return ret; } |