Changeset 86 for trunk/src/dataFlowSet.c
- Timestamp:
- 11/21/08 11:27:21 (14 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/dataFlowSet.c
r85 r86 299 299 } 300 300 } 301 if ((pftmp->fieldType==16)||(pftmp->fieldType==17)){ 302 if ((((RuleDefPtr)(*(myPtrs->rulesAddressPtr+pos)))->value->stor.svalue) 303 == ((unsigned short)*((unsigned long*)&buffer4))) 304 { 305 ((RuleDefPtr)(*(myPtrs->rulesAddressPtr+pos)))->check = 1; 306 } 307 } 301 308 if (pftmp->fieldType==1){ 302 309 agCache.bytes = *((unsigned long*)&buffer4); … … 331 338 if (pftmp->fieldType==2){ 332 339 agCache.pkts = *((unsigned long*)&buffer4); 340 } 341 #endif 342 #ifdef ASACC 343 if (pftmp->fieldType==16){ 344 agCache.asS = (unsigned short)*((unsigned long*)&buffer4); 345 } 346 if (pftmp->fieldType==17){ 347 agCache.asD = (unsigned short)*((unsigned long*)&buffer4); 333 348 } 334 349 #endif … … 573 588 } 574 589 #endif 590 #ifdef ASACC 591 if (pftmp->fieldType==16){ 592 agCache.asS = (unsigned short)*((unsigned long*)&buffer4); 593 } 594 if (pftmp->fieldType==17){ 595 agCache.asD = (unsigned short)*((unsigned long*)&buffer4); 596 } 597 #endif 575 598 break; 576 599 case 16: … … 611 634 asres = bsearch(&asKey, myPtrs->currentASTab, myPtrs->asNb, sizeof(struct AS), asGlobalCmp); 612 635 if (asres != NULL) { 613 if ( myPtrs->currentRouterPtr->snmpIndexList[agCache.inputSnmp] == 1 ) { 636 if ( myPtrs->currentRouterPtr->snmpIndexList[agCache.inputSnmp] == 1 ) { 637 #if defined(MULTISAMPLING) 638 if (myPtrs->currentRouterPtr->sampled != asres->sampling ){ 639 /* OUT ("traffic from the AS") */ 640 asres->bytesNbOUT += agCache.bytes*myPtrs->currentRouterPtr->sampled/asres->sampling; 641 asres->pktsNbOUT += agCache.pkts*myPtrs->currentRouterPtr->sampled/asres->sampling; 642 }else{ 643 asres->bytesNbOUT += agCache.bytes; 644 asres->pktsNbOUT += agCache.pkts; 645 (asres->flowNbOUT)++; 646 } 647 #else 614 648 if (myPtrs->currentRouterPtr->sampled != 0 ){ 615 649 /* OUT ("traffic from the AS") */ … … 622 656 asres->sampling = myPtrs->currentRouterPtr->sampled; 623 657 } 658 #endif 624 659 asres = NULL; 625 660 asKey.as = agCache.asD; 626 661 asres = bsearch(&asKey, myPtrs->currentASTab, myPtrs->asNb, sizeof(struct AS), asGlobalCmp); 627 662 if (asres!=NULL){ 663 #if defined(MULTISAMPLING) 664 if (myPtrs->currentRouterPtr->sampled != asres->sampling ){ 665 /* IN ("traffic to the AS") */ 666 asres->bytesNbIN += agCache.bytes*myPtrs->currentRouterPtr->sampled/asres->sampling; 667 asres->pktsNbIN += agCache.pkts*myPtrs->currentRouterPtr->sampled/asres->sampling; 668 }else{ 669 asres->bytesNbIN += agCache.bytes; 670 asres->pktsNbIN += agCache.pkts; 671 (asres->flowNbIN)++; 672 } 673 #else 628 674 if (myPtrs->currentRouterPtr->sampled != 0 ){ 629 675 /* IN ("traffic to the AS") */ … … 636 682 asres->sampling = myPtrs->currentRouterPtr->sampled; 637 683 } 684 #endif 638 685 asres = NULL; 639 686 } … … 645 692 if (asres!=NULL){ 646 693 if ( myPtrs->currentRouterPtr->snmpIndexList[agCache.inputSnmp] == 1 ) { 694 #if defined(MULTISAMPLING) 695 if (myPtrs->currentRouterPtr->sampled != asres->sampling ){ 696 /* IN ("traffic to the AS") */ 697 asres->bytesNbIN += agCache.bytes*myPtrs->currentRouterPtr->sampled/asres->sampling; 698 asres->pktsNbIN += agCache.pkts*myPtrs->currentRouterPtr->sampled/asres->sampling; 699 }else{ 700 asres->bytesNbIN += agCache.bytes; 701 asres->pktsNbIN += agCache.pkts; 702 (asres->flowNbIN)++; 703 } 704 #else 647 705 if (myPtrs->currentRouterPtr->sampled != 0 ){ 648 706 /* IN ("traffic to the AS") */ … … 655 713 asres->sampling = myPtrs->currentRouterPtr->sampled; 656 714 } 715 #endif 657 716 } 658 717 }