https://github.com/kassane/snmp.d
net-snmp bindings for D
https://github.com/kassane/snmp.d
bindings d dlang net-snmp snmp snmp-client
Last synced: 19 days ago
JSON representation
net-snmp bindings for D
- Host: GitHub
- URL: https://github.com/kassane/snmp.d
- Owner: kassane
- License: bsl-1.0
- Created: 2026-03-16T18:49:06.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2026-03-16T21:34:41.000Z (3 months ago)
- Last Synced: 2026-06-08T14:34:23.772Z (19 days ago)
- Topics: bindings, d, dlang, net-snmp, snmp, snmp-client
- Language: D
- Homepage: http://snmp-d.dub.pm/
- Size: 14.6 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# snmp.d
[](https://github.com/kassane/snmp.d/actions/workflows/ci.yml)
D bindings for [net-snmp](http://www.net-snmp.org/). Supports SNMPv1/v2c/v3, MIB loading, and subagents.
## Requirements
- **net-snmp** ≥ 5.9 — `sudo apt install libsnmp-dev` / `brew install net-snmp`
- **D frontend** ≥ 2.111 (LDC or DMD)
> **macOS:** net-snmp is keg-only. Add to your environment:
> ```sh
> export LDFLAGS="-L$(brew --prefix net-snmp)/lib"
> export CPPFLAGS="-I$(brew --prefix net-snmp)/include"
> ```
## Usage
Add in your `dub.json`|`dub.sdl`:
```sh
dub add snmp-d
```
## Modules
| Module | Provides |
|--------|----------|
| `snmp.session` | `SNMPSession` — `get`, `getNext`, `getBulk` |
| `snmp.pdu` | `SNMPResponse` — `foreach`, `length` |
| `snmp.varbind` | `VarBind` — cursor over response variables, value extractors |
| `snmp.oid` | `OID` — parse, compare, format, prefix checks |
| `snmp.v3` | `SNMPV3Session` — SNMPv3 USM auth/priv |
| `snmp.mib` | `MIB` — load MIB files, resolve named OIDs |
| `snmp.agent` | `SNMPAgent` — embedded agent / AgentX subagent |
| `snmp.types` | Enums: `SNMPVersion`, `PDUType`, `SNMPError`, `ASNType` |
| `c.net_snmp` | Raw ImportC declarations |
## Examples
```sh
cd examples
dub build :snmp_get # ./build/examples_snmp_get [host] [community]
dub build :snmp_walk # ./build/examples_snmp_walk [host] [community]
```
## License
[BSL-1.0](LICENSE)