Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 31 Dec 2005 10:25:57 -0500
From:      ari edelkind <edelkind-freebsd-hackers@episec.com>
To:        freebsd-hackers@freebsd.org
Subject:   Re: Problem about libnet on FreeBSD 6.0
Message-ID:  <20051231152557.GE15481@episec.com>
In-Reply-To: <1fa17f810512310455l3146b840w12a1a53361029608@mail.gmail.com>
References:  <1fa17f810512301341w5b98d554g6dcf950ab26f31bd@mail.gmail.com> <20051231133853.pyq2hfoow4sgcsw8@webmail.spamcop.net> <1fa17f810512310455l3146b840w12a1a53361029608@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
guomingyan@gmail.com wrote:

> On 12/31/05, Gilbert Fernandes <gilbert.fernandes@spamcop.net> wrote:
> >
> > > I find that I can't include <net/ethernet.h> when I programming
> > > with libnet,because $(CC) complains that "struct ether_addr redefined".
> > > But I need some definitions in <net/ethernet.h>,struct ether_header etc.
> > > Currently,I just copy the definitions I need from <net/ethernet.h>,but
> > > it seems very ugly.Any one has some good ideas?
> >
> Here is my include lines,
> #include ......
> #include <net/ethernet.h>
> #include <pcap.h>
> #include <libnet.h>
> ...........
> and this is the error,
> $(CC) said "/usr/local/include/./libnet/libnet-headers.h:393: error:
> redefinition of `struct ether_addr'"
> 

Assuming that either the practical contents of 'struct ether_addr' are
the same for both definitions or that it doesn't matter for any inline
functions you may be using within the header file (chances are, this
assumption is valid):

#include <net/ethernet.h>
#include <pcap.h>
#define ether_addr ether_addr_BROKEN_LIBNET
# include <libnet.h>
#undef ether_addr
....

ari




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20051231152557.GE15481>