tfDhcpdUserStart
Table of Contents >> Optional Protocols >> DHCP Server
#include <trsocket.h> |
int tfDhcpdUserStart | ( |
int userPort, | |
int flags | |
); |
Function Description
This function starts the Treck DHCP server on the specified port. If successful, the function will return TM_ENOERROR.
Parameters
- userPort
- UDP port the server will listen on. If set to zero, the server will listen on the UDP port specified by RFC 2131 (68)
- flags
- indicates whether the server will run in blocking mode. If TM_BLOCKING_ON is set, then the Treck DHCP server will run in blocking mode, otherwise, the Treck DHCP server will run in non blocking mode.
Returns
- TM_ENOERROR
- Success.
- TM_EINVAL
- TM_BLOCKING_ON is set, and pending is not enabled in the Treck stack.
- TM_ENOBUFS
- Not enough buffers to start the DHCP server.
- TM_EMFILE
- No more sockets are available.
- TM_EADDRINUSE
- Port already in use.
Usage
This function starts the DHCP server. This must be called prior to calling tfDhcpdUserExecute(), but after calling either tfDhcpdUserConfigFromFile() or tfDhcpdUserConfigFromBuffer().