Home |
Function xn_add_host_table_entry Function xn_delete_host_table_entry Function xn_attach 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_attachOpen an interface for a serial interface. int xn_attach(int device_id, int minor_number, BYTE * his_ip_addr, int com_port, int baud_rate, char handshake_type, BYTE * input_buffer, int input_buffer_len, BYTE * output_buffer, int output_buffer_len); Parametersdevice_idDevice type (PPP_DEVICE, SLIP_DEVICE or CSLIP_DEVICE). minor numberSee xn_interface_open. his_ip_addressPointer to remote IP address (4 bytes in network byte order) to connect to. com_portCOM port (1-4 or -1 = use value from device table). baud_rateBaud rate. Supported values:
handshake_typeType of hardware handshake performed. Supported values are:
input_bufferBuffer used to queue input characters which will be processed at task level. If none is specified, a DCU will be allocated by the UART driver. The size of the buffer required is 2*x+2 where x is the largest packet received. Without a buffer, the largest input packet would be 758 bytes. input_buffer_lenSize of input buffer. output_bufferBuffer used to queue output chars which will be sent from the interrupt level. If none specified, a DCU will be allocated by the UART driver. output_buffer_lenSize of output buffer. return valueReturns interface number if successful, otherwise SOCKET_ERROR. If an error occurred, call xn_getlasterror and xn_geterror_string to return the error value. Error Codes further describes each error. Possible values for this function are:
This routine must be called at start-up to open a dedicated interface, i.e. SLIP, CSLIP (SLIP with VanJacobson compression) or PPP. Parameter device_id specifies the type of device which is being opened and the minor_number specifies which device of this type is being opened. The device number and minor number specified must match an entry in the device table. It sets up the interface structure and calls the open routine for the specified interface. If the remote IP address is unknown, set his_ip_addr to 0.0.0.0. For PPP, if the remote IP address is negotiated, then the negotiated remote address will be used. When xn_set_ip is called, if the remote address has not been set, a host entry will be added to the routing table using the mask and local IP address set by xn_set_ip; otherwise, a network entry will be added using the remote IP address and the mask 255.255.255.255 (see xn_rt_add).
|