Re: Portable way to get my NICs' IPs

2005-10-28 Thread Oliver Lupton
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Stephen R Laniel wrote: > I open a socket to a remote machine, and that socket binds to a > particular interface, right? How does the socket decide what to > bind to? Presumably the socket libraries are fairly portable, > right? - From a socket-using

Re: Portable way to get my NICs' IPs

2005-10-28 Thread Stephen R Laniel
On Fri, Oct 28, 2005 at 01:52:59AM +0200, Almut Behrens wrote: > Sorry to disappoint you, but if you want to write something portable, > you've chosen the wrong task :) Hi Almut, Thanks very much for providing so much information. It was enormously informative. I'm baffled that this isn't a port

Re: Portable way to get my NICs' IPs

2005-10-27 Thread Leonel Duran Fuentes
I'm not very savy but I'd try to write a simple sh script with ifconfig, grep and a regular expression that would fit for the systems you want it to run on. Almut Behrens wrote: On Thu, Oct 27, 2005 at 04:54:22PM -0400, Stephen R Laniel wrote: On Thu, Oct 27, 2005 at 01:45:36PM -0700, Joh

Re: Portable way to get my NICs' IPs

2005-10-27 Thread Almut Behrens
On Thu, Oct 27, 2005 at 04:54:22PM -0400, Stephen R Laniel wrote: > On Thu, Oct 27, 2005 at 01:45:36PM -0700, John Purser wrote: > > You might consider one of the multi-platform languages like Python or > > Perl. Both have modules that will do this I believe. > > Yeah, that's what I'm looking for

Re: Portable way to get my NICs' IPs

2005-10-27 Thread Oliver Lupton
Stephen R Laniel wrote: Is there a portable way to 1) get a list of all my NICs (eth0, eth1, ath0, whatever); and 2) get all their IPs? For some reason I'm having a hard time figuring this out. And I need it to run across Gentoo, Debian, FreeBSD and others, so it needs to be portable. I assu

Re: Portable way to get my NICs' IPs

2005-10-27 Thread Stephen R Laniel
On Thu, Oct 27, 2005 at 01:45:36PM -0700, John Purser wrote: > You might consider one of the multi-platform languages like Python or > Perl. Both have modules that will do this I believe. Yeah, that's what I'm looking for. Does anyone know the Perl function for this task? -- Stephen R. Laniel [

Re: Portable way to get my NICs' IPs

2005-10-27 Thread Stephen R Laniel
On Thu, Oct 27, 2005 at 09:35:23PM +0100, James Keasley wrote: > ifconfig > > It lives in one of the sbins, usually, so probably isn't in your $PATH Assume I've already tried the obvious answers. :-) ifconfig isn't quite portable. See below for FreeBSD's output ("inet [IP address]") and contrast

Re: Portable way to get my NICs' IPs

2005-10-27 Thread James Keasley
Stephen R Laniel <[EMAIL PROTECTED]> writes: > Is there a portable way to > > 1) get a list of all my NICs (eth0, eth1, ath0, whatever); >and > 2) get all their IPs? > > For some reason I'm having a hard time figuring this out. > And I need it to run across Gentoo, Debian, FreeBSD and > others

Portable way to get my NICs' IPs

2005-10-27 Thread Stephen R Laniel
Is there a portable way to 1) get a list of all my NICs (eth0, eth1, ath0, whatever); and 2) get all their IPs? For some reason I'm having a hard time figuring this out. And I need it to run across Gentoo, Debian, FreeBSD and others, so it needs to be portable. I assume there's some POSIX-appr