Changeset 78 for trunk/src

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

some updates to prepare release 0.0.12

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/template.c

    r77 r78  
    8585  if ( flowsetId > 1024 ) /* FIXME CONST */  
    8686    { 
     87#ifdef DEBUG   
    8788      fprintf(stderr,"\n IP: %lu.%lu.%lu.%lu, %d,%d\n",  
    8889              cr->IpAddress>>24,  
     
    9596      fprintf (stderr, "\n cTFSPtr->templateFlowSetId >1024: %hu\n",   
    9697               cTFSPtr->templateFlowSetId);  
     98#endif 
    9799      while ( ((*offV9))> (index)){ 
    98100        buffer2[1]= *(buf+index); index++; 
    99101        buffer2[0]= *(buf+index); index++; 
    100102        tmp = *((unsigned short*)&buffer2); 
     103#ifdef DEBUG   
    101104        fprintf (stderr, " %hu ", tmp);  
     105#endif 
    102106      } 
    103107      syslog (LOG_INFO,  
     
    188192             || badFieldLength == 1  
    189193             || (badFieldCount == 1)) { 
     194#ifdef DEBUG 
    190195          fprintf(stderr,"\n IP: %lu.%lu.%lu.%lu, %d,%d\n",  
    191196                  cr->IpAddress>>24,  
     
    198203          fprintf (stderr, "\n cTFSPtr->templateFlowSetId: %hu\n",   
    199204                   cTFSPtr->templateFlowSetId);  
     205#endif 
    200206          while ( ((*offV9))> (index)){ 
    201207            buffer2[1]= *(buf+index); index++; 
    202208            buffer2[0]= *(buf+index); index++; 
    203209            tmp = *((unsigned short*)&buffer2); 
     210#ifdef DEBUG   
    204211            fprintf (stderr, " %hu ", tmp);  
     212#endif 
    205213          } 
    206214          syslog (LOG_INFO,  
    207215                  "in new template: field nb gt 216, field lg gt 16 or too many fields, bad template definition possibility"); 
    208           fprintf(stderr,   
    209                   "\n in new template function: too many fields, bug collector or wrong template def \n");   
    210216          ptpltmp = cTFSPtr; 
    211217          if (ptpltmp->prev == NULL) { 
     
    299305            buffer2[0]= *(buf+index); index++; 
    300306            tmp = *((unsigned short*)&buffer2); 
     307#ifdef DEBUG   
    301308            fprintf (stderr, " %hu ", tmp);  
     309#endif 
    302310          } 
    303311          syslog (LOG_INFO,  
    304312                  "in update template function: too many fields, bug collector or wrong template def in template update"); 
     313#ifdef DEBUG 
    305314          fprintf(stderr,  
    306315                  "\nin update template function: too many fields, bug collector or wrong template def in template update\n");  
     316#endif 
    307317          ptpltmp = cTFSPtr; 
    308318          if (ptpltmp->prev == NULL) { 
     
    419429      buffer2[0]= *(buf+(*offV9)); (*offV9)++; cpt++; 
    420430      cTOPtr->optionLg = *((unsigned short*)&buffer2); 
     431#ifdef DEBUG   
    421432      fprintf (stderr, " otid %hu, %hu, %hu, ", cTOPtr->templateOptionId, cTOPtr->optionScopeLg, cTOPtr->optionLg); 
     433#endif 
    422434      cpt_fields = 0; 
    423435      for ( i=0; i<(((cTOPtr->optionScopeLg)+(cTOPtr->optionLg))/4); i++) { 
     
    428440          badFieldNumber = 1; 
    429441        } 
     442#ifdef DEBUG   
    430443        fprintf (stderr, " %hu - ", tmp->fieldType); 
     444#endif 
    431445        buffer2[1]= *(buf+(*offV9)); (*offV9)++; cpt++; 
    432446        buffer2[0]= *(buf+(*offV9)); (*offV9)++; cpt++; 
     
    434448          badFieldLength = 1; 
    435449        } 
     450#ifdef DEBUG   
    436451        fprintf (stderr, " %hu,", tmp->fieldLength); 
     452#endif 
    437453        tmp->next = cTOPtr->fieldSet; 
    438454        tmp->prev = NULL; 
     
    447463             || (badFieldNumber == 1)  
    448464             || badFieldLength == 1) { 
     465#ifdef DEBUG   
    449466          fprintf(stderr,"\n IP: %lu.%lu.%lu.%lu\n", 
    450467                  cr->IpAddress>>24, 
     
    452469                  cr->IpAddress<<16>>24, 
    453470                  cr->IpAddress<<24>>24); 
     471#endif 
    454472          syslog (LOG_INFO,  
    455473                  "in option template function: too many fields, bug collector or wrong template def in template update"); 
     
    462480            buffer2[0]= *(buf+index); index++; 
    463481            tmp = *((unsigned short*)&buffer2); 
     482#ifdef DEBUG   
    464483            fprintf (stderr, " %hu ", tmp); 
     484#endif 
    465485          } 
    466486 
     
    484504      while ((*offV9)%4 != 0) { 
    485505        (*offV9)++; cpt++; 
     506#ifdef DEBUG   
    486507        fprintf(stderr,"p"); 
     508#endif 
    487509      } /*padding case*/ 
    488510    } else { /*update */ 
     
    538560             || (badFieldNumber == 1)  
    539561             || badFieldLength == 1) { 
     562#ifdef DEBUG   
    540563          fprintf(stderr,"\n IP: %lu.%lu.%lu.%lu\n", 
    541564                  cr->IpAddress>>24, 
     
    543566                  cr->IpAddress<<16>>24, 
    544567                  cr->IpAddress<<24>>24); 
     568#endif 
    545569          syslog (LOG_INFO,  
    546570                  "in update option tpl function: too many fields, bug collector or wrong template def in template update"); 
     
    568592      while ((*offV9)%4 != 0) { 
    569593        (*offV9)++; cpt++; 
     594#ifdef DEBUG   
    570595        fprintf(stderr,"p"); 
     596#endif 
    571597      } /*padding case*/ 
    572598    }