From fad17b4d2bf236d45e3851ec3a9ef0dcf18e122b Mon Sep 17 00:00:00 2001 From: chris <> Date: Mon, 4 Nov 2002 15:39:28 +0000 Subject: [PATCH] "" --- README | 3 +++ configure.in | 54 ++++++++++++++++++++++++++++++++++++++++++++++------ ui.c | 2 +- 3 files changed, 52 insertions(+), 7 deletions(-) diff --git a/README b/README index bb5e4e3..153d8ec 100644 --- a/README +++ b/README @@ -31,3 +31,6 @@ interface in promiscuous mode. Therefore, you will need to use the -p option to iftop to get sensible results. Cf. http://www.tcpdump.org/lists/workers/2002/02/msg00010.html +The version of curses distributed with Solaris may not be sufficient for +iftop's needs. You will probably need ncurses or similar. + diff --git a/configure.in b/configure.in index e208efc..2cc25d3 100644 --- a/configure.in +++ b/configure.in @@ -39,6 +39,15 @@ AC_ARG_WITH(resolver, [resolver=$withval], [resolver=netdb]) +AC_ARG_WITH(libpcap, + [ --with-libpcap=WHERE Where the libpcap packet-capture library is found. + The pcap library should be installed in WHERE/lib, + and the header file in either WHERE/include or + WHERE/include/pcap. + [default=look in standard locations]], + [libpcap_prefix=$withval], + [libpcap_prefix=""]) + dnl dnl Fairly generic checks. dnl @@ -208,16 +217,49 @@ fi dnl Otherwise, no resolver at all. Boo hoo. - dnl -dnl Ensure that the machine even has libpcap. We do this late, because libpcap -dnl calls netdb functions that might need libraries on some systems.... +dnl Find libpcap. dnl -AC_CHECK_LIB(pcap, pcap_open_live, , [ - AC_MSG_ERROR([can't find libpcap +if test x$libpcap_prefix = x ; then + libpcap_prefix="/usr /usr/local /opt /software" +fi + +AC_MSG_CHECKING([where to find pcap.h]) +foundpcaph=0 +oldCPPFLAGS=$CPPFLAGS +for prefix in "" $libpcap_prefix ; do + for x in "" /pcap ; do + if test x$prefix != x ; then + CPPFLAGS="$oldCPPFLAGS -I$prefix/include$x" + fi + AC_TRY_CPP([ +#include + ], [ + AC_MSG_RESULT([$prefix/include$x]) + foundpcaph=1 + break + ]) + done + if test $foundpcaph = 1 ; then + break + fi +done + +if test $foundpcaph = 0 ; then + AC_MSG_RESULT([no idea]) + AC_MSG_ERROR([can't find pcap.h You're not going to get very far without libpcap.]) - ]) +else + dnl assume that -lpcap is under $prefix/lib + if test x$prefix != x ; then + LDFLAGS="$LDFLAGS -L$prefix" + fi + AC_CHECK_LIB(pcap, pcap_open_live, , [ + AC_MSG_ERROR([can't find libpcap + You're not going to get very far without libpcap.]) + ]) +fi foundpcap=0 AC_CHECK_HEADERS([pcap.h pcap/pcap.h], [ diff --git a/ui.c b/ui.c index 3854026..6153033 100644 --- a/ui.c +++ b/ui.c @@ -877,7 +877,7 @@ void ui_loop() { case '!': { char *s; dontshowdisplay = 1; - if ((s = edline(0, "Command", ""))) { + if ((s = edline(0, "Command", "")) && s[strspn(s, " \t")]) { int i, dowait = 0; erase(); refresh();