dan_schiro

How to select a specific ethernet device for use with NU_Send_To?

Discussion created by dan_schiro on Aug 6, 2012

NU_Send_To can not be told which device to use.  It will go to the
routing table and get the first available device for its subnet. 
So, what you can do, is change the routes in the routing table. 
Use NU_Add_Route to change the direct routing.  There are 3 types
of routes; here we are covering only "host routes."  This will assign
an IP address destination to a specific device IP address.

 

Set ip_dest to the IP address that you are sending to, set the mask to
255.255.255.255 (this is a host route) and the gw_addr is the IP address
of the device that you want to specify. Call NU_Add_Route with the above
parameters to modify the routing table.

 

The effect is that any packet or datagram sent to ip_dest will be
automatically routed through gw_addr, the select ethernet device.

Outcomes