ipconfig-0.2.2/.gitignore000064400000000000000000000000511365177540200134750ustar0000000000000000/target/ **/*.rs.bk Cargo.lock .idea ipconfig-0.2.2/appveyor.yml000064400000000000000000000011571365177540200141050ustar0000000000000000environment: matrix: - TARGET: x86_64-pc-windows-msvc - TARGET: i686-pc-windows-msvc - TARGET: x86_64-pc-windows-gnu - TARGET: i686-pc-windows-gnu install: # Install Rust - set PATH=C:\Program Files\Git\mingw64\bin;%PATH% - curl -sSf -o rustup-init.exe https://win.rustup.rs/ - rustup-init.exe -y --default-host %TARGET% - set PATH=%PATH%;C:\Users\appveyor\.cargo\bin - set PATH=%PATH%;C:\Users\appveyor\.rustup\toolchains\stable-%TARGET%\bin - rustc -V - cargo -V build: false test_script: - cargo build --verbose - cargo test --verbose -- --nocapture - cargo doc ipconfig-0.2.2/build.rs000064400000000000000000000001001365177540200131450ustar0000000000000000fn main() { println!("cargo:rustc-link-lib=iphlpapi"); } ipconfig-0.2.2/Cargo.toml.orig000064400000000000000000000014501365200020500143570ustar0000000000000000[package] name = "ipconfig" version = "0.2.2" # Remember to also update the html_root_url in lib.rs and the documentation links here and in README.md authors = ["Liran Ringel "] description = "Get network adapters information and network configuration for windows." license = "MIT/Apache-2.0" keywords = ["ipconfig", "network", "adapter", "interface", "windows"] repository = "https://github.com/liranringel/ipconfig" homepage = "https://github.com/liranringel/ipconfig" documentation = "https://docs.rs/ipconfig/0.2/x86_64-pc-windows-msvc/ipconfig/" readme = "README.md" edition = "2018" [badges] appveyor = { repository = "liranringel/ipconfig" } [target.'cfg(windows)'.dependencies] winapi = "^0.3.4" widestring = "^0.4" socket2 = "^0.3.1" winreg = "^0.6.0" ipconfig-0.2.2/Cargo.toml0000644000000025011365200074200107240ustar00# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO # # When uploading crates to the registry Cargo will automatically # "normalize" Cargo.toml files for maximal compatibility # with all versions of Cargo and also rewrite `path` dependencies # to registry (e.g., crates.io) dependencies # # If you believe there's an error in this file please file an # issue against the rust-lang/cargo repository. If you're # editing this file be aware that the upstream Cargo.toml # will likely look very different (and much more reasonable) [package] edition = "2018" name = "ipconfig" version = "0.2.2" authors = ["Liran Ringel "] description = "Get network adapters information and network configuration for windows." homepage = "https://github.com/liranringel/ipconfig" documentation = "https://docs.rs/ipconfig/0.2/x86_64-pc-windows-msvc/ipconfig/" readme = "README.md" keywords = ["ipconfig", "network", "adapter", "interface", "windows"] license = "MIT/Apache-2.0" repository = "https://github.com/liranringel/ipconfig" [target."cfg(windows)".dependencies.socket2] version = "^0.3.1" [target."cfg(windows)".dependencies.widestring] version = "^0.4" [target."cfg(windows)".dependencies.winapi] version = "^0.3.4" [target."cfg(windows)".dependencies.winreg] version = "^0.6.0" [badges.appveyor] repository = "liranringel/ipconfig" ipconfig-0.2.2/LICENSE-APACHE000064400000000000000000000254501365177540200134430ustar0000000000000000 Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright [yyyy] [name of copyright owner] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ipconfig-0.2.2/LICENSE-MIT000064400000000000000000000020711365177540200131450ustar0000000000000000Copyright (c) 2017 Liran Ringel Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ipconfig-0.2.2/README.md000064400000000000000000000022271365177540200127730ustar0000000000000000# Ipconfig **Get network adapters information and network configuration for windows.** [![Build status](https://ci.appveyor.com/api/projects/status/tiwjo6q4eete0nmh/branch/master?svg=true)](https://ci.appveyor.com/project/liran-ringel/ipconfig/branch/master) [![Crates.io](https://img.shields.io/crates/v/ipconfig.svg)](https://crates.io/crates/ipconfig) [Documentation](https://docs.rs/ipconfig/0.2/x86_64-pc-windows-msvc/ipconfig/) ## Examples ```rust // Print the ip addresses and dns servers of all adapters: for adapter in ipconfig::get_adapters()? { println!("Ip addresses: {:#?}", adapter.ip_addresses()); println!("Dns servers: {:#?}", adapter.dns_servers()); } ``` ## License Licensed under either of * Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0) * MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT) at your option. ### Contribution Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you shall be dual licensed as above, without any additional terms or conditions. ipconfig-0.2.2/src/adapter.rs000064400000000000000000000236311365177540200142730ustar0000000000000000#![allow(clippy::cast_ptr_alignment)] use std; use std::ffi::CStr; use std::net::IpAddr; use crate::error::*; use socket2; use widestring::WideCString; use winapi::shared::winerror::{ERROR_SUCCESS, ERROR_BUFFER_OVERFLOW}; use winapi::shared::ws2def::AF_UNSPEC; use winapi::shared::ws2def::SOCKADDR; use crate::bindings::*; /// Represent an operational status of the adapter /// See IP_ADAPTER_ADDRESSES docs for more details #[derive(Debug, Clone, Copy, PartialEq)] pub enum OperStatus { IfOperStatusUp = 1, IfOperStatusDown = 2, IfOperStatusTesting = 3, IfOperStatusUnknown = 4, IfOperStatusDormant = 5, IfOperStatusNotPresent = 6, IfOperStatusLowerLayerDown = 7, } /// Represent an interface type /// See IANA docs on iftype for more details /// https://www.iana.org/assignments/ianaiftype-mib/ianaiftype-mib /// Note that we only support a subset of the IANA interface /// types and in case the adapter has an unsupported type, /// `IfType::Unsupported` is used. `IfType::Other` /// is different from `IfType::Unsupported`, as the former /// one is defined by the IANA itself. #[derive(Debug, Clone, Copy, PartialEq)] pub enum IfType { Other = 1, EthernetCsmacd = 6, Iso88025Tokenring = 9, Ppp = 23, SoftwareLoopback = 24, Atm = 37, Ieee80211 = 71, Tunnel = 131, Ieee1394 = 144, Unsupported, /// This enum may grow additional variants, so this makes sure clients /// don't count on exhaustive matching. (Otherwise, adding a new variant /// could break existing code.) #[doc(hidden)] __Nonexhaustive, } /// Represent an adapter. #[derive(Debug)] pub struct Adapter { adapter_name: String, ip_addresses: Vec, prefixes: Vec<(IpAddr, u32)>, gateways: Vec, dns_servers: Vec, description: String, friendly_name: String, physical_address: Option>, receive_link_speed: u64, transmit_link_speed: u64, oper_status: OperStatus, if_type: IfType, ipv6_if_index: u32, } impl Adapter { /// Get the adapter's name pub fn adapter_name(&self) -> &str { &self.adapter_name } /// Get the adapter's ip addresses (unicast ip addresses) pub fn ip_addresses(&self) -> &[IpAddr] { &self.ip_addresses } /// Get the adapter's prefixes. Returns a list of tuples (IpAddr, u32), /// where first element is a subnet address, e.g. 192.168.1.0 /// and second element is prefix length, e.g. 24 pub fn prefixes(&self) -> &[(IpAddr, u32)] { &self.prefixes } /// Get the adapter's gateways pub fn gateways(&self) -> &[IpAddr] { &self.gateways } /// Get the adapter's dns servers (the preferred dns server is first) pub fn dns_servers(&self) -> &[IpAddr] { &self.dns_servers } /// Get the adapter's description pub fn description(&self) -> &str { &self.description } /// Get the adapter's friendly name pub fn friendly_name(&self) -> &str { &self.friendly_name } /// Get the adapter's physical (MAC) address pub fn physical_address(&self) -> Option<&[u8]> { self.physical_address.as_ref().map(std::vec::Vec::as_slice) } /// Get the adapter Recieve Link Speed (bits per second) pub fn receive_link_speed(&self) -> u64 { self.receive_link_speed } /// Get the Trasnmit Link Speed (bits per second) pub fn transmit_link_speed(&self) -> u64 { self.transmit_link_speed } /// Check if the adapter is up (OperStatus is IfOperStatusUp) pub fn oper_status(&self) -> OperStatus { self.oper_status } /// Get the interface type pub fn if_type(&self) -> IfType { self.if_type } /// Get the IPv6 interface index. /// /// The return value can be used as an IPv6 scope id for link-local /// addresses. pub fn ipv6_if_index(&self) -> u32 { self.ipv6_if_index } } /// Get all the network adapters on this machine. pub fn get_adapters() -> Result> { unsafe { // Preallocate 16K per Microsoft recommendation, see Remarks section // https://docs.microsoft.com/en-us/windows/desktop/api/iphlpapi/nf-iphlpapi-getadaptersaddresses let mut buf_len: ULONG = 16384; let mut adapters_addresses_buffer = Vec::new(); let mut result = ERROR_BUFFER_OVERFLOW; while result == ERROR_BUFFER_OVERFLOW { adapters_addresses_buffer.resize(buf_len as usize, 0); result = GetAdaptersAddresses( AF_UNSPEC as u32, 0x0080 | 0x0010, //GAA_FLAG_INCLUDE_GATEWAYS | GAA_FLAG_INCLUDE_PREFIX, std::ptr::null_mut(), adapters_addresses_buffer.as_mut_ptr() as PIP_ADAPTER_ADDRESSES, &mut buf_len as *mut ULONG, ); } if result != ERROR_SUCCESS { return Err(Error { kind: ErrorKind::Os(result), }); } let mut adapters = vec![]; let mut adapter_addresses_ptr = adapters_addresses_buffer.as_mut_ptr() as PIP_ADAPTER_ADDRESSES; while !adapter_addresses_ptr.is_null() { adapters.push(get_adapter(adapter_addresses_ptr)?); adapter_addresses_ptr = (*adapter_addresses_ptr).Next; } Ok(adapters) } } unsafe fn get_adapter(adapter_addresses_ptr: PIP_ADAPTER_ADDRESSES) -> Result { let adapter_addresses = &*adapter_addresses_ptr; let adapter_name = CStr::from_ptr(adapter_addresses.AdapterName) .to_str()? .to_owned(); let dns_servers = get_dns_servers(adapter_addresses.FirstDnsServerAddress)?; let gateways = get_gateways(adapter_addresses.FirstGatewayAddress)?; let prefixes = get_prefixes(adapter_addresses.FirstPrefix)?; let unicast_addresses = get_unicast_addresses(adapter_addresses.FirstUnicastAddress)?; let receive_link_speed: u64 = adapter_addresses.ReceiveLinkSpeed; let transmit_link_speed: u64 = adapter_addresses.TransmitLinkSpeed; let oper_status = match adapter_addresses.OperStatus { 1 => OperStatus::IfOperStatusUp, 2 => OperStatus::IfOperStatusDown, 3 => OperStatus::IfOperStatusTesting, 4 => OperStatus::IfOperStatusUnknown, 5 => OperStatus::IfOperStatusDormant, 6 => OperStatus::IfOperStatusNotPresent, 7 => OperStatus::IfOperStatusLowerLayerDown, v => { panic!("unexpected OperStatus value: {}", v); } }; let if_type = match adapter_addresses.IfType { 1 => IfType::Other, 6 => IfType::EthernetCsmacd, 9 => IfType::Iso88025Tokenring, 23 => IfType::Ppp, 24 => IfType::SoftwareLoopback, 37 => IfType::Atm, 71 => IfType::Ieee80211, 131 => IfType::Tunnel, 144 => IfType::Ieee1394, _ => IfType::Unsupported, }; let ipv6_if_index = adapter_addresses.Ipv6IfIndex; let description = WideCString::from_ptr_str(adapter_addresses.Description).to_string()?; let friendly_name = WideCString::from_ptr_str(adapter_addresses.FriendlyName).to_string()?; let physical_address = if adapter_addresses.PhysicalAddressLength == 0 { None } else { Some( adapter_addresses.PhysicalAddress[..adapter_addresses.PhysicalAddressLength as usize] .to_vec(), ) }; Ok(Adapter { adapter_name, ip_addresses: unicast_addresses, prefixes, gateways, dns_servers, description, friendly_name, physical_address, receive_link_speed, transmit_link_speed, oper_status, if_type, ipv6_if_index, }) } unsafe fn socket_address_to_ipaddr(socket_address: &SOCKET_ADDRESS) -> IpAddr { let sockaddr = socket2::SockAddr::from_raw_parts( socket_address.lpSockaddr as *const SOCKADDR, socket_address.iSockaddrLength, ); // Could be either ipv4 or ipv6 sockaddr .as_inet() .map(|s| IpAddr::V4(*s.ip())) .unwrap_or_else(|| IpAddr::V6(*sockaddr.as_inet6().unwrap().ip())) } unsafe fn get_dns_servers( mut dns_server_ptr: PIP_ADAPTER_DNS_SERVER_ADDRESS_XP, ) -> Result> { let mut dns_servers = vec![]; while !dns_server_ptr.is_null() { let dns_server = &*dns_server_ptr; let ipaddr = socket_address_to_ipaddr(&dns_server.Address); dns_servers.push(ipaddr); dns_server_ptr = dns_server.Next; } Ok(dns_servers) } unsafe fn get_gateways(mut gateway_ptr: PIP_ADAPTER_GATEWAY_ADDRESS_LH) -> Result> { let mut gateways = vec![]; while !gateway_ptr.is_null() { let gateway = &*gateway_ptr; let ipaddr = socket_address_to_ipaddr(&gateway.Address); gateways.push(ipaddr); gateway_ptr = gateway.Next; } Ok(gateways) } unsafe fn get_unicast_addresses( mut unicast_addresses_ptr: PIP_ADAPTER_UNICAST_ADDRESS_LH, ) -> Result> { let mut unicast_addresses = vec![]; while !unicast_addresses_ptr.is_null() { let unicast_address = &*unicast_addresses_ptr; let ipaddr = socket_address_to_ipaddr(&unicast_address.Address); unicast_addresses.push(ipaddr); unicast_addresses_ptr = unicast_address.Next; } Ok(unicast_addresses) } unsafe fn get_prefixes(mut prefixes_ptr: PIP_ADAPTER_PREFIX_XP) -> Result> { let mut prefixes = vec![]; while !prefixes_ptr.is_null() { let prefix = &*prefixes_ptr; let ipaddr = socket_address_to_ipaddr(&prefix.Address); prefixes.push((ipaddr, prefix.PrefixLength)); prefixes_ptr = prefix.Next; } Ok(prefixes) } ipconfig-0.2.2/src/bindings/mod.rs000064400000000000000000000006601365177540200152240ustar0000000000000000#![allow(clippy::all)] #[cfg(target_pointer_width = "32")] #[path = "win32.rs"] #[allow(non_upper_case_globals)] #[allow(non_camel_case_types)] #[allow(non_snake_case)] #[allow(dead_code)] mod platform; #[cfg(target_pointer_width = "64")] #[path = "win64.rs"] #[allow(non_upper_case_globals)] #[allow(non_camel_case_types)] #[allow(non_snake_case)] #[allow(dead_code)] mod platform; pub use self::platform::*; ipconfig-0.2.2/src/bindings/win32.rs000064400000000000000000002471611365177540200154200ustar0000000000000000/* automatically generated by rust-bindgen with: bindgen.exe --whitelist-function=GetAdaptersAddresses wrapper.h -- --target=i686-pc-windows-msvc */ pub type wchar_t = ::std::os::raw::c_ushort; pub type ULONG = ::std::os::raw::c_ulong; pub type PULONG = *mut ULONG; pub type USHORT = ::std::os::raw::c_ushort; pub type DWORD = ::std::os::raw::c_ulong; pub type BYTE = ::std::os::raw::c_uchar; pub type INT = ::std::os::raw::c_int; pub type UINT8 = ::std::os::raw::c_uchar; pub type UINT32 = ::std::os::raw::c_uint; pub type ULONG64 = ::std::os::raw::c_ulonglong; pub type PVOID = *mut ::std::os::raw::c_void; pub type CHAR = ::std::os::raw::c_char; pub type WCHAR = wchar_t; pub type PWCHAR = *mut WCHAR; pub type PCHAR = *mut CHAR; pub type ULONGLONG = ::std::os::raw::c_ulonglong; #[repr(C)] #[derive(Debug, Copy)] pub struct _GUID { pub Data1: ::std::os::raw::c_ulong, pub Data2: ::std::os::raw::c_ushort, pub Data3: ::std::os::raw::c_ushort, pub Data4: [::std::os::raw::c_uchar; 8usize], } #[test] fn bindgen_test_layout__GUID() { assert_eq!( ::std::mem::size_of::<_GUID>(), 16usize, concat!("Size of: ", stringify!(_GUID)) ); assert_eq!( ::std::mem::align_of::<_GUID>(), 4usize, concat!("Alignment of ", stringify!(_GUID)) ); assert_eq!( unsafe { &(*(0 as *const _GUID)).Data1 as *const _ as usize }, 0usize, concat!( "Alignment of field: ", stringify!(_GUID), "::", stringify!(Data1) ) ); assert_eq!( unsafe { &(*(0 as *const _GUID)).Data2 as *const _ as usize }, 4usize, concat!( "Alignment of field: ", stringify!(_GUID), "::", stringify!(Data2) ) ); assert_eq!( unsafe { &(*(0 as *const _GUID)).Data3 as *const _ as usize }, 6usize, concat!( "Alignment of field: ", stringify!(_GUID), "::", stringify!(Data3) ) ); assert_eq!( unsafe { &(*(0 as *const _GUID)).Data4 as *const _ as usize }, 8usize, concat!( "Alignment of field: ", stringify!(_GUID), "::", stringify!(Data4) ) ); } impl Clone for _GUID { fn clone(&self) -> Self { *self } } pub type GUID = _GUID; pub type ADDRESS_FAMILY = USHORT; #[repr(C)] #[derive(Debug, Copy)] pub struct sockaddr { pub sa_family: ADDRESS_FAMILY, pub sa_data: [CHAR; 14usize], } #[test] fn bindgen_test_layout_sockaddr() { assert_eq!( ::std::mem::size_of::(), 16usize, concat!("Size of: ", stringify!(sockaddr)) ); assert_eq!( ::std::mem::align_of::(), 2usize, concat!("Alignment of ", stringify!(sockaddr)) ); assert_eq!( unsafe { &(*(0 as *const sockaddr)).sa_family as *const _ as usize }, 0usize, concat!( "Alignment of field: ", stringify!(sockaddr), "::", stringify!(sa_family) ) ); assert_eq!( unsafe { &(*(0 as *const sockaddr)).sa_data as *const _ as usize }, 2usize, concat!( "Alignment of field: ", stringify!(sockaddr), "::", stringify!(sa_data) ) ); } impl Clone for sockaddr { fn clone(&self) -> Self { *self } } pub type LPSOCKADDR = *mut sockaddr; #[repr(C)] #[derive(Debug, Copy)] pub struct _SOCKET_ADDRESS { pub lpSockaddr: LPSOCKADDR, pub iSockaddrLength: INT, } #[test] fn bindgen_test_layout__SOCKET_ADDRESS() { assert_eq!( ::std::mem::size_of::<_SOCKET_ADDRESS>(), 8usize, concat!("Size of: ", stringify!(_SOCKET_ADDRESS)) ); assert_eq!( ::std::mem::align_of::<_SOCKET_ADDRESS>(), 4usize, concat!("Alignment of ", stringify!(_SOCKET_ADDRESS)) ); assert_eq!( unsafe { &(*(0 as *const _SOCKET_ADDRESS)).lpSockaddr as *const _ as usize }, 0usize, concat!( "Alignment of field: ", stringify!(_SOCKET_ADDRESS), "::", stringify!(lpSockaddr) ) ); assert_eq!( unsafe { &(*(0 as *const _SOCKET_ADDRESS)).iSockaddrLength as *const _ as usize }, 4usize, concat!( "Alignment of field: ", stringify!(_SOCKET_ADDRESS), "::", stringify!(iSockaddrLength) ) ); } impl Clone for _SOCKET_ADDRESS { fn clone(&self) -> Self { *self } } pub type SOCKET_ADDRESS = _SOCKET_ADDRESS; pub type IFTYPE = ULONG; pub type NET_IF_COMPARTMENT_ID = UINT32; pub type NET_IF_NETWORK_GUID = GUID; #[repr(C)] #[derive(Copy)] pub union _NET_LUID_LH { pub Value: ULONG64, pub Info: _NET_LUID_LH__bindgen_ty_1, _bindgen_union_align: u64, } #[repr(C)] #[derive(Debug, Copy)] pub struct _NET_LUID_LH__bindgen_ty_1 { pub _bitfield_1: [u32; 2usize], pub __bindgen_align: [u64; 0usize], } #[test] fn bindgen_test_layout__NET_LUID_LH__bindgen_ty_1() { assert_eq!( ::std::mem::size_of::<_NET_LUID_LH__bindgen_ty_1>(), 8usize, concat!("Size of: ", stringify!(_NET_LUID_LH__bindgen_ty_1)) ); assert_eq!( ::std::mem::align_of::<_NET_LUID_LH__bindgen_ty_1>(), 8usize, concat!("Alignment of ", stringify!(_NET_LUID_LH__bindgen_ty_1)) ); } impl Clone for _NET_LUID_LH__bindgen_ty_1 { fn clone(&self) -> Self { *self } } impl _NET_LUID_LH__bindgen_ty_1 { #[inline] pub fn Reserved(&self) -> ULONG64 { let mut unit_field_val: u64 = unsafe { ::std::mem::uninitialized() }; unsafe { ::std::ptr::copy_nonoverlapping( &self._bitfield_1 as *const _ as *const u8, &mut unit_field_val as *mut u64 as *mut u8, ::std::mem::size_of::(), ) }; let mask = 0xffffff as u64; let val = (unit_field_val & mask) >> 0usize; unsafe { ::std::mem::transmute(val as u64) } } #[inline] pub fn set_Reserved(&mut self, val: ULONG64) { let mask = 0xffffff as u64; let val = val as u64 as u64; let mut unit_field_val: u64 = unsafe { ::std::mem::uninitialized() }; unsafe { ::std::ptr::copy_nonoverlapping( &self._bitfield_1 as *const _ as *const u8, &mut unit_field_val as *mut u64 as *mut u8, ::std::mem::size_of::(), ) }; unit_field_val &= !mask; unit_field_val |= (val << 0usize) & mask; unsafe { ::std::ptr::copy_nonoverlapping( &unit_field_val as *const _ as *const u8, &mut self._bitfield_1 as *mut _ as *mut u8, ::std::mem::size_of::(), ); } } #[inline] pub fn NetLuidIndex(&self) -> ULONG64 { let mut unit_field_val: u64 = unsafe { ::std::mem::uninitialized() }; unsafe { ::std::ptr::copy_nonoverlapping( &self._bitfield_1 as *const _ as *const u8, &mut unit_field_val as *mut u64 as *mut u8, ::std::mem::size_of::(), ) }; let mask = 0xffffff000000 as u64; let val = (unit_field_val & mask) >> 24usize; unsafe { ::std::mem::transmute(val as u64) } } #[inline] pub fn set_NetLuidIndex(&mut self, val: ULONG64) { let mask = 0xffffff000000 as u64; let val = val as u64 as u64; let mut unit_field_val: u64 = unsafe { ::std::mem::uninitialized() }; unsafe { ::std::ptr::copy_nonoverlapping( &self._bitfield_1 as *const _ as *const u8, &mut unit_field_val as *mut u64 as *mut u8, ::std::mem::size_of::(), ) }; unit_field_val &= !mask; unit_field_val |= (val << 24usize) & mask; unsafe { ::std::ptr::copy_nonoverlapping( &unit_field_val as *const _ as *const u8, &mut self._bitfield_1 as *mut _ as *mut u8, ::std::mem::size_of::(), ); } } #[inline] pub fn IfType(&self) -> ULONG64 { let mut unit_field_val: u64 = unsafe { ::std::mem::uninitialized() }; unsafe { ::std::ptr::copy_nonoverlapping( &self._bitfield_1 as *const _ as *const u8, &mut unit_field_val as *mut u64 as *mut u8, ::std::mem::size_of::(), ) }; let mask = 0xffff000000000000 as u64; let val = (unit_field_val & mask) >> 48usize; unsafe { ::std::mem::transmute(val as u64) } } #[inline] pub fn set_IfType(&mut self, val: ULONG64) { let mask = 0xffff000000000000 as u64; let val = val as u64 as u64; let mut unit_field_val: u64 = unsafe { ::std::mem::uninitialized() }; unsafe { ::std::ptr::copy_nonoverlapping( &self._bitfield_1 as *const _ as *const u8, &mut unit_field_val as *mut u64 as *mut u8, ::std::mem::size_of::(), ) }; unit_field_val &= !mask; unit_field_val |= (val << 48usize) & mask; unsafe { ::std::ptr::copy_nonoverlapping( &unit_field_val as *const _ as *const u8, &mut self._bitfield_1 as *mut _ as *mut u8, ::std::mem::size_of::(), ); } } #[inline] pub fn new_bitfield_1(Reserved: ULONG64, NetLuidIndex: ULONG64, IfType: ULONG64) -> u64 { (((0 | ((Reserved as u64 as u64) << 0usize) & (0xffffff as u64)) | ((NetLuidIndex as u64 as u64) << 24usize) & (0xffffff000000 as u64)) | ((IfType as u64 as u64) << 48usize) & (0xffff000000000000 as u64)) } } #[test] fn bindgen_test_layout__NET_LUID_LH() { assert_eq!( ::std::mem::size_of::<_NET_LUID_LH>(), 8usize, concat!("Size of: ", stringify!(_NET_LUID_LH)) ); assert_eq!( ::std::mem::align_of::<_NET_LUID_LH>(), 8usize, concat!("Alignment of ", stringify!(_NET_LUID_LH)) ); assert_eq!( unsafe { &(*(0 as *const _NET_LUID_LH)).Value as *const _ as usize }, 0usize, concat!( "Alignment of field: ", stringify!(_NET_LUID_LH), "::", stringify!(Value) ) ); assert_eq!( unsafe { &(*(0 as *const _NET_LUID_LH)).Info as *const _ as usize }, 0usize, concat!( "Alignment of field: ", stringify!(_NET_LUID_LH), "::", stringify!(Info) ) ); } impl Clone for _NET_LUID_LH { fn clone(&self) -> Self { *self } } pub type NET_LUID_LH = _NET_LUID_LH; pub type NET_LUID = NET_LUID_LH; pub type IF_LUID = NET_LUID; pub type NET_IFINDEX = ULONG; pub type IF_INDEX = NET_IFINDEX; pub const _NET_IF_CONNECTION_TYPE_NET_IF_CONNECTION_DEDICATED: _NET_IF_CONNECTION_TYPE = 1; pub const _NET_IF_CONNECTION_TYPE_NET_IF_CONNECTION_PASSIVE: _NET_IF_CONNECTION_TYPE = 2; pub const _NET_IF_CONNECTION_TYPE_NET_IF_CONNECTION_DEMAND: _NET_IF_CONNECTION_TYPE = 3; pub const _NET_IF_CONNECTION_TYPE_NET_IF_CONNECTION_MAXIMUM: _NET_IF_CONNECTION_TYPE = 4; pub type _NET_IF_CONNECTION_TYPE = ::std::os::raw::c_int; pub use self::_NET_IF_CONNECTION_TYPE as NET_IF_CONNECTION_TYPE; pub const TUNNEL_TYPE_TUNNEL_TYPE_NONE: TUNNEL_TYPE = 0; pub const TUNNEL_TYPE_TUNNEL_TYPE_OTHER: TUNNEL_TYPE = 1; pub const TUNNEL_TYPE_TUNNEL_TYPE_DIRECT: TUNNEL_TYPE = 2; pub const TUNNEL_TYPE_TUNNEL_TYPE_6TO4: TUNNEL_TYPE = 11; pub const TUNNEL_TYPE_TUNNEL_TYPE_ISATAP: TUNNEL_TYPE = 13; pub const TUNNEL_TYPE_TUNNEL_TYPE_TEREDO: TUNNEL_TYPE = 14; pub const TUNNEL_TYPE_TUNNEL_TYPE_IPHTTPS: TUNNEL_TYPE = 15; pub type TUNNEL_TYPE = ::std::os::raw::c_int; pub const IF_OPER_STATUS_IfOperStatusUp: IF_OPER_STATUS = 1; pub const IF_OPER_STATUS_IfOperStatusDown: IF_OPER_STATUS = 2; pub const IF_OPER_STATUS_IfOperStatusTesting: IF_OPER_STATUS = 3; pub const IF_OPER_STATUS_IfOperStatusUnknown: IF_OPER_STATUS = 4; pub const IF_OPER_STATUS_IfOperStatusDormant: IF_OPER_STATUS = 5; pub const IF_OPER_STATUS_IfOperStatusNotPresent: IF_OPER_STATUS = 6; pub const IF_OPER_STATUS_IfOperStatusLowerLayerDown: IF_OPER_STATUS = 7; pub type IF_OPER_STATUS = ::std::os::raw::c_int; pub const NL_PREFIX_ORIGIN_IpPrefixOriginOther: NL_PREFIX_ORIGIN = 0; pub const NL_PREFIX_ORIGIN_IpPrefixOriginManual: NL_PREFIX_ORIGIN = 1; pub const NL_PREFIX_ORIGIN_IpPrefixOriginWellKnown: NL_PREFIX_ORIGIN = 2; pub const NL_PREFIX_ORIGIN_IpPrefixOriginDhcp: NL_PREFIX_ORIGIN = 3; pub const NL_PREFIX_ORIGIN_IpPrefixOriginRouterAdvertisement: NL_PREFIX_ORIGIN = 4; pub const NL_PREFIX_ORIGIN_IpPrefixOriginUnchanged: NL_PREFIX_ORIGIN = 16; pub type NL_PREFIX_ORIGIN = ::std::os::raw::c_int; pub const NL_SUFFIX_ORIGIN_NlsoOther: NL_SUFFIX_ORIGIN = 0; pub const NL_SUFFIX_ORIGIN_NlsoManual: NL_SUFFIX_ORIGIN = 1; pub const NL_SUFFIX_ORIGIN_NlsoWellKnown: NL_SUFFIX_ORIGIN = 2; pub const NL_SUFFIX_ORIGIN_NlsoDhcp: NL_SUFFIX_ORIGIN = 3; pub const NL_SUFFIX_ORIGIN_NlsoLinkLayerAddress: NL_SUFFIX_ORIGIN = 4; pub const NL_SUFFIX_ORIGIN_NlsoRandom: NL_SUFFIX_ORIGIN = 5; pub const NL_SUFFIX_ORIGIN_IpSuffixOriginOther: NL_SUFFIX_ORIGIN = 0; pub const NL_SUFFIX_ORIGIN_IpSuffixOriginManual: NL_SUFFIX_ORIGIN = 1; pub const NL_SUFFIX_ORIGIN_IpSuffixOriginWellKnown: NL_SUFFIX_ORIGIN = 2; pub const NL_SUFFIX_ORIGIN_IpSuffixOriginDhcp: NL_SUFFIX_ORIGIN = 3; pub const NL_SUFFIX_ORIGIN_IpSuffixOriginLinkLayerAddress: NL_SUFFIX_ORIGIN = 4; pub const NL_SUFFIX_ORIGIN_IpSuffixOriginRandom: NL_SUFFIX_ORIGIN = 5; pub const NL_SUFFIX_ORIGIN_IpSuffixOriginUnchanged: NL_SUFFIX_ORIGIN = 16; pub type NL_SUFFIX_ORIGIN = ::std::os::raw::c_int; pub const NL_DAD_STATE_NldsInvalid: NL_DAD_STATE = 0; pub const NL_DAD_STATE_NldsTentative: NL_DAD_STATE = 1; pub const NL_DAD_STATE_NldsDuplicate: NL_DAD_STATE = 2; pub const NL_DAD_STATE_NldsDeprecated: NL_DAD_STATE = 3; pub const NL_DAD_STATE_NldsPreferred: NL_DAD_STATE = 4; pub const NL_DAD_STATE_IpDadStateInvalid: NL_DAD_STATE = 0; pub const NL_DAD_STATE_IpDadStateTentative: NL_DAD_STATE = 1; pub const NL_DAD_STATE_IpDadStateDuplicate: NL_DAD_STATE = 2; pub const NL_DAD_STATE_IpDadStateDeprecated: NL_DAD_STATE = 3; pub const NL_DAD_STATE_IpDadStatePreferred: NL_DAD_STATE = 4; pub type NL_DAD_STATE = ::std::os::raw::c_int; pub use self::NL_DAD_STATE as IP_DAD_STATE; pub use self::NL_PREFIX_ORIGIN as IP_PREFIX_ORIGIN; pub use self::NL_SUFFIX_ORIGIN as IP_SUFFIX_ORIGIN; #[repr(C)] #[derive(Copy)] pub struct _IP_ADAPTER_UNICAST_ADDRESS_LH { pub __bindgen_anon_1: _IP_ADAPTER_UNICAST_ADDRESS_LH__bindgen_ty_1, pub Next: *mut _IP_ADAPTER_UNICAST_ADDRESS_LH, pub Address: SOCKET_ADDRESS, pub PrefixOrigin: IP_PREFIX_ORIGIN, pub SuffixOrigin: IP_SUFFIX_ORIGIN, pub DadState: IP_DAD_STATE, pub ValidLifetime: ULONG, pub PreferredLifetime: ULONG, pub LeaseLifetime: ULONG, pub OnLinkPrefixLength: UINT8, } #[repr(C)] #[derive(Copy)] pub union _IP_ADAPTER_UNICAST_ADDRESS_LH__bindgen_ty_1 { pub Alignment: ULONGLONG, pub __bindgen_anon_1: _IP_ADAPTER_UNICAST_ADDRESS_LH__bindgen_ty_1__bindgen_ty_1, _bindgen_union_align: u64, } #[repr(C)] #[derive(Debug, Copy)] pub struct _IP_ADAPTER_UNICAST_ADDRESS_LH__bindgen_ty_1__bindgen_ty_1 { pub Length: ULONG, pub Flags: DWORD, } #[test] fn bindgen_test_layout__IP_ADAPTER_UNICAST_ADDRESS_LH__bindgen_ty_1__bindgen_ty_1() { assert_eq!( ::std::mem::size_of::<_IP_ADAPTER_UNICAST_ADDRESS_LH__bindgen_ty_1__bindgen_ty_1>(), 8usize, concat!( "Size of: ", stringify!(_IP_ADAPTER_UNICAST_ADDRESS_LH__bindgen_ty_1__bindgen_ty_1) ) ); assert_eq!( ::std::mem::align_of::<_IP_ADAPTER_UNICAST_ADDRESS_LH__bindgen_ty_1__bindgen_ty_1>(), 4usize, concat!( "Alignment of ", stringify!(_IP_ADAPTER_UNICAST_ADDRESS_LH__bindgen_ty_1__bindgen_ty_1) ) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_UNICAST_ADDRESS_LH__bindgen_ty_1__bindgen_ty_1)).Length as *const _ as usize }, 0usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_UNICAST_ADDRESS_LH__bindgen_ty_1__bindgen_ty_1), "::", stringify!(Length) ) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_UNICAST_ADDRESS_LH__bindgen_ty_1__bindgen_ty_1)).Flags as *const _ as usize }, 4usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_UNICAST_ADDRESS_LH__bindgen_ty_1__bindgen_ty_1), "::", stringify!(Flags) ) ); } impl Clone for _IP_ADAPTER_UNICAST_ADDRESS_LH__bindgen_ty_1__bindgen_ty_1 { fn clone(&self) -> Self { *self } } #[test] fn bindgen_test_layout__IP_ADAPTER_UNICAST_ADDRESS_LH__bindgen_ty_1() { assert_eq!( ::std::mem::size_of::<_IP_ADAPTER_UNICAST_ADDRESS_LH__bindgen_ty_1>(), 8usize, concat!( "Size of: ", stringify!(_IP_ADAPTER_UNICAST_ADDRESS_LH__bindgen_ty_1) ) ); assert_eq!( ::std::mem::align_of::<_IP_ADAPTER_UNICAST_ADDRESS_LH__bindgen_ty_1>(), 8usize, concat!( "Alignment of ", stringify!(_IP_ADAPTER_UNICAST_ADDRESS_LH__bindgen_ty_1) ) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_UNICAST_ADDRESS_LH__bindgen_ty_1)).Alignment as *const _ as usize }, 0usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_UNICAST_ADDRESS_LH__bindgen_ty_1), "::", stringify!(Alignment) ) ); } impl Clone for _IP_ADAPTER_UNICAST_ADDRESS_LH__bindgen_ty_1 { fn clone(&self) -> Self { *self } } #[test] fn bindgen_test_layout__IP_ADAPTER_UNICAST_ADDRESS_LH() { assert_eq!( ::std::mem::size_of::<_IP_ADAPTER_UNICAST_ADDRESS_LH>(), 48usize, concat!("Size of: ", stringify!(_IP_ADAPTER_UNICAST_ADDRESS_LH)) ); assert_eq!( ::std::mem::align_of::<_IP_ADAPTER_UNICAST_ADDRESS_LH>(), 8usize, concat!("Alignment of ", stringify!(_IP_ADAPTER_UNICAST_ADDRESS_LH)) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_UNICAST_ADDRESS_LH)).Next as *const _ as usize }, 8usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_UNICAST_ADDRESS_LH), "::", stringify!(Next) ) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_UNICAST_ADDRESS_LH)).Address as *const _ as usize }, 12usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_UNICAST_ADDRESS_LH), "::", stringify!(Address) ) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_UNICAST_ADDRESS_LH)).PrefixOrigin as *const _ as usize }, 20usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_UNICAST_ADDRESS_LH), "::", stringify!(PrefixOrigin) ) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_UNICAST_ADDRESS_LH)).SuffixOrigin as *const _ as usize }, 24usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_UNICAST_ADDRESS_LH), "::", stringify!(SuffixOrigin) ) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_UNICAST_ADDRESS_LH)).DadState as *const _ as usize }, 28usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_UNICAST_ADDRESS_LH), "::", stringify!(DadState) ) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_UNICAST_ADDRESS_LH)).ValidLifetime as *const _ as usize }, 32usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_UNICAST_ADDRESS_LH), "::", stringify!(ValidLifetime) ) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_UNICAST_ADDRESS_LH)).PreferredLifetime as *const _ as usize }, 36usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_UNICAST_ADDRESS_LH), "::", stringify!(PreferredLifetime) ) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_UNICAST_ADDRESS_LH)).LeaseLifetime as *const _ as usize }, 40usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_UNICAST_ADDRESS_LH), "::", stringify!(LeaseLifetime) ) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_UNICAST_ADDRESS_LH)).OnLinkPrefixLength as *const _ as usize }, 44usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_UNICAST_ADDRESS_LH), "::", stringify!(OnLinkPrefixLength) ) ); } impl Clone for _IP_ADAPTER_UNICAST_ADDRESS_LH { fn clone(&self) -> Self { *self } } pub type PIP_ADAPTER_UNICAST_ADDRESS_LH = *mut _IP_ADAPTER_UNICAST_ADDRESS_LH; #[repr(C)] #[derive(Copy)] pub struct _IP_ADAPTER_ANYCAST_ADDRESS_XP { pub __bindgen_anon_1: _IP_ADAPTER_ANYCAST_ADDRESS_XP__bindgen_ty_1, pub Next: *mut _IP_ADAPTER_ANYCAST_ADDRESS_XP, pub Address: SOCKET_ADDRESS, } #[repr(C)] #[derive(Copy)] pub union _IP_ADAPTER_ANYCAST_ADDRESS_XP__bindgen_ty_1 { pub Alignment: ULONGLONG, pub __bindgen_anon_1: _IP_ADAPTER_ANYCAST_ADDRESS_XP__bindgen_ty_1__bindgen_ty_1, _bindgen_union_align: u64, } #[repr(C)] #[derive(Debug, Copy)] pub struct _IP_ADAPTER_ANYCAST_ADDRESS_XP__bindgen_ty_1__bindgen_ty_1 { pub Length: ULONG, pub Flags: DWORD, } #[test] fn bindgen_test_layout__IP_ADAPTER_ANYCAST_ADDRESS_XP__bindgen_ty_1__bindgen_ty_1() { assert_eq!( ::std::mem::size_of::<_IP_ADAPTER_ANYCAST_ADDRESS_XP__bindgen_ty_1__bindgen_ty_1>(), 8usize, concat!( "Size of: ", stringify!(_IP_ADAPTER_ANYCAST_ADDRESS_XP__bindgen_ty_1__bindgen_ty_1) ) ); assert_eq!( ::std::mem::align_of::<_IP_ADAPTER_ANYCAST_ADDRESS_XP__bindgen_ty_1__bindgen_ty_1>(), 4usize, concat!( "Alignment of ", stringify!(_IP_ADAPTER_ANYCAST_ADDRESS_XP__bindgen_ty_1__bindgen_ty_1) ) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_ANYCAST_ADDRESS_XP__bindgen_ty_1__bindgen_ty_1)).Length as *const _ as usize }, 0usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_ANYCAST_ADDRESS_XP__bindgen_ty_1__bindgen_ty_1), "::", stringify!(Length) ) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_ANYCAST_ADDRESS_XP__bindgen_ty_1__bindgen_ty_1)).Flags as *const _ as usize }, 4usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_ANYCAST_ADDRESS_XP__bindgen_ty_1__bindgen_ty_1), "::", stringify!(Flags) ) ); } impl Clone for _IP_ADAPTER_ANYCAST_ADDRESS_XP__bindgen_ty_1__bindgen_ty_1 { fn clone(&self) -> Self { *self } } #[test] fn bindgen_test_layout__IP_ADAPTER_ANYCAST_ADDRESS_XP__bindgen_ty_1() { assert_eq!( ::std::mem::size_of::<_IP_ADAPTER_ANYCAST_ADDRESS_XP__bindgen_ty_1>(), 8usize, concat!( "Size of: ", stringify!(_IP_ADAPTER_ANYCAST_ADDRESS_XP__bindgen_ty_1) ) ); assert_eq!( ::std::mem::align_of::<_IP_ADAPTER_ANYCAST_ADDRESS_XP__bindgen_ty_1>(), 8usize, concat!( "Alignment of ", stringify!(_IP_ADAPTER_ANYCAST_ADDRESS_XP__bindgen_ty_1) ) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_ANYCAST_ADDRESS_XP__bindgen_ty_1)).Alignment as *const _ as usize }, 0usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_ANYCAST_ADDRESS_XP__bindgen_ty_1), "::", stringify!(Alignment) ) ); } impl Clone for _IP_ADAPTER_ANYCAST_ADDRESS_XP__bindgen_ty_1 { fn clone(&self) -> Self { *self } } #[test] fn bindgen_test_layout__IP_ADAPTER_ANYCAST_ADDRESS_XP() { assert_eq!( ::std::mem::size_of::<_IP_ADAPTER_ANYCAST_ADDRESS_XP>(), 24usize, concat!("Size of: ", stringify!(_IP_ADAPTER_ANYCAST_ADDRESS_XP)) ); assert_eq!( ::std::mem::align_of::<_IP_ADAPTER_ANYCAST_ADDRESS_XP>(), 8usize, concat!("Alignment of ", stringify!(_IP_ADAPTER_ANYCAST_ADDRESS_XP)) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_ANYCAST_ADDRESS_XP)).Next as *const _ as usize }, 8usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_ANYCAST_ADDRESS_XP), "::", stringify!(Next) ) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_ANYCAST_ADDRESS_XP)).Address as *const _ as usize }, 12usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_ANYCAST_ADDRESS_XP), "::", stringify!(Address) ) ); } impl Clone for _IP_ADAPTER_ANYCAST_ADDRESS_XP { fn clone(&self) -> Self { *self } } pub type PIP_ADAPTER_ANYCAST_ADDRESS_XP = *mut _IP_ADAPTER_ANYCAST_ADDRESS_XP; #[repr(C)] #[derive(Copy)] pub struct _IP_ADAPTER_MULTICAST_ADDRESS_XP { pub __bindgen_anon_1: _IP_ADAPTER_MULTICAST_ADDRESS_XP__bindgen_ty_1, pub Next: *mut _IP_ADAPTER_MULTICAST_ADDRESS_XP, pub Address: SOCKET_ADDRESS, } #[repr(C)] #[derive(Copy)] pub union _IP_ADAPTER_MULTICAST_ADDRESS_XP__bindgen_ty_1 { pub Alignment: ULONGLONG, pub __bindgen_anon_1: _IP_ADAPTER_MULTICAST_ADDRESS_XP__bindgen_ty_1__bindgen_ty_1, _bindgen_union_align: u64, } #[repr(C)] #[derive(Debug, Copy)] pub struct _IP_ADAPTER_MULTICAST_ADDRESS_XP__bindgen_ty_1__bindgen_ty_1 { pub Length: ULONG, pub Flags: DWORD, } #[test] fn bindgen_test_layout__IP_ADAPTER_MULTICAST_ADDRESS_XP__bindgen_ty_1__bindgen_ty_1() { assert_eq!( ::std::mem::size_of::<_IP_ADAPTER_MULTICAST_ADDRESS_XP__bindgen_ty_1__bindgen_ty_1>(), 8usize, concat!( "Size of: ", stringify!(_IP_ADAPTER_MULTICAST_ADDRESS_XP__bindgen_ty_1__bindgen_ty_1) ) ); assert_eq!( ::std::mem::align_of::<_IP_ADAPTER_MULTICAST_ADDRESS_XP__bindgen_ty_1__bindgen_ty_1>(), 4usize, concat!( "Alignment of ", stringify!(_IP_ADAPTER_MULTICAST_ADDRESS_XP__bindgen_ty_1__bindgen_ty_1) ) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_MULTICAST_ADDRESS_XP__bindgen_ty_1__bindgen_ty_1)).Length as *const _ as usize }, 0usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_MULTICAST_ADDRESS_XP__bindgen_ty_1__bindgen_ty_1), "::", stringify!(Length) ) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_MULTICAST_ADDRESS_XP__bindgen_ty_1__bindgen_ty_1)).Flags as *const _ as usize }, 4usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_MULTICAST_ADDRESS_XP__bindgen_ty_1__bindgen_ty_1), "::", stringify!(Flags) ) ); } impl Clone for _IP_ADAPTER_MULTICAST_ADDRESS_XP__bindgen_ty_1__bindgen_ty_1 { fn clone(&self) -> Self { *self } } #[test] fn bindgen_test_layout__IP_ADAPTER_MULTICAST_ADDRESS_XP__bindgen_ty_1() { assert_eq!( ::std::mem::size_of::<_IP_ADAPTER_MULTICAST_ADDRESS_XP__bindgen_ty_1>(), 8usize, concat!( "Size of: ", stringify!(_IP_ADAPTER_MULTICAST_ADDRESS_XP__bindgen_ty_1) ) ); assert_eq!( ::std::mem::align_of::<_IP_ADAPTER_MULTICAST_ADDRESS_XP__bindgen_ty_1>(), 8usize, concat!( "Alignment of ", stringify!(_IP_ADAPTER_MULTICAST_ADDRESS_XP__bindgen_ty_1) ) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_MULTICAST_ADDRESS_XP__bindgen_ty_1)).Alignment as *const _ as usize }, 0usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_MULTICAST_ADDRESS_XP__bindgen_ty_1), "::", stringify!(Alignment) ) ); } impl Clone for _IP_ADAPTER_MULTICAST_ADDRESS_XP__bindgen_ty_1 { fn clone(&self) -> Self { *self } } #[test] fn bindgen_test_layout__IP_ADAPTER_MULTICAST_ADDRESS_XP() { assert_eq!( ::std::mem::size_of::<_IP_ADAPTER_MULTICAST_ADDRESS_XP>(), 24usize, concat!("Size of: ", stringify!(_IP_ADAPTER_MULTICAST_ADDRESS_XP)) ); assert_eq!( ::std::mem::align_of::<_IP_ADAPTER_MULTICAST_ADDRESS_XP>(), 8usize, concat!( "Alignment of ", stringify!(_IP_ADAPTER_MULTICAST_ADDRESS_XP) ) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_MULTICAST_ADDRESS_XP)).Next as *const _ as usize }, 8usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_MULTICAST_ADDRESS_XP), "::", stringify!(Next) ) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_MULTICAST_ADDRESS_XP)).Address as *const _ as usize }, 12usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_MULTICAST_ADDRESS_XP), "::", stringify!(Address) ) ); } impl Clone for _IP_ADAPTER_MULTICAST_ADDRESS_XP { fn clone(&self) -> Self { *self } } pub type PIP_ADAPTER_MULTICAST_ADDRESS_XP = *mut _IP_ADAPTER_MULTICAST_ADDRESS_XP; #[repr(C)] #[derive(Copy)] pub struct _IP_ADAPTER_DNS_SERVER_ADDRESS_XP { pub __bindgen_anon_1: _IP_ADAPTER_DNS_SERVER_ADDRESS_XP__bindgen_ty_1, pub Next: *mut _IP_ADAPTER_DNS_SERVER_ADDRESS_XP, pub Address: SOCKET_ADDRESS, } #[repr(C)] #[derive(Copy)] pub union _IP_ADAPTER_DNS_SERVER_ADDRESS_XP__bindgen_ty_1 { pub Alignment: ULONGLONG, pub __bindgen_anon_1: _IP_ADAPTER_DNS_SERVER_ADDRESS_XP__bindgen_ty_1__bindgen_ty_1, _bindgen_union_align: u64, } #[repr(C)] #[derive(Debug, Copy)] pub struct _IP_ADAPTER_DNS_SERVER_ADDRESS_XP__bindgen_ty_1__bindgen_ty_1 { pub Length: ULONG, pub Reserved: DWORD, } #[test] fn bindgen_test_layout__IP_ADAPTER_DNS_SERVER_ADDRESS_XP__bindgen_ty_1__bindgen_ty_1() { assert_eq!( ::std::mem::size_of::<_IP_ADAPTER_DNS_SERVER_ADDRESS_XP__bindgen_ty_1__bindgen_ty_1>(), 8usize, concat!( "Size of: ", stringify!(_IP_ADAPTER_DNS_SERVER_ADDRESS_XP__bindgen_ty_1__bindgen_ty_1) ) ); assert_eq!( ::std::mem::align_of::<_IP_ADAPTER_DNS_SERVER_ADDRESS_XP__bindgen_ty_1__bindgen_ty_1>(), 4usize, concat!( "Alignment of ", stringify!(_IP_ADAPTER_DNS_SERVER_ADDRESS_XP__bindgen_ty_1__bindgen_ty_1) ) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_DNS_SERVER_ADDRESS_XP__bindgen_ty_1__bindgen_ty_1)).Length as *const _ as usize }, 0usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_DNS_SERVER_ADDRESS_XP__bindgen_ty_1__bindgen_ty_1), "::", stringify!(Length) ) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_DNS_SERVER_ADDRESS_XP__bindgen_ty_1__bindgen_ty_1)).Reserved as *const _ as usize }, 4usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_DNS_SERVER_ADDRESS_XP__bindgen_ty_1__bindgen_ty_1), "::", stringify!(Reserved) ) ); } impl Clone for _IP_ADAPTER_DNS_SERVER_ADDRESS_XP__bindgen_ty_1__bindgen_ty_1 { fn clone(&self) -> Self { *self } } #[test] fn bindgen_test_layout__IP_ADAPTER_DNS_SERVER_ADDRESS_XP__bindgen_ty_1() { assert_eq!( ::std::mem::size_of::<_IP_ADAPTER_DNS_SERVER_ADDRESS_XP__bindgen_ty_1>(), 8usize, concat!( "Size of: ", stringify!(_IP_ADAPTER_DNS_SERVER_ADDRESS_XP__bindgen_ty_1) ) ); assert_eq!( ::std::mem::align_of::<_IP_ADAPTER_DNS_SERVER_ADDRESS_XP__bindgen_ty_1>(), 8usize, concat!( "Alignment of ", stringify!(_IP_ADAPTER_DNS_SERVER_ADDRESS_XP__bindgen_ty_1) ) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_DNS_SERVER_ADDRESS_XP__bindgen_ty_1)).Alignment as *const _ as usize }, 0usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_DNS_SERVER_ADDRESS_XP__bindgen_ty_1), "::", stringify!(Alignment) ) ); } impl Clone for _IP_ADAPTER_DNS_SERVER_ADDRESS_XP__bindgen_ty_1 { fn clone(&self) -> Self { *self } } #[test] fn bindgen_test_layout__IP_ADAPTER_DNS_SERVER_ADDRESS_XP() { assert_eq!( ::std::mem::size_of::<_IP_ADAPTER_DNS_SERVER_ADDRESS_XP>(), 24usize, concat!("Size of: ", stringify!(_IP_ADAPTER_DNS_SERVER_ADDRESS_XP)) ); assert_eq!( ::std::mem::align_of::<_IP_ADAPTER_DNS_SERVER_ADDRESS_XP>(), 8usize, concat!( "Alignment of ", stringify!(_IP_ADAPTER_DNS_SERVER_ADDRESS_XP) ) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_DNS_SERVER_ADDRESS_XP)).Next as *const _ as usize }, 8usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_DNS_SERVER_ADDRESS_XP), "::", stringify!(Next) ) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_DNS_SERVER_ADDRESS_XP)).Address as *const _ as usize }, 12usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_DNS_SERVER_ADDRESS_XP), "::", stringify!(Address) ) ); } impl Clone for _IP_ADAPTER_DNS_SERVER_ADDRESS_XP { fn clone(&self) -> Self { *self } } pub type PIP_ADAPTER_DNS_SERVER_ADDRESS_XP = *mut _IP_ADAPTER_DNS_SERVER_ADDRESS_XP; #[repr(C)] #[derive(Copy)] pub struct _IP_ADAPTER_WINS_SERVER_ADDRESS_LH { pub __bindgen_anon_1: _IP_ADAPTER_WINS_SERVER_ADDRESS_LH__bindgen_ty_1, pub Next: *mut _IP_ADAPTER_WINS_SERVER_ADDRESS_LH, pub Address: SOCKET_ADDRESS, } #[repr(C)] #[derive(Copy)] pub union _IP_ADAPTER_WINS_SERVER_ADDRESS_LH__bindgen_ty_1 { pub Alignment: ULONGLONG, pub __bindgen_anon_1: _IP_ADAPTER_WINS_SERVER_ADDRESS_LH__bindgen_ty_1__bindgen_ty_1, _bindgen_union_align: u64, } #[repr(C)] #[derive(Debug, Copy)] pub struct _IP_ADAPTER_WINS_SERVER_ADDRESS_LH__bindgen_ty_1__bindgen_ty_1 { pub Length: ULONG, pub Reserved: DWORD, } #[test] fn bindgen_test_layout__IP_ADAPTER_WINS_SERVER_ADDRESS_LH__bindgen_ty_1__bindgen_ty_1() { assert_eq!( ::std::mem::size_of::<_IP_ADAPTER_WINS_SERVER_ADDRESS_LH__bindgen_ty_1__bindgen_ty_1>(), 8usize, concat!( "Size of: ", stringify!(_IP_ADAPTER_WINS_SERVER_ADDRESS_LH__bindgen_ty_1__bindgen_ty_1) ) ); assert_eq!( ::std::mem::align_of::<_IP_ADAPTER_WINS_SERVER_ADDRESS_LH__bindgen_ty_1__bindgen_ty_1>(), 4usize, concat!( "Alignment of ", stringify!(_IP_ADAPTER_WINS_SERVER_ADDRESS_LH__bindgen_ty_1__bindgen_ty_1) ) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_WINS_SERVER_ADDRESS_LH__bindgen_ty_1__bindgen_ty_1)).Length as *const _ as usize }, 0usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_WINS_SERVER_ADDRESS_LH__bindgen_ty_1__bindgen_ty_1), "::", stringify!(Length) ) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_WINS_SERVER_ADDRESS_LH__bindgen_ty_1__bindgen_ty_1)) .Reserved as *const _ as usize }, 4usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_WINS_SERVER_ADDRESS_LH__bindgen_ty_1__bindgen_ty_1), "::", stringify!(Reserved) ) ); } impl Clone for _IP_ADAPTER_WINS_SERVER_ADDRESS_LH__bindgen_ty_1__bindgen_ty_1 { fn clone(&self) -> Self { *self } } #[test] fn bindgen_test_layout__IP_ADAPTER_WINS_SERVER_ADDRESS_LH__bindgen_ty_1() { assert_eq!( ::std::mem::size_of::<_IP_ADAPTER_WINS_SERVER_ADDRESS_LH__bindgen_ty_1>(), 8usize, concat!( "Size of: ", stringify!(_IP_ADAPTER_WINS_SERVER_ADDRESS_LH__bindgen_ty_1) ) ); assert_eq!( ::std::mem::align_of::<_IP_ADAPTER_WINS_SERVER_ADDRESS_LH__bindgen_ty_1>(), 8usize, concat!( "Alignment of ", stringify!(_IP_ADAPTER_WINS_SERVER_ADDRESS_LH__bindgen_ty_1) ) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_WINS_SERVER_ADDRESS_LH__bindgen_ty_1)).Alignment as *const _ as usize }, 0usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_WINS_SERVER_ADDRESS_LH__bindgen_ty_1), "::", stringify!(Alignment) ) ); } impl Clone for _IP_ADAPTER_WINS_SERVER_ADDRESS_LH__bindgen_ty_1 { fn clone(&self) -> Self { *self } } #[test] fn bindgen_test_layout__IP_ADAPTER_WINS_SERVER_ADDRESS_LH() { assert_eq!( ::std::mem::size_of::<_IP_ADAPTER_WINS_SERVER_ADDRESS_LH>(), 24usize, concat!("Size of: ", stringify!(_IP_ADAPTER_WINS_SERVER_ADDRESS_LH)) ); assert_eq!( ::std::mem::align_of::<_IP_ADAPTER_WINS_SERVER_ADDRESS_LH>(), 8usize, concat!( "Alignment of ", stringify!(_IP_ADAPTER_WINS_SERVER_ADDRESS_LH) ) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_WINS_SERVER_ADDRESS_LH)).Next as *const _ as usize }, 8usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_WINS_SERVER_ADDRESS_LH), "::", stringify!(Next) ) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_WINS_SERVER_ADDRESS_LH)).Address as *const _ as usize }, 12usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_WINS_SERVER_ADDRESS_LH), "::", stringify!(Address) ) ); } impl Clone for _IP_ADAPTER_WINS_SERVER_ADDRESS_LH { fn clone(&self) -> Self { *self } } pub type PIP_ADAPTER_WINS_SERVER_ADDRESS_LH = *mut _IP_ADAPTER_WINS_SERVER_ADDRESS_LH; #[repr(C)] #[derive(Copy)] pub struct _IP_ADAPTER_GATEWAY_ADDRESS_LH { pub __bindgen_anon_1: _IP_ADAPTER_GATEWAY_ADDRESS_LH__bindgen_ty_1, pub Next: *mut _IP_ADAPTER_GATEWAY_ADDRESS_LH, pub Address: SOCKET_ADDRESS, } #[repr(C)] #[derive(Copy)] pub union _IP_ADAPTER_GATEWAY_ADDRESS_LH__bindgen_ty_1 { pub Alignment: ULONGLONG, pub __bindgen_anon_1: _IP_ADAPTER_GATEWAY_ADDRESS_LH__bindgen_ty_1__bindgen_ty_1, _bindgen_union_align: u64, } #[repr(C)] #[derive(Debug, Copy)] pub struct _IP_ADAPTER_GATEWAY_ADDRESS_LH__bindgen_ty_1__bindgen_ty_1 { pub Length: ULONG, pub Reserved: DWORD, } #[test] fn bindgen_test_layout__IP_ADAPTER_GATEWAY_ADDRESS_LH__bindgen_ty_1__bindgen_ty_1() { assert_eq!( ::std::mem::size_of::<_IP_ADAPTER_GATEWAY_ADDRESS_LH__bindgen_ty_1__bindgen_ty_1>(), 8usize, concat!( "Size of: ", stringify!(_IP_ADAPTER_GATEWAY_ADDRESS_LH__bindgen_ty_1__bindgen_ty_1) ) ); assert_eq!( ::std::mem::align_of::<_IP_ADAPTER_GATEWAY_ADDRESS_LH__bindgen_ty_1__bindgen_ty_1>(), 4usize, concat!( "Alignment of ", stringify!(_IP_ADAPTER_GATEWAY_ADDRESS_LH__bindgen_ty_1__bindgen_ty_1) ) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_GATEWAY_ADDRESS_LH__bindgen_ty_1__bindgen_ty_1)).Length as *const _ as usize }, 0usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_GATEWAY_ADDRESS_LH__bindgen_ty_1__bindgen_ty_1), "::", stringify!(Length) ) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_GATEWAY_ADDRESS_LH__bindgen_ty_1__bindgen_ty_1)).Reserved as *const _ as usize }, 4usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_GATEWAY_ADDRESS_LH__bindgen_ty_1__bindgen_ty_1), "::", stringify!(Reserved) ) ); } impl Clone for _IP_ADAPTER_GATEWAY_ADDRESS_LH__bindgen_ty_1__bindgen_ty_1 { fn clone(&self) -> Self { *self } } #[test] fn bindgen_test_layout__IP_ADAPTER_GATEWAY_ADDRESS_LH__bindgen_ty_1() { assert_eq!( ::std::mem::size_of::<_IP_ADAPTER_GATEWAY_ADDRESS_LH__bindgen_ty_1>(), 8usize, concat!( "Size of: ", stringify!(_IP_ADAPTER_GATEWAY_ADDRESS_LH__bindgen_ty_1) ) ); assert_eq!( ::std::mem::align_of::<_IP_ADAPTER_GATEWAY_ADDRESS_LH__bindgen_ty_1>(), 8usize, concat!( "Alignment of ", stringify!(_IP_ADAPTER_GATEWAY_ADDRESS_LH__bindgen_ty_1) ) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_GATEWAY_ADDRESS_LH__bindgen_ty_1)).Alignment as *const _ as usize }, 0usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_GATEWAY_ADDRESS_LH__bindgen_ty_1), "::", stringify!(Alignment) ) ); } impl Clone for _IP_ADAPTER_GATEWAY_ADDRESS_LH__bindgen_ty_1 { fn clone(&self) -> Self { *self } } #[test] fn bindgen_test_layout__IP_ADAPTER_GATEWAY_ADDRESS_LH() { assert_eq!( ::std::mem::size_of::<_IP_ADAPTER_GATEWAY_ADDRESS_LH>(), 24usize, concat!("Size of: ", stringify!(_IP_ADAPTER_GATEWAY_ADDRESS_LH)) ); assert_eq!( ::std::mem::align_of::<_IP_ADAPTER_GATEWAY_ADDRESS_LH>(), 8usize, concat!("Alignment of ", stringify!(_IP_ADAPTER_GATEWAY_ADDRESS_LH)) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_GATEWAY_ADDRESS_LH)).Next as *const _ as usize }, 8usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_GATEWAY_ADDRESS_LH), "::", stringify!(Next) ) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_GATEWAY_ADDRESS_LH)).Address as *const _ as usize }, 12usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_GATEWAY_ADDRESS_LH), "::", stringify!(Address) ) ); } impl Clone for _IP_ADAPTER_GATEWAY_ADDRESS_LH { fn clone(&self) -> Self { *self } } pub type PIP_ADAPTER_GATEWAY_ADDRESS_LH = *mut _IP_ADAPTER_GATEWAY_ADDRESS_LH; #[repr(C)] #[derive(Copy)] pub struct _IP_ADAPTER_PREFIX_XP { pub __bindgen_anon_1: _IP_ADAPTER_PREFIX_XP__bindgen_ty_1, pub Next: *mut _IP_ADAPTER_PREFIX_XP, pub Address: SOCKET_ADDRESS, pub PrefixLength: ULONG, } #[repr(C)] #[derive(Copy)] pub union _IP_ADAPTER_PREFIX_XP__bindgen_ty_1 { pub Alignment: ULONGLONG, pub __bindgen_anon_1: _IP_ADAPTER_PREFIX_XP__bindgen_ty_1__bindgen_ty_1, _bindgen_union_align: u64, } #[repr(C)] #[derive(Debug, Copy)] pub struct _IP_ADAPTER_PREFIX_XP__bindgen_ty_1__bindgen_ty_1 { pub Length: ULONG, pub Flags: DWORD, } #[test] fn bindgen_test_layout__IP_ADAPTER_PREFIX_XP__bindgen_ty_1__bindgen_ty_1() { assert_eq!( ::std::mem::size_of::<_IP_ADAPTER_PREFIX_XP__bindgen_ty_1__bindgen_ty_1>(), 8usize, concat!( "Size of: ", stringify!(_IP_ADAPTER_PREFIX_XP__bindgen_ty_1__bindgen_ty_1) ) ); assert_eq!( ::std::mem::align_of::<_IP_ADAPTER_PREFIX_XP__bindgen_ty_1__bindgen_ty_1>(), 4usize, concat!( "Alignment of ", stringify!(_IP_ADAPTER_PREFIX_XP__bindgen_ty_1__bindgen_ty_1) ) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_PREFIX_XP__bindgen_ty_1__bindgen_ty_1)).Length as *const _ as usize }, 0usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_PREFIX_XP__bindgen_ty_1__bindgen_ty_1), "::", stringify!(Length) ) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_PREFIX_XP__bindgen_ty_1__bindgen_ty_1)).Flags as *const _ as usize }, 4usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_PREFIX_XP__bindgen_ty_1__bindgen_ty_1), "::", stringify!(Flags) ) ); } impl Clone for _IP_ADAPTER_PREFIX_XP__bindgen_ty_1__bindgen_ty_1 { fn clone(&self) -> Self { *self } } #[test] fn bindgen_test_layout__IP_ADAPTER_PREFIX_XP__bindgen_ty_1() { assert_eq!( ::std::mem::size_of::<_IP_ADAPTER_PREFIX_XP__bindgen_ty_1>(), 8usize, concat!("Size of: ", stringify!(_IP_ADAPTER_PREFIX_XP__bindgen_ty_1)) ); assert_eq!( ::std::mem::align_of::<_IP_ADAPTER_PREFIX_XP__bindgen_ty_1>(), 8usize, concat!( "Alignment of ", stringify!(_IP_ADAPTER_PREFIX_XP__bindgen_ty_1) ) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_PREFIX_XP__bindgen_ty_1)).Alignment as *const _ as usize }, 0usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_PREFIX_XP__bindgen_ty_1), "::", stringify!(Alignment) ) ); } impl Clone for _IP_ADAPTER_PREFIX_XP__bindgen_ty_1 { fn clone(&self) -> Self { *self } } #[test] fn bindgen_test_layout__IP_ADAPTER_PREFIX_XP() { assert_eq!( ::std::mem::size_of::<_IP_ADAPTER_PREFIX_XP>(), 24usize, concat!("Size of: ", stringify!(_IP_ADAPTER_PREFIX_XP)) ); assert_eq!( ::std::mem::align_of::<_IP_ADAPTER_PREFIX_XP>(), 8usize, concat!("Alignment of ", stringify!(_IP_ADAPTER_PREFIX_XP)) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_PREFIX_XP)).Next as *const _ as usize }, 8usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_PREFIX_XP), "::", stringify!(Next) ) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_PREFIX_XP)).Address as *const _ as usize }, 12usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_PREFIX_XP), "::", stringify!(Address) ) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_PREFIX_XP)).PrefixLength as *const _ as usize }, 20usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_PREFIX_XP), "::", stringify!(PrefixLength) ) ); } impl Clone for _IP_ADAPTER_PREFIX_XP { fn clone(&self) -> Self { *self } } pub type PIP_ADAPTER_PREFIX_XP = *mut _IP_ADAPTER_PREFIX_XP; #[repr(C)] #[derive(Copy)] pub struct _IP_ADAPTER_DNS_SUFFIX { pub Next: *mut _IP_ADAPTER_DNS_SUFFIX, pub String: [WCHAR; 256usize], } #[test] fn bindgen_test_layout__IP_ADAPTER_DNS_SUFFIX() { assert_eq!( ::std::mem::size_of::<_IP_ADAPTER_DNS_SUFFIX>(), 516usize, concat!("Size of: ", stringify!(_IP_ADAPTER_DNS_SUFFIX)) ); assert_eq!( ::std::mem::align_of::<_IP_ADAPTER_DNS_SUFFIX>(), 4usize, concat!("Alignment of ", stringify!(_IP_ADAPTER_DNS_SUFFIX)) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_DNS_SUFFIX)).Next as *const _ as usize }, 0usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_DNS_SUFFIX), "::", stringify!(Next) ) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_DNS_SUFFIX)).String as *const _ as usize }, 4usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_DNS_SUFFIX), "::", stringify!(String) ) ); } impl Clone for _IP_ADAPTER_DNS_SUFFIX { fn clone(&self) -> Self { *self } } pub type PIP_ADAPTER_DNS_SUFFIX = *mut _IP_ADAPTER_DNS_SUFFIX; #[repr(C)] #[derive(Copy)] pub struct _IP_ADAPTER_ADDRESSES_LH { pub __bindgen_anon_1: _IP_ADAPTER_ADDRESSES_LH__bindgen_ty_1, pub Next: *mut _IP_ADAPTER_ADDRESSES_LH, pub AdapterName: PCHAR, pub FirstUnicastAddress: PIP_ADAPTER_UNICAST_ADDRESS_LH, pub FirstAnycastAddress: PIP_ADAPTER_ANYCAST_ADDRESS_XP, pub FirstMulticastAddress: PIP_ADAPTER_MULTICAST_ADDRESS_XP, pub FirstDnsServerAddress: PIP_ADAPTER_DNS_SERVER_ADDRESS_XP, pub DnsSuffix: PWCHAR, pub Description: PWCHAR, pub FriendlyName: PWCHAR, pub PhysicalAddress: [BYTE; 8usize], pub PhysicalAddressLength: ULONG, pub __bindgen_anon_2: _IP_ADAPTER_ADDRESSES_LH__bindgen_ty_2, pub Mtu: ULONG, pub IfType: IFTYPE, pub OperStatus: IF_OPER_STATUS, pub Ipv6IfIndex: IF_INDEX, pub ZoneIndices: [ULONG; 16usize], pub FirstPrefix: PIP_ADAPTER_PREFIX_XP, pub TransmitLinkSpeed: ULONG64, pub ReceiveLinkSpeed: ULONG64, pub FirstWinsServerAddress: PIP_ADAPTER_WINS_SERVER_ADDRESS_LH, pub FirstGatewayAddress: PIP_ADAPTER_GATEWAY_ADDRESS_LH, pub Ipv4Metric: ULONG, pub Ipv6Metric: ULONG, pub Luid: IF_LUID, pub Dhcpv4Server: SOCKET_ADDRESS, pub CompartmentId: NET_IF_COMPARTMENT_ID, pub NetworkGuid: NET_IF_NETWORK_GUID, pub ConnectionType: NET_IF_CONNECTION_TYPE, pub TunnelType: TUNNEL_TYPE, pub Dhcpv6Server: SOCKET_ADDRESS, pub Dhcpv6ClientDuid: [BYTE; 130usize], pub Dhcpv6ClientDuidLength: ULONG, pub Dhcpv6Iaid: ULONG, pub FirstDnsSuffix: PIP_ADAPTER_DNS_SUFFIX, } #[repr(C)] #[derive(Copy)] pub union _IP_ADAPTER_ADDRESSES_LH__bindgen_ty_1 { pub Alignment: ULONGLONG, pub __bindgen_anon_1: _IP_ADAPTER_ADDRESSES_LH__bindgen_ty_1__bindgen_ty_1, _bindgen_union_align: u64, } #[repr(C)] #[derive(Debug, Copy)] pub struct _IP_ADAPTER_ADDRESSES_LH__bindgen_ty_1__bindgen_ty_1 { pub Length: ULONG, pub IfIndex: IF_INDEX, } #[test] fn bindgen_test_layout__IP_ADAPTER_ADDRESSES_LH__bindgen_ty_1__bindgen_ty_1() { assert_eq!( ::std::mem::size_of::<_IP_ADAPTER_ADDRESSES_LH__bindgen_ty_1__bindgen_ty_1>(), 8usize, concat!( "Size of: ", stringify!(_IP_ADAPTER_ADDRESSES_LH__bindgen_ty_1__bindgen_ty_1) ) ); assert_eq!( ::std::mem::align_of::<_IP_ADAPTER_ADDRESSES_LH__bindgen_ty_1__bindgen_ty_1>(), 4usize, concat!( "Alignment of ", stringify!(_IP_ADAPTER_ADDRESSES_LH__bindgen_ty_1__bindgen_ty_1) ) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_ADDRESSES_LH__bindgen_ty_1__bindgen_ty_1)).Length as *const _ as usize }, 0usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_ADDRESSES_LH__bindgen_ty_1__bindgen_ty_1), "::", stringify!(Length) ) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_ADDRESSES_LH__bindgen_ty_1__bindgen_ty_1)).IfIndex as *const _ as usize }, 4usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_ADDRESSES_LH__bindgen_ty_1__bindgen_ty_1), "::", stringify!(IfIndex) ) ); } impl Clone for _IP_ADAPTER_ADDRESSES_LH__bindgen_ty_1__bindgen_ty_1 { fn clone(&self) -> Self { *self } } #[test] fn bindgen_test_layout__IP_ADAPTER_ADDRESSES_LH__bindgen_ty_1() { assert_eq!( ::std::mem::size_of::<_IP_ADAPTER_ADDRESSES_LH__bindgen_ty_1>(), 8usize, concat!( "Size of: ", stringify!(_IP_ADAPTER_ADDRESSES_LH__bindgen_ty_1) ) ); assert_eq!( ::std::mem::align_of::<_IP_ADAPTER_ADDRESSES_LH__bindgen_ty_1>(), 8usize, concat!( "Alignment of ", stringify!(_IP_ADAPTER_ADDRESSES_LH__bindgen_ty_1) ) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_ADDRESSES_LH__bindgen_ty_1)).Alignment as *const _ as usize }, 0usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_ADDRESSES_LH__bindgen_ty_1), "::", stringify!(Alignment) ) ); } impl Clone for _IP_ADAPTER_ADDRESSES_LH__bindgen_ty_1 { fn clone(&self) -> Self { *self } } #[repr(C)] #[derive(Copy)] pub union _IP_ADAPTER_ADDRESSES_LH__bindgen_ty_2 { pub Flags: ULONG, pub __bindgen_anon_1: _IP_ADAPTER_ADDRESSES_LH__bindgen_ty_2__bindgen_ty_1, _bindgen_union_align: u32, } #[repr(C)] #[derive(Debug, Copy)] pub struct _IP_ADAPTER_ADDRESSES_LH__bindgen_ty_2__bindgen_ty_1 { pub _bitfield_1: [u8; 2usize], pub __bindgen_padding_0: u16, pub __bindgen_align: [u32; 0usize], } #[test] fn bindgen_test_layout__IP_ADAPTER_ADDRESSES_LH__bindgen_ty_2__bindgen_ty_1() { assert_eq!( ::std::mem::size_of::<_IP_ADAPTER_ADDRESSES_LH__bindgen_ty_2__bindgen_ty_1>(), 4usize, concat!( "Size of: ", stringify!(_IP_ADAPTER_ADDRESSES_LH__bindgen_ty_2__bindgen_ty_1) ) ); assert_eq!( ::std::mem::align_of::<_IP_ADAPTER_ADDRESSES_LH__bindgen_ty_2__bindgen_ty_1>(), 4usize, concat!( "Alignment of ", stringify!(_IP_ADAPTER_ADDRESSES_LH__bindgen_ty_2__bindgen_ty_1) ) ); } impl Clone for _IP_ADAPTER_ADDRESSES_LH__bindgen_ty_2__bindgen_ty_1 { fn clone(&self) -> Self { *self } } impl _IP_ADAPTER_ADDRESSES_LH__bindgen_ty_2__bindgen_ty_1 { #[inline] pub fn DdnsEnabled(&self) -> ULONG { let mut unit_field_val: u16 = unsafe { ::std::mem::uninitialized() }; unsafe { ::std::ptr::copy_nonoverlapping( &self._bitfield_1 as *const _ as *const u8, &mut unit_field_val as *mut u16 as *mut u8, ::std::mem::size_of::(), ) }; let mask = 0x1 as u16; let val = (unit_field_val & mask) >> 0usize; unsafe { ::std::mem::transmute(val as u32) } } #[inline] pub fn set_DdnsEnabled(&mut self, val: ULONG) { let mask = 0x1 as u16; let val = val as u32 as u16; let mut unit_field_val: u16 = unsafe { ::std::mem::uninitialized() }; unsafe { ::std::ptr::copy_nonoverlapping( &self._bitfield_1 as *const _ as *const u8, &mut unit_field_val as *mut u16 as *mut u8, ::std::mem::size_of::(), ) }; unit_field_val &= !mask; unit_field_val |= (val << 0usize) & mask; unsafe { ::std::ptr::copy_nonoverlapping( &unit_field_val as *const _ as *const u8, &mut self._bitfield_1 as *mut _ as *mut u8, ::std::mem::size_of::(), ); } } #[inline] pub fn RegisterAdapterSuffix(&self) -> ULONG { let mut unit_field_val: u16 = unsafe { ::std::mem::uninitialized() }; unsafe { ::std::ptr::copy_nonoverlapping( &self._bitfield_1 as *const _ as *const u8, &mut unit_field_val as *mut u16 as *mut u8, ::std::mem::size_of::(), ) }; let mask = 0x2 as u16; let val = (unit_field_val & mask) >> 1usize; unsafe { ::std::mem::transmute(val as u32) } } #[inline] pub fn set_RegisterAdapterSuffix(&mut self, val: ULONG) { let mask = 0x2 as u16; let val = val as u32 as u16; let mut unit_field_val: u16 = unsafe { ::std::mem::uninitialized() }; unsafe { ::std::ptr::copy_nonoverlapping( &self._bitfield_1 as *const _ as *const u8, &mut unit_field_val as *mut u16 as *mut u8, ::std::mem::size_of::(), ) }; unit_field_val &= !mask; unit_field_val |= (val << 1usize) & mask; unsafe { ::std::ptr::copy_nonoverlapping( &unit_field_val as *const _ as *const u8, &mut self._bitfield_1 as *mut _ as *mut u8, ::std::mem::size_of::(), ); } } #[inline] pub fn Dhcpv4Enabled(&self) -> ULONG { let mut unit_field_val: u16 = unsafe { ::std::mem::uninitialized() }; unsafe { ::std::ptr::copy_nonoverlapping( &self._bitfield_1 as *const _ as *const u8, &mut unit_field_val as *mut u16 as *mut u8, ::std::mem::size_of::(), ) }; let mask = 0x4 as u16; let val = (unit_field_val & mask) >> 2usize; unsafe { ::std::mem::transmute(val as u32) } } #[inline] pub fn set_Dhcpv4Enabled(&mut self, val: ULONG) { let mask = 0x4 as u16; let val = val as u32 as u16; let mut unit_field_val: u16 = unsafe { ::std::mem::uninitialized() }; unsafe { ::std::ptr::copy_nonoverlapping( &self._bitfield_1 as *const _ as *const u8, &mut unit_field_val as *mut u16 as *mut u8, ::std::mem::size_of::(), ) }; unit_field_val &= !mask; unit_field_val |= (val << 2usize) & mask; unsafe { ::std::ptr::copy_nonoverlapping( &unit_field_val as *const _ as *const u8, &mut self._bitfield_1 as *mut _ as *mut u8, ::std::mem::size_of::(), ); } } #[inline] pub fn ReceiveOnly(&self) -> ULONG { let mut unit_field_val: u16 = unsafe { ::std::mem::uninitialized() }; unsafe { ::std::ptr::copy_nonoverlapping( &self._bitfield_1 as *const _ as *const u8, &mut unit_field_val as *mut u16 as *mut u8, ::std::mem::size_of::(), ) }; let mask = 0x8 as u16; let val = (unit_field_val & mask) >> 3usize; unsafe { ::std::mem::transmute(val as u32) } } #[inline] pub fn set_ReceiveOnly(&mut self, val: ULONG) { let mask = 0x8 as u16; let val = val as u32 as u16; let mut unit_field_val: u16 = unsafe { ::std::mem::uninitialized() }; unsafe { ::std::ptr::copy_nonoverlapping( &self._bitfield_1 as *const _ as *const u8, &mut unit_field_val as *mut u16 as *mut u8, ::std::mem::size_of::(), ) }; unit_field_val &= !mask; unit_field_val |= (val << 3usize) & mask; unsafe { ::std::ptr::copy_nonoverlapping( &unit_field_val as *const _ as *const u8, &mut self._bitfield_1 as *mut _ as *mut u8, ::std::mem::size_of::(), ); } } #[inline] pub fn NoMulticast(&self) -> ULONG { let mut unit_field_val: u16 = unsafe { ::std::mem::uninitialized() }; unsafe { ::std::ptr::copy_nonoverlapping( &self._bitfield_1 as *const _ as *const u8, &mut unit_field_val as *mut u16 as *mut u8, ::std::mem::size_of::(), ) }; let mask = 0x10 as u16; let val = (unit_field_val & mask) >> 4usize; unsafe { ::std::mem::transmute(val as u32) } } #[inline] pub fn set_NoMulticast(&mut self, val: ULONG) { let mask = 0x10 as u16; let val = val as u32 as u16; let mut unit_field_val: u16 = unsafe { ::std::mem::uninitialized() }; unsafe { ::std::ptr::copy_nonoverlapping( &self._bitfield_1 as *const _ as *const u8, &mut unit_field_val as *mut u16 as *mut u8, ::std::mem::size_of::(), ) }; unit_field_val &= !mask; unit_field_val |= (val << 4usize) & mask; unsafe { ::std::ptr::copy_nonoverlapping( &unit_field_val as *const _ as *const u8, &mut self._bitfield_1 as *mut _ as *mut u8, ::std::mem::size_of::(), ); } } #[inline] pub fn Ipv6OtherStatefulConfig(&self) -> ULONG { let mut unit_field_val: u16 = unsafe { ::std::mem::uninitialized() }; unsafe { ::std::ptr::copy_nonoverlapping( &self._bitfield_1 as *const _ as *const u8, &mut unit_field_val as *mut u16 as *mut u8, ::std::mem::size_of::(), ) }; let mask = 0x20 as u16; let val = (unit_field_val & mask) >> 5usize; unsafe { ::std::mem::transmute(val as u32) } } #[inline] pub fn set_Ipv6OtherStatefulConfig(&mut self, val: ULONG) { let mask = 0x20 as u16; let val = val as u32 as u16; let mut unit_field_val: u16 = unsafe { ::std::mem::uninitialized() }; unsafe { ::std::ptr::copy_nonoverlapping( &self._bitfield_1 as *const _ as *const u8, &mut unit_field_val as *mut u16 as *mut u8, ::std::mem::size_of::(), ) }; unit_field_val &= !mask; unit_field_val |= (val << 5usize) & mask; unsafe { ::std::ptr::copy_nonoverlapping( &unit_field_val as *const _ as *const u8, &mut self._bitfield_1 as *mut _ as *mut u8, ::std::mem::size_of::(), ); } } #[inline] pub fn NetbiosOverTcpipEnabled(&self) -> ULONG { let mut unit_field_val: u16 = unsafe { ::std::mem::uninitialized() }; unsafe { ::std::ptr::copy_nonoverlapping( &self._bitfield_1 as *const _ as *const u8, &mut unit_field_val as *mut u16 as *mut u8, ::std::mem::size_of::(), ) }; let mask = 0x40 as u16; let val = (unit_field_val & mask) >> 6usize; unsafe { ::std::mem::transmute(val as u32) } } #[inline] pub fn set_NetbiosOverTcpipEnabled(&mut self, val: ULONG) { let mask = 0x40 as u16; let val = val as u32 as u16; let mut unit_field_val: u16 = unsafe { ::std::mem::uninitialized() }; unsafe { ::std::ptr::copy_nonoverlapping( &self._bitfield_1 as *const _ as *const u8, &mut unit_field_val as *mut u16 as *mut u8, ::std::mem::size_of::(), ) }; unit_field_val &= !mask; unit_field_val |= (val << 6usize) & mask; unsafe { ::std::ptr::copy_nonoverlapping( &unit_field_val as *const _ as *const u8, &mut self._bitfield_1 as *mut _ as *mut u8, ::std::mem::size_of::(), ); } } #[inline] pub fn Ipv4Enabled(&self) -> ULONG { let mut unit_field_val: u16 = unsafe { ::std::mem::uninitialized() }; unsafe { ::std::ptr::copy_nonoverlapping( &self._bitfield_1 as *const _ as *const u8, &mut unit_field_val as *mut u16 as *mut u8, ::std::mem::size_of::(), ) }; let mask = 0x80 as u16; let val = (unit_field_val & mask) >> 7usize; unsafe { ::std::mem::transmute(val as u32) } } #[inline] pub fn set_Ipv4Enabled(&mut self, val: ULONG) { let mask = 0x80 as u16; let val = val as u32 as u16; let mut unit_field_val: u16 = unsafe { ::std::mem::uninitialized() }; unsafe { ::std::ptr::copy_nonoverlapping( &self._bitfield_1 as *const _ as *const u8, &mut unit_field_val as *mut u16 as *mut u8, ::std::mem::size_of::(), ) }; unit_field_val &= !mask; unit_field_val |= (val << 7usize) & mask; unsafe { ::std::ptr::copy_nonoverlapping( &unit_field_val as *const _ as *const u8, &mut self._bitfield_1 as *mut _ as *mut u8, ::std::mem::size_of::(), ); } } #[inline] pub fn Ipv6Enabled(&self) -> ULONG { let mut unit_field_val: u16 = unsafe { ::std::mem::uninitialized() }; unsafe { ::std::ptr::copy_nonoverlapping( &self._bitfield_1 as *const _ as *const u8, &mut unit_field_val as *mut u16 as *mut u8, ::std::mem::size_of::(), ) }; let mask = 0x100 as u16; let val = (unit_field_val & mask) >> 8usize; unsafe { ::std::mem::transmute(val as u32) } } #[inline] pub fn set_Ipv6Enabled(&mut self, val: ULONG) { let mask = 0x100 as u16; let val = val as u32 as u16; let mut unit_field_val: u16 = unsafe { ::std::mem::uninitialized() }; unsafe { ::std::ptr::copy_nonoverlapping( &self._bitfield_1 as *const _ as *const u8, &mut unit_field_val as *mut u16 as *mut u8, ::std::mem::size_of::(), ) }; unit_field_val &= !mask; unit_field_val |= (val << 8usize) & mask; unsafe { ::std::ptr::copy_nonoverlapping( &unit_field_val as *const _ as *const u8, &mut self._bitfield_1 as *mut _ as *mut u8, ::std::mem::size_of::(), ); } } #[inline] pub fn Ipv6ManagedAddressConfigurationSupported(&self) -> ULONG { let mut unit_field_val: u16 = unsafe { ::std::mem::uninitialized() }; unsafe { ::std::ptr::copy_nonoverlapping( &self._bitfield_1 as *const _ as *const u8, &mut unit_field_val as *mut u16 as *mut u8, ::std::mem::size_of::(), ) }; let mask = 0x200 as u16; let val = (unit_field_val & mask) >> 9usize; unsafe { ::std::mem::transmute(val as u32) } } #[inline] pub fn set_Ipv6ManagedAddressConfigurationSupported(&mut self, val: ULONG) { let mask = 0x200 as u16; let val = val as u32 as u16; let mut unit_field_val: u16 = unsafe { ::std::mem::uninitialized() }; unsafe { ::std::ptr::copy_nonoverlapping( &self._bitfield_1 as *const _ as *const u8, &mut unit_field_val as *mut u16 as *mut u8, ::std::mem::size_of::(), ) }; unit_field_val &= !mask; unit_field_val |= (val << 9usize) & mask; unsafe { ::std::ptr::copy_nonoverlapping( &unit_field_val as *const _ as *const u8, &mut self._bitfield_1 as *mut _ as *mut u8, ::std::mem::size_of::(), ); } } #[inline] pub fn new_bitfield_1( DdnsEnabled: ULONG, RegisterAdapterSuffix: ULONG, Dhcpv4Enabled: ULONG, ReceiveOnly: ULONG, NoMulticast: ULONG, Ipv6OtherStatefulConfig: ULONG, NetbiosOverTcpipEnabled: ULONG, Ipv4Enabled: ULONG, Ipv6Enabled: ULONG, Ipv6ManagedAddressConfigurationSupported: ULONG, ) -> u16 { ((((((((((0 | ((DdnsEnabled as u32 as u16) << 0usize) & (0x1 as u16)) | ((RegisterAdapterSuffix as u32 as u16) << 1usize) & (0x2 as u16)) | ((Dhcpv4Enabled as u32 as u16) << 2usize) & (0x4 as u16)) | ((ReceiveOnly as u32 as u16) << 3usize) & (0x8 as u16)) | ((NoMulticast as u32 as u16) << 4usize) & (0x10 as u16)) | ((Ipv6OtherStatefulConfig as u32 as u16) << 5usize) & (0x20 as u16)) | ((NetbiosOverTcpipEnabled as u32 as u16) << 6usize) & (0x40 as u16)) | ((Ipv4Enabled as u32 as u16) << 7usize) & (0x80 as u16)) | ((Ipv6Enabled as u32 as u16) << 8usize) & (0x100 as u16)) | ((Ipv6ManagedAddressConfigurationSupported as u32 as u16) << 9usize) & (0x200 as u16)) } } #[test] fn bindgen_test_layout__IP_ADAPTER_ADDRESSES_LH__bindgen_ty_2() { assert_eq!( ::std::mem::size_of::<_IP_ADAPTER_ADDRESSES_LH__bindgen_ty_2>(), 4usize, concat!( "Size of: ", stringify!(_IP_ADAPTER_ADDRESSES_LH__bindgen_ty_2) ) ); assert_eq!( ::std::mem::align_of::<_IP_ADAPTER_ADDRESSES_LH__bindgen_ty_2>(), 4usize, concat!( "Alignment of ", stringify!(_IP_ADAPTER_ADDRESSES_LH__bindgen_ty_2) ) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_ADDRESSES_LH__bindgen_ty_2)).Flags as *const _ as usize }, 0usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_ADDRESSES_LH__bindgen_ty_2), "::", stringify!(Flags) ) ); } impl Clone for _IP_ADAPTER_ADDRESSES_LH__bindgen_ty_2 { fn clone(&self) -> Self { *self } } #[test] fn bindgen_test_layout__IP_ADAPTER_ADDRESSES_LH() { assert_eq!( ::std::mem::size_of::<_IP_ADAPTER_ADDRESSES_LH>(), 376usize, concat!("Size of: ", stringify!(_IP_ADAPTER_ADDRESSES_LH)) ); assert_eq!( ::std::mem::align_of::<_IP_ADAPTER_ADDRESSES_LH>(), 8usize, concat!("Alignment of ", stringify!(_IP_ADAPTER_ADDRESSES_LH)) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_ADDRESSES_LH)).Next as *const _ as usize }, 8usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_ADDRESSES_LH), "::", stringify!(Next) ) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_ADDRESSES_LH)).AdapterName as *const _ as usize }, 12usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_ADDRESSES_LH), "::", stringify!(AdapterName) ) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_ADDRESSES_LH)).FirstUnicastAddress as *const _ as usize }, 16usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_ADDRESSES_LH), "::", stringify!(FirstUnicastAddress) ) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_ADDRESSES_LH)).FirstAnycastAddress as *const _ as usize }, 20usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_ADDRESSES_LH), "::", stringify!(FirstAnycastAddress) ) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_ADDRESSES_LH)).FirstMulticastAddress as *const _ as usize }, 24usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_ADDRESSES_LH), "::", stringify!(FirstMulticastAddress) ) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_ADDRESSES_LH)).FirstDnsServerAddress as *const _ as usize }, 28usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_ADDRESSES_LH), "::", stringify!(FirstDnsServerAddress) ) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_ADDRESSES_LH)).DnsSuffix as *const _ as usize }, 32usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_ADDRESSES_LH), "::", stringify!(DnsSuffix) ) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_ADDRESSES_LH)).Description as *const _ as usize }, 36usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_ADDRESSES_LH), "::", stringify!(Description) ) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_ADDRESSES_LH)).FriendlyName as *const _ as usize }, 40usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_ADDRESSES_LH), "::", stringify!(FriendlyName) ) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_ADDRESSES_LH)).PhysicalAddress as *const _ as usize }, 44usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_ADDRESSES_LH), "::", stringify!(PhysicalAddress) ) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_ADDRESSES_LH)).PhysicalAddressLength as *const _ as usize }, 52usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_ADDRESSES_LH), "::", stringify!(PhysicalAddressLength) ) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_ADDRESSES_LH)).Mtu as *const _ as usize }, 60usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_ADDRESSES_LH), "::", stringify!(Mtu) ) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_ADDRESSES_LH)).IfType as *const _ as usize }, 64usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_ADDRESSES_LH), "::", stringify!(IfType) ) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_ADDRESSES_LH)).OperStatus as *const _ as usize }, 68usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_ADDRESSES_LH), "::", stringify!(OperStatus) ) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_ADDRESSES_LH)).Ipv6IfIndex as *const _ as usize }, 72usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_ADDRESSES_LH), "::", stringify!(Ipv6IfIndex) ) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_ADDRESSES_LH)).ZoneIndices as *const _ as usize }, 76usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_ADDRESSES_LH), "::", stringify!(ZoneIndices) ) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_ADDRESSES_LH)).FirstPrefix as *const _ as usize }, 140usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_ADDRESSES_LH), "::", stringify!(FirstPrefix) ) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_ADDRESSES_LH)).TransmitLinkSpeed as *const _ as usize }, 144usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_ADDRESSES_LH), "::", stringify!(TransmitLinkSpeed) ) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_ADDRESSES_LH)).ReceiveLinkSpeed as *const _ as usize }, 152usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_ADDRESSES_LH), "::", stringify!(ReceiveLinkSpeed) ) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_ADDRESSES_LH)).FirstWinsServerAddress as *const _ as usize }, 160usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_ADDRESSES_LH), "::", stringify!(FirstWinsServerAddress) ) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_ADDRESSES_LH)).FirstGatewayAddress as *const _ as usize }, 164usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_ADDRESSES_LH), "::", stringify!(FirstGatewayAddress) ) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_ADDRESSES_LH)).Ipv4Metric as *const _ as usize }, 168usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_ADDRESSES_LH), "::", stringify!(Ipv4Metric) ) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_ADDRESSES_LH)).Ipv6Metric as *const _ as usize }, 172usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_ADDRESSES_LH), "::", stringify!(Ipv6Metric) ) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_ADDRESSES_LH)).Luid as *const _ as usize }, 176usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_ADDRESSES_LH), "::", stringify!(Luid) ) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_ADDRESSES_LH)).Dhcpv4Server as *const _ as usize }, 184usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_ADDRESSES_LH), "::", stringify!(Dhcpv4Server) ) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_ADDRESSES_LH)).CompartmentId as *const _ as usize }, 192usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_ADDRESSES_LH), "::", stringify!(CompartmentId) ) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_ADDRESSES_LH)).NetworkGuid as *const _ as usize }, 196usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_ADDRESSES_LH), "::", stringify!(NetworkGuid) ) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_ADDRESSES_LH)).ConnectionType as *const _ as usize }, 212usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_ADDRESSES_LH), "::", stringify!(ConnectionType) ) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_ADDRESSES_LH)).TunnelType as *const _ as usize }, 216usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_ADDRESSES_LH), "::", stringify!(TunnelType) ) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_ADDRESSES_LH)).Dhcpv6Server as *const _ as usize }, 220usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_ADDRESSES_LH), "::", stringify!(Dhcpv6Server) ) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_ADDRESSES_LH)).Dhcpv6ClientDuid as *const _ as usize }, 228usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_ADDRESSES_LH), "::", stringify!(Dhcpv6ClientDuid) ) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_ADDRESSES_LH)).Dhcpv6ClientDuidLength as *const _ as usize }, 360usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_ADDRESSES_LH), "::", stringify!(Dhcpv6ClientDuidLength) ) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_ADDRESSES_LH)).Dhcpv6Iaid as *const _ as usize }, 364usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_ADDRESSES_LH), "::", stringify!(Dhcpv6Iaid) ) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_ADDRESSES_LH)).FirstDnsSuffix as *const _ as usize }, 368usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_ADDRESSES_LH), "::", stringify!(FirstDnsSuffix) ) ); } impl Clone for _IP_ADAPTER_ADDRESSES_LH { fn clone(&self) -> Self { *self } } pub type IP_ADAPTER_ADDRESSES_LH = _IP_ADAPTER_ADDRESSES_LH; pub type PIP_ADAPTER_ADDRESSES = *mut IP_ADAPTER_ADDRESSES_LH; extern "stdcall" { #[link_name = "\u{1}_GetAdaptersAddresses@20"] pub fn GetAdaptersAddresses( Family: ULONG, Flags: ULONG, Reserved: PVOID, AdapterAddresses: PIP_ADAPTER_ADDRESSES, SizePointer: PULONG, ) -> ULONG; } ipconfig-0.2.2/src/bindings/win64.rs000064400000000000000000002470761365177540200154320ustar0000000000000000/* automatically generated by rust-bindgen with: bindgen.exe --whitelist-function=GetAdaptersAddresses wrapper.h -- --target=x86_64-pc-windows-msvc */ pub type wchar_t = ::std::os::raw::c_ushort; pub type ULONG = ::std::os::raw::c_ulong; pub type PULONG = *mut ULONG; pub type USHORT = ::std::os::raw::c_ushort; pub type DWORD = ::std::os::raw::c_ulong; pub type BYTE = ::std::os::raw::c_uchar; pub type INT = ::std::os::raw::c_int; pub type UINT8 = ::std::os::raw::c_uchar; pub type UINT32 = ::std::os::raw::c_uint; pub type ULONG64 = ::std::os::raw::c_ulonglong; pub type PVOID = *mut ::std::os::raw::c_void; pub type CHAR = ::std::os::raw::c_char; pub type WCHAR = wchar_t; pub type PWCHAR = *mut WCHAR; pub type PCHAR = *mut CHAR; pub type ULONGLONG = ::std::os::raw::c_ulonglong; #[repr(C)] #[derive(Debug, Copy)] pub struct _GUID { pub Data1: ::std::os::raw::c_ulong, pub Data2: ::std::os::raw::c_ushort, pub Data3: ::std::os::raw::c_ushort, pub Data4: [::std::os::raw::c_uchar; 8usize], } #[test] fn bindgen_test_layout__GUID() { assert_eq!( ::std::mem::size_of::<_GUID>(), 16usize, concat!("Size of: ", stringify!(_GUID)) ); assert_eq!( ::std::mem::align_of::<_GUID>(), 4usize, concat!("Alignment of ", stringify!(_GUID)) ); assert_eq!( unsafe { &(*(0 as *const _GUID)).Data1 as *const _ as usize }, 0usize, concat!( "Alignment of field: ", stringify!(_GUID), "::", stringify!(Data1) ) ); assert_eq!( unsafe { &(*(0 as *const _GUID)).Data2 as *const _ as usize }, 4usize, concat!( "Alignment of field: ", stringify!(_GUID), "::", stringify!(Data2) ) ); assert_eq!( unsafe { &(*(0 as *const _GUID)).Data3 as *const _ as usize }, 6usize, concat!( "Alignment of field: ", stringify!(_GUID), "::", stringify!(Data3) ) ); assert_eq!( unsafe { &(*(0 as *const _GUID)).Data4 as *const _ as usize }, 8usize, concat!( "Alignment of field: ", stringify!(_GUID), "::", stringify!(Data4) ) ); } impl Clone for _GUID { fn clone(&self) -> Self { *self } } pub type GUID = _GUID; pub type ADDRESS_FAMILY = USHORT; #[repr(C)] #[derive(Debug, Copy)] pub struct sockaddr { pub sa_family: ADDRESS_FAMILY, pub sa_data: [CHAR; 14usize], } #[test] fn bindgen_test_layout_sockaddr() { assert_eq!( ::std::mem::size_of::(), 16usize, concat!("Size of: ", stringify!(sockaddr)) ); assert_eq!( ::std::mem::align_of::(), 2usize, concat!("Alignment of ", stringify!(sockaddr)) ); assert_eq!( unsafe { &(*(0 as *const sockaddr)).sa_family as *const _ as usize }, 0usize, concat!( "Alignment of field: ", stringify!(sockaddr), "::", stringify!(sa_family) ) ); assert_eq!( unsafe { &(*(0 as *const sockaddr)).sa_data as *const _ as usize }, 2usize, concat!( "Alignment of field: ", stringify!(sockaddr), "::", stringify!(sa_data) ) ); } impl Clone for sockaddr { fn clone(&self) -> Self { *self } } pub type LPSOCKADDR = *mut sockaddr; #[repr(C)] #[derive(Debug, Copy)] pub struct _SOCKET_ADDRESS { pub lpSockaddr: LPSOCKADDR, pub iSockaddrLength: INT, } #[test] fn bindgen_test_layout__SOCKET_ADDRESS() { assert_eq!( ::std::mem::size_of::<_SOCKET_ADDRESS>(), 16usize, concat!("Size of: ", stringify!(_SOCKET_ADDRESS)) ); assert_eq!( ::std::mem::align_of::<_SOCKET_ADDRESS>(), 8usize, concat!("Alignment of ", stringify!(_SOCKET_ADDRESS)) ); assert_eq!( unsafe { &(*(0 as *const _SOCKET_ADDRESS)).lpSockaddr as *const _ as usize }, 0usize, concat!( "Alignment of field: ", stringify!(_SOCKET_ADDRESS), "::", stringify!(lpSockaddr) ) ); assert_eq!( unsafe { &(*(0 as *const _SOCKET_ADDRESS)).iSockaddrLength as *const _ as usize }, 8usize, concat!( "Alignment of field: ", stringify!(_SOCKET_ADDRESS), "::", stringify!(iSockaddrLength) ) ); } impl Clone for _SOCKET_ADDRESS { fn clone(&self) -> Self { *self } } pub type SOCKET_ADDRESS = _SOCKET_ADDRESS; pub type IFTYPE = ULONG; pub type NET_IF_COMPARTMENT_ID = UINT32; pub type NET_IF_NETWORK_GUID = GUID; #[repr(C)] #[derive(Copy)] pub union _NET_LUID_LH { pub Value: ULONG64, pub Info: _NET_LUID_LH__bindgen_ty_1, _bindgen_union_align: u64, } #[repr(C)] #[derive(Debug, Copy)] pub struct _NET_LUID_LH__bindgen_ty_1 { pub _bitfield_1: [u32; 2usize], pub __bindgen_align: [u64; 0usize], } #[test] fn bindgen_test_layout__NET_LUID_LH__bindgen_ty_1() { assert_eq!( ::std::mem::size_of::<_NET_LUID_LH__bindgen_ty_1>(), 8usize, concat!("Size of: ", stringify!(_NET_LUID_LH__bindgen_ty_1)) ); assert_eq!( ::std::mem::align_of::<_NET_LUID_LH__bindgen_ty_1>(), 8usize, concat!("Alignment of ", stringify!(_NET_LUID_LH__bindgen_ty_1)) ); } impl Clone for _NET_LUID_LH__bindgen_ty_1 { fn clone(&self) -> Self { *self } } impl _NET_LUID_LH__bindgen_ty_1 { #[inline] pub fn Reserved(&self) -> ULONG64 { let mut unit_field_val: u64 = unsafe { ::std::mem::uninitialized() }; unsafe { ::std::ptr::copy_nonoverlapping( &self._bitfield_1 as *const _ as *const u8, &mut unit_field_val as *mut u64 as *mut u8, ::std::mem::size_of::(), ) }; let mask = 0xffffff as u64; let val = (unit_field_val & mask) >> 0usize; unsafe { ::std::mem::transmute(val as u64) } } #[inline] pub fn set_Reserved(&mut self, val: ULONG64) { let mask = 0xffffff as u64; let val = val as u64 as u64; let mut unit_field_val: u64 = unsafe { ::std::mem::uninitialized() }; unsafe { ::std::ptr::copy_nonoverlapping( &self._bitfield_1 as *const _ as *const u8, &mut unit_field_val as *mut u64 as *mut u8, ::std::mem::size_of::(), ) }; unit_field_val &= !mask; unit_field_val |= (val << 0usize) & mask; unsafe { ::std::ptr::copy_nonoverlapping( &unit_field_val as *const _ as *const u8, &mut self._bitfield_1 as *mut _ as *mut u8, ::std::mem::size_of::(), ); } } #[inline] pub fn NetLuidIndex(&self) -> ULONG64 { let mut unit_field_val: u64 = unsafe { ::std::mem::uninitialized() }; unsafe { ::std::ptr::copy_nonoverlapping( &self._bitfield_1 as *const _ as *const u8, &mut unit_field_val as *mut u64 as *mut u8, ::std::mem::size_of::(), ) }; let mask = 0xffffff000000 as u64; let val = (unit_field_val & mask) >> 24usize; unsafe { ::std::mem::transmute(val as u64) } } #[inline] pub fn set_NetLuidIndex(&mut self, val: ULONG64) { let mask = 0xffffff000000 as u64; let val = val as u64 as u64; let mut unit_field_val: u64 = unsafe { ::std::mem::uninitialized() }; unsafe { ::std::ptr::copy_nonoverlapping( &self._bitfield_1 as *const _ as *const u8, &mut unit_field_val as *mut u64 as *mut u8, ::std::mem::size_of::(), ) }; unit_field_val &= !mask; unit_field_val |= (val << 24usize) & mask; unsafe { ::std::ptr::copy_nonoverlapping( &unit_field_val as *const _ as *const u8, &mut self._bitfield_1 as *mut _ as *mut u8, ::std::mem::size_of::(), ); } } #[inline] pub fn IfType(&self) -> ULONG64 { let mut unit_field_val: u64 = unsafe { ::std::mem::uninitialized() }; unsafe { ::std::ptr::copy_nonoverlapping( &self._bitfield_1 as *const _ as *const u8, &mut unit_field_val as *mut u64 as *mut u8, ::std::mem::size_of::(), ) }; let mask = 0xffff000000000000 as u64; let val = (unit_field_val & mask) >> 48usize; unsafe { ::std::mem::transmute(val as u64) } } #[inline] pub fn set_IfType(&mut self, val: ULONG64) { let mask = 0xffff000000000000 as u64; let val = val as u64 as u64; let mut unit_field_val: u64 = unsafe { ::std::mem::uninitialized() }; unsafe { ::std::ptr::copy_nonoverlapping( &self._bitfield_1 as *const _ as *const u8, &mut unit_field_val as *mut u64 as *mut u8, ::std::mem::size_of::(), ) }; unit_field_val &= !mask; unit_field_val |= (val << 48usize) & mask; unsafe { ::std::ptr::copy_nonoverlapping( &unit_field_val as *const _ as *const u8, &mut self._bitfield_1 as *mut _ as *mut u8, ::std::mem::size_of::(), ); } } #[inline] pub fn new_bitfield_1(Reserved: ULONG64, NetLuidIndex: ULONG64, IfType: ULONG64) -> u64 { (((0 | ((Reserved as u64 as u64) << 0usize) & (0xffffff as u64)) | ((NetLuidIndex as u64 as u64) << 24usize) & (0xffffff000000 as u64)) | ((IfType as u64 as u64) << 48usize) & (0xffff000000000000 as u64)) } } #[test] fn bindgen_test_layout__NET_LUID_LH() { assert_eq!( ::std::mem::size_of::<_NET_LUID_LH>(), 8usize, concat!("Size of: ", stringify!(_NET_LUID_LH)) ); assert_eq!( ::std::mem::align_of::<_NET_LUID_LH>(), 8usize, concat!("Alignment of ", stringify!(_NET_LUID_LH)) ); assert_eq!( unsafe { &(*(0 as *const _NET_LUID_LH)).Value as *const _ as usize }, 0usize, concat!( "Alignment of field: ", stringify!(_NET_LUID_LH), "::", stringify!(Value) ) ); assert_eq!( unsafe { &(*(0 as *const _NET_LUID_LH)).Info as *const _ as usize }, 0usize, concat!( "Alignment of field: ", stringify!(_NET_LUID_LH), "::", stringify!(Info) ) ); } impl Clone for _NET_LUID_LH { fn clone(&self) -> Self { *self } } pub type NET_LUID_LH = _NET_LUID_LH; pub type NET_LUID = NET_LUID_LH; pub type IF_LUID = NET_LUID; pub type NET_IFINDEX = ULONG; pub type IF_INDEX = NET_IFINDEX; pub const _NET_IF_CONNECTION_TYPE_NET_IF_CONNECTION_DEDICATED: _NET_IF_CONNECTION_TYPE = 1; pub const _NET_IF_CONNECTION_TYPE_NET_IF_CONNECTION_PASSIVE: _NET_IF_CONNECTION_TYPE = 2; pub const _NET_IF_CONNECTION_TYPE_NET_IF_CONNECTION_DEMAND: _NET_IF_CONNECTION_TYPE = 3; pub const _NET_IF_CONNECTION_TYPE_NET_IF_CONNECTION_MAXIMUM: _NET_IF_CONNECTION_TYPE = 4; pub type _NET_IF_CONNECTION_TYPE = ::std::os::raw::c_int; pub use self::_NET_IF_CONNECTION_TYPE as NET_IF_CONNECTION_TYPE; pub const TUNNEL_TYPE_TUNNEL_TYPE_NONE: TUNNEL_TYPE = 0; pub const TUNNEL_TYPE_TUNNEL_TYPE_OTHER: TUNNEL_TYPE = 1; pub const TUNNEL_TYPE_TUNNEL_TYPE_DIRECT: TUNNEL_TYPE = 2; pub const TUNNEL_TYPE_TUNNEL_TYPE_6TO4: TUNNEL_TYPE = 11; pub const TUNNEL_TYPE_TUNNEL_TYPE_ISATAP: TUNNEL_TYPE = 13; pub const TUNNEL_TYPE_TUNNEL_TYPE_TEREDO: TUNNEL_TYPE = 14; pub const TUNNEL_TYPE_TUNNEL_TYPE_IPHTTPS: TUNNEL_TYPE = 15; pub type TUNNEL_TYPE = ::std::os::raw::c_int; pub const IF_OPER_STATUS_IfOperStatusUp: IF_OPER_STATUS = 1; pub const IF_OPER_STATUS_IfOperStatusDown: IF_OPER_STATUS = 2; pub const IF_OPER_STATUS_IfOperStatusTesting: IF_OPER_STATUS = 3; pub const IF_OPER_STATUS_IfOperStatusUnknown: IF_OPER_STATUS = 4; pub const IF_OPER_STATUS_IfOperStatusDormant: IF_OPER_STATUS = 5; pub const IF_OPER_STATUS_IfOperStatusNotPresent: IF_OPER_STATUS = 6; pub const IF_OPER_STATUS_IfOperStatusLowerLayerDown: IF_OPER_STATUS = 7; pub type IF_OPER_STATUS = ::std::os::raw::c_int; pub const NL_PREFIX_ORIGIN_IpPrefixOriginOther: NL_PREFIX_ORIGIN = 0; pub const NL_PREFIX_ORIGIN_IpPrefixOriginManual: NL_PREFIX_ORIGIN = 1; pub const NL_PREFIX_ORIGIN_IpPrefixOriginWellKnown: NL_PREFIX_ORIGIN = 2; pub const NL_PREFIX_ORIGIN_IpPrefixOriginDhcp: NL_PREFIX_ORIGIN = 3; pub const NL_PREFIX_ORIGIN_IpPrefixOriginRouterAdvertisement: NL_PREFIX_ORIGIN = 4; pub const NL_PREFIX_ORIGIN_IpPrefixOriginUnchanged: NL_PREFIX_ORIGIN = 16; pub type NL_PREFIX_ORIGIN = ::std::os::raw::c_int; pub const NL_SUFFIX_ORIGIN_NlsoOther: NL_SUFFIX_ORIGIN = 0; pub const NL_SUFFIX_ORIGIN_NlsoManual: NL_SUFFIX_ORIGIN = 1; pub const NL_SUFFIX_ORIGIN_NlsoWellKnown: NL_SUFFIX_ORIGIN = 2; pub const NL_SUFFIX_ORIGIN_NlsoDhcp: NL_SUFFIX_ORIGIN = 3; pub const NL_SUFFIX_ORIGIN_NlsoLinkLayerAddress: NL_SUFFIX_ORIGIN = 4; pub const NL_SUFFIX_ORIGIN_NlsoRandom: NL_SUFFIX_ORIGIN = 5; pub const NL_SUFFIX_ORIGIN_IpSuffixOriginOther: NL_SUFFIX_ORIGIN = 0; pub const NL_SUFFIX_ORIGIN_IpSuffixOriginManual: NL_SUFFIX_ORIGIN = 1; pub const NL_SUFFIX_ORIGIN_IpSuffixOriginWellKnown: NL_SUFFIX_ORIGIN = 2; pub const NL_SUFFIX_ORIGIN_IpSuffixOriginDhcp: NL_SUFFIX_ORIGIN = 3; pub const NL_SUFFIX_ORIGIN_IpSuffixOriginLinkLayerAddress: NL_SUFFIX_ORIGIN = 4; pub const NL_SUFFIX_ORIGIN_IpSuffixOriginRandom: NL_SUFFIX_ORIGIN = 5; pub const NL_SUFFIX_ORIGIN_IpSuffixOriginUnchanged: NL_SUFFIX_ORIGIN = 16; pub type NL_SUFFIX_ORIGIN = ::std::os::raw::c_int; pub const NL_DAD_STATE_NldsInvalid: NL_DAD_STATE = 0; pub const NL_DAD_STATE_NldsTentative: NL_DAD_STATE = 1; pub const NL_DAD_STATE_NldsDuplicate: NL_DAD_STATE = 2; pub const NL_DAD_STATE_NldsDeprecated: NL_DAD_STATE = 3; pub const NL_DAD_STATE_NldsPreferred: NL_DAD_STATE = 4; pub const NL_DAD_STATE_IpDadStateInvalid: NL_DAD_STATE = 0; pub const NL_DAD_STATE_IpDadStateTentative: NL_DAD_STATE = 1; pub const NL_DAD_STATE_IpDadStateDuplicate: NL_DAD_STATE = 2; pub const NL_DAD_STATE_IpDadStateDeprecated: NL_DAD_STATE = 3; pub const NL_DAD_STATE_IpDadStatePreferred: NL_DAD_STATE = 4; pub type NL_DAD_STATE = ::std::os::raw::c_int; pub use self::NL_DAD_STATE as IP_DAD_STATE; pub use self::NL_PREFIX_ORIGIN as IP_PREFIX_ORIGIN; pub use self::NL_SUFFIX_ORIGIN as IP_SUFFIX_ORIGIN; #[repr(C)] #[derive(Copy)] pub struct _IP_ADAPTER_UNICAST_ADDRESS_LH { pub __bindgen_anon_1: _IP_ADAPTER_UNICAST_ADDRESS_LH__bindgen_ty_1, pub Next: *mut _IP_ADAPTER_UNICAST_ADDRESS_LH, pub Address: SOCKET_ADDRESS, pub PrefixOrigin: IP_PREFIX_ORIGIN, pub SuffixOrigin: IP_SUFFIX_ORIGIN, pub DadState: IP_DAD_STATE, pub ValidLifetime: ULONG, pub PreferredLifetime: ULONG, pub LeaseLifetime: ULONG, pub OnLinkPrefixLength: UINT8, } #[repr(C)] #[derive(Copy)] pub union _IP_ADAPTER_UNICAST_ADDRESS_LH__bindgen_ty_1 { pub Alignment: ULONGLONG, pub __bindgen_anon_1: _IP_ADAPTER_UNICAST_ADDRESS_LH__bindgen_ty_1__bindgen_ty_1, _bindgen_union_align: u64, } #[repr(C)] #[derive(Debug, Copy)] pub struct _IP_ADAPTER_UNICAST_ADDRESS_LH__bindgen_ty_1__bindgen_ty_1 { pub Length: ULONG, pub Flags: DWORD, } #[test] fn bindgen_test_layout__IP_ADAPTER_UNICAST_ADDRESS_LH__bindgen_ty_1__bindgen_ty_1() { assert_eq!( ::std::mem::size_of::<_IP_ADAPTER_UNICAST_ADDRESS_LH__bindgen_ty_1__bindgen_ty_1>(), 8usize, concat!( "Size of: ", stringify!(_IP_ADAPTER_UNICAST_ADDRESS_LH__bindgen_ty_1__bindgen_ty_1) ) ); assert_eq!( ::std::mem::align_of::<_IP_ADAPTER_UNICAST_ADDRESS_LH__bindgen_ty_1__bindgen_ty_1>(), 4usize, concat!( "Alignment of ", stringify!(_IP_ADAPTER_UNICAST_ADDRESS_LH__bindgen_ty_1__bindgen_ty_1) ) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_UNICAST_ADDRESS_LH__bindgen_ty_1__bindgen_ty_1)).Length as *const _ as usize }, 0usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_UNICAST_ADDRESS_LH__bindgen_ty_1__bindgen_ty_1), "::", stringify!(Length) ) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_UNICAST_ADDRESS_LH__bindgen_ty_1__bindgen_ty_1)).Flags as *const _ as usize }, 4usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_UNICAST_ADDRESS_LH__bindgen_ty_1__bindgen_ty_1), "::", stringify!(Flags) ) ); } impl Clone for _IP_ADAPTER_UNICAST_ADDRESS_LH__bindgen_ty_1__bindgen_ty_1 { fn clone(&self) -> Self { *self } } #[test] fn bindgen_test_layout__IP_ADAPTER_UNICAST_ADDRESS_LH__bindgen_ty_1() { assert_eq!( ::std::mem::size_of::<_IP_ADAPTER_UNICAST_ADDRESS_LH__bindgen_ty_1>(), 8usize, concat!( "Size of: ", stringify!(_IP_ADAPTER_UNICAST_ADDRESS_LH__bindgen_ty_1) ) ); assert_eq!( ::std::mem::align_of::<_IP_ADAPTER_UNICAST_ADDRESS_LH__bindgen_ty_1>(), 8usize, concat!( "Alignment of ", stringify!(_IP_ADAPTER_UNICAST_ADDRESS_LH__bindgen_ty_1) ) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_UNICAST_ADDRESS_LH__bindgen_ty_1)).Alignment as *const _ as usize }, 0usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_UNICAST_ADDRESS_LH__bindgen_ty_1), "::", stringify!(Alignment) ) ); } impl Clone for _IP_ADAPTER_UNICAST_ADDRESS_LH__bindgen_ty_1 { fn clone(&self) -> Self { *self } } #[test] fn bindgen_test_layout__IP_ADAPTER_UNICAST_ADDRESS_LH() { assert_eq!( ::std::mem::size_of::<_IP_ADAPTER_UNICAST_ADDRESS_LH>(), 64usize, concat!("Size of: ", stringify!(_IP_ADAPTER_UNICAST_ADDRESS_LH)) ); assert_eq!( ::std::mem::align_of::<_IP_ADAPTER_UNICAST_ADDRESS_LH>(), 8usize, concat!("Alignment of ", stringify!(_IP_ADAPTER_UNICAST_ADDRESS_LH)) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_UNICAST_ADDRESS_LH)).Next as *const _ as usize }, 8usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_UNICAST_ADDRESS_LH), "::", stringify!(Next) ) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_UNICAST_ADDRESS_LH)).Address as *const _ as usize }, 16usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_UNICAST_ADDRESS_LH), "::", stringify!(Address) ) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_UNICAST_ADDRESS_LH)).PrefixOrigin as *const _ as usize }, 32usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_UNICAST_ADDRESS_LH), "::", stringify!(PrefixOrigin) ) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_UNICAST_ADDRESS_LH)).SuffixOrigin as *const _ as usize }, 36usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_UNICAST_ADDRESS_LH), "::", stringify!(SuffixOrigin) ) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_UNICAST_ADDRESS_LH)).DadState as *const _ as usize }, 40usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_UNICAST_ADDRESS_LH), "::", stringify!(DadState) ) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_UNICAST_ADDRESS_LH)).ValidLifetime as *const _ as usize }, 44usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_UNICAST_ADDRESS_LH), "::", stringify!(ValidLifetime) ) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_UNICAST_ADDRESS_LH)).PreferredLifetime as *const _ as usize }, 48usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_UNICAST_ADDRESS_LH), "::", stringify!(PreferredLifetime) ) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_UNICAST_ADDRESS_LH)).LeaseLifetime as *const _ as usize }, 52usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_UNICAST_ADDRESS_LH), "::", stringify!(LeaseLifetime) ) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_UNICAST_ADDRESS_LH)).OnLinkPrefixLength as *const _ as usize }, 56usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_UNICAST_ADDRESS_LH), "::", stringify!(OnLinkPrefixLength) ) ); } impl Clone for _IP_ADAPTER_UNICAST_ADDRESS_LH { fn clone(&self) -> Self { *self } } pub type PIP_ADAPTER_UNICAST_ADDRESS_LH = *mut _IP_ADAPTER_UNICAST_ADDRESS_LH; #[repr(C)] #[derive(Copy)] pub struct _IP_ADAPTER_ANYCAST_ADDRESS_XP { pub __bindgen_anon_1: _IP_ADAPTER_ANYCAST_ADDRESS_XP__bindgen_ty_1, pub Next: *mut _IP_ADAPTER_ANYCAST_ADDRESS_XP, pub Address: SOCKET_ADDRESS, } #[repr(C)] #[derive(Copy)] pub union _IP_ADAPTER_ANYCAST_ADDRESS_XP__bindgen_ty_1 { pub Alignment: ULONGLONG, pub __bindgen_anon_1: _IP_ADAPTER_ANYCAST_ADDRESS_XP__bindgen_ty_1__bindgen_ty_1, _bindgen_union_align: u64, } #[repr(C)] #[derive(Debug, Copy)] pub struct _IP_ADAPTER_ANYCAST_ADDRESS_XP__bindgen_ty_1__bindgen_ty_1 { pub Length: ULONG, pub Flags: DWORD, } #[test] fn bindgen_test_layout__IP_ADAPTER_ANYCAST_ADDRESS_XP__bindgen_ty_1__bindgen_ty_1() { assert_eq!( ::std::mem::size_of::<_IP_ADAPTER_ANYCAST_ADDRESS_XP__bindgen_ty_1__bindgen_ty_1>(), 8usize, concat!( "Size of: ", stringify!(_IP_ADAPTER_ANYCAST_ADDRESS_XP__bindgen_ty_1__bindgen_ty_1) ) ); assert_eq!( ::std::mem::align_of::<_IP_ADAPTER_ANYCAST_ADDRESS_XP__bindgen_ty_1__bindgen_ty_1>(), 4usize, concat!( "Alignment of ", stringify!(_IP_ADAPTER_ANYCAST_ADDRESS_XP__bindgen_ty_1__bindgen_ty_1) ) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_ANYCAST_ADDRESS_XP__bindgen_ty_1__bindgen_ty_1)).Length as *const _ as usize }, 0usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_ANYCAST_ADDRESS_XP__bindgen_ty_1__bindgen_ty_1), "::", stringify!(Length) ) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_ANYCAST_ADDRESS_XP__bindgen_ty_1__bindgen_ty_1)).Flags as *const _ as usize }, 4usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_ANYCAST_ADDRESS_XP__bindgen_ty_1__bindgen_ty_1), "::", stringify!(Flags) ) ); } impl Clone for _IP_ADAPTER_ANYCAST_ADDRESS_XP__bindgen_ty_1__bindgen_ty_1 { fn clone(&self) -> Self { *self } } #[test] fn bindgen_test_layout__IP_ADAPTER_ANYCAST_ADDRESS_XP__bindgen_ty_1() { assert_eq!( ::std::mem::size_of::<_IP_ADAPTER_ANYCAST_ADDRESS_XP__bindgen_ty_1>(), 8usize, concat!( "Size of: ", stringify!(_IP_ADAPTER_ANYCAST_ADDRESS_XP__bindgen_ty_1) ) ); assert_eq!( ::std::mem::align_of::<_IP_ADAPTER_ANYCAST_ADDRESS_XP__bindgen_ty_1>(), 8usize, concat!( "Alignment of ", stringify!(_IP_ADAPTER_ANYCAST_ADDRESS_XP__bindgen_ty_1) ) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_ANYCAST_ADDRESS_XP__bindgen_ty_1)).Alignment as *const _ as usize }, 0usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_ANYCAST_ADDRESS_XP__bindgen_ty_1), "::", stringify!(Alignment) ) ); } impl Clone for _IP_ADAPTER_ANYCAST_ADDRESS_XP__bindgen_ty_1 { fn clone(&self) -> Self { *self } } #[test] fn bindgen_test_layout__IP_ADAPTER_ANYCAST_ADDRESS_XP() { assert_eq!( ::std::mem::size_of::<_IP_ADAPTER_ANYCAST_ADDRESS_XP>(), 32usize, concat!("Size of: ", stringify!(_IP_ADAPTER_ANYCAST_ADDRESS_XP)) ); assert_eq!( ::std::mem::align_of::<_IP_ADAPTER_ANYCAST_ADDRESS_XP>(), 8usize, concat!("Alignment of ", stringify!(_IP_ADAPTER_ANYCAST_ADDRESS_XP)) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_ANYCAST_ADDRESS_XP)).Next as *const _ as usize }, 8usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_ANYCAST_ADDRESS_XP), "::", stringify!(Next) ) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_ANYCAST_ADDRESS_XP)).Address as *const _ as usize }, 16usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_ANYCAST_ADDRESS_XP), "::", stringify!(Address) ) ); } impl Clone for _IP_ADAPTER_ANYCAST_ADDRESS_XP { fn clone(&self) -> Self { *self } } pub type PIP_ADAPTER_ANYCAST_ADDRESS_XP = *mut _IP_ADAPTER_ANYCAST_ADDRESS_XP; #[repr(C)] #[derive(Copy)] pub struct _IP_ADAPTER_MULTICAST_ADDRESS_XP { pub __bindgen_anon_1: _IP_ADAPTER_MULTICAST_ADDRESS_XP__bindgen_ty_1, pub Next: *mut _IP_ADAPTER_MULTICAST_ADDRESS_XP, pub Address: SOCKET_ADDRESS, } #[repr(C)] #[derive(Copy)] pub union _IP_ADAPTER_MULTICAST_ADDRESS_XP__bindgen_ty_1 { pub Alignment: ULONGLONG, pub __bindgen_anon_1: _IP_ADAPTER_MULTICAST_ADDRESS_XP__bindgen_ty_1__bindgen_ty_1, _bindgen_union_align: u64, } #[repr(C)] #[derive(Debug, Copy)] pub struct _IP_ADAPTER_MULTICAST_ADDRESS_XP__bindgen_ty_1__bindgen_ty_1 { pub Length: ULONG, pub Flags: DWORD, } #[test] fn bindgen_test_layout__IP_ADAPTER_MULTICAST_ADDRESS_XP__bindgen_ty_1__bindgen_ty_1() { assert_eq!( ::std::mem::size_of::<_IP_ADAPTER_MULTICAST_ADDRESS_XP__bindgen_ty_1__bindgen_ty_1>(), 8usize, concat!( "Size of: ", stringify!(_IP_ADAPTER_MULTICAST_ADDRESS_XP__bindgen_ty_1__bindgen_ty_1) ) ); assert_eq!( ::std::mem::align_of::<_IP_ADAPTER_MULTICAST_ADDRESS_XP__bindgen_ty_1__bindgen_ty_1>(), 4usize, concat!( "Alignment of ", stringify!(_IP_ADAPTER_MULTICAST_ADDRESS_XP__bindgen_ty_1__bindgen_ty_1) ) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_MULTICAST_ADDRESS_XP__bindgen_ty_1__bindgen_ty_1)).Length as *const _ as usize }, 0usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_MULTICAST_ADDRESS_XP__bindgen_ty_1__bindgen_ty_1), "::", stringify!(Length) ) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_MULTICAST_ADDRESS_XP__bindgen_ty_1__bindgen_ty_1)).Flags as *const _ as usize }, 4usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_MULTICAST_ADDRESS_XP__bindgen_ty_1__bindgen_ty_1), "::", stringify!(Flags) ) ); } impl Clone for _IP_ADAPTER_MULTICAST_ADDRESS_XP__bindgen_ty_1__bindgen_ty_1 { fn clone(&self) -> Self { *self } } #[test] fn bindgen_test_layout__IP_ADAPTER_MULTICAST_ADDRESS_XP__bindgen_ty_1() { assert_eq!( ::std::mem::size_of::<_IP_ADAPTER_MULTICAST_ADDRESS_XP__bindgen_ty_1>(), 8usize, concat!( "Size of: ", stringify!(_IP_ADAPTER_MULTICAST_ADDRESS_XP__bindgen_ty_1) ) ); assert_eq!( ::std::mem::align_of::<_IP_ADAPTER_MULTICAST_ADDRESS_XP__bindgen_ty_1>(), 8usize, concat!( "Alignment of ", stringify!(_IP_ADAPTER_MULTICAST_ADDRESS_XP__bindgen_ty_1) ) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_MULTICAST_ADDRESS_XP__bindgen_ty_1)).Alignment as *const _ as usize }, 0usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_MULTICAST_ADDRESS_XP__bindgen_ty_1), "::", stringify!(Alignment) ) ); } impl Clone for _IP_ADAPTER_MULTICAST_ADDRESS_XP__bindgen_ty_1 { fn clone(&self) -> Self { *self } } #[test] fn bindgen_test_layout__IP_ADAPTER_MULTICAST_ADDRESS_XP() { assert_eq!( ::std::mem::size_of::<_IP_ADAPTER_MULTICAST_ADDRESS_XP>(), 32usize, concat!("Size of: ", stringify!(_IP_ADAPTER_MULTICAST_ADDRESS_XP)) ); assert_eq!( ::std::mem::align_of::<_IP_ADAPTER_MULTICAST_ADDRESS_XP>(), 8usize, concat!( "Alignment of ", stringify!(_IP_ADAPTER_MULTICAST_ADDRESS_XP) ) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_MULTICAST_ADDRESS_XP)).Next as *const _ as usize }, 8usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_MULTICAST_ADDRESS_XP), "::", stringify!(Next) ) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_MULTICAST_ADDRESS_XP)).Address as *const _ as usize }, 16usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_MULTICAST_ADDRESS_XP), "::", stringify!(Address) ) ); } impl Clone for _IP_ADAPTER_MULTICAST_ADDRESS_XP { fn clone(&self) -> Self { *self } } pub type PIP_ADAPTER_MULTICAST_ADDRESS_XP = *mut _IP_ADAPTER_MULTICAST_ADDRESS_XP; #[repr(C)] #[derive(Copy)] pub struct _IP_ADAPTER_DNS_SERVER_ADDRESS_XP { pub __bindgen_anon_1: _IP_ADAPTER_DNS_SERVER_ADDRESS_XP__bindgen_ty_1, pub Next: *mut _IP_ADAPTER_DNS_SERVER_ADDRESS_XP, pub Address: SOCKET_ADDRESS, } #[repr(C)] #[derive(Copy)] pub union _IP_ADAPTER_DNS_SERVER_ADDRESS_XP__bindgen_ty_1 { pub Alignment: ULONGLONG, pub __bindgen_anon_1: _IP_ADAPTER_DNS_SERVER_ADDRESS_XP__bindgen_ty_1__bindgen_ty_1, _bindgen_union_align: u64, } #[repr(C)] #[derive(Debug, Copy)] pub struct _IP_ADAPTER_DNS_SERVER_ADDRESS_XP__bindgen_ty_1__bindgen_ty_1 { pub Length: ULONG, pub Reserved: DWORD, } #[test] fn bindgen_test_layout__IP_ADAPTER_DNS_SERVER_ADDRESS_XP__bindgen_ty_1__bindgen_ty_1() { assert_eq!( ::std::mem::size_of::<_IP_ADAPTER_DNS_SERVER_ADDRESS_XP__bindgen_ty_1__bindgen_ty_1>(), 8usize, concat!( "Size of: ", stringify!(_IP_ADAPTER_DNS_SERVER_ADDRESS_XP__bindgen_ty_1__bindgen_ty_1) ) ); assert_eq!( ::std::mem::align_of::<_IP_ADAPTER_DNS_SERVER_ADDRESS_XP__bindgen_ty_1__bindgen_ty_1>(), 4usize, concat!( "Alignment of ", stringify!(_IP_ADAPTER_DNS_SERVER_ADDRESS_XP__bindgen_ty_1__bindgen_ty_1) ) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_DNS_SERVER_ADDRESS_XP__bindgen_ty_1__bindgen_ty_1)).Length as *const _ as usize }, 0usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_DNS_SERVER_ADDRESS_XP__bindgen_ty_1__bindgen_ty_1), "::", stringify!(Length) ) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_DNS_SERVER_ADDRESS_XP__bindgen_ty_1__bindgen_ty_1)).Reserved as *const _ as usize }, 4usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_DNS_SERVER_ADDRESS_XP__bindgen_ty_1__bindgen_ty_1), "::", stringify!(Reserved) ) ); } impl Clone for _IP_ADAPTER_DNS_SERVER_ADDRESS_XP__bindgen_ty_1__bindgen_ty_1 { fn clone(&self) -> Self { *self } } #[test] fn bindgen_test_layout__IP_ADAPTER_DNS_SERVER_ADDRESS_XP__bindgen_ty_1() { assert_eq!( ::std::mem::size_of::<_IP_ADAPTER_DNS_SERVER_ADDRESS_XP__bindgen_ty_1>(), 8usize, concat!( "Size of: ", stringify!(_IP_ADAPTER_DNS_SERVER_ADDRESS_XP__bindgen_ty_1) ) ); assert_eq!( ::std::mem::align_of::<_IP_ADAPTER_DNS_SERVER_ADDRESS_XP__bindgen_ty_1>(), 8usize, concat!( "Alignment of ", stringify!(_IP_ADAPTER_DNS_SERVER_ADDRESS_XP__bindgen_ty_1) ) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_DNS_SERVER_ADDRESS_XP__bindgen_ty_1)).Alignment as *const _ as usize }, 0usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_DNS_SERVER_ADDRESS_XP__bindgen_ty_1), "::", stringify!(Alignment) ) ); } impl Clone for _IP_ADAPTER_DNS_SERVER_ADDRESS_XP__bindgen_ty_1 { fn clone(&self) -> Self { *self } } #[test] fn bindgen_test_layout__IP_ADAPTER_DNS_SERVER_ADDRESS_XP() { assert_eq!( ::std::mem::size_of::<_IP_ADAPTER_DNS_SERVER_ADDRESS_XP>(), 32usize, concat!("Size of: ", stringify!(_IP_ADAPTER_DNS_SERVER_ADDRESS_XP)) ); assert_eq!( ::std::mem::align_of::<_IP_ADAPTER_DNS_SERVER_ADDRESS_XP>(), 8usize, concat!( "Alignment of ", stringify!(_IP_ADAPTER_DNS_SERVER_ADDRESS_XP) ) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_DNS_SERVER_ADDRESS_XP)).Next as *const _ as usize }, 8usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_DNS_SERVER_ADDRESS_XP), "::", stringify!(Next) ) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_DNS_SERVER_ADDRESS_XP)).Address as *const _ as usize }, 16usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_DNS_SERVER_ADDRESS_XP), "::", stringify!(Address) ) ); } impl Clone for _IP_ADAPTER_DNS_SERVER_ADDRESS_XP { fn clone(&self) -> Self { *self } } pub type PIP_ADAPTER_DNS_SERVER_ADDRESS_XP = *mut _IP_ADAPTER_DNS_SERVER_ADDRESS_XP; #[repr(C)] #[derive(Copy)] pub struct _IP_ADAPTER_WINS_SERVER_ADDRESS_LH { pub __bindgen_anon_1: _IP_ADAPTER_WINS_SERVER_ADDRESS_LH__bindgen_ty_1, pub Next: *mut _IP_ADAPTER_WINS_SERVER_ADDRESS_LH, pub Address: SOCKET_ADDRESS, } #[repr(C)] #[derive(Copy)] pub union _IP_ADAPTER_WINS_SERVER_ADDRESS_LH__bindgen_ty_1 { pub Alignment: ULONGLONG, pub __bindgen_anon_1: _IP_ADAPTER_WINS_SERVER_ADDRESS_LH__bindgen_ty_1__bindgen_ty_1, _bindgen_union_align: u64, } #[repr(C)] #[derive(Debug, Copy)] pub struct _IP_ADAPTER_WINS_SERVER_ADDRESS_LH__bindgen_ty_1__bindgen_ty_1 { pub Length: ULONG, pub Reserved: DWORD, } #[test] fn bindgen_test_layout__IP_ADAPTER_WINS_SERVER_ADDRESS_LH__bindgen_ty_1__bindgen_ty_1() { assert_eq!( ::std::mem::size_of::<_IP_ADAPTER_WINS_SERVER_ADDRESS_LH__bindgen_ty_1__bindgen_ty_1>(), 8usize, concat!( "Size of: ", stringify!(_IP_ADAPTER_WINS_SERVER_ADDRESS_LH__bindgen_ty_1__bindgen_ty_1) ) ); assert_eq!( ::std::mem::align_of::<_IP_ADAPTER_WINS_SERVER_ADDRESS_LH__bindgen_ty_1__bindgen_ty_1>(), 4usize, concat!( "Alignment of ", stringify!(_IP_ADAPTER_WINS_SERVER_ADDRESS_LH__bindgen_ty_1__bindgen_ty_1) ) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_WINS_SERVER_ADDRESS_LH__bindgen_ty_1__bindgen_ty_1)).Length as *const _ as usize }, 0usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_WINS_SERVER_ADDRESS_LH__bindgen_ty_1__bindgen_ty_1), "::", stringify!(Length) ) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_WINS_SERVER_ADDRESS_LH__bindgen_ty_1__bindgen_ty_1)) .Reserved as *const _ as usize }, 4usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_WINS_SERVER_ADDRESS_LH__bindgen_ty_1__bindgen_ty_1), "::", stringify!(Reserved) ) ); } impl Clone for _IP_ADAPTER_WINS_SERVER_ADDRESS_LH__bindgen_ty_1__bindgen_ty_1 { fn clone(&self) -> Self { *self } } #[test] fn bindgen_test_layout__IP_ADAPTER_WINS_SERVER_ADDRESS_LH__bindgen_ty_1() { assert_eq!( ::std::mem::size_of::<_IP_ADAPTER_WINS_SERVER_ADDRESS_LH__bindgen_ty_1>(), 8usize, concat!( "Size of: ", stringify!(_IP_ADAPTER_WINS_SERVER_ADDRESS_LH__bindgen_ty_1) ) ); assert_eq!( ::std::mem::align_of::<_IP_ADAPTER_WINS_SERVER_ADDRESS_LH__bindgen_ty_1>(), 8usize, concat!( "Alignment of ", stringify!(_IP_ADAPTER_WINS_SERVER_ADDRESS_LH__bindgen_ty_1) ) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_WINS_SERVER_ADDRESS_LH__bindgen_ty_1)).Alignment as *const _ as usize }, 0usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_WINS_SERVER_ADDRESS_LH__bindgen_ty_1), "::", stringify!(Alignment) ) ); } impl Clone for _IP_ADAPTER_WINS_SERVER_ADDRESS_LH__bindgen_ty_1 { fn clone(&self) -> Self { *self } } #[test] fn bindgen_test_layout__IP_ADAPTER_WINS_SERVER_ADDRESS_LH() { assert_eq!( ::std::mem::size_of::<_IP_ADAPTER_WINS_SERVER_ADDRESS_LH>(), 32usize, concat!("Size of: ", stringify!(_IP_ADAPTER_WINS_SERVER_ADDRESS_LH)) ); assert_eq!( ::std::mem::align_of::<_IP_ADAPTER_WINS_SERVER_ADDRESS_LH>(), 8usize, concat!( "Alignment of ", stringify!(_IP_ADAPTER_WINS_SERVER_ADDRESS_LH) ) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_WINS_SERVER_ADDRESS_LH)).Next as *const _ as usize }, 8usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_WINS_SERVER_ADDRESS_LH), "::", stringify!(Next) ) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_WINS_SERVER_ADDRESS_LH)).Address as *const _ as usize }, 16usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_WINS_SERVER_ADDRESS_LH), "::", stringify!(Address) ) ); } impl Clone for _IP_ADAPTER_WINS_SERVER_ADDRESS_LH { fn clone(&self) -> Self { *self } } pub type PIP_ADAPTER_WINS_SERVER_ADDRESS_LH = *mut _IP_ADAPTER_WINS_SERVER_ADDRESS_LH; #[repr(C)] #[derive(Copy)] pub struct _IP_ADAPTER_GATEWAY_ADDRESS_LH { pub __bindgen_anon_1: _IP_ADAPTER_GATEWAY_ADDRESS_LH__bindgen_ty_1, pub Next: *mut _IP_ADAPTER_GATEWAY_ADDRESS_LH, pub Address: SOCKET_ADDRESS, } #[repr(C)] #[derive(Copy)] pub union _IP_ADAPTER_GATEWAY_ADDRESS_LH__bindgen_ty_1 { pub Alignment: ULONGLONG, pub __bindgen_anon_1: _IP_ADAPTER_GATEWAY_ADDRESS_LH__bindgen_ty_1__bindgen_ty_1, _bindgen_union_align: u64, } #[repr(C)] #[derive(Debug, Copy)] pub struct _IP_ADAPTER_GATEWAY_ADDRESS_LH__bindgen_ty_1__bindgen_ty_1 { pub Length: ULONG, pub Reserved: DWORD, } #[test] fn bindgen_test_layout__IP_ADAPTER_GATEWAY_ADDRESS_LH__bindgen_ty_1__bindgen_ty_1() { assert_eq!( ::std::mem::size_of::<_IP_ADAPTER_GATEWAY_ADDRESS_LH__bindgen_ty_1__bindgen_ty_1>(), 8usize, concat!( "Size of: ", stringify!(_IP_ADAPTER_GATEWAY_ADDRESS_LH__bindgen_ty_1__bindgen_ty_1) ) ); assert_eq!( ::std::mem::align_of::<_IP_ADAPTER_GATEWAY_ADDRESS_LH__bindgen_ty_1__bindgen_ty_1>(), 4usize, concat!( "Alignment of ", stringify!(_IP_ADAPTER_GATEWAY_ADDRESS_LH__bindgen_ty_1__bindgen_ty_1) ) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_GATEWAY_ADDRESS_LH__bindgen_ty_1__bindgen_ty_1)).Length as *const _ as usize }, 0usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_GATEWAY_ADDRESS_LH__bindgen_ty_1__bindgen_ty_1), "::", stringify!(Length) ) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_GATEWAY_ADDRESS_LH__bindgen_ty_1__bindgen_ty_1)).Reserved as *const _ as usize }, 4usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_GATEWAY_ADDRESS_LH__bindgen_ty_1__bindgen_ty_1), "::", stringify!(Reserved) ) ); } impl Clone for _IP_ADAPTER_GATEWAY_ADDRESS_LH__bindgen_ty_1__bindgen_ty_1 { fn clone(&self) -> Self { *self } } #[test] fn bindgen_test_layout__IP_ADAPTER_GATEWAY_ADDRESS_LH__bindgen_ty_1() { assert_eq!( ::std::mem::size_of::<_IP_ADAPTER_GATEWAY_ADDRESS_LH__bindgen_ty_1>(), 8usize, concat!( "Size of: ", stringify!(_IP_ADAPTER_GATEWAY_ADDRESS_LH__bindgen_ty_1) ) ); assert_eq!( ::std::mem::align_of::<_IP_ADAPTER_GATEWAY_ADDRESS_LH__bindgen_ty_1>(), 8usize, concat!( "Alignment of ", stringify!(_IP_ADAPTER_GATEWAY_ADDRESS_LH__bindgen_ty_1) ) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_GATEWAY_ADDRESS_LH__bindgen_ty_1)).Alignment as *const _ as usize }, 0usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_GATEWAY_ADDRESS_LH__bindgen_ty_1), "::", stringify!(Alignment) ) ); } impl Clone for _IP_ADAPTER_GATEWAY_ADDRESS_LH__bindgen_ty_1 { fn clone(&self) -> Self { *self } } #[test] fn bindgen_test_layout__IP_ADAPTER_GATEWAY_ADDRESS_LH() { assert_eq!( ::std::mem::size_of::<_IP_ADAPTER_GATEWAY_ADDRESS_LH>(), 32usize, concat!("Size of: ", stringify!(_IP_ADAPTER_GATEWAY_ADDRESS_LH)) ); assert_eq!( ::std::mem::align_of::<_IP_ADAPTER_GATEWAY_ADDRESS_LH>(), 8usize, concat!("Alignment of ", stringify!(_IP_ADAPTER_GATEWAY_ADDRESS_LH)) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_GATEWAY_ADDRESS_LH)).Next as *const _ as usize }, 8usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_GATEWAY_ADDRESS_LH), "::", stringify!(Next) ) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_GATEWAY_ADDRESS_LH)).Address as *const _ as usize }, 16usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_GATEWAY_ADDRESS_LH), "::", stringify!(Address) ) ); } impl Clone for _IP_ADAPTER_GATEWAY_ADDRESS_LH { fn clone(&self) -> Self { *self } } pub type PIP_ADAPTER_GATEWAY_ADDRESS_LH = *mut _IP_ADAPTER_GATEWAY_ADDRESS_LH; #[repr(C)] #[derive(Copy)] pub struct _IP_ADAPTER_PREFIX_XP { pub __bindgen_anon_1: _IP_ADAPTER_PREFIX_XP__bindgen_ty_1, pub Next: *mut _IP_ADAPTER_PREFIX_XP, pub Address: SOCKET_ADDRESS, pub PrefixLength: ULONG, } #[repr(C)] #[derive(Copy)] pub union _IP_ADAPTER_PREFIX_XP__bindgen_ty_1 { pub Alignment: ULONGLONG, pub __bindgen_anon_1: _IP_ADAPTER_PREFIX_XP__bindgen_ty_1__bindgen_ty_1, _bindgen_union_align: u64, } #[repr(C)] #[derive(Debug, Copy)] pub struct _IP_ADAPTER_PREFIX_XP__bindgen_ty_1__bindgen_ty_1 { pub Length: ULONG, pub Flags: DWORD, } #[test] fn bindgen_test_layout__IP_ADAPTER_PREFIX_XP__bindgen_ty_1__bindgen_ty_1() { assert_eq!( ::std::mem::size_of::<_IP_ADAPTER_PREFIX_XP__bindgen_ty_1__bindgen_ty_1>(), 8usize, concat!( "Size of: ", stringify!(_IP_ADAPTER_PREFIX_XP__bindgen_ty_1__bindgen_ty_1) ) ); assert_eq!( ::std::mem::align_of::<_IP_ADAPTER_PREFIX_XP__bindgen_ty_1__bindgen_ty_1>(), 4usize, concat!( "Alignment of ", stringify!(_IP_ADAPTER_PREFIX_XP__bindgen_ty_1__bindgen_ty_1) ) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_PREFIX_XP__bindgen_ty_1__bindgen_ty_1)).Length as *const _ as usize }, 0usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_PREFIX_XP__bindgen_ty_1__bindgen_ty_1), "::", stringify!(Length) ) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_PREFIX_XP__bindgen_ty_1__bindgen_ty_1)).Flags as *const _ as usize }, 4usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_PREFIX_XP__bindgen_ty_1__bindgen_ty_1), "::", stringify!(Flags) ) ); } impl Clone for _IP_ADAPTER_PREFIX_XP__bindgen_ty_1__bindgen_ty_1 { fn clone(&self) -> Self { *self } } #[test] fn bindgen_test_layout__IP_ADAPTER_PREFIX_XP__bindgen_ty_1() { assert_eq!( ::std::mem::size_of::<_IP_ADAPTER_PREFIX_XP__bindgen_ty_1>(), 8usize, concat!("Size of: ", stringify!(_IP_ADAPTER_PREFIX_XP__bindgen_ty_1)) ); assert_eq!( ::std::mem::align_of::<_IP_ADAPTER_PREFIX_XP__bindgen_ty_1>(), 8usize, concat!( "Alignment of ", stringify!(_IP_ADAPTER_PREFIX_XP__bindgen_ty_1) ) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_PREFIX_XP__bindgen_ty_1)).Alignment as *const _ as usize }, 0usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_PREFIX_XP__bindgen_ty_1), "::", stringify!(Alignment) ) ); } impl Clone for _IP_ADAPTER_PREFIX_XP__bindgen_ty_1 { fn clone(&self) -> Self { *self } } #[test] fn bindgen_test_layout__IP_ADAPTER_PREFIX_XP() { assert_eq!( ::std::mem::size_of::<_IP_ADAPTER_PREFIX_XP>(), 40usize, concat!("Size of: ", stringify!(_IP_ADAPTER_PREFIX_XP)) ); assert_eq!( ::std::mem::align_of::<_IP_ADAPTER_PREFIX_XP>(), 8usize, concat!("Alignment of ", stringify!(_IP_ADAPTER_PREFIX_XP)) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_PREFIX_XP)).Next as *const _ as usize }, 8usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_PREFIX_XP), "::", stringify!(Next) ) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_PREFIX_XP)).Address as *const _ as usize }, 16usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_PREFIX_XP), "::", stringify!(Address) ) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_PREFIX_XP)).PrefixLength as *const _ as usize }, 32usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_PREFIX_XP), "::", stringify!(PrefixLength) ) ); } impl Clone for _IP_ADAPTER_PREFIX_XP { fn clone(&self) -> Self { *self } } pub type PIP_ADAPTER_PREFIX_XP = *mut _IP_ADAPTER_PREFIX_XP; #[repr(C)] #[derive(Copy)] pub struct _IP_ADAPTER_DNS_SUFFIX { pub Next: *mut _IP_ADAPTER_DNS_SUFFIX, pub String: [WCHAR; 256usize], } #[test] fn bindgen_test_layout__IP_ADAPTER_DNS_SUFFIX() { assert_eq!( ::std::mem::size_of::<_IP_ADAPTER_DNS_SUFFIX>(), 520usize, concat!("Size of: ", stringify!(_IP_ADAPTER_DNS_SUFFIX)) ); assert_eq!( ::std::mem::align_of::<_IP_ADAPTER_DNS_SUFFIX>(), 8usize, concat!("Alignment of ", stringify!(_IP_ADAPTER_DNS_SUFFIX)) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_DNS_SUFFIX)).Next as *const _ as usize }, 0usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_DNS_SUFFIX), "::", stringify!(Next) ) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_DNS_SUFFIX)).String as *const _ as usize }, 8usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_DNS_SUFFIX), "::", stringify!(String) ) ); } impl Clone for _IP_ADAPTER_DNS_SUFFIX { fn clone(&self) -> Self { *self } } pub type PIP_ADAPTER_DNS_SUFFIX = *mut _IP_ADAPTER_DNS_SUFFIX; #[repr(C)] #[derive(Copy)] pub struct _IP_ADAPTER_ADDRESSES_LH { pub __bindgen_anon_1: _IP_ADAPTER_ADDRESSES_LH__bindgen_ty_1, pub Next: *mut _IP_ADAPTER_ADDRESSES_LH, pub AdapterName: PCHAR, pub FirstUnicastAddress: PIP_ADAPTER_UNICAST_ADDRESS_LH, pub FirstAnycastAddress: PIP_ADAPTER_ANYCAST_ADDRESS_XP, pub FirstMulticastAddress: PIP_ADAPTER_MULTICAST_ADDRESS_XP, pub FirstDnsServerAddress: PIP_ADAPTER_DNS_SERVER_ADDRESS_XP, pub DnsSuffix: PWCHAR, pub Description: PWCHAR, pub FriendlyName: PWCHAR, pub PhysicalAddress: [BYTE; 8usize], pub PhysicalAddressLength: ULONG, pub __bindgen_anon_2: _IP_ADAPTER_ADDRESSES_LH__bindgen_ty_2, pub Mtu: ULONG, pub IfType: IFTYPE, pub OperStatus: IF_OPER_STATUS, pub Ipv6IfIndex: IF_INDEX, pub ZoneIndices: [ULONG; 16usize], pub FirstPrefix: PIP_ADAPTER_PREFIX_XP, pub TransmitLinkSpeed: ULONG64, pub ReceiveLinkSpeed: ULONG64, pub FirstWinsServerAddress: PIP_ADAPTER_WINS_SERVER_ADDRESS_LH, pub FirstGatewayAddress: PIP_ADAPTER_GATEWAY_ADDRESS_LH, pub Ipv4Metric: ULONG, pub Ipv6Metric: ULONG, pub Luid: IF_LUID, pub Dhcpv4Server: SOCKET_ADDRESS, pub CompartmentId: NET_IF_COMPARTMENT_ID, pub NetworkGuid: NET_IF_NETWORK_GUID, pub ConnectionType: NET_IF_CONNECTION_TYPE, pub TunnelType: TUNNEL_TYPE, pub Dhcpv6Server: SOCKET_ADDRESS, pub Dhcpv6ClientDuid: [BYTE; 130usize], pub Dhcpv6ClientDuidLength: ULONG, pub Dhcpv6Iaid: ULONG, pub FirstDnsSuffix: PIP_ADAPTER_DNS_SUFFIX, } #[repr(C)] #[derive(Copy)] pub union _IP_ADAPTER_ADDRESSES_LH__bindgen_ty_1 { pub Alignment: ULONGLONG, pub __bindgen_anon_1: _IP_ADAPTER_ADDRESSES_LH__bindgen_ty_1__bindgen_ty_1, _bindgen_union_align: u64, } #[repr(C)] #[derive(Debug, Copy)] pub struct _IP_ADAPTER_ADDRESSES_LH__bindgen_ty_1__bindgen_ty_1 { pub Length: ULONG, pub IfIndex: IF_INDEX, } #[test] fn bindgen_test_layout__IP_ADAPTER_ADDRESSES_LH__bindgen_ty_1__bindgen_ty_1() { assert_eq!( ::std::mem::size_of::<_IP_ADAPTER_ADDRESSES_LH__bindgen_ty_1__bindgen_ty_1>(), 8usize, concat!( "Size of: ", stringify!(_IP_ADAPTER_ADDRESSES_LH__bindgen_ty_1__bindgen_ty_1) ) ); assert_eq!( ::std::mem::align_of::<_IP_ADAPTER_ADDRESSES_LH__bindgen_ty_1__bindgen_ty_1>(), 4usize, concat!( "Alignment of ", stringify!(_IP_ADAPTER_ADDRESSES_LH__bindgen_ty_1__bindgen_ty_1) ) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_ADDRESSES_LH__bindgen_ty_1__bindgen_ty_1)).Length as *const _ as usize }, 0usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_ADDRESSES_LH__bindgen_ty_1__bindgen_ty_1), "::", stringify!(Length) ) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_ADDRESSES_LH__bindgen_ty_1__bindgen_ty_1)).IfIndex as *const _ as usize }, 4usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_ADDRESSES_LH__bindgen_ty_1__bindgen_ty_1), "::", stringify!(IfIndex) ) ); } impl Clone for _IP_ADAPTER_ADDRESSES_LH__bindgen_ty_1__bindgen_ty_1 { fn clone(&self) -> Self { *self } } #[test] fn bindgen_test_layout__IP_ADAPTER_ADDRESSES_LH__bindgen_ty_1() { assert_eq!( ::std::mem::size_of::<_IP_ADAPTER_ADDRESSES_LH__bindgen_ty_1>(), 8usize, concat!( "Size of: ", stringify!(_IP_ADAPTER_ADDRESSES_LH__bindgen_ty_1) ) ); assert_eq!( ::std::mem::align_of::<_IP_ADAPTER_ADDRESSES_LH__bindgen_ty_1>(), 8usize, concat!( "Alignment of ", stringify!(_IP_ADAPTER_ADDRESSES_LH__bindgen_ty_1) ) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_ADDRESSES_LH__bindgen_ty_1)).Alignment as *const _ as usize }, 0usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_ADDRESSES_LH__bindgen_ty_1), "::", stringify!(Alignment) ) ); } impl Clone for _IP_ADAPTER_ADDRESSES_LH__bindgen_ty_1 { fn clone(&self) -> Self { *self } } #[repr(C)] #[derive(Copy)] pub union _IP_ADAPTER_ADDRESSES_LH__bindgen_ty_2 { pub Flags: ULONG, pub __bindgen_anon_1: _IP_ADAPTER_ADDRESSES_LH__bindgen_ty_2__bindgen_ty_1, _bindgen_union_align: u32, } #[repr(C)] #[derive(Debug, Copy)] pub struct _IP_ADAPTER_ADDRESSES_LH__bindgen_ty_2__bindgen_ty_1 { pub _bitfield_1: [u8; 2usize], pub __bindgen_padding_0: u16, pub __bindgen_align: [u32; 0usize], } #[test] fn bindgen_test_layout__IP_ADAPTER_ADDRESSES_LH__bindgen_ty_2__bindgen_ty_1() { assert_eq!( ::std::mem::size_of::<_IP_ADAPTER_ADDRESSES_LH__bindgen_ty_2__bindgen_ty_1>(), 4usize, concat!( "Size of: ", stringify!(_IP_ADAPTER_ADDRESSES_LH__bindgen_ty_2__bindgen_ty_1) ) ); assert_eq!( ::std::mem::align_of::<_IP_ADAPTER_ADDRESSES_LH__bindgen_ty_2__bindgen_ty_1>(), 4usize, concat!( "Alignment of ", stringify!(_IP_ADAPTER_ADDRESSES_LH__bindgen_ty_2__bindgen_ty_1) ) ); } impl Clone for _IP_ADAPTER_ADDRESSES_LH__bindgen_ty_2__bindgen_ty_1 { fn clone(&self) -> Self { *self } } impl _IP_ADAPTER_ADDRESSES_LH__bindgen_ty_2__bindgen_ty_1 { #[inline] pub fn DdnsEnabled(&self) -> ULONG { let mut unit_field_val: u16 = unsafe { ::std::mem::uninitialized() }; unsafe { ::std::ptr::copy_nonoverlapping( &self._bitfield_1 as *const _ as *const u8, &mut unit_field_val as *mut u16 as *mut u8, ::std::mem::size_of::(), ) }; let mask = 0x1 as u16; let val = (unit_field_val & mask) >> 0usize; unsafe { ::std::mem::transmute(val as u32) } } #[inline] pub fn set_DdnsEnabled(&mut self, val: ULONG) { let mask = 0x1 as u16; let val = val as u32 as u16; let mut unit_field_val: u16 = unsafe { ::std::mem::uninitialized() }; unsafe { ::std::ptr::copy_nonoverlapping( &self._bitfield_1 as *const _ as *const u8, &mut unit_field_val as *mut u16 as *mut u8, ::std::mem::size_of::(), ) }; unit_field_val &= !mask; unit_field_val |= (val << 0usize) & mask; unsafe { ::std::ptr::copy_nonoverlapping( &unit_field_val as *const _ as *const u8, &mut self._bitfield_1 as *mut _ as *mut u8, ::std::mem::size_of::(), ); } } #[inline] pub fn RegisterAdapterSuffix(&self) -> ULONG { let mut unit_field_val: u16 = unsafe { ::std::mem::uninitialized() }; unsafe { ::std::ptr::copy_nonoverlapping( &self._bitfield_1 as *const _ as *const u8, &mut unit_field_val as *mut u16 as *mut u8, ::std::mem::size_of::(), ) }; let mask = 0x2 as u16; let val = (unit_field_val & mask) >> 1usize; unsafe { ::std::mem::transmute(val as u32) } } #[inline] pub fn set_RegisterAdapterSuffix(&mut self, val: ULONG) { let mask = 0x2 as u16; let val = val as u32 as u16; let mut unit_field_val: u16 = unsafe { ::std::mem::uninitialized() }; unsafe { ::std::ptr::copy_nonoverlapping( &self._bitfield_1 as *const _ as *const u8, &mut unit_field_val as *mut u16 as *mut u8, ::std::mem::size_of::(), ) }; unit_field_val &= !mask; unit_field_val |= (val << 1usize) & mask; unsafe { ::std::ptr::copy_nonoverlapping( &unit_field_val as *const _ as *const u8, &mut self._bitfield_1 as *mut _ as *mut u8, ::std::mem::size_of::(), ); } } #[inline] pub fn Dhcpv4Enabled(&self) -> ULONG { let mut unit_field_val: u16 = unsafe { ::std::mem::uninitialized() }; unsafe { ::std::ptr::copy_nonoverlapping( &self._bitfield_1 as *const _ as *const u8, &mut unit_field_val as *mut u16 as *mut u8, ::std::mem::size_of::(), ) }; let mask = 0x4 as u16; let val = (unit_field_val & mask) >> 2usize; unsafe { ::std::mem::transmute(val as u32) } } #[inline] pub fn set_Dhcpv4Enabled(&mut self, val: ULONG) { let mask = 0x4 as u16; let val = val as u32 as u16; let mut unit_field_val: u16 = unsafe { ::std::mem::uninitialized() }; unsafe { ::std::ptr::copy_nonoverlapping( &self._bitfield_1 as *const _ as *const u8, &mut unit_field_val as *mut u16 as *mut u8, ::std::mem::size_of::(), ) }; unit_field_val &= !mask; unit_field_val |= (val << 2usize) & mask; unsafe { ::std::ptr::copy_nonoverlapping( &unit_field_val as *const _ as *const u8, &mut self._bitfield_1 as *mut _ as *mut u8, ::std::mem::size_of::(), ); } } #[inline] pub fn ReceiveOnly(&self) -> ULONG { let mut unit_field_val: u16 = unsafe { ::std::mem::uninitialized() }; unsafe { ::std::ptr::copy_nonoverlapping( &self._bitfield_1 as *const _ as *const u8, &mut unit_field_val as *mut u16 as *mut u8, ::std::mem::size_of::(), ) }; let mask = 0x8 as u16; let val = (unit_field_val & mask) >> 3usize; unsafe { ::std::mem::transmute(val as u32) } } #[inline] pub fn set_ReceiveOnly(&mut self, val: ULONG) { let mask = 0x8 as u16; let val = val as u32 as u16; let mut unit_field_val: u16 = unsafe { ::std::mem::uninitialized() }; unsafe { ::std::ptr::copy_nonoverlapping( &self._bitfield_1 as *const _ as *const u8, &mut unit_field_val as *mut u16 as *mut u8, ::std::mem::size_of::(), ) }; unit_field_val &= !mask; unit_field_val |= (val << 3usize) & mask; unsafe { ::std::ptr::copy_nonoverlapping( &unit_field_val as *const _ as *const u8, &mut self._bitfield_1 as *mut _ as *mut u8, ::std::mem::size_of::(), ); } } #[inline] pub fn NoMulticast(&self) -> ULONG { let mut unit_field_val: u16 = unsafe { ::std::mem::uninitialized() }; unsafe { ::std::ptr::copy_nonoverlapping( &self._bitfield_1 as *const _ as *const u8, &mut unit_field_val as *mut u16 as *mut u8, ::std::mem::size_of::(), ) }; let mask = 0x10 as u16; let val = (unit_field_val & mask) >> 4usize; unsafe { ::std::mem::transmute(val as u32) } } #[inline] pub fn set_NoMulticast(&mut self, val: ULONG) { let mask = 0x10 as u16; let val = val as u32 as u16; let mut unit_field_val: u16 = unsafe { ::std::mem::uninitialized() }; unsafe { ::std::ptr::copy_nonoverlapping( &self._bitfield_1 as *const _ as *const u8, &mut unit_field_val as *mut u16 as *mut u8, ::std::mem::size_of::(), ) }; unit_field_val &= !mask; unit_field_val |= (val << 4usize) & mask; unsafe { ::std::ptr::copy_nonoverlapping( &unit_field_val as *const _ as *const u8, &mut self._bitfield_1 as *mut _ as *mut u8, ::std::mem::size_of::(), ); } } #[inline] pub fn Ipv6OtherStatefulConfig(&self) -> ULONG { let mut unit_field_val: u16 = unsafe { ::std::mem::uninitialized() }; unsafe { ::std::ptr::copy_nonoverlapping( &self._bitfield_1 as *const _ as *const u8, &mut unit_field_val as *mut u16 as *mut u8, ::std::mem::size_of::(), ) }; let mask = 0x20 as u16; let val = (unit_field_val & mask) >> 5usize; unsafe { ::std::mem::transmute(val as u32) } } #[inline] pub fn set_Ipv6OtherStatefulConfig(&mut self, val: ULONG) { let mask = 0x20 as u16; let val = val as u32 as u16; let mut unit_field_val: u16 = unsafe { ::std::mem::uninitialized() }; unsafe { ::std::ptr::copy_nonoverlapping( &self._bitfield_1 as *const _ as *const u8, &mut unit_field_val as *mut u16 as *mut u8, ::std::mem::size_of::(), ) }; unit_field_val &= !mask; unit_field_val |= (val << 5usize) & mask; unsafe { ::std::ptr::copy_nonoverlapping( &unit_field_val as *const _ as *const u8, &mut self._bitfield_1 as *mut _ as *mut u8, ::std::mem::size_of::(), ); } } #[inline] pub fn NetbiosOverTcpipEnabled(&self) -> ULONG { let mut unit_field_val: u16 = unsafe { ::std::mem::uninitialized() }; unsafe { ::std::ptr::copy_nonoverlapping( &self._bitfield_1 as *const _ as *const u8, &mut unit_field_val as *mut u16 as *mut u8, ::std::mem::size_of::(), ) }; let mask = 0x40 as u16; let val = (unit_field_val & mask) >> 6usize; unsafe { ::std::mem::transmute(val as u32) } } #[inline] pub fn set_NetbiosOverTcpipEnabled(&mut self, val: ULONG) { let mask = 0x40 as u16; let val = val as u32 as u16; let mut unit_field_val: u16 = unsafe { ::std::mem::uninitialized() }; unsafe { ::std::ptr::copy_nonoverlapping( &self._bitfield_1 as *const _ as *const u8, &mut unit_field_val as *mut u16 as *mut u8, ::std::mem::size_of::(), ) }; unit_field_val &= !mask; unit_field_val |= (val << 6usize) & mask; unsafe { ::std::ptr::copy_nonoverlapping( &unit_field_val as *const _ as *const u8, &mut self._bitfield_1 as *mut _ as *mut u8, ::std::mem::size_of::(), ); } } #[inline] pub fn Ipv4Enabled(&self) -> ULONG { let mut unit_field_val: u16 = unsafe { ::std::mem::uninitialized() }; unsafe { ::std::ptr::copy_nonoverlapping( &self._bitfield_1 as *const _ as *const u8, &mut unit_field_val as *mut u16 as *mut u8, ::std::mem::size_of::(), ) }; let mask = 0x80 as u16; let val = (unit_field_val & mask) >> 7usize; unsafe { ::std::mem::transmute(val as u32) } } #[inline] pub fn set_Ipv4Enabled(&mut self, val: ULONG) { let mask = 0x80 as u16; let val = val as u32 as u16; let mut unit_field_val: u16 = unsafe { ::std::mem::uninitialized() }; unsafe { ::std::ptr::copy_nonoverlapping( &self._bitfield_1 as *const _ as *const u8, &mut unit_field_val as *mut u16 as *mut u8, ::std::mem::size_of::(), ) }; unit_field_val &= !mask; unit_field_val |= (val << 7usize) & mask; unsafe { ::std::ptr::copy_nonoverlapping( &unit_field_val as *const _ as *const u8, &mut self._bitfield_1 as *mut _ as *mut u8, ::std::mem::size_of::(), ); } } #[inline] pub fn Ipv6Enabled(&self) -> ULONG { let mut unit_field_val: u16 = unsafe { ::std::mem::uninitialized() }; unsafe { ::std::ptr::copy_nonoverlapping( &self._bitfield_1 as *const _ as *const u8, &mut unit_field_val as *mut u16 as *mut u8, ::std::mem::size_of::(), ) }; let mask = 0x100 as u16; let val = (unit_field_val & mask) >> 8usize; unsafe { ::std::mem::transmute(val as u32) } } #[inline] pub fn set_Ipv6Enabled(&mut self, val: ULONG) { let mask = 0x100 as u16; let val = val as u32 as u16; let mut unit_field_val: u16 = unsafe { ::std::mem::uninitialized() }; unsafe { ::std::ptr::copy_nonoverlapping( &self._bitfield_1 as *const _ as *const u8, &mut unit_field_val as *mut u16 as *mut u8, ::std::mem::size_of::(), ) }; unit_field_val &= !mask; unit_field_val |= (val << 8usize) & mask; unsafe { ::std::ptr::copy_nonoverlapping( &unit_field_val as *const _ as *const u8, &mut self._bitfield_1 as *mut _ as *mut u8, ::std::mem::size_of::(), ); } } #[inline] pub fn Ipv6ManagedAddressConfigurationSupported(&self) -> ULONG { let mut unit_field_val: u16 = unsafe { ::std::mem::uninitialized() }; unsafe { ::std::ptr::copy_nonoverlapping( &self._bitfield_1 as *const _ as *const u8, &mut unit_field_val as *mut u16 as *mut u8, ::std::mem::size_of::(), ) }; let mask = 0x200 as u16; let val = (unit_field_val & mask) >> 9usize; unsafe { ::std::mem::transmute(val as u32) } } #[inline] pub fn set_Ipv6ManagedAddressConfigurationSupported(&mut self, val: ULONG) { let mask = 0x200 as u16; let val = val as u32 as u16; let mut unit_field_val: u16 = unsafe { ::std::mem::uninitialized() }; unsafe { ::std::ptr::copy_nonoverlapping( &self._bitfield_1 as *const _ as *const u8, &mut unit_field_val as *mut u16 as *mut u8, ::std::mem::size_of::(), ) }; unit_field_val &= !mask; unit_field_val |= (val << 9usize) & mask; unsafe { ::std::ptr::copy_nonoverlapping( &unit_field_val as *const _ as *const u8, &mut self._bitfield_1 as *mut _ as *mut u8, ::std::mem::size_of::(), ); } } #[inline] pub fn new_bitfield_1( DdnsEnabled: ULONG, RegisterAdapterSuffix: ULONG, Dhcpv4Enabled: ULONG, ReceiveOnly: ULONG, NoMulticast: ULONG, Ipv6OtherStatefulConfig: ULONG, NetbiosOverTcpipEnabled: ULONG, Ipv4Enabled: ULONG, Ipv6Enabled: ULONG, Ipv6ManagedAddressConfigurationSupported: ULONG, ) -> u16 { ((((((((((0 | ((DdnsEnabled as u32 as u16) << 0usize) & (0x1 as u16)) | ((RegisterAdapterSuffix as u32 as u16) << 1usize) & (0x2 as u16)) | ((Dhcpv4Enabled as u32 as u16) << 2usize) & (0x4 as u16)) | ((ReceiveOnly as u32 as u16) << 3usize) & (0x8 as u16)) | ((NoMulticast as u32 as u16) << 4usize) & (0x10 as u16)) | ((Ipv6OtherStatefulConfig as u32 as u16) << 5usize) & (0x20 as u16)) | ((NetbiosOverTcpipEnabled as u32 as u16) << 6usize) & (0x40 as u16)) | ((Ipv4Enabled as u32 as u16) << 7usize) & (0x80 as u16)) | ((Ipv6Enabled as u32 as u16) << 8usize) & (0x100 as u16)) | ((Ipv6ManagedAddressConfigurationSupported as u32 as u16) << 9usize) & (0x200 as u16)) } } #[test] fn bindgen_test_layout__IP_ADAPTER_ADDRESSES_LH__bindgen_ty_2() { assert_eq!( ::std::mem::size_of::<_IP_ADAPTER_ADDRESSES_LH__bindgen_ty_2>(), 4usize, concat!( "Size of: ", stringify!(_IP_ADAPTER_ADDRESSES_LH__bindgen_ty_2) ) ); assert_eq!( ::std::mem::align_of::<_IP_ADAPTER_ADDRESSES_LH__bindgen_ty_2>(), 4usize, concat!( "Alignment of ", stringify!(_IP_ADAPTER_ADDRESSES_LH__bindgen_ty_2) ) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_ADDRESSES_LH__bindgen_ty_2)).Flags as *const _ as usize }, 0usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_ADDRESSES_LH__bindgen_ty_2), "::", stringify!(Flags) ) ); } impl Clone for _IP_ADAPTER_ADDRESSES_LH__bindgen_ty_2 { fn clone(&self) -> Self { *self } } #[test] fn bindgen_test_layout__IP_ADAPTER_ADDRESSES_LH() { assert_eq!( ::std::mem::size_of::<_IP_ADAPTER_ADDRESSES_LH>(), 448usize, concat!("Size of: ", stringify!(_IP_ADAPTER_ADDRESSES_LH)) ); assert_eq!( ::std::mem::align_of::<_IP_ADAPTER_ADDRESSES_LH>(), 8usize, concat!("Alignment of ", stringify!(_IP_ADAPTER_ADDRESSES_LH)) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_ADDRESSES_LH)).Next as *const _ as usize }, 8usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_ADDRESSES_LH), "::", stringify!(Next) ) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_ADDRESSES_LH)).AdapterName as *const _ as usize }, 16usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_ADDRESSES_LH), "::", stringify!(AdapterName) ) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_ADDRESSES_LH)).FirstUnicastAddress as *const _ as usize }, 24usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_ADDRESSES_LH), "::", stringify!(FirstUnicastAddress) ) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_ADDRESSES_LH)).FirstAnycastAddress as *const _ as usize }, 32usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_ADDRESSES_LH), "::", stringify!(FirstAnycastAddress) ) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_ADDRESSES_LH)).FirstMulticastAddress as *const _ as usize }, 40usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_ADDRESSES_LH), "::", stringify!(FirstMulticastAddress) ) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_ADDRESSES_LH)).FirstDnsServerAddress as *const _ as usize }, 48usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_ADDRESSES_LH), "::", stringify!(FirstDnsServerAddress) ) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_ADDRESSES_LH)).DnsSuffix as *const _ as usize }, 56usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_ADDRESSES_LH), "::", stringify!(DnsSuffix) ) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_ADDRESSES_LH)).Description as *const _ as usize }, 64usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_ADDRESSES_LH), "::", stringify!(Description) ) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_ADDRESSES_LH)).FriendlyName as *const _ as usize }, 72usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_ADDRESSES_LH), "::", stringify!(FriendlyName) ) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_ADDRESSES_LH)).PhysicalAddress as *const _ as usize }, 80usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_ADDRESSES_LH), "::", stringify!(PhysicalAddress) ) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_ADDRESSES_LH)).PhysicalAddressLength as *const _ as usize }, 88usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_ADDRESSES_LH), "::", stringify!(PhysicalAddressLength) ) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_ADDRESSES_LH)).Mtu as *const _ as usize }, 96usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_ADDRESSES_LH), "::", stringify!(Mtu) ) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_ADDRESSES_LH)).IfType as *const _ as usize }, 100usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_ADDRESSES_LH), "::", stringify!(IfType) ) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_ADDRESSES_LH)).OperStatus as *const _ as usize }, 104usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_ADDRESSES_LH), "::", stringify!(OperStatus) ) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_ADDRESSES_LH)).Ipv6IfIndex as *const _ as usize }, 108usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_ADDRESSES_LH), "::", stringify!(Ipv6IfIndex) ) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_ADDRESSES_LH)).ZoneIndices as *const _ as usize }, 112usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_ADDRESSES_LH), "::", stringify!(ZoneIndices) ) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_ADDRESSES_LH)).FirstPrefix as *const _ as usize }, 176usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_ADDRESSES_LH), "::", stringify!(FirstPrefix) ) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_ADDRESSES_LH)).TransmitLinkSpeed as *const _ as usize }, 184usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_ADDRESSES_LH), "::", stringify!(TransmitLinkSpeed) ) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_ADDRESSES_LH)).ReceiveLinkSpeed as *const _ as usize }, 192usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_ADDRESSES_LH), "::", stringify!(ReceiveLinkSpeed) ) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_ADDRESSES_LH)).FirstWinsServerAddress as *const _ as usize }, 200usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_ADDRESSES_LH), "::", stringify!(FirstWinsServerAddress) ) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_ADDRESSES_LH)).FirstGatewayAddress as *const _ as usize }, 208usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_ADDRESSES_LH), "::", stringify!(FirstGatewayAddress) ) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_ADDRESSES_LH)).Ipv4Metric as *const _ as usize }, 216usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_ADDRESSES_LH), "::", stringify!(Ipv4Metric) ) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_ADDRESSES_LH)).Ipv6Metric as *const _ as usize }, 220usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_ADDRESSES_LH), "::", stringify!(Ipv6Metric) ) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_ADDRESSES_LH)).Luid as *const _ as usize }, 224usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_ADDRESSES_LH), "::", stringify!(Luid) ) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_ADDRESSES_LH)).Dhcpv4Server as *const _ as usize }, 232usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_ADDRESSES_LH), "::", stringify!(Dhcpv4Server) ) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_ADDRESSES_LH)).CompartmentId as *const _ as usize }, 248usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_ADDRESSES_LH), "::", stringify!(CompartmentId) ) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_ADDRESSES_LH)).NetworkGuid as *const _ as usize }, 252usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_ADDRESSES_LH), "::", stringify!(NetworkGuid) ) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_ADDRESSES_LH)).ConnectionType as *const _ as usize }, 268usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_ADDRESSES_LH), "::", stringify!(ConnectionType) ) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_ADDRESSES_LH)).TunnelType as *const _ as usize }, 272usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_ADDRESSES_LH), "::", stringify!(TunnelType) ) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_ADDRESSES_LH)).Dhcpv6Server as *const _ as usize }, 280usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_ADDRESSES_LH), "::", stringify!(Dhcpv6Server) ) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_ADDRESSES_LH)).Dhcpv6ClientDuid as *const _ as usize }, 296usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_ADDRESSES_LH), "::", stringify!(Dhcpv6ClientDuid) ) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_ADDRESSES_LH)).Dhcpv6ClientDuidLength as *const _ as usize }, 428usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_ADDRESSES_LH), "::", stringify!(Dhcpv6ClientDuidLength) ) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_ADDRESSES_LH)).Dhcpv6Iaid as *const _ as usize }, 432usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_ADDRESSES_LH), "::", stringify!(Dhcpv6Iaid) ) ); assert_eq!( unsafe { &(*(0 as *const _IP_ADAPTER_ADDRESSES_LH)).FirstDnsSuffix as *const _ as usize }, 440usize, concat!( "Alignment of field: ", stringify!(_IP_ADAPTER_ADDRESSES_LH), "::", stringify!(FirstDnsSuffix) ) ); } impl Clone for _IP_ADAPTER_ADDRESSES_LH { fn clone(&self) -> Self { *self } } pub type IP_ADAPTER_ADDRESSES_LH = _IP_ADAPTER_ADDRESSES_LH; pub type PIP_ADAPTER_ADDRESSES = *mut IP_ADAPTER_ADDRESSES_LH; extern "C" { pub fn GetAdaptersAddresses( Family: ULONG, Flags: ULONG, Reserved: PVOID, AdapterAddresses: PIP_ADAPTER_ADDRESSES, SizePointer: PULONG, ) -> ULONG; } ipconfig-0.2.2/src/computer.rs000064400000000000000000000051531365177540200145100ustar0000000000000000//! This module implements things that are related to the computer, rather than a specific adapter. use std::string::String; use winapi::shared::minwindef::HKEY; use winreg::enums::HKEY_LOCAL_MACHINE; use winreg::enums::KEY_READ; use winreg::types::FromRegValue; use winreg::RegKey; use crate::error::*; /// Returns a value from the registry, and returns a default if it doesn't exist. fn get_value( predef: HKEY, subkey: &str, value_name: &str, default: T, ) -> ::std::io::Result { let key = RegKey::predef(predef); let value: T = match key.open_subkey_with_flags(subkey, KEY_READ) { Ok(key) => match key.get_value(value_name) { Ok(value) => value, Err(err) => match err.kind() { ::std::io::ErrorKind::NotFound => default, _ => return Err(err), }, }, Err(err) => match err.kind() { ::std::io::ErrorKind::NotFound => default, _ => return Err(err), }, }; Ok(value) } const TCPIP_PARAMETERS_KEY_PATH: &str = "SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters"; /// Returns the DNS suffix search list for the network connection used by the computer. pub fn get_search_list() -> Result> { let hklm = RegKey::predef(HKEY_LOCAL_MACHINE); let params_key = hklm.open_subkey_with_flags(TCPIP_PARAMETERS_KEY_PATH, KEY_READ)?; let search_list: ::std::io::Result = params_key.get_value("SearchList"); if let Ok(search_list) = search_list { let search_list: Vec = search_list.split(',').map(std::string::ToString::to_string).collect(); Ok(search_list) } else { Ok(vec![]) } } /// Returns the computer domain name (if any). /// Returns `None` if the computer does not belong to a domain. pub fn get_domain() -> Result> { let hklm = RegKey::predef(HKEY_LOCAL_MACHINE); let params_key = hklm.open_subkey_with_flags(TCPIP_PARAMETERS_KEY_PATH, KEY_READ)?; let domain: String = params_key.get_value("Domain")?; let domain = if domain.is_empty() { None } else { Some(domain) }; Ok(domain) } /// Returns `true` if the computer is configured to use the round robin strategy. /// Otherwise, returns `false`. pub fn is_round_robin_enabled() -> Result { let rotate: u32 = get_value( HKEY_LOCAL_MACHINE, "SYSTEM\\CurrentControlSet\\Services\\DNS\\Parameters", "RoundRobin", 1, // The default is 1 according to msdn )?; Ok(rotate != 0) } ipconfig-0.2.2/src/error.rs000064400000000000000000000031451365177540200140020ustar0000000000000000/// The Error type. #[derive(Debug)] pub struct Error { pub(crate) kind: ErrorKind, } /// The kind of an error. For the time being, it will remain private. #[derive(Debug)] pub(crate) enum ErrorKind { Utf8(std::str::Utf8Error), FromUtf16(::std::string::FromUtf16Error), Io(::std::io::Error), Os(u32), } impl std::fmt::Display for Error { fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { match &self.kind { ErrorKind::Utf8(err) => write!(f, "Utf8 error: {}", err), ErrorKind::FromUtf16(err) => write!(f, "FromUtf16 error: {}", err), ErrorKind::Io(err) => write!(f, "IO error: {}", err), ErrorKind::Os(err) => write!(f, "OS error: {}", err), } } } impl std::error::Error for Error { fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { match &self.kind { ErrorKind::Utf8(err) => Some(err), ErrorKind::FromUtf16(err) => Some(err), ErrorKind::Io(err) => Some(err), ErrorKind::Os(_) => None, } } } pub type Result = std::result::Result; impl From for Error { fn from(err: std::str::Utf8Error) -> Self { Error {kind: ErrorKind::Utf8(err)} } } impl From for Error { fn from(err: std::string::FromUtf16Error) -> Self { Error {kind: ErrorKind::FromUtf16(err)} } } impl From for Error { fn from(err: std::io::Error) -> Self { Error {kind: ErrorKind::Io(err)} } } ipconfig-0.2.2/src/lib.rs000064400000000000000000000014011365177540200134100ustar0000000000000000//! Get network adapters information for windows. //! //! //! # Examples //! //! ```rust //! # fn foo() -> ipconfig::error::Result<()> { //! // Print the ip addresses and dns servers of all adapters: //! for adapter in ipconfig::get_adapters()? { //! println!("Ip addresses: {:#?}", adapter.ip_addresses()); //! println!("Dns servers: {:#?}", adapter.dns_servers()); //! } //! # Ok(()) //! # } //! # fn main() { //! # foo().unwrap(); //! # } //! ``` #![cfg(windows)] #![doc(html_root_url = "https://docs.rs/ipconfig/0.2/x86_64-pc-windows-msvc/ipconfig/")] extern crate widestring; extern crate winapi; mod adapter; mod bindings; pub mod computer; pub mod error; pub use adapter::{get_adapters, Adapter, IfType, OperStatus}; ipconfig-0.2.2/tests/test.rs000064400000000000000000000006541365177540200142050ustar0000000000000000use ipconfig; #[test] fn no_error() { println!("Adapters: {:#?}", ipconfig::get_adapters().unwrap()); println!( "Search list: {:#?}", ipconfig::computer::get_search_list().unwrap() ); println!("Domain: {:#?}", ipconfig::computer::get_domain().unwrap()); println!( "Is round robin enabled: {:#?}", ipconfig::computer::is_round_robin_enabled().unwrap() ); } ipconfig-0.2.2/wrapper.h000064400000000000000000000000561365177540200133430ustar0000000000000000#include #include ipconfig-0.2.2/.cargo_vcs_info.json0000644000000001121365200074200127220ustar00{ "git": { "sha1": "85868f539dfbd98acb58b75dbc8cfc6e6d896890" } }