From owner-freebsd-hackers@FreeBSD.ORG Fri Sep 10 07:11:10 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5592416A4CE for ; Fri, 10 Sep 2004 07:11:10 +0000 (GMT) Received: from mail.gmx.net (imap.gmx.net [213.165.64.20]) by mx1.FreeBSD.org (Postfix) with SMTP id 43EB443D41 for ; Fri, 10 Sep 2004 07:11:07 +0000 (GMT) (envelope-from andreas.kohn@gmx.net) Received: (qmail 18740 invoked by uid 65534); 10 Sep 2004 07:11:05 -0000 Received: from unknown (EHLO [212.204.44.203]) (212.204.44.203) by mail.gmx.net (mp011) with SMTP; 10 Sep 2004 09:11:05 +0200 X-Authenticated: #2431876 From: Andreas Kohn To: vxp In-Reply-To: <20040909203816.J3744@digital-security.org> References: <20040909203816.J3744@digital-security.org> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-3fscoZyHCA3OFp3rz3PA" Message-Id: <1094800263.838.2.camel@klamath.ankon.de.eu.org> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.6 Date: Fri, 10 Sep 2004 09:11:04 +0200 cc: freebsd-hackers@freebsd.org Subject: Re: header file related question X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Sep 2004 07:11:10 -0000 --=-3fscoZyHCA3OFp3rz3PA Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On Fri, 2004-09-10 at 02:38, vxp wrote: > hi, >=20 > i realize it's most likely a stupid question, but try not to be too hard > on me please - i'm trying to learn :) >=20 > i'm experimenting with the kernel's source, and i'm not quite sure how to > find what all the header files are that i need, for the stuff i'd like to > do.. how do i track down what header files i need to #include in my stuff= ? >=20 > for instance, i'm trying to modify icmp_input() (found in > /sys/netinet/ip_icmp.c) and load the new function via a kernel module. >=20 > so, i copied all the #include's from /sys/netinet/ip_icmp.c and only have > the icmp_input() function (unmodified right now, from the form i found > it), the header files from the original ip_icmp, and a main() that > simply returns 0. doesn't want to compile, with errors about header files > such as: > --------------- > In file included from icmp.c:37: > /usr/include/netinet/in_var.h:50: error: field `ia_ifa' has incomplete > type > In file included from /usr/include/netinet/in_var.h:238, > from icmp.c:37: > /usr/include/netinet6/in6_var.h:103: error: field `ia_ifa' has incomplete > type > --------------- > i realize that it's most likely because i didn't #include something else = i > need.. but how come /sys/netinet/ip_icmp.c compiles, then? because this > file is basically that, with all functions but icmp_input removed, and a > main() that does nothing.. >=20 > so.. sorry for the long post. > but please tell me how do i find out what header files i need ? :) >=20 > thanks. >=20 Hi, just guessing: Did you compile with -D_KERNEL? HTH, Andreas --=-3fscoZyHCA3OFp3rz3PA Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (FreeBSD) iD8DBQBBQVOHYucd7Ow1ygwRAmsVAJwOyHcdFiXvt96EX2265KXbnY6NVwCffF9P MbWvGImCCygc+iu/xzSjI7Q= =tXsj -----END PGP SIGNATURE----- --=-3fscoZyHCA3OFp3rz3PA--