Re: finishing the if.h/if_var.h split

From: Doug Rabson (dfr_at_nlsystems.com)
Date: 09/30/03

  • Next message: Brooks Davis: "Re: adding if_dev member to struct ifnet"
    To: Bruce Evans <bde@zeta.org.au>
    Date: 30 Sep 2003 18:25:38 +0100
    
    

    On Tue, 2003-09-30 at 09:22, Bruce Evans wrote:

    > That's one alternative. (Far too) many places already use the simple
    > alternative of just using "struct device *". Grep shows 68 lines
    > containing "struct device" in *.h and 32 in *.c. For "device_t", the
    > numbers are 2140 in *.h and 5089 in *.c. This is in a sys tree with
    > about 1000 matches of "device_t" in generated files. There are non-bogus
    > uses of "struct device" to avoid namespace pollution in <sys/rman.h>.
    > Most other uses are just bogus (modulo the existence of device_t being
    > non-bogus -- its opaqueness is negative since anything that wants to
    > use it must include <sys/bus.h> and thus can see its internals. style(9)
    > says to not use negatively opaque typedefs).

    The internals of struct device are not contained in <sys/bus.h> - it is
    completely opaque to users outside subr_bus.c. The main 'bug' here is
    the idea that its a good thing to export kernel data structures (struct
    ifnet) to userland. The layout of struct ifnet is an implementation
    detail - it shouldn't form part of the userland api.

    _______________________________________________
    freebsd-net@freebsd.org mailing list
    http://lists.freebsd.org/mailman/listinfo/freebsd-net
    To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org"


  • Next message: Brooks Davis: "Re: adding if_dev member to struct ifnet"

    Relevant Pages

    • Re: finishing the if.h/if_var.h split
      ... > says to not use negatively opaque typedefs). ... The layout of struct ifnet is an implementation ... detail - it shouldn't form part of the userland api. ...
      (freebsd-arch)
    • take II: Allocating AF constants for vendors.
      ... GDB commands to get sizes of structures related to AF_MAX: ... printf "struct netexport: %d\n", sizeof ... printf "struct ifnet: %d\n", sizeof ...
      (freebsd-net)
    • Re: finishing the if.h/if_var.h split
      ... To add the if_dev member to struct ifnet (see the forthcoming ... Do you mean in userland? ... for genassym.c or any other file in the kernel from including ...
      (freebsd-arch)
    • Re: finishing the if.h/if_var.h split
      ... To add the if_dev member to struct ifnet (see the forthcoming ... Do you mean in userland? ... for genassym.c or any other file in the kernel from including ...
      (freebsd-net)
    • Re: per-interface packet filters [summary]
      ... > the struct ifnet. ... > private firewall info. ... > the rest of the kernel. ...
      (freebsd-net)