Class Packet
java.lang.Object
org.apache.drill.exec.store.pcap.decoder.Packet
- All Implemented Interfaces:
Comparable<Packet>
- Direct Known Subclasses:
PacketDecoder
-
Field Summary
Modifier and TypeFieldDescriptionprotected int
protected int
protected boolean
protected boolean
protected int
protected byte[]
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
This function is here so that packets can be sorted for re-sessionization.int
decodePcap
(byte[] buffer, int offset, boolean byteOrder, int maxLength) static String
formatFlags
(int flags) boolean
int
boolean
byte[]
getData()
int
boolean
boolean
int
getFlags()
boolean
int
boolean
boolean
int
long
int
boolean
long
long
boolean
protected int
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
protected int
protected int
boolean
readPcap
(InputStream in, boolean byteOrder, int maxLength) void
setIsCorrupt
(boolean value)
-
Field Details
-
raw
protected byte[] raw -
ipOffset
protected int ipOffset -
etherProtocol
protected int etherProtocol -
protocol
protected int protocol -
isRoutingV6
protected boolean isRoutingV6 -
isCorrupt
protected boolean isCorrupt
-
-
Constructor Details
-
Packet
public Packet()
-
-
Method Details
-
readPcap
- Throws:
IOException
-
decodePcap
public int decodePcap(byte[] buffer, int offset, boolean byteOrder, int maxLength) -
getPacketType
-
isIpV4Packet
public boolean isIpV4Packet() -
isIpV6Packet
public boolean isIpV6Packet() -
isPPPoV6Packet
public boolean isPPPoV6Packet() -
isTcpPacket
public boolean isTcpPacket() -
isUdpPacket
public boolean isUdpPacket() -
isArpPacket
public boolean isArpPacket() -
isIcmpPacket
public boolean isIcmpPacket() -
getSessionHash
public long getSessionHash() -
getTimestamp
public long getTimestamp() -
getTimestampMicro
public long getTimestampMicro() -
getPacketLength
public int getPacketLength() -
getSrc_ip
-
getDst_ip
-
getSourceIpAddressString
-
getDestinationIpAddressString
-
getEthernetSource
-
getEthernetDestination
-
getSequenceNumber
public int getSequenceNumber() -
getAckNumber
public int getAckNumber() -
getFlags
public int getFlags() -
getParsedFlags
-
setIsCorrupt
public void setIsCorrupt(boolean value) -
getUrgFlag
public boolean getUrgFlag() -
getPshFlag
public boolean getPshFlag() -
getEceFlag
public boolean getEceFlag() -
getSynFlag
public boolean getSynFlag() -
getAckFlag
public boolean getAckFlag() -
getRstFlag
public boolean getRstFlag() -
getFinFlag
public boolean getFinFlag() -
getNSFlag
public boolean getNSFlag() -
getCwrFlag
public boolean getCwrFlag() -
formatFlags
-
getSrc_port
public int getSrc_port() -
getDst_port
public int getDst_port() -
isCorrupt
public boolean isCorrupt() -
getData
public byte[] getData() -
ipVersion
protected int ipVersion() -
processIpV4Packet
protected int processIpV4Packet() -
processIpV6Packet
protected int processIpV6Packet() -
compareTo
This function is here so that packets can be sorted for re-sessionization. Packets in TCP streams are ordered by the sequence number, so being able to order the packets is necessary to reassemble the TCP session.- Specified by:
compareTo
in interfaceComparable<Packet>
- Parameters:
o
- The packet to which the current packet is compared to.- Returns:
- Returns the difference in sequence number.
-