Changeset 73 for trunk/src

Show
Ignore:
Timestamp:
07/24/08 10:47:32 (14 years ago)
Author:
andreu
Message:

last changes before next release

Location:
trunk/src
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/dataFlowSet.c

    r72 r73  
    153153       * progression in a data flow Set  
    154154       * notes: 
    155        *   48=header ip + header netf 
    156        *   shift = shift if there is a template declaration  
     155       *   48= IP header size + NetFlow header size 
     156       *   shift = shift because we have a template declaration 
     157       *           inside data templates 
    157158       */ 
    158159      cpt++; 
     
    273274              (*myPtrs->offsetV9Ptr)++; 
    274275              /* FIXME : here , add a check on the field type */ 
    275               if ((pftmp->fieldType==8)||(pftmp->fieldType==12)){ 
     276              if ((pftmp->fieldType==8)||(pftmp->fieldType==12) 
     277                  ||(pftmp->fieldType==15)||(pftmp->fieldType==18)){ 
    276278                if ((((RuleDefPtr)(*(myPtrs->rulesAddressPtr+pos)))->value->stor.lvalue)  
    277279                    == (*((unsigned long*)&buffer4))>>(32-((RuleDefPtr)(*(myPtrs->rulesAddressPtr+pos)))->value->mask)<<(32-((RuleDefPtr)(*(myPtrs->rulesAddressPtr+pos)))->value->mask) ) 
     
    804806         * the process renetcolSender with an IPC message queue. But, the perf 
    805807         * of IPC Msg was very bad with a default system compilation. 
    806          * So, now, we send information directly from here via sockets. 
     808         * So, now, we send information directly from here through sockets. 
    807809         */ 
    808810        tmpRuleList = myPtrs->rulesListPtr; 
  • trunk/src/renetcolParam.h

    r65 r73  
    4848 * FILE with your prefix/subnet  
    4949 */ 
    50 #define SUBNETS_LIST "<path to renetcol>/renetcol-0.0.12beta/conf/IPv4_prefix.txt" 
     50#define SUBNETS_LIST "<path to renetcol>/renetcol-0.0.12beta/conf/IPv4_Subnet_Aggregation_based_on_SNMP_index.txt" 
    5151/*  
    5252 * FILE with the list of AS with accounting 
     
    6767 * tagged "C"ustomers or "B"ackbone  
    6868 */ 
    69 #define INTERFACES_TYPE_LIST "" 
     69#define INTERFACES_TYPE_LIST "<path to renetcol>/renetcol-0.0.12beta/conf/SNMP_INDEX.txt" 
    7070/*  
    7171 * maximum SNMP index  
  • trunk/src/renetcolSender.c

    r72 r73  
    5252  FILE *ruleFile; 
    5353  FILE *tmpFile; 
    54   char field[4]; 
    5554  char port[6]; 
    56   char value[44]; 
    5755  char filters[249]; 
    58   char operator[2]; 
    59   char poubelle[2]; 
    6056  char lines[256][256]; 
    6157  char line[256]; 
     
    6662  int i = 0; 
    6763  int ruleToDelete = 0; 
     64  static char * fields; 
    6865 
    6966  while (1){ 
     
    131128    } else { 
    132129      /* NEW RULE */ 
    133       /*      if (sscanf(buffer, "%s %s %1s %s\n",*/ 
    134 /*               port, */ 
    135 /*               field, */ 
    136 /*               operator, */ 
    137 /*               value) == 0) { */ 
    138       if (sscanf(buffer, "%s %1s %s\n", 
    139                  port, 
    140                  poubelle, 
    141                  filters) == 0) { 
    142         syslog (LOG_ERR, "error in recept rule: %s", buffer); 
    143         close(sock); 
    144         return 1; 
    145       } 
     130      if (sscanf(buffer, "%s %s\n", 
     131                port, 
     132                filters) == 0) { 
     133        syslog (LOG_ERR, "error in rule syntax: %s", filters); 
     134        close(sock); 
     135        return 1; 
     136      } 
     137      subsstr(filters); 
    146138      if (!(ruleFile = fopen(RULES_FILE, "a"))) { 
    147         syslog (LOG_ERR, "error during %s opening", RULES_FILE); 
    148         close(sock); 
    149         return 1; 
     139        syslog (LOG_ERR, "error during %s opening", RULES_FILE); 
     140        close(sock); 
     141        return 1; 
    150142      } else { 
    151         fprintf(ruleFile, "N %s\n", host); 
    152         fprintf(ruleFile, "O socket %s %s\n", host, port); 
    153 /*      fprintf(ruleFile, "C %s %s %s\n", field, operator, value); */ 
    154         fprintf(ruleFile, "%s\n", filters); 
    155         fclose(ruleFile); 
    156       } 
     143        fprintf(ruleFile, "N %s\n", host); 
     144        fprintf(ruleFile, "O socket %s %s\n", host, port); 
     145        fprintf(ruleFile, "%s\n", filters); 
     146        fclose(ruleFile); 
     147      } 
     148 
    157149    } 
    158150  }