get ip retrieved by dhcp

Hi everybody when i use the simple webserver with netos6.0 and ns7520 how can i determine the ip, i got from the dhcp server? what function would i need to call? someone mentioned the function DhcpNowBound, but i dont have that one in my sources

DhcpNowBound gives you information about the received mask, ip and gateway but i think this stub routine is no longer used in NetOS6.0 when ACE was introduced. In netos 6.0 you have a lot of ACE callback routines that are called during DHCP etc. The ones that you can use is customizeAceHaveAddress and customizeAceHaveAnotherAddress. You have the source for both these routines in the file aceCallbacks.c. Hope it helps.

Flame: what’s wrong with gethostid() ? Contribution: My reading of customizeAceHaveAddress() is that it sets the parameter, and does not get the parameter. The same goes for NAIfconfigSetIpAddress(). It would be nice if a corresponding NAIfconfigGetIpAddress had been provided, but no… The information we need is in structure if_addr_info, file aceCallbacksw.c. here is a dump from my system: (netsilicon-gdb)p if_addr_info $1 = {{ifname = 0x82cc800 “eth0”, addr_info = {ipaddr = 0xc0a80165, netmask = 0xffffff00, servaddr = 0xc0a80101, def_gateway = 0xc0a80101, mtu = 0x0, name_server_address = {0xc0a80101, 0x0, 0x0}}, changed_ip_mask = 0x0}, {ifname = 0x82cc810 “eth0:0”, addr_info = { ipaddr = 0xa9fe6b39, netmask = 0xffff0000, servaddr = 0x0, def_gateway = 0x0, mtu = 0x0, name_server_address = {0x0, 0x0, 0x0}}, changed_ip_mask = 0x0}} if_addr_info.addr_info.ip_addr does contain the value returned by DHCP. So we need a function that accesses that field - how about customizeAceGetInterfaceAddrInfo()? Now to implement gethostid() based on customizeAceGetInterfaceAddrInfo()… Larry