Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 52000
Collapse All | Expand All

(-)ngrep-1.42/config.h.in (+1 lines)
Lines 18-20 Link Here
18
#define DROPPRIVS_USER         @DROPPRIVS_USER@
18
#define DROPPRIVS_USER         @DROPPRIVS_USER@
19
#define DROPPRIVS_ONLY_ROOT    @DROPPRIVS_ONLY_ROOT@
19
#define DROPPRIVS_ONLY_ROOT    @DROPPRIVS_ONLY_ROOT@
20
20
21
#define USE_PCAP_BPF           @USE_PCAP_BPF@
(-)ngrep-1.42/configure.in (-84 / +98 lines)
Lines 10-16 Link Here
10
AC_INIT(ngrep.c)
10
AC_INIT(ngrep.c)
11
11
12
echo
12
echo
13
echo 'Configuring System ...'
13
echo 'Configuring System hehe...'
14
echo
14
echo
15
15
16
AC_CANONICAL_SYSTEM
16
AC_CANONICAL_SYSTEM
Lines 162-217 Link Here
162
echo 'Configuring Network Grep (ngrep) ...'
162
echo 'Configuring Network Grep (ngrep) ...'
163
echo 
163
echo 
164
164
165
dnl
166
dnl Check for DLT_* types that might not have existed in older
167
dnl libpcap's
168
dnl
169
170
present=""
171
AC_MSG_CHECKING(for DLT_LINUX_SLL in bpf.h)
172
AC_EGREP_CPP(yes,
173
[
174
#include <net/bpf.h>
175
#ifdef DLT_LINUX_SLL
176
yes
177
#endif
178
],
179
[HAVE_DLT_LINUX_SLL="1" && echo yes], [HAVE_DLT_LINUX_SLL="0" && echo no])
180
181
present=""
182
AC_MSG_CHECKING(for DLT_LOOP in bpf.h)
183
AC_EGREP_CPP(yes,
184
[
185
#include <net/bpf.h>
186
#ifdef DLT_LOOP
187
yes
188
#endif
189
],
190
[HAVE_DLT_LOOP="1" && echo yes], [HAVE_DLT_LOOP="0" && echo no])
191
192
193
present=""
194
AC_MSG_CHECKING(for DLT_IEEE802_11 in bpf.h)
195
AC_EGREP_CPP(yes,
196
[
197
#include <net/bpf.h>
198
#ifdef DLT_IEEE802_11
199
yes
200
#endif
201
],
202
[HAVE_DLT_IEEE802_11="1" && echo yes], [HAVE_DLT_IEEE802_11="0" && echo no])
203
204
205
present=""
206
AC_MSG_CHECKING(for DLT_RAW in bpf.h)
207
AC_EGREP_CPP(yes,
208
[
209
#include <net/bpf.h>
210
#ifdef DLT_RAW
211
yes
212
#endif
213
],
214
[HAVE_DLT_RAW="1" && echo yes], [HAVE_DLT_RAW="0" && echo no])
215
165
216
166
217
dnl
167
dnl
Lines 315-340 Link Here
315
EXTRA_DEFINES="$EXTRA_DEFINES -D_BSD_SOURCE=1 -D__FAVOR_BSD=1"
265
EXTRA_DEFINES="$EXTRA_DEFINES -D_BSD_SOURCE=1 -D__FAVOR_BSD=1"
316
266
317
267
318
dnl
319
dnl Now that we're past the OS-specific stuff, which could have
320
dnl modified our USE_* and other defines, define them all now.
321
dnl 
322
323
AC_DEFINE_UNQUOTED(USE_PCAP_RESTART,    $USE_PCAP_RESTART)
324
325
AC_DEFINE_UNQUOTED(USE_PCRE,            $USE_PCRE)
326
327
AC_DEFINE_UNQUOTED(USE_DROPPRIVS,       $USE_DROPPRIVS)
328
AC_DEFINE_UNQUOTED(DROPPRIVS_USER,     "$DROPPRIVS_USER")
329
AC_DEFINE_UNQUOTED(DROPPRIVS_ONLY_ROOT, $DROPPRIVS_ONLY_ROOT)
330
331
AC_DEFINE_UNQUOTED(HAVE_DUMB_UDPHDR,    $HAVE_DUMB_UDPHDR)
332
333
AC_DEFINE_UNQUOTED(HAVE_DLT_RAW,        $HAVE_DLT_RAW) 
334
AC_DEFINE_UNQUOTED(HAVE_DLT_IEEE802_11, $HAVE_DLT_IEEE802_11) 
335
AC_DEFINE_UNQUOTED(HAVE_DLT_LOOP,       $HAVE_DLT_LOOP) 
336
AC_DEFINE_UNQUOTED(HAVE_DLT_LINUX_SLL,  $HAVE_DLT_LINUX_SLL) 
337
338
268
339
dnl
269
dnl
340
dnl Find ourselves some usable PCAP headers.
270
dnl Find ourselves some usable PCAP headers.
Lines 353-374 Link Here
353
[PCAP_DIR=$possible_dirs])
283
[PCAP_DIR=$possible_dirs])
354
284
355
pcap_dir=""
285
pcap_dir=""
356
for dir in $PCAP_DIR ; do 
286
for dir in $PCAP_DIR ; do
357
    if test -d $dir -a -r "$dir/pcap.h" -a \
