tfDhcpdUserSetOption

Jump to: navigation, search

Table of Contents >> Optional Protocols >> DHCP Server

#include <trsocket.h>


int tfDhcpdUserSetOption (
ttUserInterface interfaceHandle,
ttUser8Bit optionTag,
ttUserCharPtr dataPtr,
unsigned int dataLen
);


Function Description

This function instructs the DHCP server to include the specified non-native option in outgoing DHCP packets.


Parameters

  • interfaceHandle
    This is the interface handle matching an interface name in the DHCP server configuration file or buffer
  • optionTag
    This is the option to be set. Value could be any option tag specified in RFC 2132
  • dataPtr
    This is the buffer used to store the option data. Format is as specified in RFC 2132
  • dataLen
    This is the size of the dataPtr buffer.


Returns

  • TM_EINVAL
    Invalid parameter(s). For example invalid interface handle, or non zero datalen with null dataPtr.
  • TM_ENOENT
    tfDhcpdUserConfigFromFile() or tfDhcpdUserConfigFromBuffer() has not been called, or the interfaceHandle parameter does not correspond to any interface name in the DHCP server configuration.
  • TM_ENOBUFS
    This indicates failure due to a failed memory allocation.
  • TM_ENOERROR
    The option was successfully loaed in the DHCP server configuration database.


Usage

This function is used for options not natively supported by the DHCP server. This must be called prior to calling tfDhcpdUserStart(), or tfDhcpdUserExecute(), but after calling either tfDhcpdUserConfigFromFile() or tfDhcpdUserConfigFromBuffer(). When calling twice with the same option value, the new data replaces the old.


Table of Contents >> Optional Protocols >> DHCP Server