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_INSTANT
source
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, setReplaced
addOptionalField, addPropertyChangeListener, addPropertyChangeListener, extendActivity, getActivityType, getDescription, getDestinationAddressAsString, getEndInstant, getEndTimestamp, getOptionalFields, getSourceAddressAsString, getStartInstant, getStartTimestamp, isExcludedFromOutput, removePropertyChangeListener, removePropertyChangeListener, removeReplacedActivity, setDescription, setDestinationAddress, setEndInstant, setExcludedFromOutput, setSourceAddress, setStartInstant, writeCsvRecord
getSource
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
addPropertyChangeListener, addPropertyChangeListener, getActivityType, getDescription, getDestinationAddressAsString, getEndInstant, getEndTimestamp, getOptionalFields, getSourceAddressAsString, getStartInstant, getStartTimestamp, isExcludedFromOutput, removePropertyChangeListener, removePropertyChangeListener, setExcludedFromOutput
public 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 PcapFileHandler
pcapPacket
- the JNetPcap specific PCAP packet representationpublic org.jnetpcap.packet.PcapPacket getPcapPacket()
public long getFrameNumber()
PcapHandler
public java.time.Instant getPcapTimestamp()
PcapPacket.getCaptureHeader()
public Collection<Long> getCompoundFrameNumbers()
Activity
getCompoundFrameNumbers
in interface Activity
getCompoundFrameNumbers
in class AbstractActivity
public String toString()
toString
in class AbstractActivity
Copyright © 2013–2015 Institute of networks and security. All rights reserved.