- Timestamp:
- 11/03/08 11:11:44 (14 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/template.c
r77 r78 85 85 if ( flowsetId > 1024 ) /* FIXME CONST */ 86 86 { 87 #ifdef DEBUG 87 88 fprintf(stderr,"\n IP: %lu.%lu.%lu.%lu, %d,%d\n", 88 89 cr->IpAddress>>24, … … 95 96 fprintf (stderr, "\n cTFSPtr->templateFlowSetId >1024: %hu\n", 96 97 cTFSPtr->templateFlowSetId); 98 #endif 97 99 while ( ((*offV9))> (index)){ 98 100 buffer2[1]= *(buf+index); index++; 99 101 buffer2[0]= *(buf+index); index++; 100 102 tmp = *((unsigned short*)&buffer2); 103 #ifdef DEBUG 101 104 fprintf (stderr, " %hu ", tmp); 105 #endif 102 106 } 103 107 syslog (LOG_INFO, … … 188 192 || badFieldLength == 1 189 193 || (badFieldCount == 1)) { 194 #ifdef DEBUG 190 195 fprintf(stderr,"\n IP: %lu.%lu.%lu.%lu, %d,%d\n", 191 196 cr->IpAddress>>24, … … 198 203 fprintf (stderr, "\n cTFSPtr->templateFlowSetId: %hu\n", 199 204 cTFSPtr->templateFlowSetId); 205 #endif 200 206 while ( ((*offV9))> (index)){ 201 207 buffer2[1]= *(buf+index); index++; 202 208 buffer2[0]= *(buf+index); index++; 203 209 tmp = *((unsigned short*)&buffer2); 210 #ifdef DEBUG 204 211 fprintf (stderr, " %hu ", tmp); 212 #endif 205 213 } 206 214 syslog (LOG_INFO, 207 215 "in new template: field nb gt 216, field lg gt 16 or too many fields, bad template definition possibility"); 208 fprintf(stderr,209 "\n in new template function: too many fields, bug collector or wrong template def \n");210 216 ptpltmp = cTFSPtr; 211 217 if (ptpltmp->prev == NULL) { … … 299 305 buffer2[0]= *(buf+index); index++; 300 306 tmp = *((unsigned short*)&buffer2); 307 #ifdef DEBUG 301 308 fprintf (stderr, " %hu ", tmp); 309 #endif 302 310 } 303 311 syslog (LOG_INFO, 304 312 "in update template function: too many fields, bug collector or wrong template def in template update"); 313 #ifdef DEBUG 305 314 fprintf(stderr, 306 315 "\nin update template function: too many fields, bug collector or wrong template def in template update\n"); 316 #endif 307 317 ptpltmp = cTFSPtr; 308 318 if (ptpltmp->prev == NULL) { … … 419 429 buffer2[0]= *(buf+(*offV9)); (*offV9)++; cpt++; 420 430 cTOPtr->optionLg = *((unsigned short*)&buffer2); 431 #ifdef DEBUG 421 432 fprintf (stderr, " otid %hu, %hu, %hu, ", cTOPtr->templateOptionId, cTOPtr->optionScopeLg, cTOPtr->optionLg); 433 #endif 422 434 cpt_fields = 0; 423 435 for ( i=0; i<(((cTOPtr->optionScopeLg)+(cTOPtr->optionLg))/4); i++) { … … 428 440 badFieldNumber = 1; 429 441 } 442 #ifdef DEBUG 430 443 fprintf (stderr, " %hu - ", tmp->fieldType); 444 #endif 431 445 buffer2[1]= *(buf+(*offV9)); (*offV9)++; cpt++; 432 446 buffer2[0]= *(buf+(*offV9)); (*offV9)++; cpt++; … … 434 448 badFieldLength = 1; 435 449 } 450 #ifdef DEBUG 436 451 fprintf (stderr, " %hu,", tmp->fieldLength); 452 #endif 437 453 tmp->next = cTOPtr->fieldSet; 438 454 tmp->prev = NULL; … … 447 463 || (badFieldNumber == 1) 448 464 || badFieldLength == 1) { 465 #ifdef DEBUG 449 466 fprintf(stderr,"\n IP: %lu.%lu.%lu.%lu\n", 450 467 cr->IpAddress>>24, … … 452 469 cr->IpAddress<<16>>24, 453 470 cr->IpAddress<<24>>24); 471 #endif 454 472 syslog (LOG_INFO, 455 473 "in option template function: too many fields, bug collector or wrong template def in template update"); … … 462 480 buffer2[0]= *(buf+index); index++; 463 481 tmp = *((unsigned short*)&buffer2); 482 #ifdef DEBUG 464 483 fprintf (stderr, " %hu ", tmp); 484 #endif 465 485 } 466 486 … … 484 504 while ((*offV9)%4 != 0) { 485 505 (*offV9)++; cpt++; 506 #ifdef DEBUG 486 507 fprintf(stderr,"p"); 508 #endif 487 509 } /*padding case*/ 488 510 } else { /*update */ … … 538 560 || (badFieldNumber == 1) 539 561 || badFieldLength == 1) { 562 #ifdef DEBUG 540 563 fprintf(stderr,"\n IP: %lu.%lu.%lu.%lu\n", 541 564 cr->IpAddress>>24, … … 543 566 cr->IpAddress<<16>>24, 544 567 cr->IpAddress<<24>>24); 568 #endif 545 569 syslog (LOG_INFO, 546 570 "in update option tpl function: too many fields, bug collector or wrong template def in template update"); … … 568 592 while ((*offV9)%4 != 0) { 569 593 (*offV9)++; cpt++; 594 #ifdef DEBUG 570 595 fprintf(stderr,"p"); 596 #endif 571 597 } /*padding case*/ 572 598 }