Libnet

From Genunix

libnet - packet shaping library

Contents

Rating

2 points (out of 4)

Rating scheme: 4 points means the source builds seamlessly on Solaris Express (OpenSolaris). Points are subtracted as follows:

  • Minus 1 if the source doesn't come with an automated way to localize the build (e.g. configure)
  • Minus 1 if the source won't compile with Sun's cc (this usually means the code is gcc-centric)
  • Minus 1 if a minor patch is required, or
  • Minus 2 if a major patch(es) is required

How to build libnet-1.1.2.1 on Solaris Express

Build Environment (platform, compiler, tools, PATH, ld)

Configure and compile steps (on x86 hardware)

/usr/bin/gzip -dc libnet-1.1.2.1.tar.gz | /usr/sfw/bin/gtar xf -

cd libnet


# This source is gcc-centric, therefore...
export CC=/usr/sfw/bin/gcc
# export CFLAGS="%optflags"
export CFLAGS="-O4 -fPIC -DPIC -Xlinker -i -fno-omit-frame-pointers"

export LDFLAGS="-Wl,-zignore -Wl,-zcombreloc -Wl,-Bdirect"

./configure --prefix=/usr  \
            --mandir=/usr/share/man

# Following is a hack that comments out these lines in libnet_link_dlpi.c:
#
# if (*eos != '\0')
# {
#     snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
#             "%s(): %s bad unit number\n", __func__, l->device);
#     goto bad;
# }

perl -i.orig -lne 'print q!/*! if $.==142;print q!*/! if $.==148;print' src/libnet_link_dlpi.c

# It was done because a bug here makes libnet (and therefore ettercap)
# think that the e1000g0 interface on my laptop is invalid causing ettercap
# to fatally exit as a result. Beware: this means the intent for the ommited
# code is now being circumvented.

make

Other configure options

output of ./configure --help

Directory paths that libnet installs to

include
include/libnet
lib

Other 3rd party software libnet requires

(none)