Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 7 Oct 2012 17:53:56 +0200
From:      Luigi Rizzo <rizzo@iet.unipi.it>
To:        Garrett Cooper <yanegomi@gmail.com>
Cc:        Adrian Chadd <adrian@freebsd.org>, current@freebsd.org
Subject:   Re: sysctl vs ifconfig vs other (was Re: sysctl-controlled key-value store ?)
Message-ID:  <20121007155356.GA77558@onelab2.iet.unipi.it>
In-Reply-To: <CAGH67wTBc-RWwyQQZvbW3tufEh5xLdAswPKt3X7jMz-UP0L1VQ@mail.gmail.com>
References:  <20121006172834.GB63649@onelab2.iet.unipi.it> <CAFAOGNQEAJFD2YJyRFDCzW=XMJymznW3MMdmCabbCqTjobAU-g@mail.gmail.com> <20121007104330.GA75115@onelab2.iet.unipi.it> <CAJ-VmokXxuF78HTk1SbirEwS9EP1G2RX0=LLrzMP%2B16G4-cc4g@mail.gmail.com> <20121007150219.GA76853@onelab2.iet.unipi.it> <CAGH67wTBc-RWwyQQZvbW3tufEh5xLdAswPKt3X7jMz-UP0L1VQ@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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@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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20121007155356.GA77558>