Page 1 of 1

Accessing Current DHCP address/mask/gateway/DNS values

Posted: Thu Jun 20, 2013 12:34 pm
by sblair
I'm trying to retrieve the current DHCP address, subnet mask, gateway, and DNS values from within a different task than what the DHCP client is running in. i.e. I need to get the current DHCP values to put in my display for the user.

I obviously don't want to create a new DHCP client object. How can I best access these values from within my Display Task?

I'm on a MOD5270 if that matters.

Thanks.
Scott

Re: Accessing Current DHCP address/mask/gateway/DNS values

Posted: Thu Jun 20, 2013 12:49 pm
by sblair
Nevermind... I found the answer in this.

InterfaceBlock *ib = GetInterFaceBlock(InterfaceNumber);

iprintf("IP: "); ShowIP(ib->netIP); iprintf("\r\n");
iprintf("Mask: "); ShowIP(ib->netIpMask); iprintf("\r\n");
iprintf("Gate: "); ShowIP(ib->netIpGate); iprintf("\r\n");
iprintf("DNS: "); ShowIP(ib->netDNS); iprintf("\r\n");