public class PcapActivity extends AbstractReplaceableActivity
JMemoryPacket in a manner similar to the following (at your own risk):
byte[] arr = new byte[getPcapPacket().getPacketData().readableBytes()];
new ChainBuffer(getPcapPacket().getPacketData()).gets(arr);
JMemoryPacket jPacket = new JMemoryPacket(arr);
jPacket.scan(Ethernet.ID);
Ethernet header = jPacket.getHeader(new Ethernet());
If a JNetPcap specific PcapPacket must be passed to a Kraken parser, the class
PcapPacketToKrakenPcapPacketAdapter may be useful.
PROPERTY_ADD_FRAME_NUMBERS, PROPERTY_NEW_END_INSTANT, PROPERTY_NEW_START_INSTANTsource| Constructor and Description |
|---|
PcapActivity(long frameNumber,
org.jnetpcap.packet.PcapPacket pcapPacket)
Create a new PcapActivity using the provided frame number (as seen by the
PcapFileHandler) and the JNetPcap specific PCAP packet. |
| Modifier and Type | Method and Description |
|---|---|
Collection<Long> |
getCompoundFrameNumbers()
This method returns a sorted collection of all frame numbers in consecutive order and greater than zero, that
define this activity.
|
long |
getFrameNumber() |
org.jnetpcap.packet.PcapPacket |
getPcapPacket() |
java.time.Instant |
getPcapTimestamp() |
String |
toString() |
isReplaced, replaceActivity, setReplacedaddOptionalField, addPropertyChangeListener, addPropertyChangeListener, extendActivity, getActivityType, getDescription, getDestinationAddressAsString, getEndInstant, getEndTimestamp, getOptionalFields, getSourceAddressAsString, getStartInstant, getStartTimestamp, isExcludedFromOutput, removePropertyChangeListener, removePropertyChangeListener, removeReplacedActivity, setDescription, setDestinationAddress, setEndInstant, setExcludedFromOutput, setSourceAddress, setStartInstant, writeCsvRecordgetSourceclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitaddPropertyChangeListener, addPropertyChangeListener, getActivityType, getDescription, getDestinationAddressAsString, getEndInstant, getEndTimestamp, getOptionalFields, getSourceAddressAsString, getStartInstant, getStartTimestamp, isExcludedFromOutput, removePropertyChangeListener, removePropertyChangeListener, setExcludedFromOutputpublic PcapActivity(long frameNumber,
org.jnetpcap.packet.PcapPacket pcapPacket)
PcapFileHandler) and the JNetPcap specific PCAP packet.frameNumber - the frame number of the packet, reconstructed by the PcapFileHandlerpcapPacket - the JNetPcap specific PCAP packet representationpublic org.jnetpcap.packet.PcapPacket getPcapPacket()
public long getFrameNumber()
PcapHandlerpublic java.time.Instant getPcapTimestamp()
PcapPacket.getCaptureHeader()public Collection<Long> getCompoundFrameNumbers()
ActivitygetCompoundFrameNumbers in interface ActivitygetCompoundFrameNumbers in class AbstractActivitypublic String toString()
toString in class AbstractActivityCopyright © 2013–2015 Institute of networks and security. All rights reserved.