This may not give expected results on Emulator.
UInt32 ipAddress;
ipAddress = netIPAddrLocal;
for (i = 0; netIPAddrLocal == ipAddress; i++) {
err = NetLibIFGet(netlibRefnum, i, &ifCreator, &ifInstance);
if (err) {
break;
}
if (netIFCreatorLoop != ifCreator) {
settingSize = sizeof(ipAddress);
NetLibIFSettingGet(netlibRefnum, ifCreator, ifInstance,
netIFSettingActualIPAddr, &ipAddress,
&settingSize);
}
}
----- Original Message -----
From: "Chris Cutler" <[EMAIL PROTECTED]>
To: "Palm Developer Forum" <[EMAIL PROTECTED]>
Sent: Friday, April 04, 2003 9:03 AM
Subject: Discovering device's IP address
> Hi,
>
> I'm trying to programatically determine what IP address
> a palm device is using when my app does NetLib things. I've
> tried using NetLibIFGet() and NetLibIFSettingGet to get the
> netIFSettingReqIPAddr and netIFSettingReqIPAddr for interfaces
> with indices 0 and 1 (using 2 for the interface index gives me
> a "can't get that interface" error).
>
> Can anyone give me any suggestions how to figure out what my
> IP address is from within my app (I want to display it to the
> user)? Thanks.
>
> Chris
>
> --
> For information on using the Palm Developer Forums, or to unsubscribe,
please see http://www.palmos.com/dev/support/forums/
>
>
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/support/forums/