From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,c62b113491eda350,start X-Google-Attributes: gidfee84,public From: barnett@grymoire.crd.ge.com (Bruce Barnett) Subject: probing network interfaces with C (SIOCGIFCONF problems) Date: 1995/04/13 Message-ID: #1/1 X-Deja-AN: 100355236 sender: usenet@crdnns.crd.ge.com (USENET News System) organization: GE Corp. R & D, Schenectady, NY newsgroups: comp.unix.osf.osf1 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 "", 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 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 uunet!crdras!barnett