Changeset 83 for trunk/src

Show
Ignore:
Timestamp:
11/06/08 16:37:23 (14 years ago)
Author:
andreu
Message:

release tag 0.0.13beta ; beginning of multisampling implementation

Location:
trunk/src
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/dataFlowSet.c

    r80 r83  
    672672              if ( myPtrs->currentRouterPtr->snmpIndexList[agCache.inputSnmp] == 1  ) {        
    673673#endif 
     674 
     675                /* OUT ("traffic from the prefix/subnet")  */ 
     676#if defined(MULTISAMPLING) 
     677                if (myPtrs->currentRouterPtr->sampled != res->sampling ){ 
     678                  res->bytesNbOUT += agCache.bytes*myPtrs->currentRouterPtr->sampled/res->sampling; 
     679                  res->pktsNbOUT += agCache.pkts*myPtrs->currentRouterPtr->sampled/res->sampling; 
     680                  /* (res->flowNbOUT)++; FIXME : FIND SOMETHING*/ 
     681                }else{ 
     682                  res->bytesNbOUT += agCache.bytes; 
     683                  res->pktsNbOUT += agCache.pkts; 
     684                  (res->flowNbOUT)++;              
     685                } 
     686#else 
    674687                if (myPtrs->currentRouterPtr->sampled != 0 ){ 
    675                   /* OUT ("traffic from the prefix/subnet")  */ 
    676688                  res->bytesNbOUT += agCache.bytes; 
    677689                  res->pktsNbOUT += agCache.pkts; 
     
    682694                  res->sampling = myPtrs->currentRouterPtr->sampled; 
    683695                } 
     696#endif 
    684697#if defined(IPV4AGGIDSNMP) 
    685698                prefixKey.beginning = agCache.v4AdD>>(32-agCache.maskD)<<(32-agCache.maskD); 
     
    697710                    } 
    698711                  } 
     712#if defined(MULTISAMPLING) 
     713                  if (myPtrs->currentRouterPtr->sampled != res3->sampling ){ 
     714                    res3->bytesNbIN += agCache.bytes*myPtrs->currentRouterPtr->sampled/res3->sampling; 
     715                    res3->pktsNbIN += agCache.pkts*myPtrs->currentRouterPtr->sampled/res3->sampling; 
     716                    /* (res3->flowNbIN)++;  FIXME : FIND SOMETHING */ 
     717                  }else{ 
     718                    res3->bytesNbIN += agCache.bytes; 
     719                    res3->pktsNbIN += agCache.pkts; 
     720                    (res3->flowNbIN)++; 
     721                  } 
     722#else 
    699723                  if (myPtrs->currentRouterPtr->sampled != 0 ){ 
    700724                    /* IN ("traffic to the prefix/subnet")  */ 
     
    707731                    res3->sampling = myPtrs->currentRouterPtr->sampled; 
    708732                  } 
     733#endif 
    709734                } 
    710735#endif 
  • trunk/src/get_conf.c

    r80 r83  
    142142  unsigned short counter = 0; 
    143143  unsigned short n0, n1, n2, n3, n4; 
     144#if defined(MULTISAMPLING) 
     145  unsigned short n6; 
     146#endif 
    144147#if defined(IPV4AGGIDR) 
    145148  unsigned short n5; 
     
    249252      sscanf(prefixStrTab[i],"%hu.%hu.%hu.%hu/%hu-%hu\n", 
    250253             &n0,&n1,&n2,&n3,&n4,&n5); 
     254#endif 
     255#if defined(IPV4AGGIDSNMP) 
     256#if defined(MULTISAMPLING) 
     257      sscanf(prefixStrTab[i],"%hu.%hu.%hu.%hu %hu %hu\n", 
     258             &n0,&n1,&n2,&n3,&n4,&n6); 
    251259#else 
    252260      sscanf(prefixStrTab[i],"%hu.%hu.%hu.%hu %hu\n", 
    253261             &n0,&n1,&n2,&n3,&n4); 
     262#endif 
    254263#endif 
    255264      buffer4[0] = (unsigned char)n3; 
     
    277286          *((unsigned long*)&buffer4[0]) +~(~0<<(32-n4)); 
    278287        pV4TabPtr[i].mask = n4; 
     288#if defined(MULTISAMPLING) 
     289        pV4TabPtr[i].sampling = n6; 
     290#else 
    279291        pV4TabPtr[i].sampling = 0; 
     292#endif 
    280293#ifdef IPV4AGGIDR       
    281294        pV4TabPtr[i].routerNb = n5; 
     
    321334          *((unsigned long*)&buffer4[0]) +~(~0<<(32-n4)); 
    322335        pV4SubTabPtr[subNetIndex].mask = n4; 
    323         pV4SubTabPtr[subNetIndex].sampling = 0; 
     336#if defined(MULTISAMPLING) 
     337        pV4TabPtr[subNetIndex].sampling = n6; 
     338#else 
     339        pV4TabPtr[subNetIndex].sampling = 0; 
     340#endif 
    324341#ifdef IPV4AGGIDR       
    325342        pV4SubTabPtr[subNetIndex].routerNb = n5; 
     
    358375          *((unsigned long*)&buffer4[0]) +~(~0<<(32-n4)); 
    359376        pV4TabPtr[superNetIndex].mask = n4; 
     377#if defined(MULTISAMPLING) 
     378        pV4TabPtr[superNetIndex].sampling = n6; 
     379#else 
    360380        pV4TabPtr[superNetIndex].sampling = 0; 
     381#endif 
    361382#ifdef IPV4AGGIDR       
    362383        pV4TabPtr[superNetIndex].routerNb = n5;