Jump to: navigation, search

Table of Contents >> IPv6 Programmer's Reference

Note Note: The content on this page has been deprecated.
For the new content, please see tf6NgAddDefaultGatewayTunnel().

#include <trsocket.h>

int tf6AddDefaultGatewayTunnel (
const struct sockaddr_storage * endpointIpAddrPtr,
int flags

Function Description

This function only supports IPv6. Create a default gateway tunnel for running IPv6 over IPv4. A host that is on a link without any IPv6 routers but which can reach an IPv6 router via the existing IPv4 routing infrastructure (i.e. the IPv6 router is reachable via an IPv4 address, specified by endpointIpAddrPtr) can use this API to set this IPv6 router as the default gateway for all IPv6-capable interfaces. The configured tunnel created by this function is used to reach this default gateway (i.e. over IPv4), and operates as the IPv6 default route, meaning that it will only be used to route an IPv6 packet if there are no other routes that match the destination IP address of the packet. ([RFC2 893], [RFC 2893])


  • endpointIpAddrPtr
    Pointer to the tunnel endpoint IP address, which is the IPv4 address of the IPv6 router. The memory that this points to must be allocated by the caller, i.e. a local variable in the caller's address space.
  • flags
    Not currently used.


    One of the parameters was invalid.
    The specified tunnel endpoint address was not an IPv4-formatted address, i.e. endpointIpAddrPtr->addrFamily was not set to AF_INET.
    The tunnel endpoint (i.e. IPv6 router) was unreachable.
    A default gateway tunnel has already been configured.

Table of Contents >> IPv6 Programmer's Reference