|
Packit Service |
fa4841 |
/**
|
|
Packit Service |
fa4841 |
* WinPR: Windows Portable Runtime
|
|
Packit Service |
fa4841 |
* Windows Sockets (Winsock)
|
|
Packit Service |
fa4841 |
*
|
|
Packit Service |
fa4841 |
* Copyright 2012 Marc-Andre Moreau <marcandre.moreau@gmail.com>
|
|
Packit Service |
fa4841 |
*
|
|
Packit Service |
fa4841 |
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
Packit Service |
fa4841 |
* you may not use this file except in compliance with the License.
|
|
Packit Service |
fa4841 |
* You may obtain a copy of the License at
|
|
Packit Service |
fa4841 |
*
|
|
Packit Service |
fa4841 |
* http://www.apache.org/licenses/LICENSE-2.0
|
|
Packit Service |
fa4841 |
*
|
|
Packit Service |
fa4841 |
* Unless required by applicable law or agreed to in writing, software
|
|
Packit Service |
fa4841 |
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
Packit Service |
fa4841 |
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
Packit Service |
fa4841 |
* See the License for the specific language governing permissions and
|
|
Packit Service |
fa4841 |
* limitations under the License.
|
|
Packit Service |
fa4841 |
*/
|
|
Packit Service |
fa4841 |
|
|
Packit Service |
fa4841 |
#ifndef WINPR_WINSOCK_H
|
|
Packit Service |
fa4841 |
#define WINPR_WINSOCK_H
|
|
Packit Service |
fa4841 |
|
|
Packit Service |
fa4841 |
#include <winpr/winpr.h>
|
|
Packit Service |
fa4841 |
#include <winpr/wtypes.h>
|
|
Packit Service |
fa4841 |
#include <winpr/windows.h>
|
|
Packit Service |
fa4841 |
|
|
Packit Service |
fa4841 |
#ifdef _WIN32
|
|
Packit Service |
fa4841 |
|
|
Packit Service |
b1ea74 |
#define _accept accept
|
|
Packit Service |
b1ea74 |
#define _bind bind
|
|
Packit Service |
b1ea74 |
#define _connect connect
|
|
Packit Service |
b1ea74 |
#define _ioctlsocket ioctlsocket
|
|
Packit Service |
b1ea74 |
#define _getpeername getpeername
|
|
Packit Service |
b1ea74 |
#define _getsockname getsockname
|
|
Packit Service |
b1ea74 |
#define _getsockopt getsockopt
|
|
Packit Service |
b1ea74 |
#define _htonl htonl
|
|
Packit Service |
b1ea74 |
#define _htons htons
|
|
Packit Service |
b1ea74 |
#define _inet_addr inet_addr
|
|
Packit Service |
b1ea74 |
#define _inet_ntoa inet_ntoa
|
|
Packit Service |
b1ea74 |
#define _listen listen
|
|
Packit Service |
b1ea74 |
#define _ntohl ntohl
|
|
Packit Service |
b1ea74 |
#define _ntohs ntohs
|
|
Packit Service |
b1ea74 |
#define _recv recv
|
|
Packit Service |
b1ea74 |
#define _recvfrom recvfrom
|
|
Packit Service |
b1ea74 |
#define _select select
|
|
Packit Service |
b1ea74 |
#define _send send
|
|
Packit Service |
b1ea74 |
#define _sendto sendto
|
|
Packit Service |
b1ea74 |
#define _setsockopt setsockopt
|
|
Packit Service |
b1ea74 |
#define _shutdown shutdown
|
|
Packit Service |
b1ea74 |
#define _socket socket
|
|
Packit Service |
b1ea74 |
#define _gethostbyaddr gethostbyaddr
|
|
Packit Service |
b1ea74 |
#define _gethostbyname gethostbyname
|
|
Packit Service |
b1ea74 |
#define _gethostname gethostname
|
|
Packit Service |
b1ea74 |
#define _getservbyport getservbyport
|
|
Packit Service |
b1ea74 |
#define _getservbyname getservbyname
|
|
Packit Service |
b1ea74 |
#define _getprotobynumber getprotobynumber
|
|
Packit Service |
b1ea74 |
#define _getprotobyname getprotobyname
|
|
Packit Service |
b1ea74 |
|
|
Packit Service |
b1ea74 |
#define _IFF_UP IFF_UP
|
|
Packit Service |
b1ea74 |
#define _IFF_BROADCAST IFF_BROADCAST
|
|
Packit Service |
b1ea74 |
#define _IFF_LOOPBACK IFF_LOOPBACK
|
|
Packit Service |
b1ea74 |
#define _IFF_POINTTOPOINT IFF_POINTTOPOINT
|
|
Packit Service |
b1ea74 |
#define _IFF_MULTICAST IFF_MULTICAST
|
|
Packit Service |
fa4841 |
|
|
Packit Service |
fa4841 |
#if (_WIN32_WINNT < 0x0600)
|
|
Packit Service |
fa4841 |
|
|
Packit Service |
fa4841 |
WINPR_API PCSTR winpr_inet_ntop(INT Family, PVOID pAddr, PSTR pStringBuf, size_t StringBufSize);
|
|
Packit Service |
fa4841 |
WINPR_API INT winpr_inet_pton(INT Family, PCSTR pszAddrString, PVOID pAddrBuf);
|
|
Packit Service |
fa4841 |
|
|
Packit Service |
fa4841 |
#define inet_ntop winpr_inet_ntop
|
|
Packit Service |
fa4841 |
#define inet_pton winpr_inet_pton
|
|
Packit Service |
fa4841 |
|
|
Packit Service |
fa4841 |
#endif /* (_WIN32_WINNT < 0x0600) */
|
|
Packit Service |
fa4841 |
|
|
Packit Service |
fa4841 |
#else /* _WIN32 */
|
|
Packit Service |
fa4841 |
|
|
Packit Service |
fa4841 |
#include <netdb.h>
|
|
Packit Service |
fa4841 |
#include <unistd.h>
|
|
Packit Service |
fa4841 |
#include <sys/un.h>
|
|
Packit Service |
fa4841 |
#include <sys/ioctl.h>
|
|
Packit Service |
fa4841 |
#include <sys/socket.h>
|
|
Packit Service |
fa4841 |
#include <arpa/inet.h>
|
|
Packit Service |
fa4841 |
#include <netinet/in.h>
|
|
Packit Service |
fa4841 |
#include <netinet/tcp.h>
|
|
Packit Service |
fa4841 |
#include <net/if.h>
|
|
Packit Service |
fa4841 |
|
|
Packit Service |
fa4841 |
#include <winpr/io.h>
|
|
Packit Service |
fa4841 |
#include <winpr/error.h>
|
|
Packit Service |
fa4841 |
#include <winpr/platform.h>
|
|
Packit Service |
fa4841 |
|
|
Packit Service |
b1ea74 |
#define WSAEVENT HANDLE
|
|
Packit Service |
b1ea74 |
#define LPWSAEVENT LPHANDLE
|
|
Packit Service |
b1ea74 |
#define WSAOVERLAPPED OVERLAPPED
|
|
Packit Service |
b1ea74 |
typedef OVERLAPPED* LPWSAOVERLAPPED;
|
|
Packit Service |
fa4841 |
|
|
Packit Service |
fa4841 |
typedef UINT_PTR SOCKET;
|
|
Packit Service |
fa4841 |
typedef struct sockaddr_storage SOCKADDR_STORAGE;
|
|
Packit Service |
fa4841 |
|
|
Packit Service |
fa4841 |
#ifndef INVALID_SOCKET
|
|
Packit Service |
fa4841 |
#define INVALID_SOCKET (SOCKET)(~0)
|
|
Packit Service |
fa4841 |
#endif
|
|
Packit Service |
fa4841 |
|
|
Packit Service |
b1ea74 |
#define WSADESCRIPTION_LEN 256
|
|
Packit Service |
b1ea74 |
#define WSASYS_STATUS_LEN 128
|
|
Packit Service |
fa4841 |
|
|
Packit Service |
b1ea74 |
#define FD_READ_BIT 0
|
|
Packit Service |
b1ea74 |
#define FD_READ (1 << FD_READ_BIT)
|
|
Packit Service |
fa4841 |
|
|
Packit Service |
b1ea74 |
#define FD_WRITE_BIT 1
|
|
Packit Service |
b1ea74 |
#define FD_WRITE (1 << FD_WRITE_BIT)
|
|
Packit Service |
fa4841 |
|
|
Packit Service |
b1ea74 |
#define FD_OOB_BIT 2
|
|
Packit Service |
b1ea74 |
#define FD_OOB (1 << FD_OOB_BIT)
|
|
Packit Service |
fa4841 |
|
|
Packit Service |
b1ea74 |
#define FD_ACCEPT_BIT 3
|
|
Packit Service |
b1ea74 |
#define FD_ACCEPT (1 << FD_ACCEPT_BIT)
|
|
Packit Service |
fa4841 |
|
|
Packit Service |
b1ea74 |
#define FD_CONNECT_BIT 4
|
|
Packit Service |
b1ea74 |
#define FD_CONNECT (1 << FD_CONNECT_BIT)
|
|
Packit Service |
fa4841 |
|
|
Packit Service |
b1ea74 |
#define FD_CLOSE_BIT 5
|
|
Packit Service |
b1ea74 |
#define FD_CLOSE (1 << FD_CLOSE_BIT)
|
|
Packit Service |
fa4841 |
|
|
Packit Service |
b1ea74 |
#define FD_QOS_BIT 6
|
|
Packit Service |
b1ea74 |
#define FD_QOS (1 << FD_QOS_BIT)
|
|
Packit Service |
fa4841 |
|
|
Packit Service |
b1ea74 |
#define FD_GROUP_QOS_BIT 7
|
|
Packit Service |
b1ea74 |
#define FD_GROUP_QOS (1 << FD_GROUP_QOS_BIT)
|
|
Packit Service |
fa4841 |
|
|
Packit Service |
b1ea74 |
#define FD_ROUTING_INTERFACE_CHANGE_BIT 8
|
|
Packit Service |
b1ea74 |
#define FD_ROUTING_INTERFACE_CHANGE (1 << FD_ROUTING_INTERFACE_CHANGE_BIT)
|
|
Packit Service |
fa4841 |
|
|
Packit Service |
b1ea74 |
#define FD_ADDRESS_LIST_CHANGE_BIT 9
|
|
Packit Service |
b1ea74 |
#define FD_ADDRESS_LIST_CHANGE (1 << FD_ADDRESS_LIST_CHANGE_BIT)
|
|
Packit Service |
fa4841 |
|
|
Packit Service |
b1ea74 |
#define FD_MAX_EVENTS 10
|
|
Packit Service |
b1ea74 |
#define FD_ALL_EVENTS ((1 << FD_MAX_EVENTS) - 1)
|
|
Packit Service |
fa4841 |
|
|
Packit Service |
b1ea74 |
#define SD_RECEIVE 0
|
|
Packit Service |
b1ea74 |
#define SD_SEND 1
|
|
Packit Service |
b1ea74 |
#define SD_BOTH 2
|
|
Packit Service |
fa4841 |
|
|
Packit Service |
b1ea74 |
#define SOCKET_ERROR (-1)
|
|
Packit Service |
fa4841 |
|
|
Packit Service |
fa4841 |
typedef struct WSAData
|
|
Packit Service |
fa4841 |
{
|
|
Packit Service |
fa4841 |
WORD wVersion;
|
|
Packit Service |
fa4841 |
WORD wHighVersion;
|
|
Packit Service |
fa4841 |
#ifdef _M_AMD64
|
|
Packit Service |
fa4841 |
unsigned short iMaxSockets;
|
|
Packit Service |
fa4841 |
unsigned short iMaxUdpDg;
|
|
Packit Service |
fa4841 |
char* lpVendorInfo;
|
|
Packit Service |
b1ea74 |
char szDescription[WSADESCRIPTION_LEN + 1];
|
|
Packit Service |
b1ea74 |
char szSystemStatus[WSASYS_STATUS_LEN + 1];
|
|
Packit Service |
fa4841 |
#else
|
|
Packit Service |
b1ea74 |
char szDescription[WSADESCRIPTION_LEN + 1];
|
|
Packit Service |
b1ea74 |
char szSystemStatus[WSASYS_STATUS_LEN + 1];
|
|
Packit Service |
fa4841 |
unsigned short iMaxSockets;
|
|
Packit Service |
fa4841 |
unsigned short iMaxUdpDg;
|
|
Packit Service |
fa4841 |
char* lpVendorInfo;
|
|
Packit Service |
fa4841 |
#endif
|
|
Packit Service |
fa4841 |
} WSADATA, *LPWSADATA;
|
|
Packit Service |
fa4841 |
|
|
Packit Service |
fa4841 |
#ifndef MAKEWORD
|
|
Packit Service |
b1ea74 |
#define MAKEWORD(a, b) \
|
|
Packit Service |
b1ea74 |
((WORD)(((BYTE)((DWORD_PTR)(a)&0xFF)) | (((WORD)((BYTE)((DWORD_PTR)(b)&0xFF))) << 8)))
|
|
Packit Service |
fa4841 |
#endif
|
|
Packit Service |
fa4841 |
|
|
Packit Service |
fa4841 |
typedef struct in6_addr IN6_ADDR;
|
|
Packit Service |
fa4841 |
typedef struct in6_addr* PIN6_ADDR;
|
|
Packit Service |
fa4841 |
typedef struct in6_addr* LPIN6_ADDR;
|
|
Packit Service |
fa4841 |
|
|
Packit Service |
fa4841 |
struct sockaddr_in6_old
|
|
Packit Service |
fa4841 |
{
|
|
Packit Service |
fa4841 |
SHORT sin6_family;
|
|
Packit Service |
fa4841 |
USHORT sin6_port;
|
|
Packit Service |
fa4841 |
ULONG sin6_flowinfo;
|
|
Packit Service |
fa4841 |
IN6_ADDR sin6_addr;
|
|
Packit Service |
fa4841 |
};
|
|
Packit Service |
fa4841 |
|
|
Packit Service |
b1ea74 |
typedef union sockaddr_gen {
|
|
Packit Service |
fa4841 |
struct sockaddr Address;
|
|
Packit Service |
fa4841 |
struct sockaddr_in AddressIn;
|
|
Packit Service |
fa4841 |
struct sockaddr_in6_old AddressIn6;
|
|
Packit Service |
fa4841 |
} sockaddr_gen;
|
|
Packit Service |
fa4841 |
|
|
Packit Service |
b1ea74 |
#define _IFF_UP 0x00000001
|
|
Packit Service |
b1ea74 |
#define _IFF_BROADCAST 0x00000002
|
|
Packit Service |
b1ea74 |
#define _IFF_LOOPBACK 0x00000004
|
|
Packit Service |
b1ea74 |
#define _IFF_POINTTOPOINT 0x00000008
|
|
Packit Service |
b1ea74 |
#define _IFF_MULTICAST 0x00000010
|
|
Packit Service |
fa4841 |
|
|
Packit Service |
fa4841 |
struct _INTERFACE_INFO
|
|
Packit Service |
fa4841 |
{
|
|
Packit Service |
fa4841 |
ULONG iiFlags;
|
|
Packit Service |
fa4841 |
sockaddr_gen iiAddress;
|
|
Packit Service |
fa4841 |
sockaddr_gen iiBroadcastAddress;
|
|
Packit Service |
fa4841 |
sockaddr_gen iiNetmask;
|
|
Packit Service |
fa4841 |
};
|
|
Packit Service |
fa4841 |
typedef struct _INTERFACE_INFO INTERFACE_INFO;
|
|
Packit Service |
fa4841 |
typedef INTERFACE_INFO* LPINTERFACE_INFO;
|
|
Packit Service |
fa4841 |
|
|
Packit Service |
b1ea74 |
#define MAX_PROTOCOL_CHAIN 7
|
|
Packit Service |
b1ea74 |
#define WSAPROTOCOL_LEN 255
|
|
Packit Service |
fa4841 |
|
|
Packit Service |
fa4841 |
typedef struct _WSAPROTOCOLCHAIN
|
|
Packit Service |
fa4841 |
{
|
|
Packit Service |
fa4841 |
int ChainLen;
|
|
Packit Service |
fa4841 |
DWORD ChainEntries[MAX_PROTOCOL_CHAIN];
|
|
Packit Service |
b1ea74 |
} WSAPROTOCOLCHAIN, *LPWSAPROTOCOLCHAIN;
|
|
Packit Service |
fa4841 |
|
|
Packit Service |
fa4841 |
typedef struct _WSAPROTOCOL_INFOA
|
|
Packit Service |
fa4841 |
{
|
|
Packit Service |
fa4841 |
DWORD dwServiceFlags1;
|
|
Packit Service |
fa4841 |
DWORD dwServiceFlags2;
|
|
Packit Service |
fa4841 |
DWORD dwServiceFlags3;
|
|
Packit Service |
fa4841 |
DWORD dwServiceFlags4;
|
|
Packit Service |
fa4841 |
DWORD dwProviderFlags;
|
|
Packit Service |
fa4841 |
GUID ProviderId;
|
|
Packit Service |
fa4841 |
DWORD dwCatalogEntryId;
|
|
Packit Service |
fa4841 |
WSAPROTOCOLCHAIN ProtocolChain;
|
|
Packit Service |
fa4841 |
int iVersion;
|
|
Packit Service |
fa4841 |
int iAddressFamily;
|
|
Packit Service |
fa4841 |
int iMaxSockAddr;
|
|
Packit Service |
fa4841 |
int iMinSockAddr;
|
|
Packit Service |
fa4841 |
int iSocketType;
|
|
Packit Service |
fa4841 |
int iProtocol;
|
|
Packit Service |
fa4841 |
int iProtocolMaxOffset;
|
|
Packit Service |
fa4841 |
int iNetworkByteOrder;
|
|
Packit Service |
fa4841 |
int iSecurityScheme;
|
|
Packit Service |
fa4841 |
DWORD dwMessageSize;
|
|
Packit Service |
fa4841 |
DWORD dwProviderReserved;
|
|
Packit Service |
b1ea74 |
CHAR szProtocol[WSAPROTOCOL_LEN + 1];
|
|
Packit Service |
b1ea74 |
} WSAPROTOCOL_INFOA, *LPWSAPROTOCOL_INFOA;
|
|
Packit Service |
fa4841 |
|
|
Packit Service |
fa4841 |
typedef struct _WSAPROTOCOL_INFOW
|
|
Packit Service |
fa4841 |
{
|
|
Packit Service |
fa4841 |
DWORD dwServiceFlags1;
|
|
Packit Service |
fa4841 |
DWORD dwServiceFlags2;
|
|
Packit Service |
fa4841 |
DWORD dwServiceFlags3;
|
|
Packit Service |
fa4841 |
DWORD dwServiceFlags4;
|
|
Packit Service |
fa4841 |
DWORD dwProviderFlags;
|
|
Packit Service |
fa4841 |
GUID ProviderId;
|
|
Packit Service |
fa4841 |
DWORD dwCatalogEntryId;
|
|
Packit Service |
fa4841 |
WSAPROTOCOLCHAIN ProtocolChain;
|
|
Packit Service |
fa4841 |
int iVersion;
|
|
Packit Service |
fa4841 |
int iAddressFamily;
|
|
Packit Service |
fa4841 |
int iMaxSockAddr;
|
|
Packit Service |
fa4841 |
int iMinSockAddr;
|
|
Packit Service |
fa4841 |
int iSocketType;
|
|
Packit Service |
fa4841 |
int iProtocol;
|
|
Packit Service |
fa4841 |
int iProtocolMaxOffset;
|
|
Packit Service |
fa4841 |
int iNetworkByteOrder;
|
|
Packit Service |
fa4841 |
int iSecurityScheme;
|
|
Packit Service |
fa4841 |
DWORD dwMessageSize;
|
|
Packit Service |
fa4841 |
DWORD dwProviderReserved;
|
|
Packit Service |
b1ea74 |
WCHAR szProtocol[WSAPROTOCOL_LEN + 1];
|
|
Packit Service |
b1ea74 |
} WSAPROTOCOL_INFOW, *LPWSAPROTOCOL_INFOW;
|
|
Packit Service |
fa4841 |
|
|
Packit Service |
b1ea74 |
typedef void(CALLBACK* LPWSAOVERLAPPED_COMPLETION_ROUTINE)(DWORD dwError, DWORD cbTransferred,
|
|
Packit Service |
b1ea74 |
LPWSAOVERLAPPED lpOverlapped,
|
|
Packit Service |
b1ea74 |
DWORD dwFlags);
|
|
Packit Service |
fa4841 |
|
|
Packit Service |
fa4841 |
typedef UINT32 GROUP;
|
|
Packit Service |
b1ea74 |
#define SG_UNCONSTRAINED_GROUP 0x01
|
|
Packit Service |
b1ea74 |
#define SG_CONSTRAINED_GROUP 0x02
|
|
Packit Service |
fa4841 |
|
|
Packit Service |
b1ea74 |
#define SIO_GET_INTERFACE_LIST _IOR('t', 127, ULONG)
|
|
Packit Service |
b1ea74 |
#define SIO_GET_INTERFACE_LIST_EX _IOR('t', 126, ULONG)
|
|
Packit Service |
b1ea74 |
#define SIO_SET_MULTICAST_FILTER _IOW('t', 125, ULONG)
|
|
Packit Service |
b1ea74 |
#define SIO_GET_MULTICAST_FILTER _IOW('t', 124 | IOC_IN, ULONG)
|
|
Packit Service |
b1ea74 |
#define SIOCSIPMSFILTER SIO_SET_MULTICAST_FILTER
|
|
Packit Service |
b1ea74 |
#define SIOCGIPMSFILTER SIO_GET_MULTICAST_FILTER
|
|
Packit Service |
fa4841 |
|
|
Packit Service |
fa4841 |
#ifdef UNICODE
|
|
Packit Service |
b1ea74 |
#define WSAPROTOCOL_INFO WSAPROTOCOL_INFOW
|
|
Packit Service |
b1ea74 |
#define LPWSAPROTOCOL_INFO LPWSAPROTOCOL_INFOW
|
|
Packit Service |
fa4841 |
#else
|
|
Packit Service |
b1ea74 |
#define WSAPROTOCOL_INFO WSAPROTOCOL_INFOA
|
|
Packit Service |
b1ea74 |
#define LPWSAPROTOCOL_INFO LPWSAPROTOCOL_INFOA
|
|
Packit Service |
fa4841 |
#endif
|
|
Packit Service |
fa4841 |
|
|
Packit Service |
fa4841 |
#ifdef __cplusplus
|
|
Packit Service |
b1ea74 |
extern "C"
|
|
Packit Service |
b1ea74 |
{
|
|
Packit Service |
fa4841 |
#endif
|
|
Packit Service |
fa4841 |
|
|
Packit Service |
b1ea74 |
WINPR_API int WSAStartup(WORD wVersionRequired, LPWSADATA lpWSAData);
|
|
Packit Service |
b1ea74 |
WINPR_API int WSACleanup(void);
|
|
Packit Service |
b1ea74 |
|
|
Packit Service |
b1ea74 |
WINPR_API void WSASetLastError(int iError);
|
|
Packit Service |
b1ea74 |
WINPR_API int WSAGetLastError(void);
|
|
Packit Service |
b1ea74 |
|
|
Packit Service |
b1ea74 |
WINPR_API HANDLE WSACreateEvent(void);
|
|
Packit Service |
b1ea74 |
WINPR_API BOOL WSASetEvent(HANDLE hEvent);
|
|
Packit Service |
b1ea74 |
WINPR_API BOOL WSAResetEvent(HANDLE hEvent);
|
|
Packit Service |
b1ea74 |
WINPR_API BOOL WSACloseEvent(HANDLE hEvent);
|
|
Packit Service |
b1ea74 |
|
|
Packit Service |
b1ea74 |
WINPR_API int WSAEventSelect(SOCKET s, WSAEVENT hEventObject, LONG lNetworkEvents);
|
|
Packit Service |
b1ea74 |
|
|
Packit Service |
b1ea74 |
WINPR_API DWORD WSAWaitForMultipleEvents(DWORD cEvents, const HANDLE* lphEvents, BOOL fWaitAll,
|
|
Packit Service |
b1ea74 |
DWORD dwTimeout, BOOL fAlertable);
|
|
Packit Service |
b1ea74 |
|
|
Packit Service |
b1ea74 |
WINPR_API SOCKET WSASocketA(int af, int type, int protocol, LPWSAPROTOCOL_INFOA lpProtocolInfo,
|
|
Packit Service |
b1ea74 |
GROUP g, DWORD dwFlags);
|
|
Packit Service |
b1ea74 |
WINPR_API SOCKET WSASocketW(int af, int type, int protocol, LPWSAPROTOCOL_INFOW lpProtocolInfo,
|
|
Packit Service |
b1ea74 |
GROUP g, DWORD dwFlags);
|
|
Packit Service |
b1ea74 |
|
|
Packit Service |
b1ea74 |
WINPR_API int WSAIoctl(SOCKET s, DWORD dwIoControlCode, LPVOID lpvInBuffer, DWORD cbInBuffer,
|
|
Packit Service |
b1ea74 |
LPVOID lpvOutBuffer, DWORD cbOutBuffer, LPDWORD lpcbBytesReturned,
|
|
Packit Service |
b1ea74 |
LPWSAOVERLAPPED lpOverlapped,
|
|
Packit Service |
b1ea74 |
LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine);
|
|
Packit Service |
b1ea74 |
|
|
Packit Service |
b1ea74 |
WINPR_API SOCKET _accept(SOCKET s, struct sockaddr* addr, int* addrlen);
|
|
Packit Service |
b1ea74 |
WINPR_API int _bind(SOCKET s, const struct sockaddr* addr, int namelen);
|
|
Packit Service |
b1ea74 |
WINPR_API int closesocket(SOCKET s);
|
|
Packit Service |
b1ea74 |
WINPR_API int _connect(SOCKET s, const struct sockaddr* name, int namelen);
|
|
Packit Service |
b1ea74 |
WINPR_API int _ioctlsocket(SOCKET s, long cmd, u_long* argp);
|
|
Packit Service |
b1ea74 |
WINPR_API int _getpeername(SOCKET s, struct sockaddr* name, int* namelen);
|
|
Packit Service |
b1ea74 |
WINPR_API int _getsockname(SOCKET s, struct sockaddr* name, int* namelen);
|
|
Packit Service |
b1ea74 |
WINPR_API int _getsockopt(SOCKET s, int level, int optname, char* optval, int* optlen);
|
|
Packit Service |
b1ea74 |
WINPR_API u_long _htonl(u_long hostlong);
|
|
Packit Service |
b1ea74 |
WINPR_API u_short _htons(u_short hostshort);
|
|
Packit Service |
b1ea74 |
WINPR_API unsigned long _inet_addr(const char* cp);
|
|
Packit Service |
b1ea74 |
WINPR_API char* _inet_ntoa(struct in_addr in);
|
|
Packit Service |
b1ea74 |
WINPR_API int _listen(SOCKET s, int backlog);
|
|
Packit Service |
b1ea74 |
WINPR_API u_long _ntohl(u_long netlong);
|
|
Packit Service |
b1ea74 |
WINPR_API u_short _ntohs(u_short netshort);
|
|
Packit Service |
b1ea74 |
WINPR_API int _recv(SOCKET s, char* buf, int len, int flags);
|
|
Packit Service |
b1ea74 |
WINPR_API int _recvfrom(SOCKET s, char* buf, int len, int flags, struct sockaddr* from,
|
|
Packit Service |
b1ea74 |
int* fromlen);
|
|
Packit Service |
b1ea74 |
WINPR_API int _select(int nfds, fd_set* readfds, fd_set* writefds, fd_set* exceptfds,
|
|
Packit Service |
b1ea74 |
const struct timeval* timeout);
|
|
Packit Service |
b1ea74 |
WINPR_API int _send(SOCKET s, const char* buf, int len, int flags);
|
|
Packit Service |
b1ea74 |
WINPR_API int _sendto(SOCKET s, const char* buf, int len, int flags, const struct sockaddr* to,
|
|
Packit Service |
b1ea74 |
int tolen);
|
|
Packit Service |
b1ea74 |
WINPR_API int _setsockopt(SOCKET s, int level, int optname, const char* optval, int optlen);
|
|
Packit Service |
b1ea74 |
WINPR_API int _shutdown(SOCKET s, int how);
|
|
Packit Service |
b1ea74 |
WINPR_API SOCKET _socket(int af, int type, int protocol);
|
|
Packit Service |
b1ea74 |
WINPR_API struct hostent* _gethostbyaddr(const char* addr, int len, int type);
|
|
Packit Service |
b1ea74 |
WINPR_API struct hostent* _gethostbyname(const char* name);
|
|
Packit Service |
b1ea74 |
WINPR_API int _gethostname(char* name, int namelen);
|
|
Packit Service |
b1ea74 |
WINPR_API struct servent* _getservbyport(int port, const char* proto);
|
|
Packit Service |
b1ea74 |
WINPR_API struct servent* _getservbyname(const char* name, const char* proto);
|
|
Packit Service |
b1ea74 |
WINPR_API struct protoent* _getprotobynumber(int number);
|
|
Packit Service |
b1ea74 |
WINPR_API struct protoent* _getprotobyname(const char* name);
|
|
Packit Service |
fa4841 |
|
|
Packit Service |
fa4841 |
#ifdef __cplusplus
|
|
Packit Service |
fa4841 |
}
|
|
Packit Service |
fa4841 |
#endif
|
|
Packit Service |
fa4841 |
|
|
Packit Service |
fa4841 |
#ifdef UNICODE
|
|
Packit Service |
b1ea74 |
#define WSASocket WSASocketW
|
|
Packit Service |
fa4841 |
#else
|
|
Packit Service |
b1ea74 |
#define WSASocket WSASocketA
|
|
Packit Service |
fa4841 |
#endif
|
|
Packit Service |
fa4841 |
|
|
Packit Service |
fa4841 |
#endif /* _WIN32 */
|
|
Packit Service |
fa4841 |
|
|
Packit Service |
fa4841 |
#endif /* WINPR_WINSOCK_H */
|