|
1 | 1 | // The reference for these types and values is Microsoft Windows's ucrt (Universal C RunTime).
|
2 | 2 |
|
3 | 3 | usingnamespace @import("../windows/bits.zig");
|
| 4 | +const ws2_32 = @import("../windows/ws2_32.zig"); |
4 | 5 |
|
5 | 6 | pub const fd_t = HANDLE;
|
6 | 7 | pub const pid_t = HANDLE;
|
@@ -163,80 +164,63 @@ pub const F_OK = 0;
|
163 | 164 | pub const AT_REMOVEDIR = 0x200;
|
164 | 165 |
|
165 | 166 | pub const in_port_t = u16;
|
166 |
| -pub const sa_family_t = u16; |
| 167 | +pub const sa_family_t = ws2_32.ADDRESS_FAMILY; |
167 | 168 | pub const socklen_t = u32;
|
168 | 169 |
|
169 |
| -pub const sockaddr = extern struct { |
170 |
| - family: sa_family_t, |
171 |
| - data: [14]u8, |
172 |
| -}; |
173 |
| -pub const sockaddr_in = extern struct { |
174 |
| - family: sa_family_t = AF_INET, |
175 |
| - port: in_port_t, |
176 |
| - addr: in_addr, |
177 |
| - zero: [8]u8 = [8]u8{ 0, 0, 0, 0, 0, 0, 0, 0 }, |
178 |
| -}; |
179 |
| -pub const sockaddr_in6 = extern struct { |
180 |
| - family: sa_family_t = AF_INET6, |
181 |
| - port: in_port_t, |
182 |
| - flowinfo: u32, |
183 |
| - addr: in6_addr, |
184 |
| - scope_id: u32, |
185 |
| -}; |
| 170 | +pub const sockaddr = ws2_32.sockaddr; |
| 171 | +pub const sockaddr_in = ws2_32.sockaddr_in; |
| 172 | +pub const sockaddr_in6 = ws2_32.sockaddr_in6; |
| 173 | +pub const sockaddr_un = ws2_32.sockaddr_un; |
| 174 | + |
186 | 175 | pub const in6_addr = [16]u8;
|
187 | 176 | pub const in_addr = u32;
|
188 | 177 |
|
189 |
| -pub const sockaddr_un = extern struct { |
190 |
| - family: sa_family_t = AF_UNIX, |
191 |
| - path: [108]u8, |
192 |
| -}; |
193 |
| - |
194 |
| -pub const AF_UNSPEC = 0; |
195 |
| -pub const AF_UNIX = 1; |
196 |
| -pub const AF_INET = 2; |
197 |
| -pub const AF_IMPLINK = 3; |
198 |
| -pub const AF_PUP = 4; |
199 |
| -pub const AF_CHAOS = 5; |
200 |
| -pub const AF_NS = 6; |
201 |
| -pub const AF_IPX = AF_NS; |
202 |
| -pub const AF_ISO = 7; |
203 |
| -pub const AF_OSI = AF_ISO; |
204 |
| -pub const AF_ECMA = 8; |
205 |
| -pub const AF_DATAKIT = 9; |
206 |
| -pub const AF_CCITT = 10; |
207 |
| -pub const AF_SNA = 11; |
208 |
| -pub const AF_DECnet = 12; |
209 |
| -pub const AF_DLI = 13; |
210 |
| -pub const AF_LAT = 14; |
211 |
| -pub const AF_HYLINK = 15; |
212 |
| -pub const AF_APPLETALK = 16; |
213 |
| -pub const AF_NETBIOS = 17; |
214 |
| -pub const AF_VOICEVIEW = 18; |
215 |
| -pub const AF_FIREFOX = 19; |
216 |
| -pub const AF_UNKNOWN1 = 20; |
217 |
| -pub const AF_BAN = 21; |
218 |
| -pub const AF_ATM = 22; |
219 |
| -pub const AF_INET6 = 23; |
220 |
| -pub const AF_CLUSTER = 24; |
221 |
| -pub const AF_12844 = 25; |
222 |
| -pub const AF_IRDA = 26; |
223 |
| -pub const AF_NETDES = 28; |
224 |
| -pub const AF_TCNPROCESS = 29; |
225 |
| -pub const AF_TCNMESSAGE = 30; |
226 |
| -pub const AF_ICLFXBM = 31; |
227 |
| -pub const AF_BTH = 32; |
228 |
| -pub const AF_MAX = 33; |
229 |
| - |
230 |
| -pub const SOCK_STREAM = 1; |
231 |
| -pub const SOCK_DGRAM = 2; |
232 |
| -pub const SOCK_RAW = 3; |
233 |
| -pub const SOCK_RDM = 4; |
234 |
| -pub const SOCK_SEQPACKET = 5; |
235 |
| - |
236 |
| -pub const IPPROTO_ICMP = 1; |
237 |
| -pub const IPPROTO_IGMP = 2; |
238 |
| -pub const BTHPROTO_RFCOMM = 3; |
239 |
| -pub const IPPROTO_TCP = 6; |
240 |
| -pub const IPPROTO_UDP = 17; |
241 |
| -pub const IPPROTO_ICMPV6 = 58; |
242 |
| -pub const IPPROTO_RM = 113; |
| 178 | +pub const AF_UNSPEC = ws2_32.AF_UNSPEC; |
| 179 | +pub const AF_UNIX = ws2_32.AF_UNIX; |
| 180 | +pub const AF_INET = ws2_32.AF_INET; |
| 181 | +pub const AF_IMPLINK = ws2_32.AF_IMPLINK; |
| 182 | +pub const AF_PUP = ws2_32.AF_PUP; |
| 183 | +pub const AF_CHAOS = ws2_32.AF_CHAOS; |
| 184 | +pub const AF_NS = ws2_32.AF_NS; |
| 185 | +pub const AF_IPX = ws2_32.AF_IPX; |
| 186 | +pub const AF_ISO = ws2_32.AF_ISO; |
| 187 | +pub const AF_OSI = ws2_32.AF_OSI; |
| 188 | +pub const AF_ECMA = ws2_32.AF_ECMA; |
| 189 | +pub const AF_DATAKIT = ws2_32.AF_DATAKIT; |
| 190 | +pub const AF_CCITT = ws2_32.AF_CCITT; |
| 191 | +pub const AF_SNA = ws2_32.AF_SNA; |
| 192 | +pub const AF_DECnet = ws2_32.AF_DECnet; |
| 193 | +pub const AF_DLI = ws2_32.AF_DLI; |
| 194 | +pub const AF_LAT = ws2_32.AF_LAT; |
| 195 | +pub const AF_HYLINK = ws2_32.AF_HYLINK; |
| 196 | +pub const AF_APPLETALK = ws2_32.AF_APPLETALK; |
| 197 | +pub const AF_NETBIOS = ws2_32.AF_NETBIOS; |
| 198 | +pub const AF_VOICEVIEW = ws2_32.AF_VOICEVIEW; |
| 199 | +pub const AF_FIREFOX = ws2_32.AF_FIREFOX; |
| 200 | +pub const AF_UNKNOWN1 = ws2_32.AF_UNKNOWN1; |
| 201 | +pub const AF_BAN = ws2_32.AF_BAN; |
| 202 | +pub const AF_ATM = ws2_32.AF_ATM; |
| 203 | +pub const AF_INET6 = ws2_32.AF_INET6; |
| 204 | +pub const AF_CLUSTER = ws2_32.AF_CLUSTER; |
| 205 | +pub const AF_12844 = ws2_32.AF_12844; |
| 206 | +pub const AF_IRDA = ws2_32.AF_IRDA; |
| 207 | +pub const AF_NETDES = ws2_32.AF_NETDES; |
| 208 | +pub const AF_TCNPROCESS = ws2_32.AF_TCNPROCESS; |
| 209 | +pub const AF_TCNMESSAGE = ws2_32.AF_TCNMESSAGE; |
| 210 | +pub const AF_ICLFXBM = ws2_32.AF_ICLFXBM; |
| 211 | +pub const AF_BTH = ws2_32.AF_BTH; |
| 212 | +pub const AF_MAX = ws2_32.AF_MAX; |
| 213 | + |
| 214 | +pub const SOCK_STREAM = ws2_32.SOCK_STREAM; |
| 215 | +pub const SOCK_DGRAM = ws2_32.SOCK_DGRAM; |
| 216 | +pub const SOCK_RAW = ws2_32.SOCK_RAW; |
| 217 | +pub const SOCK_RDM = ws2_32.SOCK_RDM; |
| 218 | +pub const SOCK_SEQPACKET = ws2_32.SOCK_SEQPACKET; |
| 219 | + |
| 220 | +pub const IPPROTO_ICMP = ws2_32.IPPROTO_ICMP; |
| 221 | +pub const IPPROTO_IGMP = ws2_32.IPPROTO_IGMP; |
| 222 | +pub const BTHPROTO_RFCOMM = ws2_32.BTHPROTO_RFCOMM; |
| 223 | +pub const IPPROTO_TCP = ws2_32.IPPROTO_TCP; |
| 224 | +pub const IPPROTO_UDP = ws2_32.IPPROTO_UDP; |
| 225 | +pub const IPPROTO_ICMPV6 = ws2_32.IPPROTO_ICMPV6; |
| 226 | +pub const IPPROTO_RM = ws2_32.IPPROTO_RM; |
0 commit comments