Skip to content

Commit 47a724a

Browse files
committed
Pre-release updates
1 parent a4ad111 commit 47a724a

File tree

3 files changed

+17
-7
lines changed

3 files changed

+17
-7
lines changed

CHANGELOG.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
### To Do
22
* Failed operations to throw Exceptions over issuing PHP warnings (via a toggle)
3+
* Improved documentation
4+
* IPv6 oriented tests
35
* Expose useful data pointers via `stream_metadata` (accessible through `stream_get_meta_data`)
46

5-
### Upcoming Release
7+
### 0.6.2
68
* Improved UDP/DNS tests
79
* Selectable file descriptor (for `stream_cast`) is now cached
810
* Validates `php_url_parse` succeeds and returns a `host` property (the network device name)
911
* Packet injection tests, via ARP
12+
* Strict type enforcement within tests
1013

1114
### 0.6.0
1215
* First public release

README.md

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22

33
Stream driven PHP packet capture extension.
44

5-
[![Build Status](https://travis-ci.com/rtckit/php-pcap-ext.svg?branch=master)](https://travis-ci.com/rtckit/php-pcap-ext) ![Version](https://img.shields.io/badge/version-v0.6.0-green) ![License](https://img.shields.io/badge/license-MIT-blue)
5+
[![Build Status](https://travis-ci.com/rtckit/php-pcap-ext.svg?branch=master)](https://travis-ci.com/rtckit/php-pcap-ext) ![Version](https://img.shields.io/badge/version-v0.6.2-green) ![License](https://img.shields.io/badge/license-MIT-blue)
66

77
## Usage
88

9-
The `pcap` extension has been developed against PHP 7.4+ and regularly tested against the upcoming PHP 8.
9+
The `pcap` extension has been developed against PHP 7.4+ and regularly tested against the nightly PHP 8 build; from an operating system perspective, the ubiquity of Linux makes it the only target. The supported architectures are x86_64 and arm64.
1010

11-
The extension provides bindings for [libpcap](https://github.com/the-tcpdump-group/libpcap) and exposes its functionality via PHP streams; the packet formatting is consistent with the `pcap` file format (learn more [here](https://wiki.wireshark.org/Development/LibpcapFileFormat) and [here](https://formats.kaitai.io/pcap/index.html)). The functionality is deliberately limited to I/O operations, the actual packet parsing/crafting should be performed using pure PHP; such supporting libraries will be open sourced soon.
11+
The extension provides bindings for [libpcap](https://github.com/the-tcpdump-group/libpcap) and exposes its functionality via PHP streams; the packet formatting is consistent with the `pcap` file format (learn more [here](https://wiki.wireshark.org/Development/LibpcapFileFormat) and [here](https://formats.kaitai.io/pcap/index.html)). The functionality is deliberately limited to I/O operations, the actual packet parsing/crafting should be performed using pure PHP (some relevant supporting libraries to be published soon).
1212

1313
It's also worth familiarizing yourself with [libpcap and tcpdump](https://www.tcpdump.org/index.html).
1414

@@ -60,6 +60,9 @@ array(4) {
6060
*/
6161

6262
// process($frame) ...
63+
64+
// Inject raw packets (including the link layer data) by writing to the stream
65+
$count = fwrite($fp, $packet);
6366
```
6467

6568
The [tests](https://github.com/rtckit/php-pcap-ext/tree/master/tests) directory show cases some usage examples.
@@ -76,19 +79,23 @@ make
7679

7780
## Tests
7881

79-
Before running the test suite, make sure the user has the ability to capture network packets (root or CAP_RAW).
82+
Before running the test suite, make sure the user has the ability to capture network packets (root or `CAP_NET_RAW`).
8083

8184
```sh
8285
make test
8386
```
8487

88+
## FFI Alternative
89+
90+
A fully compilable [FFI packet capture](https://github.com/rtckit/php-pcap-ffi) package is also available; the underlying environment would still have the provide the libpcap library as well as the FFI dependencies (libffi and the PHP FFI extension). Otherwise, the FFI package can be used as a drop-in replacement when it makes sense to do so.
91+
8592
## License
8693

8794
MIT, see [LICENSE file](LICENSE).
8895

8996
### Acknowledgments
9097

91-
* [libpcap](https://github.com/the-tcpdump-group/libpcap)
98+
* [libpcap](https://github.com/the-tcpdump-group/libpcap) by The Tcpdump Group, BSD licensed.
9299

93100
### Contributing
94101

php_pcap.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
extern zend_module_entry pcap_module_entry;
1010
# define phpext_pcap_ptr &pcap_module_entry
1111

12-
# define PHP_PCAP_VERSION "0.6.0"
12+
# define PHP_PCAP_VERSION "0.6.2"
1313

1414
# if defined(ZTS) && defined(COMPILE_DL_PCAP)
1515
ZEND_TSRMLS_CACHE_EXTERN()

0 commit comments

Comments
 (0)