Changeset 77 for trunk/src

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/src
Files:
4 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}