tfAddInterfaceMhomeAddress

Jump to: navigation, search

Table of Contents >> Programmer's Reference


#include <trsocket.h>


int tfAddInterfaceMhomeAddress (
ttUserInterface interfaceHandle,
ttUserIpAddress ipAddress,
unsigned char multiHomeIndex
);


Function Description

Add a multihome IP address to the interface without adding it to the routing table. This allows the Treck stack, for example, to assume the IP address identity of another host on another network, and therefore to allow a server application on the Treck stack to get the packets whose destination is for that other host, and offload some of the work from that other host server. If the interface uses the Ethernet link layer then the user should also add a proxy ARP entry for the IP address it is assuming. An example would be:


errorCode = tfAddInterfaceMhomeAddress(myInterfaceHandle,
                                       inet_addr("1.2.3.4"),
                                       (unsigned char)1);


Parameters

  • interfaceHandle
    The device entry. This is returned by tfAddInterface().
  • ipAddress
    Extra multihome IP address.
  • multiHomeIndex
    The index for this IP address for multihoming. Because we are adding an additional IP address without really configuring the interface the interface should already have been configured and this multihome index should be bigger than 0.


Returns

  • TM_ENOERROR
    Success.
  • TM_EADDRNOTAVAIL
    Attempt to configure the device with a broadcast address.
  • TM_ENOBUFS
    Not enough memory to complete the operation.
  • TM_EINVAL
    Bad parameter, i.e. bad interface handle, or multihome index out of boundaries (not between 0 and TM_MAX_IPS_PER_IF).
  • TM_EALREADY
    The interface has already been configured at this multihome index.


Table of Contents >> Programmer's Reference