Function Prototypes:ttUserDhcpOfferCBFunc
Table of Contents >> Optional Protocols >> DHCP
| #include <trsocket.h> |
| int userDhcpOfferNotify | ( |
| ttUserInterface interfaceHandle, | |
| unsigned int multiHomeIndex, | |
| int eventId, | |
| ttUserIpAddress serverId, | |
| ttUserIpAddress ipAddress, | |
| ttUserGenericUnion userParam | |
| ); |
Function Description
This is the definition for the function that is registered with tfRegisterDhcpOfferCB().
Parameters
- interfaceHandle
- Interface handle as returned by tfAddInterface().
- multiHomeIndex
- Index of IPv4 configured address on interfaceHandle that has been configured for DHCP.
- eventId
- One of:
- TM_DHCP_EVENT_OFFER if an offer has been received
- TM_DHCP_EVENT_TIMEOUT if a timer expired, signaling the end of the selecting phase. If, after a timeout condition, the user's callback function returns without selecting an offer, DHCP will be cancelled
- TM_DHCP_EVENT_REQUEST_ACKED when the stack receives the ACK of the DHCP request from the server. (Only if the user had called tfInterfaceSetOptions() setting the TM_DEV_OPTIONS_BOOT_ARP_RETRIES option to -2.)
- serverId
- IP address of DHCP server that provided the offer. This value uniquely identifies an offer in the cache. Use this value later when you want to select the associated offer or remove it from the cache. (Only valid for TM_DHCP_EVENT_OFFER event.)
- ipAddress
- IP address that is being offered by the DHCP server. (Only valid for TM_DHCP_EVENT_OFFER event.)
- userParam
- Pointer to an optional user-defined parameter that was specified when the callback function was registered.
Returns
- TM_DHCP_OFFER_SELECT
- Accept the current offer and send an address request to the DHCP server. All further offers will be ignored.
- TM_DHCP_OFFER_COLLECT
- Keep this offer while waiting for a better offer. If the Treck offer cache is full, the latest offer in the cache will be replaced with the current offer.
- TM_DHCP_OFFER_IGNORE
- Discard this offer and wait for a better offer.