tfBootpUserStart

Jump to: navigation, search

Table of Contents >> Optional Protocols >> BOOTP User Controlled Configuration


#include <trsocket.h>


int tfBootpUserStart (
ttUserInterface interfaceHandle,
int userIndex,
ttUserDhcpNotifyFuncPtr bootpNotifyFuncPtr
);


Function Description

This function is used to set natively-supported BOOTP configuration options.


Parameters

  • interfaceHandle
    This is the Ethernet interface handle.
  • userIndex
    This is a unique user index (see below)
  • bootpNotifyFuncPtr
    This is a pointer to the function that is called when the BOOTP request completes or times out.


Returns

  • TM_EINVAL
    This indicates failure. The kernel found invalid arguments in the call.
  • TM_ENOBUFS
    This indicates failure due to a failed memory allocation.
  • TM_EINPROGRESS
    This indicates that the BOOTP request was sent without error.
  • TM_EALREADY
    This indicates that a previous BOOTP request has already been sent with (which may be OK).
  • TM_ENOERROR
    This indicates success. bootpNotifyFuncPtr will not be called.


Usage

Prior to this call, the Ethernet interface must have been opened with a zero IP address and TM_IP_USER_BOOT flag or configured. For more information, see tfOpenInterface. This function starts sending BOOTP requests on the provided interfaceHandle. The userIndex corresponds to a unique user BOOTP request that must be between 0 and tvMaxUserDhcpEntries. Note that the default value for tvMaxUserDhcpEntries is 0. This must be changed with a call to tfInitTreckOptions with an option name of TM_OPTION_DHCP_MAX_ENTRIES and a value equal to the number of BOOTP or DHCP IP Addresses that should be reserved for the local host. This must be done prior to use of this value, which governs behavior in the noted sections that follow. If the function returns TM_EINPROGRESS or TM_EALREADY, the user must wait for the BOOTP configuration to complete (i.e for bootpNotifyFunc to be called by the stack). bootpNotifyFunc is called as follows: (*bootpNotifyFunc)(ethernetInterfaceHandle, userIndex, errorCode); where the userIndex corresponds to the second parameter of tfBootpUserStart errorCode indicates success (TM_ENOERROR) or timeout (TM_ETIMEDOUT)


Table of Contents >> Optional Protocols >> BOOTP User Controlled Configuration