From owner-freebsd-questions@FreeBSD.ORG Wed Jan 26 14:21:02 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 3AEC71065674 for ; Wed, 26 Jan 2011 14:21:02 +0000 (UTC) (envelope-from bf1783@googlemail.com) Received: from mail-gw0-f54.google.com (mail-gw0-f54.google.com [74.125.83.54]) by mx1.freebsd.org (Postfix) with ESMTP id EEB418FC1E for ; Wed, 26 Jan 2011 14:21:01 +0000 (UTC) Received: by gwj21 with SMTP id 21so151170gwj.13 for ; Wed, 26 Jan 2011 06:21:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:mime-version:reply-to:date:message-id:subject :from:to:cc:content-type; bh=UKa9Kpm5H2tZj8YmgZki2RMVxj/p82X9koqvuLO+2wM=; b=mUxW0pNjC3q0gRhhlnpbsvkRd5WEk+OWrrfqyFpOkhh3Vc1mWE/cZE17gNk8VuVK9S +aGOtDElV9DfsSk0gjlgFNVi/ySilcFLYVjBdZMgypNL0DOnkGaXTzbdu/59lBgbvNAI MmsCY4qW/YCwqTSbqhw8PMNVItHJj+huOKMeY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=mime-version:reply-to:date:message-id:subject:from:to:cc :content-type; b=IW1h/2ae6EAGn9MkefyArHPmnbhtsjIFM5Fq3eoBJpjCo928rK983wPDyCv/I+6E7T WtHp/r+lh5PPcV5GPmyLtyDJluA/bWQZ0FU/OzGZWB4JojkEB0BqLowE2z03YDhICVo+ 1YdxzRQnWa0rjYSiWaJSkPCOTvLZTq4KB0FOc= MIME-Version: 1.0 Received: by 10.236.111.43 with SMTP id v31mr2651822yhg.23.1296051660131; Wed, 26 Jan 2011 06:21:00 -0800 (PST) Received: by 10.236.105.197 with HTTP; Wed, 26 Jan 2011 06:21:00 -0800 (PST) Date: Wed, 26 Jan 2011 09:21:00 -0500 Message-ID: From: "b. f." To: Da Rock Content-Type: text/plain; charset=ISO-8859-1 Cc: freebsd-questions@FreeBSD.org Subject: Re: include file not found X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: bf1783@gmail.com List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Jan 2011 14:21:02 -0000 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.