pub struct SnmpV3Message { /* private fields */ }Expand description
SNMPv3 top-level message wrapper fields.
This models the RFC 3412 message framing only. Security-model processing, USM credentials, encryption, authentication, timeliness, and scoped-PDU interpretation belong to later packet slices or generated tools.
Implementations§
Source§impl SnmpV3Message
impl SnmpV3Message
Sourcepub fn new(
msg_id: i64,
max_size: i64,
flags: impl Into<Vec<u8>>,
security_model: i64,
security_parameters: impl Into<Vec<u8>>,
scoped_data: impl Into<Vec<u8>>,
) -> Self
pub fn new( msg_id: i64, max_size: i64, flags: impl Into<Vec<u8>>, security_model: i64, security_parameters: impl Into<Vec<u8>>, scoped_data: impl Into<Vec<u8>>, ) -> Self
Build an SNMPv3 message wrapper with raw security/scoped-data bytes.
Sourcepub fn new_plaintext(
msg_id: i64,
max_size: i64,
flags: impl Into<Vec<u8>>,
security_model: i64,
security_parameters: impl Into<Vec<u8>>,
scoped_pdu: SnmpScopedPdu,
) -> Result<Self>
pub fn new_plaintext( msg_id: i64, max_size: i64, flags: impl Into<Vec<u8>>, security_model: i64, security_parameters: impl Into<Vec<u8>>, scoped_pdu: SnmpScopedPdu, ) -> Result<Self>
Build an SNMPv3 message wrapper carrying plaintext scoped-PDU data.
Sourcepub fn new_usm(
msg_id: i64,
max_size: i64,
flags: impl Into<Vec<u8>>,
usm: SnmpUsmSecurityParameters,
scoped_data: impl Into<Vec<u8>>,
) -> Result<Self>
pub fn new_usm( msg_id: i64, max_size: i64, flags: impl Into<Vec<u8>>, usm: SnmpUsmSecurityParameters, scoped_data: impl Into<Vec<u8>>, ) -> Result<Self>
Build an SNMPv3 message wrapper carrying USM security parameters.
Sourcepub fn new_encrypted_usm(
msg_id: i64,
max_size: i64,
flags: impl Into<Vec<u8>>,
usm: SnmpUsmSecurityParameters,
encrypted_pdu: impl Into<Vec<u8>>,
) -> Result<Self>
pub fn new_encrypted_usm( msg_id: i64, max_size: i64, flags: impl Into<Vec<u8>>, usm: SnmpUsmSecurityParameters, encrypted_pdu: impl Into<Vec<u8>>, ) -> Result<Self>
Build an SNMPv3 USM message carrying opaque encrypted scoped data.
Sourcepub fn new_plaintext_report(
msg_id: i64,
max_size: i64,
flags: impl Into<Vec<u8>>,
security_model: i64,
security_parameters: impl Into<Vec<u8>>,
context_engine_id: impl Into<Vec<u8>>,
context_name: impl Into<Vec<u8>>,
request_id: i64,
varbinds: SnmpVarBindList,
) -> Result<Self>
pub fn new_plaintext_report( msg_id: i64, max_size: i64, flags: impl Into<Vec<u8>>, security_model: i64, security_parameters: impl Into<Vec<u8>>, context_engine_id: impl Into<Vec<u8>>, context_name: impl Into<Vec<u8>>, request_id: i64, varbinds: SnmpVarBindList, ) -> Result<Self>
Build an SNMPv3 message with a plaintext Report-PDU.
Sourcepub fn new_usm_report(
msg_id: i64,
max_size: i64,
flags: impl Into<Vec<u8>>,
usm: SnmpUsmSecurityParameters,
context_engine_id: impl Into<Vec<u8>>,
context_name: impl Into<Vec<u8>>,
request_id: i64,
varbinds: SnmpVarBindList,
) -> Result<Self>
pub fn new_usm_report( msg_id: i64, max_size: i64, flags: impl Into<Vec<u8>>, usm: SnmpUsmSecurityParameters, context_engine_id: impl Into<Vec<u8>>, context_name: impl Into<Vec<u8>>, request_id: i64, varbinds: SnmpVarBindList, ) -> Result<Self>
Build an SNMPv3 USM message with a plaintext Report-PDU.
Sourcepub const fn version(&self) -> SnmpVersion
pub const fn version(&self) -> SnmpVersion
Message wrapper version.
Sourcepub const fn version_value(&self) -> i64
pub const fn version_value(&self) -> i64
Raw message wrapper version INTEGER.
Sourcepub const fn global_data(&self) -> &SnmpV3GlobalData
pub const fn global_data(&self) -> &SnmpV3GlobalData
RFC 3412 HeaderData global message fields.
Sourcepub fn flags_value(&self) -> SnmpV3Flags
pub fn flags_value(&self) -> SnmpV3Flags
Typed view of the first msgFlags octet.
Sourcepub const fn security_model(&self) -> i64
pub const fn security_model(&self) -> i64
RFC 3412 msgSecurityModel INTEGER value.
Sourcepub fn security_parameters(&self) -> &[u8] ⓘ
pub fn security_parameters(&self) -> &[u8] ⓘ
Raw RFC 3412 msgSecurityParameters OCTET STRING bytes.
Sourcepub const fn raw_security_parameters(&self) -> &SnmpRawSecurityParameters
pub const fn raw_security_parameters(&self) -> &SnmpRawSecurityParameters
Raw security-parameters representation with security-model metadata.
Sourcepub fn usm_security_parameters(
&self,
) -> Result<Option<SnmpUsmSecurityParameters>>
pub fn usm_security_parameters( &self, ) -> Result<Option<SnmpUsmSecurityParameters>>
Decode USM security parameters when this message uses the USM model.
Sourcepub fn scoped_data(&self) -> &[u8] ⓘ
pub fn scoped_data(&self) -> &[u8] ⓘ
Raw RFC 3412 ScopedPduData TLV bytes.
Sourcepub fn scoped_pdu(&self) -> Result<Option<SnmpScopedPdu>>
pub fn scoped_pdu(&self) -> Result<Option<SnmpScopedPdu>>
Decode plaintext scoped-PDU data, if this message carries plaintext.
Sourcepub fn encrypted_scoped_data(&self) -> Result<Option<SnmpEncryptedScopedData>>
pub fn encrypted_scoped_data(&self) -> Result<Option<SnmpEncryptedScopedData>>
Decode encrypted scoped data as opaque bytes, if this message carries it.
Sourcepub fn scoped_data_kind(&self) -> &'static str
pub fn scoped_data_kind(&self) -> &'static str
Source-backed scoped-data CHOICE label.
Sourcepub fn encrypted_scoped_pdu_len(&self) -> Result<Option<usize>>
pub fn encrypted_scoped_pdu_len(&self) -> Result<Option<usize>>
Raw encryptedPDU content length, if scoped data is encrypted.
Trait Implementations§
Source§impl Clone for SnmpV3Message
impl Clone for SnmpV3Message
Source§fn clone(&self) -> SnmpV3Message
fn clone(&self) -> SnmpV3Message
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SnmpV3Message
impl Debug for SnmpV3Message
impl Eq for SnmpV3Message
Source§impl PartialEq for SnmpV3Message
impl PartialEq for SnmpV3Message
Source§fn eq(&self, other: &SnmpV3Message) -> bool
fn eq(&self, other: &SnmpV3Message) -> bool
self and other values to be equal, and is used by ==.