Files | |
file | dhcp.h |
DHCP client Module for Modtronix TCP/IP Stack. | |
file | dhcp.h |
DHCP client Module for Modtronix TCP/IP Stack. | |
file | dhcp.h |
DHCP client Module for Modtronix TCP/IP Stack. | |
file | dhcp.h |
DHCP client Module for Modtronix TCP/IP Stack. |
A user application may also choose to call some of the APIs to directly control DHCP operation, such as whether DHCP is configured or not, and whether to permanently stop DHCP. Normally, the user's application should not need to directly interact with DHCP at all. To use the DHCP module, the user project files must be modified as follows:
The official DHCP specification (RFC1541) requires the DHCP client to renew its IP configuration before its lease time expires. To track lease time, the user application must make sure that TickUpdate() is called as required, and that reasonable time accuracy is maintained (refer to the source code file "websrvr.c" for a working example). The time resolution required is 15 minutes, plus or minus, which means that TickUpdate() may be called at a very low priority.
For the DHCP module to automatically configure the addresses and subnet mask, there must be at least one DHCP server on the network. It is the userÆs responsibility to implement some method for "publishing" the configurations back to potential users. Options range from manually reading the information from a display on each node, to storing the information in a central server. DHCP updates the values of MY_IP_BYTE?, MY_GATE_BYTE? and MY_MASK_BYTE? as a result of automatic configuration.
The DHCP layer of the Modtronix TCP/IP stack is implemented by the file "dhcp.c". The header file "dhcp.h" defines the services provided by the layer. DHCP is an active layer that broadcasts DHCP requests and automatically receives and decodes DHCP responses. Its main features include:
A user application may also choose to call some of the APIs to directly control DHCP operation, such as whether DHCP is configured or not, and whether to permanently stop DHCP. Normally, the user's application should not need to directly interact with DHCP at all. To use the DHCP module, the user project files must be modified as follows:
The official DHCP specification (RFC1541) requires the DHCP client to renew its IP configuration before its lease time expires. To track lease time, the user application must make sure that TickUpdate() is called as required, and that reasonable time accuracy is maintained (refer to the source code file "websrvr.c" for a working example). The time resolution required is 15 minutes, plus or minus, which means that TickUpdate() may be called at a very low priority.
For the DHCP module to automatically configure the addresses and subnet mask, there must be at least one DHCP server on the network. It is the userÆs responsibility to implement some method for "publishing" the configurations back to potential users. Options range from manually reading the information from a display on each node, to storing the information in a central server. DHCP updates the values of MY_IP_BYTE?, MY_GATE_BYTE? and MY_MASK_BYTE? as a result of automatic configuration.