"Raqueeb Hassan" <(E-Mail Removed)> wrote:
>> I'd have said that asking someone is a starting point for research.
>
>Yes, Tauno Voipio is right. To be more precise, it has two volumes ....
>
>1. UNIX Network Programming, Volume 1, Second Edition: Networking APIs:
>Sockets and XTI, Prentice Hall, 1998.
>2. UNIX Network Programming, Volume 2, Second Edition: Interprocess
>Communications, Prentice Hall, 1999.
>
>And you might look inside the source code of ifconfig.c ....
>http://darwinsource.opendarwin.org/1...roj/ifconfig.c
>
>Raqueeb Hassan
>Bangladesh
yeah sure.
I *do* remember the first time I wanted the answer to that
question myself. I looked in all the right places... and
ifconfig uses the netkit library, which is far too convoluted
even for someone who is well practiced at tracing code. It just
is *not* a timely way to learn that particular item.
The answer is in fact in Stevens books (actually, without
looking to see, I'd bet it's only in Volume 1), and isn't too
horribly obscured. It still takes some doing to unravel if I
remember right, but of course the person needs *have* Stevens
available. (Granted that everyone who is going to learn *any*
part of unix programming _should_ obtain all of Stevens' books,
but...)
I have *no* problem with posting (over and over again) that
short demo program which does just about nothing other than show
how to acquire information (MAC addresses and other data) about
configured interfaces. For someone learning network
programming, it presents the entire set of requirements as one
bundle. And for someone who is doing homework, there is *no*
way they can copy that snippet directly into a homework project
*without* having to figure out what it does first.
The process of trying to make use of the example code in some
other program is going to be a fabulous learning experiece. And
isn't that exactly what tutorials are for???
--
Floyd L. Davidson <http://web.newsguy.com/floyd_davidson>
Ukpeagvik (Barrow, Alaska)
(E-Mail Removed)