|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jnetpcap.PcapDumper
public class PcapDumper
Class peered with native pcap_dumper
structure. A dumper that
allows a previously opened pcap session to be dumped to a "savefile" which is
a file containing captured packets in pcap file format. To get an object of
type PcapDumper, use method Pcap.dumpOpen
.
Constructor Summary | |
---|---|
PcapDumper()
|
Method Summary | |
---|---|
void |
close()
Closes a savefile. |
void |
dump(long seconds,
int useconds,
int caplen,
int len,
java.nio.ByteBuffer packet)
Outputs a packet to the "savefile" opened with dumpOpen . |
void |
dump(PcapPktHdr hdr,
java.nio.ByteBuffer packet)
Outputs a packet to the "savefile" opened with dumpOpen . |
int |
flush()
Flushes the output buffer to the "savefile", so that any packets written with Pcap.dump but not yet written to the "savefile" will be
written. |
long |
ftell()
Returns the current file position for the "savefile", representing the number of bytes written by Pcap.dumpOpen and
Pcap.dump . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PcapDumper()
Method Detail |
---|
public void dump(PcapPktHdr hdr, java.nio.ByteBuffer packet)
dumpOpen
.
Note that the calling arguments are suitable for use with dipstach() or
loop().
hdr
- packet
- public void dump(long seconds, int useconds, int caplen, int len, java.nio.ByteBuffer packet)
dumpOpen
.
Note that the calling arguments are suitable for use with dipstach() or
loop(). This a convenience method, which takes the parameters of PcapPkthdr
class directly.
seconds
- timestamp in secondsuseconds
- timestamp fraction in microsecondscaplen
- how much was capturedlen
- actual packet length on wirepacket
- packet bufferpublic long ftell()
Pcap.dumpOpen
and
Pcap.dump
.
public int flush()
Pcap.dump
but not yet written to the "savefile" will be
written.
public void close()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |