次の方法で共有


MIB_IPFORWARD_ROW2 (Compact 2013)

3/26/2014

This 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
    The LUID for the network interface associated with this IP route entry.
  • InterfaceIndex
    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
    The IP address prefix for the destination IP address for this route.
  • NextHop
    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
    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 larger than 32 is an illegal value. For an IPv6 route entry, any value larger than 128 is an illegal value. A value of 255 is typically used to represent an illegal value.
  • ValidLifetime
    The maximum time, in seconds, that the IP route entry is valid. A value of 0xffffffff is considered infinite.
  • PreferredLifetime
    The preferred time, in seconds, that the IP route entry is valid. A value of 0xffffffff is considered infinite.
  • Metric
    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.
  • 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 that is defined in the Nldef.h header file. The member is described in RFC 4292.

    Note

    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

    MIB_IPPROTO_OTHER

    1

    The routing mechanism was not specified.

    MIB_IPPROTO_LOCAL

    2

    A local interface.

    MIB_IPPROTO_NETMGMT

    3

    A static route. This value is used to identify route information for IP routing set through network management such as the DCHP, the Simple Network Management Protocol (SNMP), or by calls to the CreateIpForwardEntry2, DeleteIpForwardEntry2, or SetIpForwardEntry2 functions.

    MIB_IPPROTO_ICMP

    4

    The result of an ICMP redirect.

    MIB_IPPROTO_EGP

    5

    The Exterior Gateway Protocol (EGP), a dynamic routing protocol.

    MIB_IPPROTO_GGP

    6

    The Gateway-to-Gateway Protocol (GGP), a dynamic routing protocol.

    MIB_IPPROTO_HELLO

    7

    The Hellospeak protocol, a dynamic routing protocol. This is a historical entry that is no longer being used.

    MIB_IPPROTO_RIP

    8

    The Berkeley Routing Information Protocol (RIP) or RIP-II, a dynamic routing protocol.

    MIB_IPPROTO_IS_IS

    9

    The Intermediate System-to-Intermediate System (IS-IS) protocol, a dynamic routing protocol. The IS-IS protocol was developed for use in the OSI protocol suite.

    MIB_IPPROTO_ES_IS

    10

    The End System-to-Intermediate System (ES-IS) protocol, a dynamic routing protocol. The ES-IS protocol was developed for use in the OSI protocol suite.

    MIB_IPPROTO_CISCO

    11

    The Cisco Interior Gateway Routing Protocol (IGRP), a dynamic routing protocol.

    MIB_IPPROTO_BBN

    12

    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.

    MIB_IPPROTO_OSPF

    13

    The Open Shortest Path First (OSPF) protocol, a dynamic routing protocol.

    MIB_IPPROTO_BGP

    14

    The Border Gateway Protocol (BGP), a dynamic routing protocol.

    MIB_IPPROTO_NT_AUTOSTATIC

    10002

    A Windows specific entry that is added originally by a routing protocol, but that is now static.

    MIB_IPPROTO_NT_STATIC

    10006

    A Windows specific entry that is added as a static route from the routing user interface or a routing command

    MIB_IPPROTO_NT_STATIC_NON_DOD

    10007

    A Windows specific entry that is added as an static route from the routing user interface or a routing command, except these routes do not cause Dial On Demand (DOD).

  • Loopback
    A value that specifies if the route is a loopback route (the gateway is located on the local host).
  • AutoconfigureAddress
    A value that specifies if the IP address is autoconfigured.
  • Publish
    A value that specifies if the route is published.
  • Immortal
    A value that specifies if the route is immortal.
  • Age
    The number of seconds since the route was added or modified in the network routing table.
  • Origin
    The origin of the route. This member can be one of the values from the NL_ROUTE_ORIGIN enumeration type that is defined in the Nldef.h header file.

    Value

    Meaning

    NlroManual

    0

    A result of manual configuration.

    NlroWellKnown

    1

    A well-known route.

    NlroDHCP

    2

    A result of DHCP configuration.

    NlroRouterAdvertisement

    3

    The result of router advertisement.

    Nlro6to4

    4

    A result of 6to4 tunneling.

Remarks

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 can 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 by link speed, hop count, or time delay.

The route metric specified in the Metric member of the MIB_IPFORWARD_ROW2 structure represents the route metric offset only. 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.

Be aware 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

Header

ws2def.h,
ws2ipdef.h

See Also

Reference

MIB Structures
CreateIpForwardEntry2
DeleteIpForwardEntry2
GetIpForwardEntry2
GetIpForwardTable2
GetIpInterfaceEntry
IP_ADDRESS_PREFIX
MIB_IPFORWARD_TABLE2
MIB_IPINTERFACE_ROW
NL_ROUTE_ORIGIN
NL_ROUTE_PROTOCOL
SetIpForwardEntry2
SOCKADDR_INET