Changeset 77285d9 for lib/format_pcap.c


Ignore:
Timestamp:
05/10/06 09:57:52 (15 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:
3fcb8b4
Parents:
9b8c7ad
Message:

OpenBSD compatibility fixes - adding in various #defines and #includes that are needed to compile under OpenBSD
Added a replacement pcap_next_ex function for systems that aren't running pcap-0.8 or better

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/format_pcap.c

    r431548c5 r77285d9  
    273273        packet->buf_control = TRACE_CTRL_PACKET;
    274274
     275        /* If we're using the replacement pcap_next_ex() we need to
     276         * make sure we have a buffer to *shudder* memcpy into
     277         */
     278        if (!packet->buffer) {
     279                packet->buffer = malloc(LIBTRACE_PACKET_BUFSIZE);
     280                if (!packet->buffer) {
     281                        trace_set_err(libtrace, errno,
     282                                        "Cannot allocate memory");
     283                        return -1;
     284                }
     285                       
     286                packet->header = packet->buffer;
     287                packet->payload = (char *)packet->buffer +
     288                                        sizeof(struct pcap_pkthdr);
     289        }
     290       
    275291        for(;;) {
    276292
Note: See TracChangeset for help on using the changeset viewer.