Return to BSD News archive
Newsgroups: comp.unix.bsd Path: sserve!manuel.anu.edu.au!munnari.oz.au!sgiblab!zaphod.mps.ohio-state.edu!sol.ctr.columbia.edu!hamblin.math.byu.edu!hellgate.utah.edu!fcom.cc.utah.edu!cs.weber.edu!terry From: terry@cs.weber.edu (A Wizard of Earth C) Subject: Re: getting net config with SIOCGIFCONF ioctl call Message-ID: <1992Oct8.205122.2366@fcom.cc.utah.edu> Keywords: ioctl ifconf ifreq Sender: news@fcom.cc.utah.edu Organization: Weber State University (Ogden, UT) References: <7519@vtserf.cc.vt.edu> <mark.718543244@labtam> Date: Thu, 8 Oct 92 20:51:22 GMT Lines: 38 In article <mark.718543244@labtam> mark@labtam.labtam.oz.au (Mark Treacy) writes: >linkt@GroupW.cns.vt.edu (Tim Link) writes: >>I'm working on a program that needs to determine the network >>configuration under 386BSD. I'm using the SIOCGIFCONF IOCTL function >>which *I THINK* should return to me an array of ifreq structures which >>have the name of the interface and it's ip address. This ain't what I'm >>gettin'. [ ... ] >In the 4.3bsd-reno and net2 release the ifreq's returned by SIOCGIFCONF >are not fixed length. See ifconf() in usr/src/sys/net/if.c . > >You need something similar to the code in inet.c in tcpdump. >i.e. (fragment taken from tcpdump) [ ... ] 1) From the "for what it's worth" department: There's a compatability call for getting the old style list. 2) COMPAT_43 may not be defined in the kernel (patches for doing this and for no NPX defined due out soon). 3) I think this is why the netstat -i output seems so bizarre ...it isn't a "new way of doing things" as had been supposed. Address families other than AF_INET may add to the conusion as well, as Mark sort of pointed out. Terry Lambert terry@icarus.weber.edu terry_lambert@novell.com --- Any opinions in this posting are my own and not those of my present or previous employers. -- ------------------------------------------------------------------------------- "I have an 8 user poetic license" - me Get the 386bsd FAQ from agate.berkeley.edu:/pub/386BSD/386bsd-0.1/unofficial -------------------------------------------------------------------------------