287
    if test -d $dir ; then
358
                       -r "$dir/net/bpf.h" ; then 
288
        if test -r "$dir/pcap.h" ; then
359
       if test -n "$pcap_dir" -a "$pcap_dir" != "$dir"; then
289
            if test -r "$dir/net/$bpf_h" -o -r "$dir/pcap-$bpf_h" ; then
360
          echo 
290
                if test -n "$pcap_dir" -a "$pcap_dir" != "$dir"; then
361
          echo; echo more than one set found in:
291
                  echo 
362
          echo  $pcap_dir 
292
                  echo; echo more than one set found in:
363
          echo  $dir
293
                  echo  $pcap_dir 
364
          echo; echo please wipe out all unused pcap installations
294
                  echo  $dir
365
          exit
295
                  echo; echo please wipe out all unused pcap installations
366
       else 
296
                  exit
367
          pcap_dir="$dir"
297
                else 
368
       fi
298
                  pcap_dir="$dir"
299
                fi
300
            fi
301
        fi
369
    fi
302
    fi
370
done
303
done
371
304
305
if test -r "$pcap_dir/pcap-bpf.h" ; then
306
  bpf_h="pcap-bpf.h"
307
  USE_PCAP_BPF="1"&&echo "bpf: use <pcap-bpf.h>"
308
else
309
  bpf_h="net/bpf.h"
310
  USE_PCAP_BPF="0"&&echo "bpf: use <net/bpf.h>"
311
fi
312
372
if test -z "$pcap_dir" ; then
313
if test -z "$pcap_dir" ; then
373
   echo no; echo couldn\'t find a complete set of pcap headers
314
   echo no; echo couldn\'t find a complete set of pcap headers
374
   exit
315
   exit
