tfNgDhcpSetOption
Table of Contents >> Optional Protocols >> DHCP
#include <trsocket.h> |
int tfNgDhcpSetOption | ( |
ttUserInterface interfaceHandle, | |
int indexType, | |
int index, | |
int bootOption, | |
void TM_FAR * dataPtr, | |
int dataLen | |
); |
Function Description
This function instructs the DHCP client to include the specified custom option in outgoing DHCP packets. The DHCP option headers will be generated automatically. If you set dataLen to 256 or higher, the option data will be split across multiple options (see RFC 3396 - Encoding Long Options in DHCP). Note that not all servers support DHCP option concatenation.
Parameters
- interfaceHandle
- The interface on which to set the option.
- indexType
- The index parameter type. Specify TM_BT_CONF for multihome index (Automatic Configuration) or TM_BT_USER for user index (User-Controlled Configuration).
- index
- Multihome or user index on which to set this option.
- bootOption
- The option code to be set.
- dataPtr
- The raw data to send. Do not include the DHCP option header (i.e. option code and option length). The headers will be generated automatically.
- dataLen
- The length of the option data.
Returns
- TM_ENOERROR
- Success.
- TM_EINVAL
- Invalid arguments in the call.
- TM_ENOBUFS
- Insufficient memory.
Usage
This function is used for sending options that are not natively supported by the DHCP client (see Table 1 below). This must be called prior to calling tfOpenInterface / tfConfigInterface. When calling twice with the same option value, the new data replaces the old.
Table 1 - Examples of custom DHCP options Option Description 43 Vendor-specific information (RFC 2132, section 8.4). 60 Vendor class identifier (RFC 2132, section 9.13). 124 Vendor-identifying vendor class option (RFC 3925, section 3). 125 Vendor-identifying vendor-specific information option (RFC 3925, section 4).