Changeset 47

Show
Ignore:
Timestamp:
08/30/07 17:46:34 (15 years ago)
Author:
andreu
Message:

merge from tag REL-0.0.11beta

Location:
trunk
Files:
2 removed
13 modified

Legend:

Unmodified
Added
Removed
  • trunk/conf/rules.txt

    r20 r47  
    1313# in table 6 
    1414 
    15 N test_MPLS 
    16 O socket <your IP address> <port> 
    17 C 46 = 5 
     15# Example 
     16# Dump on 10.0.01:1111 all MPLS flow (field 46 = 5) 
     17#N test_MPLS 
     18#O socket 10.0.0.1 1111 
     19#C 46 = 5 
    1820 
    19 # This rule depends on functionnality not present in this beta release 
     21# Example 
     22# This rule depends on functionnality not present in this release 
    2023# from TCP flows 
    2124# prefix aggregation 
    2225# five minutes 
    2326# record in/out octets 
    24 N TCPVolumetry 
    25 O file ascii /tmp/output2.txt 
    26 A P 
    27 R 4 1 R 4 25 
     27#N TCPVolumetry 
     28#O file ascii /tmp/output2.txt 
     29#A P 
     30#R 4 1 R 4 25 
    2831 
    29 # This rule depends on functionnality not present in this beta release 
     32# Example 
     33# This rule depends on functionnality not present in this release 
    3034# get all flows whom size between 15 & 16 Mo 
    3135# record all fields in a file 
    32 N Get_From_Size 
    33 O file bin /tmp/output.txt 
    34 C 1 > 15 C 1 < 16 
     36#N Get_From_Size 
     37#O file bin /tmp/output.txt 
     38#C 1 > 15 C 1 < 16 
    3539 
  • trunk/configure.in

    r34 r47  
    33 
    44AC_PREREQ(2.59) 
    5 AC_INIT(RENETCOL, 0.0.9, andreu@renater.fr) 
     5AC_INIT(RENETCOL, 0.0.11beta, andreu@renater.fr) 
    66AC_CONFIG_SRCDIR(src/) 
    77AC_PROG_MAKE_SET 
    88AM_CONFIG_HEADER(config.h) 
    99AM_INIT_AUTOMAKE 
    10 CFLAGS="-I/usr/local/include -g -ansi -Wno-long-long -Wall -D _SVID_SOURCE -DSIGSETJMP_IS_BROKEN -D _XOPEN_SOURCE -pedantic -pg" 
     10CFLAGS="-I/usr/local/include -g -ansi -Wno-long-long -Wall -D _SVID_SOURCE -DSIGSETJMP_IS_BROKEN -D _XOPEN_SOURCE -pedantic" 
    1111 
    1212CFLAGS_OPTIMIZE="-O2" 
  • trunk/src/Makefile.am

    r36 r47  
    1111        remote_output.c fields_mgmt.h fields_mgmt.c pop.h renetcolParam.h 
    1212renetcolMsgCtl_SOURCES = renetcolMsgCtl.c 
    13 renetcolAgg_SOURCES = renetcolAgg.c renetcolAgg.h rrdwrap.h rrdwrap.c pop.h renetcolParam.h 
     13renetcolAgg_SOURCES = renetcolAgg.c renetcolAgg.h pop.h renetcolParam.h 
    1414BUILT_SOURCES = renetcol.o renetcolSender.o renetcolAgg.o 
    1515renetcol_LDADD = -ldl -lc_p 
  • trunk/src/dataFlowSet.c

    r36 r47  
    173173      cpt++; 
    174174      j = 0; 
    175       pos = (pftmp->fieldType)*10+j; 
     175      pos = (pftmp->fieldType)*MAX_RULES_PER_FIELD+j; 
    176176      field_size = (int) pftmp->fieldLength; 
    177177       
    178178      /* special case: check yes on all flows from one router (phantom field nb 0) */ 
    179       while ( ((RuleDefPtr)(*(myPtrs->rulesAddressPtr+j))) != NULL ) {   
     179      /* FIXME : this code is repeated, perhaps past before */ 
     180      while ( ((RuleDefPtr)(*(myPtrs->rulesAddressPtr+j))) != NULL ) { 
    180181        if  ( (((RuleDefPtr)(*(myPtrs->rulesAddressPtr+j)))->value->stor.lvalue) 
    181182              == myPtrs->pcktPtr->ipH->srcAdd ) 
     
    791792         * In a first time (until release 0.0.7, the information was sent via 
    792793         * the process renetcolSender with an IPC message queue. But, the perf 
    793          * of IPC Msg was very bad with a system compilation by default. 
    794          * So now, we send information directly from here. 
     794         * of IPC Msg was very bad with a default system compilation. 
     795         * So, now, we send information directly from here. 
    795796         */ 
    796797        tmpRuleList = myPtrs->rulesListPtr; 
     
    834835            /* NEW transfert type */ 
    835836            for ( ; tmpRL; tmpRL=tmpRL->next){ 
    836               if (tmpRL->id == tmpRuleList->id){ 
     837              if (tmpRL->id == tmpRuleList->id){         
    837838                s = sendMessage(tmpRL->host->sockId, myMsg.text, sizeof(myMsg.text), 
    838839                                tmpRL->host->hostAddressPtr); 
     
    844845          } /* end if check */ 
    845846          tmpRuleList = tmpRuleList->next; 
     847          tmpRL = myPtrs->rulesListPtr; /* ticket #11 */ 
    846848          secondPftmp = tmp->lastField; 
    847849        } /* end while tmpRuleList */ 
  • trunk/src/mysql_mgmt.c

    r2 r47  
    22 * File: mysql_mgmt.c 
    33 *  
    4  * Authors: ANDREU François-Xavier  
     4 * Authors: ANDREU Francois-Xavier  
    55 * 
    66 * Copyright (C) 2005 GIP RENATER  
  • trunk/src/mysql_mgmt.h

    r2 r47  
    22 * File: mysql_mgmt.h 
    33 *  
    4  * Authors: ANDREU François-Xavier  
     4 * Authors: ANDREU Francois-Xavier  
    55 * 
    66 * Copyright (C) 2005 GIP RENATER  
  • trunk/src/renetcol.c

    r36 r47  
    155155  shmForAgg->currentTable = 0; 
    156156  shmForAgg->secondTable = 1; 
     157  shmForAgg->readed = 0; 
    157158 
    158159  myPtrs.rulesListPtr = NULL; 
     
    166167  } 
    167168  tmp = NULL; 
    168 /*   printRule(rulesListPtr); */ 
    169 /*   exit(1); */ 
     169#ifdef DEBUG 
     170  printRule(rulesListPtr); 
     171#endif 
     172 
    170173 
    171174  fprintf(stderr, "renetcol: I become a deamon, next messages via syslogd. By.\n"); 
     
    329332  setCache(myPtrs.rulesListPtr); 
    330333  sendReadRulesSignal(myQueue); 
     334#ifdef DEBUG 
     335  printRule(myPtrs.rulesListPtr); 
     336#endif 
    331337} 
    332338 
     
    355361  RuleDefPtr def = NULL; 
    356362 
     363#ifdef DEBUG 
     364  fprintf(stderr,"Cache for Rules\n"); 
     365#endif  
    357366  while (tmp) { 
    358367    def = tmp->def; 
     
    364373      rulesAddress[def->fieldType][i] = def; 
    365374      def = def->next; 
    366     } 
     375#ifdef DEBUG 
     376      fprintf(stderr,"%d: %d ", def->fieldType, i); 
     377#endif      
     378    } 
     379#ifdef DEBUG 
     380    fprintf(stderr,"\n"); 
     381#endif       
    367382    tmp = tmp->next; 
    368383  } 
  • trunk/src/renetcolAgg.c

    r36 r47  
    381381          } 
    382382        } 
    383       }  
    384     }  
     383      } /* end is first update */  
     384    } /* end read ok */ 
    385385    sleep(10); 
    386386  } while (1); 
  • trunk/src/renetcolDB.c

    r23 r47  
    22 * File: renetcolDB.c 
    33 *  
    4  * Authors: ANDREU François-Xavier  
     4 * Authors: ANDREU Francois-Xavier  
    55 * 
    66 * Copyright (C) 2007 GIP RENATER  
  • trunk/src/renetcolDB.h

    r23 r47  
    22 * File: renetcolDB.h 
    33 *  
    4  * Authors: ANDREU François-Xavier  
     4 * Authors: ANDREU Francois-Xavier  
    55 * 
    66 * Copyright (C) 2007 GIP RENATER  
  • trunk/src/renetcolSender.c

    r35 r47  
    7070    if (length < 0){ 
    7171      syslog(LOG_ERR, " read : %s", strerror(errno)); 
     72      close(sock); 
    7273      return 1; 
    7374    } 
     
    7980      if (!(ruleFile = fopen(rulesFileName, "r"))) { 
    8081        syslog (LOG_ERR, "error during %s opening\n", rulesFileName); 
     82        close(sock); 
    8183        exit(1); 
    8284      } else { 
     
    9496              } 
    9597            } else { 
     98              close(sock); 
    9699              return 1; 
    97100            } 
     
    106109        if (!(tmpFile = fopen(FILE_TEMPO, "w"))) { 
    107110          syslog (LOG_ERR, "error during %s opening", FILE_TEMPO); 
     111          close(sock); 
    108112          return 1; 
    109113        } else { 
     
    114118          if (remove(rulesFileName)!=0){ 
    115119            syslog(LOG_ERR, "rules.txt remove pb: %s", strerror(errno)); 
     120            close(sock); 
    116121            return 1; 
    117122          } 
    118123          if (rename(FILE_TEMPO, rulesFileName)!=0){ 
    119124            syslog(LOG_ERR, "rename file pb: %s", strerror(errno)); 
     125            close(sock); 
    120126            return 1; 
    121127          } 
     
    130136                 value) == 0) { 
    131137        syslog (LOG_ERR, "error in recept rule: %s", buffer); 
     138        close(sock); 
    132139        return 1; 
    133140      } 
    134141      if (!(ruleFile = fopen(rulesFileName, "a"))) { 
    135142        syslog (LOG_ERR, "error during %s opening", rulesFileName); 
     143        close(sock); 
    136144        return 1; 
    137145      } else { 
     
    217225    if (getnameinfo((struct sockaddr *) &clientAddress, 
    218226                    clientAddressLen, host, sizeof host, 
    219                     NULL, (size_t) 0, 0) == 0) { 
     227                    NULL, (size_t) 0, NI_NUMERICHOST) == 0) { 
    220228      syslog(LOG_INFO,  
    221229             "New connection from %s", host); 
  • trunk/tool/check.sh

    r36 r47  
    1111  killall renetcolAgg 
    1212  sleep 1 
    13   /home/maintenance/renetcol-0.0.9/src/renetcolMsgCtl /home/maintenance/renetcol-0.0.9/src/renetcol 
     13  /home/maintenance/renetcol-0.0.11beta/src/renetcolMsgCtl /home/maintenance/renetcol-0.0.11beta/src/renetcol 
    1414  echo "renetcolMsgCtl started" 
    1515  sleep 2 
    16   /home/maintenance/renetcol-0.0.9/src/renetcol /home/maintenance/renetcol-0.0.9/src/info_routeur_netflow.txt /home/maintenance/renetcol-0.0.9/src/donneesblocsadresses2 /home/maintenance/renetcol-0.0.9/src/rules.txt 
     16  /home/maintenance/renetcol-0.0.11beta/src/renetcol /home/maintenance/renetcol-0.0.11beta/src/info_routeur_netflow.txt /home/maintenance/renetcol-0.0.11beta/src/donneesblocsadresses2 /home/maintenance/renetcol-0.0.11beta/src/rules.txt 
    1717  echo "renetcol restarted" 
    18   /home/maintenance/renetcol-0.0.9/src/renetcolSender /home/maintenance/renetcol-0.0.9/src/renetcol 1 /home/maintenance/renetcol-0.0.9/src/rules.txt 
     18  /home/maintenance/renetcol-0.0.11beta/src/renetcolSender /home/maintenance/renetcol-0.0.11beta/src/renetcol 1 /home/maintenance/renetcol-0.0.11beta/src/rules.txt 
    1919  echo "renetcolSender restarted" 
    20   /home/maintenance/renetcol-0.0.9/src/renetcolAgg 
     20  /home/maintenance/renetcol-0.0.11beta/src/renetcolAgg 
    2121else 
    2222  echo "All is up" 
  • trunk/tool/renetcolGUI_0_0_7.py

    r36 r47  
    170170        underscore_line = "" 
    171171        flowCpt+=1 
    172         if (flowCpt%20 == 0 or oldTpl != self.flow[0]): 
     172##        if (flowCpt%20 == 0 or oldTpl != self.flow[0]): 
     173        if (flowCpt%100 == 0):  
    173174            flowCpt = 0 
    174175            for i in range (0, len(tpl_def[self.flow[0]])):