- Python 3.13 wheels
Dumper.flush
.
ts_utcdatetime
is now a tz aware datetime.ts_datetime
is still naive as getting the local timezone and its availability is still problematic in Python's standard library.
- Don't crash if Npcap is not installed or fails to load.
- Python 3.12 wheels.
- Now using Cython 3.
- Python 3.11 wheels.
- A const compiler warning.
dumps(..., cypcap.BpfDumpType.C_ARRAY)
outputted wrong syntax.
BpfProgram
now has__getitem__
,__len__
,__init__
,__iter__
, and can be turned into a list.dumps
can now dump the formats thatdebug_dump
used to output and return them as a string instead of printing to stdout.- Platform specific functions
Pcap.set_protocol_linux
,Pcap.get_selectable_fd
,Pcap.get_required_select_timeout
, andPcap.getevent
. cypcap.bpf
module with constants and utility functions for manually written BPF.
- Classes which should not be instantiated from Python directly should now raise
(
Pcap
&Dumper
). cypcap
is now a package rather than a single file module, API remains the same.
debug_dump
is merged intodumps
by a new type parameter.
set_config
,set_pre_config
had wrong typing. (Although those are not exported to an interface file yet).
- The
optimize
parameter toPcap.compile
now defaults toTrue
. - Can now call
Pcap.setfilter
with astr
which will be compiled by callingPcap.compile
.
- Wheels for Windows, Linux & macOS.
Pkthdr
can be created from Python and is mutable (Useful forbpf.offline_filter
).- Add
BpfProgram.dumps
/BpfProgram.loads
to dump and load the filter in the format used by iptables, tc-bpf, etc. Pcap
now has a__repr__
.Pcap
now has atype
andsource
attributes.- Add
PcapType
for indicating the type of aPcap
. Pkthdr.ts_datetime
&Pkthdr.ts_utcdatetime
that returnPkthdr.ts
as a naivedatetime
.Pcap.set_pre_config
&Pcap.set_config
shortcuts to setPcap
configuration via keyword arguments.
- Change
findalldevs
interface address parsing to use the same format as thesocket
module and add support forAF_PACKET
sockaddr_ll
used in Linux. - Addresses in
PcapIf.addresses
/PcapAddr
will now be in the formatTuple[socket.AddressFamily, <sockaddr tuple>]
. BpfProgram.dump
renamed toBpfProgram.debug_dump
.set_timeout
&open_live
now accept Python style float seconds instead of milliseconds.- The
netmask
argument toPcap.compile
is now optional, the package will try to figure out the correct value by itself.
cypcap.pyx
was missing from sdist due tocythonize
. (Bug in Cython?)
- Tests & Github Actions CI
- Support
os.PathLike
indump_open
&dump_open_append
. - Support
os.PathLike
inopen_offline
. inject
andsendpacket
now take an object implementing the buffer protocol.- Switch to using
cythonize
insetup.py
(The built-in setuptools integration uses the deprecatedold_build_ext
and keyed off whether to generate C sources on whether Cython is installed).
NETMASK_UNKNOWN
was of the wrong type.
Initial beta release. Only tested manually and lightly.