Cosmetic changes and vim improvements.

git-svn-id: https://proxytunnel.svn.sourceforge.net/svnroot/proxytunnel/trunk/proxytunnel@204 bc163920-b10d-0410-b2c5-a5491ca2ceef
This commit is contained in:
Dag Wieers 2008-01-27 10:04:23 +00:00
parent 4ab2eb5b48
commit 5cffce4172
23 changed files with 50 additions and 50 deletions

2
README
View file

@ -23,7 +23,7 @@ option it specifies it's command-line options.
$ ./proxytunnel --help
Proxytunnel 1.8.0 (rev 165)
Copyright 2001-2007 Proxytunnel Project
Copyright 2001-2008 Proxytunnel Project
Jos Visser (Muppet) <josv@osp.nl>, Mark Janssen (Maniac) <maniac@maniac.nl>
Purpose:

2
TODO
View file

@ -16,8 +16,6 @@
### Code cleanup
- Fix permissions in subversion tree (some files are wrongly executable)
- Adopt a style guide for C (different styles are now being used)
- Find some hardcore C experts to help us improve the code quality
- Improve the error output, make it consistent throughout the program

View file

@ -1,4 +1,4 @@
/* Proxytunnel - (C) 2001-2006 Jos Visser / Mark Janssen */
/* Proxytunnel - (C) 2001-2008 Jos Visser / Mark Janssen */
/* Contact: josv@osp.nl / maniac@maniac.nl */
/*

View file

@ -27,7 +27,7 @@
static const char base64digits[] =
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
#define BAD -1
#define BAD -1
static const char base64val[] = {
BAD,BAD,BAD,BAD, BAD,BAD,BAD,BAD, BAD,BAD,BAD,BAD, BAD,BAD,BAD,BAD,
BAD,BAD,BAD,BAD, BAD,BAD,BAD,BAD, BAD,BAD,BAD,BAD, BAD,BAD,BAD,BAD,
@ -131,4 +131,4 @@ int unbase64(unsigned char *out, const unsigned char *in, int maxlen) {
return (len);
}
// vim:noet
// vim:noexpandtab:ts=4

View file

@ -22,4 +22,4 @@
void base64(unsigned char *out, const unsigned char *in, int len);
int unbase64(unsigned char *out, const unsigned char *in, int maxlen);
// vim:noet
// vim:noexpandtab:ts=4

View file

@ -42,13 +42,13 @@ void make_basicauth() {
* Base64 encode the clear text cookie to create the HTTP base64
* authentication cookie
*/
base64( (unsigned char *)basicauth, (unsigned char *)p, strlen( p ) );
base64( (unsigned char *)basicauth, (unsigned char *)p, strlen(p) );
// if( args_info.verbose_flag ) {
// message( "Proxy basic auth is %s\n", basicauth );
// message( "Proxy basic auth of %s is %s\n", p, basicauth );
// }
free( p );
}
// vim:noet
// vim:noexpandtab:ts=4

View file

@ -23,4 +23,4 @@ char basicauth[80]; /* Buffer to hold the proxies basic authentication data */
/* Functions */
void make_basicauth();
// vim:noet
// vim:noexpandtab:ts=4

View file

