Working with Next Hops
The RTMv2 API allows clients to work with the list of next hops that are associated with routes and destinations. Clients can add or update a next hop by calling RtmAddNextHop. Clients can delete a next hop using RtmDeleteNextHop. Clients can search for next hops by calling RtmFindNextHop.
Clients can also update the next hop directly. To do so, the client must first lock the next hop with the RtmLockNextHop function. Then the client can use the direct pointer to the routing table manager's RTM_NEXTHOP_INFO structure to make necessary modifications. Finally, the client can unlock the next hop.
Note
The next-hop address and interface index fields in the next hop uniquely identify the next hop and should not be modified.