Re: sysctl vs ifconfig vs other (was Re: sysctl-controlled key-value store ?)

From: Luigi Rizzo <rizzo_at_iet.unipi.it>
Date: Sun, 7 Oct 2012 17:53:56 +0200
On Sun, Oct 07, 2012 at 08:23:23AM -0700, Garrett Cooper wrote:
> On Sun, Oct 7, 2012 at 8:02 AM, Luigi Rizzo <rizzo_at_iet.unipi.it> wrote:
...
> FWIW, I don't think that the problem is necessarily the fact that one
> should do it either via ioctl, kvm, sysctl, etc: having a library/set
> of interfaces as Adrian suggested would be indispensable for a number
> of groups that copy code from FreeBSD net utilities wholesale --

actually, the mechanism does matter, and exactly for the reason
you mention.
Access through sysctl is incredibly easy from both userspace and
from a C application, because all the work is done in the kernel
side, whereas other mechanisms (ioctl, i'd rather leave kvm apart
as we really don't want that!) require the definition of a specific
API (ioctl, structs) _and_ some amount of wrapping code in userspace.

cheers
luigi

> effectively forking it the code, which in turn becomes a burden to the
> project/company hacking on the code, and a loss to the community if
> it's not given back. It would also make FreeBSD adoption a whole lot
> easier for outside projects like net-snmp, as well as tools that
> should be more tightly integrated into base OSes for networking
> configuration and statistics, jail management, etc.
> 
> If something isn't done to make these interfaces more usable in a
> generic manner and clean from the get-go, it doesn't matter what
> interface I'll be getting the information via. The BSD socket
> interfaces are extremely well thought out, but bits outside of struct
> sockaddr* (e.g. stuff in net/...) could be better documented
> (unfortunately the Unix Networking books are a bit long in the tooth,
> in part because the original author passed on :(..).
> 
> My 2 cents for what little it may be worth,
> -Garrett
Received on Sun Oct 07 2012 - 13:33:41 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:31 UTC