Changeset 53

Show
Ignore:
Timestamp:
24.12.2001 22:21:27 (7 years ago)
Author:
tibob
Message:

IPFM v0.11.2 from official tarball

Location:
branches/TGZ_SOURCE
Files:
13 modified

Legend:

Unmodified
Added
Removed
  • branches/TGZ_SOURCE/HISTORY

    r47 r53  
     1Version 0.11.2 - 8 December 2000 
     2-------------------------------- 
     3sam (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. 
     8tibob : 
     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 
    115Version 0.11 - 21 October 2000 - Samuel HOCEVAR (sam@via.ecp.fr), 
    216Robert CHERAMY (tibob@via.ecp.fr) 
  • branches/TGZ_SOURCE/TODO

    r50 r53  
     1* Error messages should go to syslog in daemon mode. 
    12 
    23* log by selecting protocol (TCP/UDP) and port 
     
    89* be able to configure the output file format. 
    910 
    10 * Output Bandwidth (bps) instead of bytes in log file. 
    11  
    1211* 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) 
    1512 
    1613* HTML output 
    1714* CISCO accounting process compatible format : host source total_trafic number_of_packet 
    1815 
    19  
    20  
  • branches/TGZ_SOURCE/VERSION

    r50 r53  
    1 0.11.1 
     10.11.2 
  • branches/TGZ_SOURCE/debian/changelog

    r45 r53  
    1 ipfm (0.11) unstable; urgency=low 
     1ipfm (0.11-3) unstable; urgency=low 
    22 
    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). 
    47 
    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 
     10ipfm (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 
     19ipfm (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 
    625 
    726ipfm (0.10.4) stable; urgency=low 
  • branches/TGZ_SOURCE/doc/ipfm.conf.man

    r47 r53  
    131131 <number> day(s) 
    132132 
    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. 
     133Default 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. 
    134134.TP 
    135135.B Examples 
  • branches/TGZ_SOURCE/doc/ipfm.man

    r47 r53  
    6666This causes 
    6767.B ipfm 
    68 to flush its data tables in the log file (see 
     68to dump (and clear) its data tables in the log file (see 
    6969.BR ipfm.conf (8) 
    7070), close pcap descriptor, reload configuration file and restart. 
     
    7474This causes 
    7575.B ipfm 
    76 to flush its data tables in the log file (see 
     76to dump (and clear) its data tables in the log file (see 
    7777.BR ipfm.conf (8) 
    7878) and exit. 
     
    8888This causes 
    8989.B ipfm 
    90 to exit after having flushed its buffers. 
     90to exit after having dumped and cleared its buffers. 
     91 
     92.TP 
     93.I SigUSR1 
     94This causes 
     95.B ipfm 
     96to dump its data tables in the log file without exiting or clearing them. 
    9197 
    9298.SH SEE ALSO 
  • branches/TGZ_SOURCE/source/config.l

    r47 r53  
    6565 
    6666[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; 
    6868[Aa][Pp][Pp][Ee][Nn][Dd]         return APPEND; 
    6969[Bb][Oo][Tt][Hh]                 return BOTH; 
  • branches/TGZ_SOURCE/source/config.y

    r47 r53  
    5252int yylex(void); 
    5353int checkdump = 2; 
     54int yyfailed = 0; 
    5455 
    5556extern int line; 
    5657extern int promisc; 
    57 extern int dump; 
    58  
    59 extern char *filemask; 
     58 
    6059extern char *device; 
    6160extern struct OptionsType Options; 
     
    161160          pAllLogs->DumpInterval = $1; 
    162161          /* We can be sure that NextDump > time(NULL) 
    163              _and_ that it's the closest value. I did the maths. */ 
     162             _and_ that it's the closest value. sam did the maths. */ 
    164163          pAllLogs->NextDump = (((time(NULL) - $2) / $1) + 1) * $1 + $2; 
    165164        } 
     
    374373 
    375374void yyerror(char *s) { 
    376   printf("yacc error : %s\n",s); 
     375  yyfailed = 1; 
    377376} 
    378377 
    379378void 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); 
    381381} 
  • branches/TGZ_SOURCE/source/data.c

    r47 r53  
    197197      pLog->Data->prev = NULL; 
    198198    } else { 
     199      free(pLog->Data); 
    199200      pLog->Data = NULL; 
    200201    } 
  • branches/TGZ_SOURCE/source/filter.c

    r47 r53  
    4646extern FILE * yyin; 
    4747extern struct AllLogsType * pAllLogs; 
     48extern int yyfailed; 
    4849 
    4950/* is host on subnet address/mask ? */ 
     
    111112  } 
    112113 
    113   line = 1; 
     114  line = 0; 
     115  yyfailed = 0; 
    114116 
    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   
    116123  fclose(yyin); 
    117124} 
  • branches/TGZ_SOURCE/source/init.c

    r47 r53  
    11/* 
    2   init.c - ipfm initialization functions 
     2  init.c - ipfm initialisation functions 
    33  
    44  (c) 1999      Andres Krapf <dae@via.ecp.fr> 
     
    77  200010xx : sam   : pid file & daemon mode handling 
    88  20001107 : tibob : SIGUSR1 handling 
     9  20001207 : tibob : modifications to have a correct SIGHUP behaviour. 
    910 */ 
    1011 
     
    5455extern int SigHup; 
    5556extern int SigDump; 
     57extern int checkdump; 
    5658extern struct AllLogsType * pAllLogs; 
    5759int run_as_daemon = 1; 
     
    128130void InitOnce() 
    129131{ 
    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 */ 
    139132  signal(SIGHUP,  SigHupHandler); 
    140133  signal(SIGTERM, SigTermHandler); 
     
    154147 
    155148  pNewLog = (struct AllLogsType *) malloc (sizeof(struct AllLogsType)); 
    156   pNewLog->Next = pAllLogs; 
     149  pNewLog->Next = NULL; 
    157150  pNewLog->Filter = NULL; 
    158151  pNewLog->Data = NULL; 
     
    170163  pAllLogs = pNewLog; 
    171164 
     165  checkdump = 2; 
     166 
    172167  configure(); 
    173168 
     
    180175  if(!openpcap(device, promisc)) 
    181176  { 
    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); 
    183178    Exit(-1); 
    184179  } 
     
    194189{ 
    195190  struct AllLogsType * pTempLog; 
     191  struct AllLogsType * pTempLogFree; 
    196192  struct s_filter * pTempRule; 
    197   struct s_data * pTempData; 
    198193 
    199194/* clean the rules (deallocate the chained list) */ 
    200195   
    201   for (pTempLog = pAllLogs; NULL != pTempLog; pTempLog = pTempLog->Next) 
     196  for (pTempLog = pAllLogs; NULL != pTempLog;) 
    202197  { 
    203198    while (NULL != pTempLog->Filter) 
     
    211206    } 
    212207   
    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; 
    226216 
    227217/* close the pcap descriptor */ 
     
    318308  struct AllLogsType * pNextLog; 
    319309 
    320   pNextLog = pAllLogs->Next; 
    321310  pPrevLog = NULL; 
    322311  for (pTempLog = pAllLogs; NULL != pTempLog; pTempLog = pNextLog) 
  • branches/TGZ_SOURCE/source/ipfm.c

    r47 r53  
    8282    } 
    8383    daemon (0, 0); 
    84     umask (027); 
     84    umask (022); 
    8585 
    8686    /* Write PID file */ 
  • branches/TGZ_SOURCE/source/pcap.c

    r47 r53  
    162162{ 
    163163  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"); 
    165165  } else { 
    166166    pcap_close(pcap_global_descriptor);