pub enum Notification {
TrapV1 {
community: Bytes,
trap: TrapV1Pdu,
},
TrapV2c {
community: Bytes,
uptime: u32,
trap_oid: Oid,
varbinds: Vec<VarBind>,
request_id: i32,
},
TrapV3 {
username: Bytes,
context_engine_id: Bytes,
context_name: Bytes,
security_level: SecurityLevel,
uptime: u32,
trap_oid: Oid,
varbinds: Vec<VarBind>,
request_id: i32,
},
InformV2c {
community: Bytes,
uptime: u32,
trap_oid: Oid,
varbinds: Vec<VarBind>,
request_id: i32,
},
InformV3 {
username: Bytes,
context_engine_id: Bytes,
context_name: Bytes,
security_level: SecurityLevel,
uptime: u32,
trap_oid: Oid,
varbinds: Vec<VarBind>,
request_id: i32,
},
}Expand description
Received SNMP notification.
This enum represents all types of SNMP notifications that can be received:
SNMPv1Trap (different PDU structure)- SNMPv2c/v3 Trap (standard PDU with sysUpTime.0 and snmpTrapOID.0)
InformRequest(confirmed notification, response will be sent automatically)
Variants§
TrapV1
SNMPv1 Trap with unique PDU structure.
TrapV2c
SNMPv2c Trap (unconfirmed notification).
Fields
TrapV3
SNMPv3 Trap (unconfirmed notification).
Fields
security_level: SecurityLevelSecurity level the message was received at. A NoAuthNoPriv
notification is unauthenticated: its username is an unverified
claim. Callers requiring authentication must check this.
InformV2c
InformRequest (confirmed notification) - v2c.
A response is automatically sent when this notification is received.
Fields
InformV3
InformRequest (confirmed notification) - v3.
A response is automatically sent when this notification is received.
Fields
security_level: SecurityLevelSecurity level the message was received at. A NoAuthNoPriv
notification is unauthenticated: its username is an unverified
claim. Callers requiring authentication must check this.
Implementations§
Source§impl Notification
impl Notification
Sourcepub fn trap_oid(&self) -> Result<Oid>
pub fn trap_oid(&self) -> Result<Oid>
Get the trap/notification OID.
For TrapV1, this is derived from enterprise + generic/specific trap.
For v2c/v3, this is the snmpTrapOID.0 value.
Sourcepub fn security_level(&self) -> Option<SecurityLevel>
pub fn security_level(&self) -> Option<SecurityLevel>
Get the security level the notification was received at.
Returns None for v1/v2c notifications (community-based, no USM
security level). For v3 notifications, NoAuthNoPriv means the
message was not authenticated and its username is an unverified
claim.
Sourcepub fn is_confirmed(&self) -> bool
pub fn is_confirmed(&self) -> bool
Check if this is a confirmed notification (InformRequest).
Trait Implementations§
Source§impl Clone for Notification
impl Clone for Notification
Source§fn clone(&self) -> Notification
fn clone(&self) -> Notification
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl !Freeze for Notification
impl RefUnwindSafe for Notification
impl Send for Notification
impl Sync for Notification
impl Unpin for Notification
impl UnsafeUnpin for Notification
impl UnwindSafe for Notification
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more