From owner-freebsd-hackers Fri Jul 27 9:32:33 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from ambrisko.com (adsl-64-174-51-42.dsl.snfc21.pacbell.net [64.174.51.42]) by hub.freebsd.org (Postfix) with ESMTP id 9F0D637B401 for ; Fri, 27 Jul 2001 09:32:30 -0700 (PDT) (envelope-from ambrisko@ambrisko.com) Received: (from ambrisko@localhost) by ambrisko.com (8.11.3/8.11.3) id f6RGVHe25019; Fri, 27 Jul 2001 09:31:17 -0700 (PDT) (envelope-from ambrisko) From: Doug Ambrisko Message-Id: <200107271631.f6RGVHe25019@ambrisko.com> Subject: Re: how to share include files between kernel and userland? In-Reply-To: <20010727105549.A4331@cobweb.example.org> "from Marco Molteni at Jul 27, 2001 10:55:49 am" To: Marco Molteni Date: Fri, 27 Jul 2001 09:31:17 -0700 (PDT) Cc: freebsd-hackers@FreeBSD.ORG X-Mailer: ELM [version 2.4ME+ PL82 (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII 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 Marco Molteni writes: | I am writing a program to parse frames dumped to bpf by an, the | aironet driver. | | 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: | | aironet header | 802.11 frame | | 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. | | 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. Don't include that file only include if_aironet_ieee.h. Really we should install this file in the standard /usr/include tree so you don't need the /sys tree around to build it and ancontrol. I'll move the an_rxframe struct to if_aironet_ieee.h. Note that I'm not to sure how pcap is going to like my made up type. If you send my some sample code on dump the Aironet header I can test it for you to make sure it works since I haven't got around to it. There were some people interested in the Aironet header so I put something together but never tried doing anything usefull with it. Doug A. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message