Changeset 3b8a5ef for lib/format_pcap.c


Ignore:
Timestamp:
11/30/05 15:43:30 (16 years ago)
Author:
Daniel Lawson <dlawson@…>
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:
2adf051
Parents:
08594b8
Message:

I hate shane

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/format_pcap.c

    r14d8a63 r3b8a5ef  
    207207static void trace_pcap_handler(u_char *user, const struct pcap_pkthdr *pcaphdr, const u_char *pcappkt) {
    208208        struct libtrace_packet_t *packet = (struct libtrace_packet_t *)user;   
    209         void *buffer = packet->buffer;
    210209        int numbytes = 0;
    211        
    212         // This is ugly, but seems to be needed. We want both the
    213         // header and the payload in the same block of memory (packet->buffer)
    214         //memcpy(buffer,pcaphdr,sizeof(struct pcap_pkthdr));
     210
     211        // pcap provides us with the right bits, in it's own buffers.
     212        // We hijack them.
    215213        numbytes = pcaphdr->len;
    216         //memcpy(buffer + sizeof(struct pcap_pkthdr),pcappkt,numbytes);
    217 
    218         //packet->header = packet->buffer;
    219         //packet->payload = packet->header + sizeof(struct pcap_pkthdr);
     214
    220215        packet->header = (void *)pcaphdr;
    221216        packet->payload = (void *)pcappkt;
     
    379374}
    380375
    381 static int pcap_get_framing_length(const struct libtrace_packet_t *packet) {
     376static int pcap_get_framing_length(const struct libtrace_packet_t *packet UNUSED) {
    382377        return sizeof(struct pcap_pkthdr);
    383378}
Note: See TracChangeset for help on using the changeset viewer.