Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: CI

on:
push:
branches: [master, main, "v0.*"]
pull_request:

jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.11", "3.12", "3.13", "3.14"]

steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v5
with:
python-version: ${{ matrix.python-version }}
- run: uv sync --group dev
- run: uv run ruff check ipfix tests scripts
- run: uv run pytest
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,11 @@ nosetests.xml
# Sphinx tempfiles
sphinx/_build

# Modern Python tooling
.venv/
.pytest_cache/
.ruff_cache/
__pycache__/
uv.lock


21 changes: 0 additions & 21 deletions .travis.yml

This file was deleted.

24 changes: 23 additions & 1 deletion CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,26 @@ v0.9.6, 2014-06-06 -- Test coverage improvements, consolidation of scripts,
bugfixes (export time, reduced-length encoding),
update to latest IANA Information Element registry.

v0.9.7, 2014-07-04 -- Bugfix (export time and sequence number reversed)
v0.9.7, 2014-07-04 -- Bugfix (export time and sequence number reversed)

v0.10.0, 2026-11-22 -- Modernize packaging (pyproject.toml with PEP 639, Python
3.11+, drop Python 2 compat and vis-package); refresh IANA
IE registry (up to ID 533; note ID 278 renamed from
connectionCountNew to newConnectionDeltaCount, and ID 263
messageScope changed from unsigned64 to unsigned8) and
RFC 5103 reverse IEs; add unsigned256 (RFC 9740) and
arbitrary-width integer RLE; harden IPFIX and NetFlow v9
decoders against malformed packets (setlen < 4, zero-
length templates, bounds checks, template set padding,
template withdrawals, unbounded unknown IE cache); fix
varlen-first templates, strict RLE validation and fixed-
length string parse/unparse/resizing, use_integer_ipv4,
IE hashing, accepted_tids caching, empty set emission and
delete_template atomicity, export_record error propagation,
begin_export(0), writer default domain and flush/template
bugs, reader msgcount, and v9pdu Options Templates, stream
version check, and sequence accounting; accept timezone-
aware datetimes on encode/parse/unparse while eliminating
Python 3.12+ deprecation warnings (note:
template_record_hook now also fires on template
withdrawals with tmpl.count() == 0); expand pytest suite.
2 changes: 0 additions & 2 deletions MANIFEST.in

This file was deleted.

64 changes: 51 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,55 @@
python-ipfix
============
# python-ipfix

IPFIX implementation for Python 3.3.
IPFIX (RFC 7011) implementation for Python 3.11+.

This module provides a Python interface to IPFIX message streams, and
provides tools for building IPFIX Exporting and Collecting Processes.
It handles message framing and deframing, encoding and decoding IPFIX
data records using templates, and a bridge between IPFIX ADTs and
appropriate Python data types.
This package provides a Python interface to IPFIX message streams, and tools
for building IPFIX Exporting and Collecting Processes. It handles message
framing and deframing, encoding and decoding IPFIX data records using
templates, a bridge between IPFIX abstract data types (ADTs) and native Python
data types, and a read-only NetFlow v9 PDU decoder.

It should work on Python 2.7 as well; your mileage may vary. To install on
Python 2.7, the following additional dependencies must be manually installed:
## Installation

- pip install functools32
- pip install py2-ipaddress
- pip install pytz
```bash
pip install ipfix
```

Requires Python 3.11 or later, with no mandatory runtime dependencies.

## Quick Start

```python
import ipfix.ie
import ipfix.message
import ipfix.template

ipfix.ie.use_iana_default()
ipfix.ie.use_5103_default()

msg = ipfix.message.MessageBuffer()
msg.begin_export(8304)
tmpl = ipfix.template.for_specs(
256,
"flowStartMilliseconds",
"sourceIPv4Address",
"destinationIPv4Address",
"packetDeltaCount",
)
msg.add_template(tmpl)
msg.export_ensure_set(256)
```

Command-line utilities `ipfix2csv` and `ipfixstat` are installed as console
scripts.

## Development

```bash
uv sync --group dev
uv run ruff check ipfix tests scripts
uv run pytest
```

## License

GNU Lesser General Public License v3 or later (LGPLv3+).
10 changes: 0 additions & 10 deletions README.txt

This file was deleted.

20 changes: 9 additions & 11 deletions ipfix/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# coding: utf8
#
# python-ipfix (c) 2013 Brian Trammell.
# python-ipfix (c) 2013-2026 Brian Trammell.
#
# Many thanks to the mPlane consortium (http://www.ict-mplane.eu) for
# its material support of this effort.
Expand All @@ -19,10 +18,8 @@
# this program. If not, see <http://www.gnu.org/licenses/>.
#

from __future__ import unicode_literals

"""
IPFIX implementation for Python 3.3.
IPFIX (RFC 7011) implementation for Python 3.11+.

.. moduleauthor:: Brian Trammell <brian@trammell.ch>

Expand All @@ -47,14 +44,15 @@
messages, see :mod:`ipfix.message`. In any case, exporters will need to define
templates; see :mod:`ipfix.template`.

This module is copyright 2013 Brian Trammell. It is made available under the
terms of the
This module is copyright 2013-2026 Brian Trammell. It is made available under
the terms of the
`GNU Lesser General Public License <http://www.gnu.org/licenses/lgpl.html>`_,
version 3 or, at your option, any later version.

"""

from . import types
from . import ie
from . import template
from . import message
from . import ie, message, template, types

__version__ = "0.10.0"

__all__ = ["types", "ie", "template", "message", "__version__"]
Loading
Loading