Crates.io | rasn-snmp |
lib.rs | rasn-snmp |
version | 0.15.3 |
source | src |
created_at | 2021-07-18 19:26:50.344159 |
updated_at | 2024-06-14 18:31:57.854979 |
description | Data types for handling the Simple Network Management Protocol |
homepage | |
repository | |
max_upload_size | |
id | 424462 |
size | 31,509 |
rasn-snmp
implementation of the protocol data types from IETF RFCs 1157,
1901, 3412, and 3416. This does not provide an implementation of an agent
or proxy, but provides the data types needed to build your own agent or
proxy implementation.
This library in combination with it's sibling crates rasn
, rasn-smi
,
and rasn-mib
allow you to decode, and encode SNMP protocol messages
using entirely safe Rust. All of these libraries are also #[no_std]
so
they support any platform that supports [alloc
].
use rasn_snmp::{v2c::Message, v2::Pdus};
let data: &[u8] = &[];
// Decode SNMPv2c message containing a SNMPv2 PDU.
let message: Message<Pdus> = rasn::ber::decode(data).unwrap();
// Handle the request.
match message.data {
Pdus::GetRequest(request) => {},
Pdus::GetNextRequest(request) => {},
Pdus::Response(request) => {},
// ...
# _ => {}
}