extending ifmib(4) and de-mem(4)izing netstat

From: Michal Mertl (mime_at_traveller.cz)
Date: 12/13/04

  • Next message: Wilkinson, Alex: "Re: per-interface packet filters"
    Date: Mon, 13 Dec 2004 23:26:57 +0100
    To: freebsd-net@freebsd.org
    
    

    Hello all,

    I like the idea of a system without mem(4) but some system utilities depend
    on it. I thought I would go and change them to use other ways to get the
    information. I started with 'netstat -r' and almost completely (refcnt field
    is missing) removed the need for /dev/mem (in fact there already was
    incomplete support for it in the sources). I then went to reimplement
    'netstat -i' and found out I can't get all the information from sysctls. The
    stats which I can't find are the counters for addresses configured on the
    interfaces (in kernel stored in struct in_ifaddr). Am I missing something or
    would I have to export the data from the kernel? What is the best way to
    export them? I can see two ways: make it accessible like if_data is exported
    for physical interfaces in getifaddrs(3) or export the data into some other
    place like ifmib(4) - e.g. net.inet.generic and net.inet6.generic.

     From getifaddrs.c I can see that one way to add the information would be to
      implement something called ifam_data (probably in fact struct ifam_msghdr)
    which is present on BSDI. It would probably be also possible to hack it
    rather easily into sysctl_iflist (src/sys/net/rtsock.c) a-la ifm_data member
      of struct if_msghdr.

    P.S.: It was a great adventure to browse through the code trying to
    understand what it does. Did humans write it? :-) I'm talking about the data
    structures in the kernel, netstat sources are on the other hand a mess.

    -- 
    Michal Mertl
    _______________________________________________
    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: Wilkinson, Alex: "Re: per-interface packet filters"

    Relevant Pages

    • Gcov-kernel patch update for 2.6.0-test3
      ... Here's another resync of the kernel patch (originally by Hubertus Franke ... and Rajan Ravindran) to allow the gcov coverage analysis tool to be used ... * The .ctors-section contains a list of pointers to constructor ... static struct memchunk *freechunks; ...
      (Linux-Kernel)
    • [PATCH 2 of 18] ipath - core driver header files
      ... ipath_debug.h contains mask values used for controlling driver debugging. ... * to communicate between kernel and user code. ... * This struct must have explict pad fields where type sizes ... * We could have a single register get/put routine, that takes a group type, ...
      (Linux-Kernel)
    • Re: [HP ProLiant WatchDog driver] hpwdt HP WatchDog Patch
      ... specific HW Timer located in the HP ProLiant iLO 2 ASIC. ... development kernel. ... `struct SMBIOS_entry_point' would be more typical. ... +hpwdt_ioctl(struct file *file, unsigned int cmd, ...
      (Linux-Kernel)
    • [PATCH] Add seq_file howto to Documentation/
      ... +traversing a list of kernel items and iterating on that list. ... +function only needs to call seq_openwith a pointer to a struct ... +(0 for the first entry). ... +write static headings or variable data into the seq_file output buffer. ...
      (Linux-Kernel)
    • [PATCH 2.4] Wireless Extension v17
      ... * - Wireless Event capability in struct iw_range ... * - Fix kernel data leak to user space in private handler handling ... * This file define a set of standard wireless extensions ... * Each driver is free to use them for whatever purpose it chooses, ...
      (Linux-Kernel)