(/home/sate/Testcases/c/cve/wireshark-1.2.0/wiretap/netxray.c) |
| |
| 330 | | | int netxray_open(wtap *wth, int *err, gchar **err_info) |
| 331 | | | { |
| 332 | | | int bytes_read; |
| 333 | | | char magic[sizeof netxray_magic]; |
| 334 | | | gboolean is_old; |
| 335 | | | struct netxray_hdr hdr; |
| 336 | | | guint network_type; |
| 337 | | | double ticks_per_sec; |
| 338 | | | int version_major, version_minor; |
| 339 | | | int file_type; |
| 340 | | | double start_timestamp; |
| 341 355 |  | | [ Lines 341 to 355 omitted. ] |
| 356 | | | WTAP_ENCAP_UNKNOWN, |
| 357 | | | WTAP_ENCAP_UNKNOWN, |
| 358 | | | WTAP_ENCAP_UNKNOWN, |
| 359 | | | WTAP_ENCAP_ATM_PDUS_UNTRUNCATED, |
| 360 | | | WTAP_ENCAP_IEEE_802_11_WITH_RADIO, |
| 361 | | | |
| 362 | | | WTAP_ENCAP_UNKNOWN |
| 363 | | | }; |
| 364 | | | #define NUM_NETXRAY_ENCAPS (sizeof netxray_encap / sizeof netxray_encap[0]) |
| 365 | | | int file_encap; |
| 366 | | | guint isdn_type = 0; |
| 367 | | | |
| 368 | | | |
| 369 | | | |
| 370 | | | errno = WTAP_ERR_CANT_READ; |
| 371 | | | bytes_read = file_read(magic, 1, sizeof magic, wth->fh);
x /home/sate/Testcases/c/cve/wireshark-1.2.0/wiretap/file_wrappers.h |
| |
36 | #define file_read(buf, bsize, count, file) gzread((file),(buf),(unsigned)((count)*(bsize))) |
| |
|
| 372 | | | if (bytes_read != sizeof magic) { |
| 373 | | | *err = file_error(wth->fh); |
| 374 | | | if (*err != 0) |
| 375 | | | return -1; |
| 376 | | | return 0; |
| 377 | | | } |
| 378 | | | wth->data_offset += sizeof magic; |
| 379 | | | |
| 380 | | | if (memcmp(magic, netxray_magic, sizeof magic) == 0) { |
| 381 | | | is_old = FALSE; |
| 382 | | | } else if (memcmp(magic, old_netxray_magic, sizeof magic) == 0) { |
| 383 | | | is_old = TRUE; |
| 384 | | | } else { |
| 385 | | | return 0; |
| 386 | | | } |
| 387 | | | |
| 388 | | | |
| 389 | | | errno = WTAP_ERR_CANT_READ; |
Useless Assignment
This code assigns the variable the same value it already had. |
|
| 390 | | | bytes_read = file_read(&hdr, 1, sizeof hdr, wth->fh);
x /home/sate/Testcases/c/cve/wireshark-1.2.0/wiretap/file_wrappers.h |
| |
36 | #define file_read(buf, bsize, count, file) gzread((file),(buf),(unsigned)((count)*(bsize))) |
| |
|
| 391 | | | if (bytes_read != sizeof hdr) { |
| 392 | | | *err = file_error(wth->fh); |
| 393 | | | if (*err != 0) |
| 394 | | | return -1; |
| 395 | | | return 0; |
| 396 | | | } |
| 397 | | | wth->data_offset += sizeof hdr; |
| 398 | | | |
| 399 | | | if (is_old) { |
| 400 | | | version_major = 0; |
| 401 | | | version_minor = 0; |
| 402 | | | file_type = WTAP_FILE_NETXRAY_OLD; |
| 403 | | | } else { |
| 404 | | | |
| 405 | | | |
| 406 | | | |
| 407 | | | |
| 408 | | | |
| 409 | | | |
| 410 | | | |
| 411 | | | if (memcmp(hdr.version, vers_1_0, sizeof vers_1_0) == 0) { |
| 412 | | | version_major = 1; |
| 413 | | | version_minor = 0; |
| 414 | | | file_type = WTAP_FILE_NETXRAY_1_0; |
| 415 | | | } else if (memcmp(hdr.version, vers_1_1, sizeof vers_1_1) == 0) { |
| 416 | | | version_major = 1; |
| 417 | | | version_minor = 1; |
| 418 | | | file_type = WTAP_FILE_NETXRAY_1_1; |
| 419 | | | } else if (memcmp(hdr.version, vers_2_000, sizeof vers_2_000) == 0) { |
| 420 | | | version_major = 2; |
| 421 | | | version_minor = 0; |
| 422 | | | file_type = WTAP_FILE_NETXRAY_2_00x; |
| 423 | | | } else if (memcmp(hdr.version, vers_2_001, sizeof vers_2_001) == 0) { |
| 424 | | | version_major = 2; |
| 425 | | | version_minor = 1; |
| 426 | | | file_type = WTAP_FILE_NETXRAY_2_00x; |
| 427 | | | } else if (memcmp(hdr.version, vers_2_002, sizeof vers_2_002) == 0) { |
| 428 | | | version_major = 2; |
| 429 | | | version_minor = 2; |
| 430 | | | file_type = WTAP_FILE_NETXRAY_2_00x; |
| 431 | | | } else if (memcmp(hdr.version, vers_2_003, sizeof vers_2_003) == 0) { |
| 432 | | | version_major = 2; |
| 433 | | | version_minor = 3; |
| 434 | | | file_type = WTAP_FILE_NETXRAY_2_00x; |
| 435 | | | } else { |
| 436 | | | *err = WTAP_ERR_UNSUPPORTED; |
| 437 | | | *err_info = g_strdup_printf("netxray: version \"%.8s\" unsupported", hdr.version); |
| 438 | | | return -1; |
| 439 | | | } |
| 440 | | | } |
| 441 | | | |
| 442 | | | switch (hdr.network_plus) { |
| 443 | | | |
| 444 | | | case 0: |
| 445 | | | |
| 446 | | | |
| 447 | | | |
| 448 | | | |
| 449 | | | network_type = hdr.network + 1; |
| 450 | | | break; |
| 451 | | | |
| 452 | | | case 2: |
| 453 | | | |
| 454 | | | |
| 455 | | | |
| 456 | | | |
| 457 | | | |
| 458 | | | |
| 459 | | | |
| 460 | | | network_type = hdr.network; |
| 461 | | | break; |
| 462 | | | |
| 463 | | | default: |
| 464 | | | *err = WTAP_ERR_UNSUPPORTED; |
| 465 | | | *err_info = g_strdup_printf("netxray: the byte after the network type has the value %u, which I don't understand", |
| 466 | | | hdr.network_plus); |
| 467 | | | return -1; |
| 468 | | | } |
| 469 | | | |
| 470 | | | if (network_type >= NUM_NETXRAY_ENCAPS
x /home/sate/Testcases/c/cve/wireshark-1.2.0/wiretap/netxray.c |
| |
364 | #define NUM_NETXRAY_ENCAPS (sizeof netxray_encap / sizeof netxray_encap[0]) |
| |
|
| 471 | | | || netxray_encap[network_type] == WTAP_ENCAP_UNKNOWN) { |
| 472 | | | *err = WTAP_ERR_UNSUPPORTED_ENCAP; |
| 473 | | | *err_info = g_strdup_printf("netxray: network type %u (%u) unknown or unsupported", |
| 474 | | | network_type, hdr.network_plus); |
| 475 | | | return -1; |
| 476 | | | } |
| 477 | | | |
| 478 | | | |
| 479 | | | |
| 480 | | | |
| 481 | | | start_timestamp = (double)pletohl(&hdr.timelo)
x /home/sate/Testcases/c/cve/wireshark-1.2.0/wiretap/wtap-int.h |
| |
386 | #define pletohl(p) ((guint32)*((const guint8 *)(p)+3)<<24| \ |
387 | (guint32)*((const guint8 *)(p)+2)<<16| \ |
388 | (guint32)*((const guint8 *)(p)+1)<<8| \ |
389 | (guint32)*((const guint8 *)(p)+0)<<0) |
| |
|
| 482 | | | + (double)pletohl(&hdr.timehi)*4294967296.0;
x /home/sate/Testcases/c/cve/wireshark-1.2.0/wiretap/wtap-int.h |
| |
386 | #define pletohl(p) ((guint32)*((const guint8 *)(p)+3)<<24| \ |
387 | (guint32)*((const guint8 *)(p)+2)<<16| \ |
388 | (guint32)*((const guint8 *)(p)+1)<<8| \ |
389 | (guint32)*((const guint8 *)(p)+0)<<0) |
| |
|
| 483 | | | switch (file_type) { |
| 484 | | | |
| 485 | | | case WTAP_FILE_NETXRAY_OLD: |
| 486 | | | ticks_per_sec = 1000.0; |
| 487 | | | wth->tsprecision = WTAP_FILE_TSPREC_MSEC; |
| 488 | | | break; |
| 489 | | | |
| 490 | | | case WTAP_FILE_NETXRAY_1_0: |
| 491 | | | ticks_per_sec = 1000.0; |
| 492 | | | wth->tsprecision = WTAP_FILE_TSPREC_MSEC; |
| 493 | | | break; |
| 494 | | | |
| 495 | | | case WTAP_FILE_NETXRAY_1_1: |
| 496 | | | |
| 497 | | | |
| 498 | | | |
| 499 | | | |
| 500 | | | |
| 501 | | | |
| 502 | | | ticks_per_sec = 1000000.0; |
| 503 | | | wth->tsprecision = WTAP_FILE_TSPREC_USEC; |
| 504 | | | break; |
| 505 | | | |
| 506 | | | case WTAP_FILE_NETXRAY_2_00x: |
| 507 | | | |
| 508 | | | |
| 509 | | | |
| 510 | | | |
| 511 | | | switch (network_type) { |
| 512 | | | |
| 513 | | | case 1: |
| 514 | | | |
| 515 | | | |
| 516 | | | |
| 517 | | | |
| 518 | | | switch (hdr.captype) { |
| 519 | | | |
| 520 | | | case CAPTYPE_NDIS:
x /home/sate/Testcases/c/cve/wireshark-1.2.0/wiretap/netxray.c |
| |
109 | #define CAPTYPE_NDIS 0 /* Capture on network interface using NDIS */ |
| |
|
| 521 | | | if (hdr.timeunit >= NUM_NETXRAY_TIMEUNITS) { |
| 522 | | | *err = WTAP_ERR_UNSUPPORTED; |
| 523 | | | *err_info = g_strdup_printf( |
| 524 | | | "netxray: Unknown timeunit %u for Ethernet/CAPTYPE_NDIS version %.8s capture", |
| 525 | | | hdr.timeunit, hdr.version); |
| 526 | | | return -1; |
| 527 | | | } |
| 528 | | | |
| 529 | | | |
| 530 | | | |
| 531 | | | |
| 532 | | | |
| 533 | | | |
| 534 | | | |
| 535 | | | if (hdr.timeunit == 2) { |
| 536 | | | ticks_per_sec = pletohl(hdr.realtick);
x /home/sate/Testcases/c/cve/wireshark-1.2.0/wiretap/wtap-int.h |
| |
386 | #define pletohl(p) ((guint32)*((const guint8 *)(p)+3)<<24| \ |
387 | (guint32)*((const guint8 *)(p)+2)<<16| \ |
388 | (guint32)*((const guint8 *)(p)+1)<<8| \ |
389 | (guint32)*((const guint8 *)(p)+0)<<0) |
| |
|
| 537 | | | } |
| 538 | | | else { |
| 539 | | | ticks_per_sec = TpS[hdr.timeunit]; |
| 540 | | | } |
| 541 | | | break; |
| 542 | | | |
| 543 | | | case ETH_CAPTYPE_GIGPOD:
x /home/sate/Testcases/c/cve/wireshark-1.2.0/wiretap/netxray.c |
| |
114 | #define ETH_CAPTYPE_GIGPOD 2 /* gigabit Ethernet captured with pod */ |
| |
|
| 544 | | | if (hdr.timeunit >= NUM_NETXRAY_TIMEUNITS_GIGPOD
x /home/sate/Testcases/c/cve/wireshark-1.2.0/wiretap/netxray.c |
| |
223 | #define NUM_NETXRAY_TIMEUNITS_GIGPOD (sizeof TpS_gigpod / sizeof TpS_gigpod[0]) |
| |
|
| 545 | | | || TpS_gigpod[hdr.timeunit] == 0.0) { |
| 546 | | | *err = WTAP_ERR_UNSUPPORTED; |
| 547 | | | *err_info = g_strdup_printf( |
| 548 | | | "netxray: Unknown timeunit %u for Ethernet/ETH_CAPTYPE_GIGPOD version %.8s capture", |
| 549 | | | hdr.timeunit, hdr.version); |
| 550 | | | return -1; |
| 551 | | | } |
| 552 | | | ticks_per_sec = TpS_gigpod[hdr.timeunit]; |
| 553 | | | |
| 554 | | | |
| 555 | | | |
| 556 | | | |
| 557 | | | |
| 558 | | | |
| 559 | | | if (version_minor == 2 || version_minor == 3) |
| 560 | | | start_timestamp = 0.0; |
| 561 | | | break; |
| 562 | | | |
| 563 | | | case ETH_CAPTYPE_OTHERPOD:
x /home/sate/Testcases/c/cve/wireshark-1.2.0/wiretap/netxray.c |
| |
115 | #define ETH_CAPTYPE_OTHERPOD 3 /* non-gigabit Ethernet captured with pod */ |
| |
|
| 564 | | | if (hdr.timeunit >= NUM_NETXRAY_TIMEUNITS_OTHERPOD
x /home/sate/Testcases/c/cve/wireshark-1.2.0/wiretap/netxray.c |
| |
231 | #define NUM_NETXRAY_TIMEUNITS_OTHERPOD (sizeof TpS_otherpod / sizeof TpS_otherpod[0]) |
| |
|
| 565 | | | || TpS_otherpod[hdr.timeunit] == 0.0) { |
| 566 | | | *err = WTAP_ERR_UNSUPPORTED; |
| 567 | | | *err_info = g_strdup_printf( |
| 568 | | | "netxray: Unknown timeunit %u for Ethernet/ETH_CAPTYPE_OTHERPOD version %.8s capture", |
| 569 | | | hdr.timeunit, hdr.version); |
| 570 | | | return -1; |
| 571 | | | } |
| 572 | | | ticks_per_sec = TpS_otherpod[hdr.timeunit]; |
| 573 | | | |
| 574 | | | |
| 575 | | | |
| 576 | | | |
| 577 | | | |
| 578 | | | |
| 579 | | | if (version_minor == 2 || version_minor == 3) |
| 580 | | | start_timestamp = 0.0; |
| 581 | | | break; |
| 582 | | | |
| 583 | | | case ETH_CAPTYPE_OTHERPOD2:
x /home/sate/Testcases/c/cve/wireshark-1.2.0/wiretap/netxray.c |
| |
116 | #define ETH_CAPTYPE_OTHERPOD2 5 /* gigabit Ethernet via pod ?? */ |
| |
|
| 584 | | | if (hdr.timeunit >= NUM_NETXRAY_TIMEUNITS_OTHERPOD2
x /home/sate/Testcases/c/cve/wireshark-1.2.0/wiretap/netxray.c |
| |
239 | #define NUM_NETXRAY_TIMEUNITS_OTHERPOD2 (sizeof TpS_otherpod2 / sizeof TpS_otherpod2[0]) |
| |
|
| 585 | | | || TpS_otherpod2[hdr.timeunit] == 0.0) { |
| 586 | | | *err = WTAP_ERR_UNSUPPORTED; |
| 587 | | | *err_info = g_strdup_printf( |
| 588 | | | "netxray: Unknown timeunit %u for Ethernet/ETH_CAPTYPE_OTHERPOD2 version %.8s capture", |
| 589 | | | hdr.timeunit, hdr.version); |
| 590 | | | return -1; |
| 591 | | | } |
| 592 | | | ticks_per_sec = TpS_otherpod2[hdr.timeunit]; |
| 593 | | | |
| 594 | | | |
| 595 | | | |
| 596 | | | |
| 597 | | | |
| 598 | | | |
| 599 | | | |
| 600 | | | |
| 601 | | | if (version_minor == 2 || version_minor == 3) |
| 602 | | | start_timestamp = 0.0; |
| 603 | | | break; |
| 604 | | | |
| 605 | | | case ETH_CAPTYPE_GIGPOD2:
x /home/sate/Testcases/c/cve/wireshark-1.2.0/wiretap/netxray.c |
| |
120 | #define ETH_CAPTYPE_GIGPOD2 6 /* gigabit Ethernet, captured with blade on S6040-model Sniffer */ |
| |
|
| 606 | | | if (hdr.timeunit >= NUM_NETXRAY_TIMEUNITS_GIGPOD2
x /home/sate/Testcases/c/cve/wireshark-1.2.0/wiretap/netxray.c |
| |
247 | #define NUM_NETXRAY_TIMEUNITS_GIGPOD2 (sizeof TpS_gigpod2 / sizeof TpS_gigpod2[0]) |
| |
|
| 607 | | | || TpS_gigpod2[hdr.timeunit] == 0.0) { |
| 608 | | | *err = WTAP_ERR_UNSUPPORTED; |
| 609 | | | *err_info = g_strdup_printf( |
| 610 | | | "netxray: Unknown timeunit %u for Ethernet/ETH_CAPTYPE_GIGPOD2 version %.8s capture", |
| 611 | | | hdr.timeunit, hdr.version); |
| 612 | | | return -1; |
| 613 | | | } |
| 614 | | | ticks_per_sec = TpS_gigpod2[hdr.timeunit]; |
| 615 | | | |
| 616 | | | |
| 617 | | | |
| 618 | | | |
| 619 | | | |
| 620 | | | |
| 621 | | | |
| 622 | | | |
| 623 | | | if (version_minor == 2 || version_minor == 3) |
| 624 | | | start_timestamp = 0.0; |
| 625 | | | break; |
| 626 | | | |
| 627 | | | default: |
| 628 | | | *err = WTAP_ERR_UNSUPPORTED; |
| 629 | | | *err_info = g_strdup_printf( |
| 630 | | | "netxray: Unknown capture type %u for Ethernet version %.8s capture", |
| 631 | | | hdr.captype, hdr.version); |
| 632 | | | return -1; |
| 633 | | | } |
| 634 | | | break; |
| 635 | | | |
| 636 | | | default: |
| 637 | | | if (hdr.timeunit >= NUM_NETXRAY_TIMEUNITS) { |
| 638 | | | *err = WTAP_ERR_UNSUPPORTED; |
| 639 | | | *err_info = g_strdup_printf( |
| 640 | | | "netxray: Unknown timeunit %u for %u/%u version %.8s capture", |
| 641 | | | hdr.timeunit, network_type, hdr.captype, |
| 642 | | | hdr.version); |
| 643 | | | return -1; |
| 644 | | | } |
| 645 | | | ticks_per_sec = TpS[hdr.timeunit]; |
| 646 | | | break; |
| 647 | | | } |
| 648 | | | |
| 649 | | | |
| 650 | | | |
| 651 | | | |
| 652 | | | |
| 653 | | | |
| 654 | | | |
| 655 | | | |
| 656 | | | |
| 657 | | | |
| 658 | | | |
| 659 | | | if (ticks_per_sec >= 1e7) |
| 660 | | | wth->tsprecision = WTAP_FILE_TSPREC_NSEC; |
| 661 | | | else |
| 662 | | | wth->tsprecision = WTAP_FILE_TSPREC_USEC; |
| 663 | | | break; |
| 664 | | | |
| 665 | | | default: |
| 666 | | | g_assert_not_reached();
x /usr/include/glib-2.0/glib/gtestutils.h |
| |
73 | #define g_assert_not_reached() do { g_assertion_message (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, NULL); } while (0) |
| |
x /usr/include/glib-2.0/glib/gmacros.h |
| |
160 | # define G_STRFUNC ((const char*) (__PRETTY_FUNCTION__)) |
| |
|
| 667 | | | ticks_per_sec = 0.0; |
| 668 | | | } |
| 669 | | | start_timestamp = start_timestamp/ticks_per_sec; |
| 670 | | | |
| 671 | | | if (network_type == 4) { |
| 672 | | | |
| 673 | | | |
| 674 | | | |
| 675 | | | |
| 676 | | | |
| 677 | | | |
| 678 | | | |
| 679 | | | |
| 680 | | | |
| 681 | | | |
| 682 | | | if (version_major == 2) { |
| 683 | | | switch (hdr.captype) { |
| 684 | | | |
| 685 | | | case WAN_CAPTYPE_PPP: |
| 686 | | | |
| 687 | | | |
| 688 | | | |
| 689 | | | file_encap = WTAP_ENCAP_PPP_WITH_PHDR; |
| 690 | | | break; |
| 691 | | | |
| 692 | | | case WAN_CAPTYPE_FRELAY:
x /home/sate/Testcases/c/cve/wireshark-1.2.0/wiretap/netxray.c |
| |
127 | #define WAN_CAPTYPE_FRELAY 4 /* Frame Relay captured with pod */ |
| |
|
| 693 | | | |
| 694 | | | |
| 695 | | | |
| 696 | | | |
| 697 | | | |
| 698 | | | |
| 699 | | | |
| 700 | | | |
| 701 | | | |
| 702 | | | |
| 703 | | | |
| 704 | | | |
| 705 | | | |
| 706 | | | |
| 707 | | | |
| 708 | | | file_encap = WTAP_ENCAP_FRELAY_WITH_PHDR; |
| 709 | | | break; |
| 710 | | | |
| 711 | | | case WAN_CAPTYPE_HDLC:
x /home/sate/Testcases/c/cve/wireshark-1.2.0/wiretap/netxray.c |
| |
129 | #define WAN_CAPTYPE_HDLC 6 /* HDLC (X.25, ISDN) captured with pod */ |
| |
|
| 712 | | | case WAN_CAPTYPE_HDLC2: |
| 713 | | | |
| 714 | | | |
| 715 | | | |
| 716 | | | switch (hdr.wan_hdlc_subsub_captype) { |
| 717 | | | |
| 718 | | | case 0: |
| 719 | | | file_encap = WTAP_ENCAP_LAPB; |
| 720 | | | break; |
| 721 | | | |
| 722 | | | case 1: |
| 723 | | | case 2: |
| 724 | | | case 3: |
| 725 | | | file_encap = WTAP_ENCAP_ISDN; |
| 726 | | | isdn_type = hdr.wan_hdlc_subsub_captype; |
| 727 | | | break; |
| 728 | | | |
| 729 | | | default: |
| 730 | | | *err = WTAP_ERR_UNSUPPORTED_ENCAP; |
| 731 | | | *err_info = g_strdup_printf("netxray: WAN HDLC capture subsubtype 0x%02x unknown or unsupported", |
| 732 | | | hdr.wan_hdlc_subsub_captype); |
| 733 | | | return -1; |
| 734 | | | } |
| 735 | | | break; |
| 736 | | | |
| 737 | | | case WAN_CAPTYPE_SDLC: |
| 738 | | | |
| 739 | | | |
| 740 | | | |
| 741 | | | file_encap = WTAP_ENCAP_SDLC; |
| 742 | | | break; |
| 743 | | | |
| 744 | | | case WAN_CAPTYPE_CHDLC:
x /home/sate/Testcases/c/cve/wireshark-1.2.0/wiretap/netxray.c |
| |
136 | #define WAN_CAPTYPE_CHDLC 19 /* Cisco router (CHDLC) captured with pod */ |
| |
|
| 745 | | | |
| 746 | | | |
| 747 | | | |
| 748 | | | file_encap = WTAP_ENCAP_CHDLC_WITH_PHDR; |
| 749 | | | break; |
| 750 | | | |
| 751 | | | default: |
| 752 | | | *err = WTAP_ERR_UNSUPPORTED_ENCAP; |
| 753 | | | *err_info = g_strdup_printf("netxray: WAN capture subtype 0x%02x unknown or unsupported", |
| 754 | | | hdr.captype); |
| 755 | | | return -1; |
| 756 | | | } |
| 757 | | | } else |
| 758 | | | file_encap = WTAP_ENCAP_ETHERNET; |
| 759 | | | } else |
| 760 | | | file_encap = netxray_encap[network_type]; |
| 761 | | | |
| 762 | | | |
| 763 | | | wth->file_type = file_type; |
| 764 | | | wth->capture.netxray = g_malloc(sizeof(netxray_t)); |
| 765 | | | wth->subtype_read = netxray_read; |
| 766 | | | wth->subtype_seek_read = netxray_seek_read; |
| 767 | | | wth->subtype_close = netxray_close; |
| 768 | | | wth->file_encap = file_encap; |
| 769 | | | wth->snapshot_length = 0; |
| 770 | | | wth->capture.netxray->start_time = pletohl(&hdr.start_time);
x /home/sate/Testcases/c/cve/wireshark-1.2.0/wiretap/wtap-int.h |
| |
386 | #define pletohl(p) ((guint32)*((const guint8 *)(p)+3)<<24| \ |
387 | (guint32)*((const guint8 *)(p)+2)<<16| \ |
388 | (guint32)*((const guint8 *)(p)+1)<<8| \ |
389 | (guint32)*((const guint8 *)(p)+0)<<0) |
| |
|
| 771 | | | wth->capture.netxray->ticks_per_sec = ticks_per_sec; |
| 772 | | | wth->capture.netxray->start_timestamp = start_timestamp; |
| 773 | | | wth->capture.netxray->version_major = version_major; |
| 774 | | | |
| 775 | | | |
| 776 | | | |
| 777 | | | |
| 778 | | | |
| 779 | | | wth->capture.netxray->fcs_valid = FALSE; |
| 780 | | | switch (file_encap) { |
| 781 | | | |
| 782 | | | case WTAP_ENCAP_ETHERNET: |
| 783 | | | case WTAP_ENCAP_IEEE_802_11_WITH_RADIO: |
| 784 | | | case WTAP_ENCAP_ISDN: |
| 785 | | | case WTAP_ENCAP_LAPB: |
| 786 | | | |
| 787 | | | |
| 788 | | | |
| 789 | | | |
| 790 | | | |
| 791 | | | |
| 792 | | | |
| 793 | | | |
| 794 | | | |
| 795 | | | |
| 796 853 |  | | [ Lines 796 to 853 omitted. ] |
| 854 | | | |
| 855 | | | |
| 856 | | | |
| 857 | | | |
| 858 | | | |
| 859 | | | |
| 860 | | | |
| 861 | | | |
| 862 | | | |
| 863 | | | |
| 864 | | | if (version_major == 2) { |
| 865 | | | if (hdr.realtick[1] == 0x34 && hdr.realtick[2] == 0x12) |
| 866 | | | wth->capture.netxray->fcs_valid = TRUE; |
| 867 | | | } |
| 868 | | | break; |
| 869 | | | } |
| 870 | | | |
| 871 | | | |
| 872 | | | |
| 873 | | | |
| 874 | | | |
| 875 | | | wth->capture.netxray->isdn_type = isdn_type; |
| 876 | | | |
| 877 | | | |
| 878 | | | |
| 879 | | | |
| 880 | | | |
| 881 | | | |
| 882 | | | wth->capture.netxray->wrapped = FALSE; |
| 883 | | | wth->capture.netxray->nframes = pletohl(&hdr.nframes);
x /home/sate/Testcases/c/cve/wireshark-1.2.0/wiretap/wtap-int.h |
| |
386 | #define pletohl(p) ((guint32)*((const guint8 *)(p)+3)<<24| \ |
387 | (guint32)*((const guint8 *)(p)+2)<<16| \ |
388 | (guint32)*((const guint8 *)(p)+1)<<8| \ |
389 | (guint32)*((const guint8 *)(p)+0)<<0) |
| |
|
| 884 | | | wth->capture.netxray->start_offset = pletohl(&hdr.start_offset);
x /home/sate/Testcases/c/cve/wireshark-1.2.0/wiretap/wtap-int.h |
| |
386 | #define pletohl(p) ((guint32)*((const guint8 *)(p)+3)<<24| \ |
387 | (guint32)*((const guint8 *)(p)+2)<<16| \ |
388 | (guint32)*((const guint8 *)(p)+1)<<8| \ |
389 | (guint32)*((const guint8 *)(p)+0)<<0) |
| |
|
| 885 | | | wth->capture.netxray->end_offset = pletohl(&hdr.end_offset);
x /home/sate/Testcases/c/cve/wireshark-1.2.0/wiretap/wtap-int.h |
| |
386 | #define pletohl(p) ((guint32)*((const guint8 *)(p)+3)<<24| \ |
387 | (guint32)*((const guint8 *)(p)+2)<<16| \ |
388 | (guint32)*((const guint8 *)(p)+1)<<8| \ |
389 | (guint32)*((const guint8 *)(p)+0)<<0) |
| |
|
| 886 | | | |
| 887 | | | |
| 888 | | | if (file_seek(wth->fh, pletohl(&hdr.start_offset), SEEK_SET, err) == -1) {
x /home/sate/Testcases/c/cve/wireshark-1.2.0/wiretap/wtap-int.h |
| |
386 | #define pletohl(p) ((guint32)*((const guint8 *)(p)+3)<<24| \ |
387 | (guint32)*((const guint8 *)(p)+2)<<16| \ |
388 | (guint32)*((const guint8 *)(p)+1)<<8| \ |
389 | (guint32)*((const guint8 *)(p)+0)<<0) |
| |
x /usr/include/stdio.h |
| |
141 | #define SEEK_SET 0 /* Seek from beginning of file. */ |
| |
|
| 889 | | | g_free(wth->capture.netxray); |
| 890 | | | return -1; |
| 891 | | | } |
| 892 | | | wth->data_offset = pletohl(&hdr.start_offset);
x /home/sate/Testcases/c/cve/wireshark-1.2.0/wiretap/wtap-int.h |
| |
386 | #define pletohl(p) ((guint32)*((const guint8 *)(p)+3)<<24| \ |
387 | (guint32)*((const guint8 *)(p)+2)<<16| \ |
388 | (guint32)*((const guint8 *)(p)+1)<<8| \ |
389 | (guint32)*((const guint8 *)(p)+0)<<0) |
| |
|
| 893 | | | |
| 894 | | | return 1; |
| 895 | | | } |
| |