|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.fenyo.gnetwatch.activities.Capture
public class Capture
This class captures Ethernet frames using tethereal on a single layer-2 interface. The frames are parsed with SAX.
| Field Summary | |
|---|---|
private java.lang.Thread |
capture_thread
|
private ExternalCommand |
cmd
|
private Config |
config
|
private boolean |
forked
|
private static Log |
log
|
private CaptureManager |
manager
|
private boolean |
must_end
|
(package private) SAXReader |
reader
|
| Constructor Summary | |
|---|---|
Capture(Config config,
CaptureManager manager,
int device,
java.lang.String filter)
Constructor. |
|
| Method Summary | |
|---|---|
void |
createCaptureThread()
Starts the capture thread. |
void |
end()
Stops the capture thread and waits for its end. |
private void |
handlePacket(java.lang.StringBuffer packet)
Gives the next frame to the manager. |
static java.lang.String[] |
listDevices()
Lists all available devices. |
void |
run()
Reads tethereal standard output and extracts frames one by one. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private static Log log
final SAXReader reader
private final Config config
private ExternalCommand cmd
private CaptureManager manager
private boolean forked
private java.lang.Thread capture_thread
private boolean must_end
| Constructor Detail |
|---|
public Capture(Config config,
CaptureManager manager,
int device,
java.lang.String filter)
config - configuration.manager - capture manager this instance works for.device - device this instance captures frames from.filter - capture filter to apply.| Method Detail |
|---|
public static java.lang.String[] listDevices()
throws java.lang.InterruptedException
none. -
java.lang.InterruptedException - exception.public void createCaptureThread()
none. -
public void end()
throws java.lang.InterruptedException
none. -
java.lang.InterruptedException - exception.
private void handlePacket(java.lang.StringBuffer packet)
throws DocumentException
packet - next frame.
DocumentException - SAX parse exception.public void run()
run in interface java.lang.Runnablenone. -
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||