815 | | fprintf(stderr, " U, r: %lu.%lu.%lu.%lu, sourceId: %lu, TID: %hu", |
816 | | (myPtrs->pcktPtr->ipH->srcAdd>>24), |
817 | | (myPtrs->pcktPtr->ipH->srcAdd<<8>>24), |
818 | | (myPtrs->pcktPtr->ipH->srcAdd<<16>>24), |
819 | | (myPtrs->pcktPtr->ipH->srcAdd<<24>>24), |
820 | | myPtrs->currentHeaderV9Ptr->sourceId, |
821 | | (*myPtrs->currentFlowsetIdPtr) |
822 | | ); |
823 | | #endif |
| 820 | fprintf(stderr,"<d"); |
| 821 | #endif |
| 822 | if ((tmpOpt=existTplOptId(myPtrs->currentRouterPtr, myPtrs->currentHeaderV9Ptr->sourceId, |
| 823 | (*myPtrs->currentFlowsetIdPtr)))!=NULL) { |
| 824 | |
| 825 | for ( i=0; i<(tmpOpt->optionScopeLg/4); i++){ |
| 826 | /* FIXME : today we skip the scope fields, it's bad :( */ |
| 827 | if (pftmp=tmpOpt->lastField) { |
| 828 | for (j=0; j<pftmp->fieldLength; j++) { |
| 829 | (*myPtrs->offsetV9Ptr)++; |
| 830 | } |
| 831 | pftmp = pftmp->prev; |
| 832 | } |
| 833 | } |
| 834 | while (pftmp != NULL) { |
| 835 | if (pftmp->fieldLength==1){ |
| 836 | buffer1 = *(myPtrs->ptr_buffer+(*myPtrs->offsetV9Ptr)); (*myPtrs->offsetV9Ptr)++; |
| 837 | } |
| 838 | if (pftmp->fieldLength==2){ |
| 839 | buffer2[1]= *(myPtrs->ptr_buffer+(*myPtrs->offsetV9Ptr)); (*myPtrs->offsetV9Ptr)++; |
| 840 | buffer2[0]= *(myPtrs->ptr_buffer+(*myPtrs->offsetV9Ptr)); (*myPtrs->offsetV9Ptr)++; |
| 841 | } |
| 842 | if (pftmp->fieldLength==4){ |
| 843 | buffer4[3]= *(myPtrs->ptr_buffer+(*myPtrs->offsetV9Ptr)); (*myPtrs->offsetV9Ptr)++; |
| 844 | buffer4[2]= *(myPtrs->ptr_buffer+(*myPtrs->offsetV9Ptr)); (*myPtrs->offsetV9Ptr)++; |
| 845 | buffer4[1]= *(myPtrs->ptr_buffer+(*myPtrs->offsetV9Ptr)); (*myPtrs->offsetV9Ptr)++; |
| 846 | buffer4[0]= *(myPtrs->ptr_buffer+(*myPtrs->offsetV9Ptr)); (*myPtrs->offsetV9Ptr)++; |
| 847 | if (pftmp->fieldType==34){ |
| 848 | if (myPtrs->currentRouterPtr->sampled != *((unsigned long*)&buffer4) ) { |
| 849 | myPtrs->currentRouterPtr->sampled = *((unsigned long*)&buffer4); |
| 850 | for (i=0; i<nbPV4; i++) { |
| 851 | /* we update the PrefixV4 structure with the sampled information */ |
| 852 | if ( myPtrs->currentRouterPtr->IpAddress == myPtrs->routersID[V4PTab[i].routerNb]) { |
| 853 | V4PTab[i].sampling = *((unsigned long*)&buffer4); |
| 854 | myPtrs->secondV4Tab[i].sampling = *((unsigned long*)&buffer4); |
| 855 | #ifdef DEBUGAGG |
| 856 | fprintf(stderr," SV %lu ", *((unsigned long*)&buffer4)); |
| 857 | #endif |
| 858 | } |
| 859 | } |
| 860 | } |
| 861 | } |
| 862 | } |
| 863 | pftmp = pftmp->prev; |
| 864 | } |
| 865 | if ( pftmp == NULL ) { |
| 866 | while ((*myPtrs->offsetV9Ptr)%4 != 0) { |
| 867 | (*myPtrs->offsetV9Ptr)++; |
| 868 | } |
| 869 | } else { |
| 870 | fprintf(stderr,"PB "); |
| 871 | } |
| 872 | #ifdef DEBUG |
| 873 | fprintf(stderr,">"); |
| 874 | #endif |
| 875 | /* (*myPtrs->offsetV9Ptr)+=(data_length-4); */ |
| 876 | /* (*myPtrs->currentFlowsetNumberPtr) = myPtrs->currentHeaderV9Ptr->count; */ |
| 877 | } else { |
| 878 | /* |
| 879 | * template unknown, we skip this all the data |
| 880 | */ |
| 881 | (*myPtrs->offsetV9Ptr)+=(data_length-4); |
| 882 | (*myPtrs->currentFlowsetNumberPtr) = myPtrs->currentHeaderV9Ptr->count; |
| 883 | #ifdef DEBUG |
| 884 | fprintf(stderr, " U, r: %lu.%lu.%lu.%lu, sourceId: %lu, TID: %hu", |
| 885 | (myPtrs->pcktPtr->ipH->srcAdd>>24), |
| 886 | (myPtrs->pcktPtr->ipH->srcAdd<<8>>24), |
| 887 | (myPtrs->pcktPtr->ipH->srcAdd<<16>>24), |
| 888 | (myPtrs->pcktPtr->ipH->srcAdd<<24>>24), |
| 889 | myPtrs->currentHeaderV9Ptr->sourceId, |
| 890 | (*myPtrs->currentFlowsetIdPtr) |
| 891 | ); |
| 892 | #endif |
| 893 | } |