Changeset 808a478 for lib


Ignore:
Timestamp:
04/21/05 09:54:40 (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:
4b30586
Parents:
7bb7dda
Message:

Ported to OpenBSD

Changes were mostly with header changes, although openbsd's pcap doesn't have pcap_open_dead, so we provide our own. To this end, I fixed the libreplace shit that wasn't working at all well, and ended up putting strndup.c and pcap_open_dead.c into lib/, and adding @LTLIBOBJS@ to the libtrace source file line. Seems to work fine now!

Location:
lib
Files:
2 added
2 edited

Legend:

Unmodified
Added
Removed
  • lib/Makefile.am

    r3cfa94a r808a478  
    44#libtrace_la_SOURCES = trace.c fifo.c fifo.h common.h dagapi.c dagopts.c
    55#else
    6 libtrace_la_SOURCES = trace.c fifo.c fifo.h common.h
     6libtrace_la_SOURCES = trace.c fifo.c fifo.h common.h 
    77#endif
    88libtrace_la_CFLAGS = @ADD_INCLS@
    9 libtrace_la_LIBADD = @ADD_LIBS@ $(top_builddir)/replace/libreplace.a
     9libtrace_la_LIBADD = @ADD_LIBS@ @LTLIBOBJS@
    1010libtrace_la_LDFLAGS=-version-info 2:16:0 @ADD_LDFLAGS@
    1111
  • lib/trace.c

    r7bb7dda r808a478  
    6464#include <sys/mman.h>
    6565#include <unistd.h>
    66 #include <net/ethernet.h>
     66
     67#ifdef HAVE_NET_IF_ARP_H
     68#  include <net/if_arp.h>
     69#endif
     70
     71#ifdef HAVE_NET_IF_H
     72#  include <net/if.h>
     73#endif
     74
     75#ifdef HAVE_NETINET_IN_H
     76#  include <netinet/in.h>
     77#endif
     78
     79#ifdef HAVE_NET_ETHERNET_H
     80#  include <net/ethernet.h>
     81#endif
     82
     83#ifdef HAVE_NETINET_IF_ETHER_H
     84#  include <netinet/if_ether.h>
     85#endif
     86
    6787#include <time.h>
    6888#include <sys/ioctl.h>
     
    93113#if HAVE_PCAP_H
    94114#  include <pcap.h>
     115#  ifdef HAVE_PCAP_INT_H
     116#    include <pcap-int.h>
     117#  endif
    95118#endif
    96119
     
    894917                        assert(0);
    895918        }
    896         return ethptr;
     919        return (void *)ethptr;
    897920}
    898921
     
    12221245                case PCAP:
    12231246                        pcapptr = (struct pcap_pkthdr *)packet->buffer;
    1224                         tv = pcapptr->ts;
     1247                        // ick. FIXME
     1248                        tv.tv_sec = pcapptr->ts.tv_sec;
     1249                        tv.tv_usec = pcapptr->ts.tv_usec;
    12251250                        break;
    12261251#endif
     
    16161641                switch (trace_get_link_type(packet)) {
    16171642                        case TRACE_TYPE_ETH:
    1618                                 pcap = pcap_open_dead(DLT_EN10MB, 1500);
     1643                                pcap = (pcap_t *)pcap_open_dead(DLT_EN10MB, 1500);
    16191644                                break;
     1645#ifdef DLT_LINUX_SLL
    16201646                        case TRACE_TYPE_LINUX_SLL:
    16211647                                pcap = pcap_open_dead(DLT_LINUX_SLL, 1500);
    16221648                                break;
     1649#endif
    16231650                        default:
    16241651                                printf("only works for ETH and LINUX_SLL (ppp) at the moment\n");
Note: See TracChangeset for help on using the changeset viewer.