From owner-freebsd-standards@FreeBSD.ORG Tue Sep 21 10:02:25 2004 Return-Path: Delivered-To: freebsd-standards@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D87CF16A4CE; Tue, 21 Sep 2004 10:02:25 +0000 (GMT) Received: from arginine.spc.org (arginine.spc.org [195.206.69.236]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9051743D4C; Tue, 21 Sep 2004 10:02:25 +0000 (GMT) (envelope-from bms@spc.org) Received: from localhost (localhost [127.0.0.1]) by arginine.spc.org (Postfix) with ESMTP id B72AD653B5; Tue, 21 Sep 2004 11:02:24 +0100 (BST) Received: from arginine.spc.org ([127.0.0.1]) by localhost (arginine.spc.org [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 22905-02; Tue, 21 Sep 2004 11:02:24 +0100 (BST) Received: from empiric.dek.spc.org (adsl-67-121-95-65.dsl.snfc21.pacbell.net [67.121.95.65]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by arginine.spc.org (Postfix) with ESMTP id A265E65213; Tue, 21 Sep 2004 11:02:23 +0100 (BST) Received: by empiric.dek.spc.org (Postfix, from userid 1001) id 0F3BA6455; Tue, 21 Sep 2004 03:02:20 -0700 (PDT) Date: Tue, 21 Sep 2004 03:02:20 -0700 From: Bruce M Simpson To: Max Laier Message-ID: <20040921100220.GC842@empiric.icir.org> Mail-Followup-To: Max Laier , freebsd-arch@freebsd.org, freebsd-hackers@freebsd.org, freebsd-standards@freebsd.org, freebsd-net@freebsd.org References: <200409200250.49518.max@love2party.net> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="FCuugMFkClbJLl1L" Content-Disposition: inline In-Reply-To: <200409200250.49518.max@love2party.net> cc: freebsd-hackers@freebsd.org cc: freebsd-net@freebsd.org cc: freebsd-standards@freebsd.org cc: freebsd-arch@freebsd.org Subject: Re: Global (non _KERNEL) place for sockaddr_union? X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Sep 2004 10:02:26 -0000 --FCuugMFkClbJLl1L Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Sep 20, 2004 at 02:50:40AM +0200, Max Laier wrote: > My question now is, what would be a good place to define this? Are there = any=20 > fromal standarts that might define it already? (Couldn't find anything) I= s=20 > there anything else that I must consider? I think Brooks' recommendation is sound and should probably be followed as it's fairly close to my original recommendation to you in private. The problem is that the definition of the union depends on what you wish to use it for, and which address families are visible to the application or kernel module which is using the definition. You may find that such a definition has to have conditionalized members. This is usually not a problem so long as they are all the same size. And a sockaddr union embedded in a struct probably should have a member with type 'struct sockaddr_storage' if it's to support all address families in future, although this commits more storage in the enclosing struct and may waste space in some cases. As you point out, you cannot do this in pf, as it defeats the intent of keeping larger members out of the table in the first place, and the union is there to make some casts go away. If it's any consolation, I'm going through very similar pain with XORP's new firewall manager right now with respect to address families (and templatized C++ classes). Regards, BMS --FCuugMFkClbJLl1L Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Comment: '' iD8DBQFBT/wsueUpAYYNtTsRAnCbAKCZrI2SsVz6q/Uu0loceoJREQc/zACggs6O e98ZL0h6Z/r8TWtUkJ8P+30= =buDH -----END PGP SIGNATURE----- --FCuugMFkClbJLl1L--