Home |
Function xn_add_host_table_entry Function xn_delete_host_table_entry Function xn_interface_open_config Function xn_interface_ethernet_statistics Function xn_interface_statistics Function xn_rt_add Function xn_send_ethernet_frame Function cb_wr_screen_string_fnc Function cb_rs232_connection_lost_fnc |
Function xn_rt_addAdd a route to the routing table. int xn_rt_add(const BYTE * dest, const BYTE * mask, const BYTE * gw, DWORD metric, int iface_no, int ttl); ParametersdestDestination IP address (RT_DEFAULT for default gateway). maskDestination network mask. gwGateway address if gateway or NULL if not a gateway. metricDistance metric (RT_USEIFACEMETRIC to use the metric defined for the interface). iface_noInterface number (returned by xn_interface_open, xn_interface_open_config or xn_attach). ttlTime to live in seconds (RT_INF is forever). return valueReturns 0 if successful, otherwise SOCKET_ERROR. If an error occurred, call xn_getlasterror and xn_geterror_string to return the error value. Section Error Codes further describes each error. Possible values for this function are:
This function installs a route to the routing table. A destination address of RT_DEFAULT (all 0s), adds a default gateway entry. A metric greater than 0 specifies a gateway entry. The parameter mask is used to compare dest with the destination address when searching the routing table for an interface and IP address to use when sending a packet to a destination address. If the mask is 255.255.255.255, the entry is a network entry; otherwise, it is a host entry. An address needs to match a network entry exactly, whereas it needs to match a host entry after being anded with the mask. xn_set_ip also adds an entry to the routing table (xn_rarp, xn_bootp, xn_bootp_res and possibly xn_lcp_open will call xn_set_ip).
|