Skip site navigation (1)Skip section navigation (2)
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

--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--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20031001185458.GA29576>