52 releases (18 breaking)

0.22.0 Nov 26, 2024
0.20.0 Sep 30, 2024
0.16.0 Jul 17, 2024
0.13.1 Mar 21, 2024
0.3.1 Jul 19, 2021

#1424 in Network programming

Download history 2276/week @ 2024-08-17 1836/week @ 2024-08-24 1645/week @ 2024-08-31 2170/week @ 2024-09-07 1535/week @ 2024-09-14 2183/week @ 2024-09-21 3039/week @ 2024-09-28 2114/week @ 2024-10-05 1476/week @ 2024-10-12 2021/week @ 2024-10-19 2390/week @ 2024-10-26 860/week @ 2024-11-02 1813/week @ 2024-11-09 2408/week @ 2024-11-16 680/week @ 2024-11-23 3214/week @ 2024-11-30

8,298 downloads per month
Used in rsnmp

MIT/Apache

1MB
19K 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

~7.5MB
~142K SLoC