大网数据广告活动
网络与域名解析

Retrieving Information

· 52CE 我爱测

RTMv2 allows a client to retrieve the information referred to by a given handle using the RtmGetEntityInfo, RtmGetDestInfo, RtmGetRouteInfo, and RtmGetNextHopInfo functions.

RTMv2 allows a client to retrieve the information referred to by a given handle using the RtmGetEntityInfo, RtmGetDestInfo, RtmGetRouteInfo, and RtmGetNextHopInfo functions.

These function calls have corresponding functions (RtmReleaseEntityInfo, RtmReleaseDestInfo, RtmReleaseRouteInfo, RtmReleaseNextHopInfo) to release the handles associated with the information structure returned by the routing table manager.

Note:
Information for clients is available only in the current instance and address family.

For sample code that shows how to use these functions, see Search For the Best Route.

Using RtmGetExactMatchRoute and RtmGetExactMatchDestination

The RtmGetExactMatchRoute and RtmGetExactMatchDestination functions are used by clients to find a specific route or destination. These functions save time by doing the comparison work for the client.

For example, when RIP updates a route, RIP must retain the old metric information. RIP searches for the route and its information. Then RIP can copy the information and update the route.

Using RtmGetMostSpecificDestination

The RtmGetMostSpecificDestination function is used to locate the destination that best matches the specified network prefix.

For example, the multicast group manager uses this function to perform a reverse-path-forwarding (RPF) check on a single address. The function can also be used to find the local next hop for a given remote next hop.

For sample code that shows how to use these functions, see Search for Routes Using a Prefix Tree and Search For the Best Route.

Using RtmGetLessSpecificDestination

The RtmGetLessSpecificDestination function is used to locate the destination that is the next-best match for the specified network prefix. This function can be called repeatedly to return the next successive less-specific match, until no more destinations match.

This function is called after a call to RtmGetMostSpecificDestination.

For sample code that illustrates how to use these functions, see Search for Routes Using a Prefix Tree.

Using RtmIsBestRoute

The RtmIsBestRoute function enables a client to quickly find out whether or not a particular route is the best route to a destination. For example, a client may need to store a particular route only if it is the best route. Therefore, the client can call this function, instead of enumerating all routes and making the comparison itself.

Source: Microsoft Learn / Windows Win32 documentation by Microsoft and contributors. Documentation licensed CC BY 4.0. Code samples are covered by the MIT License. Converted from Markdown, with links normalized and embedded media omitted.

资料来源与适用范围

资料来源
Microsoft Learn / Windows Win32 documentation
适用范围
Windows Win32 API · Source date 05/31/2018
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY 4.0 (documentation), MIT (code samples)

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。