summaryrefslogtreecommitdiff
path: root/src/file.c
diff options
context:
space:
mode:
authorJakub Sławiński2005-06-07 12:06:18 +0200
committerJoshua Judson Rosen2014-07-17 21:14:58 +0200
commit32aff2b27ccc3b3e51fb6f0bd77fe0073827c527 (patch)
treef2fc2530a6960f6fdf4d63eb80c4f61342250bbd /src/file.c
parentv0.6 (diff)
downloadapf-32aff2b27ccc3b3e51fb6f0bd77fe0073827c527.tar.gz
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
Diffstat (limited to 'src/file.c')
-rw-r--r--src/file.c59
1 files changed, 24 insertions, 35 deletions
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 <config.h>
+
#include "file.h"
#include "activefor.h"
+#include "logging.h"
+#include "network.h"
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
@@ -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));