Changeset 44

Show
Ignore:
Timestamp:
08/30/07 00:53:49 (15 years ago)
Author:
andreu
Message:

ticket #11 and add generic conf in conf/rules.txt & tool/check.sh

Location:
tags/REL-0.0.11beta/trunk
Files:
4 modified

Legend:

Unmodified
Added
Removed
  • tags/REL-0.0.11beta/trunk/conf/rules.txt

    r42 r44  
    1313# in table 6 
    1414 
    15 N test_MPLS 
    16 O socket 10.0.0.1 1111 
    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 
  • tags/REL-0.0.11beta/trunk/src/dataFlowSet.c

    r42 r44  
    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 ) 
     
    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 */ 
  • tags/REL-0.0.11beta/trunk/src/renetcol.c

    r41 r44  
    167167  } 
    168168  tmp = NULL; 
    169 /*   printRule(rulesListPtr); */ 
    170 /*   exit(1); */ 
     169#ifdef DEBUG 
     170  printRule(rulesListPtr); 
     171#endif 
     172 
    171173 
    172174  fprintf(stderr, "renetcol: I become a deamon, next messages via syslogd. By.\n"); 
     
    330332  setCache(myPtrs.rulesListPtr); 
    331333  sendReadRulesSignal(myQueue); 
     334#ifdef DEBUG 
     335  printRule(myPtrs.rulesListPtr); 
     336#endif 
    332337} 
    333338 
     
    356361  RuleDefPtr def = NULL; 
    357362 
     363#ifdef DEBUG 
     364  fprintf(stderr,"Cache for Rules\n"); 
     365#endif  
    358366  while (tmp) { 
    359367    def = tmp->def; 
     
    365373      rulesAddress[def->fieldType][i] = def; 
    366374      def = def->next; 
    367     } 
     375#ifdef DEBUG 
     376      fprintf(stderr,"%d: %d ", def->fieldType, i); 
     377#endif      
     378    } 
     379#ifdef DEBUG 
     380    fprintf(stderr,"\n"); 
     381#endif       
    368382    tmp = tmp->next; 
    369383  } 
  • tags/REL-0.0.11beta/trunk/tool/check.sh

    r37 r44  
    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"