Changeset 53
- Timestamp:
- 24.12.2001 22:21:27 (7 years ago)
- Location:
- branches/TGZ_SOURCE
- Files:
-
- 13 modified
-
HISTORY (modified) (1 diff)
-
TODO (modified) (2 diffs)
-
VERSION (modified) (1 diff)
-
debian/changelog (modified) (1 diff)
-
doc/ipfm.conf.man (modified) (1 diff)
-
doc/ipfm.man (modified) (3 diffs)
-
source/config.l (modified) (1 diff)
-
source/config.y (modified) (3 diffs)
-
source/data.c (modified) (1 diff)
-
source/filter.c (modified) (2 diffs)
-
source/init.c (modified) (10 diffs)
-
source/ipfm.c (modified) (1 diff)
-
source/pcap.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/TGZ_SOURCE/HISTORY
r47 r53 1 Version 0.11.2 - 8 December 2000 2 -------------------------------- 3 sam (debian patches) : 4 - changed a line in config.y (CLEAR ALWAYs bug) 5 - Set umask to 0022 instead of 0027. 6 - The ipfm.conf manpage now states that ALWAYS is the default behaviour 7 for CLEAR. 8 tibob : 9 - corrected SIGHUP behavior (the dates were wrong and the memory wasn't 10 totally freed) 11 - configuration file parsing (exit on error in config file, prints the correct 12 line number when an error occurs). 13 - The ipfm manpage now documents SIGUSR1 signal 14 1 15 Version 0.11 - 21 October 2000 - Samuel HOCEVAR (sam@via.ecp.fr), 2 16 Robert CHERAMY (tibob@via.ecp.fr) -
branches/TGZ_SOURCE/TODO
r50 r53 1 * Error messages should go to syslog in daemon mode. 1 2 2 3 * log by selecting protocol (TCP/UDP) and port … … 8 9 * be able to configure the output file format. 9 10 10 * Output Bandwidth (bps) instead of bytes in log file.11 12 11 * Output how much time the log ran in output file (especially in case of a kill -HUP) 13 14 * Output total D/L size(bytes) or Bandwidth(bps)15 12 16 13 * HTML output 17 14 * CISCO accounting process compatible format : host source total_trafic number_of_packet 18 15 19 20 -
branches/TGZ_SOURCE/VERSION
r50 r53 1 0.11. 11 0.11.2 -
branches/TGZ_SOURCE/debian/changelog
r45 r53 1 ipfm (0.11 ) unstable; urgency=low1 ipfm (0.11-3) unstable; urgency=low 2 2 3 * new features (see HISTORY) 3 * Corrected ipfm SigHUP behaviour 4 * Documented SIGUSR1 signal 5 * Configuration file parsing corrections (exit on error in config file, 6 prints the correct line number when an error occurs). 4 7 5 -- Robert CHERAMY <robert@cheramy.net> Tue, 7 Nov 2000 01:18:35 +0100 8 -- Robert CHERAMY <robert@cheramy.net> Fri, 8 Dec 2000 01:11:29 +0100 9 10 ipfm (0.11-2) unstable; urgency=low 11 12 * Set umask to 0022 instead of 0027. 13 * Fixed a bug in config.l which made "CLEAR ALWAYS" invalid. 14 * The ipfm.conf manpage now states that ALWAYS is the default behaviour 15 for CLEAR. 16 17 -- Samuel Hocevar <sam@zoy.org> Sat, 11 Nov 2000 13:24:57 +0100 18 19 ipfm (0.11-1) unstable; urgency=low 20 21 * Initial Debian release (Closes: #75675) 22 * New features (see HISTORY) 23 24 -- Samuel Hocevar <sam@zoy.org> Tue, 7 Nov 2000 01:18:35 +0100 6 25 7 26 ipfm (0.10.4) stable; urgency=low -
branches/TGZ_SOURCE/doc/ipfm.conf.man
r47 r53 131 131 <number> day(s) 132 132 133 Default AFTER time is 0 seconds. Note that both time values MUST be a multiple of the DUMP delay. Also, this line MUST come after the DUMP line.133 Default CLEAR mode is ALWAYS. Default AFTER time is 0 seconds. Note that both time values MUST be a multiple of the DUMP delay. Also, this line MUST come after the DUMP line. 134 134 .TP 135 135 .B Examples -
branches/TGZ_SOURCE/doc/ipfm.man
r47 r53 66 66 This causes 67 67 .B ipfm 68 to flushits data tables in the log file (see68 to dump (and clear) its data tables in the log file (see 69 69 .BR ipfm.conf (8) 70 70 ), close pcap descriptor, reload configuration file and restart. … … 74 74 This causes 75 75 .B ipfm 76 to flushits data tables in the log file (see76 to dump (and clear) its data tables in the log file (see 77 77 .BR ipfm.conf (8) 78 78 ) and exit. … … 88 88 This causes 89 89 .B ipfm 90 to exit after having flushed its buffers. 90 to exit after having dumped and cleared its buffers. 91 92 .TP 93 .I SigUSR1 94 This causes 95 .B ipfm 96 to dump its data tables in the log file without exiting or clearing them. 91 97 92 98 .SH SEE ALSO -
branches/TGZ_SOURCE/source/config.l
r47 r53 65 65 66 66 [Aa][Ff][Tt][Ee][Rr] return AFTER; 67 [Aa][Ll][Ww][Aa][Yy][ ss] return ALWAYS;67 [Aa][Ll][Ww][Aa][Yy][Ss] return ALWAYS; 68 68 [Aa][Pp][Pp][Ee][Nn][Dd] return APPEND; 69 69 [Bb][Oo][Tt][Hh] return BOTH; -
branches/TGZ_SOURCE/source/config.y
r47 r53 52 52 int yylex(void); 53 53 int checkdump = 2; 54 int yyfailed = 0; 54 55 55 56 extern int line; 56 57 extern int promisc; 57 extern int dump; 58 59 extern char *filemask; 58 60 59 extern char *device; 61 60 extern struct OptionsType Options; … … 161 160 pAllLogs->DumpInterval = $1; 162 161 /* We can be sure that NextDump > time(NULL) 163 _and_ that it's the closest value. Idid the maths. */162 _and_ that it's the closest value. sam did the maths. */ 164 163 pAllLogs->NextDump = (((time(NULL) - $2) / $1) + 1) * $1 + $2; 165 164 } … … 374 373 375 374 void yyerror(char *s) { 376 printf("yacc error : %s\n",s);375 yyfailed = 1; 377 376 } 378 377 379 378 void parseerror(char *s, int line) { 380 printf("Parse error line %d: %s\n", line, s); 379 yyfailed = 1; 380 fprintf(stderr, "Parse error line %d: %s\n", line, s); 381 381 } -
branches/TGZ_SOURCE/source/data.c
r47 r53 197 197 pLog->Data->prev = NULL; 198 198 } else { 199 free(pLog->Data); 199 200 pLog->Data = NULL; 200 201 } -
branches/TGZ_SOURCE/source/filter.c
r47 r53 46 46 extern FILE * yyin; 47 47 extern struct AllLogsType * pAllLogs; 48 extern int yyfailed; 48 49 49 50 /* is host on subnet address/mask ? */ … … 111 112 } 112 113 113 line = 1; 114 line = 0; 115 yyfailed = 0; 114 116 115 yyparse(); 117 if (0 != yyparse() || yyfailed != 0) { 118 fprintf(stderr, "[ipfm] Error parsing configuration file. Exiting.\n"); 119 fclose(yyin); 120 Exit(1); 121 } 122 116 123 fclose(yyin); 117 124 } -
branches/TGZ_SOURCE/source/init.c
r47 r53 1 1 /* 2 init.c - ipfm initiali zation functions2 init.c - ipfm initialisation functions 3 3 4 4 (c) 1999 Andres Krapf <dae@via.ecp.fr> … … 7 7 200010xx : sam : pid file & daemon mode handling 8 8 20001107 : tibob : SIGUSR1 handling 9 20001207 : tibob : modifications to have a correct SIGHUP behaviour. 9 10 */ 10 11 … … 54 55 extern int SigHup; 55 56 extern int SigDump; 57 extern int checkdump; 56 58 extern struct AllLogsType * pAllLogs; 57 59 int run_as_daemon = 1; … … 128 130 void InitOnce() 129 131 { 130 /*131 struct sigaction SigChld;132 sigset_t SigChldMask;133 134 sigemptyset(&SigChldMask);135 SigChld.sa_handler = SIG_DFL;136 SigChld.sa_mask = SigChldMask;137 SigChld.sa_flags = SA_NOCLDWAIT;138 */139 132 signal(SIGHUP, SigHupHandler); 140 133 signal(SIGTERM, SigTermHandler); … … 154 147 155 148 pNewLog = (struct AllLogsType *) malloc (sizeof(struct AllLogsType)); 156 pNewLog->Next = pAllLogs;149 pNewLog->Next = NULL; 157 150 pNewLog->Filter = NULL; 158 151 pNewLog->Data = NULL; … … 170 163 pAllLogs = pNewLog; 171 164 165 checkdump = 2; 166 172 167 configure(); 173 168 … … 180 175 if(!openpcap(device, promisc)) 181 176 { 182 printf("[ipfm] Unable to open pcap descriptor on device %s\n", device);177 fprintf(stderr, "[ipfm] Unable to open pcap descriptor on device %s\n", device); 183 178 Exit(-1); 184 179 } … … 194 189 { 195 190 struct AllLogsType * pTempLog; 191 struct AllLogsType * pTempLogFree; 196 192 struct s_filter * pTempRule; 197 struct s_data * pTempData;198 193 199 194 /* clean the rules (deallocate the chained list) */ 200 195 201 for (pTempLog = pAllLogs; NULL != pTempLog; pTempLog = pTempLog->Next)196 for (pTempLog = pAllLogs; NULL != pTempLog;) 202 197 { 203 198 while (NULL != pTempLog->Filter) … … 211 206 } 212 207 213 /* clean the stats (the same) */ 214 215 while (NULL != pTempLog->Data) 216 { 217 pTempData = pTempLog->Data; 218 pTempLog->Data = pTempLog->Data->next; 219 pTempLog->DataSize--; 220 if (pTempData) 221 free(pTempData); 222 else 223 fprintf(stderr, "[init.c] BUG 2!\n"); 224 } 225 } 208 /* clean the stats */ 209 data_clear(pTempLog); 210 211 pTempLogFree = pTempLog; 212 pTempLog = pTempLog->Next; 213 free(pTempLog); 214 } 215 pAllLogs = NULL; 226 216 227 217 /* close the pcap descriptor */ … … 318 308 struct AllLogsType * pNextLog; 319 309 320 pNextLog = pAllLogs->Next;321 310 pPrevLog = NULL; 322 311 for (pTempLog = pAllLogs; NULL != pTempLog; pTempLog = pNextLog) -
branches/TGZ_SOURCE/source/ipfm.c
r47 r53 82 82 } 83 83 daemon (0, 0); 84 umask (02 7);84 umask (022); 85 85 86 86 /* Write PID file */ -
branches/TGZ_SOURCE/source/pcap.c
r47 r53 162 162 { 163 163 if (NULL == pcap_global_descriptor) { 164 fprintf(stderr, "[pcap] Can't close non-opened pcap descriptor\n");164 // fprintf(stderr, "[pcap] Can't close non-opened pcap descriptor\n"); 165 165 } else { 166 166 pcap_close(pcap_global_descriptor);
