[EMAIL PROTECTED] wrote: > On 12/31/05, Gilbert Fernandes <[EMAIL PROTECTED]> 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 _______________________________________________ [email protected] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "[EMAIL PROTECTED]"

