The setsockopt() function shall set the option specified by the option_name argument, at the protocol level specified by the level argument, to the value pointed to by the option_value argument for the socket specified by the socket argument.
Functions | |
NMI_API sint8 | setsockopt (SOCKET socket, uint8 u8Level, uint8 option_name, const void *option_value, uint16 u16OptionLen) |
NMI_API sint8 setsockopt | ( | SOCKET | sock, |
uint8 | u8Level, | ||
uint8 | option_name, | ||
const void * | option_value, | ||
uint16 | u16OptionLen | ||
) |
The setsockopt() function shall set the option specified by the option_name argument, at the protocol level specified by the level argument, to the value pointed to by the option_value argument for the socket specified by the socket argument.
[in] | socket | Socket handler. |
[in] | u8Level | Protocol level. Supported protocol levels are SOL_SOCKET, SOL_SSL_SOCKET and SOL_RAW. |
[in] | option_name | Option to be set. For protocol level SOL_SOCKET, the supported option names are: SO_SET_UDP_SEND_CALLBACK SO_TCP_KEEPALIVE SO_TCP_KEEPIDLE SO_TCP_KEEPINTVL SO_TCP_KEEPCNT For protocol level SOL_SSL_SOCKET, the supported option names are: SO_SSL_BYPASS_X509_VERIF SO_SSL_SNI SO_SSL_ENABLE_SESSION_CACHING SO_SSL_ENABLE_CERTNAME_VALIDATION SO_SSL_ALPN For protocol level SOL_RAW, the supported option names are: SO_ICMP_FILTER |
[in] | option_value | Pointer to user provided value. |
[in] | u16OptionLen | Length of the option value in bytes. Refer to each option documentation for the required length. |
[in] | socket | Socket handler. |
[in] | u8Level | Protocol level. Supported protocol levels are SOL_SOCKET and SOL_SSL_SOCKET. |
[in] | option_name | Option to be set. For protocol level SOL_SOCKET, the supported option names are: SO_SET_UDP_SEND_CALLBACK SO_TCP_KEEPALIVE SO_TCP_KEEPIDLE SO_TCP_KEEPINTVL SO_TCP_KEEPCNT For protocol level SOL_SSL_SOCKET, the supported option names are: SO_SSL_BYPASS_X509_VERIF SO_SSL_SNI SO_SSL_ENABLE_SESSION_CACHING SO_SSL_ENABLE_SNI_VALIDATION SO_SSL_ALPN |
[in] | option_value | Pointer to user provided value. |
[in] | u16OptionLen | Length of the option value in bytes. Refer to each option documentation for the required length. |
References MAX_SOCKET, NULL, rawSetSockOpt(), tstrSetSocketOptCmd::sock, SOCK_ERR_INVALID, SOCK_ERR_INVALID_ARG, SOCK_ERR_NO_ERROR, SOCKET_CMD_SET_SOCKET_OPTION, SOCKET_REQUEST, SOL_RAW, SOL_SOCKET, SOL_SSL_SOCKET, sslSetSockOpt(), tstrSocket::u16SessionID, tstrSetSocketOptCmd::u16SessionID, tstrSetSocketOptCmd::u32OptionValue, and tstrSetSocketOptCmd::u8Option.
Referenced by set_alpn_list(), and sslConnect().