Package pcap.api.internal
Class Pcap
java.lang.Object
pcap.api.internal.Pcap
- All Implemented Interfaces:
java.lang.AutoCloseable,Pcap
@Inclubating public class Pcap extends java.lang.Object implements Pcap
Pcap handle.- Author:
- Ardika Rommy Sanjaya
-
Nested Class Summary
-
Constructor Summary
Constructors Constructor Description Pcap(java.foreign.memory.Pointer<pcap_mapping.pcap> pcap)Pcap(java.foreign.memory.Pointer<pcap_mapping.pcap> pcap, int netmask) -
Method Summary
Modifier and Type Method Description <T> Tallocate(java.lang.Class<T> cls)voidbreakLoop()voidclose()<T> voiddispatch(int count, PacketHandler<T> handler, T args)DumperdumpOpen(java.lang.String file)DumperdumpOpenAppend(java.lang.String file)<T> voidloop(int count, PacketHandler<T> handler, T args)voidnextEx(PacketBuffer packetBuffer, PacketHeader packetHeader)voidsend(java.nio.ByteBuffer buffer, int size)voidsend(PacketBuffer buffer, int size)voidsetDirection(Pcap.Direction direction)voidsetFilter(java.lang.String filter, boolean optimize)voidsetNonBlock(boolean blocking)Statusstatus()
-
Constructor Details
-
Method Details
-
dumpOpen
- Specified by:
dumpOpenin interfacePcap- Throws:
ErrorException
-
dumpOpenAppend
- Specified by:
dumpOpenAppendin interfacePcap- Throws:
ErrorException
-
setFilter
- Specified by:
setFilterin interfacePcap- Throws:
ErrorException
-
loop
public <T> void loop(int count, PacketHandler<T> handler, T args) throws BreakException, ErrorException- Specified by:
loopin interfacePcap- Throws:
BreakExceptionErrorException
-
nextEx
public void nextEx(PacketBuffer packetBuffer, PacketHeader packetHeader) throws BreakException, java.util.concurrent.TimeoutException, ErrorException- Specified by:
nextExin interfacePcap- Throws:
BreakExceptionjava.util.concurrent.TimeoutExceptionErrorException
-
dispatch
public <T> void dispatch(int count, PacketHandler<T> handler, T args) throws BreakException, ErrorException- Specified by:
dispatchin interfacePcap- Throws:
BreakExceptionErrorException
-
status
- Specified by:
statusin interfacePcap- Throws:
ErrorException
-
breakLoop
public void breakLoop() -
send
- Specified by:
sendin interfacePcap- Throws:
ErrorException
-
send
- Specified by:
sendin interfacePcap- Throws:
ErrorException
-
setDirection
- Specified by:
setDirectionin interfacePcap- Throws:
ErrorException
-
setNonBlock
- Specified by:
setNonBlockin interfacePcap- Throws:
ErrorException
-
close
public void close() -
allocate
public <T> T allocate(java.lang.Class<T> cls)
-