From owner-freebsd-arch@FreeBSD.ORG Wed Oct 1 11:55:16 2003 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3F6B716A4B3 for ; Wed, 1 Oct 2003 11:55:16 -0700 (PDT) Received: from odin.ac.hmc.edu (Odin.AC.HMC.Edu [134.173.32.75]) by mx1.FreeBSD.org (Postfix) with ESMTP id 72DD643FCB for ; Wed, 1 Oct 2003 11:55:15 -0700 (PDT) (envelope-from brdavis@odin.ac.hmc.edu) Received: from odin.ac.hmc.edu (IDENT:brdavis@localhost.localdomain [127.0.0.1]) by odin.ac.hmc.edu (8.12.9/8.12.3) with ESMTP id h91IswDH002429; Wed, 1 Oct 2003 11:54:58 -0700 Received: (from brdavis@localhost) by odin.ac.hmc.edu (8.12.9/8.12.3/Submit) id h91Isw01002424; Wed, 1 Oct 2003 11:54:58 -0700 Date: Wed, 1 Oct 2003 11:54:58 -0700 From: Brooks Davis To: Vincent Jardin Message-ID: <20031001185458.GA29576@Odin.AC.HMC.Edu> References: <20030930174815.GC31908@Odin.AC.HMC.Edu> <20031001093334.S113@beagle.fokus.fraunhofer.de> <20031001164036.GA1263@Odin.AC.HMC.Edu> <200310012038.14062.vjardin@wanadoo.fr> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="VS++wcV0S1rZb1Fb" Content-Disposition: inline In-Reply-To: <200310012038.14062.vjardin@wanadoo.fr> User-Agent: Mutt/1.5.4i X-Virus-Scanned: by amavisd-milter (http://amavis.org/) on odin.ac.hmc.edu cc: arch@freebsd.org Subject: Re: adding if_dev member to struct ifnet X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Oct 2003 18:55:16 -0000 --VS++wcV0S1rZb1Fb Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Oct 01, 2003 at 08:38:13PM +0200, Vincent Jardin wrote: > > > messier BD>example is in the new ATM code where interfaces are looked= up > > > by name. > > > > > > Where is this? > > > > One example would be in sys/netatm/atm_if.c around line 1081. >=20 > Do you mean pif_name and pif_unit ? Yes. > This code could be updated. It uses pif_unit and pif_name that could beco= me=20 > pif_xname. I've done something like this in my perforce branch (//depot/user/brooks/xname/...), but it isn't a real solution because I plan to follow up by breaking the assumption that if_xname remains constant for the life of the interface. If either if_dev or if_d{name,unit} are added, you could use those as you do now. You might consider using if_index instead since that's both unchanged over the life of the device and quick to check. > snprintf(nip->nif_xname, sizeof(nip->nif_xname), "%s%= d", > asr->asr_nif_pref, count); > nip->nif_sel =3D count; /* we need to keep a selector= to=20 > build the UNI ATM address */ >=20 > ifp->if_xname =3D nip->nif_xname; Actually, this needs to be a strlcpy. if_xname is stored in the ifnet, not as a pointer, but that's a minor detail. -- 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 --VS++wcV0S1rZb1Fb Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQE/eyL/XY6L6fI4GtQRAjR0AKC+BARVRdZeT5uHjYtNnTBf6jQrrQCgnXJw mwHbpb9/pYIFiQnSTz0RR9E= =3h0Y -----END PGP SIGNATURE----- --VS++wcV0S1rZb1Fb--