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_arp_remote Function xn_send_ethernet_frame Function cb_wr_screen_string_fnc Function cb_rs232_connection_lost_fnc |
Function xn_arp_remotexn_arp_remote sends out an ARP request to resolve an IP address: int xn_arp_remote(int * iface, BYTE * ipn, long timeout); ParametersifacePointer to an integer which holds the interface number on which the request is to be sent or was sent. When the interface is set to -1 before this function is called, the IP stack will select an appropriate interface based on parameter *ipn and then assign that interface number to *iface. This parameter is optional and may be set to NULL. ipnPointer to the IP address in network byte order to be resolved. timeoutTimeout in seconds to wait for an ARP reply. If this parameter is set to 0, the function does not wait and will not return a timeout error. ARP requests sent internally by RTIP-32 have a timeout of CFG_ARPC_REQ_TIMEOUT (1 second by default). 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. This function can be used to either create or refresh an ARP cache entry. It can also be used to check if a particular IP address on the local LAN segment is currently reachable. If parameter timeout is greater zero and the function returns success, the ARP cache entry can be looked up using xn_arp_cache_lookup. Please note that this function should not be called too frequently to avoid flooding the LAN with ARP requests. ARP cache entries have a configurable live-time (see CFG_ARP_TIMEOUT, default 10 minutes). xn_arp_remote should be called to refresh an ARP cache entry only when it is about to expire. The remaining live-time can be queried with function xn_arp_cache_lookup.
|