Changeset 20 for trunk/src/dataFlowSet.c

Show
Ignore:
Timestamp:
11/22/06 14:04:22 (16 years ago)
Author:
andreu
Message:

new release 0.0.6, with CRIHAN compilation feature

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/dataFlowSet.c

    r19 r20  
    6565  struct PrefixV4 prefixKey, *res; /* for bsearch */ 
    6666  struct AggCache agCache; 
     67#ifdef CRIHAN 
    6768  struct IPFLowCache ipFirstCache; /* CRI */ 
    6869  struct MPLSFlowCache mplsFirstCache; /* CRI */ 
    6970  unsigned long firstTime = 0; /* CRI */ 
    7071  unsigned long lastTime = 0; /* CRI */ 
     72#endif /* CRIHAN */ 
    7173  int bool = 0; 
    7274 
    73   /* CRI */ 
     75#ifdef CRIHAN 
    7476  ipFirstCache.ipProt = 0; 
    7577  ipFirstCache.bytes = 0; 
     
    8991  mplsFirstCache.v4AdS = 0; 
    9092  mplsFirstCache.v4AdD = 0; 
    91   mplsFirstCache.outSnmp = 0; 
    92   mplsFirstCache.inSnmp = 0; 
    9393  mplsFirstCache.routerAd = 0; 
    9494  mplsFirstCache.mplsLabel1 = 0; 
    95  
    96   /* CRI */ 
     95#endif /* CRIHAN */ 
    9796 
    9897  buffer2[1] = *(buf+(*offV9));(*offV9)++; 
     
    122121    /* end aggreg */ 
    123122 
    124     /* CRI */ 
     123#ifdef CRIHAN 
    125124    ipFirstCache.routerAd = pcktPtr->ipH->srcAdd; 
    126125    mplsFirstCache.routerAd = pcktPtr->ipH->srcAdd; 
    127     /* end CRI */ 
     126#endif /* CRIHAN */ 
    128127 
    129128    pftmp = tmp->lastField; 
     
    185184/*            } */ 
    186185              /* end aggregation */ 
    187               /* CRI */ 
     186#ifdef CRIHAN 
    188187              if ((pftmp->fieldType==9)||(pftmp->fieldType==29)){ 
    189188                ipFirstCache.maskS = *((unsigned char*)&buffer1); 
     
    199198                ipFirstCache.tProt = *((unsigned char*)&buffer1);  
    200199              } 
    201 /*            if (pftmp->fieldType==46){  */ 
    202 /*              mplsFirstCache.topLabelType = *((unsigned char*)&buffer1);  */ 
    203 /*            } */ 
    204               /* end CRI */ 
     200#endif /* CRIHAN */ 
    205201              break; 
    206202            case 2: 
     
    215211/*            } */ 
    216212              /* end aggregation */ 
    217               /* CRI */ 
     213#ifdef CRIHAN 
    218214              if (pftmp->fieldType==10){ 
    219215                ipFirstCache.inSnmp = *((unsigned short*)&buffer2); 
    220                 mplsFirstCache.inSnmp = *((unsigned short*)&buffer2); 
    221216              } 
    222217              if (pftmp->fieldType==14){ 
    223218                ipFirstCache.outSnmp = *((unsigned short*)&buffer2); 
    224                 mplsFirstCache.outSnmp = *((unsigned short*)&buffer2); 
    225219              } 
    226220              if (pftmp->fieldType==7){ 
     
    230224                ipFirstCache.dPort = *((unsigned short*)&buffer2); 
    231225              } 
    232               /* end CRI */  
     226#endif /* CRIHAN */  
    233227              break; 
    234228            case 3: 
     
    242236              /* aggregation */ 
    243237              /* end aggregation */ 
    244               /* CRI */ 
     238#ifdef CRIHAN 
    245239              if (pftmp->fieldType==70){ 
    246240                mplsFirstCache.mplsLabel1 = (*((unsigned long*)&buffer4))>>4; 
    247241              } 
    248               /* end CRI */ 
     242#endif /* CRIHAN */ 
    249243              break; 
    250244            case 4: 
     
    275269/*            } */ 
    276270              /* end aggregation */ 
    277               /* CRI */ 
     271#ifdef CRIHAN 
    278272              if (pftmp->fieldType==8){ 
    279273                ipFirstCache.v4AdS = *((unsigned long*)&buffer4); 
     
    296290                lastTime = *((unsigned long*)&buffer4); 
    297291              } 
    298               /* end CRI */ 
     292#endif /* CRIHAN */ 
    299293              break; 
    300294            case 16: 
     
    468462/*        }        */ 
    469463          /* end aggregation */ 
    470           /* CRI */ 
     464#ifdef CRIHAN 
    471465          if ((pftmp->fieldType==9)||(pftmp->fieldType==29)){ 
    472466            ipFirstCache.maskS = *((unsigned char*)&buffer1); 
     
    482476            ipFirstCache.tProt = *((unsigned char*)&buffer1);  
    483477          } 
    484 /*        if (pftmp->fieldType==46){  */ 
    485 /*          mplsFirstCache.topLabelType = *((unsigned char*)&buffer1);  */ 
    486 /*        } */ 
     478#endif /* CRIHAN */ 
    487479          break; 
    488480        case 2: 
     
    494486          }        
    495487          /* end aggregation */ 
    496           /* CRI */ 
     488#ifdef CRIHAN 
    497489          if (pftmp->fieldType==10){ 
    498490            ipFirstCache.inSnmp = *((unsigned short*)&buffer2); 
    499             mplsFirstCache.inSnmp = *((unsigned short*)&buffer2); 
    500491          } 
    501492          if (pftmp->fieldType==14){ 
    502493            ipFirstCache.outSnmp = *((unsigned short*)&buffer2); 
    503             mplsFirstCache.outSnmp = *((unsigned short*)&buffer2); 
    504494          } 
    505495          if (pftmp->fieldType==7){ 
     
    509499            ipFirstCache.dPort = *((unsigned short*)&buffer2); 
    510500          } 
    511           /* end CRI */  
     501#endif /* CRIHAN */ 
    512502          break; 
    513503        case 3: 
     
    518508          /* aggregation */ 
    519509          /* end aggregation */ 
    520           /* CRI */ 
     510#ifdef CRIHAN 
    521511          if (pftmp->fieldType==70){ 
    522512            mplsFirstCache.mplsLabel1 = (*((unsigned long*)&buffer4))>>4; 
    523513          } 
    524           /* end CRI */ 
     514#endif /* CRIHAN */ 
    525515          break; 
    526516        case 4: 
     
    541531/*        } */ 
    542532          /* end aggregation */ 
    543           /* CRI */ 
     533#ifdef CRIHAN 
    544534          if (pftmp->fieldType==8){ 
    545535            ipFirstCache.v4AdS = *((unsigned long*)&buffer4); 
     
    562552            lastTime = *((unsigned long*)&buffer4); 
    563553          } 
    564           /* end CRI */ 
     554#endif /* CRIHAN */ 
    565555          break; 
    566556        case 16: 
     
    585575         * end of one flow (not the flowset)  
    586576         */ 
    587         /* CRI */ 
     577#ifdef CRIHAN 
    588578        if ( mplsFirstCache.mplsLabel1 == 0 ) { 
    589579          (ipCache+(*ipCounter))->ipProt = ipFirstCache.ipProt; 
     
    618608          (mplsCache+(*mplsCounter))->ipProt = mplsFirstCache.ipProt; 
    619609          mplsFirstCache.ipProt = 0; 
    620 /*        (mplsCache+(*mplsCounter))->topLabelType = mplsFirstCache.topLabelType; */ 
    621 /*        mplsFirstCache.topLabelType = 0; */ 
    622610          (mplsCache+(*mplsCounter))->v4AdS =  mplsFirstCache.v4AdS; 
    623611          mplsFirstCache.v4AdS = 0; 
    624612          (mplsCache+(*mplsCounter))->v4AdD =  mplsFirstCache.v4AdD;  
    625613          mplsFirstCache.v4AdD = 0; 
    626           (mplsCache+(*mplsCounter))->inSnmp =  mplsFirstCache.inSnmp; 
    627           mplsFirstCache.inSnmp = 0; 
    628           (mplsCache+(*mplsCounter))->outSnmp =  mplsFirstCache.outSnmp;  
    629           mplsFirstCache.outSnmp = 0; 
    630614          (mplsCache+(*mplsCounter))->routerAd =  mplsFirstCache.routerAd; 
    631615          (mplsCache+(*mplsCounter))->mplsLabel1 =  mplsFirstCache.mplsLabel1; 
     
    633617          (*mplsCounter)++; 
    634618        } 
    635         /* end CRI */ 
     619#endif /* CRIHAN */ 
    636620        /* put aggregation cache information to tables */ 
    637         if (bool == 1){ 
    638           prefixKey.beginning = agCache.v4AdS>>(32-agCache.maskS)<<(32-agCache.maskS); 
    639           res = bsearch(&prefixKey, V4PTab, nbPV4,  
    640                         sizeof(struct PrefixV4), prefCmp); 
    641         } 
     621/*      if (bool == 1){ */ 
     622/*        prefixKey.beginning = agCache.v4AdS>>(32-agCache.maskS)<<(32-agCache.maskS); */ 
     623/*        res = bsearch(&prefixKey, V4PTab, nbPV4,  */ 
     624/*                      sizeof(struct PrefixV4), prefCmp); */ 
     625/*      } */ 
    642626        bool = 0;     
    643627        /* end put */