Re: OK, I'm stumped - Why doesn't this work?
Re: OK, I'm stumped - Why doesn't this work?
- Subject: Re: OK, I'm stumped - Why doesn't this work?
- From: Igor Garnov <email@hidden>
- Date: Tue, 9 Nov 2004 22:49:50 +0300
The below function works fine for me on both Mac OS X and 9.2. It
returns true if a machine has a real IP address.
Boolean GetIPInterface( UInt8* szIPAddress )
{
Boolean bRes = false;
SInt16 i;
if ( OTInetGetInterfaceInfo( &sInetInterface, 0 ) == noErr )
{
OTInetHostToString( sInetInterface.fAddress, (char*)( szIPAddress + 1
) );
i = 1;
while ( szIPAddress[ i ] ) i++;
i--;
szIPAddress[ 0 ] = i;
if ( PLstrcmp( szIPAddress, "\p0.0.0.0" ) != 0 && PLstrcmp(
szIPAddress, "\p127.0.0.1" ) != 0 ) bRes = true;
}
return bRes;
}
Hope this helps. If it does not, reinstall OT.
And, if you supply a more descriptive subject line to your message, Mr.
Quinn is likely to answer it faster.
Regards,
Igor
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden