From owner-freebsd-questions@FreeBSD.ORG Wed Jan 26 17:52:20 2011 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CF8D9106564A for ; Wed, 26 Jan 2011 17:52:20 +0000 (UTC) (envelope-from freebsd-questions@herveybayaustralia.com.au) Received: from mail.unitedinsong.com.au (mail.unitedinsong.com.au [150.101.178.33]) by mx1.freebsd.org (Postfix) with ESMTP id 479B88FC1A for ; Wed, 26 Jan 2011 17:52:20 +0000 (UTC) Received: from laptop1.herveybayaustralia.com.au (laptop1.herveybayaustralia.com.au [192.168.0.186]) by mail.unitedinsong.com.au (Postfix) with ESMTP id 2D6F25C44 for ; Thu, 27 Jan 2011 03:59:24 +1000 (EST) Message-ID: <4D405EA6.2020606@herveybayaustralia.com.au> Date: Thu, 27 Jan 2011 03:49:26 +1000 From: Da Rock User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.1.16) Gecko/20101227 Thunderbird/3.0.11 ThunderBrowse/3.3.4 MIME-Version: 1.0 To: freebsd-questions@freebsd.org References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: include file not found X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Jan 2011 17:52:20 -0000 On 01/27/11 00:21, b. f. wrote: > 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. > Got that one. > >> 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). > And that one- missed arpa/inet.h though :) > >> 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, > Yes, I was thinking of asking that question. linux/packet.h system, is there a compatible bsd version to this (even deprecated?)? Mind you, from what I've read it could even be deprecated itself :) It was released in 2002 after all. According to some references, you're supposed to be using kernel/if_ether.h. The code I'm building doesn't appear to have changed much in nearly a year, so I don't know. > 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. > I'm hoping to win this one myself; I've been trying to get a better handle on the internals of FreeBSD so I can do more patching when things go wrong and be able to submit those instead of complaining its just 'broke'. This just might help me 'cut my teeth'. I might ask just a few dumb questions along the way though :) One thing I don't understand, though, apparently this code just builds on FreeBSD according to the site I'm following (7.2). I'm going to have a closer look at that and see whats up...