#protocols #ietf-rfc #snmp #management #rasn #safe #data

rasn-snmp

Data types for handling the Simple Network Management Protocol

32 releases (12 breaking)

new 0.15.0 May 17, 2024
0.13.1 Mar 21, 2024
0.12.4 Dec 4, 2023
0.12.3 Nov 25, 2023
0.3.1 Jul 19, 2021

#2 in #snmp

Download history 1475/week @ 2024-01-26 1682/week @ 2024-02-02 2197/week @ 2024-02-09 1374/week @ 2024-02-16 2345/week @ 2024-02-23 2765/week @ 2024-03-01 1698/week @ 2024-03-08 1424/week @ 2024-03-15 2052/week @ 2024-03-22 1268/week @ 2024-03-29 1373/week @ 2024-04-05 1462/week @ 2024-04-12 2263/week @ 2024-04-19 3418/week @ 2024-04-26 1753/week @ 2024-05-03 894/week @ 2024-05-10

8,600 downloads per month

MIT/Apache

720KB
17K 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

~10MB
~198K SLoC