From owner-freebsd-hackers@FreeBSD.ORG Mon Sep 20 00:51:53 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 1DDE716A4CE; Mon, 20 Sep 2004 00:51:53 +0000 (GMT) Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.177]) by mx1.FreeBSD.org (Postfix) with ESMTP id AC23043D2F; Mon, 20 Sep 2004 00:51:52 +0000 (GMT) (envelope-from max@love2party.net) Received: from [212.227.126.155] (helo=mrelayng.kundenserver.de) by moutng.kundenserver.de with esmtp (Exim 3.35 #1) id 1C9CPH-0007iV-00; Mon, 20 Sep 2004 02:51:51 +0200 Received: from [217.227.156.246] (helo=donor.laier.local) by mrelayng.kundenserver.de with asmtp (TLSv1:RC4-MD5:128) (Exim 3.35 #1) id 1C9CPH-0007Jw-00; Mon, 20 Sep 2004 02:51:51 +0200 From: Max Laier To: freebsd-arch@freebsd.org Date: Mon, 20 Sep 2004 02:50:40 +0200 User-Agent: KMail/1.7 MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart3113315.aWgR6iTeVk"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <200409200250.49518.max@love2party.net> X-Provags-ID: kundenserver.de abuse@kundenserver.de auth:61c499deaeeba3ba5be80f48ecc83056 cc: freebsd-hackers@freebsd.org cc: freebsd-standards@freebsd.org cc: freebsd-net@freebsd.org Subject: Global (non _KERNEL) place for sockaddr_union? 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: Mon, 20 Sep 2004 00:51:53 -0000 --nextPart3113315.aWgR6iTeVk Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Hi, http://www.freebsd.org/cgi/query-pr.cgi?pr=3Dkern/71836 is the symptom. Now= I am=20 looking for a clean solution to it. What is needed is an include file that= =20 defines union sockaddr_union in a way that is useable from kernel and=20 userland. Historically it seems that this union first apeared in context of= =20 ipsec within the kernel. pf has adopted it, but uses it in the userland as= =20 well. I am sure that it can be usefull in a lot of places that have to deal= =20 with/store different address formats. My question now is, what would be a good place to define this? Are there an= y=20 fromal standarts that might define it already? (Couldn't find anything) Is= =20 there anything else that I must consider? At some point I though netinet/in.h might be a good place, but that'd requi= re=20 inclusion of sys/socket.h, which certainly is not a good solution. Opinions? Ideas? > #include > #include >=20 > union sockaddr_union { > struct sockaddr sa; > struct sockaddr_in sin; > struct sockaddr_in6 sin6; > struct sockaddr_storage __su_pad; /* maybe not a bad idea */ > }; =46reeBSD: netipsec/keydb.h, line 43 (_KERNEL) NetBSD: netipsec/keydb.h, line 46 (_KERNEL) OpenBSD: netinet/ip_ipsp.h, line 50 (non _KERNEL) KAME: net/pfvar.h, line 699 (non _KERNEL, ! __OpenBSD__) Linux: Doesn't seem to have it. Or has it under a different name? =2D-=20 /"\ Best regards, | mlaier@freebsd.org \ / Max Laier | ICQ #67774661 X http://pf4freebsd.love2party.net/ | mlaier@EFnet / \ ASCII Ribbon Campaign | Against HTML Mail and News --nextPart3113315.aWgR6iTeVk Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.6 (FreeBSD) iD8DBQBBTilpXyyEoT62BG0RAmpDAJ9IVZ1sV1GhHYyMXaAIx2hBZ9Bo1QCfaIYn XH9Pl7Y8VcPBVr9kgjdhvc8= =QH3p -----END PGP SIGNATURE----- --nextPart3113315.aWgR6iTeVk--