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_set_ip Function xn_send_ethernet_frame Function cb_wr_screen_string_fnc Function cb_rs232_connection_lost_fnc |
Function xn_set_ipSets the IP address and network mask for an interface. int xn_set_ip(int iface_no, const BYTE * ip_address, const BYTE * ip_mask); Parametersiface_noInterface number (returned by xn_interface_open, xn_interface_open_config, or xn_attach). local_ip_addressLocal IP address. Four bytes. ip_maskLocal network mask (NULL=default). Four bytes. return valueReturns 0 if successful, otherwise -1. 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:
Before a network node can access IP services, it must have an IP address. There are five ways to establish the IP address. Call xn_bootp, xn_bootp_res, xn_rarp, or xn_dhcp to get your address from a bootp, RARP server, or DHCP. An IP address negotiation can be initiated if using PPP or xn_dhcp. xn_bootp, xn_bootp_res, xn_rarp and xn_dhcp call this function when they have determined the interface's IP address and mask so this routine need not be called. This function adds an entry to the routing table corresponding to the interface. If parameter ip_mask is NULL, the default mask 255.255.255.0, is used. For SLIP and PPP connections, if the remote address is set (see xn_attach), the network mask is not used. Either xn_interface_open or xn_attach must be called prior to calling this routine.
|