interface cleanup

From: Anders Persson (anders_at_cs.ucla.edu)
Date: 07/21/05

  • Next message: Ulf Lilleengen: "Re: interface cleanup"
    To: freebsd-net@freebsd.org
    Date: Thu, 21 Jul 2005 11:06:56 -0700
    
    

    Hi all,

    My name is Anders Persson and I am working on a Google SoC project in
    which I am trying to remove reference made from user land to kernel-
    only data structures. Currently I am going through netstat and
    rewriting some of the functions to rely on sysctl rather than kvm.
    The hope is to completely remove kvm from netstat, and parts that
    solely depend on it, like the core dump analysis would be factored
    out and moved to a more suitable place (kgdb?)

      In many cases this works quite well, and the public interfaces
    contain most of the information needed. In some cases certain pieces
    of information are not available. A specific example would be routing
    information, where I try to rely on routing messages to obtain the
    info. However, one piece of information that is missing is the ref
    count (rt_refcnt in rtentry). If this is one piece of information
    deemed necessary, what is the general opinion of including that in
    rt_msghdr? (Just a side note, I noticed there is both rtm_use and
    rtm_rmx.rmx_pksent in rt_msghdr, however when dumping an rtentry, the
    pksent metric of the entry is assigned to rtm_use and rmx_pksent is
    left unassigned, I assume this is done to avoid breaking legacy code?)

    The parts of netstat I am currently looking at are multicast routing
    info and netgraph. For both of these parts there seem to be no public
    interfaces to query for information. However, mrouting in IPv4
    provide access to the internal structures which partially avoids
    using kvm (in one case you sysctl returns a list of mem locations so
    you have to do a sysctl/kvm combo to get the stuff you want),
    however, the structs that are returned contains pointers to other
    internal data such as ifnet's. There already exists some basic ioctl
    () request to obtain partial information, but I was thinking of
    extending the publicly available information by either adding a few
    more ioctl request, or extending the information available via
    sysctl. I guess the more complex task would be to efficiently dump
    the routing cache with bandwidth meters etc. Any thoughts about this?

    I have not had time to go through netgraph enough yet, but does
    anyone have some ideas how to avoid using kvm to obtain netgraph info?

    Thanks a lot,
    Anders
    _______________________________________________
    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: Ulf Lilleengen: "Re: interface cleanup"

    Relevant Pages

    • Re: Mouse + KVM Issues [with fix]
      ... The primary scenario that I've been reading on this issue, which matches my setup, is people behind a _cheap_ KVM using a USB mouse with a PS/2 converter. ... A sysctl setting would be a sufficient workaround, if it's even applicable. ... post on any of the official FreeBSD mailing lists, ...
      (freebsd-hackers)
    • Re: interface cleanup
      ... > rewriting some of the functions to rely on sysctl rather than kvm. ... > The hope is to completely remove kvm from netstat, ...
      (freebsd-net)
    • RE: Firewall/DMZ routing
      ... >> running but have something going wrong with routing. ... > do you have forwarding enabled on the firewall? ... > sysctl net.inet.ip.forwarding ... To unsubscribe, ...
      (freebsd-questions)
    • netstat oddness.
      ... Routing tables ... Most invocations of netstat complain about the kvm. ...
      (freebsd-current)
    • Re: Routing Table Entries in user mode
      ... On some systems, such as Solaris prior to S10, it does. ... >> privileges to get the routing table entries. ... There are ways other than sysctl. ...
      (comp.unix.solaris)