Date: Wed, 1 Oct 2003 11:54:58 -0700 From: Brooks Davis <brooks@one-eyed-alien.net> To: Vincent Jardin <vjardin@wanadoo.fr> Cc: arch@freebsd.org Subject: Re: adding if_dev member to struct ifnet Message-ID: <20031001185458.GA29576@Odin.AC.HMC.Edu> In-Reply-To: <200310012038.14062.vjardin@wanadoo.fr> References: <20030930174815.GC31908@Odin.AC.HMC.Edu> <20031001093334.S113@beagle.fokus.fraunhofer.de> <20031001164036.GA1263@Odin.AC.HMC.Edu> <200310012038.14062.vjardin@wanadoo.fr>
next in thread | previous in thread | raw e-mail | index | archive | help
[-- Attachment #1 --]
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.
>
> Do you mean pif_name and pif_unit ?
Yes.
> This code could be updated. It uses pif_unit and pif_name that could become
> 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 = count; /* we need to keep a selector to
> build the UNI ATM address */
>
> ifp->if_xname = 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
--
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
[-- Attachment #2 --]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)
iD8DBQE/eyL/XY6L6fI4GtQRAjR0AKC+BARVRdZeT5uHjYtNnTBf6jQrrQCgnXJw
mwHbpb9/pYIFiQnSTz0RR9E=
=3h0Y
-----END PGP SIGNATURE-----
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20031001185458.GA29576>
