On 7 October 2012 03:43, Luigi Rizzo <rizzo_at_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. :-) AdrianReceived on Sun Oct 07 2012 - 12:08:55 UTC
This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:31 UTC