Skip to content

Commit

Permalink
Centralize bpf dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
tbarbette committed Jan 25, 2022
1 parent 2903e35 commit 37a2968
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 9 deletions.
5 changes: 5 additions & 0 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -8064,6 +8064,7 @@ if test "x$ac_have_libbpf$ac_have_libbpf_h$enable_bpf" = "xyesyesyes"; then
have_libbpf=yes
else
have_libbpf=no
enable_bpf=no
fi

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing curl_global_init" >&5
Expand Down Expand Up @@ -16534,6 +16535,10 @@ if test "x$enable_auto_batch" == "xport" ; then
provisions="$provisions autobatch_port"
fi

if test "x$enable_bpf" = xyes; then
provisions="$provisions bpf"
fi

if test "x$enable_batch" = xyes; then
provisions="$provisions batch"
else
Expand Down
6 changes: 6 additions & 0 deletions configure.in
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,7 @@ if test "x$ac_have_libbpf$ac_have_libbpf_h$enable_bpf" = "xyesyesyes"; then
have_libbpf=yes
else
have_libbpf=no
enable_bpf=no
fi

AC_SEARCH_LIBS([curl_global_init], [curl], [ac_have_curl=yes], [ac_have_curl=no])
Expand Down Expand Up @@ -2639,6 +2640,11 @@ if test "x$enable_auto_batch" == "xport" ; then
provisions="$provisions autobatch_port"
fi

dnl add 'bpf' if BPF is found
if test "x$enable_bpf" = xyes; then
provisions="$provisions bpf"
fi

dnl add 'batch' if compiled with --enable-batch
if test "x$enable_batch" = xyes; then
provisions="$provisions batch"
Expand Down
8 changes: 1 addition & 7 deletions elements/userlevel/fromdevice.hh
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,8 @@
#include "elements/userlevel/kernelfilter.hh"

#if HAVE_BPF
#include <click/bpf.hh>
# define PCAP_DONT_INCLUDE_PCAP_BPF_H 1
#ifndef bpf_stats_type
enum bpf_stats_type {
/* enabled run_time_ns and run_cnt */
BPF_STATS_RUN_TIME = 0,
};
#endif
#include <bpf/bpf.h>
struct bpf_program {
u_int bf_len;
struct bpf_insn *bf_insns;
Expand Down
3 changes: 1 addition & 2 deletions elements/userlevel/xdploader.hh
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@
#include <click/hashtable.hh>
#include <click/string.hh>
#include <click/vector.hh>
#include <click/bpf.hh>

extern "C" {
#include <bpf/bpf.h>
#include <bpf/libbpf.h>
#include <net/if.h>
#include <error.h>
#include <errno.h>
Expand Down

0 comments on commit 37a2968

Please sign in to comment.