adding if_dev member to struct ifnet
Brooks Davis
brooks at one-eyed-alien.net
Wed Oct 1 11:55:16 PDT 2003
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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-arch/attachments/20031001/438dedd2/attachment.bin
More information about the freebsd-arch
mailing list