tf6InterfaceSetPhysAddr

Jump to: navigation, search

Table of Contents >> IPv6 Programmer's Reference


#include <trsocket.h>


int tf6InterfaceSetPhysAddr (
ttUserInterface interfaceHandle,
const ttUser8Bit * physAddrPtr,
int physAddrLen,
int calledFromFlag
);


Function Description

This function only supports IPv6. This function sets the link-layer address associated with the interface, which allows the interface to initiate and respond to requests for IPv6 address resolution. If you specify a non-null value for the drvGetPhyAddrFuncPtr parameter in the call to tfAddInterface() and you are using the Ethernet link-layer, then you do not need to call this function, since the link-layer address is obtained by calling your driverGetPhysicalAddress() function.

This function may only be called on an interface that is closed, and is typically called from your device driver open function, in which case calledFromFlag is set to TM_6_DEV_CALLED_FROM_DRIVER.

Note that if you use tf6InterfaceSetPhysAddr() instead of drvGetPhyAddrFuncPtr() to set the link-layer address, then you should also call tf6Eui64SetInterfaceId() to set the interface ID. [RFC 2461]


Parameters

  • interfaceHandle
    Interface handle of an interface for which we want to set the link-layer address.
  • physAddrPtr
    Pointer to the link-layer address.
  • physAddrLen
    Length in bytes of the link-layer address.
  • calledFromFlag
    Specifies whether this function is being called from the device driver, typically from the device driver open function. It is very important to set this correctly. If you are calling this function from the device driver, set calledFromFlag to TM_6_DEV_CALLED_FROM_DRIVER, otherwise set it to TM_6_DEV_CALLED_FROM_APP.


Returns

  • 0
    Success.
  • TM_EINVAL
    One of the parameters was invalid, or physAddrLen was greater than TM_MAX_PHYS_ADDR.
  • TM_EPERM
    The interface specified by interfaceHandle was open. This function may only be called on an interface that is closed.


Table of Contents >> IPv6 Programmer's Reference