Date: Mon, 20 Sep 2004 02:50:40 +0200 From: Max Laier <max@love2party.net> To: freebsd-arch@freebsd.org Cc: freebsd-net@freebsd.org Subject: Global (non _KERNEL) place for sockaddr_union? Message-ID: <200409200250.49518.max@love2party.net>
next in thread | raw e-mail | index | archive | help
--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 <sys/socket.h> > #include <netinet/in.h> >=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--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200409200250.49518.max>