dev-blocklist-format-p2p

jre-phoenix

The PeerGuardian Text Lists (P2P) Format

The P2P format was created for the original PeerGuardian. It is simple and easily editable with any text editor, but is not very compact for transport in bandwidth limited situations.

The format

The P2P format had no official specification, but applications always follow the basic format:

Some organization:1.0.0.0-1.255.255.255
Another organization:8.0.0.0-8.255.255.255

The encoding of a P2P list is not formally defined, but many parsers assume they are ASCII or ISO-8859-1. PeerGuardian 2 (Windows) assumes P2P lists are encoded in ISO-8859-1 if they do not begin with a UTF-8 BOM.
PeerGuardian Linux allows to specify the encoding of the blocklist to be read.
TODO: which encoding is assumed by PeerGuardian Linux if none specified?

PeerGuardian 2 (Windows) and PeerGuardian Linux treat lines which start with a # as a single-line comment and ignores empty lines, like so:

# This is a comment
Some organization:1.0.0.0-1.255.255.255
Another organization:8.0.0.0-8.255.255.255

# This is another comment
Yet another organization:16.0.0.0-16.255.255.255
And another:32.0.0.0-32.255.255.255

Developing with P2B

A cross-platform C++ library for working with the P2P format is freely available here.

See also

eMule Text Lists (DAT) Format
PeerGuardian Binary Lists (P2B) Format

Based upon the old PhoenixLabs Wiki page