Changeset e5c2bc4 for lib


Ignore:
Timestamp:
06/27/06 12:41:26 (16 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:
496864e
Parents:
9461526
Message:

Redo the build system for libtrace3

Location:
lib
Files:
14 edited

Legend:

Unmodified
Added
Removed
  • lib/format_erf.c

    r362c5f2 re5c2bc4  
    4444#include <stdlib.h>
    4545
    46 #if HAVE_DAG
     46#ifdef HAVE_DAG
    4747#include <sys/mman.h>
    4848#endif
     
    6666static struct libtrace_format_t erf;
    6767static struct libtrace_format_t rtclient;
    68 #if HAVE_DAG
     68#ifdef HAVE_DAG
    6969static struct libtrace_format_t dag;
    7070#endif
     
    7676#define INPUT DATA(libtrace)->input
    7777#define OUTPUT DATAOUT(libtrace)->output
    78 #if HAVE_DAG
     78#ifdef HAVE_DAG
    7979#define DAG DATA(libtrace)->dag
    8080#define DUCK DATA(libtrace)->duck
     
    100100        } seek;
    101101
    102 #if HAVE_DAG
     102#ifdef HAVE_DAG
    103103        struct {
    104104                uint32_t last_duck;     
     
    464464#ifdef HAVE_DAG
    465465static int dag_pause_input(libtrace_t *libtrace) {
    466 #if DAG_VERSION_2_4
     466#ifdef DAG_VERSION_2_4
    467467        dag_stop(INPUT.fd);
    468468#else
     
    510510}
    511511 
    512 #if HAVE_DAG
    513 #if DAG_VERSION_2_4
     512#ifdef HAVE_DAG
     513#ifdef DAG_VERSION_2_4
    514514static int dag_get_duckinfo(libtrace_t *libtrace,
    515515                                libtrace_packet_t *packet) {
     
    667667
    668668static int dag_start_input(libtrace_t *libtrace) {
    669 #if DAG_VERSION_2_4
     669#ifdef DAG_VERSION_2_4
    670670        if(dag_start(INPUT.fd) < 0) {
    671671                trace_set_err(libtrace,errno,"Cannot start DAG %s",
     
    922922       
    923923        if (packet->trace->format == &erf 
    924 #if HAVE_DAG
     924#ifdef HAVE_DAG
    925925                        || packet->trace->format == &dag
    926926#endif
     
    10571057#endif
    10581058
    1059 #if HAVE_DAG
     1059#ifdef HAVE_DAG
    10601060static void dag_help() {
    10611061        printf("dag format module: $Revision$\n");
  • lib/format_helper.c

    re2aebe7 re5c2bc4  
    196196        assert(level<10);
    197197        assert(level>=0);
    198 #if HAVE_ZLIB
     198#ifdef HAVE_ZLIB
    199199        sprintf(filemode,"wb%d",level);
    200200#else
  • lib/format_legacy.c

    re6d963c re5c2bc4  
    6464
    6565#define INPUT DATA(libtrace)->input
    66 #if HAVE_DAG
    67 #define DAG DATA(libtrace)->dag
    68 #endif
    6966
    7067struct legacy_format_data_t {
  • lib/format_pcap.c

    rf875681 re5c2bc4  
    4242#include <errno.h>
    4343
    44 #if HAVE_PCAP_BPF_H
    45 #  include <pcap-bpf.h>
    46 #else
    47 #  ifdef HAVE_NET_BPF_H
    48 #    include <net/bpf.h>
    49 #  endif
    50 #endif
    51 
    52 #if HAVE_PCAP_H
     44#ifdef HAVE_PCAP_H
    5345#  include <pcap.h>
    5446#  ifdef HAVE_PCAP_INT_H
     
    5749#endif
    5850
    59 #if HAVE_PCAP
     51#ifdef HAVE_LIBPCAP
    6052static struct libtrace_format_t pcap;
    6153static struct libtrace_format_t pcapint;
     
    368360                        libtrace->uridata,65536,0,0,NULL);
    369361        }
    370 #if HAVE_PCAP_INJECT
     362#ifdef HAVE_PCAP_INJECT
    371363        err=pcap_inject(OUTPUT.trace.pcap,
    372364                        packet->payload,
     
    375367                err=-1;
    376368#else
    377 #if HAVE_PCAP_SENDPACKET
     369#ifdef HAVE_PCAP_SENDPACKET
    378370        err=pcap_sendpacket(OUTPUT.trace.pcap,
    379371                        packet->payload,
  • lib/format_wag.c

    r6fb4dbf re5c2bc4  
    161161                void *value) {
    162162        switch(option) {
    163 #if HAVE_ZLIB
     163#ifdef HAVE_ZLIB
    164164                case TRACE_OPTION_OUTPUT_COMPRESS:
    165165                        OPTIONS.zlib.level = *(int*)value;
  • lib/libtrace_int.h

    re2d5893 re5c2bc4  
    6363#include "rt_protocol.h"
    6464       
    65 #if HAVE_PCAP_BPF_H
     65#ifdef HAVE_PCAP_BPF_H
    6666#  include <pcap-bpf.h>
     67#  define HAVE_BPF 1
    6768#else
    6869#  ifdef HAVE_NET_BPF_H
    6970#    include <net/bpf.h>
     71#    define HAVE_BPF 1
    7072#  endif
    7173#endif
    7274
    73 #if HAVE_PCAP_H
     75#ifdef HAVE_PCAP_H
    7476#  include <pcap.h>
    7577#  ifdef HAVE_PCAP_INT_H
     
    7880#endif
    7981
    80 #if HAVE_ZLIB_H
     82#ifdef HAVE_ZLIB_H
    8183#  include <zlib.h>
    8284#endif
     
    359361bool demote_packet(libtrace_packet_t *packet);
    360362
    361 #if HAVE_BPF
     363#ifdef HAVE_BPF
    362364/* A type encapsulating a bpf filter
    363365 * This type covers the compiled bpf filter, as well as the original filter
     
    370372        char * filterstring;
    371373};
     374#else
     375struct libtrace_filter_t {};
    372376#endif
    373377
  • lib/libtraceio.h

    re2d5893 re5c2bc4  
    55#define LIBTRACEIO_H 1
    66#include "config.h"
    7 #if HAVE_ZLIB
     7#ifdef HAVE_ZLIB
    88#include <zlib.h>
    99#else
  • lib/linktypes.c

    r0ff6ddf re5c2bc4  
    11#include "libtrace.h"
    22#include "config.h"
    3 #ifdef HAVE_PCAP
    4 #include <pcap.h>
    5 #endif
    63
    74#include "rt_protocol.h"
  • lib/malloc.c

    re7bc155 re5c2bc4  
    1 #if HAVE_CONFIG_H
     1#ifdef HAVE_CONFIG_H
    22#  include <config.h>
    33#endif
  • lib/pcap_dump_flush.c

    r77285d9 re5c2bc4  
    44#include <stdio.h>
    55#include <pcap.h>
    6 #if HAVE_PCAP_INT_H
     6#ifdef HAVE_PCAP_INT_H
    77# include <pcap-int.h>
    88#else
  • lib/pcap_next_ex.c

    r77285d9 re5c2bc4  
    44#include <stdio.h>
    55#include <pcap.h>
    6 #if HAVE_PCAP_INT_H
     6#ifdef HAVE_PCAP_INT_H
    77# include <pcap-int.h>
    88#else
  • lib/pcap_open_dead.c

    rf2f47a7 re5c2bc4  
    44#include <stdio.h>
    55#include <pcap.h>
    6 #if HAVE_PCAP_INT_H
     6#ifdef HAVE_PCAP_INT_H
    77# include <pcap-int.h>
    88#else
  • lib/realloc.c

    r8afe034 re5c2bc4  
    1 #if HAVE_CONFIG_H
     1#ifdef HAVE_CONFIG_H
    22#  include <config.h>
    33#endif
  • lib/trace.c

    rc5ebbaa re5c2bc4  
    8888#include "parse_cmd.h"
    8989
    90 #if HAVE_PCAP_BPF_H
     90#ifdef HAVE_PCAP_BPF_H
    9191#  include <pcap-bpf.h>
    9292#else
     
    9595#  endif
    9696#endif
     97
    9798
    9899#include "libtrace_int.h"
     
    227228                linuxnative_constructor();
    228229#endif
    229 #ifdef HAVE_PCAP
     230#ifdef HAVE_LIBPCAP
    230231                pcap_constructor();
    231232#endif
     
    922923 */
    923924DLLEXPORT libtrace_filter_t *trace_create_filter(const char *filterstring) {
    924 #if HAVE_BPF
     925#ifdef HAVE_BPF
    925926        libtrace_filter_t *filter = (libtrace_filter_t*)
    926927                                malloc(sizeof(libtrace_filter_t));
     
    936937DLLEXPORT void trace_destroy_filter(libtrace_filter_t *filter)
    937938{
    938 #if HAVE_BPF
     939#ifdef HAVE_BPF
    939940        free(filter->filterstring);
    940941        if (filter->flag)
     
    953954int trace_bpf_compile(libtrace_filter_t *filter,
    954955                const libtrace_packet_t *packet ) {
    955 #if HAVE_BPF
     956#ifdef HAVE_BPF
    956957        void *linkptr = 0;
    957958        assert(filter);
     
    10031004DLLEXPORT int trace_apply_filter(libtrace_filter_t *filter,
    10041005                        const libtrace_packet_t *packet) {
    1005 #if HAVE_BPF
     1006#ifdef HAVE_BPF
    10061007        void *linkptr = 0;
    10071008        int clen = 0;
Note: See TracChangeset for help on using the changeset viewer.