nwio_route_t is used to get a route for the input or output routing table from a process and to send a route in the input or output routing table to a process.
typedef struct nwio_route
u32_t nwr_ent_no: The entry number within the table.
u32_t nwr_mtu; /* Ignored, compatibility with VMD */
u32_t nwr_ent_count: nwr_ent_count is the size of the routing table and is used only when returning a route to a process. If the process requested an input route, nwr_ent_count is IROUTE_NR (512) and if the process requested an output route, nwr_ent_count is OROUTE_NR (32).
The network address of the routing entry (e.g., 22.214.171.124).
The subnet mask of the routing entry (e.g., 255.255.255.0).
The gateway to which packets destined for this network are sent.
The distance. Routes with low distances are chosen over routes with high distances.
If the route is an input route, nwr_flags can be one of the following:
#define IRTF_EMPTY 0
#define IRTF_INUSE 1
#define IRTF_STATIC 2
Static input routes behave differently than dynamic input routes. If a static route is added to the input routing table, the route will not not replace any pre-existing route (static or dynamic) even if the values of the route (e.g., destination network) are the same. A dynamic input route, on the other hand, will replace another dynamic input route.
If the route is an output route, nwr_flags can be one of the following:
#define ORTF_EMPTY 0
#define ORTF_INUSE 1
#define ORTF_STATIC 2
The preference of the route. Routes with high preferences are chosen over routes with low preferences. The distance of a route is of higher importance. In other words, the relative preference of two routes is only significant if and only if these two routes are tied for the lowest distance.
ipaddr_t nwr_ifaddr: Each route is associated with an ip port. nwr_ifaddr is the ip address of this ip port.