Package org.onlab.packet.ipv6
Class Fragment
- java.lang.Object
-
- org.onlab.packet.BasePacket
-
- org.onlab.packet.ipv6.Fragment
-
- All Implemented Interfaces:
IPacket,IExtensionHeader
public class Fragment extends BasePacket implements IExtensionHeader
Implements IPv6 fragment extension header format. (RFC 2460)
-
-
Field Summary
Fields Modifier and Type Field Description protected shortfragmentOffsetstatic byteHEADER_LENGTHprotected intidentificationprotected bytemoreFragmentprotected bytenextHeader-
Fields inherited from class org.onlab.packet.BasePacket
parent, payload
-
-
Constructor Summary
Constructors Constructor Description Fragment()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Deserializer<Fragment>deserializer()Deserializer function for fragment headers.booleanequals(java.lang.Object obj)shortgetFragmentOffset()Gets the fragment offset of this header.intgetIdentification()Gets the identification of this header.bytegetMoreFragment()Gets the more fragment flag of this header.bytegetNextHeader()Gets the type of next header.inthashCode()byte[]serialize()Sets all payloads parent packet if applicable, then serializes this packet and all payloads.FragmentsetFragmentOffset(short fragmentOffset)Sets the fragment offset of this header.FragmentsetIdentification(int identification)Sets the identification of this header.FragmentsetMoreFragment(byte moreFragment)Sets the more fragment flag of this header.FragmentsetNextHeader(byte nextHeader)Sets the type of next header.java.lang.StringtoString()-
Methods inherited from class org.onlab.packet.BasePacket
clone, getParent, getPayload, resetChecksum, setParent, setPayload
-
-
-
-
Field Detail
-
HEADER_LENGTH
public static final byte HEADER_LENGTH
- See Also:
- Constant Field Values
-
nextHeader
protected byte nextHeader
-
fragmentOffset
protected short fragmentOffset
-
moreFragment
protected byte moreFragment
-
identification
protected int identification
-
-
Method Detail
-
getNextHeader
public byte getNextHeader()
Description copied from interface:IExtensionHeaderGets the type of next header.- Specified by:
getNextHeaderin interfaceIExtensionHeader- Returns:
- next header
-
setNextHeader
public Fragment setNextHeader(byte nextHeader)
Description copied from interface:IExtensionHeaderSets the type of next header.- Specified by:
setNextHeaderin interfaceIExtensionHeader- Parameters:
nextHeader- the next header to set- Returns:
- this
-
getFragmentOffset
public short getFragmentOffset()
Gets the fragment offset of this header.- Returns:
- fragment offset
-
setFragmentOffset
public Fragment setFragmentOffset(short fragmentOffset)
Sets the fragment offset of this header.- Parameters:
fragmentOffset- the fragment offset to set- Returns:
- this
-
getMoreFragment
public byte getMoreFragment()
Gets the more fragment flag of this header.- Returns:
- more fragment flag
-
setMoreFragment
public Fragment setMoreFragment(byte moreFragment)
Sets the more fragment flag of this header.- Parameters:
moreFragment- the more fragment flag to set- Returns:
- this
-
getIdentification
public int getIdentification()
Gets the identification of this header.- Returns:
- identification
-
setIdentification
public Fragment setIdentification(int identification)
Sets the identification of this header.- Parameters:
identification- the identification to set- Returns:
- this
-
serialize
public byte[] serialize()
Description copied from interface:IPacketSets all payloads parent packet if applicable, then serializes this packet and all payloads.
-
hashCode
public int hashCode()
- Overrides:
hashCodein classBasePacket
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classBasePacket
-
deserializer
public static Deserializer<Fragment> deserializer()
Deserializer function for fragment headers.- Returns:
- deserializer function
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-