FreeRDP
|
#include <winpr/platform.h>
#include <winpr/winpr.h>
#include <winpr/wtypes.h>
#include <winpr/windows.h>
#include <netdb.h>
#include <unistd.h>
#include <sys/un.h>
#include <sys/ioctl.h>
#include <sys/socket.h>
#include <arpa/inet.h>
#include <netinet/in.h>
#include <netinet/tcp.h>
#include <net/if.h>
#include <winpr/io.h>
#include <winpr/error.h>
Data Structures | |
struct | LPWSADATA |
struct | sockaddr_in6_old |
union | sockaddr_gen |
struct | INTERFACE_INFO |
struct | WSAPROTOCOLCHAIN |
struct | WSAPROTOCOL_INFOA |
struct | WSAPROTOCOL_INFOW |
Typedefs | |
typedef OVERLAPPED * | LPWSAOVERLAPPED |
typedef UINT_PTR | SOCKET |
typedef struct sockaddr_storage | SOCKADDR_STORAGE |
typedef struct in6_addr | IN6_ADDR |
typedef struct in6_addr * | PIN6_ADDR |
typedef struct in6_addr * | LPIN6_ADDR |
typedef INTERFACE_INFO * | LPINTERFACE_INFO |
typedef struct WSAPROTOCOLCHAIN * | LPWSAPROTOCOLCHAIN |
typedef struct WSAPROTOCOL_INFOA * | LPWSAPROTOCOL_INFOA |
typedef struct WSAPROTOCOL_INFOW * | LPWSAPROTOCOL_INFOW |
typedef void(CALLBACK * | LPWSAOVERLAPPED_COMPLETION_ROUTINE) (DWORD dwError, DWORD cbTransferred, LPWSAOVERLAPPED lpOverlapped, DWORD dwFlags) |
typedef UINT32 | GROUP |
Functions | |
WINPR_API int | WSAStartup (WORD wVersionRequired, LPWSADATA lpWSAData) |
WINPR_API int | WSACleanup (void) |
WINPR_API void | WSASetLastError (int iError) |
WINPR_API int | WSAGetLastError (void) |
WINPR_API BOOL | WSACloseEvent (HANDLE hEvent) |
WINPR_API HANDLE | WSACreateEvent (void) |
WINPR_API BOOL | WSASetEvent (HANDLE hEvent) |
WINPR_API BOOL | WSAResetEvent (HANDLE hEvent) |
WINPR_API int | WSAEventSelect (SOCKET s, WSAEVENT hEventObject, LONG lNetworkEvents) |
WINPR_API DWORD | WSAWaitForMultipleEvents (DWORD cEvents, const HANDLE *lphEvents, BOOL fWaitAll, DWORD dwTimeout, BOOL fAlertable) |
WINPR_API SOCKET | WSASocketA (int af, int type, int protocol, LPWSAPROTOCOL_INFOA lpProtocolInfo, GROUP g, DWORD dwFlags) |
WINPR_API SOCKET | WSASocketW (int af, int type, int protocol, LPWSAPROTOCOL_INFOW lpProtocolInfo, GROUP g, DWORD dwFlags) |
WINPR_API int | WSAIoctl (SOCKET s, DWORD dwIoControlCode, LPVOID lpvInBuffer, DWORD cbInBuffer, LPVOID lpvOutBuffer, DWORD cbOutBuffer, LPDWORD lpcbBytesReturned, LPWSAOVERLAPPED lpOverlapped, LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine) |
WINPR_API SOCKET | _accept (SOCKET s, struct sockaddr *addr, int *addrlen) |
WINPR_API int | _bind (SOCKET s, const struct sockaddr *addr, int namelen) |
WINPR_API int | closesocket (SOCKET s) |
WINPR_API int | _connect (SOCKET s, const struct sockaddr *name, int namelen) |
WINPR_API int | _ioctlsocket (SOCKET s, long cmd, u_long *argp) |
WINPR_API int | _getpeername (SOCKET s, struct sockaddr *name, int *namelen) |
WINPR_API int | _getsockname (SOCKET s, struct sockaddr *name, int *namelen) |
WINPR_API int | _getsockopt (SOCKET s, int level, int optname, char *optval, int *optlen) |
WINPR_API u_long | _htonl (u_long hostlong) |
WINPR_API u_short | _htons (u_short hostshort) |
WINPR_API unsigned long | _inet_addr (const char *cp) |
WINPR_API char * | _inet_ntoa (struct in_addr in) |
WINPR_API int | _listen (SOCKET s, int backlog) |
WINPR_API u_long | _ntohl (u_long netlong) |
WINPR_API u_short | _ntohs (u_short netshort) |
WINPR_API int | _recv (SOCKET s, char *buf, int len, int flags) |
WINPR_API int | _recvfrom (SOCKET s, char *buf, int len, int flags, struct sockaddr *from, int *fromlen) |
WINPR_API int | _select (int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, const struct timeval *timeout) |
WINPR_API int | _send (SOCKET s, const char *buf, int len, int flags) |
WINPR_API int | _sendto (SOCKET s, const char *buf, int len, int flags, const struct sockaddr *to, int tolen) |
WINPR_API int | _setsockopt (SOCKET s, int level, int optname, const char *optval, int optlen) |
WINPR_API int | _shutdown (SOCKET s, int how) |
WINPR_API SOCKET | _socket (int af, int type, int protocol) |
WINPR_API struct hostent * | _gethostbyaddr (const char *addr, int len, int type) |
WINPR_API struct hostent * | _gethostbyname (const char *name) |
WINPR_API int | _gethostname (char *name, int namelen) |
WINPR_API struct servent * | _getservbyport (int port, const char *proto) |
WINPR_API struct servent * | _getservbyname (const char *name, const char *proto) |
WINPR_API struct protoent * | _getprotobynumber (int number) |
WINPR_API struct protoent * | _getprotobyname (const char *name) |
#define _IFF_BROADCAST 0x00000002 |
#define _IFF_LOOPBACK 0x00000004 |
#define _IFF_MULTICAST 0x00000010 |
#define _IFF_POINTTOPOINT 0x00000008 |
#define _IFF_UP 0x00000001 |
#define FD_ACCEPT (1 << FD_ACCEPT_BIT) |
#define FD_ACCEPT_BIT 3 |
#define FD_ADDRESS_LIST_CHANGE (1 << FD_ADDRESS_LIST_CHANGE_BIT) |
#define FD_ADDRESS_LIST_CHANGE_BIT 9 |
#define FD_ALL_EVENTS ((1 << FD_MAX_EVENTS) - 1) |
#define FD_CLOSE (1 << FD_CLOSE_BIT) |
#define FD_CLOSE_BIT 5 |
#define FD_CONNECT (1 << FD_CONNECT_BIT) |
#define FD_CONNECT_BIT 4 |
#define FD_GROUP_QOS (1 << FD_GROUP_QOS_BIT) |
#define FD_GROUP_QOS_BIT 7 |
#define FD_MAX_EVENTS 10 |
#define FD_OOB (1 << FD_OOB_BIT) |
#define FD_OOB_BIT 2 |
#define FD_QOS (1 << FD_QOS_BIT) |
#define FD_QOS_BIT 6 |
#define FD_READ (1 << FD_READ_BIT) |
#define FD_READ_BIT 0 |
#define FD_ROUTING_INTERFACE_CHANGE (1 << FD_ROUTING_INTERFACE_CHANGE_BIT) |
#define FD_ROUTING_INTERFACE_CHANGE_BIT 8 |
#define FD_WRITE (1 << FD_WRITE_BIT) |
#define FD_WRITE_BIT 1 |
#define INVALID_SOCKET (SOCKET)(~0) |
#define LPWSAEVENT LPHANDLE |
#define LPWSAPROTOCOL_INFO LPWSAPROTOCOL_INFOA |
#define MAKEWORD | ( | a, | |
b | |||
) | ((WORD)(((BYTE)((DWORD_PTR)(a)&0xFF)) | (((WORD)((BYTE)((DWORD_PTR)(b)&0xFF))) << 8))) |
#define MAX_PROTOCOL_CHAIN 7 |
#define SD_BOTH 2 |
#define SD_RECEIVE 0 |
#define SD_SEND 1 |
#define SG_CONSTRAINED_GROUP 0x02 |
#define SG_UNCONSTRAINED_GROUP 0x01 |
#define SIO_GET_INTERFACE_LIST _IOR('t', 127, ULONG) |
#define SIO_GET_INTERFACE_LIST_EX _IOR('t', 126, ULONG) |
#define SIO_GET_MULTICAST_FILTER _IOW('t', 124 | IOC_IN, ULONG) |
#define SIO_SET_MULTICAST_FILTER _IOW('t', 125, ULONG) |
#define SIOCGIPMSFILTER SIO_GET_MULTICAST_FILTER |
#define SIOCSIPMSFILTER SIO_SET_MULTICAST_FILTER |
#define SOCKET_ERROR (-1) |
#define WSADESCRIPTION_LEN 256 |
#define WSAEVENT HANDLE |
WinPR: Windows Portable Runtime Windows Sockets (Winsock)
Copyright 2012 Marc-Andre Moreau marca ndre .more au@g mail. com
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
#define WSAOVERLAPPED OVERLAPPED |
#define WSAPROTOCOL_INFO WSAPROTOCOL_INFOA |
#define WSAPROTOCOL_LEN 255 |
#define WSASocket WSASocketA |
#define WSASYS_STATUS_LEN 128 |
typedef UINT32 GROUP |
typedef struct in6_addr IN6_ADDR |
typedef struct in6_addr* LPIN6_ADDR |
typedef INTERFACE_INFO* LPINTERFACE_INFO |
typedef OVERLAPPED* LPWSAOVERLAPPED |
typedef void(CALLBACK* LPWSAOVERLAPPED_COMPLETION_ROUTINE) (DWORD dwError, DWORD cbTransferred, LPWSAOVERLAPPED lpOverlapped, DWORD dwFlags) |
typedef struct WSAPROTOCOL_INFOA * LPWSAPROTOCOL_INFOA |
typedef struct WSAPROTOCOL_INFOW * LPWSAPROTOCOL_INFOW |
typedef struct WSAPROTOCOLCHAIN * LPWSAPROTOCOLCHAIN |
typedef struct in6_addr* PIN6_ADDR |
typedef struct sockaddr_storage SOCKADDR_STORAGE |
typedef UINT_PTR SOCKET |
WINPR_API struct hostent* _gethostbyaddr | ( | const char * | addr, |
int | len, | ||
int | type | ||
) |
WINPR_API struct hostent* _gethostbyname | ( | const char * | name | ) |
WINPR_API int _gethostname | ( | char * | name, |
int | namelen | ||
) |
WINPR_API struct protoent* _getprotobyname | ( | const char * | name | ) |
WINPR_API struct protoent* _getprotobynumber | ( | int | number | ) |
WINPR_API struct servent* _getservbyname | ( | const char * | name, |
const char * | proto | ||
) |
WINPR_API struct servent* _getservbyport | ( | int | port, |
const char * | proto | ||
) |
WINPR_API u_long _htonl | ( | u_long | hostlong | ) |
WINPR_API u_short _htons | ( | u_short | hostshort | ) |
WINPR_API unsigned long _inet_addr | ( | const char * | cp | ) |
WINPR_API char* _inet_ntoa | ( | struct in_addr | in | ) |
WINPR_API u_long _ntohl | ( | u_long | netlong | ) |
WINPR_API u_short _ntohs | ( | u_short | netshort | ) |
WINPR_API int _recvfrom | ( | SOCKET | s, |
char * | buf, | ||
int | len, | ||
int | flags, | ||
struct sockaddr * | from, | ||
int * | fromlen | ||
) |
WINPR_API int _select | ( | int | nfds, |
fd_set * | readfds, | ||
fd_set * | writefds, | ||
fd_set * | exceptfds, | ||
const struct timeval * | timeout | ||
) |
WINPR_API int _sendto | ( | SOCKET | s, |
const char * | buf, | ||
int | len, | ||
int | flags, | ||
const struct sockaddr * | to, | ||
int | tolen | ||
) |
WINPR_API int WSACleanup | ( | void | ) |
WINPR_API BOOL WSACloseEvent | ( | HANDLE | hEvent | ) |
WINPR_API HANDLE WSACreateEvent | ( | void | ) |
WINPR_API int WSAGetLastError | ( | void | ) |
Windows Sockets Extended Error Codes:
WSASYSNOTREADY WSAVERNOTSUPPORTED WSANOTINITIALISED WSAEDISCON WSAENOMORE WSAECANCELLED WSAEINVALIDPROCTABLE WSAEINVALIDPROVIDER WSAEPROVIDERFAILEDINIT WSASYSCALLFAILURE WSASERVICE_NOT_FOUND WSATYPE_NOT_FOUND WSA_E_NO_MORE WSA_E_CANCELLED WSAEREFUSED
WINPR_API int WSAIoctl | ( | SOCKET | s, |
DWORD | dwIoControlCode, | ||
LPVOID | lpvInBuffer, | ||
DWORD | cbInBuffer, | ||
LPVOID | lpvOutBuffer, | ||
DWORD | cbOutBuffer, | ||
LPDWORD | lpcbBytesReturned, | ||
LPWSAOVERLAPPED | lpOverlapped, | ||
LPWSAOVERLAPPED_COMPLETION_ROUTINE | lpCompletionRoutine | ||
) |
WINPR_API BOOL WSAResetEvent | ( | HANDLE | hEvent | ) |
WINPR_API BOOL WSASetEvent | ( | HANDLE | hEvent | ) |
WINPR_API void WSASetLastError | ( | int | iError | ) |
WINPR_API SOCKET WSASocketA | ( | int | af, |
int | type, | ||
int | protocol, | ||
LPWSAPROTOCOL_INFOA | lpProtocolInfo, | ||
GROUP | g, | ||
DWORD | dwFlags | ||
) |
WINPR_API SOCKET WSASocketW | ( | int | af, |
int | type, | ||
int | protocol, | ||
LPWSAPROTOCOL_INFOW | lpProtocolInfo, | ||
GROUP | g, | ||
DWORD | dwFlags | ||
) |
WINPR_API int WSAStartup | ( | WORD | wVersionRequired, |
LPWSADATA | lpWSAData | ||
) |
WINPR_API DWORD WSAWaitForMultipleEvents | ( | DWORD | cEvents, |
const HANDLE * | lphEvents, | ||
BOOL | fWaitAll, | ||
DWORD | dwTimeout, | ||
BOOL | fAlertable | ||
) |