|
13 | 13 | #![allow(bad_style)]
|
14 | 14 | #![cfg_attr(test, allow(dead_code))]
|
15 | 15 |
|
16 |
| -use os::raw::{c_int, c_uint, c_ulong, c_long, c_longlong, c_ushort}; |
| 16 | +use os::raw::{c_int, c_uint, c_ulong, c_long, c_longlong, c_ushort,}; |
17 | 17 | use os::raw::{c_char, c_ulonglong};
|
18 | 18 | use libc::{wchar_t, size_t, c_void};
|
19 | 19 | use ptr;
|
@@ -78,13 +78,6 @@ pub type SOCKET = ::os::windows::raw::SOCKET;
|
78 | 78 | pub type socklen_t = c_int;
|
79 | 79 | pub type ADDRESS_FAMILY = USHORT;
|
80 | 80 |
|
81 |
| -pub type LPWSAOVERLAPPED_COMPLETION_ROUTINE = |
82 |
| - Option<unsafe extern "system" fn(dwError: DWORD, |
83 |
| - cbTransferred: DWORD, |
84 |
| - lpOverlapped: LPWSAOVERLAPPED, |
85 |
| - dwFlags: DWORD)>; |
86 |
| -pub type LPWSAOVERLAPPED = *mut OVERLAPPED; |
87 |
| - |
88 | 81 | pub const TRUE: BOOL = 1;
|
89 | 82 | pub const FALSE: BOOL = 0;
|
90 | 83 |
|
@@ -121,7 +114,6 @@ pub const FILE_FLAG_OPEN_REPARSE_POINT: DWORD = 0x00200000;
|
121 | 114 | pub const FILE_FLAG_BACKUP_SEMANTICS: DWORD = 0x02000000;
|
122 | 115 | pub const SECURITY_SQOS_PRESENT: DWORD = 0x00100000;
|
123 | 116 |
|
124 |
| -pub const SIO_KEEPALIVE_VALS: DWORD = 0x98000004; |
125 | 117 | pub const FIONBIO: c_ulong = 0x8004667e;
|
126 | 118 |
|
127 | 119 | #[repr(C)]
|
@@ -233,6 +225,33 @@ pub const SOL_SOCKET: c_int = 0xffff;
|
233 | 225 | pub const SO_RCVTIMEO: c_int = 0x1006;
|
234 | 226 | pub const SO_SNDTIMEO: c_int = 0x1005;
|
235 | 227 | pub const SO_REUSEADDR: c_int = 0x0004;
|
| 228 | +pub const IPPROTO_IP: c_int = 0; |
| 229 | +pub const IPPROTO_TCP: c_int = 6; |
| 230 | +pub const IPPROTO_IPV6: c_int = 41; |
| 231 | +pub const TCP_NODELAY: c_int = 0x0001; |
| 232 | +pub const IP_TTL: c_int = 4; |
| 233 | +pub const IPV6_V6ONLY: c_int = 27; |
| 234 | +pub const SO_ERROR: c_int = 0x1007; |
| 235 | +pub const SO_BROADCAST: c_int = 0x0020; |
| 236 | +pub const IP_MULTICAST_LOOP: c_int = 11; |
| 237 | +pub const IPV6_MULTICAST_LOOP: c_int = 11; |
| 238 | +pub const IP_MULTICAST_TTL: c_int = 10; |
| 239 | +pub const IP_ADD_MEMBERSHIP: c_int = 12; |
| 240 | +pub const IP_DROP_MEMBERSHIP: c_int = 13; |
| 241 | +pub const IPV6_ADD_MEMBERSHIP: c_int = 12; |
| 242 | +pub const IPV6_DROP_MEMBERSHIP: c_int = 13; |
| 243 | + |
| 244 | +#[repr(C)] |
| 245 | +pub struct ip_mreq { |
| 246 | + pub imr_multiaddr: in_addr, |
| 247 | + pub imr_interface: in_addr, |
| 248 | +} |
| 249 | + |
| 250 | +#[repr(C)] |
| 251 | +pub struct ipv6_mreq { |
| 252 | + pub ipv6mr_multiaddr: in6_addr, |
| 253 | + pub ipv6mr_interface: c_uint, |
| 254 | +} |
236 | 255 |
|
237 | 256 | pub const VOLUME_NAME_DOS: DWORD = 0x0;
|
238 | 257 | pub const MOVEFILE_REPLACE_EXISTING: DWORD = 1;
|
@@ -785,13 +804,6 @@ pub struct in6_addr {
|
785 | 804 | pub s6_addr: [u8; 16],
|
786 | 805 | }
|
787 | 806 |
|
788 |
| -#[repr(C)] |
789 |
| -pub struct tcp_keepalive { |
790 |
| - pub onoff: c_ulong, |
791 |
| - pub keepalivetime: c_ulong, |
792 |
| - pub keepaliveinterval: c_ulong, |
793 |
| -} |
794 |
| - |
795 | 807 | #[cfg(all(target_arch = "x86_64", target_env = "gnu"))]
|
796 | 808 | pub enum UNWIND_HISTORY_TABLE {}
|
797 | 809 |
|
@@ -850,17 +862,7 @@ extern "system" {
|
850 | 862 | lpProtocolInfo: LPWSAPROTOCOL_INFO,
|
851 | 863 | g: GROUP,
|
852 | 864 | dwFlags: DWORD) -> SOCKET;
|
853 |
| - pub fn WSAIoctl(s: SOCKET, |
854 |
| - dwIoControlCode: DWORD, |
855 |
| - lpvInBuffer: LPVOID, |
856 |
| - cbInBuffer: DWORD, |
857 |
| - lpvOutBuffer: LPVOID, |
858 |
| - cbOutBuffer: DWORD, |
859 |
| - lpcbBytesReturned: LPDWORD, |
860 |
| - lpOverlapped: LPWSAOVERLAPPED, |
861 |
| - lpCompletionRoutine: LPWSAOVERLAPPED_COMPLETION_ROUTINE) |
862 |
| - -> c_int; |
863 |
| - pub fn ioctlsocket(s: SOCKET, cmd: c_long, argp: *mut u_long) -> c_int; |
| 865 | + pub fn ioctlsocket(s: SOCKET, cmd: c_long, argp: *mut c_ulong) -> c_int; |
864 | 866 | pub fn InitializeCriticalSection(CriticalSection: *mut CRITICAL_SECTION);
|
865 | 867 | pub fn EnterCriticalSection(CriticalSection: *mut CRITICAL_SECTION);
|
866 | 868 | pub fn TryEnterCriticalSection(CriticalSection: *mut CRITICAL_SECTION) -> BOOLEAN;
|
|
0 commit comments