|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface PacketListener
Allows an interested observer to monitor packet reads, writes, inserts, deletions and packet modifications.
LiveCapture capture = Captures.openLive();
capture.addPacketListener(new PacketListener() {
public void processReadPacket(Capture source, Packet packet) {
System.out.println("New packet");
}
// ... and so on
});
Also can be registered as follows:
Captures.registerListener(new CaptureListener() {
public void processOpenCapture(Capture source) {
source.registerPacketListener(new PacketListener() {
// ... and so on
});
}
public void processCloseCapture(Capture source) {
// All listeners are automatically removed after the capture session is closed
}
});
| Method Summary | |
|---|---|
void |
processAddPacket(Capture source,
Packet packet)
A new packet has been added or inserted. |
void |
processPacketChange(Capture source,
Packet packet)
Notifies that the packet data buffer has been changed, and possibly the internal structure of the packet has been altered as a result. |
void |
processReadPacket(Capture source,
Packet packet)
Notifies the listener that new packet has been captured or read from a file. |
void |
processRemovePacket(Capture source,
Packet packet)
A packet has been deleted from the capture session, i.e. |
void |
processWritePacket(Capture source,
Packet packet)
Notifies the listener that a new packet has been written to a capture session, either a file or possibly the raw network. |
| Method Detail |
|---|
void processReadPacket(Capture source,
Packet packet)
source - source capture session that captured the packetpacket - packet that captured
void processWritePacket(Capture source,
Packet packet)
source - source capture that the packet was written topacket - the packet that was written
void processAddPacket(Capture source,
Packet packet)
source - source capture that the packet was added topacket - the packet that was added
void processRemovePacket(Capture source,
Packet packet)
source - source capture that the packet was deleted frompacket - the packet that was deleted
void processPacketChange(Capture source,
Packet packet)
source - source capture the packet is bound to, could be null for newly created
packets that are not bound to a sessionpacket - the packet that had its buffer modified
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||