Index: Makefile =================================================================== --- Makefile (revision 2554) +++ Makefile (working copy) @@ -278,8 +278,11 @@ NEED_DES= yes .if defined ( USE_NG_BPF ) CFLAGS+= -DUSE_NG_BPF +.if ( ${USE_PCAP:U} != no ) +CFLAGS+= -DUSE_PCAP LDADD+= -lpcap DPADD+= ${LIBPCAP} +.endif .endif .if defined ( USE_NG_CAR ) CFLAGS+= -DUSE_NG_CAR Index: iface.c =================================================================== --- iface.c (revision 2555) +++ iface.c (working copy) @@ -57,7 +57,7 @@ #include #endif -#ifdef USE_NG_BPF +#if defined(USE_NG_BPF) && defined(USE_PCAP) #include #endif @@ -129,10 +129,12 @@ static int IfaceInitLimits(Bund b, char *path, char *hook); static void IfaceSetupLimits(Bund b); static void IfaceShutdownLimits(Bund b); +#ifdef USE_PCAP static int pcap_compile_nopcap_np(int snaplen_arg, int linktype_arg, struct bpf_program *program, const char *buf, int optimize, bpf_u_int32 mask); #endif +#endif static int IfaceSetCommand(Context ctx, int ac, const char *const av[], const void *arg); static void IfaceSessionTimeout(void *arg); @@ -3373,6 +3375,7 @@ IfaceSetupLimits(Bund b) hp->bpf_prog_len = MATCH_PROG_LEN; memcpy(&hp->bpf_prog, &gMatchProg, MATCH_PROG_LEN * sizeof(*gMatchProg)); +#ifdef USE_PCAP } else if (strncasecmp(av[0], "flt", 3) == 0) { struct acl *f; int flt; @@ -3452,6 +3455,7 @@ IfaceSetupLimits(Bund b) } Freee(buf); } +#endif /* USE_PCAP */ } else { Log(LG_ERR, ("[%s] IFACE: incorrect filter: '%s'", b->name, av[0])); @@ -3815,6 +3819,7 @@ IfaceFreeStats(struct svcstat *stat) } } +#ifdef USE_PCAP /* copied from libpcap/gencode.c */ int pcap_compile_nopcap_np(int snaplen_arg, int linktype_arg, @@ -3831,6 +3836,7 @@ pcap_compile_nopcap_np(int snaplen_arg, int linktype_a pcap_close(p); return (ret); } +#endif /* USE_PCAP */ #endif /* USE_NG_BPF */ /*