Re: Historical question

From: Christopher Nehren (apeiron+usenet_at_coitusmentis.info)
Date: 06/22/05


Date: 21 Jun 2005 23:51:25 GMT

On 2005-06-21, Zeljko Vrba scribbled these
curious markings:
> I'm wondering just out of curiosity.. Why was it decided that NICs don't have
> an entry in /dev but to be configurable by ifconfig?

Sure they do. On my 5.x machine:

[(19:46:10) apeiron@prophecy ~] ls /dev/net
lo0 pflog0 pfsync0 sis0
[(19:46:27) apeiron@prophecy ~]

> And why don't all sockets (irrespective of domain) have some kind of a vnode
> in a (synthetic) filesystem? It would be great for debugging sometimes just
> to be able to inject data to socket by doing something like
> cat smth > /sockets/ipv4/... It doesn't even work for UNIX sockets which DO
> have a file-system inode..

Because this isn't Linux and such ugly, unportable hacks don't belong in
FreeBSD.

> Another use would be for sniffing traffic by doing cat on the socket. Without
> such facility we need specialized tools like tcpdump.

Ever hear of the Unix philosophy of small tools that each do one job
well (and the major one imposed by GNU which tries to be everything, not
excluding a resource hog)?

> I'm not proposing an implementation. Just asking for the historical reason
> for this unorthogonality.

I personally don't want my cat(1) to have any code for reading from a
bpf(4). Apparently the developers of FreeBSD's cat(1) implementation
feel the same way.

Best Regards,
Christopher Nehren

-- 
I abhor a system designed for the "user", if that word is a coded
pejorative meaning "stupid and unsophisticated". -- Ken Thompson
If you ask the wrong people questions, you get "Joel on Software".
Unix is user friendly. However, it isn't idiot friendly.