David Young
2008-06-25 22:32:02 UTC
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
<ftp://cuw.ojctech.com/users/netbsd-b17835c3/ifconfig.modularize2>.
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.)
Dave
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
<ftp://cuw.ojctech.com/users/netbsd-b17835c3/ifconfig.modularize2>.
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.)
Dave
--
David Young OJC Technologies
***@ojctech.com Urbana, IL * (217) 278-3933 ext 24
--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
David Young OJC Technologies
***@ojctech.com Urbana, IL * (217) 278-3933 ext 24
--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de