- Timestamp:
- 04/25/07 17:05:21 (16 years ago)
- Location:
- trunk/src
- Files:
-
- 4 modified
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/dataFlowSet.c
r32 r34 109 109 #ifdef DEBUG 110 110 fprintf(stderr,"{d id: %hu, lg %hu", (*myPtrs->currentFlowsetIdPtr), data_length); 111 if ( (*myPtrs->currentFlowsetIdPtr) > 270) {111 if ( (*myPtrs->currentFlowsetIdPtr) > TRESHOLD_TEMPLATE_ID ) { 112 112 /* fprintf(stderr,"Bad TID from router: %lu.%lu.%lu.%lu\n", */ 113 113 /* (*myPtrs->currentFlowsetIdPtr), */ … … 893 893 buffer4[0]= *(myPtrs->ptr_buffer+(*myPtrs->offsetV9Ptr)); (*myPtrs->offsetV9Ptr)++; 894 894 if (pftmp->fieldType==34){ 895 if (myPtrs->currentRouterPtr->sampled != *((unsigned long*)&buffer4) ) { 895 if ((*((unsigned long*)&buffer4)==1) 896 || (*((unsigned long*)&buffer4)==10) 897 || (*((unsigned long*)&buffer4)==1000)) { 898 if (myPtrs->currentRouterPtr->sampled != *((unsigned long*)&buffer4) ) { 896 899 #ifdef DEBUGAGG 897 fprintf(stderr,"SV (p) %lu != %lu (r)\n", *((unsigned long*)&buffer4),898 900 fprintf(stderr,"\n SV (p) %lu != %lu (r)", *((unsigned long*)&buffer4), 901 myPtrs->currentRouterPtr->sampled); 899 902 #endif 900 myPtrs->currentRouterPtr->sampled = *((unsigned long*)&buffer4); 901 for (i=0; i<nbPV4; i++) { 902 /* we update the PrefixV4 structure with the sampled information */ 903 if ( myPtrs->currentRouterPtr->IpAddress == myPtrs->routersID[V4PTab[i].routerNb]) { 904 V4PTab[i].sampling = *((unsigned long*)&buffer4); 905 myPtrs->secondV4Tab[i].sampling = *((unsigned long*)&buffer4); 903 myPtrs->currentRouterPtr->sampled = *((unsigned long*)&buffer4); 904 for (i=0; i<nbPV4; i++) { 905 /* we update the PrefixV4 structure with the sampled information */ 906 if ( myPtrs->currentRouterPtr->IpAddress == myPtrs->routersID[V4PTab[i].routerNb]) { 907 V4PTab[i].sampling = *((unsigned long*)&buffer4); 908 myPtrs->secondV4Tab[i].sampling = *((unsigned long*)&buffer4); 909 } 906 910 } 907 911 } -
trunk/src/dataFlowSet.h
r31 r34 33 33 #include "get_conf.h" 34 34 #include "prefix_mgmt.h" 35 36 #define TRESHOLD_TEMPLATE_ID 300 35 37 36 38 struct IPFLowCache { -
trunk/src/get_conf.c
r29 r34 58 58 int nbR = 0; 59 59 char tindex[5]; 60 char tname[ 20];61 char tad[1 5];62 char tad2[1 5];60 char tname[40]; 61 char tad[16]; 62 char tad2[16]; 63 63 int ind=0; 64 64 unsigned short n0, n1, n2, n3; -
trunk/src/template.c
r30 r34 149 149 || badFieldLength == 1 150 150 || (badFieldCount == 1)) { 151 fprintf(stderr,"\n IP: %lu.%lu.%lu.%lu, %d,%d\n", 152 cr->IpAddress>>24, 153 cr->IpAddress<<8>>24, 154 cr->IpAddress<<16>>24, 155 cr->IpAddress<<24>>24, 156 badFieldNumber, 157 badFieldLength 158 ); 159 fprintf (stderr, "\n cTFSPtr->templateFlowSetId: %hu\n", 160 cTFSPtr->templateFlowSetId); 151 /* fprintf(stderr,"\n IP: %lu.%lu.%lu.%lu, %d,%d\n", */ 152 /* cr->IpAddress>>24, */ 153 /* cr->IpAddress<<8>>24, */ 154 /* cr->IpAddress<<16>>24, */ 155 /* cr->IpAddress<<24>>24, */ 156 /* badFieldNumber, */ 157 /* badFieldLength */ 158 /* ); */ 159 /* fprintf (stderr, "\n cTFSPtr->templateFlowSetId: %hu\n", */ 160 /* cTFSPtr->templateFlowSetId); */ 161 161 while ( ((*offV9))> (index)){ 162 162 buffer2[1]= *(buf+index); index++; 163 163 buffer2[0]= *(buf+index); index++; 164 164 tmp = *((unsigned short*)&buffer2); 165 fprintf (stderr, " %hu ", tmp); 165 /* fprintf (stderr, " %hu ", tmp); */ 166 166 } 167 167 syslog (LOG_INFO, 168 168 "in new template: field nb gt 89, field lg gt 16 or too many fields, bad template definition possibility"); 169 fprintf(stderr, 170 "\n in new template function: too many fields, bug collector or wrong template def \n"); 169 /* fprintf(stderr, */ 170 /* "\n in new template function: too many fields, bug collector or wrong template def \n"); */ 171 171 ptpltmp = cTFSPtr; 172 172 if (ptpltmp->prev == NULL) { … … 260 260 buffer2[0]= *(buf+index); index++; 261 261 tmp = *((unsigned short*)&buffer2); 262 fprintf (stderr, " %hu ", tmp); 262 /* fprintf (stderr, " %hu ", tmp); */ 263 263 } 264 264 syslog (LOG_INFO, 265 265 "in update template function: too many fields, bug collector or wrong template def in template update"); 266 fprintf(stderr, 267 "\nin update template function: too many fields, bug collector or wrong template def in template update\n"); 266 /* fprintf(stderr, */ 267 /* "\nin update template function: too many fields, bug collector or wrong template def in template update\n"); */ 268 268 ptpltmp = cTFSPtr; 269 269 if (ptpltmp->prev == NULL) {