Module com.slytechs.jnet.jnetpcap
Class AbstractPcapDispatcher
java.lang.Object
com.slytechs.jnet.jnetpcap.internal.AbstractPcapDispatcher
- All Implemented Interfaces:
AutoCloseable,org.jnetpcap.internal.PcapDispatcher,org.jnetpcap.PcapHandler,org.jnetpcap.PcapHandler.NativeCallback
- Direct Known Subclasses:
AbstractPacketReceiver,PacketDelayPreProcessor,PacketPlayerPreProcessor,PacketRepeaterPreProcessor,ProxyPreProcessor
AbstractPcapDispatcher relies on preview features of the Java platform:
AbstractPcapDispatcherrefers to one or more preview APIs:MemorySegment.
Preview features may be removed in a future release, or upgraded to permanent features of the Java platform.
The Class AbstractPcapDispatcher.
- Author:
- Sly Technologies Inc, repos@slytechs.com
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceA factory for creating PcapDispatcher objects.Nested classes/interfaces inherited from interface org.jnetpcap.PcapHandler
org.jnetpcap.PcapHandler.NativeCallback, org.jnetpcap.PcapHandler.OfArray<U>, org.jnetpcap.PcapHandler.OfByteBuffer<U>, org.jnetpcap.PcapHandler.OfMemorySegment<U> -
Method Summary
Modifier and TypeMethodDescriptionintcaptureLength(MemorySegmentPREVIEW address) Capture length.voidclose()Close.intdispatchNative(int count, org.jnetpcap.PcapHandler.NativeCallback handler, MemorySegmentPREVIEW user) Dispatch native.intdispatchRaw(int count, MemorySegmentPREVIEW callbackFunc, MemorySegmentPREVIEW userData) Dispatch raw.Gets the uncaught exception.intheaderLength(MemorySegmentPREVIEW address) Header length.voidInterrupt.intloopNative(int count, org.jnetpcap.PcapHandler.NativeCallback handler, MemorySegmentPREVIEW user) Loop native.intloopRaw(int count, MemorySegmentPREVIEW callbackFunc, MemorySegmentPREVIEW userData) Loop raw.voidnativeCallback(MemorySegmentPREVIEW user, MemorySegmentPREVIEW header, MemorySegmentPREVIEW packet) org.jnetpcap.util.PcapPacketRefPREVIEWnext()org.jnetpcap.util.PcapPacketRefPREVIEWnextEx()voidOn native callback exception.org.jnetpcap.internal.PcapHeaderABIvoidsetUncaughtExceptionHandler(Thread.UncaughtExceptionHandler exceptionHandler) Sets the uncaught exception handler.
-
Method Details
-
pcapHeaderABI
public org.jnetpcap.internal.PcapHeaderABI pcapHeaderABI()- Specified by:
pcapHeaderABIin interfaceorg.jnetpcap.internal.PcapDispatcher- See Also:
-
captureLength
Capture length.- Specified by:
captureLengthin interfaceorg.jnetpcap.internal.PcapDispatcher- Parameters:
address- the address- Returns:
- the int
- See Also:
-
close
public void close()Close.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceorg.jnetpcap.internal.PcapDispatcher- See Also:
-
dispatchNative
public int dispatchNative(int count, org.jnetpcap.PcapHandler.NativeCallback handler, MemorySegmentPREVIEW user) Dispatch native.- Specified by:
dispatchNativein interfaceorg.jnetpcap.internal.PcapDispatcher- Parameters:
count- the counthandler- the handleruser- the user- Returns:
- the int
- See Also:
-
dispatchRaw
Dispatch raw.- Specified by:
dispatchRawin interfaceorg.jnetpcap.internal.PcapDispatcher- Parameters:
count- the countcallbackFunc- the callback funcuserData- the user data- Returns:
- the int
- See Also:
-
getUncaughtException
Gets the uncaught exception.- Specified by:
getUncaughtExceptionin interfaceorg.jnetpcap.internal.PcapDispatcher- Returns:
- the uncaught exception
- See Also:
-
headerLength
Header length.- Specified by:
headerLengthin interfaceorg.jnetpcap.internal.PcapDispatcher- Parameters:
address- the address- Returns:
- the int
- See Also:
-
interrupt
public void interrupt()Interrupt.- Specified by:
interruptin interfaceorg.jnetpcap.internal.PcapDispatcher- See Also:
-
loopNative
public int loopNative(int count, org.jnetpcap.PcapHandler.NativeCallback handler, MemorySegmentPREVIEW user) Loop native.- Specified by:
loopNativein interfaceorg.jnetpcap.internal.PcapDispatcher- Parameters:
count- the counthandler- the handleruser- the user- Returns:
- the int
- See Also:
-
loopRaw
Loop raw.- Specified by:
loopRawin interfaceorg.jnetpcap.internal.PcapDispatcher- Parameters:
count- the countcallbackFunc- the callback funcuserData- the user data- Returns:
- the int
- See Also:
-
next
public org.jnetpcap.util.PcapPacketRefPREVIEW next() throws org.jnetpcap.PcapException- Specified by:
nextin interfaceorg.jnetpcap.internal.PcapDispatcher- Throws:
org.jnetpcap.PcapException- See Also:
-
nextEx
public org.jnetpcap.util.PcapPacketRefPREVIEW nextEx() throws org.jnetpcap.PcapException, TimeoutException- Specified by:
nextExin interfaceorg.jnetpcap.internal.PcapDispatcher- Throws:
org.jnetpcap.PcapExceptionTimeoutException- See Also:
-
onNativeCallbackException
On native callback exception.- Specified by:
onNativeCallbackExceptionin interfaceorg.jnetpcap.internal.PcapDispatcher- Parameters:
e- the e- See Also:
-
setUncaughtExceptionHandler
Sets the uncaught exception handler.- Specified by:
setUncaughtExceptionHandlerin interfaceorg.jnetpcap.internal.PcapDispatcher- Parameters:
exceptionHandler- the new uncaught exception handler- See Also:
-
nativeCallback
public void nativeCallback(MemorySegmentPREVIEW user, MemorySegmentPREVIEW header, MemorySegmentPREVIEW packet) - Specified by:
nativeCallbackin interfaceorg.jnetpcap.PcapHandler.NativeCallback- See Also:
-
AbstractPcapDispatcherwhen preview features are enabled.