On Time RTOS-32 Documentation
Welcome
RTTarget-32
RTKernel-32
RTFiles-32
RTIP-32
RTIP-32 Programming Manual
RTIP-32 Reference Manual
RTIP-32 Configuration
Socket API
Simplified Networking API
Extended RTIP-32 API
Function vf_init
Function xn_add_dns_server
Function xn_add_host_table_entry
Function xn_clear_host_cache
Function xn_delete_host_table_entry
Function xn_get_domain_name
Function xn_has_dns
Function xn_set_domain_name
Function xn_set_server_list
Function xn_name2ip_addr
Function xn_abort
Function xn_arp_send
Function xn_attach
Function xn_bootp_res
Function xn_bootp
Function xn_debug_error
Function xn_getlasterror
Function xn_geterror_string
Function xn_interface_close
Function xn_interface_info
Function xn_interface_mcast
Function xn_interface_open
Function xn_interface_open_config
Function xn_interface_opt
Function xn_interface_ethernet_statistics
Function xn_interface_statistics
Function xn_ip_set_option
Function xn_ping
Function xn_pkt_data_max
Function xn_rarp
Function xn_rt_add
Function xn_rt_cycle_gw
Function xn_rt_del
Function xn_rt_replace
Function xn_rtip_exit
Function xn_rtip_init
Function xn_rtip_restart
Function xn_set_ip
Function xn_tcp_is_connect
Function xn_tcp_is_read
Function xn_tcp_is_write
Function xn_wait_tcp_output
Function xn_autoanswer
Function xn_autologin
Function xn_hangup
Function xn_scriptlogin
Function xn_autoip
Function xn_ioacc_init
Function xn_nat_init
Function xn_arp_add
Function xn_arp_del
Function xn_arp_remote
Function xn_arp_cache_lookup
Function xn_send_ethernet_frame
Function xn_callbacks
Function cb_wr_screen_string_fnc
Function cb_rs232_connection_lost_fnc
Function cb_error_report_fnc
Function cb_raw_mode_in_char_fnc
Function cb_autoip_new_ip_fnc
Function cb_autoip_no_ip_fnc
Function cb_packetin_isr
Function cb_packetin_task
Function cb_packetout
PPP
DHCP Client
DHCP Server
FTP Client
FTP Server
TFTP Client
TFTP Server
Telnet Client
Telnet Server
Web Server
SNMP Client
POP3 Client
SMTP Client
SNTP Client
SMB Server
SMB Client
SMB3 Server
SMB3 Client
WLAN Driver
Error Codes
RTPEG-32
RTUSB-32
|
Function xn_interface_opt
Change an option associated with an interface.
int xn_interface_opt(int iface_no,
int option_name,
const char * option_value,
int optionlen);
Parametersiface_noInterface number (returned by xn_interface_open, xn_interface_open_config or xn_attach.
option_nameOptions to set (see below).
option_valueBuffer which contains values for option.
optionlenLength of *option_value.
return valueReturns 0 if option set successfully, 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:
Value |
Meaning |
ENOTINITIALIZED |
RTIP-32 has not been initialized (xn_rtip_init has not been called). |
ENOPROTOOPT |
Option parameter is invalid. |
The following options are supported:
Value |
Meaning |
IO_DEFAULT_MCAST |
Default multicast interface; i.e. iface_no specifies the default interface to be used by xn_interface_mcast. The int value stored at option_value is 1. |
IO_MAX_OUTPUT_QUE |
Set *(int*)option_value to be the maximum number of packets which can be queued on output list (-1 = no limit = default). |
IO_OUTPUT_WINDOW |
Set *(int*)option_value to be the default TCP output window size; does not affect sockets already connected (default: 11680). The option must not be set to a value higher than 1G. Function setsockopt may be used to override this value on a per socket basis. Please note that large windows require much buffer space, so CFG_NUM_PACKETS3 may need to be increased. |
IO_INPUT_WINDOW |
Set *(int*)option_value to be the default TCP input window size; does not affect sockets already connected (default: 11680). The option must not be set to a value higher than 1G. Function setsockopt may be used to override this value on a per socket basis. Please note that large windows require much buffer space, so CFG_NUM_PACKETS3 may need to be increased. |
IO_MTU |
Set *(int*)option_value to be the MTU: Maximum Transfer Unit (maximum size of packet, includes IP header). For TCP, changing MTU will not affect sockets which are already connected. For UDP, changing MTU will affect all packets sent. |
IO_802_2 |
If *(int*)option_value is not zero, all packets sent on this interface will use the 802.2 format. Note that you can also control 802.2 on a per socket basis using function setsockopt and option SO_802_2. |
IO_HARD_CLOSE |
If *(int*)option_value is not zero, xn_interface_close will not attempt to send out all packets which are queued on the interface. Rather, the interface is closed immediately and all queued data is lost. |
IO_CHKSUM_OFFLOAD |
Configures checksum offloading for this interface. *(dword*)option_value may be zero (checksum offloading is disabled) or a combination of these flags: CHKSUM_OFFLOAD_IP_IN, CHKSUM_OFFLOAD_IP_OUT, CHKSUM_OFFLOAD_UDP_IN, CHKSUM_OFFLOAD_UDP_OUT, CHKSUM_OFFLOAD_TCP_IN, CHKSUM_OFFLOAD_TCP_OUT. Value 0xFFFFFFFF enables all checksum offloading capabilities of the interface. Currently, drivers R8168_DEVICE and VIAVELO_DEVICE supports all checksum offloading options. Drivers I8254X_DEVICE, I82575_DEVICE, I82599_DEVICE, and I225_DEVICE support all except CHKSUM_OFFLOAD_IP_OUT. Checksum offloading options not supported by the interface's driver are ignored. By default, all supported checksum offloading capabilities are disabled by xn_interface_open and xn_interface_open_config. |
Example:
// set default interface for accepting multicasts
int value = 1; // turn option on
if (xn_interface_opt(iface, IO_DEFAULT_MCAST, (const char *) &value, sizeof(int))
printf("xn_interface_opt failed \n");
// turn off default interface for multicast
int value = 0; // turn option off
if (xn_interface_opt(iface, IO_DEFAULT_MCAST, (const char *) &value, sizeof(int))
printf("xn_interface_opt failed \n");
Extended RTIP-32 API
Function xn_interface_open_config
Function xn_interface_ethernet_statistics
|