Changeset 111 for trunk/src/dataFlowSet.c
- Timestamp:
- 06/17/09 14:44:04 (14 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/dataFlowSet.c
r97 r111 81 81 int paddingCounter = 0; 82 82 int crazyCounter = 0; 83 #ifdef DEBUG 84 int flowCpt = 0; 85 #endif 83 86 84 87 buffer2[1] = *(myPtrs->ptr_buffer+(*myPtrs->offsetV9Ptr)); … … 93 96 data_length = *((unsigned short*)&buffer2); 94 97 if (data_length == 0) { 95 syslog(LOG_INFO, "data flowset length null; all next informations of this data flowset are not considered! flowset ID: %hu, from router: %lu.%lu.%lu.%lu", 96 (*myPtrs->currentFlowsetIdPtr), 97 (myPtrs->pcktPtr->ipH->srcAdd>>24), 98 (myPtrs->pcktPtr->ipH->srcAdd<<8>>24), 99 (myPtrs->pcktPtr->ipH->srcAdd<<16>>24), 100 (myPtrs->pcktPtr->ipH->srcAdd<<24>>24)); 98 #ifdef DEBUG 99 fprintf (stderr, " dlg==0 <--| "); 100 #endif 101 /* syslog(LOG_INFO, "data flowset length null; all next informations of this data flowset are not considered! flowset ID: %hu, from router: %lu.%lu.%lu.%lu", */ 102 /* (*myPtrs->currentFlowsetIdPtr), */ 103 /* (myPtrs->pcktPtr->ipH->srcAdd>>24), */ 104 /* (myPtrs->pcktPtr->ipH->srcAdd<<8>>24), */ 105 /* (myPtrs->pcktPtr->ipH->srcAdd<<16>>24), */ 106 /* (myPtrs->pcktPtr->ipH->srcAdd<<24>>24)); */ 101 107 return (-1); 102 108 … … 112 118 data_length); 113 119 if ( (*myPtrs->currentFlowsetIdPtr) > TRESHOLD_TEMPLATE_ID ) { 114 /* fprintf(stderr,"Bad TID from router: %lu.%lu.%lu.%lu\n", */115 /* (*myPtrs->currentFlowsetIdPtr), */116 /* (myPtrs->pcktPtr->ipH->srcAdd>>24), */117 /* (myPtrs->pcktPtr->ipH->srcAdd<<8>>24), */118 /* (myPtrs->pcktPtr->ipH->srcAdd<<16>>24), */119 /* (myPtrs->pcktPtr->ipH->srcAdd<<24>>24)); */120 /* fprintf(stderr," Bytes : \n"); */121 /* while ( ( myPtrs->ptr_buffer+(*myPtrs->offsetV9Ptr) ) > (myPtrs->ptr_buffer+1416) ){ */122 /* buffer1= *(myPtrs->ptr_buffer+(*myPtrs->offsetV9Ptr));(*myPtrs->offsetV9Ptr)++; */123 /* tmp = *((unsigned char*)&buffer1); */124 /* fprintf (stderr, " %s ", tmp); */125 /* } */126 /* exit(-1); */120 fprintf(stderr,"Bad TID from router: %lu.%lu.%lu.%lu\n", 121 (*myPtrs->currentFlowsetIdPtr), 122 (myPtrs->pcktPtr->ipH->srcAdd>>24), 123 (myPtrs->pcktPtr->ipH->srcAdd<<8>>24), 124 (myPtrs->pcktPtr->ipH->srcAdd<<16>>24), 125 (myPtrs->pcktPtr->ipH->srcAdd<<24>>24)); 126 fprintf(stderr," Bytes : \n"); 127 while ( ( myPtrs->ptr_buffer+(*myPtrs->offsetV9Ptr) ) > (myPtrs->ptr_buffer+1416) ){ 128 buffer1= *(myPtrs->ptr_buffer+(*myPtrs->offsetV9Ptr));(*myPtrs->offsetV9Ptr)++; 129 tmp = *((unsigned char*)&buffer1); 130 fprintf (stderr, " %s ", tmp); 131 } 132 exit(-1); 127 133 return (data_length+shift); 128 134 } … … 134 140 if ( data_length%flow_size >= 9 ) { 135 141 (*myPtrs->currentFlowsetNumberPtr) = myPtrs->currentHeaderV9Ptr->count; 136 syslog(LOG_INFO, "data flowset length not match with length from template definition, wrong template definition suspected; all next informations of this data flowset are not considered! flowset ID: %hu, from router: %lu.%lu.%lu.%lu", 142 syslog(LOG_INFO, "data flowset length not match with length from template definition, wrong template definition suspected; all next informations of this data flowset are not considered! sourceID: %lu flowset ID: %hu, from router: %lu.%lu.%lu.%lu", 143 myPtrs->currentHeaderV9Ptr->sourceId, 137 144 (*myPtrs->currentFlowsetIdPtr), 138 145 (myPtrs->pcktPtr->ipH->srcAdd>>24), … … 140 147 (myPtrs->pcktPtr->ipH->srcAdd<<16>>24), 141 148 (myPtrs->pcktPtr->ipH->srcAdd<<24>>24)); 149 #ifdef DEBUG 150 fprintf (stderr, " dlg%flsz >=9 skip data "); 151 #endif 142 152 return (data_length+shift); 143 153 } … … 149 159 (myPtrs->pcktPtr->ipH->srcAdd<<16>>24), 150 160 (myPtrs->pcktPtr->ipH->srcAdd<<24>>24)); 161 #ifdef DEBUG 162 fprintf (stderr, " dlg >= 1452 skip pckt "); 163 #endif 151 164 return (-1); 152 165 } … … 641 654 * end of one flow (not the flowset) 642 655 */ 643 656 #ifdef DEBUG 657 flowCpt++; 658 fprintf(stderr," F%d ", flowCpt); 659 #endif 644 660 /* put aggregation cache information to IPv4 Prefixes table */ 645 661 /* Aggregation mode must be enable in ./configure options */ … … 1212 1228 /* not the flow end, progress in field list */ 1213 1229 pftmp = pftmp->prev; 1214 } 1230 } 1215 1231 } /* end of the while on one flow record */ 1216 1232 1217 1233 while ( ((*myPtrs->offsetV9Ptr)-48-shift) < data_length ) { 1218 1234 (*myPtrs->offsetV9Ptr)++; /* if padding */ 1219 1235 paddingCounter++; 1236 #ifdef DEBUG 1237 fprintf(stderr,", pC: %d ", paddingCounter); 1220 1238 if ( paddingCounter > 8 ) { 1221 #ifdef DEBUG1222 fprintf(stderr," padding too high: %d ", paddingCounter);1223 #endif1224 1239 syslog(LOG_INFO,"padding too high: %d ", paddingCounter); 1240 fprintf(stderr,", pC: %d <--| ", paddingCounter); 1225 1241 return (-1); 1242 #endif 1226 1243 } 1244 return (-1); 1227 1245 } 1228 1246 while ( (*myPtrs->offsetV9Ptr)-48-shift > data_length ) { … … 1232 1250 #ifdef DEBUG 1233 1251 if (crazyCounter != 0){ fprintf(stderr," crazyCounter: %d ", crazyCounter); } 1234 #endif1235 1252 if (crazyCounter!=0) { syslog(LOG_INFO,"crazyCounter: %d ", crazyCounter);} 1236 1237 #ifdef DEBUG 1238 fprintf(stderr,"}"); 1253 fprintf(stderr,"(%hu,%hu)}", data_length, data_length+shift); 1239 1254 #endif 1240 1255 … … 1326 1341 } else { 1327 1342 /* 1328 * template unknown, we skip th is all the data1343 * template unknown, we skip the data 1329 1344 */ 1330 1345 (*myPtrs->offsetV9Ptr)+=(data_length-4); 1331 (*myPtrs->currentFlowsetNumberPtr) = myPtrs->currentHeaderV9Ptr->count; 1346 (*myPtrs->currentFlowsetNumberPtr)+= 1 ; 1347 /* (*myPtrs->currentFlowsetNumberPtr) = myPtrs->currentHeaderV9Ptr->count;*/ 1332 1348 #ifdef DEBUG 1333 fprintf(stderr, " U, r: %lu.%lu.%lu.%lu, sourceId: %lu, TID: %hu ",1349 fprintf(stderr, " U, r: %lu.%lu.%lu.%lu, sourceId: %lu, TID: %hu ", 1334 1350 (myPtrs->pcktPtr->ipH->srcAdd>>24), 1335 1351 (myPtrs->pcktPtr->ipH->srcAdd<<8>>24), … … 1339 1355 (*myPtrs->currentFlowsetIdPtr) 1340 1356 ); 1357 fprintf(stderr,"(%hu,%hu) ", data_length, data_length+shift); 1341 1358 #endif 1342 1359 return (data_length+shift);