Changeset 66
- Timestamp:
- 23.04.2002 15:29:52 (7 years ago)
- Location:
- trunk
- Files:
-
- 8 modified
-
HISTORY (modified) (1 diff)
-
ipfm.conf.sample (modified) (2 diffs)
-
source/config.h.in (modified) (2 diffs)
-
source/config.l (modified) (2 diffs)
-
source/config.y (modified) (4 diffs)
-
source/data.c (modified) (3 diffs)
-
source/init.c (modified) (2 diffs)
-
source/utils.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/HISTORY
r65 r66 1 Version 0.11.5 - 11 November 20012 -------------------- -------------1 Version 0.11.5 - ??? 2 -------------------- 3 3 - a forked child exits with _exit(), so we can let pcap library set 4 4 and unset promisc mode for us under linux. Thanks to Igor Podlesny -
trunk/ipfm.conf.sample
r48 r66 1 1 # Global variables 2 3 # IPFM can monitor only one device. 2 4 #DEVICE eth0 3 5 4 # local variables 6 # UTC to output times in UTC, not local time 7 #UTC 8 9 # analyses configurations 10 5 11 ##### FIRST LOGGING CONFIGURATION ##### 12 6 13 #log subnet 10.10.10.0 when not in relation with subnet 10.1O.0.0 7 14 LOG 10.10.10.0/255.255.255.0 NOT WITH 10.10.0.0/255.255.0.0 8 15 #do not log 10.10.10.10 when in relation with 10.10.10.20 9 16 LOG NONE 10.10.10.10 WITH 10.10.10.20 10 FILENAME "/var/log/ipfm/ipfm-%d.%m-%H.%M.%S" 17 18 FILENAME "/var/log/ipfm/%Y_%d_%m/%H_%M" 19 11 20 # log every hour at exactly 0:05, 1:05, 2:05 etc. 12 21 DUMP EVERY 1 hour AFTER 5 minutes 13 # clear statistics each day (at 0 :05)22 # clear statistics each day (at 00:05 UTC) 14 23 CLEAR EVERY 24 hour 15 24 SORT IN … … 32 41 33 42 34 FILENAME "/var/log/ipfm/ ipfm2-%d.%m/%H.%M.%S"43 FILENAME "/var/log/ipfm/subnet/%Y_%d_%m_%H" 35 44 # Log every hour 36 45 DUMP EVERY 1 hour 37 # Clear statistics every day at 2:00am 46 # Clear statistics every day at 2:00am UTC 38 47 CLEAR EVERY 1 day AFTER 2 hours 39 48 SORT TOTAL -
trunk/source/config.h.in
r63 r66 18 18 #define DEFAULT_OPTIONS_PROMISC 1 19 19 #define DEFAULT_OPTIONS_APPEND 0 20 #define DEFAULT_OPTIONS_TIMEZONE local 20 21 21 22 /* But leave these defines untouched */ … … 65 66 #undef __OS_OSF1__ 66 67 68 /* Timezone : Local Time, Coordinated Universal Time */ 69 typedef enum {UTC, local} ipfm_timezone; 70 67 71 #endif 68 72 -
trunk/source/config.l
r63 r66 74 74 [Ff][Rr][Oo][Mm] return FROM; 75 75 [Ff][Ii][Ll][Ee][Nn][Aa][Mm][Ee] return FILENAME; 76 [Ll][Oo][Cc][Aa][Ll][Tt][Ii][Mm][Ee] return LOCALTIME; 76 77 [Ll][Oo][Gg] return LOG; 77 78 [Nn][Ee][Ww][Ll][Oo][Gg] return NEWLOG; … … 82 83 [Ss][Oo][Rr][Tt] return SORT; 83 84 [Tt][Oo] return TO; 85 [Uu][Tt][Cc] return UNIVERSALTIME; 84 86 [Ww][Ii][Tt][Hh] return WITH; 85 87 -
trunk/source/config.y
r63 r66 64 64 extern int yydebug; 65 65 66 ipfm_timezone tz; 67 66 68 #ifdef YYDEBUG 67 69 yydebug = 1; … … 91 93 %token FILENAME 92 94 %token FROM 95 %token LOCALTIME 93 96 %token LOG 94 97 %token NEVER … … 100 103 %token SORT 101 104 %token TO 105 %token UNIVERSALTIME 102 106 %token WITH 103 107 … … 247 251 checkdump = 2; 248 252 pAllLogs = pNewLog; 253 } 254 | LOCALTIME EOL { 255 tz = local; 256 } 257 | UNIVERSALTIME EOL { 258 tz = UTC; 249 259 } 250 260 | error EOL { -
trunk/source/data.c
r65 r66 52 52 extern struct AllLogsType *pAllLogs; 53 53 extern char *device; 54 extern ipfm_timezone tz; 54 55 55 56 void data_add(struct AllLogsType *pLog, u_int32_t ip, int in, int out) { … … 116 117 char DataToFile[MAX_DATA_SIZE]; 117 118 char *stringTime; 119 char *timezonestring; 120 121 if (tz == local) { 122 timezonestring = "local time"; 123 } else { 124 timezonestring = "UTC"; 125 } 118 126 119 127 DataSort(pLog); … … 151 159 152 160 stringTime = timefile("%Y/%m/%d %H:%M:%S", pLog->NextDump); 153 fprintf(logfile, "# IPFMv%s %s UTC -- dump every %ldd%02ld:%02ld:%02ld -- listening on %s\n", 154 VERSION, stringTime, 161 162 fprintf(logfile, "# IPFMv%s %s (%s) -- dump every %ldd%02ld:%02ld:%02ld -- listening on %s\n", 163 VERSION, stringTime, timezonestring, 155 164 pLog->DumpInterval / (60*60*24), 156 165 (pLog->DumpInterval / (60*60)) % 24, -
trunk/source/init.c
r63 r66 55 55 extern int SigDump; 56 56 extern int checkdump; 57 extern ipfm_timezone tz; 57 58 extern struct AllLogsType *pAllLogs; 58 59 int run_as_daemon = 1; … … 166 167 pAllLogs = pNewLog; 167 168 169 tz = DEFAULT_OPTIONS_TIMEZONE; 168 170 checkdump = 2; 169 171 -
trunk/source/utils.c
r65 r66 40 40 #include "missing/missing.h" 41 41 42 extern ipfm_timezone tz; 43 42 44 char *timefile(char *filemask, time_t when) { 43 45 char s_temp[FILENAME_MAX]; … … 45 47 struct tm *p_time; 46 48 47 /* 20020421, tibob : IPFM uses UTC only */ 48 p_time = gmtime(&when); 49 if (tz == local) { 50 p_time = localtime(&when); 51 } else { 52 p_time = gmtime(&when); 53 } 49 54 strftime(s_temp, sizeof(s_temp), filemask, p_time); 50 55
