Re: adding if_dev member to struct ifnet

From: Brooks Davis (brooks_at_one-eyed-alien.net)
Date: 10/01/03

  • Next message: Vincent Jardin: "Re: adding if_dev member to struct ifnet"
    Date: Wed, 1 Oct 2003 11:54:58 -0700
    To: Vincent Jardin <vjardin@wanadoo.fr>
    
    
    

    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 message: Vincent Jardin: "Re: adding if_dev member to struct ifnet"

    Relevant Pages

    • Re: adding if_dev member to struct ifnet
      ... > I've done something like this in my perforce branch ... > I plan to follow up by breaking the assumption that if_xname remains ... > over the life of the device and quick to check. ...
      (freebsd-arch)
    • Paying George Sodini respects and fulfilling hist last wishes!
      ... Every black man should get a young white girl ... Many of the young girls here ... And did it maybe only 50-75 times in my life. ... I should have exit plan done and practiced by ...
      (soc.men)
    • Re: OT - cell phone advice
      ... purchase to get "double minutes for life", with this plan every time ... With the Double Minutes for Life remember that it goes with the phone. ... Emergency: I ran out of gas ON A FREEWAY ON-RAMP AT RUSH HOUR. ... I waved my cell phone as signal "I'm OK". ...
      (alt.home.repair)
    • Re: Will Mohammad be executed tonight ?
      ... who actually did the shooting didn't go with him. ... food on him for many years. ... He got life without the possibility of parole, ... Part of his testimony concerned Muhammad's complete, multiphase plan. ...
      (soc.retirement)
    • Re: Will Mohammad be executed tonight ?
      ... who actually did the shooting didn't go with him. ... food on him for many years. ... jail for life, even if he somehow manages to completely turn his life ... Part of his testimony concerned Muhammad's complete, multiphase plan. ...
      (soc.retirement)