SOCK_ERR_INVALID_SOCKET_ID,/**< The passed socket ID is invalid */
SOCK_ERR_API_NOT_INITIALIZED,/**< Socket Interface not initialized */
SOCK_ERR_OUT_OF_SOCKETS,/**< No free socket available */
SOCK_ERR_INVALID_SOCKET_ID,/**< The passed socket ID is invalid */
SOCK_ERR_SOCKET_NOT_CREATED,/**< The specified socket has not been created.
SOCK_ERR_OUT_OF_SOCKETS,/**< No free socket available */
*/
SOCK_ERR_SOCKET_NOT_CREATED,/**< The specified socket has not been created. */
SOCK_ERR_SOCKET_OFFLINE,/**< The local port associated with the socket is not
SOCK_ERR_SOCKET_OFFLINE,/**< The local port associated with the socket is not open. Sending/Receiving of messages is not possible. */
open. Sending/Receiving of messages is not
SOCK_ERR_SOCKET_BUSY,/**< A send request is rejected because a previous send request on the specified socket is not completed */
possible. */
SOCK_ERR_SOCKET_NOT_CONNECTED,/**< The request is rejected because the specified TCP connection or no TCP connection has been established for the specified socket. */
SOCK_ERR_SOCKET_BUSY,/**< A send request is rejected because a previous send
SOCK_ERR_SOCKET_CONNECTED,/**< The request is rejected because the specified TCP connection has established a connection before the filter was activated. */
request on the specified socket is not completed */
SOCK_ERR_ADDR_IN_USE,/**< The passed local address is already in use by another socket. */
SOCK_ERR_SOCKET_NOT_CONNECTED,/**< The request is rejected because the
SOCK_ERR_INVALID_LOCAL_ADDR,/**< The passed local IP address is invalid. It is not possible to bind the socket to this address. Which IP addresses are allowed depends
specified TCP connection or no TCP
on the socket configuration (e.g. socket type UDP or TCP) and the network settings adjusted by calling the function sock_init(). */
connection has been established for the
SOCK_ERR_INVALID_REMOTE_ADDR,/**< The passed remote IP address is invalid. It is not possible to send or connect to this address. Which IP addresses are allowed depends
specified socket. */
on the socket configuration (e.g. socket type UDP or TCP) and the network settings adjusted by calling the function sock_init(). */
SOCK_ERR_SOCKET_CONNECTED,/**< The request is rejected because the specified
SOCK_ERR_NO_DATA_RECEIVED,/**< No data has been received on the specfied socket or TCP connection. */
TCP connection has established a connection
SOCK_ERR_NOT_SUPPORTED,/**< The requested action is not supported on the specified socket. */
before the filter was activated. */
SOCK_ERR_TEMPORARY_NOT_EXECUTABLE,/**< The requested action is temporary not executable on the specified socket due a concurrent pending request. */
SOCK_ERR_ADDR_IN_USE,/**< The passed local address is already in use by
SOCK_ERR_FATAL_ERROR,/**< A fatal error is reported during execution of function. */
another socket. */
SOCK_ERR_LIBRARY_NOT_LOADED/**< Can not load socket library */
SOCK_ERR_INVALID_LOCAL_ADDR,/**< The passed local IP address is invalid. It
is not possible to bind the socket to this
address. Which IP addresses are allowed
depends
on the socket configuration (e.g. socket
type UDP or TCP) and the network settings
adjusted by calling the function sock_init().
*/
SOCK_ERR_INVALID_REMOTE_ADDR,/**< The passed remote IP address is invalid. It
is not possible to send or connect to this
address. Which IP addresses are allowed
depends
on the socket configuration (e.g. socket
type UDP or TCP) and the network settings
adjusted by calling the function sock_init().
*/
SOCK_ERR_NO_DATA_RECEIVED,/**< No data has been received on the specfied
socket or TCP connection. */
SOCK_ERR_NOT_SUPPORTED,/**< The requested action is not supported on the
specified socket. */
SOCK_ERR_TEMPORARY_NOT_EXECUTABLE,/**< The requested action is temporary not
executable on the specified socket due a
concurrent pending request. */
SOCK_ERR_FATAL_ERROR,/**< A fatal error is reported during execution of
function. */
SOCK_ERR_LIBRARY_NOT_LOADED/**< Can not load socket library */
#define SOCK_IP_ADDR_ANY 0x00000000uL /**< Can be used as local IP address when creating a socket to bind the socket to all the IP addresses (If the system has
0x00000000uL /**< Can be used as local IP address when creating a socket to \
multiple IP addresses) or if the local IP address is unknown. */
bind the socket to all the IP addresses (If the system has \
#define SOCK_PORT_ANY 0u /**< Can be used as local port when creating a TCP Client socket to let the TCP/IP stack select a unique local port from the
multiple IP addresses) or if the local IP address is \
dynamic client port range. */
unknown. */
#define SOCK_PORT_ANY \
0u /**< Can be used as local port when creating a TCP Client socket to let \
the TCP/IP stack select a unique local port from the \
* \brief Configurable Options for the socket interface
* \brief Configurable Options for the socket interface
*/
*/
typedefstruct_T_PNAK_SOCK_CONFIG_OPTIONS{
typedefstruct_T_PNAK_SOCK_CONFIG_OPTIONS
PN_U32
{
Timeout;/**< Keep-Alive Timeout in milliseconds. The Keep-Alive Timeout
PN_U32Timeout;/**< Keep-Alive Timeout in milliseconds. The Keep-Alive Timeout will be used for the supervision of TCP connections. The connection will be aborted if the
will be used for the supervision of TCP connections. The
remote connection partner did not show activity within this timeout. The supervision of TCP connections can be enabled/disabled socket-specific when
connection will be aborted if the
creating the socket by calling sock_create(). For UDP sockets the application needs to perform a supervision if necessary. If the timeout value is set to 0
remote connection partner did not show activity within this
and #SOCK_FLAG_ENABLE_KEEPALIVE is set when creating a socket, a default value for the Keep-Alive Timeout will be used. */
timeout. The supervision of TCP connections can be
enabled/disabled socket-specific when
}PACK_WORD_ALIGNMENT(T_PNAK_SOCK_CONFIG_OPTIONS);
creating the socket by calling sock_create(). For UDP
sockets the application needs to perform a supervision if
necessary. If the timeout value is set to 0
and #SOCK_FLAG_ENABLE_KEEPALIVE is set when creating a
socket, a default value for the Keep-Alive Timeout will be
#define SOCK_TCP_CONNECTION_STATUS_UNCONNECTED 0x00000001uL /**< TCP connection not established */
0x00000001uL /**< TCP connection not established */
#define SOCK_TCP_CONNECTION_STATUS_CONNECTING 0x00000002uL /**< A TCP connection establishment is in progress. This status is only possible for a TCP client socket. */
#define SOCK_TCP_CONNECTION_STATUS_CONNECTING \
#define SOCK_TCP_CONNECTION_STATUS_CONNECTED 0x00000003uL /**< TCP connection established */
0x00000002uL /**< A TCP connection establishment is in progress. This status \
is only possible for a TCP client socket. */
#define SOCK_TCP_CONNECTION_STATUS_CONNECTED \
0x00000003uL /**< TCP connection established */
/** @} */
/** @} */
/** \anchor ConnectionStatusCode @name TCP Connection Status Codes
/** \anchor ConnectionStatusCode @name TCP Connection Status Codes
#define SOCK_TCP_CONNECTION_STATUS_CODE_NO_ERROR 0x00000000uL /**< No error detected */
0x00000000uL /**< No error detected */
#define SOCK_TCP_CONNECTION_STATUS_CODE_INTERNAL_ERROR 0x00000001uL /**< An internal error occurred in the socket interface causing the connection to abort. */
#define SOCK_TCP_CONNECTION_STATUS_CODE_CLOSED_REMOTELY 0x00000002uL /**< The connection has been orderly closed by the remote connection partner (TCP FIN received). */
0x00000001uL /**< An internal error occurred in the socket interface causing \
#define SOCK_TCP_CONNECTION_STATUS_CODE_ABORTED_REMOTELY 0x00000003uL /**< The connection has been aborted by the remote connection partner (TCP RST received), e.g. because
the connection to abort. */
the remote partner has detected an error or temporarily crashed. */
#define SOCK_TCP_CONNECTION_STATUS_CODE_TIMEOUT 0x00000004uL /**< The connection has been aborted because of a network failure or because the remote connection partner failed
0x00000002uL /**< The connection has been orderly closed by the remote \
to respond within the configured supervision timeout (see also T_PNAK_SOCK_CONFIG_OPTIONS). */
connection partner (TCP FIN received). */
#define SOCK_TCP_CONNECTION_STATUS_CODE_CONNECT_REJECTED 0x00000005uL /**< It was not possible to establish a connection because the destination host rejected the connect request,
#define SOCK_LOCAL_STATUS_CLOSED 0x00000001uL /**< The local socket is closed */
0x00000001uL /**< The local socket is closed \
#define SOCK_LOCAL_STATUS_OFFLINE 0x00000002uL /**< The local port associated with the socket is not open. Sending/Receiving of messages is not possible. */
*/
#define SOCK_LOCAL_STATUS_ONLINE 0x00000003uL /**< The local port associated with the socket is open. Sending/Receiving of messages is possible. */
#define SOCK_LOCAL_STATUS_OFFLINE \
0x00000002uL /**< The local port associated with the socket is not open. \
Sending/Receiving of messages is not possible. */
#define SOCK_LOCAL_STATUS_ONLINE \
0x00000003uL /**< The local port associated with the socket is open. \
Sending/Receiving of messages is possible. */
/** @} */
/** @} */
/** \anchor SocketStatusCode @name Socket Status Codes
/** \anchor SocketStatusCode @name Socket Status Codes
* Error Codes of a socket
* Error Codes of a socket
* @{
* @{
*/
*/
#define SOCK_LOCAL_STATUS_CODE_NO_ERROR 0x00000000uL /**< No error detected */
#define SOCK_LOCAL_STATUS_CODE_NO_ERROR 0x00000000uL /**< No error detected */
#define SOCK_LOCAL_STATUS_CODE_ADDR_IN_USE \
#define SOCK_LOCAL_STATUS_CODE_ADDR_IN_USE 0x00000001uL /**< The local address passed with sock_create() is already in use by another socket. */
0x00000001uL /**< The local address passed with sock_create() is already in \
#define SOCK_LOCAL_STATUS_CODE_INTERNAL_ERROR 0x00000002uL /**< An internal error occurred in the socket interface causing the socket to close. */
use by another socket. */
#define SOCK_LOCAL_STATUS_CODE_INTERNAL_ERROR \
0x00000002uL /**< An internal error occurred in the socket interface causing \