tfDhcpdUserConfigFromBuffer
Table of Contents >> Optional Protocols >> DHCP Server
| #include <trsocket.h> |
| int tfDhcpdUserConfigFromBuffer | ( |
| ttUserConstCharPtr bufferPtr, | |
| unsigned int bufferLen | |
| ); |
Function Description
This function configures the DHCP server with DHCP parameters, and options. It takes a pointer to a buffer, and a length as parameters. See usage below.
Parameters
- bufferPtr
- Pointer to a buffer. The buffer contains one line of DHCP options and parameters to be used by the DHCP server.
- bufferLen
- Length of data pointed to by bufferPtr.
Returns
- TM_EINVAL
- Null bufferPtr, or zero bufferlen, or invalid format in buffer content.
- TM_ENOBUFS
- This indicates failure due to a failed memory allocation.
- TM_ENOERROR
- The DHCP server loaded the configuration successfully.
Usage
This function is used to load the DHCP server with the DHCP options and parameters to be used to respond to potential DHCP clients. It is to be used instead of tfDhcpdUserConfigFromFile() when there is no file system support. This function must be called prior to calling tfDhcpdUserExecute(), or tfDhcpdUserStart(). The buffer input should have one or more full lines, and the function could be called multiple times (one line per call for example.) Calling this function with a partial line in the buffer is not supported. Each line given by the buffer has the same format as a line in the DHCP server configuration file, as described in the DHCP Server#DHCP Server configuration file format, and DHCP Server#DHCP Server configuration file example.