From 32aff2b27ccc3b3e51fb6f0bd77fe0073827c527 Mon Sep 17 00:00:00 2001 From: Jakub Sławiński Date: Tue, 7 Jun 2005 12:06:18 +0200 Subject: v0.7 - Added: http proxy tunnels between afserver and afclient - Fixed: sigint interception with threads enabled (in http proxy mode) - Fixed: FATAL ERROR in afclient in some situations after close of afserver when http proxy mode is enabled - Added: afclients can connect directly to afserver with enabled proxy mode - Fixed: timeout routine in http proxy tunnels - Added: 'rshow' command in ra mode displays 'tunneltype' - Fixed: printing IP of clients when http proxy mode is enabled - Added: 'tunneltype' per client in ra mode after 'cshow' command - Fixed: closing connection when http proxy mode is enabled - Fixed: threads initialization - Fixed: afserver closing after sigint - Fixed: afclient threads initialization - Added: 'version' option to display program version number - Modified: establishing afclient<->afserver connection - Added: 'keep-alive' option - Fixed: using 'proxyport' without 'proxyname' - Added: auto-reconnect feature to afclient - Added: 'ar-tries' and 'ar-delay' options - Modified: http proxy logging - Fixed: closing connection with afclient after receiving id - Fixed: thread closing due to wrong initialization sequence - Fixed: small bug in initialization process - Heavily Modified: logging routines - Added: audit option - Modified: default dateformat is now ISO 8601 - Modified: printing usage - Fixed: bug in threads' initialization in afclient - Added: 'timeout' and 'dateformat' options in ra mode - Modified: empty dateformat disables printing '[] ' - Added: 'audit' and 'dnslookups' options in ra mode - Fixed: afserver freeze bug - Added: 'kuser' and 'kclient' options in ra mode - Fixed: bug in starting afclient in ra mode - Added: audit log printed also after kicking the client --- src/file.c | 59 ++++++++++++++++++++++++----------------------------------- 1 file changed, 24 insertions(+), 35 deletions(-) (limited to 'src/file.c') diff --git a/src/file.c b/src/file.c index e4cde62..728b0c1 100644 --- a/src/file.c +++ b/src/file.c @@ -18,8 +18,12 @@ * */ +#include + #include "file.h" #include "activefor.h" +#include "logging.h" +#include "network.h" #include #include #include @@ -110,6 +114,7 @@ parsefile(char* name, int* status) char buff[256]; char helpbuf1[256]; char helpbuf2[256]; + char* tmpbuf; *status = 1; @@ -119,10 +124,6 @@ parsefile(char* name, int* status) cfg.keys = NULL; cfg.size = 0; cfg.realmtable = NULL; - cfg.logging = 0; - cfg.socklogging = 0; - cfg.logfnam = NULL; - cfg.logsport = NULL; cfg.dateformat = NULL; state = F_UNKNOWN; @@ -220,9 +221,23 @@ parsefile(char* name, int* status) else if (strcmp(helpbuf1, "baseport")==0) { cfg.realmtable[cfg.size-1].baseport = 1; } + else if (strcmp(helpbuf1, "audit")==0) { + cfg.realmtable[cfg.size-1].audit = 1; + } else if (strcmp(helpbuf1, "dnslookups")==0) { cfg.realmtable[cfg.size-1].dnslookups = 1; } +#ifdef HAVE_LIBPTHREAD + else if (strcmp(helpbuf1, "enableproxy")==0) { + if (cfg.realmtable[cfg.size-1].tunneltype == 0) { + cfg.realmtable[cfg.size-1].tunneltype = 1; + } + else { + return cfg; + } + } +#endif +#ifdef AF_INET6 else if (strcmp(helpbuf1, "ipv4")==0) { if (TYPE_IS_UNSPEC(cfg.realmtable[cfg.size-1].type)) { TYPE_SET_IPV4(cfg.realmtable[cfg.size-1].type); @@ -239,6 +254,7 @@ parsefile(char* name, int* status) return cfg; } } +#endif else { return cfg; } @@ -260,37 +276,10 @@ parsefile(char* name, int* status) cfg.keys = calloc(strlen(helpbuf2)+1, sizeof(char)); strcpy(cfg.keys, helpbuf2); } - else if (strcmp(helpbuf1, "heavylog")==0) { - if (cfg.logging) { - return cfg; - } - cfg.logging = 3; - cfg.logfnam = calloc(strlen(helpbuf2)+1, sizeof(char)); - strcpy(cfg.logfnam, helpbuf2); - } - else if (strcmp(helpbuf1, "lightlog")==0) { - if (cfg.logging) { - return cfg; - } - cfg.logging = 1; - cfg.logfnam = calloc(strlen(helpbuf2)+1, sizeof(char)); - strcpy(cfg.logfnam, helpbuf2); - } - else if (strcmp(helpbuf1, "heavysocklog")==0) { - if (cfg.socklogging) { - return cfg; - } - cfg.socklogging = 3; - cfg.logsport = calloc(strlen(helpbuf2)+1, sizeof(char)); - strcpy(cfg.logsport, helpbuf2); - } - else if (strcmp(helpbuf1, "lightsocklog")==0) { - if (cfg.socklogging) { - return cfg; - } - cfg.socklogging = 1; - cfg.logsport = calloc(strlen(helpbuf2)+1, sizeof(char)); - strcpy(cfg.logsport, helpbuf2); + else if (strcmp(helpbuf1, "log")==0) { + tmpbuf = calloc(strlen(helpbuf2)+1, sizeof(char)); + strcpy(tmpbuf, helpbuf2); + addlogtarget(tmpbuf); } else if (strcmp(helpbuf1, "dateformat")==0) { cfg.dateformat = calloc(strlen(helpbuf2)+1, sizeof(char)); -- cgit v1.1