tfAddrPolicyTableDisplayEntry

Jump to: navigation, search

Table of Contents >> Application Reference >> DNS Resolver


#include <trsocket.h>


ttUserAddrPolicyEntryHandle tfAddrPolicyTableDisplayEntry (
ttUserAddrPolicyEntryHandle apeHandle,
ttUserAddrPolicyEntryPtr userPolicyPtr,
int structType,
int flags
);


Function Description

This function fills out a ttUserAddrPolicyEntry structure, allowing the user to view the address policy table one entry at a time. This call is iterative. The user should pass a NULL ttUserAddrPolicyEntryHandle for the first call, and then pass the returned ttUserAddrPolicyEntryHandle for successive calls.


Parameters

  • apeHandle
    The policy handle as returned by tfAddrPolicyTableAddEntry().
  • userPolicyPtr
    A pointer to the user policy structure to fill out.
  • structType
    The type of user policy structure pointed to by userPolicyPtr. Currently TM_ADDR_USER_POLICY_STRUCT_1 is the only valid value.
  • flags
    Currently unused.


Returns

  • (Valid ttUserAddrPolicyEntryHandle)
    The handle to the next policy entry in the list. If the ttUserAddrPolicyEntryHandle that was passed in via apeHandle was NULL, then this is the first policy entry in the list.
  • NULL
    Either no more policy entries in the list, or one of the following errors:


Example Code

 
ttUserAddrPolicyEntryHandle apeHandle;
ttUserAddrPolicyEntry       userPolicy;
char                        ipAddrStr[INET6_ADDRSTRLEN];
 
apeHandle = (ttUserAddrPolicyEntryHandle)0;
 
for (;;)
{
    tm_bzero(&userPolicy, sizeof(ttUserAddrPolicyEntry));
    tm_bzero(ipAddrStr, sizeof(char) * INET6_ADDRSTRLEN);
    apeHandle = tfAddrPolicyTableDisplayEntry(
                    apeHandle,
                    &userPolicy,
                    TM_ADDR_USER_POLICY_STRUCT_1,
                    0);
    if (apeHandle == (ttUserAddrPolicyEntryHandle)0)
    {
        break;
    }
    inet_ntop(AF_INET6,
              &(userPolicy.aupePrefix.s6_addr),
              ipAddrStr,
              sizeof(char)*INET6_ADDRSTRLEN);
    tfKernelPrint(0,
        "Prefix:\t\t%s\n"
        "PrefixLength:\t%d\n"
        "Precedence:\t%d\n"
        "Label:\t\t:%d\n\n",
        ipAddrStr,
        userPolicy.aupePrefixLen,
        userPolicy.aupePrecedence,
        userPolicy.aupeLabel);
}
 


Table of Contents >> Application Reference >> DNS Resolver