Changeset 113 for trunk

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

Location:
trunk/src
Files:
2 added
11 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/Makefile.am

    r60 r113  
    66        dataFlowSet.h get_conf.c get_conf.h rules_mgmt.c rules_mgmt.h \ 
    77        remote_output.h remote_output.c prefix_mgmt.h prefix_mgmt.c \ 
    8         pop.h renetcolParam.h as.h as.c 
     8        pop.h renetcolParam.h as.h as.c engine_mgmt.h renetcol_mib.h 
    99renetcolSender_SOURCES = renetcolSender.c renetcolSender.h msg_mgmt.h \ 
    1010        msg_mgmt.c rules_mgmt.c rules_mgmt.h remote_output.h \ 
    1111        remote_output.c fields_mgmt.h fields_mgmt.c pop.h renetcolParam.h\ 
    12         as.h as.c 
     12        as.h as.c engine_mgmt.h renetcol_mib.h 
    1313renetcolMsgCtl_SOURCES = renetcolMsgCtl.c 
    14 renetcolAgg_SOURCES = renetcolAgg.c renetcolAgg.h pop.h renetcolParam.h as.h 
     14renetcolAgg_SOURCES = renetcolAgg.c renetcolAgg.h pop.h renetcolParam.h as.h \ 
     15        engine_mgmt.h renetcol_mib.h 
    1516BUILT_SOURCES = renetcol.o renetcolSender.o renetcolAgg.o 
    1617renetcol_LDADD = -ldl -lc_p 
  • trunk/src/V9Header_mgmt.h

    r28 r113  
    44 * Authors: ANDREU Francois-Xavier  
    55 * 
    6  * Copyright (C) 2005 2006 2007 GIP RENATER  
     6 * Copyright (C) 2005 - 2009 GIP RENATER  
    77 */ 
    88 
  • trunk/src/dataFlowSet.c

    r112 r113  
    112112                       myPtrs->currentHeaderV9Ptr->sourceId,  
    113113                       (*myPtrs->currentFlowsetIdPtr)))!=NULL ) { 
     114    myPtrs->currentMIB->dataFlowSetNb += 1; 
    114115#ifdef DEBUG 
    115116    fprintf(stderr, 
     
    654655         * end of one flow (not the flowset)  
    655656         */ 
     657        myPtrs->currentMIB->realFlowNb += 1; 
    656658#ifdef DEBUG 
    657659        flowCpt++; 
     
    12711273    if ((tmpOpt=existTplOptId(myPtrs->currentRouterPtr, myPtrs->currentHeaderV9Ptr->sourceId,  
    12721274                              (*myPtrs->currentFlowsetIdPtr)))!=NULL) {         
     1275 
     1276      myPtrs->currentMIB->optDataFlowSetNb += 1; 
    12731277#ifdef DEBUG 
    12741278      fprintf(stderr,"<d id: %hu, lg %hu", (*myPtrs->currentFlowsetIdPtr), data_length); 
     
    13421346      fprintf(stderr,">"); 
    13431347#endif 
     1348      myPtrs->currentMIB->realFlowNb += 1; 
    13441349      return (data_length+shift); 
    13451350    } else { 
  • trunk/src/renetcol.c

    r111 r113  
    5555TplFlowSetPtr curTplFlSetPtr; /* current template flowset pointer */ 
    5656TplOptionPtr curTplOptionPtr; 
    57 RouterPtr routersListPtr;  
     57RouterPtr routersListPtr; 
     58NDEEnginePtr enginePtrTmp; 
    5859 
    5960unsigned long sortedRouterList[ROUTER_INDEX_MAX]; 
     
    278279  myPtrs.pcktPtr = (DatagramPtr) malloc(sizeof(struct Datagram)); 
    279280  myPtrs.currentFlowsetNumberPtr = &currentFlowsetNumber; 
     281  myPtrs.currentMIB = shmForAgg->myMIB[shmForAgg->currentTable]; 
     282  myPtrs.secondMIB = shmForAgg->myMIB[shmForAgg->secondTable]; 
     283  if (initMIB(myPtrs.currentMIB)!=1) { 
     284    fprintf(stderr, "ERROR in MIB initialisation\n");  
     285    exit(1);} 
     286  if (initMIB(myPtrs.secondMIB)!=1) { 
     287    fprintf(stderr, "ERROR in second MIB initialisation\n");  
     288    exit(1);} 
    280289#ifdef IPV4AGGIDR 
    281290  myPtrs.routersID = &indexedRouterList; 
     
    561570      } 
    562571      shmForAgg->readed = 1; 
     572      myPtrs.currentMIB = shmForAgg->myMIB[shmForAgg->currentTable]; 
     573      myPtrs.secondMIB = shmForAgg->myMIB[shmForAgg->secondTable]; 
    563574#ifdef ASACC 
    564575      myPtrs.currentASTab = shmForAgg->ASTab[shmForAgg->currentTable]; 
     
    570581      myPtrs.currentV6IndexTab = &(shmForAgg->indexV6Tab[shmForAgg->currentTable][0][0]); 
    571582      myPtrs.secondV6IndexTab = &(shmForAgg->indexV6Tab[shmForAgg->secondTable][0][0]); 
     583      /* FIXME : to delete : */ 
    572584      if (!(TPLFILE = fopen("/tmp/IPV6LINKAGG.txt", "w"))) { 
    573585        syslog (LOG_ERR, "error during %s opening", "/tmp/IPV6LINKAGG.txt"); 
     
    596608        } 
    597609      } 
    598       fclose(TPLFILE); 
     610      fclose(TPLFILE); /* <-- */ 
    599611#endif 
    600612    } 
     
    610622    getIpHeader(myPtrs.pcktPtr, myPtrs.ptr_buffer); 
    611623    regRouter = checkIpHeader(myPtrs.pcktPtr, &sortedRouterList[0], routerNb); 
     624    myPtrs.currentMIB->ipPacketNb += 1; 
    612625    getUdpHeader(myPtrs.pcktPtr, myPtrs.ptr_buffer); 
    613626    if ( checkUdpHeader(myPtrs.pcktPtr, regRouter, receptPort) == 1 ){ 
    614627      continue; 
    615628    } 
    616      
     629    myPtrs.currentMIB->udpPacketNb += 1; 
    617630    switch( version =  
    618631            getNetFlowHeader(myPtrs.pcktPtr, myPtrs.ptr_buffer,  
     
    625638               myPtrs.currentHeaderV9Ptr->package_sequence); 
    626639#endif 
     640      myPtrs.currentMIB->v9PacketNb += 1; 
     641      myPtrs.currentMIB->flowNb += myPtrs.currentHeaderV9Ptr->count; 
    627642      if ((myPtrs.currentRouterPtr=notExistRouter(routersListPtr,  
    628643                                                  myPtrs.pcktPtr->ipH->srcAdd))==NULL) { 
    629644        myPtrs.currentRouterPtr = routersListPtr; 
    630645      } 
     646      if ((enginePtrTmp = existEngId(myPtrs.currentRouterPtr,myPtrs.currentHeaderV9Ptr->sourceId))==NULL) { 
     647        /* add new engineID */ 
     648        enginePtrTmp = newRouterEngineList(); 
     649        enginePtrTmp->next = myPtrs.currentRouterPtr->engineList; 
     650        if (myPtrs.currentRouterPtr->engineList!=NULL) { 
     651          myPtrs.currentRouterPtr->engineList->prev=enginePtrTmp;} 
     652        myPtrs.currentRouterPtr->engineList = enginePtrTmp; 
     653        enginePtrTmp->engineId = myPtrs.currentHeaderV9Ptr->sourceId; 
     654        enginePtrTmp->package_sequence = myPtrs.currentHeaderV9Ptr->package_sequence; 
     655      } else { 
     656        enginePtrTmp->engineId = myPtrs.currentHeaderV9Ptr->sourceId; 
     657        if (enginePtrTmp->package_sequence != (myPtrs.currentHeaderV9Ptr->package_sequence-1)) { 
     658          myPtrs.currentMIB->v9UnSeqNb += 1; 
     659        } 
     660        enginePtrTmp->package_sequence = myPtrs.currentHeaderV9Ptr->package_sequence; 
     661      } 
    631662      currentFlowsetNumber = 0; 
    632663      shift = 0; 
    633664      gardeFou=0; 
    634       while ((currentFlowsetNumber < myPtrs.currentHeaderV9Ptr->count) && (shift <= 1456)) { 
     665      while ((currentFlowsetNumber < myPtrs.currentHeaderV9Ptr->count)  
     666             && (shift+48 < myPtrs.pcktPtr->udp_header->length)) { 
    635667        gardeFou++; 
    636668        curTplFlSetPtr = NULL; 
    637669        currentFlowsetId=getFlowsetId(currentFlowsetNumber,  
    638670                                      myPtrs.offsetV9Ptr, myPtrs.ptr_buffer); 
     671        myPtrs.currentMIB->flowSetNb += 1; 
    639672        if ( currentFlowsetId == 0 ) { 
    640           if ( (shift = checkTemplateFlowSet(myPtrs.currentRouterPtr,  
     673          if ( (shift = checkTemplateFlowSet(shift, myPtrs.currentRouterPtr, 
     674                                             myPtrs.currentMIB, 
    641675                                             myPtrs.offsetV9Ptr,  
    642676                                             myPtrs.ptr_buffer,  
     
    649683#endif 
    650684            currentFlowsetNumber = myPtrs.currentHeaderV9Ptr->count + 1; 
    651           }; 
    652           writeAllTplFlSet(); 
     685          } 
     686          /* writeAllTplFlSet(); */ 
    653687        } else if (currentFlowsetId == 1) { 
    654           if ( (shift = checkTemplateOption(myPtrs.currentRouterPtr,  
     688          if ( (shift = checkTemplateOption(shift, myPtrs.currentRouterPtr, 
     689                                            myPtrs.currentMIB, 
    655690                                            myPtrs.offsetV9Ptr,  
    656691                                            myPtrs.ptr_buffer,  
     
    714749#ifdef DEBUG     
    715750    fprintf (stderr, "]\n"); 
     751    fprintf (stderr, "IP: %llu , UDP: %llu, NDEv9: %llu, drops: %llu, FS: %llu, Flows: %llu, realFl: %llu Diff:%llu\n", 
     752             myPtrs.currentMIB->ipPacketNb, 
     753             myPtrs.currentMIB->udpPacketNb, 
     754             myPtrs.currentMIB->v9PacketNb, 
     755             myPtrs.currentMIB->v9UnSeqNb, 
     756             myPtrs.currentMIB->flowSetNb, 
     757             myPtrs.currentMIB->flowNb, 
     758             myPtrs.currentMIB->realFlowNb, 
     759             myPtrs.currentMIB->flowNb - myPtrs.currentMIB->realFlowNb 
     760             ); 
    716761#endif 
    717762  } while (1); 
     
    929974  fclose(TPLFILE); 
    930975} 
     976 
     977/* 
     978 * initMIB 
     979 */ 
     980int initMIB(struct RenetcolMIB *theMIB) 
     981{ 
     982  theMIB->ipPacketNb = 0; 
     983  theMIB->udpPacketNb = 0; 
     984  theMIB->v9PacketNb = 0; 
     985  theMIB->v9UnSeqNb = 0; 
     986  theMIB->flowSetNb = 0; 
     987  theMIB->dataFlowSetNb = 0; 
     988  theMIB->defFlowSetNb = 0; 
     989  theMIB->optDataFlowSetNb = 0; 
     990  theMIB->optDefFlowSetNb = 0; 
     991  theMIB->flowNb = 0;           
     992  theMIB->realFlowNb = 0;  
     993  theMIB->ipv4BytesIn = 0; 
     994  theMIB->ipv4BytesOut = 0; 
     995  theMIB->ipv4PcktsIn = 0; 
     996  theMIB->ipv4PcktsOut = 0; 
     997  theMIB->ipv4FlowIn = 0; 
     998  theMIB->ipv4FlowOut = 0;     
     999  theMIB->ipv4IcmpFlowNb = 0; 
     1000  theMIB->ipv4IcmpBytesNb = 0; 
     1001  theMIB->ipv4IcmpPktsNb = 0; 
     1002  theMIB->ipv4UDPFlowNb = 0; 
     1003  theMIB->ipv4UDPBytesNb = 0; 
     1004  theMIB->ipv4UDPPktsNb = 0; 
     1005  theMIB->ipv4TCPFlowNb = 0; 
     1006  theMIB->ipv4TCPBytesNb = 0; 
     1007  theMIB->ipv4TCPPktsNb = 0; 
     1008  theMIB->ipv4OthersFlowNb = 0; 
     1009  theMIB->ipv4OthersBytesNb = 0; 
     1010  theMIB->ipv4OthersPktsNb = 0; 
     1011  theMIB->ipv4FlowSizePcktsE1 = 0;    
     1012  theMIB->ipv4FlowSizePcktsLT10 = 0;  
     1013  theMIB->ipv4FlowSizePcktsLT100 = 0; 
     1014  theMIB->ipv4FlowSizePcktsLT1k = 0;  
     1015  theMIB->ipv4FlowSizePcktsLT10k = 0; 
     1016  theMIB->ipv4FlowSizePcktsMT10k = 0; 
     1017  theMIB->ipv4FlowSizeBytesLT50 = 0;  
     1018  theMIB->ipv4FlowSizeBytesLT100 = 0; 
     1019  theMIB->ipv4FlowSizeBytesLT1k = 0;  
     1020  theMIB->ipv4FlowSizeBytesLT10k = 0; 
     1021  theMIB->ipv4FlowSizeBytesLT100k = 0; 
     1022  theMIB->ipv4FlowSizeBytesLT1M = 0;   
     1023  theMIB->ipv4FlowSizeBytesLT10M = 0;  
     1024  theMIB->ipv4FlowSizeBytesLT100M = 0;  
     1025  theMIB->ipv4FlowSizeBytesMT100M = 0;  
     1026  theMIB->ipv4WebBytesNb = 0; 
     1027  theMIB->ipv4WebPcktsNb = 0; 
     1028  theMIB->ipv4WebFlowNb = 0; 
     1029  theMIB->ipv4DNSBytesNb = 0; 
     1030  theMIB->ipv4DNSPcktsNb = 0; 
     1031  theMIB->ipv4DNSFlowNb = 0; 
     1032  theMIB->ipv4OthersApBytesNb = 0; 
     1033  theMIB->ipv4OthersApPcktsNb = 0; 
     1034  theMIB->ipv4OthersApFlowNb = 0; 
     1035  theMIB->ipv6BytesIn = 0; 
     1036  theMIB->ipv6BytesOut = 0; 
     1037  theMIB->ipv6PcktsIn = 0; 
     1038  theMIB->ipv6PcktsOut = 0; 
     1039  theMIB->ipv6FlowIn = 0; 
     1040  theMIB->ipv6FlowOut = 0; 
     1041  theMIB->ipv6IcmpFlowNb = 0; 
     1042  theMIB->ipv6IcmpBytesNb = 0; 
     1043  theMIB->ipv6IcmpPktsNb = 0; 
     1044  theMIB->ipv6UDPFlowNb = 0; 
     1045  theMIB->ipv6UDPBytesNb = 0; 
     1046  theMIB->ipv6UDPPktsNb = 0; 
     1047  theMIB->ipv6TCPFlowNb = 0; 
     1048  theMIB->ipv6TCPBytesNb = 0; 
     1049  theMIB->ipv6TCPPktsNb = 0; 
     1050  theMIB->ipv6OthersFlowNb = 0; 
     1051  theMIB->ipv6OthersBytesNb = 0; 
     1052  theMIB->ipv6OthersPktsNb = 0; 
     1053  theMIB->ipv6FlowSizePcktsE1 = 0;      
     1054  theMIB->ipv6FlowSizePcktsLT10 = 0;    
     1055  theMIB->ipv6FlowSizePcktsLT100 = 0;   
     1056  theMIB->ipv6FlowSizePcktsLT1k = 0;    
     1057  theMIB->ipv6FlowSizePcktsLT10k = 0;   
     1058  theMIB->ipv6FlowSizePcktsMT10k = 0;   
     1059  theMIB->ipv6FlowSizeBytesLT50 = 0;    
     1060  theMIB->ipv6FlowSizeBytesLT100 = 0;   
     1061  theMIB->ipv6FlowSizeBytesLT1k = 0;    
     1062  theMIB->ipv6FlowSizeBytesLT10k = 0;   
     1063  theMIB->ipv6FlowSizeBytesLT100k = 0;  
     1064  theMIB->ipv6FlowSizeBytesLT1M = 0;    
     1065  theMIB->ipv6FlowSizeBytesLT10M = 0;   
     1066  theMIB->ipv6FlowSizeBytesLT100M = 0;  
     1067  theMIB->ipv6FlowSizeBytesMT10M = 0;   
     1068  theMIB->ipv6WebBytesNb = 0; 
     1069  theMIB->ipv6WebPcktsNb = 0; 
     1070  theMIB->ipv6WebFlowNb = 0; 
     1071  theMIB->ipv6DNSBytesNb = 0; 
     1072  theMIB->ipv6DNSPcktsNb = 0; 
     1073  theMIB->ipv6DNSFlowNb = 0; 
     1074  theMIB->ipv6OthersApBytesNb = 0; 
     1075  theMIB->ipv6OthersApPcktsNb = 0; 
     1076  theMIB->ipv6OthersApFlowNb = 0; 
     1077  return 1; 
     1078} 
  • trunk/src/renetcol.h

    r111 r113  
    6666#include "renetcolParam.h" 
    6767#include "as.h" 
     68#include "renetcol_mib.h" 
     69#include "engine_mgmt.h" 
    6870 
    6971struct SHMForAgg {/* if you change it, you must change renetcolAgg.h struct */ 
     
    8789  struct IndexV6 indexV6Tab[2][ROUTER_INDEX_MAX][MAX_INDEX_BY_ROUTER]; 
    8890#endif 
     91  struct RenetcolMIB myMIB[2][1]; 
    8992}; 
    9093 
     
    107110void showAllTplFlSet(); 
    108111void writeAllTplFlSet(); 
    109  
     112int initMIB(struct RenetcolMIB *); 
  • trunk/src/renetcolAgg.h

    r96 r113  
    6464  struct IndexV6 indexV6Tab[2][ROUTER_INDEX_MAX][MAX_INDEX_BY_ROUTER]; 
    6565#endif 
     66  struct RenetcolMIB myMIB[2]; 
    6667};  
  • trunk/src/renetcolParam.h

    r96 r113  
    9595 
    9696/* 
    97  * Path to the rrd file 
     97 * RRD files paths 
    9898 */ 
    9999#define PREFIX_RRD_LOCATION "/mnt/data/RRD/RENATER/IPv4_SUBNET/" 
     
    101101#define AS_RRD_LOCATION "/mnt/data/RRD/RENATER/AS/" 
    102102#define SNMP_INDEX_RRD_LOCATION "/mnt/data/RRD/RENATER/SNMP_INDEX/" 
     103#define MIB_RRD_LOCATION "/mnt/data/RRD/RENATER/RENETCOL_MIB/" 
    103104 
    104105/* 
  • trunk/src/routers_mgmt.c

    r96 r113  
    5050    tmp->tplList = NULL; 
    5151    tmp->tplOptList = NULL; 
     52    tmp->engineList = NULL; 
    5253#if defined(MULTISAMPLING) 
    5354    tmp->sampled = 1; 
     
    112113    free(ptpl); 
    113114    ptpl = NULL; 
     115  } 
     116  return NULL; 
     117} 
     118 
     119NDEEnginePtr newRouterEngineList() 
     120{ 
     121  NDEEnginePtr tmp = (NDEEnginePtr) malloc(sizeof(struct NDEEngine)); 
     122  tmp->package_sequence = 0; 
     123  tmp->engineId = 0; 
     124  tmp->prev = NULL; 
     125  tmp->next = NULL; 
     126  return tmp; 
     127} 
     128 
     129/* 
     130 * existEngId 
     131 * 
     132 * return: 
     133 *    - a pointer on the EngineId or NULL 
     134 */ 
     135NDEEnginePtr existEngId(RouterPtr cr, unsigned long sid) 
     136{ 
     137  NDEEnginePtr tmp=cr->engineList; 
     138  for (; tmp; tmp=tmp->next) { 
     139    if (tmp->engineId==sid) { 
     140      return tmp; 
     141    } 
    114142  } 
    115143  return NULL; 
  • trunk/src/routers_mgmt.h

    r96 r113  
    4141#include "headers_mgmt.h" 
    4242#include "rules_mgmt.h" 
     43#include "renetcol_mib.h" 
     44#include "engine_mgmt.h" 
    4345 
    4446typedef struct Router * RouterPtr; 
     
    4749  TplFlowSetPtr tplList;   /* list of the template definition */ 
    4850  TplOptionPtr tplOptList; /* list of the optional template definitions */ 
     51  NDEEnginePtr engineList;    /* list of engines */ 
    4952  unsigned long sampled;   /* sampling value: (one for) 10, 100 or 1(full mode)*/ 
    5053  unsigned short ID;       /* internal ID, create during routers file reading */ 
     
    7174  unsigned long *routersID; 
    7275#endif 
     76  struct RenetcolMIB *currentMIB; 
     77  struct RenetcolMIB *secondMIB; 
    7378  struct PrefixV4 *currentV4Tab; 
    7479  struct PrefixV4 *secondV4Tab; 
     
    98103TplFlowSetPtr newRouterTplList(); 
    99104TplFlowSetPtr deleteTplFlSet(TplFlowSetPtr); 
     105NDEEnginePtr newRouterEngineList(); 
     106NDEEnginePtr existEngId(RouterPtr, unsigned long); 
    100107TplOptionPtr newRouterTplOptList(); 
    101108TplOptionPtr deleteTplOption(TplOptionPtr); 
  • 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 
  • trunk/src/template.h

    r31 r113  
    3232#include "V9Header_mgmt.h" 
    3333#include "msg_mgmt.h" 
     34#include "renetcol_mib.h" 
    3435 
    3536short getFlowsetId(short, unsigned short *, unsigned char *); 
    36 short checkTemplateFlowSet(RouterPtr, unsigned short *, 
     37short checkTemplateFlowSet(short,  
     38                           RouterPtr,  
     39                           struct RenetcolMIB *, 
     40                           unsigned short *, 
    3741                           unsigned char *, 
    3842                           NetFlowV9HeaderPtr, 
    3943                           TplFlowSetPtr, short *, int); 
    40 short checkTemplateOption(RouterPtr, unsigned short *,  
     44short checkTemplateOption(short,  
     45                          RouterPtr, 
     46                          struct RenetcolMIB *,  
     47                          unsigned short *,  
    4148                          unsigned char *,  
    4249                          NetFlowV9HeaderPtr, 
    43                           TplOptionPtr, short *); 
     50                          TplOptionPtr,  
     51                          short *); 
    4452TplFlowSetPtr existId(RouterPtr, unsigned long, short); 
    4553TplFlowSetPtr existTplId(RouterPtr, unsigned long, short);