From 6c40ae29a879eb7d7a70cbea9e3ff16e643ccce7 Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Mon, 7 Oct 2013 11:55:08 +0000 Subject: whitespace cleanups updated copyright notice git-svn-id: https://svn.spreadspace.org/tcpproxy/trunk@68 e61f0598-a718-4e21-a8f0-0aadfa62ad6b --- ChangeLog | 6 +++++- LICENSE | 12 ++++++------ README | 6 +++--- doc/Makefile | 14 +++++++------- doc/tcpproxy.8 | 21 +++++++++++++++------ doc/tcpproxy.8.txt | 34 +++++++++++++++++----------------- src/Makefile | 12 ++++++------ src/cfg_parser.h | 12 ++++++------ src/cfg_parser.rl | 2 +- src/clients.c | 2 +- src/clients.h | 12 ++++++------ src/configure | 2 +- src/daemon.h | 13 ++++++------- src/datatypes.h | 12 ++++++------ src/listener.c | 2 +- src/listener.h | 12 ++++++------ src/log.c | 16 ++++++++-------- src/log.h | 12 ++++++------ src/log_targets.h | 28 ++++++++++++++-------------- src/options.c | 18 +++++++++--------- src/options.h | 12 ++++++------ src/sig_handler.c | 12 ++++++------ src/sig_handler.h | 12 ++++++------ src/slist.c | 28 ++++++++++++++-------------- src/slist.h | 12 ++++++------ src/string_list.c | 16 ++++++++-------- src/string_list.h | 12 ++++++------ src/tcp.c | 16 ++++++++-------- src/tcp.h | 12 ++++++------ src/tcpproxy.c | 4 ++-- 30 files changed, 198 insertions(+), 186 deletions(-) diff --git a/ChangeLog b/ChangeLog index 545b488..891a501 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,8 +1,12 @@ +2013.10.07 -- Version 1.1 + +* fixed build for clang + 2010.12.25 -- Version 1.0 * print some info in SIGUSR1 and SIGUSR2 * fixed problematic usage of strndup at new parser - + 2010.12.11 -- Version 0.2 * added TCP_NODELAY option for client fd's diff --git a/LICENSE b/LICENSE index 63d266c..b3f95c6 100644 --- a/LICENSE +++ b/LICENSE @@ -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 - * + * + * Copyright (C) 2010-2013 Christian Pointner + * * This file is part of tcpproxy. * * tcpproxy is free software: you can redistribute it and/or modify diff --git a/README b/README index 608c43e..3d77137 100644 --- a/README +++ b/README @@ -1,9 +1,9 @@ Introduction ============ -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. Dependencies diff --git a/doc/Makefile b/doc/Makefile index d094e90..404da2d 100644 --- a/doc/Makefile +++ b/doc/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 -## +## +## Copyright (C) 2010-2013 Christian Pointner +## ## This file is part of tcpproxy. ## ## tcpproxy is free software: you can redistribute it and/or modify @@ -27,7 +27,7 @@ VERSION=$(shell cat ../version) -.PHONY: clean +.PHONY: clean all: manpage diff --git a/doc/tcpproxy.8 b/doc/tcpproxy.8 index 1eab26a..090d818 100644 --- a/doc/tcpproxy.8 +++ b/doc/tcpproxy.8 @@ -1,13 +1,22 @@ '\" t .\" Title: tcpproxy .\" Author: [see the "AUTHORS" section] -.\" Generator: DocBook XSL Stylesheets v1.75.1 -.\" Date: 12/14/2010 -.\" Manual: tcpproxy user manual -.\" Source: tcpproxy trunk +.\" Generator: DocBook XSL Stylesheets v1.76.1 +.\" Date: 10/07/2013 +.\" Manual: \ \& +.\" Source: \ \& .\" Language: English .\" -.TH "TCPPROXY" "8" "12/14/2010" "tcpproxy trunk" "tcpproxy user manual" +.TH "TCPPROXY" "8" "10/07/2013" "\ \&" "\ \&" +.\" ----------------------------------------------------------------- +.\" * Define some portability stuff +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" http://bugs.debian.org/507673 +.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- @@ -213,4 +222,4 @@ Christian Pointner Main web site: http://www\&.spreadspace\&.org/tcpproxy/ .SH "COPYING" .sp -Copyright (C) 2010 Christian Pointner\&. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or any later version\&. +Copyright (C) 2010\-2013 Christian Pointner\&. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or any later version\&. diff --git a/doc/tcpproxy.8.txt b/doc/tcpproxy.8.txt index c727c69..85bb7f6 100644 --- a/doc/tcpproxy.8.txt +++ b/doc/tcpproxy.8.txt @@ -35,9 +35,9 @@ tcpproxy DESCRIPTION ----------- -*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 +*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. OPTIONS @@ -50,7 +50,7 @@ The following options can be passed to the *tcpproxy* daemon: instead of becoming a daemon which is the default. *-u, --username *:: - run as this user. If no group is specified (*-g*) the default group of + run as this user. If no group is specified (*-g*) the default group of the user is used. The default is to not drop privileges. *-g, --groupname *:: @@ -58,20 +58,20 @@ The following options can be passed to the *tcpproxy* daemon: The default is to not drop privileges. *-C, --chroot *:: - Instruct *tcpproxy* to run in a chroot jail. The default is + Instruct *tcpproxy* to run in a chroot jail. The default is to not run in chroot. *-P, --write-pid *:: - Instruct *tcpproxy* to write it's pid to this file. The default is + Instruct *tcpproxy* to write it's pid to this file. The default is to not create a pid file. *-L, --log :[,[,[..]]]*:: add log target to logging system. This can be invoked several times - in order to log to different targets at the same time. Every target + in order to log to different targets at the same time. Every target has its own log level which is a number between 0 and 5. Where 0 means disabling log and 5 means debug messages are enabled. + The file target can be used more than once with different levels. - If no target is provided at the command line a single target with the + If no target is provided at the command line a single target with the config *syslog:3,tcpproxy,daemon* is added. + The following targets are supported: @@ -81,7 +81,7 @@ The following options can be passed to the *tcpproxy* daemon: *stderr*;; log to standard error, parameters *-U, --debug*:: - This option instructs *tcpproxy* to run in debug mode. It implicits *-D* + This option instructs *tcpproxy* to run in debug mode. It implicits *-D* (don't daemonize) and adds a log target with the configuration *stdout:5* (logging with maximum level). In future releases there might be additional output when this option is supplied. @@ -95,7 +95,7 @@ The following options can be passed to the *tcpproxy* daemon: to resolv both. *-p, --local-port *:: - The local port to bind to. By default there is no port defined in which case + The local port to bind to. By default there is no port defined in which case *tcpproxy* will try to read the configuration file. *-r, --remote-addr *:: @@ -116,7 +116,7 @@ The following options can be passed to the *tcpproxy* daemon: By default *tcpproxy* uses the default source address for the defined remote host. *-b, --buffer-size *:: - The size of the transmit buffers to use. *tcpproxy* will allocate two buffers of this + The size of the transmit buffers to use. *tcpproxy* will allocate two buffers of this size for any client which is connected. By default a value of 10Kbytes is used. *-c, --config *:: @@ -148,12 +148,12 @@ SIGNALS After receiving the HUP signal *tcpproxy* tries to reload the configuration file. It only reopens a listen socket if the local address and or port has changed. Therefore reloading the configuration after the daemon has dropped privileges is safe as long as there are no changes -in the local address and port. However this is only of concern if any of the listen ports is +in the local address and port. However this is only of concern if any of the listen ports is a privileged port (<1024). If there is a syntax error at the configuration file all changes are discarded. On SIGUSR1 *tcpproxy* prints some information about the listening sockets and after SIGUSR2 -information about open client connections is printed. This is sent to all configured log -targets at a level of 3. +information about open client connections is printed. This is sent to all configured log +targets at a level of 3. BUGS @@ -182,7 +182,7 @@ Main web site: http://www.spreadspace.org/tcpproxy/ COPYING ------- -Copyright \(C) 2010 Christian Pointner. This program is free -software: you can redistribute it and/or modify it under the terms -of the GNU General Public License as published by the Free Software +Copyright \(C) 2010-2013 Christian Pointner. This program is free +software: you can redistribute it and/or modify it under the terms +of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or any later version. 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 -## +## +## Copyright (C) 2010-2013 Christian Pointner +## ## 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 - * + * + * Copyright (C) 2010-2013 Christian Pointner + * * 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 + * Copyright (C) 2010-2013 Christian Pointner * * 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 + * Copyright (C) 2010-2013 Christian Pointner * * 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 - * + * + * Copyright (C) 2010-2013 Christian Pointner + * * 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 +# Copyright (C) 2010-2013 Christian Pointner # # 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 - * + * + * Copyright (C) 2010-2013 Christian Pointner + * * 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 - * + * + * Copyright (C) 2010-2013 Christian Pointner + * * 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 + * Copyright (C) 2010-2013 Christian Pointner * * 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 - * + * + * Copyright (C) 2010-2013 Christian Pointner + * * This file is part of tcpproxy. * * tcpproxy is free software: you can redistribute it and/or modify diff --git a/src/log.c b/src/log.c index dd75cea..9354ffa 100644 --- a/src/log.c +++ b/src/log.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 - * + * + * Copyright (C) 2010-2013 Christian Pointner + * * 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; diff --git a/src/log.h b/src/log.h index cde20ac..e7f2e75 100644 --- a/src/log.h +++ b/src/log.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 - * + * + * Copyright (C) 2010-2013 Christian Pointner + * * 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 - * + * + * Copyright (C) 2010-2013 Christian Pointner + * * 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 = "