Enabling/Disabling DHCP

I am attempting to use NetOS 7.4’s naIamEnable() and naIamDisable() to switch between DHCP and Static IPs after I write the changes with customizeIamSetInterfaceConfig(). It disables, but does not start a new connection. Do I need to call naIamAquire or naIamStart? Anyone have any idea how to use these functions?

Thanks,
-Erik

I have not tested this, but reading thru the API, it mentions that if you are using your own IP address acquisition protocol, you must enable the method using naIamEnable. However, the document did not discuss switching methods midstream.

During startup, customizeIamStart is called to handle the initialization. The function naIamStart will then start any methods that have been enabled.

One item to note: naIamStart() should always be called with configuration parameters returned by naIfConfigGetInterfaceParams() as they are platform specific and should not be modified by the application.

For your review of how customizeIamStart handles things, I have attached a file “iamCallbacks.c”.

Message was edited by: sbrown

Sorry, I forgot to attach the previously mentioned file.

So what you are saying is that if the method is switched, I should reboot and only use the inline method for reloading DHCP if already loaded or for switching static IP addresses.

-Erik

Egawtry - you actually just need to throw in a 2 or 3 sec delau between your disable and enable calls

I got it to work with the reboot. I have several listen sockets which were getting confused, so that was the easiest solution.

Thanks,
-Erik

Digi also recently fixed it with the most recent TCP/IP patch so you don’t have to put a delay between stopping and starting the IAM interface.