Changeset 1fbd938 for lib/trace.c
- Timestamp:
- 02/16/06 11:56:02 (16 years ago)
- Branches:
- 4.0.1-hotfixes, cachetimestamps, develop, dpdk-ndag, etsilive, getfragoff, help, libtrace4, master, ndag_format, pfring, rc-4.0.1, rc-4.0.2, rc-4.0.3, rc-4.0.4, ringdecrementfix, ringperformance, ringtimestampfixes
- Children:
- 880aa58
- Parents:
- ee5e4c7
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
lib/trace.c
r49babe0 r1fbd938 446 446 } 447 447 448 int trace_pause(libtrace_t *libtrace) 449 { 450 assert(libtrace); 451 assert(libtrace->started && "BUG: Called trace_pause without calling trace_start first"); 452 if (libtrace->format->pause_input) 453 libtrace->format->pause_input(libtrace); 454 libtrace->started=false; 455 return 0; 456 } 457 448 458 /* Parses an output options string and calls the appropriate function to deal with output options. 449 459 * … … 590 600 case TRACE_TYPE_80211_PRISM: 591 601 { 592 struct ieee_802_11_header *wifi = (char*)trace_get_link(packet)+144; 602 struct ieee_802_11_header *wifi = 603 (void*)( 604 (char*)trace_get_link(packet)+144); 593 605 if (!wifi) { 594 606 ipptr = NULL; … … 605 617 606 618 if (ntohs(eth->type) == 0x0800) { 607 ipptr=((void*)eth) + sizeof(*eth); 619 ipptr=(void*) 620 ((char*)eth + sizeof(*eth)); 608 621 } else if (ntohs(eth->type) == 0x8100) { 609 622 struct libtrace_8021q *vlanhdr = … … 611 624 if (ntohs(vlanhdr->vlan_ether_type) 612 625 == 0x0800) { 613 ipptr=( (void*)eth) +614 sizeof(*vlanhdr);626 ipptr=(void*)( 627 (char*)eth+sizeof(*vlanhdr)); 615 628 } 616 629 } … … 636 649 637 650 if (ntohs(eth->type) == 0x0800) { 638 ipptr=( (void*)eth) + sizeof(*eth);651 ipptr=(void*)((char*)eth + sizeof(*eth)); 639 652 } else if (ntohs(eth->type) == 0x8100) { 640 653 struct libtrace_8021q *vlanhdr = … … 642 655 if (ntohs(vlanhdr->vlan_ether_type) 643 656 == 0x0800) { 644 ipptr=( (void*)eth)+645 sizeof(*vlanhdr) ;657 ipptr=(void*)((char*)eth + 658 sizeof(*vlanhdr)); 646 659 } 647 660 } … … 661 674 662 675 if (ntohs(eth->ether_type)==0x0800) { 663 ipptr = ( (void *)eth) + sizeof(*eth);676 ipptr = (void*)((char *)eth + sizeof(*eth)); 664 677 } else if (ntohs(eth->ether_type) == 0x8100) { 665 678 struct libtrace_8021q *vlanhdr = … … 667 680 if (ntohs(vlanhdr->vlan_ether_type) 668 681 == 0x0800) { 669 ipptr = ( (void *)eth)+670 sizeof(*vlanhdr) ;682 ipptr = (void*)((char *)eth + 683 sizeof(*vlanhdr)); 671 684 } 672 685 } … … 689 702 } 690 703 else { 691 ipptr = ((void*)sll)+sizeof(*sll); 704 ipptr = (void*)((char*)sll+ 705 sizeof(*sll)); 692 706 } 693 707 } … … 704 718 ipptr = NULL; 705 719 } else { 706 ipptr = ((void*)pflog)+sizeof(*pflog); 720 ipptr = (void*)((char*)pflog+ 721 sizeof(*pflog)); 707 722 } 708 723 } … … 714 729 trace_get_link(packet); 715 730 if (ntohs(pos->ether_type) == 0x0800) { 716 ipptr = ((void *)pos) + sizeof(*pos);731 ipptr=(void*)((char *)pos+sizeof(*pos)); 717 732 } else { 718 ipptr =NULL;733 ipptr=NULL; 719 734 } 720 735 break; … … 732 747 * don't have time! 733 748 */ 734 llc = (void *)llc + 4;749 llc = (void*)((char *)llc + 4); 735 750 if (ntohs(llc->type) == 0x0800) { 736 ipptr = ((void *)llc) + sizeof(*llc);751 ipptr=(void*)((char*)llc+sizeof(*llc)); 737 752 } else { 738 753 ipptr = NULL;
Note: See TracChangeset
for help on using the changeset viewer.