This and other projects in the Code Examples section are published on our website under the name "test_dhcp_lib".
Here is a simple example of using DHCP on the Ethernet (net.) interface. Notice how the callback_dhcp_ok() procedure is implemented! This is a good illustration of the protracted explanation in the Operations Details topic (not that we think you will read it all).
Note also the use of the NET_AVAILABLE define. This comes from the platform. If the Ethernet interface is available on the currently selected platform, then NET_AVAILABLE is "1". Similarly, if the Wi-Fi interface is available, then WLN_AVAILABLE is "1". Using such defines you can create applications that will compile on any platform, as long as this platform has at least the Ethernet, or the Wi-Fi interface.
Here is a sample debug output we've got after running the code:
And here is the code itself...