Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 10 Sep 2004 09:11:04 +0200
From:      Andreas Kohn <andreas.kohn@gmx.net>
To:        vxp <vxp@digital-security.org>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: header file related question
Message-ID:  <1094800263.838.2.camel@klamath.ankon.de.eu.org>
In-Reply-To: <20040909203816.J3744@digital-security.org>
References:  <20040909203816.J3744@digital-security.org>

next in thread | previous in thread | raw e-mail | index | archive | help

--=-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--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1094800263.838.2.camel>