tfNgGetIpAddress

Jump to: navigation, search

Table of Contents >> IPv6 Programmer's Reference


#include <trsocket.h>


int tfNgGetIpAddress (
ttUserInterface interfaceHandle,
struct sockaddr_storage * ifIpAddrPtr,
int addrFamily,
unsigned int multiHomeIndex
);


Function Description

Next Generation API replaces tfGetIpAddress(). When addrFamily is set to AF_INET, this API may be used to retrieve each IPv4 address manually configured on the interface by the user. When addrFamily is set to AF_INET6, this API may be used to retrieve auto-configured IPv6 addresses, as well as IPv6 addresses manually configured on the interface by the user.

Here are the mHomeIndex ranges:

Manually configured:
   (mHomeIndex >= 0)
&& (mHomeIndex < TM_MAX_IPS_PER_IF)


Auto configured:
   (mHomeIndex >= TM_MAX_IPS_PER_IF)
&& (mHomeIndex < (TM_MAX_IPS_PER_IF + TM_6_MAX_AUTOCONF_IPS_PER_IF))


DHCP configured:
   (mHomeIndex >= (TM_MAX_IPS_PER_IF + TM_6_MAX_AUTOCONF_IPS_PER_IF))
&& (mHomeIndex < (TM_MAX_IPS_PER_IF + TM_6_MAX_AUTOCONF_IPS_PER_IF + TM_6_MAX_DHCP_IPS_PER_IF))


Note Note: Note that the macros TM_MAX_IPS_PER_IF, TM_6_MAX_AUTOCONF_IPS_PER_IF, and TM_6_MAX_DHCP_IPS_PER_IF are not publicly accessible unless you explicitly define them in your trsystem.h file. One possible alternative is to use the TM_NT_MAX_IPS_PER_IF, TM_6_NT_MAX_AUTOCONF_IPS_PER_IF, and TM_6_NT_MAX_DHCP_IPS_PER_IF macros if you have TM_USE_NETSTAT defined in your trsystem.h file.


Parameters

  • interfaceHandle
    The device entry as returned by tfAddInterface().
  • ifIpAddrPtr
    A pointer to the location where to store the IP address for the interface.
  • addrFamily
    Interface handle of the interface to check the status for.
  • mHomeIndex
    The index for this IP address for multihoming. Zero must be the first multihome index used.


Returns

  • TM_EAFNOSUPPORT
    addrFamily was set to an invalid value for address family; valid values are AF_INET and AF_INET6.


Table of Contents >> IPv6 Programmer's Reference