Struct:ttRouterAdvPrefixParam

Jump to: navigation, search
#include <trsocket.h>
 
/*
 * Prefix Option parameters ([RFC4861].4.6.2).
 */
typedef struct tsRouterAdvPrefixParam
{
    ttUser8Bit          raPrefixFlags;              /* see Prefix Option flags, below */
/* [RFC4861].6.2.1 - Router Configuration Variables (default values shown) */
    ttUser8Bit          raAdvPrefixLength;          /* e.g. 64 bits */
    ttUserConstCharPtr  raAdvPrefixStr;             /* e.g. "2001:db8::" */
    ttUser32Bit         raAdvValidLifetime;         /* 2,592,000 seconds */
    ttUser32Bit         raAdvPreferredLifetime;     /* 604,800 seconds */
} ttRouterAdvPrefixParam;
 
typedef ttRouterAdvPrefixParam TM_FAR * ttRouterAdvPrefixParamPtr;
typedef const ttRouterAdvPrefixParam TM_FAR * ttConstRouterAdvPrefixParamPtr;
 
/*
 * Prefix Option flags (ttRouterAdvPrefixParam.raPrefixFlags).
 */
#define TM_6_RA_FL_PREFIX_ONLINK    0x80    /* AdvOnLinkFlag */
#define TM_6_RA_FL_PREFIX_AUTO      0x40    /* AdvAutonomousFlag */

Structure Description

This structure contains information for constructing one Prefix Option for a Router Advertisement message. A Router Advertisement message contains zero or more prefix options (identified in RFC 4861 as Router Configuration Variable AdvPrefixList). If you have more than one prefix, you need to create an array of ttRouterAdvPrefixParam.

Call tf6RouterAdvPrefixDefaults() to get the default values. Call tf6RouterAdvConfig() to activate the Router Advertisement configuration.

For details, refer to RFC 4861, Section 4.2, Router Advertisement Message Format, Section 4.6.2, Prefix Information, Section 6.2.1, Router Configuration Variables and Section 10, Protocol Constants. RFC 4861 describes the prefix information of a Router Advertisement message as follows:

These options specify the prefixes that are on-link and/or are used for stateless address autoconfiguration. A router SHOULD include all its on-link prefixes (except the link-local prefix) so that multihomed hosts have complete prefix information about on-link destinations for the links to which they attach. If complete information is lacking, a host with multiple interfaces may not be able to choose the correct outgoing interface when sending traffic to its neighbors.

Table 1 below describes the raPrefixFlags bit field (bitwise OR the values).

Table 1. Prefix Option Flags
TM_6_RA_FL_PREFIX_ONLINK Set the L (on-link) flag in the option. When set, indicates that this prefix can be used for on-link determination. When not set, the advertisement makes no statement about on-link or off-link properties of the prefix. In other words, if the L flag is not set a host MUST NOT conclude that an address derived from the prefix is off-link. That is, it MUST NOT update a previous indication that the address is on-link. Identified in RFC 4861 as Router Configuration Variable AdvOnLinkFlag.

Default: TRUE

TM_6_RA_FL_PREFIX_AUTO Set the A (autonomous address-configuration) flag in the option. When set indicates that this prefix can be used for stateless address configuration as specified in RFC 4862, IPv6 Stateless Address Autoconfiguration. Identified in RFC 4861 as Router Configuration Variable AdvAutonomousFlag.

Default: TRUE


Members

  • raPrefixFlags
    Zero or more boolean values OR'd together (see Table 1 above).
  • raAdvPrefixLength
    The number of leading bits of the IPv6 address raAdvPrefixStr that are valid. The acceptable range is 0 to 128. The default is 64 bits.
  • raAdvPrefixStr
    A pointer to properly formatted IPv6 address prefix string (NUL terminated). For example, "2001:db8::". Specify a Global Unicast address, as described in RFC 4291, IPv6 Addressing Architecture. Do not specify the IPv6 link-local prefix, "fe80::", prefix length 10.
  • raAdvValidLifetime
    The number of seconds before the prefix becomes invalid and a host must stop using any addresses constructed from it. Identified in RFC 4861 as Router Configuration Variable AdvValidLifetime. The designated value of all 1's (0xffffffff) represents infinity. Implementations MAY allow AdvValidLifetime to be specified in two ways: 1) a time that decrements in real time, that is, one that will result in a Lifetime of zero at the specified time in the future, or 2) a fixed time that stays the same in consecutive advertisements. RFC 4861 specifies a default of 2,592,000 seconds (30 days), fixed (i.e., stays the same in consecutive advertisements).
  • raAdvPreferredLifetime
    The number of seconds before the prefix becomes deprecated (must be ≤ raAdvValidLifetime). A host must choose a preferred address over a deprecated one, when starting a new conversation. Identified in RFC 4861 as Router Configuration Variable AdvPreferredLifetime. The designated value of all 1's (0xffffffff) represents infinity. See RFC 4862, IPv6 Stateless Address Autoconfiguration, for details on how this value is used. Implementations MAY allow AdvPreferredLifetime to be specified in two ways: 1) a time that decrements in real time, that is, one that will result in a Lifetime of zero at the specified time in the future, or 2) a fixed time that stays the same in consecutive advertisements. RFC 4861 specifies a default of 604,800 seconds (7 days), fixed (i.e., stays the same in consecutive advertisements).