Package killerbee :: Module pcapdump :: Class PcapDumper
[hide private]
[frames] | no frames]

Class PcapDumper

source code

Instance Methods [hide private]
None
__init__(self, datalink, savefile)
Creates a libpcap file using the specified datalink type.
source code
None
pcap_dump(self, packet, ts_sec=None, ts_usec=None, orig_len=None)
Appends a new packet to the libpcap file.
source code
None
close(self)
Closes the output packet capture; wrapper for pcap_close().
source code
None
pcap_close(self)
Closed the output packet capture.
source code
Method Details [hide private]

__init__(self, datalink, savefile)
(Constructor)

source code 

Creates a libpcap file using the specified datalink type.

Parameters:
  • datalink (Integer) - Datalink type, one of DLT_* defined in pcap-bpf.h
  • savefile (String) - Output libpcap filename to open
Returns: None

pcap_dump(self, packet, ts_sec=None, ts_usec=None, orig_len=None)

source code 

Appends a new packet to the libpcap file. Optionally specify ts_sec and tv_usec for timestamp information, otherwise the current time is used. Specify orig_len if your snaplen is smaller than the entire packet contents.

Parameters:
  • ts_sec (Integer) - Timestamp, number of seconds since Unix epoch. Default is the current timestamp.
  • ts_usec (Integer) - Timestamp microseconds. Defaults to current timestamp.
  • orig_len (Integer) - Length of the original packet, used if the packet you are writing is smaller than the original packet. Defaults to the specified packet's length.
  • packet (String) - Packet contents
Returns: None