Important: |
---|
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist. |
IP Helper provides the functionality to manage network routing. Use the following functions to manage the IP routing table, and to obtain other routing information.
You can manipulate specific entries in the IP routing table. Use the CreateIpForwardEntryfunction to add a new routing table entry. Use the DeleteIpForwardEntryfunction to remove an existing entry. The SetIpForwardEntryfunction modifies an existing entry. You can retrieve the contents of the IP routing table by making a call to the GetIpForwardTablefunction.
You can also use the router management capabilities of IP Helper to retrieve information about how datagrams are routed over the network. The GetBestRoutefunction retrieves the best route to a specified destination address. The GetBestInterfacefunction retrieves the index of the interface used by the best route to a specified destination address. Lastly, the GetRTTAndHopCountfunction retrieves the round-trip time (RTT) and number of hops to a specified destination address.
The following table describes each CreateIpForwardEntryvariable and MIB_IPFORWARDROWmember.
Value | Description | ||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
pRoute |
Pointer to a MIB_IPFORWARDROWstructure that specifies the information for the new route. The caller must specify values for all members of this structure. The caller must specify PROTO_IP_NETMGMT for the dwForwardProtomember of MIB_IPFORWARDROW. |
||||||||||||||||||||||||||||||||||||||
MIB_IPFORWARDROW (All fields are read-write, and can be changed by the API user with the SetIpForwardEntryfunction) |
dwForwardDest
dwForwardMask
dwForwardPolicy
dwForwardNextHop
dwForwardIfIndex
dwForwardType
dwForwardProto
dwForwardAge
dwForwardNextHopAS
dwForwardMetric1
dwForwardMetric2
dwForwardMetric3
dwForwardMetric4
dwForwardMetric5
|
Note: |
---|
An example that shows how to set a routing-protocol-specific metric value is included within this document. See the code sample titled Setting ForwardMetric Values. |
The following table describes each DeleteIpForwardEntryvariable.
Value | Description |
---|---|
pRoute |
Pointer to a MIB_FORWARDROWstructure (see the CreateIpForwardEntrydescription above). This structure specifies information that identifies the route to delete. The caller must specify values for the dwForwardIfIndex, dwForwardDest, dwForwardMask, dwForwardNextHop, and dwForwardPolicymembers of the structure. |
The following table describes each SetIpForwardEntryvariable.
Value | Description |
---|---|
pRoute |
Pointer to a MIB_FORWARDROWstructure (see the CreateIpForwardEntrydescription above). This structure specifies information that identifies the route to delete. The caller must specify values for the dwForwardIfIndex, dwForwardDest, dwForwardMask, dwForwardNextHop, and dwForwardPolicymembers of the structure. |
The following table describes each GetIpForwardTablevariable.
Value | Description | ||||
---|---|---|---|---|---|
pIpForwardTable |
Pointer to a buffer that, on successful return, contains the IP routing table as a MIB_IPFORWARDTABLEstructure. |
||||
pdwSize |
Specifies the size of the buffer pointed to by the pIpForwardTableparameter. If the buffer is not large enough to hold the returned routing table, the function sets this parameter equal to the required buffer size. |
||||
bOrder |
Specifies whether the returned table should be sorted. If this parameter is TRUE, the table is sorted in this order:
|
||||
MIB_IPFORWARDTABLE (The table itself is read-only, but the entries can be changed using SetIpForwardEntry) |
dwNumEntries
table[ANY_SIZE]
|
The following table describes each GetBestRoutevariable.
Value | Description |
---|---|
dwDestAddr |
Specifies the destination IP address for which to obtain the best route. |
dwSourceAddr |
Specifies a source IP address. This IP address corresponds to an interface on the local computer. If multiple best routes to the destination address exist, the function selects the route that uses this interface. This parameter is optional. The caller may specify zero for this parameter. |
pBestRoute |
Pointer to a MIB_IPFORWARDROWstructure (See the CreateIpForwardEntrydescription above). On successful return, this structure contains the best route for the IP address specified by dwDestAddr. |
The following table describes each GetBestInterfacevariable.
Value | Description |
---|---|
dwDestAddr |
Specifies the destination IP address for which to retrieve the interface that has the best route. |
pdwBestIfIndex |
Pointer to a DWORDvariable. On successful return, this variable contains the index of the interface that has the best route to the address specified by the dwDestAddrparameter. |
The following table describes each GetRTTAndHopCountvariable.
Value | Description |
---|---|
DestIpAddress |
Specifies the IP address of the destination for which to determine the RTT and hop count. |
HopCount |
Pointer to a ULONGvariable. On successful return, this variable contains the hop count to the destination specified by the DestIpAddressparameter. |
MaxHops |
Specifies the maximum number of hops to search for the destination. If the number of hops to the destination exceeds this number, the function terminates the search and returns FALSE. |
RTT |
Round-trip time in milliseconds to the destination specified by DestIpAddress. |