Package dpkt :: Module pcapng :: Class Writer
[hide private]
[frames] | no frames]

Class Writer

source code

object --+
         |
        Writer

Simple pcapng dumpfile writer.

Instance Methods [hide private]
 
__init__(self, fileobj, snaplen=1500, linktype=1, shb=None, idb=None)
Create a pcapng dumpfile writer for the given fileobj.
source code
 
_validate_block(self, arg_name, blk, expected_cls)
Check a user-defined block for correct type and endianness
source code
 
writepkt(self, pkt, ts=None)
Write a single packet with its timestamp.
source code
 
close(self) source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, fileobj, snaplen=1500, linktype=1, shb=None, idb=None)
(Constructor)

source code 

Create a pcapng dumpfile writer for the given fileobj.

shb can be an instance of SectionHeaderBlock(LE)
idb can be an instance of InterfaceDescriptionBlock(LE)

Overrides: object.__init__

writepkt(self, pkt, ts=None)

source code 

Write a single packet with its timestamp.

pkt can be a buffer or an instance of EnhancedPacketBlock(LE)
ts is a Unix timestamp in seconds since Epoch (e.g. 1454725786.99)