1#ifndef GENLIB_NET_SOCK_H
2#define GENLIB_NET_SOCK_H
46#include "autoconfig.h"
47#ifdef UPNP_ENABLE_OPEN_SSL
48 #include <openssl/ssl.h>
53 #define SD_RECEIVE 0x00
64 struct sockaddr_storage foreign_sockaddr;
65#ifdef UPNP_ENABLE_OPEN_SSL
121 struct sockaddr *foreign_sockaddr);
131#ifdef UPNP_ENABLE_OPEN_SSL
Defines constants that for some reason are not defined on some systems.
#define UPNP_INLINE
Declares an inline function.
Definition UpnpGlobal.h:112
Provides a platform independent way to include TCP/IP types and functions.
#define UpnpCloseSocket
Definition UpnpInet.h:57
SOCKET socket
Definition sock.h:62
int sock_write(SOCKINFO *info, const char *buffer, size_t bufsize, int *timeoutSecs)
Writes data on the socket in sockinfo.
Definition sock.c:286
#define INVALID_SOCKET
Definition UpnpInet.h:51
int sock_init(SOCKINFO *info, SOCKET sockfd)
Assign the passed in socket descriptor to socket descriptor in the SOCKINFO structure.
Definition sock.c:73
int sock_destroy(SOCKINFO *info, int ShutdownMethod)
Associates an SSL object with the socket and begins the client-side SSL/TLS handshake.
Definition sock.c:119
static UPNP_INLINE int sock_close(SOCKET sock)
Closes the socket if it is different from -1.
Definition sock.h:79
int sock_read(SOCKINFO *info, char *buffer, size_t bufsize, int *timeoutSecs)
Reads data on socket in sockinfo.
Definition sock.c:281
int SOCKET
Definition UpnpInet.h:48
int sock_init_with_ip(SOCKINFO *info, SOCKET sockfd, struct sockaddr *foreign_sockaddr)
Calls the sock_init function and assigns the passed in IP address and port to the IP address and port...
Definition sock.c:83
int sock_make_blocking(SOCKET sock)
Make socket blocking.
Definition sock.c:293
int sock_make_no_blocking(SOCKET sock)
Make socket non-blocking.
Definition sock.c:309