net.sourceforge.jpcap.capture
Interface PacketHandler
- All Known Implementing Classes:
- PacketCapture, PacketCaptureSimulator
- public interface PacketHandler
Classes that implement this interface are capable of handling
raw packet data.
What the implementor does with the data isn't specified.
The handler could consume the data, print it, broadcast it, whatever.
Since jpcap.capture has to do with capturing packet data, all of the
implementors in this package handle packet data by receiving it
(from the underlying native methods for packet capture) and then
dispatching it (to clients interested in the data.)
Method Summary |
void |
handlePacket(int length,
int caplen,
int seconds,
int useconds,
byte[] data)
Handle an arriving packet. |
handlePacket
public void handlePacket(int length,
int caplen,
int seconds,
int useconds,
byte[] data)
- Handle an arriving packet.
- Parameters:
length
- the length of the packet off of the wire.caplen
- the number of bytes actually captured.seconds
- the seconds component of the timestamp.useconds
- the microseconds component of the timestamp.data
- the contents of the captured packet.