ANNOUNCEMENT: Live Wireshark University & Allegro Packets online APAC Wireshark Training Session
July 17th, 2024 | 10:00am-11:55am SGT (UTC+8) | Online

Ethereal-dev: Re: R: [Ethereal-dev] [PATCH] Wish list item 17 (packet generator)

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: Brad Hards <bhards@xxxxxxxxxxxxxx>
Date: Sun, 07 Sep 2003 21:15:24 +1000
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Sun, 07 Sep 2003 21:07 pm,  wrote:
> The HAVE_LIBNET define is not put in the config.h by configure. I define it
> in the top of the file for testing purposes, because I do not know how to
> change
> configure.ac and related files. I also added -lnet to LIBS directly in the
> makefile
> for the same reason. I apologize for that, perhaps with some suggestions I
> can
> learn how to do it.
Here's one I prepared earlier. The key thing to know about libnet is that
it has fundamentally incompatible API changes between 1.0.x and 1.1.x.
This version makes sure we don't have version 1.1, although making it
check for another version should be obvious:

AC_CHECK_PROG([libnetconf], [libnet-config], yes)

if test "$libnetconf" != yes; then
        AC_MSG_ERROR([*** libnet-config not found ***])
fi

AC_MSG_CHECKING(for libnet.h version 1.0.x)
libnet_dir="/usr/include /usr/local/include /usr/local/contrib/include"
for i in $libnet_dir; do
        if test -r $i/libnet.h; then
                LIBNET_INC_DIR=$i
        fi
done

if test "$LIBNET_INC_DIR" != ""; then
        if eval "grep LIBNET_VERSION $LIBNET_INC_DIR/libnet.h | grep -v 1.0 >/dev/null"; then
                FAIL_MESSAGE("libnet 1.0.x (libnet.h)", $tmp)
        fi

        CPPFLAGS="${CPPFLAGS} -I${LIBNET_INC_DIR} `libnet-config --defines`"
        CFLAGS="${CFLAGS} `libnet-config --cflags`"
        LIBS="${LIBS} `libnet-config --libs`"
        AC_MSG_RESULT(${LIBNET_INC_DIR})
else
        AC_MSG_RESULT(no)
fi
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE/WxNMW6pHgIdAuOMRAp0tAKCalRyQLGnDgUDc2yOGWfhG1ztdNQCgme3p
bc5zaSaIUaC0IAMkDQEusnA=
=vhIX
-----END PGP SIGNATURE-----