[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[patch] modular ifconfig
(This email originally appeared on tech-net@).
I have created a patch that lets us add/remove features from ifconfig,
such as support for various address families (inet, inet6, iso, atalk) and
protocols (802.11, 802.3ad, CARP), simply by trimming the list of sources
(SRCS) in the Makefile. This helps one customize ifconfig for an embedded
device or for install media, and it eliminates a lot of grotty #ifdef'age.
Now, the ifconfig syntax and semantics are finalized at run-time using
the constructor routines in each address-family/protocol module.
The patch is at
In principle, a tiny ifconfig binary could load virtually all of its
syntax from shared objects "just in time." I don't plan to take ifconfig
in that direction.
I extracted a lot of common code into subroutines, too, in order to
shrink the ifconfig binary a bit. I have made all of the address
families share a lot of code for address addition/replacement/removal.
That probably broke atalk and iso, despite my best efforts.
I have also extracted an include file, Makefile.inc, containing the
make-fu that both ifconfig and x_ifconfig share.
(BTW, I noticed that distrib/utils/x_ifconfig/ requires WARNS=4 to build,
but sbin/ifconfig/ does not. I could not explain the discrepancy in
several minutes looking, so I left in WARNS=4.)
David Young OJC Technologies
dyoung%ojctech.com@localhost Urbana, IL * (217) 278-3933 ext 24
Main Index |
Thread Index |