Kyle R . Burton on Fri, 21 Dec 2001 19:30:12 +0100


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PLUG] enumerating the interfaces on a host


> > The code returns inet6 addrs on one of the hosts I'm testing it on (a FreeBSD
> > box that has some ipv6 stuff).  How can I test the addr to see if it's
> > ipv4?  And skip it if it's not?
> 
> See if it matches /.*:.*/?

I was able to figure out a solution:  I've got access to the sockaddr_in for
each of the interfaces, so I can test sin_family to see if it contains
either the AF_INET or AF_INET6 flags.  If it's not AF_INET, I skip it.

The way Michael's code was written, it actualy made it pretty straightforward
to figure out.


Thanks,
Kyle


-- 

------------------------------------------------------------------------------
Wisdom and Compassion are inseparable.
        -- Christmas Humphreys
mortis@voicenet.com                            http://www.voicenet.com/~mortis
------------------------------------------------------------------------------

______________________________________________________________________
Philadelphia Linux Users Group       -      http://www.phillylinux.org
Announcements-http://lists.phillylinux.org/mail/listinfo/plug-announce
General Discussion  -  http://lists.phillylinux.org/mail/listinfo/plug