Changeset 2627439 for lib/format_bpf.c


Ignore:
Timestamp:
11/30/12 15:04:47 (9 years ago)
Author:
Shane Alcock <salcock@…>
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:
f00c146
Parents:
f240823
Message:
  • Created separate RT types for each combination of BPF + DLT - BPF doesn't store the linktype in the packet at all, so this has to be included in the RT type :/
File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/format_bpf.c

    rb8cb571 r2627439  
    383383{
    384384        uint32_t flags = 0;
     385
     386        packet->type = bpf_linktype_to_rt(swapl(libtrace,
     387                        FORMATIN(libtrace)->linktype));
    385388       
    386389        /* Read from the BPF interface into our capture buffer */
     
    417420         * buffer */
    418421        if (bpf_prepare_packet(libtrace, packet, FORMATIN(libtrace)->bufptr,
    419                 TRACE_RT_DATA_BPF, flags)) {
     422                        packet->type, flags)) {
    420423                return -1;
    421424        }
     
    438441        /* Convert the linktype that we recorded when we started the trace
    439442         * into a suitable libtrace linktype */
    440         return pcap_linktype_to_libtrace(FORMATIN(packet->trace)->linktype);
     443        return pcap_linktype_to_libtrace(rt_to_pcap_linktype(packet->type));
    441444}
    442445
Note: See TracChangeset for help on using the changeset viewer.