diff --git a/.github/workflows/cargo.yml b/.github/workflows/cargo.yml index fec34ec7e7..7bcbbef292 100644 --- a/.github/workflows/cargo.yml +++ b/.github/workflows/cargo.yml @@ -17,7 +17,7 @@ jobs: strategy: matrix: os: [ubuntu-latest, windows-latest, macos-latest, macos-latest-xlarge] - features: ["", "--features static", "--features schannel", "--features schannel,static"] + features: ["", "--features static", "--features schannel", "--features schannel,static", "--features overwrite"] exclude: - os: ubuntu-latest features: "--features schannel" @@ -60,6 +60,8 @@ jobs: run: cargo clippy --all-targets -- -D warnings - name: Cargo build run: cargo build --all ${{ matrix.features }} + - name: Check all generated files with git + run: git diff --exit-code - name: Cargo test run: cargo test --all ${{ matrix.features }} - name: Cargo Publish (dry run) diff --git a/CMakeLists.txt b/CMakeLists.txt index a32b057c25..6ce78d0c08 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -198,6 +198,8 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${QUIC_OUTPUT_DIR}) set(QUIC_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/src/inc) +include(GNUInstallDirs) + if (WIN32) set(QUIC_WARNING_FLAGS /WX /W4 /sdl /wd4206 CACHE INTERNAL "") set(QUIC_COMMON_FLAGS "") diff --git a/Cargo.toml b/Cargo.toml index 892e6f969f..22cbb0e90f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -34,7 +34,7 @@ include = [ "/submodules/openssl/VMS", "/submodules/xdp-for-windows/published/external", "/scripts/build.rs", - "/src/*.rs", + "/src/**/*.rs", "/src/bin", "/src/core", "/src/inc", @@ -49,9 +49,12 @@ default = [] schannel = [] static = [] preview-api = [] +# Overwrite generated binding by reruning the bindgen +overwrite = [ "dep:bindgen" ] [build-dependencies] cmake = "0.1" +bindgen = { version = "0.71", optional = true } [dependencies] bitfield = "0.17.0" diff --git a/scripts/build.rs b/scripts/build.rs index 7dbb6d3ec0..1f74cc562c 100644 --- a/scripts/build.rs +++ b/scripts/build.rs @@ -63,4 +63,47 @@ fn main() { } println!("cargo:rustc-link-lib=static=msquic"); } + + #[cfg(all(feature = "overwrite", not(target_os = "macos")))] + overwrite_bindgen(); +} + +/// Read the c header and generate rust bindings. +/// TODO: macos currently uses linux bindings. +#[cfg(all(feature = "overwrite", not(target_os = "macos")))] +fn overwrite_bindgen() { + let manifest_dir = std::path::PathBuf::from(env::var("CARGO_MANIFEST_DIR").unwrap()); + let root_dir = manifest_dir; + // include msquic headers + let inc_dir = root_dir.join("src").join("inc"); + + // The bindgen::Builder is the main entry point + // to bindgen, and lets you build up options for + // the resulting bindings. + let bindings = bindgen::Builder::default() + // The input header we would like to generate + // bindings for. + .header(root_dir.join("src/ffi/wrapper.hpp").to_str().unwrap()) + .clang_arg(format!("-I{}", inc_dir.to_string_lossy())) + .allowlist_recursively(false) + .allowlist_item("QUIC.*|BOOLEAN|BYTE|HQUIC|HRESULT") + .blocklist_type("QUIC_ADDR") + // Tell cargo to invalidate the built crate whenever any of the + // included header files changed. + .parse_callbacks(Box::new(bindgen::CargoCallbacks::new())) + // Finish the builder and generate the bindings. + .generate() + // Unwrap the Result and panic on failure. + .expect("Unable to generate bindings"); + + // Write bindings to the sys mod. + let out_path = root_dir.join("src/ffi"); + #[cfg(target_os = "windows")] + let binding_file = "win_bindings.rs"; + #[cfg(target_os = "linux")] + let binding_file = "linux_bindings.rs"; + // TODO: support macos. + bindings + .write_to_file(out_path.join(binding_file)) + .expect("Couldn't write bindings!"); } diff --git a/src/bin/CMakeLists.txt b/src/bin/CMakeLists.txt index e69cf51ac5..bc17d42e54 100644 --- a/src/bin/CMakeLists.txt +++ b/src/bin/CMakeLists.txt @@ -11,6 +11,7 @@ endif() if(BUILD_SHARED_LIBS) add_library(msquic SHARED ${SOURCES}) + add_library(msquic::msquic ALIAS msquic) target_include_directories(msquic PUBLIC $) target_link_libraries(msquic PRIVATE core msquic_platform inc warnings logging base_link main_binary_link_args) set_target_properties(msquic PROPERTIES OUTPUT_NAME ${QUIC_LIBRARY_NAME}) @@ -251,8 +252,6 @@ elseif (CX_PLATFORM STREQUAL "darwin") PROPERTIES LINK_FLAGS "-exported_symbols_list \"${CMAKE_CURRENT_SOURCE_DIR}/darwin/exports.txt\"") endif() -include(GNUInstallDirs) - file(GLOB PUBLIC_HEADERS "../inc/*.h" "../inc/*.hpp") if(QUIC_TLS STREQUAL "openssl" OR QUIC_TLS STREQUAL "openssl3") @@ -264,11 +263,18 @@ if(WIN32) endif() if(BUILD_SHARED_LIBS) - install(TARGETS msquic msquic_platform inc logging_inc warnings main_binary_link_args ${OTHER_TARGETS} EXPORT msquic DESTINATION lib) + install(TARGETS msquic msquic_platform inc logging_inc warnings main_binary_link_args ${OTHER_TARGETS} + EXPORT msquic + RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" + LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" + ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" + ) else() - install(FILES ${QUIC_STATIC_LIBRARY} DESTINATION lib) + install(FILES "${QUIC_STATIC_LIBRARY}" + DESTINATION lib + ) endif() -install(FILES ${PUBLIC_HEADERS} DESTINATION include) +install(FILES ${PUBLIC_HEADERS} DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}") configure_file(msquic-config.cmake.in ${CMAKE_BINARY_DIR}/msquic-config.cmake @ONLY) diff --git a/src/bin/msquic-config.cmake.in b/src/bin/msquic-config.cmake.in index e61e63feab..2696ae9bf1 100644 --- a/src/bin/msquic-config.cmake.in +++ b/src/bin/msquic-config.cmake.in @@ -2,8 +2,10 @@ include(CMakeFindDependencyMacro) include("${CMAKE_CURRENT_LIST_DIR}/msquic.cmake") -foreach(_t IN ITEMS msquic msquic_platform) - if(TARGET msquic::${_t} AND NOT TARGET ${_t}) - add_library(${_t} ALIAS msquic::${_t}) - endif() -endforeach() +# Legacy names +if(NOT TARGET msquic) + add_library(msquic ALIAS msquic::msquic) +endif() +if(NOT TARGET msquic_platform) + add_library(msquic_platform ALIAS msquic::platform) +endif() diff --git a/src/ffi/linux_bindings.rs b/src/ffi/linux_bindings.rs new file mode 100644 index 0000000000..9b4f449f4a --- /dev/null +++ b/src/ffi/linux_bindings.rs @@ -0,0 +1,5695 @@ +/* automatically generated by rust-bindgen 0.71.1 */ + +#[repr(C)] +#[derive(Copy, Clone, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)] +pub struct __BindgenBitfieldUnit { + storage: Storage, +} +impl __BindgenBitfieldUnit { + #[inline] + pub const fn new(storage: Storage) -> Self { + Self { storage } + } +} +impl __BindgenBitfieldUnit +where + Storage: AsRef<[u8]> + AsMut<[u8]>, +{ + #[inline] + fn extract_bit(byte: u8, index: usize) -> bool { + let bit_index = if cfg!(target_endian = "big") { + 7 - (index % 8) + } else { + index % 8 + }; + let mask = 1 << bit_index; + byte & mask == mask + } + #[inline] + pub fn get_bit(&self, index: usize) -> bool { + debug_assert!(index / 8 < self.storage.as_ref().len()); + let byte_index = index / 8; + let byte = self.storage.as_ref()[byte_index]; + Self::extract_bit(byte, index) + } + #[inline] + pub unsafe fn raw_get_bit(this: *const Self, index: usize) -> bool { + debug_assert!(index / 8 < core::mem::size_of::()); + let byte_index = index / 8; + let byte = *(core::ptr::addr_of!((*this).storage) as *const u8).offset(byte_index as isize); + Self::extract_bit(byte, index) + } + #[inline] + fn change_bit(byte: u8, index: usize, val: bool) -> u8 { + let bit_index = if cfg!(target_endian = "big") { + 7 - (index % 8) + } else { + index % 8 + }; + let mask = 1 << bit_index; + if val { + byte | mask + } else { + byte & !mask + } + } + #[inline] + pub fn set_bit(&mut self, index: usize, val: bool) { + debug_assert!(index / 8 < self.storage.as_ref().len()); + let byte_index = index / 8; + let byte = &mut self.storage.as_mut()[byte_index]; + *byte = Self::change_bit(*byte, index, val); + } + #[inline] + pub unsafe fn raw_set_bit(this: *mut Self, index: usize, val: bool) { + debug_assert!(index / 8 < core::mem::size_of::()); + let byte_index = index / 8; + let byte = + (core::ptr::addr_of_mut!((*this).storage) as *mut u8).offset(byte_index as isize); + *byte = Self::change_bit(*byte, index, val); + } + #[inline] + pub fn get(&self, bit_offset: usize, bit_width: u8) -> u64 { + debug_assert!(bit_width <= 64); + debug_assert!(bit_offset / 8 < self.storage.as_ref().len()); + debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len()); + let mut val = 0; + for i in 0..(bit_width as usize) { + if self.get_bit(i + bit_offset) { + let index = if cfg!(target_endian = "big") { + bit_width as usize - 1 - i + } else { + i + }; + val |= 1 << index; + } + } + val + } + #[inline] + pub unsafe fn raw_get(this: *const Self, bit_offset: usize, bit_width: u8) -> u64 { + debug_assert!(bit_width <= 64); + debug_assert!(bit_offset / 8 < core::mem::size_of::()); + debug_assert!((bit_offset + (bit_width as usize)) / 8 <= core::mem::size_of::()); + let mut val = 0; + for i in 0..(bit_width as usize) { + if Self::raw_get_bit(this, i + bit_offset) { + let index = if cfg!(target_endian = "big") { + bit_width as usize - 1 - i + } else { + i + }; + val |= 1 << index; + } + } + val + } + #[inline] + pub fn set(&mut self, bit_offset: usize, bit_width: u8, val: u64) { + debug_assert!(bit_width <= 64); + debug_assert!(bit_offset / 8 < self.storage.as_ref().len()); + debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len()); + for i in 0..(bit_width as usize) { + let mask = 1 << i; + let val_bit_is_set = val & mask == mask; + let index = if cfg!(target_endian = "big") { + bit_width as usize - 1 - i + } else { + i + }; + self.set_bit(index + bit_offset, val_bit_is_set); + } + } + #[inline] + pub unsafe fn raw_set(this: *mut Self, bit_offset: usize, bit_width: u8, val: u64) { + debug_assert!(bit_width <= 64); + debug_assert!(bit_offset / 8 < core::mem::size_of::()); + debug_assert!((bit_offset + (bit_width as usize)) / 8 <= core::mem::size_of::()); + for i in 0..(bit_width as usize) { + let mask = 1 << i; + let val_bit_is_set = val & mask == mask; + let index = if cfg!(target_endian = "big") { + bit_width as usize - 1 - i + } else { + i + }; + Self::raw_set_bit(this, index + bit_offset, val_bit_is_set); + } + } +} +pub const QUIC_ADDRESS_FAMILY_UNSPEC: u32 = 0; +pub const QUIC_ADDRESS_FAMILY_INET: u32 = 2; +pub const QUIC_ADDRESS_FAMILY_INET6: u32 = 10; +pub const QUIC_CERTIFICATE_FLAG_IGNORE_REVOCATION: u32 = 128; +pub const QUIC_CERTIFICATE_FLAG_IGNORE_UNKNOWN_CA: u32 = 256; +pub const QUIC_CERTIFICATE_FLAG_IGNORE_WRONG_USAGE: u32 = 512; +pub const QUIC_CERTIFICATE_FLAG_IGNORE_CERTIFICATE_CN_INVALID: u32 = 4096; +pub const QUIC_CERTIFICATE_FLAG_IGNORE_CERTIFICATE_DATE_INVALID: u32 = 8192; +pub const QUIC_CERTIFICATE_FLAG_IGNORE_WEAK_SIGNATURE: u32 = 65536; +pub const QUIC_UINT62_MAX: u64 = 4611686018427387903; +pub const QUIC_MAX_ALPN_LENGTH: u32 = 255; +pub const QUIC_MAX_SNI_LENGTH: u32 = 65535; +pub const QUIC_MAX_RESUMPTION_APP_DATA_LENGTH: u32 = 1000; +pub const QUIC_STATELESS_RESET_KEY_LENGTH: u32 = 32; +pub const QUIC_MAX_TICKET_KEY_COUNT: u32 = 16; +pub const QUIC_TLS_SECRETS_MAX_SECRET_LEN: u32 = 64; +pub const QUIC_PARAM_PREFIX_GLOBAL: u32 = 16777216; +pub const QUIC_PARAM_PREFIX_REGISTRATION: u32 = 33554432; +pub const QUIC_PARAM_PREFIX_CONFIGURATION: u32 = 50331648; +pub const QUIC_PARAM_PREFIX_LISTENER: u32 = 67108864; +pub const QUIC_PARAM_PREFIX_CONNECTION: u32 = 83886080; +pub const QUIC_PARAM_PREFIX_TLS: u32 = 100663296; +pub const QUIC_PARAM_PREFIX_TLS_SCHANNEL: u32 = 117440512; +pub const QUIC_PARAM_PREFIX_STREAM: u32 = 134217728; +pub const QUIC_PARAM_HIGH_PRIORITY: u32 = 1073741824; +pub const QUIC_PARAM_GLOBAL_RETRY_MEMORY_PERCENT: u32 = 16777216; +pub const QUIC_PARAM_GLOBAL_SUPPORTED_VERSIONS: u32 = 16777217; +pub const QUIC_PARAM_GLOBAL_LOAD_BALACING_MODE: u32 = 16777218; +pub const QUIC_PARAM_GLOBAL_PERF_COUNTERS: u32 = 16777219; +pub const QUIC_PARAM_GLOBAL_LIBRARY_VERSION: u32 = 16777220; +pub const QUIC_PARAM_GLOBAL_SETTINGS: u32 = 16777221; +pub const QUIC_PARAM_GLOBAL_GLOBAL_SETTINGS: u32 = 16777222; +pub const QUIC_PARAM_GLOBAL_LIBRARY_GIT_HASH: u32 = 16777224; +pub const QUIC_PARAM_GLOBAL_TLS_PROVIDER: u32 = 16777226; +pub const QUIC_PARAM_GLOBAL_STATELESS_RESET_KEY: u32 = 16777227; +pub const QUIC_PARAM_CONFIGURATION_SETTINGS: u32 = 50331648; +pub const QUIC_PARAM_CONFIGURATION_TICKET_KEYS: u32 = 50331649; +pub const QUIC_PARAM_CONFIGURATION_SCHANNEL_CREDENTIAL_ATTRIBUTE_W: u32 = 50331651; +pub const QUIC_PARAM_LISTENER_LOCAL_ADDRESS: u32 = 67108864; +pub const QUIC_PARAM_LISTENER_STATS: u32 = 67108865; +pub const QUIC_PARAM_CONN_QUIC_VERSION: u32 = 83886080; +pub const QUIC_PARAM_CONN_LOCAL_ADDRESS: u32 = 83886081; +pub const QUIC_PARAM_CONN_REMOTE_ADDRESS: u32 = 83886082; +pub const QUIC_PARAM_CONN_IDEAL_PROCESSOR: u32 = 83886083; +pub const QUIC_PARAM_CONN_SETTINGS: u32 = 83886084; +pub const QUIC_PARAM_CONN_STATISTICS: u32 = 83886085; +pub const QUIC_PARAM_CONN_STATISTICS_PLAT: u32 = 83886086; +pub const QUIC_PARAM_CONN_SHARE_UDP_BINDING: u32 = 83886087; +pub const QUIC_PARAM_CONN_LOCAL_BIDI_STREAM_COUNT: u32 = 83886088; +pub const QUIC_PARAM_CONN_LOCAL_UNIDI_STREAM_COUNT: u32 = 83886089; +pub const QUIC_PARAM_CONN_MAX_STREAM_IDS: u32 = 83886090; +pub const QUIC_PARAM_CONN_CLOSE_REASON_PHRASE: u32 = 83886091; +pub const QUIC_PARAM_CONN_STREAM_SCHEDULING_SCHEME: u32 = 83886092; +pub const QUIC_PARAM_CONN_DATAGRAM_RECEIVE_ENABLED: u32 = 83886093; +pub const QUIC_PARAM_CONN_DATAGRAM_SEND_ENABLED: u32 = 83886094; +pub const QUIC_PARAM_CONN_RESUMPTION_TICKET: u32 = 83886096; +pub const QUIC_PARAM_CONN_PEER_CERTIFICATE_VALID: u32 = 83886097; +pub const QUIC_PARAM_CONN_LOCAL_INTERFACE: u32 = 83886098; +pub const QUIC_PARAM_CONN_TLS_SECRETS: u32 = 83886099; +pub const QUIC_PARAM_CONN_STATISTICS_V2: u32 = 83886102; +pub const QUIC_PARAM_CONN_STATISTICS_V2_PLAT: u32 = 83886103; +pub const QUIC_PARAM_CONN_ORIG_DEST_CID: u32 = 83886104; +pub const QUIC_PARAM_TLS_HANDSHAKE_INFO: u32 = 100663296; +pub const QUIC_PARAM_TLS_NEGOTIATED_ALPN: u32 = 100663297; +pub const QUIC_PARAM_STREAM_ID: u32 = 134217728; +pub const QUIC_PARAM_STREAM_0RTT_LENGTH: u32 = 134217729; +pub const QUIC_PARAM_STREAM_IDEAL_SEND_BUFFER_SIZE: u32 = 134217730; +pub const QUIC_PARAM_STREAM_PRIORITY: u32 = 134217731; +pub const QUIC_PARAM_STREAM_STATISTICS: u32 = 134217732; +pub const QUIC_API_VERSION_1: u32 = 1; +pub const QUIC_API_VERSION_2: u32 = 2; +pub type BOOLEAN = ::std::os::raw::c_uchar; +pub type QUIC_ADDRESS_FAMILY = sa_family_t; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct QUIC_ADDR_STR { + pub Address: [::std::os::raw::c_char; 64usize], +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of QUIC_ADDR_STR"][::std::mem::size_of::() - 64usize]; + ["Alignment of QUIC_ADDR_STR"][::std::mem::align_of::() - 1usize]; + ["Offset of field: QUIC_ADDR_STR::Address"] + [::std::mem::offset_of!(QUIC_ADDR_STR, Address) - 0usize]; +}; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct QUIC_HANDLE { + _unused: [u8; 0], +} +pub type HQUIC = *mut QUIC_HANDLE; +pub type QUIC_UINT62 = u64; +pub const QUIC_TLS_PROVIDER_QUIC_TLS_PROVIDER_SCHANNEL: QUIC_TLS_PROVIDER = 0; +pub const QUIC_TLS_PROVIDER_QUIC_TLS_PROVIDER_OPENSSL: QUIC_TLS_PROVIDER = 1; +pub type QUIC_TLS_PROVIDER = ::std::os::raw::c_uint; +pub const QUIC_EXECUTION_PROFILE_QUIC_EXECUTION_PROFILE_LOW_LATENCY: QUIC_EXECUTION_PROFILE = 0; +pub const QUIC_EXECUTION_PROFILE_QUIC_EXECUTION_PROFILE_TYPE_MAX_THROUGHPUT: + QUIC_EXECUTION_PROFILE = 1; +pub const QUIC_EXECUTION_PROFILE_QUIC_EXECUTION_PROFILE_TYPE_SCAVENGER: QUIC_EXECUTION_PROFILE = 2; +pub const QUIC_EXECUTION_PROFILE_QUIC_EXECUTION_PROFILE_TYPE_REAL_TIME: QUIC_EXECUTION_PROFILE = 3; +pub type QUIC_EXECUTION_PROFILE = ::std::os::raw::c_uint; +pub const QUIC_LOAD_BALANCING_MODE_QUIC_LOAD_BALANCING_DISABLED: QUIC_LOAD_BALANCING_MODE = 0; +pub const QUIC_LOAD_BALANCING_MODE_QUIC_LOAD_BALANCING_SERVER_ID_IP: QUIC_LOAD_BALANCING_MODE = 1; +pub const QUIC_LOAD_BALANCING_MODE_QUIC_LOAD_BALANCING_SERVER_ID_FIXED: QUIC_LOAD_BALANCING_MODE = + 2; +pub const QUIC_LOAD_BALANCING_MODE_QUIC_LOAD_BALANCING_COUNT: QUIC_LOAD_BALANCING_MODE = 3; +pub type QUIC_LOAD_BALANCING_MODE = ::std::os::raw::c_uint; +pub const QUIC_TLS_ALERT_CODES_QUIC_TLS_ALERT_CODE_SUCCESS: QUIC_TLS_ALERT_CODES = 65535; +pub const QUIC_TLS_ALERT_CODES_QUIC_TLS_ALERT_CODE_UNEXPECTED_MESSAGE: QUIC_TLS_ALERT_CODES = 10; +pub const QUIC_TLS_ALERT_CODES_QUIC_TLS_ALERT_CODE_BAD_CERTIFICATE: QUIC_TLS_ALERT_CODES = 42; +pub const QUIC_TLS_ALERT_CODES_QUIC_TLS_ALERT_CODE_UNSUPPORTED_CERTIFICATE: QUIC_TLS_ALERT_CODES = + 43; +pub const QUIC_TLS_ALERT_CODES_QUIC_TLS_ALERT_CODE_CERTIFICATE_REVOKED: QUIC_TLS_ALERT_CODES = 44; +pub const QUIC_TLS_ALERT_CODES_QUIC_TLS_ALERT_CODE_CERTIFICATE_EXPIRED: QUIC_TLS_ALERT_CODES = 45; +pub const QUIC_TLS_ALERT_CODES_QUIC_TLS_ALERT_CODE_CERTIFICATE_UNKNOWN: QUIC_TLS_ALERT_CODES = 46; +pub const QUIC_TLS_ALERT_CODES_QUIC_TLS_ALERT_CODE_ILLEGAL_PARAMETER: QUIC_TLS_ALERT_CODES = 47; +pub const QUIC_TLS_ALERT_CODES_QUIC_TLS_ALERT_CODE_UNKNOWN_CA: QUIC_TLS_ALERT_CODES = 48; +pub const QUIC_TLS_ALERT_CODES_QUIC_TLS_ALERT_CODE_ACCESS_DENIED: QUIC_TLS_ALERT_CODES = 49; +pub const QUIC_TLS_ALERT_CODES_QUIC_TLS_ALERT_CODE_INSUFFICIENT_SECURITY: QUIC_TLS_ALERT_CODES = 71; +pub const QUIC_TLS_ALERT_CODES_QUIC_TLS_ALERT_CODE_INTERNAL_ERROR: QUIC_TLS_ALERT_CODES = 80; +pub const QUIC_TLS_ALERT_CODES_QUIC_TLS_ALERT_CODE_USER_CANCELED: QUIC_TLS_ALERT_CODES = 90; +pub const QUIC_TLS_ALERT_CODES_QUIC_TLS_ALERT_CODE_CERTIFICATE_REQUIRED: QUIC_TLS_ALERT_CODES = 116; +pub const QUIC_TLS_ALERT_CODES_QUIC_TLS_ALERT_CODE_MAX: QUIC_TLS_ALERT_CODES = 255; +pub type QUIC_TLS_ALERT_CODES = ::std::os::raw::c_uint; +pub const QUIC_CREDENTIAL_TYPE_QUIC_CREDENTIAL_TYPE_NONE: QUIC_CREDENTIAL_TYPE = 0; +pub const QUIC_CREDENTIAL_TYPE_QUIC_CREDENTIAL_TYPE_CERTIFICATE_HASH: QUIC_CREDENTIAL_TYPE = 1; +pub const QUIC_CREDENTIAL_TYPE_QUIC_CREDENTIAL_TYPE_CERTIFICATE_HASH_STORE: QUIC_CREDENTIAL_TYPE = + 2; +pub const QUIC_CREDENTIAL_TYPE_QUIC_CREDENTIAL_TYPE_CERTIFICATE_CONTEXT: QUIC_CREDENTIAL_TYPE = 3; +pub const QUIC_CREDENTIAL_TYPE_QUIC_CREDENTIAL_TYPE_CERTIFICATE_FILE: QUIC_CREDENTIAL_TYPE = 4; +pub const QUIC_CREDENTIAL_TYPE_QUIC_CREDENTIAL_TYPE_CERTIFICATE_FILE_PROTECTED: + QUIC_CREDENTIAL_TYPE = 5; +pub const QUIC_CREDENTIAL_TYPE_QUIC_CREDENTIAL_TYPE_CERTIFICATE_PKCS12: QUIC_CREDENTIAL_TYPE = 6; +pub type QUIC_CREDENTIAL_TYPE = ::std::os::raw::c_uint; +pub const QUIC_CREDENTIAL_FLAGS_QUIC_CREDENTIAL_FLAG_NONE: QUIC_CREDENTIAL_FLAGS = 0; +pub const QUIC_CREDENTIAL_FLAGS_QUIC_CREDENTIAL_FLAG_CLIENT: QUIC_CREDENTIAL_FLAGS = 1; +pub const QUIC_CREDENTIAL_FLAGS_QUIC_CREDENTIAL_FLAG_LOAD_ASYNCHRONOUS: QUIC_CREDENTIAL_FLAGS = 2; +pub const QUIC_CREDENTIAL_FLAGS_QUIC_CREDENTIAL_FLAG_NO_CERTIFICATE_VALIDATION: + QUIC_CREDENTIAL_FLAGS = 4; +pub const QUIC_CREDENTIAL_FLAGS_QUIC_CREDENTIAL_FLAG_ENABLE_OCSP: QUIC_CREDENTIAL_FLAGS = 8; +pub const QUIC_CREDENTIAL_FLAGS_QUIC_CREDENTIAL_FLAG_INDICATE_CERTIFICATE_RECEIVED: + QUIC_CREDENTIAL_FLAGS = 16; +pub const QUIC_CREDENTIAL_FLAGS_QUIC_CREDENTIAL_FLAG_DEFER_CERTIFICATE_VALIDATION: + QUIC_CREDENTIAL_FLAGS = 32; +pub const QUIC_CREDENTIAL_FLAGS_QUIC_CREDENTIAL_FLAG_REQUIRE_CLIENT_AUTHENTICATION: + QUIC_CREDENTIAL_FLAGS = 64; +pub const QUIC_CREDENTIAL_FLAGS_QUIC_CREDENTIAL_FLAG_USE_TLS_BUILTIN_CERTIFICATE_VALIDATION: + QUIC_CREDENTIAL_FLAGS = 128; +pub const QUIC_CREDENTIAL_FLAGS_QUIC_CREDENTIAL_FLAG_REVOCATION_CHECK_END_CERT: + QUIC_CREDENTIAL_FLAGS = 256; +pub const QUIC_CREDENTIAL_FLAGS_QUIC_CREDENTIAL_FLAG_REVOCATION_CHECK_CHAIN: QUIC_CREDENTIAL_FLAGS = + 512; +pub const QUIC_CREDENTIAL_FLAGS_QUIC_CREDENTIAL_FLAG_REVOCATION_CHECK_CHAIN_EXCLUDE_ROOT: + QUIC_CREDENTIAL_FLAGS = 1024; +pub const QUIC_CREDENTIAL_FLAGS_QUIC_CREDENTIAL_FLAG_IGNORE_NO_REVOCATION_CHECK: + QUIC_CREDENTIAL_FLAGS = 2048; +pub const QUIC_CREDENTIAL_FLAGS_QUIC_CREDENTIAL_FLAG_IGNORE_REVOCATION_OFFLINE: + QUIC_CREDENTIAL_FLAGS = 4096; +pub const QUIC_CREDENTIAL_FLAGS_QUIC_CREDENTIAL_FLAG_SET_ALLOWED_CIPHER_SUITES: + QUIC_CREDENTIAL_FLAGS = 8192; +pub const QUIC_CREDENTIAL_FLAGS_QUIC_CREDENTIAL_FLAG_USE_PORTABLE_CERTIFICATES: + QUIC_CREDENTIAL_FLAGS = 16384; +pub const QUIC_CREDENTIAL_FLAGS_QUIC_CREDENTIAL_FLAG_USE_SUPPLIED_CREDENTIALS: + QUIC_CREDENTIAL_FLAGS = 32768; +pub const QUIC_CREDENTIAL_FLAGS_QUIC_CREDENTIAL_FLAG_USE_SYSTEM_MAPPER: QUIC_CREDENTIAL_FLAGS = + 65536; +pub const QUIC_CREDENTIAL_FLAGS_QUIC_CREDENTIAL_FLAG_CACHE_ONLY_URL_RETRIEVAL: + QUIC_CREDENTIAL_FLAGS = 131072; +pub const QUIC_CREDENTIAL_FLAGS_QUIC_CREDENTIAL_FLAG_REVOCATION_CHECK_CACHE_ONLY: + QUIC_CREDENTIAL_FLAGS = 262144; +pub const QUIC_CREDENTIAL_FLAGS_QUIC_CREDENTIAL_FLAG_INPROC_PEER_CERTIFICATE: + QUIC_CREDENTIAL_FLAGS = 524288; +pub const QUIC_CREDENTIAL_FLAGS_QUIC_CREDENTIAL_FLAG_SET_CA_CERTIFICATE_FILE: + QUIC_CREDENTIAL_FLAGS = 1048576; +pub const QUIC_CREDENTIAL_FLAGS_QUIC_CREDENTIAL_FLAG_DISABLE_AIA: QUIC_CREDENTIAL_FLAGS = 2097152; +pub type QUIC_CREDENTIAL_FLAGS = ::std::os::raw::c_uint; +pub const QUIC_ALLOWED_CIPHER_SUITE_FLAGS_QUIC_ALLOWED_CIPHER_SUITE_NONE: + QUIC_ALLOWED_CIPHER_SUITE_FLAGS = 0; +pub const QUIC_ALLOWED_CIPHER_SUITE_FLAGS_QUIC_ALLOWED_CIPHER_SUITE_AES_128_GCM_SHA256: + QUIC_ALLOWED_CIPHER_SUITE_FLAGS = 1; +pub const QUIC_ALLOWED_CIPHER_SUITE_FLAGS_QUIC_ALLOWED_CIPHER_SUITE_AES_256_GCM_SHA384: + QUIC_ALLOWED_CIPHER_SUITE_FLAGS = 2; +pub const QUIC_ALLOWED_CIPHER_SUITE_FLAGS_QUIC_ALLOWED_CIPHER_SUITE_CHACHA20_POLY1305_SHA256: + QUIC_ALLOWED_CIPHER_SUITE_FLAGS = 4; +pub type QUIC_ALLOWED_CIPHER_SUITE_FLAGS = ::std::os::raw::c_uint; +pub const QUIC_CERTIFICATE_HASH_STORE_FLAGS_QUIC_CERTIFICATE_HASH_STORE_FLAG_NONE: + QUIC_CERTIFICATE_HASH_STORE_FLAGS = 0; +pub const QUIC_CERTIFICATE_HASH_STORE_FLAGS_QUIC_CERTIFICATE_HASH_STORE_FLAG_MACHINE_STORE: + QUIC_CERTIFICATE_HASH_STORE_FLAGS = 1; +pub type QUIC_CERTIFICATE_HASH_STORE_FLAGS = ::std::os::raw::c_uint; +pub const QUIC_CONNECTION_SHUTDOWN_FLAGS_QUIC_CONNECTION_SHUTDOWN_FLAG_NONE: + QUIC_CONNECTION_SHUTDOWN_FLAGS = 0; +pub const QUIC_CONNECTION_SHUTDOWN_FLAGS_QUIC_CONNECTION_SHUTDOWN_FLAG_SILENT: + QUIC_CONNECTION_SHUTDOWN_FLAGS = 1; +pub type QUIC_CONNECTION_SHUTDOWN_FLAGS = ::std::os::raw::c_uint; +pub const QUIC_SERVER_RESUMPTION_LEVEL_QUIC_SERVER_NO_RESUME: QUIC_SERVER_RESUMPTION_LEVEL = 0; +pub const QUIC_SERVER_RESUMPTION_LEVEL_QUIC_SERVER_RESUME_ONLY: QUIC_SERVER_RESUMPTION_LEVEL = 1; +pub const QUIC_SERVER_RESUMPTION_LEVEL_QUIC_SERVER_RESUME_AND_ZERORTT: + QUIC_SERVER_RESUMPTION_LEVEL = 2; +pub type QUIC_SERVER_RESUMPTION_LEVEL = ::std::os::raw::c_uint; +pub const QUIC_SEND_RESUMPTION_FLAGS_QUIC_SEND_RESUMPTION_FLAG_NONE: QUIC_SEND_RESUMPTION_FLAGS = 0; +pub const QUIC_SEND_RESUMPTION_FLAGS_QUIC_SEND_RESUMPTION_FLAG_FINAL: QUIC_SEND_RESUMPTION_FLAGS = + 1; +pub type QUIC_SEND_RESUMPTION_FLAGS = ::std::os::raw::c_uint; +pub const QUIC_STREAM_SCHEDULING_SCHEME_QUIC_STREAM_SCHEDULING_SCHEME_FIFO: + QUIC_STREAM_SCHEDULING_SCHEME = 0; +pub const QUIC_STREAM_SCHEDULING_SCHEME_QUIC_STREAM_SCHEDULING_SCHEME_ROUND_ROBIN: + QUIC_STREAM_SCHEDULING_SCHEME = 1; +pub const QUIC_STREAM_SCHEDULING_SCHEME_QUIC_STREAM_SCHEDULING_SCHEME_COUNT: + QUIC_STREAM_SCHEDULING_SCHEME = 2; +pub type QUIC_STREAM_SCHEDULING_SCHEME = ::std::os::raw::c_uint; +pub const QUIC_STREAM_OPEN_FLAGS_QUIC_STREAM_OPEN_FLAG_NONE: QUIC_STREAM_OPEN_FLAGS = 0; +pub const QUIC_STREAM_OPEN_FLAGS_QUIC_STREAM_OPEN_FLAG_UNIDIRECTIONAL: QUIC_STREAM_OPEN_FLAGS = 1; +pub const QUIC_STREAM_OPEN_FLAGS_QUIC_STREAM_OPEN_FLAG_0_RTT: QUIC_STREAM_OPEN_FLAGS = 2; +pub const QUIC_STREAM_OPEN_FLAGS_QUIC_STREAM_OPEN_FLAG_DELAY_ID_FC_UPDATES: QUIC_STREAM_OPEN_FLAGS = + 4; +pub type QUIC_STREAM_OPEN_FLAGS = ::std::os::raw::c_uint; +pub const QUIC_STREAM_START_FLAGS_QUIC_STREAM_START_FLAG_NONE: QUIC_STREAM_START_FLAGS = 0; +pub const QUIC_STREAM_START_FLAGS_QUIC_STREAM_START_FLAG_IMMEDIATE: QUIC_STREAM_START_FLAGS = 1; +pub const QUIC_STREAM_START_FLAGS_QUIC_STREAM_START_FLAG_FAIL_BLOCKED: QUIC_STREAM_START_FLAGS = 2; +pub const QUIC_STREAM_START_FLAGS_QUIC_STREAM_START_FLAG_SHUTDOWN_ON_FAIL: QUIC_STREAM_START_FLAGS = + 4; +pub const QUIC_STREAM_START_FLAGS_QUIC_STREAM_START_FLAG_INDICATE_PEER_ACCEPT: + QUIC_STREAM_START_FLAGS = 8; +pub const QUIC_STREAM_START_FLAGS_QUIC_STREAM_START_FLAG_PRIORITY_WORK: QUIC_STREAM_START_FLAGS = + 16; +pub type QUIC_STREAM_START_FLAGS = ::std::os::raw::c_uint; +pub const QUIC_STREAM_SHUTDOWN_FLAGS_QUIC_STREAM_SHUTDOWN_FLAG_NONE: QUIC_STREAM_SHUTDOWN_FLAGS = 0; +pub const QUIC_STREAM_SHUTDOWN_FLAGS_QUIC_STREAM_SHUTDOWN_FLAG_GRACEFUL: + QUIC_STREAM_SHUTDOWN_FLAGS = 1; +pub const QUIC_STREAM_SHUTDOWN_FLAGS_QUIC_STREAM_SHUTDOWN_FLAG_ABORT_SEND: + QUIC_STREAM_SHUTDOWN_FLAGS = 2; +pub const QUIC_STREAM_SHUTDOWN_FLAGS_QUIC_STREAM_SHUTDOWN_FLAG_ABORT_RECEIVE: + QUIC_STREAM_SHUTDOWN_FLAGS = 4; +pub const QUIC_STREAM_SHUTDOWN_FLAGS_QUIC_STREAM_SHUTDOWN_FLAG_ABORT: QUIC_STREAM_SHUTDOWN_FLAGS = + 6; +pub const QUIC_STREAM_SHUTDOWN_FLAGS_QUIC_STREAM_SHUTDOWN_FLAG_IMMEDIATE: + QUIC_STREAM_SHUTDOWN_FLAGS = 8; +pub const QUIC_STREAM_SHUTDOWN_FLAGS_QUIC_STREAM_SHUTDOWN_FLAG_INLINE: QUIC_STREAM_SHUTDOWN_FLAGS = + 16; +pub type QUIC_STREAM_SHUTDOWN_FLAGS = ::std::os::raw::c_uint; +pub const QUIC_RECEIVE_FLAGS_QUIC_RECEIVE_FLAG_NONE: QUIC_RECEIVE_FLAGS = 0; +pub const QUIC_RECEIVE_FLAGS_QUIC_RECEIVE_FLAG_0_RTT: QUIC_RECEIVE_FLAGS = 1; +pub const QUIC_RECEIVE_FLAGS_QUIC_RECEIVE_FLAG_FIN: QUIC_RECEIVE_FLAGS = 2; +pub type QUIC_RECEIVE_FLAGS = ::std::os::raw::c_uint; +pub const QUIC_SEND_FLAGS_QUIC_SEND_FLAG_NONE: QUIC_SEND_FLAGS = 0; +pub const QUIC_SEND_FLAGS_QUIC_SEND_FLAG_ALLOW_0_RTT: QUIC_SEND_FLAGS = 1; +pub const QUIC_SEND_FLAGS_QUIC_SEND_FLAG_START: QUIC_SEND_FLAGS = 2; +pub const QUIC_SEND_FLAGS_QUIC_SEND_FLAG_FIN: QUIC_SEND_FLAGS = 4; +pub const QUIC_SEND_FLAGS_QUIC_SEND_FLAG_DGRAM_PRIORITY: QUIC_SEND_FLAGS = 8; +pub const QUIC_SEND_FLAGS_QUIC_SEND_FLAG_DELAY_SEND: QUIC_SEND_FLAGS = 16; +pub const QUIC_SEND_FLAGS_QUIC_SEND_FLAG_CANCEL_ON_LOSS: QUIC_SEND_FLAGS = 32; +pub const QUIC_SEND_FLAGS_QUIC_SEND_FLAG_PRIORITY_WORK: QUIC_SEND_FLAGS = 64; +pub type QUIC_SEND_FLAGS = ::std::os::raw::c_uint; +pub const QUIC_DATAGRAM_SEND_STATE_QUIC_DATAGRAM_SEND_UNKNOWN: QUIC_DATAGRAM_SEND_STATE = 0; +pub const QUIC_DATAGRAM_SEND_STATE_QUIC_DATAGRAM_SEND_SENT: QUIC_DATAGRAM_SEND_STATE = 1; +pub const QUIC_DATAGRAM_SEND_STATE_QUIC_DATAGRAM_SEND_LOST_SUSPECT: QUIC_DATAGRAM_SEND_STATE = 2; +pub const QUIC_DATAGRAM_SEND_STATE_QUIC_DATAGRAM_SEND_LOST_DISCARDED: QUIC_DATAGRAM_SEND_STATE = 3; +pub const QUIC_DATAGRAM_SEND_STATE_QUIC_DATAGRAM_SEND_ACKNOWLEDGED: QUIC_DATAGRAM_SEND_STATE = 4; +pub const QUIC_DATAGRAM_SEND_STATE_QUIC_DATAGRAM_SEND_ACKNOWLEDGED_SPURIOUS: + QUIC_DATAGRAM_SEND_STATE = 5; +pub const QUIC_DATAGRAM_SEND_STATE_QUIC_DATAGRAM_SEND_CANCELED: QUIC_DATAGRAM_SEND_STATE = 6; +pub type QUIC_DATAGRAM_SEND_STATE = ::std::os::raw::c_uint; +pub const QUIC_EXECUTION_CONFIG_FLAGS_QUIC_EXECUTION_CONFIG_FLAG_NONE: QUIC_EXECUTION_CONFIG_FLAGS = + 0; +pub type QUIC_EXECUTION_CONFIG_FLAGS = ::std::os::raw::c_uint; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct QUIC_EXECUTION_CONFIG { + pub Flags: QUIC_EXECUTION_CONFIG_FLAGS, + pub PollingIdleTimeoutUs: u32, + pub ProcessorCount: u32, + pub ProcessorList: [u16; 1usize], +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of QUIC_EXECUTION_CONFIG"][::std::mem::size_of::() - 16usize]; + ["Alignment of QUIC_EXECUTION_CONFIG"] + [::std::mem::align_of::() - 4usize]; + ["Offset of field: QUIC_EXECUTION_CONFIG::Flags"] + [::std::mem::offset_of!(QUIC_EXECUTION_CONFIG, Flags) - 0usize]; + ["Offset of field: QUIC_EXECUTION_CONFIG::PollingIdleTimeoutUs"] + [::std::mem::offset_of!(QUIC_EXECUTION_CONFIG, PollingIdleTimeoutUs) - 4usize]; + ["Offset of field: QUIC_EXECUTION_CONFIG::ProcessorCount"] + [::std::mem::offset_of!(QUIC_EXECUTION_CONFIG, ProcessorCount) - 8usize]; + ["Offset of field: QUIC_EXECUTION_CONFIG::ProcessorList"] + [::std::mem::offset_of!(QUIC_EXECUTION_CONFIG, ProcessorList) - 12usize]; +}; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct QUIC_REGISTRATION_CONFIG { + pub AppName: *const ::std::os::raw::c_char, + pub ExecutionProfile: QUIC_EXECUTION_PROFILE, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of QUIC_REGISTRATION_CONFIG"] + [::std::mem::size_of::() - 16usize]; + ["Alignment of QUIC_REGISTRATION_CONFIG"] + [::std::mem::align_of::() - 8usize]; + ["Offset of field: QUIC_REGISTRATION_CONFIG::AppName"] + [::std::mem::offset_of!(QUIC_REGISTRATION_CONFIG, AppName) - 0usize]; + ["Offset of field: QUIC_REGISTRATION_CONFIG::ExecutionProfile"] + [::std::mem::offset_of!(QUIC_REGISTRATION_CONFIG, ExecutionProfile) - 8usize]; +}; +pub type QUIC_CREDENTIAL_LOAD_COMPLETE = ::std::option::Option< + unsafe extern "C" fn( + Configuration: HQUIC, + Context: *mut ::std::os::raw::c_void, + Status: ::std::os::raw::c_uint, + ), +>; +pub type QUIC_CREDENTIAL_LOAD_COMPLETE_HANDLER = QUIC_CREDENTIAL_LOAD_COMPLETE; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct QUIC_CERTIFICATE_HASH { + pub ShaHash: [u8; 20usize], +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of QUIC_CERTIFICATE_HASH"][::std::mem::size_of::() - 20usize]; + ["Alignment of QUIC_CERTIFICATE_HASH"] + [::std::mem::align_of::() - 1usize]; + ["Offset of field: QUIC_CERTIFICATE_HASH::ShaHash"] + [::std::mem::offset_of!(QUIC_CERTIFICATE_HASH, ShaHash) - 0usize]; +}; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct QUIC_CERTIFICATE_HASH_STORE { + pub Flags: QUIC_CERTIFICATE_HASH_STORE_FLAGS, + pub ShaHash: [u8; 20usize], + pub StoreName: [::std::os::raw::c_char; 128usize], +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of QUIC_CERTIFICATE_HASH_STORE"] + [::std::mem::size_of::() - 152usize]; + ["Alignment of QUIC_CERTIFICATE_HASH_STORE"] + [::std::mem::align_of::() - 4usize]; + ["Offset of field: QUIC_CERTIFICATE_HASH_STORE::Flags"] + [::std::mem::offset_of!(QUIC_CERTIFICATE_HASH_STORE, Flags) - 0usize]; + ["Offset of field: QUIC_CERTIFICATE_HASH_STORE::ShaHash"] + [::std::mem::offset_of!(QUIC_CERTIFICATE_HASH_STORE, ShaHash) - 4usize]; + ["Offset of field: QUIC_CERTIFICATE_HASH_STORE::StoreName"] + [::std::mem::offset_of!(QUIC_CERTIFICATE_HASH_STORE, StoreName) - 24usize]; +}; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct QUIC_CERTIFICATE_FILE { + pub PrivateKeyFile: *const ::std::os::raw::c_char, + pub CertificateFile: *const ::std::os::raw::c_char, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of QUIC_CERTIFICATE_FILE"][::std::mem::size_of::() - 16usize]; + ["Alignment of QUIC_CERTIFICATE_FILE"] + [::std::mem::align_of::() - 8usize]; + ["Offset of field: QUIC_CERTIFICATE_FILE::PrivateKeyFile"] + [::std::mem::offset_of!(QUIC_CERTIFICATE_FILE, PrivateKeyFile) - 0usize]; + ["Offset of field: QUIC_CERTIFICATE_FILE::CertificateFile"] + [::std::mem::offset_of!(QUIC_CERTIFICATE_FILE, CertificateFile) - 8usize]; +}; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct QUIC_CERTIFICATE_FILE_PROTECTED { + pub PrivateKeyFile: *const ::std::os::raw::c_char, + pub CertificateFile: *const ::std::os::raw::c_char, + pub PrivateKeyPassword: *const ::std::os::raw::c_char, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of QUIC_CERTIFICATE_FILE_PROTECTED"] + [::std::mem::size_of::() - 24usize]; + ["Alignment of QUIC_CERTIFICATE_FILE_PROTECTED"] + [::std::mem::align_of::() - 8usize]; + ["Offset of field: QUIC_CERTIFICATE_FILE_PROTECTED::PrivateKeyFile"] + [::std::mem::offset_of!(QUIC_CERTIFICATE_FILE_PROTECTED, PrivateKeyFile) - 0usize]; + ["Offset of field: QUIC_CERTIFICATE_FILE_PROTECTED::CertificateFile"] + [::std::mem::offset_of!(QUIC_CERTIFICATE_FILE_PROTECTED, CertificateFile) - 8usize]; + ["Offset of field: QUIC_CERTIFICATE_FILE_PROTECTED::PrivateKeyPassword"] + [::std::mem::offset_of!(QUIC_CERTIFICATE_FILE_PROTECTED, PrivateKeyPassword) - 16usize]; +}; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct QUIC_CERTIFICATE_PKCS12 { + pub Asn1Blob: *const u8, + pub Asn1BlobLength: u32, + pub PrivateKeyPassword: *const ::std::os::raw::c_char, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of QUIC_CERTIFICATE_PKCS12"][::std::mem::size_of::() - 24usize]; + ["Alignment of QUIC_CERTIFICATE_PKCS12"] + [::std::mem::align_of::() - 8usize]; + ["Offset of field: QUIC_CERTIFICATE_PKCS12::Asn1Blob"] + [::std::mem::offset_of!(QUIC_CERTIFICATE_PKCS12, Asn1Blob) - 0usize]; + ["Offset of field: QUIC_CERTIFICATE_PKCS12::Asn1BlobLength"] + [::std::mem::offset_of!(QUIC_CERTIFICATE_PKCS12, Asn1BlobLength) - 8usize]; + ["Offset of field: QUIC_CERTIFICATE_PKCS12::PrivateKeyPassword"] + [::std::mem::offset_of!(QUIC_CERTIFICATE_PKCS12, PrivateKeyPassword) - 16usize]; +}; +pub type QUIC_CERTIFICATE = ::std::os::raw::c_void; +pub type QUIC_CERTIFICATE_CHAIN = ::std::os::raw::c_void; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct QUIC_CREDENTIAL_CONFIG { + pub Type: QUIC_CREDENTIAL_TYPE, + pub Flags: QUIC_CREDENTIAL_FLAGS, + pub __bindgen_anon_1: QUIC_CREDENTIAL_CONFIG__bindgen_ty_1, + pub Principal: *const ::std::os::raw::c_char, + pub Reserved: *mut ::std::os::raw::c_void, + pub AsyncHandler: QUIC_CREDENTIAL_LOAD_COMPLETE_HANDLER, + pub AllowedCipherSuites: QUIC_ALLOWED_CIPHER_SUITE_FLAGS, + pub CaCertificateFile: *const ::std::os::raw::c_char, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union QUIC_CREDENTIAL_CONFIG__bindgen_ty_1 { + pub CertificateHash: *mut QUIC_CERTIFICATE_HASH, + pub CertificateHashStore: *mut QUIC_CERTIFICATE_HASH_STORE, + pub CertificateContext: *mut QUIC_CERTIFICATE, + pub CertificateFile: *mut QUIC_CERTIFICATE_FILE, + pub CertificateFileProtected: *mut QUIC_CERTIFICATE_FILE_PROTECTED, + pub CertificatePkcs12: *mut QUIC_CERTIFICATE_PKCS12, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of QUIC_CREDENTIAL_CONFIG__bindgen_ty_1"] + [::std::mem::size_of::() - 8usize]; + ["Alignment of QUIC_CREDENTIAL_CONFIG__bindgen_ty_1"] + [::std::mem::align_of::() - 8usize]; + ["Offset of field: QUIC_CREDENTIAL_CONFIG__bindgen_ty_1::CertificateHash"] + [::std::mem::offset_of!(QUIC_CREDENTIAL_CONFIG__bindgen_ty_1, CertificateHash) - 0usize]; + ["Offset of field: QUIC_CREDENTIAL_CONFIG__bindgen_ty_1::CertificateHashStore"][::std::mem::offset_of!( + QUIC_CREDENTIAL_CONFIG__bindgen_ty_1, + CertificateHashStore + ) - 0usize]; + ["Offset of field: QUIC_CREDENTIAL_CONFIG__bindgen_ty_1::CertificateContext"] + [::std::mem::offset_of!(QUIC_CREDENTIAL_CONFIG__bindgen_ty_1, CertificateContext) - 0usize]; + ["Offset of field: QUIC_CREDENTIAL_CONFIG__bindgen_ty_1::CertificateFile"] + [::std::mem::offset_of!(QUIC_CREDENTIAL_CONFIG__bindgen_ty_1, CertificateFile) - 0usize]; + ["Offset of field: QUIC_CREDENTIAL_CONFIG__bindgen_ty_1::CertificateFileProtected"][::std::mem::offset_of!( + QUIC_CREDENTIAL_CONFIG__bindgen_ty_1, + CertificateFileProtected + ) - 0usize]; + ["Offset of field: QUIC_CREDENTIAL_CONFIG__bindgen_ty_1::CertificatePkcs12"] + [::std::mem::offset_of!(QUIC_CREDENTIAL_CONFIG__bindgen_ty_1, CertificatePkcs12) - 0usize]; +}; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of QUIC_CREDENTIAL_CONFIG"][::std::mem::size_of::() - 56usize]; + ["Alignment of QUIC_CREDENTIAL_CONFIG"] + [::std::mem::align_of::() - 8usize]; + ["Offset of field: QUIC_CREDENTIAL_CONFIG::Type"] + [::std::mem::offset_of!(QUIC_CREDENTIAL_CONFIG, Type) - 0usize]; + ["Offset of field: QUIC_CREDENTIAL_CONFIG::Flags"] + [::std::mem::offset_of!(QUIC_CREDENTIAL_CONFIG, Flags) - 4usize]; + ["Offset of field: QUIC_CREDENTIAL_CONFIG::Principal"] + [::std::mem::offset_of!(QUIC_CREDENTIAL_CONFIG, Principal) - 16usize]; + ["Offset of field: QUIC_CREDENTIAL_CONFIG::Reserved"] + [::std::mem::offset_of!(QUIC_CREDENTIAL_CONFIG, Reserved) - 24usize]; + ["Offset of field: QUIC_CREDENTIAL_CONFIG::AsyncHandler"] + [::std::mem::offset_of!(QUIC_CREDENTIAL_CONFIG, AsyncHandler) - 32usize]; + ["Offset of field: QUIC_CREDENTIAL_CONFIG::AllowedCipherSuites"] + [::std::mem::offset_of!(QUIC_CREDENTIAL_CONFIG, AllowedCipherSuites) - 40usize]; + ["Offset of field: QUIC_CREDENTIAL_CONFIG::CaCertificateFile"] + [::std::mem::offset_of!(QUIC_CREDENTIAL_CONFIG, CaCertificateFile) - 48usize]; +}; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct QUIC_TICKET_KEY_CONFIG { + pub Id: [u8; 16usize], + pub Material: [u8; 64usize], + pub MaterialLength: u8, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of QUIC_TICKET_KEY_CONFIG"][::std::mem::size_of::() - 81usize]; + ["Alignment of QUIC_TICKET_KEY_CONFIG"] + [::std::mem::align_of::() - 1usize]; + ["Offset of field: QUIC_TICKET_KEY_CONFIG::Id"] + [::std::mem::offset_of!(QUIC_TICKET_KEY_CONFIG, Id) - 0usize]; + ["Offset of field: QUIC_TICKET_KEY_CONFIG::Material"] + [::std::mem::offset_of!(QUIC_TICKET_KEY_CONFIG, Material) - 16usize]; + ["Offset of field: QUIC_TICKET_KEY_CONFIG::MaterialLength"] + [::std::mem::offset_of!(QUIC_TICKET_KEY_CONFIG, MaterialLength) - 80usize]; +}; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct QUIC_BUFFER { + pub Length: u32, + pub Buffer: *mut u8, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of QUIC_BUFFER"][::std::mem::size_of::() - 16usize]; + ["Alignment of QUIC_BUFFER"][::std::mem::align_of::() - 8usize]; + ["Offset of field: QUIC_BUFFER::Length"][::std::mem::offset_of!(QUIC_BUFFER, Length) - 0usize]; + ["Offset of field: QUIC_BUFFER::Buffer"][::std::mem::offset_of!(QUIC_BUFFER, Buffer) - 8usize]; +}; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct QUIC_NEW_CONNECTION_INFO { + pub QuicVersion: u32, + pub LocalAddress: *const QUIC_ADDR, + pub RemoteAddress: *const QUIC_ADDR, + pub CryptoBufferLength: u32, + pub ClientAlpnListLength: u16, + pub ServerNameLength: u16, + pub NegotiatedAlpnLength: u8, + pub CryptoBuffer: *const u8, + pub ClientAlpnList: *const u8, + pub NegotiatedAlpn: *const u8, + pub ServerName: *const ::std::os::raw::c_char, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of QUIC_NEW_CONNECTION_INFO"] + [::std::mem::size_of::() - 72usize]; + ["Alignment of QUIC_NEW_CONNECTION_INFO"] + [::std::mem::align_of::() - 8usize]; + ["Offset of field: QUIC_NEW_CONNECTION_INFO::QuicVersion"] + [::std::mem::offset_of!(QUIC_NEW_CONNECTION_INFO, QuicVersion) - 0usize]; + ["Offset of field: QUIC_NEW_CONNECTION_INFO::LocalAddress"] + [::std::mem::offset_of!(QUIC_NEW_CONNECTION_INFO, LocalAddress) - 8usize]; + ["Offset of field: QUIC_NEW_CONNECTION_INFO::RemoteAddress"] + [::std::mem::offset_of!(QUIC_NEW_CONNECTION_INFO, RemoteAddress) - 16usize]; + ["Offset of field: QUIC_NEW_CONNECTION_INFO::CryptoBufferLength"] + [::std::mem::offset_of!(QUIC_NEW_CONNECTION_INFO, CryptoBufferLength) - 24usize]; + ["Offset of field: QUIC_NEW_CONNECTION_INFO::ClientAlpnListLength"] + [::std::mem::offset_of!(QUIC_NEW_CONNECTION_INFO, ClientAlpnListLength) - 28usize]; + ["Offset of field: QUIC_NEW_CONNECTION_INFO::ServerNameLength"] + [::std::mem::offset_of!(QUIC_NEW_CONNECTION_INFO, ServerNameLength) - 30usize]; + ["Offset of field: QUIC_NEW_CONNECTION_INFO::NegotiatedAlpnLength"] + [::std::mem::offset_of!(QUIC_NEW_CONNECTION_INFO, NegotiatedAlpnLength) - 32usize]; + ["Offset of field: QUIC_NEW_CONNECTION_INFO::CryptoBuffer"] + [::std::mem::offset_of!(QUIC_NEW_CONNECTION_INFO, CryptoBuffer) - 40usize]; + ["Offset of field: QUIC_NEW_CONNECTION_INFO::ClientAlpnList"] + [::std::mem::offset_of!(QUIC_NEW_CONNECTION_INFO, ClientAlpnList) - 48usize]; + ["Offset of field: QUIC_NEW_CONNECTION_INFO::NegotiatedAlpn"] + [::std::mem::offset_of!(QUIC_NEW_CONNECTION_INFO, NegotiatedAlpn) - 56usize]; + ["Offset of field: QUIC_NEW_CONNECTION_INFO::ServerName"] + [::std::mem::offset_of!(QUIC_NEW_CONNECTION_INFO, ServerName) - 64usize]; +}; +pub const QUIC_TLS_PROTOCOL_VERSION_QUIC_TLS_PROTOCOL_UNKNOWN: QUIC_TLS_PROTOCOL_VERSION = 0; +pub const QUIC_TLS_PROTOCOL_VERSION_QUIC_TLS_PROTOCOL_1_3: QUIC_TLS_PROTOCOL_VERSION = 12288; +pub type QUIC_TLS_PROTOCOL_VERSION = ::std::os::raw::c_uint; +pub const QUIC_CIPHER_ALGORITHM_QUIC_CIPHER_ALGORITHM_NONE: QUIC_CIPHER_ALGORITHM = 0; +pub const QUIC_CIPHER_ALGORITHM_QUIC_CIPHER_ALGORITHM_AES_128: QUIC_CIPHER_ALGORITHM = 26126; +pub const QUIC_CIPHER_ALGORITHM_QUIC_CIPHER_ALGORITHM_AES_256: QUIC_CIPHER_ALGORITHM = 26128; +pub const QUIC_CIPHER_ALGORITHM_QUIC_CIPHER_ALGORITHM_CHACHA20: QUIC_CIPHER_ALGORITHM = 26130; +pub type QUIC_CIPHER_ALGORITHM = ::std::os::raw::c_uint; +pub const QUIC_HASH_ALGORITHM_QUIC_HASH_ALGORITHM_NONE: QUIC_HASH_ALGORITHM = 0; +pub const QUIC_HASH_ALGORITHM_QUIC_HASH_ALGORITHM_SHA_256: QUIC_HASH_ALGORITHM = 32780; +pub const QUIC_HASH_ALGORITHM_QUIC_HASH_ALGORITHM_SHA_384: QUIC_HASH_ALGORITHM = 32781; +pub type QUIC_HASH_ALGORITHM = ::std::os::raw::c_uint; +pub const QUIC_KEY_EXCHANGE_ALGORITHM_QUIC_KEY_EXCHANGE_ALGORITHM_NONE: + QUIC_KEY_EXCHANGE_ALGORITHM = 0; +pub type QUIC_KEY_EXCHANGE_ALGORITHM = ::std::os::raw::c_uint; +pub const QUIC_CIPHER_SUITE_QUIC_CIPHER_SUITE_TLS_AES_128_GCM_SHA256: QUIC_CIPHER_SUITE = 4865; +pub const QUIC_CIPHER_SUITE_QUIC_CIPHER_SUITE_TLS_AES_256_GCM_SHA384: QUIC_CIPHER_SUITE = 4866; +pub const QUIC_CIPHER_SUITE_QUIC_CIPHER_SUITE_TLS_CHACHA20_POLY1305_SHA256: QUIC_CIPHER_SUITE = + 4867; +pub type QUIC_CIPHER_SUITE = ::std::os::raw::c_uint; +pub const QUIC_CONGESTION_CONTROL_ALGORITHM_QUIC_CONGESTION_CONTROL_ALGORITHM_CUBIC: + QUIC_CONGESTION_CONTROL_ALGORITHM = 0; +pub const QUIC_CONGESTION_CONTROL_ALGORITHM_QUIC_CONGESTION_CONTROL_ALGORITHM_MAX: + QUIC_CONGESTION_CONTROL_ALGORITHM = 1; +pub type QUIC_CONGESTION_CONTROL_ALGORITHM = ::std::os::raw::c_uint; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct QUIC_HANDSHAKE_INFO { + pub TlsProtocolVersion: QUIC_TLS_PROTOCOL_VERSION, + pub CipherAlgorithm: QUIC_CIPHER_ALGORITHM, + pub CipherStrength: i32, + pub Hash: QUIC_HASH_ALGORITHM, + pub HashStrength: i32, + pub KeyExchangeAlgorithm: QUIC_KEY_EXCHANGE_ALGORITHM, + pub KeyExchangeStrength: i32, + pub CipherSuite: QUIC_CIPHER_SUITE, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of QUIC_HANDSHAKE_INFO"][::std::mem::size_of::() - 32usize]; + ["Alignment of QUIC_HANDSHAKE_INFO"][::std::mem::align_of::() - 4usize]; + ["Offset of field: QUIC_HANDSHAKE_INFO::TlsProtocolVersion"] + [::std::mem::offset_of!(QUIC_HANDSHAKE_INFO, TlsProtocolVersion) - 0usize]; + ["Offset of field: QUIC_HANDSHAKE_INFO::CipherAlgorithm"] + [::std::mem::offset_of!(QUIC_HANDSHAKE_INFO, CipherAlgorithm) - 4usize]; + ["Offset of field: QUIC_HANDSHAKE_INFO::CipherStrength"] + [::std::mem::offset_of!(QUIC_HANDSHAKE_INFO, CipherStrength) - 8usize]; + ["Offset of field: QUIC_HANDSHAKE_INFO::Hash"] + [::std::mem::offset_of!(QUIC_HANDSHAKE_INFO, Hash) - 12usize]; + ["Offset of field: QUIC_HANDSHAKE_INFO::HashStrength"] + [::std::mem::offset_of!(QUIC_HANDSHAKE_INFO, HashStrength) - 16usize]; + ["Offset of field: QUIC_HANDSHAKE_INFO::KeyExchangeAlgorithm"] + [::std::mem::offset_of!(QUIC_HANDSHAKE_INFO, KeyExchangeAlgorithm) - 20usize]; + ["Offset of field: QUIC_HANDSHAKE_INFO::KeyExchangeStrength"] + [::std::mem::offset_of!(QUIC_HANDSHAKE_INFO, KeyExchangeStrength) - 24usize]; + ["Offset of field: QUIC_HANDSHAKE_INFO::CipherSuite"] + [::std::mem::offset_of!(QUIC_HANDSHAKE_INFO, CipherSuite) - 28usize]; +}; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct QUIC_STATISTICS { + pub CorrelationId: u64, + pub _bitfield_align_1: [u8; 0], + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize]>, + pub Rtt: u32, + pub MinRtt: u32, + pub MaxRtt: u32, + pub Timing: QUIC_STATISTICS__bindgen_ty_1, + pub Handshake: QUIC_STATISTICS__bindgen_ty_2, + pub Send: QUIC_STATISTICS__bindgen_ty_3, + pub Recv: QUIC_STATISTICS__bindgen_ty_4, + pub Misc: QUIC_STATISTICS__bindgen_ty_5, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct QUIC_STATISTICS__bindgen_ty_1 { + pub Start: u64, + pub InitialFlightEnd: u64, + pub HandshakeFlightEnd: u64, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of QUIC_STATISTICS__bindgen_ty_1"] + [::std::mem::size_of::() - 24usize]; + ["Alignment of QUIC_STATISTICS__bindgen_ty_1"] + [::std::mem::align_of::() - 8usize]; + ["Offset of field: QUIC_STATISTICS__bindgen_ty_1::Start"] + [::std::mem::offset_of!(QUIC_STATISTICS__bindgen_ty_1, Start) - 0usize]; + ["Offset of field: QUIC_STATISTICS__bindgen_ty_1::InitialFlightEnd"] + [::std::mem::offset_of!(QUIC_STATISTICS__bindgen_ty_1, InitialFlightEnd) - 8usize]; + ["Offset of field: QUIC_STATISTICS__bindgen_ty_1::HandshakeFlightEnd"] + [::std::mem::offset_of!(QUIC_STATISTICS__bindgen_ty_1, HandshakeFlightEnd) - 16usize]; +}; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct QUIC_STATISTICS__bindgen_ty_2 { + pub ClientFlight1Bytes: u32, + pub ServerFlight1Bytes: u32, + pub ClientFlight2Bytes: u32, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of QUIC_STATISTICS__bindgen_ty_2"] + [::std::mem::size_of::() - 12usize]; + ["Alignment of QUIC_STATISTICS__bindgen_ty_2"] + [::std::mem::align_of::() - 4usize]; + ["Offset of field: QUIC_STATISTICS__bindgen_ty_2::ClientFlight1Bytes"] + [::std::mem::offset_of!(QUIC_STATISTICS__bindgen_ty_2, ClientFlight1Bytes) - 0usize]; + ["Offset of field: QUIC_STATISTICS__bindgen_ty_2::ServerFlight1Bytes"] + [::std::mem::offset_of!(QUIC_STATISTICS__bindgen_ty_2, ServerFlight1Bytes) - 4usize]; + ["Offset of field: QUIC_STATISTICS__bindgen_ty_2::ClientFlight2Bytes"] + [::std::mem::offset_of!(QUIC_STATISTICS__bindgen_ty_2, ClientFlight2Bytes) - 8usize]; +}; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct QUIC_STATISTICS__bindgen_ty_3 { + pub PathMtu: u16, + pub TotalPackets: u64, + pub RetransmittablePackets: u64, + pub SuspectedLostPackets: u64, + pub SpuriousLostPackets: u64, + pub TotalBytes: u64, + pub TotalStreamBytes: u64, + pub CongestionCount: u32, + pub PersistentCongestionCount: u32, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of QUIC_STATISTICS__bindgen_ty_3"] + [::std::mem::size_of::() - 64usize]; + ["Alignment of QUIC_STATISTICS__bindgen_ty_3"] + [::std::mem::align_of::() - 8usize]; + ["Offset of field: QUIC_STATISTICS__bindgen_ty_3::PathMtu"] + [::std::mem::offset_of!(QUIC_STATISTICS__bindgen_ty_3, PathMtu) - 0usize]; + ["Offset of field: QUIC_STATISTICS__bindgen_ty_3::TotalPackets"] + [::std::mem::offset_of!(QUIC_STATISTICS__bindgen_ty_3, TotalPackets) - 8usize]; + ["Offset of field: QUIC_STATISTICS__bindgen_ty_3::RetransmittablePackets"] + [::std::mem::offset_of!(QUIC_STATISTICS__bindgen_ty_3, RetransmittablePackets) - 16usize]; + ["Offset of field: QUIC_STATISTICS__bindgen_ty_3::SuspectedLostPackets"] + [::std::mem::offset_of!(QUIC_STATISTICS__bindgen_ty_3, SuspectedLostPackets) - 24usize]; + ["Offset of field: QUIC_STATISTICS__bindgen_ty_3::SpuriousLostPackets"] + [::std::mem::offset_of!(QUIC_STATISTICS__bindgen_ty_3, SpuriousLostPackets) - 32usize]; + ["Offset of field: QUIC_STATISTICS__bindgen_ty_3::TotalBytes"] + [::std::mem::offset_of!(QUIC_STATISTICS__bindgen_ty_3, TotalBytes) - 40usize]; + ["Offset of field: QUIC_STATISTICS__bindgen_ty_3::TotalStreamBytes"] + [::std::mem::offset_of!(QUIC_STATISTICS__bindgen_ty_3, TotalStreamBytes) - 48usize]; + ["Offset of field: QUIC_STATISTICS__bindgen_ty_3::CongestionCount"] + [::std::mem::offset_of!(QUIC_STATISTICS__bindgen_ty_3, CongestionCount) - 56usize]; + ["Offset of field: QUIC_STATISTICS__bindgen_ty_3::PersistentCongestionCount"][::std::mem::offset_of!( + QUIC_STATISTICS__bindgen_ty_3, + PersistentCongestionCount + ) - 60usize]; +}; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct QUIC_STATISTICS__bindgen_ty_4 { + pub TotalPackets: u64, + pub ReorderedPackets: u64, + pub DroppedPackets: u64, + pub DuplicatePackets: u64, + pub TotalBytes: u64, + pub TotalStreamBytes: u64, + pub DecryptionFailures: u64, + pub ValidAckFrames: u64, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of QUIC_STATISTICS__bindgen_ty_4"] + [::std::mem::size_of::() - 64usize]; + ["Alignment of QUIC_STATISTICS__bindgen_ty_4"] + [::std::mem::align_of::() - 8usize]; + ["Offset of field: QUIC_STATISTICS__bindgen_ty_4::TotalPackets"] + [::std::mem::offset_of!(QUIC_STATISTICS__bindgen_ty_4, TotalPackets) - 0usize]; + ["Offset of field: QUIC_STATISTICS__bindgen_ty_4::ReorderedPackets"] + [::std::mem::offset_of!(QUIC_STATISTICS__bindgen_ty_4, ReorderedPackets) - 8usize]; + ["Offset of field: QUIC_STATISTICS__bindgen_ty_4::DroppedPackets"] + [::std::mem::offset_of!(QUIC_STATISTICS__bindgen_ty_4, DroppedPackets) - 16usize]; + ["Offset of field: QUIC_STATISTICS__bindgen_ty_4::DuplicatePackets"] + [::std::mem::offset_of!(QUIC_STATISTICS__bindgen_ty_4, DuplicatePackets) - 24usize]; + ["Offset of field: QUIC_STATISTICS__bindgen_ty_4::TotalBytes"] + [::std::mem::offset_of!(QUIC_STATISTICS__bindgen_ty_4, TotalBytes) - 32usize]; + ["Offset of field: QUIC_STATISTICS__bindgen_ty_4::TotalStreamBytes"] + [::std::mem::offset_of!(QUIC_STATISTICS__bindgen_ty_4, TotalStreamBytes) - 40usize]; + ["Offset of field: QUIC_STATISTICS__bindgen_ty_4::DecryptionFailures"] + [::std::mem::offset_of!(QUIC_STATISTICS__bindgen_ty_4, DecryptionFailures) - 48usize]; + ["Offset of field: QUIC_STATISTICS__bindgen_ty_4::ValidAckFrames"] + [::std::mem::offset_of!(QUIC_STATISTICS__bindgen_ty_4, ValidAckFrames) - 56usize]; +}; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct QUIC_STATISTICS__bindgen_ty_5 { + pub KeyUpdateCount: u32, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of QUIC_STATISTICS__bindgen_ty_5"] + [::std::mem::size_of::() - 4usize]; + ["Alignment of QUIC_STATISTICS__bindgen_ty_5"] + [::std::mem::align_of::() - 4usize]; + ["Offset of field: QUIC_STATISTICS__bindgen_ty_5::KeyUpdateCount"] + [::std::mem::offset_of!(QUIC_STATISTICS__bindgen_ty_5, KeyUpdateCount) - 0usize]; +}; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of QUIC_STATISTICS"][::std::mem::size_of::() - 200usize]; + ["Alignment of QUIC_STATISTICS"][::std::mem::align_of::() - 8usize]; + ["Offset of field: QUIC_STATISTICS::CorrelationId"] + [::std::mem::offset_of!(QUIC_STATISTICS, CorrelationId) - 0usize]; + ["Offset of field: QUIC_STATISTICS::Rtt"] + [::std::mem::offset_of!(QUIC_STATISTICS, Rtt) - 12usize]; + ["Offset of field: QUIC_STATISTICS::MinRtt"] + [::std::mem::offset_of!(QUIC_STATISTICS, MinRtt) - 16usize]; + ["Offset of field: QUIC_STATISTICS::MaxRtt"] + [::std::mem::offset_of!(QUIC_STATISTICS, MaxRtt) - 20usize]; + ["Offset of field: QUIC_STATISTICS::Timing"] + [::std::mem::offset_of!(QUIC_STATISTICS, Timing) - 24usize]; + ["Offset of field: QUIC_STATISTICS::Handshake"] + [::std::mem::offset_of!(QUIC_STATISTICS, Handshake) - 48usize]; + ["Offset of field: QUIC_STATISTICS::Send"] + [::std::mem::offset_of!(QUIC_STATISTICS, Send) - 64usize]; + ["Offset of field: QUIC_STATISTICS::Recv"] + [::std::mem::offset_of!(QUIC_STATISTICS, Recv) - 128usize]; + ["Offset of field: QUIC_STATISTICS::Misc"] + [::std::mem::offset_of!(QUIC_STATISTICS, Misc) - 192usize]; +}; +impl QUIC_STATISTICS { + #[inline] + pub fn VersionNegotiation(&self) -> u32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u32) } + } + #[inline] + pub fn set_VersionNegotiation(&mut self, val: u32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn VersionNegotiation_raw(this: *const Self) -> u32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 0usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_VersionNegotiation_raw(this: *mut Self, val: u32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 0usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn StatelessRetry(&self) -> u32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u32) } + } + #[inline] + pub fn set_StatelessRetry(&mut self, val: u32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(1usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn StatelessRetry_raw(this: *const Self) -> u32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 1usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_StatelessRetry_raw(this: *mut Self, val: u32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 1usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn ResumptionAttempted(&self) -> u32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(2usize, 1u8) as u32) } + } + #[inline] + pub fn set_ResumptionAttempted(&mut self, val: u32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(2usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn ResumptionAttempted_raw(this: *const Self) -> u32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 2usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_ResumptionAttempted_raw(this: *mut Self, val: u32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 2usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn ResumptionSucceeded(&self) -> u32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(3usize, 1u8) as u32) } + } + #[inline] + pub fn set_ResumptionSucceeded(&mut self, val: u32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(3usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn ResumptionSucceeded_raw(this: *const Self) -> u32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 3usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_ResumptionSucceeded_raw(this: *mut Self, val: u32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 3usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn new_bitfield_1( + VersionNegotiation: u32, + StatelessRetry: u32, + ResumptionAttempted: u32, + ResumptionSucceeded: u32, + ) -> __BindgenBitfieldUnit<[u8; 1usize]> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize]> = Default::default(); + __bindgen_bitfield_unit.set(0usize, 1u8, { + let VersionNegotiation: u32 = unsafe { ::std::mem::transmute(VersionNegotiation) }; + VersionNegotiation as u64 + }); + __bindgen_bitfield_unit.set(1usize, 1u8, { + let StatelessRetry: u32 = unsafe { ::std::mem::transmute(StatelessRetry) }; + StatelessRetry as u64 + }); + __bindgen_bitfield_unit.set(2usize, 1u8, { + let ResumptionAttempted: u32 = unsafe { ::std::mem::transmute(ResumptionAttempted) }; + ResumptionAttempted as u64 + }); + __bindgen_bitfield_unit.set(3usize, 1u8, { + let ResumptionSucceeded: u32 = unsafe { ::std::mem::transmute(ResumptionSucceeded) }; + ResumptionSucceeded as u64 + }); + __bindgen_bitfield_unit + } +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct QUIC_STATISTICS_V2 { + pub CorrelationId: u64, + pub _bitfield_align_1: [u32; 0], + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize]>, + pub Rtt: u32, + pub MinRtt: u32, + pub MaxRtt: u32, + pub TimingStart: u64, + pub TimingInitialFlightEnd: u64, + pub TimingHandshakeFlightEnd: u64, + pub HandshakeClientFlight1Bytes: u32, + pub HandshakeServerFlight1Bytes: u32, + pub HandshakeClientFlight2Bytes: u32, + pub SendPathMtu: u16, + pub SendTotalPackets: u64, + pub SendRetransmittablePackets: u64, + pub SendSuspectedLostPackets: u64, + pub SendSpuriousLostPackets: u64, + pub SendTotalBytes: u64, + pub SendTotalStreamBytes: u64, + pub SendCongestionCount: u32, + pub SendPersistentCongestionCount: u32, + pub RecvTotalPackets: u64, + pub RecvReorderedPackets: u64, + pub RecvDroppedPackets: u64, + pub RecvDuplicatePackets: u64, + pub RecvTotalBytes: u64, + pub RecvTotalStreamBytes: u64, + pub RecvDecryptionFailures: u64, + pub RecvValidAckFrames: u64, + pub KeyUpdateCount: u32, + pub SendCongestionWindow: u32, + pub DestCidUpdateCount: u32, + pub SendEcnCongestionCount: u32, + pub HandshakeHopLimitTTL: u8, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of QUIC_STATISTICS_V2"][::std::mem::size_of::() - 208usize]; + ["Alignment of QUIC_STATISTICS_V2"][::std::mem::align_of::() - 8usize]; + ["Offset of field: QUIC_STATISTICS_V2::CorrelationId"] + [::std::mem::offset_of!(QUIC_STATISTICS_V2, CorrelationId) - 0usize]; + ["Offset of field: QUIC_STATISTICS_V2::Rtt"] + [::std::mem::offset_of!(QUIC_STATISTICS_V2, Rtt) - 12usize]; + ["Offset of field: QUIC_STATISTICS_V2::MinRtt"] + [::std::mem::offset_of!(QUIC_STATISTICS_V2, MinRtt) - 16usize]; + ["Offset of field: QUIC_STATISTICS_V2::MaxRtt"] + [::std::mem::offset_of!(QUIC_STATISTICS_V2, MaxRtt) - 20usize]; + ["Offset of field: QUIC_STATISTICS_V2::TimingStart"] + [::std::mem::offset_of!(QUIC_STATISTICS_V2, TimingStart) - 24usize]; + ["Offset of field: QUIC_STATISTICS_V2::TimingInitialFlightEnd"] + [::std::mem::offset_of!(QUIC_STATISTICS_V2, TimingInitialFlightEnd) - 32usize]; + ["Offset of field: QUIC_STATISTICS_V2::TimingHandshakeFlightEnd"] + [::std::mem::offset_of!(QUIC_STATISTICS_V2, TimingHandshakeFlightEnd) - 40usize]; + ["Offset of field: QUIC_STATISTICS_V2::HandshakeClientFlight1Bytes"] + [::std::mem::offset_of!(QUIC_STATISTICS_V2, HandshakeClientFlight1Bytes) - 48usize]; + ["Offset of field: QUIC_STATISTICS_V2::HandshakeServerFlight1Bytes"] + [::std::mem::offset_of!(QUIC_STATISTICS_V2, HandshakeServerFlight1Bytes) - 52usize]; + ["Offset of field: QUIC_STATISTICS_V2::HandshakeClientFlight2Bytes"] + [::std::mem::offset_of!(QUIC_STATISTICS_V2, HandshakeClientFlight2Bytes) - 56usize]; + ["Offset of field: QUIC_STATISTICS_V2::SendPathMtu"] + [::std::mem::offset_of!(QUIC_STATISTICS_V2, SendPathMtu) - 60usize]; + ["Offset of field: QUIC_STATISTICS_V2::SendTotalPackets"] + [::std::mem::offset_of!(QUIC_STATISTICS_V2, SendTotalPackets) - 64usize]; + ["Offset of field: QUIC_STATISTICS_V2::SendRetransmittablePackets"] + [::std::mem::offset_of!(QUIC_STATISTICS_V2, SendRetransmittablePackets) - 72usize]; + ["Offset of field: QUIC_STATISTICS_V2::SendSuspectedLostPackets"] + [::std::mem::offset_of!(QUIC_STATISTICS_V2, SendSuspectedLostPackets) - 80usize]; + ["Offset of field: QUIC_STATISTICS_V2::SendSpuriousLostPackets"] + [::std::mem::offset_of!(QUIC_STATISTICS_V2, SendSpuriousLostPackets) - 88usize]; + ["Offset of field: QUIC_STATISTICS_V2::SendTotalBytes"] + [::std::mem::offset_of!(QUIC_STATISTICS_V2, SendTotalBytes) - 96usize]; + ["Offset of field: QUIC_STATISTICS_V2::SendTotalStreamBytes"] + [::std::mem::offset_of!(QUIC_STATISTICS_V2, SendTotalStreamBytes) - 104usize]; + ["Offset of field: QUIC_STATISTICS_V2::SendCongestionCount"] + [::std::mem::offset_of!(QUIC_STATISTICS_V2, SendCongestionCount) - 112usize]; + ["Offset of field: QUIC_STATISTICS_V2::SendPersistentCongestionCount"] + [::std::mem::offset_of!(QUIC_STATISTICS_V2, SendPersistentCongestionCount) - 116usize]; + ["Offset of field: QUIC_STATISTICS_V2::RecvTotalPackets"] + [::std::mem::offset_of!(QUIC_STATISTICS_V2, RecvTotalPackets) - 120usize]; + ["Offset of field: QUIC_STATISTICS_V2::RecvReorderedPackets"] + [::std::mem::offset_of!(QUIC_STATISTICS_V2, RecvReorderedPackets) - 128usize]; + ["Offset of field: QUIC_STATISTICS_V2::RecvDroppedPackets"] + [::std::mem::offset_of!(QUIC_STATISTICS_V2, RecvDroppedPackets) - 136usize]; + ["Offset of field: QUIC_STATISTICS_V2::RecvDuplicatePackets"] + [::std::mem::offset_of!(QUIC_STATISTICS_V2, RecvDuplicatePackets) - 144usize]; + ["Offset of field: QUIC_STATISTICS_V2::RecvTotalBytes"] + [::std::mem::offset_of!(QUIC_STATISTICS_V2, RecvTotalBytes) - 152usize]; + ["Offset of field: QUIC_STATISTICS_V2::RecvTotalStreamBytes"] + [::std::mem::offset_of!(QUIC_STATISTICS_V2, RecvTotalStreamBytes) - 160usize]; + ["Offset of field: QUIC_STATISTICS_V2::RecvDecryptionFailures"] + [::std::mem::offset_of!(QUIC_STATISTICS_V2, RecvDecryptionFailures) - 168usize]; + ["Offset of field: QUIC_STATISTICS_V2::RecvValidAckFrames"] + [::std::mem::offset_of!(QUIC_STATISTICS_V2, RecvValidAckFrames) - 176usize]; + ["Offset of field: QUIC_STATISTICS_V2::KeyUpdateCount"] + [::std::mem::offset_of!(QUIC_STATISTICS_V2, KeyUpdateCount) - 184usize]; + ["Offset of field: QUIC_STATISTICS_V2::SendCongestionWindow"] + [::std::mem::offset_of!(QUIC_STATISTICS_V2, SendCongestionWindow) - 188usize]; + ["Offset of field: QUIC_STATISTICS_V2::DestCidUpdateCount"] + [::std::mem::offset_of!(QUIC_STATISTICS_V2, DestCidUpdateCount) - 192usize]; + ["Offset of field: QUIC_STATISTICS_V2::SendEcnCongestionCount"] + [::std::mem::offset_of!(QUIC_STATISTICS_V2, SendEcnCongestionCount) - 196usize]; + ["Offset of field: QUIC_STATISTICS_V2::HandshakeHopLimitTTL"] + [::std::mem::offset_of!(QUIC_STATISTICS_V2, HandshakeHopLimitTTL) - 200usize]; +}; +impl QUIC_STATISTICS_V2 { + #[inline] + pub fn VersionNegotiation(&self) -> u32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u32) } + } + #[inline] + pub fn set_VersionNegotiation(&mut self, val: u32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn VersionNegotiation_raw(this: *const Self) -> u32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 0usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_VersionNegotiation_raw(this: *mut Self, val: u32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 0usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn StatelessRetry(&self) -> u32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u32) } + } + #[inline] + pub fn set_StatelessRetry(&mut self, val: u32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(1usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn StatelessRetry_raw(this: *const Self) -> u32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 1usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_StatelessRetry_raw(this: *mut Self, val: u32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 1usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn ResumptionAttempted(&self) -> u32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(2usize, 1u8) as u32) } + } + #[inline] + pub fn set_ResumptionAttempted(&mut self, val: u32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(2usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn ResumptionAttempted_raw(this: *const Self) -> u32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 2usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_ResumptionAttempted_raw(this: *mut Self, val: u32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 2usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn ResumptionSucceeded(&self) -> u32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(3usize, 1u8) as u32) } + } + #[inline] + pub fn set_ResumptionSucceeded(&mut self, val: u32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(3usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn ResumptionSucceeded_raw(this: *const Self) -> u32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 3usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_ResumptionSucceeded_raw(this: *mut Self, val: u32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 3usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn GreaseBitNegotiated(&self) -> u32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(4usize, 1u8) as u32) } + } + #[inline] + pub fn set_GreaseBitNegotiated(&mut self, val: u32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(4usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn GreaseBitNegotiated_raw(this: *const Self) -> u32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 4usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_GreaseBitNegotiated_raw(this: *mut Self, val: u32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 4usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn EcnCapable(&self) -> u32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(5usize, 1u8) as u32) } + } + #[inline] + pub fn set_EcnCapable(&mut self, val: u32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(5usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn EcnCapable_raw(this: *const Self) -> u32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 5usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_EcnCapable_raw(this: *mut Self, val: u32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 5usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn EncryptionOffloaded(&self) -> u32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(6usize, 1u8) as u32) } + } + #[inline] + pub fn set_EncryptionOffloaded(&mut self, val: u32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(6usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn EncryptionOffloaded_raw(this: *const Self) -> u32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 6usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_EncryptionOffloaded_raw(this: *mut Self, val: u32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 6usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn RESERVED(&self) -> u32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(7usize, 25u8) as u32) } + } + #[inline] + pub fn set_RESERVED(&mut self, val: u32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(7usize, 25u8, val as u64) + } + } + #[inline] + pub unsafe fn RESERVED_raw(this: *const Self) -> u32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 7usize, + 25u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_RESERVED_raw(this: *mut Self, val: u32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 7usize, + 25u8, + val as u64, + ) + } + } + #[inline] + pub fn new_bitfield_1( + VersionNegotiation: u32, + StatelessRetry: u32, + ResumptionAttempted: u32, + ResumptionSucceeded: u32, + GreaseBitNegotiated: u32, + EcnCapable: u32, + EncryptionOffloaded: u32, + RESERVED: u32, + ) -> __BindgenBitfieldUnit<[u8; 4usize]> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize]> = Default::default(); + __bindgen_bitfield_unit.set(0usize, 1u8, { + let VersionNegotiation: u32 = unsafe { ::std::mem::transmute(VersionNegotiation) }; + VersionNegotiation as u64 + }); + __bindgen_bitfield_unit.set(1usize, 1u8, { + let StatelessRetry: u32 = unsafe { ::std::mem::transmute(StatelessRetry) }; + StatelessRetry as u64 + }); + __bindgen_bitfield_unit.set(2usize, 1u8, { + let ResumptionAttempted: u32 = unsafe { ::std::mem::transmute(ResumptionAttempted) }; + ResumptionAttempted as u64 + }); + __bindgen_bitfield_unit.set(3usize, 1u8, { + let ResumptionSucceeded: u32 = unsafe { ::std::mem::transmute(ResumptionSucceeded) }; + ResumptionSucceeded as u64 + }); + __bindgen_bitfield_unit.set(4usize, 1u8, { + let GreaseBitNegotiated: u32 = unsafe { ::std::mem::transmute(GreaseBitNegotiated) }; + GreaseBitNegotiated as u64 + }); + __bindgen_bitfield_unit.set(5usize, 1u8, { + let EcnCapable: u32 = unsafe { ::std::mem::transmute(EcnCapable) }; + EcnCapable as u64 + }); + __bindgen_bitfield_unit.set(6usize, 1u8, { + let EncryptionOffloaded: u32 = unsafe { ::std::mem::transmute(EncryptionOffloaded) }; + EncryptionOffloaded as u64 + }); + __bindgen_bitfield_unit.set(7usize, 25u8, { + let RESERVED: u32 = unsafe { ::std::mem::transmute(RESERVED) }; + RESERVED as u64 + }); + __bindgen_bitfield_unit + } +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct QUIC_LISTENER_STATISTICS { + pub TotalAcceptedConnections: u64, + pub TotalRejectedConnections: u64, + pub BindingRecvDroppedPackets: u64, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of QUIC_LISTENER_STATISTICS"] + [::std::mem::size_of::() - 24usize]; + ["Alignment of QUIC_LISTENER_STATISTICS"] + [::std::mem::align_of::() - 8usize]; + ["Offset of field: QUIC_LISTENER_STATISTICS::TotalAcceptedConnections"] + [::std::mem::offset_of!(QUIC_LISTENER_STATISTICS, TotalAcceptedConnections) - 0usize]; + ["Offset of field: QUIC_LISTENER_STATISTICS::TotalRejectedConnections"] + [::std::mem::offset_of!(QUIC_LISTENER_STATISTICS, TotalRejectedConnections) - 8usize]; + ["Offset of field: QUIC_LISTENER_STATISTICS::BindingRecvDroppedPackets"] + [::std::mem::offset_of!(QUIC_LISTENER_STATISTICS, BindingRecvDroppedPackets) - 16usize]; +}; +pub const QUIC_PERFORMANCE_COUNTERS_QUIC_PERF_COUNTER_CONN_CREATED: QUIC_PERFORMANCE_COUNTERS = 0; +pub const QUIC_PERFORMANCE_COUNTERS_QUIC_PERF_COUNTER_CONN_HANDSHAKE_FAIL: + QUIC_PERFORMANCE_COUNTERS = 1; +pub const QUIC_PERFORMANCE_COUNTERS_QUIC_PERF_COUNTER_CONN_APP_REJECT: QUIC_PERFORMANCE_COUNTERS = + 2; +pub const QUIC_PERFORMANCE_COUNTERS_QUIC_PERF_COUNTER_CONN_RESUMED: QUIC_PERFORMANCE_COUNTERS = 3; +pub const QUIC_PERFORMANCE_COUNTERS_QUIC_PERF_COUNTER_CONN_ACTIVE: QUIC_PERFORMANCE_COUNTERS = 4; +pub const QUIC_PERFORMANCE_COUNTERS_QUIC_PERF_COUNTER_CONN_CONNECTED: QUIC_PERFORMANCE_COUNTERS = 5; +pub const QUIC_PERFORMANCE_COUNTERS_QUIC_PERF_COUNTER_CONN_PROTOCOL_ERRORS: + QUIC_PERFORMANCE_COUNTERS = 6; +pub const QUIC_PERFORMANCE_COUNTERS_QUIC_PERF_COUNTER_CONN_NO_ALPN: QUIC_PERFORMANCE_COUNTERS = 7; +pub const QUIC_PERFORMANCE_COUNTERS_QUIC_PERF_COUNTER_STRM_ACTIVE: QUIC_PERFORMANCE_COUNTERS = 8; +pub const QUIC_PERFORMANCE_COUNTERS_QUIC_PERF_COUNTER_PKTS_SUSPECTED_LOST: + QUIC_PERFORMANCE_COUNTERS = 9; +pub const QUIC_PERFORMANCE_COUNTERS_QUIC_PERF_COUNTER_PKTS_DROPPED: QUIC_PERFORMANCE_COUNTERS = 10; +pub const QUIC_PERFORMANCE_COUNTERS_QUIC_PERF_COUNTER_PKTS_DECRYPTION_FAIL: + QUIC_PERFORMANCE_COUNTERS = 11; +pub const QUIC_PERFORMANCE_COUNTERS_QUIC_PERF_COUNTER_UDP_RECV: QUIC_PERFORMANCE_COUNTERS = 12; +pub const QUIC_PERFORMANCE_COUNTERS_QUIC_PERF_COUNTER_UDP_SEND: QUIC_PERFORMANCE_COUNTERS = 13; +pub const QUIC_PERFORMANCE_COUNTERS_QUIC_PERF_COUNTER_UDP_RECV_BYTES: QUIC_PERFORMANCE_COUNTERS = + 14; +pub const QUIC_PERFORMANCE_COUNTERS_QUIC_PERF_COUNTER_UDP_SEND_BYTES: QUIC_PERFORMANCE_COUNTERS = + 15; +pub const QUIC_PERFORMANCE_COUNTERS_QUIC_PERF_COUNTER_UDP_RECV_EVENTS: QUIC_PERFORMANCE_COUNTERS = + 16; +pub const QUIC_PERFORMANCE_COUNTERS_QUIC_PERF_COUNTER_UDP_SEND_CALLS: QUIC_PERFORMANCE_COUNTERS = + 17; +pub const QUIC_PERFORMANCE_COUNTERS_QUIC_PERF_COUNTER_APP_SEND_BYTES: QUIC_PERFORMANCE_COUNTERS = + 18; +pub const QUIC_PERFORMANCE_COUNTERS_QUIC_PERF_COUNTER_APP_RECV_BYTES: QUIC_PERFORMANCE_COUNTERS = + 19; +pub const QUIC_PERFORMANCE_COUNTERS_QUIC_PERF_COUNTER_CONN_QUEUE_DEPTH: QUIC_PERFORMANCE_COUNTERS = + 20; +pub const QUIC_PERFORMANCE_COUNTERS_QUIC_PERF_COUNTER_CONN_OPER_QUEUE_DEPTH: + QUIC_PERFORMANCE_COUNTERS = 21; +pub const QUIC_PERFORMANCE_COUNTERS_QUIC_PERF_COUNTER_CONN_OPER_QUEUED: QUIC_PERFORMANCE_COUNTERS = + 22; +pub const QUIC_PERFORMANCE_COUNTERS_QUIC_PERF_COUNTER_CONN_OPER_COMPLETED: + QUIC_PERFORMANCE_COUNTERS = 23; +pub const QUIC_PERFORMANCE_COUNTERS_QUIC_PERF_COUNTER_WORK_OPER_QUEUE_DEPTH: + QUIC_PERFORMANCE_COUNTERS = 24; +pub const QUIC_PERFORMANCE_COUNTERS_QUIC_PERF_COUNTER_WORK_OPER_QUEUED: QUIC_PERFORMANCE_COUNTERS = + 25; +pub const QUIC_PERFORMANCE_COUNTERS_QUIC_PERF_COUNTER_WORK_OPER_COMPLETED: + QUIC_PERFORMANCE_COUNTERS = 26; +pub const QUIC_PERFORMANCE_COUNTERS_QUIC_PERF_COUNTER_PATH_VALIDATED: QUIC_PERFORMANCE_COUNTERS = + 27; +pub const QUIC_PERFORMANCE_COUNTERS_QUIC_PERF_COUNTER_PATH_FAILURE: QUIC_PERFORMANCE_COUNTERS = 28; +pub const QUIC_PERFORMANCE_COUNTERS_QUIC_PERF_COUNTER_SEND_STATELESS_RESET: + QUIC_PERFORMANCE_COUNTERS = 29; +pub const QUIC_PERFORMANCE_COUNTERS_QUIC_PERF_COUNTER_SEND_STATELESS_RETRY: + QUIC_PERFORMANCE_COUNTERS = 30; +pub const QUIC_PERFORMANCE_COUNTERS_QUIC_PERF_COUNTER_CONN_LOAD_REJECT: QUIC_PERFORMANCE_COUNTERS = + 31; +pub const QUIC_PERFORMANCE_COUNTERS_QUIC_PERF_COUNTER_MAX: QUIC_PERFORMANCE_COUNTERS = 32; +pub type QUIC_PERFORMANCE_COUNTERS = ::std::os::raw::c_uint; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct QUIC_GLOBAL_SETTINGS { + pub __bindgen_anon_1: QUIC_GLOBAL_SETTINGS__bindgen_ty_1, + pub RetryMemoryLimit: u16, + pub LoadBalancingMode: u16, + pub FixedServerID: u32, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union QUIC_GLOBAL_SETTINGS__bindgen_ty_1 { + pub IsSetFlags: u64, + pub IsSet: QUIC_GLOBAL_SETTINGS__bindgen_ty_1__bindgen_ty_1, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct QUIC_GLOBAL_SETTINGS__bindgen_ty_1__bindgen_ty_1 { + pub _bitfield_align_1: [u64; 0], + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 8usize]>, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of QUIC_GLOBAL_SETTINGS__bindgen_ty_1__bindgen_ty_1"] + [::std::mem::size_of::() - 8usize]; + ["Alignment of QUIC_GLOBAL_SETTINGS__bindgen_ty_1__bindgen_ty_1"] + [::std::mem::align_of::() - 8usize]; +}; +impl QUIC_GLOBAL_SETTINGS__bindgen_ty_1__bindgen_ty_1 { + #[inline] + pub fn RetryMemoryLimit(&self) -> u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u64) } + } + #[inline] + pub fn set_RetryMemoryLimit(&mut self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn RetryMemoryLimit_raw(this: *const Self) -> u64 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 0usize, + 1u8, + ) as u64) + } + } + #[inline] + pub unsafe fn set_RetryMemoryLimit_raw(this: *mut Self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 8usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 0usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn LoadBalancingMode(&self) -> u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u64) } + } + #[inline] + pub fn set_LoadBalancingMode(&mut self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(1usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn LoadBalancingMode_raw(this: *const Self) -> u64 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 1usize, + 1u8, + ) as u64) + } + } + #[inline] + pub unsafe fn set_LoadBalancingMode_raw(this: *mut Self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 8usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 1usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn FixedServerID(&self) -> u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(2usize, 1u8) as u64) } + } + #[inline] + pub fn set_FixedServerID(&mut self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(2usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn FixedServerID_raw(this: *const Self) -> u64 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 2usize, + 1u8, + ) as u64) + } + } + #[inline] + pub unsafe fn set_FixedServerID_raw(this: *mut Self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 8usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 2usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn RESERVED(&self) -> u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(3usize, 61u8) as u64) } + } + #[inline] + pub fn set_RESERVED(&mut self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(3usize, 61u8, val as u64) + } + } + #[inline] + pub unsafe fn RESERVED_raw(this: *const Self) -> u64 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 3usize, + 61u8, + ) as u64) + } + } + #[inline] + pub unsafe fn set_RESERVED_raw(this: *mut Self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 8usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 3usize, + 61u8, + val as u64, + ) + } + } + #[inline] + pub fn new_bitfield_1( + RetryMemoryLimit: u64, + LoadBalancingMode: u64, + FixedServerID: u64, + RESERVED: u64, + ) -> __BindgenBitfieldUnit<[u8; 8usize]> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 8usize]> = Default::default(); + __bindgen_bitfield_unit.set(0usize, 1u8, { + let RetryMemoryLimit: u64 = unsafe { ::std::mem::transmute(RetryMemoryLimit) }; + RetryMemoryLimit as u64 + }); + __bindgen_bitfield_unit.set(1usize, 1u8, { + let LoadBalancingMode: u64 = unsafe { ::std::mem::transmute(LoadBalancingMode) }; + LoadBalancingMode as u64 + }); + __bindgen_bitfield_unit.set(2usize, 1u8, { + let FixedServerID: u64 = unsafe { ::std::mem::transmute(FixedServerID) }; + FixedServerID as u64 + }); + __bindgen_bitfield_unit.set(3usize, 61u8, { + let RESERVED: u64 = unsafe { ::std::mem::transmute(RESERVED) }; + RESERVED as u64 + }); + __bindgen_bitfield_unit + } +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of QUIC_GLOBAL_SETTINGS__bindgen_ty_1"] + [::std::mem::size_of::() - 8usize]; + ["Alignment of QUIC_GLOBAL_SETTINGS__bindgen_ty_1"] + [::std::mem::align_of::() - 8usize]; + ["Offset of field: QUIC_GLOBAL_SETTINGS__bindgen_ty_1::IsSetFlags"] + [::std::mem::offset_of!(QUIC_GLOBAL_SETTINGS__bindgen_ty_1, IsSetFlags) - 0usize]; + ["Offset of field: QUIC_GLOBAL_SETTINGS__bindgen_ty_1::IsSet"] + [::std::mem::offset_of!(QUIC_GLOBAL_SETTINGS__bindgen_ty_1, IsSet) - 0usize]; +}; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of QUIC_GLOBAL_SETTINGS"][::std::mem::size_of::() - 16usize]; + ["Alignment of QUIC_GLOBAL_SETTINGS"][::std::mem::align_of::() - 8usize]; + ["Offset of field: QUIC_GLOBAL_SETTINGS::RetryMemoryLimit"] + [::std::mem::offset_of!(QUIC_GLOBAL_SETTINGS, RetryMemoryLimit) - 8usize]; + ["Offset of field: QUIC_GLOBAL_SETTINGS::LoadBalancingMode"] + [::std::mem::offset_of!(QUIC_GLOBAL_SETTINGS, LoadBalancingMode) - 10usize]; + ["Offset of field: QUIC_GLOBAL_SETTINGS::FixedServerID"] + [::std::mem::offset_of!(QUIC_GLOBAL_SETTINGS, FixedServerID) - 12usize]; +}; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct QUIC_SETTINGS { + pub __bindgen_anon_1: QUIC_SETTINGS__bindgen_ty_1, + pub MaxBytesPerKey: u64, + pub HandshakeIdleTimeoutMs: u64, + pub IdleTimeoutMs: u64, + pub MtuDiscoverySearchCompleteTimeoutUs: u64, + pub TlsClientMaxSendBuffer: u32, + pub TlsServerMaxSendBuffer: u32, + pub StreamRecvWindowDefault: u32, + pub StreamRecvBufferDefault: u32, + pub ConnFlowControlWindow: u32, + pub MaxWorkerQueueDelayUs: u32, + pub MaxStatelessOperations: u32, + pub InitialWindowPackets: u32, + pub SendIdleTimeoutMs: u32, + pub InitialRttMs: u32, + pub MaxAckDelayMs: u32, + pub DisconnectTimeoutMs: u32, + pub KeepAliveIntervalMs: u32, + pub CongestionControlAlgorithm: u16, + pub PeerBidiStreamCount: u16, + pub PeerUnidiStreamCount: u16, + pub MaxBindingStatelessOperations: u16, + pub StatelessOperationExpirationMs: u16, + pub MinimumMtu: u16, + pub MaximumMtu: u16, + pub _bitfield_align_1: [u8; 0], + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize]>, + pub MaxOperationsPerDrain: u8, + pub MtuDiscoveryMissingProbeCount: u8, + pub DestCidUpdateIdleTimeoutMs: u32, + pub __bindgen_anon_2: QUIC_SETTINGS__bindgen_ty_2, + pub StreamRecvWindowBidiLocalDefault: u32, + pub StreamRecvWindowBidiRemoteDefault: u32, + pub StreamRecvWindowUnidiDefault: u32, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union QUIC_SETTINGS__bindgen_ty_1 { + pub IsSetFlags: u64, + pub IsSet: QUIC_SETTINGS__bindgen_ty_1__bindgen_ty_1, +} +#[repr(C)] +#[repr(align(8))] +#[derive(Debug, Copy, Clone)] +pub struct QUIC_SETTINGS__bindgen_ty_1__bindgen_ty_1 { + pub _bitfield_align_1: [u32; 0], + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 8usize]>, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of QUIC_SETTINGS__bindgen_ty_1__bindgen_ty_1"] + [::std::mem::size_of::() - 8usize]; + ["Alignment of QUIC_SETTINGS__bindgen_ty_1__bindgen_ty_1"] + [::std::mem::align_of::() - 8usize]; +}; +impl QUIC_SETTINGS__bindgen_ty_1__bindgen_ty_1 { + #[inline] + pub fn MaxBytesPerKey(&self) -> u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u64) } + } + #[inline] + pub fn set_MaxBytesPerKey(&mut self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn MaxBytesPerKey_raw(this: *const Self) -> u64 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 0usize, + 1u8, + ) as u64) + } + } + #[inline] + pub unsafe fn set_MaxBytesPerKey_raw(this: *mut Self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 8usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 0usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn HandshakeIdleTimeoutMs(&self) -> u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u64) } + } + #[inline] + pub fn set_HandshakeIdleTimeoutMs(&mut self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(1usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn HandshakeIdleTimeoutMs_raw(this: *const Self) -> u64 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 1usize, + 1u8, + ) as u64) + } + } + #[inline] + pub unsafe fn set_HandshakeIdleTimeoutMs_raw(this: *mut Self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 8usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 1usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn IdleTimeoutMs(&self) -> u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(2usize, 1u8) as u64) } + } + #[inline] + pub fn set_IdleTimeoutMs(&mut self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(2usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn IdleTimeoutMs_raw(this: *const Self) -> u64 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 2usize, + 1u8, + ) as u64) + } + } + #[inline] + pub unsafe fn set_IdleTimeoutMs_raw(this: *mut Self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 8usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 2usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn MtuDiscoverySearchCompleteTimeoutUs(&self) -> u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(3usize, 1u8) as u64) } + } + #[inline] + pub fn set_MtuDiscoverySearchCompleteTimeoutUs(&mut self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(3usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn MtuDiscoverySearchCompleteTimeoutUs_raw(this: *const Self) -> u64 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 3usize, + 1u8, + ) as u64) + } + } + #[inline] + pub unsafe fn set_MtuDiscoverySearchCompleteTimeoutUs_raw(this: *mut Self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 8usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 3usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn TlsClientMaxSendBuffer(&self) -> u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(4usize, 1u8) as u64) } + } + #[inline] + pub fn set_TlsClientMaxSendBuffer(&mut self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(4usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn TlsClientMaxSendBuffer_raw(this: *const Self) -> u64 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 4usize, + 1u8, + ) as u64) + } + } + #[inline] + pub unsafe fn set_TlsClientMaxSendBuffer_raw(this: *mut Self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 8usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 4usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn TlsServerMaxSendBuffer(&self) -> u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(5usize, 1u8) as u64) } + } + #[inline] + pub fn set_TlsServerMaxSendBuffer(&mut self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(5usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn TlsServerMaxSendBuffer_raw(this: *const Self) -> u64 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 5usize, + 1u8, + ) as u64) + } + } + #[inline] + pub unsafe fn set_TlsServerMaxSendBuffer_raw(this: *mut Self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 8usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 5usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn StreamRecvWindowDefault(&self) -> u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(6usize, 1u8) as u64) } + } + #[inline] + pub fn set_StreamRecvWindowDefault(&mut self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(6usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn StreamRecvWindowDefault_raw(this: *const Self) -> u64 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 6usize, + 1u8, + ) as u64) + } + } + #[inline] + pub unsafe fn set_StreamRecvWindowDefault_raw(this: *mut Self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 8usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 6usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn StreamRecvBufferDefault(&self) -> u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(7usize, 1u8) as u64) } + } + #[inline] + pub fn set_StreamRecvBufferDefault(&mut self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(7usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn StreamRecvBufferDefault_raw(this: *const Self) -> u64 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 7usize, + 1u8, + ) as u64) + } + } + #[inline] + pub unsafe fn set_StreamRecvBufferDefault_raw(this: *mut Self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 8usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 7usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn ConnFlowControlWindow(&self) -> u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(8usize, 1u8) as u64) } + } + #[inline] + pub fn set_ConnFlowControlWindow(&mut self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(8usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn ConnFlowControlWindow_raw(this: *const Self) -> u64 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 8usize, + 1u8, + ) as u64) + } + } + #[inline] + pub unsafe fn set_ConnFlowControlWindow_raw(this: *mut Self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 8usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 8usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn MaxWorkerQueueDelayUs(&self) -> u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(9usize, 1u8) as u64) } + } + #[inline] + pub fn set_MaxWorkerQueueDelayUs(&mut self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(9usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn MaxWorkerQueueDelayUs_raw(this: *const Self) -> u64 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 9usize, + 1u8, + ) as u64) + } + } + #[inline] + pub unsafe fn set_MaxWorkerQueueDelayUs_raw(this: *mut Self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 8usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 9usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn MaxStatelessOperations(&self) -> u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(10usize, 1u8) as u64) } + } + #[inline] + pub fn set_MaxStatelessOperations(&mut self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(10usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn MaxStatelessOperations_raw(this: *const Self) -> u64 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 10usize, + 1u8, + ) as u64) + } + } + #[inline] + pub unsafe fn set_MaxStatelessOperations_raw(this: *mut Self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 8usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 10usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn InitialWindowPackets(&self) -> u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(11usize, 1u8) as u64) } + } + #[inline] + pub fn set_InitialWindowPackets(&mut self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(11usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn InitialWindowPackets_raw(this: *const Self) -> u64 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 11usize, + 1u8, + ) as u64) + } + } + #[inline] + pub unsafe fn set_InitialWindowPackets_raw(this: *mut Self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 8usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 11usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn SendIdleTimeoutMs(&self) -> u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(12usize, 1u8) as u64) } + } + #[inline] + pub fn set_SendIdleTimeoutMs(&mut self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(12usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn SendIdleTimeoutMs_raw(this: *const Self) -> u64 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 12usize, + 1u8, + ) as u64) + } + } + #[inline] + pub unsafe fn set_SendIdleTimeoutMs_raw(this: *mut Self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 8usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 12usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn InitialRttMs(&self) -> u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(13usize, 1u8) as u64) } + } + #[inline] + pub fn set_InitialRttMs(&mut self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(13usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn InitialRttMs_raw(this: *const Self) -> u64 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 13usize, + 1u8, + ) as u64) + } + } + #[inline] + pub unsafe fn set_InitialRttMs_raw(this: *mut Self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 8usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 13usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn MaxAckDelayMs(&self) -> u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(14usize, 1u8) as u64) } + } + #[inline] + pub fn set_MaxAckDelayMs(&mut self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(14usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn MaxAckDelayMs_raw(this: *const Self) -> u64 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 14usize, + 1u8, + ) as u64) + } + } + #[inline] + pub unsafe fn set_MaxAckDelayMs_raw(this: *mut Self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 8usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 14usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn DisconnectTimeoutMs(&self) -> u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(15usize, 1u8) as u64) } + } + #[inline] + pub fn set_DisconnectTimeoutMs(&mut self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(15usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn DisconnectTimeoutMs_raw(this: *const Self) -> u64 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 15usize, + 1u8, + ) as u64) + } + } + #[inline] + pub unsafe fn set_DisconnectTimeoutMs_raw(this: *mut Self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 8usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 15usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn KeepAliveIntervalMs(&self) -> u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(16usize, 1u8) as u64) } + } + #[inline] + pub fn set_KeepAliveIntervalMs(&mut self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(16usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn KeepAliveIntervalMs_raw(this: *const Self) -> u64 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 16usize, + 1u8, + ) as u64) + } + } + #[inline] + pub unsafe fn set_KeepAliveIntervalMs_raw(this: *mut Self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 8usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 16usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn CongestionControlAlgorithm(&self) -> u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(17usize, 1u8) as u64) } + } + #[inline] + pub fn set_CongestionControlAlgorithm(&mut self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(17usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn CongestionControlAlgorithm_raw(this: *const Self) -> u64 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 17usize, + 1u8, + ) as u64) + } + } + #[inline] + pub unsafe fn set_CongestionControlAlgorithm_raw(this: *mut Self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 8usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 17usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn PeerBidiStreamCount(&self) -> u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(18usize, 1u8) as u64) } + } + #[inline] + pub fn set_PeerBidiStreamCount(&mut self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(18usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn PeerBidiStreamCount_raw(this: *const Self) -> u64 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 18usize, + 1u8, + ) as u64) + } + } + #[inline] + pub unsafe fn set_PeerBidiStreamCount_raw(this: *mut Self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 8usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 18usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn PeerUnidiStreamCount(&self) -> u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(19usize, 1u8) as u64) } + } + #[inline] + pub fn set_PeerUnidiStreamCount(&mut self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(19usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn PeerUnidiStreamCount_raw(this: *const Self) -> u64 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 19usize, + 1u8, + ) as u64) + } + } + #[inline] + pub unsafe fn set_PeerUnidiStreamCount_raw(this: *mut Self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 8usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 19usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn MaxBindingStatelessOperations(&self) -> u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(20usize, 1u8) as u64) } + } + #[inline] + pub fn set_MaxBindingStatelessOperations(&mut self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(20usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn MaxBindingStatelessOperations_raw(this: *const Self) -> u64 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 20usize, + 1u8, + ) as u64) + } + } + #[inline] + pub unsafe fn set_MaxBindingStatelessOperations_raw(this: *mut Self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 8usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 20usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn StatelessOperationExpirationMs(&self) -> u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(21usize, 1u8) as u64) } + } + #[inline] + pub fn set_StatelessOperationExpirationMs(&mut self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(21usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn StatelessOperationExpirationMs_raw(this: *const Self) -> u64 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 21usize, + 1u8, + ) as u64) + } + } + #[inline] + pub unsafe fn set_StatelessOperationExpirationMs_raw(this: *mut Self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 8usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 21usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn MinimumMtu(&self) -> u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(22usize, 1u8) as u64) } + } + #[inline] + pub fn set_MinimumMtu(&mut self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(22usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn MinimumMtu_raw(this: *const Self) -> u64 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 22usize, + 1u8, + ) as u64) + } + } + #[inline] + pub unsafe fn set_MinimumMtu_raw(this: *mut Self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 8usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 22usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn MaximumMtu(&self) -> u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(23usize, 1u8) as u64) } + } + #[inline] + pub fn set_MaximumMtu(&mut self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(23usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn MaximumMtu_raw(this: *const Self) -> u64 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 23usize, + 1u8, + ) as u64) + } + } + #[inline] + pub unsafe fn set_MaximumMtu_raw(this: *mut Self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 8usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 23usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn SendBufferingEnabled(&self) -> u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(24usize, 1u8) as u64) } + } + #[inline] + pub fn set_SendBufferingEnabled(&mut self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(24usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn SendBufferingEnabled_raw(this: *const Self) -> u64 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 24usize, + 1u8, + ) as u64) + } + } + #[inline] + pub unsafe fn set_SendBufferingEnabled_raw(this: *mut Self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 8usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 24usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn PacingEnabled(&self) -> u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(25usize, 1u8) as u64) } + } + #[inline] + pub fn set_PacingEnabled(&mut self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(25usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn PacingEnabled_raw(this: *const Self) -> u64 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 25usize, + 1u8, + ) as u64) + } + } + #[inline] + pub unsafe fn set_PacingEnabled_raw(this: *mut Self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 8usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 25usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn MigrationEnabled(&self) -> u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(26usize, 1u8) as u64) } + } + #[inline] + pub fn set_MigrationEnabled(&mut self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(26usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn MigrationEnabled_raw(this: *const Self) -> u64 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 26usize, + 1u8, + ) as u64) + } + } + #[inline] + pub unsafe fn set_MigrationEnabled_raw(this: *mut Self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 8usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 26usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn DatagramReceiveEnabled(&self) -> u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(27usize, 1u8) as u64) } + } + #[inline] + pub fn set_DatagramReceiveEnabled(&mut self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(27usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn DatagramReceiveEnabled_raw(this: *const Self) -> u64 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 27usize, + 1u8, + ) as u64) + } + } + #[inline] + pub unsafe fn set_DatagramReceiveEnabled_raw(this: *mut Self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 8usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 27usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn ServerResumptionLevel(&self) -> u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(28usize, 1u8) as u64) } + } + #[inline] + pub fn set_ServerResumptionLevel(&mut self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(28usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn ServerResumptionLevel_raw(this: *const Self) -> u64 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 28usize, + 1u8, + ) as u64) + } + } + #[inline] + pub unsafe fn set_ServerResumptionLevel_raw(this: *mut Self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 8usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 28usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn MaxOperationsPerDrain(&self) -> u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(29usize, 1u8) as u64) } + } + #[inline] + pub fn set_MaxOperationsPerDrain(&mut self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(29usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn MaxOperationsPerDrain_raw(this: *const Self) -> u64 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 29usize, + 1u8, + ) as u64) + } + } + #[inline] + pub unsafe fn set_MaxOperationsPerDrain_raw(this: *mut Self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 8usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 29usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn MtuDiscoveryMissingProbeCount(&self) -> u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(30usize, 1u8) as u64) } + } + #[inline] + pub fn set_MtuDiscoveryMissingProbeCount(&mut self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(30usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn MtuDiscoveryMissingProbeCount_raw(this: *const Self) -> u64 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 30usize, + 1u8, + ) as u64) + } + } + #[inline] + pub unsafe fn set_MtuDiscoveryMissingProbeCount_raw(this: *mut Self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 8usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 30usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn DestCidUpdateIdleTimeoutMs(&self) -> u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(31usize, 1u8) as u64) } + } + #[inline] + pub fn set_DestCidUpdateIdleTimeoutMs(&mut self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(31usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn DestCidUpdateIdleTimeoutMs_raw(this: *const Self) -> u64 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 31usize, + 1u8, + ) as u64) + } + } + #[inline] + pub unsafe fn set_DestCidUpdateIdleTimeoutMs_raw(this: *mut Self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 8usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 31usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn GreaseQuicBitEnabled(&self) -> u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(32usize, 1u8) as u64) } + } + #[inline] + pub fn set_GreaseQuicBitEnabled(&mut self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(32usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn GreaseQuicBitEnabled_raw(this: *const Self) -> u64 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 32usize, + 1u8, + ) as u64) + } + } + #[inline] + pub unsafe fn set_GreaseQuicBitEnabled_raw(this: *mut Self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 8usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 32usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn EcnEnabled(&self) -> u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(33usize, 1u8) as u64) } + } + #[inline] + pub fn set_EcnEnabled(&mut self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(33usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn EcnEnabled_raw(this: *const Self) -> u64 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 33usize, + 1u8, + ) as u64) + } + } + #[inline] + pub unsafe fn set_EcnEnabled_raw(this: *mut Self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 8usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 33usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn HyStartEnabled(&self) -> u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(34usize, 1u8) as u64) } + } + #[inline] + pub fn set_HyStartEnabled(&mut self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(34usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn HyStartEnabled_raw(this: *const Self) -> u64 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 34usize, + 1u8, + ) as u64) + } + } + #[inline] + pub unsafe fn set_HyStartEnabled_raw(this: *mut Self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 8usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 34usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn StreamRecvWindowBidiLocalDefault(&self) -> u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(35usize, 1u8) as u64) } + } + #[inline] + pub fn set_StreamRecvWindowBidiLocalDefault(&mut self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(35usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn StreamRecvWindowBidiLocalDefault_raw(this: *const Self) -> u64 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 35usize, + 1u8, + ) as u64) + } + } + #[inline] + pub unsafe fn set_StreamRecvWindowBidiLocalDefault_raw(this: *mut Self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 8usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 35usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn StreamRecvWindowBidiRemoteDefault(&self) -> u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(36usize, 1u8) as u64) } + } + #[inline] + pub fn set_StreamRecvWindowBidiRemoteDefault(&mut self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(36usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn StreamRecvWindowBidiRemoteDefault_raw(this: *const Self) -> u64 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 36usize, + 1u8, + ) as u64) + } + } + #[inline] + pub unsafe fn set_StreamRecvWindowBidiRemoteDefault_raw(this: *mut Self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 8usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 36usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn StreamRecvWindowUnidiDefault(&self) -> u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(37usize, 1u8) as u64) } + } + #[inline] + pub fn set_StreamRecvWindowUnidiDefault(&mut self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(37usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn StreamRecvWindowUnidiDefault_raw(this: *const Self) -> u64 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 37usize, + 1u8, + ) as u64) + } + } + #[inline] + pub unsafe fn set_StreamRecvWindowUnidiDefault_raw(this: *mut Self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 8usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 37usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn RESERVED(&self) -> u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(38usize, 26u8) as u64) } + } + #[inline] + pub fn set_RESERVED(&mut self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(38usize, 26u8, val as u64) + } + } + #[inline] + pub unsafe fn RESERVED_raw(this: *const Self) -> u64 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 38usize, + 26u8, + ) as u64) + } + } + #[inline] + pub unsafe fn set_RESERVED_raw(this: *mut Self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 8usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 38usize, + 26u8, + val as u64, + ) + } + } + #[inline] + pub fn new_bitfield_1( + MaxBytesPerKey: u64, + HandshakeIdleTimeoutMs: u64, + IdleTimeoutMs: u64, + MtuDiscoverySearchCompleteTimeoutUs: u64, + TlsClientMaxSendBuffer: u64, + TlsServerMaxSendBuffer: u64, + StreamRecvWindowDefault: u64, + StreamRecvBufferDefault: u64, + ConnFlowControlWindow: u64, + MaxWorkerQueueDelayUs: u64, + MaxStatelessOperations: u64, + InitialWindowPackets: u64, + SendIdleTimeoutMs: u64, + InitialRttMs: u64, + MaxAckDelayMs: u64, + DisconnectTimeoutMs: u64, + KeepAliveIntervalMs: u64, + CongestionControlAlgorithm: u64, + PeerBidiStreamCount: u64, + PeerUnidiStreamCount: u64, + MaxBindingStatelessOperations: u64, + StatelessOperationExpirationMs: u64, + MinimumMtu: u64, + MaximumMtu: u64, + SendBufferingEnabled: u64, + PacingEnabled: u64, + MigrationEnabled: u64, + DatagramReceiveEnabled: u64, + ServerResumptionLevel: u64, + MaxOperationsPerDrain: u64, + MtuDiscoveryMissingProbeCount: u64, + DestCidUpdateIdleTimeoutMs: u64, + GreaseQuicBitEnabled: u64, + EcnEnabled: u64, + HyStartEnabled: u64, + StreamRecvWindowBidiLocalDefault: u64, + StreamRecvWindowBidiRemoteDefault: u64, + StreamRecvWindowUnidiDefault: u64, + RESERVED: u64, + ) -> __BindgenBitfieldUnit<[u8; 8usize]> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 8usize]> = Default::default(); + __bindgen_bitfield_unit.set(0usize, 1u8, { + let MaxBytesPerKey: u64 = unsafe { ::std::mem::transmute(MaxBytesPerKey) }; + MaxBytesPerKey as u64 + }); + __bindgen_bitfield_unit.set(1usize, 1u8, { + let HandshakeIdleTimeoutMs: u64 = + unsafe { ::std::mem::transmute(HandshakeIdleTimeoutMs) }; + HandshakeIdleTimeoutMs as u64 + }); + __bindgen_bitfield_unit.set(2usize, 1u8, { + let IdleTimeoutMs: u64 = unsafe { ::std::mem::transmute(IdleTimeoutMs) }; + IdleTimeoutMs as u64 + }); + __bindgen_bitfield_unit.set(3usize, 1u8, { + let MtuDiscoverySearchCompleteTimeoutUs: u64 = + unsafe { ::std::mem::transmute(MtuDiscoverySearchCompleteTimeoutUs) }; + MtuDiscoverySearchCompleteTimeoutUs as u64 + }); + __bindgen_bitfield_unit.set(4usize, 1u8, { + let TlsClientMaxSendBuffer: u64 = + unsafe { ::std::mem::transmute(TlsClientMaxSendBuffer) }; + TlsClientMaxSendBuffer as u64 + }); + __bindgen_bitfield_unit.set(5usize, 1u8, { + let TlsServerMaxSendBuffer: u64 = + unsafe { ::std::mem::transmute(TlsServerMaxSendBuffer) }; + TlsServerMaxSendBuffer as u64 + }); + __bindgen_bitfield_unit.set(6usize, 1u8, { + let StreamRecvWindowDefault: u64 = + unsafe { ::std::mem::transmute(StreamRecvWindowDefault) }; + StreamRecvWindowDefault as u64 + }); + __bindgen_bitfield_unit.set(7usize, 1u8, { + let StreamRecvBufferDefault: u64 = + unsafe { ::std::mem::transmute(StreamRecvBufferDefault) }; + StreamRecvBufferDefault as u64 + }); + __bindgen_bitfield_unit.set(8usize, 1u8, { + let ConnFlowControlWindow: u64 = + unsafe { ::std::mem::transmute(ConnFlowControlWindow) }; + ConnFlowControlWindow as u64 + }); + __bindgen_bitfield_unit.set(9usize, 1u8, { + let MaxWorkerQueueDelayUs: u64 = + unsafe { ::std::mem::transmute(MaxWorkerQueueDelayUs) }; + MaxWorkerQueueDelayUs as u64 + }); + __bindgen_bitfield_unit.set(10usize, 1u8, { + let MaxStatelessOperations: u64 = + unsafe { ::std::mem::transmute(MaxStatelessOperations) }; + MaxStatelessOperations as u64 + }); + __bindgen_bitfield_unit.set(11usize, 1u8, { + let InitialWindowPackets: u64 = unsafe { ::std::mem::transmute(InitialWindowPackets) }; + InitialWindowPackets as u64 + }); + __bindgen_bitfield_unit.set(12usize, 1u8, { + let SendIdleTimeoutMs: u64 = unsafe { ::std::mem::transmute(SendIdleTimeoutMs) }; + SendIdleTimeoutMs as u64 + }); + __bindgen_bitfield_unit.set(13usize, 1u8, { + let InitialRttMs: u64 = unsafe { ::std::mem::transmute(InitialRttMs) }; + InitialRttMs as u64 + }); + __bindgen_bitfield_unit.set(14usize, 1u8, { + let MaxAckDelayMs: u64 = unsafe { ::std::mem::transmute(MaxAckDelayMs) }; + MaxAckDelayMs as u64 + }); + __bindgen_bitfield_unit.set(15usize, 1u8, { + let DisconnectTimeoutMs: u64 = unsafe { ::std::mem::transmute(DisconnectTimeoutMs) }; + DisconnectTimeoutMs as u64 + }); + __bindgen_bitfield_unit.set(16usize, 1u8, { + let KeepAliveIntervalMs: u64 = unsafe { ::std::mem::transmute(KeepAliveIntervalMs) }; + KeepAliveIntervalMs as u64 + }); + __bindgen_bitfield_unit.set(17usize, 1u8, { + let CongestionControlAlgorithm: u64 = + unsafe { ::std::mem::transmute(CongestionControlAlgorithm) }; + CongestionControlAlgorithm as u64 + }); + __bindgen_bitfield_unit.set(18usize, 1u8, { + let PeerBidiStreamCount: u64 = unsafe { ::std::mem::transmute(PeerBidiStreamCount) }; + PeerBidiStreamCount as u64 + }); + __bindgen_bitfield_unit.set(19usize, 1u8, { + let PeerUnidiStreamCount: u64 = unsafe { ::std::mem::transmute(PeerUnidiStreamCount) }; + PeerUnidiStreamCount as u64 + }); + __bindgen_bitfield_unit.set(20usize, 1u8, { + let MaxBindingStatelessOperations: u64 = + unsafe { ::std::mem::transmute(MaxBindingStatelessOperations) }; + MaxBindingStatelessOperations as u64 + }); + __bindgen_bitfield_unit.set(21usize, 1u8, { + let StatelessOperationExpirationMs: u64 = + unsafe { ::std::mem::transmute(StatelessOperationExpirationMs) }; + StatelessOperationExpirationMs as u64 + }); + __bindgen_bitfield_unit.set(22usize, 1u8, { + let MinimumMtu: u64 = unsafe { ::std::mem::transmute(MinimumMtu) }; + MinimumMtu as u64 + }); + __bindgen_bitfield_unit.set(23usize, 1u8, { + let MaximumMtu: u64 = unsafe { ::std::mem::transmute(MaximumMtu) }; + MaximumMtu as u64 + }); + __bindgen_bitfield_unit.set(24usize, 1u8, { + let SendBufferingEnabled: u64 = unsafe { ::std::mem::transmute(SendBufferingEnabled) }; + SendBufferingEnabled as u64 + }); + __bindgen_bitfield_unit.set(25usize, 1u8, { + let PacingEnabled: u64 = unsafe { ::std::mem::transmute(PacingEnabled) }; + PacingEnabled as u64 + }); + __bindgen_bitfield_unit.set(26usize, 1u8, { + let MigrationEnabled: u64 = unsafe { ::std::mem::transmute(MigrationEnabled) }; + MigrationEnabled as u64 + }); + __bindgen_bitfield_unit.set(27usize, 1u8, { + let DatagramReceiveEnabled: u64 = + unsafe { ::std::mem::transmute(DatagramReceiveEnabled) }; + DatagramReceiveEnabled as u64 + }); + __bindgen_bitfield_unit.set(28usize, 1u8, { + let ServerResumptionLevel: u64 = + unsafe { ::std::mem::transmute(ServerResumptionLevel) }; + ServerResumptionLevel as u64 + }); + __bindgen_bitfield_unit.set(29usize, 1u8, { + let MaxOperationsPerDrain: u64 = + unsafe { ::std::mem::transmute(MaxOperationsPerDrain) }; + MaxOperationsPerDrain as u64 + }); + __bindgen_bitfield_unit.set(30usize, 1u8, { + let MtuDiscoveryMissingProbeCount: u64 = + unsafe { ::std::mem::transmute(MtuDiscoveryMissingProbeCount) }; + MtuDiscoveryMissingProbeCount as u64 + }); + __bindgen_bitfield_unit.set(31usize, 1u8, { + let DestCidUpdateIdleTimeoutMs: u64 = + unsafe { ::std::mem::transmute(DestCidUpdateIdleTimeoutMs) }; + DestCidUpdateIdleTimeoutMs as u64 + }); + __bindgen_bitfield_unit.set(32usize, 1u8, { + let GreaseQuicBitEnabled: u64 = unsafe { ::std::mem::transmute(GreaseQuicBitEnabled) }; + GreaseQuicBitEnabled as u64 + }); + __bindgen_bitfield_unit.set(33usize, 1u8, { + let EcnEnabled: u64 = unsafe { ::std::mem::transmute(EcnEnabled) }; + EcnEnabled as u64 + }); + __bindgen_bitfield_unit.set(34usize, 1u8, { + let HyStartEnabled: u64 = unsafe { ::std::mem::transmute(HyStartEnabled) }; + HyStartEnabled as u64 + }); + __bindgen_bitfield_unit.set(35usize, 1u8, { + let StreamRecvWindowBidiLocalDefault: u64 = + unsafe { ::std::mem::transmute(StreamRecvWindowBidiLocalDefault) }; + StreamRecvWindowBidiLocalDefault as u64 + }); + __bindgen_bitfield_unit.set(36usize, 1u8, { + let StreamRecvWindowBidiRemoteDefault: u64 = + unsafe { ::std::mem::transmute(StreamRecvWindowBidiRemoteDefault) }; + StreamRecvWindowBidiRemoteDefault as u64 + }); + __bindgen_bitfield_unit.set(37usize, 1u8, { + let StreamRecvWindowUnidiDefault: u64 = + unsafe { ::std::mem::transmute(StreamRecvWindowUnidiDefault) }; + StreamRecvWindowUnidiDefault as u64 + }); + __bindgen_bitfield_unit.set(38usize, 26u8, { + let RESERVED: u64 = unsafe { ::std::mem::transmute(RESERVED) }; + RESERVED as u64 + }); + __bindgen_bitfield_unit + } +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of QUIC_SETTINGS__bindgen_ty_1"] + [::std::mem::size_of::() - 8usize]; + ["Alignment of QUIC_SETTINGS__bindgen_ty_1"] + [::std::mem::align_of::() - 8usize]; + ["Offset of field: QUIC_SETTINGS__bindgen_ty_1::IsSetFlags"] + [::std::mem::offset_of!(QUIC_SETTINGS__bindgen_ty_1, IsSetFlags) - 0usize]; + ["Offset of field: QUIC_SETTINGS__bindgen_ty_1::IsSet"] + [::std::mem::offset_of!(QUIC_SETTINGS__bindgen_ty_1, IsSet) - 0usize]; +}; +#[repr(C)] +#[derive(Copy, Clone)] +pub union QUIC_SETTINGS__bindgen_ty_2 { + pub Flags: u64, + pub __bindgen_anon_1: QUIC_SETTINGS__bindgen_ty_2__bindgen_ty_1, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct QUIC_SETTINGS__bindgen_ty_2__bindgen_ty_1 { + pub _bitfield_align_1: [u64; 0], + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 8usize]>, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of QUIC_SETTINGS__bindgen_ty_2__bindgen_ty_1"] + [::std::mem::size_of::() - 8usize]; + ["Alignment of QUIC_SETTINGS__bindgen_ty_2__bindgen_ty_1"] + [::std::mem::align_of::() - 8usize]; +}; +impl QUIC_SETTINGS__bindgen_ty_2__bindgen_ty_1 { + #[inline] + pub fn HyStartEnabled(&self) -> u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u64) } + } + #[inline] + pub fn set_HyStartEnabled(&mut self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn HyStartEnabled_raw(this: *const Self) -> u64 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 0usize, + 1u8, + ) as u64) + } + } + #[inline] + pub unsafe fn set_HyStartEnabled_raw(this: *mut Self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 8usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 0usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn ReservedFlags(&self) -> u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 63u8) as u64) } + } + #[inline] + pub fn set_ReservedFlags(&mut self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(1usize, 63u8, val as u64) + } + } + #[inline] + pub unsafe fn ReservedFlags_raw(this: *const Self) -> u64 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 1usize, + 63u8, + ) as u64) + } + } + #[inline] + pub unsafe fn set_ReservedFlags_raw(this: *mut Self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 8usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 1usize, + 63u8, + val as u64, + ) + } + } + #[inline] + pub fn new_bitfield_1( + HyStartEnabled: u64, + ReservedFlags: u64, + ) -> __BindgenBitfieldUnit<[u8; 8usize]> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 8usize]> = Default::default(); + __bindgen_bitfield_unit.set(0usize, 1u8, { + let HyStartEnabled: u64 = unsafe { ::std::mem::transmute(HyStartEnabled) }; + HyStartEnabled as u64 + }); + __bindgen_bitfield_unit.set(1usize, 63u8, { + let ReservedFlags: u64 = unsafe { ::std::mem::transmute(ReservedFlags) }; + ReservedFlags as u64 + }); + __bindgen_bitfield_unit + } +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of QUIC_SETTINGS__bindgen_ty_2"] + [::std::mem::size_of::() - 8usize]; + ["Alignment of QUIC_SETTINGS__bindgen_ty_2"] + [::std::mem::align_of::() - 8usize]; + ["Offset of field: QUIC_SETTINGS__bindgen_ty_2::Flags"] + [::std::mem::offset_of!(QUIC_SETTINGS__bindgen_ty_2, Flags) - 0usize]; +}; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of QUIC_SETTINGS"][::std::mem::size_of::() - 144usize]; + ["Alignment of QUIC_SETTINGS"][::std::mem::align_of::() - 8usize]; + ["Offset of field: QUIC_SETTINGS::MaxBytesPerKey"] + [::std::mem::offset_of!(QUIC_SETTINGS, MaxBytesPerKey) - 8usize]; + ["Offset of field: QUIC_SETTINGS::HandshakeIdleTimeoutMs"] + [::std::mem::offset_of!(QUIC_SETTINGS, HandshakeIdleTimeoutMs) - 16usize]; + ["Offset of field: QUIC_SETTINGS::IdleTimeoutMs"] + [::std::mem::offset_of!(QUIC_SETTINGS, IdleTimeoutMs) - 24usize]; + ["Offset of field: QUIC_SETTINGS::MtuDiscoverySearchCompleteTimeoutUs"] + [::std::mem::offset_of!(QUIC_SETTINGS, MtuDiscoverySearchCompleteTimeoutUs) - 32usize]; + ["Offset of field: QUIC_SETTINGS::TlsClientMaxSendBuffer"] + [::std::mem::offset_of!(QUIC_SETTINGS, TlsClientMaxSendBuffer) - 40usize]; + ["Offset of field: QUIC_SETTINGS::TlsServerMaxSendBuffer"] + [::std::mem::offset_of!(QUIC_SETTINGS, TlsServerMaxSendBuffer) - 44usize]; + ["Offset of field: QUIC_SETTINGS::StreamRecvWindowDefault"] + [::std::mem::offset_of!(QUIC_SETTINGS, StreamRecvWindowDefault) - 48usize]; + ["Offset of field: QUIC_SETTINGS::StreamRecvBufferDefault"] + [::std::mem::offset_of!(QUIC_SETTINGS, StreamRecvBufferDefault) - 52usize]; + ["Offset of field: QUIC_SETTINGS::ConnFlowControlWindow"] + [::std::mem::offset_of!(QUIC_SETTINGS, ConnFlowControlWindow) - 56usize]; + ["Offset of field: QUIC_SETTINGS::MaxWorkerQueueDelayUs"] + [::std::mem::offset_of!(QUIC_SETTINGS, MaxWorkerQueueDelayUs) - 60usize]; + ["Offset of field: QUIC_SETTINGS::MaxStatelessOperations"] + [::std::mem::offset_of!(QUIC_SETTINGS, MaxStatelessOperations) - 64usize]; + ["Offset of field: QUIC_SETTINGS::InitialWindowPackets"] + [::std::mem::offset_of!(QUIC_SETTINGS, InitialWindowPackets) - 68usize]; + ["Offset of field: QUIC_SETTINGS::SendIdleTimeoutMs"] + [::std::mem::offset_of!(QUIC_SETTINGS, SendIdleTimeoutMs) - 72usize]; + ["Offset of field: QUIC_SETTINGS::InitialRttMs"] + [::std::mem::offset_of!(QUIC_SETTINGS, InitialRttMs) - 76usize]; + ["Offset of field: QUIC_SETTINGS::MaxAckDelayMs"] + [::std::mem::offset_of!(QUIC_SETTINGS, MaxAckDelayMs) - 80usize]; + ["Offset of field: QUIC_SETTINGS::DisconnectTimeoutMs"] + [::std::mem::offset_of!(QUIC_SETTINGS, DisconnectTimeoutMs) - 84usize]; + ["Offset of field: QUIC_SETTINGS::KeepAliveIntervalMs"] + [::std::mem::offset_of!(QUIC_SETTINGS, KeepAliveIntervalMs) - 88usize]; + ["Offset of field: QUIC_SETTINGS::CongestionControlAlgorithm"] + [::std::mem::offset_of!(QUIC_SETTINGS, CongestionControlAlgorithm) - 92usize]; + ["Offset of field: QUIC_SETTINGS::PeerBidiStreamCount"] + [::std::mem::offset_of!(QUIC_SETTINGS, PeerBidiStreamCount) - 94usize]; + ["Offset of field: QUIC_SETTINGS::PeerUnidiStreamCount"] + [::std::mem::offset_of!(QUIC_SETTINGS, PeerUnidiStreamCount) - 96usize]; + ["Offset of field: QUIC_SETTINGS::MaxBindingStatelessOperations"] + [::std::mem::offset_of!(QUIC_SETTINGS, MaxBindingStatelessOperations) - 98usize]; + ["Offset of field: QUIC_SETTINGS::StatelessOperationExpirationMs"] + [::std::mem::offset_of!(QUIC_SETTINGS, StatelessOperationExpirationMs) - 100usize]; + ["Offset of field: QUIC_SETTINGS::MinimumMtu"] + [::std::mem::offset_of!(QUIC_SETTINGS, MinimumMtu) - 102usize]; + ["Offset of field: QUIC_SETTINGS::MaximumMtu"] + [::std::mem::offset_of!(QUIC_SETTINGS, MaximumMtu) - 104usize]; + ["Offset of field: QUIC_SETTINGS::MaxOperationsPerDrain"] + [::std::mem::offset_of!(QUIC_SETTINGS, MaxOperationsPerDrain) - 107usize]; + ["Offset of field: QUIC_SETTINGS::MtuDiscoveryMissingProbeCount"] + [::std::mem::offset_of!(QUIC_SETTINGS, MtuDiscoveryMissingProbeCount) - 108usize]; + ["Offset of field: QUIC_SETTINGS::DestCidUpdateIdleTimeoutMs"] + [::std::mem::offset_of!(QUIC_SETTINGS, DestCidUpdateIdleTimeoutMs) - 112usize]; + ["Offset of field: QUIC_SETTINGS::StreamRecvWindowBidiLocalDefault"] + [::std::mem::offset_of!(QUIC_SETTINGS, StreamRecvWindowBidiLocalDefault) - 128usize]; + ["Offset of field: QUIC_SETTINGS::StreamRecvWindowBidiRemoteDefault"] + [::std::mem::offset_of!(QUIC_SETTINGS, StreamRecvWindowBidiRemoteDefault) - 132usize]; + ["Offset of field: QUIC_SETTINGS::StreamRecvWindowUnidiDefault"] + [::std::mem::offset_of!(QUIC_SETTINGS, StreamRecvWindowUnidiDefault) - 136usize]; +}; +impl QUIC_SETTINGS { + #[inline] + pub fn SendBufferingEnabled(&self) -> u8 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u8) } + } + #[inline] + pub fn set_SendBufferingEnabled(&mut self, val: u8) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn SendBufferingEnabled_raw(this: *const Self) -> u8 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 0usize, + 1u8, + ) as u8) + } + } + #[inline] + pub unsafe fn set_SendBufferingEnabled_raw(this: *mut Self, val: u8) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 0usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn PacingEnabled(&self) -> u8 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u8) } + } + #[inline] + pub fn set_PacingEnabled(&mut self, val: u8) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + self._bitfield_1.set(1usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn PacingEnabled_raw(this: *const Self) -> u8 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 1usize, + 1u8, + ) as u8) + } + } + #[inline] + pub unsafe fn set_PacingEnabled_raw(this: *mut Self, val: u8) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 1usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn MigrationEnabled(&self) -> u8 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(2usize, 1u8) as u8) } + } + #[inline] + pub fn set_MigrationEnabled(&mut self, val: u8) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + self._bitfield_1.set(2usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn MigrationEnabled_raw(this: *const Self) -> u8 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 2usize, + 1u8, + ) as u8) + } + } + #[inline] + pub unsafe fn set_MigrationEnabled_raw(this: *mut Self, val: u8) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 2usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn DatagramReceiveEnabled(&self) -> u8 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(3usize, 1u8) as u8) } + } + #[inline] + pub fn set_DatagramReceiveEnabled(&mut self, val: u8) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + self._bitfield_1.set(3usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn DatagramReceiveEnabled_raw(this: *const Self) -> u8 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 3usize, + 1u8, + ) as u8) + } + } + #[inline] + pub unsafe fn set_DatagramReceiveEnabled_raw(this: *mut Self, val: u8) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 3usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn ServerResumptionLevel(&self) -> u8 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(4usize, 2u8) as u8) } + } + #[inline] + pub fn set_ServerResumptionLevel(&mut self, val: u8) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + self._bitfield_1.set(4usize, 2u8, val as u64) + } + } + #[inline] + pub unsafe fn ServerResumptionLevel_raw(this: *const Self) -> u8 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 4usize, + 2u8, + ) as u8) + } + } + #[inline] + pub unsafe fn set_ServerResumptionLevel_raw(this: *mut Self, val: u8) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 4usize, + 2u8, + val as u64, + ) + } + } + #[inline] + pub fn GreaseQuicBitEnabled(&self) -> u8 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(6usize, 1u8) as u8) } + } + #[inline] + pub fn set_GreaseQuicBitEnabled(&mut self, val: u8) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + self._bitfield_1.set(6usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn GreaseQuicBitEnabled_raw(this: *const Self) -> u8 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 6usize, + 1u8, + ) as u8) + } + } + #[inline] + pub unsafe fn set_GreaseQuicBitEnabled_raw(this: *mut Self, val: u8) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 6usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn EcnEnabled(&self) -> u8 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(7usize, 1u8) as u8) } + } + #[inline] + pub fn set_EcnEnabled(&mut self, val: u8) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + self._bitfield_1.set(7usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn EcnEnabled_raw(this: *const Self) -> u8 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 7usize, + 1u8, + ) as u8) + } + } + #[inline] + pub unsafe fn set_EcnEnabled_raw(this: *mut Self, val: u8) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 7usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn new_bitfield_1( + SendBufferingEnabled: u8, + PacingEnabled: u8, + MigrationEnabled: u8, + DatagramReceiveEnabled: u8, + ServerResumptionLevel: u8, + GreaseQuicBitEnabled: u8, + EcnEnabled: u8, + ) -> __BindgenBitfieldUnit<[u8; 1usize]> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize]> = Default::default(); + __bindgen_bitfield_unit.set(0usize, 1u8, { + let SendBufferingEnabled: u8 = unsafe { ::std::mem::transmute(SendBufferingEnabled) }; + SendBufferingEnabled as u64 + }); + __bindgen_bitfield_unit.set(1usize, 1u8, { + let PacingEnabled: u8 = unsafe { ::std::mem::transmute(PacingEnabled) }; + PacingEnabled as u64 + }); + __bindgen_bitfield_unit.set(2usize, 1u8, { + let MigrationEnabled: u8 = unsafe { ::std::mem::transmute(MigrationEnabled) }; + MigrationEnabled as u64 + }); + __bindgen_bitfield_unit.set(3usize, 1u8, { + let DatagramReceiveEnabled: u8 = + unsafe { ::std::mem::transmute(DatagramReceiveEnabled) }; + DatagramReceiveEnabled as u64 + }); + __bindgen_bitfield_unit.set(4usize, 2u8, { + let ServerResumptionLevel: u8 = unsafe { ::std::mem::transmute(ServerResumptionLevel) }; + ServerResumptionLevel as u64 + }); + __bindgen_bitfield_unit.set(6usize, 1u8, { + let GreaseQuicBitEnabled: u8 = unsafe { ::std::mem::transmute(GreaseQuicBitEnabled) }; + GreaseQuicBitEnabled as u64 + }); + __bindgen_bitfield_unit.set(7usize, 1u8, { + let EcnEnabled: u8 = unsafe { ::std::mem::transmute(EcnEnabled) }; + EcnEnabled as u64 + }); + __bindgen_bitfield_unit + } +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct QUIC_TLS_SECRETS { + pub SecretLength: u8, + pub IsSet: QUIC_TLS_SECRETS__bindgen_ty_1, + pub ClientRandom: [u8; 32usize], + pub ClientEarlyTrafficSecret: [u8; 64usize], + pub ClientHandshakeTrafficSecret: [u8; 64usize], + pub ServerHandshakeTrafficSecret: [u8; 64usize], + pub ClientTrafficSecret0: [u8; 64usize], + pub ServerTrafficSecret0: [u8; 64usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct QUIC_TLS_SECRETS__bindgen_ty_1 { + pub _bitfield_align_1: [u8; 0], + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize]>, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of QUIC_TLS_SECRETS__bindgen_ty_1"] + [::std::mem::size_of::() - 1usize]; + ["Alignment of QUIC_TLS_SECRETS__bindgen_ty_1"] + [::std::mem::align_of::() - 1usize]; +}; +impl QUIC_TLS_SECRETS__bindgen_ty_1 { + #[inline] + pub fn ClientRandom(&self) -> u8 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u8) } + } + #[inline] + pub fn set_ClientRandom(&mut self, val: u8) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn ClientRandom_raw(this: *const Self) -> u8 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 0usize, + 1u8, + ) as u8) + } + } + #[inline] + pub unsafe fn set_ClientRandom_raw(this: *mut Self, val: u8) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 0usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn ClientEarlyTrafficSecret(&self) -> u8 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u8) } + } + #[inline] + pub fn set_ClientEarlyTrafficSecret(&mut self, val: u8) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + self._bitfield_1.set(1usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn ClientEarlyTrafficSecret_raw(this: *const Self) -> u8 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 1usize, + 1u8, + ) as u8) + } + } + #[inline] + pub unsafe fn set_ClientEarlyTrafficSecret_raw(this: *mut Self, val: u8) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 1usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn ClientHandshakeTrafficSecret(&self) -> u8 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(2usize, 1u8) as u8) } + } + #[inline] + pub fn set_ClientHandshakeTrafficSecret(&mut self, val: u8) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + self._bitfield_1.set(2usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn ClientHandshakeTrafficSecret_raw(this: *const Self) -> u8 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 2usize, + 1u8, + ) as u8) + } + } + #[inline] + pub unsafe fn set_ClientHandshakeTrafficSecret_raw(this: *mut Self, val: u8) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 2usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn ServerHandshakeTrafficSecret(&self) -> u8 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(3usize, 1u8) as u8) } + } + #[inline] + pub fn set_ServerHandshakeTrafficSecret(&mut self, val: u8) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + self._bitfield_1.set(3usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn ServerHandshakeTrafficSecret_raw(this: *const Self) -> u8 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 3usize, + 1u8, + ) as u8) + } + } + #[inline] + pub unsafe fn set_ServerHandshakeTrafficSecret_raw(this: *mut Self, val: u8) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 3usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn ClientTrafficSecret0(&self) -> u8 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(4usize, 1u8) as u8) } + } + #[inline] + pub fn set_ClientTrafficSecret0(&mut self, val: u8) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + self._bitfield_1.set(4usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn ClientTrafficSecret0_raw(this: *const Self) -> u8 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 4usize, + 1u8, + ) as u8) + } + } + #[inline] + pub unsafe fn set_ClientTrafficSecret0_raw(this: *mut Self, val: u8) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 4usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn ServerTrafficSecret0(&self) -> u8 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(5usize, 1u8) as u8) } + } + #[inline] + pub fn set_ServerTrafficSecret0(&mut self, val: u8) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + self._bitfield_1.set(5usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn ServerTrafficSecret0_raw(this: *const Self) -> u8 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 5usize, + 1u8, + ) as u8) + } + } + #[inline] + pub unsafe fn set_ServerTrafficSecret0_raw(this: *mut Self, val: u8) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 5usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn new_bitfield_1( + ClientRandom: u8, + ClientEarlyTrafficSecret: u8, + ClientHandshakeTrafficSecret: u8, + ServerHandshakeTrafficSecret: u8, + ClientTrafficSecret0: u8, + ServerTrafficSecret0: u8, + ) -> __BindgenBitfieldUnit<[u8; 1usize]> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize]> = Default::default(); + __bindgen_bitfield_unit.set(0usize, 1u8, { + let ClientRandom: u8 = unsafe { ::std::mem::transmute(ClientRandom) }; + ClientRandom as u64 + }); + __bindgen_bitfield_unit.set(1usize, 1u8, { + let ClientEarlyTrafficSecret: u8 = + unsafe { ::std::mem::transmute(ClientEarlyTrafficSecret) }; + ClientEarlyTrafficSecret as u64 + }); + __bindgen_bitfield_unit.set(2usize, 1u8, { + let ClientHandshakeTrafficSecret: u8 = + unsafe { ::std::mem::transmute(ClientHandshakeTrafficSecret) }; + ClientHandshakeTrafficSecret as u64 + }); + __bindgen_bitfield_unit.set(3usize, 1u8, { + let ServerHandshakeTrafficSecret: u8 = + unsafe { ::std::mem::transmute(ServerHandshakeTrafficSecret) }; + ServerHandshakeTrafficSecret as u64 + }); + __bindgen_bitfield_unit.set(4usize, 1u8, { + let ClientTrafficSecret0: u8 = unsafe { ::std::mem::transmute(ClientTrafficSecret0) }; + ClientTrafficSecret0 as u64 + }); + __bindgen_bitfield_unit.set(5usize, 1u8, { + let ServerTrafficSecret0: u8 = unsafe { ::std::mem::transmute(ServerTrafficSecret0) }; + ServerTrafficSecret0 as u64 + }); + __bindgen_bitfield_unit + } +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of QUIC_TLS_SECRETS"][::std::mem::size_of::() - 354usize]; + ["Alignment of QUIC_TLS_SECRETS"][::std::mem::align_of::() - 1usize]; + ["Offset of field: QUIC_TLS_SECRETS::SecretLength"] + [::std::mem::offset_of!(QUIC_TLS_SECRETS, SecretLength) - 0usize]; + ["Offset of field: QUIC_TLS_SECRETS::IsSet"] + [::std::mem::offset_of!(QUIC_TLS_SECRETS, IsSet) - 1usize]; + ["Offset of field: QUIC_TLS_SECRETS::ClientRandom"] + [::std::mem::offset_of!(QUIC_TLS_SECRETS, ClientRandom) - 2usize]; + ["Offset of field: QUIC_TLS_SECRETS::ClientEarlyTrafficSecret"] + [::std::mem::offset_of!(QUIC_TLS_SECRETS, ClientEarlyTrafficSecret) - 34usize]; + ["Offset of field: QUIC_TLS_SECRETS::ClientHandshakeTrafficSecret"] + [::std::mem::offset_of!(QUIC_TLS_SECRETS, ClientHandshakeTrafficSecret) - 98usize]; + ["Offset of field: QUIC_TLS_SECRETS::ServerHandshakeTrafficSecret"] + [::std::mem::offset_of!(QUIC_TLS_SECRETS, ServerHandshakeTrafficSecret) - 162usize]; + ["Offset of field: QUIC_TLS_SECRETS::ClientTrafficSecret0"] + [::std::mem::offset_of!(QUIC_TLS_SECRETS, ClientTrafficSecret0) - 226usize]; + ["Offset of field: QUIC_TLS_SECRETS::ServerTrafficSecret0"] + [::std::mem::offset_of!(QUIC_TLS_SECRETS, ServerTrafficSecret0) - 290usize]; +}; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct QUIC_STREAM_STATISTICS { + pub ConnBlockedBySchedulingUs: u64, + pub ConnBlockedByPacingUs: u64, + pub ConnBlockedByAmplificationProtUs: u64, + pub ConnBlockedByCongestionControlUs: u64, + pub ConnBlockedByFlowControlUs: u64, + pub StreamBlockedByIdFlowControlUs: u64, + pub StreamBlockedByFlowControlUs: u64, + pub StreamBlockedByAppUs: u64, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of QUIC_STREAM_STATISTICS"][::std::mem::size_of::() - 64usize]; + ["Alignment of QUIC_STREAM_STATISTICS"] + [::std::mem::align_of::() - 8usize]; + ["Offset of field: QUIC_STREAM_STATISTICS::ConnBlockedBySchedulingUs"] + [::std::mem::offset_of!(QUIC_STREAM_STATISTICS, ConnBlockedBySchedulingUs) - 0usize]; + ["Offset of field: QUIC_STREAM_STATISTICS::ConnBlockedByPacingUs"] + [::std::mem::offset_of!(QUIC_STREAM_STATISTICS, ConnBlockedByPacingUs) - 8usize]; + ["Offset of field: QUIC_STREAM_STATISTICS::ConnBlockedByAmplificationProtUs"][::std::mem::offset_of!( + QUIC_STREAM_STATISTICS, + ConnBlockedByAmplificationProtUs + ) - 16usize]; + ["Offset of field: QUIC_STREAM_STATISTICS::ConnBlockedByCongestionControlUs"][::std::mem::offset_of!( + QUIC_STREAM_STATISTICS, + ConnBlockedByCongestionControlUs + ) - 24usize]; + ["Offset of field: QUIC_STREAM_STATISTICS::ConnBlockedByFlowControlUs"] + [::std::mem::offset_of!(QUIC_STREAM_STATISTICS, ConnBlockedByFlowControlUs) - 32usize]; + ["Offset of field: QUIC_STREAM_STATISTICS::StreamBlockedByIdFlowControlUs"] + [::std::mem::offset_of!(QUIC_STREAM_STATISTICS, StreamBlockedByIdFlowControlUs) - 40usize]; + ["Offset of field: QUIC_STREAM_STATISTICS::StreamBlockedByFlowControlUs"] + [::std::mem::offset_of!(QUIC_STREAM_STATISTICS, StreamBlockedByFlowControlUs) - 48usize]; + ["Offset of field: QUIC_STREAM_STATISTICS::StreamBlockedByAppUs"] + [::std::mem::offset_of!(QUIC_STREAM_STATISTICS, StreamBlockedByAppUs) - 56usize]; +}; +pub type QUIC_SET_CONTEXT_FN = ::std::option::Option< + unsafe extern "C" fn(Handle: HQUIC, Context: *mut ::std::os::raw::c_void), +>; +pub type QUIC_GET_CONTEXT_FN = + ::std::option::Option *mut ::std::os::raw::c_void>; +pub type QUIC_SET_CALLBACK_HANDLER_FN = ::std::option::Option< + unsafe extern "C" fn( + Handle: HQUIC, + Handler: *mut ::std::os::raw::c_void, + Context: *mut ::std::os::raw::c_void, + ), +>; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct QUIC_SCHANNEL_CREDENTIAL_ATTRIBUTE_W { + pub Attribute: ::std::os::raw::c_ulong, + pub BufferLength: ::std::os::raw::c_ulong, + pub Buffer: *mut ::std::os::raw::c_void, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of QUIC_SCHANNEL_CREDENTIAL_ATTRIBUTE_W"] + [::std::mem::size_of::() - 24usize]; + ["Alignment of QUIC_SCHANNEL_CREDENTIAL_ATTRIBUTE_W"] + [::std::mem::align_of::() - 8usize]; + ["Offset of field: QUIC_SCHANNEL_CREDENTIAL_ATTRIBUTE_W::Attribute"] + [::std::mem::offset_of!(QUIC_SCHANNEL_CREDENTIAL_ATTRIBUTE_W, Attribute) - 0usize]; + ["Offset of field: QUIC_SCHANNEL_CREDENTIAL_ATTRIBUTE_W::BufferLength"] + [::std::mem::offset_of!(QUIC_SCHANNEL_CREDENTIAL_ATTRIBUTE_W, BufferLength) - 8usize]; + ["Offset of field: QUIC_SCHANNEL_CREDENTIAL_ATTRIBUTE_W::Buffer"] + [::std::mem::offset_of!(QUIC_SCHANNEL_CREDENTIAL_ATTRIBUTE_W, Buffer) - 16usize]; +}; +pub type QUIC_SET_PARAM_FN = ::std::option::Option< + unsafe extern "C" fn( + Handle: HQUIC, + Param: u32, + BufferLength: u32, + Buffer: *const ::std::os::raw::c_void, + ) -> ::std::os::raw::c_uint, +>; +pub type QUIC_GET_PARAM_FN = ::std::option::Option< + unsafe extern "C" fn( + Handle: HQUIC, + Param: u32, + BufferLength: *mut u32, + Buffer: *mut ::std::os::raw::c_void, + ) -> ::std::os::raw::c_uint, +>; +pub type QUIC_REGISTRATION_OPEN_FN = ::std::option::Option< + unsafe extern "C" fn( + Config: *const QUIC_REGISTRATION_CONFIG, + Registration: *mut HQUIC, + ) -> ::std::os::raw::c_uint, +>; +pub type QUIC_REGISTRATION_CLOSE_FN = + ::std::option::Option; +pub type QUIC_REGISTRATION_SHUTDOWN_FN = ::std::option::Option< + unsafe extern "C" fn( + Registration: HQUIC, + Flags: QUIC_CONNECTION_SHUTDOWN_FLAGS, + ErrorCode: QUIC_UINT62, + ), +>; +pub type QUIC_CONFIGURATION_OPEN_FN = ::std::option::Option< + unsafe extern "C" fn( + Registration: HQUIC, + AlpnBuffers: *const QUIC_BUFFER, + AlpnBufferCount: u32, + Settings: *const QUIC_SETTINGS, + SettingsSize: u32, + Context: *mut ::std::os::raw::c_void, + Configuration: *mut HQUIC, + ) -> ::std::os::raw::c_uint, +>; +pub type QUIC_CONFIGURATION_CLOSE_FN = + ::std::option::Option; +pub type QUIC_CONFIGURATION_LOAD_CREDENTIAL_FN = ::std::option::Option< + unsafe extern "C" fn( + Configuration: HQUIC, + CredConfig: *const QUIC_CREDENTIAL_CONFIG, + ) -> ::std::os::raw::c_uint, +>; +pub const QUIC_LISTENER_EVENT_TYPE_QUIC_LISTENER_EVENT_NEW_CONNECTION: QUIC_LISTENER_EVENT_TYPE = 0; +pub const QUIC_LISTENER_EVENT_TYPE_QUIC_LISTENER_EVENT_STOP_COMPLETE: QUIC_LISTENER_EVENT_TYPE = 1; +pub type QUIC_LISTENER_EVENT_TYPE = ::std::os::raw::c_uint; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct QUIC_LISTENER_EVENT { + pub Type: QUIC_LISTENER_EVENT_TYPE, + pub __bindgen_anon_1: QUIC_LISTENER_EVENT__bindgen_ty_1, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union QUIC_LISTENER_EVENT__bindgen_ty_1 { + pub NEW_CONNECTION: QUIC_LISTENER_EVENT__bindgen_ty_1__bindgen_ty_1, + pub STOP_COMPLETE: QUIC_LISTENER_EVENT__bindgen_ty_1__bindgen_ty_2, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct QUIC_LISTENER_EVENT__bindgen_ty_1__bindgen_ty_1 { + pub Info: *const QUIC_NEW_CONNECTION_INFO, + pub Connection: HQUIC, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of QUIC_LISTENER_EVENT__bindgen_ty_1__bindgen_ty_1"] + [::std::mem::size_of::() - 16usize]; + ["Alignment of QUIC_LISTENER_EVENT__bindgen_ty_1__bindgen_ty_1"] + [::std::mem::align_of::() - 8usize]; + ["Offset of field: QUIC_LISTENER_EVENT__bindgen_ty_1__bindgen_ty_1::Info"] + [::std::mem::offset_of!(QUIC_LISTENER_EVENT__bindgen_ty_1__bindgen_ty_1, Info) - 0usize]; + ["Offset of field: QUIC_LISTENER_EVENT__bindgen_ty_1__bindgen_ty_1::Connection"][::std::mem::offset_of!( + QUIC_LISTENER_EVENT__bindgen_ty_1__bindgen_ty_1, + Connection + ) - 8usize]; +}; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct QUIC_LISTENER_EVENT__bindgen_ty_1__bindgen_ty_2 { + pub _bitfield_align_1: [u8; 0], + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize]>, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of QUIC_LISTENER_EVENT__bindgen_ty_1__bindgen_ty_2"] + [::std::mem::size_of::() - 1usize]; + ["Alignment of QUIC_LISTENER_EVENT__bindgen_ty_1__bindgen_ty_2"] + [::std::mem::align_of::() - 1usize]; +}; +impl QUIC_LISTENER_EVENT__bindgen_ty_1__bindgen_ty_2 { + #[inline] + pub fn AppCloseInProgress(&self) -> BOOLEAN { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u8) } + } + #[inline] + pub fn set_AppCloseInProgress(&mut self, val: BOOLEAN) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn AppCloseInProgress_raw(this: *const Self) -> BOOLEAN { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 0usize, + 1u8, + ) as u8) + } + } + #[inline] + pub unsafe fn set_AppCloseInProgress_raw(this: *mut Self, val: BOOLEAN) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 0usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn RESERVED(&self) -> BOOLEAN { + unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 7u8) as u8) } + } + #[inline] + pub fn set_RESERVED(&mut self, val: BOOLEAN) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + self._bitfield_1.set(1usize, 7u8, val as u64) + } + } + #[inline] + pub unsafe fn RESERVED_raw(this: *const Self) -> BOOLEAN { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 1usize, + 7u8, + ) as u8) + } + } + #[inline] + pub unsafe fn set_RESERVED_raw(this: *mut Self, val: BOOLEAN) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 1usize, + 7u8, + val as u64, + ) + } + } + #[inline] + pub fn new_bitfield_1( + AppCloseInProgress: BOOLEAN, + RESERVED: BOOLEAN, + ) -> __BindgenBitfieldUnit<[u8; 1usize]> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize]> = Default::default(); + __bindgen_bitfield_unit.set(0usize, 1u8, { + let AppCloseInProgress: u8 = unsafe { ::std::mem::transmute(AppCloseInProgress) }; + AppCloseInProgress as u64 + }); + __bindgen_bitfield_unit.set(1usize, 7u8, { + let RESERVED: u8 = unsafe { ::std::mem::transmute(RESERVED) }; + RESERVED as u64 + }); + __bindgen_bitfield_unit + } +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of QUIC_LISTENER_EVENT__bindgen_ty_1"] + [::std::mem::size_of::() - 16usize]; + ["Alignment of QUIC_LISTENER_EVENT__bindgen_ty_1"] + [::std::mem::align_of::() - 8usize]; + ["Offset of field: QUIC_LISTENER_EVENT__bindgen_ty_1::NEW_CONNECTION"] + [::std::mem::offset_of!(QUIC_LISTENER_EVENT__bindgen_ty_1, NEW_CONNECTION) - 0usize]; + ["Offset of field: QUIC_LISTENER_EVENT__bindgen_ty_1::STOP_COMPLETE"] + [::std::mem::offset_of!(QUIC_LISTENER_EVENT__bindgen_ty_1, STOP_COMPLETE) - 0usize]; +}; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of QUIC_LISTENER_EVENT"][::std::mem::size_of::() - 24usize]; + ["Alignment of QUIC_LISTENER_EVENT"][::std::mem::align_of::() - 8usize]; + ["Offset of field: QUIC_LISTENER_EVENT::Type"] + [::std::mem::offset_of!(QUIC_LISTENER_EVENT, Type) - 0usize]; +}; +pub type QUIC_LISTENER_CALLBACK = ::std::option::Option< + unsafe extern "C" fn( + Listener: HQUIC, + Context: *mut ::std::os::raw::c_void, + Event: *mut QUIC_LISTENER_EVENT, + ) -> ::std::os::raw::c_uint, +>; +pub type QUIC_LISTENER_CALLBACK_HANDLER = QUIC_LISTENER_CALLBACK; +pub type QUIC_LISTENER_OPEN_FN = ::std::option::Option< + unsafe extern "C" fn( + Registration: HQUIC, + Handler: QUIC_LISTENER_CALLBACK_HANDLER, + Context: *mut ::std::os::raw::c_void, + Listener: *mut HQUIC, + ) -> ::std::os::raw::c_uint, +>; +pub type QUIC_LISTENER_CLOSE_FN = ::std::option::Option; +pub type QUIC_LISTENER_START_FN = ::std::option::Option< + unsafe extern "C" fn( + Listener: HQUIC, + AlpnBuffers: *const QUIC_BUFFER, + AlpnBufferCount: u32, + LocalAddress: *const QUIC_ADDR, + ) -> ::std::os::raw::c_uint, +>; +pub type QUIC_LISTENER_STOP_FN = ::std::option::Option; +pub const QUIC_CONNECTION_EVENT_TYPE_QUIC_CONNECTION_EVENT_CONNECTED: QUIC_CONNECTION_EVENT_TYPE = + 0; +pub const QUIC_CONNECTION_EVENT_TYPE_QUIC_CONNECTION_EVENT_SHUTDOWN_INITIATED_BY_TRANSPORT: + QUIC_CONNECTION_EVENT_TYPE = 1; +pub const QUIC_CONNECTION_EVENT_TYPE_QUIC_CONNECTION_EVENT_SHUTDOWN_INITIATED_BY_PEER: + QUIC_CONNECTION_EVENT_TYPE = 2; +pub const QUIC_CONNECTION_EVENT_TYPE_QUIC_CONNECTION_EVENT_SHUTDOWN_COMPLETE: + QUIC_CONNECTION_EVENT_TYPE = 3; +pub const QUIC_CONNECTION_EVENT_TYPE_QUIC_CONNECTION_EVENT_LOCAL_ADDRESS_CHANGED: + QUIC_CONNECTION_EVENT_TYPE = 4; +pub const QUIC_CONNECTION_EVENT_TYPE_QUIC_CONNECTION_EVENT_PEER_ADDRESS_CHANGED: + QUIC_CONNECTION_EVENT_TYPE = 5; +pub const QUIC_CONNECTION_EVENT_TYPE_QUIC_CONNECTION_EVENT_PEER_STREAM_STARTED: + QUIC_CONNECTION_EVENT_TYPE = 6; +pub const QUIC_CONNECTION_EVENT_TYPE_QUIC_CONNECTION_EVENT_STREAMS_AVAILABLE: + QUIC_CONNECTION_EVENT_TYPE = 7; +pub const QUIC_CONNECTION_EVENT_TYPE_QUIC_CONNECTION_EVENT_PEER_NEEDS_STREAMS: + QUIC_CONNECTION_EVENT_TYPE = 8; +pub const QUIC_CONNECTION_EVENT_TYPE_QUIC_CONNECTION_EVENT_IDEAL_PROCESSOR_CHANGED: + QUIC_CONNECTION_EVENT_TYPE = 9; +pub const QUIC_CONNECTION_EVENT_TYPE_QUIC_CONNECTION_EVENT_DATAGRAM_STATE_CHANGED: + QUIC_CONNECTION_EVENT_TYPE = 10; +pub const QUIC_CONNECTION_EVENT_TYPE_QUIC_CONNECTION_EVENT_DATAGRAM_RECEIVED: + QUIC_CONNECTION_EVENT_TYPE = 11; +pub const QUIC_CONNECTION_EVENT_TYPE_QUIC_CONNECTION_EVENT_DATAGRAM_SEND_STATE_CHANGED: + QUIC_CONNECTION_EVENT_TYPE = 12; +pub const QUIC_CONNECTION_EVENT_TYPE_QUIC_CONNECTION_EVENT_RESUMED: QUIC_CONNECTION_EVENT_TYPE = 13; +pub const QUIC_CONNECTION_EVENT_TYPE_QUIC_CONNECTION_EVENT_RESUMPTION_TICKET_RECEIVED: + QUIC_CONNECTION_EVENT_TYPE = 14; +pub const QUIC_CONNECTION_EVENT_TYPE_QUIC_CONNECTION_EVENT_PEER_CERTIFICATE_RECEIVED: + QUIC_CONNECTION_EVENT_TYPE = 15; +pub type QUIC_CONNECTION_EVENT_TYPE = ::std::os::raw::c_uint; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct QUIC_CONNECTION_EVENT { + pub Type: QUIC_CONNECTION_EVENT_TYPE, + pub __bindgen_anon_1: QUIC_CONNECTION_EVENT__bindgen_ty_1, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union QUIC_CONNECTION_EVENT__bindgen_ty_1 { + pub CONNECTED: QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_1, + pub SHUTDOWN_INITIATED_BY_TRANSPORT: QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_2, + pub SHUTDOWN_INITIATED_BY_PEER: QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_3, + pub SHUTDOWN_COMPLETE: QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_4, + pub LOCAL_ADDRESS_CHANGED: QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_5, + pub PEER_ADDRESS_CHANGED: QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_6, + pub PEER_STREAM_STARTED: QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_7, + pub STREAMS_AVAILABLE: QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_8, + pub PEER_NEEDS_STREAMS: QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_9, + pub IDEAL_PROCESSOR_CHANGED: QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_10, + pub DATAGRAM_STATE_CHANGED: QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_11, + pub DATAGRAM_RECEIVED: QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_12, + pub DATAGRAM_SEND_STATE_CHANGED: QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_13, + pub RESUMED: QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_14, + pub RESUMPTION_TICKET_RECEIVED: QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_15, + pub PEER_CERTIFICATE_RECEIVED: QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_16, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_1 { + pub SessionResumed: BOOLEAN, + pub NegotiatedAlpnLength: u8, + pub NegotiatedAlpn: *const u8, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_1"] + [::std::mem::size_of::() - 16usize]; + ["Alignment of QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_1"] + [::std::mem::align_of::() - 8usize]; + ["Offset of field: QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_1::SessionResumed"][::std::mem::offset_of!( + QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_1, + SessionResumed + ) + - 0usize]; + ["Offset of field: QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_1::NegotiatedAlpnLength"][::std::mem::offset_of!( + QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_1, + NegotiatedAlpnLength + ) + - 1usize]; + ["Offset of field: QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_1::NegotiatedAlpn"][::std::mem::offset_of!( + QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_1, + NegotiatedAlpn + ) + - 8usize]; +}; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_2 { + pub Status: ::std::os::raw::c_uint, + pub ErrorCode: QUIC_UINT62, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_2"] + [::std::mem::size_of::() - 16usize]; + ["Alignment of QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_2"] + [::std::mem::align_of::() - 8usize]; + ["Offset of field: QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_2::Status"][::std::mem::offset_of!( + QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_2, + Status + ) - 0usize]; + ["Offset of field: QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_2::ErrorCode"][::std::mem::offset_of!( + QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_2, + ErrorCode + ) - 8usize]; +}; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_3 { + pub ErrorCode: QUIC_UINT62, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_3"] + [::std::mem::size_of::() - 8usize]; + ["Alignment of QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_3"] + [::std::mem::align_of::() - 8usize]; + ["Offset of field: QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_3::ErrorCode"][::std::mem::offset_of!( + QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_3, + ErrorCode + ) - 0usize]; +}; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_4 { + pub _bitfield_align_1: [u8; 0], + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize]>, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_4"] + [::std::mem::size_of::() - 1usize]; + ["Alignment of QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_4"] + [::std::mem::align_of::() - 1usize]; +}; +impl QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_4 { + #[inline] + pub fn HandshakeCompleted(&self) -> BOOLEAN { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u8) } + } + #[inline] + pub fn set_HandshakeCompleted(&mut self, val: BOOLEAN) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn HandshakeCompleted_raw(this: *const Self) -> BOOLEAN { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 0usize, + 1u8, + ) as u8) + } + } + #[inline] + pub unsafe fn set_HandshakeCompleted_raw(this: *mut Self, val: BOOLEAN) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 0usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn PeerAcknowledgedShutdown(&self) -> BOOLEAN { + unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u8) } + } + #[inline] + pub fn set_PeerAcknowledgedShutdown(&mut self, val: BOOLEAN) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + self._bitfield_1.set(1usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn PeerAcknowledgedShutdown_raw(this: *const Self) -> BOOLEAN { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 1usize, + 1u8, + ) as u8) + } + } + #[inline] + pub unsafe fn set_PeerAcknowledgedShutdown_raw(this: *mut Self, val: BOOLEAN) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 1usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn AppCloseInProgress(&self) -> BOOLEAN { + unsafe { ::std::mem::transmute(self._bitfield_1.get(2usize, 1u8) as u8) } + } + #[inline] + pub fn set_AppCloseInProgress(&mut self, val: BOOLEAN) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + self._bitfield_1.set(2usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn AppCloseInProgress_raw(this: *const Self) -> BOOLEAN { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 2usize, + 1u8, + ) as u8) + } + } + #[inline] + pub unsafe fn set_AppCloseInProgress_raw(this: *mut Self, val: BOOLEAN) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 2usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn new_bitfield_1( + HandshakeCompleted: BOOLEAN, + PeerAcknowledgedShutdown: BOOLEAN, + AppCloseInProgress: BOOLEAN, + ) -> __BindgenBitfieldUnit<[u8; 1usize]> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize]> = Default::default(); + __bindgen_bitfield_unit.set(0usize, 1u8, { + let HandshakeCompleted: u8 = unsafe { ::std::mem::transmute(HandshakeCompleted) }; + HandshakeCompleted as u64 + }); + __bindgen_bitfield_unit.set(1usize, 1u8, { + let PeerAcknowledgedShutdown: u8 = + unsafe { ::std::mem::transmute(PeerAcknowledgedShutdown) }; + PeerAcknowledgedShutdown as u64 + }); + __bindgen_bitfield_unit.set(2usize, 1u8, { + let AppCloseInProgress: u8 = unsafe { ::std::mem::transmute(AppCloseInProgress) }; + AppCloseInProgress as u64 + }); + __bindgen_bitfield_unit + } +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_5 { + pub Address: *const QUIC_ADDR, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_5"] + [::std::mem::size_of::() - 8usize]; + ["Alignment of QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_5"] + [::std::mem::align_of::() - 8usize]; + ["Offset of field: QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_5::Address"][::std::mem::offset_of!( + QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_5, + Address + ) - 0usize]; +}; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_6 { + pub Address: *const QUIC_ADDR, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_6"] + [::std::mem::size_of::() - 8usize]; + ["Alignment of QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_6"] + [::std::mem::align_of::() - 8usize]; + ["Offset of field: QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_6::Address"][::std::mem::offset_of!( + QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_6, + Address + ) - 0usize]; +}; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_7 { + pub Stream: HQUIC, + pub Flags: QUIC_STREAM_OPEN_FLAGS, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_7"] + [::std::mem::size_of::() - 16usize]; + ["Alignment of QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_7"] + [::std::mem::align_of::() - 8usize]; + ["Offset of field: QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_7::Stream"][::std::mem::offset_of!( + QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_7, + Stream + ) - 0usize]; + ["Offset of field: QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_7::Flags"] + [::std::mem::offset_of!(QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_7, Flags) - 8usize]; +}; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_8 { + pub BidirectionalCount: u16, + pub UnidirectionalCount: u16, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_8"] + [::std::mem::size_of::() - 4usize]; + ["Alignment of QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_8"] + [::std::mem::align_of::() - 2usize]; + ["Offset of field: QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_8::BidirectionalCount"][::std::mem::offset_of!( + QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_8, + BidirectionalCount + ) + - 0usize]; + ["Offset of field: QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_8::UnidirectionalCount"][::std::mem::offset_of!( + QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_8, + UnidirectionalCount + ) + - 2usize]; +}; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_9 { + pub Bidirectional: BOOLEAN, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_9"] + [::std::mem::size_of::() - 1usize]; + ["Alignment of QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_9"] + [::std::mem::align_of::() - 1usize]; + ["Offset of field: QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_9::Bidirectional"][::std::mem::offset_of!( + QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_9, + Bidirectional + ) + - 0usize]; +}; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_10 { + pub IdealProcessor: u16, + pub PartitionIndex: u16, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_10"] + [::std::mem::size_of::() - 4usize]; + ["Alignment of QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_10"] + [::std::mem::align_of::() - 2usize]; + ["Offset of field: QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_10::IdealProcessor"][::std::mem::offset_of!( + QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_10, + IdealProcessor + ) + - 0usize]; + ["Offset of field: QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_10::PartitionIndex"][::std::mem::offset_of!( + QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_10, + PartitionIndex + ) + - 2usize]; +}; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_11 { + pub SendEnabled: BOOLEAN, + pub MaxSendLength: u16, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_11"] + [::std::mem::size_of::() - 4usize]; + ["Alignment of QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_11"] + [::std::mem::align_of::() - 2usize]; + ["Offset of field: QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_11::SendEnabled"][::std::mem::offset_of!( + QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_11, + SendEnabled + ) + - 0usize]; + ["Offset of field: QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_11::MaxSendLength"][::std::mem::offset_of!( + QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_11, + MaxSendLength + ) + - 2usize]; +}; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_12 { + pub Buffer: *const QUIC_BUFFER, + pub Flags: QUIC_RECEIVE_FLAGS, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_12"] + [::std::mem::size_of::() - 16usize]; + ["Alignment of QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_12"] + [::std::mem::align_of::() - 8usize]; + ["Offset of field: QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_12::Buffer"][::std::mem::offset_of!( + QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_12, + Buffer + ) - 0usize]; + ["Offset of field: QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_12::Flags"][::std::mem::offset_of!( + QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_12, + Flags + ) - 8usize]; +}; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_13 { + pub ClientContext: *mut ::std::os::raw::c_void, + pub State: QUIC_DATAGRAM_SEND_STATE, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_13"] + [::std::mem::size_of::() - 16usize]; + ["Alignment of QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_13"] + [::std::mem::align_of::() - 8usize]; + ["Offset of field: QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_13::ClientContext"][::std::mem::offset_of!( + QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_13, + ClientContext + ) + - 0usize]; + ["Offset of field: QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_13::State"][::std::mem::offset_of!( + QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_13, + State + ) - 8usize]; +}; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_14 { + pub ResumptionStateLength: u16, + pub ResumptionState: *const u8, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_14"] + [::std::mem::size_of::() - 16usize]; + ["Alignment of QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_14"] + [::std::mem::align_of::() - 8usize]; + ["Offset of field: QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_14::ResumptionStateLength"] [:: std :: mem :: offset_of ! (QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_14 , ResumptionStateLength) - 0usize] ; + ["Offset of field: QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_14::ResumptionState"][::std::mem::offset_of!( + QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_14, + ResumptionState + ) + - 8usize]; +}; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_15 { + pub ResumptionTicketLength: u32, + pub ResumptionTicket: *const u8, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_15"] + [::std::mem::size_of::() - 16usize]; + ["Alignment of QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_15"] + [::std::mem::align_of::() - 8usize]; + ["Offset of field: QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_15::ResumptionTicketLength"] [:: std :: mem :: offset_of ! (QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_15 , ResumptionTicketLength) - 0usize] ; + ["Offset of field: QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_15::ResumptionTicket"][::std::mem::offset_of!( + QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_15, + ResumptionTicket + ) + - 8usize]; +}; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_16 { + pub Certificate: *mut QUIC_CERTIFICATE, + pub DeferredErrorFlags: u32, + pub DeferredStatus: ::std::os::raw::c_uint, + pub Chain: *mut QUIC_CERTIFICATE_CHAIN, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_16"] + [::std::mem::size_of::() - 24usize]; + ["Alignment of QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_16"] + [::std::mem::align_of::() - 8usize]; + ["Offset of field: QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_16::Certificate"][::std::mem::offset_of!( + QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_16, + Certificate + ) + - 0usize]; + ["Offset of field: QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_16::DeferredErrorFlags"][::std::mem::offset_of!( + QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_16, + DeferredErrorFlags + ) + - 8usize]; + ["Offset of field: QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_16::DeferredStatus"][::std::mem::offset_of!( + QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_16, + DeferredStatus + ) + - 12usize]; + ["Offset of field: QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_16::Chain"][::std::mem::offset_of!( + QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_16, + Chain + ) - 16usize]; +}; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of QUIC_CONNECTION_EVENT__bindgen_ty_1"] + [::std::mem::size_of::() - 24usize]; + ["Alignment of QUIC_CONNECTION_EVENT__bindgen_ty_1"] + [::std::mem::align_of::() - 8usize]; + ["Offset of field: QUIC_CONNECTION_EVENT__bindgen_ty_1::CONNECTED"] + [::std::mem::offset_of!(QUIC_CONNECTION_EVENT__bindgen_ty_1, CONNECTED) - 0usize]; + ["Offset of field: QUIC_CONNECTION_EVENT__bindgen_ty_1::SHUTDOWN_INITIATED_BY_TRANSPORT"][::std::mem::offset_of!( + QUIC_CONNECTION_EVENT__bindgen_ty_1, + SHUTDOWN_INITIATED_BY_TRANSPORT + ) + - 0usize]; + ["Offset of field: QUIC_CONNECTION_EVENT__bindgen_ty_1::SHUTDOWN_INITIATED_BY_PEER"][::std::mem::offset_of!( + QUIC_CONNECTION_EVENT__bindgen_ty_1, + SHUTDOWN_INITIATED_BY_PEER + ) + - 0usize]; + ["Offset of field: QUIC_CONNECTION_EVENT__bindgen_ty_1::SHUTDOWN_COMPLETE"] + [::std::mem::offset_of!(QUIC_CONNECTION_EVENT__bindgen_ty_1, SHUTDOWN_COMPLETE) - 0usize]; + ["Offset of field: QUIC_CONNECTION_EVENT__bindgen_ty_1::LOCAL_ADDRESS_CHANGED"][::std::mem::offset_of!( + QUIC_CONNECTION_EVENT__bindgen_ty_1, + LOCAL_ADDRESS_CHANGED + ) - 0usize]; + ["Offset of field: QUIC_CONNECTION_EVENT__bindgen_ty_1::PEER_ADDRESS_CHANGED"][::std::mem::offset_of!( + QUIC_CONNECTION_EVENT__bindgen_ty_1, + PEER_ADDRESS_CHANGED + ) - 0usize]; + ["Offset of field: QUIC_CONNECTION_EVENT__bindgen_ty_1::PEER_STREAM_STARTED"] + [::std::mem::offset_of!(QUIC_CONNECTION_EVENT__bindgen_ty_1, PEER_STREAM_STARTED) - 0usize]; + ["Offset of field: QUIC_CONNECTION_EVENT__bindgen_ty_1::STREAMS_AVAILABLE"] + [::std::mem::offset_of!(QUIC_CONNECTION_EVENT__bindgen_ty_1, STREAMS_AVAILABLE) - 0usize]; + ["Offset of field: QUIC_CONNECTION_EVENT__bindgen_ty_1::PEER_NEEDS_STREAMS"] + [::std::mem::offset_of!(QUIC_CONNECTION_EVENT__bindgen_ty_1, PEER_NEEDS_STREAMS) - 0usize]; + ["Offset of field: QUIC_CONNECTION_EVENT__bindgen_ty_1::IDEAL_PROCESSOR_CHANGED"][::std::mem::offset_of!( + QUIC_CONNECTION_EVENT__bindgen_ty_1, + IDEAL_PROCESSOR_CHANGED + ) - 0usize]; + ["Offset of field: QUIC_CONNECTION_EVENT__bindgen_ty_1::DATAGRAM_STATE_CHANGED"][::std::mem::offset_of!( + QUIC_CONNECTION_EVENT__bindgen_ty_1, + DATAGRAM_STATE_CHANGED + ) - 0usize]; + ["Offset of field: QUIC_CONNECTION_EVENT__bindgen_ty_1::DATAGRAM_RECEIVED"] + [::std::mem::offset_of!(QUIC_CONNECTION_EVENT__bindgen_ty_1, DATAGRAM_RECEIVED) - 0usize]; + ["Offset of field: QUIC_CONNECTION_EVENT__bindgen_ty_1::DATAGRAM_SEND_STATE_CHANGED"][::std::mem::offset_of!( + QUIC_CONNECTION_EVENT__bindgen_ty_1, + DATAGRAM_SEND_STATE_CHANGED + ) + - 0usize]; + ["Offset of field: QUIC_CONNECTION_EVENT__bindgen_ty_1::RESUMED"] + [::std::mem::offset_of!(QUIC_CONNECTION_EVENT__bindgen_ty_1, RESUMED) - 0usize]; + ["Offset of field: QUIC_CONNECTION_EVENT__bindgen_ty_1::RESUMPTION_TICKET_RECEIVED"][::std::mem::offset_of!( + QUIC_CONNECTION_EVENT__bindgen_ty_1, + RESUMPTION_TICKET_RECEIVED + ) + - 0usize]; + ["Offset of field: QUIC_CONNECTION_EVENT__bindgen_ty_1::PEER_CERTIFICATE_RECEIVED"][::std::mem::offset_of!( + QUIC_CONNECTION_EVENT__bindgen_ty_1, + PEER_CERTIFICATE_RECEIVED + ) - 0usize]; +}; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of QUIC_CONNECTION_EVENT"][::std::mem::size_of::() - 32usize]; + ["Alignment of QUIC_CONNECTION_EVENT"] + [::std::mem::align_of::() - 8usize]; + ["Offset of field: QUIC_CONNECTION_EVENT::Type"] + [::std::mem::offset_of!(QUIC_CONNECTION_EVENT, Type) - 0usize]; +}; +pub type QUIC_CONNECTION_CALLBACK = ::std::option::Option< + unsafe extern "C" fn( + Connection: HQUIC, + Context: *mut ::std::os::raw::c_void, + Event: *mut QUIC_CONNECTION_EVENT, + ) -> ::std::os::raw::c_uint, +>; +pub type QUIC_CONNECTION_CALLBACK_HANDLER = QUIC_CONNECTION_CALLBACK; +pub type QUIC_CONNECTION_OPEN_FN = ::std::option::Option< + unsafe extern "C" fn( + Registration: HQUIC, + Handler: QUIC_CONNECTION_CALLBACK_HANDLER, + Context: *mut ::std::os::raw::c_void, + Connection: *mut HQUIC, + ) -> ::std::os::raw::c_uint, +>; +pub type QUIC_CONNECTION_CLOSE_FN = ::std::option::Option; +pub type QUIC_CONNECTION_SHUTDOWN_FN = ::std::option::Option< + unsafe extern "C" fn( + Connection: HQUIC, + Flags: QUIC_CONNECTION_SHUTDOWN_FLAGS, + ErrorCode: QUIC_UINT62, + ), +>; +pub type QUIC_CONNECTION_START_FN = ::std::option::Option< + unsafe extern "C" fn( + Connection: HQUIC, + Configuration: HQUIC, + Family: QUIC_ADDRESS_FAMILY, + ServerName: *const ::std::os::raw::c_char, + ServerPort: u16, + ) -> ::std::os::raw::c_uint, +>; +pub type QUIC_CONNECTION_SET_CONFIGURATION_FN = ::std::option::Option< + unsafe extern "C" fn(Connection: HQUIC, Configuration: HQUIC) -> ::std::os::raw::c_uint, +>; +pub type QUIC_CONNECTION_SEND_RESUMPTION_FN = ::std::option::Option< + unsafe extern "C" fn( + Connection: HQUIC, + Flags: QUIC_SEND_RESUMPTION_FLAGS, + DataLength: u16, + ResumptionData: *const u8, + ) -> ::std::os::raw::c_uint, +>; +pub type QUIC_CONNECTION_COMP_RESUMPTION_FN = ::std::option::Option< + unsafe extern "C" fn(Connection: HQUIC, Result: BOOLEAN) -> ::std::os::raw::c_uint, +>; +pub type QUIC_CONNECTION_COMP_CERT_FN = ::std::option::Option< + unsafe extern "C" fn( + Connection: HQUIC, + Result: BOOLEAN, + TlsAlert: QUIC_TLS_ALERT_CODES, + ) -> ::std::os::raw::c_uint, +>; +pub const QUIC_STREAM_EVENT_TYPE_QUIC_STREAM_EVENT_START_COMPLETE: QUIC_STREAM_EVENT_TYPE = 0; +pub const QUIC_STREAM_EVENT_TYPE_QUIC_STREAM_EVENT_RECEIVE: QUIC_STREAM_EVENT_TYPE = 1; +pub const QUIC_STREAM_EVENT_TYPE_QUIC_STREAM_EVENT_SEND_COMPLETE: QUIC_STREAM_EVENT_TYPE = 2; +pub const QUIC_STREAM_EVENT_TYPE_QUIC_STREAM_EVENT_PEER_SEND_SHUTDOWN: QUIC_STREAM_EVENT_TYPE = 3; +pub const QUIC_STREAM_EVENT_TYPE_QUIC_STREAM_EVENT_PEER_SEND_ABORTED: QUIC_STREAM_EVENT_TYPE = 4; +pub const QUIC_STREAM_EVENT_TYPE_QUIC_STREAM_EVENT_PEER_RECEIVE_ABORTED: QUIC_STREAM_EVENT_TYPE = 5; +pub const QUIC_STREAM_EVENT_TYPE_QUIC_STREAM_EVENT_SEND_SHUTDOWN_COMPLETE: QUIC_STREAM_EVENT_TYPE = + 6; +pub const QUIC_STREAM_EVENT_TYPE_QUIC_STREAM_EVENT_SHUTDOWN_COMPLETE: QUIC_STREAM_EVENT_TYPE = 7; +pub const QUIC_STREAM_EVENT_TYPE_QUIC_STREAM_EVENT_IDEAL_SEND_BUFFER_SIZE: QUIC_STREAM_EVENT_TYPE = + 8; +pub const QUIC_STREAM_EVENT_TYPE_QUIC_STREAM_EVENT_PEER_ACCEPTED: QUIC_STREAM_EVENT_TYPE = 9; +pub const QUIC_STREAM_EVENT_TYPE_QUIC_STREAM_EVENT_CANCEL_ON_LOSS: QUIC_STREAM_EVENT_TYPE = 10; +pub type QUIC_STREAM_EVENT_TYPE = ::std::os::raw::c_uint; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct QUIC_STREAM_EVENT { + pub Type: QUIC_STREAM_EVENT_TYPE, + pub __bindgen_anon_1: QUIC_STREAM_EVENT__bindgen_ty_1, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union QUIC_STREAM_EVENT__bindgen_ty_1 { + pub START_COMPLETE: QUIC_STREAM_EVENT__bindgen_ty_1__bindgen_ty_1, + pub RECEIVE: QUIC_STREAM_EVENT__bindgen_ty_1__bindgen_ty_2, + pub SEND_COMPLETE: QUIC_STREAM_EVENT__bindgen_ty_1__bindgen_ty_3, + pub PEER_SEND_ABORTED: QUIC_STREAM_EVENT__bindgen_ty_1__bindgen_ty_4, + pub PEER_RECEIVE_ABORTED: QUIC_STREAM_EVENT__bindgen_ty_1__bindgen_ty_5, + pub SEND_SHUTDOWN_COMPLETE: QUIC_STREAM_EVENT__bindgen_ty_1__bindgen_ty_6, + pub SHUTDOWN_COMPLETE: QUIC_STREAM_EVENT__bindgen_ty_1__bindgen_ty_7, + pub IDEAL_SEND_BUFFER_SIZE: QUIC_STREAM_EVENT__bindgen_ty_1__bindgen_ty_8, + pub CANCEL_ON_LOSS: QUIC_STREAM_EVENT__bindgen_ty_1__bindgen_ty_9, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct QUIC_STREAM_EVENT__bindgen_ty_1__bindgen_ty_1 { + pub Status: ::std::os::raw::c_uint, + pub ID: QUIC_UINT62, + pub _bitfield_align_1: [u8; 0], + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize]>, + pub __bindgen_padding_0: [u8; 7usize], +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of QUIC_STREAM_EVENT__bindgen_ty_1__bindgen_ty_1"] + [::std::mem::size_of::() - 24usize]; + ["Alignment of QUIC_STREAM_EVENT__bindgen_ty_1__bindgen_ty_1"] + [::std::mem::align_of::() - 8usize]; + ["Offset of field: QUIC_STREAM_EVENT__bindgen_ty_1__bindgen_ty_1::Status"] + [::std::mem::offset_of!(QUIC_STREAM_EVENT__bindgen_ty_1__bindgen_ty_1, Status) - 0usize]; + ["Offset of field: QUIC_STREAM_EVENT__bindgen_ty_1__bindgen_ty_1::ID"] + [::std::mem::offset_of!(QUIC_STREAM_EVENT__bindgen_ty_1__bindgen_ty_1, ID) - 8usize]; +}; +impl QUIC_STREAM_EVENT__bindgen_ty_1__bindgen_ty_1 { + #[inline] + pub fn PeerAccepted(&self) -> BOOLEAN { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u8) } + } + #[inline] + pub fn set_PeerAccepted(&mut self, val: BOOLEAN) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn PeerAccepted_raw(this: *const Self) -> BOOLEAN { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 0usize, + 1u8, + ) as u8) + } + } + #[inline] + pub unsafe fn set_PeerAccepted_raw(this: *mut Self, val: BOOLEAN) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 0usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn RESERVED(&self) -> BOOLEAN { + unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 7u8) as u8) } + } + #[inline] + pub fn set_RESERVED(&mut self, val: BOOLEAN) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + self._bitfield_1.set(1usize, 7u8, val as u64) + } + } + #[inline] + pub unsafe fn RESERVED_raw(this: *const Self) -> BOOLEAN { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 1usize, + 7u8, + ) as u8) + } + } + #[inline] + pub unsafe fn set_RESERVED_raw(this: *mut Self, val: BOOLEAN) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 1usize, + 7u8, + val as u64, + ) + } + } + #[inline] + pub fn new_bitfield_1( + PeerAccepted: BOOLEAN, + RESERVED: BOOLEAN, + ) -> __BindgenBitfieldUnit<[u8; 1usize]> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize]> = Default::default(); + __bindgen_bitfield_unit.set(0usize, 1u8, { + let PeerAccepted: u8 = unsafe { ::std::mem::transmute(PeerAccepted) }; + PeerAccepted as u64 + }); + __bindgen_bitfield_unit.set(1usize, 7u8, { + let RESERVED: u8 = unsafe { ::std::mem::transmute(RESERVED) }; + RESERVED as u64 + }); + __bindgen_bitfield_unit + } +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct QUIC_STREAM_EVENT__bindgen_ty_1__bindgen_ty_2 { + pub AbsoluteOffset: u64, + pub TotalBufferLength: u64, + pub Buffers: *const QUIC_BUFFER, + pub BufferCount: u32, + pub Flags: QUIC_RECEIVE_FLAGS, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of QUIC_STREAM_EVENT__bindgen_ty_1__bindgen_ty_2"] + [::std::mem::size_of::() - 32usize]; + ["Alignment of QUIC_STREAM_EVENT__bindgen_ty_1__bindgen_ty_2"] + [::std::mem::align_of::() - 8usize]; + ["Offset of field: QUIC_STREAM_EVENT__bindgen_ty_1__bindgen_ty_2::AbsoluteOffset"][::std::mem::offset_of!( + QUIC_STREAM_EVENT__bindgen_ty_1__bindgen_ty_2, + AbsoluteOffset + ) - 0usize]; + ["Offset of field: QUIC_STREAM_EVENT__bindgen_ty_1__bindgen_ty_2::TotalBufferLength"][::std::mem::offset_of!( + QUIC_STREAM_EVENT__bindgen_ty_1__bindgen_ty_2, + TotalBufferLength + ) + - 8usize]; + ["Offset of field: QUIC_STREAM_EVENT__bindgen_ty_1__bindgen_ty_2::Buffers"] + [::std::mem::offset_of!(QUIC_STREAM_EVENT__bindgen_ty_1__bindgen_ty_2, Buffers) - 16usize]; + ["Offset of field: QUIC_STREAM_EVENT__bindgen_ty_1__bindgen_ty_2::BufferCount"][::std::mem::offset_of!( + QUIC_STREAM_EVENT__bindgen_ty_1__bindgen_ty_2, + BufferCount + ) - 24usize]; + ["Offset of field: QUIC_STREAM_EVENT__bindgen_ty_1__bindgen_ty_2::Flags"] + [::std::mem::offset_of!(QUIC_STREAM_EVENT__bindgen_ty_1__bindgen_ty_2, Flags) - 28usize]; +}; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct QUIC_STREAM_EVENT__bindgen_ty_1__bindgen_ty_3 { + pub Canceled: BOOLEAN, + pub ClientContext: *mut ::std::os::raw::c_void, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of QUIC_STREAM_EVENT__bindgen_ty_1__bindgen_ty_3"] + [::std::mem::size_of::() - 16usize]; + ["Alignment of QUIC_STREAM_EVENT__bindgen_ty_1__bindgen_ty_3"] + [::std::mem::align_of::() - 8usize]; + ["Offset of field: QUIC_STREAM_EVENT__bindgen_ty_1__bindgen_ty_3::Canceled"] + [::std::mem::offset_of!(QUIC_STREAM_EVENT__bindgen_ty_1__bindgen_ty_3, Canceled) - 0usize]; + ["Offset of field: QUIC_STREAM_EVENT__bindgen_ty_1__bindgen_ty_3::ClientContext"][::std::mem::offset_of!( + QUIC_STREAM_EVENT__bindgen_ty_1__bindgen_ty_3, + ClientContext + ) - 8usize]; +}; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct QUIC_STREAM_EVENT__bindgen_ty_1__bindgen_ty_4 { + pub ErrorCode: QUIC_UINT62, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of QUIC_STREAM_EVENT__bindgen_ty_1__bindgen_ty_4"] + [::std::mem::size_of::() - 8usize]; + ["Alignment of QUIC_STREAM_EVENT__bindgen_ty_1__bindgen_ty_4"] + [::std::mem::align_of::() - 8usize]; + ["Offset of field: QUIC_STREAM_EVENT__bindgen_ty_1__bindgen_ty_4::ErrorCode"] + [::std::mem::offset_of!(QUIC_STREAM_EVENT__bindgen_ty_1__bindgen_ty_4, ErrorCode) - 0usize]; +}; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct QUIC_STREAM_EVENT__bindgen_ty_1__bindgen_ty_5 { + pub ErrorCode: QUIC_UINT62, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of QUIC_STREAM_EVENT__bindgen_ty_1__bindgen_ty_5"] + [::std::mem::size_of::() - 8usize]; + ["Alignment of QUIC_STREAM_EVENT__bindgen_ty_1__bindgen_ty_5"] + [::std::mem::align_of::() - 8usize]; + ["Offset of field: QUIC_STREAM_EVENT__bindgen_ty_1__bindgen_ty_5::ErrorCode"] + [::std::mem::offset_of!(QUIC_STREAM_EVENT__bindgen_ty_1__bindgen_ty_5, ErrorCode) - 0usize]; +}; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct QUIC_STREAM_EVENT__bindgen_ty_1__bindgen_ty_6 { + pub Graceful: BOOLEAN, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of QUIC_STREAM_EVENT__bindgen_ty_1__bindgen_ty_6"] + [::std::mem::size_of::() - 1usize]; + ["Alignment of QUIC_STREAM_EVENT__bindgen_ty_1__bindgen_ty_6"] + [::std::mem::align_of::() - 1usize]; + ["Offset of field: QUIC_STREAM_EVENT__bindgen_ty_1__bindgen_ty_6::Graceful"] + [::std::mem::offset_of!(QUIC_STREAM_EVENT__bindgen_ty_1__bindgen_ty_6, Graceful) - 0usize]; +}; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct QUIC_STREAM_EVENT__bindgen_ty_1__bindgen_ty_7 { + pub ConnectionShutdown: BOOLEAN, + pub _bitfield_align_1: [u8; 0], + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize]>, + pub ConnectionErrorCode: QUIC_UINT62, + pub ConnectionCloseStatus: ::std::os::raw::c_uint, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of QUIC_STREAM_EVENT__bindgen_ty_1__bindgen_ty_7"] + [::std::mem::size_of::() - 24usize]; + ["Alignment of QUIC_STREAM_EVENT__bindgen_ty_1__bindgen_ty_7"] + [::std::mem::align_of::() - 8usize]; + ["Offset of field: QUIC_STREAM_EVENT__bindgen_ty_1__bindgen_ty_7::ConnectionShutdown"][::std::mem::offset_of!( + QUIC_STREAM_EVENT__bindgen_ty_1__bindgen_ty_7, + ConnectionShutdown + ) + - 0usize]; + ["Offset of field: QUIC_STREAM_EVENT__bindgen_ty_1__bindgen_ty_7::ConnectionErrorCode"][::std::mem::offset_of!( + QUIC_STREAM_EVENT__bindgen_ty_1__bindgen_ty_7, + ConnectionErrorCode + ) + - 8usize]; + ["Offset of field: QUIC_STREAM_EVENT__bindgen_ty_1__bindgen_ty_7::ConnectionCloseStatus"][::std::mem::offset_of!( + QUIC_STREAM_EVENT__bindgen_ty_1__bindgen_ty_7, + ConnectionCloseStatus + ) + - 16usize]; +}; +impl QUIC_STREAM_EVENT__bindgen_ty_1__bindgen_ty_7 { + #[inline] + pub fn AppCloseInProgress(&self) -> BOOLEAN { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u8) } + } + #[inline] + pub fn set_AppCloseInProgress(&mut self, val: BOOLEAN) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn AppCloseInProgress_raw(this: *const Self) -> BOOLEAN { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 0usize, + 1u8, + ) as u8) + } + } + #[inline] + pub unsafe fn set_AppCloseInProgress_raw(this: *mut Self, val: BOOLEAN) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 0usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn ConnectionShutdownByApp(&self) -> BOOLEAN { + unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u8) } + } + #[inline] + pub fn set_ConnectionShutdownByApp(&mut self, val: BOOLEAN) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + self._bitfield_1.set(1usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn ConnectionShutdownByApp_raw(this: *const Self) -> BOOLEAN { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 1usize, + 1u8, + ) as u8) + } + } + #[inline] + pub unsafe fn set_ConnectionShutdownByApp_raw(this: *mut Self, val: BOOLEAN) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 1usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn ConnectionClosedRemotely(&self) -> BOOLEAN { + unsafe { ::std::mem::transmute(self._bitfield_1.get(2usize, 1u8) as u8) } + } + #[inline] + pub fn set_ConnectionClosedRemotely(&mut self, val: BOOLEAN) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + self._bitfield_1.set(2usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn ConnectionClosedRemotely_raw(this: *const Self) -> BOOLEAN { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 2usize, + 1u8, + ) as u8) + } + } + #[inline] + pub unsafe fn set_ConnectionClosedRemotely_raw(this: *mut Self, val: BOOLEAN) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 2usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn RESERVED(&self) -> BOOLEAN { + unsafe { ::std::mem::transmute(self._bitfield_1.get(3usize, 5u8) as u8) } + } + #[inline] + pub fn set_RESERVED(&mut self, val: BOOLEAN) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + self._bitfield_1.set(3usize, 5u8, val as u64) + } + } + #[inline] + pub unsafe fn RESERVED_raw(this: *const Self) -> BOOLEAN { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 3usize, + 5u8, + ) as u8) + } + } + #[inline] + pub unsafe fn set_RESERVED_raw(this: *mut Self, val: BOOLEAN) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 3usize, + 5u8, + val as u64, + ) + } + } + #[inline] + pub fn new_bitfield_1( + AppCloseInProgress: BOOLEAN, + ConnectionShutdownByApp: BOOLEAN, + ConnectionClosedRemotely: BOOLEAN, + RESERVED: BOOLEAN, + ) -> __BindgenBitfieldUnit<[u8; 1usize]> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize]> = Default::default(); + __bindgen_bitfield_unit.set(0usize, 1u8, { + let AppCloseInProgress: u8 = unsafe { ::std::mem::transmute(AppCloseInProgress) }; + AppCloseInProgress as u64 + }); + __bindgen_bitfield_unit.set(1usize, 1u8, { + let ConnectionShutdownByApp: u8 = + unsafe { ::std::mem::transmute(ConnectionShutdownByApp) }; + ConnectionShutdownByApp as u64 + }); + __bindgen_bitfield_unit.set(2usize, 1u8, { + let ConnectionClosedRemotely: u8 = + unsafe { ::std::mem::transmute(ConnectionClosedRemotely) }; + ConnectionClosedRemotely as u64 + }); + __bindgen_bitfield_unit.set(3usize, 5u8, { + let RESERVED: u8 = unsafe { ::std::mem::transmute(RESERVED) }; + RESERVED as u64 + }); + __bindgen_bitfield_unit + } +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct QUIC_STREAM_EVENT__bindgen_ty_1__bindgen_ty_8 { + pub ByteCount: u64, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of QUIC_STREAM_EVENT__bindgen_ty_1__bindgen_ty_8"] + [::std::mem::size_of::() - 8usize]; + ["Alignment of QUIC_STREAM_EVENT__bindgen_ty_1__bindgen_ty_8"] + [::std::mem::align_of::() - 8usize]; + ["Offset of field: QUIC_STREAM_EVENT__bindgen_ty_1__bindgen_ty_8::ByteCount"] + [::std::mem::offset_of!(QUIC_STREAM_EVENT__bindgen_ty_1__bindgen_ty_8, ByteCount) - 0usize]; +}; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct QUIC_STREAM_EVENT__bindgen_ty_1__bindgen_ty_9 { + pub ErrorCode: QUIC_UINT62, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of QUIC_STREAM_EVENT__bindgen_ty_1__bindgen_ty_9"] + [::std::mem::size_of::() - 8usize]; + ["Alignment of QUIC_STREAM_EVENT__bindgen_ty_1__bindgen_ty_9"] + [::std::mem::align_of::() - 8usize]; + ["Offset of field: QUIC_STREAM_EVENT__bindgen_ty_1__bindgen_ty_9::ErrorCode"] + [::std::mem::offset_of!(QUIC_STREAM_EVENT__bindgen_ty_1__bindgen_ty_9, ErrorCode) - 0usize]; +}; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of QUIC_STREAM_EVENT__bindgen_ty_1"] + [::std::mem::size_of::() - 32usize]; + ["Alignment of QUIC_STREAM_EVENT__bindgen_ty_1"] + [::std::mem::align_of::() - 8usize]; + ["Offset of field: QUIC_STREAM_EVENT__bindgen_ty_1::START_COMPLETE"] + [::std::mem::offset_of!(QUIC_STREAM_EVENT__bindgen_ty_1, START_COMPLETE) - 0usize]; + ["Offset of field: QUIC_STREAM_EVENT__bindgen_ty_1::RECEIVE"] + [::std::mem::offset_of!(QUIC_STREAM_EVENT__bindgen_ty_1, RECEIVE) - 0usize]; + ["Offset of field: QUIC_STREAM_EVENT__bindgen_ty_1::SEND_COMPLETE"] + [::std::mem::offset_of!(QUIC_STREAM_EVENT__bindgen_ty_1, SEND_COMPLETE) - 0usize]; + ["Offset of field: QUIC_STREAM_EVENT__bindgen_ty_1::PEER_SEND_ABORTED"] + [::std::mem::offset_of!(QUIC_STREAM_EVENT__bindgen_ty_1, PEER_SEND_ABORTED) - 0usize]; + ["Offset of field: QUIC_STREAM_EVENT__bindgen_ty_1::PEER_RECEIVE_ABORTED"] + [::std::mem::offset_of!(QUIC_STREAM_EVENT__bindgen_ty_1, PEER_RECEIVE_ABORTED) - 0usize]; + ["Offset of field: QUIC_STREAM_EVENT__bindgen_ty_1::SEND_SHUTDOWN_COMPLETE"] + [::std::mem::offset_of!(QUIC_STREAM_EVENT__bindgen_ty_1, SEND_SHUTDOWN_COMPLETE) - 0usize]; + ["Offset of field: QUIC_STREAM_EVENT__bindgen_ty_1::SHUTDOWN_COMPLETE"] + [::std::mem::offset_of!(QUIC_STREAM_EVENT__bindgen_ty_1, SHUTDOWN_COMPLETE) - 0usize]; + ["Offset of field: QUIC_STREAM_EVENT__bindgen_ty_1::IDEAL_SEND_BUFFER_SIZE"] + [::std::mem::offset_of!(QUIC_STREAM_EVENT__bindgen_ty_1, IDEAL_SEND_BUFFER_SIZE) - 0usize]; + ["Offset of field: QUIC_STREAM_EVENT__bindgen_ty_1::CANCEL_ON_LOSS"] + [::std::mem::offset_of!(QUIC_STREAM_EVENT__bindgen_ty_1, CANCEL_ON_LOSS) - 0usize]; +}; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of QUIC_STREAM_EVENT"][::std::mem::size_of::() - 40usize]; + ["Alignment of QUIC_STREAM_EVENT"][::std::mem::align_of::() - 8usize]; + ["Offset of field: QUIC_STREAM_EVENT::Type"] + [::std::mem::offset_of!(QUIC_STREAM_EVENT, Type) - 0usize]; +}; +pub type QUIC_STREAM_CALLBACK = ::std::option::Option< + unsafe extern "C" fn( + Stream: HQUIC, + Context: *mut ::std::os::raw::c_void, + Event: *mut QUIC_STREAM_EVENT, + ) -> ::std::os::raw::c_uint, +>; +pub type QUIC_STREAM_CALLBACK_HANDLER = QUIC_STREAM_CALLBACK; +pub type QUIC_STREAM_OPEN_FN = ::std::option::Option< + unsafe extern "C" fn( + Connection: HQUIC, + Flags: QUIC_STREAM_OPEN_FLAGS, + Handler: QUIC_STREAM_CALLBACK_HANDLER, + Context: *mut ::std::os::raw::c_void, + Stream: *mut HQUIC, + ) -> ::std::os::raw::c_uint, +>; +pub type QUIC_STREAM_CLOSE_FN = ::std::option::Option; +pub type QUIC_STREAM_START_FN = ::std::option::Option< + unsafe extern "C" fn(Stream: HQUIC, Flags: QUIC_STREAM_START_FLAGS) -> ::std::os::raw::c_uint, +>; +pub type QUIC_STREAM_SHUTDOWN_FN = ::std::option::Option< + unsafe extern "C" fn( + Stream: HQUIC, + Flags: QUIC_STREAM_SHUTDOWN_FLAGS, + ErrorCode: QUIC_UINT62, + ) -> ::std::os::raw::c_uint, +>; +pub type QUIC_STREAM_SEND_FN = ::std::option::Option< + unsafe extern "C" fn( + Stream: HQUIC, + Buffers: *const QUIC_BUFFER, + BufferCount: u32, + Flags: QUIC_SEND_FLAGS, + ClientSendContext: *mut ::std::os::raw::c_void, + ) -> ::std::os::raw::c_uint, +>; +pub type QUIC_STREAM_RECEIVE_COMPLETE_FN = + ::std::option::Option; +pub type QUIC_STREAM_RECEIVE_SET_ENABLED_FN = ::std::option::Option< + unsafe extern "C" fn(Stream: HQUIC, IsEnabled: BOOLEAN) -> ::std::os::raw::c_uint, +>; +pub type QUIC_DATAGRAM_SEND_FN = ::std::option::Option< + unsafe extern "C" fn( + Connection: HQUIC, + Buffers: *const QUIC_BUFFER, + BufferCount: u32, + Flags: QUIC_SEND_FLAGS, + ClientSendContext: *mut ::std::os::raw::c_void, + ) -> ::std::os::raw::c_uint, +>; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct QUIC_API_TABLE { + pub SetContext: QUIC_SET_CONTEXT_FN, + pub GetContext: QUIC_GET_CONTEXT_FN, + pub SetCallbackHandler: QUIC_SET_CALLBACK_HANDLER_FN, + pub SetParam: QUIC_SET_PARAM_FN, + pub GetParam: QUIC_GET_PARAM_FN, + pub RegistrationOpen: QUIC_REGISTRATION_OPEN_FN, + pub RegistrationClose: QUIC_REGISTRATION_CLOSE_FN, + pub RegistrationShutdown: QUIC_REGISTRATION_SHUTDOWN_FN, + pub ConfigurationOpen: QUIC_CONFIGURATION_OPEN_FN, + pub ConfigurationClose: QUIC_CONFIGURATION_CLOSE_FN, + pub ConfigurationLoadCredential: QUIC_CONFIGURATION_LOAD_CREDENTIAL_FN, + pub ListenerOpen: QUIC_LISTENER_OPEN_FN, + pub ListenerClose: QUIC_LISTENER_CLOSE_FN, + pub ListenerStart: QUIC_LISTENER_START_FN, + pub ListenerStop: QUIC_LISTENER_STOP_FN, + pub ConnectionOpen: QUIC_CONNECTION_OPEN_FN, + pub ConnectionClose: QUIC_CONNECTION_CLOSE_FN, + pub ConnectionShutdown: QUIC_CONNECTION_SHUTDOWN_FN, + pub ConnectionStart: QUIC_CONNECTION_START_FN, + pub ConnectionSetConfiguration: QUIC_CONNECTION_SET_CONFIGURATION_FN, + pub ConnectionSendResumptionTicket: QUIC_CONNECTION_SEND_RESUMPTION_FN, + pub StreamOpen: QUIC_STREAM_OPEN_FN, + pub StreamClose: QUIC_STREAM_CLOSE_FN, + pub StreamStart: QUIC_STREAM_START_FN, + pub StreamShutdown: QUIC_STREAM_SHUTDOWN_FN, + pub StreamSend: QUIC_STREAM_SEND_FN, + pub StreamReceiveComplete: QUIC_STREAM_RECEIVE_COMPLETE_FN, + pub StreamReceiveSetEnabled: QUIC_STREAM_RECEIVE_SET_ENABLED_FN, + pub DatagramSend: QUIC_DATAGRAM_SEND_FN, + pub ConnectionResumptionTicketValidationComplete: QUIC_CONNECTION_COMP_RESUMPTION_FN, + pub ConnectionCertificateValidationComplete: QUIC_CONNECTION_COMP_CERT_FN, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of QUIC_API_TABLE"][::std::mem::size_of::() - 248usize]; + ["Alignment of QUIC_API_TABLE"][::std::mem::align_of::() - 8usize]; + ["Offset of field: QUIC_API_TABLE::SetContext"] + [::std::mem::offset_of!(QUIC_API_TABLE, SetContext) - 0usize]; + ["Offset of field: QUIC_API_TABLE::GetContext"] + [::std::mem::offset_of!(QUIC_API_TABLE, GetContext) - 8usize]; + ["Offset of field: QUIC_API_TABLE::SetCallbackHandler"] + [::std::mem::offset_of!(QUIC_API_TABLE, SetCallbackHandler) - 16usize]; + ["Offset of field: QUIC_API_TABLE::SetParam"] + [::std::mem::offset_of!(QUIC_API_TABLE, SetParam) - 24usize]; + ["Offset of field: QUIC_API_TABLE::GetParam"] + [::std::mem::offset_of!(QUIC_API_TABLE, GetParam) - 32usize]; + ["Offset of field: QUIC_API_TABLE::RegistrationOpen"] + [::std::mem::offset_of!(QUIC_API_TABLE, RegistrationOpen) - 40usize]; + ["Offset of field: QUIC_API_TABLE::RegistrationClose"] + [::std::mem::offset_of!(QUIC_API_TABLE, RegistrationClose) - 48usize]; + ["Offset of field: QUIC_API_TABLE::RegistrationShutdown"] + [::std::mem::offset_of!(QUIC_API_TABLE, RegistrationShutdown) - 56usize]; + ["Offset of field: QUIC_API_TABLE::ConfigurationOpen"] + [::std::mem::offset_of!(QUIC_API_TABLE, ConfigurationOpen) - 64usize]; + ["Offset of field: QUIC_API_TABLE::ConfigurationClose"] + [::std::mem::offset_of!(QUIC_API_TABLE, ConfigurationClose) - 72usize]; + ["Offset of field: QUIC_API_TABLE::ConfigurationLoadCredential"] + [::std::mem::offset_of!(QUIC_API_TABLE, ConfigurationLoadCredential) - 80usize]; + ["Offset of field: QUIC_API_TABLE::ListenerOpen"] + [::std::mem::offset_of!(QUIC_API_TABLE, ListenerOpen) - 88usize]; + ["Offset of field: QUIC_API_TABLE::ListenerClose"] + [::std::mem::offset_of!(QUIC_API_TABLE, ListenerClose) - 96usize]; + ["Offset of field: QUIC_API_TABLE::ListenerStart"] + [::std::mem::offset_of!(QUIC_API_TABLE, ListenerStart) - 104usize]; + ["Offset of field: QUIC_API_TABLE::ListenerStop"] + [::std::mem::offset_of!(QUIC_API_TABLE, ListenerStop) - 112usize]; + ["Offset of field: QUIC_API_TABLE::ConnectionOpen"] + [::std::mem::offset_of!(QUIC_API_TABLE, ConnectionOpen) - 120usize]; + ["Offset of field: QUIC_API_TABLE::ConnectionClose"] + [::std::mem::offset_of!(QUIC_API_TABLE, ConnectionClose) - 128usize]; + ["Offset of field: QUIC_API_TABLE::ConnectionShutdown"] + [::std::mem::offset_of!(QUIC_API_TABLE, ConnectionShutdown) - 136usize]; + ["Offset of field: QUIC_API_TABLE::ConnectionStart"] + [::std::mem::offset_of!(QUIC_API_TABLE, ConnectionStart) - 144usize]; + ["Offset of field: QUIC_API_TABLE::ConnectionSetConfiguration"] + [::std::mem::offset_of!(QUIC_API_TABLE, ConnectionSetConfiguration) - 152usize]; + ["Offset of field: QUIC_API_TABLE::ConnectionSendResumptionTicket"] + [::std::mem::offset_of!(QUIC_API_TABLE, ConnectionSendResumptionTicket) - 160usize]; + ["Offset of field: QUIC_API_TABLE::StreamOpen"] + [::std::mem::offset_of!(QUIC_API_TABLE, StreamOpen) - 168usize]; + ["Offset of field: QUIC_API_TABLE::StreamClose"] + [::std::mem::offset_of!(QUIC_API_TABLE, StreamClose) - 176usize]; + ["Offset of field: QUIC_API_TABLE::StreamStart"] + [::std::mem::offset_of!(QUIC_API_TABLE, StreamStart) - 184usize]; + ["Offset of field: QUIC_API_TABLE::StreamShutdown"] + [::std::mem::offset_of!(QUIC_API_TABLE, StreamShutdown) - 192usize]; + ["Offset of field: QUIC_API_TABLE::StreamSend"] + [::std::mem::offset_of!(QUIC_API_TABLE, StreamSend) - 200usize]; + ["Offset of field: QUIC_API_TABLE::StreamReceiveComplete"] + [::std::mem::offset_of!(QUIC_API_TABLE, StreamReceiveComplete) - 208usize]; + ["Offset of field: QUIC_API_TABLE::StreamReceiveSetEnabled"] + [::std::mem::offset_of!(QUIC_API_TABLE, StreamReceiveSetEnabled) - 216usize]; + ["Offset of field: QUIC_API_TABLE::DatagramSend"] + [::std::mem::offset_of!(QUIC_API_TABLE, DatagramSend) - 224usize]; + ["Offset of field: QUIC_API_TABLE::ConnectionResumptionTicketValidationComplete"][::std::mem::offset_of!( + QUIC_API_TABLE, + ConnectionResumptionTicketValidationComplete + ) - 232usize]; + ["Offset of field: QUIC_API_TABLE::ConnectionCertificateValidationComplete"][::std::mem::offset_of!( + QUIC_API_TABLE, + ConnectionCertificateValidationComplete + ) - 240usize]; +}; +pub const QUIC_ERROR_SUCCESS: QUIC_ERROR = 0; +pub const QUIC_ERROR_PENDING: QUIC_ERROR = 4294967294; +pub const QUIC_ERROR_CONTINUE: QUIC_ERROR = 4294967295; +pub const QUIC_ERROR_OUT_OF_MEMORY: QUIC_ERROR = 12; +pub const QUIC_ERROR_INVALID_PARAMETER: QUIC_ERROR = 22; +pub const QUIC_ERROR_INVALID_STATE: QUIC_ERROR = 1; +pub const QUIC_ERROR_NOT_SUPPORTED: QUIC_ERROR = 95; +pub const QUIC_ERROR_NOT_FOUND: QUIC_ERROR = 2; +pub const QUIC_ERROR_BUFFER_TOO_SMALL: QUIC_ERROR = 75; +pub const QUIC_ERROR_HANDSHAKE_FAILURE: QUIC_ERROR = 103; +pub const QUIC_ERROR_ABORTED: QUIC_ERROR = 125; +pub const QUIC_ERROR_ADDRESS_IN_USE: QUIC_ERROR = 98; +pub const QUIC_ERROR_INVALID_ADDRESS: QUIC_ERROR = 97; +pub const QUIC_ERROR_CONNECTION_TIMEOUT: QUIC_ERROR = 110; +pub const QUIC_ERROR_CONNECTION_IDLE: QUIC_ERROR = 62; +pub const QUIC_ERROR_UNREACHABLE: QUIC_ERROR = 113; +pub const QUIC_ERROR_INTERNAL_ERROR: QUIC_ERROR = 5; +pub const QUIC_ERROR_CONNECTION_REFUSED: QUIC_ERROR = 111; +pub const QUIC_ERROR_PROTOCOL_ERROR: QUIC_ERROR = 71; +pub const QUIC_ERROR_VER_NEG_ERROR: QUIC_ERROR = 93; +pub const QUIC_ERROR_TLS_ERROR: QUIC_ERROR = 126; +pub const QUIC_ERROR_USER_CANCELED: QUIC_ERROR = 130; +pub const QUIC_ERROR_ALPN_NEG_FAILURE: QUIC_ERROR = 92; +pub const QUIC_ERROR_STREAM_LIMIT_REACHED: QUIC_ERROR = 86; +pub const QUIC_ERROR_ALPN_IN_USE: QUIC_ERROR = 91; +pub const QUIC_ERROR_CLOSE_NOTIFY: QUIC_ERROR = 200000256; +pub const QUIC_ERROR_BAD_CERTIFICATE: QUIC_ERROR = 200000298; +pub const QUIC_ERROR_UNSUPPORTED_CERTIFICATE: QUIC_ERROR = 200000299; +pub const QUIC_ERROR_REVOKED_CERTIFICATE: QUIC_ERROR = 200000300; +pub const QUIC_ERROR_EXPIRED_CERTIFICATE: QUIC_ERROR = 200000301; +pub const QUIC_ERROR_UNKNOWN_CERTIFICATE: QUIC_ERROR = 200000302; +pub const QUIC_ERROR_REQUIRED_CERTIFICATE: QUIC_ERROR = 200000372; +pub const QUIC_ERROR_CERT_EXPIRED: QUIC_ERROR = 200000513; +pub const QUIC_ERROR_CERT_UNTRUSTED_ROOT: QUIC_ERROR = 200000514; +pub const QUIC_ERROR_CERT_NO_CERT: QUIC_ERROR = 200000515; +pub type QUIC_ERROR = ::std::os::raw::c_uint; diff --git a/src/ffi/mod.rs b/src/ffi/mod.rs new file mode 100644 index 0000000000..7743f69736 --- /dev/null +++ b/src/ffi/mod.rs @@ -0,0 +1,20 @@ +#![allow( + non_snake_case, + non_upper_case_globals, + non_camel_case_types, + dead_code, + clippy::all +)] + +pub type QUIC_ADDR = std::ffi::c_void; + +// TODO: macos currently is using the linux bindings. +#[cfg(not(target_os = "windows"))] +pub type sa_family_t = u16; +#[cfg(not(target_os = "windows"))] +include!("linux_bindings.rs"); + +#[cfg(target_os = "windows")] +pub type ADDRESS_FAMILY = u16; +#[cfg(target_os = "windows")] +include!("win_bindings.rs"); diff --git a/src/ffi/win_bindings.rs b/src/ffi/win_bindings.rs new file mode 100644 index 0000000000..0b564fdcaf --- /dev/null +++ b/src/ffi/win_bindings.rs @@ -0,0 +1,5720 @@ +/* automatically generated by rust-bindgen 0.71.1 */ + +#[repr(C)] +#[derive(Copy, Clone, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)] +pub struct __BindgenBitfieldUnit { + storage: Storage, +} +impl __BindgenBitfieldUnit { + #[inline] + pub const fn new(storage: Storage) -> Self { + Self { storage } + } +} +impl __BindgenBitfieldUnit +where + Storage: AsRef<[u8]> + AsMut<[u8]>, +{ + #[inline] + fn extract_bit(byte: u8, index: usize) -> bool { + let bit_index = if cfg!(target_endian = "big") { + 7 - (index % 8) + } else { + index % 8 + }; + let mask = 1 << bit_index; + byte & mask == mask + } + #[inline] + pub fn get_bit(&self, index: usize) -> bool { + debug_assert!(index / 8 < self.storage.as_ref().len()); + let byte_index = index / 8; + let byte = self.storage.as_ref()[byte_index]; + Self::extract_bit(byte, index) + } + #[inline] + pub unsafe fn raw_get_bit(this: *const Self, index: usize) -> bool { + debug_assert!(index / 8 < core::mem::size_of::()); + let byte_index = index / 8; + let byte = *(core::ptr::addr_of!((*this).storage) as *const u8).offset(byte_index as isize); + Self::extract_bit(byte, index) + } + #[inline] + fn change_bit(byte: u8, index: usize, val: bool) -> u8 { + let bit_index = if cfg!(target_endian = "big") { + 7 - (index % 8) + } else { + index % 8 + }; + let mask = 1 << bit_index; + if val { + byte | mask + } else { + byte & !mask + } + } + #[inline] + pub fn set_bit(&mut self, index: usize, val: bool) { + debug_assert!(index / 8 < self.storage.as_ref().len()); + let byte_index = index / 8; + let byte = &mut self.storage.as_mut()[byte_index]; + *byte = Self::change_bit(*byte, index, val); + } + #[inline] + pub unsafe fn raw_set_bit(this: *mut Self, index: usize, val: bool) { + debug_assert!(index / 8 < core::mem::size_of::()); + let byte_index = index / 8; + let byte = + (core::ptr::addr_of_mut!((*this).storage) as *mut u8).offset(byte_index as isize); + *byte = Self::change_bit(*byte, index, val); + } + #[inline] + pub fn get(&self, bit_offset: usize, bit_width: u8) -> u64 { + debug_assert!(bit_width <= 64); + debug_assert!(bit_offset / 8 < self.storage.as_ref().len()); + debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len()); + let mut val = 0; + for i in 0..(bit_width as usize) { + if self.get_bit(i + bit_offset) { + let index = if cfg!(target_endian = "big") { + bit_width as usize - 1 - i + } else { + i + }; + val |= 1 << index; + } + } + val + } + #[inline] + pub unsafe fn raw_get(this: *const Self, bit_offset: usize, bit_width: u8) -> u64 { + debug_assert!(bit_width <= 64); + debug_assert!(bit_offset / 8 < core::mem::size_of::()); + debug_assert!((bit_offset + (bit_width as usize)) / 8 <= core::mem::size_of::()); + let mut val = 0; + for i in 0..(bit_width as usize) { + if Self::raw_get_bit(this, i + bit_offset) { + let index = if cfg!(target_endian = "big") { + bit_width as usize - 1 - i + } else { + i + }; + val |= 1 << index; + } + } + val + } + #[inline] + pub fn set(&mut self, bit_offset: usize, bit_width: u8, val: u64) { + debug_assert!(bit_width <= 64); + debug_assert!(bit_offset / 8 < self.storage.as_ref().len()); + debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len()); + for i in 0..(bit_width as usize) { + let mask = 1 << i; + let val_bit_is_set = val & mask == mask; + let index = if cfg!(target_endian = "big") { + bit_width as usize - 1 - i + } else { + i + }; + self.set_bit(index + bit_offset, val_bit_is_set); + } + } + #[inline] + pub unsafe fn raw_set(this: *mut Self, bit_offset: usize, bit_width: u8, val: u64) { + debug_assert!(bit_width <= 64); + debug_assert!(bit_offset / 8 < core::mem::size_of::()); + debug_assert!((bit_offset + (bit_width as usize)) / 8 <= core::mem::size_of::()); + for i in 0..(bit_width as usize) { + let mask = 1 << i; + let val_bit_is_set = val & mask == mask; + let index = if cfg!(target_endian = "big") { + bit_width as usize - 1 - i + } else { + i + }; + Self::raw_set_bit(this, index + bit_offset, val_bit_is_set); + } + } +} +pub const QUIC_ADDRESS_FAMILY_UNSPEC: u32 = 0; +pub const QUIC_ADDRESS_FAMILY_INET: u32 = 2; +pub const QUIC_ADDRESS_FAMILY_INET6: u32 = 23; +pub const QUIC_UINT62_MAX: u64 = 4611686018427387903; +pub const QUIC_MAX_ALPN_LENGTH: u32 = 255; +pub const QUIC_MAX_SNI_LENGTH: u32 = 65535; +pub const QUIC_MAX_RESUMPTION_APP_DATA_LENGTH: u32 = 1000; +pub const QUIC_STATELESS_RESET_KEY_LENGTH: u32 = 32; +pub const QUIC_MAX_TICKET_KEY_COUNT: u32 = 16; +pub const QUIC_TLS_SECRETS_MAX_SECRET_LEN: u32 = 64; +pub const QUIC_PARAM_PREFIX_GLOBAL: u32 = 16777216; +pub const QUIC_PARAM_PREFIX_REGISTRATION: u32 = 33554432; +pub const QUIC_PARAM_PREFIX_CONFIGURATION: u32 = 50331648; +pub const QUIC_PARAM_PREFIX_LISTENER: u32 = 67108864; +pub const QUIC_PARAM_PREFIX_CONNECTION: u32 = 83886080; +pub const QUIC_PARAM_PREFIX_TLS: u32 = 100663296; +pub const QUIC_PARAM_PREFIX_TLS_SCHANNEL: u32 = 117440512; +pub const QUIC_PARAM_PREFIX_STREAM: u32 = 134217728; +pub const QUIC_PARAM_HIGH_PRIORITY: u32 = 1073741824; +pub const QUIC_PARAM_GLOBAL_RETRY_MEMORY_PERCENT: u32 = 16777216; +pub const QUIC_PARAM_GLOBAL_SUPPORTED_VERSIONS: u32 = 16777217; +pub const QUIC_PARAM_GLOBAL_LOAD_BALACING_MODE: u32 = 16777218; +pub const QUIC_PARAM_GLOBAL_PERF_COUNTERS: u32 = 16777219; +pub const QUIC_PARAM_GLOBAL_LIBRARY_VERSION: u32 = 16777220; +pub const QUIC_PARAM_GLOBAL_SETTINGS: u32 = 16777221; +pub const QUIC_PARAM_GLOBAL_GLOBAL_SETTINGS: u32 = 16777222; +pub const QUIC_PARAM_GLOBAL_LIBRARY_GIT_HASH: u32 = 16777224; +pub const QUIC_PARAM_GLOBAL_TLS_PROVIDER: u32 = 16777226; +pub const QUIC_PARAM_GLOBAL_STATELESS_RESET_KEY: u32 = 16777227; +pub const QUIC_PARAM_CONFIGURATION_SETTINGS: u32 = 50331648; +pub const QUIC_PARAM_CONFIGURATION_TICKET_KEYS: u32 = 50331649; +pub const QUIC_PARAM_CONFIGURATION_SCHANNEL_CREDENTIAL_ATTRIBUTE_W: u32 = 50331651; +pub const QUIC_PARAM_LISTENER_LOCAL_ADDRESS: u32 = 67108864; +pub const QUIC_PARAM_LISTENER_STATS: u32 = 67108865; +pub const QUIC_PARAM_CONN_QUIC_VERSION: u32 = 83886080; +pub const QUIC_PARAM_CONN_LOCAL_ADDRESS: u32 = 83886081; +pub const QUIC_PARAM_CONN_REMOTE_ADDRESS: u32 = 83886082; +pub const QUIC_PARAM_CONN_IDEAL_PROCESSOR: u32 = 83886083; +pub const QUIC_PARAM_CONN_SETTINGS: u32 = 83886084; +pub const QUIC_PARAM_CONN_STATISTICS: u32 = 83886085; +pub const QUIC_PARAM_CONN_STATISTICS_PLAT: u32 = 83886086; +pub const QUIC_PARAM_CONN_SHARE_UDP_BINDING: u32 = 83886087; +pub const QUIC_PARAM_CONN_LOCAL_BIDI_STREAM_COUNT: u32 = 83886088; +pub const QUIC_PARAM_CONN_LOCAL_UNIDI_STREAM_COUNT: u32 = 83886089; +pub const QUIC_PARAM_CONN_MAX_STREAM_IDS: u32 = 83886090; +pub const QUIC_PARAM_CONN_CLOSE_REASON_PHRASE: u32 = 83886091; +pub const QUIC_PARAM_CONN_STREAM_SCHEDULING_SCHEME: u32 = 83886092; +pub const QUIC_PARAM_CONN_DATAGRAM_RECEIVE_ENABLED: u32 = 83886093; +pub const QUIC_PARAM_CONN_DATAGRAM_SEND_ENABLED: u32 = 83886094; +pub const QUIC_PARAM_CONN_RESUMPTION_TICKET: u32 = 83886096; +pub const QUIC_PARAM_CONN_PEER_CERTIFICATE_VALID: u32 = 83886097; +pub const QUIC_PARAM_CONN_LOCAL_INTERFACE: u32 = 83886098; +pub const QUIC_PARAM_CONN_TLS_SECRETS: u32 = 83886099; +pub const QUIC_PARAM_CONN_STATISTICS_V2: u32 = 83886102; +pub const QUIC_PARAM_CONN_STATISTICS_V2_PLAT: u32 = 83886103; +pub const QUIC_PARAM_CONN_ORIG_DEST_CID: u32 = 83886104; +pub const QUIC_PARAM_TLS_HANDSHAKE_INFO: u32 = 100663296; +pub const QUIC_PARAM_TLS_NEGOTIATED_ALPN: u32 = 100663297; +pub const QUIC_PARAM_TLS_SCHANNEL_CONTEXT_ATTRIBUTE_W: u32 = 117440512; +pub const QUIC_PARAM_TLS_SCHANNEL_CONTEXT_ATTRIBUTE_EX_W: u32 = 117440513; +pub const QUIC_PARAM_TLS_SCHANNEL_SECURITY_CONTEXT_TOKEN: u32 = 117440514; +pub const QUIC_PARAM_STREAM_ID: u32 = 134217728; +pub const QUIC_PARAM_STREAM_0RTT_LENGTH: u32 = 134217729; +pub const QUIC_PARAM_STREAM_IDEAL_SEND_BUFFER_SIZE: u32 = 134217730; +pub const QUIC_PARAM_STREAM_PRIORITY: u32 = 134217731; +pub const QUIC_PARAM_STREAM_STATISTICS: u32 = 134217732; +pub const QUIC_API_VERSION_1: u32 = 1; +pub const QUIC_API_VERSION_2: u32 = 2; +pub type BYTE = ::std::os::raw::c_uchar; +pub type HRESULT = ::std::os::raw::c_long; +pub type BOOLEAN = BYTE; +pub type QUIC_ADDRESS_FAMILY = ADDRESS_FAMILY; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct QUIC_ADDR_STR { + pub Address: [::std::os::raw::c_char; 64usize], +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of QUIC_ADDR_STR"][::std::mem::size_of::() - 64usize]; + ["Alignment of QUIC_ADDR_STR"][::std::mem::align_of::() - 1usize]; + ["Offset of field: QUIC_ADDR_STR::Address"] + [::std::mem::offset_of!(QUIC_ADDR_STR, Address) - 0usize]; +}; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct QUIC_HANDLE { + _unused: [u8; 0], +} +pub type HQUIC = *mut QUIC_HANDLE; +pub type QUIC_UINT62 = u64; +pub const QUIC_TLS_PROVIDER_QUIC_TLS_PROVIDER_SCHANNEL: QUIC_TLS_PROVIDER = 0; +pub const QUIC_TLS_PROVIDER_QUIC_TLS_PROVIDER_OPENSSL: QUIC_TLS_PROVIDER = 1; +pub type QUIC_TLS_PROVIDER = ::std::os::raw::c_int; +pub const QUIC_EXECUTION_PROFILE_QUIC_EXECUTION_PROFILE_LOW_LATENCY: QUIC_EXECUTION_PROFILE = 0; +pub const QUIC_EXECUTION_PROFILE_QUIC_EXECUTION_PROFILE_TYPE_MAX_THROUGHPUT: + QUIC_EXECUTION_PROFILE = 1; +pub const QUIC_EXECUTION_PROFILE_QUIC_EXECUTION_PROFILE_TYPE_SCAVENGER: QUIC_EXECUTION_PROFILE = 2; +pub const QUIC_EXECUTION_PROFILE_QUIC_EXECUTION_PROFILE_TYPE_REAL_TIME: QUIC_EXECUTION_PROFILE = 3; +pub type QUIC_EXECUTION_PROFILE = ::std::os::raw::c_int; +pub const QUIC_LOAD_BALANCING_MODE_QUIC_LOAD_BALANCING_DISABLED: QUIC_LOAD_BALANCING_MODE = 0; +pub const QUIC_LOAD_BALANCING_MODE_QUIC_LOAD_BALANCING_SERVER_ID_IP: QUIC_LOAD_BALANCING_MODE = 1; +pub const QUIC_LOAD_BALANCING_MODE_QUIC_LOAD_BALANCING_SERVER_ID_FIXED: QUIC_LOAD_BALANCING_MODE = + 2; +pub const QUIC_LOAD_BALANCING_MODE_QUIC_LOAD_BALANCING_COUNT: QUIC_LOAD_BALANCING_MODE = 3; +pub type QUIC_LOAD_BALANCING_MODE = ::std::os::raw::c_int; +pub const QUIC_TLS_ALERT_CODES_QUIC_TLS_ALERT_CODE_SUCCESS: QUIC_TLS_ALERT_CODES = 65535; +pub const QUIC_TLS_ALERT_CODES_QUIC_TLS_ALERT_CODE_UNEXPECTED_MESSAGE: QUIC_TLS_ALERT_CODES = 10; +pub const QUIC_TLS_ALERT_CODES_QUIC_TLS_ALERT_CODE_BAD_CERTIFICATE: QUIC_TLS_ALERT_CODES = 42; +pub const QUIC_TLS_ALERT_CODES_QUIC_TLS_ALERT_CODE_UNSUPPORTED_CERTIFICATE: QUIC_TLS_ALERT_CODES = + 43; +pub const QUIC_TLS_ALERT_CODES_QUIC_TLS_ALERT_CODE_CERTIFICATE_REVOKED: QUIC_TLS_ALERT_CODES = 44; +pub const QUIC_TLS_ALERT_CODES_QUIC_TLS_ALERT_CODE_CERTIFICATE_EXPIRED: QUIC_TLS_ALERT_CODES = 45; +pub const QUIC_TLS_ALERT_CODES_QUIC_TLS_ALERT_CODE_CERTIFICATE_UNKNOWN: QUIC_TLS_ALERT_CODES = 46; +pub const QUIC_TLS_ALERT_CODES_QUIC_TLS_ALERT_CODE_ILLEGAL_PARAMETER: QUIC_TLS_ALERT_CODES = 47; +pub const QUIC_TLS_ALERT_CODES_QUIC_TLS_ALERT_CODE_UNKNOWN_CA: QUIC_TLS_ALERT_CODES = 48; +pub const QUIC_TLS_ALERT_CODES_QUIC_TLS_ALERT_CODE_ACCESS_DENIED: QUIC_TLS_ALERT_CODES = 49; +pub const QUIC_TLS_ALERT_CODES_QUIC_TLS_ALERT_CODE_INSUFFICIENT_SECURITY: QUIC_TLS_ALERT_CODES = 71; +pub const QUIC_TLS_ALERT_CODES_QUIC_TLS_ALERT_CODE_INTERNAL_ERROR: QUIC_TLS_ALERT_CODES = 80; +pub const QUIC_TLS_ALERT_CODES_QUIC_TLS_ALERT_CODE_USER_CANCELED: QUIC_TLS_ALERT_CODES = 90; +pub const QUIC_TLS_ALERT_CODES_QUIC_TLS_ALERT_CODE_CERTIFICATE_REQUIRED: QUIC_TLS_ALERT_CODES = 116; +pub const QUIC_TLS_ALERT_CODES_QUIC_TLS_ALERT_CODE_MAX: QUIC_TLS_ALERT_CODES = 255; +pub type QUIC_TLS_ALERT_CODES = ::std::os::raw::c_int; +pub const QUIC_CREDENTIAL_TYPE_QUIC_CREDENTIAL_TYPE_NONE: QUIC_CREDENTIAL_TYPE = 0; +pub const QUIC_CREDENTIAL_TYPE_QUIC_CREDENTIAL_TYPE_CERTIFICATE_HASH: QUIC_CREDENTIAL_TYPE = 1; +pub const QUIC_CREDENTIAL_TYPE_QUIC_CREDENTIAL_TYPE_CERTIFICATE_HASH_STORE: QUIC_CREDENTIAL_TYPE = + 2; +pub const QUIC_CREDENTIAL_TYPE_QUIC_CREDENTIAL_TYPE_CERTIFICATE_CONTEXT: QUIC_CREDENTIAL_TYPE = 3; +pub const QUIC_CREDENTIAL_TYPE_QUIC_CREDENTIAL_TYPE_CERTIFICATE_FILE: QUIC_CREDENTIAL_TYPE = 4; +pub const QUIC_CREDENTIAL_TYPE_QUIC_CREDENTIAL_TYPE_CERTIFICATE_FILE_PROTECTED: + QUIC_CREDENTIAL_TYPE = 5; +pub const QUIC_CREDENTIAL_TYPE_QUIC_CREDENTIAL_TYPE_CERTIFICATE_PKCS12: QUIC_CREDENTIAL_TYPE = 6; +pub type QUIC_CREDENTIAL_TYPE = ::std::os::raw::c_int; +pub const QUIC_CREDENTIAL_FLAGS_QUIC_CREDENTIAL_FLAG_NONE: QUIC_CREDENTIAL_FLAGS = 0; +pub const QUIC_CREDENTIAL_FLAGS_QUIC_CREDENTIAL_FLAG_CLIENT: QUIC_CREDENTIAL_FLAGS = 1; +pub const QUIC_CREDENTIAL_FLAGS_QUIC_CREDENTIAL_FLAG_LOAD_ASYNCHRONOUS: QUIC_CREDENTIAL_FLAGS = 2; +pub const QUIC_CREDENTIAL_FLAGS_QUIC_CREDENTIAL_FLAG_NO_CERTIFICATE_VALIDATION: + QUIC_CREDENTIAL_FLAGS = 4; +pub const QUIC_CREDENTIAL_FLAGS_QUIC_CREDENTIAL_FLAG_ENABLE_OCSP: QUIC_CREDENTIAL_FLAGS = 8; +pub const QUIC_CREDENTIAL_FLAGS_QUIC_CREDENTIAL_FLAG_INDICATE_CERTIFICATE_RECEIVED: + QUIC_CREDENTIAL_FLAGS = 16; +pub const QUIC_CREDENTIAL_FLAGS_QUIC_CREDENTIAL_FLAG_DEFER_CERTIFICATE_VALIDATION: + QUIC_CREDENTIAL_FLAGS = 32; +pub const QUIC_CREDENTIAL_FLAGS_QUIC_CREDENTIAL_FLAG_REQUIRE_CLIENT_AUTHENTICATION: + QUIC_CREDENTIAL_FLAGS = 64; +pub const QUIC_CREDENTIAL_FLAGS_QUIC_CREDENTIAL_FLAG_USE_TLS_BUILTIN_CERTIFICATE_VALIDATION: + QUIC_CREDENTIAL_FLAGS = 128; +pub const QUIC_CREDENTIAL_FLAGS_QUIC_CREDENTIAL_FLAG_REVOCATION_CHECK_END_CERT: + QUIC_CREDENTIAL_FLAGS = 256; +pub const QUIC_CREDENTIAL_FLAGS_QUIC_CREDENTIAL_FLAG_REVOCATION_CHECK_CHAIN: QUIC_CREDENTIAL_FLAGS = + 512; +pub const QUIC_CREDENTIAL_FLAGS_QUIC_CREDENTIAL_FLAG_REVOCATION_CHECK_CHAIN_EXCLUDE_ROOT: + QUIC_CREDENTIAL_FLAGS = 1024; +pub const QUIC_CREDENTIAL_FLAGS_QUIC_CREDENTIAL_FLAG_IGNORE_NO_REVOCATION_CHECK: + QUIC_CREDENTIAL_FLAGS = 2048; +pub const QUIC_CREDENTIAL_FLAGS_QUIC_CREDENTIAL_FLAG_IGNORE_REVOCATION_OFFLINE: + QUIC_CREDENTIAL_FLAGS = 4096; +pub const QUIC_CREDENTIAL_FLAGS_QUIC_CREDENTIAL_FLAG_SET_ALLOWED_CIPHER_SUITES: + QUIC_CREDENTIAL_FLAGS = 8192; +pub const QUIC_CREDENTIAL_FLAGS_QUIC_CREDENTIAL_FLAG_USE_PORTABLE_CERTIFICATES: + QUIC_CREDENTIAL_FLAGS = 16384; +pub const QUIC_CREDENTIAL_FLAGS_QUIC_CREDENTIAL_FLAG_USE_SUPPLIED_CREDENTIALS: + QUIC_CREDENTIAL_FLAGS = 32768; +pub const QUIC_CREDENTIAL_FLAGS_QUIC_CREDENTIAL_FLAG_USE_SYSTEM_MAPPER: QUIC_CREDENTIAL_FLAGS = + 65536; +pub const QUIC_CREDENTIAL_FLAGS_QUIC_CREDENTIAL_FLAG_CACHE_ONLY_URL_RETRIEVAL: + QUIC_CREDENTIAL_FLAGS = 131072; +pub const QUIC_CREDENTIAL_FLAGS_QUIC_CREDENTIAL_FLAG_REVOCATION_CHECK_CACHE_ONLY: + QUIC_CREDENTIAL_FLAGS = 262144; +pub const QUIC_CREDENTIAL_FLAGS_QUIC_CREDENTIAL_FLAG_INPROC_PEER_CERTIFICATE: + QUIC_CREDENTIAL_FLAGS = 524288; +pub const QUIC_CREDENTIAL_FLAGS_QUIC_CREDENTIAL_FLAG_SET_CA_CERTIFICATE_FILE: + QUIC_CREDENTIAL_FLAGS = 1048576; +pub const QUIC_CREDENTIAL_FLAGS_QUIC_CREDENTIAL_FLAG_DISABLE_AIA: QUIC_CREDENTIAL_FLAGS = 2097152; +pub type QUIC_CREDENTIAL_FLAGS = ::std::os::raw::c_int; +pub const QUIC_ALLOWED_CIPHER_SUITE_FLAGS_QUIC_ALLOWED_CIPHER_SUITE_NONE: + QUIC_ALLOWED_CIPHER_SUITE_FLAGS = 0; +pub const QUIC_ALLOWED_CIPHER_SUITE_FLAGS_QUIC_ALLOWED_CIPHER_SUITE_AES_128_GCM_SHA256: + QUIC_ALLOWED_CIPHER_SUITE_FLAGS = 1; +pub const QUIC_ALLOWED_CIPHER_SUITE_FLAGS_QUIC_ALLOWED_CIPHER_SUITE_AES_256_GCM_SHA384: + QUIC_ALLOWED_CIPHER_SUITE_FLAGS = 2; +pub const QUIC_ALLOWED_CIPHER_SUITE_FLAGS_QUIC_ALLOWED_CIPHER_SUITE_CHACHA20_POLY1305_SHA256: + QUIC_ALLOWED_CIPHER_SUITE_FLAGS = 4; +pub type QUIC_ALLOWED_CIPHER_SUITE_FLAGS = ::std::os::raw::c_int; +pub const QUIC_CERTIFICATE_HASH_STORE_FLAGS_QUIC_CERTIFICATE_HASH_STORE_FLAG_NONE: + QUIC_CERTIFICATE_HASH_STORE_FLAGS = 0; +pub const QUIC_CERTIFICATE_HASH_STORE_FLAGS_QUIC_CERTIFICATE_HASH_STORE_FLAG_MACHINE_STORE: + QUIC_CERTIFICATE_HASH_STORE_FLAGS = 1; +pub type QUIC_CERTIFICATE_HASH_STORE_FLAGS = ::std::os::raw::c_int; +pub const QUIC_CONNECTION_SHUTDOWN_FLAGS_QUIC_CONNECTION_SHUTDOWN_FLAG_NONE: + QUIC_CONNECTION_SHUTDOWN_FLAGS = 0; +pub const QUIC_CONNECTION_SHUTDOWN_FLAGS_QUIC_CONNECTION_SHUTDOWN_FLAG_SILENT: + QUIC_CONNECTION_SHUTDOWN_FLAGS = 1; +pub type QUIC_CONNECTION_SHUTDOWN_FLAGS = ::std::os::raw::c_int; +pub const QUIC_SERVER_RESUMPTION_LEVEL_QUIC_SERVER_NO_RESUME: QUIC_SERVER_RESUMPTION_LEVEL = 0; +pub const QUIC_SERVER_RESUMPTION_LEVEL_QUIC_SERVER_RESUME_ONLY: QUIC_SERVER_RESUMPTION_LEVEL = 1; +pub const QUIC_SERVER_RESUMPTION_LEVEL_QUIC_SERVER_RESUME_AND_ZERORTT: + QUIC_SERVER_RESUMPTION_LEVEL = 2; +pub type QUIC_SERVER_RESUMPTION_LEVEL = ::std::os::raw::c_int; +pub const QUIC_SEND_RESUMPTION_FLAGS_QUIC_SEND_RESUMPTION_FLAG_NONE: QUIC_SEND_RESUMPTION_FLAGS = 0; +pub const QUIC_SEND_RESUMPTION_FLAGS_QUIC_SEND_RESUMPTION_FLAG_FINAL: QUIC_SEND_RESUMPTION_FLAGS = + 1; +pub type QUIC_SEND_RESUMPTION_FLAGS = ::std::os::raw::c_int; +pub const QUIC_STREAM_SCHEDULING_SCHEME_QUIC_STREAM_SCHEDULING_SCHEME_FIFO: + QUIC_STREAM_SCHEDULING_SCHEME = 0; +pub const QUIC_STREAM_SCHEDULING_SCHEME_QUIC_STREAM_SCHEDULING_SCHEME_ROUND_ROBIN: + QUIC_STREAM_SCHEDULING_SCHEME = 1; +pub const QUIC_STREAM_SCHEDULING_SCHEME_QUIC_STREAM_SCHEDULING_SCHEME_COUNT: + QUIC_STREAM_SCHEDULING_SCHEME = 2; +pub type QUIC_STREAM_SCHEDULING_SCHEME = ::std::os::raw::c_int; +pub const QUIC_STREAM_OPEN_FLAGS_QUIC_STREAM_OPEN_FLAG_NONE: QUIC_STREAM_OPEN_FLAGS = 0; +pub const QUIC_STREAM_OPEN_FLAGS_QUIC_STREAM_OPEN_FLAG_UNIDIRECTIONAL: QUIC_STREAM_OPEN_FLAGS = 1; +pub const QUIC_STREAM_OPEN_FLAGS_QUIC_STREAM_OPEN_FLAG_0_RTT: QUIC_STREAM_OPEN_FLAGS = 2; +pub const QUIC_STREAM_OPEN_FLAGS_QUIC_STREAM_OPEN_FLAG_DELAY_ID_FC_UPDATES: QUIC_STREAM_OPEN_FLAGS = + 4; +pub type QUIC_STREAM_OPEN_FLAGS = ::std::os::raw::c_int; +pub const QUIC_STREAM_START_FLAGS_QUIC_STREAM_START_FLAG_NONE: QUIC_STREAM_START_FLAGS = 0; +pub const QUIC_STREAM_START_FLAGS_QUIC_STREAM_START_FLAG_IMMEDIATE: QUIC_STREAM_START_FLAGS = 1; +pub const QUIC_STREAM_START_FLAGS_QUIC_STREAM_START_FLAG_FAIL_BLOCKED: QUIC_STREAM_START_FLAGS = 2; +pub const QUIC_STREAM_START_FLAGS_QUIC_STREAM_START_FLAG_SHUTDOWN_ON_FAIL: QUIC_STREAM_START_FLAGS = + 4; +pub const QUIC_STREAM_START_FLAGS_QUIC_STREAM_START_FLAG_INDICATE_PEER_ACCEPT: + QUIC_STREAM_START_FLAGS = 8; +pub const QUIC_STREAM_START_FLAGS_QUIC_STREAM_START_FLAG_PRIORITY_WORK: QUIC_STREAM_START_FLAGS = + 16; +pub type QUIC_STREAM_START_FLAGS = ::std::os::raw::c_int; +pub const QUIC_STREAM_SHUTDOWN_FLAGS_QUIC_STREAM_SHUTDOWN_FLAG_NONE: QUIC_STREAM_SHUTDOWN_FLAGS = 0; +pub const QUIC_STREAM_SHUTDOWN_FLAGS_QUIC_STREAM_SHUTDOWN_FLAG_GRACEFUL: + QUIC_STREAM_SHUTDOWN_FLAGS = 1; +pub const QUIC_STREAM_SHUTDOWN_FLAGS_QUIC_STREAM_SHUTDOWN_FLAG_ABORT_SEND: + QUIC_STREAM_SHUTDOWN_FLAGS = 2; +pub const QUIC_STREAM_SHUTDOWN_FLAGS_QUIC_STREAM_SHUTDOWN_FLAG_ABORT_RECEIVE: + QUIC_STREAM_SHUTDOWN_FLAGS = 4; +pub const QUIC_STREAM_SHUTDOWN_FLAGS_QUIC_STREAM_SHUTDOWN_FLAG_ABORT: QUIC_STREAM_SHUTDOWN_FLAGS = + 6; +pub const QUIC_STREAM_SHUTDOWN_FLAGS_QUIC_STREAM_SHUTDOWN_FLAG_IMMEDIATE: + QUIC_STREAM_SHUTDOWN_FLAGS = 8; +pub const QUIC_STREAM_SHUTDOWN_FLAGS_QUIC_STREAM_SHUTDOWN_FLAG_INLINE: QUIC_STREAM_SHUTDOWN_FLAGS = + 16; +pub type QUIC_STREAM_SHUTDOWN_FLAGS = ::std::os::raw::c_int; +pub const QUIC_RECEIVE_FLAGS_QUIC_RECEIVE_FLAG_NONE: QUIC_RECEIVE_FLAGS = 0; +pub const QUIC_RECEIVE_FLAGS_QUIC_RECEIVE_FLAG_0_RTT: QUIC_RECEIVE_FLAGS = 1; +pub const QUIC_RECEIVE_FLAGS_QUIC_RECEIVE_FLAG_FIN: QUIC_RECEIVE_FLAGS = 2; +pub type QUIC_RECEIVE_FLAGS = ::std::os::raw::c_int; +pub const QUIC_SEND_FLAGS_QUIC_SEND_FLAG_NONE: QUIC_SEND_FLAGS = 0; +pub const QUIC_SEND_FLAGS_QUIC_SEND_FLAG_ALLOW_0_RTT: QUIC_SEND_FLAGS = 1; +pub const QUIC_SEND_FLAGS_QUIC_SEND_FLAG_START: QUIC_SEND_FLAGS = 2; +pub const QUIC_SEND_FLAGS_QUIC_SEND_FLAG_FIN: QUIC_SEND_FLAGS = 4; +pub const QUIC_SEND_FLAGS_QUIC_SEND_FLAG_DGRAM_PRIORITY: QUIC_SEND_FLAGS = 8; +pub const QUIC_SEND_FLAGS_QUIC_SEND_FLAG_DELAY_SEND: QUIC_SEND_FLAGS = 16; +pub const QUIC_SEND_FLAGS_QUIC_SEND_FLAG_CANCEL_ON_LOSS: QUIC_SEND_FLAGS = 32; +pub const QUIC_SEND_FLAGS_QUIC_SEND_FLAG_PRIORITY_WORK: QUIC_SEND_FLAGS = 64; +pub type QUIC_SEND_FLAGS = ::std::os::raw::c_int; +pub const QUIC_DATAGRAM_SEND_STATE_QUIC_DATAGRAM_SEND_UNKNOWN: QUIC_DATAGRAM_SEND_STATE = 0; +pub const QUIC_DATAGRAM_SEND_STATE_QUIC_DATAGRAM_SEND_SENT: QUIC_DATAGRAM_SEND_STATE = 1; +pub const QUIC_DATAGRAM_SEND_STATE_QUIC_DATAGRAM_SEND_LOST_SUSPECT: QUIC_DATAGRAM_SEND_STATE = 2; +pub const QUIC_DATAGRAM_SEND_STATE_QUIC_DATAGRAM_SEND_LOST_DISCARDED: QUIC_DATAGRAM_SEND_STATE = 3; +pub const QUIC_DATAGRAM_SEND_STATE_QUIC_DATAGRAM_SEND_ACKNOWLEDGED: QUIC_DATAGRAM_SEND_STATE = 4; +pub const QUIC_DATAGRAM_SEND_STATE_QUIC_DATAGRAM_SEND_ACKNOWLEDGED_SPURIOUS: + QUIC_DATAGRAM_SEND_STATE = 5; +pub const QUIC_DATAGRAM_SEND_STATE_QUIC_DATAGRAM_SEND_CANCELED: QUIC_DATAGRAM_SEND_STATE = 6; +pub type QUIC_DATAGRAM_SEND_STATE = ::std::os::raw::c_int; +pub const QUIC_EXECUTION_CONFIG_FLAGS_QUIC_EXECUTION_CONFIG_FLAG_NONE: QUIC_EXECUTION_CONFIG_FLAGS = + 0; +pub type QUIC_EXECUTION_CONFIG_FLAGS = ::std::os::raw::c_int; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct QUIC_EXECUTION_CONFIG { + pub Flags: QUIC_EXECUTION_CONFIG_FLAGS, + pub PollingIdleTimeoutUs: u32, + pub ProcessorCount: u32, + pub ProcessorList: [u16; 1usize], +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of QUIC_EXECUTION_CONFIG"][::std::mem::size_of::() - 16usize]; + ["Alignment of QUIC_EXECUTION_CONFIG"] + [::std::mem::align_of::() - 4usize]; + ["Offset of field: QUIC_EXECUTION_CONFIG::Flags"] + [::std::mem::offset_of!(QUIC_EXECUTION_CONFIG, Flags) - 0usize]; + ["Offset of field: QUIC_EXECUTION_CONFIG::PollingIdleTimeoutUs"] + [::std::mem::offset_of!(QUIC_EXECUTION_CONFIG, PollingIdleTimeoutUs) - 4usize]; + ["Offset of field: QUIC_EXECUTION_CONFIG::ProcessorCount"] + [::std::mem::offset_of!(QUIC_EXECUTION_CONFIG, ProcessorCount) - 8usize]; + ["Offset of field: QUIC_EXECUTION_CONFIG::ProcessorList"] + [::std::mem::offset_of!(QUIC_EXECUTION_CONFIG, ProcessorList) - 12usize]; +}; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct QUIC_REGISTRATION_CONFIG { + pub AppName: *const ::std::os::raw::c_char, + pub ExecutionProfile: QUIC_EXECUTION_PROFILE, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of QUIC_REGISTRATION_CONFIG"] + [::std::mem::size_of::() - 16usize]; + ["Alignment of QUIC_REGISTRATION_CONFIG"] + [::std::mem::align_of::() - 8usize]; + ["Offset of field: QUIC_REGISTRATION_CONFIG::AppName"] + [::std::mem::offset_of!(QUIC_REGISTRATION_CONFIG, AppName) - 0usize]; + ["Offset of field: QUIC_REGISTRATION_CONFIG::ExecutionProfile"] + [::std::mem::offset_of!(QUIC_REGISTRATION_CONFIG, ExecutionProfile) - 8usize]; +}; +pub type QUIC_CREDENTIAL_LOAD_COMPLETE_HANDLER = ::std::option::Option< + unsafe extern "C" fn(arg1: HQUIC, arg2: *mut ::std::os::raw::c_void, arg3: HRESULT), +>; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct QUIC_CERTIFICATE_HASH { + pub ShaHash: [u8; 20usize], +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of QUIC_CERTIFICATE_HASH"][::std::mem::size_of::() - 20usize]; + ["Alignment of QUIC_CERTIFICATE_HASH"] + [::std::mem::align_of::() - 1usize]; + ["Offset of field: QUIC_CERTIFICATE_HASH::ShaHash"] + [::std::mem::offset_of!(QUIC_CERTIFICATE_HASH, ShaHash) - 0usize]; +}; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct QUIC_CERTIFICATE_HASH_STORE { + pub Flags: QUIC_CERTIFICATE_HASH_STORE_FLAGS, + pub ShaHash: [u8; 20usize], + pub StoreName: [::std::os::raw::c_char; 128usize], +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of QUIC_CERTIFICATE_HASH_STORE"] + [::std::mem::size_of::() - 152usize]; + ["Alignment of QUIC_CERTIFICATE_HASH_STORE"] + [::std::mem::align_of::() - 4usize]; + ["Offset of field: QUIC_CERTIFICATE_HASH_STORE::Flags"] + [::std::mem::offset_of!(QUIC_CERTIFICATE_HASH_STORE, Flags) - 0usize]; + ["Offset of field: QUIC_CERTIFICATE_HASH_STORE::ShaHash"] + [::std::mem::offset_of!(QUIC_CERTIFICATE_HASH_STORE, ShaHash) - 4usize]; + ["Offset of field: QUIC_CERTIFICATE_HASH_STORE::StoreName"] + [::std::mem::offset_of!(QUIC_CERTIFICATE_HASH_STORE, StoreName) - 24usize]; +}; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct QUIC_CERTIFICATE_FILE { + pub PrivateKeyFile: *const ::std::os::raw::c_char, + pub CertificateFile: *const ::std::os::raw::c_char, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of QUIC_CERTIFICATE_FILE"][::std::mem::size_of::() - 16usize]; + ["Alignment of QUIC_CERTIFICATE_FILE"] + [::std::mem::align_of::() - 8usize]; + ["Offset of field: QUIC_CERTIFICATE_FILE::PrivateKeyFile"] + [::std::mem::offset_of!(QUIC_CERTIFICATE_FILE, PrivateKeyFile) - 0usize]; + ["Offset of field: QUIC_CERTIFICATE_FILE::CertificateFile"] + [::std::mem::offset_of!(QUIC_CERTIFICATE_FILE, CertificateFile) - 8usize]; +}; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct QUIC_CERTIFICATE_FILE_PROTECTED { + pub PrivateKeyFile: *const ::std::os::raw::c_char, + pub CertificateFile: *const ::std::os::raw::c_char, + pub PrivateKeyPassword: *const ::std::os::raw::c_char, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of QUIC_CERTIFICATE_FILE_PROTECTED"] + [::std::mem::size_of::() - 24usize]; + ["Alignment of QUIC_CERTIFICATE_FILE_PROTECTED"] + [::std::mem::align_of::() - 8usize]; + ["Offset of field: QUIC_CERTIFICATE_FILE_PROTECTED::PrivateKeyFile"] + [::std::mem::offset_of!(QUIC_CERTIFICATE_FILE_PROTECTED, PrivateKeyFile) - 0usize]; + ["Offset of field: QUIC_CERTIFICATE_FILE_PROTECTED::CertificateFile"] + [::std::mem::offset_of!(QUIC_CERTIFICATE_FILE_PROTECTED, CertificateFile) - 8usize]; + ["Offset of field: QUIC_CERTIFICATE_FILE_PROTECTED::PrivateKeyPassword"] + [::std::mem::offset_of!(QUIC_CERTIFICATE_FILE_PROTECTED, PrivateKeyPassword) - 16usize]; +}; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct QUIC_CERTIFICATE_PKCS12 { + pub Asn1Blob: *const u8, + pub Asn1BlobLength: u32, + pub PrivateKeyPassword: *const ::std::os::raw::c_char, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of QUIC_CERTIFICATE_PKCS12"][::std::mem::size_of::() - 24usize]; + ["Alignment of QUIC_CERTIFICATE_PKCS12"] + [::std::mem::align_of::() - 8usize]; + ["Offset of field: QUIC_CERTIFICATE_PKCS12::Asn1Blob"] + [::std::mem::offset_of!(QUIC_CERTIFICATE_PKCS12, Asn1Blob) - 0usize]; + ["Offset of field: QUIC_CERTIFICATE_PKCS12::Asn1BlobLength"] + [::std::mem::offset_of!(QUIC_CERTIFICATE_PKCS12, Asn1BlobLength) - 8usize]; + ["Offset of field: QUIC_CERTIFICATE_PKCS12::PrivateKeyPassword"] + [::std::mem::offset_of!(QUIC_CERTIFICATE_PKCS12, PrivateKeyPassword) - 16usize]; +}; +pub type QUIC_CERTIFICATE = ::std::os::raw::c_void; +pub type QUIC_CERTIFICATE_CHAIN = ::std::os::raw::c_void; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct QUIC_CREDENTIAL_CONFIG { + pub Type: QUIC_CREDENTIAL_TYPE, + pub Flags: QUIC_CREDENTIAL_FLAGS, + pub __bindgen_anon_1: QUIC_CREDENTIAL_CONFIG__bindgen_ty_1, + pub Principal: *const ::std::os::raw::c_char, + pub Reserved: *mut ::std::os::raw::c_void, + pub AsyncHandler: QUIC_CREDENTIAL_LOAD_COMPLETE_HANDLER, + pub AllowedCipherSuites: QUIC_ALLOWED_CIPHER_SUITE_FLAGS, + pub CaCertificateFile: *const ::std::os::raw::c_char, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union QUIC_CREDENTIAL_CONFIG__bindgen_ty_1 { + pub CertificateHash: *mut QUIC_CERTIFICATE_HASH, + pub CertificateHashStore: *mut QUIC_CERTIFICATE_HASH_STORE, + pub CertificateContext: *mut QUIC_CERTIFICATE, + pub CertificateFile: *mut QUIC_CERTIFICATE_FILE, + pub CertificateFileProtected: *mut QUIC_CERTIFICATE_FILE_PROTECTED, + pub CertificatePkcs12: *mut QUIC_CERTIFICATE_PKCS12, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of QUIC_CREDENTIAL_CONFIG__bindgen_ty_1"] + [::std::mem::size_of::() - 8usize]; + ["Alignment of QUIC_CREDENTIAL_CONFIG__bindgen_ty_1"] + [::std::mem::align_of::() - 8usize]; + ["Offset of field: QUIC_CREDENTIAL_CONFIG__bindgen_ty_1::CertificateHash"] + [::std::mem::offset_of!(QUIC_CREDENTIAL_CONFIG__bindgen_ty_1, CertificateHash) - 0usize]; + ["Offset of field: QUIC_CREDENTIAL_CONFIG__bindgen_ty_1::CertificateHashStore"][::std::mem::offset_of!( + QUIC_CREDENTIAL_CONFIG__bindgen_ty_1, + CertificateHashStore + ) - 0usize]; + ["Offset of field: QUIC_CREDENTIAL_CONFIG__bindgen_ty_1::CertificateContext"] + [::std::mem::offset_of!(QUIC_CREDENTIAL_CONFIG__bindgen_ty_1, CertificateContext) - 0usize]; + ["Offset of field: QUIC_CREDENTIAL_CONFIG__bindgen_ty_1::CertificateFile"] + [::std::mem::offset_of!(QUIC_CREDENTIAL_CONFIG__bindgen_ty_1, CertificateFile) - 0usize]; + ["Offset of field: QUIC_CREDENTIAL_CONFIG__bindgen_ty_1::CertificateFileProtected"][::std::mem::offset_of!( + QUIC_CREDENTIAL_CONFIG__bindgen_ty_1, + CertificateFileProtected + ) - 0usize]; + ["Offset of field: QUIC_CREDENTIAL_CONFIG__bindgen_ty_1::CertificatePkcs12"] + [::std::mem::offset_of!(QUIC_CREDENTIAL_CONFIG__bindgen_ty_1, CertificatePkcs12) - 0usize]; +}; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of QUIC_CREDENTIAL_CONFIG"][::std::mem::size_of::() - 56usize]; + ["Alignment of QUIC_CREDENTIAL_CONFIG"] + [::std::mem::align_of::() - 8usize]; + ["Offset of field: QUIC_CREDENTIAL_CONFIG::Type"] + [::std::mem::offset_of!(QUIC_CREDENTIAL_CONFIG, Type) - 0usize]; + ["Offset of field: QUIC_CREDENTIAL_CONFIG::Flags"] + [::std::mem::offset_of!(QUIC_CREDENTIAL_CONFIG, Flags) - 4usize]; + ["Offset of field: QUIC_CREDENTIAL_CONFIG::Principal"] + [::std::mem::offset_of!(QUIC_CREDENTIAL_CONFIG, Principal) - 16usize]; + ["Offset of field: QUIC_CREDENTIAL_CONFIG::Reserved"] + [::std::mem::offset_of!(QUIC_CREDENTIAL_CONFIG, Reserved) - 24usize]; + ["Offset of field: QUIC_CREDENTIAL_CONFIG::AsyncHandler"] + [::std::mem::offset_of!(QUIC_CREDENTIAL_CONFIG, AsyncHandler) - 32usize]; + ["Offset of field: QUIC_CREDENTIAL_CONFIG::AllowedCipherSuites"] + [::std::mem::offset_of!(QUIC_CREDENTIAL_CONFIG, AllowedCipherSuites) - 40usize]; + ["Offset of field: QUIC_CREDENTIAL_CONFIG::CaCertificateFile"] + [::std::mem::offset_of!(QUIC_CREDENTIAL_CONFIG, CaCertificateFile) - 48usize]; +}; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct QUIC_TICKET_KEY_CONFIG { + pub Id: [u8; 16usize], + pub Material: [u8; 64usize], + pub MaterialLength: u8, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of QUIC_TICKET_KEY_CONFIG"][::std::mem::size_of::() - 81usize]; + ["Alignment of QUIC_TICKET_KEY_CONFIG"] + [::std::mem::align_of::() - 1usize]; + ["Offset of field: QUIC_TICKET_KEY_CONFIG::Id"] + [::std::mem::offset_of!(QUIC_TICKET_KEY_CONFIG, Id) - 0usize]; + ["Offset of field: QUIC_TICKET_KEY_CONFIG::Material"] + [::std::mem::offset_of!(QUIC_TICKET_KEY_CONFIG, Material) - 16usize]; + ["Offset of field: QUIC_TICKET_KEY_CONFIG::MaterialLength"] + [::std::mem::offset_of!(QUIC_TICKET_KEY_CONFIG, MaterialLength) - 80usize]; +}; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct QUIC_BUFFER { + pub Length: u32, + pub Buffer: *mut u8, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of QUIC_BUFFER"][::std::mem::size_of::() - 16usize]; + ["Alignment of QUIC_BUFFER"][::std::mem::align_of::() - 8usize]; + ["Offset of field: QUIC_BUFFER::Length"][::std::mem::offset_of!(QUIC_BUFFER, Length) - 0usize]; + ["Offset of field: QUIC_BUFFER::Buffer"][::std::mem::offset_of!(QUIC_BUFFER, Buffer) - 8usize]; +}; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct QUIC_NEW_CONNECTION_INFO { + pub QuicVersion: u32, + pub LocalAddress: *const QUIC_ADDR, + pub RemoteAddress: *const QUIC_ADDR, + pub CryptoBufferLength: u32, + pub ClientAlpnListLength: u16, + pub ServerNameLength: u16, + pub NegotiatedAlpnLength: u8, + pub CryptoBuffer: *const u8, + pub ClientAlpnList: *const u8, + pub NegotiatedAlpn: *const u8, + pub ServerName: *const ::std::os::raw::c_char, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of QUIC_NEW_CONNECTION_INFO"] + [::std::mem::size_of::() - 72usize]; + ["Alignment of QUIC_NEW_CONNECTION_INFO"] + [::std::mem::align_of::() - 8usize]; + ["Offset of field: QUIC_NEW_CONNECTION_INFO::QuicVersion"] + [::std::mem::offset_of!(QUIC_NEW_CONNECTION_INFO, QuicVersion) - 0usize]; + ["Offset of field: QUIC_NEW_CONNECTION_INFO::LocalAddress"] + [::std::mem::offset_of!(QUIC_NEW_CONNECTION_INFO, LocalAddress) - 8usize]; + ["Offset of field: QUIC_NEW_CONNECTION_INFO::RemoteAddress"] + [::std::mem::offset_of!(QUIC_NEW_CONNECTION_INFO, RemoteAddress) - 16usize]; + ["Offset of field: QUIC_NEW_CONNECTION_INFO::CryptoBufferLength"] + [::std::mem::offset_of!(QUIC_NEW_CONNECTION_INFO, CryptoBufferLength) - 24usize]; + ["Offset of field: QUIC_NEW_CONNECTION_INFO::ClientAlpnListLength"] + [::std::mem::offset_of!(QUIC_NEW_CONNECTION_INFO, ClientAlpnListLength) - 28usize]; + ["Offset of field: QUIC_NEW_CONNECTION_INFO::ServerNameLength"] + [::std::mem::offset_of!(QUIC_NEW_CONNECTION_INFO, ServerNameLength) - 30usize]; + ["Offset of field: QUIC_NEW_CONNECTION_INFO::NegotiatedAlpnLength"] + [::std::mem::offset_of!(QUIC_NEW_CONNECTION_INFO, NegotiatedAlpnLength) - 32usize]; + ["Offset of field: QUIC_NEW_CONNECTION_INFO::CryptoBuffer"] + [::std::mem::offset_of!(QUIC_NEW_CONNECTION_INFO, CryptoBuffer) - 40usize]; + ["Offset of field: QUIC_NEW_CONNECTION_INFO::ClientAlpnList"] + [::std::mem::offset_of!(QUIC_NEW_CONNECTION_INFO, ClientAlpnList) - 48usize]; + ["Offset of field: QUIC_NEW_CONNECTION_INFO::NegotiatedAlpn"] + [::std::mem::offset_of!(QUIC_NEW_CONNECTION_INFO, NegotiatedAlpn) - 56usize]; + ["Offset of field: QUIC_NEW_CONNECTION_INFO::ServerName"] + [::std::mem::offset_of!(QUIC_NEW_CONNECTION_INFO, ServerName) - 64usize]; +}; +pub const QUIC_TLS_PROTOCOL_VERSION_QUIC_TLS_PROTOCOL_UNKNOWN: QUIC_TLS_PROTOCOL_VERSION = 0; +pub const QUIC_TLS_PROTOCOL_VERSION_QUIC_TLS_PROTOCOL_1_3: QUIC_TLS_PROTOCOL_VERSION = 12288; +pub type QUIC_TLS_PROTOCOL_VERSION = ::std::os::raw::c_int; +pub const QUIC_CIPHER_ALGORITHM_QUIC_CIPHER_ALGORITHM_NONE: QUIC_CIPHER_ALGORITHM = 0; +pub const QUIC_CIPHER_ALGORITHM_QUIC_CIPHER_ALGORITHM_AES_128: QUIC_CIPHER_ALGORITHM = 26126; +pub const QUIC_CIPHER_ALGORITHM_QUIC_CIPHER_ALGORITHM_AES_256: QUIC_CIPHER_ALGORITHM = 26128; +pub const QUIC_CIPHER_ALGORITHM_QUIC_CIPHER_ALGORITHM_CHACHA20: QUIC_CIPHER_ALGORITHM = 26130; +pub type QUIC_CIPHER_ALGORITHM = ::std::os::raw::c_int; +pub const QUIC_HASH_ALGORITHM_QUIC_HASH_ALGORITHM_NONE: QUIC_HASH_ALGORITHM = 0; +pub const QUIC_HASH_ALGORITHM_QUIC_HASH_ALGORITHM_SHA_256: QUIC_HASH_ALGORITHM = 32780; +pub const QUIC_HASH_ALGORITHM_QUIC_HASH_ALGORITHM_SHA_384: QUIC_HASH_ALGORITHM = 32781; +pub type QUIC_HASH_ALGORITHM = ::std::os::raw::c_int; +pub const QUIC_KEY_EXCHANGE_ALGORITHM_QUIC_KEY_EXCHANGE_ALGORITHM_NONE: + QUIC_KEY_EXCHANGE_ALGORITHM = 0; +pub type QUIC_KEY_EXCHANGE_ALGORITHM = ::std::os::raw::c_int; +pub const QUIC_CIPHER_SUITE_QUIC_CIPHER_SUITE_TLS_AES_128_GCM_SHA256: QUIC_CIPHER_SUITE = 4865; +pub const QUIC_CIPHER_SUITE_QUIC_CIPHER_SUITE_TLS_AES_256_GCM_SHA384: QUIC_CIPHER_SUITE = 4866; +pub const QUIC_CIPHER_SUITE_QUIC_CIPHER_SUITE_TLS_CHACHA20_POLY1305_SHA256: QUIC_CIPHER_SUITE = + 4867; +pub type QUIC_CIPHER_SUITE = ::std::os::raw::c_int; +pub const QUIC_CONGESTION_CONTROL_ALGORITHM_QUIC_CONGESTION_CONTROL_ALGORITHM_CUBIC: + QUIC_CONGESTION_CONTROL_ALGORITHM = 0; +pub const QUIC_CONGESTION_CONTROL_ALGORITHM_QUIC_CONGESTION_CONTROL_ALGORITHM_MAX: + QUIC_CONGESTION_CONTROL_ALGORITHM = 1; +pub type QUIC_CONGESTION_CONTROL_ALGORITHM = ::std::os::raw::c_int; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct QUIC_HANDSHAKE_INFO { + pub TlsProtocolVersion: QUIC_TLS_PROTOCOL_VERSION, + pub CipherAlgorithm: QUIC_CIPHER_ALGORITHM, + pub CipherStrength: i32, + pub Hash: QUIC_HASH_ALGORITHM, + pub HashStrength: i32, + pub KeyExchangeAlgorithm: QUIC_KEY_EXCHANGE_ALGORITHM, + pub KeyExchangeStrength: i32, + pub CipherSuite: QUIC_CIPHER_SUITE, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of QUIC_HANDSHAKE_INFO"][::std::mem::size_of::() - 32usize]; + ["Alignment of QUIC_HANDSHAKE_INFO"][::std::mem::align_of::() - 4usize]; + ["Offset of field: QUIC_HANDSHAKE_INFO::TlsProtocolVersion"] + [::std::mem::offset_of!(QUIC_HANDSHAKE_INFO, TlsProtocolVersion) - 0usize]; + ["Offset of field: QUIC_HANDSHAKE_INFO::CipherAlgorithm"] + [::std::mem::offset_of!(QUIC_HANDSHAKE_INFO, CipherAlgorithm) - 4usize]; + ["Offset of field: QUIC_HANDSHAKE_INFO::CipherStrength"] + [::std::mem::offset_of!(QUIC_HANDSHAKE_INFO, CipherStrength) - 8usize]; + ["Offset of field: QUIC_HANDSHAKE_INFO::Hash"] + [::std::mem::offset_of!(QUIC_HANDSHAKE_INFO, Hash) - 12usize]; + ["Offset of field: QUIC_HANDSHAKE_INFO::HashStrength"] + [::std::mem::offset_of!(QUIC_HANDSHAKE_INFO, HashStrength) - 16usize]; + ["Offset of field: QUIC_HANDSHAKE_INFO::KeyExchangeAlgorithm"] + [::std::mem::offset_of!(QUIC_HANDSHAKE_INFO, KeyExchangeAlgorithm) - 20usize]; + ["Offset of field: QUIC_HANDSHAKE_INFO::KeyExchangeStrength"] + [::std::mem::offset_of!(QUIC_HANDSHAKE_INFO, KeyExchangeStrength) - 24usize]; + ["Offset of field: QUIC_HANDSHAKE_INFO::CipherSuite"] + [::std::mem::offset_of!(QUIC_HANDSHAKE_INFO, CipherSuite) - 28usize]; +}; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct QUIC_STATISTICS { + pub CorrelationId: u64, + pub _bitfield_align_1: [u8; 0], + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize]>, + pub Rtt: u32, + pub MinRtt: u32, + pub MaxRtt: u32, + pub Timing: QUIC_STATISTICS__bindgen_ty_1, + pub Handshake: QUIC_STATISTICS__bindgen_ty_2, + pub Send: QUIC_STATISTICS__bindgen_ty_3, + pub Recv: QUIC_STATISTICS__bindgen_ty_4, + pub Misc: QUIC_STATISTICS__bindgen_ty_5, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct QUIC_STATISTICS__bindgen_ty_1 { + pub Start: u64, + pub InitialFlightEnd: u64, + pub HandshakeFlightEnd: u64, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of QUIC_STATISTICS__bindgen_ty_1"] + [::std::mem::size_of::() - 24usize]; + ["Alignment of QUIC_STATISTICS__bindgen_ty_1"] + [::std::mem::align_of::() - 8usize]; + ["Offset of field: QUIC_STATISTICS__bindgen_ty_1::Start"] + [::std::mem::offset_of!(QUIC_STATISTICS__bindgen_ty_1, Start) - 0usize]; + ["Offset of field: QUIC_STATISTICS__bindgen_ty_1::InitialFlightEnd"] + [::std::mem::offset_of!(QUIC_STATISTICS__bindgen_ty_1, InitialFlightEnd) - 8usize]; + ["Offset of field: QUIC_STATISTICS__bindgen_ty_1::HandshakeFlightEnd"] + [::std::mem::offset_of!(QUIC_STATISTICS__bindgen_ty_1, HandshakeFlightEnd) - 16usize]; +}; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct QUIC_STATISTICS__bindgen_ty_2 { + pub ClientFlight1Bytes: u32, + pub ServerFlight1Bytes: u32, + pub ClientFlight2Bytes: u32, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of QUIC_STATISTICS__bindgen_ty_2"] + [::std::mem::size_of::() - 12usize]; + ["Alignment of QUIC_STATISTICS__bindgen_ty_2"] + [::std::mem::align_of::() - 4usize]; + ["Offset of field: QUIC_STATISTICS__bindgen_ty_2::ClientFlight1Bytes"] + [::std::mem::offset_of!(QUIC_STATISTICS__bindgen_ty_2, ClientFlight1Bytes) - 0usize]; + ["Offset of field: QUIC_STATISTICS__bindgen_ty_2::ServerFlight1Bytes"] + [::std::mem::offset_of!(QUIC_STATISTICS__bindgen_ty_2, ServerFlight1Bytes) - 4usize]; + ["Offset of field: QUIC_STATISTICS__bindgen_ty_2::ClientFlight2Bytes"] + [::std::mem::offset_of!(QUIC_STATISTICS__bindgen_ty_2, ClientFlight2Bytes) - 8usize]; +}; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct QUIC_STATISTICS__bindgen_ty_3 { + pub PathMtu: u16, + pub TotalPackets: u64, + pub RetransmittablePackets: u64, + pub SuspectedLostPackets: u64, + pub SpuriousLostPackets: u64, + pub TotalBytes: u64, + pub TotalStreamBytes: u64, + pub CongestionCount: u32, + pub PersistentCongestionCount: u32, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of QUIC_STATISTICS__bindgen_ty_3"] + [::std::mem::size_of::() - 64usize]; + ["Alignment of QUIC_STATISTICS__bindgen_ty_3"] + [::std::mem::align_of::() - 8usize]; + ["Offset of field: QUIC_STATISTICS__bindgen_ty_3::PathMtu"] + [::std::mem::offset_of!(QUIC_STATISTICS__bindgen_ty_3, PathMtu) - 0usize]; + ["Offset of field: QUIC_STATISTICS__bindgen_ty_3::TotalPackets"] + [::std::mem::offset_of!(QUIC_STATISTICS__bindgen_ty_3, TotalPackets) - 8usize]; + ["Offset of field: QUIC_STATISTICS__bindgen_ty_3::RetransmittablePackets"] + [::std::mem::offset_of!(QUIC_STATISTICS__bindgen_ty_3, RetransmittablePackets) - 16usize]; + ["Offset of field: QUIC_STATISTICS__bindgen_ty_3::SuspectedLostPackets"] + [::std::mem::offset_of!(QUIC_STATISTICS__bindgen_ty_3, SuspectedLostPackets) - 24usize]; + ["Offset of field: QUIC_STATISTICS__bindgen_ty_3::SpuriousLostPackets"] + [::std::mem::offset_of!(QUIC_STATISTICS__bindgen_ty_3, SpuriousLostPackets) - 32usize]; + ["Offset of field: QUIC_STATISTICS__bindgen_ty_3::TotalBytes"] + [::std::mem::offset_of!(QUIC_STATISTICS__bindgen_ty_3, TotalBytes) - 40usize]; + ["Offset of field: QUIC_STATISTICS__bindgen_ty_3::TotalStreamBytes"] + [::std::mem::offset_of!(QUIC_STATISTICS__bindgen_ty_3, TotalStreamBytes) - 48usize]; + ["Offset of field: QUIC_STATISTICS__bindgen_ty_3::CongestionCount"] + [::std::mem::offset_of!(QUIC_STATISTICS__bindgen_ty_3, CongestionCount) - 56usize]; + ["Offset of field: QUIC_STATISTICS__bindgen_ty_3::PersistentCongestionCount"][::std::mem::offset_of!( + QUIC_STATISTICS__bindgen_ty_3, + PersistentCongestionCount + ) - 60usize]; +}; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct QUIC_STATISTICS__bindgen_ty_4 { + pub TotalPackets: u64, + pub ReorderedPackets: u64, + pub DroppedPackets: u64, + pub DuplicatePackets: u64, + pub TotalBytes: u64, + pub TotalStreamBytes: u64, + pub DecryptionFailures: u64, + pub ValidAckFrames: u64, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of QUIC_STATISTICS__bindgen_ty_4"] + [::std::mem::size_of::() - 64usize]; + ["Alignment of QUIC_STATISTICS__bindgen_ty_4"] + [::std::mem::align_of::() - 8usize]; + ["Offset of field: QUIC_STATISTICS__bindgen_ty_4::TotalPackets"] + [::std::mem::offset_of!(QUIC_STATISTICS__bindgen_ty_4, TotalPackets) - 0usize]; + ["Offset of field: QUIC_STATISTICS__bindgen_ty_4::ReorderedPackets"] + [::std::mem::offset_of!(QUIC_STATISTICS__bindgen_ty_4, ReorderedPackets) - 8usize]; + ["Offset of field: QUIC_STATISTICS__bindgen_ty_4::DroppedPackets"] + [::std::mem::offset_of!(QUIC_STATISTICS__bindgen_ty_4, DroppedPackets) - 16usize]; + ["Offset of field: QUIC_STATISTICS__bindgen_ty_4::DuplicatePackets"] + [::std::mem::offset_of!(QUIC_STATISTICS__bindgen_ty_4, DuplicatePackets) - 24usize]; + ["Offset of field: QUIC_STATISTICS__bindgen_ty_4::TotalBytes"] + [::std::mem::offset_of!(QUIC_STATISTICS__bindgen_ty_4, TotalBytes) - 32usize]; + ["Offset of field: QUIC_STATISTICS__bindgen_ty_4::TotalStreamBytes"] + [::std::mem::offset_of!(QUIC_STATISTICS__bindgen_ty_4, TotalStreamBytes) - 40usize]; + ["Offset of field: QUIC_STATISTICS__bindgen_ty_4::DecryptionFailures"] + [::std::mem::offset_of!(QUIC_STATISTICS__bindgen_ty_4, DecryptionFailures) - 48usize]; + ["Offset of field: QUIC_STATISTICS__bindgen_ty_4::ValidAckFrames"] + [::std::mem::offset_of!(QUIC_STATISTICS__bindgen_ty_4, ValidAckFrames) - 56usize]; +}; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct QUIC_STATISTICS__bindgen_ty_5 { + pub KeyUpdateCount: u32, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of QUIC_STATISTICS__bindgen_ty_5"] + [::std::mem::size_of::() - 4usize]; + ["Alignment of QUIC_STATISTICS__bindgen_ty_5"] + [::std::mem::align_of::() - 4usize]; + ["Offset of field: QUIC_STATISTICS__bindgen_ty_5::KeyUpdateCount"] + [::std::mem::offset_of!(QUIC_STATISTICS__bindgen_ty_5, KeyUpdateCount) - 0usize]; +}; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of QUIC_STATISTICS"][::std::mem::size_of::() - 200usize]; + ["Alignment of QUIC_STATISTICS"][::std::mem::align_of::() - 8usize]; + ["Offset of field: QUIC_STATISTICS::CorrelationId"] + [::std::mem::offset_of!(QUIC_STATISTICS, CorrelationId) - 0usize]; + ["Offset of field: QUIC_STATISTICS::Rtt"] + [::std::mem::offset_of!(QUIC_STATISTICS, Rtt) - 12usize]; + ["Offset of field: QUIC_STATISTICS::MinRtt"] + [::std::mem::offset_of!(QUIC_STATISTICS, MinRtt) - 16usize]; + ["Offset of field: QUIC_STATISTICS::MaxRtt"] + [::std::mem::offset_of!(QUIC_STATISTICS, MaxRtt) - 20usize]; + ["Offset of field: QUIC_STATISTICS::Timing"] + [::std::mem::offset_of!(QUIC_STATISTICS, Timing) - 24usize]; + ["Offset of field: QUIC_STATISTICS::Handshake"] + [::std::mem::offset_of!(QUIC_STATISTICS, Handshake) - 48usize]; + ["Offset of field: QUIC_STATISTICS::Send"] + [::std::mem::offset_of!(QUIC_STATISTICS, Send) - 64usize]; + ["Offset of field: QUIC_STATISTICS::Recv"] + [::std::mem::offset_of!(QUIC_STATISTICS, Recv) - 128usize]; + ["Offset of field: QUIC_STATISTICS::Misc"] + [::std::mem::offset_of!(QUIC_STATISTICS, Misc) - 192usize]; +}; +impl QUIC_STATISTICS { + #[inline] + pub fn VersionNegotiation(&self) -> u32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u32) } + } + #[inline] + pub fn set_VersionNegotiation(&mut self, val: u32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn VersionNegotiation_raw(this: *const Self) -> u32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 0usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_VersionNegotiation_raw(this: *mut Self, val: u32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 0usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn StatelessRetry(&self) -> u32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u32) } + } + #[inline] + pub fn set_StatelessRetry(&mut self, val: u32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(1usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn StatelessRetry_raw(this: *const Self) -> u32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 1usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_StatelessRetry_raw(this: *mut Self, val: u32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 1usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn ResumptionAttempted(&self) -> u32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(2usize, 1u8) as u32) } + } + #[inline] + pub fn set_ResumptionAttempted(&mut self, val: u32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(2usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn ResumptionAttempted_raw(this: *const Self) -> u32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 2usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_ResumptionAttempted_raw(this: *mut Self, val: u32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 2usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn ResumptionSucceeded(&self) -> u32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(3usize, 1u8) as u32) } + } + #[inline] + pub fn set_ResumptionSucceeded(&mut self, val: u32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(3usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn ResumptionSucceeded_raw(this: *const Self) -> u32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 3usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_ResumptionSucceeded_raw(this: *mut Self, val: u32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 3usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn new_bitfield_1( + VersionNegotiation: u32, + StatelessRetry: u32, + ResumptionAttempted: u32, + ResumptionSucceeded: u32, + ) -> __BindgenBitfieldUnit<[u8; 1usize]> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize]> = Default::default(); + __bindgen_bitfield_unit.set(0usize, 1u8, { + let VersionNegotiation: u32 = unsafe { ::std::mem::transmute(VersionNegotiation) }; + VersionNegotiation as u64 + }); + __bindgen_bitfield_unit.set(1usize, 1u8, { + let StatelessRetry: u32 = unsafe { ::std::mem::transmute(StatelessRetry) }; + StatelessRetry as u64 + }); + __bindgen_bitfield_unit.set(2usize, 1u8, { + let ResumptionAttempted: u32 = unsafe { ::std::mem::transmute(ResumptionAttempted) }; + ResumptionAttempted as u64 + }); + __bindgen_bitfield_unit.set(3usize, 1u8, { + let ResumptionSucceeded: u32 = unsafe { ::std::mem::transmute(ResumptionSucceeded) }; + ResumptionSucceeded as u64 + }); + __bindgen_bitfield_unit + } +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct QUIC_STATISTICS_V2 { + pub CorrelationId: u64, + pub _bitfield_align_1: [u32; 0], + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize]>, + pub Rtt: u32, + pub MinRtt: u32, + pub MaxRtt: u32, + pub TimingStart: u64, + pub TimingInitialFlightEnd: u64, + pub TimingHandshakeFlightEnd: u64, + pub HandshakeClientFlight1Bytes: u32, + pub HandshakeServerFlight1Bytes: u32, + pub HandshakeClientFlight2Bytes: u32, + pub SendPathMtu: u16, + pub SendTotalPackets: u64, + pub SendRetransmittablePackets: u64, + pub SendSuspectedLostPackets: u64, + pub SendSpuriousLostPackets: u64, + pub SendTotalBytes: u64, + pub SendTotalStreamBytes: u64, + pub SendCongestionCount: u32, + pub SendPersistentCongestionCount: u32, + pub RecvTotalPackets: u64, + pub RecvReorderedPackets: u64, + pub RecvDroppedPackets: u64, + pub RecvDuplicatePackets: u64, + pub RecvTotalBytes: u64, + pub RecvTotalStreamBytes: u64, + pub RecvDecryptionFailures: u64, + pub RecvValidAckFrames: u64, + pub KeyUpdateCount: u32, + pub SendCongestionWindow: u32, + pub DestCidUpdateCount: u32, + pub SendEcnCongestionCount: u32, + pub HandshakeHopLimitTTL: u8, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of QUIC_STATISTICS_V2"][::std::mem::size_of::() - 208usize]; + ["Alignment of QUIC_STATISTICS_V2"][::std::mem::align_of::() - 8usize]; + ["Offset of field: QUIC_STATISTICS_V2::CorrelationId"] + [::std::mem::offset_of!(QUIC_STATISTICS_V2, CorrelationId) - 0usize]; + ["Offset of field: QUIC_STATISTICS_V2::Rtt"] + [::std::mem::offset_of!(QUIC_STATISTICS_V2, Rtt) - 12usize]; + ["Offset of field: QUIC_STATISTICS_V2::MinRtt"] + [::std::mem::offset_of!(QUIC_STATISTICS_V2, MinRtt) - 16usize]; + ["Offset of field: QUIC_STATISTICS_V2::MaxRtt"] + [::std::mem::offset_of!(QUIC_STATISTICS_V2, MaxRtt) - 20usize]; + ["Offset of field: QUIC_STATISTICS_V2::TimingStart"] + [::std::mem::offset_of!(QUIC_STATISTICS_V2, TimingStart) - 24usize]; + ["Offset of field: QUIC_STATISTICS_V2::TimingInitialFlightEnd"] + [::std::mem::offset_of!(QUIC_STATISTICS_V2, TimingInitialFlightEnd) - 32usize]; + ["Offset of field: QUIC_STATISTICS_V2::TimingHandshakeFlightEnd"] + [::std::mem::offset_of!(QUIC_STATISTICS_V2, TimingHandshakeFlightEnd) - 40usize]; + ["Offset of field: QUIC_STATISTICS_V2::HandshakeClientFlight1Bytes"] + [::std::mem::offset_of!(QUIC_STATISTICS_V2, HandshakeClientFlight1Bytes) - 48usize]; + ["Offset of field: QUIC_STATISTICS_V2::HandshakeServerFlight1Bytes"] + [::std::mem::offset_of!(QUIC_STATISTICS_V2, HandshakeServerFlight1Bytes) - 52usize]; + ["Offset of field: QUIC_STATISTICS_V2::HandshakeClientFlight2Bytes"] + [::std::mem::offset_of!(QUIC_STATISTICS_V2, HandshakeClientFlight2Bytes) - 56usize]; + ["Offset of field: QUIC_STATISTICS_V2::SendPathMtu"] + [::std::mem::offset_of!(QUIC_STATISTICS_V2, SendPathMtu) - 60usize]; + ["Offset of field: QUIC_STATISTICS_V2::SendTotalPackets"] + [::std::mem::offset_of!(QUIC_STATISTICS_V2, SendTotalPackets) - 64usize]; + ["Offset of field: QUIC_STATISTICS_V2::SendRetransmittablePackets"] + [::std::mem::offset_of!(QUIC_STATISTICS_V2, SendRetransmittablePackets) - 72usize]; + ["Offset of field: QUIC_STATISTICS_V2::SendSuspectedLostPackets"] + [::std::mem::offset_of!(QUIC_STATISTICS_V2, SendSuspectedLostPackets) - 80usize]; + ["Offset of field: QUIC_STATISTICS_V2::SendSpuriousLostPackets"] + [::std::mem::offset_of!(QUIC_STATISTICS_V2, SendSpuriousLostPackets) - 88usize]; + ["Offset of field: QUIC_STATISTICS_V2::SendTotalBytes"] + [::std::mem::offset_of!(QUIC_STATISTICS_V2, SendTotalBytes) - 96usize]; + ["Offset of field: QUIC_STATISTICS_V2::SendTotalStreamBytes"] + [::std::mem::offset_of!(QUIC_STATISTICS_V2, SendTotalStreamBytes) - 104usize]; + ["Offset of field: QUIC_STATISTICS_V2::SendCongestionCount"] + [::std::mem::offset_of!(QUIC_STATISTICS_V2, SendCongestionCount) - 112usize]; + ["Offset of field: QUIC_STATISTICS_V2::SendPersistentCongestionCount"] + [::std::mem::offset_of!(QUIC_STATISTICS_V2, SendPersistentCongestionCount) - 116usize]; + ["Offset of field: QUIC_STATISTICS_V2::RecvTotalPackets"] + [::std::mem::offset_of!(QUIC_STATISTICS_V2, RecvTotalPackets) - 120usize]; + ["Offset of field: QUIC_STATISTICS_V2::RecvReorderedPackets"] + [::std::mem::offset_of!(QUIC_STATISTICS_V2, RecvReorderedPackets) - 128usize]; + ["Offset of field: QUIC_STATISTICS_V2::RecvDroppedPackets"] + [::std::mem::offset_of!(QUIC_STATISTICS_V2, RecvDroppedPackets) - 136usize]; + ["Offset of field: QUIC_STATISTICS_V2::RecvDuplicatePackets"] + [::std::mem::offset_of!(QUIC_STATISTICS_V2, RecvDuplicatePackets) - 144usize]; + ["Offset of field: QUIC_STATISTICS_V2::RecvTotalBytes"] + [::std::mem::offset_of!(QUIC_STATISTICS_V2, RecvTotalBytes) - 152usize]; + ["Offset of field: QUIC_STATISTICS_V2::RecvTotalStreamBytes"] + [::std::mem::offset_of!(QUIC_STATISTICS_V2, RecvTotalStreamBytes) - 160usize]; + ["Offset of field: QUIC_STATISTICS_V2::RecvDecryptionFailures"] + [::std::mem::offset_of!(QUIC_STATISTICS_V2, RecvDecryptionFailures) - 168usize]; + ["Offset of field: QUIC_STATISTICS_V2::RecvValidAckFrames"] + [::std::mem::offset_of!(QUIC_STATISTICS_V2, RecvValidAckFrames) - 176usize]; + ["Offset of field: QUIC_STATISTICS_V2::KeyUpdateCount"] + [::std::mem::offset_of!(QUIC_STATISTICS_V2, KeyUpdateCount) - 184usize]; + ["Offset of field: QUIC_STATISTICS_V2::SendCongestionWindow"] + [::std::mem::offset_of!(QUIC_STATISTICS_V2, SendCongestionWindow) - 188usize]; + ["Offset of field: QUIC_STATISTICS_V2::DestCidUpdateCount"] + [::std::mem::offset_of!(QUIC_STATISTICS_V2, DestCidUpdateCount) - 192usize]; + ["Offset of field: QUIC_STATISTICS_V2::SendEcnCongestionCount"] + [::std::mem::offset_of!(QUIC_STATISTICS_V2, SendEcnCongestionCount) - 196usize]; + ["Offset of field: QUIC_STATISTICS_V2::HandshakeHopLimitTTL"] + [::std::mem::offset_of!(QUIC_STATISTICS_V2, HandshakeHopLimitTTL) - 200usize]; +}; +impl QUIC_STATISTICS_V2 { + #[inline] + pub fn VersionNegotiation(&self) -> u32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u32) } + } + #[inline] + pub fn set_VersionNegotiation(&mut self, val: u32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn VersionNegotiation_raw(this: *const Self) -> u32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 0usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_VersionNegotiation_raw(this: *mut Self, val: u32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 0usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn StatelessRetry(&self) -> u32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u32) } + } + #[inline] + pub fn set_StatelessRetry(&mut self, val: u32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(1usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn StatelessRetry_raw(this: *const Self) -> u32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 1usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_StatelessRetry_raw(this: *mut Self, val: u32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 1usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn ResumptionAttempted(&self) -> u32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(2usize, 1u8) as u32) } + } + #[inline] + pub fn set_ResumptionAttempted(&mut self, val: u32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(2usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn ResumptionAttempted_raw(this: *const Self) -> u32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 2usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_ResumptionAttempted_raw(this: *mut Self, val: u32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 2usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn ResumptionSucceeded(&self) -> u32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(3usize, 1u8) as u32) } + } + #[inline] + pub fn set_ResumptionSucceeded(&mut self, val: u32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(3usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn ResumptionSucceeded_raw(this: *const Self) -> u32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 3usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_ResumptionSucceeded_raw(this: *mut Self, val: u32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 3usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn GreaseBitNegotiated(&self) -> u32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(4usize, 1u8) as u32) } + } + #[inline] + pub fn set_GreaseBitNegotiated(&mut self, val: u32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(4usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn GreaseBitNegotiated_raw(this: *const Self) -> u32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 4usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_GreaseBitNegotiated_raw(this: *mut Self, val: u32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 4usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn EcnCapable(&self) -> u32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(5usize, 1u8) as u32) } + } + #[inline] + pub fn set_EcnCapable(&mut self, val: u32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(5usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn EcnCapable_raw(this: *const Self) -> u32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 5usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_EcnCapable_raw(this: *mut Self, val: u32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 5usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn EncryptionOffloaded(&self) -> u32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(6usize, 1u8) as u32) } + } + #[inline] + pub fn set_EncryptionOffloaded(&mut self, val: u32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(6usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn EncryptionOffloaded_raw(this: *const Self) -> u32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 6usize, + 1u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_EncryptionOffloaded_raw(this: *mut Self, val: u32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 6usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn RESERVED(&self) -> u32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(7usize, 25u8) as u32) } + } + #[inline] + pub fn set_RESERVED(&mut self, val: u32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(7usize, 25u8, val as u64) + } + } + #[inline] + pub unsafe fn RESERVED_raw(this: *const Self) -> u32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 7usize, + 25u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set_RESERVED_raw(this: *mut Self, val: u32) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 7usize, + 25u8, + val as u64, + ) + } + } + #[inline] + pub fn new_bitfield_1( + VersionNegotiation: u32, + StatelessRetry: u32, + ResumptionAttempted: u32, + ResumptionSucceeded: u32, + GreaseBitNegotiated: u32, + EcnCapable: u32, + EncryptionOffloaded: u32, + RESERVED: u32, + ) -> __BindgenBitfieldUnit<[u8; 4usize]> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize]> = Default::default(); + __bindgen_bitfield_unit.set(0usize, 1u8, { + let VersionNegotiation: u32 = unsafe { ::std::mem::transmute(VersionNegotiation) }; + VersionNegotiation as u64 + }); + __bindgen_bitfield_unit.set(1usize, 1u8, { + let StatelessRetry: u32 = unsafe { ::std::mem::transmute(StatelessRetry) }; + StatelessRetry as u64 + }); + __bindgen_bitfield_unit.set(2usize, 1u8, { + let ResumptionAttempted: u32 = unsafe { ::std::mem::transmute(ResumptionAttempted) }; + ResumptionAttempted as u64 + }); + __bindgen_bitfield_unit.set(3usize, 1u8, { + let ResumptionSucceeded: u32 = unsafe { ::std::mem::transmute(ResumptionSucceeded) }; + ResumptionSucceeded as u64 + }); + __bindgen_bitfield_unit.set(4usize, 1u8, { + let GreaseBitNegotiated: u32 = unsafe { ::std::mem::transmute(GreaseBitNegotiated) }; + GreaseBitNegotiated as u64 + }); + __bindgen_bitfield_unit.set(5usize, 1u8, { + let EcnCapable: u32 = unsafe { ::std::mem::transmute(EcnCapable) }; + EcnCapable as u64 + }); + __bindgen_bitfield_unit.set(6usize, 1u8, { + let EncryptionOffloaded: u32 = unsafe { ::std::mem::transmute(EncryptionOffloaded) }; + EncryptionOffloaded as u64 + }); + __bindgen_bitfield_unit.set(7usize, 25u8, { + let RESERVED: u32 = unsafe { ::std::mem::transmute(RESERVED) }; + RESERVED as u64 + }); + __bindgen_bitfield_unit + } +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct QUIC_LISTENER_STATISTICS { + pub TotalAcceptedConnections: u64, + pub TotalRejectedConnections: u64, + pub BindingRecvDroppedPackets: u64, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of QUIC_LISTENER_STATISTICS"] + [::std::mem::size_of::() - 24usize]; + ["Alignment of QUIC_LISTENER_STATISTICS"] + [::std::mem::align_of::() - 8usize]; + ["Offset of field: QUIC_LISTENER_STATISTICS::TotalAcceptedConnections"] + [::std::mem::offset_of!(QUIC_LISTENER_STATISTICS, TotalAcceptedConnections) - 0usize]; + ["Offset of field: QUIC_LISTENER_STATISTICS::TotalRejectedConnections"] + [::std::mem::offset_of!(QUIC_LISTENER_STATISTICS, TotalRejectedConnections) - 8usize]; + ["Offset of field: QUIC_LISTENER_STATISTICS::BindingRecvDroppedPackets"] + [::std::mem::offset_of!(QUIC_LISTENER_STATISTICS, BindingRecvDroppedPackets) - 16usize]; +}; +pub const QUIC_PERFORMANCE_COUNTERS_QUIC_PERF_COUNTER_CONN_CREATED: QUIC_PERFORMANCE_COUNTERS = 0; +pub const QUIC_PERFORMANCE_COUNTERS_QUIC_PERF_COUNTER_CONN_HANDSHAKE_FAIL: + QUIC_PERFORMANCE_COUNTERS = 1; +pub const QUIC_PERFORMANCE_COUNTERS_QUIC_PERF_COUNTER_CONN_APP_REJECT: QUIC_PERFORMANCE_COUNTERS = + 2; +pub const QUIC_PERFORMANCE_COUNTERS_QUIC_PERF_COUNTER_CONN_RESUMED: QUIC_PERFORMANCE_COUNTERS = 3; +pub const QUIC_PERFORMANCE_COUNTERS_QUIC_PERF_COUNTER_CONN_ACTIVE: QUIC_PERFORMANCE_COUNTERS = 4; +pub const QUIC_PERFORMANCE_COUNTERS_QUIC_PERF_COUNTER_CONN_CONNECTED: QUIC_PERFORMANCE_COUNTERS = 5; +pub const QUIC_PERFORMANCE_COUNTERS_QUIC_PERF_COUNTER_CONN_PROTOCOL_ERRORS: + QUIC_PERFORMANCE_COUNTERS = 6; +pub const QUIC_PERFORMANCE_COUNTERS_QUIC_PERF_COUNTER_CONN_NO_ALPN: QUIC_PERFORMANCE_COUNTERS = 7; +pub const QUIC_PERFORMANCE_COUNTERS_QUIC_PERF_COUNTER_STRM_ACTIVE: QUIC_PERFORMANCE_COUNTERS = 8; +pub const QUIC_PERFORMANCE_COUNTERS_QUIC_PERF_COUNTER_PKTS_SUSPECTED_LOST: + QUIC_PERFORMANCE_COUNTERS = 9; +pub const QUIC_PERFORMANCE_COUNTERS_QUIC_PERF_COUNTER_PKTS_DROPPED: QUIC_PERFORMANCE_COUNTERS = 10; +pub const QUIC_PERFORMANCE_COUNTERS_QUIC_PERF_COUNTER_PKTS_DECRYPTION_FAIL: + QUIC_PERFORMANCE_COUNTERS = 11; +pub const QUIC_PERFORMANCE_COUNTERS_QUIC_PERF_COUNTER_UDP_RECV: QUIC_PERFORMANCE_COUNTERS = 12; +pub const QUIC_PERFORMANCE_COUNTERS_QUIC_PERF_COUNTER_UDP_SEND: QUIC_PERFORMANCE_COUNTERS = 13; +pub const QUIC_PERFORMANCE_COUNTERS_QUIC_PERF_COUNTER_UDP_RECV_BYTES: QUIC_PERFORMANCE_COUNTERS = + 14; +pub const QUIC_PERFORMANCE_COUNTERS_QUIC_PERF_COUNTER_UDP_SEND_BYTES: QUIC_PERFORMANCE_COUNTERS = + 15; +pub const QUIC_PERFORMANCE_COUNTERS_QUIC_PERF_COUNTER_UDP_RECV_EVENTS: QUIC_PERFORMANCE_COUNTERS = + 16; +pub const QUIC_PERFORMANCE_COUNTERS_QUIC_PERF_COUNTER_UDP_SEND_CALLS: QUIC_PERFORMANCE_COUNTERS = + 17; +pub const QUIC_PERFORMANCE_COUNTERS_QUIC_PERF_COUNTER_APP_SEND_BYTES: QUIC_PERFORMANCE_COUNTERS = + 18; +pub const QUIC_PERFORMANCE_COUNTERS_QUIC_PERF_COUNTER_APP_RECV_BYTES: QUIC_PERFORMANCE_COUNTERS = + 19; +pub const QUIC_PERFORMANCE_COUNTERS_QUIC_PERF_COUNTER_CONN_QUEUE_DEPTH: QUIC_PERFORMANCE_COUNTERS = + 20; +pub const QUIC_PERFORMANCE_COUNTERS_QUIC_PERF_COUNTER_CONN_OPER_QUEUE_DEPTH: + QUIC_PERFORMANCE_COUNTERS = 21; +pub const QUIC_PERFORMANCE_COUNTERS_QUIC_PERF_COUNTER_CONN_OPER_QUEUED: QUIC_PERFORMANCE_COUNTERS = + 22; +pub const QUIC_PERFORMANCE_COUNTERS_QUIC_PERF_COUNTER_CONN_OPER_COMPLETED: + QUIC_PERFORMANCE_COUNTERS = 23; +pub const QUIC_PERFORMANCE_COUNTERS_QUIC_PERF_COUNTER_WORK_OPER_QUEUE_DEPTH: + QUIC_PERFORMANCE_COUNTERS = 24; +pub const QUIC_PERFORMANCE_COUNTERS_QUIC_PERF_COUNTER_WORK_OPER_QUEUED: QUIC_PERFORMANCE_COUNTERS = + 25; +pub const QUIC_PERFORMANCE_COUNTERS_QUIC_PERF_COUNTER_WORK_OPER_COMPLETED: + QUIC_PERFORMANCE_COUNTERS = 26; +pub const QUIC_PERFORMANCE_COUNTERS_QUIC_PERF_COUNTER_PATH_VALIDATED: QUIC_PERFORMANCE_COUNTERS = + 27; +pub const QUIC_PERFORMANCE_COUNTERS_QUIC_PERF_COUNTER_PATH_FAILURE: QUIC_PERFORMANCE_COUNTERS = 28; +pub const QUIC_PERFORMANCE_COUNTERS_QUIC_PERF_COUNTER_SEND_STATELESS_RESET: + QUIC_PERFORMANCE_COUNTERS = 29; +pub const QUIC_PERFORMANCE_COUNTERS_QUIC_PERF_COUNTER_SEND_STATELESS_RETRY: + QUIC_PERFORMANCE_COUNTERS = 30; +pub const QUIC_PERFORMANCE_COUNTERS_QUIC_PERF_COUNTER_CONN_LOAD_REJECT: QUIC_PERFORMANCE_COUNTERS = + 31; +pub const QUIC_PERFORMANCE_COUNTERS_QUIC_PERF_COUNTER_MAX: QUIC_PERFORMANCE_COUNTERS = 32; +pub type QUIC_PERFORMANCE_COUNTERS = ::std::os::raw::c_int; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct QUIC_GLOBAL_SETTINGS { + pub __bindgen_anon_1: QUIC_GLOBAL_SETTINGS__bindgen_ty_1, + pub RetryMemoryLimit: u16, + pub LoadBalancingMode: u16, + pub FixedServerID: u32, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union QUIC_GLOBAL_SETTINGS__bindgen_ty_1 { + pub IsSetFlags: u64, + pub IsSet: QUIC_GLOBAL_SETTINGS__bindgen_ty_1__bindgen_ty_1, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct QUIC_GLOBAL_SETTINGS__bindgen_ty_1__bindgen_ty_1 { + pub _bitfield_align_1: [u64; 0], + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 8usize]>, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of QUIC_GLOBAL_SETTINGS__bindgen_ty_1__bindgen_ty_1"] + [::std::mem::size_of::() - 8usize]; + ["Alignment of QUIC_GLOBAL_SETTINGS__bindgen_ty_1__bindgen_ty_1"] + [::std::mem::align_of::() - 8usize]; +}; +impl QUIC_GLOBAL_SETTINGS__bindgen_ty_1__bindgen_ty_1 { + #[inline] + pub fn RetryMemoryLimit(&self) -> u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u64) } + } + #[inline] + pub fn set_RetryMemoryLimit(&mut self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn RetryMemoryLimit_raw(this: *const Self) -> u64 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 0usize, + 1u8, + ) as u64) + } + } + #[inline] + pub unsafe fn set_RetryMemoryLimit_raw(this: *mut Self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 8usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 0usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn LoadBalancingMode(&self) -> u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u64) } + } + #[inline] + pub fn set_LoadBalancingMode(&mut self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(1usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn LoadBalancingMode_raw(this: *const Self) -> u64 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 1usize, + 1u8, + ) as u64) + } + } + #[inline] + pub unsafe fn set_LoadBalancingMode_raw(this: *mut Self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 8usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 1usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn FixedServerID(&self) -> u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(2usize, 1u8) as u64) } + } + #[inline] + pub fn set_FixedServerID(&mut self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(2usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn FixedServerID_raw(this: *const Self) -> u64 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 2usize, + 1u8, + ) as u64) + } + } + #[inline] + pub unsafe fn set_FixedServerID_raw(this: *mut Self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 8usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 2usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn RESERVED(&self) -> u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(3usize, 61u8) as u64) } + } + #[inline] + pub fn set_RESERVED(&mut self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(3usize, 61u8, val as u64) + } + } + #[inline] + pub unsafe fn RESERVED_raw(this: *const Self) -> u64 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 3usize, + 61u8, + ) as u64) + } + } + #[inline] + pub unsafe fn set_RESERVED_raw(this: *mut Self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 8usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 3usize, + 61u8, + val as u64, + ) + } + } + #[inline] + pub fn new_bitfield_1( + RetryMemoryLimit: u64, + LoadBalancingMode: u64, + FixedServerID: u64, + RESERVED: u64, + ) -> __BindgenBitfieldUnit<[u8; 8usize]> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 8usize]> = Default::default(); + __bindgen_bitfield_unit.set(0usize, 1u8, { + let RetryMemoryLimit: u64 = unsafe { ::std::mem::transmute(RetryMemoryLimit) }; + RetryMemoryLimit as u64 + }); + __bindgen_bitfield_unit.set(1usize, 1u8, { + let LoadBalancingMode: u64 = unsafe { ::std::mem::transmute(LoadBalancingMode) }; + LoadBalancingMode as u64 + }); + __bindgen_bitfield_unit.set(2usize, 1u8, { + let FixedServerID: u64 = unsafe { ::std::mem::transmute(FixedServerID) }; + FixedServerID as u64 + }); + __bindgen_bitfield_unit.set(3usize, 61u8, { + let RESERVED: u64 = unsafe { ::std::mem::transmute(RESERVED) }; + RESERVED as u64 + }); + __bindgen_bitfield_unit + } +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of QUIC_GLOBAL_SETTINGS__bindgen_ty_1"] + [::std::mem::size_of::() - 8usize]; + ["Alignment of QUIC_GLOBAL_SETTINGS__bindgen_ty_1"] + [::std::mem::align_of::() - 8usize]; + ["Offset of field: QUIC_GLOBAL_SETTINGS__bindgen_ty_1::IsSetFlags"] + [::std::mem::offset_of!(QUIC_GLOBAL_SETTINGS__bindgen_ty_1, IsSetFlags) - 0usize]; + ["Offset of field: QUIC_GLOBAL_SETTINGS__bindgen_ty_1::IsSet"] + [::std::mem::offset_of!(QUIC_GLOBAL_SETTINGS__bindgen_ty_1, IsSet) - 0usize]; +}; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of QUIC_GLOBAL_SETTINGS"][::std::mem::size_of::() - 16usize]; + ["Alignment of QUIC_GLOBAL_SETTINGS"][::std::mem::align_of::() - 8usize]; + ["Offset of field: QUIC_GLOBAL_SETTINGS::RetryMemoryLimit"] + [::std::mem::offset_of!(QUIC_GLOBAL_SETTINGS, RetryMemoryLimit) - 8usize]; + ["Offset of field: QUIC_GLOBAL_SETTINGS::LoadBalancingMode"] + [::std::mem::offset_of!(QUIC_GLOBAL_SETTINGS, LoadBalancingMode) - 10usize]; + ["Offset of field: QUIC_GLOBAL_SETTINGS::FixedServerID"] + [::std::mem::offset_of!(QUIC_GLOBAL_SETTINGS, FixedServerID) - 12usize]; +}; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct QUIC_SETTINGS { + pub __bindgen_anon_1: QUIC_SETTINGS__bindgen_ty_1, + pub MaxBytesPerKey: u64, + pub HandshakeIdleTimeoutMs: u64, + pub IdleTimeoutMs: u64, + pub MtuDiscoverySearchCompleteTimeoutUs: u64, + pub TlsClientMaxSendBuffer: u32, + pub TlsServerMaxSendBuffer: u32, + pub StreamRecvWindowDefault: u32, + pub StreamRecvBufferDefault: u32, + pub ConnFlowControlWindow: u32, + pub MaxWorkerQueueDelayUs: u32, + pub MaxStatelessOperations: u32, + pub InitialWindowPackets: u32, + pub SendIdleTimeoutMs: u32, + pub InitialRttMs: u32, + pub MaxAckDelayMs: u32, + pub DisconnectTimeoutMs: u32, + pub KeepAliveIntervalMs: u32, + pub CongestionControlAlgorithm: u16, + pub PeerBidiStreamCount: u16, + pub PeerUnidiStreamCount: u16, + pub MaxBindingStatelessOperations: u16, + pub StatelessOperationExpirationMs: u16, + pub MinimumMtu: u16, + pub MaximumMtu: u16, + pub _bitfield_align_1: [u8; 0], + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize]>, + pub MaxOperationsPerDrain: u8, + pub MtuDiscoveryMissingProbeCount: u8, + pub DestCidUpdateIdleTimeoutMs: u32, + pub __bindgen_anon_2: QUIC_SETTINGS__bindgen_ty_2, + pub StreamRecvWindowBidiLocalDefault: u32, + pub StreamRecvWindowBidiRemoteDefault: u32, + pub StreamRecvWindowUnidiDefault: u32, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union QUIC_SETTINGS__bindgen_ty_1 { + pub IsSetFlags: u64, + pub IsSet: QUIC_SETTINGS__bindgen_ty_1__bindgen_ty_1, +} +#[repr(C)] +#[repr(align(8))] +#[derive(Debug, Copy, Clone)] +pub struct QUIC_SETTINGS__bindgen_ty_1__bindgen_ty_1 { + pub _bitfield_align_1: [u32; 0], + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 8usize]>, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of QUIC_SETTINGS__bindgen_ty_1__bindgen_ty_1"] + [::std::mem::size_of::() - 8usize]; + ["Alignment of QUIC_SETTINGS__bindgen_ty_1__bindgen_ty_1"] + [::std::mem::align_of::() - 8usize]; +}; +impl QUIC_SETTINGS__bindgen_ty_1__bindgen_ty_1 { + #[inline] + pub fn MaxBytesPerKey(&self) -> u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u64) } + } + #[inline] + pub fn set_MaxBytesPerKey(&mut self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn MaxBytesPerKey_raw(this: *const Self) -> u64 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 0usize, + 1u8, + ) as u64) + } + } + #[inline] + pub unsafe fn set_MaxBytesPerKey_raw(this: *mut Self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 8usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 0usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn HandshakeIdleTimeoutMs(&self) -> u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u64) } + } + #[inline] + pub fn set_HandshakeIdleTimeoutMs(&mut self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(1usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn HandshakeIdleTimeoutMs_raw(this: *const Self) -> u64 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 1usize, + 1u8, + ) as u64) + } + } + #[inline] + pub unsafe fn set_HandshakeIdleTimeoutMs_raw(this: *mut Self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 8usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 1usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn IdleTimeoutMs(&self) -> u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(2usize, 1u8) as u64) } + } + #[inline] + pub fn set_IdleTimeoutMs(&mut self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(2usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn IdleTimeoutMs_raw(this: *const Self) -> u64 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 2usize, + 1u8, + ) as u64) + } + } + #[inline] + pub unsafe fn set_IdleTimeoutMs_raw(this: *mut Self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 8usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 2usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn MtuDiscoverySearchCompleteTimeoutUs(&self) -> u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(3usize, 1u8) as u64) } + } + #[inline] + pub fn set_MtuDiscoverySearchCompleteTimeoutUs(&mut self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(3usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn MtuDiscoverySearchCompleteTimeoutUs_raw(this: *const Self) -> u64 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 3usize, + 1u8, + ) as u64) + } + } + #[inline] + pub unsafe fn set_MtuDiscoverySearchCompleteTimeoutUs_raw(this: *mut Self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 8usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 3usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn TlsClientMaxSendBuffer(&self) -> u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(4usize, 1u8) as u64) } + } + #[inline] + pub fn set_TlsClientMaxSendBuffer(&mut self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(4usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn TlsClientMaxSendBuffer_raw(this: *const Self) -> u64 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 4usize, + 1u8, + ) as u64) + } + } + #[inline] + pub unsafe fn set_TlsClientMaxSendBuffer_raw(this: *mut Self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 8usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 4usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn TlsServerMaxSendBuffer(&self) -> u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(5usize, 1u8) as u64) } + } + #[inline] + pub fn set_TlsServerMaxSendBuffer(&mut self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(5usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn TlsServerMaxSendBuffer_raw(this: *const Self) -> u64 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 5usize, + 1u8, + ) as u64) + } + } + #[inline] + pub unsafe fn set_TlsServerMaxSendBuffer_raw(this: *mut Self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 8usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 5usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn StreamRecvWindowDefault(&self) -> u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(6usize, 1u8) as u64) } + } + #[inline] + pub fn set_StreamRecvWindowDefault(&mut self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(6usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn StreamRecvWindowDefault_raw(this: *const Self) -> u64 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 6usize, + 1u8, + ) as u64) + } + } + #[inline] + pub unsafe fn set_StreamRecvWindowDefault_raw(this: *mut Self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 8usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 6usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn StreamRecvBufferDefault(&self) -> u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(7usize, 1u8) as u64) } + } + #[inline] + pub fn set_StreamRecvBufferDefault(&mut self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(7usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn StreamRecvBufferDefault_raw(this: *const Self) -> u64 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 7usize, + 1u8, + ) as u64) + } + } + #[inline] + pub unsafe fn set_StreamRecvBufferDefault_raw(this: *mut Self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 8usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 7usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn ConnFlowControlWindow(&self) -> u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(8usize, 1u8) as u64) } + } + #[inline] + pub fn set_ConnFlowControlWindow(&mut self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(8usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn ConnFlowControlWindow_raw(this: *const Self) -> u64 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 8usize, + 1u8, + ) as u64) + } + } + #[inline] + pub unsafe fn set_ConnFlowControlWindow_raw(this: *mut Self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 8usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 8usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn MaxWorkerQueueDelayUs(&self) -> u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(9usize, 1u8) as u64) } + } + #[inline] + pub fn set_MaxWorkerQueueDelayUs(&mut self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(9usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn MaxWorkerQueueDelayUs_raw(this: *const Self) -> u64 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 9usize, + 1u8, + ) as u64) + } + } + #[inline] + pub unsafe fn set_MaxWorkerQueueDelayUs_raw(this: *mut Self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 8usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 9usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn MaxStatelessOperations(&self) -> u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(10usize, 1u8) as u64) } + } + #[inline] + pub fn set_MaxStatelessOperations(&mut self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(10usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn MaxStatelessOperations_raw(this: *const Self) -> u64 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 10usize, + 1u8, + ) as u64) + } + } + #[inline] + pub unsafe fn set_MaxStatelessOperations_raw(this: *mut Self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 8usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 10usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn InitialWindowPackets(&self) -> u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(11usize, 1u8) as u64) } + } + #[inline] + pub fn set_InitialWindowPackets(&mut self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(11usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn InitialWindowPackets_raw(this: *const Self) -> u64 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 11usize, + 1u8, + ) as u64) + } + } + #[inline] + pub unsafe fn set_InitialWindowPackets_raw(this: *mut Self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 8usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 11usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn SendIdleTimeoutMs(&self) -> u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(12usize, 1u8) as u64) } + } + #[inline] + pub fn set_SendIdleTimeoutMs(&mut self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(12usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn SendIdleTimeoutMs_raw(this: *const Self) -> u64 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 12usize, + 1u8, + ) as u64) + } + } + #[inline] + pub unsafe fn set_SendIdleTimeoutMs_raw(this: *mut Self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 8usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 12usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn InitialRttMs(&self) -> u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(13usize, 1u8) as u64) } + } + #[inline] + pub fn set_InitialRttMs(&mut self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(13usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn InitialRttMs_raw(this: *const Self) -> u64 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 13usize, + 1u8, + ) as u64) + } + } + #[inline] + pub unsafe fn set_InitialRttMs_raw(this: *mut Self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 8usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 13usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn MaxAckDelayMs(&self) -> u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(14usize, 1u8) as u64) } + } + #[inline] + pub fn set_MaxAckDelayMs(&mut self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(14usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn MaxAckDelayMs_raw(this: *const Self) -> u64 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 14usize, + 1u8, + ) as u64) + } + } + #[inline] + pub unsafe fn set_MaxAckDelayMs_raw(this: *mut Self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 8usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 14usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn DisconnectTimeoutMs(&self) -> u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(15usize, 1u8) as u64) } + } + #[inline] + pub fn set_DisconnectTimeoutMs(&mut self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(15usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn DisconnectTimeoutMs_raw(this: *const Self) -> u64 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 15usize, + 1u8, + ) as u64) + } + } + #[inline] + pub unsafe fn set_DisconnectTimeoutMs_raw(this: *mut Self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 8usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 15usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn KeepAliveIntervalMs(&self) -> u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(16usize, 1u8) as u64) } + } + #[inline] + pub fn set_KeepAliveIntervalMs(&mut self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(16usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn KeepAliveIntervalMs_raw(this: *const Self) -> u64 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 16usize, + 1u8, + ) as u64) + } + } + #[inline] + pub unsafe fn set_KeepAliveIntervalMs_raw(this: *mut Self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 8usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 16usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn CongestionControlAlgorithm(&self) -> u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(17usize, 1u8) as u64) } + } + #[inline] + pub fn set_CongestionControlAlgorithm(&mut self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(17usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn CongestionControlAlgorithm_raw(this: *const Self) -> u64 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 17usize, + 1u8, + ) as u64) + } + } + #[inline] + pub unsafe fn set_CongestionControlAlgorithm_raw(this: *mut Self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 8usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 17usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn PeerBidiStreamCount(&self) -> u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(18usize, 1u8) as u64) } + } + #[inline] + pub fn set_PeerBidiStreamCount(&mut self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(18usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn PeerBidiStreamCount_raw(this: *const Self) -> u64 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 18usize, + 1u8, + ) as u64) + } + } + #[inline] + pub unsafe fn set_PeerBidiStreamCount_raw(this: *mut Self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 8usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 18usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn PeerUnidiStreamCount(&self) -> u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(19usize, 1u8) as u64) } + } + #[inline] + pub fn set_PeerUnidiStreamCount(&mut self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(19usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn PeerUnidiStreamCount_raw(this: *const Self) -> u64 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 19usize, + 1u8, + ) as u64) + } + } + #[inline] + pub unsafe fn set_PeerUnidiStreamCount_raw(this: *mut Self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 8usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 19usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn MaxBindingStatelessOperations(&self) -> u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(20usize, 1u8) as u64) } + } + #[inline] + pub fn set_MaxBindingStatelessOperations(&mut self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(20usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn MaxBindingStatelessOperations_raw(this: *const Self) -> u64 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 20usize, + 1u8, + ) as u64) + } + } + #[inline] + pub unsafe fn set_MaxBindingStatelessOperations_raw(this: *mut Self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 8usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 20usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn StatelessOperationExpirationMs(&self) -> u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(21usize, 1u8) as u64) } + } + #[inline] + pub fn set_StatelessOperationExpirationMs(&mut self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(21usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn StatelessOperationExpirationMs_raw(this: *const Self) -> u64 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 21usize, + 1u8, + ) as u64) + } + } + #[inline] + pub unsafe fn set_StatelessOperationExpirationMs_raw(this: *mut Self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 8usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 21usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn MinimumMtu(&self) -> u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(22usize, 1u8) as u64) } + } + #[inline] + pub fn set_MinimumMtu(&mut self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(22usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn MinimumMtu_raw(this: *const Self) -> u64 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 22usize, + 1u8, + ) as u64) + } + } + #[inline] + pub unsafe fn set_MinimumMtu_raw(this: *mut Self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 8usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 22usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn MaximumMtu(&self) -> u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(23usize, 1u8) as u64) } + } + #[inline] + pub fn set_MaximumMtu(&mut self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(23usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn MaximumMtu_raw(this: *const Self) -> u64 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 23usize, + 1u8, + ) as u64) + } + } + #[inline] + pub unsafe fn set_MaximumMtu_raw(this: *mut Self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 8usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 23usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn SendBufferingEnabled(&self) -> u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(24usize, 1u8) as u64) } + } + #[inline] + pub fn set_SendBufferingEnabled(&mut self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(24usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn SendBufferingEnabled_raw(this: *const Self) -> u64 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 24usize, + 1u8, + ) as u64) + } + } + #[inline] + pub unsafe fn set_SendBufferingEnabled_raw(this: *mut Self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 8usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 24usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn PacingEnabled(&self) -> u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(25usize, 1u8) as u64) } + } + #[inline] + pub fn set_PacingEnabled(&mut self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(25usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn PacingEnabled_raw(this: *const Self) -> u64 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 25usize, + 1u8, + ) as u64) + } + } + #[inline] + pub unsafe fn set_PacingEnabled_raw(this: *mut Self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 8usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 25usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn MigrationEnabled(&self) -> u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(26usize, 1u8) as u64) } + } + #[inline] + pub fn set_MigrationEnabled(&mut self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(26usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn MigrationEnabled_raw(this: *const Self) -> u64 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 26usize, + 1u8, + ) as u64) + } + } + #[inline] + pub unsafe fn set_MigrationEnabled_raw(this: *mut Self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 8usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 26usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn DatagramReceiveEnabled(&self) -> u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(27usize, 1u8) as u64) } + } + #[inline] + pub fn set_DatagramReceiveEnabled(&mut self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(27usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn DatagramReceiveEnabled_raw(this: *const Self) -> u64 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 27usize, + 1u8, + ) as u64) + } + } + #[inline] + pub unsafe fn set_DatagramReceiveEnabled_raw(this: *mut Self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 8usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 27usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn ServerResumptionLevel(&self) -> u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(28usize, 1u8) as u64) } + } + #[inline] + pub fn set_ServerResumptionLevel(&mut self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(28usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn ServerResumptionLevel_raw(this: *const Self) -> u64 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 28usize, + 1u8, + ) as u64) + } + } + #[inline] + pub unsafe fn set_ServerResumptionLevel_raw(this: *mut Self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 8usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 28usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn MaxOperationsPerDrain(&self) -> u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(29usize, 1u8) as u64) } + } + #[inline] + pub fn set_MaxOperationsPerDrain(&mut self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(29usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn MaxOperationsPerDrain_raw(this: *const Self) -> u64 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 29usize, + 1u8, + ) as u64) + } + } + #[inline] + pub unsafe fn set_MaxOperationsPerDrain_raw(this: *mut Self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 8usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 29usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn MtuDiscoveryMissingProbeCount(&self) -> u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(30usize, 1u8) as u64) } + } + #[inline] + pub fn set_MtuDiscoveryMissingProbeCount(&mut self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(30usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn MtuDiscoveryMissingProbeCount_raw(this: *const Self) -> u64 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 30usize, + 1u8, + ) as u64) + } + } + #[inline] + pub unsafe fn set_MtuDiscoveryMissingProbeCount_raw(this: *mut Self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 8usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 30usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn DestCidUpdateIdleTimeoutMs(&self) -> u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(31usize, 1u8) as u64) } + } + #[inline] + pub fn set_DestCidUpdateIdleTimeoutMs(&mut self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(31usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn DestCidUpdateIdleTimeoutMs_raw(this: *const Self) -> u64 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 31usize, + 1u8, + ) as u64) + } + } + #[inline] + pub unsafe fn set_DestCidUpdateIdleTimeoutMs_raw(this: *mut Self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 8usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 31usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn GreaseQuicBitEnabled(&self) -> u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(32usize, 1u8) as u64) } + } + #[inline] + pub fn set_GreaseQuicBitEnabled(&mut self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(32usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn GreaseQuicBitEnabled_raw(this: *const Self) -> u64 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 32usize, + 1u8, + ) as u64) + } + } + #[inline] + pub unsafe fn set_GreaseQuicBitEnabled_raw(this: *mut Self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 8usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 32usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn EcnEnabled(&self) -> u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(33usize, 1u8) as u64) } + } + #[inline] + pub fn set_EcnEnabled(&mut self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(33usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn EcnEnabled_raw(this: *const Self) -> u64 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 33usize, + 1u8, + ) as u64) + } + } + #[inline] + pub unsafe fn set_EcnEnabled_raw(this: *mut Self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 8usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 33usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn HyStartEnabled(&self) -> u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(34usize, 1u8) as u64) } + } + #[inline] + pub fn set_HyStartEnabled(&mut self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(34usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn HyStartEnabled_raw(this: *const Self) -> u64 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 34usize, + 1u8, + ) as u64) + } + } + #[inline] + pub unsafe fn set_HyStartEnabled_raw(this: *mut Self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 8usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 34usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn StreamRecvWindowBidiLocalDefault(&self) -> u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(35usize, 1u8) as u64) } + } + #[inline] + pub fn set_StreamRecvWindowBidiLocalDefault(&mut self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(35usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn StreamRecvWindowBidiLocalDefault_raw(this: *const Self) -> u64 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 35usize, + 1u8, + ) as u64) + } + } + #[inline] + pub unsafe fn set_StreamRecvWindowBidiLocalDefault_raw(this: *mut Self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 8usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 35usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn StreamRecvWindowBidiRemoteDefault(&self) -> u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(36usize, 1u8) as u64) } + } + #[inline] + pub fn set_StreamRecvWindowBidiRemoteDefault(&mut self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(36usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn StreamRecvWindowBidiRemoteDefault_raw(this: *const Self) -> u64 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 36usize, + 1u8, + ) as u64) + } + } + #[inline] + pub unsafe fn set_StreamRecvWindowBidiRemoteDefault_raw(this: *mut Self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 8usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 36usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn StreamRecvWindowUnidiDefault(&self) -> u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(37usize, 1u8) as u64) } + } + #[inline] + pub fn set_StreamRecvWindowUnidiDefault(&mut self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(37usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn StreamRecvWindowUnidiDefault_raw(this: *const Self) -> u64 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 37usize, + 1u8, + ) as u64) + } + } + #[inline] + pub unsafe fn set_StreamRecvWindowUnidiDefault_raw(this: *mut Self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 8usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 37usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn RESERVED(&self) -> u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(38usize, 26u8) as u64) } + } + #[inline] + pub fn set_RESERVED(&mut self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(38usize, 26u8, val as u64) + } + } + #[inline] + pub unsafe fn RESERVED_raw(this: *const Self) -> u64 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 38usize, + 26u8, + ) as u64) + } + } + #[inline] + pub unsafe fn set_RESERVED_raw(this: *mut Self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 8usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 38usize, + 26u8, + val as u64, + ) + } + } + #[inline] + pub fn new_bitfield_1( + MaxBytesPerKey: u64, + HandshakeIdleTimeoutMs: u64, + IdleTimeoutMs: u64, + MtuDiscoverySearchCompleteTimeoutUs: u64, + TlsClientMaxSendBuffer: u64, + TlsServerMaxSendBuffer: u64, + StreamRecvWindowDefault: u64, + StreamRecvBufferDefault: u64, + ConnFlowControlWindow: u64, + MaxWorkerQueueDelayUs: u64, + MaxStatelessOperations: u64, + InitialWindowPackets: u64, + SendIdleTimeoutMs: u64, + InitialRttMs: u64, + MaxAckDelayMs: u64, + DisconnectTimeoutMs: u64, + KeepAliveIntervalMs: u64, + CongestionControlAlgorithm: u64, + PeerBidiStreamCount: u64, + PeerUnidiStreamCount: u64, + MaxBindingStatelessOperations: u64, + StatelessOperationExpirationMs: u64, + MinimumMtu: u64, + MaximumMtu: u64, + SendBufferingEnabled: u64, + PacingEnabled: u64, + MigrationEnabled: u64, + DatagramReceiveEnabled: u64, + ServerResumptionLevel: u64, + MaxOperationsPerDrain: u64, + MtuDiscoveryMissingProbeCount: u64, + DestCidUpdateIdleTimeoutMs: u64, + GreaseQuicBitEnabled: u64, + EcnEnabled: u64, + HyStartEnabled: u64, + StreamRecvWindowBidiLocalDefault: u64, + StreamRecvWindowBidiRemoteDefault: u64, + StreamRecvWindowUnidiDefault: u64, + RESERVED: u64, + ) -> __BindgenBitfieldUnit<[u8; 8usize]> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 8usize]> = Default::default(); + __bindgen_bitfield_unit.set(0usize, 1u8, { + let MaxBytesPerKey: u64 = unsafe { ::std::mem::transmute(MaxBytesPerKey) }; + MaxBytesPerKey as u64 + }); + __bindgen_bitfield_unit.set(1usize, 1u8, { + let HandshakeIdleTimeoutMs: u64 = + unsafe { ::std::mem::transmute(HandshakeIdleTimeoutMs) }; + HandshakeIdleTimeoutMs as u64 + }); + __bindgen_bitfield_unit.set(2usize, 1u8, { + let IdleTimeoutMs: u64 = unsafe { ::std::mem::transmute(IdleTimeoutMs) }; + IdleTimeoutMs as u64 + }); + __bindgen_bitfield_unit.set(3usize, 1u8, { + let MtuDiscoverySearchCompleteTimeoutUs: u64 = + unsafe { ::std::mem::transmute(MtuDiscoverySearchCompleteTimeoutUs) }; + MtuDiscoverySearchCompleteTimeoutUs as u64 + }); + __bindgen_bitfield_unit.set(4usize, 1u8, { + let TlsClientMaxSendBuffer: u64 = + unsafe { ::std::mem::transmute(TlsClientMaxSendBuffer) }; + TlsClientMaxSendBuffer as u64 + }); + __bindgen_bitfield_unit.set(5usize, 1u8, { + let TlsServerMaxSendBuffer: u64 = + unsafe { ::std::mem::transmute(TlsServerMaxSendBuffer) }; + TlsServerMaxSendBuffer as u64 + }); + __bindgen_bitfield_unit.set(6usize, 1u8, { + let StreamRecvWindowDefault: u64 = + unsafe { ::std::mem::transmute(StreamRecvWindowDefault) }; + StreamRecvWindowDefault as u64 + }); + __bindgen_bitfield_unit.set(7usize, 1u8, { + let StreamRecvBufferDefault: u64 = + unsafe { ::std::mem::transmute(StreamRecvBufferDefault) }; + StreamRecvBufferDefault as u64 + }); + __bindgen_bitfield_unit.set(8usize, 1u8, { + let ConnFlowControlWindow: u64 = + unsafe { ::std::mem::transmute(ConnFlowControlWindow) }; + ConnFlowControlWindow as u64 + }); + __bindgen_bitfield_unit.set(9usize, 1u8, { + let MaxWorkerQueueDelayUs: u64 = + unsafe { ::std::mem::transmute(MaxWorkerQueueDelayUs) }; + MaxWorkerQueueDelayUs as u64 + }); + __bindgen_bitfield_unit.set(10usize, 1u8, { + let MaxStatelessOperations: u64 = + unsafe { ::std::mem::transmute(MaxStatelessOperations) }; + MaxStatelessOperations as u64 + }); + __bindgen_bitfield_unit.set(11usize, 1u8, { + let InitialWindowPackets: u64 = unsafe { ::std::mem::transmute(InitialWindowPackets) }; + InitialWindowPackets as u64 + }); + __bindgen_bitfield_unit.set(12usize, 1u8, { + let SendIdleTimeoutMs: u64 = unsafe { ::std::mem::transmute(SendIdleTimeoutMs) }; + SendIdleTimeoutMs as u64 + }); + __bindgen_bitfield_unit.set(13usize, 1u8, { + let InitialRttMs: u64 = unsafe { ::std::mem::transmute(InitialRttMs) }; + InitialRttMs as u64 + }); + __bindgen_bitfield_unit.set(14usize, 1u8, { + let MaxAckDelayMs: u64 = unsafe { ::std::mem::transmute(MaxAckDelayMs) }; + MaxAckDelayMs as u64 + }); + __bindgen_bitfield_unit.set(15usize, 1u8, { + let DisconnectTimeoutMs: u64 = unsafe { ::std::mem::transmute(DisconnectTimeoutMs) }; + DisconnectTimeoutMs as u64 + }); + __bindgen_bitfield_unit.set(16usize, 1u8, { + let KeepAliveIntervalMs: u64 = unsafe { ::std::mem::transmute(KeepAliveIntervalMs) }; + KeepAliveIntervalMs as u64 + }); + __bindgen_bitfield_unit.set(17usize, 1u8, { + let CongestionControlAlgorithm: u64 = + unsafe { ::std::mem::transmute(CongestionControlAlgorithm) }; + CongestionControlAlgorithm as u64 + }); + __bindgen_bitfield_unit.set(18usize, 1u8, { + let PeerBidiStreamCount: u64 = unsafe { ::std::mem::transmute(PeerBidiStreamCount) }; + PeerBidiStreamCount as u64 + }); + __bindgen_bitfield_unit.set(19usize, 1u8, { + let PeerUnidiStreamCount: u64 = unsafe { ::std::mem::transmute(PeerUnidiStreamCount) }; + PeerUnidiStreamCount as u64 + }); + __bindgen_bitfield_unit.set(20usize, 1u8, { + let MaxBindingStatelessOperations: u64 = + unsafe { ::std::mem::transmute(MaxBindingStatelessOperations) }; + MaxBindingStatelessOperations as u64 + }); + __bindgen_bitfield_unit.set(21usize, 1u8, { + let StatelessOperationExpirationMs: u64 = + unsafe { ::std::mem::transmute(StatelessOperationExpirationMs) }; + StatelessOperationExpirationMs as u64 + }); + __bindgen_bitfield_unit.set(22usize, 1u8, { + let MinimumMtu: u64 = unsafe { ::std::mem::transmute(MinimumMtu) }; + MinimumMtu as u64 + }); + __bindgen_bitfield_unit.set(23usize, 1u8, { + let MaximumMtu: u64 = unsafe { ::std::mem::transmute(MaximumMtu) }; + MaximumMtu as u64 + }); + __bindgen_bitfield_unit.set(24usize, 1u8, { + let SendBufferingEnabled: u64 = unsafe { ::std::mem::transmute(SendBufferingEnabled) }; + SendBufferingEnabled as u64 + }); + __bindgen_bitfield_unit.set(25usize, 1u8, { + let PacingEnabled: u64 = unsafe { ::std::mem::transmute(PacingEnabled) }; + PacingEnabled as u64 + }); + __bindgen_bitfield_unit.set(26usize, 1u8, { + let MigrationEnabled: u64 = unsafe { ::std::mem::transmute(MigrationEnabled) }; + MigrationEnabled as u64 + }); + __bindgen_bitfield_unit.set(27usize, 1u8, { + let DatagramReceiveEnabled: u64 = + unsafe { ::std::mem::transmute(DatagramReceiveEnabled) }; + DatagramReceiveEnabled as u64 + }); + __bindgen_bitfield_unit.set(28usize, 1u8, { + let ServerResumptionLevel: u64 = + unsafe { ::std::mem::transmute(ServerResumptionLevel) }; + ServerResumptionLevel as u64 + }); + __bindgen_bitfield_unit.set(29usize, 1u8, { + let MaxOperationsPerDrain: u64 = + unsafe { ::std::mem::transmute(MaxOperationsPerDrain) }; + MaxOperationsPerDrain as u64 + }); + __bindgen_bitfield_unit.set(30usize, 1u8, { + let MtuDiscoveryMissingProbeCount: u64 = + unsafe { ::std::mem::transmute(MtuDiscoveryMissingProbeCount) }; + MtuDiscoveryMissingProbeCount as u64 + }); + __bindgen_bitfield_unit.set(31usize, 1u8, { + let DestCidUpdateIdleTimeoutMs: u64 = + unsafe { ::std::mem::transmute(DestCidUpdateIdleTimeoutMs) }; + DestCidUpdateIdleTimeoutMs as u64 + }); + __bindgen_bitfield_unit.set(32usize, 1u8, { + let GreaseQuicBitEnabled: u64 = unsafe { ::std::mem::transmute(GreaseQuicBitEnabled) }; + GreaseQuicBitEnabled as u64 + }); + __bindgen_bitfield_unit.set(33usize, 1u8, { + let EcnEnabled: u64 = unsafe { ::std::mem::transmute(EcnEnabled) }; + EcnEnabled as u64 + }); + __bindgen_bitfield_unit.set(34usize, 1u8, { + let HyStartEnabled: u64 = unsafe { ::std::mem::transmute(HyStartEnabled) }; + HyStartEnabled as u64 + }); + __bindgen_bitfield_unit.set(35usize, 1u8, { + let StreamRecvWindowBidiLocalDefault: u64 = + unsafe { ::std::mem::transmute(StreamRecvWindowBidiLocalDefault) }; + StreamRecvWindowBidiLocalDefault as u64 + }); + __bindgen_bitfield_unit.set(36usize, 1u8, { + let StreamRecvWindowBidiRemoteDefault: u64 = + unsafe { ::std::mem::transmute(StreamRecvWindowBidiRemoteDefault) }; + StreamRecvWindowBidiRemoteDefault as u64 + }); + __bindgen_bitfield_unit.set(37usize, 1u8, { + let StreamRecvWindowUnidiDefault: u64 = + unsafe { ::std::mem::transmute(StreamRecvWindowUnidiDefault) }; + StreamRecvWindowUnidiDefault as u64 + }); + __bindgen_bitfield_unit.set(38usize, 26u8, { + let RESERVED: u64 = unsafe { ::std::mem::transmute(RESERVED) }; + RESERVED as u64 + }); + __bindgen_bitfield_unit + } +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of QUIC_SETTINGS__bindgen_ty_1"] + [::std::mem::size_of::() - 8usize]; + ["Alignment of QUIC_SETTINGS__bindgen_ty_1"] + [::std::mem::align_of::() - 8usize]; + ["Offset of field: QUIC_SETTINGS__bindgen_ty_1::IsSetFlags"] + [::std::mem::offset_of!(QUIC_SETTINGS__bindgen_ty_1, IsSetFlags) - 0usize]; + ["Offset of field: QUIC_SETTINGS__bindgen_ty_1::IsSet"] + [::std::mem::offset_of!(QUIC_SETTINGS__bindgen_ty_1, IsSet) - 0usize]; +}; +#[repr(C)] +#[derive(Copy, Clone)] +pub union QUIC_SETTINGS__bindgen_ty_2 { + pub Flags: u64, + pub __bindgen_anon_1: QUIC_SETTINGS__bindgen_ty_2__bindgen_ty_1, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct QUIC_SETTINGS__bindgen_ty_2__bindgen_ty_1 { + pub _bitfield_align_1: [u64; 0], + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 8usize]>, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of QUIC_SETTINGS__bindgen_ty_2__bindgen_ty_1"] + [::std::mem::size_of::() - 8usize]; + ["Alignment of QUIC_SETTINGS__bindgen_ty_2__bindgen_ty_1"] + [::std::mem::align_of::() - 8usize]; +}; +impl QUIC_SETTINGS__bindgen_ty_2__bindgen_ty_1 { + #[inline] + pub fn HyStartEnabled(&self) -> u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u64) } + } + #[inline] + pub fn set_HyStartEnabled(&mut self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn HyStartEnabled_raw(this: *const Self) -> u64 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 0usize, + 1u8, + ) as u64) + } + } + #[inline] + pub unsafe fn set_HyStartEnabled_raw(this: *mut Self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 8usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 0usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn ReservedFlags(&self) -> u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 63u8) as u64) } + } + #[inline] + pub fn set_ReservedFlags(&mut self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(1usize, 63u8, val as u64) + } + } + #[inline] + pub unsafe fn ReservedFlags_raw(this: *const Self) -> u64 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 1usize, + 63u8, + ) as u64) + } + } + #[inline] + pub unsafe fn set_ReservedFlags_raw(this: *mut Self, val: u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 8usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 1usize, + 63u8, + val as u64, + ) + } + } + #[inline] + pub fn new_bitfield_1( + HyStartEnabled: u64, + ReservedFlags: u64, + ) -> __BindgenBitfieldUnit<[u8; 8usize]> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 8usize]> = Default::default(); + __bindgen_bitfield_unit.set(0usize, 1u8, { + let HyStartEnabled: u64 = unsafe { ::std::mem::transmute(HyStartEnabled) }; + HyStartEnabled as u64 + }); + __bindgen_bitfield_unit.set(1usize, 63u8, { + let ReservedFlags: u64 = unsafe { ::std::mem::transmute(ReservedFlags) }; + ReservedFlags as u64 + }); + __bindgen_bitfield_unit + } +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of QUIC_SETTINGS__bindgen_ty_2"] + [::std::mem::size_of::() - 8usize]; + ["Alignment of QUIC_SETTINGS__bindgen_ty_2"] + [::std::mem::align_of::() - 8usize]; + ["Offset of field: QUIC_SETTINGS__bindgen_ty_2::Flags"] + [::std::mem::offset_of!(QUIC_SETTINGS__bindgen_ty_2, Flags) - 0usize]; +}; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of QUIC_SETTINGS"][::std::mem::size_of::() - 144usize]; + ["Alignment of QUIC_SETTINGS"][::std::mem::align_of::() - 8usize]; + ["Offset of field: QUIC_SETTINGS::MaxBytesPerKey"] + [::std::mem::offset_of!(QUIC_SETTINGS, MaxBytesPerKey) - 8usize]; + ["Offset of field: QUIC_SETTINGS::HandshakeIdleTimeoutMs"] + [::std::mem::offset_of!(QUIC_SETTINGS, HandshakeIdleTimeoutMs) - 16usize]; + ["Offset of field: QUIC_SETTINGS::IdleTimeoutMs"] + [::std::mem::offset_of!(QUIC_SETTINGS, IdleTimeoutMs) - 24usize]; + ["Offset of field: QUIC_SETTINGS::MtuDiscoverySearchCompleteTimeoutUs"] + [::std::mem::offset_of!(QUIC_SETTINGS, MtuDiscoverySearchCompleteTimeoutUs) - 32usize]; + ["Offset of field: QUIC_SETTINGS::TlsClientMaxSendBuffer"] + [::std::mem::offset_of!(QUIC_SETTINGS, TlsClientMaxSendBuffer) - 40usize]; + ["Offset of field: QUIC_SETTINGS::TlsServerMaxSendBuffer"] + [::std::mem::offset_of!(QUIC_SETTINGS, TlsServerMaxSendBuffer) - 44usize]; + ["Offset of field: QUIC_SETTINGS::StreamRecvWindowDefault"] + [::std::mem::offset_of!(QUIC_SETTINGS, StreamRecvWindowDefault) - 48usize]; + ["Offset of field: QUIC_SETTINGS::StreamRecvBufferDefault"] + [::std::mem::offset_of!(QUIC_SETTINGS, StreamRecvBufferDefault) - 52usize]; + ["Offset of field: QUIC_SETTINGS::ConnFlowControlWindow"] + [::std::mem::offset_of!(QUIC_SETTINGS, ConnFlowControlWindow) - 56usize]; + ["Offset of field: QUIC_SETTINGS::MaxWorkerQueueDelayUs"] + [::std::mem::offset_of!(QUIC_SETTINGS, MaxWorkerQueueDelayUs) - 60usize]; + ["Offset of field: QUIC_SETTINGS::MaxStatelessOperations"] + [::std::mem::offset_of!(QUIC_SETTINGS, MaxStatelessOperations) - 64usize]; + ["Offset of field: QUIC_SETTINGS::InitialWindowPackets"] + [::std::mem::offset_of!(QUIC_SETTINGS, InitialWindowPackets) - 68usize]; + ["Offset of field: QUIC_SETTINGS::SendIdleTimeoutMs"] + [::std::mem::offset_of!(QUIC_SETTINGS, SendIdleTimeoutMs) - 72usize]; + ["Offset of field: QUIC_SETTINGS::InitialRttMs"] + [::std::mem::offset_of!(QUIC_SETTINGS, InitialRttMs) - 76usize]; + ["Offset of field: QUIC_SETTINGS::MaxAckDelayMs"] + [::std::mem::offset_of!(QUIC_SETTINGS, MaxAckDelayMs) - 80usize]; + ["Offset of field: QUIC_SETTINGS::DisconnectTimeoutMs"] + [::std::mem::offset_of!(QUIC_SETTINGS, DisconnectTimeoutMs) - 84usize]; + ["Offset of field: QUIC_SETTINGS::KeepAliveIntervalMs"] + [::std::mem::offset_of!(QUIC_SETTINGS, KeepAliveIntervalMs) - 88usize]; + ["Offset of field: QUIC_SETTINGS::CongestionControlAlgorithm"] + [::std::mem::offset_of!(QUIC_SETTINGS, CongestionControlAlgorithm) - 92usize]; + ["Offset of field: QUIC_SETTINGS::PeerBidiStreamCount"] + [::std::mem::offset_of!(QUIC_SETTINGS, PeerBidiStreamCount) - 94usize]; + ["Offset of field: QUIC_SETTINGS::PeerUnidiStreamCount"] + [::std::mem::offset_of!(QUIC_SETTINGS, PeerUnidiStreamCount) - 96usize]; + ["Offset of field: QUIC_SETTINGS::MaxBindingStatelessOperations"] + [::std::mem::offset_of!(QUIC_SETTINGS, MaxBindingStatelessOperations) - 98usize]; + ["Offset of field: QUIC_SETTINGS::StatelessOperationExpirationMs"] + [::std::mem::offset_of!(QUIC_SETTINGS, StatelessOperationExpirationMs) - 100usize]; + ["Offset of field: QUIC_SETTINGS::MinimumMtu"] + [::std::mem::offset_of!(QUIC_SETTINGS, MinimumMtu) - 102usize]; + ["Offset of field: QUIC_SETTINGS::MaximumMtu"] + [::std::mem::offset_of!(QUIC_SETTINGS, MaximumMtu) - 104usize]; + ["Offset of field: QUIC_SETTINGS::MaxOperationsPerDrain"] + [::std::mem::offset_of!(QUIC_SETTINGS, MaxOperationsPerDrain) - 107usize]; + ["Offset of field: QUIC_SETTINGS::MtuDiscoveryMissingProbeCount"] + [::std::mem::offset_of!(QUIC_SETTINGS, MtuDiscoveryMissingProbeCount) - 108usize]; + ["Offset of field: QUIC_SETTINGS::DestCidUpdateIdleTimeoutMs"] + [::std::mem::offset_of!(QUIC_SETTINGS, DestCidUpdateIdleTimeoutMs) - 112usize]; + ["Offset of field: QUIC_SETTINGS::StreamRecvWindowBidiLocalDefault"] + [::std::mem::offset_of!(QUIC_SETTINGS, StreamRecvWindowBidiLocalDefault) - 128usize]; + ["Offset of field: QUIC_SETTINGS::StreamRecvWindowBidiRemoteDefault"] + [::std::mem::offset_of!(QUIC_SETTINGS, StreamRecvWindowBidiRemoteDefault) - 132usize]; + ["Offset of field: QUIC_SETTINGS::StreamRecvWindowUnidiDefault"] + [::std::mem::offset_of!(QUIC_SETTINGS, StreamRecvWindowUnidiDefault) - 136usize]; +}; +impl QUIC_SETTINGS { + #[inline] + pub fn SendBufferingEnabled(&self) -> u8 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u8) } + } + #[inline] + pub fn set_SendBufferingEnabled(&mut self, val: u8) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn SendBufferingEnabled_raw(this: *const Self) -> u8 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 0usize, + 1u8, + ) as u8) + } + } + #[inline] + pub unsafe fn set_SendBufferingEnabled_raw(this: *mut Self, val: u8) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 0usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn PacingEnabled(&self) -> u8 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u8) } + } + #[inline] + pub fn set_PacingEnabled(&mut self, val: u8) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + self._bitfield_1.set(1usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn PacingEnabled_raw(this: *const Self) -> u8 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 1usize, + 1u8, + ) as u8) + } + } + #[inline] + pub unsafe fn set_PacingEnabled_raw(this: *mut Self, val: u8) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 1usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn MigrationEnabled(&self) -> u8 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(2usize, 1u8) as u8) } + } + #[inline] + pub fn set_MigrationEnabled(&mut self, val: u8) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + self._bitfield_1.set(2usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn MigrationEnabled_raw(this: *const Self) -> u8 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 2usize, + 1u8, + ) as u8) + } + } + #[inline] + pub unsafe fn set_MigrationEnabled_raw(this: *mut Self, val: u8) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 2usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn DatagramReceiveEnabled(&self) -> u8 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(3usize, 1u8) as u8) } + } + #[inline] + pub fn set_DatagramReceiveEnabled(&mut self, val: u8) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + self._bitfield_1.set(3usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn DatagramReceiveEnabled_raw(this: *const Self) -> u8 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 3usize, + 1u8, + ) as u8) + } + } + #[inline] + pub unsafe fn set_DatagramReceiveEnabled_raw(this: *mut Self, val: u8) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 3usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn ServerResumptionLevel(&self) -> u8 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(4usize, 2u8) as u8) } + } + #[inline] + pub fn set_ServerResumptionLevel(&mut self, val: u8) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + self._bitfield_1.set(4usize, 2u8, val as u64) + } + } + #[inline] + pub unsafe fn ServerResumptionLevel_raw(this: *const Self) -> u8 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 4usize, + 2u8, + ) as u8) + } + } + #[inline] + pub unsafe fn set_ServerResumptionLevel_raw(this: *mut Self, val: u8) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 4usize, + 2u8, + val as u64, + ) + } + } + #[inline] + pub fn GreaseQuicBitEnabled(&self) -> u8 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(6usize, 1u8) as u8) } + } + #[inline] + pub fn set_GreaseQuicBitEnabled(&mut self, val: u8) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + self._bitfield_1.set(6usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn GreaseQuicBitEnabled_raw(this: *const Self) -> u8 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 6usize, + 1u8, + ) as u8) + } + } + #[inline] + pub unsafe fn set_GreaseQuicBitEnabled_raw(this: *mut Self, val: u8) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 6usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn EcnEnabled(&self) -> u8 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(7usize, 1u8) as u8) } + } + #[inline] + pub fn set_EcnEnabled(&mut self, val: u8) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + self._bitfield_1.set(7usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn EcnEnabled_raw(this: *const Self) -> u8 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 7usize, + 1u8, + ) as u8) + } + } + #[inline] + pub unsafe fn set_EcnEnabled_raw(this: *mut Self, val: u8) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 7usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn new_bitfield_1( + SendBufferingEnabled: u8, + PacingEnabled: u8, + MigrationEnabled: u8, + DatagramReceiveEnabled: u8, + ServerResumptionLevel: u8, + GreaseQuicBitEnabled: u8, + EcnEnabled: u8, + ) -> __BindgenBitfieldUnit<[u8; 1usize]> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize]> = Default::default(); + __bindgen_bitfield_unit.set(0usize, 1u8, { + let SendBufferingEnabled: u8 = unsafe { ::std::mem::transmute(SendBufferingEnabled) }; + SendBufferingEnabled as u64 + }); + __bindgen_bitfield_unit.set(1usize, 1u8, { + let PacingEnabled: u8 = unsafe { ::std::mem::transmute(PacingEnabled) }; + PacingEnabled as u64 + }); + __bindgen_bitfield_unit.set(2usize, 1u8, { + let MigrationEnabled: u8 = unsafe { ::std::mem::transmute(MigrationEnabled) }; + MigrationEnabled as u64 + }); + __bindgen_bitfield_unit.set(3usize, 1u8, { + let DatagramReceiveEnabled: u8 = + unsafe { ::std::mem::transmute(DatagramReceiveEnabled) }; + DatagramReceiveEnabled as u64 + }); + __bindgen_bitfield_unit.set(4usize, 2u8, { + let ServerResumptionLevel: u8 = unsafe { ::std::mem::transmute(ServerResumptionLevel) }; + ServerResumptionLevel as u64 + }); + __bindgen_bitfield_unit.set(6usize, 1u8, { + let GreaseQuicBitEnabled: u8 = unsafe { ::std::mem::transmute(GreaseQuicBitEnabled) }; + GreaseQuicBitEnabled as u64 + }); + __bindgen_bitfield_unit.set(7usize, 1u8, { + let EcnEnabled: u8 = unsafe { ::std::mem::transmute(EcnEnabled) }; + EcnEnabled as u64 + }); + __bindgen_bitfield_unit + } +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct QUIC_TLS_SECRETS { + pub SecretLength: u8, + pub IsSet: QUIC_TLS_SECRETS__bindgen_ty_1, + pub ClientRandom: [u8; 32usize], + pub ClientEarlyTrafficSecret: [u8; 64usize], + pub ClientHandshakeTrafficSecret: [u8; 64usize], + pub ServerHandshakeTrafficSecret: [u8; 64usize], + pub ClientTrafficSecret0: [u8; 64usize], + pub ServerTrafficSecret0: [u8; 64usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct QUIC_TLS_SECRETS__bindgen_ty_1 { + pub _bitfield_align_1: [u8; 0], + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize]>, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of QUIC_TLS_SECRETS__bindgen_ty_1"] + [::std::mem::size_of::() - 1usize]; + ["Alignment of QUIC_TLS_SECRETS__bindgen_ty_1"] + [::std::mem::align_of::() - 1usize]; +}; +impl QUIC_TLS_SECRETS__bindgen_ty_1 { + #[inline] + pub fn ClientRandom(&self) -> u8 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u8) } + } + #[inline] + pub fn set_ClientRandom(&mut self, val: u8) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn ClientRandom_raw(this: *const Self) -> u8 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 0usize, + 1u8, + ) as u8) + } + } + #[inline] + pub unsafe fn set_ClientRandom_raw(this: *mut Self, val: u8) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 0usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn ClientEarlyTrafficSecret(&self) -> u8 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u8) } + } + #[inline] + pub fn set_ClientEarlyTrafficSecret(&mut self, val: u8) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + self._bitfield_1.set(1usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn ClientEarlyTrafficSecret_raw(this: *const Self) -> u8 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 1usize, + 1u8, + ) as u8) + } + } + #[inline] + pub unsafe fn set_ClientEarlyTrafficSecret_raw(this: *mut Self, val: u8) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 1usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn ClientHandshakeTrafficSecret(&self) -> u8 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(2usize, 1u8) as u8) } + } + #[inline] + pub fn set_ClientHandshakeTrafficSecret(&mut self, val: u8) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + self._bitfield_1.set(2usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn ClientHandshakeTrafficSecret_raw(this: *const Self) -> u8 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 2usize, + 1u8, + ) as u8) + } + } + #[inline] + pub unsafe fn set_ClientHandshakeTrafficSecret_raw(this: *mut Self, val: u8) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 2usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn ServerHandshakeTrafficSecret(&self) -> u8 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(3usize, 1u8) as u8) } + } + #[inline] + pub fn set_ServerHandshakeTrafficSecret(&mut self, val: u8) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + self._bitfield_1.set(3usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn ServerHandshakeTrafficSecret_raw(this: *const Self) -> u8 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 3usize, + 1u8, + ) as u8) + } + } + #[inline] + pub unsafe fn set_ServerHandshakeTrafficSecret_raw(this: *mut Self, val: u8) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 3usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn ClientTrafficSecret0(&self) -> u8 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(4usize, 1u8) as u8) } + } + #[inline] + pub fn set_ClientTrafficSecret0(&mut self, val: u8) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + self._bitfield_1.set(4usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn ClientTrafficSecret0_raw(this: *const Self) -> u8 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 4usize, + 1u8, + ) as u8) + } + } + #[inline] + pub unsafe fn set_ClientTrafficSecret0_raw(this: *mut Self, val: u8) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 4usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn ServerTrafficSecret0(&self) -> u8 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(5usize, 1u8) as u8) } + } + #[inline] + pub fn set_ServerTrafficSecret0(&mut self, val: u8) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + self._bitfield_1.set(5usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn ServerTrafficSecret0_raw(this: *const Self) -> u8 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 5usize, + 1u8, + ) as u8) + } + } + #[inline] + pub unsafe fn set_ServerTrafficSecret0_raw(this: *mut Self, val: u8) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 5usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn new_bitfield_1( + ClientRandom: u8, + ClientEarlyTrafficSecret: u8, + ClientHandshakeTrafficSecret: u8, + ServerHandshakeTrafficSecret: u8, + ClientTrafficSecret0: u8, + ServerTrafficSecret0: u8, + ) -> __BindgenBitfieldUnit<[u8; 1usize]> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize]> = Default::default(); + __bindgen_bitfield_unit.set(0usize, 1u8, { + let ClientRandom: u8 = unsafe { ::std::mem::transmute(ClientRandom) }; + ClientRandom as u64 + }); + __bindgen_bitfield_unit.set(1usize, 1u8, { + let ClientEarlyTrafficSecret: u8 = + unsafe { ::std::mem::transmute(ClientEarlyTrafficSecret) }; + ClientEarlyTrafficSecret as u64 + }); + __bindgen_bitfield_unit.set(2usize, 1u8, { + let ClientHandshakeTrafficSecret: u8 = + unsafe { ::std::mem::transmute(ClientHandshakeTrafficSecret) }; + ClientHandshakeTrafficSecret as u64 + }); + __bindgen_bitfield_unit.set(3usize, 1u8, { + let ServerHandshakeTrafficSecret: u8 = + unsafe { ::std::mem::transmute(ServerHandshakeTrafficSecret) }; + ServerHandshakeTrafficSecret as u64 + }); + __bindgen_bitfield_unit.set(4usize, 1u8, { + let ClientTrafficSecret0: u8 = unsafe { ::std::mem::transmute(ClientTrafficSecret0) }; + ClientTrafficSecret0 as u64 + }); + __bindgen_bitfield_unit.set(5usize, 1u8, { + let ServerTrafficSecret0: u8 = unsafe { ::std::mem::transmute(ServerTrafficSecret0) }; + ServerTrafficSecret0 as u64 + }); + __bindgen_bitfield_unit + } +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of QUIC_TLS_SECRETS"][::std::mem::size_of::() - 354usize]; + ["Alignment of QUIC_TLS_SECRETS"][::std::mem::align_of::() - 1usize]; + ["Offset of field: QUIC_TLS_SECRETS::SecretLength"] + [::std::mem::offset_of!(QUIC_TLS_SECRETS, SecretLength) - 0usize]; + ["Offset of field: QUIC_TLS_SECRETS::IsSet"] + [::std::mem::offset_of!(QUIC_TLS_SECRETS, IsSet) - 1usize]; + ["Offset of field: QUIC_TLS_SECRETS::ClientRandom"] + [::std::mem::offset_of!(QUIC_TLS_SECRETS, ClientRandom) - 2usize]; + ["Offset of field: QUIC_TLS_SECRETS::ClientEarlyTrafficSecret"] + [::std::mem::offset_of!(QUIC_TLS_SECRETS, ClientEarlyTrafficSecret) - 34usize]; + ["Offset of field: QUIC_TLS_SECRETS::ClientHandshakeTrafficSecret"] + [::std::mem::offset_of!(QUIC_TLS_SECRETS, ClientHandshakeTrafficSecret) - 98usize]; + ["Offset of field: QUIC_TLS_SECRETS::ServerHandshakeTrafficSecret"] + [::std::mem::offset_of!(QUIC_TLS_SECRETS, ServerHandshakeTrafficSecret) - 162usize]; + ["Offset of field: QUIC_TLS_SECRETS::ClientTrafficSecret0"] + [::std::mem::offset_of!(QUIC_TLS_SECRETS, ClientTrafficSecret0) - 226usize]; + ["Offset of field: QUIC_TLS_SECRETS::ServerTrafficSecret0"] + [::std::mem::offset_of!(QUIC_TLS_SECRETS, ServerTrafficSecret0) - 290usize]; +}; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct QUIC_STREAM_STATISTICS { + pub ConnBlockedBySchedulingUs: u64, + pub ConnBlockedByPacingUs: u64, + pub ConnBlockedByAmplificationProtUs: u64, + pub ConnBlockedByCongestionControlUs: u64, + pub ConnBlockedByFlowControlUs: u64, + pub StreamBlockedByIdFlowControlUs: u64, + pub StreamBlockedByFlowControlUs: u64, + pub StreamBlockedByAppUs: u64, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of QUIC_STREAM_STATISTICS"][::std::mem::size_of::() - 64usize]; + ["Alignment of QUIC_STREAM_STATISTICS"] + [::std::mem::align_of::() - 8usize]; + ["Offset of field: QUIC_STREAM_STATISTICS::ConnBlockedBySchedulingUs"] + [::std::mem::offset_of!(QUIC_STREAM_STATISTICS, ConnBlockedBySchedulingUs) - 0usize]; + ["Offset of field: QUIC_STREAM_STATISTICS::ConnBlockedByPacingUs"] + [::std::mem::offset_of!(QUIC_STREAM_STATISTICS, ConnBlockedByPacingUs) - 8usize]; + ["Offset of field: QUIC_STREAM_STATISTICS::ConnBlockedByAmplificationProtUs"][::std::mem::offset_of!( + QUIC_STREAM_STATISTICS, + ConnBlockedByAmplificationProtUs + ) - 16usize]; + ["Offset of field: QUIC_STREAM_STATISTICS::ConnBlockedByCongestionControlUs"][::std::mem::offset_of!( + QUIC_STREAM_STATISTICS, + ConnBlockedByCongestionControlUs + ) - 24usize]; + ["Offset of field: QUIC_STREAM_STATISTICS::ConnBlockedByFlowControlUs"] + [::std::mem::offset_of!(QUIC_STREAM_STATISTICS, ConnBlockedByFlowControlUs) - 32usize]; + ["Offset of field: QUIC_STREAM_STATISTICS::StreamBlockedByIdFlowControlUs"] + [::std::mem::offset_of!(QUIC_STREAM_STATISTICS, StreamBlockedByIdFlowControlUs) - 40usize]; + ["Offset of field: QUIC_STREAM_STATISTICS::StreamBlockedByFlowControlUs"] + [::std::mem::offset_of!(QUIC_STREAM_STATISTICS, StreamBlockedByFlowControlUs) - 48usize]; + ["Offset of field: QUIC_STREAM_STATISTICS::StreamBlockedByAppUs"] + [::std::mem::offset_of!(QUIC_STREAM_STATISTICS, StreamBlockedByAppUs) - 56usize]; +}; +pub type QUIC_SET_CONTEXT_FN = ::std::option::Option< + unsafe extern "C" fn(Handle: HQUIC, Context: *mut ::std::os::raw::c_void), +>; +pub type QUIC_GET_CONTEXT_FN = + ::std::option::Option *mut ::std::os::raw::c_void>; +pub type QUIC_SET_CALLBACK_HANDLER_FN = ::std::option::Option< + unsafe extern "C" fn( + Handle: HQUIC, + Handler: *mut ::std::os::raw::c_void, + Context: *mut ::std::os::raw::c_void, + ), +>; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct QUIC_SCHANNEL_CREDENTIAL_ATTRIBUTE_W { + pub Attribute: ::std::os::raw::c_ulong, + pub BufferLength: ::std::os::raw::c_ulong, + pub Buffer: *mut ::std::os::raw::c_void, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of QUIC_SCHANNEL_CREDENTIAL_ATTRIBUTE_W"] + [::std::mem::size_of::() - 16usize]; + ["Alignment of QUIC_SCHANNEL_CREDENTIAL_ATTRIBUTE_W"] + [::std::mem::align_of::() - 8usize]; + ["Offset of field: QUIC_SCHANNEL_CREDENTIAL_ATTRIBUTE_W::Attribute"] + [::std::mem::offset_of!(QUIC_SCHANNEL_CREDENTIAL_ATTRIBUTE_W, Attribute) - 0usize]; + ["Offset of field: QUIC_SCHANNEL_CREDENTIAL_ATTRIBUTE_W::BufferLength"] + [::std::mem::offset_of!(QUIC_SCHANNEL_CREDENTIAL_ATTRIBUTE_W, BufferLength) - 4usize]; + ["Offset of field: QUIC_SCHANNEL_CREDENTIAL_ATTRIBUTE_W::Buffer"] + [::std::mem::offset_of!(QUIC_SCHANNEL_CREDENTIAL_ATTRIBUTE_W, Buffer) - 8usize]; +}; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct QUIC_SCHANNEL_CONTEXT_ATTRIBUTE_W { + pub Attribute: ::std::os::raw::c_ulong, + pub Buffer: *mut ::std::os::raw::c_void, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of QUIC_SCHANNEL_CONTEXT_ATTRIBUTE_W"] + [::std::mem::size_of::() - 16usize]; + ["Alignment of QUIC_SCHANNEL_CONTEXT_ATTRIBUTE_W"] + [::std::mem::align_of::() - 8usize]; + ["Offset of field: QUIC_SCHANNEL_CONTEXT_ATTRIBUTE_W::Attribute"] + [::std::mem::offset_of!(QUIC_SCHANNEL_CONTEXT_ATTRIBUTE_W, Attribute) - 0usize]; + ["Offset of field: QUIC_SCHANNEL_CONTEXT_ATTRIBUTE_W::Buffer"] + [::std::mem::offset_of!(QUIC_SCHANNEL_CONTEXT_ATTRIBUTE_W, Buffer) - 8usize]; +}; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct QUIC_SCHANNEL_CONTEXT_ATTRIBUTE_EX_W { + pub Attribute: ::std::os::raw::c_ulong, + pub BufferLength: ::std::os::raw::c_ulong, + pub Buffer: *mut ::std::os::raw::c_void, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of QUIC_SCHANNEL_CONTEXT_ATTRIBUTE_EX_W"] + [::std::mem::size_of::() - 16usize]; + ["Alignment of QUIC_SCHANNEL_CONTEXT_ATTRIBUTE_EX_W"] + [::std::mem::align_of::() - 8usize]; + ["Offset of field: QUIC_SCHANNEL_CONTEXT_ATTRIBUTE_EX_W::Attribute"] + [::std::mem::offset_of!(QUIC_SCHANNEL_CONTEXT_ATTRIBUTE_EX_W, Attribute) - 0usize]; + ["Offset of field: QUIC_SCHANNEL_CONTEXT_ATTRIBUTE_EX_W::BufferLength"] + [::std::mem::offset_of!(QUIC_SCHANNEL_CONTEXT_ATTRIBUTE_EX_W, BufferLength) - 4usize]; + ["Offset of field: QUIC_SCHANNEL_CONTEXT_ATTRIBUTE_EX_W::Buffer"] + [::std::mem::offset_of!(QUIC_SCHANNEL_CONTEXT_ATTRIBUTE_EX_W, Buffer) - 8usize]; +}; +pub type QUIC_SET_PARAM_FN = ::std::option::Option< + unsafe extern "C" fn( + Handle: HQUIC, + Param: u32, + BufferLength: u32, + Buffer: *const ::std::os::raw::c_void, + ) -> HRESULT, +>; +pub type QUIC_GET_PARAM_FN = ::std::option::Option< + unsafe extern "C" fn( + Handle: HQUIC, + Param: u32, + BufferLength: *mut u32, + Buffer: *mut ::std::os::raw::c_void, + ) -> HRESULT, +>; +pub type QUIC_REGISTRATION_OPEN_FN = ::std::option::Option< + unsafe extern "C" fn( + Config: *const QUIC_REGISTRATION_CONFIG, + Registration: *mut HQUIC, + ) -> HRESULT, +>; +pub type QUIC_REGISTRATION_CLOSE_FN = + ::std::option::Option; +pub type QUIC_REGISTRATION_SHUTDOWN_FN = ::std::option::Option< + unsafe extern "C" fn( + Registration: HQUIC, + Flags: QUIC_CONNECTION_SHUTDOWN_FLAGS, + ErrorCode: QUIC_UINT62, + ), +>; +pub type QUIC_CONFIGURATION_OPEN_FN = ::std::option::Option< + unsafe extern "C" fn( + Registration: HQUIC, + AlpnBuffers: *const QUIC_BUFFER, + AlpnBufferCount: u32, + Settings: *const QUIC_SETTINGS, + SettingsSize: u32, + Context: *mut ::std::os::raw::c_void, + Configuration: *mut HQUIC, + ) -> HRESULT, +>; +pub type QUIC_CONFIGURATION_CLOSE_FN = + ::std::option::Option; +pub type QUIC_CONFIGURATION_LOAD_CREDENTIAL_FN = ::std::option::Option< + unsafe extern "C" fn( + Configuration: HQUIC, + CredConfig: *const QUIC_CREDENTIAL_CONFIG, + ) -> HRESULT, +>; +pub const QUIC_LISTENER_EVENT_TYPE_QUIC_LISTENER_EVENT_NEW_CONNECTION: QUIC_LISTENER_EVENT_TYPE = 0; +pub const QUIC_LISTENER_EVENT_TYPE_QUIC_LISTENER_EVENT_STOP_COMPLETE: QUIC_LISTENER_EVENT_TYPE = 1; +pub type QUIC_LISTENER_EVENT_TYPE = ::std::os::raw::c_int; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct QUIC_LISTENER_EVENT { + pub Type: QUIC_LISTENER_EVENT_TYPE, + pub __bindgen_anon_1: QUIC_LISTENER_EVENT__bindgen_ty_1, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union QUIC_LISTENER_EVENT__bindgen_ty_1 { + pub NEW_CONNECTION: QUIC_LISTENER_EVENT__bindgen_ty_1__bindgen_ty_1, + pub STOP_COMPLETE: QUIC_LISTENER_EVENT__bindgen_ty_1__bindgen_ty_2, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct QUIC_LISTENER_EVENT__bindgen_ty_1__bindgen_ty_1 { + pub Info: *const QUIC_NEW_CONNECTION_INFO, + pub Connection: HQUIC, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of QUIC_LISTENER_EVENT__bindgen_ty_1__bindgen_ty_1"] + [::std::mem::size_of::() - 16usize]; + ["Alignment of QUIC_LISTENER_EVENT__bindgen_ty_1__bindgen_ty_1"] + [::std::mem::align_of::() - 8usize]; + ["Offset of field: QUIC_LISTENER_EVENT__bindgen_ty_1__bindgen_ty_1::Info"] + [::std::mem::offset_of!(QUIC_LISTENER_EVENT__bindgen_ty_1__bindgen_ty_1, Info) - 0usize]; + ["Offset of field: QUIC_LISTENER_EVENT__bindgen_ty_1__bindgen_ty_1::Connection"][::std::mem::offset_of!( + QUIC_LISTENER_EVENT__bindgen_ty_1__bindgen_ty_1, + Connection + ) - 8usize]; +}; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct QUIC_LISTENER_EVENT__bindgen_ty_1__bindgen_ty_2 { + pub _bitfield_align_1: [u8; 0], + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize]>, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of QUIC_LISTENER_EVENT__bindgen_ty_1__bindgen_ty_2"] + [::std::mem::size_of::() - 1usize]; + ["Alignment of QUIC_LISTENER_EVENT__bindgen_ty_1__bindgen_ty_2"] + [::std::mem::align_of::() - 1usize]; +}; +impl QUIC_LISTENER_EVENT__bindgen_ty_1__bindgen_ty_2 { + #[inline] + pub fn AppCloseInProgress(&self) -> BOOLEAN { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u8) } + } + #[inline] + pub fn set_AppCloseInProgress(&mut self, val: BOOLEAN) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn AppCloseInProgress_raw(this: *const Self) -> BOOLEAN { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 0usize, + 1u8, + ) as u8) + } + } + #[inline] + pub unsafe fn set_AppCloseInProgress_raw(this: *mut Self, val: BOOLEAN) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 0usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn RESERVED(&self) -> BOOLEAN { + unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 7u8) as u8) } + } + #[inline] + pub fn set_RESERVED(&mut self, val: BOOLEAN) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + self._bitfield_1.set(1usize, 7u8, val as u64) + } + } + #[inline] + pub unsafe fn RESERVED_raw(this: *const Self) -> BOOLEAN { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 1usize, + 7u8, + ) as u8) + } + } + #[inline] + pub unsafe fn set_RESERVED_raw(this: *mut Self, val: BOOLEAN) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 1usize, + 7u8, + val as u64, + ) + } + } + #[inline] + pub fn new_bitfield_1( + AppCloseInProgress: BOOLEAN, + RESERVED: BOOLEAN, + ) -> __BindgenBitfieldUnit<[u8; 1usize]> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize]> = Default::default(); + __bindgen_bitfield_unit.set(0usize, 1u8, { + let AppCloseInProgress: u8 = unsafe { ::std::mem::transmute(AppCloseInProgress) }; + AppCloseInProgress as u64 + }); + __bindgen_bitfield_unit.set(1usize, 7u8, { + let RESERVED: u8 = unsafe { ::std::mem::transmute(RESERVED) }; + RESERVED as u64 + }); + __bindgen_bitfield_unit + } +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of QUIC_LISTENER_EVENT__bindgen_ty_1"] + [::std::mem::size_of::() - 16usize]; + ["Alignment of QUIC_LISTENER_EVENT__bindgen_ty_1"] + [::std::mem::align_of::() - 8usize]; + ["Offset of field: QUIC_LISTENER_EVENT__bindgen_ty_1::NEW_CONNECTION"] + [::std::mem::offset_of!(QUIC_LISTENER_EVENT__bindgen_ty_1, NEW_CONNECTION) - 0usize]; + ["Offset of field: QUIC_LISTENER_EVENT__bindgen_ty_1::STOP_COMPLETE"] + [::std::mem::offset_of!(QUIC_LISTENER_EVENT__bindgen_ty_1, STOP_COMPLETE) - 0usize]; +}; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of QUIC_LISTENER_EVENT"][::std::mem::size_of::() - 24usize]; + ["Alignment of QUIC_LISTENER_EVENT"][::std::mem::align_of::() - 8usize]; + ["Offset of field: QUIC_LISTENER_EVENT::Type"] + [::std::mem::offset_of!(QUIC_LISTENER_EVENT, Type) - 0usize]; +}; +pub type QUIC_LISTENER_CALLBACK_HANDLER = ::std::option::Option< + unsafe extern "C" fn( + arg1: HQUIC, + arg2: *mut ::std::os::raw::c_void, + arg3: *mut QUIC_LISTENER_EVENT, + ) -> HRESULT, +>; +pub type QUIC_LISTENER_OPEN_FN = ::std::option::Option< + unsafe extern "C" fn( + Registration: HQUIC, + Handler: QUIC_LISTENER_CALLBACK_HANDLER, + Context: *mut ::std::os::raw::c_void, + Listener: *mut HQUIC, + ) -> HRESULT, +>; +pub type QUIC_LISTENER_CLOSE_FN = ::std::option::Option; +pub type QUIC_LISTENER_START_FN = ::std::option::Option< + unsafe extern "C" fn( + Listener: HQUIC, + AlpnBuffers: *const QUIC_BUFFER, + AlpnBufferCount: u32, + LocalAddress: *const QUIC_ADDR, + ) -> HRESULT, +>; +pub type QUIC_LISTENER_STOP_FN = ::std::option::Option; +pub const QUIC_CONNECTION_EVENT_TYPE_QUIC_CONNECTION_EVENT_CONNECTED: QUIC_CONNECTION_EVENT_TYPE = + 0; +pub const QUIC_CONNECTION_EVENT_TYPE_QUIC_CONNECTION_EVENT_SHUTDOWN_INITIATED_BY_TRANSPORT: + QUIC_CONNECTION_EVENT_TYPE = 1; +pub const QUIC_CONNECTION_EVENT_TYPE_QUIC_CONNECTION_EVENT_SHUTDOWN_INITIATED_BY_PEER: + QUIC_CONNECTION_EVENT_TYPE = 2; +pub const QUIC_CONNECTION_EVENT_TYPE_QUIC_CONNECTION_EVENT_SHUTDOWN_COMPLETE: + QUIC_CONNECTION_EVENT_TYPE = 3; +pub const QUIC_CONNECTION_EVENT_TYPE_QUIC_CONNECTION_EVENT_LOCAL_ADDRESS_CHANGED: + QUIC_CONNECTION_EVENT_TYPE = 4; +pub const QUIC_CONNECTION_EVENT_TYPE_QUIC_CONNECTION_EVENT_PEER_ADDRESS_CHANGED: + QUIC_CONNECTION_EVENT_TYPE = 5; +pub const QUIC_CONNECTION_EVENT_TYPE_QUIC_CONNECTION_EVENT_PEER_STREAM_STARTED: + QUIC_CONNECTION_EVENT_TYPE = 6; +pub const QUIC_CONNECTION_EVENT_TYPE_QUIC_CONNECTION_EVENT_STREAMS_AVAILABLE: + QUIC_CONNECTION_EVENT_TYPE = 7; +pub const QUIC_CONNECTION_EVENT_TYPE_QUIC_CONNECTION_EVENT_PEER_NEEDS_STREAMS: + QUIC_CONNECTION_EVENT_TYPE = 8; +pub const QUIC_CONNECTION_EVENT_TYPE_QUIC_CONNECTION_EVENT_IDEAL_PROCESSOR_CHANGED: + QUIC_CONNECTION_EVENT_TYPE = 9; +pub const QUIC_CONNECTION_EVENT_TYPE_QUIC_CONNECTION_EVENT_DATAGRAM_STATE_CHANGED: + QUIC_CONNECTION_EVENT_TYPE = 10; +pub const QUIC_CONNECTION_EVENT_TYPE_QUIC_CONNECTION_EVENT_DATAGRAM_RECEIVED: + QUIC_CONNECTION_EVENT_TYPE = 11; +pub const QUIC_CONNECTION_EVENT_TYPE_QUIC_CONNECTION_EVENT_DATAGRAM_SEND_STATE_CHANGED: + QUIC_CONNECTION_EVENT_TYPE = 12; +pub const QUIC_CONNECTION_EVENT_TYPE_QUIC_CONNECTION_EVENT_RESUMED: QUIC_CONNECTION_EVENT_TYPE = 13; +pub const QUIC_CONNECTION_EVENT_TYPE_QUIC_CONNECTION_EVENT_RESUMPTION_TICKET_RECEIVED: + QUIC_CONNECTION_EVENT_TYPE = 14; +pub const QUIC_CONNECTION_EVENT_TYPE_QUIC_CONNECTION_EVENT_PEER_CERTIFICATE_RECEIVED: + QUIC_CONNECTION_EVENT_TYPE = 15; +pub type QUIC_CONNECTION_EVENT_TYPE = ::std::os::raw::c_int; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct QUIC_CONNECTION_EVENT { + pub Type: QUIC_CONNECTION_EVENT_TYPE, + pub __bindgen_anon_1: QUIC_CONNECTION_EVENT__bindgen_ty_1, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union QUIC_CONNECTION_EVENT__bindgen_ty_1 { + pub CONNECTED: QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_1, + pub SHUTDOWN_INITIATED_BY_TRANSPORT: QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_2, + pub SHUTDOWN_INITIATED_BY_PEER: QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_3, + pub SHUTDOWN_COMPLETE: QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_4, + pub LOCAL_ADDRESS_CHANGED: QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_5, + pub PEER_ADDRESS_CHANGED: QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_6, + pub PEER_STREAM_STARTED: QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_7, + pub STREAMS_AVAILABLE: QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_8, + pub PEER_NEEDS_STREAMS: QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_9, + pub IDEAL_PROCESSOR_CHANGED: QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_10, + pub DATAGRAM_STATE_CHANGED: QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_11, + pub DATAGRAM_RECEIVED: QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_12, + pub DATAGRAM_SEND_STATE_CHANGED: QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_13, + pub RESUMED: QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_14, + pub RESUMPTION_TICKET_RECEIVED: QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_15, + pub PEER_CERTIFICATE_RECEIVED: QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_16, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_1 { + pub SessionResumed: BOOLEAN, + pub NegotiatedAlpnLength: u8, + pub NegotiatedAlpn: *const u8, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_1"] + [::std::mem::size_of::() - 16usize]; + ["Alignment of QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_1"] + [::std::mem::align_of::() - 8usize]; + ["Offset of field: QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_1::SessionResumed"][::std::mem::offset_of!( + QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_1, + SessionResumed + ) + - 0usize]; + ["Offset of field: QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_1::NegotiatedAlpnLength"][::std::mem::offset_of!( + QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_1, + NegotiatedAlpnLength + ) + - 1usize]; + ["Offset of field: QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_1::NegotiatedAlpn"][::std::mem::offset_of!( + QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_1, + NegotiatedAlpn + ) + - 8usize]; +}; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_2 { + pub Status: HRESULT, + pub ErrorCode: QUIC_UINT62, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_2"] + [::std::mem::size_of::() - 16usize]; + ["Alignment of QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_2"] + [::std::mem::align_of::() - 8usize]; + ["Offset of field: QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_2::Status"][::std::mem::offset_of!( + QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_2, + Status + ) - 0usize]; + ["Offset of field: QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_2::ErrorCode"][::std::mem::offset_of!( + QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_2, + ErrorCode + ) - 8usize]; +}; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_3 { + pub ErrorCode: QUIC_UINT62, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_3"] + [::std::mem::size_of::() - 8usize]; + ["Alignment of QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_3"] + [::std::mem::align_of::() - 8usize]; + ["Offset of field: QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_3::ErrorCode"][::std::mem::offset_of!( + QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_3, + ErrorCode + ) - 0usize]; +}; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_4 { + pub _bitfield_align_1: [u8; 0], + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize]>, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_4"] + [::std::mem::size_of::() - 1usize]; + ["Alignment of QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_4"] + [::std::mem::align_of::() - 1usize]; +}; +impl QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_4 { + #[inline] + pub fn HandshakeCompleted(&self) -> BOOLEAN { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u8) } + } + #[inline] + pub fn set_HandshakeCompleted(&mut self, val: BOOLEAN) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn HandshakeCompleted_raw(this: *const Self) -> BOOLEAN { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 0usize, + 1u8, + ) as u8) + } + } + #[inline] + pub unsafe fn set_HandshakeCompleted_raw(this: *mut Self, val: BOOLEAN) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 0usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn PeerAcknowledgedShutdown(&self) -> BOOLEAN { + unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u8) } + } + #[inline] + pub fn set_PeerAcknowledgedShutdown(&mut self, val: BOOLEAN) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + self._bitfield_1.set(1usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn PeerAcknowledgedShutdown_raw(this: *const Self) -> BOOLEAN { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 1usize, + 1u8, + ) as u8) + } + } + #[inline] + pub unsafe fn set_PeerAcknowledgedShutdown_raw(this: *mut Self, val: BOOLEAN) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 1usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn AppCloseInProgress(&self) -> BOOLEAN { + unsafe { ::std::mem::transmute(self._bitfield_1.get(2usize, 1u8) as u8) } + } + #[inline] + pub fn set_AppCloseInProgress(&mut self, val: BOOLEAN) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + self._bitfield_1.set(2usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn AppCloseInProgress_raw(this: *const Self) -> BOOLEAN { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 2usize, + 1u8, + ) as u8) + } + } + #[inline] + pub unsafe fn set_AppCloseInProgress_raw(this: *mut Self, val: BOOLEAN) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 2usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn new_bitfield_1( + HandshakeCompleted: BOOLEAN, + PeerAcknowledgedShutdown: BOOLEAN, + AppCloseInProgress: BOOLEAN, + ) -> __BindgenBitfieldUnit<[u8; 1usize]> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize]> = Default::default(); + __bindgen_bitfield_unit.set(0usize, 1u8, { + let HandshakeCompleted: u8 = unsafe { ::std::mem::transmute(HandshakeCompleted) }; + HandshakeCompleted as u64 + }); + __bindgen_bitfield_unit.set(1usize, 1u8, { + let PeerAcknowledgedShutdown: u8 = + unsafe { ::std::mem::transmute(PeerAcknowledgedShutdown) }; + PeerAcknowledgedShutdown as u64 + }); + __bindgen_bitfield_unit.set(2usize, 1u8, { + let AppCloseInProgress: u8 = unsafe { ::std::mem::transmute(AppCloseInProgress) }; + AppCloseInProgress as u64 + }); + __bindgen_bitfield_unit + } +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_5 { + pub Address: *const QUIC_ADDR, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_5"] + [::std::mem::size_of::() - 8usize]; + ["Alignment of QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_5"] + [::std::mem::align_of::() - 8usize]; + ["Offset of field: QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_5::Address"][::std::mem::offset_of!( + QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_5, + Address + ) - 0usize]; +}; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_6 { + pub Address: *const QUIC_ADDR, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_6"] + [::std::mem::size_of::() - 8usize]; + ["Alignment of QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_6"] + [::std::mem::align_of::() - 8usize]; + ["Offset of field: QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_6::Address"][::std::mem::offset_of!( + QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_6, + Address + ) - 0usize]; +}; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_7 { + pub Stream: HQUIC, + pub Flags: QUIC_STREAM_OPEN_FLAGS, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_7"] + [::std::mem::size_of::() - 16usize]; + ["Alignment of QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_7"] + [::std::mem::align_of::() - 8usize]; + ["Offset of field: QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_7::Stream"][::std::mem::offset_of!( + QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_7, + Stream + ) - 0usize]; + ["Offset of field: QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_7::Flags"] + [::std::mem::offset_of!(QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_7, Flags) - 8usize]; +}; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_8 { + pub BidirectionalCount: u16, + pub UnidirectionalCount: u16, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_8"] + [::std::mem::size_of::() - 4usize]; + ["Alignment of QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_8"] + [::std::mem::align_of::() - 2usize]; + ["Offset of field: QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_8::BidirectionalCount"][::std::mem::offset_of!( + QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_8, + BidirectionalCount + ) + - 0usize]; + ["Offset of field: QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_8::UnidirectionalCount"][::std::mem::offset_of!( + QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_8, + UnidirectionalCount + ) + - 2usize]; +}; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_9 { + pub Bidirectional: BOOLEAN, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_9"] + [::std::mem::size_of::() - 1usize]; + ["Alignment of QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_9"] + [::std::mem::align_of::() - 1usize]; + ["Offset of field: QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_9::Bidirectional"][::std::mem::offset_of!( + QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_9, + Bidirectional + ) + - 0usize]; +}; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_10 { + pub IdealProcessor: u16, + pub PartitionIndex: u16, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_10"] + [::std::mem::size_of::() - 4usize]; + ["Alignment of QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_10"] + [::std::mem::align_of::() - 2usize]; + ["Offset of field: QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_10::IdealProcessor"][::std::mem::offset_of!( + QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_10, + IdealProcessor + ) + - 0usize]; + ["Offset of field: QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_10::PartitionIndex"][::std::mem::offset_of!( + QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_10, + PartitionIndex + ) + - 2usize]; +}; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_11 { + pub SendEnabled: BOOLEAN, + pub MaxSendLength: u16, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_11"] + [::std::mem::size_of::() - 4usize]; + ["Alignment of QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_11"] + [::std::mem::align_of::() - 2usize]; + ["Offset of field: QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_11::SendEnabled"][::std::mem::offset_of!( + QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_11, + SendEnabled + ) + - 0usize]; + ["Offset of field: QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_11::MaxSendLength"][::std::mem::offset_of!( + QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_11, + MaxSendLength + ) + - 2usize]; +}; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_12 { + pub Buffer: *const QUIC_BUFFER, + pub Flags: QUIC_RECEIVE_FLAGS, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_12"] + [::std::mem::size_of::() - 16usize]; + ["Alignment of QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_12"] + [::std::mem::align_of::() - 8usize]; + ["Offset of field: QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_12::Buffer"][::std::mem::offset_of!( + QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_12, + Buffer + ) - 0usize]; + ["Offset of field: QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_12::Flags"][::std::mem::offset_of!( + QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_12, + Flags + ) - 8usize]; +}; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_13 { + pub ClientContext: *mut ::std::os::raw::c_void, + pub State: QUIC_DATAGRAM_SEND_STATE, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_13"] + [::std::mem::size_of::() - 16usize]; + ["Alignment of QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_13"] + [::std::mem::align_of::() - 8usize]; + ["Offset of field: QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_13::ClientContext"][::std::mem::offset_of!( + QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_13, + ClientContext + ) + - 0usize]; + ["Offset of field: QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_13::State"][::std::mem::offset_of!( + QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_13, + State + ) - 8usize]; +}; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_14 { + pub ResumptionStateLength: u16, + pub ResumptionState: *const u8, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_14"] + [::std::mem::size_of::() - 16usize]; + ["Alignment of QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_14"] + [::std::mem::align_of::() - 8usize]; + ["Offset of field: QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_14::ResumptionStateLength"] [:: std :: mem :: offset_of ! (QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_14 , ResumptionStateLength) - 0usize] ; + ["Offset of field: QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_14::ResumptionState"][::std::mem::offset_of!( + QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_14, + ResumptionState + ) + - 8usize]; +}; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_15 { + pub ResumptionTicketLength: u32, + pub ResumptionTicket: *const u8, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_15"] + [::std::mem::size_of::() - 16usize]; + ["Alignment of QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_15"] + [::std::mem::align_of::() - 8usize]; + ["Offset of field: QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_15::ResumptionTicketLength"] [:: std :: mem :: offset_of ! (QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_15 , ResumptionTicketLength) - 0usize] ; + ["Offset of field: QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_15::ResumptionTicket"][::std::mem::offset_of!( + QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_15, + ResumptionTicket + ) + - 8usize]; +}; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_16 { + pub Certificate: *mut QUIC_CERTIFICATE, + pub DeferredErrorFlags: u32, + pub DeferredStatus: HRESULT, + pub Chain: *mut QUIC_CERTIFICATE_CHAIN, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_16"] + [::std::mem::size_of::() - 24usize]; + ["Alignment of QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_16"] + [::std::mem::align_of::() - 8usize]; + ["Offset of field: QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_16::Certificate"][::std::mem::offset_of!( + QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_16, + Certificate + ) + - 0usize]; + ["Offset of field: QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_16::DeferredErrorFlags"][::std::mem::offset_of!( + QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_16, + DeferredErrorFlags + ) + - 8usize]; + ["Offset of field: QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_16::DeferredStatus"][::std::mem::offset_of!( + QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_16, + DeferredStatus + ) + - 12usize]; + ["Offset of field: QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_16::Chain"][::std::mem::offset_of!( + QUIC_CONNECTION_EVENT__bindgen_ty_1__bindgen_ty_16, + Chain + ) - 16usize]; +}; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of QUIC_CONNECTION_EVENT__bindgen_ty_1"] + [::std::mem::size_of::() - 24usize]; + ["Alignment of QUIC_CONNECTION_EVENT__bindgen_ty_1"] + [::std::mem::align_of::() - 8usize]; + ["Offset of field: QUIC_CONNECTION_EVENT__bindgen_ty_1::CONNECTED"] + [::std::mem::offset_of!(QUIC_CONNECTION_EVENT__bindgen_ty_1, CONNECTED) - 0usize]; + ["Offset of field: QUIC_CONNECTION_EVENT__bindgen_ty_1::SHUTDOWN_INITIATED_BY_TRANSPORT"][::std::mem::offset_of!( + QUIC_CONNECTION_EVENT__bindgen_ty_1, + SHUTDOWN_INITIATED_BY_TRANSPORT + ) + - 0usize]; + ["Offset of field: QUIC_CONNECTION_EVENT__bindgen_ty_1::SHUTDOWN_INITIATED_BY_PEER"][::std::mem::offset_of!( + QUIC_CONNECTION_EVENT__bindgen_ty_1, + SHUTDOWN_INITIATED_BY_PEER + ) + - 0usize]; + ["Offset of field: QUIC_CONNECTION_EVENT__bindgen_ty_1::SHUTDOWN_COMPLETE"] + [::std::mem::offset_of!(QUIC_CONNECTION_EVENT__bindgen_ty_1, SHUTDOWN_COMPLETE) - 0usize]; + ["Offset of field: QUIC_CONNECTION_EVENT__bindgen_ty_1::LOCAL_ADDRESS_CHANGED"][::std::mem::offset_of!( + QUIC_CONNECTION_EVENT__bindgen_ty_1, + LOCAL_ADDRESS_CHANGED + ) - 0usize]; + ["Offset of field: QUIC_CONNECTION_EVENT__bindgen_ty_1::PEER_ADDRESS_CHANGED"][::std::mem::offset_of!( + QUIC_CONNECTION_EVENT__bindgen_ty_1, + PEER_ADDRESS_CHANGED + ) - 0usize]; + ["Offset of field: QUIC_CONNECTION_EVENT__bindgen_ty_1::PEER_STREAM_STARTED"] + [::std::mem::offset_of!(QUIC_CONNECTION_EVENT__bindgen_ty_1, PEER_STREAM_STARTED) - 0usize]; + ["Offset of field: QUIC_CONNECTION_EVENT__bindgen_ty_1::STREAMS_AVAILABLE"] + [::std::mem::offset_of!(QUIC_CONNECTION_EVENT__bindgen_ty_1, STREAMS_AVAILABLE) - 0usize]; + ["Offset of field: QUIC_CONNECTION_EVENT__bindgen_ty_1::PEER_NEEDS_STREAMS"] + [::std::mem::offset_of!(QUIC_CONNECTION_EVENT__bindgen_ty_1, PEER_NEEDS_STREAMS) - 0usize]; + ["Offset of field: QUIC_CONNECTION_EVENT__bindgen_ty_1::IDEAL_PROCESSOR_CHANGED"][::std::mem::offset_of!( + QUIC_CONNECTION_EVENT__bindgen_ty_1, + IDEAL_PROCESSOR_CHANGED + ) - 0usize]; + ["Offset of field: QUIC_CONNECTION_EVENT__bindgen_ty_1::DATAGRAM_STATE_CHANGED"][::std::mem::offset_of!( + QUIC_CONNECTION_EVENT__bindgen_ty_1, + DATAGRAM_STATE_CHANGED + ) - 0usize]; + ["Offset of field: QUIC_CONNECTION_EVENT__bindgen_ty_1::DATAGRAM_RECEIVED"] + [::std::mem::offset_of!(QUIC_CONNECTION_EVENT__bindgen_ty_1, DATAGRAM_RECEIVED) - 0usize]; + ["Offset of field: QUIC_CONNECTION_EVENT__bindgen_ty_1::DATAGRAM_SEND_STATE_CHANGED"][::std::mem::offset_of!( + QUIC_CONNECTION_EVENT__bindgen_ty_1, + DATAGRAM_SEND_STATE_CHANGED + ) + - 0usize]; + ["Offset of field: QUIC_CONNECTION_EVENT__bindgen_ty_1::RESUMED"] + [::std::mem::offset_of!(QUIC_CONNECTION_EVENT__bindgen_ty_1, RESUMED) - 0usize]; + ["Offset of field: QUIC_CONNECTION_EVENT__bindgen_ty_1::RESUMPTION_TICKET_RECEIVED"][::std::mem::offset_of!( + QUIC_CONNECTION_EVENT__bindgen_ty_1, + RESUMPTION_TICKET_RECEIVED + ) + - 0usize]; + ["Offset of field: QUIC_CONNECTION_EVENT__bindgen_ty_1::PEER_CERTIFICATE_RECEIVED"][::std::mem::offset_of!( + QUIC_CONNECTION_EVENT__bindgen_ty_1, + PEER_CERTIFICATE_RECEIVED + ) - 0usize]; +}; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of QUIC_CONNECTION_EVENT"][::std::mem::size_of::() - 32usize]; + ["Alignment of QUIC_CONNECTION_EVENT"] + [::std::mem::align_of::() - 8usize]; + ["Offset of field: QUIC_CONNECTION_EVENT::Type"] + [::std::mem::offset_of!(QUIC_CONNECTION_EVENT, Type) - 0usize]; +}; +pub type QUIC_CONNECTION_CALLBACK_HANDLER = ::std::option::Option< + unsafe extern "C" fn( + arg1: HQUIC, + arg2: *mut ::std::os::raw::c_void, + arg3: *mut QUIC_CONNECTION_EVENT, + ) -> HRESULT, +>; +pub type QUIC_CONNECTION_OPEN_FN = ::std::option::Option< + unsafe extern "C" fn( + Registration: HQUIC, + Handler: QUIC_CONNECTION_CALLBACK_HANDLER, + Context: *mut ::std::os::raw::c_void, + Connection: *mut HQUIC, + ) -> HRESULT, +>; +pub type QUIC_CONNECTION_CLOSE_FN = ::std::option::Option; +pub type QUIC_CONNECTION_SHUTDOWN_FN = ::std::option::Option< + unsafe extern "C" fn( + Connection: HQUIC, + Flags: QUIC_CONNECTION_SHUTDOWN_FLAGS, + ErrorCode: QUIC_UINT62, + ), +>; +pub type QUIC_CONNECTION_START_FN = ::std::option::Option< + unsafe extern "C" fn( + Connection: HQUIC, + Configuration: HQUIC, + Family: QUIC_ADDRESS_FAMILY, + ServerName: *const ::std::os::raw::c_char, + ServerPort: u16, + ) -> HRESULT, +>; +pub type QUIC_CONNECTION_SET_CONFIGURATION_FN = + ::std::option::Option HRESULT>; +pub type QUIC_CONNECTION_SEND_RESUMPTION_FN = ::std::option::Option< + unsafe extern "C" fn( + Connection: HQUIC, + Flags: QUIC_SEND_RESUMPTION_FLAGS, + DataLength: u16, + ResumptionData: *const u8, + ) -> HRESULT, +>; +pub type QUIC_CONNECTION_COMP_RESUMPTION_FN = + ::std::option::Option HRESULT>; +pub type QUIC_CONNECTION_COMP_CERT_FN = ::std::option::Option< + unsafe extern "C" fn( + Connection: HQUIC, + Result: BOOLEAN, + TlsAlert: QUIC_TLS_ALERT_CODES, + ) -> HRESULT, +>; +pub const QUIC_STREAM_EVENT_TYPE_QUIC_STREAM_EVENT_START_COMPLETE: QUIC_STREAM_EVENT_TYPE = 0; +pub const QUIC_STREAM_EVENT_TYPE_QUIC_STREAM_EVENT_RECEIVE: QUIC_STREAM_EVENT_TYPE = 1; +pub const QUIC_STREAM_EVENT_TYPE_QUIC_STREAM_EVENT_SEND_COMPLETE: QUIC_STREAM_EVENT_TYPE = 2; +pub const QUIC_STREAM_EVENT_TYPE_QUIC_STREAM_EVENT_PEER_SEND_SHUTDOWN: QUIC_STREAM_EVENT_TYPE = 3; +pub const QUIC_STREAM_EVENT_TYPE_QUIC_STREAM_EVENT_PEER_SEND_ABORTED: QUIC_STREAM_EVENT_TYPE = 4; +pub const QUIC_STREAM_EVENT_TYPE_QUIC_STREAM_EVENT_PEER_RECEIVE_ABORTED: QUIC_STREAM_EVENT_TYPE = 5; +pub const QUIC_STREAM_EVENT_TYPE_QUIC_STREAM_EVENT_SEND_SHUTDOWN_COMPLETE: QUIC_STREAM_EVENT_TYPE = + 6; +pub const QUIC_STREAM_EVENT_TYPE_QUIC_STREAM_EVENT_SHUTDOWN_COMPLETE: QUIC_STREAM_EVENT_TYPE = 7; +pub const QUIC_STREAM_EVENT_TYPE_QUIC_STREAM_EVENT_IDEAL_SEND_BUFFER_SIZE: QUIC_STREAM_EVENT_TYPE = + 8; +pub const QUIC_STREAM_EVENT_TYPE_QUIC_STREAM_EVENT_PEER_ACCEPTED: QUIC_STREAM_EVENT_TYPE = 9; +pub const QUIC_STREAM_EVENT_TYPE_QUIC_STREAM_EVENT_CANCEL_ON_LOSS: QUIC_STREAM_EVENT_TYPE = 10; +pub type QUIC_STREAM_EVENT_TYPE = ::std::os::raw::c_int; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct QUIC_STREAM_EVENT { + pub Type: QUIC_STREAM_EVENT_TYPE, + pub __bindgen_anon_1: QUIC_STREAM_EVENT__bindgen_ty_1, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union QUIC_STREAM_EVENT__bindgen_ty_1 { + pub START_COMPLETE: QUIC_STREAM_EVENT__bindgen_ty_1__bindgen_ty_1, + pub RECEIVE: QUIC_STREAM_EVENT__bindgen_ty_1__bindgen_ty_2, + pub SEND_COMPLETE: QUIC_STREAM_EVENT__bindgen_ty_1__bindgen_ty_3, + pub PEER_SEND_ABORTED: QUIC_STREAM_EVENT__bindgen_ty_1__bindgen_ty_4, + pub PEER_RECEIVE_ABORTED: QUIC_STREAM_EVENT__bindgen_ty_1__bindgen_ty_5, + pub SEND_SHUTDOWN_COMPLETE: QUIC_STREAM_EVENT__bindgen_ty_1__bindgen_ty_6, + pub SHUTDOWN_COMPLETE: QUIC_STREAM_EVENT__bindgen_ty_1__bindgen_ty_7, + pub IDEAL_SEND_BUFFER_SIZE: QUIC_STREAM_EVENT__bindgen_ty_1__bindgen_ty_8, + pub CANCEL_ON_LOSS: QUIC_STREAM_EVENT__bindgen_ty_1__bindgen_ty_9, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct QUIC_STREAM_EVENT__bindgen_ty_1__bindgen_ty_1 { + pub Status: HRESULT, + pub ID: QUIC_UINT62, + pub _bitfield_align_1: [u8; 0], + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize]>, + pub __bindgen_padding_0: [u8; 7usize], +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of QUIC_STREAM_EVENT__bindgen_ty_1__bindgen_ty_1"] + [::std::mem::size_of::() - 24usize]; + ["Alignment of QUIC_STREAM_EVENT__bindgen_ty_1__bindgen_ty_1"] + [::std::mem::align_of::() - 8usize]; + ["Offset of field: QUIC_STREAM_EVENT__bindgen_ty_1__bindgen_ty_1::Status"] + [::std::mem::offset_of!(QUIC_STREAM_EVENT__bindgen_ty_1__bindgen_ty_1, Status) - 0usize]; + ["Offset of field: QUIC_STREAM_EVENT__bindgen_ty_1__bindgen_ty_1::ID"] + [::std::mem::offset_of!(QUIC_STREAM_EVENT__bindgen_ty_1__bindgen_ty_1, ID) - 8usize]; +}; +impl QUIC_STREAM_EVENT__bindgen_ty_1__bindgen_ty_1 { + #[inline] + pub fn PeerAccepted(&self) -> BOOLEAN { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u8) } + } + #[inline] + pub fn set_PeerAccepted(&mut self, val: BOOLEAN) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn PeerAccepted_raw(this: *const Self) -> BOOLEAN { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 0usize, + 1u8, + ) as u8) + } + } + #[inline] + pub unsafe fn set_PeerAccepted_raw(this: *mut Self, val: BOOLEAN) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 0usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn RESERVED(&self) -> BOOLEAN { + unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 7u8) as u8) } + } + #[inline] + pub fn set_RESERVED(&mut self, val: BOOLEAN) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + self._bitfield_1.set(1usize, 7u8, val as u64) + } + } + #[inline] + pub unsafe fn RESERVED_raw(this: *const Self) -> BOOLEAN { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 1usize, + 7u8, + ) as u8) + } + } + #[inline] + pub unsafe fn set_RESERVED_raw(this: *mut Self, val: BOOLEAN) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 1usize, + 7u8, + val as u64, + ) + } + } + #[inline] + pub fn new_bitfield_1( + PeerAccepted: BOOLEAN, + RESERVED: BOOLEAN, + ) -> __BindgenBitfieldUnit<[u8; 1usize]> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize]> = Default::default(); + __bindgen_bitfield_unit.set(0usize, 1u8, { + let PeerAccepted: u8 = unsafe { ::std::mem::transmute(PeerAccepted) }; + PeerAccepted as u64 + }); + __bindgen_bitfield_unit.set(1usize, 7u8, { + let RESERVED: u8 = unsafe { ::std::mem::transmute(RESERVED) }; + RESERVED as u64 + }); + __bindgen_bitfield_unit + } +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct QUIC_STREAM_EVENT__bindgen_ty_1__bindgen_ty_2 { + pub AbsoluteOffset: u64, + pub TotalBufferLength: u64, + pub Buffers: *const QUIC_BUFFER, + pub BufferCount: u32, + pub Flags: QUIC_RECEIVE_FLAGS, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of QUIC_STREAM_EVENT__bindgen_ty_1__bindgen_ty_2"] + [::std::mem::size_of::() - 32usize]; + ["Alignment of QUIC_STREAM_EVENT__bindgen_ty_1__bindgen_ty_2"] + [::std::mem::align_of::() - 8usize]; + ["Offset of field: QUIC_STREAM_EVENT__bindgen_ty_1__bindgen_ty_2::AbsoluteOffset"][::std::mem::offset_of!( + QUIC_STREAM_EVENT__bindgen_ty_1__bindgen_ty_2, + AbsoluteOffset + ) - 0usize]; + ["Offset of field: QUIC_STREAM_EVENT__bindgen_ty_1__bindgen_ty_2::TotalBufferLength"][::std::mem::offset_of!( + QUIC_STREAM_EVENT__bindgen_ty_1__bindgen_ty_2, + TotalBufferLength + ) + - 8usize]; + ["Offset of field: QUIC_STREAM_EVENT__bindgen_ty_1__bindgen_ty_2::Buffers"] + [::std::mem::offset_of!(QUIC_STREAM_EVENT__bindgen_ty_1__bindgen_ty_2, Buffers) - 16usize]; + ["Offset of field: QUIC_STREAM_EVENT__bindgen_ty_1__bindgen_ty_2::BufferCount"][::std::mem::offset_of!( + QUIC_STREAM_EVENT__bindgen_ty_1__bindgen_ty_2, + BufferCount + ) - 24usize]; + ["Offset of field: QUIC_STREAM_EVENT__bindgen_ty_1__bindgen_ty_2::Flags"] + [::std::mem::offset_of!(QUIC_STREAM_EVENT__bindgen_ty_1__bindgen_ty_2, Flags) - 28usize]; +}; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct QUIC_STREAM_EVENT__bindgen_ty_1__bindgen_ty_3 { + pub Canceled: BOOLEAN, + pub ClientContext: *mut ::std::os::raw::c_void, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of QUIC_STREAM_EVENT__bindgen_ty_1__bindgen_ty_3"] + [::std::mem::size_of::() - 16usize]; + ["Alignment of QUIC_STREAM_EVENT__bindgen_ty_1__bindgen_ty_3"] + [::std::mem::align_of::() - 8usize]; + ["Offset of field: QUIC_STREAM_EVENT__bindgen_ty_1__bindgen_ty_3::Canceled"] + [::std::mem::offset_of!(QUIC_STREAM_EVENT__bindgen_ty_1__bindgen_ty_3, Canceled) - 0usize]; + ["Offset of field: QUIC_STREAM_EVENT__bindgen_ty_1__bindgen_ty_3::ClientContext"][::std::mem::offset_of!( + QUIC_STREAM_EVENT__bindgen_ty_1__bindgen_ty_3, + ClientContext + ) - 8usize]; +}; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct QUIC_STREAM_EVENT__bindgen_ty_1__bindgen_ty_4 { + pub ErrorCode: QUIC_UINT62, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of QUIC_STREAM_EVENT__bindgen_ty_1__bindgen_ty_4"] + [::std::mem::size_of::() - 8usize]; + ["Alignment of QUIC_STREAM_EVENT__bindgen_ty_1__bindgen_ty_4"] + [::std::mem::align_of::() - 8usize]; + ["Offset of field: QUIC_STREAM_EVENT__bindgen_ty_1__bindgen_ty_4::ErrorCode"] + [::std::mem::offset_of!(QUIC_STREAM_EVENT__bindgen_ty_1__bindgen_ty_4, ErrorCode) - 0usize]; +}; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct QUIC_STREAM_EVENT__bindgen_ty_1__bindgen_ty_5 { + pub ErrorCode: QUIC_UINT62, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of QUIC_STREAM_EVENT__bindgen_ty_1__bindgen_ty_5"] + [::std::mem::size_of::() - 8usize]; + ["Alignment of QUIC_STREAM_EVENT__bindgen_ty_1__bindgen_ty_5"] + [::std::mem::align_of::() - 8usize]; + ["Offset of field: QUIC_STREAM_EVENT__bindgen_ty_1__bindgen_ty_5::ErrorCode"] + [::std::mem::offset_of!(QUIC_STREAM_EVENT__bindgen_ty_1__bindgen_ty_5, ErrorCode) - 0usize]; +}; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct QUIC_STREAM_EVENT__bindgen_ty_1__bindgen_ty_6 { + pub Graceful: BOOLEAN, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of QUIC_STREAM_EVENT__bindgen_ty_1__bindgen_ty_6"] + [::std::mem::size_of::() - 1usize]; + ["Alignment of QUIC_STREAM_EVENT__bindgen_ty_1__bindgen_ty_6"] + [::std::mem::align_of::() - 1usize]; + ["Offset of field: QUIC_STREAM_EVENT__bindgen_ty_1__bindgen_ty_6::Graceful"] + [::std::mem::offset_of!(QUIC_STREAM_EVENT__bindgen_ty_1__bindgen_ty_6, Graceful) - 0usize]; +}; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct QUIC_STREAM_EVENT__bindgen_ty_1__bindgen_ty_7 { + pub ConnectionShutdown: BOOLEAN, + pub _bitfield_align_1: [u8; 0], + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize]>, + pub ConnectionErrorCode: QUIC_UINT62, + pub ConnectionCloseStatus: HRESULT, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of QUIC_STREAM_EVENT__bindgen_ty_1__bindgen_ty_7"] + [::std::mem::size_of::() - 24usize]; + ["Alignment of QUIC_STREAM_EVENT__bindgen_ty_1__bindgen_ty_7"] + [::std::mem::align_of::() - 8usize]; + ["Offset of field: QUIC_STREAM_EVENT__bindgen_ty_1__bindgen_ty_7::ConnectionShutdown"][::std::mem::offset_of!( + QUIC_STREAM_EVENT__bindgen_ty_1__bindgen_ty_7, + ConnectionShutdown + ) + - 0usize]; + ["Offset of field: QUIC_STREAM_EVENT__bindgen_ty_1__bindgen_ty_7::ConnectionErrorCode"][::std::mem::offset_of!( + QUIC_STREAM_EVENT__bindgen_ty_1__bindgen_ty_7, + ConnectionErrorCode + ) + - 8usize]; + ["Offset of field: QUIC_STREAM_EVENT__bindgen_ty_1__bindgen_ty_7::ConnectionCloseStatus"][::std::mem::offset_of!( + QUIC_STREAM_EVENT__bindgen_ty_1__bindgen_ty_7, + ConnectionCloseStatus + ) + - 16usize]; +}; +impl QUIC_STREAM_EVENT__bindgen_ty_1__bindgen_ty_7 { + #[inline] + pub fn AppCloseInProgress(&self) -> BOOLEAN { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u8) } + } + #[inline] + pub fn set_AppCloseInProgress(&mut self, val: BOOLEAN) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn AppCloseInProgress_raw(this: *const Self) -> BOOLEAN { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 0usize, + 1u8, + ) as u8) + } + } + #[inline] + pub unsafe fn set_AppCloseInProgress_raw(this: *mut Self, val: BOOLEAN) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 0usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn ConnectionShutdownByApp(&self) -> BOOLEAN { + unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u8) } + } + #[inline] + pub fn set_ConnectionShutdownByApp(&mut self, val: BOOLEAN) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + self._bitfield_1.set(1usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn ConnectionShutdownByApp_raw(this: *const Self) -> BOOLEAN { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 1usize, + 1u8, + ) as u8) + } + } + #[inline] + pub unsafe fn set_ConnectionShutdownByApp_raw(this: *mut Self, val: BOOLEAN) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 1usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn ConnectionClosedRemotely(&self) -> BOOLEAN { + unsafe { ::std::mem::transmute(self._bitfield_1.get(2usize, 1u8) as u8) } + } + #[inline] + pub fn set_ConnectionClosedRemotely(&mut self, val: BOOLEAN) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + self._bitfield_1.set(2usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn ConnectionClosedRemotely_raw(this: *const Self) -> BOOLEAN { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 2usize, + 1u8, + ) as u8) + } + } + #[inline] + pub unsafe fn set_ConnectionClosedRemotely_raw(this: *mut Self, val: BOOLEAN) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 2usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn RESERVED(&self) -> BOOLEAN { + unsafe { ::std::mem::transmute(self._bitfield_1.get(3usize, 5u8) as u8) } + } + #[inline] + pub fn set_RESERVED(&mut self, val: BOOLEAN) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + self._bitfield_1.set(3usize, 5u8, val as u64) + } + } + #[inline] + pub unsafe fn RESERVED_raw(this: *const Self) -> BOOLEAN { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 3usize, + 5u8, + ) as u8) + } + } + #[inline] + pub unsafe fn set_RESERVED_raw(this: *mut Self, val: BOOLEAN) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 3usize, + 5u8, + val as u64, + ) + } + } + #[inline] + pub fn new_bitfield_1( + AppCloseInProgress: BOOLEAN, + ConnectionShutdownByApp: BOOLEAN, + ConnectionClosedRemotely: BOOLEAN, + RESERVED: BOOLEAN, + ) -> __BindgenBitfieldUnit<[u8; 1usize]> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize]> = Default::default(); + __bindgen_bitfield_unit.set(0usize, 1u8, { + let AppCloseInProgress: u8 = unsafe { ::std::mem::transmute(AppCloseInProgress) }; + AppCloseInProgress as u64 + }); + __bindgen_bitfield_unit.set(1usize, 1u8, { + let ConnectionShutdownByApp: u8 = + unsafe { ::std::mem::transmute(ConnectionShutdownByApp) }; + ConnectionShutdownByApp as u64 + }); + __bindgen_bitfield_unit.set(2usize, 1u8, { + let ConnectionClosedRemotely: u8 = + unsafe { ::std::mem::transmute(ConnectionClosedRemotely) }; + ConnectionClosedRemotely as u64 + }); + __bindgen_bitfield_unit.set(3usize, 5u8, { + let RESERVED: u8 = unsafe { ::std::mem::transmute(RESERVED) }; + RESERVED as u64 + }); + __bindgen_bitfield_unit + } +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct QUIC_STREAM_EVENT__bindgen_ty_1__bindgen_ty_8 { + pub ByteCount: u64, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of QUIC_STREAM_EVENT__bindgen_ty_1__bindgen_ty_8"] + [::std::mem::size_of::() - 8usize]; + ["Alignment of QUIC_STREAM_EVENT__bindgen_ty_1__bindgen_ty_8"] + [::std::mem::align_of::() - 8usize]; + ["Offset of field: QUIC_STREAM_EVENT__bindgen_ty_1__bindgen_ty_8::ByteCount"] + [::std::mem::offset_of!(QUIC_STREAM_EVENT__bindgen_ty_1__bindgen_ty_8, ByteCount) - 0usize]; +}; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct QUIC_STREAM_EVENT__bindgen_ty_1__bindgen_ty_9 { + pub ErrorCode: QUIC_UINT62, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of QUIC_STREAM_EVENT__bindgen_ty_1__bindgen_ty_9"] + [::std::mem::size_of::() - 8usize]; + ["Alignment of QUIC_STREAM_EVENT__bindgen_ty_1__bindgen_ty_9"] + [::std::mem::align_of::() - 8usize]; + ["Offset of field: QUIC_STREAM_EVENT__bindgen_ty_1__bindgen_ty_9::ErrorCode"] + [::std::mem::offset_of!(QUIC_STREAM_EVENT__bindgen_ty_1__bindgen_ty_9, ErrorCode) - 0usize]; +}; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of QUIC_STREAM_EVENT__bindgen_ty_1"] + [::std::mem::size_of::() - 32usize]; + ["Alignment of QUIC_STREAM_EVENT__bindgen_ty_1"] + [::std::mem::align_of::() - 8usize]; + ["Offset of field: QUIC_STREAM_EVENT__bindgen_ty_1::START_COMPLETE"] + [::std::mem::offset_of!(QUIC_STREAM_EVENT__bindgen_ty_1, START_COMPLETE) - 0usize]; + ["Offset of field: QUIC_STREAM_EVENT__bindgen_ty_1::RECEIVE"] + [::std::mem::offset_of!(QUIC_STREAM_EVENT__bindgen_ty_1, RECEIVE) - 0usize]; + ["Offset of field: QUIC_STREAM_EVENT__bindgen_ty_1::SEND_COMPLETE"] + [::std::mem::offset_of!(QUIC_STREAM_EVENT__bindgen_ty_1, SEND_COMPLETE) - 0usize]; + ["Offset of field: QUIC_STREAM_EVENT__bindgen_ty_1::PEER_SEND_ABORTED"] + [::std::mem::offset_of!(QUIC_STREAM_EVENT__bindgen_ty_1, PEER_SEND_ABORTED) - 0usize]; + ["Offset of field: QUIC_STREAM_EVENT__bindgen_ty_1::PEER_RECEIVE_ABORTED"] + [::std::mem::offset_of!(QUIC_STREAM_EVENT__bindgen_ty_1, PEER_RECEIVE_ABORTED) - 0usize]; + ["Offset of field: QUIC_STREAM_EVENT__bindgen_ty_1::SEND_SHUTDOWN_COMPLETE"] + [::std::mem::offset_of!(QUIC_STREAM_EVENT__bindgen_ty_1, SEND_SHUTDOWN_COMPLETE) - 0usize]; + ["Offset of field: QUIC_STREAM_EVENT__bindgen_ty_1::SHUTDOWN_COMPLETE"] + [::std::mem::offset_of!(QUIC_STREAM_EVENT__bindgen_ty_1, SHUTDOWN_COMPLETE) - 0usize]; + ["Offset of field: QUIC_STREAM_EVENT__bindgen_ty_1::IDEAL_SEND_BUFFER_SIZE"] + [::std::mem::offset_of!(QUIC_STREAM_EVENT__bindgen_ty_1, IDEAL_SEND_BUFFER_SIZE) - 0usize]; + ["Offset of field: QUIC_STREAM_EVENT__bindgen_ty_1::CANCEL_ON_LOSS"] + [::std::mem::offset_of!(QUIC_STREAM_EVENT__bindgen_ty_1, CANCEL_ON_LOSS) - 0usize]; +}; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of QUIC_STREAM_EVENT"][::std::mem::size_of::() - 40usize]; + ["Alignment of QUIC_STREAM_EVENT"][::std::mem::align_of::() - 8usize]; + ["Offset of field: QUIC_STREAM_EVENT::Type"] + [::std::mem::offset_of!(QUIC_STREAM_EVENT, Type) - 0usize]; +}; +pub type QUIC_STREAM_CALLBACK_HANDLER = ::std::option::Option< + unsafe extern "C" fn( + arg1: HQUIC, + arg2: *mut ::std::os::raw::c_void, + arg3: *mut QUIC_STREAM_EVENT, + ) -> HRESULT, +>; +pub type QUIC_STREAM_OPEN_FN = ::std::option::Option< + unsafe extern "C" fn( + Connection: HQUIC, + Flags: QUIC_STREAM_OPEN_FLAGS, + Handler: QUIC_STREAM_CALLBACK_HANDLER, + Context: *mut ::std::os::raw::c_void, + Stream: *mut HQUIC, + ) -> HRESULT, +>; +pub type QUIC_STREAM_CLOSE_FN = ::std::option::Option; +pub type QUIC_STREAM_START_FN = ::std::option::Option< + unsafe extern "C" fn(Stream: HQUIC, Flags: QUIC_STREAM_START_FLAGS) -> HRESULT, +>; +pub type QUIC_STREAM_SHUTDOWN_FN = ::std::option::Option< + unsafe extern "C" fn( + Stream: HQUIC, + Flags: QUIC_STREAM_SHUTDOWN_FLAGS, + ErrorCode: QUIC_UINT62, + ) -> HRESULT, +>; +pub type QUIC_STREAM_SEND_FN = ::std::option::Option< + unsafe extern "C" fn( + Stream: HQUIC, + Buffers: *const QUIC_BUFFER, + BufferCount: u32, + Flags: QUIC_SEND_FLAGS, + ClientSendContext: *mut ::std::os::raw::c_void, + ) -> HRESULT, +>; +pub type QUIC_STREAM_RECEIVE_COMPLETE_FN = + ::std::option::Option; +pub type QUIC_STREAM_RECEIVE_SET_ENABLED_FN = + ::std::option::Option HRESULT>; +pub type QUIC_DATAGRAM_SEND_FN = ::std::option::Option< + unsafe extern "C" fn( + Connection: HQUIC, + Buffers: *const QUIC_BUFFER, + BufferCount: u32, + Flags: QUIC_SEND_FLAGS, + ClientSendContext: *mut ::std::os::raw::c_void, + ) -> HRESULT, +>; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct QUIC_API_TABLE { + pub SetContext: QUIC_SET_CONTEXT_FN, + pub GetContext: QUIC_GET_CONTEXT_FN, + pub SetCallbackHandler: QUIC_SET_CALLBACK_HANDLER_FN, + pub SetParam: QUIC_SET_PARAM_FN, + pub GetParam: QUIC_GET_PARAM_FN, + pub RegistrationOpen: QUIC_REGISTRATION_OPEN_FN, + pub RegistrationClose: QUIC_REGISTRATION_CLOSE_FN, + pub RegistrationShutdown: QUIC_REGISTRATION_SHUTDOWN_FN, + pub ConfigurationOpen: QUIC_CONFIGURATION_OPEN_FN, + pub ConfigurationClose: QUIC_CONFIGURATION_CLOSE_FN, + pub ConfigurationLoadCredential: QUIC_CONFIGURATION_LOAD_CREDENTIAL_FN, + pub ListenerOpen: QUIC_LISTENER_OPEN_FN, + pub ListenerClose: QUIC_LISTENER_CLOSE_FN, + pub ListenerStart: QUIC_LISTENER_START_FN, + pub ListenerStop: QUIC_LISTENER_STOP_FN, + pub ConnectionOpen: QUIC_CONNECTION_OPEN_FN, + pub ConnectionClose: QUIC_CONNECTION_CLOSE_FN, + pub ConnectionShutdown: QUIC_CONNECTION_SHUTDOWN_FN, + pub ConnectionStart: QUIC_CONNECTION_START_FN, + pub ConnectionSetConfiguration: QUIC_CONNECTION_SET_CONFIGURATION_FN, + pub ConnectionSendResumptionTicket: QUIC_CONNECTION_SEND_RESUMPTION_FN, + pub StreamOpen: QUIC_STREAM_OPEN_FN, + pub StreamClose: QUIC_STREAM_CLOSE_FN, + pub StreamStart: QUIC_STREAM_START_FN, + pub StreamShutdown: QUIC_STREAM_SHUTDOWN_FN, + pub StreamSend: QUIC_STREAM_SEND_FN, + pub StreamReceiveComplete: QUIC_STREAM_RECEIVE_COMPLETE_FN, + pub StreamReceiveSetEnabled: QUIC_STREAM_RECEIVE_SET_ENABLED_FN, + pub DatagramSend: QUIC_DATAGRAM_SEND_FN, + pub ConnectionResumptionTicketValidationComplete: QUIC_CONNECTION_COMP_RESUMPTION_FN, + pub ConnectionCertificateValidationComplete: QUIC_CONNECTION_COMP_CERT_FN, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of QUIC_API_TABLE"][::std::mem::size_of::() - 248usize]; + ["Alignment of QUIC_API_TABLE"][::std::mem::align_of::() - 8usize]; + ["Offset of field: QUIC_API_TABLE::SetContext"] + [::std::mem::offset_of!(QUIC_API_TABLE, SetContext) - 0usize]; + ["Offset of field: QUIC_API_TABLE::GetContext"] + [::std::mem::offset_of!(QUIC_API_TABLE, GetContext) - 8usize]; + ["Offset of field: QUIC_API_TABLE::SetCallbackHandler"] + [::std::mem::offset_of!(QUIC_API_TABLE, SetCallbackHandler) - 16usize]; + ["Offset of field: QUIC_API_TABLE::SetParam"] + [::std::mem::offset_of!(QUIC_API_TABLE, SetParam) - 24usize]; + ["Offset of field: QUIC_API_TABLE::GetParam"] + [::std::mem::offset_of!(QUIC_API_TABLE, GetParam) - 32usize]; + ["Offset of field: QUIC_API_TABLE::RegistrationOpen"] + [::std::mem::offset_of!(QUIC_API_TABLE, RegistrationOpen) - 40usize]; + ["Offset of field: QUIC_API_TABLE::RegistrationClose"] + [::std::mem::offset_of!(QUIC_API_TABLE, RegistrationClose) - 48usize]; + ["Offset of field: QUIC_API_TABLE::RegistrationShutdown"] + [::std::mem::offset_of!(QUIC_API_TABLE, RegistrationShutdown) - 56usize]; + ["Offset of field: QUIC_API_TABLE::ConfigurationOpen"] + [::std::mem::offset_of!(QUIC_API_TABLE, ConfigurationOpen) - 64usize]; + ["Offset of field: QUIC_API_TABLE::ConfigurationClose"] + [::std::mem::offset_of!(QUIC_API_TABLE, ConfigurationClose) - 72usize]; + ["Offset of field: QUIC_API_TABLE::ConfigurationLoadCredential"] + [::std::mem::offset_of!(QUIC_API_TABLE, ConfigurationLoadCredential) - 80usize]; + ["Offset of field: QUIC_API_TABLE::ListenerOpen"] + [::std::mem::offset_of!(QUIC_API_TABLE, ListenerOpen) - 88usize]; + ["Offset of field: QUIC_API_TABLE::ListenerClose"] + [::std::mem::offset_of!(QUIC_API_TABLE, ListenerClose) - 96usize]; + ["Offset of field: QUIC_API_TABLE::ListenerStart"] + [::std::mem::offset_of!(QUIC_API_TABLE, ListenerStart) - 104usize]; + ["Offset of field: QUIC_API_TABLE::ListenerStop"] + [::std::mem::offset_of!(QUIC_API_TABLE, ListenerStop) - 112usize]; + ["Offset of field: QUIC_API_TABLE::ConnectionOpen"] + [::std::mem::offset_of!(QUIC_API_TABLE, ConnectionOpen) - 120usize]; + ["Offset of field: QUIC_API_TABLE::ConnectionClose"] + [::std::mem::offset_of!(QUIC_API_TABLE, ConnectionClose) - 128usize]; + ["Offset of field: QUIC_API_TABLE::ConnectionShutdown"] + [::std::mem::offset_of!(QUIC_API_TABLE, ConnectionShutdown) - 136usize]; + ["Offset of field: QUIC_API_TABLE::ConnectionStart"] + [::std::mem::offset_of!(QUIC_API_TABLE, ConnectionStart) - 144usize]; + ["Offset of field: QUIC_API_TABLE::ConnectionSetConfiguration"] + [::std::mem::offset_of!(QUIC_API_TABLE, ConnectionSetConfiguration) - 152usize]; + ["Offset of field: QUIC_API_TABLE::ConnectionSendResumptionTicket"] + [::std::mem::offset_of!(QUIC_API_TABLE, ConnectionSendResumptionTicket) - 160usize]; + ["Offset of field: QUIC_API_TABLE::StreamOpen"] + [::std::mem::offset_of!(QUIC_API_TABLE, StreamOpen) - 168usize]; + ["Offset of field: QUIC_API_TABLE::StreamClose"] + [::std::mem::offset_of!(QUIC_API_TABLE, StreamClose) - 176usize]; + ["Offset of field: QUIC_API_TABLE::StreamStart"] + [::std::mem::offset_of!(QUIC_API_TABLE, StreamStart) - 184usize]; + ["Offset of field: QUIC_API_TABLE::StreamShutdown"] + [::std::mem::offset_of!(QUIC_API_TABLE, StreamShutdown) - 192usize]; + ["Offset of field: QUIC_API_TABLE::StreamSend"] + [::std::mem::offset_of!(QUIC_API_TABLE, StreamSend) - 200usize]; + ["Offset of field: QUIC_API_TABLE::StreamReceiveComplete"] + [::std::mem::offset_of!(QUIC_API_TABLE, StreamReceiveComplete) - 208usize]; + ["Offset of field: QUIC_API_TABLE::StreamReceiveSetEnabled"] + [::std::mem::offset_of!(QUIC_API_TABLE, StreamReceiveSetEnabled) - 216usize]; + ["Offset of field: QUIC_API_TABLE::DatagramSend"] + [::std::mem::offset_of!(QUIC_API_TABLE, DatagramSend) - 224usize]; + ["Offset of field: QUIC_API_TABLE::ConnectionResumptionTicketValidationComplete"][::std::mem::offset_of!( + QUIC_API_TABLE, + ConnectionResumptionTicketValidationComplete + ) - 232usize]; + ["Offset of field: QUIC_API_TABLE::ConnectionCertificateValidationComplete"][::std::mem::offset_of!( + QUIC_API_TABLE, + ConnectionCertificateValidationComplete + ) - 240usize]; +}; +pub const QUIC_ERROR_SUCCESS: QUIC_ERROR = 0; +pub const QUIC_ERROR_PENDING: QUIC_ERROR = 459749; +pub const QUIC_ERROR_CONTINUE: QUIC_ERROR = 459998; +pub const QUIC_ERROR_OUT_OF_MEMORY: QUIC_ERROR = -2147024882; +pub const QUIC_ERROR_INVALID_PARAMETER: QUIC_ERROR = -2147024809; +pub const QUIC_ERROR_INVALID_STATE: QUIC_ERROR = -2147019873; +pub const QUIC_ERROR_NOT_SUPPORTED: QUIC_ERROR = -2147467262; +pub const QUIC_ERROR_NOT_FOUND: QUIC_ERROR = -2147023728; +pub const QUIC_ERROR_BUFFER_TOO_SMALL: QUIC_ERROR = -2147024774; +pub const QUIC_ERROR_HANDSHAKE_FAILURE: QUIC_ERROR = -2143223808; +pub const QUIC_ERROR_ABORTED: QUIC_ERROR = -2147467260; +pub const QUIC_ERROR_ADDRESS_IN_USE: QUIC_ERROR = -2147014848; +pub const QUIC_ERROR_INVALID_ADDRESS: QUIC_ERROR = -2147014847; +pub const QUIC_ERROR_CONNECTION_TIMEOUT: QUIC_ERROR = -2143223802; +pub const QUIC_ERROR_CONNECTION_IDLE: QUIC_ERROR = -2143223803; +pub const QUIC_ERROR_UNREACHABLE: QUIC_ERROR = -2147023664; +pub const QUIC_ERROR_INTERNAL_ERROR: QUIC_ERROR = -2143223805; +pub const QUIC_ERROR_CONNECTION_REFUSED: QUIC_ERROR = -2147023671; +pub const QUIC_ERROR_PROTOCOL_ERROR: QUIC_ERROR = -2143223804; +pub const QUIC_ERROR_VER_NEG_ERROR: QUIC_ERROR = -2143223807; +pub const QUIC_ERROR_TLS_ERROR: QUIC_ERROR = -2147013864; +pub const QUIC_ERROR_USER_CANCELED: QUIC_ERROR = -2143223806; +pub const QUIC_ERROR_ALPN_NEG_FAILURE: QUIC_ERROR = -2143223801; +pub const QUIC_ERROR_STREAM_LIMIT_REACHED: QUIC_ERROR = -2143223800; +pub const QUIC_ERROR_ALPN_IN_USE: QUIC_ERROR = -2143223799; +pub const QUIC_ERROR_CLOSE_NOTIFY: QUIC_ERROR = -2143223552; +pub const QUIC_ERROR_BAD_CERTIFICATE: QUIC_ERROR = -2143223510; +pub const QUIC_ERROR_UNSUPPORTED_CERTIFICATE: QUIC_ERROR = -2143223509; +pub const QUIC_ERROR_REVOKED_CERTIFICATE: QUIC_ERROR = -2143223508; +pub const QUIC_ERROR_EXPIRED_CERTIFICATE: QUIC_ERROR = -2143223507; +pub const QUIC_ERROR_UNKNOWN_CERTIFICATE: QUIC_ERROR = -2143223506; +pub const QUIC_ERROR_REQUIRED_CERTIFICATE: QUIC_ERROR = -2143223436; +pub const QUIC_ERROR_CERT_EXPIRED: QUIC_ERROR = -2146762495; +pub const QUIC_ERROR_CERT_UNTRUSTED_ROOT: QUIC_ERROR = -2146762487; +pub const QUIC_ERROR_CERT_NO_CERT: QUIC_ERROR = -2146893042; +pub type QUIC_ERROR = ::std::os::raw::c_int; diff --git a/src/ffi/wrapper.hpp b/src/ffi/wrapper.hpp new file mode 100644 index 0000000000..c77e8d587e --- /dev/null +++ b/src/ffi/wrapper.hpp @@ -0,0 +1,44 @@ +// header wrapper to feed into bindgen + +#include "msquic.h" + +// bindgen or clang has problem with c marcro functions +// This forces clang to evaluate macros. +// Cannot reuse QUIC_STATUS as the name because it is an macro type. +typedef enum QUIC_ERROR { + SUCCESS = QUIC_STATUS_SUCCESS, + PENDING = QUIC_STATUS_PENDING, + CONTINUE = QUIC_STATUS_CONTINUE, + OUT_OF_MEMORY = QUIC_STATUS_OUT_OF_MEMORY, + INVALID_PARAMETER = QUIC_STATUS_INVALID_PARAMETER, + INVALID_STATE = QUIC_STATUS_INVALID_STATE, + NOT_SUPPORTED = QUIC_STATUS_NOT_SUPPORTED, + NOT_FOUND = QUIC_STATUS_NOT_FOUND, + BUFFER_TOO_SMALL = QUIC_STATUS_BUFFER_TOO_SMALL, + HANDSHAKE_FAILURE = QUIC_STATUS_HANDSHAKE_FAILURE, + ABORTED = QUIC_STATUS_ABORTED, + ADDRESS_IN_USE = QUIC_STATUS_ADDRESS_IN_USE, + INVALID_ADDRESS = QUIC_STATUS_INVALID_ADDRESS, + CONNECTION_TIMEOUT = QUIC_STATUS_CONNECTION_TIMEOUT, + CONNECTION_IDLE = QUIC_STATUS_CONNECTION_IDLE, + UNREACHABLE = QUIC_STATUS_UNREACHABLE, + INTERNAL_ERROR = QUIC_STATUS_INTERNAL_ERROR, + CONNECTION_REFUSED = QUIC_STATUS_CONNECTION_REFUSED, + PROTOCOL_ERROR = QUIC_STATUS_PROTOCOL_ERROR, + VER_NEG_ERROR = QUIC_STATUS_VER_NEG_ERROR, + TLS_ERROR = QUIC_STATUS_TLS_ERROR, + USER_CANCELED = QUIC_STATUS_USER_CANCELED, + ALPN_NEG_FAILURE = QUIC_STATUS_ALPN_NEG_FAILURE, + STREAM_LIMIT_REACHED = QUIC_STATUS_STREAM_LIMIT_REACHED, + ALPN_IN_USE = QUIC_STATUS_ALPN_IN_USE, + CLOSE_NOTIFY = QUIC_STATUS_CLOSE_NOTIFY, + BAD_CERTIFICATE = QUIC_STATUS_BAD_CERTIFICATE, + UNSUPPORTED_CERTIFICATE = QUIC_STATUS_UNSUPPORTED_CERTIFICATE, + REVOKED_CERTIFICATE = QUIC_STATUS_REVOKED_CERTIFICATE, + EXPIRED_CERTIFICATE = QUIC_STATUS_EXPIRED_CERTIFICATE, + UNKNOWN_CERTIFICATE = QUIC_STATUS_UNKNOWN_CERTIFICATE, + REQUIRED_CERTIFICATE = QUIC_STATUS_REQUIRED_CERTIFICATE, + CERT_EXPIRED = QUIC_STATUS_CERT_EXPIRED, + CERT_UNTRUSTED_ROOT = QUIC_STATUS_CERT_UNTRUSTED_ROOT, + CERT_NO_CERT = QUIC_STATUS_CERT_NO_CERT +} QUIC_ERROR; diff --git a/src/generated/CMakeLists.txt b/src/generated/CMakeLists.txt index 93bd6cc9a2..86d1fb0a3d 100644 --- a/src/generated/CMakeLists.txt +++ b/src/generated/CMakeLists.txt @@ -43,7 +43,12 @@ if(QUIC_ENABLE_LOGGING) target_link_libraries(msquic.lttng PRIVATE ${LTTNGUST_LIBRARIES}) set_target_properties(msquic.lttng PROPERTIES SOVERSION ${QUIC_FULL_VERSION} VERSION ${QUIC_FULL_VERSION}) - install(TARGETS msquic.lttng DESTINATION lib) + install(TARGETS msquic.lttng + EXPORT msquic + RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" + LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" + ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" + ) endif() else() diff --git a/src/generated/linux/datapath_raw_xdp_linux.c.clog.h b/src/generated/linux/datapath_raw_xdp_linux.c.clog.h index f2456815ff..9893b21e2d 100644 --- a/src/generated/linux/datapath_raw_xdp_linux.c.clog.h +++ b/src/generated/linux/datapath_raw_xdp_linux.c.clog.h @@ -546,9 +546,9 @@ tracepoint(CLOG_DATAPATH_RAW_XDP_LINUX_C, XdpPartitionShutdown , arg2);\ // Decoder Ring for XdpPartitionShutdownComplete // [ xdp][%p] XDP partition shutdown complete // QuicTraceLogVerbose( - XdpPartitionShutdownComplete, - "[ xdp][%p] XDP partition shutdown complete", - Partition); + XdpPartitionShutdownComplete, + "[ xdp][%p] XDP partition shutdown complete", + Partition); // arg2 = arg2 = Partition = arg2 ----------------------------------------------------------*/ #ifndef _clog_3_ARGS_TRACE_XdpPartitionShutdownComplete @@ -564,9 +564,9 @@ tracepoint(CLOG_DATAPATH_RAW_XDP_LINUX_C, XdpPartitionShutdownComplete , arg2);\ // Decoder Ring for XdpQueueAsyncIoRxComplete // [ xdp][%p] XDP async IO complete (RX) // QuicTraceLogVerbose( - XdpQueueAsyncIoRxComplete, - "[ xdp][%p] XDP async IO complete (RX)", - Queue); + XdpQueueAsyncIoRxComplete, + "[ xdp][%p] XDP async IO complete (RX)", + Queue); // arg2 = arg2 = Queue = arg2 ----------------------------------------------------------*/ #ifndef _clog_3_ARGS_TRACE_XdpQueueAsyncIoRxComplete diff --git a/src/generated/linux/datapath_raw_xdp_linux.c.clog.h.lttng.h b/src/generated/linux/datapath_raw_xdp_linux.c.clog.h.lttng.h index 0a65d87672..5595345fa9 100644 --- a/src/generated/linux/datapath_raw_xdp_linux.c.clog.h.lttng.h +++ b/src/generated/linux/datapath_raw_xdp_linux.c.clog.h.lttng.h @@ -568,9 +568,9 @@ TRACEPOINT_EVENT(CLOG_DATAPATH_RAW_XDP_LINUX_C, XdpPartitionShutdown, // Decoder Ring for XdpPartitionShutdownComplete // [ xdp][%p] XDP partition shutdown complete // QuicTraceLogVerbose( - XdpPartitionShutdownComplete, - "[ xdp][%p] XDP partition shutdown complete", - Partition); + XdpPartitionShutdownComplete, + "[ xdp][%p] XDP partition shutdown complete", + Partition); // arg2 = arg2 = Partition = arg2 ----------------------------------------------------------*/ TRACEPOINT_EVENT(CLOG_DATAPATH_RAW_XDP_LINUX_C, XdpPartitionShutdownComplete, @@ -587,9 +587,9 @@ TRACEPOINT_EVENT(CLOG_DATAPATH_RAW_XDP_LINUX_C, XdpPartitionShutdownComplete, // Decoder Ring for XdpQueueAsyncIoRxComplete // [ xdp][%p] XDP async IO complete (RX) // QuicTraceLogVerbose( - XdpQueueAsyncIoRxComplete, - "[ xdp][%p] XDP async IO complete (RX)", - Queue); + XdpQueueAsyncIoRxComplete, + "[ xdp][%p] XDP async IO complete (RX)", + Queue); // arg2 = arg2 = Queue = arg2 ----------------------------------------------------------*/ TRACEPOINT_EVENT(CLOG_DATAPATH_RAW_XDP_LINUX_C, XdpQueueAsyncIoRxComplete, diff --git a/src/generated/linux/datapath_raw_xdp_win.c.clog.h b/src/generated/linux/datapath_raw_xdp_win.c.clog.h index b8e8a3d927..70075fd2b7 100644 --- a/src/generated/linux/datapath_raw_xdp_win.c.clog.h +++ b/src/generated/linux/datapath_raw_xdp_win.c.clog.h @@ -263,9 +263,9 @@ tracepoint(CLOG_DATAPATH_RAW_XDP_WIN_C, XdpQueueAsyncIoTx , arg2);\ // Decoder Ring for XdpQueueAsyncIoRxComplete // [ xdp][%p] XDP async IO complete (RX) // QuicTraceLogVerbose( - XdpQueueAsyncIoRxComplete, - "[ xdp][%p] XDP async IO complete (RX)", - Queue); + XdpQueueAsyncIoRxComplete, + "[ xdp][%p] XDP async IO complete (RX)", + Queue); // arg2 = arg2 = Queue = arg2 ----------------------------------------------------------*/ #ifndef _clog_3_ARGS_TRACE_XdpQueueAsyncIoRxComplete @@ -281,9 +281,9 @@ tracepoint(CLOG_DATAPATH_RAW_XDP_WIN_C, XdpQueueAsyncIoRxComplete , arg2);\ // Decoder Ring for XdpQueueAsyncIoTxComplete // [ xdp][%p] XDP async IO complete (TX) // QuicTraceLogVerbose( - XdpQueueAsyncIoTxComplete, - "[ xdp][%p] XDP async IO complete (TX)", - Queue); + XdpQueueAsyncIoTxComplete, + "[ xdp][%p] XDP async IO complete (TX)", + Queue); // arg2 = arg2 = Queue = arg2 ----------------------------------------------------------*/ #ifndef _clog_3_ARGS_TRACE_XdpQueueAsyncIoTxComplete @@ -299,9 +299,9 @@ tracepoint(CLOG_DATAPATH_RAW_XDP_WIN_C, XdpQueueAsyncIoTxComplete , arg2);\ // Decoder Ring for XdpPartitionShutdownComplete // [ xdp][%p] XDP partition shutdown complete // QuicTraceLogVerbose( - XdpPartitionShutdownComplete, - "[ xdp][%p] XDP partition shutdown complete", - Partition); + XdpPartitionShutdownComplete, + "[ xdp][%p] XDP partition shutdown complete", + Partition); // arg2 = arg2 = Partition = arg2 ----------------------------------------------------------*/ #ifndef _clog_3_ARGS_TRACE_XdpPartitionShutdownComplete diff --git a/src/generated/linux/datapath_raw_xdp_win.c.clog.h.lttng.h b/src/generated/linux/datapath_raw_xdp_win.c.clog.h.lttng.h index 891a5d88f3..2273dd284d 100644 --- a/src/generated/linux/datapath_raw_xdp_win.c.clog.h.lttng.h +++ b/src/generated/linux/datapath_raw_xdp_win.c.clog.h.lttng.h @@ -261,9 +261,9 @@ TRACEPOINT_EVENT(CLOG_DATAPATH_RAW_XDP_WIN_C, XdpQueueAsyncIoTx, // Decoder Ring for XdpQueueAsyncIoRxComplete // [ xdp][%p] XDP async IO complete (RX) // QuicTraceLogVerbose( - XdpQueueAsyncIoRxComplete, - "[ xdp][%p] XDP async IO complete (RX)", - Queue); + XdpQueueAsyncIoRxComplete, + "[ xdp][%p] XDP async IO complete (RX)", + Queue); // arg2 = arg2 = Queue = arg2 ----------------------------------------------------------*/ TRACEPOINT_EVENT(CLOG_DATAPATH_RAW_XDP_WIN_C, XdpQueueAsyncIoRxComplete, @@ -280,9 +280,9 @@ TRACEPOINT_EVENT(CLOG_DATAPATH_RAW_XDP_WIN_C, XdpQueueAsyncIoRxComplete, // Decoder Ring for XdpQueueAsyncIoTxComplete // [ xdp][%p] XDP async IO complete (TX) // QuicTraceLogVerbose( - XdpQueueAsyncIoTxComplete, - "[ xdp][%p] XDP async IO complete (TX)", - Queue); + XdpQueueAsyncIoTxComplete, + "[ xdp][%p] XDP async IO complete (TX)", + Queue); // arg2 = arg2 = Queue = arg2 ----------------------------------------------------------*/ TRACEPOINT_EVENT(CLOG_DATAPATH_RAW_XDP_WIN_C, XdpQueueAsyncIoTxComplete, @@ -299,9 +299,9 @@ TRACEPOINT_EVENT(CLOG_DATAPATH_RAW_XDP_WIN_C, XdpQueueAsyncIoTxComplete, // Decoder Ring for XdpPartitionShutdownComplete // [ xdp][%p] XDP partition shutdown complete // QuicTraceLogVerbose( - XdpPartitionShutdownComplete, - "[ xdp][%p] XDP partition shutdown complete", - Partition); + XdpPartitionShutdownComplete, + "[ xdp][%p] XDP partition shutdown complete", + Partition); // arg2 = arg2 = Partition = arg2 ----------------------------------------------------------*/ TRACEPOINT_EVENT(CLOG_DATAPATH_RAW_XDP_WIN_C, XdpPartitionShutdownComplete, diff --git a/src/generated/linux/datapath_winuser.c.clog.h b/src/generated/linux/datapath_winuser.c.clog.h index d77ffd43af..c285e4e96b 100644 --- a/src/generated/linux/datapath_winuser.c.clog.h +++ b/src/generated/linux/datapath_winuser.c.clog.h @@ -341,10 +341,10 @@ tracepoint(CLOG_DATAPATH_WINUSER_C, LibraryError , arg2);\ "[data][%p] ERROR, %u, %s.", SocketProc->Parent, LastError, - "CxPlatSocketEnqueueSqe"); + "CxPlatEventQEnqueueEx"); // arg2 = arg2 = SocketProc->Parent = arg2 // arg3 = arg3 = LastError = arg3 -// arg4 = arg4 = "CxPlatSocketEnqueueSqe" = arg4 +// arg4 = arg4 = "CxPlatEventQEnqueueEx" = arg4 ----------------------------------------------------------*/ #ifndef _clog_5_ARGS_TRACE_DatapathErrorStatus #define _clog_5_ARGS_TRACE_DatapathErrorStatus(uniqueId, encoded_arg_string, arg2, arg3, arg4)\ diff --git a/src/generated/linux/datapath_winuser.c.clog.h.lttng.h b/src/generated/linux/datapath_winuser.c.clog.h.lttng.h index 6dfd96927d..6af0327b8e 100644 --- a/src/generated/linux/datapath_winuser.c.clog.h.lttng.h +++ b/src/generated/linux/datapath_winuser.c.clog.h.lttng.h @@ -341,10 +341,10 @@ TRACEPOINT_EVENT(CLOG_DATAPATH_WINUSER_C, LibraryError, "[data][%p] ERROR, %u, %s.", SocketProc->Parent, LastError, - "CxPlatSocketEnqueueSqe"); + "CxPlatEventQEnqueueEx"); // arg2 = arg2 = SocketProc->Parent = arg2 // arg3 = arg3 = LastError = arg3 -// arg4 = arg4 = "CxPlatSocketEnqueueSqe" = arg4 +// arg4 = arg4 = "CxPlatEventQEnqueueEx" = arg4 ----------------------------------------------------------*/ TRACEPOINT_EVENT(CLOG_DATAPATH_WINUSER_C, DatapathErrorStatus, TP_ARGS( diff --git a/src/inc/CMakeLists.txt b/src/inc/CMakeLists.txt index 48edebd1e0..c1b8fd6c70 100644 --- a/src/inc/CMakeLists.txt +++ b/src/inc/CMakeLists.txt @@ -17,6 +17,7 @@ target_compile_features(inc INTERFACE cxx_std_17) target_compile_features(inc INTERFACE c_std_11) add_library(base_link INTERFACE) +add_library(msquic::base_link ALIAS base_link) if (HAS_GUARDCF) target_link_options(base_link INTERFACE /guard:cf /DYNAMICBASE) diff --git a/src/inc/quic_platform.h b/src/inc/quic_platform.h index ceaa6cdcd8..4e56a87fd5 100644 --- a/src/inc/quic_platform.h +++ b/src/inc/quic_platform.h @@ -541,18 +541,6 @@ CxPlatWakeExecutionContext( ); #endif -// -// The "type" of the completion queue event is stored as the first uint32_t of -// the user data. Everything after that in the user data is type-specific. -// -#define CxPlatCqeType(cqe) (*(uint32_t*)CxPlatCqeUserData(cqe)) - -// -// All QUIC (and lower layer) completion queue events have a type starting with -// 0x8000. -// -#define CXPLAT_CQE_TYPE_QUIC_BASE 0x8000 // to 0xFFFF - // // Test Interface for loading a self-signed certificate. // diff --git a/src/inc/quic_platform_posix.h b/src/inc/quic_platform_posix.h index 9adc306306..f963770741 100644 --- a/src/inc/quic_platform_posix.h +++ b/src/inc/quic_platform_posix.h @@ -959,6 +959,16 @@ CxPlatInternalEventWaitWithTimeout( #include typedef struct io_uring CXPLAT_EVENTQ; typedef struct io_uring_cqe* CXPLAT_CQE; +typedef +_IRQL_requires_max_(PASSIVE_LEVEL) +void +(CXPLAT_EVENT_COMPLETION)( + _In_ CXPLAT_CQE* Cqe + ); +typedef CXPLAT_EVENT_COMPLETION *CXPLAT_EVENT_COMPLETION_HANDLER; +typedef struct CXPLAT_SQE { + CXPLAT_EVENT_COMPLETION_HANDLER Completion; +} CXPLAT_SQE; inline BOOLEAN @@ -980,21 +990,19 @@ CxPlatEventQCleanup( inline BOOLEAN -_CxPlatEventQEnqueue( +CxPlatEventQEnqueue( _In_ CXPLAT_EVENTQ* queue, - _In_opt_ void* user_data + _In_ CXPLAT_SQE* sqe ) { struct io_uring_sqe *io_sqe = io_uring_get_sqe(queue); if (io_sqe == NULL) return FALSE; // OOM io_uring_prep_nop(io_sqe); - io_uring_sqe_set_data(io_sqe, user_data); + io_uring_sqe_set_data(io_sqe, sqe); io_uring_submit(queue); // TODO - Extract to separate function? return TRUE; } -#define CxPlatEventQEnqueue(queue, sqe, user_data) _CxPlatEventQEnqueue(queue, user_data) - inline uint32_t CxPlatEventQDequeue( @@ -1028,12 +1036,36 @@ CxPlatEventQReturn( } inline -void* -CxPlatCqeUserData( +BOOLEAN +CxPlatSqeInitialize( + _In_ CXPLAT_EVENTQ* queue, + _In_ CXPLAT_EVENT_COMPLETION completion, + _Out_ CXPLAT_SQE* sqe + ) +{ + UNREFERENCED_PARAMETER(queue); + sqe->Completion = completion; + return TRUE; +} + +inline +void +CxPlatSqeCleanup( + _In_ CXPLAT_EVENTQ* queue, + _In_ CXPLAT_SQE* sqe + ) +{ + UNREFERENCED_PARAMETER(queue); + UNREFERENCED_PARAMETER(sqe); +} + +inline +CXPLAT_SQE* +CxPlatCqeGetSqe( _In_ const CXPLAT_CQE* cqe ) { - return (void*)(uintptr_t)cqe->user_data; + return (CXPLAT_SQE*)(uintptr_t)cqe->user_data; } #else // epoll @@ -1042,9 +1074,17 @@ CxPlatCqeUserData( #include typedef int CXPLAT_EVENTQ; -#define CXPLAT_SQE int -#define CXPLAT_SQE_DEFAULT 0 typedef struct epoll_event CXPLAT_CQE; +typedef +void +(CXPLAT_EVENT_COMPLETION)( + _In_ CXPLAT_CQE* Cqe + ); +typedef CXPLAT_EVENT_COMPLETION *CXPLAT_EVENT_COMPLETION_HANDLER; +typedef struct CXPLAT_SQE { + int fd; + CXPLAT_EVENT_COMPLETION_HANDLER Completion; +} CXPLAT_SQE; inline BOOLEAN @@ -1068,13 +1108,11 @@ inline BOOLEAN CxPlatEventQEnqueue( _In_ CXPLAT_EVENTQ* queue, - _In_ CXPLAT_SQE* sqe, - _In_opt_ void* user_data + _In_ CXPLAT_SQE* sqe ) { UNREFERENCED_PARAMETER(queue); - UNREFERENCED_PARAMETER(user_data); - return eventfd_write(*sqe, 1) == 0; + return eventfd_write(sqe->fd, 1) == 0; } inline @@ -1105,19 +1143,18 @@ CxPlatEventQReturn( UNREFERENCED_PARAMETER(count); } -#define CXPLAT_SQE_INIT 1 - inline BOOLEAN CxPlatSqeInitialize( _In_ CXPLAT_EVENTQ* queue, - _Out_ CXPLAT_SQE* sqe, - _In_ void* user_data + _In_ CXPLAT_EVENT_COMPLETION completion, + _Out_ CXPLAT_SQE* sqe ) { - struct epoll_event event = { .events = EPOLLIN | EPOLLET, .data = { .ptr = user_data } }; - if ((*sqe = eventfd(0, EFD_CLOEXEC)) == -1) return FALSE; - if (epoll_ctl(*queue, EPOLL_CTL_ADD, *sqe, &event) != 0) { close(*sqe); return FALSE; } + struct epoll_event event = { .events = EPOLLIN | EPOLLET, .data = { .ptr = sqe } }; + sqe->Completion = completion; + if ((sqe->fd = eventfd(0, EFD_CLOEXEC)) == -1) return FALSE; + if (epoll_ctl(*queue, EPOLL_CTL_ADD, sqe->fd, &event) != 0) { close(sqe->fd); return FALSE; } return TRUE; } @@ -1128,17 +1165,17 @@ CxPlatSqeCleanup( _In_ CXPLAT_SQE* sqe ) { - epoll_ctl(*queue, EPOLL_CTL_DEL, *sqe, NULL); - close(*sqe); + epoll_ctl(*queue, EPOLL_CTL_DEL, sqe->fd, NULL); + close(sqe->fd); } inline -void* -CxPlatCqeUserData( +CXPLAT_SQE* +CxPlatCqeGetSqe( _In_ const CXPLAT_CQE* cqe ) { - return (void*)cqe->data.ptr; + return (CXPLAT_SQE*)cqe->data.ptr; } #endif @@ -1149,9 +1186,17 @@ CxPlatCqeUserData( #include typedef int CXPLAT_EVENTQ; -#define CXPLAT_SQE uintptr_t -#define CXPLAT_SQE_DEFAULT 0 typedef struct kevent CXPLAT_CQE; +typedef +void +(CXPLAT_EVENT_COMPLETION)( + _In_ CXPLAT_CQE* Cqe + ); +typedef CXPLAT_EVENT_COMPLETION *CXPLAT_EVENT_COMPLETION_HANDLER; +typedef struct CXPLAT_SQE { + uintptr_t Handle; + CXPLAT_EVENT_COMPLETION_HANDLER Completion; +} CXPLAT_SQE; inline BOOLEAN @@ -1174,12 +1219,25 @@ CxPlatEventQCleanup( inline BOOLEAN CxPlatEventQEnqueue( + _In_ CXPLAT_EVENTQ* queue, + _In_ CXPLAT_SQE* sqe + ) +{ + // TODO - Should ident simply use the pointer value of sqe? + struct kevent event = {.ident = sqe->Handle, .filter = EVFILT_USER, .flags = EV_ADD | EV_ONESHOT, .fflags = NOTE_TRIGGER, .data = 0, .udata = sqe}; + return kevent(*queue, &event, 1, NULL, 0, NULL) == 0; +} + +inline +BOOLEAN +CxPlatEventQEnqueueEx( _In_ CXPLAT_EVENTQ* queue, _In_ CXPLAT_SQE* sqe, - _In_opt_ void* user_data + _In_ short filter, + _In_ unsigned short flags ) { - struct kevent event = {.ident = *sqe, .filter = EVFILT_USER, .flags = EV_ADD | EV_ONESHOT, .fflags = NOTE_TRIGGER, .data = 0, .udata = user_data}; + struct kevent event = {.ident = sqe->Handle, .filter = filter, .flags = flags, .fflags = 0, .data = 0, .udata = sqe}; return kevent(*queue, &event, 1, NULL, 0, NULL) == 0; } @@ -1215,24 +1273,36 @@ CxPlatEventQReturn( UNREFERENCED_PARAMETER(count); } -#define CXPLAT_SQE_INIT 1 - extern uintptr_t CxPlatCurrentSqe; inline BOOLEAN CxPlatSqeInitialize( _In_ CXPLAT_EVENTQ* queue, - _In_ CXPLAT_SQE* sqe, - _In_ void* user_data + _In_ CXPLAT_EVENT_COMPLETION completion, + _Out_ CXPLAT_SQE* sqe ) { UNREFERENCED_PARAMETER(queue); - UNREFERENCED_PARAMETER(user_data); - *sqe = __sync_add_and_fetch(&CxPlatCurrentSqe, 1); + sqe->Handle = __sync_add_and_fetch(&CxPlatCurrentSqe, 1); + sqe->Completion = completion; return TRUE; } +inline +void +CxPlatSqeInitializeEx( + _In_ CXPLAT_EVENTQ* queue, + _In_ uintptr_t handle, + _In_ CXPLAT_EVENT_COMPLETION completion, + _Out_ CXPLAT_SQE* sqe + ) +{ + UNREFERENCED_PARAMETER(queue); + sqe->Handle = handle; + sqe->Completion = completion; +} + inline void CxPlatSqeCleanup( @@ -1245,12 +1315,12 @@ CxPlatSqeCleanup( } inline -void* -CxPlatCqeUserData( +CXPLAT_SQE* +CxPlatCqeGetSqe( _In_ const CXPLAT_CQE* cqe ) { - return (void*)cqe->udata; + return (CXPLAT_SQE*)cqe->udata; } #else diff --git a/src/inc/quic_platform_winkernel.h b/src/inc/quic_platform_winkernel.h index 3314de5272..065f5e192a 100644 --- a/src/inc/quic_platform_winkernel.h +++ b/src/inc/quic_platform_winkernel.h @@ -498,16 +498,14 @@ CxPlatEventQCleanup( inline BOOLEAN _CxPlatEventQEnqueue( - _In_ CXPLAT_EVENTQ* queue, - _In_opt_ void* user_data + _In_ CXPLAT_EVENTQ* queue ) { - UNREFERENCED_PARAMETER(user_data); KeSetEvent(queue, IO_NO_INCREMENT, FALSE); return TRUE; } -#define CxPlatEventQEnqueue(queue, sqe, user_data) _CxPlatEventQEnqueue(queue, user_data) +#define CxPlatEventQEnqueue(queue, sqe) _CxPlatEventQEnqueue(queue) inline uint32_t diff --git a/src/inc/quic_platform_winuser.h b/src/inc/quic_platform_winuser.h index 52c47080b8..d04347ad76 100644 --- a/src/inc/quic_platform_winuser.h +++ b/src/inc/quic_platform_winuser.h @@ -702,11 +702,16 @@ CxPlatEventWaitWithTimeout( typedef HANDLE CXPLAT_EVENTQ; typedef OVERLAPPED_ENTRY CXPLAT_CQE; -#define CXPLAT_SQE CXPLAT_SQE -#define CXPLAT_SQE_DEFAULT {0} +typedef +_IRQL_requires_max_(PASSIVE_LEVEL) +void +(CXPLAT_EVENT_COMPLETION)( + _In_ CXPLAT_CQE* Cqe + ); +typedef CXPLAT_EVENT_COMPLETION *CXPLAT_EVENT_COMPLETION_HANDLER; typedef struct CXPLAT_SQE { - void* UserData; OVERLAPPED Overlapped; + CXPLAT_EVENT_COMPLETION_HANDLER Completion; #if DEBUG BOOLEAN IsQueued; // Debug flag to catch double queueing. #endif @@ -744,8 +749,7 @@ inline BOOLEAN CxPlatEventQEnqueue( _In_ CXPLAT_EVENTQ* queue, - _In_ CXPLAT_SQE* sqe, - _In_opt_ void* user_data + _In_ CXPLAT_SQE* sqe ) { #if DEBUG @@ -753,7 +757,6 @@ CxPlatEventQEnqueue( sqe->IsQueued; #endif CxPlatZeroMemory(&sqe->Overlapped, sizeof(sqe->Overlapped)); - sqe->UserData = user_data; return PostQueuedCompletionStatus(*queue, 0, 0, &sqe->Overlapped) != 0; } @@ -762,8 +765,7 @@ BOOLEAN CxPlatEventQEnqueueEx( // Windows specific extension _In_ CXPLAT_EVENTQ* queue, _In_ CXPLAT_SQE* sqe, - _In_ uint32_t num_bytes, - _In_opt_ void* user_data + _In_ uint32_t num_bytes ) { #if DEBUG @@ -771,7 +773,6 @@ CxPlatEventQEnqueueEx( // Windows specific extension sqe->IsQueued; #endif CxPlatZeroMemory(&sqe->Overlapped, sizeof(sqe->Overlapped)); - sqe->UserData = user_data; return PostQueuedCompletionStatus(*queue, num_bytes, 0, &sqe->Overlapped) != 0; } @@ -810,21 +811,52 @@ CxPlatEventQReturn( } inline -void* -CxPlatCqeUserData( - _In_ const CXPLAT_CQE* cqe +BOOLEAN +CxPlatSqeInitialize( + _In_ CXPLAT_EVENTQ* queue, + _In_ CXPLAT_EVENT_COMPLETION completion, + _Out_ CXPLAT_SQE* sqe ) { - return CONTAINING_RECORD(cqe->lpOverlapped, CXPLAT_SQE, Overlapped)->UserData; + UNREFERENCED_PARAMETER(queue); + CxPlatZeroMemory(sqe, sizeof(*sqe)); + sqe->Completion = completion; + return TRUE; } -typedef struct DATAPATH_SQE DATAPATH_SQE; +inline +void +CxPlatSqeInitializeEx( + _In_ CXPLAT_EVENT_COMPLETION_HANDLER completion, + _Out_ CXPLAT_SQE* sqe + ) +{ + sqe->Completion = completion; + CxPlatZeroMemory(&sqe->Overlapped, sizeof(sqe->Overlapped)); +#if DEBUG + sqe->IsQueued = FALSE; +#endif +} +inline void -CxPlatDatapathSqeInitialize( - _Out_ DATAPATH_SQE* DatapathSqe, - _In_ uint32_t CqeType - ); +CxPlatSqeCleanup( + _In_ CXPLAT_EVENTQ* queue, + _In_ CXPLAT_SQE* sqe + ) +{ + UNREFERENCED_PARAMETER(queue); + UNREFERENCED_PARAMETER(sqe); +} + +inline +CXPLAT_SQE* +CxPlatCqeGetSqe( + _In_ const CXPLAT_CQE* cqe + ) +{ + return CONTAINING_RECORD(cqe->lpOverlapped, CXPLAT_SQE, Overlapped); +} // // Time Measurement Interfaces diff --git a/src/lib.rs b/src/lib.rs index 9a5e00b1d3..2d1eb2e281 100755 --- a/src/lib.rs +++ b/src/lib.rs @@ -23,6 +23,7 @@ use std::result::Result; use std::sync::Once; #[macro_use] extern crate bitfield; +pub mod ffi; // // The following starts the C interop layer of MsQuic API. diff --git a/src/platform/CMakeLists.txt b/src/platform/CMakeLists.txt index 997906d0cd..61c898a8af 100644 --- a/src/platform/CMakeLists.txt +++ b/src/platform/CMakeLists.txt @@ -60,6 +60,8 @@ else() endif() add_library(msquic_platform STATIC ${SOURCES}) +add_library(msquic::platform ALIAS msquic_platform) +set_target_properties(msquic_platform PROPERTIES EXPORT_NAME platform) if("${CX_PLATFORM}" STREQUAL "windows") target_link_libraries( diff --git a/src/platform/datapath_epoll.c b/src/platform/datapath_epoll.c index 8c95ae8fac..a91b82c532 100644 --- a/src/platform/datapath_epoll.c +++ b/src/platform/datapath_epoll.c @@ -205,6 +205,10 @@ typedef struct CXPLAT_RECV_MSG_CONTROL_BUFFER { #else #define CXPLAT_DBG_ASSERT_CMSG(CMsg, type) #endif + +CXPLAT_EVENT_COMPLETION CxPlatSocketContextUninitializeEventComplete; +CXPLAT_EVENT_COMPLETION CxPlatSocketContextFlushTxEventComplete; +CXPLAT_EVENT_COMPLETION CxPlatSocketContextIoEventComplete; void CxPlatDataPathCalculateFeatureSupport( @@ -572,13 +576,10 @@ CxPlatSocketContextSqeInitialize( BOOLEAN IoSqeInitialized = FALSE; BOOLEAN FlushTxInitialized = FALSE; - SocketContext->ShutdownSqe.CqeType = CXPLAT_CQE_TYPE_SOCKET_SHUTDOWN; - SocketContext->IoSqe.CqeType = CXPLAT_CQE_TYPE_SOCKET_IO; - SocketContext->FlushTxSqe.CqeType = CXPLAT_CQE_TYPE_SOCKET_FLUSH_TX; if (!CxPlatSqeInitialize( SocketContext->DatapathPartition->EventQ, - &SocketContext->ShutdownSqe.Sqe, + CxPlatSocketContextUninitializeEventComplete, &SocketContext->ShutdownSqe)) { Status = errno; QuicTraceEvent( @@ -593,7 +594,7 @@ CxPlatSocketContextSqeInitialize( if (!CxPlatSqeInitialize( SocketContext->DatapathPartition->EventQ, - &SocketContext->IoSqe.Sqe, + CxPlatSocketContextIoEventComplete, &SocketContext->IoSqe)) { Status = errno; QuicTraceEvent( @@ -608,7 +609,7 @@ CxPlatSocketContextSqeInitialize( if (!CxPlatSqeInitialize( SocketContext->DatapathPartition->EventQ, - &SocketContext->FlushTxSqe.Sqe, + CxPlatSocketContextFlushTxEventComplete, &SocketContext->FlushTxSqe)) { Status = errno; QuicTraceEvent( @@ -627,13 +628,13 @@ CxPlatSocketContextSqeInitialize( if (QUIC_FAILED(Status)) { if (ShutdownSqeInitialized) { - CxPlatSqeCleanup(SocketContext->DatapathPartition->EventQ, &SocketContext->ShutdownSqe.Sqe); + CxPlatSqeCleanup(SocketContext->DatapathPartition->EventQ, &SocketContext->ShutdownSqe); } if (IoSqeInitialized) { - CxPlatSqeCleanup(SocketContext->DatapathPartition->EventQ, &SocketContext->IoSqe.Sqe); + CxPlatSqeCleanup(SocketContext->DatapathPartition->EventQ, &SocketContext->IoSqe); } if (FlushTxInitialized) { - CxPlatSqeCleanup(SocketContext->DatapathPartition->EventQ, &SocketContext->FlushTxSqe.Sqe); + CxPlatSqeCleanup(SocketContext->DatapathPartition->EventQ, &SocketContext->FlushTxSqe); } } @@ -1154,9 +1155,9 @@ CxPlatSocketContextUninitializeComplete( } if (SocketContext->SqeInitialized) { - CxPlatSqeCleanup(SocketContext->DatapathPartition->EventQ, &SocketContext->ShutdownSqe.Sqe); - CxPlatSqeCleanup(SocketContext->DatapathPartition->EventQ, &SocketContext->IoSqe.Sqe); - CxPlatSqeCleanup(SocketContext->DatapathPartition->EventQ, &SocketContext->FlushTxSqe.Sqe); + CxPlatSqeCleanup(SocketContext->DatapathPartition->EventQ, &SocketContext->ShutdownSqe); + CxPlatSqeCleanup(SocketContext->DatapathPartition->EventQ, &SocketContext->IoSqe); + CxPlatSqeCleanup(SocketContext->DatapathPartition->EventQ, &SocketContext->FlushTxSqe); } CxPlatLockUninitialize(&SocketContext->TxQueueLock); @@ -1168,6 +1169,16 @@ CxPlatSocketContextUninitializeComplete( CxPlatSocketRelease(SocketContext->Binding); } +void +CxPlatSocketContextUninitializeEventComplete( + _In_ CXPLAT_CQE* Cqe + ) +{ + CXPLAT_SOCKET_CONTEXT* SocketContext = + CXPLAT_CONTAINING_RECORD(CxPlatCqeGetSqe(Cqe), CXPLAT_SOCKET_CONTEXT, ShutdownSqe); + CxPlatSocketContextUninitializeComplete(SocketContext); +} + void CxPlatSocketContextUninitialize( _In_ CXPLAT_SOCKET_CONTEXT* SocketContext @@ -1210,7 +1221,6 @@ CxPlatSocketContextUninitialize( CXPLAT_FRE_ASSERT( CxPlatEventQEnqueue( SocketContext->DatapathPartition->EventQ, - &SocketContext->ShutdownSqe.Sqe, &SocketContext->ShutdownSqe)); } } @@ -2425,7 +2435,6 @@ SocketSend( CXPLAT_FRE_ASSERT( CxPlatEventQEnqueue( SocketContext->DatapathPartition->EventQ, - &SocketContext->FlushTxSqe.Sqe, &SocketContext->FlushTxSqe)); } return; @@ -2787,6 +2796,16 @@ CxPlatSocketContextFlushTxQueue( } } +void +CxPlatSocketContextFlushTxEventComplete( + _In_ CXPLAT_CQE* Cqe + ) +{ + CXPLAT_SOCKET_CONTEXT* SocketContext = + CXPLAT_CONTAINING_RECORD(CxPlatCqeGetSqe(Cqe), CXPLAT_SOCKET_CONTEXT, FlushTxSqe); + CxPlatSocketContextFlushTxQueue(SocketContext, FALSE); +} + _IRQL_requires_max_(DISPATCH_LEVEL) QUIC_STATUS CxPlatSocketGetTcpStatistics( @@ -2800,11 +2819,13 @@ CxPlatSocketGetTcpStatistics( } void -CxPlatDataPathSocketProcessIoCompletion( - _In_ CXPLAT_SOCKET_CONTEXT* SocketContext, +CxPlatSocketContextIoEventComplete( _In_ CXPLAT_CQE* Cqe ) { + CXPLAT_SOCKET_CONTEXT* SocketContext = + CXPLAT_CONTAINING_RECORD(CxPlatCqeGetSqe(Cqe), CXPLAT_SOCKET_CONTEXT, IoSqe); + if (CxPlatRundownAcquire(&SocketContext->UpcallRundown)) { if (EPOLLERR & Cqe->events) { CxPlatSocketHandleErrors(SocketContext); @@ -2827,30 +2848,3 @@ CxPlatDataPathSocketProcessIoCompletion( CxPlatRundownRelease(&SocketContext->UpcallRundown); } } - -void -DataPathProcessCqe( - _In_ CXPLAT_CQE* Cqe - ) -{ - switch (CxPlatCqeType(Cqe)) { - case CXPLAT_CQE_TYPE_SOCKET_SHUTDOWN: { - CXPLAT_SOCKET_CONTEXT* SocketContext = - CXPLAT_CONTAINING_RECORD(CxPlatCqeUserData(Cqe), CXPLAT_SOCKET_CONTEXT, ShutdownSqe); - CxPlatSocketContextUninitializeComplete(SocketContext); - break; - } - case CXPLAT_CQE_TYPE_SOCKET_IO: { - CXPLAT_SOCKET_CONTEXT* SocketContext = - CXPLAT_CONTAINING_RECORD(CxPlatCqeUserData(Cqe), CXPLAT_SOCKET_CONTEXT, IoSqe); - CxPlatDataPathSocketProcessIoCompletion(SocketContext, Cqe); - break; - } - case CXPLAT_CQE_TYPE_SOCKET_FLUSH_TX: { - CXPLAT_SOCKET_CONTEXT* SocketContext = - CXPLAT_CONTAINING_RECORD(CxPlatCqeUserData(Cqe), CXPLAT_SOCKET_CONTEXT, FlushTxSqe); - CxPlatSocketContextFlushTxQueue(SocketContext, FALSE); - break; - } - } -} diff --git a/src/platform/datapath_kqueue.c b/src/platform/datapath_kqueue.c index 87efcf0428..e5a441ed3c 100644 --- a/src/platform/datapath_kqueue.c +++ b/src/platform/datapath_kqueue.c @@ -162,12 +162,12 @@ typedef struct QUIC_CACHEALIGN CXPLAT_SOCKET_CONTEXT { // // The event for the shutdown event. // - DATAPATH_SQE ShutdownSqe; + CXPLAT_SQE ShutdownSqe; // - // The user data for the IO event. + // The event for the IO event. // - uint32_t IoCqeType; + CXPLAT_SQE IoSqe; // // The I/O vector for receive datagrams. @@ -376,6 +376,9 @@ typedef struct CXPLAT_DATAPATH { CXPLAT_DATAPATH_PARTITION Partitions[]; } CXPLAT_DATAPATH; + +CXPLAT_EVENT_COMPLETION CxPlatSocketContextUninitializeEventComplete; +CXPLAT_EVENT_COMPLETION CxPlatSocketContextIoEventComplete; QUIC_STATUS CxPlatSocketSendInternal( @@ -646,19 +649,15 @@ CxPlatSocketContextInitialize( goto Exit; } - if (!CxPlatSqeInitialize( - SocketContext->DatapathPartition->EventQ, - &SocketContext->ShutdownSqe.Sqe, - &SocketContext->ShutdownSqe)) { - Status = errno; - QuicTraceEvent( - DatapathErrorStatus, - "[data][%p] ERROR, %u, %s.", - Binding, - Status, - "CxPlatSqeInitialize failed"); - goto Exit; - } + CxPlatSqeInitialize( + SocketContext->DatapathPartition->EventQ, + CxPlatSocketContextUninitializeEventComplete, + &SocketContext->ShutdownSqe); + CxPlatSqeInitializeEx( + SocketContext->DatapathPartition->EventQ, + SocketContext->SocketFd, + CxPlatSocketContextIoEventComplete, + &SocketContext->IoSqe); // // Set dual (IPv4 & IPv6) socket mode unless we operate in pure IPv4 mode @@ -972,9 +971,11 @@ CxPlatSocketContextUninitializeComplete( } if (SocketContext->SocketFd != INVALID_SOCKET) { - struct kevent DeleteEvent = {0}; - EV_SET(&DeleteEvent, SocketContext->SocketFd, EVFILT_READ, EV_DELETE, 0, 0, &SocketContext->IoCqeType); - (void)kevent(*SocketContext->DatapathPartition->EventQ, &DeleteEvent, 1, NULL, 0, NULL); + CxPlatEventQEnqueueEx( + SocketContext->DatapathPartition->EventQ, + &SocketContext->IoSqe, + EVFILT_READ, + EV_DELETE); close(SocketContext->SocketFd); } @@ -987,6 +988,16 @@ CxPlatSocketContextUninitializeComplete( CxPlatSocketRelease(SocketContext->Binding); } +void +CxPlatSocketContextUninitializeEventComplete( + _In_ CXPLAT_CQE* Cqe + ) +{ + CXPLAT_SOCKET_CONTEXT* SocketContext = + CXPLAT_CONTAINING_RECORD(CxPlatCqeGetSqe(Cqe), CXPLAT_SOCKET_CONTEXT, ShutdownSqe); + CxPlatSocketContextUninitializeComplete(SocketContext); +} + void CxPlatSocketContextUninitialize( _In_ CXPLAT_SOCKET_CONTEXT* SocketContext @@ -1005,13 +1016,13 @@ CxPlatSocketContextUninitialize( // // Cancel and clean up any pending IO. // - struct kevent DeleteEvent = {0}; - EV_SET(&DeleteEvent, SocketContext->SocketFd, EVFILT_READ, EV_DELETE, 0, 0, &SocketContext->IoCqeType); - (void)kevent(*SocketContext->DatapathPartition->EventQ, &DeleteEvent, 1, NULL, 0, NULL); - + CxPlatEventQEnqueueEx( + SocketContext->DatapathPartition->EventQ, + &SocketContext->IoSqe, + EVFILT_READ, + EV_DELETE); CxPlatEventQEnqueue( SocketContext->DatapathPartition->EventQ, - &SocketContext->ShutdownSqe.Sqe, &SocketContext->ShutdownSqe); } } @@ -1063,25 +1074,18 @@ CxPlatSocketContextStartReceive( goto Error; } - struct kevent Event = {0}; - EV_SET(&Event, SocketContext->SocketFd, EVFILT_READ, EV_ADD | EV_ENABLE, 0, 0, &SocketContext->IoCqeType); - - int Ret = - kevent( - *SocketContext->DatapathPartition->EventQ, - &Event, - 1, - NULL, - 0, - NULL); - if (Ret < 0) { + if (!CxPlatEventQEnqueueEx( + SocketContext->DatapathPartition->EventQ, + &SocketContext->IoSqe, + EVFILT_READ, + EV_ADD | EV_ENABLE)) { Status = errno; QuicTraceEvent( DatapathErrorStatus, "[data][%p] ERROR, %u, %s.", SocketContext->Binding, Status, - "kevent failed"); + "CxPlatEventQEnqueueEx failed"); goto Error; } @@ -1307,11 +1311,13 @@ CxPlatSocketContextSendComplete( } void -CxPlatDataPathSocketProcessIoCompletion( - _In_ CXPLAT_SOCKET_CONTEXT* SocketContext, +CxPlatSocketContextIoEventComplete( _In_ CXPLAT_CQE* Cqe ) { + CXPLAT_SOCKET_CONTEXT* SocketContext = + CXPLAT_CONTAINING_RECORD(CxPlatCqeGetSqe(Cqe), CXPLAT_SOCKET_CONTEXT, IoSqe); + if (!CxPlatRundownAcquire(&SocketContext->UpcallRundown)) { return; } @@ -1425,8 +1431,6 @@ CxPlatSocketCreateUdp( for (uint32_t i = 0; i < SocketCount; i++) { Binding->SocketContexts[i].Binding = Binding; Binding->SocketContexts[i].SocketFd = INVALID_SOCKET; - Binding->SocketContexts[i].ShutdownSqe.CqeType = CXPLAT_CQE_TYPE_SOCKET_SHUTDOWN; - Binding->SocketContexts[i].IoCqeType = CXPLAT_CQE_TYPE_SOCKET_IO; Binding->SocketContexts[i].RecvIov.iov_len = Binding->Mtu - CXPLAT_MIN_IPV4_HEADER_SIZE - CXPLAT_UDP_HEADER_SIZE; Binding->SocketContexts[i].DatapathPartition = @@ -2029,24 +2033,18 @@ CxPlatSocketSendInternal( CxPlatLockRelease(&SocketContext->PendingSendDataLock); } SendPending = TRUE; - struct kevent Event = {0}; - EV_SET(&Event, SocketContext->SocketFd, EVFILT_WRITE, EV_ADD | EV_ONESHOT | EV_CLEAR, 0, 0, &SocketContext->IoCqeType); - int Ret = - kevent( - *SocketContext->DatapathPartition->EventQ, - &Event, - 1, - NULL, - 0, - NULL); - if (Ret < 1) { + if (!CxPlatEventQEnqueueEx( + SocketContext->DatapathPartition->EventQ, + &SocketContext->IoSqe, + EVFILT_WRITE, + EV_ADD | EV_ONESHOT | EV_CLEAR)) { Status = errno; QuicTraceEvent( DatapathErrorStatus, "[data][%p] ERROR, %u, %s.", SocketContext->Binding, Status, - "kevent failed"); + "CxPlatEventQEnqueueEx failed"); goto Exit; } Status = QUIC_STATUS_PENDING; @@ -2129,27 +2127,6 @@ CxPlatSocketGetTcpStatistics( return QUIC_STATUS_NOT_SUPPORTED; } -void -CxPlatDataPathProcessCqe( - _In_ CXPLAT_CQE* Cqe - ) -{ - switch (CxPlatCqeType(Cqe)) { - case CXPLAT_CQE_TYPE_SOCKET_SHUTDOWN: { - CXPLAT_SOCKET_CONTEXT* SocketContext = - CXPLAT_CONTAINING_RECORD(CxPlatCqeUserData(Cqe), CXPLAT_SOCKET_CONTEXT, ShutdownSqe); - CxPlatSocketContextUninitializeComplete(SocketContext); - break; - } - case CXPLAT_CQE_TYPE_SOCKET_IO: { - CXPLAT_SOCKET_CONTEXT* SocketContext = - CXPLAT_CONTAINING_RECORD(CxPlatCqeUserData(Cqe), CXPLAT_SOCKET_CONTEXT, IoCqeType); - CxPlatDataPathSocketProcessIoCompletion(SocketContext, Cqe); - break; - } - } -} - _IRQL_requires_max_(PASSIVE_LEVEL) void QuicCopyRouteInfo( diff --git a/src/platform/datapath_linux.c b/src/platform/datapath_linux.c index 714d1162d2..b0c6be1259 100644 --- a/src/platform/datapath_linux.c +++ b/src/platform/datapath_linux.c @@ -29,18 +29,6 @@ CxPlatSocketUpdateQeo( return QUIC_STATUS_NOT_SUPPORTED; } -void -CxPlatDataPathProcessCqe( - _In_ CXPLAT_CQE* Cqe - ) -{ - if (CXPLAT_CQE_TYPE_XDP_SHUTDOWN <= CxPlatCqeType(Cqe)) { - RawDataPathProcessCqe(Cqe); - } else { - DataPathProcessCqe(Cqe); - } -} - _IRQL_requires_max_(PASSIVE_LEVEL) void CxPlatUpdateRoute( diff --git a/src/platform/datapath_raw_dummy.c b/src/platform/datapath_raw_dummy.c index 146feb637a..2db9a43e52 100644 --- a/src/platform/datapath_raw_dummy.c +++ b/src/platform/datapath_raw_dummy.c @@ -244,14 +244,6 @@ RawResolveRoute( return QUIC_STATUS_NOT_SUPPORTED; } -void -RawDataPathProcessCqe( - _In_ CXPLAT_CQE* Cqe - ) -{ - UNREFERENCED_PARAMETER(Cqe); -} - _IRQL_requires_max_(PASSIVE_LEVEL) void RawUpdateRoute( diff --git a/src/platform/datapath_raw_xdp.h b/src/platform/datapath_raw_xdp.h index d264ce5d4a..c2ef397d5b 100644 --- a/src/platform/datapath_raw_xdp.h +++ b/src/platform/datapath_raw_xdp.h @@ -26,14 +26,6 @@ typedef struct XDP_PARTITION XDP_PARTITION; typedef struct XDP_DATAPATH XDP_DATAPATH; typedef struct XDP_QUEUE XDP_QUEUE; -// -// IO header for SQE->CQE based completions. -// -typedef struct DATAPATH_XDP_IO_SQE { - DATAPATH_XDP_IO_TYPE IoType; - DATAPATH_SQE DatapathSqe; -} DATAPATH_XDP_IO_SQE; - typedef struct XDP_INTERFACE_COMMON { CXPLAT_INTERFACE; uint16_t QueueCount; @@ -52,7 +44,7 @@ typedef struct XDP_QUEUE_COMMON { typedef struct QUIC_CACHEALIGN XDP_PARTITION { CXPLAT_EXECUTION_CONTEXT Ec; - DATAPATH_SQE ShutdownSqe; + CXPLAT_SQE ShutdownSqe; const struct XDP_DATAPATH* Xdp; CXPLAT_EVENTQ* EventQ; XDP_QUEUE* Queues; // A linked list of queues, accessed by Next. diff --git a/src/platform/datapath_raw_xdp_linux.c b/src/platform/datapath_raw_xdp_linux.c index fd5d1a5470..14471f91eb 100644 --- a/src/platform/datapath_raw_xdp_linux.c +++ b/src/platform/datapath_raw_xdp_linux.c @@ -27,7 +27,6 @@ #include "datapath_raw_xdp_linux.c.clog.h" #endif - #define NUM_FRAMES 8192 * 2 #define CONS_NUM_DESCS NUM_FRAMES / 2 #define PROD_NUM_DESCS NUM_FRAMES / 2 @@ -87,8 +86,8 @@ typedef struct XDP_INTERFACE { typedef struct XDP_QUEUE { XDP_QUEUE_COMMON; - DATAPATH_SQE RxIoSqe; - DATAPATH_SQE FlushTxSqe; + CXPLAT_SQE RxIoSqe; + CXPLAT_SQE FlushTxSqe; CXPLAT_LIST_ENTRY PartitionTxQueue; CXPLAT_SLIST_ENTRY PartitionRxPool; @@ -128,6 +127,10 @@ typedef struct __attribute__((aligned(64))) XDP_TX_PACKET { uint8_t FrameBuffer[MAX_ETH_FRAME_SIZE]; } XDP_TX_PACKET; +CXPLAT_EVENT_COMPLETION CxPlatPartitionShutdownEventComplete; +CXPLAT_EVENT_COMPLETION CxPlatQueueRxIoEventComplete; +CXPLAT_EVENT_COMPLETION CxPlatQueueTxIoEventComplete; + void XdpSocketContextSetEvents( _In_ XDP_QUEUE* Queue, @@ -254,10 +257,10 @@ CxPlatDpRawInterfaceUninitialize( if (Queue->XskInfo->Xsk) { if (Queue->Partition && Queue->Partition->EventQ) { epoll_ctl(*Queue->Partition->EventQ, EPOLL_CTL_DEL, xsk_socket__fd(Queue->XskInfo->Xsk), NULL); - CxPlatSqeCleanup(Queue->Partition->EventQ, &Queue->RxIoSqe.Sqe); - CxPlatSqeCleanup(Queue->Partition->EventQ, &Queue->FlushTxSqe.Sqe); + CxPlatSqeCleanup(Queue->Partition->EventQ, &Queue->RxIoSqe); + CxPlatSqeCleanup(Queue->Partition->EventQ, &Queue->FlushTxSqe); if (i == 0) { - CxPlatSqeCleanup(Queue->Partition->EventQ, &Queue->Partition->ShutdownSqe.Sqe); + CxPlatSqeCleanup(Queue->Partition->EventQ, &Queue->Partition->ShutdownSqe); } } xsk_socket__delete(Queue->XskInfo->Xsk); @@ -799,14 +802,13 @@ CxPlatDpRawInitialize( Partition->Ec.NextTimeUs = UINT64_MAX; Partition->Ec.Callback = CxPlatXdpExecute; Partition->Ec.Context = &Xdp->Partitions[i]; - Partition->ShutdownSqe.CqeType = CXPLAT_CQE_TYPE_XDP_SHUTDOWN; CxPlatRefIncrement(&Xdp->RefCount); CxPlatRundownAcquire(&Xdp->Rundown); Partition->EventQ = CxPlatWorkerPoolGetEventQ(WorkerPool, (uint16_t)i); if (!CxPlatSqeInitialize( Partition->EventQ, - &Partition->ShutdownSqe.Sqe, + CxPlatPartitionShutdownEventComplete, &Partition->ShutdownSqe)) { Status = QUIC_STATUS_INTERNAL_ERROR; goto Error; @@ -817,22 +819,20 @@ CxPlatDpRawInitialize( while (Queue) { if (!CxPlatSqeInitialize( Partition->EventQ, - &Queue->RxIoSqe.Sqe, + CxPlatQueueRxIoEventComplete, &Queue->RxIoSqe)) { Status = QUIC_STATUS_INTERNAL_ERROR; goto Error; } - Queue->RxIoSqe.CqeType = CXPLAT_CQE_TYPE_XDP_IO; XdpSocketContextSetEvents(Queue, EPOLL_CTL_ADD, EPOLLIN); if (!CxPlatSqeInitialize( Partition->EventQ, - &Queue->FlushTxSqe.Sqe, + CxPlatQueueTxIoEventComplete, &Queue->FlushTxSqe)) { Status = QUIC_STATUS_INTERNAL_ERROR; goto Error; } - Queue->FlushTxSqe.CqeType = CXPLAT_CQE_TYPE_XDP_FLUSH_TX; ++QueueCount; Queue = Queue->Next; @@ -1201,7 +1201,7 @@ CxPlatXdpExecute( XdpPartitionShutdown, "[ xdp][%p] XDP partition shutdown", Partition); - CxPlatEventQEnqueue(Partition->EventQ, &Partition->ShutdownSqe.Sqe, &Partition->ShutdownSqe); + CxPlatEventQEnqueue(Partition->EventQ, &Partition->ShutdownSqe); return FALSE; } @@ -1334,40 +1334,43 @@ CxPlatXdpRx( } void -RawDataPathProcessCqe( +CxPlatPartitionShutdownEventComplete( _In_ CXPLAT_CQE* Cqe ) { - switch (CxPlatCqeType(Cqe)) { - case CXPLAT_CQE_TYPE_XDP_SHUTDOWN: { - XDP_PARTITION* Partition = - CXPLAT_CONTAINING_RECORD(CxPlatCqeUserData(Cqe), XDP_PARTITION, ShutdownSqe); - QuicTraceLogVerbose( - XdpPartitionShutdownComplete, - "[ xdp][%p] XDP partition shutdown complete", - Partition); - CxPlatDpRawRelease((XDP_DATAPATH*)Partition->Xdp); - break; - } - case CXPLAT_CQE_TYPE_XDP_IO: { - // TODO: use DATAPATH_IO_SQE to distinguish Tx/RX - DATAPATH_SQE* Sqe = (DATAPATH_SQE*)CxPlatCqeUserData(Cqe); - XDP_QUEUE* Queue; - Queue = CXPLAT_CONTAINING_RECORD(Sqe, XDP_QUEUE, RxIoSqe); - QuicTraceLogVerbose( - XdpQueueAsyncIoRxComplete, - "[ xdp][%p] XDP async IO complete (RX)", - Queue); - if (EPOLLOUT & Cqe->events) { - KickTx(Queue, TRUE); - } else { - Queue->RxQueued = FALSE; - Queue->Partition->Ec.Ready = TRUE; - } - break; - } - case CXPLAT_CQE_TYPE_XDP_FLUSH_TX: { + XDP_PARTITION* Partition = + CXPLAT_CONTAINING_RECORD(CxPlatCqeGetSqe(Cqe), XDP_PARTITION, ShutdownSqe); + QuicTraceLogVerbose( + XdpPartitionShutdownComplete, + "[ xdp][%p] XDP partition shutdown complete", + Partition); + CxPlatDpRawRelease((XDP_DATAPATH*)Partition->Xdp); +} +void +CxPlatQueueRxIoEventComplete( + _In_ CXPLAT_CQE* Cqe + ) +{ + // TODO: use CQE to distinguish Tx/RX + XDP_QUEUE* Queue = + CXPLAT_CONTAINING_RECORD(CxPlatCqeGetSqe(Cqe), XDP_QUEUE, RxIoSqe); + QuicTraceLogVerbose( + XdpQueueAsyncIoRxComplete, + "[ xdp][%p] XDP async IO complete (RX)", + Queue); + if (EPOLLOUT & Cqe->events) { + KickTx(Queue, TRUE); + } else { + Queue->RxQueued = FALSE; + Queue->Partition->Ec.Ready = TRUE; } - } +} + +void +CxPlatQueueTxIoEventComplete( + _In_ CXPLAT_CQE* Cqe + ) +{ + UNREFERENCED_PARAMETER(Cqe); // TODO - Use this? } diff --git a/src/platform/datapath_raw_xdp_win.c b/src/platform/datapath_raw_xdp_win.c index 370b53a529..c2178bfaf9 100644 --- a/src/platform/datapath_raw_xdp_win.c +++ b/src/platform/datapath_raw_xdp_win.c @@ -62,13 +62,13 @@ typedef struct XDP_QUEUE { uint16_t RssProcessor; uint8_t* RxBuffers; HANDLE RxXsk; - DATAPATH_XDP_IO_SQE RxIoSqe; + CXPLAT_SQE RxIoSqe; XSK_RING RxFillRing; XSK_RING RxRing; HANDLE RxProgram; uint8_t* TxBuffers; HANDLE TxXsk; - DATAPATH_XDP_IO_SQE TxIoSqe; + CXPLAT_SQE TxIoSqe; XSK_RING TxRing; XSK_RING TxCompletionRing; @@ -103,6 +103,10 @@ typedef struct DECLSPEC_ALIGN(MEMORY_ALLOCATION_ALIGNMENT) XDP_TX_PACKET { uint8_t FrameBuffer[MAX_ETH_FRAME_SIZE]; } XDP_TX_PACKET; +CXPLAT_EVENT_COMPLETION CxPlatIoXdpWaitRxEventComplete; +CXPLAT_EVENT_COMPLETION CxPlatIoXdpWaitTxEventComplete; +CXPLAT_EVENT_COMPLETION CxPlatIoXdpShutdownEventComplete; + _IRQL_requires_max_(PASSIVE_LEVEL) BOOLEAN CxPlatXdpExecute( @@ -459,10 +463,6 @@ CxPlatDpRawInterfaceInitialize( CxPlatLockInitialize(&Queue->TxLock); CxPlatListInitializeHead(&Queue->TxQueue); CxPlatListInitializeHead(&Queue->PartitionTxQueue); - CxPlatDatapathSqeInitialize(&Queue->RxIoSqe.DatapathSqe, CXPLAT_CQE_TYPE_SOCKET_IO); - Queue->RxIoSqe.IoType = DATAPATH_XDP_IO_RECV; - CxPlatDatapathSqeInitialize(&Queue->TxIoSqe.DatapathSqe, CXPLAT_CQE_TYPE_SOCKET_IO); - Queue->TxIoSqe.IoType = DATAPATH_XDP_IO_SEND; // // RX datapath. @@ -1111,7 +1111,7 @@ CxPlatDpRawInitialize( Partition->Ec.NextTimeUs = UINT64_MAX; Partition->Ec.Callback = CxPlatXdpExecute; Partition->Ec.Context = &Xdp->Partitions[i]; - Partition->ShutdownSqe.CqeType = CXPLAT_CQE_TYPE_SOCKET_SHUTDOWN; + CxPlatSqeInitializeEx(CxPlatIoXdpShutdownEventComplete, &Partition->ShutdownSqe); CxPlatRefIncrement(&Xdp->RefCount); Partition->EventQ = CxPlatWorkerPoolGetEventQ(WorkerPool, (uint16_t)i); @@ -1753,7 +1753,7 @@ CxPlatXdpExecute( Queue->TxXsk = NULL; Queue = Queue->Next; } - CxPlatEventQEnqueue(Partition->EventQ, &Partition->ShutdownSqe.Sqe, &Partition->ShutdownSqe); + CxPlatEventQEnqueue(Partition->EventQ, &Partition->ShutdownSqe); return FALSE; } @@ -1781,13 +1781,13 @@ CxPlatXdpExecute( XdpQueueAsyncIoRx, "[ xdp][%p] XDP async IO start (RX)", Queue); - CxPlatZeroMemory( - &Queue->RxIoSqe.DatapathSqe.Sqe.Overlapped, - sizeof(Queue->RxIoSqe.DatapathSqe.Sqe.Overlapped)); + CxPlatSqeInitializeEx( + CxPlatIoXdpWaitRxEventComplete, + &Queue->RxIoSqe); HRESULT hr = Xdp->XdpApi->XskNotifyAsync( Queue->RxXsk, XSK_NOTIFY_FLAG_WAIT_RX, - &Queue->RxIoSqe.DatapathSqe.Sqe.Overlapped); + &Queue->RxIoSqe.Overlapped); if (hr == HRESULT_FROM_WIN32(ERROR_IO_PENDING)) { Queue->RxQueued = TRUE; } else if (hr == S_OK) { @@ -1805,13 +1805,13 @@ CxPlatXdpExecute( XdpQueueAsyncIoTx, "[ xdp][%p] XDP async IO start (TX)", Queue); - CxPlatZeroMemory( - &Queue->TxIoSqe.DatapathSqe.Sqe.Overlapped, - sizeof(Queue->TxIoSqe.DatapathSqe.Sqe.Overlapped)); + CxPlatSqeInitializeEx( + CxPlatIoXdpWaitTxEventComplete, + &Queue->TxIoSqe); HRESULT hr = Xdp->XdpApi->XskNotifyAsync( Queue->TxXsk, XSK_NOTIFY_FLAG_WAIT_TX, - &Queue->TxIoSqe.DatapathSqe.Sqe.Overlapped); + &Queue->TxIoSqe.Overlapped); if (hr == HRESULT_FROM_WIN32(ERROR_IO_PENDING)) { Queue->TxQueued = TRUE; } else if (hr == S_OK) { @@ -1831,40 +1831,50 @@ CxPlatXdpExecute( return TRUE; } +_IRQL_requires_max_(PASSIVE_LEVEL) void -RawDataPathProcessCqe( +CxPlatIoXdpWaitRxEventComplete( _In_ CXPLAT_CQE* Cqe ) { - if (CxPlatCqeType(Cqe) == CXPLAT_CQE_TYPE_SOCKET_IO) { - DATAPATH_XDP_IO_SQE* Sqe = - CONTAINING_RECORD(CxPlatCqeUserData(Cqe), DATAPATH_XDP_IO_SQE, DatapathSqe); - XDP_QUEUE* Queue; + CXPLAT_SQE* Sqe = CxPlatCqeGetSqe(Cqe); + XDP_QUEUE* Queue = CONTAINING_RECORD(Sqe, XDP_QUEUE, RxIoSqe); + QuicTraceLogVerbose( + XdpQueueAsyncIoRxComplete, + "[ xdp][%p] XDP async IO complete (RX)", + Queue); + Queue->RxQueued = FALSE; + Queue->Partition->Ec.Ready = TRUE; +} - if (Sqe->IoType == DATAPATH_XDP_IO_RECV) { - Queue = CONTAINING_RECORD(Sqe, XDP_QUEUE, RxIoSqe); - QuicTraceLogVerbose( - XdpQueueAsyncIoRxComplete, - "[ xdp][%p] XDP async IO complete (RX)", - Queue); - Queue->RxQueued = FALSE; - } else { - CXPLAT_DBG_ASSERT(Sqe->IoType == DATAPATH_XDP_IO_SEND); - Queue = CONTAINING_RECORD(Sqe, XDP_QUEUE, TxIoSqe); - QuicTraceLogVerbose( - XdpQueueAsyncIoTxComplete, - "[ xdp][%p] XDP async IO complete (TX)", - Queue); - Queue->TxQueued = FALSE; - } - Queue->Partition->Ec.Ready = TRUE; - } else if (CxPlatCqeType(Cqe) == CXPLAT_CQE_TYPE_SOCKET_SHUTDOWN) { - XDP_PARTITION* Partition = - CONTAINING_RECORD(CxPlatCqeUserData(Cqe), XDP_PARTITION, ShutdownSqe); - QuicTraceLogVerbose( - XdpPartitionShutdownComplete, - "[ xdp][%p] XDP partition shutdown complete", - Partition); - CxPlatDpRawRelease((XDP_DATAPATH*)Partition->Xdp); - } +_IRQL_requires_max_(PASSIVE_LEVEL) +void +CxPlatIoXdpWaitTxEventComplete( + _In_ CXPLAT_CQE* Cqe + ) +{ + CXPLAT_SQE* Sqe = CxPlatCqeGetSqe(Cqe); + XDP_QUEUE* Queue = CONTAINING_RECORD(Sqe, XDP_QUEUE, TxIoSqe); + QuicTraceLogVerbose( + XdpQueueAsyncIoTxComplete, + "[ xdp][%p] XDP async IO complete (TX)", + Queue); + Queue->TxQueued = FALSE; + Queue->Partition->Ec.Ready = TRUE; +} + +_IRQL_requires_max_(PASSIVE_LEVEL) +void +CxPlatIoXdpShutdownEventComplete( + _In_ CXPLAT_CQE* Cqe + ) +{ + CXPLAT_SQE* Sqe = CxPlatCqeGetSqe(Cqe); + XDP_PARTITION* Partition = + CONTAINING_RECORD(Sqe, XDP_PARTITION, ShutdownSqe); + QuicTraceLogVerbose( + XdpPartitionShutdownComplete, + "[ xdp][%p] XDP partition shutdown complete", + Partition); + CxPlatDpRawRelease((XDP_DATAPATH*)Partition->Xdp); } diff --git a/src/platform/datapath_win.c b/src/platform/datapath_win.c index 6512dc98ab..6c07715f97 100644 --- a/src/platform/datapath_win.c +++ b/src/platform/datapath_win.c @@ -31,30 +31,6 @@ CxPlatSocketUpdateQeo( return QUIC_STATUS_NOT_SUPPORTED; } -void -CxPlatDataPathProcessCqe( - _In_ CXPLAT_CQE* Cqe - ) -{ - switch (CxPlatCqeType(Cqe)) { - case CXPLAT_CQE_TYPE_SOCKET_IO: { - DATAPATH_IO_SQE* Sqe = - CONTAINING_RECORD(CxPlatCqeUserData(Cqe), DATAPATH_IO_SQE, DatapathSqe); - if (Sqe->IoType == DATAPATH_XDP_IO_RECV || Sqe->IoType == DATAPATH_XDP_IO_SEND) { - RawDataPathProcessCqe(Cqe); - } else { - DataPathProcessCqe(Cqe); - } - break; - } - case CXPLAT_CQE_TYPE_SOCKET_SHUTDOWN: { - RawDataPathProcessCqe(Cqe); - break; - } - default: CXPLAT_DBG_ASSERT(FALSE); break; - } -} - _IRQL_requires_max_(PASSIVE_LEVEL) void CxPlatUpdateRoute( diff --git a/src/platform/datapath_winuser.c b/src/platform/datapath_winuser.c index c7d40bf83a..2d935ab68f 100644 --- a/src/platform/datapath_winuser.c +++ b/src/platform/datapath_winuser.c @@ -104,12 +104,22 @@ CXPLAT_STATIC_ASSERT( ErrorCode == WSAECONNRESET \ ) +typedef enum RIO_IO_TYPE { + RIO_IO_RECV, + RIO_IO_SEND, + RIO_IO_RECV_FAILURE, +} RIO_IO_TYPE; // // Contains all the info for a single RX IO operation. Multiple RX packets may // come from a single IO operation. // typedef struct DATAPATH_RX_IO_BLOCK { + // + // The IO type. + // + RIO_IO_TYPE IoType; + // // The owning datagram pool. // @@ -138,7 +148,7 @@ typedef struct DATAPATH_RX_IO_BLOCK { // // The receive SQE. // - DATAPATH_IO_SQE Sqe; + CXPLAT_SQE Sqe; // // Contains the input and output message data. @@ -179,7 +189,7 @@ typedef struct DECLSPEC_ALIGN(MEMORY_ALLOCATION_ALIGNMENT) CXPLAT_RIO_SEND_BUFFE // // The IO type. // - DATAPATH_IO_TYPE IoType; + RIO_IO_TYPE IoType; // // The RIO buffer ID. @@ -210,7 +220,7 @@ typedef struct CXPLAT_SEND_DATA { // // The submission queue entry for the send completion. // - DATAPATH_IO_SQE Sqe; + CXPLAT_SQE Sqe; // // The owning processor context. @@ -284,6 +294,14 @@ void SocketDelete( _In_ CXPLAT_SOCKET* Socket ); + +CXPLAT_EVENT_COMPLETION CxPlatIoRecvEventComplete; +CXPLAT_EVENT_COMPLETION CxPlatIoRecvFailureEventComplete; +CXPLAT_EVENT_COMPLETION CxPlatIoSendEventComplete; +CXPLAT_EVENT_COMPLETION CxPlatIoQueueSendEventComplete; +CXPLAT_EVENT_COMPLETION CxPlatIoAcceptExEventComplete; +CXPLAT_EVENT_COMPLETION CxPlatIoConnectExEventComplete; +CXPLAT_EVENT_COMPLETION CxPlatIoRioNotifyEventComplete; #ifdef DEBUG #ifndef AllocOffset @@ -350,66 +368,23 @@ CxPlatSocketContextRelease( VOID CxPlatStartDatapathIo( _In_ CXPLAT_SOCKET_PROC* SocketProc, - _Inout_ DATAPATH_IO_SQE* Sqe, - _In_ DATAPATH_IO_TYPE IoType + _Inout_ CXPLAT_SQE* Sqe, + _In_ CXPLAT_EVENT_COMPLETION Completion ) { - CXPLAT_DBG_ASSERT(Sqe->DatapathSqe.CqeType == CXPLAT_CQE_TYPE_SOCKET_IO); - CXPLAT_DBG_ASSERT(Sqe->DatapathSqe.Sqe.UserData == &Sqe->DatapathSqe); - CXPLAT_DBG_ASSERT(Sqe->DatapathSqe.Sqe.Overlapped.Internal != 0x103); // STATUS_PENDING - CXPLAT_DBG_ASSERT(Sqe->IoType == 0); - - Sqe->IoType = IoType; - CxPlatZeroMemory(&Sqe->DatapathSqe.Sqe.Overlapped, sizeof(Sqe->DatapathSqe.Sqe.Overlapped)); + CXPLAT_DBG_ASSERT(Sqe->Overlapped.Internal != 0x103); // STATUS_PENDING + CxPlatSqeInitializeEx(Completion, Sqe); CxPlatRefIncrement(&SocketProc->RefCount); } VOID CxPlatCancelDatapathIo( - _In_ CXPLAT_SOCKET_PROC* SocketProc, - _Inout_ DATAPATH_IO_SQE* Sqe + _In_ CXPLAT_SOCKET_PROC* SocketProc ) { - CXPLAT_DBG_ASSERT(Sqe->DatapathSqe.CqeType == CXPLAT_CQE_TYPE_SOCKET_IO); - CXPLAT_DBG_ASSERT(Sqe->DatapathSqe.Sqe.UserData == &Sqe->DatapathSqe); - CXPLAT_DBG_ASSERT(Sqe->IoType > DATAPATH_IO_SIGNATURE && Sqe->IoType < DATAPATH_IO_MAX); - DBG_UNREFERENCED_PARAMETER(Sqe); -#if DEBUG - Sqe->IoType = 0; -#endif CxPlatSocketContextRelease(SocketProc); } -VOID -CxPlatStopDatapathIo( - _Inout_ DATAPATH_IO_SQE* Sqe - ) -{ - CXPLAT_DBG_ASSERT(Sqe->DatapathSqe.CqeType == CXPLAT_CQE_TYPE_SOCKET_IO); - CXPLAT_DBG_ASSERT(Sqe->DatapathSqe.Sqe.UserData == &Sqe->DatapathSqe); - CXPLAT_DBG_ASSERT(Sqe->DatapathSqe.Sqe.Overlapped.Internal != 0x103); // STATUS_PENDING - CXPLAT_DBG_ASSERT(Sqe->IoType > DATAPATH_IO_SIGNATURE && Sqe->IoType < DATAPATH_IO_MAX); - DBG_UNREFERENCED_PARAMETER(Sqe); -#if DEBUG - Sqe->IoType = 0; -#endif -} - -VOID -CxPlatStopInlineDatapathIo( - _Inout_ DATAPATH_IO_SQE* Sqe - ) -{ - // - // We want to assert the overlapped result is not pending below, but Winsock - // and the Windows kernel may leave the overlapped struct in the pending - // state if an IO completes inline. Ignore the overlapped result in this - // case. - // - Sqe->DatapathSqe.Sqe.Overlapped.Internal = 0; - CxPlatStopDatapathIo(Sqe); -} - void CxPlatDataPathStartReceiveAsync( _In_ CXPLAT_SOCKET_PROC* SocketProc @@ -1429,7 +1404,10 @@ CxPlatSocketArmRioNotify( { if (!SocketProc->RioNotifyArmed) { SocketProc->RioNotifyArmed = TRUE; - CxPlatStartDatapathIo(SocketProc, &SocketProc->RioSqe, DATAPATH_IO_RIO_NOTIFY); + CxPlatStartDatapathIo( + SocketProc, + &SocketProc->RioSqe, + CxPlatIoRioNotifyEventComplete); ULONG NotifyResult = SocketProc->DatapathProc->Datapath-> RioDispatch.RIONotify(SocketProc->RioCq); CXPLAT_TEL_ASSERT(NotifyResult == ERROR_SUCCESS); @@ -1440,7 +1418,7 @@ CxPlatSocketArmRioNotify( QUIC_STATUS CxPlatSocketEnqueueSqe( _In_ CXPLAT_SOCKET_PROC* SocketProc, - _In_ DATAPATH_IO_SQE* Sqe, + _In_ CXPLAT_SQE* Sqe, _In_ uint32_t NumBytes ) { @@ -1448,16 +1426,15 @@ CxPlatSocketEnqueueSqe( CXPLAT_DBG_ASSERT(!SocketProc->Freed); if (!CxPlatEventQEnqueueEx( SocketProc->DatapathProc->EventQ, - &Sqe->DatapathSqe.Sqe, - NumBytes, - &Sqe->DatapathSqe)) { + Sqe, + NumBytes)) { const DWORD LastError = GetLastError(); QuicTraceEvent( DatapathErrorStatus, "[data][%p] ERROR, %u, %s.", SocketProc->Parent, LastError, - "CxPlatSocketEnqueueSqe"); + "CxPlatEventQEnqueueEx"); return HRESULT_FROM_WIN32(LastError); } return QUIC_STATUS_SUCCESS; @@ -1536,8 +1513,6 @@ SocketCreateUdp( CxPlatRefInitialize(&Socket->PerProcSockets[i].RefCount); Socket->PerProcSockets[i].Parent = Socket; Socket->PerProcSockets[i].Socket = INVALID_SOCKET; - CxPlatDatapathSqeInitialize( - &Socket->PerProcSockets[i].IoSqe.DatapathSqe, CXPLAT_CQE_TYPE_SOCKET_IO); CxPlatRundownInitialize(&Socket->PerProcSockets[i].RundownRef); Socket->PerProcSockets[i].RioCq = RIO_INVALID_CQ; Socket->PerProcSockets[i].RioRq = RIO_INVALID_RQ; @@ -1875,11 +1850,7 @@ SocketCreateUdp( NotificationCompletion.Iocp.IocpHandle = *SocketProc->DatapathProc->EventQ; NotificationCompletion.Iocp.Overlapped = - &SocketProc->RioSqe.DatapathSqe.Sqe.Overlapped; - - CxPlatDatapathSqeInitialize( - &SocketProc->RioSqe.DatapathSqe, - CXPLAT_CQE_TYPE_SOCKET_IO); + &SocketProc->RioSqe.Overlapped; SocketProc->RioCq = Datapath->RioDispatch.RIOCreateCompletionQueue( @@ -2189,7 +2160,6 @@ CxPlatSocketCreateTcpInternal( CxPlatRefInitialize(&SocketProc->RefCount); SocketProc->Parent = Socket; SocketProc->Socket = INVALID_SOCKET; - CxPlatDatapathSqeInitialize(&SocketProc->IoSqe.DatapathSqe, CXPLAT_CQE_TYPE_SOCKET_IO); CxPlatRundownInitialize(&SocketProc->RundownRef); SocketProc->RioCq = RIO_INVALID_CQ; SocketProc->RioRq = RIO_INVALID_RQ; @@ -2295,7 +2265,10 @@ CxPlatSocketCreateTcpInternal( SOCKADDR_INET MappedRemoteAddress = { 0 }; CxPlatConvertToMappedV6(RemoteAddress, &MappedRemoteAddress); - CxPlatStartDatapathIo(SocketProc, &SocketProc->IoSqe, DATAPATH_IO_CONNECTEX); + CxPlatStartDatapathIo( + SocketProc, + &SocketProc->IoSqe, + CxPlatIoConnectExEventComplete); Result = Datapath->ConnectEx( @@ -2305,7 +2278,7 @@ CxPlatSocketCreateTcpInternal( NULL, 0, &BytesReturned, - &SocketProc->IoSqe.DatapathSqe.Sqe.Overlapped); + &SocketProc->IoSqe.Overlapped); if (Result == FALSE) { int WsaError = WSAGetLastError(); if (WsaError != WSA_IO_PENDING) { @@ -2316,7 +2289,7 @@ CxPlatSocketCreateTcpInternal( WsaError, "ConnectEx"); Status = HRESULT_FROM_WIN32(WsaError); - CxPlatCancelDatapathIo(SocketProc, &SocketProc->IoSqe); + CxPlatCancelDatapathIo(SocketProc); goto Error; } } else { @@ -2325,7 +2298,7 @@ CxPlatSocketCreateTcpInternal( // Status = CxPlatSocketEnqueueSqe(SocketProc, &SocketProc->IoSqe, BytesReturned); if (QUIC_FAILED(Status)) { - CxPlatCancelDatapathIo(SocketProc, &SocketProc->IoSqe); + CxPlatCancelDatapathIo(SocketProc); goto Error; } } @@ -2461,7 +2434,6 @@ SocketCreateTcpListener( CxPlatRefInitialize(&SocketProc->RefCount); SocketProc->Parent = Socket; SocketProc->Socket = INVALID_SOCKET; - CxPlatDatapathSqeInitialize(&SocketProc->IoSqe.DatapathSqe, CXPLAT_CQE_TYPE_SOCKET_IO); CxPlatRundownInitialize(&SocketProc->RundownRef); SocketProc->RioCq = RIO_INVALID_CQ; SocketProc->RioRq = RIO_INVALID_RQ; @@ -2868,9 +2840,6 @@ CxPlatSocketAllocRxIoBlock( IoBlock->OwningPool = OwningPool; IoBlock->ReferenceCount = 0; IoBlock->SocketProc = SocketProc; -#if DEBUG - IoBlock->Sqe.IoType = 0; -#endif } return IoBlock; @@ -2911,7 +2880,10 @@ CxPlatSocketStartAccept( } } - CxPlatStartDatapathIo(ListenerSocketProc, &ListenerSocketProc->IoSqe, DATAPATH_IO_ACCEPTEX); + CxPlatStartDatapathIo( + ListenerSocketProc, + &ListenerSocketProc->IoSqe, + CxPlatIoAcceptExEventComplete); Result = Datapath->AcceptEx( @@ -2922,7 +2894,7 @@ CxPlatSocketStartAccept( sizeof(SOCKADDR_INET)+16, // dwLocalAddressLength sizeof(SOCKADDR_INET)+16, // dwRemoteAddressLength &BytesRecv, - &ListenerSocketProc->IoSqe.DatapathSqe.Sqe.Overlapped); + &ListenerSocketProc->IoSqe.Overlapped); if (Result == FALSE) { int WsaError = WSAGetLastError(); if (WsaError != WSA_IO_PENDING) { @@ -2933,7 +2905,7 @@ CxPlatSocketStartAccept( WsaError, "AcceptEx"); Status = HRESULT_FROM_WIN32(WsaError); - CxPlatCancelDatapathIo(ListenerSocketProc, &ListenerSocketProc->IoSqe); + CxPlatCancelDatapathIo(ListenerSocketProc); goto Error; } } else { @@ -2942,7 +2914,7 @@ CxPlatSocketStartAccept( // Status = CxPlatSocketEnqueueSqe(ListenerSocketProc, &ListenerSocketProc->IoSqe, BytesRecv); if (QUIC_FAILED(Status)) { - CxPlatCancelDatapathIo(ListenerSocketProc, &ListenerSocketProc->IoSqe); + CxPlatCancelDatapathIo(ListenerSocketProc); goto Error; } } @@ -2956,12 +2928,10 @@ CxPlatSocketStartAccept( void CxPlatDataPathSocketProcessAcceptCompletion( - _In_ DATAPATH_IO_SQE* Sqe, - _In_ CXPLAT_CQE* Cqe + _In_ CXPLAT_SOCKET_PROC* ListenerSocketProc, + _In_ ULONG IoResult ) { - CXPLAT_SOCKET_PROC* ListenerSocketProc = CONTAINING_RECORD(Sqe, CXPLAT_SOCKET_PROC, IoSqe); - ULONG IoResult = RtlNtStatusToDosError((NTSTATUS)Cqe->Internal); CXPLAT_SOCKET_PROC* AcceptSocketProc = NULL; if (IoResult == WSAENOTSOCK || IoResult == WSA_OPERATION_ABORTED) { @@ -3105,13 +3075,10 @@ CxPlatDataPathSocketProcessAcceptCompletion( void CxPlatDataPathSocketProcessConnectCompletion( - _In_ DATAPATH_IO_SQE* Sqe, - _In_ CXPLAT_CQE* Cqe + _In_ CXPLAT_SOCKET_PROC* SocketProc, + _In_ ULONG IoResult ) { - CXPLAT_SOCKET_PROC* SocketProc = CONTAINING_RECORD(Sqe, CXPLAT_SOCKET_PROC, IoSqe); - ULONG IoResult = RtlNtStatusToDosError((NTSTATUS)Cqe->Internal); - if (IoResult == WSAENOTSOCK || IoResult == WSA_OPERATION_ABORTED) { // // Error from shutdown, silently ignore. Return immediately so the @@ -3201,11 +3168,10 @@ CxPlatSocketStartRioReceives( Control.BufferId = IoBlock->RioBufferId; Control.Offset = FIELD_OFFSET(DATAPATH_RX_IO_BLOCK, ControlBuf); Control.Length = sizeof(IoBlock->ControlBuf); - IoBlock->Sqe.IoType = DATAPATH_IO_RIO_RECV; if (!Datapath->RioDispatch.RIOReceiveEx( SocketProc->RioRq, &Data, 1, NULL, &RemoteAddr, - &Control, NULL, RioFlags, &IoBlock->Sqe.IoType)) { + &Control, NULL, RioFlags, &IoBlock->Sqe)) { int WsaError = WSAGetLastError(); QuicTraceEvent( DatapathErrorStatus, @@ -3295,8 +3261,10 @@ CxPlatSocketStartWinsockReceive( // held by the socket until it completes. // - CxPlatDatapathSqeInitialize(&IoBlock->Sqe.DatapathSqe, CXPLAT_CQE_TYPE_SOCKET_IO); - CxPlatStartDatapathIo(SocketProc, &IoBlock->Sqe, DATAPATH_IO_RECV); + CxPlatStartDatapathIo( + SocketProc, + &IoBlock->Sqe, + CxPlatIoRecvEventComplete); IoBlock->WsaControlBuf.buf = ((CHAR*)IoBlock) + Datapath->RecvPayloadOffset; IoBlock->WsaControlBuf.len = SocketProc->Parent->RecvBufLen; @@ -3325,7 +3293,7 @@ CxPlatSocketStartWinsockReceive( SocketProc->Socket, &IoBlock->WsaMsgHdr, &BytesRecv, - &IoBlock->Sqe.DatapathSqe.Sqe.Overlapped, + &IoBlock->Sqe.Overlapped, NULL); } else { Result = @@ -3335,7 +3303,7 @@ CxPlatSocketStartWinsockReceive( 1, &BytesRecv, &IoBlock->WsaMsgHdr.dwFlags, - &IoBlock->Sqe.DatapathSqe.Sqe.Overlapped, + &IoBlock->Sqe.Overlapped, NULL); } @@ -3350,7 +3318,7 @@ CxPlatSocketStartWinsockReceive( // Update the SQE to indicate the failure. // if (SyncBytesReceived == NULL) { - IoBlock->Sqe.IoType = DATAPATH_IO_RECV_FAILURE; + IoBlock->Sqe.Completion = CxPlatIoRecvFailureEventComplete; BytesRecv = (DWORD)WsaError; } } @@ -3360,8 +3328,14 @@ CxPlatSocketStartWinsockReceive( // The receive completed inline (success or failure), and the caller is // prepared to handle it synchronously. // - CxPlatStopInlineDatapathIo(&IoBlock->Sqe); CXPLAT_DBG_ASSERT(BytesRecv < UINT16_MAX); + // + // We want to assert the overlapped result is not pending below, but Winsock + // and the Windows kernel may leave the overlapped struct in the pending + // state if an IO completes inline. Ignore the overlapped result in this + // case. + // + IoBlock->Sqe.Overlapped.Internal = 0; *SyncBytesReceived = (uint16_t)BytesRecv; *SyncIoResult = WsaError; *SyncIoBlock = IoBlock; @@ -3380,7 +3354,7 @@ CxPlatSocketStartWinsockReceive( // and this likely should simply be treated as a fatal error. // CXPLAT_DBG_ASSERT(FALSE); // We don't expect tests to hit this. - CxPlatCancelDatapathIo(SocketProc, &IoBlock->Sqe); + CxPlatCancelDatapathIo(SocketProc); CxPlatSocketFreeRxIoBlock(IoBlock); return Status; } @@ -3695,12 +3669,9 @@ CxPlatDataPathStartReceiveAsync( void CxPlatDataPathSocketProcessRioCompletion( - _In_ DATAPATH_IO_SQE* Sqe, - _In_ CXPLAT_CQE* Cqe + _In_ CXPLAT_SOCKET_PROC* SocketProc ) { - UNREFERENCED_PARAMETER(Cqe); - CXPLAT_SOCKET_PROC* SocketProc = CONTAINING_RECORD(Sqe, CXPLAT_SOCKET_PROC, RioSqe); CXPLAT_DATAPATH* Datapath = SocketProc->DatapathProc->Datapath; ULONG ResultCount; BOOLEAN UpcallAcquired; @@ -3721,14 +3692,14 @@ CxPlatDataPathSocketProcessRioCompletion( CXPLAT_FRE_ASSERT(ResultCount != RIO_CORRUPT_CQ); for (ULONG i = 0; i < ResultCount; i++) { - DATAPATH_IO_TYPE* IoType = - (DATAPATH_IO_TYPE*)(ULONG_PTR)Results[i].RequestContext; + RIO_IO_TYPE* IoType = + (RIO_IO_TYPE*)(ULONG_PTR)Results[i].RequestContext; switch (*IoType) { - case DATAPATH_IO_RIO_RECV: + case RIO_IO_RECV: CXPLAT_DBG_ASSERT(Results[i].BytesTransferred <= UINT16_MAX); DATAPATH_RX_IO_BLOCK* IoBlock = - CONTAINING_RECORD(IoType, DATAPATH_RX_IO_BLOCK, Sqe.IoType); + CONTAINING_RECORD(IoType, DATAPATH_RX_IO_BLOCK, IoType); if (UpcallAcquired) { NeedReceive = @@ -3744,7 +3715,7 @@ CxPlatDataPathSocketProcessRioCompletion( SocketProc->RioRecvCount--; break; - case DATAPATH_IO_RIO_SEND: + case RIO_IO_SEND: CXPLAT_RIO_SEND_BUFFER_HEADER* SendHeader = CONTAINING_RECORD(IoType, CXPLAT_RIO_SEND_BUFFER_HEADER, IoType); CxPlatSendDataComplete(SendHeader->SendData, Results[i].Status); @@ -4075,9 +4046,6 @@ SendDataAlloc( SendData->ClientBuffer.len = 0; SendData->ClientBuffer.buf = NULL; SendData->DatapathType = Config->Route->DatapathType = CXPLAT_DATAPATH_TYPE_NORMAL; -#if DEBUG - SendData->Sqe.IoType = 0; -#endif if (Socket->UseRio) { SendData->BufferPool = @@ -4469,7 +4437,7 @@ CxPlatSocketSendWithRio( Data.BufferId = SendHeader->RioBufferId; Data.Length = SendData->WsaBuffers[i].len; - SendHeader->IoType = DATAPATH_IO_RIO_SEND; + SendHeader->IoType = RIO_IO_SEND; SendHeader->SendData = SendData; if (!Datapath->RioDispatch.RIOSendEx( @@ -4595,8 +4563,10 @@ CxPlatSocketSendInline( // // Start the async send. // - CxPlatDatapathSqeInitialize(&SendData->Sqe.DatapathSqe, CXPLAT_CQE_TYPE_SOCKET_IO); - CxPlatStartDatapathIo(SocketProc, &SendData->Sqe, DATAPATH_IO_SEND); + CxPlatStartDatapathIo( + SocketProc, + &SendData->Sqe, + CxPlatIoSendEventComplete); if (Socket->Type == CXPLAT_SOCKET_UDP) { Result = @@ -4605,7 +4575,7 @@ CxPlatSocketSendInline( &WSAMhdr, 0, &BytesSent, - &SendData->Sqe.DatapathSqe.Sqe.Overlapped, + &SendData->Sqe.Overlapped, NULL); } else { Result = @@ -4615,7 +4585,7 @@ CxPlatSocketSendInline( SendData->WsaBufferCount, &BytesSent, 0, - &SendData->Sqe.DatapathSqe.Sqe.Overlapped, + &SendData->Sqe.Overlapped, NULL); } @@ -4630,7 +4600,7 @@ CxPlatSocketSendInline( // // Completed synchronously, so process the completion inline. // - CxPlatCancelDatapathIo(SocketProc, &SendData->Sqe); + CxPlatCancelDatapathIo(SocketProc); CxPlatSendDataComplete(SendData, WsaError); } @@ -4641,11 +4611,17 @@ CxPlatSocketSendEnqueue( ) { SendData->LocalAddress = Route->LocalAddress; - CxPlatDatapathSqeInitialize(&SendData->Sqe.DatapathSqe, CXPLAT_CQE_TYPE_SOCKET_IO); - CxPlatStartDatapathIo(SendData->SocketProc, &SendData->Sqe, DATAPATH_IO_QUEUE_SEND); - QUIC_STATUS Status = CxPlatSocketEnqueueSqe(SendData->SocketProc, &SendData->Sqe, 0); + CxPlatStartDatapathIo( + SendData->SocketProc, + &SendData->Sqe, + CxPlatIoQueueSendEventComplete); + QUIC_STATUS Status = + CxPlatSocketEnqueueSqe( + SendData->SocketProc, + &SendData->Sqe, + 0); if (QUIC_FAILED(Status)) { - CxPlatCancelDatapathIo(SendData->SocketProc, &SendData->Sqe); + CxPlatCancelDatapathIo(SendData->SocketProc); } } @@ -4690,12 +4666,9 @@ SocketSend( void CxPlatDataPathSocketProcessQueuedSend( - _In_ DATAPATH_IO_SQE* Sqe, - _In_ CXPLAT_CQE* Cqe + _In_ CXPLAT_SEND_DATA* SendData ) { - UNREFERENCED_PARAMETER(Cqe); - CXPLAT_SEND_DATA* SendData = CONTAINING_RECORD(Sqe, CXPLAT_SEND_DATA, Sqe); CXPLAT_SOCKET_PROC* SocketProc = SendData->SocketProc; if (CxPlatRundownAcquire(&SocketProc->RundownRef)) { @@ -4795,81 +4768,103 @@ CxPlatSocketGetTcpStatistics( #endif } +_IRQL_requires_max_(PASSIVE_LEVEL) void -DataPathProcessCqe( +CxPlatIoRecvEventComplete( _In_ CXPLAT_CQE* Cqe ) { - switch (CxPlatCqeType(Cqe)) { - case CXPLAT_CQE_TYPE_SOCKET_IO: { - DATAPATH_IO_SQE* Sqe = - CONTAINING_RECORD(CxPlatCqeUserData(Cqe), DATAPATH_IO_SQE, DatapathSqe); - DATAPATH_IO_TYPE IoType = Sqe->IoType; - CXPLAT_SOCKET_PROC* SocketProc = NULL; - - CxPlatStopDatapathIo(Sqe); - - switch (IoType) { - case DATAPATH_IO_RECV: - // - // N.B. We don't set SocketProc here because receive completions are - // special (they loop internally). - // - CXPLAT_DBG_ASSERT(Cqe->dwNumberOfBytesTransferred <= UINT16_MAX); - CxPlatDataPathSocketProcessReceive( - CONTAINING_RECORD(Sqe, DATAPATH_RX_IO_BLOCK, Sqe), - (uint16_t)Cqe->dwNumberOfBytesTransferred, - RtlNtStatusToDosError((NTSTATUS)Cqe->Internal)); - break; - - case DATAPATH_IO_SEND: - SocketProc = CONTAINING_RECORD(Sqe, CXPLAT_SEND_DATA, Sqe)->SocketProc; - CxPlatSendDataComplete( - CONTAINING_RECORD(Sqe, CXPLAT_SEND_DATA, Sqe), - RtlNtStatusToDosError((NTSTATUS)Cqe->Internal)); - break; - - case DATAPATH_IO_QUEUE_SEND: - SocketProc = CONTAINING_RECORD(Sqe, CXPLAT_SEND_DATA, Sqe)->SocketProc; - CxPlatDataPathSocketProcessQueuedSend(Sqe, Cqe); - break; + CXPLAT_SQE* Sqe = CxPlatCqeGetSqe(Cqe); + CXPLAT_DBG_ASSERT(Sqe->Overlapped.Internal != 0x103); // STATUS_PENDING + CXPLAT_DBG_ASSERT(Cqe->dwNumberOfBytesTransferred <= UINT16_MAX); + CxPlatDataPathSocketProcessReceive( + CONTAINING_RECORD(Sqe, DATAPATH_RX_IO_BLOCK, Sqe), + (uint16_t)Cqe->dwNumberOfBytesTransferred, + RtlNtStatusToDosError((NTSTATUS)Cqe->Internal)); +} - case DATAPATH_IO_ACCEPTEX: - SocketProc = CONTAINING_RECORD(Sqe, CXPLAT_SOCKET_PROC, IoSqe); - CxPlatDataPathSocketProcessAcceptCompletion(Sqe, Cqe); - break; +_IRQL_requires_max_(PASSIVE_LEVEL) +void +CxPlatIoRecvFailureEventComplete( + _In_ CXPLAT_CQE* Cqe + ) +{ + CXPLAT_SQE* Sqe = CxPlatCqeGetSqe(Cqe); + CXPLAT_DBG_ASSERT(Sqe->Overlapped.Internal != 0x103); // STATUS_PENDING + CXPLAT_DBG_ASSERT(Cqe->dwNumberOfBytesTransferred <= UINT16_MAX); + CxPlatDataPathSocketProcessReceive( + CONTAINING_RECORD(Sqe, DATAPATH_RX_IO_BLOCK, Sqe), + 0, + (ULONG)Cqe->dwNumberOfBytesTransferred); +} - case DATAPATH_IO_CONNECTEX: - SocketProc = CONTAINING_RECORD(Sqe, CXPLAT_SOCKET_PROC, IoSqe); - CxPlatDataPathSocketProcessConnectCompletion(Sqe, Cqe); - break; +_IRQL_requires_max_(PASSIVE_LEVEL) +void +CxPlatIoSendEventComplete( + _In_ CXPLAT_CQE* Cqe + ) +{ + CXPLAT_SQE* Sqe = CxPlatCqeGetSqe(Cqe); + CXPLAT_DBG_ASSERT(Sqe->Overlapped.Internal != 0x103); // STATUS_PENDING + CXPLAT_SEND_DATA* SendData = CONTAINING_RECORD(Sqe, CXPLAT_SEND_DATA, Sqe); + CXPLAT_SOCKET_PROC* SocketProc = SendData->SocketProc; + CxPlatSendDataComplete( + SendData, + RtlNtStatusToDosError((NTSTATUS)Cqe->Internal)); + CxPlatSocketContextRelease(SocketProc); +} - case DATAPATH_IO_RIO_NOTIFY: - SocketProc = CONTAINING_RECORD(Sqe, CXPLAT_SOCKET_PROC, RioSqe); - CxPlatDataPathSocketProcessRioCompletion(Sqe, Cqe); - break; +_IRQL_requires_max_(PASSIVE_LEVEL) +void +CxPlatIoQueueSendEventComplete( + _In_ CXPLAT_CQE* Cqe + ) +{ + CXPLAT_SQE* Sqe = CxPlatCqeGetSqe(Cqe); + CXPLAT_DBG_ASSERT(Sqe->Overlapped.Internal != 0x103); // STATUS_PENDING + CXPLAT_SEND_DATA* SendData = CONTAINING_RECORD(Sqe, CXPLAT_SEND_DATA, Sqe); + CXPLAT_SOCKET_PROC* SocketProc = SendData->SocketProc; + CxPlatDataPathSocketProcessQueuedSend(SendData); + CxPlatSocketContextRelease(SocketProc); +} - case DATAPATH_IO_RECV_FAILURE: - // - // N.B. We don't set SocketProc here because receive completions are - // special (they loop internally). - // - CxPlatDataPathSocketProcessReceive( - CONTAINING_RECORD(Sqe, DATAPATH_RX_IO_BLOCK, Sqe), - 0, - (ULONG)Cqe->dwNumberOfBytesTransferred); - break; +_IRQL_requires_max_(PASSIVE_LEVEL) +void +CxPlatIoAcceptExEventComplete( + _In_ CXPLAT_CQE* Cqe + ) +{ + CXPLAT_SQE* Sqe = CxPlatCqeGetSqe(Cqe); + CXPLAT_DBG_ASSERT(Sqe->Overlapped.Internal != 0x103); // STATUS_PENDING + CXPLAT_SOCKET_PROC* SocketProc = CONTAINING_RECORD(Sqe, CXPLAT_SOCKET_PROC, IoSqe); + ULONG IoResult = RtlNtStatusToDosError((NTSTATUS)Cqe->Internal); + CxPlatDataPathSocketProcessAcceptCompletion(SocketProc, IoResult); + CxPlatSocketContextRelease(SocketProc); +} - default: - CXPLAT_DBG_ASSERT(FALSE); - break; - } +_IRQL_requires_max_(PASSIVE_LEVEL) +void +CxPlatIoConnectExEventComplete( + _In_ CXPLAT_CQE* Cqe + ) +{ + CXPLAT_SQE* Sqe = CxPlatCqeGetSqe(Cqe); + CXPLAT_DBG_ASSERT(Sqe->Overlapped.Internal != 0x103); // STATUS_PENDING + CXPLAT_SOCKET_PROC* SocketProc = CONTAINING_RECORD(Sqe, CXPLAT_SOCKET_PROC, IoSqe); + ULONG IoResult = RtlNtStatusToDosError((NTSTATUS)Cqe->Internal); + CxPlatDataPathSocketProcessConnectCompletion(SocketProc, IoResult); + CxPlatSocketContextRelease(SocketProc); +} - if (SocketProc) { - CxPlatSocketContextRelease(SocketProc); - } - break; - } - default: CXPLAT_DBG_ASSERT(FALSE); break; - } +_IRQL_requires_max_(PASSIVE_LEVEL) +void +CxPlatIoRioNotifyEventComplete( + _In_ CXPLAT_CQE* Cqe + ) +{ + CXPLAT_SQE* Sqe = CxPlatCqeGetSqe(Cqe); + CXPLAT_DBG_ASSERT(Sqe->Overlapped.Internal != 0x103); // STATUS_PENDING + CXPLAT_SOCKET_PROC* SocketProc = CONTAINING_RECORD(Sqe, CXPLAT_SOCKET_PROC, IoSqe); + CxPlatDataPathSocketProcessRioCompletion(SocketProc); + CxPlatSocketContextRelease(SocketProc); } diff --git a/src/platform/inline.c b/src/platform/inline.c index 6b4d075bda..5ab290945b 100644 --- a/src/platform/inline.c +++ b/src/platform/inline.c @@ -411,20 +411,19 @@ CxPlatEventQCleanup( _In_ CXPLAT_EVENTQ* queue ); -#ifdef CXPLAT_SQE BOOLEAN CxPlatEventQEnqueue( _In_ CXPLAT_EVENTQ* queue, - _In_ CXPLAT_SQE* sqe, - _In_opt_ void* user_data + _In_ CXPLAT_SQE* sqe ); -#else + BOOLEAN -_CxPlatEventQEnqueue( +CxPlatEventQEnqueueEx( _In_ CXPLAT_EVENTQ* queue, - _In_opt_ void* user_data + _In_ CXPLAT_SQE* sqe, + _In_ short filter, + _In_ unsigned short flags ); -#endif uint32_t CxPlatEventQDequeue( @@ -440,12 +439,19 @@ CxPlatEventQReturn( _In_ uint32_t count ); -#ifdef CXPLAT_SQE_INIT BOOLEAN CxPlatSqeInitialize( _In_ CXPLAT_EVENTQ* queue, - _Out_ CXPLAT_SQE* sqe, - _In_ void* user_data + _In_ CXPLAT_EVENT_COMPLETION completion, + _Out_ CXPLAT_SQE* sqe + ); + +void +CxPlatSqeInitializeEx( + _In_ CXPLAT_EVENTQ* queue, + _In_ uintptr_t handle, + _In_ CXPLAT_EVENT_COMPLETION completion, + _Out_ CXPLAT_SQE* sqe ); void @@ -453,10 +459,9 @@ CxPlatSqeCleanup( _In_ CXPLAT_EVENTQ* queue, _In_ CXPLAT_SQE* sqe ); -#endif // CXPLAT_SQE_INIT -void* -CxPlatCqeUserData( +CXPLAT_SQE* +CxPlatCqeGetSqe( _In_ const CXPLAT_CQE* cqe ); diff --git a/src/platform/platform_internal.h b/src/platform/platform_internal.h index 11d064fc4a..d9e83583ee 100644 --- a/src/platform/platform_internal.h +++ b/src/platform/platform_internal.h @@ -39,13 +39,6 @@ #endif -typedef struct DATAPATH_SQE { - uint32_t CqeType; -#ifdef CXPLAT_SQE - CXPLAT_SQE Sqe; -#endif -} DATAPATH_SQE; - typedef struct CXPLAT_DATAPATH_COMMON { // // The UDP callback function pointers. @@ -122,40 +115,6 @@ typedef enum CXPLAT_DATAPATH_TYPE { CXPLAT_DATAPATH_TYPE_RAW, // currently raw == xdp } CXPLAT_DATAPATH_TYPE; -// -// Type of IO. -// -typedef enum DATAPATH_IO_TYPE { - DATAPATH_IO_SIGNATURE = 'WINU', - DATAPATH_IO_RECV = DATAPATH_IO_SIGNATURE + 1, - DATAPATH_IO_SEND = DATAPATH_IO_SIGNATURE + 2, - DATAPATH_IO_QUEUE_SEND = DATAPATH_IO_SIGNATURE + 3, - DATAPATH_IO_ACCEPTEX = DATAPATH_IO_SIGNATURE + 4, - DATAPATH_IO_CONNECTEX = DATAPATH_IO_SIGNATURE + 5, - DATAPATH_IO_RIO_NOTIFY = DATAPATH_IO_SIGNATURE + 6, - DATAPATH_IO_RIO_RECV = DATAPATH_IO_SIGNATURE + 7, - DATAPATH_IO_RIO_SEND = DATAPATH_IO_SIGNATURE + 8, - DATAPATH_IO_RECV_FAILURE = DATAPATH_IO_SIGNATURE + 9, - DATAPATH_IO_MAX -} DATAPATH_IO_TYPE; - -// -// Type of IO for XDP. -// -typedef enum DATAPATH_XDP_IO_TYPE { - DATAPATH_XDP_IO_SIGNATURE = 'XDPD', - DATAPATH_XDP_IO_RECV = DATAPATH_XDP_IO_SIGNATURE + 1, - DATAPATH_XDP_IO_SEND = DATAPATH_XDP_IO_SIGNATURE + 2 -} DATAPATH_XDP_IO_TYPE; - -// -// IO header for SQE->CQE based completions. -// -typedef struct DATAPATH_IO_SQE { - DATAPATH_IO_TYPE IoType; - DATAPATH_SQE DatapathSqe; -} DATAPATH_IO_SQE; - typedef enum CXPLAT_SOCKET_TYPE { CXPLAT_SOCKET_UDP = 0, CXPLAT_SOCKET_TCP_LISTENER = 1, @@ -450,12 +409,12 @@ typedef struct QUIC_CACHEALIGN CXPLAT_SOCKET_PROC { // // Submission queue event for IO completion // - DATAPATH_IO_SQE IoSqe; + CXPLAT_SQE IoSqe; // // Submission queue event for RIO IO completion // - DATAPATH_IO_SQE RioSqe; + CXPLAT_SQE RioSqe; // // The datapath per-processor context. @@ -802,11 +761,6 @@ CxPlatWorkerPoolGetEventQ( _In_ uint16_t Index // Into the config processor array ); -void -CxPlatDataPathProcessCqe( - _In_ CXPLAT_CQE* Cqe - ); - BOOLEAN // Returns FALSE no work was done. CxPlatDataPathPoll( _In_ void* Context, @@ -823,15 +777,6 @@ CxPlatDpRawGetDatapathSize( _In_opt_ const QUIC_EXECUTION_CONFIG* Config ); -#define CXPLAT_CQE_TYPE_WORKER_WAKE CXPLAT_CQE_TYPE_QUIC_BASE + 1 -#define CXPLAT_CQE_TYPE_WORKER_UPDATE_POLL CXPLAT_CQE_TYPE_QUIC_BASE + 2 -#define CXPLAT_CQE_TYPE_SOCKET_SHUTDOWN CXPLAT_CQE_TYPE_QUIC_BASE + 3 -#define CXPLAT_CQE_TYPE_SOCKET_IO CXPLAT_CQE_TYPE_QUIC_BASE + 4 -#define CXPLAT_CQE_TYPE_SOCKET_FLUSH_TX CXPLAT_CQE_TYPE_QUIC_BASE + 5 -#define CXPLAT_CQE_TYPE_XDP_SHUTDOWN CXPLAT_CQE_TYPE_QUIC_BASE + 6 -#define CXPLAT_CQE_TYPE_XDP_IO CXPLAT_CQE_TYPE_QUIC_BASE + 7 -#define CXPLAT_CQE_TYPE_XDP_FLUSH_TX CXPLAT_CQE_TYPE_QUIC_BASE + 8 - #if defined(CX_PLATFORM_LINUX) typedef struct CXPLAT_DATAPATH_PARTITION CXPLAT_DATAPATH_PARTITION; @@ -859,17 +804,17 @@ typedef struct QUIC_CACHEALIGN CXPLAT_SOCKET_CONTEXT { // // The submission queue event for shutdown. // - DATAPATH_SQE ShutdownSqe; + CXPLAT_SQE ShutdownSqe; // // The submission queue event for IO. // - DATAPATH_SQE IoSqe; + CXPLAT_SQE IoSqe; // // The submission queue event for flushing the send queue. // - DATAPATH_SQE FlushTxSqe; + CXPLAT_SQE FlushTxSqe; // // The head of list containg all pending sends on this socket. @@ -1197,11 +1142,6 @@ SocketSend( _In_ CXPLAT_SEND_DATA* SendData ); -void -DataPathProcessCqe( - _In_ CXPLAT_CQE* Cqe - ); - CXPLAT_SOCKET* CxPlatRawToSocket( _In_ CXPLAT_SOCKET_RAW* Socket @@ -1346,11 +1286,6 @@ RawResolveRoute( _In_ CXPLAT_ROUTE_RESOLUTION_CALLBACK_HANDLER Callback ); -void -RawDataPathProcessCqe( - _In_ CXPLAT_CQE* Cqe - ); - _IRQL_requires_max_(PASSIVE_LEVEL) void RawUpdateRoute( diff --git a/src/platform/platform_winuser.c b/src/platform/platform_winuser.c index 46e87aa35b..11897048d2 100644 --- a/src/platform/platform_winuser.c +++ b/src/platform/platform_winuser.c @@ -582,17 +582,6 @@ CxPlatGetProcessorGroupInfo( return QUIC_STATUS_SUCCESS; } -void -CxPlatDatapathSqeInitialize( - _Out_ DATAPATH_SQE* DatapathSqe, - _In_ uint32_t CqeType - ) -{ - RtlZeroMemory(DatapathSqe, sizeof(*DatapathSqe)); - DatapathSqe->CqeType = CqeType; - DatapathSqe->Sqe.UserData = DatapathSqe; -} - #ifdef DEBUG void CxPlatSetAllocFailDenominator( diff --git a/src/platform/platform_worker.c b/src/platform/platform_worker.c index ffe4c73d22..78a139c098 100644 --- a/src/platform/platform_worker.c +++ b/src/platform/platform_worker.c @@ -15,9 +15,6 @@ #include "platform_worker.c.clog.h" #endif -const uint32_t WorkerWakeEventPayload = CXPLAT_CQE_TYPE_WORKER_WAKE; -const uint32_t WorkerUpdatePollEventPayload = CXPLAT_CQE_TYPE_WORKER_UPDATE_POLL; - typedef struct QUIC_CACHEALIGN CXPLAT_WORKER { // @@ -30,7 +27,6 @@ typedef struct QUIC_CACHEALIGN CXPLAT_WORKER { // CXPLAT_EVENTQ EventQ; -#ifdef CXPLAT_SQE // // Submission queue entry for shutting down the worker thread. // @@ -45,7 +41,6 @@ typedef struct QUIC_CACHEALIGN CXPLAT_WORKER { // Submission queue entry for update the polling set. // CXPLAT_SQE UpdatePollSqe; -#endif // // Serializes access to the execution contexts. @@ -83,14 +78,13 @@ typedef struct QUIC_CACHEALIGN CXPLAT_WORKER { // Flags to indicate what has been initialized. // BOOLEAN InitializedEventQ : 1; -#ifdef CXPLAT_SQE_INIT BOOLEAN InitializedShutdownSqe : 1; BOOLEAN InitializedWakeSqe : 1; BOOLEAN InitializedUpdatePollSqe : 1; -#endif BOOLEAN InitializedThread : 1; BOOLEAN InitializedECLock : 1; BOOLEAN StoppingThread : 1; + BOOLEAN StoppedThread : 1; BOOLEAN DestroyedThread : 1; #if DEBUG // Debug flags - Must not be in the bitfield. BOOLEAN ThreadStarted; @@ -106,6 +100,42 @@ typedef struct QUIC_CACHEALIGN CXPLAT_WORKER { CXPLAT_THREAD_CALLBACK(CxPlatWorkerThread, Context); +static void +ShutdownCompletion( + _In_ CXPLAT_CQE* Cqe + ) +{ + CXPLAT_WORKER* Worker = + CXPLAT_CONTAINING_RECORD(CxPlatCqeGetSqe(Cqe), CXPLAT_WORKER, ShutdownSqe); + Worker->StoppedThread = TRUE; +} + +static void +WakeCompletion( + _In_ CXPLAT_CQE* Cqe + ) +{ + // + // No-op as the goal is simply to wake the event queue thread + // + UNREFERENCED_PARAMETER(Cqe); +} + +void +CxPlatUpdateExecutionContexts( + _In_ CXPLAT_WORKER* Worker + ); + +static void +UpdatePollCompletion( + _In_ CXPLAT_CQE* Cqe + ) +{ + CXPLAT_WORKER* Worker = + CXPLAT_CONTAINING_RECORD(CxPlatCqeGetSqe(Cqe), CXPLAT_WORKER, UpdatePollSqe); + CxPlatUpdateExecutionContexts(Worker); +} + void CxPlatWorkerPoolInit( _In_ CXPLAT_WORKER_POOL* WorkerPool @@ -177,55 +207,51 @@ CxPlatWorkerPoolLazyStart( CxPlatZeroMemory(WorkerPool->Workers, WorkersSize); for (uint32_t i = 0; i < WorkerPool->WorkerCount; ++i) { - CxPlatLockInitialize(&WorkerPool->Workers[i].ECLock); - CxPlatListInitializeHead(&WorkerPool->Workers[i].DynamicPoolList); - WorkerPool->Workers[i].InitializedECLock = TRUE; - WorkerPool->Workers[i].IdealProcessor = ProcessorList ? ProcessorList[i] : (uint16_t)i; - CXPLAT_DBG_ASSERT(WorkerPool->Workers[i].IdealProcessor < CxPlatProcCount()); - ThreadConfig.IdealProcessor = WorkerPool->Workers[i].IdealProcessor; + CXPLAT_WORKER* Worker = &WorkerPool->Workers[i]; + CxPlatLockInitialize(&Worker->ECLock); + CxPlatListInitializeHead(&Worker->DynamicPoolList); + Worker->InitializedECLock = TRUE; + Worker->IdealProcessor = ProcessorList ? ProcessorList[i] : (uint16_t)i; + CXPLAT_DBG_ASSERT(Worker->IdealProcessor < CxPlatProcCount()); + ThreadConfig.IdealProcessor = Worker->IdealProcessor; ThreadConfig.Context = &WorkerPool->Workers[i]; - if (!CxPlatEventQInitialize(&WorkerPool->Workers[i].EventQ)) { + if (!CxPlatEventQInitialize(&Worker->EventQ)) { QuicTraceEvent( LibraryError, "[ lib] ERROR, %s.", "CxPlatEventQInitialize"); goto Error; } - WorkerPool->Workers[i].InitializedEventQ = TRUE; -#ifdef CXPLAT_SQE_INIT - WorkerPool->Workers[i].ShutdownSqe = (CXPLAT_SQE)WorkerPool->Workers[i].EventQ; - if (!CxPlatSqeInitialize(&WorkerPool->Workers[i].EventQ, &WorkerPool->Workers[i].ShutdownSqe, NULL)) { + Worker->InitializedEventQ = TRUE; + if (!CxPlatSqeInitialize(&Worker->EventQ, ShutdownCompletion, &Worker->ShutdownSqe)) { QuicTraceEvent( LibraryError, "[ lib] ERROR, %s.", "CxPlatSqeInitialize(shutdown)"); goto Error; } - WorkerPool->Workers[i].InitializedShutdownSqe = TRUE; - WorkerPool->Workers[i].WakeSqe = (CXPLAT_SQE)WorkerWakeEventPayload; - if (!CxPlatSqeInitialize(&WorkerPool->Workers[i].EventQ, &WorkerPool->Workers[i].WakeSqe, (void*)&WorkerWakeEventPayload)) { + Worker->InitializedShutdownSqe = TRUE; + if (!CxPlatSqeInitialize(&Worker->EventQ, WakeCompletion, &Worker->WakeSqe)) { QuicTraceEvent( LibraryError, "[ lib] ERROR, %s.", "CxPlatSqeInitialize(wake)"); goto Error; } - WorkerPool->Workers[i].InitializedWakeSqe = TRUE; - WorkerPool->Workers[i].UpdatePollSqe = (CXPLAT_SQE)WorkerUpdatePollEventPayload; - if (!CxPlatSqeInitialize(&WorkerPool->Workers[i].EventQ, &WorkerPool->Workers[i].UpdatePollSqe, (void*)&WorkerUpdatePollEventPayload)) { + Worker->InitializedWakeSqe = TRUE; + if (!CxPlatSqeInitialize(&Worker->EventQ, UpdatePollCompletion, &Worker->UpdatePollSqe)) { QuicTraceEvent( LibraryError, "[ lib] ERROR, %s.", "CxPlatSqeInitialize(updatepoll)"); goto Error; } - WorkerPool->Workers[i].InitializedUpdatePollSqe = TRUE; -#endif + Worker->InitializedUpdatePollSqe = TRUE; if (QUIC_FAILED( - CxPlatThreadCreate(&ThreadConfig, &WorkerPool->Workers[i].Thread))) { + CxPlatThreadCreate(&ThreadConfig, &Worker->Thread))) { goto Error; } - WorkerPool->Workers[i].InitializedThread = TRUE; + Worker->InitializedThread = TRUE; } CxPlatRundownInitialize(&WorkerPool->Rundown); @@ -238,36 +264,32 @@ CxPlatWorkerPoolLazyStart( if (WorkerPool->Workers) { for (uint32_t i = 0; i < WorkerPool->WorkerCount; ++i) { - if (WorkerPool->Workers[i].InitializedThread) { - WorkerPool->Workers[i].StoppingThread = TRUE; - CxPlatEventQEnqueue( - &WorkerPool->Workers[i].EventQ, - &WorkerPool->Workers[i].ShutdownSqe, - NULL); - CxPlatThreadWait(&WorkerPool->Workers[i].Thread); - CxPlatThreadDelete(&WorkerPool->Workers[i].Thread); + CXPLAT_WORKER* Worker = &WorkerPool->Workers[i]; + if (Worker->InitializedThread) { + Worker->StoppingThread = TRUE; + CxPlatEventQEnqueue(&Worker->EventQ, &Worker->ShutdownSqe); + CxPlatThreadWait(&Worker->Thread); + CxPlatThreadDelete(&Worker->Thread); #if DEBUG - CXPLAT_DBG_ASSERT(WorkerPool->Workers[i].ThreadStarted); - CXPLAT_DBG_ASSERT(WorkerPool->Workers[i].ThreadFinished); + CXPLAT_DBG_ASSERT(Worker->ThreadStarted); + CXPLAT_DBG_ASSERT(Worker->ThreadFinished); #endif - WorkerPool->Workers[i].DestroyedThread = TRUE; + Worker->DestroyedThread = TRUE; } -#ifdef CXPLAT_SQE_INIT - if (WorkerPool->Workers[i].InitializedUpdatePollSqe) { - CxPlatSqeCleanup(&WorkerPool->Workers[i].EventQ, &WorkerPool->Workers[i].UpdatePollSqe); + if (Worker->InitializedUpdatePollSqe) { + CxPlatSqeCleanup(&Worker->EventQ, &Worker->UpdatePollSqe); } - if (WorkerPool->Workers[i].InitializedWakeSqe) { - CxPlatSqeCleanup(&WorkerPool->Workers[i].EventQ, &WorkerPool->Workers[i].WakeSqe); + if (Worker->InitializedWakeSqe) { + CxPlatSqeCleanup(&Worker->EventQ, &Worker->WakeSqe); } - if (WorkerPool->Workers[i].InitializedShutdownSqe) { - CxPlatSqeCleanup(&WorkerPool->Workers[i].EventQ, &WorkerPool->Workers[i].ShutdownSqe); + if (Worker->InitializedShutdownSqe) { + CxPlatSqeCleanup(&Worker->EventQ, &Worker->ShutdownSqe); } -#endif // CXPLAT_SQE_INIT - if (WorkerPool->Workers[i].InitializedEventQ) { - CxPlatEventQCleanup(&WorkerPool->Workers[i].EventQ); + if (Worker->InitializedEventQ) { + CxPlatEventQCleanup(&Worker->EventQ); } - if (WorkerPool->Workers[i].InitializedECLock) { - CxPlatLockUninitialize(&WorkerPool->Workers[i].ECLock); + if (Worker->InitializedECLock) { + CxPlatLockUninitialize(&Worker->ECLock); } } @@ -290,26 +312,22 @@ CxPlatWorkerPoolUninit( CxPlatRundownReleaseAndWait(&WorkerPool->Rundown); for (uint32_t i = 0; i < WorkerPool->WorkerCount; ++i) { - WorkerPool->Workers[i].StoppingThread = TRUE; - CxPlatEventQEnqueue( - &WorkerPool->Workers[i].EventQ, - &WorkerPool->Workers[i].ShutdownSqe, - NULL); - CxPlatThreadWait(&WorkerPool->Workers[i].Thread); - CxPlatThreadDelete(&WorkerPool->Workers[i].Thread); + CXPLAT_WORKER* Worker = &WorkerPool->Workers[i]; + Worker->StoppingThread = TRUE; + CxPlatEventQEnqueue(&Worker->EventQ, &Worker->ShutdownSqe); + CxPlatThreadWait(&Worker->Thread); + CxPlatThreadDelete(&Worker->Thread); #if DEBUG - CXPLAT_DBG_ASSERT(WorkerPool->Workers[i].ThreadStarted); - CXPLAT_DBG_ASSERT(WorkerPool->Workers[i].ThreadFinished); + CXPLAT_DBG_ASSERT(Worker->ThreadStarted); + CXPLAT_DBG_ASSERT(Worker->ThreadFinished); #endif - WorkerPool->Workers[i].DestroyedThread = TRUE; -#ifdef CXPLAT_SQE_INIT - CxPlatSqeCleanup(&WorkerPool->Workers[i].EventQ, &WorkerPool->Workers[i].UpdatePollSqe); - CxPlatSqeCleanup(&WorkerPool->Workers[i].EventQ, &WorkerPool->Workers[i].WakeSqe); - CxPlatSqeCleanup(&WorkerPool->Workers[i].EventQ, &WorkerPool->Workers[i].ShutdownSqe); -#endif // CXPLAT_SQE_INIT - CxPlatEventQCleanup(&WorkerPool->Workers[i].EventQ); - CXPLAT_DBG_ASSERT(CxPlatListIsEmpty(&WorkerPool->Workers[i].DynamicPoolList)); - CxPlatLockUninitialize(&WorkerPool->Workers[i].ECLock); + Worker->DestroyedThread = TRUE; + CxPlatSqeCleanup(&Worker->EventQ, &Worker->UpdatePollSqe); + CxPlatSqeCleanup(&Worker->EventQ, &Worker->WakeSqe); + CxPlatSqeCleanup(&Worker->EventQ, &Worker->ShutdownSqe); + CxPlatEventQCleanup(&Worker->EventQ); + CXPLAT_DBG_ASSERT(CxPlatListIsEmpty(&Worker->DynamicPoolList)); + CxPlatLockUninitialize(&Worker->ECLock); } CXPLAT_FREE(WorkerPool->Workers, QUIC_POOL_PLATFORM_WORKER); @@ -413,10 +431,7 @@ CxPlatAddExecutionContext( CxPlatLockRelease(&Worker->ECLock); if (QueueEvent) { - CxPlatEventQEnqueue( - &Worker->EventQ, - &Worker->UpdatePollSqe, - (void*)&WorkerUpdatePollEventPayload); + CxPlatEventQEnqueue(&Worker->EventQ, &Worker->UpdatePollSqe); } } @@ -427,7 +442,7 @@ CxPlatWakeExecutionContext( { CXPLAT_WORKER* Worker = (CXPLAT_WORKER*)Context->CxPlatContext; if (!InterlockedFetchAndSetBoolean(&Worker->Running)) { - CxPlatEventQEnqueue(&Worker->EventQ, &Worker->WakeSqe, (void*)&WorkerWakeEventPayload); + CxPlatEventQEnqueue(&Worker->EventQ, &Worker->WakeSqe); } } @@ -509,7 +524,7 @@ CxPlatRunExecutionContexts( } } -BOOLEAN +void CxPlatProcessEvents( _In_ CXPLAT_WORKER* Worker, _Inout_ CXPLAT_EXECUTION_STATE* State @@ -524,26 +539,11 @@ CxPlatProcessEvents( #endif State->NoWorkCount = 0; for (uint32_t i = 0; i < CqeCount; ++i) { - if (CxPlatCqeUserData(&Cqes[i]) == NULL) { -#if DEBUG - CXPLAT_DBG_ASSERT(Worker->StoppingThread); -#endif - return TRUE; // NULL user data means shutdown. - } - switch (CxPlatCqeType(&Cqes[i])) { - case CXPLAT_CQE_TYPE_WORKER_WAKE: - break; // No-op, just wake up to do polling stuff. - case CXPLAT_CQE_TYPE_WORKER_UPDATE_POLL: - CxPlatUpdateExecutionContexts(Worker); - break; - default: // Pass the rest to the datapath - CxPlatDataPathProcessCqe(&Cqes[i]); - break; - } + CXPLAT_SQE* Sqe = CxPlatCqeGetSqe(&Cqes[i]); + Sqe->Completion(&Cqes[i]); } CxPlatEventQReturn(&Worker->EventQ, CqeCount); } - return FALSE; } // @@ -568,7 +568,7 @@ CXPLAT_THREAD_CALLBACK(CxPlatWorkerThread, Context) Worker->Running = TRUE; - while (TRUE) { + while (!Worker->StoppedThread) { ++State.NoWorkCount; #if DEBUG // Debug statistics @@ -582,9 +582,7 @@ CXPLAT_THREAD_CALLBACK(CxPlatWorkerThread, Context) CxPlatRunExecutionContexts(Worker, &State); // Run once more to handle race conditions } - if (CxPlatProcessEvents(Worker, &State)) { - goto Shutdown; - } + CxPlatProcessEvents(Worker, &State); if (State.NoWorkCount == 0) { State.LastWorkTime = State.TimeNow; @@ -599,8 +597,6 @@ CXPLAT_THREAD_CALLBACK(CxPlatWorkerThread, Context) } } -Shutdown: - Worker->Running = FALSE; #if DEBUG diff --git a/src/platform/unittest/PlatformTest.cpp b/src/platform/unittest/PlatformTest.cpp index 126e90f10a..0b35b0c65a 100644 --- a/src/platform/unittest/PlatformTest.cpp +++ b/src/platform/unittest/PlatformTest.cpp @@ -53,8 +53,22 @@ TEST(PlatformTest, QuicAddrParsing) TEST(PlatformTest, EventQueue) { - uint32_t user_data1 = 0x1234, user_data2 = 0x5678, user_data3 = 0x90; - + struct my_sqe : public CXPLAT_SQE { + uint32_t data; + static void my_completion_1(CXPLAT_CQE* Cqe) { + CXPLAT_SQE* Sqe = CxPlatCqeGetSqe(Cqe); + ASSERT_TRUE(((my_sqe*)Sqe)->data == 0x1234); + } + static void my_completion_2(CXPLAT_CQE* Cqe) { + CXPLAT_SQE* Sqe = CxPlatCqeGetSqe(Cqe); + ASSERT_TRUE(((my_sqe*)Sqe)->data == 0x5678); + } + static void my_completion_3(CXPLAT_CQE* Cqe) { + CXPLAT_SQE* Sqe = CxPlatCqeGetSqe(Cqe); + ASSERT_TRUE(((my_sqe*)Sqe)->data == 0x90); + } + }; + CXPLAT_EVENTQ queue; ASSERT_TRUE(CxPlatEventQInitialize(&queue)); @@ -63,127 +77,128 @@ TEST(PlatformTest, EventQueue) ASSERT_EQ(0u, CxPlatEventQDequeue(&queue, events, 2, 0)); ASSERT_EQ(0u, CxPlatEventQDequeue(&queue, events, 2, 100)); -#ifdef CXPLAT_SQE - CXPLAT_SQE sqe1 = CXPLAT_SQE_DEFAULT; - CXPLAT_SQE sqe2 = CXPLAT_SQE_DEFAULT; - CXPLAT_SQE sqe3 = CXPLAT_SQE_DEFAULT; -#ifdef CXPLAT_SQE_INIT - ASSERT_TRUE(CxPlatSqeInitialize(&queue, &sqe1, &user_data1)); - ASSERT_TRUE(CxPlatSqeInitialize(&queue, &sqe2, &user_data2)); - ASSERT_TRUE(CxPlatSqeInitialize(&queue, &sqe3, &user_data3)); -#endif // CXPLAT_SQE_INIT -#endif // CXPLAT_SQE + my_sqe sqe1, sqe2, sqe3; + sqe1.data = 0x1234; + ASSERT_TRUE(CxPlatSqeInitialize(&queue, my_sqe::my_completion_1, &sqe1)); + sqe2.data = 0x5678; + ASSERT_TRUE(CxPlatSqeInitialize(&queue, my_sqe::my_completion_2, &sqe2)); + sqe3.data = 0x90; + ASSERT_TRUE(CxPlatSqeInitialize(&queue, my_sqe::my_completion_3, &sqe3)); // Single queue/dequeue tests - ASSERT_TRUE(CxPlatEventQEnqueue(&queue, &sqe1, &user_data1)); + ASSERT_TRUE(CxPlatEventQEnqueue(&queue, &sqe1)); ASSERT_EQ(1u, CxPlatEventQDequeue(&queue, events, 2, 0)); - ASSERT_EQ((void*)&user_data1, CxPlatCqeUserData(&events[0])); + ASSERT_EQ(&sqe1, (my_sqe*)CxPlatCqeGetSqe(&events[0])); // Multiple queue/dequeue tests - ASSERT_TRUE(CxPlatEventQEnqueue(&queue, &sqe1, &user_data1)); - ASSERT_TRUE(CxPlatEventQEnqueue(&queue, &sqe2, &user_data2)); - ASSERT_TRUE(CxPlatEventQEnqueue(&queue, &sqe3, &user_data3)); + ASSERT_TRUE(CxPlatEventQEnqueue(&queue, &sqe1)); + ASSERT_TRUE(CxPlatEventQEnqueue(&queue, &sqe2)); + ASSERT_TRUE(CxPlatEventQEnqueue(&queue, &sqe3)); ASSERT_EQ(2u, CxPlatEventQDequeue(&queue, events, 2, 100)); ASSERT_EQ(1u, CxPlatEventQDequeue(&queue, events, 2, 0)); ASSERT_EQ(0u, CxPlatEventQDequeue(&queue, events, 2, 0)); struct EventQueueContext { CXPLAT_EVENTQ* queue; -#ifdef CXPLAT_SQE CXPLAT_SQE* sqe; -#endif - void* user_data; static CXPLAT_THREAD_CALLBACK(EventQueueCallback, Context) { auto ctx = (EventQueueContext*)Context; CxPlatSleep(100); - CxPlatEventQEnqueue(ctx->queue, ctx->sqe, ctx->user_data); + CxPlatEventQEnqueue(ctx->queue, ctx->sqe); CXPLAT_THREAD_RETURN(0); } }; // Async queue/dequeue tests -#ifdef CXPLAT_SQE - EventQueueContext context = { &queue, &sqe1, &user_data1 }; -#else - EventQueueContext context = { &queue, &user_data1 }; -#endif + EventQueueContext context = { &queue, &sqe1 }; CXPLAT_THREAD_CONFIG config = { 0, 0, NULL, EventQueueContext::EventQueueCallback, &context }; CXPLAT_THREAD thread; ASSERT_TRUE(QUIC_SUCCEEDED(CxPlatThreadCreate(&config, &thread))); ASSERT_EQ(1u, CxPlatEventQDequeue(&queue, events, 2, 1000)); - ASSERT_EQ((void*)&user_data1, CxPlatCqeUserData(&events[0])); + ASSERT_EQ(&sqe1, (my_sqe*)CxPlatCqeGetSqe(&events[0])); CxPlatThreadWait(&thread); CxPlatThreadDelete(&thread); -#ifdef CXPLAT_SQE_INIT CxPlatSqeCleanup(&queue, &sqe1); CxPlatSqeCleanup(&queue, &sqe2); CxPlatSqeCleanup(&queue, &sqe3); -#endif // CXPLAT_SQE_INIT CxPlatEventQCleanup(&queue); } TEST(PlatformTest, EventQueueWorker) { + typedef struct EventQueueContext EventQueueContext; + + struct my_sqe : public CXPLAT_SQE { + EventQueueContext* context; + uint32_t data; + }; + struct EventQueueContext { CXPLAT_EVENTQ* queue; uint32_t counts[3]; + bool running; static CXPLAT_THREAD_CALLBACK(EventQueueCallback, Context) { auto ctx = (EventQueueContext*)Context; CXPLAT_CQE events[4]; - while (true) { + while (ctx->running) { uint32_t count = CxPlatEventQDequeue(ctx->queue, events, ARRAYSIZE(events), UINT32_MAX); for (uint32_t i = 0; i < count; i++) { - if (CxPlatCqeUserData(&events[i]) == NULL) goto Exit; - ctx->counts[CxPlatCqeType(events + i)]++; + auto sqe = CxPlatCqeGetSqe(&events[i]); + sqe->Completion(&events[i]); } } - Exit: CXPLAT_THREAD_RETURN(0); } + static void shutdown_completion(CXPLAT_CQE* Cqe) { + auto Sqe = (my_sqe*)CxPlatCqeGetSqe(Cqe); + Sqe->context->running = false; + } + static void my_completion(CXPLAT_CQE* Cqe) { + auto Sqe = (my_sqe*)CxPlatCqeGetSqe(Cqe); + Sqe->context->counts[Sqe->data]++; + } }; - uint32_t user_data1 = 0, user_data2 = 1, user_data3 = 2; - CXPLAT_EVENTQ queue; ASSERT_TRUE(CxPlatEventQInitialize(&queue)); - EventQueueContext context = { &queue, {0} }; + EventQueueContext context = { &queue, {0}, true }; CXPLAT_THREAD_CONFIG config = { 0, 0, NULL, EventQueueContext::EventQueueCallback, &context }; CXPLAT_THREAD thread; ASSERT_TRUE(QUIC_SUCCEEDED(CxPlatThreadCreate(&config, &thread))); - -#ifdef CXPLAT_SQE - CXPLAT_SQE shutdown = CXPLAT_SQE_DEFAULT; - CXPLAT_SQE sqe1 = CXPLAT_SQE_DEFAULT; - CXPLAT_SQE sqe2 = CXPLAT_SQE_DEFAULT; - CXPLAT_SQE sqe3 = CXPLAT_SQE_DEFAULT; -#ifdef CXPLAT_SQE_INIT - ASSERT_TRUE(CxPlatSqeInitialize(&queue, &shutdown, nullptr)); - ASSERT_TRUE(CxPlatSqeInitialize(&queue, &sqe1, &user_data1)); - ASSERT_TRUE(CxPlatSqeInitialize(&queue, &sqe2, &user_data2)); - ASSERT_TRUE(CxPlatSqeInitialize(&queue, &sqe3, &user_data3)); -#endif // CXPLAT_SQE_INIT -#endif // CXPLAT_SQE - - ASSERT_TRUE(CxPlatEventQEnqueue(&queue, &sqe1, &user_data1)); - ASSERT_TRUE(CxPlatEventQEnqueue(&queue, &sqe2, &user_data2)); + + my_sqe shutdown, sqe1, sqe2, sqe3; + shutdown.context = &context; + ASSERT_TRUE(CxPlatSqeInitialize(&queue, EventQueueContext::shutdown_completion, &shutdown)); + sqe1.context = &context; + sqe1.data = 0; + ASSERT_TRUE(CxPlatSqeInitialize(&queue, EventQueueContext::my_completion, &sqe1)); + sqe2.context = &context; + sqe2.data = 1; + ASSERT_TRUE(CxPlatSqeInitialize(&queue, EventQueueContext::my_completion, &sqe2)); + sqe3.context = &context; + sqe3.data = 2; + ASSERT_TRUE(CxPlatSqeInitialize(&queue, EventQueueContext::my_completion, &sqe3)); + + ASSERT_TRUE(CxPlatEventQEnqueue(&queue, &sqe1)); + ASSERT_TRUE(CxPlatEventQEnqueue(&queue, &sqe2)); CxPlatSleep(100); ASSERT_TRUE(context.counts[0] == 1u); ASSERT_TRUE(context.counts[1] == 1u); ASSERT_TRUE(context.counts[2] == 0u); - ASSERT_TRUE(CxPlatEventQEnqueue(&queue, &sqe1, &user_data1)); - ASSERT_TRUE(CxPlatEventQEnqueue(&queue, &sqe2, &user_data2)); - ASSERT_TRUE(CxPlatEventQEnqueue(&queue, &sqe3, &user_data3)); + ASSERT_TRUE(CxPlatEventQEnqueue(&queue, &sqe1)); + ASSERT_TRUE(CxPlatEventQEnqueue(&queue, &sqe2)); + ASSERT_TRUE(CxPlatEventQEnqueue(&queue, &sqe3)); CxPlatSleep(100); ASSERT_TRUE(context.counts[0] == 2u); ASSERT_TRUE(context.counts[1] == 2u); ASSERT_TRUE(context.counts[2] == 1u); - ASSERT_TRUE(CxPlatEventQEnqueue(&queue, &sqe3, &user_data3)); - ASSERT_TRUE(CxPlatEventQEnqueue(&queue, &shutdown, nullptr)); + ASSERT_TRUE(CxPlatEventQEnqueue(&queue, &sqe3)); + ASSERT_TRUE(CxPlatEventQEnqueue(&queue, &shutdown)); CxPlatThreadWait(&thread); CxPlatThreadDelete(&thread); @@ -192,12 +207,10 @@ TEST(PlatformTest, EventQueueWorker) ASSERT_TRUE(context.counts[1] == 2u); ASSERT_TRUE(context.counts[2] == 2u); -#ifdef CXPLAT_SQE_INIT CxPlatSqeCleanup(&queue, &shutdown); CxPlatSqeCleanup(&queue, &sqe1); CxPlatSqeCleanup(&queue, &sqe2); CxPlatSqeCleanup(&queue, &sqe3); -#endif // CXPLAT_SQE_INIT CxPlatEventQCleanup(&queue); } diff --git a/src/platform/unittest/external/CMakeLists.txt b/src/platform/unittest/external/CMakeLists.txt index cfb1ccba9b..ab4b6e6488 100644 --- a/src/platform/unittest/external/CMakeLists.txt +++ b/src/platform/unittest/external/CMakeLists.txt @@ -32,5 +32,5 @@ set_target_properties(msquic::inc PROPERTIES INTERFACE_COMPILE_DEFINITIONS "${d add_executable(msquicplatformtest ${SOURCES}) target_include_directories(msquicplatformtest PRIVATE ${CMAKE_INSTALL_PREFIX}/include) -target_link_libraries(msquicplatformtest PRIVATE gtest msquic::msquic msquic::msquic_platform ws2_32 ntdll ncrypt crypt32 iphlpapi) +target_link_libraries(msquicplatformtest PRIVATE gtest msquic::msquic msquic::platform ws2_32 ntdll ncrypt crypt32 iphlpapi) target_compile_definitions(msquicplatformtest PRIVATE QUIC_EVENTS_STUB QUIC_LOGS_STUB _DISABLE_VECTOR_ANNOTATION _DISABLE_STRING_ANNOTATION) diff --git a/src/test/lib/DataTest.cpp b/src/test/lib/DataTest.cpp index 2e4d91bdc3..87f05ff115 100644 --- a/src/test/lib/DataTest.cpp +++ b/src/test/lib/DataTest.cpp @@ -3603,8 +3603,221 @@ struct ConnectionPriorityTestContext { }; const uint8_t ConnectionPriorityTestContext::NumSend = 3; -void QuicTestConnectionPriority() +typedef void ConnectionPriorityTestType( + UniquePtr Connections[], + uint8_t NumConnections, + MsQuicStream** Streams, + QUIC_BUFFER Buffer, + MsQuicConfiguration* ClientConfiguration, + QuicAddr* ServerLocalAddr + ); + +void +ConnectionPriorityTestConnectionStart(UniquePtr& Connection, MsQuicConfiguration* ClientConfiguration, QuicAddr* ServerLocalAddr) { + TEST_QUIC_SUCCEEDED(Connection->Start( + *ClientConfiguration, + ServerLocalAddr->GetFamily(), + QUIC_TEST_LOOPBACK_FOR_AF(ServerLocalAddr->GetFamily()), + ServerLocalAddr->GetPort())); + TEST_TRUE(Connection->HandshakeCompleteEvent.WaitTimeout(TestWaitTimeout)); + TEST_TRUE(Connection->HandshakeComplete); +} + +static void ConnectionPriorityTest1(UniquePtr Connections[], uint8_t NumConnections, MsQuicStream* Streams[], QUIC_BUFFER Buffer, MsQuicConfiguration* ClientConfiguration, QuicAddr* ServerLocalAddr) { + // s: stream op + // p: prioritized op + // s0/s2: stream start, stream send + // n in sn0/sn2: stream id + // processing | queued + // [1[s0]] | [] + // [1[s0]] | [2[s00, s02, ..., s(n-1)0, s(n-1)2]] + // [1[s0]] | [3[s0p, s2p], 2[s00, s02, ..., s(n-1)0, s(n-1)2]] + // [3[s0p, s2p], 2[s00, s02, ..., s(n-1)0, s(n-1)2]] | [] + UNREFERENCED_PARAMETER(NumConnections); + ConnectionPriorityTestContext Context; + MsQuicStream Stream1(*Connections[0], QUIC_STREAM_OPEN_FLAG_UNIDIRECTIONAL, CleanUpManual, ConnectionPriorityTestContext::ClientStreamStartStreamCallback, &Context); + MsQuicStream Stream3(*Connections[2], QUIC_STREAM_OPEN_FLAG_UNIDIRECTIONAL, CleanUpManual, ConnectionPriorityTestContext::ClientStreamStartStreamCallback, &Context); + Context.ExpectedStream = &Stream1; + + ConnectionPriorityTestConnectionStart(Connections[0], ClientConfiguration, ServerLocalAddr); + + Stream1.Start(QUIC_STREAM_START_FLAG_IMMEDIATE); + // Wait until this StreamStart operation is drained + TEST_TRUE(Context.BlockAfterInitialStart.WaitTimeout(TestWaitTimeout)); + Context.ExpectedStream = &Stream3; + + for (uint8_t i = 0; i < ConnectionPriorityTestContext::NumSend; ++i) { + Streams[i] = new(std::nothrow) MsQuicStream( + *Connections[1], QUIC_STREAM_OPEN_FLAG_UNIDIRECTIONAL, CleanUpManual, + ConnectionPriorityTestContext::ClientStreamStartStreamCallback, &Context); + TEST_QUIC_SUCCEEDED(Streams[i]->GetInitStatus()); + TEST_QUIC_SUCCEEDED(Streams[i]->Send(&Buffer, 1, QUIC_SEND_FLAG_START | QUIC_SEND_FLAG_FIN)); + } + + TEST_QUIC_SUCCEEDED(Stream3.Start(QUIC_STREAM_START_FLAG_PRIORITY_WORK)); + TEST_QUIC_SUCCEEDED(Stream3.Send(&Buffer, 1, QUIC_SEND_FLAG_FIN | QUIC_SEND_FLAG_PRIORITY_WORK)); + Context.MaxSend = ConnectionPriorityTestContext::NumSend + 1; + Context.OperationQueuedComplete.Set(); // All operations are queued. Kick off processing the operations + + for (uint8_t i = 1; i < 3; ++i) { + ConnectionPriorityTestConnectionStart(Connections[i], ClientConfiguration, ServerLocalAddr); + } + + MsQuicStream* ExpectedStartOrder[ConnectionPriorityTestContext::NumSend + 2] = {0}; + ExpectedStartOrder[0] = &Stream1; + ExpectedStartOrder[1] = &Stream3; + for (uint8_t i = 2; i < ConnectionPriorityTestContext::NumSend + 2; ++i) { + ExpectedStartOrder[i] = Streams[i-2]; + } + MsQuicStream* ExpectedSendOrder[ConnectionPriorityTestContext::NumSend + 1] = {0}; + ExpectedSendOrder[0] = &Stream3; + for (uint8_t i = 1; i < ConnectionPriorityTestContext::NumSend + 1; ++i) { + ExpectedSendOrder[i] = Streams[i-1]; + } + + TEST_TRUE(Context.AllReceivesComplete.WaitTimeout(TestWaitTimeout)); + + TEST_TRUE(memcmp(Context.StartOrder, ExpectedStartOrder, sizeof(ExpectedStartOrder)) == 0); + TEST_TRUE(memcmp(Context.SendOrder, ExpectedSendOrder, sizeof(ExpectedSendOrder)) == 0); + TEST_TRUE(Context.TestSucceeded); + for (uint8_t i = 0; i < ConnectionPriorityTestContext::NumSend; ++i) { + delete Streams[i]; + } +} + +static void ConnectionPriorityTest2(UniquePtr Connections[], uint8_t NumConnections, MsQuicStream* Streams[], QUIC_BUFFER Buffer, MsQuicConfiguration* ClientConfiguration, QuicAddr* ServerLocalAddr) { + // processing | queued + // [1[s0]] | [] + // [1[s0]] | [2[s(n-1)0p, s(n-1)2p, s00, s02, ..., s(n-2)0, s(n-2)2]] + // [1[s0]] | [2[s(n-1)0p, s(n-1)2p, s00, s02, ..., s(n-2)0, s(n-2)2], 3[s0p, s2p]] + // [2[s(n-1)0p, s(n-1)2p, s00, s02, ..., s(n-2)0, s(n-2)2], 3[s0p, s2p]] | [] + + UNREFERENCED_PARAMETER(NumConnections); + ConnectionPriorityTestContext Context; + MsQuicStream Stream1(*Connections[0], QUIC_STREAM_OPEN_FLAG_UNIDIRECTIONAL, CleanUpManual, ConnectionPriorityTestContext::ClientStreamStartStreamCallback, &Context); + MsQuicStream Stream3(*Connections[2], QUIC_STREAM_OPEN_FLAG_UNIDIRECTIONAL, CleanUpManual, ConnectionPriorityTestContext::ClientStreamStartStreamCallback, &Context); + Context.ExpectedStream = &Stream1; + + ConnectionPriorityTestConnectionStart(Connections[0], ClientConfiguration, ServerLocalAddr); + + Stream1.Start(QUIC_STREAM_START_FLAG_IMMEDIATE); + // Wait until this StreamStart operation is drained + TEST_TRUE(Context.BlockAfterInitialStart.WaitTimeout(TestWaitTimeout)); + + for (uint8_t i = 0; i < ConnectionPriorityTestContext::NumSend; ++i) { + Streams[i] = new(std::nothrow) MsQuicStream( + *Connections[1], QUIC_STREAM_OPEN_FLAG_UNIDIRECTIONAL, CleanUpManual, + ConnectionPriorityTestContext::ClientStreamStartStreamCallback, &Context); + TEST_QUIC_SUCCEEDED(Streams[i]->GetInitStatus()); + + // NOTE: Splitting Start and Send without using QUIC_SEND_FLAG_START doesn't change operation order, + // but it changes callback order. This is needed for using ExpectedXxxxOrder array. + if (i == ConnectionPriorityTestContext::NumSend-1) { + Context.ExpectedStream = Streams[i]; + TEST_QUIC_SUCCEEDED(Streams[i]->Start(QUIC_STREAM_START_FLAG_PRIORITY_WORK)) + TEST_QUIC_SUCCEEDED(Streams[i]->Send(&Buffer, 1, QUIC_SEND_FLAG_FIN | QUIC_SEND_FLAG_PRIORITY_WORK)); + } else { + TEST_QUIC_SUCCEEDED(Streams[i]->Start(QUIC_STREAM_START_FLAG_NONE)) + TEST_QUIC_SUCCEEDED(Streams[i]->Send(&Buffer, 1, QUIC_SEND_FLAG_FIN)); + } + } + + TEST_QUIC_SUCCEEDED(Stream3.Start(QUIC_STREAM_START_FLAG_NONE)); + TEST_QUIC_SUCCEEDED(Stream3.Send(&Buffer, 1, QUIC_SEND_FLAG_FIN)); + Context.MaxSend = ConnectionPriorityTestContext::NumSend + 1; + Context.OperationQueuedComplete.Set(); // All operations are queued. Kick off processing the operations + + MsQuicStream* ExpectedStartOrder[ConnectionPriorityTestContext::NumSend + 2] = {0}; + ExpectedStartOrder[0] = &Stream1; + ExpectedStartOrder[1] = Streams[ConnectionPriorityTestContext::NumSend-1]; + ExpectedStartOrder[ConnectionPriorityTestContext::NumSend+1] = &Stream3; + for (uint8_t i = 2; i < ConnectionPriorityTestContext::NumSend + 1; ++i) { + ExpectedStartOrder[i] = Streams[i-2]; + } + MsQuicStream* ExpectedSendOrder[ConnectionPriorityTestContext::NumSend + 1] = {0}; + ExpectedSendOrder[0] = Streams[ConnectionPriorityTestContext::NumSend-1]; + ExpectedSendOrder[ConnectionPriorityTestContext::NumSend] = &Stream3; + for (uint8_t i = 1; i < ConnectionPriorityTestContext::NumSend; ++i) { + ExpectedSendOrder[i] = Streams[i-1]; + } + + for (uint8_t i = 1; i < 3; ++i) { + ConnectionPriorityTestConnectionStart(Connections[i], ClientConfiguration, ServerLocalAddr); + } + + TEST_TRUE(Context.AllReceivesComplete.WaitTimeout(TestWaitTimeout)); + + TEST_TRUE(memcmp(Context.StartOrder, ExpectedStartOrder, sizeof(ExpectedStartOrder)) == 0); + TEST_TRUE(memcmp(Context.SendOrder, ExpectedSendOrder, sizeof(ExpectedSendOrder)) == 0); + TEST_TRUE(Context.TestSucceeded); + for (uint8_t i = 0; i < ConnectionPriorityTestContext::NumSend; ++i) { + delete Streams[i]; + } +} + +static void ConnectionPriorityTest3(UniquePtr Connections[], uint8_t NumConnections, MsQuicStream* Streams[], QUIC_BUFFER Buffer, MsQuicConfiguration* ClientConfiguration, QuicAddr* ServerLocalAddr) { + // processing | queued + // [1[s0]] | [] + // [1[s0]] | [5[s0, s2]] + // [1[s0]] | [4[s0p, s2p], 5[s0, s2]] + // [1[s0]] | [4[s0p, s2p], 5[s0, s2]], 3[s0, s2]] + // [1[s0]] | [4[s0p, s2p], 2[s0p, s2p], 5[s0, s2], 3[s0, s2]] + // [1[s0, s2]] | [4[s0p, s2p], 2[s0p, s2p], 5[s0, s2], 3[s0, s2]] + + UNREFERENCED_PARAMETER(NumConnections); + UNREFERENCED_PARAMETER(Streams); + ConnectionPriorityTestContext Context; + MsQuicStream Stream1(*Connections[0], QUIC_STREAM_OPEN_FLAG_UNIDIRECTIONAL, CleanUpManual, ConnectionPriorityTestContext::ClientStreamStartStreamCallback, &Context); + MsQuicStream Stream2(*Connections[1], QUIC_STREAM_OPEN_FLAG_UNIDIRECTIONAL, CleanUpManual, ConnectionPriorityTestContext::ClientStreamStartStreamCallback, &Context); + MsQuicStream Stream3(*Connections[2], QUIC_STREAM_OPEN_FLAG_UNIDIRECTIONAL, CleanUpManual, ConnectionPriorityTestContext::ClientStreamStartStreamCallback, &Context); + MsQuicStream Stream4(*Connections[3], QUIC_STREAM_OPEN_FLAG_UNIDIRECTIONAL, CleanUpManual, ConnectionPriorityTestContext::ClientStreamStartStreamCallback, &Context); + MsQuicStream Stream5(*Connections[4], QUIC_STREAM_OPEN_FLAG_UNIDIRECTIONAL, CleanUpManual, ConnectionPriorityTestContext::ClientStreamStartStreamCallback, &Context); + + ConnectionPriorityTestConnectionStart(Connections[0], ClientConfiguration, ServerLocalAddr); + + Stream1.Start(QUIC_STREAM_START_FLAG_IMMEDIATE); + // Wait until this StreamStart operation is drained + TEST_TRUE(Context.BlockAfterInitialStart.WaitTimeout(TestWaitTimeout)); + + TEST_QUIC_SUCCEEDED(Stream5.Start(QUIC_STREAM_START_FLAG_NONE)); + TEST_QUIC_SUCCEEDED(Stream5.Send(&Buffer, 1, QUIC_SEND_FLAG_START | QUIC_SEND_FLAG_FIN)); + TEST_QUIC_SUCCEEDED(Stream4.Start(QUIC_STREAM_START_FLAG_PRIORITY_WORK)); + TEST_QUIC_SUCCEEDED(Stream4.Send(&Buffer, 1, QUIC_SEND_FLAG_START | QUIC_SEND_FLAG_FIN | QUIC_SEND_FLAG_PRIORITY_WORK)); + TEST_QUIC_SUCCEEDED(Stream3.Start(QUIC_STREAM_START_FLAG_NONE)); + TEST_QUIC_SUCCEEDED(Stream3.Send(&Buffer, 1, QUIC_SEND_FLAG_START | QUIC_SEND_FLAG_FIN)); + TEST_QUIC_SUCCEEDED(Stream2.Start(QUIC_STREAM_START_FLAG_PRIORITY_WORK)); + TEST_QUIC_SUCCEEDED(Stream2.Send(&Buffer, 1, QUIC_SEND_FLAG_START | QUIC_SEND_FLAG_FIN | QUIC_SEND_FLAG_PRIORITY_WORK)); + + TEST_QUIC_SUCCEEDED(Stream1.Send(&Buffer, 1, QUIC_SEND_FLAG_FIN | QUIC_SEND_FLAG_PRIORITY_WORK)); + + Context.OperationQueuedComplete.Set(); // All operations are queued. Kick off processing the operations + Context.MaxSend = 5; + + for (uint8_t i = 1; i < NumConnections; ++i) { + ConnectionPriorityTestConnectionStart(Connections[i], ClientConfiguration, ServerLocalAddr); + } + + TEST_TRUE(Context.AllReceivesComplete.WaitTimeout(TestWaitTimeout)); + + MsQuicStream* ExpectedStartOrder[5] = {0}; + MsQuicStream* ExpectedSendOrder[5] = {0}; + ExpectedStartOrder[0] = &Stream1; + ExpectedStartOrder[1] = &Stream4; + ExpectedStartOrder[2] = &Stream2; + ExpectedStartOrder[3] = &Stream5; + ExpectedStartOrder[4] = &Stream3; + ExpectedSendOrder[0] = &Stream1; + ExpectedSendOrder[1] = &Stream4; + ExpectedSendOrder[2] = &Stream2; + ExpectedSendOrder[3] = &Stream5; + ExpectedSendOrder[4] = &Stream3; + + TEST_TRUE(memcmp(Context.StartOrder, ExpectedStartOrder, sizeof(ExpectedStartOrder)) == 0); + TEST_TRUE(memcmp(Context.SendOrder, ExpectedSendOrder, sizeof(ExpectedSendOrder)) == 0); +} + +void ConnectionPriorityCommon(ConnectionPriorityTestType* ConnectionPriorityTest) { // QUIC_EXECUTION_PROFILE_TYPE_SCAVENGER for serializing Connections MsQuicRegistration Registration("MsQuicTest", QUIC_EXECUTION_PROFILE_TYPE_SCAVENGER, true); TEST_QUIC_SUCCEEDED(Registration.GetInitStatus()); @@ -3631,202 +3844,20 @@ void QuicTestConnectionPriority() for (uint8_t i = 0; i < NumConnections; ++i) { Connections[i].reset(new(std::nothrow) MsQuicConnection(Registration)); TEST_QUIC_SUCCEEDED(Connections[i]->GetInitStatus()); - TEST_QUIC_SUCCEEDED(Connections[i]->Start(ClientConfiguration, ServerLocalAddr.GetFamily(), QUIC_TEST_LOOPBACK_FOR_AF(ServerLocalAddr.GetFamily()), ServerLocalAddr.GetPort())); - TEST_TRUE(Connections[i]->HandshakeCompleteEvent.WaitTimeout(TestWaitTimeout)); - TEST_TRUE(Connections[i]->HandshakeComplete); - } - - // s: stream op - // p: prioritied op - // s0/s2: stream start, stream send - // n in sn0/sn2: stream id - // processing | queued - // [1[s0]] | [] - // [1[s0]] | [2[s00, s02, ..., s(n-1)0, s(n-1)2]] - // [1[s0]] | [3[s0p, s2p], 2[s00, s02, ..., s(n-1)0, s(n-1)2]] - // [3[s0p, s2p], 2[s00, s02, ..., s(n-1)0, s(n-1)2]] | [] - { - ConnectionPriorityTestContext Context; - MsQuicStream Stream1(*Connections[0], QUIC_STREAM_OPEN_FLAG_UNIDIRECTIONAL, CleanUpManual, ConnectionPriorityTestContext::ClientStreamStartStreamCallback, &Context); - MsQuicStream Stream3(*Connections[2], QUIC_STREAM_OPEN_FLAG_UNIDIRECTIONAL, CleanUpManual, ConnectionPriorityTestContext::ClientStreamStartStreamCallback, &Context); - Context.ExpectedStream = &Stream1; - - // NOTE: This is to flush all operations in the queue. - // If this is not done, the operation order is not guaranteed. - // e.g. This test case randomly swap [3] and [4] and fail without sleep. - // This happens when [3] is already in the worker queue. - // Normal enqueue doesn't re-queue the Connection - CxPlatSleep(300); - - Stream1.Start(QUIC_STREAM_START_FLAG_IMMEDIATE); - // Wait until this StreamStart operation is drained - TEST_TRUE(Context.BlockAfterInitialStart.WaitTimeout(TestWaitTimeout)); - Context.ExpectedStream = &Stream3; - - for (uint8_t i = 0; i < ConnectionPriorityTestContext::NumSend; ++i) { - Streams[i] = new(std::nothrow) MsQuicStream( - *Connections[1], QUIC_STREAM_OPEN_FLAG_UNIDIRECTIONAL, CleanUpManual, - ConnectionPriorityTestContext::ClientStreamStartStreamCallback, &Context); - TEST_QUIC_SUCCEEDED(Streams[i]->GetInitStatus()); - TEST_QUIC_SUCCEEDED(Streams[i]->Send(&Buffer, 1, QUIC_SEND_FLAG_START | QUIC_SEND_FLAG_FIN)); - } - - TEST_QUIC_SUCCEEDED(Stream3.Start(QUIC_STREAM_START_FLAG_PRIORITY_WORK)); - TEST_QUIC_SUCCEEDED(Stream3.Send(&Buffer, 1, QUIC_SEND_FLAG_FIN | QUIC_SEND_FLAG_PRIORITY_WORK)); - Context.MaxSend = ConnectionPriorityTestContext::NumSend + 1; - Context.OperationQueuedComplete.Set(); // All operations are queued. Kick off processing the operations - - MsQuicStream* ExpectedStartOrder[ConnectionPriorityTestContext::NumSend + 2] = {0}; - ExpectedStartOrder[0] = &Stream1; - ExpectedStartOrder[1] = &Stream3; - for (uint8_t i = 2; i < ConnectionPriorityTestContext::NumSend + 2; ++i) { - ExpectedStartOrder[i] = Streams[i-2]; - } - MsQuicStream* ExpectedSendOrder[ConnectionPriorityTestContext::NumSend + 1] = {0}; - ExpectedSendOrder[0] = &Stream3; - for (uint8_t i = 1; i < ConnectionPriorityTestContext::NumSend + 1; ++i) { - ExpectedSendOrder[i] = Streams[i-1]; - } - - TEST_TRUE(Context.AllReceivesComplete.WaitTimeout(TestWaitTimeout)); - - TEST_TRUE(memcmp(Context.StartOrder, ExpectedStartOrder, sizeof(ExpectedStartOrder)) == 0); - TEST_TRUE(memcmp(Context.SendOrder, ExpectedSendOrder, sizeof(ExpectedSendOrder)) == 0); - TEST_TRUE(Context.TestSucceeded); - for (uint8_t i = 0; i < ConnectionPriorityTestContext::NumSend; ++i) { - delete Streams[i]; - } - } - - // processing | queued - // [1[s0]] | [] - // [1[s0]] | [2[s(n-1)0p, s(n-1)2p, s00, s02, ..., s(n-2)0, s(n-2)2]] - // [1[s0]] | [2[s(n-1)0p, s(n-1)2p, s00, s02, ..., s(n-2)0, s(n-2)2], 3[s0p, s2p]] - // [2[s(n-1)0p, s(n-1)2p, s00, s02, ..., s(n-2)0, s(n-2)2], 3[s0p, s2p]] | [] - { - ConnectionPriorityTestContext Context; - MsQuicStream Stream1(*Connections[0], QUIC_STREAM_OPEN_FLAG_UNIDIRECTIONAL, CleanUpManual, ConnectionPriorityTestContext::ClientStreamStartStreamCallback, &Context); - MsQuicStream Stream3(*Connections[2], QUIC_STREAM_OPEN_FLAG_UNIDIRECTIONAL, CleanUpManual, ConnectionPriorityTestContext::ClientStreamStartStreamCallback, &Context); - Context.ExpectedStream = &Stream1; - - // NOTE: This is to flush all operations in the queue. - // If this is not done, the operation order is not guaranteed. - // e.g. This test case randomly swap [3] and [4] and fail without sleep. - // This happens when [3] is already in the worker queue. - // Normal enqueue doesn't re-queue the Connection - CxPlatSleep(300); - - Stream1.Start(QUIC_STREAM_START_FLAG_IMMEDIATE); - // Wait until this StreamStart operation is drained - TEST_TRUE(Context.BlockAfterInitialStart.WaitTimeout(TestWaitTimeout)); - - for (uint8_t i = 0; i < ConnectionPriorityTestContext::NumSend; ++i) { - Streams[i] = new(std::nothrow) MsQuicStream( - *Connections[1], QUIC_STREAM_OPEN_FLAG_UNIDIRECTIONAL, CleanUpManual, - ConnectionPriorityTestContext::ClientStreamStartStreamCallback, &Context); - TEST_QUIC_SUCCEEDED(Streams[i]->GetInitStatus()); - - // NOTE: Splitting Start and Send without using QUIC_SEND_FLAG_START doesn't change operation order, - // but it changes callback order. This is needed for using ExpectedXxxxOrder array. - if (i == ConnectionPriorityTestContext::NumSend-1) { - Context.ExpectedStream = Streams[i]; - TEST_QUIC_SUCCEEDED(Streams[i]->Start(QUIC_STREAM_START_FLAG_PRIORITY_WORK)) - TEST_QUIC_SUCCEEDED(Streams[i]->Send(&Buffer, 1, QUIC_SEND_FLAG_FIN | QUIC_SEND_FLAG_PRIORITY_WORK)); - } else { - TEST_QUIC_SUCCEEDED(Streams[i]->Start(QUIC_STREAM_START_FLAG_NONE)) - TEST_QUIC_SUCCEEDED(Streams[i]->Send(&Buffer, 1, QUIC_SEND_FLAG_FIN)); - } - } - - TEST_QUIC_SUCCEEDED(Stream3.Start(QUIC_STREAM_START_FLAG_NONE)); - TEST_QUIC_SUCCEEDED(Stream3.Send(&Buffer, 1, QUIC_SEND_FLAG_FIN)); - Context.MaxSend = ConnectionPriorityTestContext::NumSend + 1; - Context.OperationQueuedComplete.Set(); // All operations are queued. Kick off processing the operations - - MsQuicStream* ExpectedStartOrder[ConnectionPriorityTestContext::NumSend + 2] = {0}; - ExpectedStartOrder[0] = &Stream1; - ExpectedStartOrder[1] = Streams[ConnectionPriorityTestContext::NumSend-1]; - ExpectedStartOrder[ConnectionPriorityTestContext::NumSend+1] = &Stream3; - for (uint8_t i = 2; i < ConnectionPriorityTestContext::NumSend + 1; ++i) { - ExpectedStartOrder[i] = Streams[i-2]; - } - MsQuicStream* ExpectedSendOrder[ConnectionPriorityTestContext::NumSend + 1] = {0}; - ExpectedSendOrder[0] = Streams[ConnectionPriorityTestContext::NumSend-1]; - ExpectedSendOrder[ConnectionPriorityTestContext::NumSend] = &Stream3; - for (uint8_t i = 1; i < ConnectionPriorityTestContext::NumSend; ++i) { - ExpectedSendOrder[i] = Streams[i-1]; - } - - TEST_TRUE(Context.AllReceivesComplete.WaitTimeout(TestWaitTimeout)); - - TEST_TRUE(memcmp(Context.StartOrder, ExpectedStartOrder, sizeof(ExpectedStartOrder)) == 0); - TEST_TRUE(memcmp(Context.SendOrder, ExpectedSendOrder, sizeof(ExpectedSendOrder)) == 0); - TEST_TRUE(Context.TestSucceeded); - for (uint8_t i = 0; i < ConnectionPriorityTestContext::NumSend; ++i) { - delete Streams[i]; - } } - // processing | queued - // [1[s0]] | [] - // [1[s0]] | [5[s0, s2]] - // [1[s0]] | [4[s0p, s2p], 5[s0, s2]] - // [1[s0]] | [4[s0p, s2p], 5[s0, s2]], 3[s0, s2]] - // [1[s0]] | [4[s0p, s2p], 2[s0p, s2p], 5[s0, s2], 3[s0, s2]] - // [1[s0, s2]] | [4[s0p, s2p], 2[s0p, s2p], 5[s0, s2], 3[s0, s2]] - { - ConnectionPriorityTestContext Context; - MsQuicStream Stream1(*Connections[0], QUIC_STREAM_OPEN_FLAG_UNIDIRECTIONAL, CleanUpManual, ConnectionPriorityTestContext::ClientStreamStartStreamCallback, &Context); - MsQuicStream Stream2(*Connections[1], QUIC_STREAM_OPEN_FLAG_UNIDIRECTIONAL, CleanUpManual, ConnectionPriorityTestContext::ClientStreamStartStreamCallback, &Context); - MsQuicStream Stream3(*Connections[2], QUIC_STREAM_OPEN_FLAG_UNIDIRECTIONAL, CleanUpManual, ConnectionPriorityTestContext::ClientStreamStartStreamCallback, &Context); - MsQuicStream Stream4(*Connections[3], QUIC_STREAM_OPEN_FLAG_UNIDIRECTIONAL, CleanUpManual, ConnectionPriorityTestContext::ClientStreamStartStreamCallback, &Context); - MsQuicStream Stream5(*Connections[4], QUIC_STREAM_OPEN_FLAG_UNIDIRECTIONAL, CleanUpManual, ConnectionPriorityTestContext::ClientStreamStartStreamCallback, &Context); - - // NOTE: This is to flush all operations in the queue. - // If this is not done, the operation order is not guaranteed. - // e.g. This test case randomly swap [3] and [4] and fail without sleep. - // This happens when [3] is already in the worker queue. - // Normal enqueue doesn't re-queue the Connection - CxPlatSleep(300); - - Stream1.Start(QUIC_STREAM_START_FLAG_IMMEDIATE); - // Wait until this StreamStart operation is drained - TEST_TRUE(Context.BlockAfterInitialStart.WaitTimeout(TestWaitTimeout)); - - TEST_QUIC_SUCCEEDED(Stream5.Start(QUIC_STREAM_START_FLAG_NONE)); - TEST_QUIC_SUCCEEDED(Stream5.Send(&Buffer, 1, QUIC_SEND_FLAG_START | QUIC_SEND_FLAG_FIN)); - TEST_QUIC_SUCCEEDED(Stream4.Start(QUIC_STREAM_START_FLAG_PRIORITY_WORK)); - TEST_QUIC_SUCCEEDED(Stream4.Send(&Buffer, 1, QUIC_SEND_FLAG_START | QUIC_SEND_FLAG_FIN | QUIC_SEND_FLAG_PRIORITY_WORK)); - TEST_QUIC_SUCCEEDED(Stream3.Start(QUIC_STREAM_START_FLAG_NONE)); - TEST_QUIC_SUCCEEDED(Stream3.Send(&Buffer, 1, QUIC_SEND_FLAG_START | QUIC_SEND_FLAG_FIN)); - TEST_QUIC_SUCCEEDED(Stream2.Start(QUIC_STREAM_START_FLAG_PRIORITY_WORK)); - TEST_QUIC_SUCCEEDED(Stream2.Send(&Buffer, 1, QUIC_SEND_FLAG_START | QUIC_SEND_FLAG_FIN | QUIC_SEND_FLAG_PRIORITY_WORK)); - - TEST_QUIC_SUCCEEDED(Stream1.Send(&Buffer, 1, QUIC_SEND_FLAG_FIN | QUIC_SEND_FLAG_PRIORITY_WORK)); - - Context.OperationQueuedComplete.Set(); // All operations are queued. Kick off processing the operations - Context.MaxSend = 5; - TEST_TRUE(Context.AllReceivesComplete.WaitTimeout(TestWaitTimeout)); - - MsQuicStream* ExpectedStartOrder[5] = {0}; - MsQuicStream* ExpectedSendOrder[5] = {0}; - ExpectedStartOrder[0] = &Stream1; - ExpectedStartOrder[1] = &Stream4; - ExpectedStartOrder[2] = &Stream2; - ExpectedStartOrder[3] = &Stream5; - ExpectedStartOrder[4] = &Stream3; - ExpectedSendOrder[0] = &Stream1; - ExpectedSendOrder[1] = &Stream4; - ExpectedSendOrder[2] = &Stream2; - ExpectedSendOrder[3] = &Stream5; - ExpectedSendOrder[4] = &Stream3; - - TEST_TRUE(memcmp(Context.StartOrder, ExpectedStartOrder, sizeof(ExpectedStartOrder)) == 0); - TEST_TRUE(memcmp(Context.SendOrder, ExpectedSendOrder, sizeof(ExpectedSendOrder)) == 0); - } + ConnectionPriorityTest(Connections, NumConnections, Streams, Buffer, &ClientConfiguration, &ServerLocalAddr); } } +void QuicTestConnectionPriority() +{ + // NOTE: re-allocating connections/streams can avoid contaminating operations operation from previous test + ConnectionPriorityCommon(ConnectionPriorityTest1); + ConnectionPriorityCommon(ConnectionPriorityTest2); + ConnectionPriorityCommon(ConnectionPriorityTest3); +} + struct StreamBlockUnblockConnFlowControl { CxPlatEvent ClientStreamShutdownComplete; CxPlatEvent ClientStreamSendComplete;