Changeset 77

Show
Ignore:
Timestamp:
11/03/08 10:46:51 (14 years ago)
Author:
andreu
Message:

some updates to prepare release 0.0.12

Location:
trunk
Files:
5 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/as.h

    r60 r77  
    3535#include <syslog.h> 
    3636 
    37 #ifdef ASACC 
    3837struct AS{ 
    3938  unsigned short as; 
     
    4645  unsigned long long pktsNbOUT; 
    4746}; 
    48 #endif 
    4947 
    5048int asGlobalCmp(const void *, const void *); 
  • trunk/src/renetcolSender.c

    r75 r77  
    4343 
    4444/* 
     45 *   subsstr 
     46 *    
     47 *   substitute '_' char in a string with ' ' 
     48 */ 
     49char *subsstr(char *chin) 
     50{ 
     51    int i; 
     52    for (i = 0; i < strlen(chin); i++) { 
     53        if (chin[i] == '_') { 
     54            chin[i] = ' '; 
     55        } 
     56    } 
     57    return chin; 
     58} 
     59 
     60/* 
    4561 * todo 
    4662 */ 
     
    5369  FILE *tmpFile; 
    5470  char port[6]; 
     71/*  char value[44]; */ 
    5572  char filters[249]; 
     73/*  char operator[2]; */ 
    5674  char lines[256][256]; 
    5775  char line[256]; 
     
    129147      /* NEW RULE */ 
    130148      if (sscanf(buffer, "%s %s\n", 
    131                 port, 
    132                 filters) == 0) { 
     149                port,  
     150                filters) == 0) {  
     151syslog (LOG_ERR, "reception de : %s, %s et %s", buffer, port, filters); 
    133152        syslog (LOG_ERR, "error in rule syntax: %s", filters); 
    134153        close(sock); 
    135154        return 1; 
    136155      } 
     156syslog (LOG_ERR, "filters : %s", filters); 
    137157      subsstr(filters); 
     158syslog (LOG_ERR, "filters modifies : %s", filters); 
    138159      if (!(ruleFile = fopen(RULES_FILE, "a"))) { 
    139         syslog (LOG_ERR, "error during %s opening", RULES_FILE); 
    140         close(sock); 
    141         return 1; 
     160        syslog (LOG_ERR, "error during %s opening", RULES_FILE); 
     161        close(sock); 
     162        return 1; 
    142163      } else { 
    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  
     164        fprintf(ruleFile, "N %s\n", host); 
     165        fprintf(ruleFile, "O socket %s %s\n", host, port); 
     166        fprintf(ruleFile, "%s\n", filters);  
     167        fclose(ruleFile); 
     168      } 
    149169    } 
    150170  } 
  • trunk/src/renetcolSender.h

    r36 r77  
    4343#include "renetcolParam.h" 
    4444 
     45#define CONST1 "C " 
     46 
    4547typedef union semun 
    4648{ 
  • trunk/src/template.c

    r76 r77  
    3636  unsigned short os; 
    3737  unsigned char buffer2[2]; 
    38    
     38 
    3939  if ( cfn == 0 ) { 
    4040    os = 20+8+20; 
     
    7878  unsigned short badFieldLength = 0; 
    7979  unsigned short badFieldCount = 0; 
    80    
     80 
    8181  buffer2[1]= *(buf+(*offV9)); (*offV9)++; cpt++; 
    8282  buffer2[0]= *(buf+(*offV9)); (*offV9)++; cpt++; 
     
    166166        buffer2[1]= *(buf+(*offV9)); (*offV9)++; cpt++; 
    167167        buffer2[0]= *(buf+(*offV9)); (*offV9)++; cpt++; 
    168         if ( (fldPtr->fieldType = *((unsigned short*)&buffer2) ) > 89) { 
     168        if ( (fldPtr->fieldType = *((unsigned short*)&buffer2) ) > 216) { 
    169169          badFieldNumber = 1; 
    170170        } 
     
    205205          } 
    206206          syslog (LOG_INFO,  
    207                   "in new template: field nb gt 89, field lg gt 16 or too many fields, bad template definition possibility"); 
     207                  "in new template: field nb gt 216, field lg gt 16 or too many fields, bad template definition possibility"); 
    208208          fprintf(stderr,   
    209209                  "\n in new template function: too many fields, bug collector or wrong template def \n");   
     
    272272        buffer2[1]= *(buf+(*offV9)); (*offV9)++; cpt++; 
    273273        buffer2[0]= *(buf+(*offV9)); (*offV9)++; cpt++; 
    274         if ( (fldPtr->fieldType = *((unsigned short*)&buffer2) ) > 89) { 
     274        if ( (fldPtr->fieldType = *((unsigned short*)&buffer2) ) > 216) { 
    275275          badFieldNumber = 1; 
    276276        } 
     
    397397  length = *((unsigned short*)&buffer2); 
    398398  do { 
    399     /*#ifdef DEBUG    */ 
     399#ifdef DEBUG     
    400400    fprintf (stderr, "< %hu, %hu, ",getFlowsetId, length); 
    401     /*#endif*/ 
     401#endif 
    402402    badFieldNumber = 0; 
    403403    badFieldLength = 0; 
     
    425425        buffer2[1]= *(buf+(*offV9)); (*offV9)++; cpt++; 
    426426        buffer2[0]= *(buf+(*offV9)); (*offV9)++; cpt++; 
    427         if ( (tmp->fieldType = *((unsigned short*)&buffer2) ) > 89) { 
     427        if ( (tmp->fieldType = *((unsigned short*)&buffer2) ) > 216) { 
    428428          badFieldNumber = 1; 
    429429        } 
     
    454454          syslog (LOG_INFO,  
    455455                  "in option template function: too many fields, bug collector or wrong template def in template update"); 
    456           /*#ifdef DEBUG*/ 
     456#ifdef DEBUG 
    457457          fprintf(stderr, 
    458458                  "\nin option template function: too many fields, bug collector or wrong template def in template update\n"); 
    459           /*#endif*/ 
     459#endif 
    460460          while ( ((*offV9))> (index)){ 
    461461            buffer2[1]= *(buf+index); index++; 
     
    518518        buffer2[1]= *(buf+(*offV9)); (*offV9)++; cpt++; 
    519519        buffer2[0]= *(buf+(*offV9)); (*offV9)++; cpt++; 
    520         if ( (tmp->fieldType = *((unsigned short*)&buffer2) ) > 89) { 
     520        if ( (tmp->fieldType = *((unsigned short*)&buffer2) ) > 216) { 
    521521          badFieldNumber = 1; 
    522522        } 
     
    545545          syslog (LOG_INFO,  
    546546                  "in update option tpl function: too many fields, bug collector or wrong template def in template update"); 
    547           /*#ifdef DEBUG*/ 
     547#ifdef DEBUG 
    548548          fprintf(stderr, 
    549549                  "\nin update option tpl function: too many fields, bug collector or wrong template def in template update\n"); 
    550           /*#endif*/ 
     550#endif 
    551551          ptplotmp = cTOPtr; 
    552552          if (ptplotmp->prev == NULL) { 
     
    574574  } while ((cpt) < (length-2)); 
    575575  /*   show_all_tplFlSet(); */ 
    576   /*#ifdef DEBUG*/ 
     576#ifdef DEBUG 
    577577  fprintf (stderr, ">"); 
    578   /*#endif*/ 
     578#endif 
    579579  return length; 
    580580} 
  • trunk/tool/renetcolGUI.py

    r75 r77  
    5858 
    5959myInputControlThread = None 
    60 printValue =      [ 0,1,1,0,1,0,0,1,1,0, 
    61                     0,1,1,0,0,0,0,0,0,0, 
    62                     1,0,0,0,0,0,0,1,1,0, 
    63                     0,0,0,0,0,0,0,0,0,0, 
    64                     0,0,0,0,0,0,1,1,0,0, 
    65                     0,0,0,0,0,0,0,0,0,0, 
    66                     0,0,0,0,0,0,0,0,0,0, 
    67                     1,1,1,1,1,1,1,1,1,1, 
    68                     0,0,0,0,0,0,0,0,0,0 
     60printValue =      [ 0,1,1,0,1,0,0,1,1,0, # 0 to 9 
     61                    0,1,1,0,0,0,0,0,0,0, # 10... 
     62                    1,0,0,0,0,0,0,1,1,0, # 
     63                    0,0,0,0,0,0,0,0,0,0, # 
     64                    0,0,0,0,0,0,1,1,0,0, # 
     65                    0,0,0,0,0,0,0,0,0,0, # 
     66                    0,0,0,0,0,0,0,0,0,0, # 
     67                    1,1,1,1,1,1,1,1,1,1, # 
     68                    0,0,0,0,0,0,0,0,0,0,  # 80 to 89 
     69                    0,0,0,0,0,0,0,0,0,0, # 
     70                    0,0,0,0,0,0,0,0,0,0, # 
     71                    0,0,0,0,0,0,0,0,0,0, # 
     72                    0,0,0,0,0,0,0,0,0,0, # 
     73                    0,0,0,0,0,0,0,0,0,0 # 130 to 139 
    6974                    ] 
    7075firstParseValue = [ 0,0,0,0,0,0,0,0,0,0, 
     
    7681                    0,0,0,0,0,0,0,0,0,0, 
    7782                    0,0,0,0,0,0,0,0,0,0, 
    78                     0,0,0,0,0,0,0,0,0,0 
     83                    0,0,0,0,0,0,0,0,0,0, 
     84                    0,0,0,0,0,0,0,0,0,0, # 
     85                    0,0,0,0,0,0,0,0,0,0, # 
     86                    0,0,0,0,0,0,0,0,0,0, # 
     87                    0,0,0,0,0,0,0,0,0,0, # 
     88                    0,0,0,0,0,0,0,0,0,0 # 130 to 139 
    7989                    ] 
    8090checkUpValues =   [ 0,0,0,0,0,0,0,0,0,0, 
     
    8696                    0,0,0,0,0,0,0,0,0,0, 
    8797                    0,0,0,0,0,0,0,0,0,0, 
    88                     0,0,0,0,0,0,0,0,0,0 
     98                    0,0,0,0,0,0,0,0,0,0, 
     99                    0,0,0,0,0,0,0,0,0,0, # 
     100                    0,0,0,0,0,0,0,0,0,0, # 
     101                    0,0,0,0,0,0,0,0,0,0, # 
     102                    0,0,0,0,0,0,0,0,0,0, # 
     103                    0,0,0,0,0,0,0,0,0,0 # 130 to 139 
    89104                    ] 
    90105fieldsName =  [ "","IN_BYT","IN_PKTS","","PROT","TOS","TCP_FL","S_PORT","IPv4@S","S_MASK", 
     
    96111                "","","","","","","","","","ROUTER", 
    97112                "M_L_1","M_L_2","M_L_3","M_L_4","M_L_5","M_L_6","M_L_7","M_L_8","M_L_9","M_L_10", 
    98                 "","","","","","","","","","" 
     113                "","","","","","","","","","", # 80 to 89 
     114                "","","","","","","","","","", 
     115                "","","","","","","","","","", 
     116                "","","","","","","","","","", 
     117                "","","","","","","","","","", 
     118                "","","","","","","","","","" # 130 to 139 
    99119                ] 
    100120flowCpt = 0