Changeset 73dd29f for lib/format_bpf.c


Ignore:
Timestamp:
04/02/07 21:44:53 (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:
11f2df7
Parents:
02bd77e
Message:

Sooo, pcap has two types of DLT's "pure" DLT's that are platform dependant,
and "linktype" DLT's that are portable and are what are written to pcap files.

Instead of fudging the two concepts together so much, attempt to disintangle
this mess without exposing too much of the god awful mess to the end user.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/format_bpf.c

    r5361eae r73dd29f  
    6161        unsigned int buffersize;
    6262        int remaining;
    63         unsigned int dlt;
     63        unsigned int linktype;
    6464};
    6565
     
    151151
    152152        if (ioctl(FORMATIN(libtrace)->fd, BIOCGDLT,
    153                          &FORMATIN(libtrace)->dlt) == -1) {
     153                         &FORMATIN(libtrace)->linktype) == -1) {
    154154                trace_set_err(libtrace,errno,"Failed to retrieve link type");
    155155                close(FORMATIN(libtrace)->fd);
     
    278278
    279279        /* Find the payload */
    280         /* TODO: Pcap deals with a padded FDDI dlt here */
     280        /* TODO: Pcap deals with a padded FDDI linktype here */
    281281        packet->payload=FORMATIN(libtrace)->bufptr+BPFHDR(packet)->bh_hdrlen;
    282282
     
    293293
    294294static libtrace_linktype_t bpf_get_link_type(const libtrace_packet_t *packet) {
    295         return pcap_dlt_to_libtrace(FORMATIN(packet->trace)->dlt);
     295        return pcap_linktype_to_libtrace(FORMATIN(packet->trace)->linktype);
    296296}
    297297
Note: See TracChangeset for help on using the changeset viewer.