tf6DhcpSetOption

Jump to: navigation, search

Table of Contents >> Optional Protocols >> DHCPv6


#include <trsocket.h>


int tf6DhcpSetOption (
int optionName,
ttVoidPt optionValue,
int optionLength
);


Function Description

Set DHCPv6 global options. Any options set with this function will apply to every interface on which DHCPv6 is running.


Parameters

  • optionName
    Name of the option to set
  • optionValue
    Pointer to the value to which to set the given option.
  • optionLength
    Length of the data type (in bytes) pointed to by optionValue


Note Note: Setting the MRD of a message to -1 will instruct the DHCPv6 client to treat the message as a “one shot”, meaning that it will send the message a single time and then immediately timeout without waiting for a reply. This can be very useful for Release and Decline messages, which delay the shutdown of an interface until they are complete.


Option Type Description
TM_6_DHCP_GOPT_RELEASE_MRD int The Maximum Retransmission Duration (in seconds) for a Release message, if the server does not respond. Setting this value to 0 means that the Maximum Retransmission Count will be used instead. Note: This will affect how long it takes to close an interface, as all DHCPv6 addresses must be released before the interface is fully closed. This value may be set to -1 to force an immediate timeout (see above).

Default: 0 (approximately 15 seconds)

TM_6_DHCP_GOPT_DECLINE_MRD int The Maximum Retransmission Duration (in seconds) for a Decline message, if the server does not respond. Setting this value to 0 means that the Maximum Retransmission Count will be used instead. Note: As with Release messages, this could affect how long it takes to close an interface. This can only occur if the interface is closed while the client is in the process of Declining an address. This value may be set to -1 to force an immediate timeout (see above).

Default: 0 (approximately 15 seconds)

TM_6_DHCP_GOPT_SOLICIT_MRD int The Maximum Retransmission Duration (in seconds) for a Solicit message. Setting this value to 0 means Solicit attempts will continue until a server responds. Note: This value may not be set to -1.

Default: 0

Returns

  • TM_ENOERROR
    Success.
  • TM_EINVAL
    Invalid parameter


Table of Contents >> Optional Protocols >> DHCPv6