Re: 'struct ifnet' question!

From: Max Laier (max_at_love2party.net)
Date: 04/29/04

  • Next message: Eugene Grosbein: "ripd, multicast and route to 224.0.0.0/4"
    To: freebsd-net@freebsd.org
    Date: Thu, 29 Apr 2004 14:22:47 +0200
    
    
    
    

    On Thursday 29 April 2004 12:15, Artis Caune wrote:
    <...>
    > Yeh, this works as expected, but I wonder if I can
    > use ifp->index instead of ifp->if_xname.
    > Using 'index + array pointer feature' I can find decision
    > tree in just one? memory access step, compared to
    > if_xname where I should make expensive strcmp() calls. ;)
    >
    > I'm worried about 'dynamic' interfaces. e.x:
    > # ifconfig vlan0 create; ...
    > # load rules with 'shape in on vlan0'
    > # ifconfig vlan0 destroy
    > # ifconfig vlan0 create; ...
    >
    > I belive at this point if_index is not the same
    > when rules was loaded. How safe is to use if_index
    > instead of if_xname? How safe is to use if_xname
    > with interface renaming feature (-current)?
    >
    > Is there some way to track interface changes events?

    Yes there is, in -current you will find some eventhandlers (in if_var.h and
    if_clone.h) which allow you to get a notification when an interface arrives
    or leaves. Pf (from OpenBSD 3.5) will use them to do exactly what you are
    planning, to have O(1) interface look-ups.

    The other (big) problem in this field is, how to handle yet unknown interfaces
    (e.g. USB/Cardbus/ppp/tun/...).

    Attached is my WIP version of the pf interface handling, which might be a bit
    too complex for your purpose, but should give you the idea.

    -- 
    Best regards,				| mlaier@freebsd.org
    Max Laier				| ICQ #67774661
    http://pf4freebsd.love2party.net/	| mlaier@EFnet
    
    



  • Next message: Eugene Grosbein: "ripd, multicast and route to 224.0.0.0/4"

    Relevant Pages

    • Re: [patch 0/8] Nesting class_device patches that actually work
      ... you give one of your "subclass devices" an interface, ... Take a step back and look what a kernel interface is about. ... device tree by following the "device" symlink from sysfs to get a unified tree ... the hierarchy is not a reason not to be able to walk up the chain and change ...
      (Linux-Kernel)
    • Re: ATL-COM: return pointer to instance
      ... > tree a second time. ... You should call AddRef any time you are handing a new reference to the ... both your own code and the VB code refer to the interface, ...
      (microsoft.public.vc.language)
    • Re: developing for something that isnt there..
      ... xml was chosen becouse well. ... creating a tree model of javabeans was my insisting becouse i didnt' ... had a complelty differnt strucutre and style of interface, ... and interface to send messages about them the classes ...
      (comp.lang.java.programmer)
    • Re: What I dont like about C# so far, compared to C++ (managed or
      ... locking type. ... program "using" the interface is show. ... probably never use it ("The IConfiguration interface defines ... Amazing that my home grown tree is ...
      (microsoft.public.dotnet.languages.csharp)
    • Re: [PATCH] Open Firmware device tree virtual filesystem
      ... the of_* routines continue to define the ... The main problem with the current powerpc interface to the device-tree ... tree is in kernel memory, and the lifetime of the properties is tied to ... In general, we don't fabricate the @unit-address part, we use OF's own ...
      (Linux-Kernel)