|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.jnetpcap.PcapUtils
public final class PcapUtils
A Pcap utility class which provides certain additional and convenience methods.
| Method Summary | ||
|---|---|---|
static
|
dispatchInBackground(Pcap pcap,
int cnt,
ByteBufferHandler<T> handler,
T data)
Runs the dispatch function in a background thread. |
|
static
|
dispatchInBackground(Pcap pcap,
int cnt,
JBufferHandler<T> handler,
T data)
Runs the dispatch function in a background thread. |
|
static byte[] |
getHardwareAddress(PcapIf netif)
Retrieves a network hardware address or MAC for a network interface |
|
static byte[] |
getHardwareAddress(java.lang.String device)
Retrieves a network hardware address or MAC for a network interface |
|
static
|
loopInBackground(Pcap pcap,
int cnt,
ByteBufferHandler<T> handler,
T data)
Runs the loop function in a background thread. |
|
static
|
loopInBackground(Pcap pcap,
int cnt,
JBufferHandler<T> handler,
T data)
Runs the loop function in a background thread. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static <T> PcapTask<T> dispatchInBackground(Pcap pcap,
int cnt,
ByteBufferHandler<T> handler,
T data)
pcap - an open pcap objectcnt - number of packets to capture and exit, 0 for infinatehandler - user supplied callback handlerdata - opaque, user supplied data object dispatched back to the handler
public static <T> PcapTask<T> dispatchInBackground(Pcap pcap,
int cnt,
JBufferHandler<T> handler,
T data)
pcap - an open pcap objectcnt - number of packets to capture and exit, 0 for infinatehandler - user supplied callback handlerdata - opaque, user supplied data object dispatched back to the handler
public static byte[] getHardwareAddress(PcapIf netif)
throws java.io.IOException
netif - network device as retrieved from Pcap.findAllDevs().
java.io.IOException - any communication errorsPcap.findAllDevs(List, StringBuilder)
public static byte[] getHardwareAddress(java.lang.String device)
throws java.io.IOException
device - network interface name
java.io.IOException - any communication errors
public static <T> PcapTask<T> loopInBackground(Pcap pcap,
int cnt,
ByteBufferHandler<T> handler,
T data)
pcap - an open pcap objectcnt - number of packets to capture and exit, 0 for infinatehandler - user supplied callback handlerdata - opaque, user supplied data object dispatched back to the handler
public static <T> PcapTask<T> loopInBackground(Pcap pcap,
int cnt,
JBufferHandler<T> handler,
T data)
pcap - an open pcap objectcnt - number of packets to capture and exit, 0 for infinatehandler - user supplied callback handlerdata - opaque, user supplied data object dispatched back to the handler
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||