次の方法で共有


DeleteIpForwardEntry (Compact 2013)

3/26/2014

This function deletes an existing route in the local device's IP routing table.

Syntax

DWORD DeleteIpForwardEntry(
  PMIB_IPFORWARDROW pRoute
);

Parameters

  • pRoute
    [in] Pointer to a MIB_IPFORWARDROW structure that contains information that identifies the route to delete. The caller must specify values for the dwForwardIfIndex, dwForwardDest, dwForwardMask, dwForwardNextHop, and dwForwardPolicy members of the structure.

Return Value

Error code

Meaning

NO_ERROR (zero)

The routine is successful.

ERROR_ACCESS_DENIED

Access is denied.

ERROR_INVALID_PARAMETER

An input parameter is invalid, no action was taken. This error is returned if the pRoute parameter is NULL, the dwForwardMask member of the PMIB_IPFORWARDROW structure is not a valid IPv4 subnet mask, the dwForwardIfIndex member is NULL, or one of the other members of the MIB_IPFORWARDROW structure is invalid.

ERROR_NOT_FOUND

The pRoute parameter points to a route entry that does not exist.

ERROR_NOT_SUPPORTED

The IPv4 transport is not configured on the local device.

(other)

The function can return other error codes.

If the function fails, use FormatMessage to obtain the message string for the returned error.

Remarks

The dwForwardProto member of MIB_IPFORWARDROW structure pointer to by the route parameter must be set to MIB_IPPROTO_NETMGMT or DeleteIpForwardEntry will fail. Routing protocol identifiers are used to determine route information for the specified routing protocol. For example, MIB_IPPROTO_NETMGMT is used to determine route information for IP routing set through network management such as DCHP, SNMP, or by calls to the CreateIpForwardEntry, DeleteIpForwardEntry, or SetIpForwardEntry functions.

Several members of the MIB_IPFORWARDROW structure pointed to by the route parameter are currently not used by CreateIpForwardEntry. These members include dwForwardPolicy, dwForwardType, dwForwardAge, dwForwardNextHopAS, dwForwardMetric1, dwForwardMetric2, dwForwardMetric3, dwForwardMetric4, and dwForwardMetric5.

To modify an existing route in the IPv4 routing table, use the SetIpForwardEntry function. To retrieve the IPv4 routing table, call the GetIpForwardTable function.

Requirements

Header

iphlpapi.h

Library

Iphlpapi.lib

See Also

Reference

IP Helper Functions
GetIpForwardTable
CreateIpForwardEntry
MIB_IPFORWARDROW
SetIpForwardEntry

Other Resources

FormatMessage
IP Helper