Registering with the Routing Table Manager

Before a client can access the routing table, it first must register with the routing table manager using the RtmRegisterEntity function.

When a client registers, it passes to the routing table manager an RTM_ENTITY_INFO structure. This structure contains the information that uniquely identifies a client, the address family, and the instance of the routing table manager with which the client is registering. A client can also establish the RTM_EVENT_CALLBACK callback. The routing table manager will use this callback to notify the client of events such as change notifications and client registrations.

The routing table manager completes its registration processing and returns a handle to the client. The client must use this handle for all subsequent calls to RTMv2 functions.

The RtmRegisterEntity function that is used in RTMv2 is analogous to the RtmRegisterClient function that is used in RTMv1. The RtmRegisterClient function is obsolete, except for clients using IPX.

Once a client has finished interacting with the routing table manager, it must call RtmDeregisterEntity. The routing table manager destroys the handle associated with the client. To avoid memory leaks, the client must ensure that it releases all handles and deletes all the routes and next hops that it owns before calling RtmDeregisterEntity.

For sample code that shows how to use these functions, see Register with the Routing Table Manager and Use the Event Notification Callback.