From: barnett@grymoire.crd.ge.com (Bruce Barnett)
Subject: probing network interfaces with C (SIOCGIFCONF problems)
Date: 1995/04/13 [thread overview]
Message-ID: <BARNETT.95Apr13160452@grymoire.crd.ge.com> (raw)
I need to scan the different network interfaces in a C program, and I
need to eliminate the non-TCP/IP interfaces.
Let me elaborate - when I do a netstat -i, I get three different
values for ln0. In one case the etwork is "DLI", a second one is
"<Link>", and the third one is the TCP/IP interface.
In my C program, I get the address, network, broadcast values using ioctl's of
SIOCGIFCONF, SIOCGIFNETMASK, SIOCGIFBRDADDR respectively.
How do I, in a C program, eliminate the DLI and <LINK> interfaces?
It seems that the address is 6.3.6.0 for these interfaces.
Should I compare the address with this number?
Is that how I eliminate the non-TCP/IP interfaces? Seems strange.
There must be a better way. How does OSF's netstat do it?
Is it another one of those SIOCGIF* controls?
--
Bruce Barnett <barnett@crd.ge.com> uunet!crdras!barnett
reply other threads:[~1995-04-13 4:00 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox