跳转到内容

std.os.windows.ws2_32

标准库Zig 0.17.0官方原文
源码std/os/windows/ws2_32.zig

第 1 行

std.os.windows.ws2_32.ADDRESS_FAMILY

类型

第 9 行

std.os.windows.ws2_32.AF

命名空间

第 40 行

std.os.windows.ws2_32.AF.@"12844"

常量

第 67 行

std.os.windows.ws2_32.AF.APPLETALK

常量

第 58 行

std.os.windows.ws2_32.AF.ATM

常量

第 64 行

std.os.windows.ws2_32.AF.BAN

常量

第 63 行

std.os.windows.ws2_32.AF.BTH

常量

第 74 行

std.os.windows.ws2_32.AF.CCITT

常量

第 52 行

std.os.windows.ws2_32.AF.CHAOS

常量

第 46 行

std.os.windows.ws2_32.AF.CLUSTER

常量

第 66 行

std.os.windows.ws2_32.AF.DATAKIT

常量

第 51 行

std.os.windows.ws2_32.AF.DECnet

常量

第 54 行

std.os.windows.ws2_32.AF.DLI

常量

第 55 行

std.os.windows.ws2_32.AF.ECMA

常量

第 50 行

std.os.windows.ws2_32.AF.FIREFOX

常量

第 61 行

std.os.windows.ws2_32.AF.HYLINK

常量

第 57 行

std.os.windows.ws2_32.AF.HYPERV

常量

第 76 行

std.os.windows.ws2_32.AF.ICLFXBM

常量

第 73 行

std.os.windows.ws2_32.AF.IMPLINK

常量

第 44 行

std.os.windows.ws2_32.AF.INET

常量

第 43 行

std.os.windows.ws2_32.AF.INET6

常量

第 65 行

std.os.windows.ws2_32.AF.IPX

常量

第 48 行

std.os.windows.ws2_32.AF.IRDA

常量

第 68 行

std.os.windows.ws2_32.AF.ISO

常量

第 49 行

std.os.windows.ws2_32.AF.LAT

常量

第 56 行

std.os.windows.ws2_32.AF.LINK

常量

第 75 行

std.os.windows.ws2_32.AF.MAX

常量

第 70 行

std.os.windows.ws2_32.AF.NETBIOS

常量

第 59 行

std.os.windows.ws2_32.AF.NETDES

常量

第 69 行

std.os.windows.ws2_32.AF.NS

常量

第 47 行

std.os.windows.ws2_32.AF.PUP

常量

第 45 行

std.os.windows.ws2_32.AF.SNA

常量

第 53 行

std.os.windows.ws2_32.AF.TCNMESSAGE

常量

第 72 行

std.os.windows.ws2_32.AF.TCNPROCESS

常量

第 71 行

std.os.windows.ws2_32.AF.UNIX

常量

第 42 行

std.os.windows.ws2_32.AF.UNKNOWN1

常量

第 62 行

std.os.windows.ws2_32.AF.UNSPEC

常量

第 41 行

std.os.windows.ws2_32.AF.VOICEVIEW

常量

第 60 行

std.os.windows.ws2_32.assert

别名

第 2 行

别名目标 std.debug.assert

std.os.windows.ws2_32.FLOWSPEC

容器

第 177 行

字段

TokenRate: u32
TokenBucketSize: u32
PeakBandwidth: u32
Latency: u32
DelayVariation: u32
ServiceType: u32
MaxSduSize: u32
MinimumPolicedSize: u32

std.os.windows.ws2_32.GROUP

类型

第 8 行

std.os.windows.ws2_32.hostent

容器

第 237 行

字段

h_name: [*]u8
h_aliases: **i8
h_addrtype: i16
h_length: i16
h_addr_list: **i8

std.os.windows.ws2_32.IPPROTO

命名空间

第 162 行

std.os.windows.ws2_32.IPPROTO.GGP

常量

第 166 行

std.os.windows.ws2_32.IPPROTO.ICMP

常量

第 164 行

std.os.windows.ws2_32.IPPROTO.IDP

常量

第 170 行

std.os.windows.ws2_32.IPPROTO.IGMP

常量

第 165 行

std.os.windows.ws2_32.IPPROTO.IP

常量

第 163 行

std.os.windows.ws2_32.IPPROTO.MAX

常量

第 174 行

std.os.windows.ws2_32.IPPROTO.ND

常量

第 171 行

std.os.windows.ws2_32.IPPROTO.PUP

常量

第 168 行

std.os.windows.ws2_32.IPPROTO.RAW

常量

第 173 行

std.os.windows.ws2_32.IPPROTO.RM

常量

第 172 行

std.os.windows.ws2_32.IPPROTO.TCP

常量

第 167 行

std.os.windows.ws2_32.IPPROTO.UDP

常量

第 169 行

std.os.windows.ws2_32.linger

容器

第 193 行

字段

onoff: u16
linger: u16

std.os.windows.ws2_32.LONG

别名

第 6 行

别名目标 std.os.windows.LONG

std.os.windows.ws2_32.MSG

命名空间

第 144 行

std.os.windows.ws2_32.MSG.BCAST

常量

第 154 行

std.os.windows.ws2_32.MSG.CTRUNC

常量

第 153 行

std.os.windows.ws2_32.MSG.DONTROUTE

常量

第 147 行

std.os.windows.ws2_32.MSG.INTERRUPT

常量

第 149 行

std.os.windows.ws2_32.MSG.MAXIOVLEN

常量

第 159 行

std.os.windows.ws2_32.MSG.MCAST

常量

第 155 行

std.os.windows.ws2_32.MSG.OOB

常量

第 145 行

std.os.windows.ws2_32.MSG.PARTIAL

常量

第 157 行

std.os.windows.ws2_32.MSG.PEEK

常量

第 146 行

std.os.windows.ws2_32.MSG.PUSH_IMMEDIATE

常量

第 150 行

std.os.windows.ws2_32.MSG.TRUNC

常量

第 152 行

std.os.windows.ws2_32.MSG.WAITALL

常量

第 148 行

std.os.windows.ws2_32.SO

命名空间

第 92 行

std.os.windows.ws2_32.SO.ACCEPTCONN

常量

第 94 行

std.os.windows.ws2_32.SO.BROADCAST

常量

第 98 行

std.os.windows.ws2_32.SO.BSP_STATE

常量

第 110 行

std.os.windows.ws2_32.SO.COMPARTMENT_ID

常量

第 116 行

std.os.windows.ws2_32.SO.CONDITIONAL_ACCEPT

常量

第 114 行

std.os.windows.ws2_32.SO.CONNDATA

常量

第 124 行

std.os.windows.ws2_32.SO.CONNDATALEN

常量

第 128 行

std.os.windows.ws2_32.SO.CONNECT_TIME

常量

第 138 行

std.os.windows.ws2_32.SO.CONNOPT

常量

第 125 行

std.os.windows.ws2_32.SO.CONNOPTLEN

常量

第 129 行

std.os.windows.ws2_32.SO.DEBUG

常量

第 93 行

std.os.windows.ws2_32.SO.DISCDATA

常量

第 126 行

std.os.windows.ws2_32.SO.DISCDATALEN

常量

第 130 行

std.os.windows.ws2_32.SO.DISCOPT

常量

第 127 行

std.os.windows.ws2_32.SO.DISCOPTLEN

常量

第 131 行

std.os.windows.ws2_32.SO.DONTROUTE

常量

第 97 行

std.os.windows.ws2_32.SO.ERROR

常量

第 108 行

std.os.windows.ws2_32.SO.GROUP_ID

常量

第 111 行

std.os.windows.ws2_32.SO.GROUP_PRIORITY

常量

第 112 行

std.os.windows.ws2_32.SO.KEEPALIVE

常量

第 96 行

std.os.windows.ws2_32.SO.LINGER

常量

第 100 行

std.os.windows.ws2_32.SO.MAX_MSG_SIZE

常量

第 113 行

std.os.windows.ws2_32.SO.MAXDG

常量

第 135 行

std.os.windows.ws2_32.SO.MAXPATHDG

常量

第 136 行

std.os.windows.ws2_32.SO.OOBINLINE

常量

第 101 行

std.os.windows.ws2_32.SO.OPENTYPE

常量

第 132 行

std.os.windows.ws2_32.SO.ORIGINAL_DST

常量

第 121 行

std.os.windows.ws2_32.SO.PAUSE_ACCEPT

常量

第 115 行

std.os.windows.ws2_32.SO.PORT_SCALABILITY

常量

第 118 行

std.os.windows.ws2_32.SO.PROTOCOL_INFOA

常量

第 122 行

std.os.windows.ws2_32.SO.PROTOCOL_INFOW

常量

第 123 行

std.os.windows.ws2_32.SO.RANDOMIZE_PORT

常量

第 117 行

std.os.windows.ws2_32.SO.RCVBUF

常量

第 103 行

std.os.windows.ws2_32.SO.RCVLOWAT

常量

第 105 行

std.os.windows.ws2_32.SO.RCVTIMEO

常量

第 107 行

std.os.windows.ws2_32.SO.REUSE_MULTICASTPORT

常量

第 120 行

std.os.windows.ws2_32.SO.REUSE_UNICASTPORT

常量

第 119 行

std.os.windows.ws2_32.SO.REUSEADDR

常量

第 95 行

std.os.windows.ws2_32.SO.SNDBUF

常量

第 102 行

std.os.windows.ws2_32.SO.SNDLOWAT

常量

第 104 行

std.os.windows.ws2_32.SO.SNDTIMEO

常量

第 106 行

std.os.windows.ws2_32.SO.SYNCHRONOUS_ALERT

常量

第 133 行

std.os.windows.ws2_32.SO.SYNCHRONOUS_NONALERT

常量

第 134 行

std.os.windows.ws2_32.SO.TYPE

常量

第 109 行

std.os.windows.ws2_32.SO.UNIX_PATH

常量

第 141 行

std.os.windows.ws2_32.SO.UPDATE_ACCEPT_CONTEXT

常量

第 137 行

std.os.windows.ws2_32.SO.UPDATE_CONNECT_CONTEXT

常量

第 139 行

std.os.windows.ws2_32.SO.USELOOPBACK

常量

第 99 行

std.os.windows.ws2_32.SOCK

命名空间

第 79 行

std.os.windows.ws2_32.SOCK.DGRAM

常量

第 81 行

std.os.windows.ws2_32.SOCK.RAW

常量

第 82 行

std.os.windows.ws2_32.SOCK.RDM

常量

第 83 行

std.os.windows.ws2_32.SOCK.SEQPACKET

常量

第 84 行

std.os.windows.ws2_32.SOCK.STREAM

常量

第 80 行

std.os.windows.ws2_32.sockaddr

容器

第 198 行

字段

family: ADDRESS_FAMILY
data: [14]u8

std.os.windows.ws2_32.sockaddr.in

容器

第 214 行

IPv4 套接字地址

字段

family: ADDRESS_FAMILY = AF.INET
port: USHORT
addr: u32
zero: [8]u8 = [8]u8{ 0, 0, 0, 0, 0, 0, 0, 0 }

std.os.windows.ws2_32.sockaddr.in6

容器

第 222 行

IPv6 套接字地址

字段

family: ADDRESS_FAMILY = AF.INET6
port: USHORT
flowinfo: u32
addr: [16]u8
scope_id: u32

std.os.windows.ws2_32.sockaddr.SS_MAXSIZE

常量

第 202 行

std.os.windows.ws2_32.sockaddr.storage

容器

第 203 行

字段

family: ADDRESS_FAMILY align(8)
padding: [SS_MAXSIZE - @sizeOf(ADDRESS_FAMILY)]u8 = undefined

std.os.windows.ws2_32.sockaddr.un

容器

第 231 行

UNIX 域套接字地址

字段

family: ADDRESS_FAMILY = AF.UNIX
path: [108]u8

std.os.windows.ws2_32.socklen_t

类型

第 12 行

std.os.windows.ws2_32.sockproto

容器

第 188 行

字段

sp_family: u16
sp_protocol: u16

std.os.windows.ws2_32.SOL

命名空间

第 87 行

std.os.windows.ws2_32.SOL.IRLMP

常量

第 88 行

std.os.windows.ws2_32.SOL.SOCKET

常量

第 89 行

std.os.windows.ws2_32.std

别名

第 1 行

别名目标 std

std.os.windows.ws2_32.TCP

命名空间

第 14 行

std.os.windows.ws2_32.TCP.ATMARK

常量

第 25 行

std.os.windows.ws2_32.TCP.BSDURGENT

常量

第 37 行

std.os.windows.ws2_32.TCP.CONGESTION_ALGORITHM

常量

第 29 行

std.os.windows.ws2_32.TCP.DELAY_FIN_ACK

常量

第 30 行

std.os.windows.ws2_32.TCP.EXPEDITED_1122

常量

第 16 行

std.os.windows.ws2_32.TCP.FAIL_CONNECT_ON_ICMP_ERROR

常量

第 35 行

std.os.windows.ws2_32.TCP.FASTOPEN

常量

第 32 行

std.os.windows.ws2_32.TCP.ICMP_ERROR_INFO

常量

第 36 行

std.os.windows.ws2_32.TCP.KEEPALIVE

常量

第 20 行

std.os.windows.ws2_32.TCP.KEEPCNT

常量

第 33 行

std.os.windows.ws2_32.TCP.KEEPINTVL

常量

第 34 行

std.os.windows.ws2_32.TCP.MAXRT

常量

第 22 行

std.os.windows.ws2_32.TCP.MAXRTMS

常量

第 31 行

std.os.windows.ws2_32.TCP.MAXSEG

常量

第 21 行

std.os.windows.ws2_32.TCP.NODELAY

常量

第 15 行

std.os.windows.ws2_32.TCP.NOSYNRETRIES

常量

第 26 行

std.os.windows.ws2_32.TCP.NOURG

常量

第 24 行

std.os.windows.ws2_32.TCP.OFFLOAD_NO_PREFERENCE

常量

第 17 行

std.os.windows.ws2_32.TCP.OFFLOAD_NOT_PREFERRED

常量

第 18 行

std.os.windows.ws2_32.TCP.OFFLOAD_PREFERENCE

常量

第 28 行

std.os.windows.ws2_32.TCP.OFFLOAD_PREFERRED

常量

第 19 行

std.os.windows.ws2_32.TCP.STDURG

常量

第 23 行

std.os.windows.ws2_32.TCP.TIMESTAMPS

常量

第 27 行

std.os.windows.ws2_32.timeval

容器

第 245 行

字段

sec: LONG
usec: LONG

std.os.windows.ws2_32.USHORT

别名

第 5 行

别名目标 std.os.windows.USHORT

std.os.windows.ws2_32.windows

别名

第 3 行

别名目标 std.os.windows

源码

std/os/windows/ws2_32.zig

const std = @import("../../std.zig");
const assert = std.debug.assert;
const windows = std.os.windows;

const USHORT = windows.USHORT;
const LONG = windows.LONG;

pub const GROUP = u32;
pub const ADDRESS_FAMILY = u16;

// Microsoft 对此使用有符号 c_int,但其值永远不应为负
pub const socklen_t = u32;

