Changeset 77285d9


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

Files:
1 added
8 edited

Legend:

Unmodified
Added
Removed
  • configure.in

    re5f1431 r77285d9  
    158158        fi
    159159   
    160         # Versions of libpcap earlier than 0.8 don't have pcap_dump_flush
     160        # Versions of libpcap earlier than 0.8 don't have pcap_dump_flush or
     161        # pcap_next_ex
    161162        AC_CHECK_LIB(pcap,pcap_dump_flush,
    162163                     have_pcap_dump_flush=true,
     
    165166        if test "$have_pcap_dump_flush" = false; then
    166167                AC_REPLACE_FUNCS(pcap_dump_flush)
     168        fi
     169       
     170        AC_CHECK_LIB(pcap,pcap_next_ex,
     171                     have_pcap_next_ex=true,
     172                     have_pcap_next_ex=false)
     173
     174        if test "$have_pcap_next_ex" = false; then
     175                AC_REPLACE_FUNCS(pcap_next_ex)
    167176        fi
    168177
  • lib/fifo.c

    r431548c5 r77285d9  
    3939
    4040#include "fifo.h"
     41
     42#ifndef PRIu64
     43        #define PRIu64 "llu"
     44#endif
     45
     46#ifndef PRIi64
     47        #define PRIi64 "lli"
     48#endif
    4149
    4250enum which_t { FIFO_PTR_IN, FIFO_PTR_OUT, FIFO_PTR_ACK };
  • 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
  • lib/libtrace.h.in

    re5f1431 r77285d9  
    5757
    5858#include <sys/types.h>
     59#include <sys/time.h>
     60
    5961#ifdef _MSC_VER
    6062    /* define the following from MSVC's internal types */
     
    98100#    include <netinet/in.h>
    99101#    include <stdbool.h>
     102#    include <sys/types.h>
     103#    include <sys/socket.h>
    100104#endif
    101105
     
    119123#  define SIMPLE_FUNCTION
    120124#  define UNUSED
    121 #  define PACKED __declspec(align(1))
     125#  define PACKED
    122126#  define CONSTRUCTOR
    123127#endif
  • lib/linktypes.c

    rfe4ab68 r77285d9  
    1313#ifndef WIN32
    1414#include <net/if_arp.h>
    15 #else
     15#endif
     16
     17#ifndef ARPHRD_ETHER
    1618#define ARPHRD_ETHER    1               /* Ethernet 10/100Mbps.  */
     19#endif
     20
     21#ifndef ARPHRD_PPP
    1722#define ARPHRD_PPP      512
    1823#endif
  • lib/pcap_dump_flush.c

    rf2f47a7 r77285d9  
    1717                return (0);
    1818}
     19
    1920#endif
  • lib/protocols.c

    r95747c3 r77285d9  
    1111#ifndef WIN32
    1212#include <net/if_arp.h>
    13 #else
     13#endif
     14
     15#ifndef ARPHRD_ETHER
    1416#define ARPHRD_ETHER    1               /* Ethernet 10/100Mbps.  */
     17#endif
     18
     19#ifndef ARPHRD_PPP
    1520#define ARPHRD_PPP      512
    1621#endif
     22
    1723
    1824/* Returns the payload from 802.3 ethernet.  Type optionally returned in
  • lib/trace.c

    rc37ab9f r77285d9  
    5050#include <sys/stat.h>
    5151#include <sys/types.h>
     52#include <sys/socket.h>
    5253#include <stdarg.h>
    5354
Note: See TracChangeset for help on using the changeset viewer.