|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.gremwell.jnetbridge.Port
com.gremwell.jnetbridge.PcapPort
public class PcapPort
This class implements a port receiving and sending network packets with libpcap, through jnetpcap library. Upon instantiation PCAP handle gets initialized, but the packet pumping thread does not get started until start(). The clients of this class can invoke start()/stop() several times. The PCAP handle gets closed upon invocation of close() method. After that it does not get reopened by start().
Field Summary |
---|
Fields inherited from class com.gremwell.jnetbridge.Port |
---|
listener, name, received, sent |
Constructor Summary | |
---|---|
PcapPort(java.lang.String name)
Prepare the interface to receive and send packets. |
Method Summary | |
---|---|
void |
close()
The clients have to invoke this method to release resources allocated for this port, if any. |
java.lang.String |
getStat()
|
void |
send(org.jnetpcap.nio.JBuffer packet)
Invoked by the clients. |
void |
start()
Start packet pumping thread. |
void |
stop()
Stop packet pumping thread. |
Methods inherited from class com.gremwell.jnetbridge.Port |
---|
getName, setListener, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public PcapPort(java.lang.String name) throws PcapException
name
- Name of the interface to open
PcapException
Method Detail |
---|
public void send(org.jnetpcap.nio.JBuffer packet)
Port
Port
have
to send the packet immediately or enqueue it.
send
in class Port
public void start()
public void stop()
public void close()
Port
close
in class Port
public java.lang.String getStat()
getStat
in class Port
Port.getStat()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |