#aper #snmp #asn1 #ber #asn #cer #codec #encoding-formats #der #rasn

rasn-snmp

Data types for handling the Simple Network Management Protocol

28 releases (9 breaking)

0.12.5 Feb 3, 2024
0.12.4 Dec 4, 2023
0.12.3 Nov 25, 2023
0.8.2 Jul 11, 2023
0.3.1 Jul 19, 2021

#463 in Text processing

Download history 1583/week @ 2023-10-29 1276/week @ 2023-11-05 2594/week @ 2023-11-12 816/week @ 2023-11-19 2753/week @ 2023-11-26 2252/week @ 2023-12-03 1516/week @ 2023-12-10 712/week @ 2023-12-17 249/week @ 2023-12-24 2097/week @ 2023-12-31 1989/week @ 2024-01-07 2365/week @ 2024-01-14 2096/week @ 2024-01-21 1800/week @ 2024-01-28 1688/week @ 2024-02-04 2516/week @ 2024-02-11

8,130 downloads per month

MIT/Apache

560KB
13K SLoC

Simple Network Management Protocol

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) => {},
    // ...
# _ => {}
}

Dependencies

~9.5MB
~190K SLoC