Changeset 113 for trunk/src/template.c

Show
Ignore:
Timestamp:
06/23/09 17:42:00 (13 years ago)
Author:
andreu
Message:

ticket#27 : new global structure for counters.
some bug correction in renetcol.c

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/template.c

    r111 r113  
    5454 */ 
    5555short  
    56 checkTemplateFlowSet(RouterPtr cr, unsigned short *offV9,  
     56checkTemplateFlowSet(short shift,  
     57                     RouterPtr cr,  
     58                     struct RenetcolMIB *myMIB, 
     59                     unsigned short *offV9,  
    5760                     unsigned char *buf,  
    5861                     NetFlowV9HeaderPtr v9Ptr, 
     
    212215#endif 
    213216          } 
    214 #ifdef DEBUG   
    215           syslog (LOG_INFO,  
    216                   "New template: field nb, field lg or too many fields, bad template def possibility SId: %lu", 
    217                   v9Ptr->sourceId); 
    218 #endif 
    219217          ptpltmp = cTFSPtr; 
    220218          if (ptpltmp->prev == NULL) { 
     
    313311          } 
    314312#ifdef DEBUG 
    315           syslog (LOG_INFO,  
    316                   "in update template function: too many fields, bug collector or wrong template def in template update"); 
    317313          fprintf(stderr,  
    318314                  "\nin update template function: too many fields, bug collector or wrong template def in template update\n");  
     
    374370    msgSend( myQueue, myMsg); 
    375371    /* end send */ 
    376     (*cFNPtr)++;     
     372    (*cFNPtr)++;   
     373#ifdef DEBUG 
     374    fprintf (stderr, "}"); 
     375#endif 
     376    myMIB->defFlowSetNb += 1; 
     377    myMIB->realFlowNb += 1;     
    377378  } while ( (cpt) < (length-2) ); /*length-2*/ 
    378 #ifdef DEBUG 
    379   fprintf (stderr, "}"); 
    380 #endif 
    381   return length; 
     379  return length+shift; 
    382380} 
    383381 
     
    387385 */ 
    388386short  
    389 checkTemplateOption(RouterPtr cr, unsigned short *offV9,  
    390                     unsigned char *buf, NetFlowV9HeaderPtr v9Ptr, 
     387checkTemplateOption(short shift,  
     388                    RouterPtr cr, 
     389                    struct RenetcolMIB *myMIB, 
     390                    unsigned short *offV9,  
     391                    unsigned char *buf,  
     392                    NetFlowV9HeaderPtr v9Ptr, 
    391393                    TplOptionPtr cTOPtr, 
    392394                    short *cFNPtr) 
     
    467469             || badFieldLength == 1) { 
    468470#ifdef DEBUG   
    469           fprintf(stderr,"\n IP: %lu.%lu.%lu.%lu\n", 
     471          fprintf(stderr,"\n IP: %lu.%lu.%lu.%lu Opt Templ\n", 
    470472                  cr->IpAddress>>24, 
    471473                  cr->IpAddress<<8>>24, 
     
    474476          syslog (LOG_INFO,  
    475477                  "in option template function: too many fields, bug collector or wrong template def in template update"); 
    476           fprintf(stderr, 
    477                   "\nin option template function: too many fields, bug collector or wrong template def in template update\n"); 
    478478#endif 
    479479          while ( ((*offV9))> (index)){ 
     
    569569          syslog (LOG_INFO,  
    570570                  "in update option tpl function: too many fields, bug collector or wrong template def in template update"); 
    571           fprintf(stderr, 
    572                   "\nin update option tpl function: too many fields, bug collector or wrong template def in template update\n"); 
    573571#endif 
    574572          ptplotmp = cTOPtr; 
     
    597595    } 
    598596    (*cFNPtr)++; 
     597#ifdef DEBUG 
     598    fprintf (stderr, ">"); 
     599#endif 
     600    myMIB->optDefFlowSetNb += 1; 
     601    myMIB->realFlowNb += 1;     
    599602  } while ((cpt) < (length-2)); 
    600603  /*   show_all_tplFlSet(); */ 
    601 #ifdef DEBUG 
    602   fprintf (stderr, ">"); 
    603 #endif 
    604   return length; 
     604  return length+shift; 
    605605} 
    606606