From owner-freebsd-hackers Fri Jul 27 8:30:30 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from odin.ac.hmc.edu (Odin.AC.HMC.Edu [134.173.32.75]) by hub.freebsd.org (Postfix) with ESMTP id 6AACF37B403 for ; Fri, 27 Jul 2001 08:30:26 -0700 (PDT) (envelope-from brdavis@odin.ac.hmc.edu) Received: (from brdavis@localhost) by odin.ac.hmc.edu (8.11.0/8.11.0) id f6RFUNj24391; Fri, 27 Jul 2001 08:30:23 -0700 Date: Fri, 27 Jul 2001 08:30:23 -0700 From: Brooks Davis To: Marco Molteni Cc: freebsd-hackers@FreeBSD.ORG Subject: Re: how to share include files between kernel and userland? Message-ID: <20010727083023.A21548@Odin.AC.HMC.Edu> References: <20010727105549.A4331@cobweb.example.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-md5; protocol="application/pgp-signature"; boundary="HlL+5n6rz5pIUxbD" Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20010727105549.A4331@cobweb.example.org>; from molter@tin.it on Fri, Jul 27, 2001 at 10:55:49AM +0200 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG --HlL+5n6rz5pIUxbD Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Jul 27, 2001 at 10:55:49AM +0200, Marco Molteni wrote: > I am writing a program to parse frames dumped to bpf by an, the > aironet driver. >=20 > I am using the latest patches by Doug Ambrisko, that allow the driver > to dump not only the 802.11 frame but also the special Aironet header > that the device prepends to the 802.11 frame, ie: >=20 > aironet header | 802.11 frame >=20 > Now, to my question with include files. The struct that describes the > aironet header, an_rxframe, is in an/if_anreg.h, so I included > if_anreg.h in my program. Among other things, if_anreg.h needs the > definition of struct arpcom, which is in net/if_arp.h. Good, I > included also net/if_arp.h, but the compiler still complained. It > turns out that the definition of struct arpcom is guarded by > #ifdef _KERNEL. >=20 > So, what should I do? Define _KERNEL in my program, or copy the > definition of struct an_rxframe directly in my C file? I hoped to find > a third, more elegant solution. First, apply the patches in PR 29210 if you haven't already (now that I think of it, they are probably in Doug's mega patch.) This removes all duplicate structures. Next, move an_rxframe to if_aironet_ieee.h so it's in the userland include file. The kernel now uses both of them so that should be the best answer. -- Brooks --=20 Any statement of the form "X is the one, true Y" is FALSE. PGP fingerprint 655D 519C 26A7 82E7 2529 9BF0 5D8E 8BE9 F238 1AD4 --HlL+5n6rz5pIUxbD Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (GNU/Linux) Comment: For info see http://www.gnupg.org iD8DBQE7YYkNXY6L6fI4GtQRArEMAJ4xoJq6tQcCi9d+x0aVBojhukAlBQCghTQq omC1WoxJ9LhNMH+v5Es1nuU= =dou0 -----END PGP SIGNATURE----- --HlL+5n6rz5pIUxbD-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message