@ -100,9 +100,11 @@ static char * gengetopt_strdup (char * s) {
}
int cmdline_parser( int argc, char * const *argv, struct gengetopt_args_info *args_info ) {
int c; /* Character of the parsed option. */
int r; /* Tmd retval */
int missing_required_options = 0;
/* Character of the parsed option. */
int c;
/* Tmd retval */
int r;
int missing_required_options = 0;
char * tmp_env_var;
args_info->help_given = 0;
@ -161,27 +163,27 @@ int cmdline_parser( int argc, char * const *argv, struct gengetopt_args_info *ar
/* Struct option: Name, Has_arg, Flag, Value */
static struct option long_options[] = {
{ "help", 0, NULL, 'h' },
{ "help", 0, NULL, 'h' },
{ "version", 0, NULL, 'V' },
{ "user", 1, NULL, 'u' },
{ "pass", 1, NULL, 's' },
{ "domain", 1, NULL, 't' },
{ "user", 1, NULL, 'u' },
{ "pass", 1, NULL, 's' },
{ "domain", 1, NULL, 't' },
{ "uservar", 1, NULL, 'U' },
{ "passvar", 1, NULL, 'S' },
{ "passfile", 1, NULL, 'F' },
{ "proxy", 1, NULL, 'p' },
{ "dest", 1, NULL, 'd' },
{ "proxy", 1, NULL, 'p' },
{ "dest", 1, NULL, 'd' },
{ "remproxy", 1, NULL, 'r' },
{ "proctitle", 1, NULL, 'x' },
{ "header", 1, NULL, 'H' },
{ "header", 1, NULL, 'H' },
{ "verbose", 0, NULL, 'v' },
{ "ntlm", 0, NULL, 'N' },
{ "inetd", 0, NULL, 'i' },
{ "ntlm", 0, NULL, 'N' },
{ "inetd", 0, NULL, 'i' },
{ "standalone", 1, NULL, 'a' },
{ "quiet", 0, NULL, 'q' },
{ "quiet", 0, NULL, 'q' },
{ "encrypt", 0, NULL, 'e' },
{ "encrypt-proxy", 0, NULL, 'E' },
{ NULL, 0, NULL, 0 }
{ NULL, 0, NULL, 0 }
};
c = getopt_long (argc, argv, "hVia:u:s:t:U:S:F:p:r:d:H:x:nvNeEq", long_options, &option_index);
@ -470,4 +472,4 @@ static char *getCredentialsFromFile( const char* filename, char **user, char **p
return strdup( "Error opening password file" );
}
// vim:noet
// vim:noexpandtab:ts=4

View file

@ -30,7 +30,7 @@ struct gengetopt_args_info {
char *pass_arg; /* Password to send to HTTPS proxy for auth. */
char *domain_arg; /* NTLM Domain override */
char *proxy_arg; /* HTTPS Proxy host to connect to. */
char *proxyhost_arg; /* HTTPS Proxy host to connect to. */
char *proxyhost_arg; /* HTTPS Proxy host to connect to. */
int proxyport_arg; /* HTTPS Proxy host portnumber to connect to. */
char *dest_arg; /* Destination host to built the tunnel to. */
char header_arg[MAX_HEADER_SIZE]; /* Extra headers to send to proxy */
@ -41,16 +41,16 @@ struct gengetopt_args_info {
int quiet_flag; /* Turn on quiet mode (default=off). */
int standalone_arg; /* Turn on stdalone (-a) on port */
int encrypt_flag; /* Turn on SSL encryption (default=off). */
int encryptproxy_flag; /* Turn on client to proxy SSL encryption (def=off).*/
char *proctitle_arg; /* Override process title (default=off). */
int encryptproxy_flag; /* Turn on client to proxy SSL encryption (def=off).*/
char *proctitle_arg; /* Override process title (default=off). */
int help_given; /* Whether help was given. */
int version_given; /* Whether version was given. */
int user_given; /* Whether user was given. */
int pass_given; /* Whether pass was given. */
int domain_given; /* Whether domain was given. */
int proxy_given; /* Whether proxyhost was given. */
int proxyhost_given; /* Whether proxyhost was given. */
int proxyport_given; /* Whether proxyport was given. */
int proxyhost_given; /* Whether proxyhost was given. */
int proxyport_given; /* Whether proxyport was given. */
int dest_given; /* Whether dest was given. */
int remproxy_given; /* Whether remproxy was given. */
int verbose_given; /* Whether verbose was given. */
@ -59,8 +59,8 @@ struct gengetopt_args_info {
int quiet_given; /* Whether quiet mode was given. */
int header_given; /* Whether extra headers are given */
int encrypt_given; /* Whether encrypt was given */
int encryptproxy_given; /* Whether encrypt was given */
int proctitle_given; /* Whether to override process title */
int encryptproxy_given; /* Whether encrypt was given */
int proctitle_given; /* Whether to override process title */
};
int cmdline_parser( int argc, char * const *argv, struct gengetopt_args_info *args_info );
@ -70,4 +70,4 @@ void cmdline_parser_print_version( void );
#endif /* _cmdline_h */
// vim:noet
// vim:noexpandtab:ts=4

View file

@ -30,4 +30,4 @@
#define _PASSWORD_LEN 80
#endif
// vim:noet
// vim:noexpandtab:ts=4

View file

@ -30,4 +30,4 @@ If using PROTOTYPES, then PROTO_LIST returns the list, otherwise it
#define PROTO_LIST(list) ()
#endif
// vim:noet
// vim:noexpandtab:ts=4

2
http.c
View file

@ -204,4 +204,4 @@ void proxy_protocol(PTSTREAM *pts) {
}
}
// vim:noet
// vim:noexpandtab:ts=4

2
io.c
View file

@ -127,4 +127,4 @@ void cpio(PTSTREAM *stream1, PTSTREAM *stream2) {
closeall();
}
// vim:noet
// vim:noexpandtab:ts=4

2
io.h
View file

@ -21,4 +21,4 @@
int readline(PTSTREAM *pts);
void cpio(PTSTREAM *stream1, PTSTREAM *stream2);
// vim:noet
// vim:noexpandtab:ts=4

View file

@ -51,4 +51,4 @@ void my_perror( char *msg ) {
}
}
// vim:noet
// vim:noexpandtab:ts=4

2
ntlm.c
View file

@ -460,4 +460,4 @@ void build_ntlm2_response() {
lm2digest[16 + i] = b->client_challenge[i];
}
// vim:noet
// vim:noexpandtab:ts=4

2
ntlm.h
View file

@ -105,4 +105,4 @@ typedef struct {
unsigned long data_start;
} blob;
// vim:noet
// vim:noexpandtab:ts=4

View file

@ -66,8 +66,8 @@ void signal_handler( int signal ) {
* the socket that is connected to the proxy
*/
int tunnel_connect() {
struct sockaddr_in sa;
struct hostent *he;
struct sockaddr_in sa;
struct hostent *he;
int sd;
/* Create the socket */
@ -407,4 +407,4 @@ int main( int argc, char *argv[] ) {
exit( 0 );
}
// vim:noet
// vim:noexpandtab:ts=4

View file

@ -64,4 +64,4 @@ char buf[SIZE]; /* Data transfer buffer */
#define MAX( x, y ) ( ( (x)>(y) ) ? (x) : (y) )
#endif
// vim:noet
// vim:noexpandtab:ts=4

View file

@ -196,4 +196,4 @@ int stream_get_outgoing_fd(PTSTREAM *pts) {
#endif /* USE_SSL */
}
// vim:noet
// vim:noexpandtab:ts=4

View file

@ -48,4 +48,4 @@ int stream_enable_ssl(PTSTREAM *pts);
int stream_get_incoming_fd(PTSTREAM *pts);
int stream_get_outgoing_fd(PTSTREAM *pts);
// vim:noet
// vim:noexpandtab:ts=4

View file

@ -201,4 +201,4 @@ static void handler(int s) {
}
#endif /* HAVE_READPASSPHRASE */
// vim:noet
// vim:noexpandtab:ts=4

View file

@ -164,4 +164,4 @@ void setproctitle(const char *fmt, ...) {
#endif /* HAVE_SETPROCTITLE */
// vim:noet
// vim:noexpandtab:ts=4