pub const TCP = struct {
    pub const NODELAY = 1;
    pub const EXPEDITED_1122 = 2;
    pub const OFFLOAD_NO_PREFERENCE = 0;
    pub const OFFLOAD_NOT_PREFERRED = 1;
    pub const OFFLOAD_PREFERRED = 2;
    pub const KEEPALIVE = 3;
    pub const MAXSEG = 4;
    pub const MAXRT = 5;
    pub const STDURG = 6;
    pub const NOURG = 7;
    pub const ATMARK = 8;
    pub const NOSYNRETRIES = 9;
    pub const TIMESTAMPS = 10;
    pub const OFFLOAD_PREFERENCE = 11;
    pub const CONGESTION_ALGORITHM = 12;
    pub const DELAY_FIN_ACK = 13;
    pub const MAXRTMS = 14;
    pub const FASTOPEN = 15;
    pub const KEEPCNT = 16;
    pub const KEEPINTVL = 17;
    pub const FAIL_CONNECT_ON_ICMP_ERROR = 18;
    pub const ICMP_ERROR_INFO = 19;
    pub const BSDURGENT = 28672;
};

pub const AF = struct {
    pub const UNSPEC = 0;
    pub const UNIX = 1;
    pub const INET = 2;
    pub const IMPLINK = 3;
    pub const PUP = 4;
    pub const CHAOS = 5;
    pub const NS = 6;
    pub const IPX = 6;
    pub const ISO = 7;
    pub const ECMA = 8;
    pub const DATAKIT = 9;
    pub const CCITT = 10;
    pub const SNA = 11;
    pub const DECnet = 12;
    pub const DLI = 13;
    pub const LAT = 14;
    pub const HYLINK = 15;
    pub const APPLETALK = 16;
    pub const NETBIOS = 17;
    pub const VOICEVIEW = 18;
    pub const FIREFOX = 19;
    pub const UNKNOWN1 = 20;
    pub const BAN = 21;
    pub const ATM = 22;
    pub const INET6 = 23;
    pub const CLUSTER = 24;
    pub const @"12844" = 25;
    pub const IRDA = 26;
    pub const NETDES = 28;
    pub const MAX = 29;
    pub const TCNPROCESS = 29;
    pub const TCNMESSAGE = 30;
    pub const ICLFXBM = 31;
    pub const BTH = 32;
    pub const LINK = 33;
    pub const HYPERV = 34;
};

pub const SOCK = struct {
    pub const STREAM = 1;
    pub const DGRAM = 2;
    pub const RAW = 3;
    pub const RDM = 4;
    pub const SEQPACKET = 5;
};

pub const SOL = struct {
    pub const IRLMP = 255;
    pub const SOCKET = 65535;
};

pub const SO = struct {
    pub const DEBUG = 1;
    pub const ACCEPTCONN = 2;
    pub const REUSEADDR = 4;
    pub const KEEPALIVE = 8;
    pub const DONTROUTE = 16;
    pub const BROADCAST = 32;
    pub const USELOOPBACK = 64;
    pub const LINGER = 128;
    pub const OOBINLINE = 256;
    pub const SNDBUF = 4097;
    pub const RCVBUF = 4098;
    pub const SNDLOWAT = 4099;
    pub const RCVLOWAT = 4100;
    pub const SNDTIMEO = 4101;
    pub const RCVTIMEO = 4102;
    pub const ERROR = 4103;
    pub const TYPE = 4104;
    pub const BSP_STATE = 4105;
    pub const GROUP_ID = 8193;
    pub const GROUP_PRIORITY = 8194;
    pub const MAX_MSG_SIZE = 8195;
    pub const CONDITIONAL_ACCEPT = 12290;
    pub const PAUSE_ACCEPT = 12291;
    pub const COMPARTMENT_ID = 12292;
    pub const RANDOMIZE_PORT = 12293;
    pub const PORT_SCALABILITY = 12294;
    pub const REUSE_UNICASTPORT = 12295;
    pub const REUSE_MULTICASTPORT = 12296;
    pub const ORIGINAL_DST = 12303;
    pub const PROTOCOL_INFOA = 8196;
    pub const PROTOCOL_INFOW = 8197;
    pub const CONNDATA = 28672;
    pub const CONNOPT = 28673;
    pub const DISCDATA = 28674;
    pub const DISCOPT = 28675;
    pub const CONNDATALEN = 28676;
    pub const CONNOPTLEN = 28677;
    pub const DISCDATALEN = 28678;
    pub const DISCOPTLEN = 28679;
    pub const OPENTYPE = 28680;
    pub const SYNCHRONOUS_ALERT = 16;
    pub const SYNCHRONOUS_NONALERT = 32;
    pub const MAXDG = 28681;
    pub const MAXPATHDG = 28682;
    pub const UPDATE_ACCEPT_CONTEXT = 28683;
    pub const CONNECT_TIME = 28684;
    pub const UPDATE_CONNECT_CONTEXT = 28688;

    pub const UNIX_PATH = 0x98000000;
};

