TCPIP_IPV6_DASSourceAddressSelect Function

C

IPV6_ADDR_STRUCT * TCPIP_IPV6_DASSourceAddressSelect(
    TCPIP_NET_HANDLE hNetIf, 
    const IPV6_ADDR * dest, 
    IPV6_ADDR * requestedSource
);

Description

The IPv6 policy table is used to select the destination address. The destination address selection algorithm takes a list of IPv6 addresses (gPolicyTable) and sorts the linked list. There are eight sorting rules. Starting with the last rule and working to the most important, using a stable sorting algorithm, will produce a sorted list most efficiently. The best average run time we'll get with a stable sort with O(1) memory usage is O(n^2), so we'll use an insertion sort. This will usually be most efficient for small lists (which should be the typical case). If a rule determines a result, then the remaining rules are not relevant and should be ignored.

Preconditions

TCPIP_IPV6_Initialize() is required. TCPIP_IPV6_InterfaceIsReady should be true.

Parameters

ParametersDescription
hNetIfThe given interface.
destThe destination address.
requestedSourceA specified source.

Returns

IPV6_ADDR *

  • Pointer to the selected source address - On Success.

  • NULL - On Failure.

Remarks

None.