CoCalc provides the best real-time collaborative environment for Jupyter Notebooks, LaTeX documents, and SageMath, scalable from individual users to large groups and classes!
CoCalc provides the best real-time collaborative environment for Jupyter Notebooks, LaTeX documents, and SageMath, scalable from individual users to large groups and classes!
Path: blob/master/data/headers/windows/Winsock2.h
Views: 1904
//1// License:2// https://github.com/rapid7/metasploit-framework/blob/master/LICENSE3//45#define IPPROTO_IP 06#define IPPROTO_ICMP 17#define IPPROTO_IGMP 28#define IPPROTO_GGP 39#define IPPROTO_TCP 610#define IPPROTO_PUP 1211#define IPPROTO_UDP 1712#define IPPROTO_IDP 2213#define IPPROTO_ND 7714#define IPPROTO_RAW 25515#define IPPROTO_MAX 25616#define IPPORT_ECHO 717#define IPPORT_DISCARD 918#define IPPORT_SYSTAT 1119#define IPPORT_DAYTIME 1320#define IPPORT_NETSTAT 1521#define IPPORT_FTP 2122#define IPPORT_TELNET 2323#define IPPORT_SMTP 2524#define IPPORT_TIMESERVER 3725#define IPPORT_NAMESERVER 4226#define IPPORT_WHOIS 4327#define IPPORT_MTP 5728#define IPPORT_TFTP 6929#define IPPORT_RJE 7730#define IPPORT_FINGER 7931#define IPPORT_TTYLINK 8732#define IPPORT_SUPDUP 9533#define IPPORT_EXECSERVER 51234#define IPPORT_LOGINSERVER 51335#define IPPORT_CMDSERVER 51436#define IPPORT_EFSSERVER 52037#define IPPORT_BIFFUDP 51238#define IPPORT_WHOSERVER 51339#define IPPORT_ROUTESERVER 52040#define IPPORT_RESERVED 102441#define IMPLINK_IP 15542#define IMPLINK_LOWEXPER 15643#define IMPLINK_HIGHEXPER 15844#define WSADESCRIPTION_LEN 25645#define WSASYS_STATUS_LEN 12846#define SD_RECEIVE 0x0047#define SD_SEND 0x0148#define SD_BOTH 0x0249#define FD_SETSIZE 6450#define WSA_INVALID_HANDLE 651#define WSA_NOT_ENOUGH_MEMORY 852#define WSA_INVALID_PARAMETER 8753#define WSA_OPERATION_ABORTED 99554#define WSA_IO_INCOMPLETE 99655#define WSA_IO_PENDING 99756#define WSAEINTR 1000457#define WSAEBADF 1000958#define WSAEACCES 1001359#define WSAEFAULT 1001460#define WSAEINVAL 1002261#define WSAEMFILE 1002462#define WSAEWOULDBLOCK 1003563#define WSAEINPROGRESS 1003664#define WSAEALREADY 1003765#define WSAENOTSOCK 1003866#define WSAEDESTADDRREQ 1003967#define WSAEMSGSIZE 1004068#define WSAEPROTOTYPE 1004169#define WSAENOPROTOOPT 1004270#define WSAEPROTONOSUPPORT 1004371#define WSAESOCKTNOSUPPORT 1004472#define WSAEOPNOTSUPP 1004573#define WSAEPFNOSUPPORT 1004674#define WSAEAFNOSUPPORT 1004775#define WSAEADDRINUSE 1004876#define WSAEADDRNOTAVAIL 1004977#define WSAENETDOWN 1005078#define WSAENETUNREACH 1005179#define WSAENETRESET 1005280#define WSAECONNABORTED 1005381#define WSAECONNRESET 1005482#define WSAENOBUFS 1005583#define WSAEISCONN 1005684#define WSAENOTCONN 1005785#define WSAESHUTDOWN 1005886#define WSAETOOMANYREFS 1005987#define WSAETIMEDOUT 1006088#define WSAECONNREFUSED 1006189#define WSAELOOP 1006290#define WSAENAMETOOLONG 1006391#define WSAEHOSTDOWN 1006492#define WSAEHOSTUNREACH 1006593#define WSAENOTEMPTY 1006694#define WSAEPROCLIM 1006795#define WSAEUSERS 1006896#define WSAEDQUOT 1006997#define WSAESTALE 1007098#define WSAEREMOTE 1007199#define WSASYSNOTREADY 10091100#define WSAVERNOTSUPPORTED 10092101#define WSANOTINITIALISED 10093102#define WSAEDISCON 10101103#define WSAENOMORE 10102104#define WSAECANCELLED 10103105#define WSAEINVALIDPROCTABLE 10104106#define WSAEINVALIDPROVIDER 10105107#define WSAEPROVIDERFAILEDINIT 10106108#define WSASYSCALLFAILURE 10107109#define WSASERVICE_NOT_FOUND 10108110#define WSATYPE_NOT_FOUND 10109111#define WSA_E_NO_MORE 10110112#define WSA_E_CANCELLED 10111113#define WSAEREFUSED 10112114#define WSAHOST_NOT_FOUND 11001115#define WSATRY_AGAIN 11002116#define WSANO_RECOVERY 11003117#define WSANO_DATA 11004118#define WSA_QOS_RECEIVERS 11005119#define WSA_QOS_SENDERS 11006120#define WSA_QOS_NO_SENDERS 11007121#define WSA_QOS_NO_RECEIVERS 11008122#define WSA_QOS_REQUEST_CONFIRMED 11009123#define WSA_QOS_ADMISSION_FAILURE 11010124#define WSA_QOS_POLICY_FAILURE 11011125#define WSA_QOS_BAD_STYLE 11012126#define WSA_QOS_BAD_OBJECT 11013127#define WSA_QOS_TRAFFIC_CTRL_ERROR 11014128#define WSA_QOS_GENERIC_ERROR 11015129#define WSA_QOS_ESERVICETYPE 11016130#define WSA_QOS_EFLOWSPEC 11017131#define WSA_QOS_EPROVSPECBUF 11018132#define WSA_QOS_EFILTERSTYLE 11019133#define WSA_QOS_EFILTERTYPE 11020134#define WSA_QOS_EFILTERCOUNT 11021135#define WSA_QOS_EOBJLENGTH 11022136#define WSA_QOS_EFLOWCOUNT 11023137#define WSA_QOS_EUNKOWNPSOBJ 11024138#define WSA_QOS_EPOLICYOBJ 11025139#define WSA_QOS_EFLOWDESC 11026140#define WSA_QOS_EPSFLOWSPEC 11027141#define WSA_QOS_EPSFILTERSPEC 11028142#define WSA_QOS_ESDMODEOBJ 11029143#define WSA_QOS_ESHAPERATEOBJ 11030144#define WSA_QOS_RESERVED_PETYPE 11031145#define AF_UNSPEC 0146#define AF_INET 2147#define AF_IPX 6148#define AF_APPLETALK 16149#define AF_NETBIOS 17150#define AF_INET6 23151#define AF_IRDA 26152#define AF_BTH 32153#define SOCK_STREAM 1154#define SOCK_DGRAM 2155#define SOCK_RAW 3156#define SOCK_RDM 4157#define SOCK_SEQPACKET 5158#define INVALID_SOCKET (SOCKET)(~0)159#define SOCKET_ERROR (-1)160#define AI_PASSIVE 0x00000001161#define AI_CANONNAME 0x00000002162#define AI_NUMERICHOST 0x00000004163#define AI_NUMERICSERV 0x00000008164#define AI_ALL 0x00000100165#define AI_ADDRCONFIG 0x00000400166#define AI_V4MAPPED 0x00000800167#define AI_NON_AUTHORITATIVE 0x00004000168#define AI_SECURE 0x00008000169#define AI_RETURN_PREFERRED_NAMES 0x00010000170#define AI_FQDN 0x00020000171#define AI_FILESERVER 0x00040000172#define MAX_PROTOCOL_CHAIN 7173#define WSAPROTOCOL_LEN 255174#define SOMAXCONN 0x7fffffff175176typedef unsigned char u_char;177typedef unsigned short u_short;178typedef unsigned int u_int;179typedef unsigned long u_long;180typedef u_int SOCKET;181typedef unsigned int GROUP;182typedef ULONG SERVICETYPE;183184struct sockaddr {185u_short sa_family;186char sa_data[14];187} SOCKADDR;188189typedef struct WSAData {190WORD wVersion;191WORD wHighVersion;192char szDescription[WSADESCRIPTION_LEN+1];193char szSystemStatus[WSASYS_STATUS_LEN+1];194unsigned short iMaxSockets;195unsigned short iMaxUdpDg;196char *lpVendorInfo;197} WSADATA, *LPWSADATA;198199typedef struct addrinfo {200int ai_flags;201int ai_family;202int ai_socktype;203int ai_protocol;204size_t ai_addrlen;205char *ai_canonname;206struct sockaddr *ai_addr;207struct addrinfo *ai_next;208} ADDRINFOA, *PADDRINFOA;209210typedef struct fd_set {211u_int fd_count;212SOCKET fd_array[FD_SETSIZE];213} fd_set;214215typedef struct in_addr {216union {217struct {218u_char s_b1,s_b2,s_b3,s_b4;219} S_un_b;220struct {221u_short s_w1,s_w2;222} S_un_w;223u_long S_addr;224} S_un;225} IN_ADDR, *PIN_ADDR, *LPIN_ADDR;226227struct sockaddr_in {228short sin_family;229u_short sin_port;230struct in_addr sin_addr;231char sin_zero[8];232};233234struct sockproto {235u_short sp_family;236u_short sp_protocol;237};238239typedef struct hostent {240char *h_name;241char **h_aliases;242short h_addrtype;243short h_length;244char **h_addr_list;245} HOSTENT, *PHOSTENT, *LPHOSTENT;246247typedef struct _WSAPROTOCOLCHAIN {248int ChainLen;249DWORD ChainEntries[MAX_PROTOCOL_CHAIN];250} WSAPROTOCOLCHAIN, *LPWSAPROTOCOLCHAIN;251252typedef struct _WSAPROTOCOL_INFO {253DWORD dwServiceFlags1;254DWORD dwServiceFlags2;255DWORD dwServiceFlags3;256DWORD dwServiceFlags4;257DWORD dwProviderFlags;258GUID ProviderId;259DWORD dwCatalogEntryId;260WSAPROTOCOLCHAIN ProtocolChain;261int iVersion;262int iAddressFamily;263int iMaxSockAddr;264int iMinSockAddr;265int iSocketType;266int iProtocol;267int iProtocolMaxOffset;268int iNetworkByteOrder;269int iSecurityScheme;270DWORD dwMessageSize;271DWORD dwProviderReserved;272TCHAR szProtocol[WSAPROTOCOL_LEN+1];273} WSAPROTOCOL_INFO, *LPWSAPROTOCOL_INFO;274275typedef struct _WSABUF276{277ULONG len;278CHAR* buf;279} WSABUF, *LPWSABUF;280281typedef struct _FLOWSPEC {282unsigned int TokenRate;283unsigned int TokenBucketSize;284unsigned int PeakBandwidth;285unsigned int Latency;286unsigned int DelayVariation;287SERVICETYPE ServiceType;288unsigned int MaxSduSize;289unsigned int MinimumPolicedSize;290} FLOWSPEC, *PFLOWSPEC, *LPFLOWSPEC;291292typedef struct _QUALITYOFSERVICE {293FLOWSPEC SendingFlowspec;294FLOWSPEC ReceivingFlowspec;295WSABUF ProviderSpecific;296} QOS, *LPQOS;297298typedef int (CALLBACK *LPCONDITIONPROC)(LPWSABUF, LPWSABUF, LPQOS, LPQOS, LPWSABUF, LPWSABUF, GROUP *, DWORD);299typedef struct sockaddr_in SOCKADDR_IN;300typedef struct sockaddr_in *PSOCKADDR_IN;301typedef struct sockaddr_in *LPSOCKADDR_IN;302303WINAPI int WSAStartup __attribute__((dllimport))(WORD, LPWSADATA);304WINAPI int WSACleanup __attribute__((dllimport))();305WINAPI int getaddrinfo __attribute__((dllimport))(PCSTR, PCSTR, const ADDRINFOA*, PADDRINFOA*);306WINAPI SOCKET socket __attribute__((dllimport))(int, int, int);307WINAPI void freeaddrinfo __attribute__((dllimport))(struct addrinfo*);308WINAPI int closesocket __attribute__((dllimport))(SOCKET);309WINAPI int bind __attribute__((dllimport))(SOCKET, const struct sockaddr*, int);310WINAPI SOCKET accept __attribute__((dllimport))(SOCKET, struct sockaddr*, int*);311WINAPI BOOL AcceptEx __attribute__((dllimport))(SOCKET, SOCKET, PVOID, DWORD, DWORD, DWORD, LPDWORD, LPOVERLAPPED);312WINAPI int connect __attribute__((dllimport))(SOCKET, const struct sockaddr*, int);313WINAPI int gethostname __attribute__((dllimport))(char*, int);314WINAPI int listen __attribute__((dllimport))(SOCKET, int);315WINAPI int recv __attribute__((dllimport))(SOCKET, char*, int, int);316WINAPI int recvfrom __attribute__((dllimport))(SOCKET, char*, int, int, struct sockaddr*, int*);317WINAPI int send __attribute__((dllimport))(SOCKET, char*, int, int);318WINAPI int sendto __attribute__((dllimport))(SOCKET, char*, int, int, const struct sockaddr*, int);319WINAPI int select __attribute__((dllimport))(int, fd_set*, fd_set*, fd_set*, const struct timeval*);320WINAPI int setsockopt __attribute__((dllimport))(SOCKET, int, int, const char*, int);321WINAPI char* inet_ntoa __attribute__((dllimport))(struct in_addr);322WINAPI unsigned long inet_addr __attribute__((dllimport))(const char*);323WINAPI int shutdown __attribute__((dllimport))(SOCKET, int);324WINAPI u_short htons __attribute__((dllimport))(u_short);325WINAPI u_long htonl __attribute__((dllimport))(u_long);326WINAPI struct hostent* gethostbyname __attribute__((dllimport))(const char*);327WINAPI struct hostent* gethostbyaddr __attribute__((dllimport))(const char*, int, int);328WINAPI int WSAGetLastError __attribute__((dllimport))();329WINAPI SOCKET WSASocket __attribute__((dllimport))(int, int, int, LPWSAPROTOCOL_INFO, GROUP, DWORD);330WINAPI SOCKET WSAAccept __attribute__((dllimport))(SOCKET, struct sockaddr*, LPINT, LPCONDITIONPROC, DWORD_PTR);331332333