MIB_IPFORWARD_ROW2 structure (netioapi.h)
The MIB_IPFORWARD_ROW2 structure stores information about an IP route entry.
Syntax
typedef struct _MIB_IPFORWARD_ROW2 {
NET_LUID InterfaceLuid;
NET_IFINDEX InterfaceIndex;
IP_ADDRESS_PREFIX DestinationPrefix;
SOCKADDR_INET NextHop;
UCHAR SitePrefixLength;
ULONG ValidLifetime;
ULONG PreferredLifetime;
ULONG Metric;
NL_ROUTE_PROTOCOL Protocol;
BOOLEAN Loopback;
BOOLEAN AutoconfigureAddress;
BOOLEAN Publish;
BOOLEAN Immortal;
ULONG Age;
NL_ROUTE_ORIGIN Origin;
} MIB_IPFORWARD_ROW2, *PMIB_IPFORWARD_ROW2;
Members
InterfaceLuid
Type: NET_LUID
The locally unique identifier (LUID) for the network interface associated with this IP route entry.
InterfaceIndex
Type: NET_IFINDEX
The local index value for the network interface associated with this IP route entry. This index value may change when a network adapter is disabled and then enabled, or under other circumstances, and should not be considered persistent.
DestinationPrefix
Type: IP_ADDRESS_PREFIX
The IP address prefix for the destination IP address for this route.
NextHop
Type: SOCKADDR_INET
For a remote route, the IP address of the next system or gateway en route. If the route is to a local loopback address or an IP address on the local link, the next hop is unspecified (all zeros). For a local loopback route, this member should be an IPv4 address of 0.0.0.0 for an IPv4 route entry or an IPv6 address of 0::0 for an IPv6 route entry.
SitePrefixLength
Type: UCHAR
The length, in bits, of the site prefix or network part of the IP address for this route. For an IPv4 route entry, any value greater than 32 is an illegal value. For an IPv6 route entry, any value greater than 128 is an illegal value. A value of 255 is commonly used to represent an illegal value.
ValidLifetime
Type: ULONG
The maximum time, in seconds, that the IP route entry is valid. A value of 0xffffffff is considered to be infinite.
PreferredLifetime
Type: ULONG
The preferred time, in seconds, that the IP route entry is valid. A value of 0xffffffff is considered to be infinite.
Metric
Type: ULONG
The route metric offset value for this IP route entry. Note the actual route metric used to compute the route preference is the summation of interface metric specified in the Metric member of the MIB_IPINTERFACE_ROW structure and the route metric offset specified in this member. The semantics of this metric are determined by the routing protocol specified in the Protocol member. If this metric is not used, its value should be set to -1. This value is documented in RFC 4292. For more information, see http://www.ietf.org/rfc/rfc4292.txt.
Protocol
Type: NL_ROUTE_PROTOCOL
The routing mechanism how this IP route was added. This member can be one of the values from the NL_ROUTE_PROTOCOL enumeration type defined in the Nldef.h header file. The member is described in RFC 4292. For more information, see http://www.ietf.org/rfc/rfc4292.txt.
Note that the Nldef.h header is automatically included by the Ipmib.h header file which is automatically included by the Iprtrmib.h header. The Iphlpapi.h header automatically includes the Iprtrmib.h header file. The Iprtrmib.h, Ipmib.h, and Nldef.h header files should never be used directly.
The following list shows the possible values for this member.
Value | Meaning |
---|---|
|
The routing mechanism was not specified. |
|
A local interface. |
|
A static route. This value is used to identify route information for IP routing set through network management such as the Dynamic Host Configuration Protocol (DCHP), the Simple Network Management Protocol (SNMP), or by calls to the CreateIpForwardEntry2, DeleteIpForwardEntry2, or SetIpForwardEntry2 functions. |
|
The result of an ICMP redirect. |
|
The Exterior Gateway Protocol (EGP), a dynamic routing protocol. |
|
The Gateway-to-Gateway Protocol (GGP), a dynamic routing protocol. |
|
The Hellospeak protocol, a dynamic routing protocol. This is a historical entry no longer in use and was an early routing protocol used by the original ARPANET routers that ran special software called the Fuzzball routing protocol, sometimes called Hellospeak, as described in RFC 891 and RFC 1305. For more information, see http://www.ietf.org/rfc/rfc891.txt and http://www.ietf.org/rfc/rfc1305.txt. |
|
The Berkeley Routing Information Protocol (RIP) or RIP-II, a dynamic routing protocol. |
|
The Intermediate System-to-Intermediate System (IS-IS) protocol, a dynamic routing protocol. The IS-IS protocol was developed for use in the Open Systems Interconnection (OSI) protocol suite. |
|
The End System-to-Intermediate System (ES-IS) protocol, a dynamic routing protocol. The ES-IS protocol was developed for use in the Open Systems Interconnection (OSI) protocol suite. |
|
The Cisco Interior Gateway Routing Protocol (IGRP), a dynamic routing protocol. |
|
The Bolt, Beranek, and Newman (BBN) Interior Gateway Protocol (IGP) that used the Shortest Path First (SPF) algorithm. This was an early dynamic routing protocol. |
|
The Open Shortest Path First (OSPF) protocol, a dynamic routing protocol. |
|
The Border Gateway Protocol (BGP), a dynamic routing protocol. |
|
A Windows specific entry added originally by a routing protocol, but which is now static. |
|
A Windows specific entry added as a static route from the routing user interface or a routing command. |
|
A Windows specific entry added as a static route from the routing user interface or a routing command, except these routes do not cause Dial On Demand (DOD). |
Loopback
Type: BOOLEAN
A value that specifies if the route is a loopback route (the gateway is on the local host).
AutoconfigureAddress
Type: BOOLEAN
A value that specifies if the IP address is autoconfigured.
Publish
Type: BOOLEAN
A value that specifies if the route is published.
Immortal
Type: BOOLEAN
A value that specifies if the route is immortal.
Age
Type: ULONG
The number of seconds since the route was added or modified in the network routing table.
Origin
Type: NL_ROUTE_ORIGIN
The origin of the route. This member can be one of the values from the NL_ROUTE_ORIGIN enumeration type defined in the Nldef.h header file.
Remarks
The MIB_IPFORWARD_ROW2 structure is defined on Windows Vista and later.
The GetIpForwardTable2 function enumerates the IP route entries on a local system and returns this information in a MIB_IPFORWARD_TABLE2 structure as an array of MIB_IPFORWARD_ROW2 entries.
The GetIpForwardEntry2 function retrieves a single IP route entry and returns this information in a MIB_IPFORWARD_ROW2 structure.
An entry with the Prefix and the PrefixLength members of the IP_ADDRESS_PREFIX set to zero in the DestinationPrefix member in the MIB_IPFORWARD_ROW2 structure is considered a default route. The MIB_IPFORWARD_TABLE2 may contain multiple MIB_IPFORWARD_ROW2 entries with the Prefix and the PrefixLength members of the IP_ADDRESS_PREFIX set to zero in the DestinationPrefix member when there are multiple network adapters installed.
The Metric member of a MIB_IPFORWARD_ROW2 entry is a value that is assigned to an IP route for a particular network interface that identifies the cost that is associated with using that route. For example, the metric can be valued in terms of link speed, hop count, or time delay. Automatic metric is a feature on Windows XP and later that automatically configures the metric for the local routes that are based on link speed. The automatic metric feature is enabled by default (the UseAutomaticMetric member of the MIB_IPINTERFACE_ROW structure is set to TRUE) on Windows XP and later. It can also be manually configured to assign a specific metric to an IP route.
The route metric specified in the Metric member of the MIB_IPFORWARD_ROW2 structure represents just the route metric offset. The complete metric is a combination of this route metric offset added to the interface metric specified in the Metric member of the MIB_IPINTERFACE_ROW structure of the associated interface. An application can retrieve the interface metric by calling the GetIpInterfaceEntry function.
Note that the Netioapi.h header file is automatically included in the Iphlpapi.h header file. The Netioapi.h header file should never be used directly.
Requirements
Requirement | Value |
---|---|
Minimum supported client | Windows Vista [desktop apps only] |
Minimum supported server | Windows Server 2008 [desktop apps only] |
Header | netioapi.h (include Iphlpapi.h) |