ifconfig refactoring for FreeBSD
Dan writes "Based on Sam Leffer's suggestion, Bruce Simpson has been working on refactoring ifconfig(8). ifconfig is a FreeBSD unix utility used to assign an address to a network interface and/or configure network interface parameters. Bruce says that ifconfig has grown increasingly large and become unwieldy. Part of the effort has been to get a handle on all of the options that are currently supported so he has written a YACC grammar for it. He has uploaded some grammer, created a design document and also generated a PDF file you can view which shows you syntax diagrams for each part of the parse tree."
While they are at it, they should add something to parse /etc/rc.conf and reconfigure all interfaces while the system is running. This is one area where Linux has an advantage.
For those of you who do not know what YACC is all about
Its good to see something like this happening as ifconfig is not only used on FreeBSD but also on most (all?) Linux distros.
Ifconfig is just one of the many contributions the BSD projects have given to the Linux and UNIX community.
PS: To all those "bsd is dying" trolls, things like this show its not. Without the work of the BSD projects you wouldn't have some of the many tools you use each day.
(\(\
(^.^)
(")")
*This is the cute bunny virus, please copy this into your sig so it can spread
Starting with FreeBSD 4.x, ifconfig with no arguments simply lists all interfaces the kernel has found, and their configuration details.
(the actual output has tabs to make the formatting a little prettier)Refactoring is meant to be about improving the design of existing code, in small controlled ways. This doesn't look like refactoring, just a rewrite of a section of it.
Either way I find it hard to appreciate why this is news.
There is no "GNU ifconfig". Linux has it's own version which is probably based on an old BSD version, or, maybe written from scratch.
% ifconfig -V
net-tools 1.60
ifconfig 1.42 (2001-04-13)
You can tell it's not GNU because it doesn't spout on about the GPL everytime you run it.
Just checking. ;>
A yacc grammar? That makes it official, ifconfig is now a contender for the ls Memorial Too Damn Many Options award. Other known entrants include ld, most X applications, and the ever-popular gcc.
- system("/usr/sbin/arp
...")
and you will see pretty quickly that it's much more complicated than any ioctl()Conceptually, ARP table entries as routing table entries is great but the API is in need of some serious re-working or a library to hide the complexity.
btw, i got bashed by some bsd troll, cause we linux users tend to use the ip command, from the iproute package, nowadays... :)
nice to see that freebsd is moving along...
Even better, I use two realtek for internal interfaces and one 3com for the cable connection.
The 3coms don't like it when there's more than one in my firewall, the realteks work just fine. Only setting the macaddress didn't go well, so that's why the 3com on the outside.
home
We use it all our web servers. Just look at Netcraft for longest uptime, every single machine runs on BSD. Who are these wierdos claiming BSD is dead? Stupid fools!
yhl hand
ifconfig is just the older, more compatible way to config the interfaces for those who grew up using older Linuxes and other Unices. You can do everything ifconfig + iptables using ip + tc and more.
So before anyone claims that Linux's ifconfig sucks and is too complicated, they've already made a better replacement for it, just needs more documentation and exposure.
BSD blows away Windows and Linux, Mac OS X is based on BSD. BSD is the most stable OS out there today, just look at Netcraft's longest up times! Face the facts you pathetic freaks, BSD is here to stay!
.... can't accept BSD is a superior OS!
I keep thinking that /. will eventually start doing some housekeeping.
Notice how the trolls don't hit other BSD sites or the BSD mailing lists?
Here they can keep posting the same crap over and over and nothing is done.
More of the "Open Source is great so long as it is Linux" attitude. *sigh*
You stupid ignorant fool, another freak in denial! LOL
>It is a fact: *BSD is dying Tell that to Yahoo you sack of sh*t!
Let's not give the GNU guys any ideas. ;)
-
And the Angel said unto me, "These are the cries of the carrots! The cries of the carrots!"
haha. I can't believe you call that sack of overpriced Apple shit a "supercomputer"
no ECC memory
no redudant powersupply
not even sure if these things have RAID
and since its from Apple, you get a propietary, closed-source operating system running on their locked-down hardware
No thanks.
Go cry in a corner: http://news.com.com/2100-7337_3-5095026.html Mac-based system cost just over $5 million and is #3 fastest supercomputer in the world The other top machines cost $250 million.
no one serious would trust their data to that Mac cluster.
did you even read anything of what I said?
oh thats right, you're a knee-jerk "BSD RULES!!!!11!" luser
learn how to make proper links, btw
Learn how to spell you "loser"!
aww, you ran out of arguments so you had to nitpick my spelling
typical BSD luser - low IQ and prefers an inferior OS
_d8b____________________d8b
d 888b,8 b,_ `?8b8 88P'
_?88____________________88P
__88b__________________d88
__888888b__.d888b,_d888888
__88P_`?8b_?8b,___d8P'_?88
_d88,__d88___`?8b_88b__,88b
d88'`?88P'`?888P'_`?88P'`88b
_d8b_______d8b
_?88_______88P
__88b_____d88
__888888b_888___d8888b__?88___d8P__d8P_.d888b,
__88P_`?8b?88__d8P'_?88_d88__d8P'_d8P'_?8b,
_d88,__d88_88b_88b__d88_?8b_,88b_,88'____`?8b
d88'`?88P'__88b`?8888P'_`?888P'888P'__`?888P'
________d8b__________________________d8b
________?88__________________________?88
_________88b__________________________88b
_d8888b__888888b_?88___d8P__88bd88b___888__d88'_.
d8P'_`P__88P_`?8bd88___88___88P'_?8b__888bd8P'__?
88b_____d88___88P?8(__d88__d88___88P_d88888b_____
`?888P'd88'___88b`?88P'?8bd88'___88bd88'_`?88b,`?
>low IQ and prefers an inferior OS
Is that why you use Windows?
YHBRT! YHL! FOAD! HASD!
Bwahahahah, you Lunix fuck!
Since it was directed towards you, you can answer it.
You were double-reverse trolled, BSD fucktard!
Fact: You are dying.
BSD is for people who like to be on life support
If you need yacc to parse a command line,
something is seriously wrong.
The ifconfig on Linux is a compatibility
wrapper. Native commands, like "ip" and
"ethtool", are more powerful and easier to
use as well. Through ifconfig, you can only
see an approximation of the true and correct
status of your network config. All the
advanced Linux concepts get brutally mapped
to BSD-style concepts. For example, Linux
lets you assign multiple IP addresses to a
single interface without using aliases.
Routing is different as well; the default
route, broadcast, and gateway are not what
you'd deal with in the native interface.
So a Linux user may as well delete ifconfig.
Using the native tools is much more sensible.