PHPackages                             dface/snmp-packet - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. dface/snmp-packet

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

dface/snmp-packet
=================

SNMP packets encoder/decoder

05PHP

Since Jan 3Pushed 8y ago1 watchersCompare

[ Source](https://github.com/3DFace/snmp-packet)[ Packagist](https://packagist.org/packages/dface/snmp-packet)[ RSS](/packages/dface-snmp-packet/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

[![Build Status](https://camo.githubusercontent.com/bd9690e58e339396051e375218b6c83a7e06c4280a185bdb8ef822ae5713b22e/68747470733a2f2f7472617669732d63692e6f72672f3344466163652f736e6d702d7061636b65742e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/3DFace/snmp-packet)

SnmpPacket
==========

[](#snmppacket)

> **Note:** This is an early development version.

A PHP library to encode/decode SNMP packets.

This library does not aim to implement SNMP protocol processing. It's just for decoding SNMP messages from binary strings into PHP-objects and vice versa.

Supports SNMP messages v1, v2c and v3.

### Installation

[](#installation)

`composer require dface/snmp-packet`

### Usage

[](#usage)

Example of naive `snmpget` command can be found in `./examples/NaiveSnmpGet.php`. Take a look at `prepareRequest()` to see how to construct/encode messages. And `processResponse()` to see how to decode/process them.

Simple example of message encoding:

```
// construct pdu:
$bindings = new VarBindList(
   new VarBind(new Oid('1.3.6.1.2.1.1.3.0'), new NullValue())
);
$pdu = new GetRequestPDU(1, 0, 0, $bindings);

// pack into the message:
$message = new MessageV1(1, $this->community, $pdu);

// take a binary to send it somewhere:
$bin = $message->toBinary();
```

Simple example of message decoding:

```
// decode message from binary:
$message = MessageV1::fromBinary($bin);

// take pdu:
$pdu = $message->getPdu();

//check on errors:
$err = $pdu->getErrorStatus();

// iterate over bindings:
$bindings = $pdu->getVariableBindings()->getList();
foreach ($bindings as $var_bind) {
    printf("%s: %s\n", $var_bind->getOid(), $var_bind->getValue());
}
```

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/faaef133956fbef7d0c35eb2b65aafd88e741240c11b6f55b7d5fda04125c0cf?d=identicon)[3DFace](/maintainers/3DFace)

---

Top Contributors

[![3DFace](https://avatars.githubusercontent.com/u/1931471?v=4)](https://github.com/3DFace "3DFace (22 commits)")

### Embed Badge

![Health badge](/badges/dface-snmp-packet/health.svg)

```
[![Health](https://phpackages.com/badges/dface-snmp-packet/health.svg)](https://phpackages.com/packages/dface-snmp-packet)
```

###  Alternatives

[bentools/string-combinations

A simple, low-memory footprint function to generate all string combinations from a series of characters.

31197.8k](/packages/bentools-string-combinations)[divante-ltd/module-pimcore-integration

Magento-Pimcore bridge module.

348.3k](/packages/divante-ltd-module-pimcore-integration)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
