Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 26 Jan 2011 09:21:00 -0500
From:      "b. f." <bf1783@googlemail.com>
To:        Da Rock <freebsd-questions@herveybayaustralia.com.au>
Cc:        freebsd-questions@FreeBSD.org
Subject:   Re: include file not found
Message-ID:  <AANLkTimqd0eu0vaUAs_HTy1Cp1eBcYO%2BxBWF8M4kNp3G@mail.gmail.com>

next in thread | raw e-mail | index | archive | help
Da Rock wrote:
> gcc -Wall -Wformat-security -Wno-format-zero-length  -g -O3 -I.
> -I/usr/include -I/usr/local/include  -DLIBDIR='"/lib/l2tpns"'
> -DETCDIR='"/etc/l2tpns"' -DSTATISTICS -DSTAT_CALLS -DRINGBUFFER
> -DHAVE_EPOLL -DBGP -c -o arp.o arp.c
> In file included from arp.c:8:
> /usr/include/net/if_arp.h:88: error: field 'arp_pa' has incomplete type
> /usr/include/net/if_arp.h:89: error: field 'arp_ha' has incomplete type

You seem to be missing definitions of struct sockaddr, so probably
sys/socket.h is needed.

> In file included from arp.c:9:
> /usr/include/netinet/if_ether.h:96: error: field 'sin_addr' has
> incomplete type
> /usr/include/netinet/if_ether.h:97: error: field 'sin_srcaddr' has
> incomplete type

Here it looks like you're missing struct in_addr, which is in
sys/netinet/in.h (and also arpa/inet.h).

> arp.c:20: error: 'ETH_ALEN' undeclared here (not in a function)
> arp.c: In function 'sendarp':
> arp.c:29: error: storage size of 'sll' isn't known
> arp.c:54: error: 'PF_PACKET' undeclared (first use in this function)
> arp.c:54: error: (Each undeclared identifier is reported only once
> arp.c:54: error: for each function it appears in.)
> arp.c:54: error: 'ETH_P_RARP' undeclared (first use in this function)
> arp.c:57: error: 'AF_PACKET' undeclared (first use in this function)

Some of these missing parameters are Linux-specific.

> arp.c:29: warning: unused variable 'sll'
> gmake: *** [arp.o] Error 1

As you can see, porting requires some care.  It's not only a matter of
including different headers; there are some other differences that may
require patches, and we won't be able to go through this step-by-step
on the list.  You can see what FreeBSD headers a similar FreeBSD
application needs by looking at src/usr.sbin/arp, and you can get some
help with the Linux->FreeBSD part by looking at /sys/compat/linux,

http://svn.freebsd.org/viewvc/base/projects/ofed/head/sys/ofed/include/

and

http://fxr.watson.org/

; and you might be able to cheat a bit by using a compatibility layer
like devel/gnulib, but you're going to have to go through this
carefully on your own.

b.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?AANLkTimqd0eu0vaUAs_HTy1Cp1eBcYO%2BxBWF8M4kNp3G>