Home |
Function xn_add_host_table_entry Function xn_delete_host_table_entry Function xn_interface_info Function xn_interface_open_config Function xn_interface_ethernet_statistics Function xn_interface_statistics Function xn_send_ethernet_frame Function cb_wr_screen_string_fnc Function cb_rs232_connection_lost_fnc |
Function xn_interface_infoReturns information about an open interface. int xn_interface_info(int iface_no, struct _iface_info * pi_info); Parametersiface_noInterface number (returned by xn_interface_open, xn_interface_open_config, or xn_attach). pi_infoPointer to a structure which returns the interface information. 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 routine returns information about an open interface in *pi_info. The structure pointed to by pi_info is: #define IP_ALEN 4 #define ETH_ALEN 6 typedef struct _iface_info { int device_id; // device type (NE2000_DEVICE etc.) const char * device_name; // name of device BYTE my_ip_address[IP_ALEN]; // local IP address BYTE my_ethernet_address[ETH_ALEN]; // local Ethernet address BYTE ip_mask[IP_ALEN]; // network mask BYTE his_ip_address[IP_ALEN]; // remote IP address - // valid only for SLIP, CSLIP, or PPP BYTE bootp_ip_address[IP_ALEN]; // valid if BOOTP was done int mtu; // local MTU int irq; // IRQ use by the device WORD ioaddr // I/O address of device (if > 0) int link_status // current link status and speed } IFACE_INFO; Field link_status may have one of these values:
-1 is returned when the device or device driver is unable to determine the link status. Some Ethernet controllers may need a long time to finish auto negotiation. When link_status is 0 right after having called xn_interface_open_config or xn_interface_open, it is recommended to wait and query the status again for up to 1 second before assuming that the network cable is unplugged.
|