Lines 384-389 Link Here
384
fi
325
fi
385
326
386
dnl
327
dnl
328
dnl Check for DLT_* types that might not have existed in older
329
dnl libpcap's
330
dnl
331
332
present=""
333
AC_MSG_CHECKING(for DLT_LINUX_SLL in $bpf_h)
334
AC_EGREP_CPP(yes,
335
[
336
#include <$bpf_h>
337
#ifdef DLT_LINUX_SLL
338
yes
339
#endif
340
],
341
[HAVE_DLT_LINUX_SLL="1" && echo yes], [HAVE_DLT_LINUX_SLL="0" && echo no])
342
343
present=""
344
AC_MSG_CHECKING(for DLT_LOOP in $bpf_h)
345
AC_EGREP_CPP(yes,
346
[
347
#include <$bpf_h>
348
#ifdef DLT_LOOP
349
yes
350
#endif
351
],
352
[HAVE_DLT_LOOP="1" && echo yes], [HAVE_DLT_LOOP="0" && echo no])
353
354
355
present=""
356
AC_MSG_CHECKING(for DLT_IEEE802_11 in $bpf_h)
357
AC_EGREP_CPP(yes,
358
[
359
#include <$bpf_h>
360
#ifdef DLT_IEEE802_11
361
yes
362
#endif
363
],
364
[HAVE_DLT_IEEE802_11="1" && echo yes], [HAVE_DLT_IEEE802_11="0" && echo no])
365
366
367
present=""
368
AC_MSG_CHECKING(for DLT_RAW in $bpf_h)
369
AC_EGREP_CPP(yes,
370
[
371
#include <$bpf_h>
372
#ifdef DLT_RAW
373
yes
374
#endif
375
],
376
[HAVE_DLT_RAW="1" && echo yes], [HAVE_DLT_RAW="0" && echo no])
377
dnl
387
dnl And the library..
378
dnl And the library..
388
dnl
379
dnl
389
380
Lines 410-415 Link Here
410
AC_DEFINE_UNQUOTED(PCAP_RESTART_FUNC, $pcap_restart_func)
401
AC_DEFINE_UNQUOTED(PCAP_RESTART_FUNC, $pcap_restart_func)
411
402
412
dnl
403
dnl
404
dnl Now that we're past the OS-specific stuff, which could have
405
dnl modified our USE_* and other defines, define them all now.
406
dnl 
407
408
AC_DEFINE_UNQUOTED(USE_PCAP_RESTART,    $USE_PCAP_RESTART)
409
410
AC_DEFINE_UNQUOTED(USE_PCRE,            $USE_PCRE)
411
412
AC_DEFINE_UNQUOTED(USE_DROPPRIVS,       $USE_DROPPRIVS)
413
AC_DEFINE_UNQUOTED(DROPPRIVS_USER,     "$DROPPRIVS_USER")
414
AC_DEFINE_UNQUOTED(DROPPRIVS_ONLY_ROOT, $DROPPRIVS_ONLY_ROOT)
415
416
AC_DEFINE_UNQUOTED(HAVE_DUMB_UDPHDR,    $HAVE_DUMB_UDPHDR)
417
418
AC_DEFINE_UNQUOTED(HAVE_DLT_RAW,        $HAVE_DLT_RAW) 
419
AC_DEFINE_UNQUOTED(HAVE_DLT_IEEE802_11, $HAVE_DLT_IEEE802_11) 
420
AC_DEFINE_UNQUOTED(HAVE_DLT_LOOP,       $HAVE_DLT_LOOP) 
421
AC_DEFINE_UNQUOTED(HAVE_DLT_LINUX_SLL,  $HAVE_DLT_LINUX_SLL) 
422
AC_DEFINE_UNQUOTED(USE_PCAP_BPF,        $USE_PCAP_BPF) 
423
424
425
426
dnl
413
dnl AC_SUBST in the tack-on globals..
427
dnl AC_SUBST in the tack-on globals..
414
dnl
428
dnl
415
429
(-)ngrep-1.42/ngrep.c (-1 / +8 lines)
Lines 55-61 Link Here
55
#include <netinet/ip_icmp.h>
55
#include <netinet/ip_icmp.h>
56
56
57
#include <pcap.h>
57
#include <pcap.h>
58
#include <net/bpf.h>
58
59
59
60
#include <stdlib.h>
60
#include <stdlib.h>
61
#include <string.h>
61
#include <string.h>
Lines 68-73 Link Here
68
#include "config.h"
68
#include "config.h"
69
#endif
69
#endif
70
70
71
#if USE_PCAP_BPF
72
#include <pcap-bpf.h>
73
#else
74
#include <net/bpf.h>
75
#endif
76
77
71
#if USE_PCRE
78
#if USE_PCRE
72
#include "pcre-3.4/pcre.h"
79
#include "pcre-3.4/pcre.h"
73
#else
80
#else

Return to bug 52000