Changeset f72e13d


Ignore:
Timestamp:
10/30/15 17:53:52 (6 years ago)
Author:
Shane Alcock <salcock@…>
Branches:
pfring
Children:
1598c46
Parents:
21c0d70
Message:

Started adding support for PF_RING

Very early stages -- basically it compiles and can possibly be used
with the original API, but I haven't tested it yet.

Still TODO:

test using basic libtrace examples
event API support
parallel support
RT support

Files:
1 added
5 edited

Legend:

Unmodified
Added
Removed
  • configure.in

    r32a3ec5 rf72e13d  
    424424fi
    425425
     426# Check for PF_RING
     427AC_ARG_WITH(pfring,
     428            AS_HELP_STRING(--with-pfring,include PF_RING live capture support (if PF_RING libraries are available)),
     429[
     430        if test "$withval" = no
     431        then
     432            want_pfring=no
     433        else
     434            want_pfring=ifpresent
     435        fi
     436],[
     437        want_pfring=ifpresent
     438])
     439
     440
     441
     442libtrace_pfring=false
     443if test "$want_pfring" != no; then
     444        # bit annoying that we have to include extra libs to account for
     445        # optional pfring modules that depend on these libs
     446        AC_SEARCH_LIBS(pfring_recv, pfring, pfring_found=1, pfring_found=0,[-ldag -lpcap])
     447        if test "$pfring_found" = 1; then
     448                ADD_LIBS="$ADD_LIBS -lpfring"
     449                LIBTRACE_LIBS="$LIBTRACE_LIBS -lpfring"
     450                AC_DEFINE(HAVE_PFRING,1,[conditional for building with DAG live capture support])
     451                libtrace_pfring=true
     452        fi     
     453fi
     454
    426455# Check for PACKET_FANOUT (borrowed from Suricata)
    427456AC_CHECK_DECL([PACKET_FANOUT],
     
    589618AM_CONDITIONAL([HAVE_BPF_CAPTURE], [test "$ac_cv_have_decl_BIOCSETIF" = yes ])
    590619AM_CONDITIONAL([HAVE_DAG], [test "$libtrace_dag" = true])
     620AM_CONDITIONAL([HAVE_PFRING], [test "$libtrace_pfring" = true])
    591621AM_CONDITIONAL([HAVE_DPDK], [test "$libtrace_dpdk" = true])
    592622AM_CONDITIONAL([DAG2_4], [test "$libtrace_dag_version" = 24])
     
    670700        AC_MSG_NOTICE([Note: Requires DPDK v1.5 or newer])
    671701fi
     702
     703if test x"$libtrace_pfring" = xtrue; then
     704        AC_MSG_NOTICE([Compiled with PF_RING live capture support: Yes])
     705else
     706        AC_MSG_NOTICE([Compiled with PF_RING live capture support: No])
     707fi
     708
    672709reportopt "Compiled with LLVM BPF JIT support" $JIT
    673710reportopt "Building man pages/documentation" $libtrace_doxygen
  • lib/Makefile.am

    re63d80d rf72e13d  
    5050endif
    5151
     52if HAVE_PFRING
     53NATIVEFORMATS += format_pfring.c
     54endif
     55
    5256libtrace_la_SOURCES = trace.c trace_parallel.c common.h \
    5357                format_erf.c format_pcap.c format_legacy.c \
  • lib/libtrace.h.in

    rd391ce0 rf72e13d  
    392392        TRACE_FORMAT_RAWERF       =16,  /**< Special format for reading uncompressed ERF traces without checking for compression */
    393393    TRACE_FORMAT_DPDK     =17, /**< The Intel Data Plane Development Kit format */
     394        TRACE_FORMAT_PFRING       =18,
    394395};
    395396
     
    445446    /** RT is encapsulating a Intel DPDK capture record */
    446447        TRACE_RT_DATA_DPDK=TRACE_RT_DATA_SIMPLE+TRACE_FORMAT_DPDK,
     448
     449        /** RT is encapsulating a PF_RING capture record */
     450        TRACE_RT_DATA_PFRING = TRACE_RT_DATA_SIMPLE + TRACE_FORMAT_PFRING,
    447451
    448452        /** As PCAP does not store the linktype with the packet, we need to
  • lib/libtrace_int.h

    rd8b05b7 rf72e13d  
    12631263void dpdk_constructor(void);
    12641264#endif
     1265#if HAVE_PFRING
     1266void pfring_constructor(void);
     1267#endif
    12651268
    12661269/** Extracts the RadioTap flags from a wireless link header
  • lib/trace.c

    r92a2bf6 rf72e13d  
    155155#ifdef HAVE_DPDK
    156156        dpdk_constructor();
     157#endif
     158#ifdef HAVE_PFRING
     159        pfring_constructor();   
    157160#endif
    158161        }
Note: See TracChangeset for help on using the changeset viewer.