UPnPsdk 0.1
Universal Plug and Play +, Software Development Kit
 
Loading...
Searching...
No Matches
anonymous_namespace{sock.cpp} Namespace Reference

Functions

Scope restricted to file
int sock_read_unprotected (const SOCKINFO *a_info, char *a_readbuf, const char *a_writebuf, const size_t a_bufsize, int *a_timeoutSecs)
 Read from a not SSL protected socket.
 
int sock_write_unprotected (const SOCKINFO *a_info, char *a_readbuf, const char *a_writebuf, const size_t a_bufsize, int *a_timeoutSecs)
 Write to a not SSL protected socket.
 
int sock_read_ssl (const SOCKINFO *a_info, char *a_readbuf, const char *a_writebuf, const size_t a_bufsize, int *a_timeoutSecs)
 Read from an SSL protected socket.
 
int sock_write_ssl (const SOCKINFO *a_info, char *a_readbuf, const char *a_writebuf, const size_t a_bufsize, int *a_timeoutSecs)
 Write to an SSL protected socket.
 

Variables

SSL_CTX * gSslCtx {nullptr}
 Pointer to an SSL Context.
 

Function Documentation

◆ sock_read_unprotected()

int anonymous_namespace{sock.cpp}::sock_read_unprotected ( const SOCKINFO a_info,
char *  a_readbuf,
const char *  a_writebuf,
const size_t  a_bufsize,
int *  a_timeoutSecs 
)

Read from a not SSL protected socket.

Returns
On success: Number of bytes read. 0 bytes read is no error.
On error:
  • UPNP_E_SOCKET_ERROR
  • UPNP_E_TIMEDOUT
Parameters
[in]a_infoSocket Information Object.
[out]a_readbufBuffer to get data to.
[in]a_writebufBuffer to send data from.
[in]a_bufsizeSize of the used buffer (read or write).
[in]a_timeoutSecstimeout value: < 0 blocks indefinitely waiting for a file descriptor to become ready.

Definition at line 79 of file sock.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ sock_write_unprotected()

int anonymous_namespace{sock.cpp}::sock_write_unprotected ( const SOCKINFO a_info,
char *  a_readbuf,
const char *  a_writebuf,
const size_t  a_bufsize,
int *  a_timeoutSecs 
)

Write to a not SSL protected socket.

Returns
On success: Number of bytes written. 0 bytes written is no error.
On error:
  • UPNP_E_SOCKET_ERROR
  • UPNP_E_TIMEDOUT
  • UPNP_E_SOCKET_WRITE
Parameters
[in]a_infoSocket Information Object.
[out]a_readbufBuffer to get data to.
[in]a_writebufBuffer to send data from.
[in]a_bufsizeSize of the buffer.
[in]a_timeoutSecstimeout value: < 0 blocks indefinitely waiting for a file descriptor to become ready.

Definition at line 164 of file sock.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ sock_read_ssl()

int anonymous_namespace{sock.cpp}::sock_read_ssl ( const SOCKINFO a_info,
char *  a_readbuf,
const char *  a_writebuf,
const size_t  a_bufsize,
int *  a_timeoutSecs 
)

Read from an SSL protected socket.

This is only available with OpenSSL enabled on compiling the library.

Returns
On success: Number of bytes read. 0 bytes read is no error.
On error:
  • UPNP_E_SOCKET_ERROR
  • UPNP_E_TIMEDOUT
Parameters
[in]a_infoSocket Information Object.
[out]a_readbufBuffer to get data to.
[in]a_writebufBuffer to send data from.
[in]a_bufsizeSize of the used buffer (read or write).
[in]a_timeoutSecstimeout value: < 0 blocks indefinitely waiting for a file descriptor to become ready.

Definition at line 264 of file sock.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ sock_write_ssl()

int anonymous_namespace{sock.cpp}::sock_write_ssl ( const SOCKINFO a_info,
char *  a_readbuf,
const char *  a_writebuf,
const size_t  a_bufsize,
int *  a_timeoutSecs 
)

Write to an SSL protected socket.

This is only available with OpenSSL enabled on compiling the library.

Returns
On success: Number of bytes written. 0 bytes written is no error.
On error:
  • UPNP_E_SOCKET_ERROR
  • UPNP_E_TIMEDOUT
  • UPNP_E_SOCKET_WRITE
Parameters
[in]a_infoSocket Information Object.
[out]a_readbufBuffer to get data to.
[in]a_writebufBuffer to send data from.
[in]a_bufsizeSize of the buffer.
[in]a_timeoutSecstimeout value: < 0 blocks indefinitely waiting for a file descriptor to become ready.

Definition at line 351 of file sock.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Variable Documentation

◆ gSslCtx

SSL_CTX* anonymous_namespace{sock.cpp}::gSslCtx {nullptr}

Pointer to an SSL Context.

Only this one is supported. With the given functions there is no way to use more than this SSL Context.

Definition at line 63 of file sock.cpp.