pub const MSG = struct {
    pub const OOB = 0x1;
    pub const PEEK = 0x2;
    pub const DONTROUTE = 0x4;
    pub const WAITALL = 0x8;
    pub const INTERRUPT = 0x10;
    pub const PUSH_IMMEDIATE = 0x20;

    pub const TRUNC = 0x0100;
    pub const CTRUNC = 0x0200;
    pub const BCAST = 0x0400;
    pub const MCAST = 0x0800;

    pub const PARTIAL = 0x8000;

    pub const MAXIOVLEN = 16;
};

pub const IPPROTO = struct {
    pub const IP = 0;
    pub const ICMP = 1;
    pub const IGMP = 2;
    pub const GGP = 3;
    pub const TCP = 6;
    pub const PUP = 12;
    pub const UDP = 17;
    pub const IDP = 22;
    pub const ND = 77;
    pub const RM = 113;
    pub const RAW = 255;
    pub const MAX = 256;
};

pub const FLOWSPEC = extern struct {
    TokenRate: u32,
    TokenBucketSize: u32,
    PeakBandwidth: u32,
    Latency: u32,
    DelayVariation: u32,
    ServiceType: u32,
    MaxSduSize: u32,
    MinimumPolicedSize: u32,
};

pub const sockproto = extern struct {
    sp_family: u16,
    sp_protocol: u16,
};

pub const linger = extern struct {
    onoff: u16,
    linger: u16,
};

pub const sockaddr = extern struct {
    family: ADDRESS_FAMILY,
    data: [14]u8,

    pub const SS_MAXSIZE = 128;
    pub const storage = extern struct {
        family: ADDRESS_FAMILY align(8),
        padding: [SS_MAXSIZE - @sizeOf(ADDRESS_FAMILY)]u8 = undefined,

        comptime {
            assert(@sizeOf(storage) == SS_MAXSIZE);
            assert(@alignOf(storage) == 8);
        }
    };

    /// IPv4 套接字地址
    pub const in = extern struct {
        family: ADDRESS_FAMILY = AF.INET,
        port: USHORT,
        addr: u32,
        zero: [8]u8 = [8]u8{ 0, 0, 0, 0, 0, 0, 0, 0 },
    };

    /// IPv6 套接字地址
    pub const in6 = extern struct {
        family: ADDRESS_FAMILY = AF.INET6,
        port: USHORT,
        flowinfo: u32,
        addr: [16]u8,
        scope_id: u32,
    };

    /// UNIX 域套接字地址
    pub const un = extern struct {
        family: ADDRESS_FAMILY = AF.UNIX,
        path: [108]u8,
    };
};

pub const hostent = extern struct {
    h_name: [*]u8,
    h_aliases: **i8,
    h_addrtype: i16,
    h_length: i16,
    h_addr_list: **i8,
};

pub const timeval = extern struct {
    sec: LONG,
    usec: LONG,
};