• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: OK, I'm stumped - Why doesn't this work?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >OK, I'm stumped - Why doesn't this work? (From: Dakidd <email@hidden>)

  • Prev by Date: OK, I'm stumped - Why doesn't this work?
  • Next by Date: Re: OK, I'm stumped - Why doesn't this work? (Can't OTGetInetInterfaceInfo() )
  • Previous by thread: OK, I'm stumped - Why doesn't this work?
  • Next by thread: Re: OK, I'm stumped - Why doesn't this work?
  • Index(es):
    • Date
    • Thread