Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 7 Oct 2012 07:08:54 -0700
From:      Adrian Chadd <adrian@freebsd.org>
To:        Luigi Rizzo <rizzo@iet.unipi.it>
Cc:        current@freebsd.org
Subject:   Re: sysctl-controlled key-value store ?
Message-ID:  <CAJ-VmokXxuF78HTk1SbirEwS9EP1G2RX0=LLrzMP%2B16G4-cc4g@mail.gmail.com>
In-Reply-To: <20121007104330.GA75115@onelab2.iet.unipi.it>
References:  <20121006172834.GB63649@onelab2.iet.unipi.it> <CAFAOGNQEAJFD2YJyRFDCzW=XMJymznW3MMdmCabbCqTjobAU-g@mail.gmail.com> <20121007104330.GA75115@onelab2.iet.unipi.it>

next in thread | previous in thread | raw e-mail | index | archive | help
On 7 October 2012 03:43, Luigi Rizzo <rizzo@iet.unipi.it> wrote:
>
> Good point, thanks for mentioning this:

ew. ifconfig :-)

> <rant>
> Could be done, but I consider the ifconfig one of the ugliest
> configuration mechanisms we have in FreeBSD so I'd rather not
> contribute to that.

Seconded; but compare to Linux which has mutiple different commands to
do networking, as well as 'net'. :-)

> src/sbin/ifconfig/ has over 11K of C source, most of it just in
> charge of filling some obscure ioctl argument with limited error
> checking.
>
> For instance, ifbridge.c has 700 lines of code defines 38 commands
> or variants. All the code does is convert command line into one of

[snip]

> (and the like) with no complications on the kernel side and
> huge simplifications on the userland side and kernel-user ABI.
> Replace sysctl with sysfs or other mechanism of choice.
>
>
> ifieee80211 is even worse -- over 5000 lines of code,
> 153 between commands and arguments, and 31 different parameters:

I'd personally like to break these kinds of things out into libraries
so other C code can use them.

I'm eventually going to do it to the net80211 code in ifconfig; maybe
it's also worth doing to if_bridge for example.

Doing configuration via sysctl can be hokey, especially when you use
sysctl and sysfs to do things which change the sysctl/sysfs layout (by
creating/destroying nodes as you change the configuration.) It's ..
ew.

Maybe for your bridge stuff its easy enough, but for something like
net80211 where there's a lot of things to configure, doing it via
sysctl would involve lots of parsing in the kernel.. and I like my
kernels smaller. :-)


Adrian



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAJ-VmokXxuF78HTk1SbirEwS9EP1G2RX0=LLrzMP%2B16G4-cc4g>