java.lang.Object
org.jnetpcap.PcapDumper
- All Implemented Interfaces:
Flushable
,AutoCloseable
Dump packets to a capture file.
- Author:
- Sly Technologies Inc, repos@slytechs.com, mark
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Close a savefile being written to.void
dump
(MemorySegment header, MemorySegment packet) Write a packet to a capture file.dumpFile()
Get the OS standard I/O stream for a savefile being written.void
flush()
Flush to a savefile packets dumped.toString()
Information about this pcap dumper.
-
Method Details
-
close
public void close()Close a savefile being written to.Closes the ``savefile.''
- Specified by:
close
in interfaceAutoCloseable
- Since:
- libpcap 0.4
- See Also:
-
dump
Write a packet to a capture file.pcap_dump() outputs a packet to the ``savefile'' opened with pcap_dump_open(3PCAP). Note that its calling arguments are suitable for use with pcap_dispatch(3PCAP) or pcap_loop(3PCAP). If called directly, the user parameter is of type pcap_dumper_t as returned by pcap_dump_open().
- Parameters:
header
- the headerpacket
- the packet- Throws:
IOException
- Signals that an I/O exception has occurred.- Since:
- libpcap 0.4
-
dumpFile
Get the OS standard I/O stream for a savefile being written.- Returns:
- address to OS's stream I/O handle
- Since:
- libpcap 0.8
- See Also:
-
flush
Flush to a savefile packets dumped.pcap_dump_flush() flushes the output buffer to the ``savefile,'' so that any packets written with pcap_dump(3PCAP) but not yet written to the ``savefile'' will be written.
- Specified by:
flush
in interfaceFlushable
- Throws:
IOException
- Signals that an I/O exception has occurred.- Since:
- libpcap 0.8
- See Also:
-
toString
-