Changeset 38f9537 for test


Ignore:
Timestamp:
03/26/07 13:58:27 (14 years ago)
Author:
Perry Lorier <perry@…>
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:
acb0d01
Parents:
f0c639b
Message:

libtrace will report packets that aren't the first fragment as not having
a UDP header (fair enough), update the bpf filters to agree with these
semantics

File:
1 edited

Legend:

Unmodified
Added
Removed
  • test/test-decode.c

    rd5a27e8 r38f9537  
    9292        libtrace_packet_t *packet;
    9393        libtrace_filter_t *filter_tcp = trace_create_filter("tcp");
    94         libtrace_filter_t *filter_udp = trace_create_filter("udp");
     94        libtrace_filter_t *filter_udp =
     95                trace_create_filter("udp and ip[6:2] & 0x1fff = 0");
    9596        libtrace_filter_t *filter_icmp = trace_create_filter("icmp");
    9697
     
    143144                        error=1;
    144145                        printf("udp problem\n");
     146                        if (trace_get_udp(packet)) {
     147                                printf(" libtrace thinks this is a udp packet\n");
     148                        }
     149                        else {
     150                                printf(" libtrace doesn't think this is a udp packet\n");
     151                        }
     152                        if (trace_apply_filter(filter_udp,packet)) {
     153                                printf(" bpf thinks this is a udp packet\n");
     154                        }
     155                        else {
     156                                printf(" bpf doesn't think this is a udp packet\n");
     157                        }
    145158                        trace_dump_packet(packet);
    146159                        break;
Note: See TracChangeset for help on using the changeset viewer.