Changeset 20 for trunk/src/dataFlowSet.c
- Timestamp:
- 11/22/06 14:04:22 (16 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/dataFlowSet.c
r19 r20 65 65 struct PrefixV4 prefixKey, *res; /* for bsearch */ 66 66 struct AggCache agCache; 67 #ifdef CRIHAN 67 68 struct IPFLowCache ipFirstCache; /* CRI */ 68 69 struct MPLSFlowCache mplsFirstCache; /* CRI */ 69 70 unsigned long firstTime = 0; /* CRI */ 70 71 unsigned long lastTime = 0; /* CRI */ 72 #endif /* CRIHAN */ 71 73 int bool = 0; 72 74 73 /* CRI */ 75 #ifdef CRIHAN 74 76 ipFirstCache.ipProt = 0; 75 77 ipFirstCache.bytes = 0; … … 89 91 mplsFirstCache.v4AdS = 0; 90 92 mplsFirstCache.v4AdD = 0; 91 mplsFirstCache.outSnmp = 0;92 mplsFirstCache.inSnmp = 0;93 93 mplsFirstCache.routerAd = 0; 94 94 mplsFirstCache.mplsLabel1 = 0; 95 96 /* CRI */ 95 #endif /* CRIHAN */ 97 96 98 97 buffer2[1] = *(buf+(*offV9));(*offV9)++; … … 122 121 /* end aggreg */ 123 122 124 /* CRI */ 123 #ifdef CRIHAN 125 124 ipFirstCache.routerAd = pcktPtr->ipH->srcAdd; 126 125 mplsFirstCache.routerAd = pcktPtr->ipH->srcAdd; 127 /* end CRI*/126 #endif /* CRIHAN */ 128 127 129 128 pftmp = tmp->lastField; … … 185 184 /* } */ 186 185 /* end aggregation */ 187 /* CRI */ 186 #ifdef CRIHAN 188 187 if ((pftmp->fieldType==9)||(pftmp->fieldType==29)){ 189 188 ipFirstCache.maskS = *((unsigned char*)&buffer1); … … 199 198 ipFirstCache.tProt = *((unsigned char*)&buffer1); 200 199 } 201 /* if (pftmp->fieldType==46){ */ 202 /* mplsFirstCache.topLabelType = *((unsigned char*)&buffer1); */ 203 /* } */ 204 /* end CRI */ 200 #endif /* CRIHAN */ 205 201 break; 206 202 case 2: … … 215 211 /* } */ 216 212 /* end aggregation */ 217 /* CRI */ 213 #ifdef CRIHAN 218 214 if (pftmp->fieldType==10){ 219 215 ipFirstCache.inSnmp = *((unsigned short*)&buffer2); 220 mplsFirstCache.inSnmp = *((unsigned short*)&buffer2);221 216 } 222 217 if (pftmp->fieldType==14){ 223 218 ipFirstCache.outSnmp = *((unsigned short*)&buffer2); 224 mplsFirstCache.outSnmp = *((unsigned short*)&buffer2);225 219 } 226 220 if (pftmp->fieldType==7){ … … 230 224 ipFirstCache.dPort = *((unsigned short*)&buffer2); 231 225 } 232 /* end CRI*/226 #endif /* CRIHAN */ 233 227 break; 234 228 case 3: … … 242 236 /* aggregation */ 243 237 /* end aggregation */ 244 /* CRI */ 238 #ifdef CRIHAN 245 239 if (pftmp->fieldType==70){ 246 240 mplsFirstCache.mplsLabel1 = (*((unsigned long*)&buffer4))>>4; 247 241 } 248 /* end CRI*/242 #endif /* CRIHAN */ 249 243 break; 250 244 case 4: … … 275 269 /* } */ 276 270 /* end aggregation */ 277 /* CRI */ 271 #ifdef CRIHAN 278 272 if (pftmp->fieldType==8){ 279 273 ipFirstCache.v4AdS = *((unsigned long*)&buffer4); … … 296 290 lastTime = *((unsigned long*)&buffer4); 297 291 } 298 /* end CRI*/292 #endif /* CRIHAN */ 299 293 break; 300 294 case 16: … … 468 462 /* } */ 469 463 /* end aggregation */ 470 /* CRI */ 464 #ifdef CRIHAN 471 465 if ((pftmp->fieldType==9)||(pftmp->fieldType==29)){ 472 466 ipFirstCache.maskS = *((unsigned char*)&buffer1); … … 482 476 ipFirstCache.tProt = *((unsigned char*)&buffer1); 483 477 } 484 /* if (pftmp->fieldType==46){ */ 485 /* mplsFirstCache.topLabelType = *((unsigned char*)&buffer1); */ 486 /* } */ 478 #endif /* CRIHAN */ 487 479 break; 488 480 case 2: … … 494 486 } 495 487 /* end aggregation */ 496 /* CRI */ 488 #ifdef CRIHAN 497 489 if (pftmp->fieldType==10){ 498 490 ipFirstCache.inSnmp = *((unsigned short*)&buffer2); 499 mplsFirstCache.inSnmp = *((unsigned short*)&buffer2);500 491 } 501 492 if (pftmp->fieldType==14){ 502 493 ipFirstCache.outSnmp = *((unsigned short*)&buffer2); 503 mplsFirstCache.outSnmp = *((unsigned short*)&buffer2);504 494 } 505 495 if (pftmp->fieldType==7){ … … 509 499 ipFirstCache.dPort = *((unsigned short*)&buffer2); 510 500 } 511 /* end CRI */ 501 #endif /* CRIHAN */ 512 502 break; 513 503 case 3: … … 518 508 /* aggregation */ 519 509 /* end aggregation */ 520 /* CRI */ 510 #ifdef CRIHAN 521 511 if (pftmp->fieldType==70){ 522 512 mplsFirstCache.mplsLabel1 = (*((unsigned long*)&buffer4))>>4; 523 513 } 524 /* end CRI*/514 #endif /* CRIHAN */ 525 515 break; 526 516 case 4: … … 541 531 /* } */ 542 532 /* end aggregation */ 543 /* CRI */ 533 #ifdef CRIHAN 544 534 if (pftmp->fieldType==8){ 545 535 ipFirstCache.v4AdS = *((unsigned long*)&buffer4); … … 562 552 lastTime = *((unsigned long*)&buffer4); 563 553 } 564 /* end CRI*/554 #endif /* CRIHAN */ 565 555 break; 566 556 case 16: … … 585 575 * end of one flow (not the flowset) 586 576 */ 587 /* CRI */ 577 #ifdef CRIHAN 588 578 if ( mplsFirstCache.mplsLabel1 == 0 ) { 589 579 (ipCache+(*ipCounter))->ipProt = ipFirstCache.ipProt; … … 618 608 (mplsCache+(*mplsCounter))->ipProt = mplsFirstCache.ipProt; 619 609 mplsFirstCache.ipProt = 0; 620 /* (mplsCache+(*mplsCounter))->topLabelType = mplsFirstCache.topLabelType; */621 /* mplsFirstCache.topLabelType = 0; */622 610 (mplsCache+(*mplsCounter))->v4AdS = mplsFirstCache.v4AdS; 623 611 mplsFirstCache.v4AdS = 0; 624 612 (mplsCache+(*mplsCounter))->v4AdD = mplsFirstCache.v4AdD; 625 613 mplsFirstCache.v4AdD = 0; 626 (mplsCache+(*mplsCounter))->inSnmp = mplsFirstCache.inSnmp;627 mplsFirstCache.inSnmp = 0;628 (mplsCache+(*mplsCounter))->outSnmp = mplsFirstCache.outSnmp;629 mplsFirstCache.outSnmp = 0;630 614 (mplsCache+(*mplsCounter))->routerAd = mplsFirstCache.routerAd; 631 615 (mplsCache+(*mplsCounter))->mplsLabel1 = mplsFirstCache.mplsLabel1; … … 633 617 (*mplsCounter)++; 634 618 } 635 /* end CRI*/619 #endif /* CRIHAN */ 636 620 /* 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 /* } */ 642 626 bool = 0; 643 627 /* end put */