Package org.pcap4j.packet
Class IpV6Packet.IpV6Header
- java.lang.Object
-
- org.pcap4j.packet.AbstractPacket.AbstractHeader
-
- org.pcap4j.packet.IpV6Packet.IpV6Header
-
- All Implemented Interfaces:
java.io.Serializable
,IpPacket.IpHeader
,Packet.Header
- Enclosing class:
- IpV6Packet
public static final class IpV6Packet.IpV6Header extends AbstractPacket.AbstractHeader implements IpPacket.IpHeader
- Since:
- pcap4j 0.9.10
- Author:
- Kaito Yamada
- See Also:
- Serialized Form
-
-
Method Summary
Modifier and Type Method Description protected java.lang.String
buildString()
This method builds the valuetoString()
will return.protected int
calcHashCode()
This method builds the valuehashCode()
will return using the byte arraygetRawData()
returns.boolean
equals(java.lang.Object obj)
Indicates whether some other object is "equal to" this one using return values ofgetRawData()
.java.net.Inet6Address
getDstAddr()
IpV6Packet.IpV6FlowLabel
getFlowLabel()
byte
getHopLimit()
int
getHopLimitAsInt()
IpNumber
getNextHeader()
short
getPayloadLength()
int
getPayloadLengthAsInt()
IpNumber
getProtocol()
protected java.util.List<byte[]>
getRawFields()
Returns a list of byte arrays which represents this header's fields.java.net.Inet6Address
getSrcAddr()
IpV6Packet.IpV6TrafficClass
getTrafficClass()
IpVersion
getVersion()
int
length()
Returns the header length in bytes.-
Methods inherited from class org.pcap4j.packet.AbstractPacket.AbstractHeader
buildHexString, buildRawData, calcLength, getRawData, hashCode, toHexString, toString
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.pcap4j.packet.Packet.Header
getRawData
-
-
-
-
Method Detail
-
getVersion
public IpVersion getVersion()
- Specified by:
getVersion
in interfaceIpPacket.IpHeader
- Returns:
- version
-
getTrafficClass
public IpV6Packet.IpV6TrafficClass getTrafficClass()
- Returns:
- trafficClass
-
getFlowLabel
public IpV6Packet.IpV6FlowLabel getFlowLabel()
- Returns:
- flowLabel
-
getPayloadLength
public short getPayloadLength()
- Returns:
- payloadLength
-
getPayloadLengthAsInt
public int getPayloadLengthAsInt()
- Returns:
- payloadLength
-
getNextHeader
public IpNumber getNextHeader()
- Returns:
- nextHeader
-
getProtocol
public IpNumber getProtocol()
- Specified by:
getProtocol
in interfaceIpPacket.IpHeader
- Returns:
- an IpNumber object which indicates the protocol of the following header.
-
getHopLimit
public byte getHopLimit()
- Returns:
- hopLimit
-
getHopLimitAsInt
public int getHopLimitAsInt()
- Returns:
- hopLimit
-
getSrcAddr
public java.net.Inet6Address getSrcAddr()
- Specified by:
getSrcAddr
in interfaceIpPacket.IpHeader
- Returns:
- srcAddr
-
getDstAddr
public java.net.Inet6Address getDstAddr()
- Specified by:
getDstAddr
in interfaceIpPacket.IpHeader
- Returns:
- dstAddr
-
getRawFields
protected java.util.List<byte[]> getRawFields()
Description copied from class:AbstractPacket.AbstractHeader
Returns a list of byte arrays which represents this header's fields. This method is called bycalcLength()
andbuildRawData()
.- Specified by:
getRawFields
in classAbstractPacket.AbstractHeader
- Returns:
- a list of byte arrays which represents this header's fields
-
length
public int length()
Description copied from class:AbstractPacket.AbstractHeader
Returns the header length in bytes. This method callscalcLength()
and caches the return value when it is called for the first time, and then, this method returns the cached value from the second time.- Specified by:
length
in interfacePacket.Header
- Overrides:
length
in classAbstractPacket.AbstractHeader
- Returns:
- the length of the byte stream of the header represented by this object in bytes
-
buildString
protected java.lang.String buildString()
Description copied from class:AbstractPacket.AbstractHeader
This method builds the valuetoString()
will return.- Overrides:
buildString
in classAbstractPacket.AbstractHeader
- Returns:
- a string representation of this object
-
equals
public boolean equals(java.lang.Object obj)
Description copied from class:AbstractPacket.AbstractHeader
Indicates whether some other object is "equal to" this one using return values ofgetRawData()
. This method should be overridden so that it does more strict comparisons more efficiently.- Overrides:
equals
in classAbstractPacket.AbstractHeader
-
calcHashCode
protected int calcHashCode()
Description copied from class:AbstractPacket.AbstractHeader
This method builds the valuehashCode()
will return using the byte arraygetRawData()
returns. This method may be better to be overridden for performance reason.- Overrides:
calcHashCode
in classAbstractPacket.AbstractHeader
- Returns:
- a calculated hash code value for the object
-
-