From 3d946ef5eb15d2333a5e376ab95dad2e70e0dfb9 Mon Sep 17 00:00:00 2001 From: lithdew Date: Sun, 9 May 2021 14:44:02 +0900 Subject: [PATCH] x/os, x/net, os:, fix typos/errors, add missing constants/docs Add missing constants to ws2_32 such as SIO_BASE_HANDLE. Made all declared constants in ws2_32 comptime_int, and fixed a few broken constants (i.e. GUID's). Fixed a few syscalls not having callconv(WINAPI) in ws2_32. Fixed a typo in std.x.net.tcp.Client. Removed unnecessary @alignCast's for socket addresses in std.x.net.Socket. Added a warning on using timeout methods for std.x.net.Socket. Fixed compilation error spotted by CI in std.os that references std.os.windows.ws2_32.SD_RECEIVE. Renamed std.x.os.Socket.setOption()'s parameter `name: u32` to `code: u32`. --- lib/std/os.zig | 6 +- lib/std/os/windows/ws2_32.zig | 1654 ++++++++++++++++--------------- lib/std/x/net/tcp.zig | 2 +- lib/std/x/os/socket_posix.zig | 16 +- lib/std/x/os/socket_windows.zig | 18 +- 5 files changed, 856 insertions(+), 840 deletions(-) diff --git a/lib/std/os.zig b/lib/std/os.zig index 8362c07234..ebd481e0c8 100644 --- a/lib/std/os.zig +++ b/lib/std/os.zig @@ -2758,9 +2758,9 @@ pub const ShutdownHow = enum { recv, send, both }; pub fn shutdown(sock: socket_t, how: ShutdownHow) ShutdownError!void { if (builtin.os.tag == .windows) { const result = windows.ws2_32.shutdown(sock, switch (how) { - .recv => windows.SD_RECEIVE, - .send => windows.SD_SEND, - .both => windows.SD_BOTH, + .recv => windows.ws2_32.SD_RECEIVE, + .send => windows.ws2_32.SD_SEND, + .both => windows.ws2_32.SD_BOTH, }); if (0 != result) switch (windows.ws2_32.WSAGetLastError()) { .WSAECONNABORTED => return error.ConnectionAborted, diff --git a/lib/std/os/windows/ws2_32.zig b/lib/std/os/windows/ws2_32.zig index bab2f65c1c..a76baa0acc 100644 --- a/lib/std/os/windows/ws2_32.zig +++ b/lib/std/os/windows/ws2_32.zig @@ -15,826 +15,830 @@ pub const WSAEVENT = HANDLE; // Microsoft use the signed c_int for this, but it should never be negative pub const socklen_t = u32; -pub const LM_HB_Extension = @as(i32, 128); -pub const LM_HB1_PnP = @as(i32, 1); -pub const LM_HB1_PDA_Palmtop = @as(i32, 2); -pub const LM_HB1_Computer = @as(i32, 4); -pub const LM_HB1_Printer = @as(i32, 8); -pub const LM_HB1_Modem = @as(i32, 16); -pub const LM_HB1_Fax = @as(i32, 32); -pub const LM_HB1_LANAccess = @as(i32, 64); -pub const LM_HB2_Telephony = @as(i32, 1); -pub const LM_HB2_FileServer = @as(i32, 2); -pub const ATMPROTO_AALUSER = @as(u32, 0); -pub const ATMPROTO_AAL1 = @as(u32, 1); -pub const ATMPROTO_AAL2 = @as(u32, 2); -pub const ATMPROTO_AAL34 = @as(u32, 3); -pub const ATMPROTO_AAL5 = @as(u32, 5); -pub const SAP_FIELD_ABSENT = @as(u32, 4294967294); -pub const SAP_FIELD_ANY = @as(u32, 4294967295); -pub const SAP_FIELD_ANY_AESA_SEL = @as(u32, 4294967290); -pub const SAP_FIELD_ANY_AESA_REST = @as(u32, 4294967291); -pub const ATM_E164 = @as(u32, 1); -pub const ATM_NSAP = @as(u32, 2); -pub const ATM_AESA = @as(u32, 2); -pub const ATM_ADDR_SIZE = @as(u32, 20); -pub const BLLI_L2_ISO_1745 = @as(u32, 1); -pub const BLLI_L2_Q921 = @as(u32, 2); -pub const BLLI_L2_X25L = @as(u32, 6); -pub const BLLI_L2_X25M = @as(u32, 7); -pub const BLLI_L2_ELAPB = @as(u32, 8); -pub const BLLI_L2_HDLC_ARM = @as(u32, 9); -pub const BLLI_L2_HDLC_NRM = @as(u32, 10); -pub const BLLI_L2_HDLC_ABM = @as(u32, 11); -pub const BLLI_L2_LLC = @as(u32, 12); -pub const BLLI_L2_X75 = @as(u32, 13); -pub const BLLI_L2_Q922 = @as(u32, 14); -pub const BLLI_L2_USER_SPECIFIED = @as(u32, 16); -pub const BLLI_L2_ISO_7776 = @as(u32, 17); -pub const BLLI_L3_X25 = @as(u32, 6); -pub const BLLI_L3_ISO_8208 = @as(u32, 7); -pub const BLLI_L3_X223 = @as(u32, 8); -pub const BLLI_L3_SIO_8473 = @as(u32, 9); -pub const BLLI_L3_T70 = @as(u32, 10); -pub const BLLI_L3_ISO_TR9577 = @as(u32, 11); -pub const BLLI_L3_USER_SPECIFIED = @as(u32, 16); -pub const BLLI_L3_IPI_SNAP = @as(u32, 128); -pub const BLLI_L3_IPI_IP = @as(u32, 204); -pub const BHLI_ISO = @as(u32, 0); -pub const BHLI_UserSpecific = @as(u32, 1); -pub const BHLI_HighLayerProfile = @as(u32, 2); -pub const BHLI_VendorSpecificAppId = @as(u32, 3); -pub const AAL5_MODE_MESSAGE = @as(u32, 1); -pub const AAL5_MODE_STREAMING = @as(u32, 2); -pub const AAL5_SSCS_NULL = @as(u32, 0); -pub const AAL5_SSCS_SSCOP_ASSURED = @as(u32, 1); -pub const AAL5_SSCS_SSCOP_NON_ASSURED = @as(u32, 2); -pub const AAL5_SSCS_FRAME_RELAY = @as(u32, 4); -pub const BCOB_A = @as(u32, 1); -pub const BCOB_C = @as(u32, 3); -pub const BCOB_X = @as(u32, 16); -pub const TT_NOIND = @as(u32, 0); -pub const TT_CBR = @as(u32, 4); -pub const TT_VBR = @as(u32, 8); -pub const TR_NOIND = @as(u32, 0); -pub const TR_END_TO_END = @as(u32, 1); -pub const TR_NO_END_TO_END = @as(u32, 2); -pub const CLIP_NOT = @as(u32, 0); -pub const CLIP_SUS = @as(u32, 32); -pub const UP_P2P = @as(u32, 0); -pub const UP_P2MP = @as(u32, 1); -pub const BLLI_L2_MODE_NORMAL = @as(u32, 64); -pub const BLLI_L2_MODE_EXT = @as(u32, 128); -pub const BLLI_L3_MODE_NORMAL = @as(u32, 64); -pub const BLLI_L3_MODE_EXT = @as(u32, 128); -pub const BLLI_L3_PACKET_16 = @as(u32, 4); -pub const BLLI_L3_PACKET_32 = @as(u32, 5); -pub const BLLI_L3_PACKET_64 = @as(u32, 6); -pub const BLLI_L3_PACKET_128 = @as(u32, 7); -pub const BLLI_L3_PACKET_256 = @as(u32, 8); -pub const BLLI_L3_PACKET_512 = @as(u32, 9); -pub const BLLI_L3_PACKET_1024 = @as(u32, 10); -pub const BLLI_L3_PACKET_2048 = @as(u32, 11); -pub const BLLI_L3_PACKET_4096 = @as(u32, 12); -pub const PI_ALLOWED = @as(u32, 0); -pub const PI_RESTRICTED = @as(u32, 64); -pub const PI_NUMBER_NOT_AVAILABLE = @as(u32, 128); -pub const SI_USER_NOT_SCREENED = @as(u32, 0); -pub const SI_USER_PASSED = @as(u32, 1); -pub const SI_USER_FAILED = @as(u32, 2); -pub const SI_NETWORK = @as(u32, 3); -pub const CAUSE_LOC_USER = @as(u32, 0); -pub const CAUSE_LOC_PRIVATE_LOCAL = @as(u32, 1); -pub const CAUSE_LOC_PUBLIC_LOCAL = @as(u32, 2); -pub const CAUSE_LOC_TRANSIT_NETWORK = @as(u32, 3); -pub const CAUSE_LOC_PUBLIC_REMOTE = @as(u32, 4); -pub const CAUSE_LOC_PRIVATE_REMOTE = @as(u32, 5); -pub const CAUSE_LOC_INTERNATIONAL_NETWORK = @as(u32, 7); -pub const CAUSE_LOC_BEYOND_INTERWORKING = @as(u32, 10); -pub const CAUSE_UNALLOCATED_NUMBER = @as(u32, 1); -pub const CAUSE_NO_ROUTE_TO_TRANSIT_NETWORK = @as(u32, 2); -pub const CAUSE_NO_ROUTE_TO_DESTINATION = @as(u32, 3); -pub const CAUSE_VPI_VCI_UNACCEPTABLE = @as(u32, 10); -pub const CAUSE_NORMAL_CALL_CLEARING = @as(u32, 16); -pub const CAUSE_USER_BUSY = @as(u32, 17); -pub const CAUSE_NO_USER_RESPONDING = @as(u32, 18); -pub const CAUSE_CALL_REJECTED = @as(u32, 21); -pub const CAUSE_NUMBER_CHANGED = @as(u32, 22); -pub const CAUSE_USER_REJECTS_CLIR = @as(u32, 23); -pub const CAUSE_DESTINATION_OUT_OF_ORDER = @as(u32, 27); -pub const CAUSE_INVALID_NUMBER_FORMAT = @as(u32, 28); -pub const CAUSE_STATUS_ENQUIRY_RESPONSE = @as(u32, 30); -pub const CAUSE_NORMAL_UNSPECIFIED = @as(u32, 31); -pub const CAUSE_VPI_VCI_UNAVAILABLE = @as(u32, 35); -pub const CAUSE_NETWORK_OUT_OF_ORDER = @as(u32, 38); -pub const CAUSE_TEMPORARY_FAILURE = @as(u32, 41); -pub const CAUSE_ACCESS_INFORMAION_DISCARDED = @as(u32, 43); -pub const CAUSE_NO_VPI_VCI_AVAILABLE = @as(u32, 45); -pub const CAUSE_RESOURCE_UNAVAILABLE = @as(u32, 47); -pub const CAUSE_QOS_UNAVAILABLE = @as(u32, 49); -pub const CAUSE_USER_CELL_RATE_UNAVAILABLE = @as(u32, 51); -pub const CAUSE_BEARER_CAPABILITY_UNAUTHORIZED = @as(u32, 57); -pub const CAUSE_BEARER_CAPABILITY_UNAVAILABLE = @as(u32, 58); -pub const CAUSE_OPTION_UNAVAILABLE = @as(u32, 63); -pub const CAUSE_BEARER_CAPABILITY_UNIMPLEMENTED = @as(u32, 65); -pub const CAUSE_UNSUPPORTED_TRAFFIC_PARAMETERS = @as(u32, 73); -pub const CAUSE_INVALID_CALL_REFERENCE = @as(u32, 81); -pub const CAUSE_CHANNEL_NONEXISTENT = @as(u32, 82); -pub const CAUSE_INCOMPATIBLE_DESTINATION = @as(u32, 88); -pub const CAUSE_INVALID_ENDPOINT_REFERENCE = @as(u32, 89); -pub const CAUSE_INVALID_TRANSIT_NETWORK_SELECTION = @as(u32, 91); -pub const CAUSE_TOO_MANY_PENDING_ADD_PARTY = @as(u32, 92); -pub const CAUSE_AAL_PARAMETERS_UNSUPPORTED = @as(u32, 93); -pub const CAUSE_MANDATORY_IE_MISSING = @as(u32, 96); -pub const CAUSE_UNIMPLEMENTED_MESSAGE_TYPE = @as(u32, 97); -pub const CAUSE_UNIMPLEMENTED_IE = @as(u32, 99); -pub const CAUSE_INVALID_IE_CONTENTS = @as(u32, 100); -pub const CAUSE_INVALID_STATE_FOR_MESSAGE = @as(u32, 101); -pub const CAUSE_RECOVERY_ON_TIMEOUT = @as(u32, 102); -pub const CAUSE_INCORRECT_MESSAGE_LENGTH = @as(u32, 104); -pub const CAUSE_PROTOCOL_ERROR = @as(u32, 111); -pub const CAUSE_COND_UNKNOWN = @as(u32, 0); -pub const CAUSE_COND_PERMANENT = @as(u32, 1); -pub const CAUSE_COND_TRANSIENT = @as(u32, 2); -pub const CAUSE_REASON_USER = @as(u32, 0); -pub const CAUSE_REASON_IE_MISSING = @as(u32, 4); -pub const CAUSE_REASON_IE_INSUFFICIENT = @as(u32, 8); -pub const CAUSE_PU_PROVIDER = @as(u32, 0); -pub const CAUSE_PU_USER = @as(u32, 8); -pub const CAUSE_NA_NORMAL = @as(u32, 0); -pub const CAUSE_NA_ABNORMAL = @as(u32, 4); -pub const QOS_CLASS0 = @as(u32, 0); -pub const QOS_CLASS1 = @as(u32, 1); -pub const QOS_CLASS2 = @as(u32, 2); -pub const QOS_CLASS3 = @as(u32, 3); -pub const QOS_CLASS4 = @as(u32, 4); -pub const TNS_TYPE_NATIONAL = @as(u32, 64); -pub const TNS_PLAN_CARRIER_ID_CODE = @as(u32, 1); -pub const SIO_GET_NUMBER_OF_ATM_DEVICES = @as(u32, 1343619073); -pub const SIO_GET_ATM_ADDRESS = @as(u32, 3491102722); -pub const SIO_ASSOCIATE_PVC = @as(u32, 2417360899); -pub const SIO_GET_ATM_CONNECTION_ID = @as(u32, 1343619076); -pub const RIO_MSG_DONT_NOTIFY = @as(u32, 1); -pub const RIO_MSG_DEFER = @as(u32, 2); -pub const RIO_MSG_WAITALL = @as(u32, 4); -pub const RIO_MSG_COMMIT_ONLY = @as(u32, 8); -pub const RIO_MAX_CQ_SIZE = @as(u32, 134217728); -pub const RIO_CORRUPT_CQ = @as(u32, 4294967295); -pub const WINDOWS_AF_IRDA = @as(u32, 26); -pub const WCE_AF_IRDA = @as(u32, 22); -pub const IRDA_PROTO_SOCK_STREAM = @as(u32, 1); -pub const SOL_IRLMP = @as(u32, 255); -pub const IRLMP_ENUMDEVICES = @as(u32, 16); -pub const IRLMP_IAS_SET = @as(u32, 17); -pub const IRLMP_IAS_QUERY = @as(u32, 18); -pub const IRLMP_SEND_PDU_LEN = @as(u32, 19); -pub const IRLMP_EXCLUSIVE_MODE = @as(u32, 20); -pub const IRLMP_IRLPT_MODE = @as(u32, 21); -pub const IRLMP_9WIRE_MODE = @as(u32, 22); -pub const IRLMP_TINYTP_MODE = @as(u32, 23); -pub const IRLMP_PARAMETERS = @as(u32, 24); -pub const IRLMP_DISCOVERY_MODE = @as(u32, 25); -pub const IRLMP_SHARP_MODE = @as(u32, 32); -pub const IAS_ATTRIB_NO_CLASS = @as(u32, 16); -pub const IAS_ATTRIB_NO_ATTRIB = @as(u32, 0); -pub const IAS_ATTRIB_INT = @as(u32, 1); -pub const IAS_ATTRIB_OCTETSEQ = @as(u32, 2); -pub const IAS_ATTRIB_STR = @as(u32, 3); -pub const IAS_MAX_USER_STRING = @as(u32, 256); -pub const IAS_MAX_OCTET_STRING = @as(u32, 1024); -pub const IAS_MAX_CLASSNAME = @as(u32, 64); -pub const IAS_MAX_ATTRIBNAME = @as(u32, 256); -pub const LmCharSetASCII = @as(u32, 0); -pub const LmCharSetISO_8859_1 = @as(u32, 1); -pub const LmCharSetISO_8859_2 = @as(u32, 2); -pub const LmCharSetISO_8859_3 = @as(u32, 3); -pub const LmCharSetISO_8859_4 = @as(u32, 4); -pub const LmCharSetISO_8859_5 = @as(u32, 5); -pub const LmCharSetISO_8859_6 = @as(u32, 6); -pub const LmCharSetISO_8859_7 = @as(u32, 7); -pub const LmCharSetISO_8859_8 = @as(u32, 8); -pub const LmCharSetISO_8859_9 = @as(u32, 9); -pub const LmCharSetUNICODE = @as(u32, 255); -pub const LM_BAUD_1200 = @as(u32, 1200); -pub const LM_BAUD_2400 = @as(u32, 2400); -pub const LM_BAUD_9600 = @as(u32, 9600); -pub const LM_BAUD_19200 = @as(u32, 19200); -pub const LM_BAUD_38400 = @as(u32, 38400); -pub const LM_BAUD_57600 = @as(u32, 57600); -pub const LM_BAUD_115200 = @as(u32, 115200); -pub const LM_BAUD_576K = @as(u32, 576000); -pub const LM_BAUD_1152K = @as(u32, 1152000); -pub const LM_BAUD_4M = @as(u32, 4000000); -pub const LM_BAUD_16M = @as(u32, 16000000); -pub const IPX_PTYPE = @as(u32, 16384); -pub const IPX_FILTERPTYPE = @as(u32, 16385); -pub const IPX_STOPFILTERPTYPE = @as(u32, 16387); -pub const IPX_DSTYPE = @as(u32, 16386); -pub const IPX_EXTENDED_ADDRESS = @as(u32, 16388); -pub const IPX_RECVHDR = @as(u32, 16389); -pub const IPX_MAXSIZE = @as(u32, 16390); -pub const IPX_ADDRESS = @as(u32, 16391); -pub const IPX_GETNETINFO = @as(u32, 16392); -pub const IPX_GETNETINFO_NORIP = @as(u32, 16393); -pub const IPX_SPXGETCONNECTIONSTATUS = @as(u32, 16395); -pub const IPX_ADDRESS_NOTIFY = @as(u32, 16396); -pub const IPX_MAX_ADAPTER_NUM = @as(u32, 16397); -pub const IPX_RERIPNETNUMBER = @as(u32, 16398); -pub const IPX_RECEIVE_BROADCAST = @as(u32, 16399); -pub const IPX_IMMEDIATESPXACK = @as(u32, 16400); -pub const IPPROTO_RM = @as(u32, 113); -pub const MAX_MCAST_TTL = @as(u32, 255); -pub const RM_OPTIONSBASE = @as(u32, 1000); -pub const RM_RATE_WINDOW_SIZE = @as(u32, 1001); -pub const RM_SET_MESSAGE_BOUNDARY = @as(u32, 1002); -pub const RM_FLUSHCACHE = @as(u32, 1003); -pub const RM_SENDER_WINDOW_ADVANCE_METHOD = @as(u32, 1004); -pub const RM_SENDER_STATISTICS = @as(u32, 1005); -pub const RM_LATEJOIN = @as(u32, 1006); -pub const RM_SET_SEND_IF = @as(u32, 1007); -pub const RM_ADD_RECEIVE_IF = @as(u32, 1008); -pub const RM_DEL_RECEIVE_IF = @as(u32, 1009); -pub const RM_SEND_WINDOW_ADV_RATE = @as(u32, 1010); -pub const RM_USE_FEC = @as(u32, 1011); -pub const RM_SET_MCAST_TTL = @as(u32, 1012); -pub const RM_RECEIVER_STATISTICS = @as(u32, 1013); -pub const RM_HIGH_SPEED_INTRANET_OPT = @as(u32, 1014); -pub const SENDER_DEFAULT_RATE_KBITS_PER_SEC = @as(u32, 56); -pub const SENDER_DEFAULT_WINDOW_ADV_PERCENTAGE = @as(u32, 15); -pub const MAX_WINDOW_INCREMENT_PERCENTAGE = @as(u32, 25); -pub const SENDER_DEFAULT_LATE_JOINER_PERCENTAGE = @as(u32, 0); -pub const SENDER_MAX_LATE_JOINER_PERCENTAGE = @as(u32, 75); -pub const BITS_PER_BYTE = @as(u32, 8); -pub const LOG2_BITS_PER_BYTE = @as(u32, 3); -pub const SOCKET_DEFAULT2_QM_POLICY = Guid.initString("aec2ef9c-3a4d-4d3e-8842-239942e39a47"); -pub const REAL_TIME_NOTIFICATION_CAPABILITY = Guid.initString("6b59819a-5cae-492d-a901-2a3c2c50164f"); -pub const REAL_TIME_NOTIFICATION_CAPABILITY_EX = Guid.initString("6843da03-154a-4616-a508-44371295f96b"); -pub const ASSOCIATE_NAMERES_CONTEXT = Guid.initString("59a38b67-d4fe-46e1-ba3c-87ea74ca3049"); -pub const TCP_INITIAL_RTO_DEFAULT_RTT = @as(u32, 0); -pub const TCP_INITIAL_RTO_DEFAULT_MAX_SYN_RETRANSMISSIONS = @as(u32, 0); -pub const SOCKET_SETTINGS_GUARANTEE_ENCRYPTION = @as(u32, 1); -pub const SOCKET_SETTINGS_ALLOW_INSECURE = @as(u32, 2); -pub const SOCKET_SETTINGS_IPSEC_SKIP_FILTER_INSTANTIATION = @as(u32, 1); -pub const SOCKET_SETTINGS_IPSEC_OPTIONAL_PEER_NAME_VERIFICATION = @as(u32, 2); -pub const SOCKET_SETTINGS_IPSEC_ALLOW_FIRST_INBOUND_PKT_UNENCRYPTED = @as(u32, 4); -pub const SOCKET_SETTINGS_IPSEC_PEER_NAME_IS_RAW_FORMAT = @as(u32, 8); -pub const SOCKET_QUERY_IPSEC2_ABORT_CONNECTION_ON_FIELD_CHANGE = @as(u32, 1); -pub const SOCKET_QUERY_IPSEC2_FIELD_MASK_MM_SA_ID = @as(u32, 1); -pub const SOCKET_QUERY_IPSEC2_FIELD_MASK_QM_SA_ID = @as(u32, 2); -pub const SOCKET_INFO_CONNECTION_SECURED = @as(u32, 1); -pub const SOCKET_INFO_CONNECTION_ENCRYPTED = @as(u32, 2); -pub const SOCKET_INFO_CONNECTION_IMPERSONATED = @as(u32, 4); -pub const IN4ADDR_LOOPBACK = @as(u32, 16777343); -pub const IN4ADDR_LOOPBACKPREFIX_LENGTH = @as(u32, 8); -pub const IN4ADDR_LINKLOCALPREFIX_LENGTH = @as(u32, 16); -pub const IN4ADDR_MULTICASTPREFIX_LENGTH = @as(u32, 4); -pub const IFF_UP = @as(u32, 1); -pub const IFF_BROADCAST = @as(u32, 2); -pub const IFF_LOOPBACK = @as(u32, 4); -pub const IFF_POINTTOPOINT = @as(u32, 8); -pub const IFF_MULTICAST = @as(u32, 16); -pub const IP_OPTIONS = @as(u32, 1); -pub const IP_HDRINCL = @as(u32, 2); -pub const IP_TOS = @as(u32, 3); -pub const IP_TTL = @as(u32, 4); -pub const IP_MULTICAST_IF = @as(u32, 9); -pub const IP_MULTICAST_TTL = @as(u32, 10); -pub const IP_MULTICAST_LOOP = @as(u32, 11); -pub const IP_ADD_MEMBERSHIP = @as(u32, 12); -pub const IP_DROP_MEMBERSHIP = @as(u32, 13); -pub const IP_DONTFRAGMENT = @as(u32, 14); -pub const IP_ADD_SOURCE_MEMBERSHIP = @as(u32, 15); -pub const IP_DROP_SOURCE_MEMBERSHIP = @as(u32, 16); -pub const IP_BLOCK_SOURCE = @as(u32, 17); -pub const IP_UNBLOCK_SOURCE = @as(u32, 18); -pub const IP_PKTINFO = @as(u32, 19); -pub const IP_HOPLIMIT = @as(u32, 21); -pub const IP_RECVTTL = @as(u32, 21); -pub const IP_RECEIVE_BROADCAST = @as(u32, 22); -pub const IP_RECVIF = @as(u32, 24); -pub const IP_RECVDSTADDR = @as(u32, 25); -pub const IP_IFLIST = @as(u32, 28); -pub const IP_ADD_IFLIST = @as(u32, 29); -pub const IP_DEL_IFLIST = @as(u32, 30); -pub const IP_UNICAST_IF = @as(u32, 31); -pub const IP_RTHDR = @as(u32, 32); -pub const IP_GET_IFLIST = @as(u32, 33); -pub const IP_RECVRTHDR = @as(u32, 38); -pub const IP_TCLASS = @as(u32, 39); -pub const IP_RECVTCLASS = @as(u32, 40); -pub const IP_RECVTOS = @as(u32, 40); -pub const IP_ORIGINAL_ARRIVAL_IF = @as(u32, 47); -pub const IP_ECN = @as(u32, 50); -pub const IP_PKTINFO_EX = @as(u32, 51); -pub const IP_WFP_REDIRECT_RECORDS = @as(u32, 60); -pub const IP_WFP_REDIRECT_CONTEXT = @as(u32, 70); -pub const IP_MTU_DISCOVER = @as(u32, 71); -pub const IP_MTU = @as(u32, 73); -pub const IP_NRT_INTERFACE = @as(u32, 74); -pub const IP_RECVERR = @as(u32, 75); -pub const IP_USER_MTU = @as(u32, 76); -pub const IP_UNSPECIFIED_TYPE_OF_SERVICE = @as(i32, -1); -pub const IN6ADDR_LINKLOCALPREFIX_LENGTH = @as(u32, 64); -pub const IN6ADDR_MULTICASTPREFIX_LENGTH = @as(u32, 8); -pub const IN6ADDR_SOLICITEDNODEMULTICASTPREFIX_LENGTH = @as(u32, 104); -pub const IN6ADDR_V4MAPPEDPREFIX_LENGTH = @as(u32, 96); -pub const IN6ADDR_6TO4PREFIX_LENGTH = @as(u32, 16); -pub const IN6ADDR_TEREDOPREFIX_LENGTH = @as(u32, 32); -pub const MCAST_JOIN_GROUP = @as(u32, 41); -pub const MCAST_LEAVE_GROUP = @as(u32, 42); -pub const MCAST_BLOCK_SOURCE = @as(u32, 43); -pub const MCAST_UNBLOCK_SOURCE = @as(u32, 44); -pub const MCAST_JOIN_SOURCE_GROUP = @as(u32, 45); -pub const MCAST_LEAVE_SOURCE_GROUP = @as(u32, 46); -pub const IPV6_HOPOPTS = @as(u32, 1); -pub const IPV6_HDRINCL = @as(u32, 2); -pub const IPV6_UNICAST_HOPS = @as(u32, 4); -pub const IPV6_MULTICAST_IF = @as(u32, 9); -pub const IPV6_MULTICAST_HOPS = @as(u32, 10); -pub const IPV6_MULTICAST_LOOP = @as(u32, 11); -pub const IPV6_ADD_MEMBERSHIP = @as(u32, 12); -pub const IPV6_DROP_MEMBERSHIP = @as(u32, 13); -pub const IPV6_DONTFRAG = @as(u32, 14); -pub const IPV6_PKTINFO = @as(u32, 19); -pub const IPV6_HOPLIMIT = @as(u32, 21); -pub const IPV6_PROTECTION_LEVEL = @as(u32, 23); -pub const IPV6_RECVIF = @as(u32, 24); -pub const IPV6_RECVDSTADDR = @as(u32, 25); -pub const IPV6_CHECKSUM = @as(u32, 26); -pub const IPV6_V6ONLY = @as(u32, 27); -pub const IPV6_IFLIST = @as(u32, 28); -pub const IPV6_ADD_IFLIST = @as(u32, 29); -pub const IPV6_DEL_IFLIST = @as(u32, 30); -pub const IPV6_UNICAST_IF = @as(u32, 31); -pub const IPV6_RTHDR = @as(u32, 32); -pub const IPV6_GET_IFLIST = @as(u32, 33); -pub const IPV6_RECVRTHDR = @as(u32, 38); -pub const IPV6_TCLASS = @as(u32, 39); -pub const IPV6_RECVTCLASS = @as(u32, 40); -pub const IPV6_ECN = @as(u32, 50); -pub const IPV6_PKTINFO_EX = @as(u32, 51); -pub const IPV6_WFP_REDIRECT_RECORDS = @as(u32, 60); -pub const IPV6_WFP_REDIRECT_CONTEXT = @as(u32, 70); -pub const IPV6_MTU_DISCOVER = @as(u32, 71); -pub const IPV6_MTU = @as(u32, 72); -pub const IPV6_NRT_INTERFACE = @as(u32, 74); -pub const IPV6_RECVERR = @as(u32, 75); -pub const IPV6_USER_MTU = @as(u32, 76); -pub const IP_UNSPECIFIED_HOP_LIMIT = @as(i32, -1); -pub const PROTECTION_LEVEL_UNRESTRICTED = @as(u32, 10); -pub const PROTECTION_LEVEL_EDGERESTRICTED = @as(u32, 20); -pub const PROTECTION_LEVEL_RESTRICTED = @as(u32, 30); -pub const INET_ADDRSTRLEN = @as(u32, 22); -pub const INET6_ADDRSTRLEN = @as(u32, 65); -pub const TCP_OFFLOAD_NO_PREFERENCE = @as(u32, 0); -pub const TCP_OFFLOAD_NOT_PREFERRED = @as(u32, 1); -pub const TCP_OFFLOAD_PREFERRED = @as(u32, 2); -pub const TCP_EXPEDITED_1122 = @as(u32, 2); -pub const TCP_KEEPALIVE = @as(u32, 3); -pub const TCP_MAXSEG = @as(u32, 4); -pub const TCP_MAXRT = @as(u32, 5); -pub const TCP_STDURG = @as(u32, 6); -pub const TCP_NOURG = @as(u32, 7); -pub const TCP_ATMARK = @as(u32, 8); -pub const TCP_NOSYNRETRIES = @as(u32, 9); -pub const TCP_TIMESTAMPS = @as(u32, 10); -pub const TCP_OFFLOAD_PREFERENCE = @as(u32, 11); -pub const TCP_CONGESTION_ALGORITHM = @as(u32, 12); -pub const TCP_DELAY_FIN_ACK = @as(u32, 13); -pub const TCP_MAXRTMS = @as(u32, 14); -pub const TCP_FASTOPEN = @as(u32, 15); -pub const TCP_KEEPCNT = @as(u32, 16); -pub const TCP_KEEPINTVL = @as(u32, 17); -pub const TCP_FAIL_CONNECT_ON_ICMP_ERROR = @as(u32, 18); -pub const TCP_ICMP_ERROR_INFO = @as(u32, 19); -pub const UDP_SEND_MSG_SIZE = @as(u32, 2); -pub const UDP_RECV_MAX_COALESCED_SIZE = @as(u32, 3); -pub const UDP_COALESCED_INFO = @as(u32, 3); -pub const AF_UNSPEC = @as(u32, 0); -pub const AF_UNIX = @as(u32, 1); -pub const AF_INET = @as(u32, 2); -pub const AF_IMPLINK = @as(u32, 3); -pub const AF_PUP = @as(u32, 4); -pub const AF_CHAOS = @as(u32, 5); -pub const AF_NS = @as(u32, 6); -pub const AF_ISO = @as(u32, 7); -pub const AF_ECMA = @as(u32, 8); -pub const AF_DATAKIT = @as(u32, 9); -pub const AF_CCITT = @as(u32, 10); -pub const AF_SNA = @as(u32, 11); -pub const AF_DECnet = @as(u32, 12); -pub const AF_DLI = @as(u32, 13); -pub const AF_LAT = @as(u32, 14); -pub const AF_HYLINK = @as(u32, 15); -pub const AF_APPLETALK = @as(u32, 16); -pub const AF_NETBIOS = @as(u32, 17); -pub const AF_VOICEVIEW = @as(u32, 18); -pub const AF_FIREFOX = @as(u32, 19); -pub const AF_UNKNOWN1 = @as(u32, 20); -pub const AF_BAN = @as(u32, 21); -pub const AF_ATM = @as(u32, 22); -pub const AF_INET6 = @as(u32, 23); -pub const AF_CLUSTER = @as(u32, 24); -pub const AF_12844 = @as(u32, 25); -pub const AF_IRDA = @as(u32, 26); -pub const AF_NETDES = @as(u32, 28); -pub const AF_MAX = @as(u32, 29); -pub const AF_TCNPROCESS = @as(u32, 29); -pub const AF_TCNMESSAGE = @as(u32, 30); -pub const AF_ICLFXBM = @as(u32, 31); -pub const AF_LINK = @as(u32, 33); -pub const AF_HYPERV = @as(u32, 34); -pub const SOCK_STREAM = @as(u32, 1); -pub const SOCK_DGRAM = @as(u32, 2); -pub const SOCK_RAW = @as(u32, 3); -pub const SOCK_RDM = @as(u32, 4); -pub const SOCK_SEQPACKET = @as(u32, 5); -pub const SOL_SOCKET = @as(u32, 65535); -pub const SO_DEBUG = @as(u32, 1); -pub const SO_ACCEPTCONN = @as(u32, 2); -pub const SO_REUSEADDR = @as(u32, 4); -pub const SO_KEEPALIVE = @as(u32, 8); -pub const SO_DONTROUTE = @as(u32, 16); -pub const SO_BROADCAST = @as(u32, 32); -pub const SO_USELOOPBACK = @as(u32, 64); -pub const SO_LINGER = @as(u32, 128); -pub const SO_OOBINLINE = @as(u32, 256); -pub const SO_SNDBUF = @as(u32, 4097); -pub const SO_RCVBUF = @as(u32, 4098); -pub const SO_SNDLOWAT = @as(u32, 4099); -pub const SO_RCVLOWAT = @as(u32, 4100); -pub const SO_SNDTIMEO = @as(u32, 4101); -pub const SO_RCVTIMEO = @as(u32, 4102); -pub const SO_ERROR = @as(u32, 4103); -pub const SO_TYPE = @as(u32, 4104); -pub const SO_BSP_STATE = @as(u32, 4105); -pub const SO_GROUP_ID = @as(u32, 8193); -pub const SO_GROUP_PRIORITY = @as(u32, 8194); -pub const SO_MAX_MSG_SIZE = @as(u32, 8195); -pub const SO_CONDITIONAL_ACCEPT = @as(u32, 12290); -pub const SO_PAUSE_ACCEPT = @as(u32, 12291); -pub const SO_COMPARTMENT_ID = @as(u32, 12292); -pub const SO_RANDOMIZE_PORT = @as(u32, 12293); -pub const SO_PORT_SCALABILITY = @as(u32, 12294); -pub const SO_REUSE_UNICASTPORT = @as(u32, 12295); -pub const SO_REUSE_MULTICASTPORT = @as(u32, 12296); -pub const SO_ORIGINAL_DST = @as(u32, 12303); -pub const WSK_SO_BASE = @as(u32, 16384); -pub const TCP_NODELAY = @as(u32, 1); -pub const IOC_UNIX = @as(u32, 0); -pub const IOC_WS2 = @as(u32, 134217728); -pub const IOC_PROTOCOL = @as(u32, 268435456); -pub const IOC_VENDOR = @as(u32, 402653184); -pub const IPPROTO_IP = @as(u32, 0); -pub const IPPORT_TCPMUX = @as(u32, 1); -pub const IPPORT_ECHO = @as(u32, 7); -pub const IPPORT_DISCARD = @as(u32, 9); -pub const IPPORT_SYSTAT = @as(u32, 11); -pub const IPPORT_DAYTIME = @as(u32, 13); -pub const IPPORT_NETSTAT = @as(u32, 15); -pub const IPPORT_QOTD = @as(u32, 17); -pub const IPPORT_MSP = @as(u32, 18); -pub const IPPORT_CHARGEN = @as(u32, 19); -pub const IPPORT_FTP_DATA = @as(u32, 20); -pub const IPPORT_FTP = @as(u32, 21); -pub const IPPORT_TELNET = @as(u32, 23); -pub const IPPORT_SMTP = @as(u32, 25); -pub const IPPORT_TIMESERVER = @as(u32, 37); -pub const IPPORT_NAMESERVER = @as(u32, 42); -pub const IPPORT_WHOIS = @as(u32, 43); -pub const IPPORT_MTP = @as(u32, 57); -pub const IPPORT_TFTP = @as(u32, 69); -pub const IPPORT_RJE = @as(u32, 77); -pub const IPPORT_FINGER = @as(u32, 79); -pub const IPPORT_TTYLINK = @as(u32, 87); -pub const IPPORT_SUPDUP = @as(u32, 95); -pub const IPPORT_POP3 = @as(u32, 110); -pub const IPPORT_NTP = @as(u32, 123); -pub const IPPORT_EPMAP = @as(u32, 135); -pub const IPPORT_NETBIOS_NS = @as(u32, 137); -pub const IPPORT_NETBIOS_DGM = @as(u32, 138); -pub const IPPORT_NETBIOS_SSN = @as(u32, 139); -pub const IPPORT_IMAP = @as(u32, 143); -pub const IPPORT_SNMP = @as(u32, 161); -pub const IPPORT_SNMP_TRAP = @as(u32, 162); -pub const IPPORT_IMAP3 = @as(u32, 220); -pub const IPPORT_LDAP = @as(u32, 389); -pub const IPPORT_HTTPS = @as(u32, 443); -pub const IPPORT_MICROSOFT_DS = @as(u32, 445); -pub const IPPORT_EXECSERVER = @as(u32, 512); -pub const IPPORT_LOGINSERVER = @as(u32, 513); -pub const IPPORT_CMDSERVER = @as(u32, 514); -pub const IPPORT_EFSSERVER = @as(u32, 520); -pub const IPPORT_BIFFUDP = @as(u32, 512); -pub const IPPORT_WHOSERVER = @as(u32, 513); -pub const IPPORT_ROUTESERVER = @as(u32, 520); -pub const IPPORT_RESERVED = @as(u32, 1024); -pub const IPPORT_REGISTERED_MAX = @as(u32, 49151); -pub const IPPORT_DYNAMIC_MIN = @as(u32, 49152); -pub const IPPORT_DYNAMIC_MAX = @as(u32, 65535); -pub const IN_CLASSA_NET = @as(u32, 4278190080); -pub const IN_CLASSA_NSHIFT = @as(u32, 24); -pub const IN_CLASSA_HOST = @as(u32, 16777215); -pub const IN_CLASSA_MAX = @as(u32, 128); -pub const IN_CLASSB_NET = @as(u32, 4294901760); -pub const IN_CLASSB_NSHIFT = @as(u32, 16); -pub const IN_CLASSB_HOST = @as(u32, 65535); -pub const IN_CLASSB_MAX = @as(u32, 65536); -pub const IN_CLASSC_NET = @as(u32, 4294967040); -pub const IN_CLASSC_NSHIFT = @as(u32, 8); -pub const IN_CLASSC_HOST = @as(u32, 255); -pub const IN_CLASSD_NET = @as(u32, 4026531840); -pub const IN_CLASSD_NSHIFT = @as(u32, 28); -pub const IN_CLASSD_HOST = @as(u32, 268435455); -pub const INADDR_LOOPBACK = @as(u32, 2130706433); -pub const INADDR_NONE = @as(u32, 4294967295); -pub const IOCPARM_MASK = @as(u32, 127); -pub const IOC_VOID = @as(u32, 536870912); -pub const IOC_OUT = @as(u32, 1073741824); -pub const IOC_IN = @as(u32, 2147483648); -pub const MSG_TRUNC = @as(u32, 256); -pub const MSG_CTRUNC = @as(u32, 512); -pub const MSG_BCAST = @as(u32, 1024); -pub const MSG_MCAST = @as(u32, 2048); -pub const MSG_ERRQUEUE = @as(u32, 4096); -pub const AI_PASSIVE = @as(u32, 1); -pub const AI_CANONNAME = @as(u32, 2); -pub const AI_NUMERICHOST = @as(u32, 4); -pub const AI_NUMERICSERV = @as(u32, 8); -pub const AI_DNS_ONLY = @as(u32, 16); -pub const AI_ALL = @as(u32, 256); -pub const AI_ADDRCONFIG = @as(u32, 1024); -pub const AI_V4MAPPED = @as(u32, 2048); -pub const AI_NON_AUTHORITATIVE = @as(u32, 16384); -pub const AI_SECURE = @as(u32, 32768); -pub const AI_RETURN_PREFERRED_NAMES = @as(u32, 65536); -pub const AI_FQDN = @as(u32, 131072); -pub const AI_FILESERVER = @as(u32, 262144); -pub const AI_DISABLE_IDN_ENCODING = @as(u32, 524288); -pub const AI_EXTENDED = @as(u32, 2147483648); -pub const AI_RESOLUTION_HANDLE = @as(u32, 1073741824); -pub const ADDRINFOEX_VERSION_2 = @as(u32, 2); -pub const ADDRINFOEX_VERSION_3 = @as(u32, 3); -pub const ADDRINFOEX_VERSION_4 = @as(u32, 4); -pub const NS_ALL = @as(u32, 0); -pub const NS_SAP = @as(u32, 1); -pub const NS_NDS = @as(u32, 2); -pub const NS_PEER_BROWSE = @as(u32, 3); -pub const NS_SLP = @as(u32, 5); -pub const NS_DHCP = @as(u32, 6); -pub const NS_TCPIP_LOCAL = @as(u32, 10); -pub const NS_TCPIP_HOSTS = @as(u32, 11); -pub const NS_DNS = @as(u32, 12); -pub const NS_NETBT = @as(u32, 13); -pub const NS_WINS = @as(u32, 14); -pub const NS_NLA = @as(u32, 15); -pub const NS_NBP = @as(u32, 20); -pub const NS_MS = @as(u32, 30); -pub const NS_STDA = @as(u32, 31); -pub const NS_NTDS = @as(u32, 32); -pub const NS_EMAIL = @as(u32, 37); -pub const NS_X500 = @as(u32, 40); -pub const NS_NIS = @as(u32, 41); -pub const NS_NISPLUS = @as(u32, 42); -pub const NS_WRQ = @as(u32, 50); -pub const NS_NETDES = @as(u32, 60); -pub const NI_NOFQDN = @as(u32, 1); -pub const NI_NUMERICHOST = @as(u32, 2); -pub const NI_NAMEREQD = @as(u32, 4); -pub const NI_NUMERICSERV = @as(u32, 8); -pub const NI_DGRAM = @as(u32, 16); -pub const NI_MAXHOST = @as(u32, 1025); -pub const NI_MAXSERV = @as(u32, 32); -pub const INCL_WINSOCK_API_PROTOTYPES = @as(u32, 1); -pub const INCL_WINSOCK_API_TYPEDEFS = @as(u32, 0); -pub const FD_SETSIZE = @as(u32, 64); -pub const IMPLINK_IP = @as(u32, 155); -pub const IMPLINK_LOWEXPER = @as(u32, 156); -pub const IMPLINK_HIGHEXPER = @as(u32, 158); -pub const WSADESCRIPTION_LEN = @as(u32, 256); -pub const WSASYS_STATUS_LEN = @as(u32, 128); -pub const SOCKET_ERROR = @as(i32, -1); -pub const FROM_PROTOCOL_INFO = @as(i32, -1); -pub const SO_PROTOCOL_INFOA = @as(u32, 8196); -pub const SO_PROTOCOL_INFOW = @as(u32, 8197); -pub const PVD_CONFIG = @as(u32, 12289); -pub const SOMAXCONN = @as(u32, 2147483647); -pub const MSG_PEEK = @as(u32, 2); -pub const MSG_WAITALL = @as(u32, 8); -pub const MSG_PUSH_IMMEDIATE = @as(u32, 32); -pub const MSG_PARTIAL = @as(u32, 32768); -pub const MSG_INTERRUPT = @as(u32, 16); -pub const MSG_MAXIOVLEN = @as(u32, 16); -pub const MAXGETHOSTSTRUCT = @as(u32, 1024); -pub const FD_READ_BIT = @as(u32, 0); -pub const FD_WRITE_BIT = @as(u32, 1); -pub const FD_OOB_BIT = @as(u32, 2); -pub const FD_ACCEPT_BIT = @as(u32, 3); -pub const FD_CONNECT_BIT = @as(u32, 4); -pub const FD_CLOSE_BIT = @as(u32, 5); -pub const FD_QOS_BIT = @as(u32, 6); -pub const FD_GROUP_QOS_BIT = @as(u32, 7); -pub const FD_ROUTING_INTERFACE_CHANGE_BIT = @as(u32, 8); -pub const FD_ADDRESS_LIST_CHANGE_BIT = @as(u32, 9); -pub const FD_MAX_EVENTS = @as(u32, 10); -pub const CF_ACCEPT = @as(u32, 0); -pub const CF_REJECT = @as(u32, 1); -pub const CF_DEFER = @as(u32, 2); -pub const SD_RECEIVE = @as(u32, 0); -pub const SD_SEND = @as(u32, 1); -pub const SD_BOTH = @as(u32, 2); -pub const SG_UNCONSTRAINED_GROUP = @as(u32, 1); -pub const SG_CONSTRAINED_GROUP = @as(u32, 2); -pub const MAX_PROTOCOL_CHAIN = @as(u32, 7); -pub const BASE_PROTOCOL = @as(u32, 1); -pub const LAYERED_PROTOCOL = @as(u32, 0); -pub const WSAPROTOCOL_LEN = @as(u32, 255); -pub const PFL_MULTIPLE_PROTO_ENTRIES = @as(u32, 1); -pub const PFL_RECOMMENDED_PROTO_ENTRY = @as(u32, 2); -pub const PFL_HIDDEN = @as(u32, 4); -pub const PFL_MATCHES_PROTOCOL_ZERO = @as(u32, 8); -pub const PFL_NETWORKDIRECT_PROVIDER = @as(u32, 16); -pub const XP1_CONNECTIONLESS = @as(u32, 1); -pub const XP1_GUARANTEED_DELIVERY = @as(u32, 2); -pub const XP1_GUARANTEED_ORDER = @as(u32, 4); -pub const XP1_MESSAGE_ORIENTED = @as(u32, 8); -pub const XP1_PSEUDO_STREAM = @as(u32, 16); -pub const XP1_GRACEFUL_CLOSE = @as(u32, 32); -pub const XP1_EXPEDITED_DATA = @as(u32, 64); -pub const XP1_CONNECT_DATA = @as(u32, 128); -pub const XP1_DISCONNECT_DATA = @as(u32, 256); -pub const XP1_SUPPORT_BROADCAST = @as(u32, 512); -pub const XP1_SUPPORT_MULTIPOINT = @as(u32, 1024); -pub const XP1_MULTIPOINT_CONTROL_PLANE = @as(u32, 2048); -pub const XP1_MULTIPOINT_DATA_PLANE = @as(u32, 4096); -pub const XP1_QOS_SUPPORTED = @as(u32, 8192); -pub const XP1_INTERRUPT = @as(u32, 16384); -pub const XP1_UNI_SEND = @as(u32, 32768); -pub const XP1_UNI_RECV = @as(u32, 65536); -pub const XP1_IFS_HANDLES = @as(u32, 131072); -pub const XP1_PARTIAL_MESSAGE = @as(u32, 262144); -pub const XP1_SAN_SUPPORT_SDP = @as(u32, 524288); -pub const BIGENDIAN = @as(u32, 0); -pub const LITTLEENDIAN = @as(u32, 1); -pub const SECURITY_PROTOCOL_NONE = @as(u32, 0); -pub const JL_SENDER_ONLY = @as(u32, 1); -pub const JL_RECEIVER_ONLY = @as(u32, 2); -pub const JL_BOTH = @as(u32, 4); -pub const WSA_FLAG_OVERLAPPED = @as(u32, 1); -pub const WSA_FLAG_MULTIPOINT_C_ROOT = @as(u32, 2); -pub const WSA_FLAG_MULTIPOINT_C_LEAF = @as(u32, 4); -pub const WSA_FLAG_MULTIPOINT_D_ROOT = @as(u32, 8); -pub const WSA_FLAG_MULTIPOINT_D_LEAF = @as(u32, 16); -pub const WSA_FLAG_ACCESS_SYSTEM_SECURITY = @as(u32, 64); -pub const WSA_FLAG_NO_HANDLE_INHERIT = @as(u32, 128); -pub const WSA_FLAG_REGISTERED_IO = @as(u32, 256); -pub const TH_NETDEV = @as(u32, 1); -pub const TH_TAPI = @as(u32, 2); -pub const SERVICE_MULTIPLE = @as(u32, 1); -pub const NS_LOCALNAME = @as(u32, 19); -pub const RES_UNUSED_1 = @as(u32, 1); -pub const RES_FLUSH_CACHE = @as(u32, 2); -pub const RES_SERVICE = @as(u32, 4); -pub const LUP_DEEP = @as(u32, 1); -pub const LUP_CONTAINERS = @as(u32, 2); -pub const LUP_NOCONTAINERS = @as(u32, 4); -pub const LUP_NEAREST = @as(u32, 8); -pub const LUP_RETURN_NAME = @as(u32, 16); -pub const LUP_RETURN_TYPE = @as(u32, 32); -pub const LUP_RETURN_VERSION = @as(u32, 64); -pub const LUP_RETURN_COMMENT = @as(u32, 128); -pub const LUP_RETURN_ADDR = @as(u32, 256); -pub const LUP_RETURN_BLOB = @as(u32, 512); -pub const LUP_RETURN_ALIASES = @as(u32, 1024); -pub const LUP_RETURN_QUERY_STRING = @as(u32, 2048); -pub const LUP_RETURN_ALL = @as(u32, 4080); -pub const LUP_RES_SERVICE = @as(u32, 32768); -pub const LUP_FLUSHCACHE = @as(u32, 4096); -pub const LUP_FLUSHPREVIOUS = @as(u32, 8192); -pub const LUP_NON_AUTHORITATIVE = @as(u32, 16384); -pub const LUP_SECURE = @as(u32, 32768); -pub const LUP_RETURN_PREFERRED_NAMES = @as(u32, 65536); -pub const LUP_DNS_ONLY = @as(u32, 131072); -pub const LUP_ADDRCONFIG = @as(u32, 1048576); -pub const LUP_DUAL_ADDR = @as(u32, 2097152); -pub const LUP_FILESERVER = @as(u32, 4194304); -pub const LUP_DISABLE_IDN_ENCODING = @as(u32, 8388608); -pub const LUP_API_ANSI = @as(u32, 16777216); -pub const LUP_RESOLUTION_HANDLE = @as(u32, 2147483648); -pub const RESULT_IS_ALIAS = @as(u32, 1); -pub const RESULT_IS_ADDED = @as(u32, 16); -pub const RESULT_IS_CHANGED = @as(u32, 32); -pub const RESULT_IS_DELETED = @as(u32, 64); -pub const POLLRDNORM = @as(u32, 256); -pub const POLLRDBAND = @as(u32, 512); -pub const POLLPRI = @as(u32, 1024); -pub const POLLWRNORM = @as(u32, 16); -pub const POLLWRBAND = @as(u32, 32); -pub const POLLERR = @as(u32, 1); -pub const POLLHUP = @as(u32, 2); -pub const POLLNVAL = @as(u32, 4); -pub const SO_CONNDATA = @as(u32, 28672); -pub const SO_CONNOPT = @as(u32, 28673); -pub const SO_DISCDATA = @as(u32, 28674); -pub const SO_DISCOPT = @as(u32, 28675); -pub const SO_CONNDATALEN = @as(u32, 28676); -pub const SO_CONNOPTLEN = @as(u32, 28677); -pub const SO_DISCDATALEN = @as(u32, 28678); -pub const SO_DISCOPTLEN = @as(u32, 28679); -pub const SO_OPENTYPE = @as(u32, 28680); -pub const SO_SYNCHRONOUS_ALERT = @as(u32, 16); -pub const SO_SYNCHRONOUS_NONALERT = @as(u32, 32); -pub const SO_MAXDG = @as(u32, 28681); -pub const SO_MAXPATHDG = @as(u32, 28682); -pub const SO_UPDATE_ACCEPT_CONTEXT = @as(u32, 28683); -pub const SO_CONNECT_TIME = @as(u32, 28684); -pub const SO_UPDATE_CONNECT_CONTEXT = @as(u32, 28688); -pub const TCP_BSDURGENT = @as(u32, 28672); -pub const TF_DISCONNECT = @as(u32, 1); -pub const TF_REUSE_SOCKET = @as(u32, 2); -pub const TF_WRITE_BEHIND = @as(u32, 4); -pub const TF_USE_DEFAULT_WORKER = @as(u32, 0); -pub const TF_USE_SYSTEM_THREAD = @as(u32, 16); -pub const TF_USE_KERNEL_APC = @as(u32, 32); -pub const TP_ELEMENT_MEMORY = @as(u32, 1); -pub const TP_ELEMENT_FILE = @as(u32, 2); -pub const TP_ELEMENT_EOP = @as(u32, 4); -pub const NLA_ALLUSERS_NETWORK = @as(u32, 1); -pub const NLA_FRIENDLY_NAME = @as(u32, 2); -pub const WSPDESCRIPTION_LEN = @as(u32, 255); -pub const WSS_OPERATION_IN_PROGRESS = @as(i32, 259); -pub const LSP_SYSTEM = @as(u32, 2147483648); -pub const LSP_INSPECTOR = @as(u32, 1); -pub const LSP_REDIRECTOR = @as(u32, 2); -pub const LSP_PROXY = @as(u32, 4); -pub const LSP_FIREWALL = @as(u32, 8); -pub const LSP_INBOUND_MODIFY = @as(u32, 16); -pub const LSP_OUTBOUND_MODIFY = @as(u32, 32); -pub const LSP_CRYPTO_COMPRESS = @as(u32, 64); -pub const LSP_LOCAL_CACHE = @as(u32, 128); -pub const IPPROTO_ICMP = @as(u32, 1); -pub const IPPROTO_IGMP = @as(u32, 2); -pub const IPPROTO_GGP = @as(u32, 3); -pub const IPPROTO_TCP = @as(u32, 6); -pub const IPPROTO_PUP = @as(u32, 12); -pub const IPPROTO_UDP = @as(u32, 17); -pub const IPPROTO_IDP = @as(u32, 22); -pub const IPPROTO_ND = @as(u32, 77); -pub const IPPROTO_RAW = @as(u32, 255); -pub const IPPROTO_MAX = @as(u32, 256); -pub const IP_DEFAULT_MULTICAST_TTL = @as(u32, 1); -pub const IP_DEFAULT_MULTICAST_LOOP = @as(u32, 1); -pub const IP_MAX_MEMBERSHIPS = @as(u32, 20); -pub const AF_IPX = @as(u32, 6); -pub const FD_READ = @as(u32, 1); -pub const FD_WRITE = @as(u32, 2); -pub const FD_OOB = @as(u32, 4); -pub const FD_ACCEPT = @as(u32, 8); -pub const FD_CONNECT = @as(u32, 16); -pub const FD_CLOSE = @as(u32, 32); -pub const SERVICE_RESOURCE = @as(u32, 1); -pub const SERVICE_SERVICE = @as(u32, 2); -pub const SERVICE_LOCAL = @as(u32, 4); -pub const SERVICE_FLAG_DEFER = @as(u32, 1); -pub const SERVICE_FLAG_HARD = @as(u32, 2); -pub const PROP_COMMENT = @as(u32, 1); -pub const PROP_LOCALE = @as(u32, 2); -pub const PROP_DISPLAY_HINT = @as(u32, 4); -pub const PROP_VERSION = @as(u32, 8); -pub const PROP_START_TIME = @as(u32, 16); -pub const PROP_MACHINE = @as(u32, 32); -pub const PROP_ADDRESSES = @as(u32, 256); -pub const PROP_SD = @as(u32, 512); -pub const PROP_ALL = @as(u32, 2147483648); -pub const SERVICE_ADDRESS_FLAG_RPC_CN = @as(u32, 1); -pub const SERVICE_ADDRESS_FLAG_RPC_DG = @as(u32, 2); -pub const SERVICE_ADDRESS_FLAG_RPC_NB = @as(u32, 4); -pub const NS_DEFAULT = @as(u32, 0); -pub const NS_VNS = @as(u32, 50); -pub const NSTYPE_HIERARCHICAL = @as(u32, 1); -pub const NSTYPE_DYNAMIC = @as(u32, 2); -pub const NSTYPE_ENUMERABLE = @as(u32, 4); -pub const NSTYPE_WORKGROUP = @as(u32, 8); -pub const XP_CONNECTIONLESS = @as(u32, 1); -pub const XP_GUARANTEED_DELIVERY = @as(u32, 2); -pub const XP_GUARANTEED_ORDER = @as(u32, 4); -pub const XP_MESSAGE_ORIENTED = @as(u32, 8); -pub const XP_PSEUDO_STREAM = @as(u32, 16); -pub const XP_GRACEFUL_CLOSE = @as(u32, 32); -pub const XP_EXPEDITED_DATA = @as(u32, 64); -pub const XP_CONNECT_DATA = @as(u32, 128); -pub const XP_DISCONNECT_DATA = @as(u32, 256); -pub const XP_SUPPORTS_BROADCAST = @as(u32, 512); -pub const XP_SUPPORTS_MULTICAST = @as(u32, 1024); -pub const XP_BANDWIDTH_ALLOCATION = @as(u32, 2048); -pub const XP_FRAGMENTATION = @as(u32, 4096); -pub const XP_ENCRYPTS = @as(u32, 8192); -pub const RES_SOFT_SEARCH = @as(u32, 1); -pub const RES_FIND_MULTIPLE = @as(u32, 2); -pub const SET_SERVICE_PARTIAL_SUCCESS = @as(u32, 1); -pub const UDP_NOCHECKSUM = @as(u32, 1); -pub const UDP_CHECKSUM_COVERAGE = @as(u32, 20); -pub const GAI_STRERROR_BUFFER_SIZE = @as(u32, 1024); +pub const LM_HB_Extension = 128; +pub const LM_HB1_PnP = 1; +pub const LM_HB1_PDA_Palmtop = 2; +pub const LM_HB1_Computer = 4; +pub const LM_HB1_Printer = 8; +pub const LM_HB1_Modem = 16; +pub const LM_HB1_Fax = 32; +pub const LM_HB1_LANAccess = 64; +pub const LM_HB2_Telephony = 1; +pub const LM_HB2_FileServer = 2; +pub const ATMPROTO_AALUSER = 0; +pub const ATMPROTO_AAL1 = 1; +pub const ATMPROTO_AAL2 = 2; +pub const ATMPROTO_AAL34 = 3; +pub const ATMPROTO_AAL5 = 5; +pub const SAP_FIELD_ABSENT = 4294967294; +pub const SAP_FIELD_ANY = 4294967295; +pub const SAP_FIELD_ANY_AESA_SEL = 4294967290; +pub const SAP_FIELD_ANY_AESA_REST = 4294967291; +pub const ATM_E164 = 1; +pub const ATM_NSAP = 2; +pub const ATM_AESA = 2; +pub const ATM_ADDR_SIZE = 20; +pub const BLLI_L2_ISO_1745 = 1; +pub const BLLI_L2_Q921 = 2; +pub const BLLI_L2_X25L = 6; +pub const BLLI_L2_X25M = 7; +pub const BLLI_L2_ELAPB = 8; +pub const BLLI_L2_HDLC_ARM = 9; +pub const BLLI_L2_HDLC_NRM = 10; +pub const BLLI_L2_HDLC_ABM = 11; +pub const BLLI_L2_LLC = 12; +pub const BLLI_L2_X75 = 13; +pub const BLLI_L2_Q922 = 14; +pub const BLLI_L2_USER_SPECIFIED = 16; +pub const BLLI_L2_ISO_7776 = 17; +pub const BLLI_L3_X25 = 6; +pub const BLLI_L3_ISO_8208 = 7; +pub const BLLI_L3_X223 = 8; +pub const BLLI_L3_SIO_8473 = 9; +pub const BLLI_L3_T70 = 10; +pub const BLLI_L3_ISO_TR9577 = 11; +pub const BLLI_L3_USER_SPECIFIED = 16; +pub const BLLI_L3_IPI_SNAP = 128; +pub const BLLI_L3_IPI_IP = 204; +pub const BHLI_ISO = 0; +pub const BHLI_UserSpecific = 1; +pub const BHLI_HighLayerProfile = 2; +pub const BHLI_VendorSpecificAppId = 3; +pub const AAL5_MODE_MESSAGE = 1; +pub const AAL5_MODE_STREAMING = 2; +pub const AAL5_SSCS_NULL = 0; +pub const AAL5_SSCS_SSCOP_ASSURED = 1; +pub const AAL5_SSCS_SSCOP_NON_ASSURED = 2; +pub const AAL5_SSCS_FRAME_RELAY = 4; +pub const BCOB_A = 1; +pub const BCOB_C = 3; +pub const BCOB_X = 16; +pub const TT_NOIND = 0; +pub const TT_CBR = 4; +pub const TT_VBR = 8; +pub const TR_NOIND = 0; +pub const TR_END_TO_END = 1; +pub const TR_NO_END_TO_END = 2; +pub const CLIP_NOT = 0; +pub const CLIP_SUS = 32; +pub const UP_P2P = 0; +pub const UP_P2MP = 1; +pub const BLLI_L2_MODE_NORMAL = 64; +pub const BLLI_L2_MODE_EXT = 128; +pub const BLLI_L3_MODE_NORMAL = 64; +pub const BLLI_L3_MODE_EXT = 128; +pub const BLLI_L3_PACKET_16 = 4; +pub const BLLI_L3_PACKET_32 = 5; +pub const BLLI_L3_PACKET_64 = 6; +pub const BLLI_L3_PACKET_128 = 7; +pub const BLLI_L3_PACKET_256 = 8; +pub const BLLI_L3_PACKET_512 = 9; +pub const BLLI_L3_PACKET_1024 = 10; +pub const BLLI_L3_PACKET_2048 = 11; +pub const BLLI_L3_PACKET_4096 = 12; +pub const PI_ALLOWED = 0; +pub const PI_RESTRICTED = 64; +pub const PI_NUMBER_NOT_AVAILABLE = 128; +pub const SI_USER_NOT_SCREENED = 0; +pub const SI_USER_PASSED = 1; +pub const SI_USER_FAILED = 2; +pub const SI_NETWORK = 3; +pub const CAUSE_LOC_USER = 0; +pub const CAUSE_LOC_PRIVATE_LOCAL = 1; +pub const CAUSE_LOC_PUBLIC_LOCAL = 2; +pub const CAUSE_LOC_TRANSIT_NETWORK = 3; +pub const CAUSE_LOC_PUBLIC_REMOTE = 4; +pub const CAUSE_LOC_PRIVATE_REMOTE = 5; +pub const CAUSE_LOC_INTERNATIONAL_NETWORK = 7; +pub const CAUSE_LOC_BEYOND_INTERWORKING = 10; +pub const CAUSE_UNALLOCATED_NUMBER = 1; +pub const CAUSE_NO_ROUTE_TO_TRANSIT_NETWORK = 2; +pub const CAUSE_NO_ROUTE_TO_DESTINATION = 3; +pub const CAUSE_VPI_VCI_UNACCEPTABLE = 10; +pub const CAUSE_NORMAL_CALL_CLEARING = 16; +pub const CAUSE_USER_BUSY = 17; +pub const CAUSE_NO_USER_RESPONDING = 18; +pub const CAUSE_CALL_REJECTED = 21; +pub const CAUSE_NUMBER_CHANGED = 22; +pub const CAUSE_USER_REJECTS_CLIR = 23; +pub const CAUSE_DESTINATION_OUT_OF_ORDER = 27; +pub const CAUSE_INVALID_NUMBER_FORMAT = 28; +pub const CAUSE_STATUS_ENQUIRY_RESPONSE = 30; +pub const CAUSE_NORMAL_UNSPECIFIED = 31; +pub const CAUSE_VPI_VCI_UNAVAILABLE = 35; +pub const CAUSE_NETWORK_OUT_OF_ORDER = 38; +pub const CAUSE_TEMPORARY_FAILURE = 41; +pub const CAUSE_ACCESS_INFORMAION_DISCARDED = 43; +pub const CAUSE_NO_VPI_VCI_AVAILABLE = 45; +pub const CAUSE_RESOURCE_UNAVAILABLE = 47; +pub const CAUSE_QOS_UNAVAILABLE = 49; +pub const CAUSE_USER_CELL_RATE_UNAVAILABLE = 51; +pub const CAUSE_BEARER_CAPABILITY_UNAUTHORIZED = 57; +pub const CAUSE_BEARER_CAPABILITY_UNAVAILABLE = 58; +pub const CAUSE_OPTION_UNAVAILABLE = 63; +pub const CAUSE_BEARER_CAPABILITY_UNIMPLEMENTED = 65; +pub const CAUSE_UNSUPPORTED_TRAFFIC_PARAMETERS = 73; +pub const CAUSE_INVALID_CALL_REFERENCE = 81; +pub const CAUSE_CHANNEL_NONEXISTENT = 82; +pub const CAUSE_INCOMPATIBLE_DESTINATION = 88; +pub const CAUSE_INVALID_ENDPOINT_REFERENCE = 89; +pub const CAUSE_INVALID_TRANSIT_NETWORK_SELECTION = 91; +pub const CAUSE_TOO_MANY_PENDING_ADD_PARTY = 92; +pub const CAUSE_AAL_PARAMETERS_UNSUPPORTED = 93; +pub const CAUSE_MANDATORY_IE_MISSING = 96; +pub const CAUSE_UNIMPLEMENTED_MESSAGE_TYPE = 97; +pub const CAUSE_UNIMPLEMENTED_IE = 99; +pub const CAUSE_INVALID_IE_CONTENTS = 100; +pub const CAUSE_INVALID_STATE_FOR_MESSAGE = 101; +pub const CAUSE_RECOVERY_ON_TIMEOUT = 102; +pub const CAUSE_INCORRECT_MESSAGE_LENGTH = 104; +pub const CAUSE_PROTOCOL_ERROR = 111; +pub const CAUSE_COND_UNKNOWN = 0; +pub const CAUSE_COND_PERMANENT = 1; +pub const CAUSE_COND_TRANSIENT = 2; +pub const CAUSE_REASON_USER = 0; +pub const CAUSE_REASON_IE_MISSING = 4; +pub const CAUSE_REASON_IE_INSUFFICIENT = 8; +pub const CAUSE_PU_PROVIDER = 0; +pub const CAUSE_PU_USER = 8; +pub const CAUSE_NA_NORMAL = 0; +pub const CAUSE_NA_ABNORMAL = 4; +pub const QOS_CLASS0 = 0; +pub const QOS_CLASS1 = 1; +pub const QOS_CLASS2 = 2; +pub const QOS_CLASS3 = 3; +pub const QOS_CLASS4 = 4; +pub const TNS_TYPE_NATIONAL = 64; +pub const TNS_PLAN_CARRIER_ID_CODE = 1; +pub const SIO_GET_NUMBER_OF_ATM_DEVICES = 1343619073; +pub const SIO_GET_ATM_ADDRESS = 3491102722; +pub const SIO_ASSOCIATE_PVC = 2417360899; +pub const SIO_GET_ATM_CONNECTION_ID = 1343619076; +pub const RIO_MSG_DONT_NOTIFY = 1; +pub const RIO_MSG_DEFER = 2; +pub const RIO_MSG_WAITALL = 4; +pub const RIO_MSG_COMMIT_ONLY = 8; +pub const RIO_MAX_CQ_SIZE = 134217728; +pub const RIO_CORRUPT_CQ = 4294967295; +pub const WINDOWS_AF_IRDA = 26; +pub const WCE_AF_IRDA = 22; +pub const IRDA_PROTO_SOCK_STREAM = 1; +pub const SOL_IRLMP = 255; +pub const IRLMP_ENUMDEVICES = 16; +pub const IRLMP_IAS_SET = 17; +pub const IRLMP_IAS_QUERY = 18; +pub const IRLMP_SEND_PDU_LEN = 19; +pub const IRLMP_EXCLUSIVE_MODE = 20; +pub const IRLMP_IRLPT_MODE = 21; +pub const IRLMP_9WIRE_MODE = 22; +pub const IRLMP_TINYTP_MODE = 23; +pub const IRLMP_PARAMETERS = 24; +pub const IRLMP_DISCOVERY_MODE = 25; +pub const IRLMP_SHARP_MODE = 32; +pub const IAS_ATTRIB_NO_CLASS = 16; +pub const IAS_ATTRIB_NO_ATTRIB = 0; +pub const IAS_ATTRIB_INT = 1; +pub const IAS_ATTRIB_OCTETSEQ = 2; +pub const IAS_ATTRIB_STR = 3; +pub const IAS_MAX_USER_STRING = 256; +pub const IAS_MAX_OCTET_STRING = 1024; +pub const IAS_MAX_CLASSNAME = 64; +pub const IAS_MAX_ATTRIBNAME = 256; +pub const LmCharSetASCII = 0; +pub const LmCharSetISO_8859_1 = 1; +pub const LmCharSetISO_8859_2 = 2; +pub const LmCharSetISO_8859_3 = 3; +pub const LmCharSetISO_8859_4 = 4; +pub const LmCharSetISO_8859_5 = 5; +pub const LmCharSetISO_8859_6 = 6; +pub const LmCharSetISO_8859_7 = 7; +pub const LmCharSetISO_8859_8 = 8; +pub const LmCharSetISO_8859_9 = 9; +pub const LmCharSetUNICODE = 255; +pub const LM_BAUD_1200 = 1200; +pub const LM_BAUD_2400 = 2400; +pub const LM_BAUD_9600 = 9600; +pub const LM_BAUD_19200 = 19200; +pub const LM_BAUD_38400 = 38400; +pub const LM_BAUD_57600 = 57600; +pub const LM_BAUD_115200 = 115200; +pub const LM_BAUD_576K = 576000; +pub const LM_BAUD_1152K = 1152000; +pub const LM_BAUD_4M = 4000000; +pub const LM_BAUD_16M = 16000000; +pub const IPX_PTYPE = 16384; +pub const IPX_FILTERPTYPE = 16385; +pub const IPX_STOPFILTERPTYPE = 16387; +pub const IPX_DSTYPE = 16386; +pub const IPX_EXTENDED_ADDRESS = 16388; +pub const IPX_RECVHDR = 16389; +pub const IPX_MAXSIZE = 16390; +pub const IPX_ADDRESS = 16391; +pub const IPX_GETNETINFO = 16392; +pub const IPX_GETNETINFO_NORIP = 16393; +pub const IPX_SPXGETCONNECTIONSTATUS = 16395; +pub const IPX_ADDRESS_NOTIFY = 16396; +pub const IPX_MAX_ADAPTER_NUM = 16397; +pub const IPX_RERIPNETNUMBER = 16398; +pub const IPX_RECEIVE_BROADCAST = 16399; +pub const IPX_IMMEDIATESPXACK = 16400; +pub const IPPROTO_RM = 113; +pub const MAX_MCAST_TTL = 255; +pub const RM_OPTIONSBASE = 1000; +pub const RM_RATE_WINDOW_SIZE = 1001; +pub const RM_SET_MESSAGE_BOUNDARY = 1002; +pub const RM_FLUSHCACHE = 1003; +pub const RM_SENDER_WINDOW_ADVANCE_METHOD = 1004; +pub const RM_SENDER_STATISTICS = 1005; +pub const RM_LATEJOIN = 1006; +pub const RM_SET_SEND_IF = 1007; +pub const RM_ADD_RECEIVE_IF = 1008; +pub const RM_DEL_RECEIVE_IF = 1009; +pub const RM_SEND_WINDOW_ADV_RATE = 1010; +pub const RM_USE_FEC = 1011; +pub const RM_SET_MCAST_TTL = 1012; +pub const RM_RECEIVER_STATISTICS = 1013; +pub const RM_HIGH_SPEED_INTRANET_OPT = 1014; +pub const SENDER_DEFAULT_RATE_KBITS_PER_SEC = 56; +pub const SENDER_DEFAULT_WINDOW_ADV_PERCENTAGE = 15; +pub const MAX_WINDOW_INCREMENT_PERCENTAGE = 25; +pub const SENDER_DEFAULT_LATE_JOINER_PERCENTAGE = 0; +pub const SENDER_MAX_LATE_JOINER_PERCENTAGE = 75; +pub const BITS_PER_BYTE = 8; +pub const LOG2_BITS_PER_BYTE = 3; +pub const SOCKET_DEFAULT2_QM_POLICY = GUID.parse("{aec2ef9c-3a4d-4d3e-8842-239942e39a47}"); +pub const REAL_TIME_NOTIFICATION_CAPABILITY = GUID.parse("{6b59819a-5cae-492d-a901-2a3c2c50164f}"); +pub const REAL_TIME_NOTIFICATION_CAPABILITY_EX = GUID.parse("{6843da03-154a-4616-a508-44371295f96b}"); +pub const ASSOCIATE_NAMERES_CONTEXT = GUID.parse("{59a38b67-d4fe-46e1-ba3c-87ea74ca3049}"); +pub const TCP_INITIAL_RTO_DEFAULT_RTT = 0; +pub const TCP_INITIAL_RTO_DEFAULT_MAX_SYN_RETRANSMISSIONS = 0; +pub const SOCKET_SETTINGS_GUARANTEE_ENCRYPTION = 1; +pub const SOCKET_SETTINGS_ALLOW_INSECURE = 2; +pub const SOCKET_SETTINGS_IPSEC_SKIP_FILTER_INSTANTIATION = 1; +pub const SOCKET_SETTINGS_IPSEC_OPTIONAL_PEER_NAME_VERIFICATION = 2; +pub const SOCKET_SETTINGS_IPSEC_ALLOW_FIRST_INBOUND_PKT_UNENCRYPTED = 4; +pub const SOCKET_SETTINGS_IPSEC_PEER_NAME_IS_RAW_FORMAT = 8; +pub const SOCKET_QUERY_IPSEC2_ABORT_CONNECTION_ON_FIELD_CHANGE = 1; +pub const SOCKET_QUERY_IPSEC2_FIELD_MASK_MM_SA_ID = 1; +pub const SOCKET_QUERY_IPSEC2_FIELD_MASK_QM_SA_ID = 2; +pub const SOCKET_INFO_CONNECTION_SECURED = 1; +pub const SOCKET_INFO_CONNECTION_ENCRYPTED = 2; +pub const SOCKET_INFO_CONNECTION_IMPERSONATED = 4; +pub const IN4ADDR_LOOPBACK = 16777343; +pub const IN4ADDR_LOOPBACKPREFIX_LENGTH = 8; +pub const IN4ADDR_LINKLOCALPREFIX_LENGTH = 16; +pub const IN4ADDR_MULTICASTPREFIX_LENGTH = 4; +pub const IFF_UP = 1; +pub const IFF_BROADCAST = 2; +pub const IFF_LOOPBACK = 4; +pub const IFF_POINTTOPOINT = 8; +pub const IFF_MULTICAST = 16; +pub const IP_OPTIONS = 1; +pub const IP_HDRINCL = 2; +pub const IP_TOS = 3; +pub const IP_TTL = 4; +pub const IP_MULTICAST_IF = 9; +pub const IP_MULTICAST_TTL = 10; +pub const IP_MULTICAST_LOOP = 11; +pub const IP_ADD_MEMBERSHIP = 12; +pub const IP_DROP_MEMBERSHIP = 13; +pub const IP_DONTFRAGMENT = 14; +pub const IP_ADD_SOURCE_MEMBERSHIP = 15; +pub const IP_DROP_SOURCE_MEMBERSHIP = 16; +pub const IP_BLOCK_SOURCE = 17; +pub const IP_UNBLOCK_SOURCE = 18; +pub const IP_PKTINFO = 19; +pub const IP_HOPLIMIT = 21; +pub const IP_RECVTTL = 21; +pub const IP_RECEIVE_BROADCAST = 22; +pub const IP_RECVIF = 24; +pub const IP_RECVDSTADDR = 25; +pub const IP_IFLIST = 28; +pub const IP_ADD_IFLIST = 29; +pub const IP_DEL_IFLIST = 30; +pub const IP_UNICAST_IF = 31; +pub const IP_RTHDR = 32; +pub const IP_GET_IFLIST = 33; +pub const IP_RECVRTHDR = 38; +pub const IP_TCLASS = 39; +pub const IP_RECVTCLASS = 40; +pub const IP_RECVTOS = 40; +pub const IP_ORIGINAL_ARRIVAL_IF = 47; +pub const IP_ECN = 50; +pub const IP_PKTINFO_EX = 51; +pub const IP_WFP_REDIRECT_RECORDS = 60; +pub const IP_WFP_REDIRECT_CONTEXT = 70; +pub const IP_MTU_DISCOVER = 71; +pub const IP_MTU = 73; +pub const IP_NRT_INTERFACE = 74; +pub const IP_RECVERR = 75; +pub const IP_USER_MTU = 76; +pub const IP_UNSPECIFIED_TYPE_OF_SERVICE = -1; +pub const IN6ADDR_LINKLOCALPREFIX_LENGTH = 64; +pub const IN6ADDR_MULTICASTPREFIX_LENGTH = 8; +pub const IN6ADDR_SOLICITEDNODEMULTICASTPREFIX_LENGTH = 104; +pub const IN6ADDR_V4MAPPEDPREFIX_LENGTH = 96; +pub const IN6ADDR_6TO4PREFIX_LENGTH = 16; +pub const IN6ADDR_TEREDOPREFIX_LENGTH = 32; +pub const MCAST_JOIN_GROUP = 41; +pub const MCAST_LEAVE_GROUP = 42; +pub const MCAST_BLOCK_SOURCE = 43; +pub const MCAST_UNBLOCK_SOURCE = 44; +pub const MCAST_JOIN_SOURCE_GROUP = 45; +pub const MCAST_LEAVE_SOURCE_GROUP = 46; +pub const IPV6_HOPOPTS = 1; +pub const IPV6_HDRINCL = 2; +pub const IPV6_UNICAST_HOPS = 4; +pub const IPV6_MULTICAST_IF = 9; +pub const IPV6_MULTICAST_HOPS = 10; +pub const IPV6_MULTICAST_LOOP = 11; +pub const IPV6_ADD_MEMBERSHIP = 12; +pub const IPV6_DROP_MEMBERSHIP = 13; +pub const IPV6_DONTFRAG = 14; +pub const IPV6_PKTINFO = 19; +pub const IPV6_HOPLIMIT = 21; +pub const IPV6_PROTECTION_LEVEL = 23; +pub const IPV6_RECVIF = 24; +pub const IPV6_RECVDSTADDR = 25; +pub const IPV6_CHECKSUM = 26; +pub const IPV6_V6ONLY = 27; +pub const IPV6_IFLIST = 28; +pub const IPV6_ADD_IFLIST = 29; +pub const IPV6_DEL_IFLIST = 30; +pub const IPV6_UNICAST_IF = 31; +pub const IPV6_RTHDR = 32; +pub const IPV6_GET_IFLIST = 33; +pub const IPV6_RECVRTHDR = 38; +pub const IPV6_TCLASS = 39; +pub const IPV6_RECVTCLASS = 40; +pub const IPV6_ECN = 50; +pub const IPV6_PKTINFO_EX = 51; +pub const IPV6_WFP_REDIRECT_RECORDS = 60; +pub const IPV6_WFP_REDIRECT_CONTEXT = 70; +pub const IPV6_MTU_DISCOVER = 71; +pub const IPV6_MTU = 72; +pub const IPV6_NRT_INTERFACE = 74; +pub const IPV6_RECVERR = 75; +pub const IPV6_USER_MTU = 76; +pub const IP_UNSPECIFIED_HOP_LIMIT = -1; +pub const PROTECTION_LEVEL_UNRESTRICTED = 10; +pub const PROTECTION_LEVEL_EDGERESTRICTED = 20; +pub const PROTECTION_LEVEL_RESTRICTED = 30; +pub const INET_ADDRSTRLEN = 22; +pub const INET6_ADDRSTRLEN = 65; +pub const TCP_OFFLOAD_NO_PREFERENCE = 0; +pub const TCP_OFFLOAD_NOT_PREFERRED = 1; +pub const TCP_OFFLOAD_PREFERRED = 2; +pub const TCP_EXPEDITED_1122 = 2; +pub const TCP_KEEPALIVE = 3; +pub const TCP_MAXSEG = 4; +pub const TCP_MAXRT = 5; +pub const TCP_STDURG = 6; +pub const TCP_NOURG = 7; +pub const TCP_ATMARK = 8; +pub const TCP_NOSYNRETRIES = 9; +pub const TCP_TIMESTAMPS = 10; +pub const TCP_OFFLOAD_PREFERENCE = 11; +pub const TCP_CONGESTION_ALGORITHM = 12; +pub const TCP_DELAY_FIN_ACK = 13; +pub const TCP_MAXRTMS = 14; +pub const TCP_FASTOPEN = 15; +pub const TCP_KEEPCNT = 16; +pub const TCP_KEEPINTVL = 17; +pub const TCP_FAIL_CONNECT_ON_ICMP_ERROR = 18; +pub const TCP_ICMP_ERROR_INFO = 19; +pub const UDP_SEND_MSG_SIZE = 2; +pub const UDP_RECV_MAX_COALESCED_SIZE = 3; +pub const UDP_COALESCED_INFO = 3; +pub const AF_UNSPEC = 0; +pub const AF_UNIX = 1; +pub const AF_INET = 2; +pub const AF_IMPLINK = 3; +pub const AF_PUP = 4; +pub const AF_CHAOS = 5; +pub const AF_NS = 6; +pub const AF_ISO = 7; +pub const AF_ECMA = 8; +pub const AF_DATAKIT = 9; +pub const AF_CCITT = 10; +pub const AF_SNA = 11; +pub const AF_DECnet = 12; +pub const AF_DLI = 13; +pub const AF_LAT = 14; +pub const AF_HYLINK = 15; +pub const AF_APPLETALK = 16; +pub const AF_NETBIOS = 17; +pub const AF_VOICEVIEW = 18; +pub const AF_FIREFOX = 19; +pub const AF_UNKNOWN1 = 20; +pub const AF_BAN = 21; +pub const AF_ATM = 22; +pub const AF_INET6 = 23; +pub const AF_CLUSTER = 24; +pub const AF_12844 = 25; +pub const AF_IRDA = 26; +pub const AF_NETDES = 28; +pub const AF_MAX = 29; +pub const AF_TCNPROCESS = 29; +pub const AF_TCNMESSAGE = 30; +pub const AF_ICLFXBM = 31; +pub const AF_LINK = 33; +pub const AF_HYPERV = 34; +pub const SOCK_STREAM = 1; +pub const SOCK_DGRAM = 2; +pub const SOCK_RAW = 3; +pub const SOCK_RDM = 4; +pub const SOCK_SEQPACKET = 5; +pub const SOL_SOCKET = 65535; +pub const SO_DEBUG = 1; +pub const SO_ACCEPTCONN = 2; +pub const SO_REUSEADDR = 4; +pub const SO_KEEPALIVE = 8; +pub const SO_DONTROUTE = 16; +pub const SO_BROADCAST = 32; +pub const SO_USELOOPBACK = 64; +pub const SO_LINGER = 128; +pub const SO_OOBINLINE = 256; +pub const SO_SNDBUF = 4097; +pub const SO_RCVBUF = 4098; +pub const SO_SNDLOWAT = 4099; +pub const SO_RCVLOWAT = 4100; +pub const SO_SNDTIMEO = 4101; +pub const SO_RCVTIMEO = 4102; +pub const SO_ERROR = 4103; +pub const SO_TYPE = 4104; +pub const SO_BSP_STATE = 4105; +pub const SO_GROUP_ID = 8193; +pub const SO_GROUP_PRIORITY = 8194; +pub const SO_MAX_MSG_SIZE = 8195; +pub const SO_CONDITIONAL_ACCEPT = 12290; +pub const SO_PAUSE_ACCEPT = 12291; +pub const SO_COMPARTMENT_ID = 12292; +pub const SO_RANDOMIZE_PORT = 12293; +pub const SO_PORT_SCALABILITY = 12294; +pub const SO_REUSE_UNICASTPORT = 12295; +pub const SO_REUSE_MULTICASTPORT = 12296; +pub const SO_ORIGINAL_DST = 12303; +pub const WSK_SO_BASE = 16384; +pub const TCP_NODELAY = 1; +pub const IOC_UNIX = 0; +pub const IOC_WS2 = 134217728; +pub const IOC_PROTOCOL = 268435456; +pub const IOC_VENDOR = 402653184; +pub const SIO_BSP_HANDLE = IOC_OUT | IOC_WS2 | 27; +pub const SIO_BSP_HANDLE_SELECT = IOC_OUT | IOC_WS2 | 28; +pub const SIO_BSP_HANDLE_POLL = IOC_OUT | IOC_WS2 | 29; +pub const SIO_BASE_HANDLE = IOC_OUT | IOC_WS2 | 34; +pub const IPPROTO_IP = 0; +pub const IPPORT_TCPMUX = 1; +pub const IPPORT_ECHO = 7; +pub const IPPORT_DISCARD = 9; +pub const IPPORT_SYSTAT = 11; +pub const IPPORT_DAYTIME = 13; +pub const IPPORT_NETSTAT = 15; +pub const IPPORT_QOTD = 17; +pub const IPPORT_MSP = 18; +pub const IPPORT_CHARGEN = 19; +pub const IPPORT_FTP_DATA = 20; +pub const IPPORT_FTP = 21; +pub const IPPORT_TELNET = 23; +pub const IPPORT_SMTP = 25; +pub const IPPORT_TIMESERVER = 37; +pub const IPPORT_NAMESERVER = 42; +pub const IPPORT_WHOIS = 43; +pub const IPPORT_MTP = 57; +pub const IPPORT_TFTP = 69; +pub const IPPORT_RJE = 77; +pub const IPPORT_FINGER = 79; +pub const IPPORT_TTYLINK = 87; +pub const IPPORT_SUPDUP = 95; +pub const IPPORT_POP3 = 110; +pub const IPPORT_NTP = 123; +pub const IPPORT_EPMAP = 135; +pub const IPPORT_NETBIOS_NS = 137; +pub const IPPORT_NETBIOS_DGM = 138; +pub const IPPORT_NETBIOS_SSN = 139; +pub const IPPORT_IMAP = 143; +pub const IPPORT_SNMP = 161; +pub const IPPORT_SNMP_TRAP = 162; +pub const IPPORT_IMAP3 = 220; +pub const IPPORT_LDAP = 389; +pub const IPPORT_HTTPS = 443; +pub const IPPORT_MICROSOFT_DS = 445; +pub const IPPORT_EXECSERVER = 512; +pub const IPPORT_LOGINSERVER = 513; +pub const IPPORT_CMDSERVER = 514; +pub const IPPORT_EFSSERVER = 520; +pub const IPPORT_BIFFUDP = 512; +pub const IPPORT_WHOSERVER = 513; +pub const IPPORT_ROUTESERVER = 520; +pub const IPPORT_RESERVED = 1024; +pub const IPPORT_REGISTERED_MAX = 49151; +pub const IPPORT_DYNAMIC_MIN = 49152; +pub const IPPORT_DYNAMIC_MAX = 65535; +pub const IN_CLASSA_NET = 4278190080; +pub const IN_CLASSA_NSHIFT = 24; +pub const IN_CLASSA_HOST = 16777215; +pub const IN_CLASSA_MAX = 128; +pub const IN_CLASSB_NET = 4294901760; +pub const IN_CLASSB_NSHIFT = 16; +pub const IN_CLASSB_HOST = 65535; +pub const IN_CLASSB_MAX = 65536; +pub const IN_CLASSC_NET = 4294967040; +pub const IN_CLASSC_NSHIFT = 8; +pub const IN_CLASSC_HOST = 255; +pub const IN_CLASSD_NET = 4026531840; +pub const IN_CLASSD_NSHIFT = 28; +pub const IN_CLASSD_HOST = 268435455; +pub const INADDR_LOOPBACK = 2130706433; +pub const INADDR_NONE = 4294967295; +pub const IOCPARM_MASK = 127; +pub const IOC_VOID = 536870912; +pub const IOC_OUT = 1073741824; +pub const IOC_IN = 2147483648; +pub const MSG_TRUNC = 256; +pub const MSG_CTRUNC = 512; +pub const MSG_BCAST = 1024; +pub const MSG_MCAST = 2048; +pub const MSG_ERRQUEUE = 4096; +pub const AI_PASSIVE = 1; +pub const AI_CANONNAME = 2; +pub const AI_NUMERICHOST = 4; +pub const AI_NUMERICSERV = 8; +pub const AI_DNS_ONLY = 16; +pub const AI_ALL = 256; +pub const AI_ADDRCONFIG = 1024; +pub const AI_V4MAPPED = 2048; +pub const AI_NON_AUTHORITATIVE = 16384; +pub const AI_SECURE = 32768; +pub const AI_RETURN_PREFERRED_NAMES = 65536; +pub const AI_FQDN = 131072; +pub const AI_FILESERVER = 262144; +pub const AI_DISABLE_IDN_ENCODING = 524288; +pub const AI_EXTENDED = 2147483648; +pub const AI_RESOLUTION_HANDLE = 1073741824; +pub const ADDRINFOEX_VERSION_2 = 2; +pub const ADDRINFOEX_VERSION_3 = 3; +pub const ADDRINFOEX_VERSION_4 = 4; +pub const NS_ALL = 0; +pub const NS_SAP = 1; +pub const NS_NDS = 2; +pub const NS_PEER_BROWSE = 3; +pub const NS_SLP = 5; +pub const NS_DHCP = 6; +pub const NS_TCPIP_LOCAL = 10; +pub const NS_TCPIP_HOSTS = 11; +pub const NS_DNS = 12; +pub const NS_NETBT = 13; +pub const NS_WINS = 14; +pub const NS_NLA = 15; +pub const NS_NBP = 20; +pub const NS_MS = 30; +pub const NS_STDA = 31; +pub const NS_NTDS = 32; +pub const NS_EMAIL = 37; +pub const NS_X500 = 40; +pub const NS_NIS = 41; +pub const NS_NISPLUS = 42; +pub const NS_WRQ = 50; +pub const NS_NETDES = 60; +pub const NI_NOFQDN = 1; +pub const NI_NUMERICHOST = 2; +pub const NI_NAMEREQD = 4; +pub const NI_NUMERICSERV = 8; +pub const NI_DGRAM = 16; +pub const NI_MAXHOST = 1025; +pub const NI_MAXSERV = 32; +pub const INCL_WINSOCK_API_PROTOTYPES = 1; +pub const INCL_WINSOCK_API_TYPEDEFS = 0; +pub const FD_SETSIZE = 64; +pub const IMPLINK_IP = 155; +pub const IMPLINK_LOWEXPER = 156; +pub const IMPLINK_HIGHEXPER = 158; +pub const WSADESCRIPTION_LEN = 256; +pub const WSASYS_STATUS_LEN = 128; +pub const SOCKET_ERROR = -1; +pub const FROM_PROTOCOL_INFO = -1; +pub const SO_PROTOCOL_INFOA = 8196; +pub const SO_PROTOCOL_INFOW = 8197; +pub const PVD_CONFIG = 12289; +pub const SOMAXCONN = 2147483647; +pub const MSG_PEEK = 2; +pub const MSG_WAITALL = 8; +pub const MSG_PUSH_IMMEDIATE = 32; +pub const MSG_PARTIAL = 32768; +pub const MSG_INTERRUPT = 16; +pub const MSG_MAXIOVLEN = 16; +pub const MAXGETHOSTSTRUCT = 1024; +pub const FD_READ_BIT = 0; +pub const FD_WRITE_BIT = 1; +pub const FD_OOB_BIT = 2; +pub const FD_ACCEPT_BIT = 3; +pub const FD_CONNECT_BIT = 4; +pub const FD_CLOSE_BIT = 5; +pub const FD_QOS_BIT = 6; +pub const FD_GROUP_QOS_BIT = 7; +pub const FD_ROUTING_INTERFACE_CHANGE_BIT = 8; +pub const FD_ADDRESS_LIST_CHANGE_BIT = 9; +pub const FD_MAX_EVENTS = 10; +pub const CF_ACCEPT = 0; +pub const CF_REJECT = 1; +pub const CF_DEFER = 2; +pub const SD_RECEIVE = 0; +pub const SD_SEND = 1; +pub const SD_BOTH = 2; +pub const SG_UNCONSTRAINED_GROUP = 1; +pub const SG_CONSTRAINED_GROUP = 2; +pub const MAX_PROTOCOL_CHAIN = 7; +pub const BASE_PROTOCOL = 1; +pub const LAYERED_PROTOCOL = 0; +pub const WSAPROTOCOL_LEN = 255; +pub const PFL_MULTIPLE_PROTO_ENTRIES = 1; +pub const PFL_RECOMMENDED_PROTO_ENTRY = 2; +pub const PFL_HIDDEN = 4; +pub const PFL_MATCHES_PROTOCOL_ZERO = 8; +pub const PFL_NETWORKDIRECT_PROVIDER = 16; +pub const XP1_CONNECTIONLESS = 1; +pub const XP1_GUARANTEED_DELIVERY = 2; +pub const XP1_GUARANTEED_ORDER = 4; +pub const XP1_MESSAGE_ORIENTED = 8; +pub const XP1_PSEUDO_STREAM = 16; +pub const XP1_GRACEFUL_CLOSE = 32; +pub const XP1_EXPEDITED_DATA = 64; +pub const XP1_CONNECT_DATA = 128; +pub const XP1_DISCONNECT_DATA = 256; +pub const XP1_SUPPORT_BROADCAST = 512; +pub const XP1_SUPPORT_MULTIPOINT = 1024; +pub const XP1_MULTIPOINT_CONTROL_PLANE = 2048; +pub const XP1_MULTIPOINT_DATA_PLANE = 4096; +pub const XP1_QOS_SUPPORTED = 8192; +pub const XP1_INTERRUPT = 16384; +pub const XP1_UNI_SEND = 32768; +pub const XP1_UNI_RECV = 65536; +pub const XP1_IFS_HANDLES = 131072; +pub const XP1_PARTIAL_MESSAGE = 262144; +pub const XP1_SAN_SUPPORT_SDP = 524288; +pub const BIGENDIAN = 0; +pub const LITTLEENDIAN = 1; +pub const SECURITY_PROTOCOL_NONE = 0; +pub const JL_SENDER_ONLY = 1; +pub const JL_RECEIVER_ONLY = 2; +pub const JL_BOTH = 4; +pub const WSA_FLAG_OVERLAPPED = 1; +pub const WSA_FLAG_MULTIPOINT_C_ROOT = 2; +pub const WSA_FLAG_MULTIPOINT_C_LEAF = 4; +pub const WSA_FLAG_MULTIPOINT_D_ROOT = 8; +pub const WSA_FLAG_MULTIPOINT_D_LEAF = 16; +pub const WSA_FLAG_ACCESS_SYSTEM_SECURITY = 64; +pub const WSA_FLAG_NO_HANDLE_INHERIT = 128; +pub const WSA_FLAG_REGISTERED_IO = 256; +pub const TH_NETDEV = 1; +pub const TH_TAPI = 2; +pub const SERVICE_MULTIPLE = 1; +pub const NS_LOCALNAME = 19; +pub const RES_UNUSED_1 = 1; +pub const RES_FLUSH_CACHE = 2; +pub const RES_SERVICE = 4; +pub const LUP_DEEP = 1; +pub const LUP_CONTAINERS = 2; +pub const LUP_NOCONTAINERS = 4; +pub const LUP_NEAREST = 8; +pub const LUP_RETURN_NAME = 16; +pub const LUP_RETURN_TYPE = 32; +pub const LUP_RETURN_VERSION = 64; +pub const LUP_RETURN_COMMENT = 128; +pub const LUP_RETURN_ADDR = 256; +pub const LUP_RETURN_BLOB = 512; +pub const LUP_RETURN_ALIASES = 1024; +pub const LUP_RETURN_QUERY_STRING = 2048; +pub const LUP_RETURN_ALL = 4080; +pub const LUP_RES_SERVICE = 32768; +pub const LUP_FLUSHCACHE = 4096; +pub const LUP_FLUSHPREVIOUS = 8192; +pub const LUP_NON_AUTHORITATIVE = 16384; +pub const LUP_SECURE = 32768; +pub const LUP_RETURN_PREFERRED_NAMES = 65536; +pub const LUP_DNS_ONLY = 131072; +pub const LUP_ADDRCONFIG = 1048576; +pub const LUP_DUAL_ADDR = 2097152; +pub const LUP_FILESERVER = 4194304; +pub const LUP_DISABLE_IDN_ENCODING = 8388608; +pub const LUP_API_ANSI = 16777216; +pub const LUP_RESOLUTION_HANDLE = 2147483648; +pub const RESULT_IS_ALIAS = 1; +pub const RESULT_IS_ADDED = 16; +pub const RESULT_IS_CHANGED = 32; +pub const RESULT_IS_DELETED = 64; +pub const POLLRDNORM = 256; +pub const POLLRDBAND = 512; +pub const POLLPRI = 1024; +pub const POLLWRNORM = 16; +pub const POLLWRBAND = 32; +pub const POLLERR = 1; +pub const POLLHUP = 2; +pub const POLLNVAL = 4; +pub const SO_CONNDATA = 28672; +pub const SO_CONNOPT = 28673; +pub const SO_DISCDATA = 28674; +pub const SO_DISCOPT = 28675; +pub const SO_CONNDATALEN = 28676; +pub const SO_CONNOPTLEN = 28677; +pub const SO_DISCDATALEN = 28678; +pub const SO_DISCOPTLEN = 28679; +pub const SO_OPENTYPE = 28680; +pub const SO_SYNCHRONOUS_ALERT = 16; +pub const SO_SYNCHRONOUS_NONALERT = 32; +pub const SO_MAXDG = 28681; +pub const SO_MAXPATHDG = 28682; +pub const SO_UPDATE_ACCEPT_CONTEXT = 28683; +pub const SO_CONNECT_TIME = 28684; +pub const SO_UPDATE_CONNECT_CONTEXT = 28688; +pub const TCP_BSDURGENT = 28672; +pub const TF_DISCONNECT = 1; +pub const TF_REUSE_SOCKET = 2; +pub const TF_WRITE_BEHIND = 4; +pub const TF_USE_DEFAULT_WORKER = 0; +pub const TF_USE_SYSTEM_THREAD = 16; +pub const TF_USE_KERNEL_APC = 32; +pub const TP_ELEMENT_MEMORY = 1; +pub const TP_ELEMENT_FILE = 2; +pub const TP_ELEMENT_EOP = 4; +pub const NLA_ALLUSERS_NETWORK = 1; +pub const NLA_FRIENDLY_NAME = 2; +pub const WSPDESCRIPTION_LEN = 255; +pub const WSS_OPERATION_IN_PROGRESS = 259; +pub const LSP_SYSTEM = 2147483648; +pub const LSP_INSPECTOR = 1; +pub const LSP_REDIRECTOR = 2; +pub const LSP_PROXY = 4; +pub const LSP_FIREWALL = 8; +pub const LSP_INBOUND_MODIFY = 16; +pub const LSP_OUTBOUND_MODIFY = 32; +pub const LSP_CRYPTO_COMPRESS = 64; +pub const LSP_LOCAL_CACHE = 128; +pub const IPPROTO_ICMP = 1; +pub const IPPROTO_IGMP = 2; +pub const IPPROTO_GGP = 3; +pub const IPPROTO_TCP = 6; +pub const IPPROTO_PUP = 12; +pub const IPPROTO_UDP = 17; +pub const IPPROTO_IDP = 22; +pub const IPPROTO_ND = 77; +pub const IPPROTO_RAW = 255; +pub const IPPROTO_MAX = 256; +pub const IP_DEFAULT_MULTICAST_TTL = 1; +pub const IP_DEFAULT_MULTICAST_LOOP = 1; +pub const IP_MAX_MEMBERSHIPS = 20; +pub const AF_IPX = 6; +pub const FD_READ = 1; +pub const FD_WRITE = 2; +pub const FD_OOB = 4; +pub const FD_ACCEPT = 8; +pub const FD_CONNECT = 16; +pub const FD_CLOSE = 32; +pub const SERVICE_RESOURCE = 1; +pub const SERVICE_SERVICE = 2; +pub const SERVICE_LOCAL = 4; +pub const SERVICE_FLAG_DEFER = 1; +pub const SERVICE_FLAG_HARD = 2; +pub const PROP_COMMENT = 1; +pub const PROP_LOCALE = 2; +pub const PROP_DISPLAY_HINT = 4; +pub const PROP_VERSION = 8; +pub const PROP_START_TIME = 16; +pub const PROP_MACHINE = 32; +pub const PROP_ADDRESSES = 256; +pub const PROP_SD = 512; +pub const PROP_ALL = 2147483648; +pub const SERVICE_ADDRESS_FLAG_RPC_CN = 1; +pub const SERVICE_ADDRESS_FLAG_RPC_DG = 2; +pub const SERVICE_ADDRESS_FLAG_RPC_NB = 4; +pub const NS_DEFAULT = 0; +pub const NS_VNS = 50; +pub const NSTYPE_HIERARCHICAL = 1; +pub const NSTYPE_DYNAMIC = 2; +pub const NSTYPE_ENUMERABLE = 4; +pub const NSTYPE_WORKGROUP = 8; +pub const XP_CONNECTIONLESS = 1; +pub const XP_GUARANTEED_DELIVERY = 2; +pub const XP_GUARANTEED_ORDER = 4; +pub const XP_MESSAGE_ORIENTED = 8; +pub const XP_PSEUDO_STREAM = 16; +pub const XP_GRACEFUL_CLOSE = 32; +pub const XP_EXPEDITED_DATA = 64; +pub const XP_CONNECT_DATA = 128; +pub const XP_DISCONNECT_DATA = 256; +pub const XP_SUPPORTS_BROADCAST = 512; +pub const XP_SUPPORTS_MULTICAST = 1024; +pub const XP_BANDWIDTH_ALLOCATION = 2048; +pub const XP_FRAGMENTATION = 4096; +pub const XP_ENCRYPTS = 8192; +pub const RES_SOFT_SEARCH = 1; +pub const RES_FIND_MULTIPLE = 2; +pub const SET_SERVICE_PARTIAL_SUCCESS = 1; +pub const UDP_NOCHECKSUM = 1; +pub const UDP_CHECKSUM_COVERAGE = 20; +pub const GAI_STRERROR_BUFFER_SIZE = 1024; pub const LPCONDITIONPROC = fn ( lpCallerId: *WSABUF, @@ -999,7 +1003,7 @@ pub const addrinfoexA = extern struct { ai_addr: *sockaddr, ai_blob: *c_void, ai_bloblen: usize, - ai_provider: *Guid, + ai_provider: *GUID, ai_next: *addrinfoexA, }; @@ -1664,7 +1668,7 @@ pub extern "ws2_32" fn htons( ) callconv(WINAPI) u16; pub extern "ws2_32" fn inet_addr( - cp: [*]const u8, + cp: ?[*]const u8, ) callconv(WINAPI) u32; pub extern "ws2_32" fn listen( @@ -1705,7 +1709,7 @@ pub extern "ws2_32" fn select( ) callconv(WINAPI) i32; pub extern "ws2_32" fn send( - s: SOCKEt, + s: SOCKET, buf: [*]const u8, len: i32, flags: u32, @@ -1750,11 +1754,11 @@ pub extern "ws2_32" fn WSASetLastError(iError: i32) callconv(WINAPI) void; pub extern "ws2_32" fn WSAGetLastError() callconv(WINAPI) WinsockError; -pub extern "ws2_32" fn WSAIsBlocking(WINAPI) BOOL; +pub extern "ws2_32" fn WSAIsBlocking() callconv(WINAPI) BOOL; pub extern "ws2_32" fn WSAUnhookBlockingHook() callconv(WINAPI) i32; -pub extern "ws2_32" fn WSASetBlockingHook(lpBlockFunc: FARPROC) FARPROC; +pub extern "ws2_32" fn WSASetBlockingHook(lpBlockFunc: FARPROC) callconv(WINAPI) FARPROC; pub extern "ws2_32" fn WSACancelBlockingCall() callconv(WINAPI) i32; diff --git a/lib/std/x/net/tcp.zig b/lib/std/x/net/tcp.zig index 13fea01f23..ec20d13388 100644 --- a/lib/std/x/net/tcp.zig +++ b/lib/std/x/net/tcp.zig @@ -150,7 +150,7 @@ pub const Client = struct { /// Read multiple I/O vectors with a prepended message header from the socket /// with a set of flags specified. It returns the number of bytes that were /// read into the buffer provided. - pub fn readVectorized(self: cLIENT, msg: *os.msghdr, flags: u32) !usize { + pub fn readVectorized(self: Client, msg: *os.msghdr, flags: u32) !usize { return self.socket.readVectorized(msg, flags); } diff --git a/lib/std/x/os/socket_posix.zig b/lib/std/x/os/socket_posix.zig index 56f6d53875..904938bfc8 100644 --- a/lib/std/x/os/socket_posix.zig +++ b/lib/std/x/os/socket_posix.zig @@ -59,7 +59,7 @@ pub const Socket = struct { var address_len: u32 = @sizeOf(os.sockaddr_storage); const socket = Socket{ .fd = try os.accept(self.fd, @ptrCast(*os.sockaddr, &address), &address_len, flags) }; - const socket_address = Socket.Address.fromNative(@alignCast(4, @ptrCast(*os.sockaddr, &address))); + const socket_address = Socket.Address.fromNative(@ptrCast(*os.sockaddr, &address)); return Socket.Connection.from(socket, socket_address); } @@ -95,7 +95,7 @@ pub const Socket = struct { var address: os.sockaddr_storage = undefined; var address_len: u32 = @sizeOf(os.sockaddr_storage); try os.getsockname(self.fd, @ptrCast(*os.sockaddr, &address), &address_len); - return Socket.Address.fromNative(@alignCast(4, @ptrCast(*os.sockaddr, &address))); + return Socket.Address.fromNative(@ptrCast(*os.sockaddr, &address)); } /// Query the address that the socket is connected to. @@ -103,7 +103,7 @@ pub const Socket = struct { var address: os.sockaddr_storage = undefined; var address_len: u32 = @sizeOf(os.sockaddr_storage); try os.getpeername(self.fd, @ptrCast(*os.sockaddr, &address), &address_len); - return Socket.Address.fromNative(@alignCast(4, @ptrCast(*os.sockaddr, &address))); + return Socket.Address.fromNative(@ptrCast(*os.sockaddr, &address)); } /// Query and return the latest cached error on the socket. @@ -146,8 +146,8 @@ pub const Socket = struct { } /// Set a socket option. - pub fn setOption(self: Socket, level: u32, name: u32, value: []const u8) !void { - return os.setsockopt(self.fd, level, name, value); + pub fn setOption(self: Socket, level: u32, code: u32, value: []const u8) !void { + return os.setsockopt(self.fd, level, code, value); } /// Have close() or shutdown() syscalls block until all queued messages in the socket have been successfully @@ -208,6 +208,9 @@ pub const Socket = struct { return self.setOption(os.SOL_SOCKET, os.SO_RCVBUF, mem.asBytes(&size)); } + /// WARNING: Timeouts only affect blocking sockets. It is undefined behavior if a timeout is + /// set on a non-blocking socket. + /// /// Set a timeout on the socket that is to occur if no messages are successfully written /// to its bound destination after a specified number of milliseconds. A subsequent write /// to the socket will thereafter return `error.WouldBlock` should the timeout be exceeded. @@ -220,6 +223,9 @@ pub const Socket = struct { return self.setOption(os.SOL_SOCKET, os.SO_SNDTIMEO, mem.asBytes(&timeout)); } + /// WARNING: Timeouts only affect blocking sockets. It is undefined behavior if a timeout is + /// set on a non-blocking socket. + /// /// Set a timeout on the socket that is to occur if no messages are successfully read /// from its bound destination after a specified number of milliseconds. A subsequent /// read from the socket will thereafter return `error.WouldBlock` should the timeout be diff --git a/lib/std/x/os/socket_windows.zig b/lib/std/x/os/socket_windows.zig index bc9d9de0e6..8a0c9b43ce 100644 --- a/lib/std/x/os/socket_windows.zig +++ b/lib/std/x/os/socket_windows.zig @@ -24,7 +24,7 @@ pub const Socket = struct { pub fn init(domain: u32, socket_type: u32, protocol: u32) !Socket { var filtered_socket_type = socket_type & ~@as(u32, os.SOCK_CLOEXEC); - var filtered_flags = ws2_32.WSA_FLAG_OVERLAPPED; + var filtered_flags: u32 = ws2_32.WSA_FLAG_OVERLAPPED; if (socket_type & os.SOCK_CLOEXEC != 0) { filtered_flags |= ws2_32.WSA_FLAG_NO_HANDLE_INHERIT; } @@ -169,7 +169,7 @@ pub const Socket = struct { } const socket = Socket.from(rc); - const socket_address = Socket.Address.fromNative(@alignCast(4, @ptrCast(*ws2_32.sockaddr, &address))); + const socket_address = Socket.Address.fromNative(@ptrCast(*ws2_32.sockaddr, &address)); return Socket.Connection.from(socket, socket_address); } @@ -275,7 +275,7 @@ pub const Socket = struct { }; } - return Socket.Address.fromNative(@alignCast(4, @ptrCast(*os.sockaddr, &address))); + return Socket.Address.fromNative(@ptrCast(*os.sockaddr, &address)); } /// Query the address that the socket is connected to. @@ -295,7 +295,7 @@ pub const Socket = struct { }; } - return Socket.Address.fromNative(@alignCast(4, @ptrCast(*os.sockaddr, &address))); + return Socket.Address.fromNative(@ptrCast(*os.sockaddr, &address)); } /// Query and return the latest cached error on the socket. @@ -314,8 +314,8 @@ pub const Socket = struct { } /// Set a socket option. - pub fn setOption(self: Socket, level: u32, name: u32, value: []const u8) !void { - const rc = ws2_32.setsockopt(self.fd, @intCast(i32, level), @intCast(i32, name), value.ptr, @intCast(i32, value.len)); + pub fn setOption(self: Socket, level: u32, code: u32, value: []const u8) !void { + const rc = ws2_32.setsockopt(self.fd, @intCast(i32, level), @intCast(i32, code), value.ptr, @intCast(i32, value.len)); if (rc == ws2_32.SOCKET_ERROR) { return switch (ws2_32.WSAGetLastError()) { .WSANOTINITIALISED => unreachable, @@ -375,6 +375,9 @@ pub const Socket = struct { return self.setOption(ws2_32.SOL_SOCKET, ws2_32.SO_RCVBUF, mem.asBytes(&size)); } + /// WARNING: Timeouts only affect blocking sockets. It is undefined behavior if a timeout is + /// set on a non-blocking socket. + /// /// Set a timeout on the socket that is to occur if no messages are successfully written /// to its bound destination after a specified number of milliseconds. A subsequent write /// to the socket will thereafter return `error.WouldBlock` should the timeout be exceeded. @@ -382,6 +385,9 @@ pub const Socket = struct { return self.setOption(ws2_32.SOL_SOCKET, ws2_32.SO_SNDTIMEO, mem.asBytes(&milliseconds)); } + /// WARNING: Timeouts only affect blocking sockets. It is undefined behavior if a timeout is + /// set on a non-blocking socket. + /// /// Set a timeout on the socket that is to occur if no messages are successfully read /// from its bound destination after a specified number of milliseconds. A subsequent /// read from the socket will thereafter return `error.WouldBlock` should the timeout be