Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 09 Jan 2001 15:35:12 +0200
From:      Graham Wheeler <gram@cequrux.com>
To:        David Malone <dwmalone@maths.tcd.ie>
Cc:        hackers@freebsd.org, markster@marko.net
Subject:   Re: Size of struct ifreq/returned buffer of SIOCGIFCONF
Message-ID:  <3A5B1390.A5453C78@cequrux.com>
References:  <3A5AE617.E8644889@cequrux.com> <20010109140752.A52761@walton.maths.tcd.ie>

next in thread | previous in thread | raw e-mail | index | archive | help
David Malone wrote:
> 
> On Tue, Jan 09, 2001 at 12:21:11PM +0200, Graham Wheeler wrote:
> 
> > I am attempting to port the cheops network mapping/diagnostic program
> > from Linux to FreeBSD (see www.marko.net/cheops). One of the first snags
> > I have hit comes in using SIOCGIFCONF to queries the network interface
> > names and addresses.
> 
> Could you use getifaddrs() for this? It would probably provide the
> info you need in a easier to digest form. If not, the code below
> might be useful. It gets a list of interface properties using
> sysctl(), but I believe the info is packed in the same way as it
> is for SIOCGIFCONF.

I have code similar to yours I wrote myself used in our firewall
product, but I would ideally like to have code that compiles and works
on both Linux and FreeBSD, to reduce the work required to maintain the
cheops port once it is done, and ease porting to other Unices as well -
accessing kernel mibs or using other non-standard API calls will be my
means of last resort.

Marko - does Linux have getifaddrs()? I somehow doubt it...

gr.
-- 
Dr Graham Wheeler                        E-mail: gram@cequrux.com
Director, Research and Development       WWW:    http://www.cequrux.com
CEQURUX Technologies                     Phone:  +27(21)423-6065
Firewalls/VPN Specialists                Fax:    +27(21)424-3656


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3A5B1390.A5453C78>