PHPackages                             riskivy/pcap-php - 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. riskivy/pcap-php

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

riskivy/pcap-php
================

A compact reader/writer for tcpdumps

v1.0.0.x-dev(8y ago)134MITPHP

Since Aug 9Pushed 8y agoCompare

[ Source](https://github.com/riskivy/pcap-php)[ Packagist](https://packagist.org/packages/riskivy/pcap-php)[ RSS](/packages/riskivy-pcap-php/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (2)Used By (0)

*Everything can be encoded or decoded*Introduction
==================================================

[](#everything-can-be-encoded-or-decodedintroduction)

This small lib's purpose is to allow encoding and decoding of network packets. It is made possible thanks to the basic implementation of

To start off, this lib was made to decode dumps, so maybe not all the encoding functions are added for now!

Now let's take a look:

There is the LibPcap\\Reader For reading a pcap file, and a LibPcap\\Writer (which is the same as the reader, but or writing data). The reader may read from a single file (Maybe more in the future)

The reader has the open method which will open a p/cap file, and parse it.

The reader then creates a LibPcap\\File\\Pcap, which allows interaction with the file.

The file is automatically parsed and generates a LibPcap\\Packet\\PacketBuffer, which is basicly an iterable object (you can use it in foreach's)

Packet structure
================

[](#packet-structure)

Every packet contained in the buffer has the following structure:

```
{
public function getHead();
public function getIpFrame();
public function getEthernetFrame();
public function getProtocol();
}

```

These are the basic functions, if no protocol has been determined, or maybe is not impelmented yet, the function `getProtocol()` whill return null.

A protocol is determined while the file is parsed, every protocol implemented is tried.

A protocol look smore or less like :

```
{
public function getName();
public function getSourcePort();
public function getDestinationPort();
}

```

Every field in a protocol is "dynamic", which means that while parsing any field can be added to the object, so to determine what protocol is a certain packett, you will need to call the `getName()` method.

List of implemented Protocols and names associated to them
==========================================================

[](#list-of-implemented-protocols-and-names-associated-to-them)

ProtocolNameDhcpdhcpHttphttpTcptcpUdpudp

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity49

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.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

3201d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6807b05e1abbddc425df6cd457ff572b71eaa80865619ea2462be8076c87beaa?d=identicon)[riskivy](/maintainers/riskivy)

---

Top Contributors

[![riskivy](https://avatars.githubusercontent.com/u/30256536?v=4)](https://github.com/riskivy "riskivy (4 commits)")

### Embed Badge

![Health badge](/badges/riskivy-pcap-php/health.svg)

```
[![Health](https://phpackages.com/badges/riskivy-pcap-php/health.svg)](https://phpackages.com/packages/riskivy-pcap-php)
```

PHPackages © 2026

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