diff --git a/openthread-sys/Cargo.toml b/openthread-sys/Cargo.toml index 7a2837a8..b2736ef6 100644 --- a/openthread-sys/Cargo.toml +++ b/openthread-sys/Cargo.toml @@ -22,8 +22,8 @@ force-esp-riscv-toolchain = [] [build-dependencies] anyhow = "1" -bindgen = "0.71" -env_logger = "0.10" +bindgen = "0.72" +env_logger = "0.11" log = "0.4" cmake = "0.1.52" cc = "1.1" diff --git a/openthread-sys/gen/builder.rs b/openthread-sys/gen/builder.rs index 1b16ead4..b77a23cc 100644 --- a/openthread-sys/gen/builder.rs +++ b/openthread-sys/gen/builder.rs @@ -30,6 +30,7 @@ impl OpenThreadBuilder { /// - `force_esp_riscv_toolchain`: If true, and if the target is a riscv32 target, force the use of the Espressif RISCV GCC toolchain /// (`riscv32-esp-elf-gcc`) rather than the derived `riscv32-unknown-elf-gcc` toolchain which is the "official" RISC-V one /// (https://github.com/riscv-collab/riscv-gnu-toolchain) + #[expect(clippy::too_many_arguments)] pub fn new( force_clang: bool, crate_root_path: PathBuf, @@ -95,6 +96,7 @@ impl OpenThreadBuilder { .derive_debug(false) .derive_default(true) .layout_tests(false) + .prepend_enum_name(false) .allowlist_item("ot.*") .allowlist_item("OT_.*") .header( diff --git a/openthread-sys/gen/sysroot/include/sys/types.h b/openthread-sys/gen/sysroot/include/sys/types.h index 8a2a70af..98d508ca 100644 --- a/openthread-sys/gen/sysroot/include/sys/types.h +++ b/openthread-sys/gen/sysroot/include/sys/types.h @@ -9,8 +9,15 @@ extern "C" { #include +#if defined(__has_include) && __has_include() +// HACK: MbedTLS ends up including whenever it's available. +// That header ends up pulling in _off_t.h, which conflicts with our own +// definition. Let's just use the system one if we can. +#include +#else // Newlib defines `off_t` as `__SLONGWORD_TYPE`. typedef long int off_t; +#endif #ifdef __cplusplus } // extern "C" diff --git a/openthread-sys/src/include/riscv32imac-unknown-none-elf.rs b/openthread-sys/src/include/riscv32imac-unknown-none-elf.rs index 6fbdfa20..7de93947 100644 --- a/openthread-sys/src/include/riscv32imac-unknown-none-elf.rs +++ b/openthread-sys/src/include/riscv32imac-unknown-none-elf.rs @@ -1,4 +1,4 @@ -/* automatically generated by rust-bindgen 0.71.1 */ +/* automatically generated by rust-bindgen 0.72.1 */ #[repr(C)] #[derive(Copy, Clone, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)] @@ -36,7 +36,9 @@ where 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); + let byte = unsafe { + *(core::ptr::addr_of!((*this).storage) as *const u8).offset(byte_index as isize) + }; Self::extract_bit(byte, index) } #[inline] @@ -64,9 +66,10 @@ where 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); + let byte = unsafe { + (core::ptr::addr_of_mut!((*this).storage) as *mut u8).offset(byte_index as isize) + }; + unsafe { *byte = Self::change_bit(*byte, index, val) }; } #[inline] pub fn get(&self, bit_offset: usize, bit_width: u8) -> u64 { @@ -93,7 +96,7 @@ where 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) { + if unsafe { Self::raw_get_bit(this, i + bit_offset) } { let index = if cfg!(target_endian = "big") { bit_width as usize - 1 - i } else { @@ -133,7 +136,7 @@ where } else { i }; - Self::raw_set_bit(this, index + bit_offset, val_bit_is_set); + unsafe { Self::raw_set_bit(this, index + bit_offset, val_bit_is_set) }; } } } @@ -259,82 +262,82 @@ pub const OT_DNS_TXT_KEY_MIN_LENGTH: u32 = 1; pub const OT_DNS_TXT_KEY_MAX_LENGTH: u32 = 9; pub const OT_DNS_TXT_KEY_ITER_MAX_LENGTH: u32 = 64; /// No error. -pub const otError_OT_ERROR_NONE: otError = 0; +pub const OT_ERROR_NONE: otError = 0; /// Operational failed. -pub const otError_OT_ERROR_FAILED: otError = 1; +pub const OT_ERROR_FAILED: otError = 1; /// Message was dropped. -pub const otError_OT_ERROR_DROP: otError = 2; +pub const OT_ERROR_DROP: otError = 2; /// Insufficient buffers. -pub const otError_OT_ERROR_NO_BUFS: otError = 3; +pub const OT_ERROR_NO_BUFS: otError = 3; /// No route available. -pub const otError_OT_ERROR_NO_ROUTE: otError = 4; +pub const OT_ERROR_NO_ROUTE: otError = 4; /// Service is busy and could not service the operation. -pub const otError_OT_ERROR_BUSY: otError = 5; +pub const OT_ERROR_BUSY: otError = 5; /// Failed to parse message. -pub const otError_OT_ERROR_PARSE: otError = 6; +pub const OT_ERROR_PARSE: otError = 6; /// Input arguments are invalid. -pub const otError_OT_ERROR_INVALID_ARGS: otError = 7; +pub const OT_ERROR_INVALID_ARGS: otError = 7; /// Security checks failed. -pub const otError_OT_ERROR_SECURITY: otError = 8; +pub const OT_ERROR_SECURITY: otError = 8; /// Address resolution requires an address query operation. -pub const otError_OT_ERROR_ADDRESS_QUERY: otError = 9; +pub const OT_ERROR_ADDRESS_QUERY: otError = 9; /// Address is not in the source match table. -pub const otError_OT_ERROR_NO_ADDRESS: otError = 10; +pub const OT_ERROR_NO_ADDRESS: otError = 10; /// Operation was aborted. -pub const otError_OT_ERROR_ABORT: otError = 11; +pub const OT_ERROR_ABORT: otError = 11; /// Function or method is not implemented. -pub const otError_OT_ERROR_NOT_IMPLEMENTED: otError = 12; +pub const OT_ERROR_NOT_IMPLEMENTED: otError = 12; /// Cannot complete due to invalid state. -pub const otError_OT_ERROR_INVALID_STATE: otError = 13; +pub const OT_ERROR_INVALID_STATE: otError = 13; /// No acknowledgment was received after macMaxFrameRetries (IEEE 802.15.4-2006). -pub const otError_OT_ERROR_NO_ACK: otError = 14; +pub const OT_ERROR_NO_ACK: otError = 14; /// A transmission could not take place due to activity on the channel, i.e., the CSMA-CA mechanism has failed /// (IEEE 802.15.4-2006). -pub const otError_OT_ERROR_CHANNEL_ACCESS_FAILURE: otError = 15; +pub const OT_ERROR_CHANNEL_ACCESS_FAILURE: otError = 15; /// Not currently attached to a Thread Partition. -pub const otError_OT_ERROR_DETACHED: otError = 16; +pub const OT_ERROR_DETACHED: otError = 16; /// FCS check failure while receiving. -pub const otError_OT_ERROR_FCS: otError = 17; +pub const OT_ERROR_FCS: otError = 17; /// No frame received. -pub const otError_OT_ERROR_NO_FRAME_RECEIVED: otError = 18; +pub const OT_ERROR_NO_FRAME_RECEIVED: otError = 18; /// Received a frame from an unknown neighbor. -pub const otError_OT_ERROR_UNKNOWN_NEIGHBOR: otError = 19; +pub const OT_ERROR_UNKNOWN_NEIGHBOR: otError = 19; /// Received a frame from an invalid source address. -pub const otError_OT_ERROR_INVALID_SOURCE_ADDRESS: otError = 20; +pub const OT_ERROR_INVALID_SOURCE_ADDRESS: otError = 20; /// Received a frame filtered by the address filter (allowlisted or denylisted). -pub const otError_OT_ERROR_ADDRESS_FILTERED: otError = 21; +pub const OT_ERROR_ADDRESS_FILTERED: otError = 21; /// Received a frame filtered by the destination address check. -pub const otError_OT_ERROR_DESTINATION_ADDRESS_FILTERED: otError = 22; +pub const OT_ERROR_DESTINATION_ADDRESS_FILTERED: otError = 22; /// The requested item could not be found. -pub const otError_OT_ERROR_NOT_FOUND: otError = 23; +pub const OT_ERROR_NOT_FOUND: otError = 23; /// The operation is already in progress. -pub const otError_OT_ERROR_ALREADY: otError = 24; +pub const OT_ERROR_ALREADY: otError = 24; /// The creation of IPv6 address failed. -pub const otError_OT_ERROR_IP6_ADDRESS_CREATION_FAILURE: otError = 26; +pub const OT_ERROR_IP6_ADDRESS_CREATION_FAILURE: otError = 26; /// Operation prevented by mode flags -pub const otError_OT_ERROR_NOT_CAPABLE: otError = 27; +pub const OT_ERROR_NOT_CAPABLE: otError = 27; /// Coap response or acknowledgment or DNS, SNTP response not received. -pub const otError_OT_ERROR_RESPONSE_TIMEOUT: otError = 28; +pub const OT_ERROR_RESPONSE_TIMEOUT: otError = 28; /// Received a duplicated frame. -pub const otError_OT_ERROR_DUPLICATED: otError = 29; +pub const OT_ERROR_DUPLICATED: otError = 29; /// Message is being dropped from reassembly list due to timeout. -pub const otError_OT_ERROR_REASSEMBLY_TIMEOUT: otError = 30; +pub const OT_ERROR_REASSEMBLY_TIMEOUT: otError = 30; /// Message is not a TMF Message. -pub const otError_OT_ERROR_NOT_TMF: otError = 31; +pub const OT_ERROR_NOT_TMF: otError = 31; /// Received a non-lowpan data frame. -pub const otError_OT_ERROR_NOT_LOWPAN_DATA_FRAME: otError = 32; +pub const OT_ERROR_NOT_LOWPAN_DATA_FRAME: otError = 32; /// The link margin was too low. -pub const otError_OT_ERROR_LINK_MARGIN_LOW: otError = 34; +pub const OT_ERROR_LINK_MARGIN_LOW: otError = 34; /// Input (CLI) command is invalid. -pub const otError_OT_ERROR_INVALID_COMMAND: otError = 35; +pub const OT_ERROR_INVALID_COMMAND: otError = 35; /// Special error code used to indicate success/error status is pending and not yet known. -pub const otError_OT_ERROR_PENDING: otError = 36; +pub const OT_ERROR_PENDING: otError = 36; /// Request rejected. -pub const otError_OT_ERROR_REJECTED: otError = 37; +pub const OT_ERROR_REJECTED: otError = 37; /// The number of defined errors. -pub const otError_OT_NUM_ERRORS: otError = 38; +pub const OT_NUM_ERRORS: otError = 38; /// Generic error (should not use). -pub const otError_OT_ERROR_GENERIC: otError = 255; +pub const OT_ERROR_GENERIC: otError = 255; /// Represents error codes used throughout OpenThread. pub type otError = ::core::ffi::c_uint; unsafe extern "C" { @@ -573,19 +576,19 @@ pub struct otMessage { _unused: [u8; 0], } ///< Low priority level. -pub const otMessagePriority_OT_MESSAGE_PRIORITY_LOW: otMessagePriority = 0; +pub const OT_MESSAGE_PRIORITY_LOW: otMessagePriority = 0; ///< Normal priority level. -pub const otMessagePriority_OT_MESSAGE_PRIORITY_NORMAL: otMessagePriority = 1; +pub const OT_MESSAGE_PRIORITY_NORMAL: otMessagePriority = 1; ///< High priority level. -pub const otMessagePriority_OT_MESSAGE_PRIORITY_HIGH: otMessagePriority = 2; +pub const OT_MESSAGE_PRIORITY_HIGH: otMessagePriority = 2; /// Defines the OpenThread message priority levels. pub type otMessagePriority = ::core::ffi::c_uint; ///< Message from Thread Netif. -pub const otMessageOrigin_OT_MESSAGE_ORIGIN_THREAD_NETIF: otMessageOrigin = 0; +pub const OT_MESSAGE_ORIGIN_THREAD_NETIF: otMessageOrigin = 0; ///< Message from a trusted source on host. -pub const otMessageOrigin_OT_MESSAGE_ORIGIN_HOST_TRUSTED: otMessageOrigin = 1; +pub const OT_MESSAGE_ORIGIN_HOST_TRUSTED: otMessageOrigin = 1; ///< Message from an untrusted source on host. -pub const otMessageOrigin_OT_MESSAGE_ORIGIN_HOST_UNTRUSTED: otMessageOrigin = 2; +pub const OT_MESSAGE_ORIGIN_HOST_UNTRUSTED: otMessageOrigin = 2; /// Defines the OpenThread message origins. pub type otMessageOrigin = ::core::ffi::c_uint; /// Represents a message settings. @@ -2594,13 +2597,13 @@ pub type otUdpReceive = ::core::option::Option< ), >; ///< Unspecified network interface. -pub const otNetifIdentifier_OT_NETIF_UNSPECIFIED: otNetifIdentifier = 0; +pub const OT_NETIF_UNSPECIFIED: otNetifIdentifier = 0; ///< The host Thread interface - allow use of platform UDP. -pub const otNetifIdentifier_OT_NETIF_THREAD_HOST: otNetifIdentifier = 1; +pub const OT_NETIF_THREAD_HOST: otNetifIdentifier = 1; ///< The internal Thread interface (within OpenThread) - do not use platform UDP. -pub const otNetifIdentifier_OT_NETIF_THREAD_INTERNAL: otNetifIdentifier = 2; +pub const OT_NETIF_THREAD_INTERNAL: otNetifIdentifier = 2; ///< The Backbone interface. -pub const otNetifIdentifier_OT_NETIF_BACKBONE: otNetifIdentifier = 3; +pub const OT_NETIF_BACKBONE: otNetifIdentifier = 3; /// Defines the OpenThread network interface identifiers. pub type otNetifIdentifier = ::core::ffi::c_uint; /// Represents a UDP socket. @@ -2803,23 +2806,23 @@ unsafe extern "C" { pub fn otUdpIsPortInUse(aInstance: *mut otInstance, port: u16) -> bool; } ///< Key Type: Raw Data. -pub const otCryptoKeyType_OT_CRYPTO_KEY_TYPE_RAW: otCryptoKeyType = 0; +pub const OT_CRYPTO_KEY_TYPE_RAW: otCryptoKeyType = 0; ///< Key Type: AES. -pub const otCryptoKeyType_OT_CRYPTO_KEY_TYPE_AES: otCryptoKeyType = 1; +pub const OT_CRYPTO_KEY_TYPE_AES: otCryptoKeyType = 1; ///< Key Type: HMAC. -pub const otCryptoKeyType_OT_CRYPTO_KEY_TYPE_HMAC: otCryptoKeyType = 2; +pub const OT_CRYPTO_KEY_TYPE_HMAC: otCryptoKeyType = 2; ///< Key Type: ECDSA. -pub const otCryptoKeyType_OT_CRYPTO_KEY_TYPE_ECDSA: otCryptoKeyType = 3; +pub const OT_CRYPTO_KEY_TYPE_ECDSA: otCryptoKeyType = 3; /// Defines the key types. pub type otCryptoKeyType = ::core::ffi::c_uint; ///< Key Algorithm: Vendor Defined. -pub const otCryptoKeyAlgorithm_OT_CRYPTO_KEY_ALG_VENDOR: otCryptoKeyAlgorithm = 0; +pub const OT_CRYPTO_KEY_ALG_VENDOR: otCryptoKeyAlgorithm = 0; ///< Key Algorithm: AES ECB. -pub const otCryptoKeyAlgorithm_OT_CRYPTO_KEY_ALG_AES_ECB: otCryptoKeyAlgorithm = 1; +pub const OT_CRYPTO_KEY_ALG_AES_ECB: otCryptoKeyAlgorithm = 1; ///< Key Algorithm: HMAC SHA-256. -pub const otCryptoKeyAlgorithm_OT_CRYPTO_KEY_ALG_HMAC_SHA_256: otCryptoKeyAlgorithm = 2; +pub const OT_CRYPTO_KEY_ALG_HMAC_SHA_256: otCryptoKeyAlgorithm = 2; ///< Key Algorithm: ECDSA. -pub const otCryptoKeyAlgorithm_OT_CRYPTO_KEY_ALG_ECDSA: otCryptoKeyAlgorithm = 3; +pub const OT_CRYPTO_KEY_ALG_ECDSA: otCryptoKeyAlgorithm = 3; /// Defines the key algorithms. pub type otCryptoKeyAlgorithm = ::core::ffi::c_uint; ///< Key Usage: Key Usage is empty. @@ -2837,9 +2840,9 @@ pub const OT_CRYPTO_KEY_USAGE_VERIFY_HASH: _bindgen_ty_4 = 16; /// Defines the key usage flags. pub type _bindgen_ty_4 = ::core::ffi::c_uint; ///< Key Persistence: Key is volatile. -pub const otCryptoKeyStorage_OT_CRYPTO_KEY_STORAGE_VOLATILE: otCryptoKeyStorage = 0; +pub const OT_CRYPTO_KEY_STORAGE_VOLATILE: otCryptoKeyStorage = 0; ///< Key Persistence: Key is persistent. -pub const otCryptoKeyStorage_OT_CRYPTO_KEY_STORAGE_PERSISTENT: otCryptoKeyStorage = 1; +pub const OT_CRYPTO_KEY_STORAGE_PERSISTENT: otCryptoKeyStorage = 1; /// Defines the key storage types. pub type otCryptoKeyStorage = ::core::ffi::c_uint; /// This datatype represents the key reference. @@ -3623,9 +3626,9 @@ impl Default for otMacKeyMaterial { } } ///< Use Literal Keys. -pub const otRadioKeyType_OT_KEY_TYPE_LITERAL_KEY: otRadioKeyType = 0; +pub const OT_KEY_TYPE_LITERAL_KEY: otRadioKeyType = 0; ///< Use Reference to Key. -pub const otRadioKeyType_OT_KEY_TYPE_KEY_REF: otRadioKeyType = 1; +pub const OT_KEY_TYPE_KEY_REF: otRadioKeyType = 1; /// Defines constants about key types. pub type otRadioKeyType = ::core::ffi::c_uint; /// Represents the IEEE 802.15.4 Header IE (Information Element) related information of a radio frame. @@ -4068,11 +4071,11 @@ impl Default for otRadioFrame { } } } -pub const otRadioState_OT_RADIO_STATE_DISABLED: otRadioState = 0; -pub const otRadioState_OT_RADIO_STATE_SLEEP: otRadioState = 1; -pub const otRadioState_OT_RADIO_STATE_RECEIVE: otRadioState = 2; -pub const otRadioState_OT_RADIO_STATE_TRANSMIT: otRadioState = 3; -pub const otRadioState_OT_RADIO_STATE_INVALID: otRadioState = 255; +pub const OT_RADIO_STATE_DISABLED: otRadioState = 0; +pub const OT_RADIO_STATE_SLEEP: otRadioState = 1; +pub const OT_RADIO_STATE_RECEIVE: otRadioState = 2; +pub const OT_RADIO_STATE_TRANSMIT: otRadioState = 3; +pub const OT_RADIO_STATE_INVALID: otRadioState = 255; /// Represents the state of a radio. /// Initially, a radio is in the Disabled state. pub type otRadioState = ::core::ffi::c_uint; @@ -5802,89 +5805,89 @@ impl Default for otOperationalDatasetTlvs { } } ///< meshcop Channel TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_CHANNEL: otMeshcopTlvType = 0; +pub const OT_MESHCOP_TLV_CHANNEL: otMeshcopTlvType = 0; ///< meshcop Pan Id TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_PANID: otMeshcopTlvType = 1; +pub const OT_MESHCOP_TLV_PANID: otMeshcopTlvType = 1; ///< meshcop Extended Pan Id TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_EXTPANID: otMeshcopTlvType = 2; +pub const OT_MESHCOP_TLV_EXTPANID: otMeshcopTlvType = 2; ///< meshcop Network Name TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_NETWORKNAME: otMeshcopTlvType = 3; +pub const OT_MESHCOP_TLV_NETWORKNAME: otMeshcopTlvType = 3; ///< meshcop PSKc TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_PSKC: otMeshcopTlvType = 4; +pub const OT_MESHCOP_TLV_PSKC: otMeshcopTlvType = 4; ///< meshcop Network Key TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_NETWORKKEY: otMeshcopTlvType = 5; +pub const OT_MESHCOP_TLV_NETWORKKEY: otMeshcopTlvType = 5; ///< meshcop Network Key Sequence TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_NETWORK_KEY_SEQUENCE: otMeshcopTlvType = 6; +pub const OT_MESHCOP_TLV_NETWORK_KEY_SEQUENCE: otMeshcopTlvType = 6; ///< meshcop Mesh Local Prefix TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_MESHLOCALPREFIX: otMeshcopTlvType = 7; +pub const OT_MESHCOP_TLV_MESHLOCALPREFIX: otMeshcopTlvType = 7; ///< meshcop Steering Data TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_STEERING_DATA: otMeshcopTlvType = 8; +pub const OT_MESHCOP_TLV_STEERING_DATA: otMeshcopTlvType = 8; ///< meshcop Border Agent Locator TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_BORDER_AGENT_RLOC: otMeshcopTlvType = 9; +pub const OT_MESHCOP_TLV_BORDER_AGENT_RLOC: otMeshcopTlvType = 9; ///< meshcop Commissioner ID TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_COMMISSIONER_ID: otMeshcopTlvType = 10; +pub const OT_MESHCOP_TLV_COMMISSIONER_ID: otMeshcopTlvType = 10; ///< meshcop Commissioner Session ID TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_COMM_SESSION_ID: otMeshcopTlvType = 11; +pub const OT_MESHCOP_TLV_COMM_SESSION_ID: otMeshcopTlvType = 11; ///< meshcop Security Policy TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_SECURITYPOLICY: otMeshcopTlvType = 12; +pub const OT_MESHCOP_TLV_SECURITYPOLICY: otMeshcopTlvType = 12; ///< meshcop Get TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_GET: otMeshcopTlvType = 13; +pub const OT_MESHCOP_TLV_GET: otMeshcopTlvType = 13; ///< meshcop Active Timestamp TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_ACTIVETIMESTAMP: otMeshcopTlvType = 14; +pub const OT_MESHCOP_TLV_ACTIVETIMESTAMP: otMeshcopTlvType = 14; ///< meshcop Commissioner UDP Port TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_COMMISSIONER_UDP_PORT: otMeshcopTlvType = 15; +pub const OT_MESHCOP_TLV_COMMISSIONER_UDP_PORT: otMeshcopTlvType = 15; ///< meshcop State TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_STATE: otMeshcopTlvType = 16; +pub const OT_MESHCOP_TLV_STATE: otMeshcopTlvType = 16; ///< meshcop Joiner DTLS Encapsulation TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_JOINER_DTLS: otMeshcopTlvType = 17; +pub const OT_MESHCOP_TLV_JOINER_DTLS: otMeshcopTlvType = 17; ///< meshcop Joiner UDP Port TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_JOINER_UDP_PORT: otMeshcopTlvType = 18; +pub const OT_MESHCOP_TLV_JOINER_UDP_PORT: otMeshcopTlvType = 18; ///< meshcop Joiner IID TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_JOINER_IID: otMeshcopTlvType = 19; +pub const OT_MESHCOP_TLV_JOINER_IID: otMeshcopTlvType = 19; ///< meshcop Joiner Router Locator TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_JOINER_RLOC: otMeshcopTlvType = 20; +pub const OT_MESHCOP_TLV_JOINER_RLOC: otMeshcopTlvType = 20; ///< meshcop Joiner Router KEK TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_JOINER_ROUTER_KEK: otMeshcopTlvType = 21; +pub const OT_MESHCOP_TLV_JOINER_ROUTER_KEK: otMeshcopTlvType = 21; ///< meshcop Provisioning URL TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_PROVISIONING_URL: otMeshcopTlvType = 32; +pub const OT_MESHCOP_TLV_PROVISIONING_URL: otMeshcopTlvType = 32; ///< meshcop Vendor Name TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_VENDOR_NAME_TLV: otMeshcopTlvType = 33; +pub const OT_MESHCOP_TLV_VENDOR_NAME_TLV: otMeshcopTlvType = 33; ///< meshcop Vendor Model TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_VENDOR_MODEL_TLV: otMeshcopTlvType = 34; +pub const OT_MESHCOP_TLV_VENDOR_MODEL_TLV: otMeshcopTlvType = 34; ///< meshcop Vendor SW Version TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_VENDOR_SW_VERSION_TLV: otMeshcopTlvType = 35; +pub const OT_MESHCOP_TLV_VENDOR_SW_VERSION_TLV: otMeshcopTlvType = 35; ///< meshcop Vendor Data TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_VENDOR_DATA_TLV: otMeshcopTlvType = 36; +pub const OT_MESHCOP_TLV_VENDOR_DATA_TLV: otMeshcopTlvType = 36; ///< meshcop Vendor Stack Version TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_VENDOR_STACK_VERSION_TLV: otMeshcopTlvType = 37; +pub const OT_MESHCOP_TLV_VENDOR_STACK_VERSION_TLV: otMeshcopTlvType = 37; ///< meshcop UDP encapsulation TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_UDP_ENCAPSULATION_TLV: otMeshcopTlvType = 48; +pub const OT_MESHCOP_TLV_UDP_ENCAPSULATION_TLV: otMeshcopTlvType = 48; ///< meshcop IPv6 address TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_IPV6_ADDRESS_TLV: otMeshcopTlvType = 49; +pub const OT_MESHCOP_TLV_IPV6_ADDRESS_TLV: otMeshcopTlvType = 49; ///< meshcop Pending Timestamp TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_PENDINGTIMESTAMP: otMeshcopTlvType = 51; +pub const OT_MESHCOP_TLV_PENDINGTIMESTAMP: otMeshcopTlvType = 51; ///< meshcop Delay Timer TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_DELAYTIMER: otMeshcopTlvType = 52; +pub const OT_MESHCOP_TLV_DELAYTIMER: otMeshcopTlvType = 52; ///< meshcop Channel Mask TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_CHANNELMASK: otMeshcopTlvType = 53; +pub const OT_MESHCOP_TLV_CHANNELMASK: otMeshcopTlvType = 53; ///< meshcop Count TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_COUNT: otMeshcopTlvType = 54; +pub const OT_MESHCOP_TLV_COUNT: otMeshcopTlvType = 54; ///< meshcop Period TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_PERIOD: otMeshcopTlvType = 55; +pub const OT_MESHCOP_TLV_PERIOD: otMeshcopTlvType = 55; ///< meshcop Scan Duration TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_SCAN_DURATION: otMeshcopTlvType = 56; +pub const OT_MESHCOP_TLV_SCAN_DURATION: otMeshcopTlvType = 56; ///< meshcop Energy List TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_ENERGY_LIST: otMeshcopTlvType = 57; +pub const OT_MESHCOP_TLV_ENERGY_LIST: otMeshcopTlvType = 57; ///< meshcop Thread Domain Name TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_THREAD_DOMAIN_NAME: otMeshcopTlvType = 59; +pub const OT_MESHCOP_TLV_THREAD_DOMAIN_NAME: otMeshcopTlvType = 59; ///< meshcop Wake-up Channel TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_WAKEUP_CHANNEL: otMeshcopTlvType = 74; +pub const OT_MESHCOP_TLV_WAKEUP_CHANNEL: otMeshcopTlvType = 74; ///< meshcop Discovery Request TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_DISCOVERYREQUEST: otMeshcopTlvType = 128; +pub const OT_MESHCOP_TLV_DISCOVERYREQUEST: otMeshcopTlvType = 128; ///< meshcop Discovery Response TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_DISCOVERYRESPONSE: otMeshcopTlvType = 129; +pub const OT_MESHCOP_TLV_DISCOVERYRESPONSE: otMeshcopTlvType = 129; ///< meshcop Joiner Advertisement TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_JOINERADVERTISEMENT: otMeshcopTlvType = 241; +pub const OT_MESHCOP_TLV_JOINERADVERTISEMENT: otMeshcopTlvType = 241; /// Represents meshcop TLV types. pub type otMeshcopTlvType = ::core::ffi::c_uint; /// Pointer is called when a response to a MGMT_SET request is received or times out. @@ -6202,12 +6205,12 @@ unsafe extern "C" { aDatasetTlvs: *mut otOperationalDatasetTlvs, ) -> otError; } -pub const otJoinerState_OT_JOINER_STATE_IDLE: otJoinerState = 0; -pub const otJoinerState_OT_JOINER_STATE_DISCOVER: otJoinerState = 1; -pub const otJoinerState_OT_JOINER_STATE_CONNECT: otJoinerState = 2; -pub const otJoinerState_OT_JOINER_STATE_CONNECTED: otJoinerState = 3; -pub const otJoinerState_OT_JOINER_STATE_ENTRUST: otJoinerState = 4; -pub const otJoinerState_OT_JOINER_STATE_JOINED: otJoinerState = 5; +pub const OT_JOINER_STATE_IDLE: otJoinerState = 0; +pub const OT_JOINER_STATE_DISCOVER: otJoinerState = 1; +pub const OT_JOINER_STATE_CONNECT: otJoinerState = 2; +pub const OT_JOINER_STATE_CONNECTED: otJoinerState = 3; +pub const OT_JOINER_STATE_ENTRUST: otJoinerState = 4; +pub const OT_JOINER_STATE_JOINED: otJoinerState = 5; /// Defines the Joiner State. pub type otJoinerState = ::core::ffi::c_uint; /// Represents a Joiner Discerner. @@ -6320,18 +6323,18 @@ unsafe extern "C" { pub fn otJoinerStateToString(aState: otJoinerState) -> *const ::core::ffi::c_char; } ///< Commissioner role is disabled. -pub const otCommissionerState_OT_COMMISSIONER_STATE_DISABLED: otCommissionerState = 0; +pub const OT_COMMISSIONER_STATE_DISABLED: otCommissionerState = 0; ///< Currently petitioning to become a Commissioner. -pub const otCommissionerState_OT_COMMISSIONER_STATE_PETITION: otCommissionerState = 1; +pub const OT_COMMISSIONER_STATE_PETITION: otCommissionerState = 1; ///< Commissioner role is active. -pub const otCommissionerState_OT_COMMISSIONER_STATE_ACTIVE: otCommissionerState = 2; +pub const OT_COMMISSIONER_STATE_ACTIVE: otCommissionerState = 2; /// Defines the Commissioner State. pub type otCommissionerState = ::core::ffi::c_uint; -pub const otCommissionerJoinerEvent_OT_COMMISSIONER_JOINER_START: otCommissionerJoinerEvent = 0; -pub const otCommissionerJoinerEvent_OT_COMMISSIONER_JOINER_CONNECTED: otCommissionerJoinerEvent = 1; -pub const otCommissionerJoinerEvent_OT_COMMISSIONER_JOINER_FINALIZE: otCommissionerJoinerEvent = 2; -pub const otCommissionerJoinerEvent_OT_COMMISSIONER_JOINER_END: otCommissionerJoinerEvent = 3; -pub const otCommissionerJoinerEvent_OT_COMMISSIONER_JOINER_REMOVED: otCommissionerJoinerEvent = 4; +pub const OT_COMMISSIONER_JOINER_START: otCommissionerJoinerEvent = 0; +pub const OT_COMMISSIONER_JOINER_CONNECTED: otCommissionerJoinerEvent = 1; +pub const OT_COMMISSIONER_JOINER_FINALIZE: otCommissionerJoinerEvent = 2; +pub const OT_COMMISSIONER_JOINER_END: otCommissionerJoinerEvent = 3; +pub const OT_COMMISSIONER_JOINER_REMOVED: otCommissionerJoinerEvent = 4; /// Defines a Joiner Event on the Commissioner. pub type otCommissionerJoinerEvent = ::core::ffi::c_uint; /// Represents the steering data. @@ -6574,11 +6577,11 @@ impl Default for otJoinerPskd { } } ///< Accept any Joiner (no EUI64 or Discerner is specified). -pub const otJoinerInfoType_OT_JOINER_INFO_TYPE_ANY: otJoinerInfoType = 0; +pub const OT_JOINER_INFO_TYPE_ANY: otJoinerInfoType = 0; ///< Joiner EUI-64 is specified (`mSharedId.mEui64` in `otJoinerInfo`). -pub const otJoinerInfoType_OT_JOINER_INFO_TYPE_EUI64: otJoinerInfoType = 1; +pub const OT_JOINER_INFO_TYPE_EUI64: otJoinerInfoType = 1; ///< Joiner Discerner is specified (`mSharedId.mDiscerner` in `otJoinerInfo`). -pub const otJoinerInfoType_OT_JOINER_INFO_TYPE_DISCERNER: otJoinerInfoType = 2; +pub const OT_JOINER_INFO_TYPE_DISCERNER: otJoinerInfoType = 2; /// Defines a Joiner Info Type. pub type otJoinerInfoType = ::core::ffi::c_uint; /// Represents a Joiner Info. @@ -6954,11 +6957,11 @@ unsafe extern "C" { } pub type otMacFilterIterator = u8; ///< Address filter is disabled. -pub const otMacFilterAddressMode_OT_MAC_FILTER_ADDRESS_MODE_DISABLED: otMacFilterAddressMode = 0; +pub const OT_MAC_FILTER_ADDRESS_MODE_DISABLED: otMacFilterAddressMode = 0; ///< Allowlist address filter mode is enabled. -pub const otMacFilterAddressMode_OT_MAC_FILTER_ADDRESS_MODE_ALLOWLIST: otMacFilterAddressMode = 1; +pub const OT_MAC_FILTER_ADDRESS_MODE_ALLOWLIST: otMacFilterAddressMode = 1; ///< Denylist address filter mode is enabled. -pub const otMacFilterAddressMode_OT_MAC_FILTER_ADDRESS_MODE_DENYLIST: otMacFilterAddressMode = 2; +pub const OT_MAC_FILTER_ADDRESS_MODE_DENYLIST: otMacFilterAddressMode = 2; /// Defines address mode of the mac filter. pub type otMacFilterAddressMode = ::core::ffi::c_uint; /// Represents a Mac Filter entry. @@ -8119,15 +8122,15 @@ unsafe extern "C" { pub fn otLinkSetRxOnWhenIdle(aInstance: *mut otInstance, aRxOnWhenIdle: bool) -> otError; } ///< The Thread stack is disabled. -pub const otDeviceRole_OT_DEVICE_ROLE_DISABLED: otDeviceRole = 0; +pub const OT_DEVICE_ROLE_DISABLED: otDeviceRole = 0; ///< Not currently participating in a Thread network/partition. -pub const otDeviceRole_OT_DEVICE_ROLE_DETACHED: otDeviceRole = 1; +pub const OT_DEVICE_ROLE_DETACHED: otDeviceRole = 1; ///< The Thread Child role. -pub const otDeviceRole_OT_DEVICE_ROLE_CHILD: otDeviceRole = 2; +pub const OT_DEVICE_ROLE_CHILD: otDeviceRole = 2; ///< The Thread Router role. -pub const otDeviceRole_OT_DEVICE_ROLE_ROUTER: otDeviceRole = 3; +pub const OT_DEVICE_ROLE_ROUTER: otDeviceRole = 3; ///< The Thread Leader role. -pub const otDeviceRole_OT_DEVICE_ROLE_LEADER: otDeviceRole = 4; +pub const OT_DEVICE_ROLE_LEADER: otDeviceRole = 4; /// Represents a Thread device role. pub type otDeviceRole = ::core::ffi::c_uint; /// Represents an MLE Link Mode configuration. @@ -9797,14 +9800,14 @@ pub struct otNat64ProtocolCounters { pub mTcp: otNat64Counters, } ///< Packet drop for unknown reasons. -pub const otNat64DropReason_OT_NAT64_DROP_REASON_UNKNOWN: otNat64DropReason = 0; +pub const OT_NAT64_DROP_REASON_UNKNOWN: otNat64DropReason = 0; ///< Packet drop due to failed to parse the datagram. -pub const otNat64DropReason_OT_NAT64_DROP_REASON_ILLEGAL_PACKET: otNat64DropReason = 1; +pub const OT_NAT64_DROP_REASON_ILLEGAL_PACKET: otNat64DropReason = 1; ///< Packet drop due to unsupported IP protocol. -pub const otNat64DropReason_OT_NAT64_DROP_REASON_UNSUPPORTED_PROTO: otNat64DropReason = 2; +pub const OT_NAT64_DROP_REASON_UNSUPPORTED_PROTO: otNat64DropReason = 2; ///< Packet drop due to no mappings found or mapping pool exhausted. -pub const otNat64DropReason_OT_NAT64_DROP_REASON_NO_MAPPING: otNat64DropReason = 3; -pub const otNat64DropReason_OT_NAT64_DROP_REASON_COUNT: otNat64DropReason = 4; +pub const OT_NAT64_DROP_REASON_NO_MAPPING: otNat64DropReason = 3; +pub const OT_NAT64_DROP_REASON_COUNT: otNat64DropReason = 4; /// Packet drop reasons. pub type otNat64DropReason = ::core::ffi::c_uint; /// Represents the counters of dropped packets due to errors when handling NAT64 packets. @@ -9927,13 +9930,13 @@ unsafe extern "C" { ) -> otError; } ///< NAT64 is disabled. -pub const otNat64State_OT_NAT64_STATE_DISABLED: otNat64State = 0; +pub const OT_NAT64_STATE_DISABLED: otNat64State = 0; ///< NAT64 is enabled, but one or more dependencies of NAT64 are not running. -pub const otNat64State_OT_NAT64_STATE_NOT_RUNNING: otNat64State = 1; +pub const OT_NAT64_STATE_NOT_RUNNING: otNat64State = 1; ///< NAT64 is enabled, but this BR is not an active NAT64 BR. -pub const otNat64State_OT_NAT64_STATE_IDLE: otNat64State = 2; +pub const OT_NAT64_STATE_IDLE: otNat64State = 2; ///< The BR is publishing a NAT64 prefix and/or translating packets. -pub const otNat64State_OT_NAT64_STATE_ACTIVE: otNat64State = 3; +pub const OT_NAT64_STATE_ACTIVE: otNat64State = 3; /// States of NAT64. pub type otNat64State = ::core::ffi::c_uint; unsafe extern "C" { @@ -10954,11 +10957,11 @@ impl otExternalRouteConfig { } } ///< Low route preference. -pub const otRoutePreference_OT_ROUTE_PREFERENCE_LOW: otRoutePreference = -1; +pub const OT_ROUTE_PREFERENCE_LOW: otRoutePreference = -1; ///< Medium route preference. -pub const otRoutePreference_OT_ROUTE_PREFERENCE_MED: otRoutePreference = 0; +pub const OT_ROUTE_PREFERENCE_MED: otRoutePreference = 0; ///< High route preference. -pub const otRoutePreference_OT_ROUTE_PREFERENCE_HIGH: otRoutePreference = 1; +pub const OT_ROUTE_PREFERENCE_HIGH: otRoutePreference = 1; /// Defines valid values for `mPreference` in `otExternalRouteConfig` and `otBorderRouterConfig`. pub type otRoutePreference = ::core::ffi::c_int; /// Represents a Server configuration. @@ -11282,16 +11285,16 @@ unsafe extern "C" { /// @retval OT_ERROR_NOT_CAPABLE Not capable of resetting to bootloader. pub fn otPlatResetToBootloader(aInstance: *mut otInstance) -> otError; } -pub const otPlatResetReason_OT_PLAT_RESET_REASON_POWER_ON: otPlatResetReason = 0; -pub const otPlatResetReason_OT_PLAT_RESET_REASON_EXTERNAL: otPlatResetReason = 1; -pub const otPlatResetReason_OT_PLAT_RESET_REASON_SOFTWARE: otPlatResetReason = 2; -pub const otPlatResetReason_OT_PLAT_RESET_REASON_FAULT: otPlatResetReason = 3; -pub const otPlatResetReason_OT_PLAT_RESET_REASON_CRASH: otPlatResetReason = 4; -pub const otPlatResetReason_OT_PLAT_RESET_REASON_ASSERT: otPlatResetReason = 5; -pub const otPlatResetReason_OT_PLAT_RESET_REASON_OTHER: otPlatResetReason = 6; -pub const otPlatResetReason_OT_PLAT_RESET_REASON_UNKNOWN: otPlatResetReason = 7; -pub const otPlatResetReason_OT_PLAT_RESET_REASON_WATCHDOG: otPlatResetReason = 8; -pub const otPlatResetReason_OT_PLAT_RESET_REASON_COUNT: otPlatResetReason = 9; +pub const OT_PLAT_RESET_REASON_POWER_ON: otPlatResetReason = 0; +pub const OT_PLAT_RESET_REASON_EXTERNAL: otPlatResetReason = 1; +pub const OT_PLAT_RESET_REASON_SOFTWARE: otPlatResetReason = 2; +pub const OT_PLAT_RESET_REASON_FAULT: otPlatResetReason = 3; +pub const OT_PLAT_RESET_REASON_CRASH: otPlatResetReason = 4; +pub const OT_PLAT_RESET_REASON_ASSERT: otPlatResetReason = 5; +pub const OT_PLAT_RESET_REASON_OTHER: otPlatResetReason = 6; +pub const OT_PLAT_RESET_REASON_UNKNOWN: otPlatResetReason = 7; +pub const OT_PLAT_RESET_REASON_WATCHDOG: otPlatResetReason = 8; +pub const OT_PLAT_RESET_REASON_COUNT: otPlatResetReason = 9; /// Enumeration of possible reset reason codes. /// /// These are in the same order as the Spinel reset reason codes. @@ -11320,7 +11323,7 @@ unsafe extern "C" { /// external triggers. /// /// @note The `ON` power state only determines the MCU's power mode and is not related to radio's state. -pub const otPlatMcuPowerState_OT_PLAT_MCU_POWER_STATE_ON: otPlatMcuPowerState = 0; +pub const OT_PLAT_MCU_POWER_STATE_ON: otPlatMcuPowerState = 0; /// NCP's MCU can enter low-power (energy-saving) state. /// /// When the NCP's desired power state is set to `LOW_POWER`, host is expected to "poke" the NCP (e.g., an external @@ -11334,12 +11337,12 @@ pub const otPlatMcuPowerState_OT_PLAT_MCU_POWER_STATE_ON: otPlatMcuPowerState = /// /// @note The `LOW_POWER` power state only determines the MCU's power mode and is not related to radio's state /// (radio is managed by OpenThread core and device role, e.g., device being sleepy or not. -pub const otPlatMcuPowerState_OT_PLAT_MCU_POWER_STATE_LOW_POWER: otPlatMcuPowerState = 1; +pub const OT_PLAT_MCU_POWER_STATE_LOW_POWER: otPlatMcuPowerState = 1; /// NCP is fully off. /// /// An NCP hardware reset (via a RESET pin) is required to bring the NCP back to `SPINEL_MCU_POWER_STATE_ON`. /// RAM is not retained after reset. -pub const otPlatMcuPowerState_OT_PLAT_MCU_POWER_STATE_OFF: otPlatMcuPowerState = 2; +pub const OT_PLAT_MCU_POWER_STATE_OFF: otPlatMcuPowerState = 2; /// Enumeration of micro-controller's power states. /// /// These values are used for NCP configuration when `OPENTHREAD_CONFIG_NCP_ENABLE_MCU_POWER_STATE_CONTROL` is enabled. @@ -11614,51 +11617,51 @@ unsafe extern "C" { /// Represents the log level. pub type otLogLevel = ::core::ffi::c_int; ///< OpenThread API -pub const otLogRegion_OT_LOG_REGION_API: otLogRegion = 1; +pub const OT_LOG_REGION_API: otLogRegion = 1; ///< MLE -pub const otLogRegion_OT_LOG_REGION_MLE: otLogRegion = 2; +pub const OT_LOG_REGION_MLE: otLogRegion = 2; ///< EID-to-RLOC mapping. -pub const otLogRegion_OT_LOG_REGION_ARP: otLogRegion = 3; +pub const OT_LOG_REGION_ARP: otLogRegion = 3; ///< Network Data -pub const otLogRegion_OT_LOG_REGION_NET_DATA: otLogRegion = 4; +pub const OT_LOG_REGION_NET_DATA: otLogRegion = 4; ///< ICMPv6 -pub const otLogRegion_OT_LOG_REGION_ICMP: otLogRegion = 5; +pub const OT_LOG_REGION_ICMP: otLogRegion = 5; ///< IPv6 -pub const otLogRegion_OT_LOG_REGION_IP6: otLogRegion = 6; +pub const OT_LOG_REGION_IP6: otLogRegion = 6; ///< TCP -pub const otLogRegion_OT_LOG_REGION_TCP: otLogRegion = 7; +pub const OT_LOG_REGION_TCP: otLogRegion = 7; ///< IEEE 802.15.4 MAC -pub const otLogRegion_OT_LOG_REGION_MAC: otLogRegion = 8; +pub const OT_LOG_REGION_MAC: otLogRegion = 8; ///< Memory -pub const otLogRegion_OT_LOG_REGION_MEM: otLogRegion = 9; +pub const OT_LOG_REGION_MEM: otLogRegion = 9; ///< NCP -pub const otLogRegion_OT_LOG_REGION_NCP: otLogRegion = 10; +pub const OT_LOG_REGION_NCP: otLogRegion = 10; ///< Mesh Commissioning Protocol -pub const otLogRegion_OT_LOG_REGION_MESH_COP: otLogRegion = 11; +pub const OT_LOG_REGION_MESH_COP: otLogRegion = 11; ///< Network Diagnostic -pub const otLogRegion_OT_LOG_REGION_NET_DIAG: otLogRegion = 12; +pub const OT_LOG_REGION_NET_DIAG: otLogRegion = 12; ///< Platform -pub const otLogRegion_OT_LOG_REGION_PLATFORM: otLogRegion = 13; +pub const OT_LOG_REGION_PLATFORM: otLogRegion = 13; ///< CoAP -pub const otLogRegion_OT_LOG_REGION_COAP: otLogRegion = 14; +pub const OT_LOG_REGION_COAP: otLogRegion = 14; ///< CLI -pub const otLogRegion_OT_LOG_REGION_CLI: otLogRegion = 15; +pub const OT_LOG_REGION_CLI: otLogRegion = 15; ///< OpenThread Core -pub const otLogRegion_OT_LOG_REGION_CORE: otLogRegion = 16; +pub const OT_LOG_REGION_CORE: otLogRegion = 16; ///< Utility module -pub const otLogRegion_OT_LOG_REGION_UTIL: otLogRegion = 17; +pub const OT_LOG_REGION_UTIL: otLogRegion = 17; ///< Backbone Router (available since Thread 1.2) -pub const otLogRegion_OT_LOG_REGION_BBR: otLogRegion = 18; +pub const OT_LOG_REGION_BBR: otLogRegion = 18; ///< Multicast Listener Registration (available since Thread 1.2) -pub const otLogRegion_OT_LOG_REGION_MLR: otLogRegion = 19; +pub const OT_LOG_REGION_MLR: otLogRegion = 19; ///< Domain Unicast Address (available since Thread 1.2) -pub const otLogRegion_OT_LOG_REGION_DUA: otLogRegion = 20; +pub const OT_LOG_REGION_DUA: otLogRegion = 20; ///< Border Router -pub const otLogRegion_OT_LOG_REGION_BR: otLogRegion = 21; +pub const OT_LOG_REGION_BR: otLogRegion = 21; ///< Service Registration Protocol (SRP) -pub const otLogRegion_OT_LOG_REGION_SRP: otLogRegion = 22; +pub const OT_LOG_REGION_SRP: otLogRegion = 22; ///< DNS -pub const otLogRegion_OT_LOG_REGION_DNS: otLogRegion = 23; +pub const OT_LOG_REGION_DNS: otLogRegion = 23; /// Represents log regions. /// /// The support for log region is removed and instead each core module can define its own name to appended to the logs. @@ -11827,21 +11830,21 @@ unsafe extern "C" { pub fn otDnsIsNameCompressionEnabled() -> bool; } ///< Item to be added/registered. -pub const otSrpClientItemState_OT_SRP_CLIENT_ITEM_STATE_TO_ADD: otSrpClientItemState = 0; +pub const OT_SRP_CLIENT_ITEM_STATE_TO_ADD: otSrpClientItemState = 0; ///< Item is being added/registered. -pub const otSrpClientItemState_OT_SRP_CLIENT_ITEM_STATE_ADDING: otSrpClientItemState = 1; +pub const OT_SRP_CLIENT_ITEM_STATE_ADDING: otSrpClientItemState = 1; ///< Item to be refreshed (re-register to renew lease). -pub const otSrpClientItemState_OT_SRP_CLIENT_ITEM_STATE_TO_REFRESH: otSrpClientItemState = 2; +pub const OT_SRP_CLIENT_ITEM_STATE_TO_REFRESH: otSrpClientItemState = 2; ///< Item is being refreshed. -pub const otSrpClientItemState_OT_SRP_CLIENT_ITEM_STATE_REFRESHING: otSrpClientItemState = 3; +pub const OT_SRP_CLIENT_ITEM_STATE_REFRESHING: otSrpClientItemState = 3; ///< Item to be removed. -pub const otSrpClientItemState_OT_SRP_CLIENT_ITEM_STATE_TO_REMOVE: otSrpClientItemState = 4; +pub const OT_SRP_CLIENT_ITEM_STATE_TO_REMOVE: otSrpClientItemState = 4; ///< Item is being removed. -pub const otSrpClientItemState_OT_SRP_CLIENT_ITEM_STATE_REMOVING: otSrpClientItemState = 5; +pub const OT_SRP_CLIENT_ITEM_STATE_REMOVING: otSrpClientItemState = 5; ///< Item is registered with server. -pub const otSrpClientItemState_OT_SRP_CLIENT_ITEM_STATE_REGISTERED: otSrpClientItemState = 6; +pub const OT_SRP_CLIENT_ITEM_STATE_REGISTERED: otSrpClientItemState = 6; ///< Item is removed. -pub const otSrpClientItemState_OT_SRP_CLIENT_ITEM_STATE_REMOVED: otSrpClientItemState = 7; +pub const OT_SRP_CLIENT_ITEM_STATE_REMOVED: otSrpClientItemState = 7; /// Specifies an SRP client item (service or host info) state. pub type otSrpClientItemState = ::core::ffi::c_uint; /// Represents an SRP client host info. diff --git a/openthread-sys/src/include/riscv32imc-unknown-none-elf.rs b/openthread-sys/src/include/riscv32imc-unknown-none-elf.rs index 6fbdfa20..7de93947 100644 --- a/openthread-sys/src/include/riscv32imc-unknown-none-elf.rs +++ b/openthread-sys/src/include/riscv32imc-unknown-none-elf.rs @@ -1,4 +1,4 @@ -/* automatically generated by rust-bindgen 0.71.1 */ +/* automatically generated by rust-bindgen 0.72.1 */ #[repr(C)] #[derive(Copy, Clone, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)] @@ -36,7 +36,9 @@ where 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); + let byte = unsafe { + *(core::ptr::addr_of!((*this).storage) as *const u8).offset(byte_index as isize) + }; Self::extract_bit(byte, index) } #[inline] @@ -64,9 +66,10 @@ where 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); + let byte = unsafe { + (core::ptr::addr_of_mut!((*this).storage) as *mut u8).offset(byte_index as isize) + }; + unsafe { *byte = Self::change_bit(*byte, index, val) }; } #[inline] pub fn get(&self, bit_offset: usize, bit_width: u8) -> u64 { @@ -93,7 +96,7 @@ where 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) { + if unsafe { Self::raw_get_bit(this, i + bit_offset) } { let index = if cfg!(target_endian = "big") { bit_width as usize - 1 - i } else { @@ -133,7 +136,7 @@ where } else { i }; - Self::raw_set_bit(this, index + bit_offset, val_bit_is_set); + unsafe { Self::raw_set_bit(this, index + bit_offset, val_bit_is_set) }; } } } @@ -259,82 +262,82 @@ pub const OT_DNS_TXT_KEY_MIN_LENGTH: u32 = 1; pub const OT_DNS_TXT_KEY_MAX_LENGTH: u32 = 9; pub const OT_DNS_TXT_KEY_ITER_MAX_LENGTH: u32 = 64; /// No error. -pub const otError_OT_ERROR_NONE: otError = 0; +pub const OT_ERROR_NONE: otError = 0; /// Operational failed. -pub const otError_OT_ERROR_FAILED: otError = 1; +pub const OT_ERROR_FAILED: otError = 1; /// Message was dropped. -pub const otError_OT_ERROR_DROP: otError = 2; +pub const OT_ERROR_DROP: otError = 2; /// Insufficient buffers. -pub const otError_OT_ERROR_NO_BUFS: otError = 3; +pub const OT_ERROR_NO_BUFS: otError = 3; /// No route available. -pub const otError_OT_ERROR_NO_ROUTE: otError = 4; +pub const OT_ERROR_NO_ROUTE: otError = 4; /// Service is busy and could not service the operation. -pub const otError_OT_ERROR_BUSY: otError = 5; +pub const OT_ERROR_BUSY: otError = 5; /// Failed to parse message. -pub const otError_OT_ERROR_PARSE: otError = 6; +pub const OT_ERROR_PARSE: otError = 6; /// Input arguments are invalid. -pub const otError_OT_ERROR_INVALID_ARGS: otError = 7; +pub const OT_ERROR_INVALID_ARGS: otError = 7; /// Security checks failed. -pub const otError_OT_ERROR_SECURITY: otError = 8; +pub const OT_ERROR_SECURITY: otError = 8; /// Address resolution requires an address query operation. -pub const otError_OT_ERROR_ADDRESS_QUERY: otError = 9; +pub const OT_ERROR_ADDRESS_QUERY: otError = 9; /// Address is not in the source match table. -pub const otError_OT_ERROR_NO_ADDRESS: otError = 10; +pub const OT_ERROR_NO_ADDRESS: otError = 10; /// Operation was aborted. -pub const otError_OT_ERROR_ABORT: otError = 11; +pub const OT_ERROR_ABORT: otError = 11; /// Function or method is not implemented. -pub const otError_OT_ERROR_NOT_IMPLEMENTED: otError = 12; +pub const OT_ERROR_NOT_IMPLEMENTED: otError = 12; /// Cannot complete due to invalid state. -pub const otError_OT_ERROR_INVALID_STATE: otError = 13; +pub const OT_ERROR_INVALID_STATE: otError = 13; /// No acknowledgment was received after macMaxFrameRetries (IEEE 802.15.4-2006). -pub const otError_OT_ERROR_NO_ACK: otError = 14; +pub const OT_ERROR_NO_ACK: otError = 14; /// A transmission could not take place due to activity on the channel, i.e., the CSMA-CA mechanism has failed /// (IEEE 802.15.4-2006). -pub const otError_OT_ERROR_CHANNEL_ACCESS_FAILURE: otError = 15; +pub const OT_ERROR_CHANNEL_ACCESS_FAILURE: otError = 15; /// Not currently attached to a Thread Partition. -pub const otError_OT_ERROR_DETACHED: otError = 16; +pub const OT_ERROR_DETACHED: otError = 16; /// FCS check failure while receiving. -pub const otError_OT_ERROR_FCS: otError = 17; +pub const OT_ERROR_FCS: otError = 17; /// No frame received. -pub const otError_OT_ERROR_NO_FRAME_RECEIVED: otError = 18; +pub const OT_ERROR_NO_FRAME_RECEIVED: otError = 18; /// Received a frame from an unknown neighbor. -pub const otError_OT_ERROR_UNKNOWN_NEIGHBOR: otError = 19; +pub const OT_ERROR_UNKNOWN_NEIGHBOR: otError = 19; /// Received a frame from an invalid source address. -pub const otError_OT_ERROR_INVALID_SOURCE_ADDRESS: otError = 20; +pub const OT_ERROR_INVALID_SOURCE_ADDRESS: otError = 20; /// Received a frame filtered by the address filter (allowlisted or denylisted). -pub const otError_OT_ERROR_ADDRESS_FILTERED: otError = 21; +pub const OT_ERROR_ADDRESS_FILTERED: otError = 21; /// Received a frame filtered by the destination address check. -pub const otError_OT_ERROR_DESTINATION_ADDRESS_FILTERED: otError = 22; +pub const OT_ERROR_DESTINATION_ADDRESS_FILTERED: otError = 22; /// The requested item could not be found. -pub const otError_OT_ERROR_NOT_FOUND: otError = 23; +pub const OT_ERROR_NOT_FOUND: otError = 23; /// The operation is already in progress. -pub const otError_OT_ERROR_ALREADY: otError = 24; +pub const OT_ERROR_ALREADY: otError = 24; /// The creation of IPv6 address failed. -pub const otError_OT_ERROR_IP6_ADDRESS_CREATION_FAILURE: otError = 26; +pub const OT_ERROR_IP6_ADDRESS_CREATION_FAILURE: otError = 26; /// Operation prevented by mode flags -pub const otError_OT_ERROR_NOT_CAPABLE: otError = 27; +pub const OT_ERROR_NOT_CAPABLE: otError = 27; /// Coap response or acknowledgment or DNS, SNTP response not received. -pub const otError_OT_ERROR_RESPONSE_TIMEOUT: otError = 28; +pub const OT_ERROR_RESPONSE_TIMEOUT: otError = 28; /// Received a duplicated frame. -pub const otError_OT_ERROR_DUPLICATED: otError = 29; +pub const OT_ERROR_DUPLICATED: otError = 29; /// Message is being dropped from reassembly list due to timeout. -pub const otError_OT_ERROR_REASSEMBLY_TIMEOUT: otError = 30; +pub const OT_ERROR_REASSEMBLY_TIMEOUT: otError = 30; /// Message is not a TMF Message. -pub const otError_OT_ERROR_NOT_TMF: otError = 31; +pub const OT_ERROR_NOT_TMF: otError = 31; /// Received a non-lowpan data frame. -pub const otError_OT_ERROR_NOT_LOWPAN_DATA_FRAME: otError = 32; +pub const OT_ERROR_NOT_LOWPAN_DATA_FRAME: otError = 32; /// The link margin was too low. -pub const otError_OT_ERROR_LINK_MARGIN_LOW: otError = 34; +pub const OT_ERROR_LINK_MARGIN_LOW: otError = 34; /// Input (CLI) command is invalid. -pub const otError_OT_ERROR_INVALID_COMMAND: otError = 35; +pub const OT_ERROR_INVALID_COMMAND: otError = 35; /// Special error code used to indicate success/error status is pending and not yet known. -pub const otError_OT_ERROR_PENDING: otError = 36; +pub const OT_ERROR_PENDING: otError = 36; /// Request rejected. -pub const otError_OT_ERROR_REJECTED: otError = 37; +pub const OT_ERROR_REJECTED: otError = 37; /// The number of defined errors. -pub const otError_OT_NUM_ERRORS: otError = 38; +pub const OT_NUM_ERRORS: otError = 38; /// Generic error (should not use). -pub const otError_OT_ERROR_GENERIC: otError = 255; +pub const OT_ERROR_GENERIC: otError = 255; /// Represents error codes used throughout OpenThread. pub type otError = ::core::ffi::c_uint; unsafe extern "C" { @@ -573,19 +576,19 @@ pub struct otMessage { _unused: [u8; 0], } ///< Low priority level. -pub const otMessagePriority_OT_MESSAGE_PRIORITY_LOW: otMessagePriority = 0; +pub const OT_MESSAGE_PRIORITY_LOW: otMessagePriority = 0; ///< Normal priority level. -pub const otMessagePriority_OT_MESSAGE_PRIORITY_NORMAL: otMessagePriority = 1; +pub const OT_MESSAGE_PRIORITY_NORMAL: otMessagePriority = 1; ///< High priority level. -pub const otMessagePriority_OT_MESSAGE_PRIORITY_HIGH: otMessagePriority = 2; +pub const OT_MESSAGE_PRIORITY_HIGH: otMessagePriority = 2; /// Defines the OpenThread message priority levels. pub type otMessagePriority = ::core::ffi::c_uint; ///< Message from Thread Netif. -pub const otMessageOrigin_OT_MESSAGE_ORIGIN_THREAD_NETIF: otMessageOrigin = 0; +pub const OT_MESSAGE_ORIGIN_THREAD_NETIF: otMessageOrigin = 0; ///< Message from a trusted source on host. -pub const otMessageOrigin_OT_MESSAGE_ORIGIN_HOST_TRUSTED: otMessageOrigin = 1; +pub const OT_MESSAGE_ORIGIN_HOST_TRUSTED: otMessageOrigin = 1; ///< Message from an untrusted source on host. -pub const otMessageOrigin_OT_MESSAGE_ORIGIN_HOST_UNTRUSTED: otMessageOrigin = 2; +pub const OT_MESSAGE_ORIGIN_HOST_UNTRUSTED: otMessageOrigin = 2; /// Defines the OpenThread message origins. pub type otMessageOrigin = ::core::ffi::c_uint; /// Represents a message settings. @@ -2594,13 +2597,13 @@ pub type otUdpReceive = ::core::option::Option< ), >; ///< Unspecified network interface. -pub const otNetifIdentifier_OT_NETIF_UNSPECIFIED: otNetifIdentifier = 0; +pub const OT_NETIF_UNSPECIFIED: otNetifIdentifier = 0; ///< The host Thread interface - allow use of platform UDP. -pub const otNetifIdentifier_OT_NETIF_THREAD_HOST: otNetifIdentifier = 1; +pub const OT_NETIF_THREAD_HOST: otNetifIdentifier = 1; ///< The internal Thread interface (within OpenThread) - do not use platform UDP. -pub const otNetifIdentifier_OT_NETIF_THREAD_INTERNAL: otNetifIdentifier = 2; +pub const OT_NETIF_THREAD_INTERNAL: otNetifIdentifier = 2; ///< The Backbone interface. -pub const otNetifIdentifier_OT_NETIF_BACKBONE: otNetifIdentifier = 3; +pub const OT_NETIF_BACKBONE: otNetifIdentifier = 3; /// Defines the OpenThread network interface identifiers. pub type otNetifIdentifier = ::core::ffi::c_uint; /// Represents a UDP socket. @@ -2803,23 +2806,23 @@ unsafe extern "C" { pub fn otUdpIsPortInUse(aInstance: *mut otInstance, port: u16) -> bool; } ///< Key Type: Raw Data. -pub const otCryptoKeyType_OT_CRYPTO_KEY_TYPE_RAW: otCryptoKeyType = 0; +pub const OT_CRYPTO_KEY_TYPE_RAW: otCryptoKeyType = 0; ///< Key Type: AES. -pub const otCryptoKeyType_OT_CRYPTO_KEY_TYPE_AES: otCryptoKeyType = 1; +pub const OT_CRYPTO_KEY_TYPE_AES: otCryptoKeyType = 1; ///< Key Type: HMAC. -pub const otCryptoKeyType_OT_CRYPTO_KEY_TYPE_HMAC: otCryptoKeyType = 2; +pub const OT_CRYPTO_KEY_TYPE_HMAC: otCryptoKeyType = 2; ///< Key Type: ECDSA. -pub const otCryptoKeyType_OT_CRYPTO_KEY_TYPE_ECDSA: otCryptoKeyType = 3; +pub const OT_CRYPTO_KEY_TYPE_ECDSA: otCryptoKeyType = 3; /// Defines the key types. pub type otCryptoKeyType = ::core::ffi::c_uint; ///< Key Algorithm: Vendor Defined. -pub const otCryptoKeyAlgorithm_OT_CRYPTO_KEY_ALG_VENDOR: otCryptoKeyAlgorithm = 0; +pub const OT_CRYPTO_KEY_ALG_VENDOR: otCryptoKeyAlgorithm = 0; ///< Key Algorithm: AES ECB. -pub const otCryptoKeyAlgorithm_OT_CRYPTO_KEY_ALG_AES_ECB: otCryptoKeyAlgorithm = 1; +pub const OT_CRYPTO_KEY_ALG_AES_ECB: otCryptoKeyAlgorithm = 1; ///< Key Algorithm: HMAC SHA-256. -pub const otCryptoKeyAlgorithm_OT_CRYPTO_KEY_ALG_HMAC_SHA_256: otCryptoKeyAlgorithm = 2; +pub const OT_CRYPTO_KEY_ALG_HMAC_SHA_256: otCryptoKeyAlgorithm = 2; ///< Key Algorithm: ECDSA. -pub const otCryptoKeyAlgorithm_OT_CRYPTO_KEY_ALG_ECDSA: otCryptoKeyAlgorithm = 3; +pub const OT_CRYPTO_KEY_ALG_ECDSA: otCryptoKeyAlgorithm = 3; /// Defines the key algorithms. pub type otCryptoKeyAlgorithm = ::core::ffi::c_uint; ///< Key Usage: Key Usage is empty. @@ -2837,9 +2840,9 @@ pub const OT_CRYPTO_KEY_USAGE_VERIFY_HASH: _bindgen_ty_4 = 16; /// Defines the key usage flags. pub type _bindgen_ty_4 = ::core::ffi::c_uint; ///< Key Persistence: Key is volatile. -pub const otCryptoKeyStorage_OT_CRYPTO_KEY_STORAGE_VOLATILE: otCryptoKeyStorage = 0; +pub const OT_CRYPTO_KEY_STORAGE_VOLATILE: otCryptoKeyStorage = 0; ///< Key Persistence: Key is persistent. -pub const otCryptoKeyStorage_OT_CRYPTO_KEY_STORAGE_PERSISTENT: otCryptoKeyStorage = 1; +pub const OT_CRYPTO_KEY_STORAGE_PERSISTENT: otCryptoKeyStorage = 1; /// Defines the key storage types. pub type otCryptoKeyStorage = ::core::ffi::c_uint; /// This datatype represents the key reference. @@ -3623,9 +3626,9 @@ impl Default for otMacKeyMaterial { } } ///< Use Literal Keys. -pub const otRadioKeyType_OT_KEY_TYPE_LITERAL_KEY: otRadioKeyType = 0; +pub const OT_KEY_TYPE_LITERAL_KEY: otRadioKeyType = 0; ///< Use Reference to Key. -pub const otRadioKeyType_OT_KEY_TYPE_KEY_REF: otRadioKeyType = 1; +pub const OT_KEY_TYPE_KEY_REF: otRadioKeyType = 1; /// Defines constants about key types. pub type otRadioKeyType = ::core::ffi::c_uint; /// Represents the IEEE 802.15.4 Header IE (Information Element) related information of a radio frame. @@ -4068,11 +4071,11 @@ impl Default for otRadioFrame { } } } -pub const otRadioState_OT_RADIO_STATE_DISABLED: otRadioState = 0; -pub const otRadioState_OT_RADIO_STATE_SLEEP: otRadioState = 1; -pub const otRadioState_OT_RADIO_STATE_RECEIVE: otRadioState = 2; -pub const otRadioState_OT_RADIO_STATE_TRANSMIT: otRadioState = 3; -pub const otRadioState_OT_RADIO_STATE_INVALID: otRadioState = 255; +pub const OT_RADIO_STATE_DISABLED: otRadioState = 0; +pub const OT_RADIO_STATE_SLEEP: otRadioState = 1; +pub const OT_RADIO_STATE_RECEIVE: otRadioState = 2; +pub const OT_RADIO_STATE_TRANSMIT: otRadioState = 3; +pub const OT_RADIO_STATE_INVALID: otRadioState = 255; /// Represents the state of a radio. /// Initially, a radio is in the Disabled state. pub type otRadioState = ::core::ffi::c_uint; @@ -5802,89 +5805,89 @@ impl Default for otOperationalDatasetTlvs { } } ///< meshcop Channel TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_CHANNEL: otMeshcopTlvType = 0; +pub const OT_MESHCOP_TLV_CHANNEL: otMeshcopTlvType = 0; ///< meshcop Pan Id TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_PANID: otMeshcopTlvType = 1; +pub const OT_MESHCOP_TLV_PANID: otMeshcopTlvType = 1; ///< meshcop Extended Pan Id TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_EXTPANID: otMeshcopTlvType = 2; +pub const OT_MESHCOP_TLV_EXTPANID: otMeshcopTlvType = 2; ///< meshcop Network Name TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_NETWORKNAME: otMeshcopTlvType = 3; +pub const OT_MESHCOP_TLV_NETWORKNAME: otMeshcopTlvType = 3; ///< meshcop PSKc TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_PSKC: otMeshcopTlvType = 4; +pub const OT_MESHCOP_TLV_PSKC: otMeshcopTlvType = 4; ///< meshcop Network Key TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_NETWORKKEY: otMeshcopTlvType = 5; +pub const OT_MESHCOP_TLV_NETWORKKEY: otMeshcopTlvType = 5; ///< meshcop Network Key Sequence TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_NETWORK_KEY_SEQUENCE: otMeshcopTlvType = 6; +pub const OT_MESHCOP_TLV_NETWORK_KEY_SEQUENCE: otMeshcopTlvType = 6; ///< meshcop Mesh Local Prefix TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_MESHLOCALPREFIX: otMeshcopTlvType = 7; +pub const OT_MESHCOP_TLV_MESHLOCALPREFIX: otMeshcopTlvType = 7; ///< meshcop Steering Data TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_STEERING_DATA: otMeshcopTlvType = 8; +pub const OT_MESHCOP_TLV_STEERING_DATA: otMeshcopTlvType = 8; ///< meshcop Border Agent Locator TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_BORDER_AGENT_RLOC: otMeshcopTlvType = 9; +pub const OT_MESHCOP_TLV_BORDER_AGENT_RLOC: otMeshcopTlvType = 9; ///< meshcop Commissioner ID TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_COMMISSIONER_ID: otMeshcopTlvType = 10; +pub const OT_MESHCOP_TLV_COMMISSIONER_ID: otMeshcopTlvType = 10; ///< meshcop Commissioner Session ID TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_COMM_SESSION_ID: otMeshcopTlvType = 11; +pub const OT_MESHCOP_TLV_COMM_SESSION_ID: otMeshcopTlvType = 11; ///< meshcop Security Policy TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_SECURITYPOLICY: otMeshcopTlvType = 12; +pub const OT_MESHCOP_TLV_SECURITYPOLICY: otMeshcopTlvType = 12; ///< meshcop Get TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_GET: otMeshcopTlvType = 13; +pub const OT_MESHCOP_TLV_GET: otMeshcopTlvType = 13; ///< meshcop Active Timestamp TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_ACTIVETIMESTAMP: otMeshcopTlvType = 14; +pub const OT_MESHCOP_TLV_ACTIVETIMESTAMP: otMeshcopTlvType = 14; ///< meshcop Commissioner UDP Port TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_COMMISSIONER_UDP_PORT: otMeshcopTlvType = 15; +pub const OT_MESHCOP_TLV_COMMISSIONER_UDP_PORT: otMeshcopTlvType = 15; ///< meshcop State TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_STATE: otMeshcopTlvType = 16; +pub const OT_MESHCOP_TLV_STATE: otMeshcopTlvType = 16; ///< meshcop Joiner DTLS Encapsulation TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_JOINER_DTLS: otMeshcopTlvType = 17; +pub const OT_MESHCOP_TLV_JOINER_DTLS: otMeshcopTlvType = 17; ///< meshcop Joiner UDP Port TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_JOINER_UDP_PORT: otMeshcopTlvType = 18; +pub const OT_MESHCOP_TLV_JOINER_UDP_PORT: otMeshcopTlvType = 18; ///< meshcop Joiner IID TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_JOINER_IID: otMeshcopTlvType = 19; +pub const OT_MESHCOP_TLV_JOINER_IID: otMeshcopTlvType = 19; ///< meshcop Joiner Router Locator TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_JOINER_RLOC: otMeshcopTlvType = 20; +pub const OT_MESHCOP_TLV_JOINER_RLOC: otMeshcopTlvType = 20; ///< meshcop Joiner Router KEK TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_JOINER_ROUTER_KEK: otMeshcopTlvType = 21; +pub const OT_MESHCOP_TLV_JOINER_ROUTER_KEK: otMeshcopTlvType = 21; ///< meshcop Provisioning URL TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_PROVISIONING_URL: otMeshcopTlvType = 32; +pub const OT_MESHCOP_TLV_PROVISIONING_URL: otMeshcopTlvType = 32; ///< meshcop Vendor Name TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_VENDOR_NAME_TLV: otMeshcopTlvType = 33; +pub const OT_MESHCOP_TLV_VENDOR_NAME_TLV: otMeshcopTlvType = 33; ///< meshcop Vendor Model TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_VENDOR_MODEL_TLV: otMeshcopTlvType = 34; +pub const OT_MESHCOP_TLV_VENDOR_MODEL_TLV: otMeshcopTlvType = 34; ///< meshcop Vendor SW Version TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_VENDOR_SW_VERSION_TLV: otMeshcopTlvType = 35; +pub const OT_MESHCOP_TLV_VENDOR_SW_VERSION_TLV: otMeshcopTlvType = 35; ///< meshcop Vendor Data TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_VENDOR_DATA_TLV: otMeshcopTlvType = 36; +pub const OT_MESHCOP_TLV_VENDOR_DATA_TLV: otMeshcopTlvType = 36; ///< meshcop Vendor Stack Version TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_VENDOR_STACK_VERSION_TLV: otMeshcopTlvType = 37; +pub const OT_MESHCOP_TLV_VENDOR_STACK_VERSION_TLV: otMeshcopTlvType = 37; ///< meshcop UDP encapsulation TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_UDP_ENCAPSULATION_TLV: otMeshcopTlvType = 48; +pub const OT_MESHCOP_TLV_UDP_ENCAPSULATION_TLV: otMeshcopTlvType = 48; ///< meshcop IPv6 address TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_IPV6_ADDRESS_TLV: otMeshcopTlvType = 49; +pub const OT_MESHCOP_TLV_IPV6_ADDRESS_TLV: otMeshcopTlvType = 49; ///< meshcop Pending Timestamp TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_PENDINGTIMESTAMP: otMeshcopTlvType = 51; +pub const OT_MESHCOP_TLV_PENDINGTIMESTAMP: otMeshcopTlvType = 51; ///< meshcop Delay Timer TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_DELAYTIMER: otMeshcopTlvType = 52; +pub const OT_MESHCOP_TLV_DELAYTIMER: otMeshcopTlvType = 52; ///< meshcop Channel Mask TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_CHANNELMASK: otMeshcopTlvType = 53; +pub const OT_MESHCOP_TLV_CHANNELMASK: otMeshcopTlvType = 53; ///< meshcop Count TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_COUNT: otMeshcopTlvType = 54; +pub const OT_MESHCOP_TLV_COUNT: otMeshcopTlvType = 54; ///< meshcop Period TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_PERIOD: otMeshcopTlvType = 55; +pub const OT_MESHCOP_TLV_PERIOD: otMeshcopTlvType = 55; ///< meshcop Scan Duration TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_SCAN_DURATION: otMeshcopTlvType = 56; +pub const OT_MESHCOP_TLV_SCAN_DURATION: otMeshcopTlvType = 56; ///< meshcop Energy List TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_ENERGY_LIST: otMeshcopTlvType = 57; +pub const OT_MESHCOP_TLV_ENERGY_LIST: otMeshcopTlvType = 57; ///< meshcop Thread Domain Name TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_THREAD_DOMAIN_NAME: otMeshcopTlvType = 59; +pub const OT_MESHCOP_TLV_THREAD_DOMAIN_NAME: otMeshcopTlvType = 59; ///< meshcop Wake-up Channel TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_WAKEUP_CHANNEL: otMeshcopTlvType = 74; +pub const OT_MESHCOP_TLV_WAKEUP_CHANNEL: otMeshcopTlvType = 74; ///< meshcop Discovery Request TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_DISCOVERYREQUEST: otMeshcopTlvType = 128; +pub const OT_MESHCOP_TLV_DISCOVERYREQUEST: otMeshcopTlvType = 128; ///< meshcop Discovery Response TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_DISCOVERYRESPONSE: otMeshcopTlvType = 129; +pub const OT_MESHCOP_TLV_DISCOVERYRESPONSE: otMeshcopTlvType = 129; ///< meshcop Joiner Advertisement TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_JOINERADVERTISEMENT: otMeshcopTlvType = 241; +pub const OT_MESHCOP_TLV_JOINERADVERTISEMENT: otMeshcopTlvType = 241; /// Represents meshcop TLV types. pub type otMeshcopTlvType = ::core::ffi::c_uint; /// Pointer is called when a response to a MGMT_SET request is received or times out. @@ -6202,12 +6205,12 @@ unsafe extern "C" { aDatasetTlvs: *mut otOperationalDatasetTlvs, ) -> otError; } -pub const otJoinerState_OT_JOINER_STATE_IDLE: otJoinerState = 0; -pub const otJoinerState_OT_JOINER_STATE_DISCOVER: otJoinerState = 1; -pub const otJoinerState_OT_JOINER_STATE_CONNECT: otJoinerState = 2; -pub const otJoinerState_OT_JOINER_STATE_CONNECTED: otJoinerState = 3; -pub const otJoinerState_OT_JOINER_STATE_ENTRUST: otJoinerState = 4; -pub const otJoinerState_OT_JOINER_STATE_JOINED: otJoinerState = 5; +pub const OT_JOINER_STATE_IDLE: otJoinerState = 0; +pub const OT_JOINER_STATE_DISCOVER: otJoinerState = 1; +pub const OT_JOINER_STATE_CONNECT: otJoinerState = 2; +pub const OT_JOINER_STATE_CONNECTED: otJoinerState = 3; +pub const OT_JOINER_STATE_ENTRUST: otJoinerState = 4; +pub const OT_JOINER_STATE_JOINED: otJoinerState = 5; /// Defines the Joiner State. pub type otJoinerState = ::core::ffi::c_uint; /// Represents a Joiner Discerner. @@ -6320,18 +6323,18 @@ unsafe extern "C" { pub fn otJoinerStateToString(aState: otJoinerState) -> *const ::core::ffi::c_char; } ///< Commissioner role is disabled. -pub const otCommissionerState_OT_COMMISSIONER_STATE_DISABLED: otCommissionerState = 0; +pub const OT_COMMISSIONER_STATE_DISABLED: otCommissionerState = 0; ///< Currently petitioning to become a Commissioner. -pub const otCommissionerState_OT_COMMISSIONER_STATE_PETITION: otCommissionerState = 1; +pub const OT_COMMISSIONER_STATE_PETITION: otCommissionerState = 1; ///< Commissioner role is active. -pub const otCommissionerState_OT_COMMISSIONER_STATE_ACTIVE: otCommissionerState = 2; +pub const OT_COMMISSIONER_STATE_ACTIVE: otCommissionerState = 2; /// Defines the Commissioner State. pub type otCommissionerState = ::core::ffi::c_uint; -pub const otCommissionerJoinerEvent_OT_COMMISSIONER_JOINER_START: otCommissionerJoinerEvent = 0; -pub const otCommissionerJoinerEvent_OT_COMMISSIONER_JOINER_CONNECTED: otCommissionerJoinerEvent = 1; -pub const otCommissionerJoinerEvent_OT_COMMISSIONER_JOINER_FINALIZE: otCommissionerJoinerEvent = 2; -pub const otCommissionerJoinerEvent_OT_COMMISSIONER_JOINER_END: otCommissionerJoinerEvent = 3; -pub const otCommissionerJoinerEvent_OT_COMMISSIONER_JOINER_REMOVED: otCommissionerJoinerEvent = 4; +pub const OT_COMMISSIONER_JOINER_START: otCommissionerJoinerEvent = 0; +pub const OT_COMMISSIONER_JOINER_CONNECTED: otCommissionerJoinerEvent = 1; +pub const OT_COMMISSIONER_JOINER_FINALIZE: otCommissionerJoinerEvent = 2; +pub const OT_COMMISSIONER_JOINER_END: otCommissionerJoinerEvent = 3; +pub const OT_COMMISSIONER_JOINER_REMOVED: otCommissionerJoinerEvent = 4; /// Defines a Joiner Event on the Commissioner. pub type otCommissionerJoinerEvent = ::core::ffi::c_uint; /// Represents the steering data. @@ -6574,11 +6577,11 @@ impl Default for otJoinerPskd { } } ///< Accept any Joiner (no EUI64 or Discerner is specified). -pub const otJoinerInfoType_OT_JOINER_INFO_TYPE_ANY: otJoinerInfoType = 0; +pub const OT_JOINER_INFO_TYPE_ANY: otJoinerInfoType = 0; ///< Joiner EUI-64 is specified (`mSharedId.mEui64` in `otJoinerInfo`). -pub const otJoinerInfoType_OT_JOINER_INFO_TYPE_EUI64: otJoinerInfoType = 1; +pub const OT_JOINER_INFO_TYPE_EUI64: otJoinerInfoType = 1; ///< Joiner Discerner is specified (`mSharedId.mDiscerner` in `otJoinerInfo`). -pub const otJoinerInfoType_OT_JOINER_INFO_TYPE_DISCERNER: otJoinerInfoType = 2; +pub const OT_JOINER_INFO_TYPE_DISCERNER: otJoinerInfoType = 2; /// Defines a Joiner Info Type. pub type otJoinerInfoType = ::core::ffi::c_uint; /// Represents a Joiner Info. @@ -6954,11 +6957,11 @@ unsafe extern "C" { } pub type otMacFilterIterator = u8; ///< Address filter is disabled. -pub const otMacFilterAddressMode_OT_MAC_FILTER_ADDRESS_MODE_DISABLED: otMacFilterAddressMode = 0; +pub const OT_MAC_FILTER_ADDRESS_MODE_DISABLED: otMacFilterAddressMode = 0; ///< Allowlist address filter mode is enabled. -pub const otMacFilterAddressMode_OT_MAC_FILTER_ADDRESS_MODE_ALLOWLIST: otMacFilterAddressMode = 1; +pub const OT_MAC_FILTER_ADDRESS_MODE_ALLOWLIST: otMacFilterAddressMode = 1; ///< Denylist address filter mode is enabled. -pub const otMacFilterAddressMode_OT_MAC_FILTER_ADDRESS_MODE_DENYLIST: otMacFilterAddressMode = 2; +pub const OT_MAC_FILTER_ADDRESS_MODE_DENYLIST: otMacFilterAddressMode = 2; /// Defines address mode of the mac filter. pub type otMacFilterAddressMode = ::core::ffi::c_uint; /// Represents a Mac Filter entry. @@ -8119,15 +8122,15 @@ unsafe extern "C" { pub fn otLinkSetRxOnWhenIdle(aInstance: *mut otInstance, aRxOnWhenIdle: bool) -> otError; } ///< The Thread stack is disabled. -pub const otDeviceRole_OT_DEVICE_ROLE_DISABLED: otDeviceRole = 0; +pub const OT_DEVICE_ROLE_DISABLED: otDeviceRole = 0; ///< Not currently participating in a Thread network/partition. -pub const otDeviceRole_OT_DEVICE_ROLE_DETACHED: otDeviceRole = 1; +pub const OT_DEVICE_ROLE_DETACHED: otDeviceRole = 1; ///< The Thread Child role. -pub const otDeviceRole_OT_DEVICE_ROLE_CHILD: otDeviceRole = 2; +pub const OT_DEVICE_ROLE_CHILD: otDeviceRole = 2; ///< The Thread Router role. -pub const otDeviceRole_OT_DEVICE_ROLE_ROUTER: otDeviceRole = 3; +pub const OT_DEVICE_ROLE_ROUTER: otDeviceRole = 3; ///< The Thread Leader role. -pub const otDeviceRole_OT_DEVICE_ROLE_LEADER: otDeviceRole = 4; +pub const OT_DEVICE_ROLE_LEADER: otDeviceRole = 4; /// Represents a Thread device role. pub type otDeviceRole = ::core::ffi::c_uint; /// Represents an MLE Link Mode configuration. @@ -9797,14 +9800,14 @@ pub struct otNat64ProtocolCounters { pub mTcp: otNat64Counters, } ///< Packet drop for unknown reasons. -pub const otNat64DropReason_OT_NAT64_DROP_REASON_UNKNOWN: otNat64DropReason = 0; +pub const OT_NAT64_DROP_REASON_UNKNOWN: otNat64DropReason = 0; ///< Packet drop due to failed to parse the datagram. -pub const otNat64DropReason_OT_NAT64_DROP_REASON_ILLEGAL_PACKET: otNat64DropReason = 1; +pub const OT_NAT64_DROP_REASON_ILLEGAL_PACKET: otNat64DropReason = 1; ///< Packet drop due to unsupported IP protocol. -pub const otNat64DropReason_OT_NAT64_DROP_REASON_UNSUPPORTED_PROTO: otNat64DropReason = 2; +pub const OT_NAT64_DROP_REASON_UNSUPPORTED_PROTO: otNat64DropReason = 2; ///< Packet drop due to no mappings found or mapping pool exhausted. -pub const otNat64DropReason_OT_NAT64_DROP_REASON_NO_MAPPING: otNat64DropReason = 3; -pub const otNat64DropReason_OT_NAT64_DROP_REASON_COUNT: otNat64DropReason = 4; +pub const OT_NAT64_DROP_REASON_NO_MAPPING: otNat64DropReason = 3; +pub const OT_NAT64_DROP_REASON_COUNT: otNat64DropReason = 4; /// Packet drop reasons. pub type otNat64DropReason = ::core::ffi::c_uint; /// Represents the counters of dropped packets due to errors when handling NAT64 packets. @@ -9927,13 +9930,13 @@ unsafe extern "C" { ) -> otError; } ///< NAT64 is disabled. -pub const otNat64State_OT_NAT64_STATE_DISABLED: otNat64State = 0; +pub const OT_NAT64_STATE_DISABLED: otNat64State = 0; ///< NAT64 is enabled, but one or more dependencies of NAT64 are not running. -pub const otNat64State_OT_NAT64_STATE_NOT_RUNNING: otNat64State = 1; +pub const OT_NAT64_STATE_NOT_RUNNING: otNat64State = 1; ///< NAT64 is enabled, but this BR is not an active NAT64 BR. -pub const otNat64State_OT_NAT64_STATE_IDLE: otNat64State = 2; +pub const OT_NAT64_STATE_IDLE: otNat64State = 2; ///< The BR is publishing a NAT64 prefix and/or translating packets. -pub const otNat64State_OT_NAT64_STATE_ACTIVE: otNat64State = 3; +pub const OT_NAT64_STATE_ACTIVE: otNat64State = 3; /// States of NAT64. pub type otNat64State = ::core::ffi::c_uint; unsafe extern "C" { @@ -10954,11 +10957,11 @@ impl otExternalRouteConfig { } } ///< Low route preference. -pub const otRoutePreference_OT_ROUTE_PREFERENCE_LOW: otRoutePreference = -1; +pub const OT_ROUTE_PREFERENCE_LOW: otRoutePreference = -1; ///< Medium route preference. -pub const otRoutePreference_OT_ROUTE_PREFERENCE_MED: otRoutePreference = 0; +pub const OT_ROUTE_PREFERENCE_MED: otRoutePreference = 0; ///< High route preference. -pub const otRoutePreference_OT_ROUTE_PREFERENCE_HIGH: otRoutePreference = 1; +pub const OT_ROUTE_PREFERENCE_HIGH: otRoutePreference = 1; /// Defines valid values for `mPreference` in `otExternalRouteConfig` and `otBorderRouterConfig`. pub type otRoutePreference = ::core::ffi::c_int; /// Represents a Server configuration. @@ -11282,16 +11285,16 @@ unsafe extern "C" { /// @retval OT_ERROR_NOT_CAPABLE Not capable of resetting to bootloader. pub fn otPlatResetToBootloader(aInstance: *mut otInstance) -> otError; } -pub const otPlatResetReason_OT_PLAT_RESET_REASON_POWER_ON: otPlatResetReason = 0; -pub const otPlatResetReason_OT_PLAT_RESET_REASON_EXTERNAL: otPlatResetReason = 1; -pub const otPlatResetReason_OT_PLAT_RESET_REASON_SOFTWARE: otPlatResetReason = 2; -pub const otPlatResetReason_OT_PLAT_RESET_REASON_FAULT: otPlatResetReason = 3; -pub const otPlatResetReason_OT_PLAT_RESET_REASON_CRASH: otPlatResetReason = 4; -pub const otPlatResetReason_OT_PLAT_RESET_REASON_ASSERT: otPlatResetReason = 5; -pub const otPlatResetReason_OT_PLAT_RESET_REASON_OTHER: otPlatResetReason = 6; -pub const otPlatResetReason_OT_PLAT_RESET_REASON_UNKNOWN: otPlatResetReason = 7; -pub const otPlatResetReason_OT_PLAT_RESET_REASON_WATCHDOG: otPlatResetReason = 8; -pub const otPlatResetReason_OT_PLAT_RESET_REASON_COUNT: otPlatResetReason = 9; +pub const OT_PLAT_RESET_REASON_POWER_ON: otPlatResetReason = 0; +pub const OT_PLAT_RESET_REASON_EXTERNAL: otPlatResetReason = 1; +pub const OT_PLAT_RESET_REASON_SOFTWARE: otPlatResetReason = 2; +pub const OT_PLAT_RESET_REASON_FAULT: otPlatResetReason = 3; +pub const OT_PLAT_RESET_REASON_CRASH: otPlatResetReason = 4; +pub const OT_PLAT_RESET_REASON_ASSERT: otPlatResetReason = 5; +pub const OT_PLAT_RESET_REASON_OTHER: otPlatResetReason = 6; +pub const OT_PLAT_RESET_REASON_UNKNOWN: otPlatResetReason = 7; +pub const OT_PLAT_RESET_REASON_WATCHDOG: otPlatResetReason = 8; +pub const OT_PLAT_RESET_REASON_COUNT: otPlatResetReason = 9; /// Enumeration of possible reset reason codes. /// /// These are in the same order as the Spinel reset reason codes. @@ -11320,7 +11323,7 @@ unsafe extern "C" { /// external triggers. /// /// @note The `ON` power state only determines the MCU's power mode and is not related to radio's state. -pub const otPlatMcuPowerState_OT_PLAT_MCU_POWER_STATE_ON: otPlatMcuPowerState = 0; +pub const OT_PLAT_MCU_POWER_STATE_ON: otPlatMcuPowerState = 0; /// NCP's MCU can enter low-power (energy-saving) state. /// /// When the NCP's desired power state is set to `LOW_POWER`, host is expected to "poke" the NCP (e.g., an external @@ -11334,12 +11337,12 @@ pub const otPlatMcuPowerState_OT_PLAT_MCU_POWER_STATE_ON: otPlatMcuPowerState = /// /// @note The `LOW_POWER` power state only determines the MCU's power mode and is not related to radio's state /// (radio is managed by OpenThread core and device role, e.g., device being sleepy or not. -pub const otPlatMcuPowerState_OT_PLAT_MCU_POWER_STATE_LOW_POWER: otPlatMcuPowerState = 1; +pub const OT_PLAT_MCU_POWER_STATE_LOW_POWER: otPlatMcuPowerState = 1; /// NCP is fully off. /// /// An NCP hardware reset (via a RESET pin) is required to bring the NCP back to `SPINEL_MCU_POWER_STATE_ON`. /// RAM is not retained after reset. -pub const otPlatMcuPowerState_OT_PLAT_MCU_POWER_STATE_OFF: otPlatMcuPowerState = 2; +pub const OT_PLAT_MCU_POWER_STATE_OFF: otPlatMcuPowerState = 2; /// Enumeration of micro-controller's power states. /// /// These values are used for NCP configuration when `OPENTHREAD_CONFIG_NCP_ENABLE_MCU_POWER_STATE_CONTROL` is enabled. @@ -11614,51 +11617,51 @@ unsafe extern "C" { /// Represents the log level. pub type otLogLevel = ::core::ffi::c_int; ///< OpenThread API -pub const otLogRegion_OT_LOG_REGION_API: otLogRegion = 1; +pub const OT_LOG_REGION_API: otLogRegion = 1; ///< MLE -pub const otLogRegion_OT_LOG_REGION_MLE: otLogRegion = 2; +pub const OT_LOG_REGION_MLE: otLogRegion = 2; ///< EID-to-RLOC mapping. -pub const otLogRegion_OT_LOG_REGION_ARP: otLogRegion = 3; +pub const OT_LOG_REGION_ARP: otLogRegion = 3; ///< Network Data -pub const otLogRegion_OT_LOG_REGION_NET_DATA: otLogRegion = 4; +pub const OT_LOG_REGION_NET_DATA: otLogRegion = 4; ///< ICMPv6 -pub const otLogRegion_OT_LOG_REGION_ICMP: otLogRegion = 5; +pub const OT_LOG_REGION_ICMP: otLogRegion = 5; ///< IPv6 -pub const otLogRegion_OT_LOG_REGION_IP6: otLogRegion = 6; +pub const OT_LOG_REGION_IP6: otLogRegion = 6; ///< TCP -pub const otLogRegion_OT_LOG_REGION_TCP: otLogRegion = 7; +pub const OT_LOG_REGION_TCP: otLogRegion = 7; ///< IEEE 802.15.4 MAC -pub const otLogRegion_OT_LOG_REGION_MAC: otLogRegion = 8; +pub const OT_LOG_REGION_MAC: otLogRegion = 8; ///< Memory -pub const otLogRegion_OT_LOG_REGION_MEM: otLogRegion = 9; +pub const OT_LOG_REGION_MEM: otLogRegion = 9; ///< NCP -pub const otLogRegion_OT_LOG_REGION_NCP: otLogRegion = 10; +pub const OT_LOG_REGION_NCP: otLogRegion = 10; ///< Mesh Commissioning Protocol -pub const otLogRegion_OT_LOG_REGION_MESH_COP: otLogRegion = 11; +pub const OT_LOG_REGION_MESH_COP: otLogRegion = 11; ///< Network Diagnostic -pub const otLogRegion_OT_LOG_REGION_NET_DIAG: otLogRegion = 12; +pub const OT_LOG_REGION_NET_DIAG: otLogRegion = 12; ///< Platform -pub const otLogRegion_OT_LOG_REGION_PLATFORM: otLogRegion = 13; +pub const OT_LOG_REGION_PLATFORM: otLogRegion = 13; ///< CoAP -pub const otLogRegion_OT_LOG_REGION_COAP: otLogRegion = 14; +pub const OT_LOG_REGION_COAP: otLogRegion = 14; ///< CLI -pub const otLogRegion_OT_LOG_REGION_CLI: otLogRegion = 15; +pub const OT_LOG_REGION_CLI: otLogRegion = 15; ///< OpenThread Core -pub const otLogRegion_OT_LOG_REGION_CORE: otLogRegion = 16; +pub const OT_LOG_REGION_CORE: otLogRegion = 16; ///< Utility module -pub const otLogRegion_OT_LOG_REGION_UTIL: otLogRegion = 17; +pub const OT_LOG_REGION_UTIL: otLogRegion = 17; ///< Backbone Router (available since Thread 1.2) -pub const otLogRegion_OT_LOG_REGION_BBR: otLogRegion = 18; +pub const OT_LOG_REGION_BBR: otLogRegion = 18; ///< Multicast Listener Registration (available since Thread 1.2) -pub const otLogRegion_OT_LOG_REGION_MLR: otLogRegion = 19; +pub const OT_LOG_REGION_MLR: otLogRegion = 19; ///< Domain Unicast Address (available since Thread 1.2) -pub const otLogRegion_OT_LOG_REGION_DUA: otLogRegion = 20; +pub const OT_LOG_REGION_DUA: otLogRegion = 20; ///< Border Router -pub const otLogRegion_OT_LOG_REGION_BR: otLogRegion = 21; +pub const OT_LOG_REGION_BR: otLogRegion = 21; ///< Service Registration Protocol (SRP) -pub const otLogRegion_OT_LOG_REGION_SRP: otLogRegion = 22; +pub const OT_LOG_REGION_SRP: otLogRegion = 22; ///< DNS -pub const otLogRegion_OT_LOG_REGION_DNS: otLogRegion = 23; +pub const OT_LOG_REGION_DNS: otLogRegion = 23; /// Represents log regions. /// /// The support for log region is removed and instead each core module can define its own name to appended to the logs. @@ -11827,21 +11830,21 @@ unsafe extern "C" { pub fn otDnsIsNameCompressionEnabled() -> bool; } ///< Item to be added/registered. -pub const otSrpClientItemState_OT_SRP_CLIENT_ITEM_STATE_TO_ADD: otSrpClientItemState = 0; +pub const OT_SRP_CLIENT_ITEM_STATE_TO_ADD: otSrpClientItemState = 0; ///< Item is being added/registered. -pub const otSrpClientItemState_OT_SRP_CLIENT_ITEM_STATE_ADDING: otSrpClientItemState = 1; +pub const OT_SRP_CLIENT_ITEM_STATE_ADDING: otSrpClientItemState = 1; ///< Item to be refreshed (re-register to renew lease). -pub const otSrpClientItemState_OT_SRP_CLIENT_ITEM_STATE_TO_REFRESH: otSrpClientItemState = 2; +pub const OT_SRP_CLIENT_ITEM_STATE_TO_REFRESH: otSrpClientItemState = 2; ///< Item is being refreshed. -pub const otSrpClientItemState_OT_SRP_CLIENT_ITEM_STATE_REFRESHING: otSrpClientItemState = 3; +pub const OT_SRP_CLIENT_ITEM_STATE_REFRESHING: otSrpClientItemState = 3; ///< Item to be removed. -pub const otSrpClientItemState_OT_SRP_CLIENT_ITEM_STATE_TO_REMOVE: otSrpClientItemState = 4; +pub const OT_SRP_CLIENT_ITEM_STATE_TO_REMOVE: otSrpClientItemState = 4; ///< Item is being removed. -pub const otSrpClientItemState_OT_SRP_CLIENT_ITEM_STATE_REMOVING: otSrpClientItemState = 5; +pub const OT_SRP_CLIENT_ITEM_STATE_REMOVING: otSrpClientItemState = 5; ///< Item is registered with server. -pub const otSrpClientItemState_OT_SRP_CLIENT_ITEM_STATE_REGISTERED: otSrpClientItemState = 6; +pub const OT_SRP_CLIENT_ITEM_STATE_REGISTERED: otSrpClientItemState = 6; ///< Item is removed. -pub const otSrpClientItemState_OT_SRP_CLIENT_ITEM_STATE_REMOVED: otSrpClientItemState = 7; +pub const OT_SRP_CLIENT_ITEM_STATE_REMOVED: otSrpClientItemState = 7; /// Specifies an SRP client item (service or host info) state. pub type otSrpClientItemState = ::core::ffi::c_uint; /// Represents an SRP client host info. diff --git a/openthread-sys/src/include/thumbv6m-none-eabi.rs b/openthread-sys/src/include/thumbv6m-none-eabi.rs index bb4fc9c5..eaed96f6 100644 --- a/openthread-sys/src/include/thumbv6m-none-eabi.rs +++ b/openthread-sys/src/include/thumbv6m-none-eabi.rs @@ -1,4 +1,4 @@ -/* automatically generated by rust-bindgen 0.71.1 */ +/* automatically generated by rust-bindgen 0.72.1 */ #[repr(C)] #[derive(Copy, Clone, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)] @@ -36,7 +36,9 @@ where 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); + let byte = unsafe { + *(core::ptr::addr_of!((*this).storage) as *const u8).offset(byte_index as isize) + }; Self::extract_bit(byte, index) } #[inline] @@ -64,9 +66,10 @@ where 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); + let byte = unsafe { + (core::ptr::addr_of_mut!((*this).storage) as *mut u8).offset(byte_index as isize) + }; + unsafe { *byte = Self::change_bit(*byte, index, val) }; } #[inline] pub fn get(&self, bit_offset: usize, bit_width: u8) -> u64 { @@ -93,7 +96,7 @@ where 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) { + if unsafe { Self::raw_get_bit(this, i + bit_offset) } { let index = if cfg!(target_endian = "big") { bit_width as usize - 1 - i } else { @@ -133,7 +136,7 @@ where } else { i }; - Self::raw_set_bit(this, index + bit_offset, val_bit_is_set); + unsafe { Self::raw_set_bit(this, index + bit_offset, val_bit_is_set) }; } } } @@ -259,82 +262,82 @@ pub const OT_DNS_TXT_KEY_MIN_LENGTH: u32 = 1; pub const OT_DNS_TXT_KEY_MAX_LENGTH: u32 = 9; pub const OT_DNS_TXT_KEY_ITER_MAX_LENGTH: u32 = 64; /// No error. -pub const otError_OT_ERROR_NONE: otError = 0; +pub const OT_ERROR_NONE: otError = 0; /// Operational failed. -pub const otError_OT_ERROR_FAILED: otError = 1; +pub const OT_ERROR_FAILED: otError = 1; /// Message was dropped. -pub const otError_OT_ERROR_DROP: otError = 2; +pub const OT_ERROR_DROP: otError = 2; /// Insufficient buffers. -pub const otError_OT_ERROR_NO_BUFS: otError = 3; +pub const OT_ERROR_NO_BUFS: otError = 3; /// No route available. -pub const otError_OT_ERROR_NO_ROUTE: otError = 4; +pub const OT_ERROR_NO_ROUTE: otError = 4; /// Service is busy and could not service the operation. -pub const otError_OT_ERROR_BUSY: otError = 5; +pub const OT_ERROR_BUSY: otError = 5; /// Failed to parse message. -pub const otError_OT_ERROR_PARSE: otError = 6; +pub const OT_ERROR_PARSE: otError = 6; /// Input arguments are invalid. -pub const otError_OT_ERROR_INVALID_ARGS: otError = 7; +pub const OT_ERROR_INVALID_ARGS: otError = 7; /// Security checks failed. -pub const otError_OT_ERROR_SECURITY: otError = 8; +pub const OT_ERROR_SECURITY: otError = 8; /// Address resolution requires an address query operation. -pub const otError_OT_ERROR_ADDRESS_QUERY: otError = 9; +pub const OT_ERROR_ADDRESS_QUERY: otError = 9; /// Address is not in the source match table. -pub const otError_OT_ERROR_NO_ADDRESS: otError = 10; +pub const OT_ERROR_NO_ADDRESS: otError = 10; /// Operation was aborted. -pub const otError_OT_ERROR_ABORT: otError = 11; +pub const OT_ERROR_ABORT: otError = 11; /// Function or method is not implemented. -pub const otError_OT_ERROR_NOT_IMPLEMENTED: otError = 12; +pub const OT_ERROR_NOT_IMPLEMENTED: otError = 12; /// Cannot complete due to invalid state. -pub const otError_OT_ERROR_INVALID_STATE: otError = 13; +pub const OT_ERROR_INVALID_STATE: otError = 13; /// No acknowledgment was received after macMaxFrameRetries (IEEE 802.15.4-2006). -pub const otError_OT_ERROR_NO_ACK: otError = 14; +pub const OT_ERROR_NO_ACK: otError = 14; /// A transmission could not take place due to activity on the channel, i.e., the CSMA-CA mechanism has failed /// (IEEE 802.15.4-2006). -pub const otError_OT_ERROR_CHANNEL_ACCESS_FAILURE: otError = 15; +pub const OT_ERROR_CHANNEL_ACCESS_FAILURE: otError = 15; /// Not currently attached to a Thread Partition. -pub const otError_OT_ERROR_DETACHED: otError = 16; +pub const OT_ERROR_DETACHED: otError = 16; /// FCS check failure while receiving. -pub const otError_OT_ERROR_FCS: otError = 17; +pub const OT_ERROR_FCS: otError = 17; /// No frame received. -pub const otError_OT_ERROR_NO_FRAME_RECEIVED: otError = 18; +pub const OT_ERROR_NO_FRAME_RECEIVED: otError = 18; /// Received a frame from an unknown neighbor. -pub const otError_OT_ERROR_UNKNOWN_NEIGHBOR: otError = 19; +pub const OT_ERROR_UNKNOWN_NEIGHBOR: otError = 19; /// Received a frame from an invalid source address. -pub const otError_OT_ERROR_INVALID_SOURCE_ADDRESS: otError = 20; +pub const OT_ERROR_INVALID_SOURCE_ADDRESS: otError = 20; /// Received a frame filtered by the address filter (allowlisted or denylisted). -pub const otError_OT_ERROR_ADDRESS_FILTERED: otError = 21; +pub const OT_ERROR_ADDRESS_FILTERED: otError = 21; /// Received a frame filtered by the destination address check. -pub const otError_OT_ERROR_DESTINATION_ADDRESS_FILTERED: otError = 22; +pub const OT_ERROR_DESTINATION_ADDRESS_FILTERED: otError = 22; /// The requested item could not be found. -pub const otError_OT_ERROR_NOT_FOUND: otError = 23; +pub const OT_ERROR_NOT_FOUND: otError = 23; /// The operation is already in progress. -pub const otError_OT_ERROR_ALREADY: otError = 24; +pub const OT_ERROR_ALREADY: otError = 24; /// The creation of IPv6 address failed. -pub const otError_OT_ERROR_IP6_ADDRESS_CREATION_FAILURE: otError = 26; +pub const OT_ERROR_IP6_ADDRESS_CREATION_FAILURE: otError = 26; /// Operation prevented by mode flags -pub const otError_OT_ERROR_NOT_CAPABLE: otError = 27; +pub const OT_ERROR_NOT_CAPABLE: otError = 27; /// Coap response or acknowledgment or DNS, SNTP response not received. -pub const otError_OT_ERROR_RESPONSE_TIMEOUT: otError = 28; +pub const OT_ERROR_RESPONSE_TIMEOUT: otError = 28; /// Received a duplicated frame. -pub const otError_OT_ERROR_DUPLICATED: otError = 29; +pub const OT_ERROR_DUPLICATED: otError = 29; /// Message is being dropped from reassembly list due to timeout. -pub const otError_OT_ERROR_REASSEMBLY_TIMEOUT: otError = 30; +pub const OT_ERROR_REASSEMBLY_TIMEOUT: otError = 30; /// Message is not a TMF Message. -pub const otError_OT_ERROR_NOT_TMF: otError = 31; +pub const OT_ERROR_NOT_TMF: otError = 31; /// Received a non-lowpan data frame. -pub const otError_OT_ERROR_NOT_LOWPAN_DATA_FRAME: otError = 32; +pub const OT_ERROR_NOT_LOWPAN_DATA_FRAME: otError = 32; /// The link margin was too low. -pub const otError_OT_ERROR_LINK_MARGIN_LOW: otError = 34; +pub const OT_ERROR_LINK_MARGIN_LOW: otError = 34; /// Input (CLI) command is invalid. -pub const otError_OT_ERROR_INVALID_COMMAND: otError = 35; +pub const OT_ERROR_INVALID_COMMAND: otError = 35; /// Special error code used to indicate success/error status is pending and not yet known. -pub const otError_OT_ERROR_PENDING: otError = 36; +pub const OT_ERROR_PENDING: otError = 36; /// Request rejected. -pub const otError_OT_ERROR_REJECTED: otError = 37; +pub const OT_ERROR_REJECTED: otError = 37; /// The number of defined errors. -pub const otError_OT_NUM_ERRORS: otError = 38; +pub const OT_NUM_ERRORS: otError = 38; /// Generic error (should not use). -pub const otError_OT_ERROR_GENERIC: otError = 255; +pub const OT_ERROR_GENERIC: otError = 255; /// Represents error codes used throughout OpenThread. pub type otError = ::core::ffi::c_uchar; unsafe extern "C" { @@ -573,19 +576,19 @@ pub struct otMessage { _unused: [u8; 0], } ///< Low priority level. -pub const otMessagePriority_OT_MESSAGE_PRIORITY_LOW: otMessagePriority = 0; +pub const OT_MESSAGE_PRIORITY_LOW: otMessagePriority = 0; ///< Normal priority level. -pub const otMessagePriority_OT_MESSAGE_PRIORITY_NORMAL: otMessagePriority = 1; +pub const OT_MESSAGE_PRIORITY_NORMAL: otMessagePriority = 1; ///< High priority level. -pub const otMessagePriority_OT_MESSAGE_PRIORITY_HIGH: otMessagePriority = 2; +pub const OT_MESSAGE_PRIORITY_HIGH: otMessagePriority = 2; /// Defines the OpenThread message priority levels. pub type otMessagePriority = ::core::ffi::c_uchar; ///< Message from Thread Netif. -pub const otMessageOrigin_OT_MESSAGE_ORIGIN_THREAD_NETIF: otMessageOrigin = 0; +pub const OT_MESSAGE_ORIGIN_THREAD_NETIF: otMessageOrigin = 0; ///< Message from a trusted source on host. -pub const otMessageOrigin_OT_MESSAGE_ORIGIN_HOST_TRUSTED: otMessageOrigin = 1; +pub const OT_MESSAGE_ORIGIN_HOST_TRUSTED: otMessageOrigin = 1; ///< Message from an untrusted source on host. -pub const otMessageOrigin_OT_MESSAGE_ORIGIN_HOST_UNTRUSTED: otMessageOrigin = 2; +pub const OT_MESSAGE_ORIGIN_HOST_UNTRUSTED: otMessageOrigin = 2; /// Defines the OpenThread message origins. pub type otMessageOrigin = ::core::ffi::c_uchar; /// Represents a message settings. @@ -2594,13 +2597,13 @@ pub type otUdpReceive = ::core::option::Option< ), >; ///< Unspecified network interface. -pub const otNetifIdentifier_OT_NETIF_UNSPECIFIED: otNetifIdentifier = 0; +pub const OT_NETIF_UNSPECIFIED: otNetifIdentifier = 0; ///< The host Thread interface - allow use of platform UDP. -pub const otNetifIdentifier_OT_NETIF_THREAD_HOST: otNetifIdentifier = 1; +pub const OT_NETIF_THREAD_HOST: otNetifIdentifier = 1; ///< The internal Thread interface (within OpenThread) - do not use platform UDP. -pub const otNetifIdentifier_OT_NETIF_THREAD_INTERNAL: otNetifIdentifier = 2; +pub const OT_NETIF_THREAD_INTERNAL: otNetifIdentifier = 2; ///< The Backbone interface. -pub const otNetifIdentifier_OT_NETIF_BACKBONE: otNetifIdentifier = 3; +pub const OT_NETIF_BACKBONE: otNetifIdentifier = 3; /// Defines the OpenThread network interface identifiers. pub type otNetifIdentifier = ::core::ffi::c_uchar; /// Represents a UDP socket. @@ -2803,23 +2806,23 @@ unsafe extern "C" { pub fn otUdpIsPortInUse(aInstance: *mut otInstance, port: u16) -> bool; } ///< Key Type: Raw Data. -pub const otCryptoKeyType_OT_CRYPTO_KEY_TYPE_RAW: otCryptoKeyType = 0; +pub const OT_CRYPTO_KEY_TYPE_RAW: otCryptoKeyType = 0; ///< Key Type: AES. -pub const otCryptoKeyType_OT_CRYPTO_KEY_TYPE_AES: otCryptoKeyType = 1; +pub const OT_CRYPTO_KEY_TYPE_AES: otCryptoKeyType = 1; ///< Key Type: HMAC. -pub const otCryptoKeyType_OT_CRYPTO_KEY_TYPE_HMAC: otCryptoKeyType = 2; +pub const OT_CRYPTO_KEY_TYPE_HMAC: otCryptoKeyType = 2; ///< Key Type: ECDSA. -pub const otCryptoKeyType_OT_CRYPTO_KEY_TYPE_ECDSA: otCryptoKeyType = 3; +pub const OT_CRYPTO_KEY_TYPE_ECDSA: otCryptoKeyType = 3; /// Defines the key types. pub type otCryptoKeyType = ::core::ffi::c_uchar; ///< Key Algorithm: Vendor Defined. -pub const otCryptoKeyAlgorithm_OT_CRYPTO_KEY_ALG_VENDOR: otCryptoKeyAlgorithm = 0; +pub const OT_CRYPTO_KEY_ALG_VENDOR: otCryptoKeyAlgorithm = 0; ///< Key Algorithm: AES ECB. -pub const otCryptoKeyAlgorithm_OT_CRYPTO_KEY_ALG_AES_ECB: otCryptoKeyAlgorithm = 1; +pub const OT_CRYPTO_KEY_ALG_AES_ECB: otCryptoKeyAlgorithm = 1; ///< Key Algorithm: HMAC SHA-256. -pub const otCryptoKeyAlgorithm_OT_CRYPTO_KEY_ALG_HMAC_SHA_256: otCryptoKeyAlgorithm = 2; +pub const OT_CRYPTO_KEY_ALG_HMAC_SHA_256: otCryptoKeyAlgorithm = 2; ///< Key Algorithm: ECDSA. -pub const otCryptoKeyAlgorithm_OT_CRYPTO_KEY_ALG_ECDSA: otCryptoKeyAlgorithm = 3; +pub const OT_CRYPTO_KEY_ALG_ECDSA: otCryptoKeyAlgorithm = 3; /// Defines the key algorithms. pub type otCryptoKeyAlgorithm = ::core::ffi::c_uchar; ///< Key Usage: Key Usage is empty. @@ -2837,9 +2840,9 @@ pub const OT_CRYPTO_KEY_USAGE_VERIFY_HASH: _bindgen_ty_4 = 16; /// Defines the key usage flags. pub type _bindgen_ty_4 = ::core::ffi::c_uchar; ///< Key Persistence: Key is volatile. -pub const otCryptoKeyStorage_OT_CRYPTO_KEY_STORAGE_VOLATILE: otCryptoKeyStorage = 0; +pub const OT_CRYPTO_KEY_STORAGE_VOLATILE: otCryptoKeyStorage = 0; ///< Key Persistence: Key is persistent. -pub const otCryptoKeyStorage_OT_CRYPTO_KEY_STORAGE_PERSISTENT: otCryptoKeyStorage = 1; +pub const OT_CRYPTO_KEY_STORAGE_PERSISTENT: otCryptoKeyStorage = 1; /// Defines the key storage types. pub type otCryptoKeyStorage = ::core::ffi::c_uchar; /// This datatype represents the key reference. @@ -3623,9 +3626,9 @@ impl Default for otMacKeyMaterial { } } ///< Use Literal Keys. -pub const otRadioKeyType_OT_KEY_TYPE_LITERAL_KEY: otRadioKeyType = 0; +pub const OT_KEY_TYPE_LITERAL_KEY: otRadioKeyType = 0; ///< Use Reference to Key. -pub const otRadioKeyType_OT_KEY_TYPE_KEY_REF: otRadioKeyType = 1; +pub const OT_KEY_TYPE_KEY_REF: otRadioKeyType = 1; /// Defines constants about key types. pub type otRadioKeyType = ::core::ffi::c_uchar; /// Represents the IEEE 802.15.4 Header IE (Information Element) related information of a radio frame. @@ -4068,11 +4071,11 @@ impl Default for otRadioFrame { } } } -pub const otRadioState_OT_RADIO_STATE_DISABLED: otRadioState = 0; -pub const otRadioState_OT_RADIO_STATE_SLEEP: otRadioState = 1; -pub const otRadioState_OT_RADIO_STATE_RECEIVE: otRadioState = 2; -pub const otRadioState_OT_RADIO_STATE_TRANSMIT: otRadioState = 3; -pub const otRadioState_OT_RADIO_STATE_INVALID: otRadioState = 255; +pub const OT_RADIO_STATE_DISABLED: otRadioState = 0; +pub const OT_RADIO_STATE_SLEEP: otRadioState = 1; +pub const OT_RADIO_STATE_RECEIVE: otRadioState = 2; +pub const OT_RADIO_STATE_TRANSMIT: otRadioState = 3; +pub const OT_RADIO_STATE_INVALID: otRadioState = 255; /// Represents the state of a radio. /// Initially, a radio is in the Disabled state. pub type otRadioState = ::core::ffi::c_uchar; @@ -5802,89 +5805,89 @@ impl Default for otOperationalDatasetTlvs { } } ///< meshcop Channel TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_CHANNEL: otMeshcopTlvType = 0; +pub const OT_MESHCOP_TLV_CHANNEL: otMeshcopTlvType = 0; ///< meshcop Pan Id TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_PANID: otMeshcopTlvType = 1; +pub const OT_MESHCOP_TLV_PANID: otMeshcopTlvType = 1; ///< meshcop Extended Pan Id TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_EXTPANID: otMeshcopTlvType = 2; +pub const OT_MESHCOP_TLV_EXTPANID: otMeshcopTlvType = 2; ///< meshcop Network Name TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_NETWORKNAME: otMeshcopTlvType = 3; +pub const OT_MESHCOP_TLV_NETWORKNAME: otMeshcopTlvType = 3; ///< meshcop PSKc TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_PSKC: otMeshcopTlvType = 4; +pub const OT_MESHCOP_TLV_PSKC: otMeshcopTlvType = 4; ///< meshcop Network Key TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_NETWORKKEY: otMeshcopTlvType = 5; +pub const OT_MESHCOP_TLV_NETWORKKEY: otMeshcopTlvType = 5; ///< meshcop Network Key Sequence TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_NETWORK_KEY_SEQUENCE: otMeshcopTlvType = 6; +pub const OT_MESHCOP_TLV_NETWORK_KEY_SEQUENCE: otMeshcopTlvType = 6; ///< meshcop Mesh Local Prefix TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_MESHLOCALPREFIX: otMeshcopTlvType = 7; +pub const OT_MESHCOP_TLV_MESHLOCALPREFIX: otMeshcopTlvType = 7; ///< meshcop Steering Data TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_STEERING_DATA: otMeshcopTlvType = 8; +pub const OT_MESHCOP_TLV_STEERING_DATA: otMeshcopTlvType = 8; ///< meshcop Border Agent Locator TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_BORDER_AGENT_RLOC: otMeshcopTlvType = 9; +pub const OT_MESHCOP_TLV_BORDER_AGENT_RLOC: otMeshcopTlvType = 9; ///< meshcop Commissioner ID TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_COMMISSIONER_ID: otMeshcopTlvType = 10; +pub const OT_MESHCOP_TLV_COMMISSIONER_ID: otMeshcopTlvType = 10; ///< meshcop Commissioner Session ID TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_COMM_SESSION_ID: otMeshcopTlvType = 11; +pub const OT_MESHCOP_TLV_COMM_SESSION_ID: otMeshcopTlvType = 11; ///< meshcop Security Policy TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_SECURITYPOLICY: otMeshcopTlvType = 12; +pub const OT_MESHCOP_TLV_SECURITYPOLICY: otMeshcopTlvType = 12; ///< meshcop Get TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_GET: otMeshcopTlvType = 13; +pub const OT_MESHCOP_TLV_GET: otMeshcopTlvType = 13; ///< meshcop Active Timestamp TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_ACTIVETIMESTAMP: otMeshcopTlvType = 14; +pub const OT_MESHCOP_TLV_ACTIVETIMESTAMP: otMeshcopTlvType = 14; ///< meshcop Commissioner UDP Port TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_COMMISSIONER_UDP_PORT: otMeshcopTlvType = 15; +pub const OT_MESHCOP_TLV_COMMISSIONER_UDP_PORT: otMeshcopTlvType = 15; ///< meshcop State TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_STATE: otMeshcopTlvType = 16; +pub const OT_MESHCOP_TLV_STATE: otMeshcopTlvType = 16; ///< meshcop Joiner DTLS Encapsulation TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_JOINER_DTLS: otMeshcopTlvType = 17; +pub const OT_MESHCOP_TLV_JOINER_DTLS: otMeshcopTlvType = 17; ///< meshcop Joiner UDP Port TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_JOINER_UDP_PORT: otMeshcopTlvType = 18; +pub const OT_MESHCOP_TLV_JOINER_UDP_PORT: otMeshcopTlvType = 18; ///< meshcop Joiner IID TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_JOINER_IID: otMeshcopTlvType = 19; +pub const OT_MESHCOP_TLV_JOINER_IID: otMeshcopTlvType = 19; ///< meshcop Joiner Router Locator TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_JOINER_RLOC: otMeshcopTlvType = 20; +pub const OT_MESHCOP_TLV_JOINER_RLOC: otMeshcopTlvType = 20; ///< meshcop Joiner Router KEK TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_JOINER_ROUTER_KEK: otMeshcopTlvType = 21; +pub const OT_MESHCOP_TLV_JOINER_ROUTER_KEK: otMeshcopTlvType = 21; ///< meshcop Provisioning URL TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_PROVISIONING_URL: otMeshcopTlvType = 32; +pub const OT_MESHCOP_TLV_PROVISIONING_URL: otMeshcopTlvType = 32; ///< meshcop Vendor Name TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_VENDOR_NAME_TLV: otMeshcopTlvType = 33; +pub const OT_MESHCOP_TLV_VENDOR_NAME_TLV: otMeshcopTlvType = 33; ///< meshcop Vendor Model TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_VENDOR_MODEL_TLV: otMeshcopTlvType = 34; +pub const OT_MESHCOP_TLV_VENDOR_MODEL_TLV: otMeshcopTlvType = 34; ///< meshcop Vendor SW Version TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_VENDOR_SW_VERSION_TLV: otMeshcopTlvType = 35; +pub const OT_MESHCOP_TLV_VENDOR_SW_VERSION_TLV: otMeshcopTlvType = 35; ///< meshcop Vendor Data TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_VENDOR_DATA_TLV: otMeshcopTlvType = 36; +pub const OT_MESHCOP_TLV_VENDOR_DATA_TLV: otMeshcopTlvType = 36; ///< meshcop Vendor Stack Version TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_VENDOR_STACK_VERSION_TLV: otMeshcopTlvType = 37; +pub const OT_MESHCOP_TLV_VENDOR_STACK_VERSION_TLV: otMeshcopTlvType = 37; ///< meshcop UDP encapsulation TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_UDP_ENCAPSULATION_TLV: otMeshcopTlvType = 48; +pub const OT_MESHCOP_TLV_UDP_ENCAPSULATION_TLV: otMeshcopTlvType = 48; ///< meshcop IPv6 address TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_IPV6_ADDRESS_TLV: otMeshcopTlvType = 49; +pub const OT_MESHCOP_TLV_IPV6_ADDRESS_TLV: otMeshcopTlvType = 49; ///< meshcop Pending Timestamp TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_PENDINGTIMESTAMP: otMeshcopTlvType = 51; +pub const OT_MESHCOP_TLV_PENDINGTIMESTAMP: otMeshcopTlvType = 51; ///< meshcop Delay Timer TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_DELAYTIMER: otMeshcopTlvType = 52; +pub const OT_MESHCOP_TLV_DELAYTIMER: otMeshcopTlvType = 52; ///< meshcop Channel Mask TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_CHANNELMASK: otMeshcopTlvType = 53; +pub const OT_MESHCOP_TLV_CHANNELMASK: otMeshcopTlvType = 53; ///< meshcop Count TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_COUNT: otMeshcopTlvType = 54; +pub const OT_MESHCOP_TLV_COUNT: otMeshcopTlvType = 54; ///< meshcop Period TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_PERIOD: otMeshcopTlvType = 55; +pub const OT_MESHCOP_TLV_PERIOD: otMeshcopTlvType = 55; ///< meshcop Scan Duration TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_SCAN_DURATION: otMeshcopTlvType = 56; +pub const OT_MESHCOP_TLV_SCAN_DURATION: otMeshcopTlvType = 56; ///< meshcop Energy List TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_ENERGY_LIST: otMeshcopTlvType = 57; +pub const OT_MESHCOP_TLV_ENERGY_LIST: otMeshcopTlvType = 57; ///< meshcop Thread Domain Name TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_THREAD_DOMAIN_NAME: otMeshcopTlvType = 59; +pub const OT_MESHCOP_TLV_THREAD_DOMAIN_NAME: otMeshcopTlvType = 59; ///< meshcop Wake-up Channel TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_WAKEUP_CHANNEL: otMeshcopTlvType = 74; +pub const OT_MESHCOP_TLV_WAKEUP_CHANNEL: otMeshcopTlvType = 74; ///< meshcop Discovery Request TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_DISCOVERYREQUEST: otMeshcopTlvType = 128; +pub const OT_MESHCOP_TLV_DISCOVERYREQUEST: otMeshcopTlvType = 128; ///< meshcop Discovery Response TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_DISCOVERYRESPONSE: otMeshcopTlvType = 129; +pub const OT_MESHCOP_TLV_DISCOVERYRESPONSE: otMeshcopTlvType = 129; ///< meshcop Joiner Advertisement TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_JOINERADVERTISEMENT: otMeshcopTlvType = 241; +pub const OT_MESHCOP_TLV_JOINERADVERTISEMENT: otMeshcopTlvType = 241; /// Represents meshcop TLV types. pub type otMeshcopTlvType = ::core::ffi::c_uchar; /// Pointer is called when a response to a MGMT_SET request is received or times out. @@ -6202,12 +6205,12 @@ unsafe extern "C" { aDatasetTlvs: *mut otOperationalDatasetTlvs, ) -> otError; } -pub const otJoinerState_OT_JOINER_STATE_IDLE: otJoinerState = 0; -pub const otJoinerState_OT_JOINER_STATE_DISCOVER: otJoinerState = 1; -pub const otJoinerState_OT_JOINER_STATE_CONNECT: otJoinerState = 2; -pub const otJoinerState_OT_JOINER_STATE_CONNECTED: otJoinerState = 3; -pub const otJoinerState_OT_JOINER_STATE_ENTRUST: otJoinerState = 4; -pub const otJoinerState_OT_JOINER_STATE_JOINED: otJoinerState = 5; +pub const OT_JOINER_STATE_IDLE: otJoinerState = 0; +pub const OT_JOINER_STATE_DISCOVER: otJoinerState = 1; +pub const OT_JOINER_STATE_CONNECT: otJoinerState = 2; +pub const OT_JOINER_STATE_CONNECTED: otJoinerState = 3; +pub const OT_JOINER_STATE_ENTRUST: otJoinerState = 4; +pub const OT_JOINER_STATE_JOINED: otJoinerState = 5; /// Defines the Joiner State. pub type otJoinerState = ::core::ffi::c_uchar; /// Represents a Joiner Discerner. @@ -6320,18 +6323,18 @@ unsafe extern "C" { pub fn otJoinerStateToString(aState: otJoinerState) -> *const ::core::ffi::c_char; } ///< Commissioner role is disabled. -pub const otCommissionerState_OT_COMMISSIONER_STATE_DISABLED: otCommissionerState = 0; +pub const OT_COMMISSIONER_STATE_DISABLED: otCommissionerState = 0; ///< Currently petitioning to become a Commissioner. -pub const otCommissionerState_OT_COMMISSIONER_STATE_PETITION: otCommissionerState = 1; +pub const OT_COMMISSIONER_STATE_PETITION: otCommissionerState = 1; ///< Commissioner role is active. -pub const otCommissionerState_OT_COMMISSIONER_STATE_ACTIVE: otCommissionerState = 2; +pub const OT_COMMISSIONER_STATE_ACTIVE: otCommissionerState = 2; /// Defines the Commissioner State. pub type otCommissionerState = ::core::ffi::c_uchar; -pub const otCommissionerJoinerEvent_OT_COMMISSIONER_JOINER_START: otCommissionerJoinerEvent = 0; -pub const otCommissionerJoinerEvent_OT_COMMISSIONER_JOINER_CONNECTED: otCommissionerJoinerEvent = 1; -pub const otCommissionerJoinerEvent_OT_COMMISSIONER_JOINER_FINALIZE: otCommissionerJoinerEvent = 2; -pub const otCommissionerJoinerEvent_OT_COMMISSIONER_JOINER_END: otCommissionerJoinerEvent = 3; -pub const otCommissionerJoinerEvent_OT_COMMISSIONER_JOINER_REMOVED: otCommissionerJoinerEvent = 4; +pub const OT_COMMISSIONER_JOINER_START: otCommissionerJoinerEvent = 0; +pub const OT_COMMISSIONER_JOINER_CONNECTED: otCommissionerJoinerEvent = 1; +pub const OT_COMMISSIONER_JOINER_FINALIZE: otCommissionerJoinerEvent = 2; +pub const OT_COMMISSIONER_JOINER_END: otCommissionerJoinerEvent = 3; +pub const OT_COMMISSIONER_JOINER_REMOVED: otCommissionerJoinerEvent = 4; /// Defines a Joiner Event on the Commissioner. pub type otCommissionerJoinerEvent = ::core::ffi::c_uchar; /// Represents the steering data. @@ -6574,11 +6577,11 @@ impl Default for otJoinerPskd { } } ///< Accept any Joiner (no EUI64 or Discerner is specified). -pub const otJoinerInfoType_OT_JOINER_INFO_TYPE_ANY: otJoinerInfoType = 0; +pub const OT_JOINER_INFO_TYPE_ANY: otJoinerInfoType = 0; ///< Joiner EUI-64 is specified (`mSharedId.mEui64` in `otJoinerInfo`). -pub const otJoinerInfoType_OT_JOINER_INFO_TYPE_EUI64: otJoinerInfoType = 1; +pub const OT_JOINER_INFO_TYPE_EUI64: otJoinerInfoType = 1; ///< Joiner Discerner is specified (`mSharedId.mDiscerner` in `otJoinerInfo`). -pub const otJoinerInfoType_OT_JOINER_INFO_TYPE_DISCERNER: otJoinerInfoType = 2; +pub const OT_JOINER_INFO_TYPE_DISCERNER: otJoinerInfoType = 2; /// Defines a Joiner Info Type. pub type otJoinerInfoType = ::core::ffi::c_uchar; /// Represents a Joiner Info. @@ -6954,11 +6957,11 @@ unsafe extern "C" { } pub type otMacFilterIterator = u8; ///< Address filter is disabled. -pub const otMacFilterAddressMode_OT_MAC_FILTER_ADDRESS_MODE_DISABLED: otMacFilterAddressMode = 0; +pub const OT_MAC_FILTER_ADDRESS_MODE_DISABLED: otMacFilterAddressMode = 0; ///< Allowlist address filter mode is enabled. -pub const otMacFilterAddressMode_OT_MAC_FILTER_ADDRESS_MODE_ALLOWLIST: otMacFilterAddressMode = 1; +pub const OT_MAC_FILTER_ADDRESS_MODE_ALLOWLIST: otMacFilterAddressMode = 1; ///< Denylist address filter mode is enabled. -pub const otMacFilterAddressMode_OT_MAC_FILTER_ADDRESS_MODE_DENYLIST: otMacFilterAddressMode = 2; +pub const OT_MAC_FILTER_ADDRESS_MODE_DENYLIST: otMacFilterAddressMode = 2; /// Defines address mode of the mac filter. pub type otMacFilterAddressMode = ::core::ffi::c_uchar; /// Represents a Mac Filter entry. @@ -8119,15 +8122,15 @@ unsafe extern "C" { pub fn otLinkSetRxOnWhenIdle(aInstance: *mut otInstance, aRxOnWhenIdle: bool) -> otError; } ///< The Thread stack is disabled. -pub const otDeviceRole_OT_DEVICE_ROLE_DISABLED: otDeviceRole = 0; +pub const OT_DEVICE_ROLE_DISABLED: otDeviceRole = 0; ///< Not currently participating in a Thread network/partition. -pub const otDeviceRole_OT_DEVICE_ROLE_DETACHED: otDeviceRole = 1; +pub const OT_DEVICE_ROLE_DETACHED: otDeviceRole = 1; ///< The Thread Child role. -pub const otDeviceRole_OT_DEVICE_ROLE_CHILD: otDeviceRole = 2; +pub const OT_DEVICE_ROLE_CHILD: otDeviceRole = 2; ///< The Thread Router role. -pub const otDeviceRole_OT_DEVICE_ROLE_ROUTER: otDeviceRole = 3; +pub const OT_DEVICE_ROLE_ROUTER: otDeviceRole = 3; ///< The Thread Leader role. -pub const otDeviceRole_OT_DEVICE_ROLE_LEADER: otDeviceRole = 4; +pub const OT_DEVICE_ROLE_LEADER: otDeviceRole = 4; /// Represents a Thread device role. pub type otDeviceRole = ::core::ffi::c_uchar; /// Represents an MLE Link Mode configuration. @@ -9797,14 +9800,14 @@ pub struct otNat64ProtocolCounters { pub mTcp: otNat64Counters, } ///< Packet drop for unknown reasons. -pub const otNat64DropReason_OT_NAT64_DROP_REASON_UNKNOWN: otNat64DropReason = 0; +pub const OT_NAT64_DROP_REASON_UNKNOWN: otNat64DropReason = 0; ///< Packet drop due to failed to parse the datagram. -pub const otNat64DropReason_OT_NAT64_DROP_REASON_ILLEGAL_PACKET: otNat64DropReason = 1; +pub const OT_NAT64_DROP_REASON_ILLEGAL_PACKET: otNat64DropReason = 1; ///< Packet drop due to unsupported IP protocol. -pub const otNat64DropReason_OT_NAT64_DROP_REASON_UNSUPPORTED_PROTO: otNat64DropReason = 2; +pub const OT_NAT64_DROP_REASON_UNSUPPORTED_PROTO: otNat64DropReason = 2; ///< Packet drop due to no mappings found or mapping pool exhausted. -pub const otNat64DropReason_OT_NAT64_DROP_REASON_NO_MAPPING: otNat64DropReason = 3; -pub const otNat64DropReason_OT_NAT64_DROP_REASON_COUNT: otNat64DropReason = 4; +pub const OT_NAT64_DROP_REASON_NO_MAPPING: otNat64DropReason = 3; +pub const OT_NAT64_DROP_REASON_COUNT: otNat64DropReason = 4; /// Packet drop reasons. pub type otNat64DropReason = ::core::ffi::c_uchar; /// Represents the counters of dropped packets due to errors when handling NAT64 packets. @@ -9927,13 +9930,13 @@ unsafe extern "C" { ) -> otError; } ///< NAT64 is disabled. -pub const otNat64State_OT_NAT64_STATE_DISABLED: otNat64State = 0; +pub const OT_NAT64_STATE_DISABLED: otNat64State = 0; ///< NAT64 is enabled, but one or more dependencies of NAT64 are not running. -pub const otNat64State_OT_NAT64_STATE_NOT_RUNNING: otNat64State = 1; +pub const OT_NAT64_STATE_NOT_RUNNING: otNat64State = 1; ///< NAT64 is enabled, but this BR is not an active NAT64 BR. -pub const otNat64State_OT_NAT64_STATE_IDLE: otNat64State = 2; +pub const OT_NAT64_STATE_IDLE: otNat64State = 2; ///< The BR is publishing a NAT64 prefix and/or translating packets. -pub const otNat64State_OT_NAT64_STATE_ACTIVE: otNat64State = 3; +pub const OT_NAT64_STATE_ACTIVE: otNat64State = 3; /// States of NAT64. pub type otNat64State = ::core::ffi::c_uchar; unsafe extern "C" { @@ -10954,11 +10957,11 @@ impl otExternalRouteConfig { } } ///< Low route preference. -pub const otRoutePreference_OT_ROUTE_PREFERENCE_LOW: otRoutePreference = -1; +pub const OT_ROUTE_PREFERENCE_LOW: otRoutePreference = -1; ///< Medium route preference. -pub const otRoutePreference_OT_ROUTE_PREFERENCE_MED: otRoutePreference = 0; +pub const OT_ROUTE_PREFERENCE_MED: otRoutePreference = 0; ///< High route preference. -pub const otRoutePreference_OT_ROUTE_PREFERENCE_HIGH: otRoutePreference = 1; +pub const OT_ROUTE_PREFERENCE_HIGH: otRoutePreference = 1; /// Defines valid values for `mPreference` in `otExternalRouteConfig` and `otBorderRouterConfig`. pub type otRoutePreference = ::core::ffi::c_schar; /// Represents a Server configuration. @@ -11282,16 +11285,16 @@ unsafe extern "C" { /// @retval OT_ERROR_NOT_CAPABLE Not capable of resetting to bootloader. pub fn otPlatResetToBootloader(aInstance: *mut otInstance) -> otError; } -pub const otPlatResetReason_OT_PLAT_RESET_REASON_POWER_ON: otPlatResetReason = 0; -pub const otPlatResetReason_OT_PLAT_RESET_REASON_EXTERNAL: otPlatResetReason = 1; -pub const otPlatResetReason_OT_PLAT_RESET_REASON_SOFTWARE: otPlatResetReason = 2; -pub const otPlatResetReason_OT_PLAT_RESET_REASON_FAULT: otPlatResetReason = 3; -pub const otPlatResetReason_OT_PLAT_RESET_REASON_CRASH: otPlatResetReason = 4; -pub const otPlatResetReason_OT_PLAT_RESET_REASON_ASSERT: otPlatResetReason = 5; -pub const otPlatResetReason_OT_PLAT_RESET_REASON_OTHER: otPlatResetReason = 6; -pub const otPlatResetReason_OT_PLAT_RESET_REASON_UNKNOWN: otPlatResetReason = 7; -pub const otPlatResetReason_OT_PLAT_RESET_REASON_WATCHDOG: otPlatResetReason = 8; -pub const otPlatResetReason_OT_PLAT_RESET_REASON_COUNT: otPlatResetReason = 9; +pub const OT_PLAT_RESET_REASON_POWER_ON: otPlatResetReason = 0; +pub const OT_PLAT_RESET_REASON_EXTERNAL: otPlatResetReason = 1; +pub const OT_PLAT_RESET_REASON_SOFTWARE: otPlatResetReason = 2; +pub const OT_PLAT_RESET_REASON_FAULT: otPlatResetReason = 3; +pub const OT_PLAT_RESET_REASON_CRASH: otPlatResetReason = 4; +pub const OT_PLAT_RESET_REASON_ASSERT: otPlatResetReason = 5; +pub const OT_PLAT_RESET_REASON_OTHER: otPlatResetReason = 6; +pub const OT_PLAT_RESET_REASON_UNKNOWN: otPlatResetReason = 7; +pub const OT_PLAT_RESET_REASON_WATCHDOG: otPlatResetReason = 8; +pub const OT_PLAT_RESET_REASON_COUNT: otPlatResetReason = 9; /// Enumeration of possible reset reason codes. /// /// These are in the same order as the Spinel reset reason codes. @@ -11320,7 +11323,7 @@ unsafe extern "C" { /// external triggers. /// /// @note The `ON` power state only determines the MCU's power mode and is not related to radio's state. -pub const otPlatMcuPowerState_OT_PLAT_MCU_POWER_STATE_ON: otPlatMcuPowerState = 0; +pub const OT_PLAT_MCU_POWER_STATE_ON: otPlatMcuPowerState = 0; /// NCP's MCU can enter low-power (energy-saving) state. /// /// When the NCP's desired power state is set to `LOW_POWER`, host is expected to "poke" the NCP (e.g., an external @@ -11334,12 +11337,12 @@ pub const otPlatMcuPowerState_OT_PLAT_MCU_POWER_STATE_ON: otPlatMcuPowerState = /// /// @note The `LOW_POWER` power state only determines the MCU's power mode and is not related to radio's state /// (radio is managed by OpenThread core and device role, e.g., device being sleepy or not. -pub const otPlatMcuPowerState_OT_PLAT_MCU_POWER_STATE_LOW_POWER: otPlatMcuPowerState = 1; +pub const OT_PLAT_MCU_POWER_STATE_LOW_POWER: otPlatMcuPowerState = 1; /// NCP is fully off. /// /// An NCP hardware reset (via a RESET pin) is required to bring the NCP back to `SPINEL_MCU_POWER_STATE_ON`. /// RAM is not retained after reset. -pub const otPlatMcuPowerState_OT_PLAT_MCU_POWER_STATE_OFF: otPlatMcuPowerState = 2; +pub const OT_PLAT_MCU_POWER_STATE_OFF: otPlatMcuPowerState = 2; /// Enumeration of micro-controller's power states. /// /// These values are used for NCP configuration when `OPENTHREAD_CONFIG_NCP_ENABLE_MCU_POWER_STATE_CONTROL` is enabled. @@ -11614,51 +11617,51 @@ unsafe extern "C" { /// Represents the log level. pub type otLogLevel = ::core::ffi::c_int; ///< OpenThread API -pub const otLogRegion_OT_LOG_REGION_API: otLogRegion = 1; +pub const OT_LOG_REGION_API: otLogRegion = 1; ///< MLE -pub const otLogRegion_OT_LOG_REGION_MLE: otLogRegion = 2; +pub const OT_LOG_REGION_MLE: otLogRegion = 2; ///< EID-to-RLOC mapping. -pub const otLogRegion_OT_LOG_REGION_ARP: otLogRegion = 3; +pub const OT_LOG_REGION_ARP: otLogRegion = 3; ///< Network Data -pub const otLogRegion_OT_LOG_REGION_NET_DATA: otLogRegion = 4; +pub const OT_LOG_REGION_NET_DATA: otLogRegion = 4; ///< ICMPv6 -pub const otLogRegion_OT_LOG_REGION_ICMP: otLogRegion = 5; +pub const OT_LOG_REGION_ICMP: otLogRegion = 5; ///< IPv6 -pub const otLogRegion_OT_LOG_REGION_IP6: otLogRegion = 6; +pub const OT_LOG_REGION_IP6: otLogRegion = 6; ///< TCP -pub const otLogRegion_OT_LOG_REGION_TCP: otLogRegion = 7; +pub const OT_LOG_REGION_TCP: otLogRegion = 7; ///< IEEE 802.15.4 MAC -pub const otLogRegion_OT_LOG_REGION_MAC: otLogRegion = 8; +pub const OT_LOG_REGION_MAC: otLogRegion = 8; ///< Memory -pub const otLogRegion_OT_LOG_REGION_MEM: otLogRegion = 9; +pub const OT_LOG_REGION_MEM: otLogRegion = 9; ///< NCP -pub const otLogRegion_OT_LOG_REGION_NCP: otLogRegion = 10; +pub const OT_LOG_REGION_NCP: otLogRegion = 10; ///< Mesh Commissioning Protocol -pub const otLogRegion_OT_LOG_REGION_MESH_COP: otLogRegion = 11; +pub const OT_LOG_REGION_MESH_COP: otLogRegion = 11; ///< Network Diagnostic -pub const otLogRegion_OT_LOG_REGION_NET_DIAG: otLogRegion = 12; +pub const OT_LOG_REGION_NET_DIAG: otLogRegion = 12; ///< Platform -pub const otLogRegion_OT_LOG_REGION_PLATFORM: otLogRegion = 13; +pub const OT_LOG_REGION_PLATFORM: otLogRegion = 13; ///< CoAP -pub const otLogRegion_OT_LOG_REGION_COAP: otLogRegion = 14; +pub const OT_LOG_REGION_COAP: otLogRegion = 14; ///< CLI -pub const otLogRegion_OT_LOG_REGION_CLI: otLogRegion = 15; +pub const OT_LOG_REGION_CLI: otLogRegion = 15; ///< OpenThread Core -pub const otLogRegion_OT_LOG_REGION_CORE: otLogRegion = 16; +pub const OT_LOG_REGION_CORE: otLogRegion = 16; ///< Utility module -pub const otLogRegion_OT_LOG_REGION_UTIL: otLogRegion = 17; +pub const OT_LOG_REGION_UTIL: otLogRegion = 17; ///< Backbone Router (available since Thread 1.2) -pub const otLogRegion_OT_LOG_REGION_BBR: otLogRegion = 18; +pub const OT_LOG_REGION_BBR: otLogRegion = 18; ///< Multicast Listener Registration (available since Thread 1.2) -pub const otLogRegion_OT_LOG_REGION_MLR: otLogRegion = 19; +pub const OT_LOG_REGION_MLR: otLogRegion = 19; ///< Domain Unicast Address (available since Thread 1.2) -pub const otLogRegion_OT_LOG_REGION_DUA: otLogRegion = 20; +pub const OT_LOG_REGION_DUA: otLogRegion = 20; ///< Border Router -pub const otLogRegion_OT_LOG_REGION_BR: otLogRegion = 21; +pub const OT_LOG_REGION_BR: otLogRegion = 21; ///< Service Registration Protocol (SRP) -pub const otLogRegion_OT_LOG_REGION_SRP: otLogRegion = 22; +pub const OT_LOG_REGION_SRP: otLogRegion = 22; ///< DNS -pub const otLogRegion_OT_LOG_REGION_DNS: otLogRegion = 23; +pub const OT_LOG_REGION_DNS: otLogRegion = 23; /// Represents log regions. /// /// The support for log region is removed and instead each core module can define its own name to appended to the logs. @@ -11827,21 +11830,21 @@ unsafe extern "C" { pub fn otDnsIsNameCompressionEnabled() -> bool; } ///< Item to be added/registered. -pub const otSrpClientItemState_OT_SRP_CLIENT_ITEM_STATE_TO_ADD: otSrpClientItemState = 0; +pub const OT_SRP_CLIENT_ITEM_STATE_TO_ADD: otSrpClientItemState = 0; ///< Item is being added/registered. -pub const otSrpClientItemState_OT_SRP_CLIENT_ITEM_STATE_ADDING: otSrpClientItemState = 1; +pub const OT_SRP_CLIENT_ITEM_STATE_ADDING: otSrpClientItemState = 1; ///< Item to be refreshed (re-register to renew lease). -pub const otSrpClientItemState_OT_SRP_CLIENT_ITEM_STATE_TO_REFRESH: otSrpClientItemState = 2; +pub const OT_SRP_CLIENT_ITEM_STATE_TO_REFRESH: otSrpClientItemState = 2; ///< Item is being refreshed. -pub const otSrpClientItemState_OT_SRP_CLIENT_ITEM_STATE_REFRESHING: otSrpClientItemState = 3; +pub const OT_SRP_CLIENT_ITEM_STATE_REFRESHING: otSrpClientItemState = 3; ///< Item to be removed. -pub const otSrpClientItemState_OT_SRP_CLIENT_ITEM_STATE_TO_REMOVE: otSrpClientItemState = 4; +pub const OT_SRP_CLIENT_ITEM_STATE_TO_REMOVE: otSrpClientItemState = 4; ///< Item is being removed. -pub const otSrpClientItemState_OT_SRP_CLIENT_ITEM_STATE_REMOVING: otSrpClientItemState = 5; +pub const OT_SRP_CLIENT_ITEM_STATE_REMOVING: otSrpClientItemState = 5; ///< Item is registered with server. -pub const otSrpClientItemState_OT_SRP_CLIENT_ITEM_STATE_REGISTERED: otSrpClientItemState = 6; +pub const OT_SRP_CLIENT_ITEM_STATE_REGISTERED: otSrpClientItemState = 6; ///< Item is removed. -pub const otSrpClientItemState_OT_SRP_CLIENT_ITEM_STATE_REMOVED: otSrpClientItemState = 7; +pub const OT_SRP_CLIENT_ITEM_STATE_REMOVED: otSrpClientItemState = 7; /// Specifies an SRP client item (service or host info) state. pub type otSrpClientItemState = ::core::ffi::c_uchar; /// Represents an SRP client host info. diff --git a/openthread-sys/src/include/thumbv7em-none-eabi.rs b/openthread-sys/src/include/thumbv7em-none-eabi.rs index bb4fc9c5..eaed96f6 100644 --- a/openthread-sys/src/include/thumbv7em-none-eabi.rs +++ b/openthread-sys/src/include/thumbv7em-none-eabi.rs @@ -1,4 +1,4 @@ -/* automatically generated by rust-bindgen 0.71.1 */ +/* automatically generated by rust-bindgen 0.72.1 */ #[repr(C)] #[derive(Copy, Clone, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)] @@ -36,7 +36,9 @@ where 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); + let byte = unsafe { + *(core::ptr::addr_of!((*this).storage) as *const u8).offset(byte_index as isize) + }; Self::extract_bit(byte, index) } #[inline] @@ -64,9 +66,10 @@ where 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); + let byte = unsafe { + (core::ptr::addr_of_mut!((*this).storage) as *mut u8).offset(byte_index as isize) + }; + unsafe { *byte = Self::change_bit(*byte, index, val) }; } #[inline] pub fn get(&self, bit_offset: usize, bit_width: u8) -> u64 { @@ -93,7 +96,7 @@ where 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) { + if unsafe { Self::raw_get_bit(this, i + bit_offset) } { let index = if cfg!(target_endian = "big") { bit_width as usize - 1 - i } else { @@ -133,7 +136,7 @@ where } else { i }; - Self::raw_set_bit(this, index + bit_offset, val_bit_is_set); + unsafe { Self::raw_set_bit(this, index + bit_offset, val_bit_is_set) }; } } } @@ -259,82 +262,82 @@ pub const OT_DNS_TXT_KEY_MIN_LENGTH: u32 = 1; pub const OT_DNS_TXT_KEY_MAX_LENGTH: u32 = 9; pub const OT_DNS_TXT_KEY_ITER_MAX_LENGTH: u32 = 64; /// No error. -pub const otError_OT_ERROR_NONE: otError = 0; +pub const OT_ERROR_NONE: otError = 0; /// Operational failed. -pub const otError_OT_ERROR_FAILED: otError = 1; +pub const OT_ERROR_FAILED: otError = 1; /// Message was dropped. -pub const otError_OT_ERROR_DROP: otError = 2; +pub const OT_ERROR_DROP: otError = 2; /// Insufficient buffers. -pub const otError_OT_ERROR_NO_BUFS: otError = 3; +pub const OT_ERROR_NO_BUFS: otError = 3; /// No route available. -pub const otError_OT_ERROR_NO_ROUTE: otError = 4; +pub const OT_ERROR_NO_ROUTE: otError = 4; /// Service is busy and could not service the operation. -pub const otError_OT_ERROR_BUSY: otError = 5; +pub const OT_ERROR_BUSY: otError = 5; /// Failed to parse message. -pub const otError_OT_ERROR_PARSE: otError = 6; +pub const OT_ERROR_PARSE: otError = 6; /// Input arguments are invalid. -pub const otError_OT_ERROR_INVALID_ARGS: otError = 7; +pub const OT_ERROR_INVALID_ARGS: otError = 7; /// Security checks failed. -pub const otError_OT_ERROR_SECURITY: otError = 8; +pub const OT_ERROR_SECURITY: otError = 8; /// Address resolution requires an address query operation. -pub const otError_OT_ERROR_ADDRESS_QUERY: otError = 9; +pub const OT_ERROR_ADDRESS_QUERY: otError = 9; /// Address is not in the source match table. -pub const otError_OT_ERROR_NO_ADDRESS: otError = 10; +pub const OT_ERROR_NO_ADDRESS: otError = 10; /// Operation was aborted. -pub const otError_OT_ERROR_ABORT: otError = 11; +pub const OT_ERROR_ABORT: otError = 11; /// Function or method is not implemented. -pub const otError_OT_ERROR_NOT_IMPLEMENTED: otError = 12; +pub const OT_ERROR_NOT_IMPLEMENTED: otError = 12; /// Cannot complete due to invalid state. -pub const otError_OT_ERROR_INVALID_STATE: otError = 13; +pub const OT_ERROR_INVALID_STATE: otError = 13; /// No acknowledgment was received after macMaxFrameRetries (IEEE 802.15.4-2006). -pub const otError_OT_ERROR_NO_ACK: otError = 14; +pub const OT_ERROR_NO_ACK: otError = 14; /// A transmission could not take place due to activity on the channel, i.e., the CSMA-CA mechanism has failed /// (IEEE 802.15.4-2006). -pub const otError_OT_ERROR_CHANNEL_ACCESS_FAILURE: otError = 15; +pub const OT_ERROR_CHANNEL_ACCESS_FAILURE: otError = 15; /// Not currently attached to a Thread Partition. -pub const otError_OT_ERROR_DETACHED: otError = 16; +pub const OT_ERROR_DETACHED: otError = 16; /// FCS check failure while receiving. -pub const otError_OT_ERROR_FCS: otError = 17; +pub const OT_ERROR_FCS: otError = 17; /// No frame received. -pub const otError_OT_ERROR_NO_FRAME_RECEIVED: otError = 18; +pub const OT_ERROR_NO_FRAME_RECEIVED: otError = 18; /// Received a frame from an unknown neighbor. -pub const otError_OT_ERROR_UNKNOWN_NEIGHBOR: otError = 19; +pub const OT_ERROR_UNKNOWN_NEIGHBOR: otError = 19; /// Received a frame from an invalid source address. -pub const otError_OT_ERROR_INVALID_SOURCE_ADDRESS: otError = 20; +pub const OT_ERROR_INVALID_SOURCE_ADDRESS: otError = 20; /// Received a frame filtered by the address filter (allowlisted or denylisted). -pub const otError_OT_ERROR_ADDRESS_FILTERED: otError = 21; +pub const OT_ERROR_ADDRESS_FILTERED: otError = 21; /// Received a frame filtered by the destination address check. -pub const otError_OT_ERROR_DESTINATION_ADDRESS_FILTERED: otError = 22; +pub const OT_ERROR_DESTINATION_ADDRESS_FILTERED: otError = 22; /// The requested item could not be found. -pub const otError_OT_ERROR_NOT_FOUND: otError = 23; +pub const OT_ERROR_NOT_FOUND: otError = 23; /// The operation is already in progress. -pub const otError_OT_ERROR_ALREADY: otError = 24; +pub const OT_ERROR_ALREADY: otError = 24; /// The creation of IPv6 address failed. -pub const otError_OT_ERROR_IP6_ADDRESS_CREATION_FAILURE: otError = 26; +pub const OT_ERROR_IP6_ADDRESS_CREATION_FAILURE: otError = 26; /// Operation prevented by mode flags -pub const otError_OT_ERROR_NOT_CAPABLE: otError = 27; +pub const OT_ERROR_NOT_CAPABLE: otError = 27; /// Coap response or acknowledgment or DNS, SNTP response not received. -pub const otError_OT_ERROR_RESPONSE_TIMEOUT: otError = 28; +pub const OT_ERROR_RESPONSE_TIMEOUT: otError = 28; /// Received a duplicated frame. -pub const otError_OT_ERROR_DUPLICATED: otError = 29; +pub const OT_ERROR_DUPLICATED: otError = 29; /// Message is being dropped from reassembly list due to timeout. -pub const otError_OT_ERROR_REASSEMBLY_TIMEOUT: otError = 30; +pub const OT_ERROR_REASSEMBLY_TIMEOUT: otError = 30; /// Message is not a TMF Message. -pub const otError_OT_ERROR_NOT_TMF: otError = 31; +pub const OT_ERROR_NOT_TMF: otError = 31; /// Received a non-lowpan data frame. -pub const otError_OT_ERROR_NOT_LOWPAN_DATA_FRAME: otError = 32; +pub const OT_ERROR_NOT_LOWPAN_DATA_FRAME: otError = 32; /// The link margin was too low. -pub const otError_OT_ERROR_LINK_MARGIN_LOW: otError = 34; +pub const OT_ERROR_LINK_MARGIN_LOW: otError = 34; /// Input (CLI) command is invalid. -pub const otError_OT_ERROR_INVALID_COMMAND: otError = 35; +pub const OT_ERROR_INVALID_COMMAND: otError = 35; /// Special error code used to indicate success/error status is pending and not yet known. -pub const otError_OT_ERROR_PENDING: otError = 36; +pub const OT_ERROR_PENDING: otError = 36; /// Request rejected. -pub const otError_OT_ERROR_REJECTED: otError = 37; +pub const OT_ERROR_REJECTED: otError = 37; /// The number of defined errors. -pub const otError_OT_NUM_ERRORS: otError = 38; +pub const OT_NUM_ERRORS: otError = 38; /// Generic error (should not use). -pub const otError_OT_ERROR_GENERIC: otError = 255; +pub const OT_ERROR_GENERIC: otError = 255; /// Represents error codes used throughout OpenThread. pub type otError = ::core::ffi::c_uchar; unsafe extern "C" { @@ -573,19 +576,19 @@ pub struct otMessage { _unused: [u8; 0], } ///< Low priority level. -pub const otMessagePriority_OT_MESSAGE_PRIORITY_LOW: otMessagePriority = 0; +pub const OT_MESSAGE_PRIORITY_LOW: otMessagePriority = 0; ///< Normal priority level. -pub const otMessagePriority_OT_MESSAGE_PRIORITY_NORMAL: otMessagePriority = 1; +pub const OT_MESSAGE_PRIORITY_NORMAL: otMessagePriority = 1; ///< High priority level. -pub const otMessagePriority_OT_MESSAGE_PRIORITY_HIGH: otMessagePriority = 2; +pub const OT_MESSAGE_PRIORITY_HIGH: otMessagePriority = 2; /// Defines the OpenThread message priority levels. pub type otMessagePriority = ::core::ffi::c_uchar; ///< Message from Thread Netif. -pub const otMessageOrigin_OT_MESSAGE_ORIGIN_THREAD_NETIF: otMessageOrigin = 0; +pub const OT_MESSAGE_ORIGIN_THREAD_NETIF: otMessageOrigin = 0; ///< Message from a trusted source on host. -pub const otMessageOrigin_OT_MESSAGE_ORIGIN_HOST_TRUSTED: otMessageOrigin = 1; +pub const OT_MESSAGE_ORIGIN_HOST_TRUSTED: otMessageOrigin = 1; ///< Message from an untrusted source on host. -pub const otMessageOrigin_OT_MESSAGE_ORIGIN_HOST_UNTRUSTED: otMessageOrigin = 2; +pub const OT_MESSAGE_ORIGIN_HOST_UNTRUSTED: otMessageOrigin = 2; /// Defines the OpenThread message origins. pub type otMessageOrigin = ::core::ffi::c_uchar; /// Represents a message settings. @@ -2594,13 +2597,13 @@ pub type otUdpReceive = ::core::option::Option< ), >; ///< Unspecified network interface. -pub const otNetifIdentifier_OT_NETIF_UNSPECIFIED: otNetifIdentifier = 0; +pub const OT_NETIF_UNSPECIFIED: otNetifIdentifier = 0; ///< The host Thread interface - allow use of platform UDP. -pub const otNetifIdentifier_OT_NETIF_THREAD_HOST: otNetifIdentifier = 1; +pub const OT_NETIF_THREAD_HOST: otNetifIdentifier = 1; ///< The internal Thread interface (within OpenThread) - do not use platform UDP. -pub const otNetifIdentifier_OT_NETIF_THREAD_INTERNAL: otNetifIdentifier = 2; +pub const OT_NETIF_THREAD_INTERNAL: otNetifIdentifier = 2; ///< The Backbone interface. -pub const otNetifIdentifier_OT_NETIF_BACKBONE: otNetifIdentifier = 3; +pub const OT_NETIF_BACKBONE: otNetifIdentifier = 3; /// Defines the OpenThread network interface identifiers. pub type otNetifIdentifier = ::core::ffi::c_uchar; /// Represents a UDP socket. @@ -2803,23 +2806,23 @@ unsafe extern "C" { pub fn otUdpIsPortInUse(aInstance: *mut otInstance, port: u16) -> bool; } ///< Key Type: Raw Data. -pub const otCryptoKeyType_OT_CRYPTO_KEY_TYPE_RAW: otCryptoKeyType = 0; +pub const OT_CRYPTO_KEY_TYPE_RAW: otCryptoKeyType = 0; ///< Key Type: AES. -pub const otCryptoKeyType_OT_CRYPTO_KEY_TYPE_AES: otCryptoKeyType = 1; +pub const OT_CRYPTO_KEY_TYPE_AES: otCryptoKeyType = 1; ///< Key Type: HMAC. -pub const otCryptoKeyType_OT_CRYPTO_KEY_TYPE_HMAC: otCryptoKeyType = 2; +pub const OT_CRYPTO_KEY_TYPE_HMAC: otCryptoKeyType = 2; ///< Key Type: ECDSA. -pub const otCryptoKeyType_OT_CRYPTO_KEY_TYPE_ECDSA: otCryptoKeyType = 3; +pub const OT_CRYPTO_KEY_TYPE_ECDSA: otCryptoKeyType = 3; /// Defines the key types. pub type otCryptoKeyType = ::core::ffi::c_uchar; ///< Key Algorithm: Vendor Defined. -pub const otCryptoKeyAlgorithm_OT_CRYPTO_KEY_ALG_VENDOR: otCryptoKeyAlgorithm = 0; +pub const OT_CRYPTO_KEY_ALG_VENDOR: otCryptoKeyAlgorithm = 0; ///< Key Algorithm: AES ECB. -pub const otCryptoKeyAlgorithm_OT_CRYPTO_KEY_ALG_AES_ECB: otCryptoKeyAlgorithm = 1; +pub const OT_CRYPTO_KEY_ALG_AES_ECB: otCryptoKeyAlgorithm = 1; ///< Key Algorithm: HMAC SHA-256. -pub const otCryptoKeyAlgorithm_OT_CRYPTO_KEY_ALG_HMAC_SHA_256: otCryptoKeyAlgorithm = 2; +pub const OT_CRYPTO_KEY_ALG_HMAC_SHA_256: otCryptoKeyAlgorithm = 2; ///< Key Algorithm: ECDSA. -pub const otCryptoKeyAlgorithm_OT_CRYPTO_KEY_ALG_ECDSA: otCryptoKeyAlgorithm = 3; +pub const OT_CRYPTO_KEY_ALG_ECDSA: otCryptoKeyAlgorithm = 3; /// Defines the key algorithms. pub type otCryptoKeyAlgorithm = ::core::ffi::c_uchar; ///< Key Usage: Key Usage is empty. @@ -2837,9 +2840,9 @@ pub const OT_CRYPTO_KEY_USAGE_VERIFY_HASH: _bindgen_ty_4 = 16; /// Defines the key usage flags. pub type _bindgen_ty_4 = ::core::ffi::c_uchar; ///< Key Persistence: Key is volatile. -pub const otCryptoKeyStorage_OT_CRYPTO_KEY_STORAGE_VOLATILE: otCryptoKeyStorage = 0; +pub const OT_CRYPTO_KEY_STORAGE_VOLATILE: otCryptoKeyStorage = 0; ///< Key Persistence: Key is persistent. -pub const otCryptoKeyStorage_OT_CRYPTO_KEY_STORAGE_PERSISTENT: otCryptoKeyStorage = 1; +pub const OT_CRYPTO_KEY_STORAGE_PERSISTENT: otCryptoKeyStorage = 1; /// Defines the key storage types. pub type otCryptoKeyStorage = ::core::ffi::c_uchar; /// This datatype represents the key reference. @@ -3623,9 +3626,9 @@ impl Default for otMacKeyMaterial { } } ///< Use Literal Keys. -pub const otRadioKeyType_OT_KEY_TYPE_LITERAL_KEY: otRadioKeyType = 0; +pub const OT_KEY_TYPE_LITERAL_KEY: otRadioKeyType = 0; ///< Use Reference to Key. -pub const otRadioKeyType_OT_KEY_TYPE_KEY_REF: otRadioKeyType = 1; +pub const OT_KEY_TYPE_KEY_REF: otRadioKeyType = 1; /// Defines constants about key types. pub type otRadioKeyType = ::core::ffi::c_uchar; /// Represents the IEEE 802.15.4 Header IE (Information Element) related information of a radio frame. @@ -4068,11 +4071,11 @@ impl Default for otRadioFrame { } } } -pub const otRadioState_OT_RADIO_STATE_DISABLED: otRadioState = 0; -pub const otRadioState_OT_RADIO_STATE_SLEEP: otRadioState = 1; -pub const otRadioState_OT_RADIO_STATE_RECEIVE: otRadioState = 2; -pub const otRadioState_OT_RADIO_STATE_TRANSMIT: otRadioState = 3; -pub const otRadioState_OT_RADIO_STATE_INVALID: otRadioState = 255; +pub const OT_RADIO_STATE_DISABLED: otRadioState = 0; +pub const OT_RADIO_STATE_SLEEP: otRadioState = 1; +pub const OT_RADIO_STATE_RECEIVE: otRadioState = 2; +pub const OT_RADIO_STATE_TRANSMIT: otRadioState = 3; +pub const OT_RADIO_STATE_INVALID: otRadioState = 255; /// Represents the state of a radio. /// Initially, a radio is in the Disabled state. pub type otRadioState = ::core::ffi::c_uchar; @@ -5802,89 +5805,89 @@ impl Default for otOperationalDatasetTlvs { } } ///< meshcop Channel TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_CHANNEL: otMeshcopTlvType = 0; +pub const OT_MESHCOP_TLV_CHANNEL: otMeshcopTlvType = 0; ///< meshcop Pan Id TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_PANID: otMeshcopTlvType = 1; +pub const OT_MESHCOP_TLV_PANID: otMeshcopTlvType = 1; ///< meshcop Extended Pan Id TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_EXTPANID: otMeshcopTlvType = 2; +pub const OT_MESHCOP_TLV_EXTPANID: otMeshcopTlvType = 2; ///< meshcop Network Name TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_NETWORKNAME: otMeshcopTlvType = 3; +pub const OT_MESHCOP_TLV_NETWORKNAME: otMeshcopTlvType = 3; ///< meshcop PSKc TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_PSKC: otMeshcopTlvType = 4; +pub const OT_MESHCOP_TLV_PSKC: otMeshcopTlvType = 4; ///< meshcop Network Key TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_NETWORKKEY: otMeshcopTlvType = 5; +pub const OT_MESHCOP_TLV_NETWORKKEY: otMeshcopTlvType = 5; ///< meshcop Network Key Sequence TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_NETWORK_KEY_SEQUENCE: otMeshcopTlvType = 6; +pub const OT_MESHCOP_TLV_NETWORK_KEY_SEQUENCE: otMeshcopTlvType = 6; ///< meshcop Mesh Local Prefix TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_MESHLOCALPREFIX: otMeshcopTlvType = 7; +pub const OT_MESHCOP_TLV_MESHLOCALPREFIX: otMeshcopTlvType = 7; ///< meshcop Steering Data TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_STEERING_DATA: otMeshcopTlvType = 8; +pub const OT_MESHCOP_TLV_STEERING_DATA: otMeshcopTlvType = 8; ///< meshcop Border Agent Locator TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_BORDER_AGENT_RLOC: otMeshcopTlvType = 9; +pub const OT_MESHCOP_TLV_BORDER_AGENT_RLOC: otMeshcopTlvType = 9; ///< meshcop Commissioner ID TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_COMMISSIONER_ID: otMeshcopTlvType = 10; +pub const OT_MESHCOP_TLV_COMMISSIONER_ID: otMeshcopTlvType = 10; ///< meshcop Commissioner Session ID TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_COMM_SESSION_ID: otMeshcopTlvType = 11; +pub const OT_MESHCOP_TLV_COMM_SESSION_ID: otMeshcopTlvType = 11; ///< meshcop Security Policy TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_SECURITYPOLICY: otMeshcopTlvType = 12; +pub const OT_MESHCOP_TLV_SECURITYPOLICY: otMeshcopTlvType = 12; ///< meshcop Get TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_GET: otMeshcopTlvType = 13; +pub const OT_MESHCOP_TLV_GET: otMeshcopTlvType = 13; ///< meshcop Active Timestamp TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_ACTIVETIMESTAMP: otMeshcopTlvType = 14; +pub const OT_MESHCOP_TLV_ACTIVETIMESTAMP: otMeshcopTlvType = 14; ///< meshcop Commissioner UDP Port TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_COMMISSIONER_UDP_PORT: otMeshcopTlvType = 15; +pub const OT_MESHCOP_TLV_COMMISSIONER_UDP_PORT: otMeshcopTlvType = 15; ///< meshcop State TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_STATE: otMeshcopTlvType = 16; +pub const OT_MESHCOP_TLV_STATE: otMeshcopTlvType = 16; ///< meshcop Joiner DTLS Encapsulation TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_JOINER_DTLS: otMeshcopTlvType = 17; +pub const OT_MESHCOP_TLV_JOINER_DTLS: otMeshcopTlvType = 17; ///< meshcop Joiner UDP Port TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_JOINER_UDP_PORT: otMeshcopTlvType = 18; +pub const OT_MESHCOP_TLV_JOINER_UDP_PORT: otMeshcopTlvType = 18; ///< meshcop Joiner IID TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_JOINER_IID: otMeshcopTlvType = 19; +pub const OT_MESHCOP_TLV_JOINER_IID: otMeshcopTlvType = 19; ///< meshcop Joiner Router Locator TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_JOINER_RLOC: otMeshcopTlvType = 20; +pub const OT_MESHCOP_TLV_JOINER_RLOC: otMeshcopTlvType = 20; ///< meshcop Joiner Router KEK TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_JOINER_ROUTER_KEK: otMeshcopTlvType = 21; +pub const OT_MESHCOP_TLV_JOINER_ROUTER_KEK: otMeshcopTlvType = 21; ///< meshcop Provisioning URL TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_PROVISIONING_URL: otMeshcopTlvType = 32; +pub const OT_MESHCOP_TLV_PROVISIONING_URL: otMeshcopTlvType = 32; ///< meshcop Vendor Name TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_VENDOR_NAME_TLV: otMeshcopTlvType = 33; +pub const OT_MESHCOP_TLV_VENDOR_NAME_TLV: otMeshcopTlvType = 33; ///< meshcop Vendor Model TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_VENDOR_MODEL_TLV: otMeshcopTlvType = 34; +pub const OT_MESHCOP_TLV_VENDOR_MODEL_TLV: otMeshcopTlvType = 34; ///< meshcop Vendor SW Version TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_VENDOR_SW_VERSION_TLV: otMeshcopTlvType = 35; +pub const OT_MESHCOP_TLV_VENDOR_SW_VERSION_TLV: otMeshcopTlvType = 35; ///< meshcop Vendor Data TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_VENDOR_DATA_TLV: otMeshcopTlvType = 36; +pub const OT_MESHCOP_TLV_VENDOR_DATA_TLV: otMeshcopTlvType = 36; ///< meshcop Vendor Stack Version TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_VENDOR_STACK_VERSION_TLV: otMeshcopTlvType = 37; +pub const OT_MESHCOP_TLV_VENDOR_STACK_VERSION_TLV: otMeshcopTlvType = 37; ///< meshcop UDP encapsulation TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_UDP_ENCAPSULATION_TLV: otMeshcopTlvType = 48; +pub const OT_MESHCOP_TLV_UDP_ENCAPSULATION_TLV: otMeshcopTlvType = 48; ///< meshcop IPv6 address TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_IPV6_ADDRESS_TLV: otMeshcopTlvType = 49; +pub const OT_MESHCOP_TLV_IPV6_ADDRESS_TLV: otMeshcopTlvType = 49; ///< meshcop Pending Timestamp TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_PENDINGTIMESTAMP: otMeshcopTlvType = 51; +pub const OT_MESHCOP_TLV_PENDINGTIMESTAMP: otMeshcopTlvType = 51; ///< meshcop Delay Timer TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_DELAYTIMER: otMeshcopTlvType = 52; +pub const OT_MESHCOP_TLV_DELAYTIMER: otMeshcopTlvType = 52; ///< meshcop Channel Mask TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_CHANNELMASK: otMeshcopTlvType = 53; +pub const OT_MESHCOP_TLV_CHANNELMASK: otMeshcopTlvType = 53; ///< meshcop Count TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_COUNT: otMeshcopTlvType = 54; +pub const OT_MESHCOP_TLV_COUNT: otMeshcopTlvType = 54; ///< meshcop Period TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_PERIOD: otMeshcopTlvType = 55; +pub const OT_MESHCOP_TLV_PERIOD: otMeshcopTlvType = 55; ///< meshcop Scan Duration TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_SCAN_DURATION: otMeshcopTlvType = 56; +pub const OT_MESHCOP_TLV_SCAN_DURATION: otMeshcopTlvType = 56; ///< meshcop Energy List TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_ENERGY_LIST: otMeshcopTlvType = 57; +pub const OT_MESHCOP_TLV_ENERGY_LIST: otMeshcopTlvType = 57; ///< meshcop Thread Domain Name TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_THREAD_DOMAIN_NAME: otMeshcopTlvType = 59; +pub const OT_MESHCOP_TLV_THREAD_DOMAIN_NAME: otMeshcopTlvType = 59; ///< meshcop Wake-up Channel TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_WAKEUP_CHANNEL: otMeshcopTlvType = 74; +pub const OT_MESHCOP_TLV_WAKEUP_CHANNEL: otMeshcopTlvType = 74; ///< meshcop Discovery Request TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_DISCOVERYREQUEST: otMeshcopTlvType = 128; +pub const OT_MESHCOP_TLV_DISCOVERYREQUEST: otMeshcopTlvType = 128; ///< meshcop Discovery Response TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_DISCOVERYRESPONSE: otMeshcopTlvType = 129; +pub const OT_MESHCOP_TLV_DISCOVERYRESPONSE: otMeshcopTlvType = 129; ///< meshcop Joiner Advertisement TLV -pub const otMeshcopTlvType_OT_MESHCOP_TLV_JOINERADVERTISEMENT: otMeshcopTlvType = 241; +pub const OT_MESHCOP_TLV_JOINERADVERTISEMENT: otMeshcopTlvType = 241; /// Represents meshcop TLV types. pub type otMeshcopTlvType = ::core::ffi::c_uchar; /// Pointer is called when a response to a MGMT_SET request is received or times out. @@ -6202,12 +6205,12 @@ unsafe extern "C" { aDatasetTlvs: *mut otOperationalDatasetTlvs, ) -> otError; } -pub const otJoinerState_OT_JOINER_STATE_IDLE: otJoinerState = 0; -pub const otJoinerState_OT_JOINER_STATE_DISCOVER: otJoinerState = 1; -pub const otJoinerState_OT_JOINER_STATE_CONNECT: otJoinerState = 2; -pub const otJoinerState_OT_JOINER_STATE_CONNECTED: otJoinerState = 3; -pub const otJoinerState_OT_JOINER_STATE_ENTRUST: otJoinerState = 4; -pub const otJoinerState_OT_JOINER_STATE_JOINED: otJoinerState = 5; +pub const OT_JOINER_STATE_IDLE: otJoinerState = 0; +pub const OT_JOINER_STATE_DISCOVER: otJoinerState = 1; +pub const OT_JOINER_STATE_CONNECT: otJoinerState = 2; +pub const OT_JOINER_STATE_CONNECTED: otJoinerState = 3; +pub const OT_JOINER_STATE_ENTRUST: otJoinerState = 4; +pub const OT_JOINER_STATE_JOINED: otJoinerState = 5; /// Defines the Joiner State. pub type otJoinerState = ::core::ffi::c_uchar; /// Represents a Joiner Discerner. @@ -6320,18 +6323,18 @@ unsafe extern "C" { pub fn otJoinerStateToString(aState: otJoinerState) -> *const ::core::ffi::c_char; } ///< Commissioner role is disabled. -pub const otCommissionerState_OT_COMMISSIONER_STATE_DISABLED: otCommissionerState = 0; +pub const OT_COMMISSIONER_STATE_DISABLED: otCommissionerState = 0; ///< Currently petitioning to become a Commissioner. -pub const otCommissionerState_OT_COMMISSIONER_STATE_PETITION: otCommissionerState = 1; +pub const OT_COMMISSIONER_STATE_PETITION: otCommissionerState = 1; ///< Commissioner role is active. -pub const otCommissionerState_OT_COMMISSIONER_STATE_ACTIVE: otCommissionerState = 2; +pub const OT_COMMISSIONER_STATE_ACTIVE: otCommissionerState = 2; /// Defines the Commissioner State. pub type otCommissionerState = ::core::ffi::c_uchar; -pub const otCommissionerJoinerEvent_OT_COMMISSIONER_JOINER_START: otCommissionerJoinerEvent = 0; -pub const otCommissionerJoinerEvent_OT_COMMISSIONER_JOINER_CONNECTED: otCommissionerJoinerEvent = 1; -pub const otCommissionerJoinerEvent_OT_COMMISSIONER_JOINER_FINALIZE: otCommissionerJoinerEvent = 2; -pub const otCommissionerJoinerEvent_OT_COMMISSIONER_JOINER_END: otCommissionerJoinerEvent = 3; -pub const otCommissionerJoinerEvent_OT_COMMISSIONER_JOINER_REMOVED: otCommissionerJoinerEvent = 4; +pub const OT_COMMISSIONER_JOINER_START: otCommissionerJoinerEvent = 0; +pub const OT_COMMISSIONER_JOINER_CONNECTED: otCommissionerJoinerEvent = 1; +pub const OT_COMMISSIONER_JOINER_FINALIZE: otCommissionerJoinerEvent = 2; +pub const OT_COMMISSIONER_JOINER_END: otCommissionerJoinerEvent = 3; +pub const OT_COMMISSIONER_JOINER_REMOVED: otCommissionerJoinerEvent = 4; /// Defines a Joiner Event on the Commissioner. pub type otCommissionerJoinerEvent = ::core::ffi::c_uchar; /// Represents the steering data. @@ -6574,11 +6577,11 @@ impl Default for otJoinerPskd { } } ///< Accept any Joiner (no EUI64 or Discerner is specified). -pub const otJoinerInfoType_OT_JOINER_INFO_TYPE_ANY: otJoinerInfoType = 0; +pub const OT_JOINER_INFO_TYPE_ANY: otJoinerInfoType = 0; ///< Joiner EUI-64 is specified (`mSharedId.mEui64` in `otJoinerInfo`). -pub const otJoinerInfoType_OT_JOINER_INFO_TYPE_EUI64: otJoinerInfoType = 1; +pub const OT_JOINER_INFO_TYPE_EUI64: otJoinerInfoType = 1; ///< Joiner Discerner is specified (`mSharedId.mDiscerner` in `otJoinerInfo`). -pub const otJoinerInfoType_OT_JOINER_INFO_TYPE_DISCERNER: otJoinerInfoType = 2; +pub const OT_JOINER_INFO_TYPE_DISCERNER: otJoinerInfoType = 2; /// Defines a Joiner Info Type. pub type otJoinerInfoType = ::core::ffi::c_uchar; /// Represents a Joiner Info. @@ -6954,11 +6957,11 @@ unsafe extern "C" { } pub type otMacFilterIterator = u8; ///< Address filter is disabled. -pub const otMacFilterAddressMode_OT_MAC_FILTER_ADDRESS_MODE_DISABLED: otMacFilterAddressMode = 0; +pub const OT_MAC_FILTER_ADDRESS_MODE_DISABLED: otMacFilterAddressMode = 0; ///< Allowlist address filter mode is enabled. -pub const otMacFilterAddressMode_OT_MAC_FILTER_ADDRESS_MODE_ALLOWLIST: otMacFilterAddressMode = 1; +pub const OT_MAC_FILTER_ADDRESS_MODE_ALLOWLIST: otMacFilterAddressMode = 1; ///< Denylist address filter mode is enabled. -pub const otMacFilterAddressMode_OT_MAC_FILTER_ADDRESS_MODE_DENYLIST: otMacFilterAddressMode = 2; +pub const OT_MAC_FILTER_ADDRESS_MODE_DENYLIST: otMacFilterAddressMode = 2; /// Defines address mode of the mac filter. pub type otMacFilterAddressMode = ::core::ffi::c_uchar; /// Represents a Mac Filter entry. @@ -8119,15 +8122,15 @@ unsafe extern "C" { pub fn otLinkSetRxOnWhenIdle(aInstance: *mut otInstance, aRxOnWhenIdle: bool) -> otError; } ///< The Thread stack is disabled. -pub const otDeviceRole_OT_DEVICE_ROLE_DISABLED: otDeviceRole = 0; +pub const OT_DEVICE_ROLE_DISABLED: otDeviceRole = 0; ///< Not currently participating in a Thread network/partition. -pub const otDeviceRole_OT_DEVICE_ROLE_DETACHED: otDeviceRole = 1; +pub const OT_DEVICE_ROLE_DETACHED: otDeviceRole = 1; ///< The Thread Child role. -pub const otDeviceRole_OT_DEVICE_ROLE_CHILD: otDeviceRole = 2; +pub const OT_DEVICE_ROLE_CHILD: otDeviceRole = 2; ///< The Thread Router role. -pub const otDeviceRole_OT_DEVICE_ROLE_ROUTER: otDeviceRole = 3; +pub const OT_DEVICE_ROLE_ROUTER: otDeviceRole = 3; ///< The Thread Leader role. -pub const otDeviceRole_OT_DEVICE_ROLE_LEADER: otDeviceRole = 4; +pub const OT_DEVICE_ROLE_LEADER: otDeviceRole = 4; /// Represents a Thread device role. pub type otDeviceRole = ::core::ffi::c_uchar; /// Represents an MLE Link Mode configuration. @@ -9797,14 +9800,14 @@ pub struct otNat64ProtocolCounters { pub mTcp: otNat64Counters, } ///< Packet drop for unknown reasons. -pub const otNat64DropReason_OT_NAT64_DROP_REASON_UNKNOWN: otNat64DropReason = 0; +pub const OT_NAT64_DROP_REASON_UNKNOWN: otNat64DropReason = 0; ///< Packet drop due to failed to parse the datagram. -pub const otNat64DropReason_OT_NAT64_DROP_REASON_ILLEGAL_PACKET: otNat64DropReason = 1; +pub const OT_NAT64_DROP_REASON_ILLEGAL_PACKET: otNat64DropReason = 1; ///< Packet drop due to unsupported IP protocol. -pub const otNat64DropReason_OT_NAT64_DROP_REASON_UNSUPPORTED_PROTO: otNat64DropReason = 2; +pub const OT_NAT64_DROP_REASON_UNSUPPORTED_PROTO: otNat64DropReason = 2; ///< Packet drop due to no mappings found or mapping pool exhausted. -pub const otNat64DropReason_OT_NAT64_DROP_REASON_NO_MAPPING: otNat64DropReason = 3; -pub const otNat64DropReason_OT_NAT64_DROP_REASON_COUNT: otNat64DropReason = 4; +pub const OT_NAT64_DROP_REASON_NO_MAPPING: otNat64DropReason = 3; +pub const OT_NAT64_DROP_REASON_COUNT: otNat64DropReason = 4; /// Packet drop reasons. pub type otNat64DropReason = ::core::ffi::c_uchar; /// Represents the counters of dropped packets due to errors when handling NAT64 packets. @@ -9927,13 +9930,13 @@ unsafe extern "C" { ) -> otError; } ///< NAT64 is disabled. -pub const otNat64State_OT_NAT64_STATE_DISABLED: otNat64State = 0; +pub const OT_NAT64_STATE_DISABLED: otNat64State = 0; ///< NAT64 is enabled, but one or more dependencies of NAT64 are not running. -pub const otNat64State_OT_NAT64_STATE_NOT_RUNNING: otNat64State = 1; +pub const OT_NAT64_STATE_NOT_RUNNING: otNat64State = 1; ///< NAT64 is enabled, but this BR is not an active NAT64 BR. -pub const otNat64State_OT_NAT64_STATE_IDLE: otNat64State = 2; +pub const OT_NAT64_STATE_IDLE: otNat64State = 2; ///< The BR is publishing a NAT64 prefix and/or translating packets. -pub const otNat64State_OT_NAT64_STATE_ACTIVE: otNat64State = 3; +pub const OT_NAT64_STATE_ACTIVE: otNat64State = 3; /// States of NAT64. pub type otNat64State = ::core::ffi::c_uchar; unsafe extern "C" { @@ -10954,11 +10957,11 @@ impl otExternalRouteConfig { } } ///< Low route preference. -pub const otRoutePreference_OT_ROUTE_PREFERENCE_LOW: otRoutePreference = -1; +pub const OT_ROUTE_PREFERENCE_LOW: otRoutePreference = -1; ///< Medium route preference. -pub const otRoutePreference_OT_ROUTE_PREFERENCE_MED: otRoutePreference = 0; +pub const OT_ROUTE_PREFERENCE_MED: otRoutePreference = 0; ///< High route preference. -pub const otRoutePreference_OT_ROUTE_PREFERENCE_HIGH: otRoutePreference = 1; +pub const OT_ROUTE_PREFERENCE_HIGH: otRoutePreference = 1; /// Defines valid values for `mPreference` in `otExternalRouteConfig` and `otBorderRouterConfig`. pub type otRoutePreference = ::core::ffi::c_schar; /// Represents a Server configuration. @@ -11282,16 +11285,16 @@ unsafe extern "C" { /// @retval OT_ERROR_NOT_CAPABLE Not capable of resetting to bootloader. pub fn otPlatResetToBootloader(aInstance: *mut otInstance) -> otError; } -pub const otPlatResetReason_OT_PLAT_RESET_REASON_POWER_ON: otPlatResetReason = 0; -pub const otPlatResetReason_OT_PLAT_RESET_REASON_EXTERNAL: otPlatResetReason = 1; -pub const otPlatResetReason_OT_PLAT_RESET_REASON_SOFTWARE: otPlatResetReason = 2; -pub const otPlatResetReason_OT_PLAT_RESET_REASON_FAULT: otPlatResetReason = 3; -pub const otPlatResetReason_OT_PLAT_RESET_REASON_CRASH: otPlatResetReason = 4; -pub const otPlatResetReason_OT_PLAT_RESET_REASON_ASSERT: otPlatResetReason = 5; -pub const otPlatResetReason_OT_PLAT_RESET_REASON_OTHER: otPlatResetReason = 6; -pub const otPlatResetReason_OT_PLAT_RESET_REASON_UNKNOWN: otPlatResetReason = 7; -pub const otPlatResetReason_OT_PLAT_RESET_REASON_WATCHDOG: otPlatResetReason = 8; -pub const otPlatResetReason_OT_PLAT_RESET_REASON_COUNT: otPlatResetReason = 9; +pub const OT_PLAT_RESET_REASON_POWER_ON: otPlatResetReason = 0; +pub const OT_PLAT_RESET_REASON_EXTERNAL: otPlatResetReason = 1; +pub const OT_PLAT_RESET_REASON_SOFTWARE: otPlatResetReason = 2; +pub const OT_PLAT_RESET_REASON_FAULT: otPlatResetReason = 3; +pub const OT_PLAT_RESET_REASON_CRASH: otPlatResetReason = 4; +pub const OT_PLAT_RESET_REASON_ASSERT: otPlatResetReason = 5; +pub const OT_PLAT_RESET_REASON_OTHER: otPlatResetReason = 6; +pub const OT_PLAT_RESET_REASON_UNKNOWN: otPlatResetReason = 7; +pub const OT_PLAT_RESET_REASON_WATCHDOG: otPlatResetReason = 8; +pub const OT_PLAT_RESET_REASON_COUNT: otPlatResetReason = 9; /// Enumeration of possible reset reason codes. /// /// These are in the same order as the Spinel reset reason codes. @@ -11320,7 +11323,7 @@ unsafe extern "C" { /// external triggers. /// /// @note The `ON` power state only determines the MCU's power mode and is not related to radio's state. -pub const otPlatMcuPowerState_OT_PLAT_MCU_POWER_STATE_ON: otPlatMcuPowerState = 0; +pub const OT_PLAT_MCU_POWER_STATE_ON: otPlatMcuPowerState = 0; /// NCP's MCU can enter low-power (energy-saving) state. /// /// When the NCP's desired power state is set to `LOW_POWER`, host is expected to "poke" the NCP (e.g., an external @@ -11334,12 +11337,12 @@ pub const otPlatMcuPowerState_OT_PLAT_MCU_POWER_STATE_ON: otPlatMcuPowerState = /// /// @note The `LOW_POWER` power state only determines the MCU's power mode and is not related to radio's state /// (radio is managed by OpenThread core and device role, e.g., device being sleepy or not. -pub const otPlatMcuPowerState_OT_PLAT_MCU_POWER_STATE_LOW_POWER: otPlatMcuPowerState = 1; +pub const OT_PLAT_MCU_POWER_STATE_LOW_POWER: otPlatMcuPowerState = 1; /// NCP is fully off. /// /// An NCP hardware reset (via a RESET pin) is required to bring the NCP back to `SPINEL_MCU_POWER_STATE_ON`. /// RAM is not retained after reset. -pub const otPlatMcuPowerState_OT_PLAT_MCU_POWER_STATE_OFF: otPlatMcuPowerState = 2; +pub const OT_PLAT_MCU_POWER_STATE_OFF: otPlatMcuPowerState = 2; /// Enumeration of micro-controller's power states. /// /// These values are used for NCP configuration when `OPENTHREAD_CONFIG_NCP_ENABLE_MCU_POWER_STATE_CONTROL` is enabled. @@ -11614,51 +11617,51 @@ unsafe extern "C" { /// Represents the log level. pub type otLogLevel = ::core::ffi::c_int; ///< OpenThread API -pub const otLogRegion_OT_LOG_REGION_API: otLogRegion = 1; +pub const OT_LOG_REGION_API: otLogRegion = 1; ///< MLE -pub const otLogRegion_OT_LOG_REGION_MLE: otLogRegion = 2; +pub const OT_LOG_REGION_MLE: otLogRegion = 2; ///< EID-to-RLOC mapping. -pub const otLogRegion_OT_LOG_REGION_ARP: otLogRegion = 3; +pub const OT_LOG_REGION_ARP: otLogRegion = 3; ///< Network Data -pub const otLogRegion_OT_LOG_REGION_NET_DATA: otLogRegion = 4; +pub const OT_LOG_REGION_NET_DATA: otLogRegion = 4; ///< ICMPv6 -pub const otLogRegion_OT_LOG_REGION_ICMP: otLogRegion = 5; +pub const OT_LOG_REGION_ICMP: otLogRegion = 5; ///< IPv6 -pub const otLogRegion_OT_LOG_REGION_IP6: otLogRegion = 6; +pub const OT_LOG_REGION_IP6: otLogRegion = 6; ///< TCP -pub const otLogRegion_OT_LOG_REGION_TCP: otLogRegion = 7; +pub const OT_LOG_REGION_TCP: otLogRegion = 7; ///< IEEE 802.15.4 MAC -pub const otLogRegion_OT_LOG_REGION_MAC: otLogRegion = 8; +pub const OT_LOG_REGION_MAC: otLogRegion = 8; ///< Memory -pub const otLogRegion_OT_LOG_REGION_MEM: otLogRegion = 9; +pub const OT_LOG_REGION_MEM: otLogRegion = 9; ///< NCP -pub const otLogRegion_OT_LOG_REGION_NCP: otLogRegion = 10; +pub const OT_LOG_REGION_NCP: otLogRegion = 10; ///< Mesh Commissioning Protocol -pub const otLogRegion_OT_LOG_REGION_MESH_COP: otLogRegion = 11; +pub const OT_LOG_REGION_MESH_COP: otLogRegion = 11; ///< Network Diagnostic -pub const otLogRegion_OT_LOG_REGION_NET_DIAG: otLogRegion = 12; +pub const OT_LOG_REGION_NET_DIAG: otLogRegion = 12; ///< Platform -pub const otLogRegion_OT_LOG_REGION_PLATFORM: otLogRegion = 13; +pub const OT_LOG_REGION_PLATFORM: otLogRegion = 13; ///< CoAP -pub const otLogRegion_OT_LOG_REGION_COAP: otLogRegion = 14; +pub const OT_LOG_REGION_COAP: otLogRegion = 14; ///< CLI -pub const otLogRegion_OT_LOG_REGION_CLI: otLogRegion = 15; +pub const OT_LOG_REGION_CLI: otLogRegion = 15; ///< OpenThread Core -pub const otLogRegion_OT_LOG_REGION_CORE: otLogRegion = 16; +pub const OT_LOG_REGION_CORE: otLogRegion = 16; ///< Utility module -pub const otLogRegion_OT_LOG_REGION_UTIL: otLogRegion = 17; +pub const OT_LOG_REGION_UTIL: otLogRegion = 17; ///< Backbone Router (available since Thread 1.2) -pub const otLogRegion_OT_LOG_REGION_BBR: otLogRegion = 18; +pub const OT_LOG_REGION_BBR: otLogRegion = 18; ///< Multicast Listener Registration (available since Thread 1.2) -pub const otLogRegion_OT_LOG_REGION_MLR: otLogRegion = 19; +pub const OT_LOG_REGION_MLR: otLogRegion = 19; ///< Domain Unicast Address (available since Thread 1.2) -pub const otLogRegion_OT_LOG_REGION_DUA: otLogRegion = 20; +pub const OT_LOG_REGION_DUA: otLogRegion = 20; ///< Border Router -pub const otLogRegion_OT_LOG_REGION_BR: otLogRegion = 21; +pub const OT_LOG_REGION_BR: otLogRegion = 21; ///< Service Registration Protocol (SRP) -pub const otLogRegion_OT_LOG_REGION_SRP: otLogRegion = 22; +pub const OT_LOG_REGION_SRP: otLogRegion = 22; ///< DNS -pub const otLogRegion_OT_LOG_REGION_DNS: otLogRegion = 23; +pub const OT_LOG_REGION_DNS: otLogRegion = 23; /// Represents log regions. /// /// The support for log region is removed and instead each core module can define its own name to appended to the logs. @@ -11827,21 +11830,21 @@ unsafe extern "C" { pub fn otDnsIsNameCompressionEnabled() -> bool; } ///< Item to be added/registered. -pub const otSrpClientItemState_OT_SRP_CLIENT_ITEM_STATE_TO_ADD: otSrpClientItemState = 0; +pub const OT_SRP_CLIENT_ITEM_STATE_TO_ADD: otSrpClientItemState = 0; ///< Item is being added/registered. -pub const otSrpClientItemState_OT_SRP_CLIENT_ITEM_STATE_ADDING: otSrpClientItemState = 1; +pub const OT_SRP_CLIENT_ITEM_STATE_ADDING: otSrpClientItemState = 1; ///< Item to be refreshed (re-register to renew lease). -pub const otSrpClientItemState_OT_SRP_CLIENT_ITEM_STATE_TO_REFRESH: otSrpClientItemState = 2; +pub const OT_SRP_CLIENT_ITEM_STATE_TO_REFRESH: otSrpClientItemState = 2; ///< Item is being refreshed. -pub const otSrpClientItemState_OT_SRP_CLIENT_ITEM_STATE_REFRESHING: otSrpClientItemState = 3; +pub const OT_SRP_CLIENT_ITEM_STATE_REFRESHING: otSrpClientItemState = 3; ///< Item to be removed. -pub const otSrpClientItemState_OT_SRP_CLIENT_ITEM_STATE_TO_REMOVE: otSrpClientItemState = 4; +pub const OT_SRP_CLIENT_ITEM_STATE_TO_REMOVE: otSrpClientItemState = 4; ///< Item is being removed. -pub const otSrpClientItemState_OT_SRP_CLIENT_ITEM_STATE_REMOVING: otSrpClientItemState = 5; +pub const OT_SRP_CLIENT_ITEM_STATE_REMOVING: otSrpClientItemState = 5; ///< Item is registered with server. -pub const otSrpClientItemState_OT_SRP_CLIENT_ITEM_STATE_REGISTERED: otSrpClientItemState = 6; +pub const OT_SRP_CLIENT_ITEM_STATE_REGISTERED: otSrpClientItemState = 6; ///< Item is removed. -pub const otSrpClientItemState_OT_SRP_CLIENT_ITEM_STATE_REMOVED: otSrpClientItemState = 7; +pub const OT_SRP_CLIENT_ITEM_STATE_REMOVED: otSrpClientItemState = 7; /// Specifies an SRP client item (service or host info) state. pub type otSrpClientItemState = ::core::ffi::c_uchar; /// Represents an SRP client host info. diff --git a/openthread-sys/src/lib.rs b/openthread-sys/src/lib.rs index e288c8be..f4977243 100644 --- a/openthread-sys/src/lib.rs +++ b/openthread-sys/src/lib.rs @@ -32,6 +32,13 @@ //! Note that this list is likely to change over time. #![no_std] +#![allow( + rustdoc::bare_urls, + rustdoc::broken_intra_doc_links, + rustdoc::invalid_html_tags, + rustdoc::invalid_rust_codeblocks, + reason = "Documentation is generated from the C header files" +)] #![allow(unknown_lints)] pub use bindings::*; diff --git a/openthread/src/dataset.rs b/openthread/src/dataset.rs index 2b878b1e..6ea55d7e 100644 --- a/openthread/src/dataset.rs +++ b/openthread/src/dataset.rs @@ -4,9 +4,9 @@ use crate::sys::{ otDatasetParseTlvs, otDatasetSetActive, otDatasetSetActiveTlvs, otDatasetSetPending, - otDatasetSetPendingTlvs, otError_OT_ERROR_INVALID_ARGS, otError_OT_ERROR_NO_BUFS, - otExtendedPanId, otMeshLocalPrefix, otNetworkKey, otOperationalDataset, - otOperationalDatasetTlvs, otPskc, otTimestamp, + otDatasetSetPendingTlvs, otExtendedPanId, otMeshLocalPrefix, otNetworkKey, + otOperationalDataset, otOperationalDatasetTlvs, otPskc, otTimestamp, OT_ERROR_INVALID_ARGS, + OT_ERROR_NO_BUFS, }; use crate::{ot, OpenThread, OtActiveState, OtError}; @@ -203,7 +203,7 @@ impl OperationalDataset<'_> { raw_dataset: &mut otOperationalDataset, ) -> Result<(), OtError> { if tlv.len() > ot_tlv.mTlvs.len() { - Err(OtError::new(otError_OT_ERROR_NO_BUFS))?; + Err(OtError::new(OT_ERROR_NO_BUFS))?; } ot_tlv.mTlvs[..tlv.len()].copy_from_slice(tlv); @@ -366,7 +366,7 @@ impl OpenThread<'_> { /// Populates the internal OT TLV dataset structure with the given dataset in TLV slice format. fn fill_dataset_tlv(state: &mut OtActiveState<'_>, dataset: &[u8]) -> Result<(), OtError> { if state.ot.dataset_resources.dataset_tlv.mTlvs.len() < dataset.len() { - Err(OtError::new(otError_OT_ERROR_NO_BUFS))?; + Err(OtError::new(OT_ERROR_NO_BUFS))?; } state.ot.dataset_resources.dataset_tlv.mTlvs[..dataset.len()].copy_from_slice(dataset); @@ -390,14 +390,14 @@ impl OpenThread<'_> { { let byte = (chf .to_digit(16) - .ok_or(OtError::new(otError_OT_ERROR_INVALID_ARGS))? + .ok_or(OtError::new(OT_ERROR_INVALID_ARGS))? << 4) | chs .to_digit(16) - .ok_or(OtError::new(otError_OT_ERROR_INVALID_ARGS))?; + .ok_or(OtError::new(OT_ERROR_INVALID_ARGS))?; if offset >= state.ot.dataset_resources.dataset_tlv.mTlvs.len() { - Err(OtError::new(otError_OT_ERROR_NO_BUFS))?; + Err(OtError::new(OT_ERROR_NO_BUFS))?; } state.ot.dataset_resources.dataset_tlv.mTlvs[offset] = byte as _; diff --git a/openthread/src/enal.rs b/openthread/src/enal.rs index 80c44209..9dd36627 100644 --- a/openthread/src/enal.rs +++ b/openthread/src/enal.rs @@ -1,6 +1,6 @@ use core::net::{Ipv4Addr, SocketAddr, SocketAddrV6}; -use crate::sys::otError_OT_ERROR_FAILED; +use crate::sys::OT_ERROR_FAILED; use crate::{OpenThread, OtError, UdpSocket}; impl edge_nal::io::Error for OtError { @@ -199,7 +199,7 @@ impl<'a> edge_nal::UdpBind for OpenThread<'a> { fn socket_addr_v6(addr: SocketAddr) -> Result { match addr { - SocketAddr::V4(_) => Err(OtError::new(otError_OT_ERROR_FAILED)), + SocketAddr::V4(_) => Err(OtError::new(OT_ERROR_FAILED)), SocketAddr::V6(v6) => Ok(v6), } } diff --git a/openthread/src/lib.rs b/openthread/src/lib.rs index 2e44478e..23676246 100644 --- a/openthread/src/lib.rs +++ b/openthread/src/lib.rs @@ -67,20 +67,17 @@ mod srp; mod udp; use sys::{ - otChangedFlags, otDeviceRole, otDeviceRole_OT_DEVICE_ROLE_CHILD, - otDeviceRole_OT_DEVICE_ROLE_DETACHED, otDeviceRole_OT_DEVICE_ROLE_DISABLED, - otDeviceRole_OT_DEVICE_ROLE_LEADER, otDeviceRole_OT_DEVICE_ROLE_ROUTER, otError, - otError_OT_ERROR_ABORT, otError_OT_ERROR_CHANNEL_ACCESS_FAILURE, otError_OT_ERROR_DROP, - otError_OT_ERROR_NONE, otError_OT_ERROR_NOT_FOUND, otError_OT_ERROR_NO_ACK, - otError_OT_ERROR_NO_BUFS, otInstance, otInstanceFinalize, otInstanceInitSingle, otIp6Address, - otIp6GetUnicastAddresses, otIp6IsEnabled, otIp6NewMessageFromBuffer, otIp6Send, + otChangedFlags, otDeviceRole, otError, otInstance, otInstanceFinalize, otInstanceInitSingle, + otIp6Address, otIp6GetUnicastAddresses, otIp6IsEnabled, otIp6NewMessageFromBuffer, otIp6Send, otIp6SetEnabled, otIp6SetReceiveCallback, otLinkModeConfig, otMessage, otMessageFree, - otMessagePriority_OT_MESSAGE_PRIORITY_NORMAL, otMessageRead, otMessageSettings, - otOperationalDataset, otOperationalDatasetTlvs, otPlatAlarmMilliFired, otPlatRadioReceiveDone, - otPlatRadioTxDone, otPlatRadioTxStarted, otRadioCaps, otRadioFrame, otSetStateChangedCallback, - otTaskletsProcess, otThreadGetDeviceRole, otThreadGetExtendedPanId, otThreadSetEnabled, - otThreadSetLinkMode, OT_CHANGED_THREAD_ROLE, OT_RADIO_CAPS_ACK_TIMEOUT, - OT_RADIO_FRAME_MAX_SIZE, + otMessageRead, otMessageSettings, otOperationalDataset, otOperationalDatasetTlvs, + otPlatAlarmMilliFired, otPlatRadioReceiveDone, otPlatRadioTxDone, otPlatRadioTxStarted, + otRadioCaps, otRadioFrame, otSetStateChangedCallback, otTaskletsProcess, otThreadGetDeviceRole, + otThreadGetExtendedPanId, otThreadSetEnabled, otThreadSetLinkMode, OT_CHANGED_THREAD_ROLE, + OT_DEVICE_ROLE_CHILD, OT_DEVICE_ROLE_DETACHED, OT_DEVICE_ROLE_DISABLED, OT_DEVICE_ROLE_LEADER, + OT_DEVICE_ROLE_ROUTER, OT_ERROR_ABORT, OT_ERROR_CHANNEL_ACCESS_FAILURE, OT_ERROR_DROP, + OT_ERROR_NONE, OT_ERROR_NOT_FOUND, OT_ERROR_NO_ACK, OT_ERROR_NO_BUFS, + OT_MESSAGE_PRIORITY_NORMAL, OT_RADIO_CAPS_ACK_TIMEOUT, OT_RADIO_FRAME_MAX_SIZE, }; /// A newtype wrapper over the native OpenThread error type (`otError`). @@ -122,7 +119,7 @@ impl core::error::Error for OtError {} macro_rules! ot { ($code: expr) => {{ match $code { - $crate::sys::otError_OT_ERROR_NONE => Ok(()), + $crate::sys::OT_ERROR_NONE => Ok(()), err => Err($crate::OtError::new(err)), } }}; @@ -139,7 +136,7 @@ pub trait IntoOtCode { impl IntoOtCode for Result<(), OtError> { fn into_ot_code(self) -> otError { match self { - Ok(_) => otError_OT_ERROR_NONE, + Ok(_) => OT_ERROR_NONE, Err(e) => e.into_inner(), } } @@ -176,7 +173,7 @@ impl<'a> OpenThread<'a> { { // `OpenThread` is already instantiated; can't instantiate another instance // until all `OpenThread` instances are dropped - Err(OtError::new(otError_OT_ERROR_NO_BUFS))?; + Err(OtError::new(OT_ERROR_NO_BUFS))?; } // Needed so that we convert from the the actual `'a` lifetime of `rng` to the fake `'static` lifetime in `OtResources` @@ -853,7 +850,7 @@ impl<'a> OpenThread<'a> { state.ot.instance, &mut state.ot.radio_resources.snd_frame, core::ptr::null_mut(), - otError_OT_ERROR_ABORT, + OT_ERROR_ABORT, ); } } @@ -897,7 +894,7 @@ impl<'a> OpenThread<'a> { state.ot.instance, &mut state.ot.radio_resources.snd_frame, ack_frame_ptr, - otError_OT_ERROR_NONE, + OT_ERROR_NONE, ); } } @@ -968,7 +965,7 @@ impl<'a> OpenThread<'a> { otPlatRadioReceiveDone( instance, &mut radio_resources.rcv_frame, - otError_OT_ERROR_NONE, + OT_ERROR_NONE, ); } } @@ -1033,11 +1030,11 @@ impl<'a> OpenThread<'a> { E: RadioError, { match err.kind() { - RadioErrorKind::TxFailed => otError_OT_ERROR_CHANNEL_ACCESS_FAILURE, + RadioErrorKind::TxFailed => OT_ERROR_CHANNEL_ACCESS_FAILURE, RadioErrorKind::TxAckFailed | RadioErrorKind::RxAckTimeout - | RadioErrorKind::RxAckInvalid => otError_OT_ERROR_NO_ACK, - _ => otError_OT_ERROR_ABORT, + | RadioErrorKind::RxAckInvalid => OT_ERROR_NO_ACK, + _ => OT_ERROR_ABORT, } } } @@ -1205,11 +1202,11 @@ impl From for DeviceRole { #[allow(non_snake_case)] fn from(value: otDeviceRole) -> Self { match value { - otDeviceRole_OT_DEVICE_ROLE_DISABLED => Self::Disabled, - otDeviceRole_OT_DEVICE_ROLE_DETACHED => Self::Detached, - otDeviceRole_OT_DEVICE_ROLE_CHILD => Self::Child, - otDeviceRole_OT_DEVICE_ROLE_ROUTER => Self::Router, - otDeviceRole_OT_DEVICE_ROLE_LEADER => Self::Leader, + OT_DEVICE_ROLE_DISABLED => Self::Disabled, + OT_DEVICE_ROLE_DETACHED => Self::Detached, + OT_DEVICE_ROLE_CHILD => Self::Child, + OT_DEVICE_ROLE_ROUTER => Self::Router, + OT_DEVICE_ROLE_LEADER => Self::Leader, other => Self::Other(other), } } @@ -1241,7 +1238,7 @@ impl<'a> OtActiveState<'a> { let udp = self .udp .as_mut() - .ok_or(OtError::new(crate::sys::otError_OT_ERROR_FAILED))?; + .ok_or(OtError::new(crate::sys::OT_ERROR_FAILED))?; Ok(udp) } @@ -1255,7 +1252,7 @@ impl<'a> OtActiveState<'a> { let srp = self .srp .as_mut() - .ok_or(OtError::new(crate::sys::otError_OT_ERROR_FAILED))?; + .ok_or(OtError::new(crate::sys::OT_ERROR_FAILED))?; Ok(srp) } @@ -1358,14 +1355,14 @@ impl<'a> OtContext<'a> { packet.len() as _, &otMessageSettings { mLinkSecurityEnabled: true, - mPriority: otMessagePriority_OT_MESSAGE_PRIORITY_NORMAL as _, + mPriority: OT_MESSAGE_PRIORITY_NORMAL as _, }, ) }; if !msg.is_null() { let res = unsafe { otIp6Send(state.ot.instance, msg) }; - if res != otError_OT_ERROR_DROP { + if res != OT_ERROR_DROP { ot!(res)?; trace!("Transmitted IPv6 packet: {}", Bytes(packet)); @@ -1377,7 +1374,7 @@ impl<'a> OtContext<'a> { Ok(()) } else { - Err(OtError::new(otError_OT_ERROR_NO_BUFS)) + Err(OtError::new(OT_ERROR_NO_BUFS)) } } @@ -1758,7 +1755,7 @@ impl<'a> OtContext<'a> { ); if index < 0 { - Err(OtError::new(otError_OT_ERROR_NOT_FOUND))?; + Err(OtError::new(OT_ERROR_NOT_FOUND))?; } let state = self.state(); @@ -1767,7 +1764,7 @@ impl<'a> OtContext<'a> { let len = settings .get(key, index as _, buf)? - .ok_or(OtError::new(otError_OT_ERROR_NOT_FOUND))?; + .ok_or(OtError::new(OT_ERROR_NOT_FOUND))?; Ok(len) } @@ -1812,7 +1809,7 @@ impl<'a> OtContext<'a> { ); if index < 0 { - Err(OtError::new(otError_OT_ERROR_NOT_FOUND))?; + Err(OtError::new(OT_ERROR_NOT_FOUND))?; } let state = self.state(); @@ -1820,7 +1817,7 @@ impl<'a> OtContext<'a> { let settings = &mut state.ot.settings; if !settings.remove(key, Some(index as _))? { - Err(OtError::new(otError_OT_ERROR_NOT_FOUND))?; + Err(OtError::new(OT_ERROR_NOT_FOUND))?; } Ok(()) diff --git a/openthread/src/netdata.rs b/openthread/src/netdata.rs index fe4f9e2b..1616d83b 100644 --- a/openthread/src/netdata.rs +++ b/openthread/src/netdata.rs @@ -4,9 +4,9 @@ use core::{ }; use openthread_sys::{ - otBorderRouterConfig, otError_OT_ERROR_NONE, otNetDataGetNextOnMeshPrefix, - otRoutePreference_OT_ROUTE_PREFERENCE_HIGH, otRoutePreference_OT_ROUTE_PREFERENCE_LOW, - otRoutePreference_OT_ROUTE_PREFERENCE_MED, OT_NETWORK_DATA_ITERATOR_INIT, + otBorderRouterConfig, otNetDataGetNextOnMeshPrefix, OT_ERROR_NONE, + OT_NETWORK_DATA_ITERATOR_INIT, OT_ROUTE_PREFERENCE_HIGH, OT_ROUTE_PREFERENCE_LOW, + OT_ROUTE_PREFERENCE_MED, }; use crate::{OpenThread, OtError}; @@ -14,22 +14,22 @@ use crate::{OpenThread, OtError}; #[derive(Clone, Debug, Eq, PartialEq, Hash)] pub enum OtRoutePreference { /// Low route preference - OtRoutePreferenceLow = otRoutePreference_OT_ROUTE_PREFERENCE_LOW as isize, + OtRoutePreferenceLow = OT_ROUTE_PREFERENCE_LOW as isize, /// Medium route preference - OtRoutePreferenceMed = otRoutePreference_OT_ROUTE_PREFERENCE_MED as isize, + OtRoutePreferenceMed = OT_ROUTE_PREFERENCE_MED as isize, /// High route preference - OtRoutePreferenceHigh = otRoutePreference_OT_ROUTE_PREFERENCE_HIGH as isize, + OtRoutePreferenceHigh = OT_ROUTE_PREFERENCE_HIGH as isize, Unkown = 2, } #[allow(non_upper_case_globals, clippy::unnecessary_cast)] impl OtRoutePreference { fn from_ot_int(input: i32) -> Self { - // These cast are needed as otRoutePreference_OT_ROUTE_PREFERENCE_* are i8 for thumbv* + // These cast are needed as OT_ROUTE_PREFERENCE_* are i8 for thumbv* // but i32 for riscv32im* - const value_low: i32 = otRoutePreference_OT_ROUTE_PREFERENCE_LOW as i32; - const value_med: i32 = otRoutePreference_OT_ROUTE_PREFERENCE_MED as i32; - const value_high: i32 = otRoutePreference_OT_ROUTE_PREFERENCE_HIGH as i32; + const value_low: i32 = OT_ROUTE_PREFERENCE_LOW as i32; + const value_med: i32 = OT_ROUTE_PREFERENCE_MED as i32; + const value_high: i32 = OT_ROUTE_PREFERENCE_HIGH as i32; match input { value_low => OtRoutePreference::OtRoutePreferenceLow, value_med => OtRoutePreference::OtRoutePreferenceMed, @@ -209,7 +209,7 @@ impl OpenThread<'_> { &mut network_data_iterator, &mut a_config, ) - } == otError_OT_ERROR_NONE + } == OT_ERROR_NONE { f(Some(OtBorderRouterConfig::from_ot(a_config)))?; } diff --git a/openthread/src/platform.rs b/openthread/src/platform.rs index 8f8df0fc..3963cd2c 100644 --- a/openthread/src/platform.rs +++ b/openthread/src/platform.rs @@ -5,7 +5,7 @@ use core::ffi::{c_char, CStr}; use portable_atomic::AtomicUsize; -use openthread_sys::otError_OT_ERROR_NONE; +use openthread_sys::OT_ERROR_NONE; use crate::sys::{otError, otInstance, otLogLevel, otLogRegion, otRadioCaps, otRadioFrame}; use crate::{IntoOtCode, OtActiveState, OtContext}; @@ -206,7 +206,7 @@ extern "C" fn otPlatSettingsGet( }) { Ok(len) => { *value_length = len as _; - otError_OT_ERROR_NONE + OT_ERROR_NONE } Err(e) => e.into_inner(), } @@ -304,7 +304,7 @@ extern "C" fn otPlatLog( } } - otError_OT_ERROR_NONE + OT_ERROR_NONE } // Other C functions which might generally not be supported by MCU ROMs or by - say - `tinyrlibc` diff --git a/openthread/src/scan.rs b/openthread/src/scan.rs index cde487a6..96f03796 100644 --- a/openthread/src/scan.rs +++ b/openthread/src/scan.rs @@ -3,14 +3,14 @@ use core::future::poll_fn; use crate::fmt::bitflags; use crate::sys::{ - otActiveScanResult, otError_OT_ERROR_BUSY, otInstance, otLinkActiveScan, - otLinkIsActiveScanInProgress, OT_CHANNEL_10_MASK, OT_CHANNEL_11_MASK, OT_CHANNEL_12_MASK, - OT_CHANNEL_13_MASK, OT_CHANNEL_14_MASK, OT_CHANNEL_15_MASK, OT_CHANNEL_16_MASK, - OT_CHANNEL_17_MASK, OT_CHANNEL_18_MASK, OT_CHANNEL_19_MASK, OT_CHANNEL_1_MASK, - OT_CHANNEL_20_MASK, OT_CHANNEL_21_MASK, OT_CHANNEL_22_MASK, OT_CHANNEL_23_MASK, - OT_CHANNEL_24_MASK, OT_CHANNEL_25_MASK, OT_CHANNEL_26_MASK, OT_CHANNEL_2_MASK, - OT_CHANNEL_3_MASK, OT_CHANNEL_4_MASK, OT_CHANNEL_5_MASK, OT_CHANNEL_6_MASK, OT_CHANNEL_7_MASK, - OT_CHANNEL_8_MASK, OT_CHANNEL_9_MASK, + otActiveScanResult, otInstance, otLinkActiveScan, otLinkIsActiveScanInProgress, + OT_CHANNEL_10_MASK, OT_CHANNEL_11_MASK, OT_CHANNEL_12_MASK, OT_CHANNEL_13_MASK, + OT_CHANNEL_14_MASK, OT_CHANNEL_15_MASK, OT_CHANNEL_16_MASK, OT_CHANNEL_17_MASK, + OT_CHANNEL_18_MASK, OT_CHANNEL_19_MASK, OT_CHANNEL_1_MASK, OT_CHANNEL_20_MASK, + OT_CHANNEL_21_MASK, OT_CHANNEL_22_MASK, OT_CHANNEL_23_MASK, OT_CHANNEL_24_MASK, + OT_CHANNEL_25_MASK, OT_CHANNEL_26_MASK, OT_CHANNEL_2_MASK, OT_CHANNEL_3_MASK, + OT_CHANNEL_4_MASK, OT_CHANNEL_5_MASK, OT_CHANNEL_6_MASK, OT_CHANNEL_7_MASK, OT_CHANNEL_8_MASK, + OT_CHANNEL_9_MASK, OT_ERROR_BUSY, }; use crate::{ot, OpenThread, OtContext, OtError}; @@ -137,7 +137,7 @@ impl<'a> OpenThread<'a> { if in_progress { warn!("Another scan in progress"); - return Err(OtError::new(otError_OT_ERROR_BUSY)); + return Err(OtError::new(OT_ERROR_BUSY)); } { diff --git a/openthread/src/settings.rs b/openthread/src/settings.rs index 5ea855e2..fb564c9b 100644 --- a/openthread/src/settings.rs +++ b/openthread/src/settings.rs @@ -11,7 +11,7 @@ use embassy_sync::blocking_mutex::Mutex; use crate::fmt::Bytes; use crate::signal::Signal; use crate::sys::{ - otError_OT_ERROR_INVALID_ARGS, otError_OT_ERROR_NOT_IMPLEMENTED, otError_OT_ERROR_NO_BUFS, + OT_ERROR_INVALID_ARGS, OT_ERROR_NOT_IMPLEMENTED, OT_ERROR_NO_BUFS, OT_SETTINGS_KEY_ACTIVE_DATASET, OT_SETTINGS_KEY_BORDER_AGENT_ID, OT_SETTINGS_KEY_BR_ON_LINK_PREFIXES, OT_SETTINGS_KEY_BR_ULA_PREFIX, OT_SETTINGS_KEY_CHILD_INFO, OT_SETTINGS_KEY_DAD_INFO, OT_SETTINGS_KEY_NETWORK_INFO, OT_SETTINGS_KEY_PARENT_INFO, @@ -36,9 +36,9 @@ pub enum SettingsError { impl From for OtError { fn from(error: SettingsError) -> OtError { match error { - SettingsError::NoBufs => OtError::new(otError_OT_ERROR_NO_BUFS), - SettingsError::InvalidData => OtError::new(otError_OT_ERROR_INVALID_ARGS), - SettingsError::NotImplemented => OtError::new(otError_OT_ERROR_NOT_IMPLEMENTED), + SettingsError::NoBufs => OtError::new(OT_ERROR_NO_BUFS), + SettingsError::InvalidData => OtError::new(OT_ERROR_INVALID_ARGS), + SettingsError::NotImplemented => OtError::new(OT_ERROR_NOT_IMPLEMENTED), } } } diff --git a/openthread/src/srp.rs b/openthread/src/srp.rs index b2e3d5e0..632f3674 100644 --- a/openthread/src/srp.rs +++ b/openthread/src/srp.rs @@ -8,23 +8,19 @@ use core::net::{Ipv6Addr, SocketAddrV6}; use crate::signal::Signal; use crate::sys::{ - otDnsTxtEntry, otError_OT_ERROR_INVALID_ARGS, otError_OT_ERROR_INVALID_STATE, - otError_OT_ERROR_NO_BUFS, otIp6Address, otSrpClientAddService, otSrpClientClearHostAndServices, + otDnsTxtEntry, otIp6Address, otSrpClientAddService, otSrpClientClearHostAndServices, otSrpClientClearService, otSrpClientEnableAutoHostAddress, otSrpClientEnableAutoStartMode, otSrpClientGetHostInfo, otSrpClientGetKeyLeaseInterval, otSrpClientGetLeaseInterval, otSrpClientGetServerAddress, otSrpClientGetServices, otSrpClientGetTtl, otSrpClientHostInfo, otSrpClientIsAutoStartModeEnabled, otSrpClientIsRunning, otSrpClientItemState, - otSrpClientItemState_OT_SRP_CLIENT_ITEM_STATE_ADDING, - otSrpClientItemState_OT_SRP_CLIENT_ITEM_STATE_REFRESHING, - otSrpClientItemState_OT_SRP_CLIENT_ITEM_STATE_REGISTERED, - otSrpClientItemState_OT_SRP_CLIENT_ITEM_STATE_REMOVED, - otSrpClientItemState_OT_SRP_CLIENT_ITEM_STATE_REMOVING, - otSrpClientItemState_OT_SRP_CLIENT_ITEM_STATE_TO_ADD, - otSrpClientItemState_OT_SRP_CLIENT_ITEM_STATE_TO_REFRESH, - otSrpClientItemState_OT_SRP_CLIENT_ITEM_STATE_TO_REMOVE, otSrpClientRemoveHostAndServices, - otSrpClientRemoveService, otSrpClientService, otSrpClientSetHostAddresses, - otSrpClientSetHostName, otSrpClientSetKeyLeaseInterval, otSrpClientSetLeaseInterval, - otSrpClientSetTtl, otSrpClientStart, otSrpClientStop, + otSrpClientRemoveHostAndServices, otSrpClientRemoveService, otSrpClientService, + otSrpClientSetHostAddresses, otSrpClientSetHostName, otSrpClientSetKeyLeaseInterval, + otSrpClientSetLeaseInterval, otSrpClientSetTtl, otSrpClientStart, otSrpClientStop, + OT_ERROR_INVALID_ARGS, OT_ERROR_INVALID_STATE, OT_ERROR_NO_BUFS, + OT_SRP_CLIENT_ITEM_STATE_ADDING, OT_SRP_CLIENT_ITEM_STATE_REFRESHING, + OT_SRP_CLIENT_ITEM_STATE_REGISTERED, OT_SRP_CLIENT_ITEM_STATE_REMOVED, + OT_SRP_CLIENT_ITEM_STATE_REMOVING, OT_SRP_CLIENT_ITEM_STATE_TO_ADD, + OT_SRP_CLIENT_ITEM_STATE_TO_REFRESH, OT_SRP_CLIENT_ITEM_STATE_TO_REMOVE, }; use crate::{ot, to_ot_addr, to_sock_addr, OpenThread, OtContext, OtError}; @@ -220,14 +216,14 @@ impl defmt::Format for SrpState { impl From for SrpState { fn from(value: otSrpClientItemState) -> Self { match value { - otSrpClientItemState_OT_SRP_CLIENT_ITEM_STATE_TO_ADD => Self::ToAdd, - otSrpClientItemState_OT_SRP_CLIENT_ITEM_STATE_ADDING => Self::Adding, - otSrpClientItemState_OT_SRP_CLIENT_ITEM_STATE_TO_REFRESH => Self::ToRefresh, - otSrpClientItemState_OT_SRP_CLIENT_ITEM_STATE_REFRESHING => Self::Refreshing, - otSrpClientItemState_OT_SRP_CLIENT_ITEM_STATE_TO_REMOVE => Self::ToRemove, - otSrpClientItemState_OT_SRP_CLIENT_ITEM_STATE_REMOVING => Self::Removing, - otSrpClientItemState_OT_SRP_CLIENT_ITEM_STATE_REMOVED => Self::Removed, - otSrpClientItemState_OT_SRP_CLIENT_ITEM_STATE_REGISTERED => Self::Registered, + OT_SRP_CLIENT_ITEM_STATE_TO_ADD => Self::ToAdd, + OT_SRP_CLIENT_ITEM_STATE_ADDING => Self::Adding, + OT_SRP_CLIENT_ITEM_STATE_TO_REFRESH => Self::ToRefresh, + OT_SRP_CLIENT_ITEM_STATE_REFRESHING => Self::Refreshing, + OT_SRP_CLIENT_ITEM_STATE_TO_REMOVE => Self::ToRemove, + OT_SRP_CLIENT_ITEM_STATE_REMOVING => Self::Removing, + OT_SRP_CLIENT_ITEM_STATE_REMOVED => Self::Removed, + OT_SRP_CLIENT_ITEM_STATE_REGISTERED => Self::Registered, other => Self::Other(other), } } @@ -639,7 +635,7 @@ impl OpenThread<'_> { let srp = ot.state().srp()?; if srp.conf_taken { - Err(OtError::new(otError_OT_ERROR_INVALID_STATE))?; + Err(OtError::new(OT_ERROR_INVALID_STATE))?; } unsafe { @@ -808,7 +804,7 @@ impl OpenThread<'_> { .taken .iter() .position(|&taken| !taken) - .ok_or(OtError::new(otError_OT_ERROR_NO_BUFS))?; + .ok_or(OtError::new(OT_ERROR_NO_BUFS))?; let service_data = &mut srp.services[slot]; let buf = &mut srp.buffers[srp.buf_len * slot..srp.buf_len * (slot + 1)]; @@ -836,7 +832,7 @@ impl OpenThread<'_> { let srp = ot.state().srp()?; if slot > srp.services.len() || !srp.taken[slot] { - Err(OtError::new(otError_OT_ERROR_INVALID_ARGS))?; + Err(OtError::new(OT_ERROR_INVALID_ARGS))?; } if immediate { @@ -910,7 +906,7 @@ impl OtContext<'_> { let state = self.state(); if let Ok(srp) = state.srp() { - if host_info.mState == otSrpClientItemState_OT_SRP_CLIENT_ITEM_STATE_REMOVED { + if host_info.mState == OT_SRP_CLIENT_ITEM_STATE_REMOVED { srp.conf_taken = false; info!("SRP host removed"); } @@ -961,7 +957,7 @@ fn align_min(buf: &mut [u8], count: usize) -> Result<(&mut [T], &mut [u8]), O let (t_leading_buf0, t_buf, _) = unsafe { buf.align_to_mut::() }; if t_buf.len() < count { - Err(OtError::new(otError_OT_ERROR_NO_BUFS))?; + Err(OtError::new(OT_ERROR_NO_BUFS))?; } // Shrink `t_buf` to the number of requested items (count) @@ -983,7 +979,7 @@ fn store_str<'t>(str: &str, buf: &'t mut [u8]) -> Result<(&'t CStr, &'t mut [u8] let data_len = str.len() + 1; if data_len > buf.len() { - Err(OtError::new(otError_OT_ERROR_NO_BUFS))?; + Err(OtError::new(OT_ERROR_NO_BUFS))?; } let (str_buf, rem_buf) = buf.split_at_mut(data_len); @@ -1002,7 +998,7 @@ fn store_str<'t>(str: &str, buf: &'t mut [u8]) -> Result<(&'t CStr, &'t mut [u8] fn store_data<'t>(data: &[u8], buf: &'t mut [u8]) -> Result<(&'t [u8], &'t mut [u8]), OtError> { if data.len() > buf.len() { - Err(OtError::new(otError_OT_ERROR_NO_BUFS))?; + Err(OtError::new(OT_ERROR_NO_BUFS))?; } let (data_buf, rem_buf) = buf.split_at_mut(data.len()); diff --git a/openthread/src/udp.rs b/openthread/src/udp.rs index 94a512bb..62cf0066 100644 --- a/openthread/src/udp.rs +++ b/openthread/src/udp.rs @@ -6,10 +6,9 @@ use core::net::{Ipv6Addr, SocketAddrV6}; use crate::signal::Signal; use crate::sys::{ - otError_OT_ERROR_DROP, otError_OT_ERROR_NO_BUFS, otIp6Address, otIp6Address__bindgen_ty_1, - otMessage, otMessageAppend, otMessageGetLength, otMessageInfo, otMessageRead, - otNetifIdentifier_OT_NETIF_THREAD_INTERNAL, otSockAddr, otUdpBind, otUdpClose, otUdpConnect, - otUdpNewMessage, otUdpOpen, otUdpSend, otUdpSocket, + otIp6Address, otIp6Address__bindgen_ty_1, otMessage, otMessageAppend, otMessageGetLength, + otMessageInfo, otMessageRead, otSockAddr, otUdpBind, otUdpClose, otUdpConnect, otUdpNewMessage, + otUdpOpen, otUdpSend, otUdpSocket, OT_ERROR_DROP, OT_ERROR_NO_BUFS, OT_NETIF_THREAD_INTERNAL, }; use crate::{ot, to_ot_addr, to_sock_addr, Bytes, OpenThread, OtContext, OtError}; @@ -36,7 +35,7 @@ impl<'a> UdpSocket<'a> { state.ot.instance, &mut unwrap!(state.udp.as_mut()).sockets[this.slot].ot_socket, &to_ot_addr(local), - otNetifIdentifier_OT_NETIF_THREAD_INTERNAL, + OT_NETIF_THREAD_INTERNAL, ); } } @@ -77,7 +76,7 @@ impl<'a> UdpSocket<'a> { .sockets .iter() .position(|socket| !socket.taken) - .ok_or(otError_OT_ERROR_NO_BUFS)?; + .ok_or(OT_ERROR_NO_BUFS)?; let socket = &mut udp.sockets[slot]; socket.ot_socket = Default::default(); @@ -206,7 +205,7 @@ impl<'a> UdpSocket<'a> { message_info.mPeerAddr.mFields.m8 = dst.ip().octets(); let res = unsafe { otUdpSend(instance, &mut socket.ot_socket, msg, &message_info) }; - if res != otError_OT_ERROR_DROP { + if res != OT_ERROR_DROP { ot!(res)?; } else { // OpenThread will intentionally drop some multicast and ICMPv6 packets @@ -218,7 +217,7 @@ impl<'a> UdpSocket<'a> { Ok(()) } else { - Err(OtError::new(otError_OT_ERROR_NO_BUFS)) + Err(OtError::new(OT_ERROR_NO_BUFS)) } } @@ -395,7 +394,7 @@ impl UdpSocketCtx { }, mPort: 0, }, - mNetifId: otNetifIdentifier_OT_NETIF_THREAD_INTERNAL, + mNetifId: OT_NETIF_THREAD_INTERNAL, mHandler: None, mContext: core::ptr::null_mut(), mHandle: core::ptr::null_mut(), diff --git a/xtask/Cargo.lock b/xtask/Cargo.lock index aad6a090..e1fdf6f2 100644 --- a/xtask/Cargo.lock +++ b/xtask/Cargo.lock @@ -69,9 +69,9 @@ checksum = "6b964d184e89d9b6b67dd2715bc8e74cf3107fb2b529990c90cf517326150bf4" [[package]] name = "bindgen" -version = "0.71.1" +version = "0.72.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f58bf3d7db68cfbac37cfc485a8d711e87e064c3d0fe0435b92f7a407f9d6b3" +checksum = "993776b509cfb49c750f11b8f07a46fa23e0a1386ffc01fb1e7d343efc387895" dependencies = [ "bitflags 2.8.0", "cexpr", @@ -210,16 +210,26 @@ dependencies = [ ] [[package]] -name = "env_logger" -version = "0.10.2" +name = "env_filter" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4cd405aab171cb85d6735e5c8d9db038c17d3ca007a4d2c25f337935c3d90580" +checksum = "7a1c3cc8e57274ec99de65301228b537f1e4eedc1b8e0f9411c6caac8ae7308f" dependencies = [ - "humantime", - "is-terminal", "log", "regex", - "termcolor", +] + +[[package]] +name = "env_logger" +version = "0.11.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2daee4ea451f429a58296525ddf28b45a3b64f1acf6587e2067437bb11e218d" +dependencies = [ + "anstream", + "anstyle", + "env_filter", + "jiff", + "log", ] [[package]] @@ -259,41 +269,42 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" [[package]] -name = "hermit-abi" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbf6a919d6cf397374f7dfeeea91d974c7c0a7221d0d0f4f20d859d329e53fcc" - -[[package]] -name = "humantime" -version = "2.1.0" +name = "is_terminal_polyfill" +version = "1.70.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" +checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" [[package]] -name = "is-terminal" -version = "0.4.15" +name = "itertools" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e19b23d53f35ce9f56aebc7d1bb4e6ac1e9c0db7ac85c8d1760c04379edced37" +checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" dependencies = [ - "hermit-abi", - "libc", - "windows-sys", + "either", ] [[package]] -name = "is_terminal_polyfill" -version = "1.70.1" +name = "jiff" +version = "0.2.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" +checksum = "1a3546dc96b6d42c5f24902af9e2538e82e39ad350b0c766eb3fbf2d8f3d8359" +dependencies = [ + "jiff-static", + "log", + "portable-atomic", + "portable-atomic-util", + "serde_core", +] [[package]] -name = "itertools" -version = "0.13.0" +name = "jiff-static" +version = "0.2.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" +checksum = "2a8c8b344124222efd714b73bb41f8b5120b27a7cc1c75593a6ff768d9d05aa4" dependencies = [ - "either", + "proc-macro2", + "quote", + "syn", ] [[package]] @@ -357,6 +368,21 @@ version = "1.20.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "945462a4b81e43c4e3ba96bd7b49d834c6f61198356aa858733bc4acf3cbe62e" +[[package]] +name = "portable-atomic" +version = "1.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c33a9471896f1c69cecef8d20cbe2f7accd12527ce60845ff44c153bb2a21b49" + +[[package]] +name = "portable-atomic-util" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a9db96d7fa8782dd8c15ce32ffe8680bbd1e978a43bf51a34d39483540495f5" +dependencies = [ + "portable-atomic", +] + [[package]] name = "prettyplease" version = "0.2.29" @@ -475,6 +501,26 @@ version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "357703d41365b4b27c590e3ed91eabb1b663f07c4c084095e60cbed4362dff0d" +[[package]] +name = "serde_core" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "shlex" version = "1.3.0" @@ -508,15 +554,6 @@ dependencies = [ "remove_dir_all", ] -[[package]] -name = "termcolor" -version = "1.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755" -dependencies = [ - "winapi-util", -] - [[package]] name = "thiserror" version = "1.0.69" @@ -565,15 +602,6 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" -[[package]] -name = "winapi-util" -version = "0.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" -dependencies = [ - "windows-sys", -] - [[package]] name = "winapi-x86_64-pc-windows-gnu" version = "0.4.0" diff --git a/xtask/Cargo.toml b/xtask/Cargo.toml index 9da98a2f..d78a241e 100644 --- a/xtask/Cargo.toml +++ b/xtask/Cargo.toml @@ -13,8 +13,8 @@ rust-version = "1.84" [dependencies] anyhow = "1" -bindgen = "0.71" -env_logger = "0.10" +bindgen = "0.72" +env_logger = "0.11" log = "0.4" cmake = "0.1.52" cc = "1.1"