Class Packet
java.lang.Object
org.apache.drill.exec.store.pcap.decoder.Packet
- All Implemented Interfaces:
Comparable<Packet>
- Direct Known Subclasses:
PacketDecoder
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected intprotected intprotected booleanprotected booleanprotected intprotected byte[] -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintThis function is here so that packets can be sorted for re-sessionization.intdecodePcap(byte[] buffer, int offset, boolean byteOrder, int maxLength) static StringformatFlags(int flags) booleanintbooleanbyte[]getData()intbooleanbooleanintgetFlags()booleanintbooleanbooleanintlongintbooleanlonglongbooleanprotected intbooleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanprotected intprotected intbooleanreadPcap(InputStream in, boolean byteOrder, int maxLength) voidsetIsCorrupt(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:
compareToin interfaceComparable<Packet>- Parameters:
o- The packet to which the current packet is compared to.- Returns:
- Returns the difference in sequence number.
-