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 short
fragmentOffset
static byte
HEADER_LENGTH
protected int
identification
protected byte
moreFragment
protected byte
nextHeader
-
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.boolean
equals(Object obj)
short
getFragmentOffset()
Gets the fragment offset of this header.int
getIdentification()
Gets the identification of this header.byte
getMoreFragment()
Gets the more fragment flag of this header.byte
getNextHeader()
Gets the type of next header.int
hashCode()
byte[]
serialize()
Sets all payloads parent packet if applicable, then serializes this packet and all payloads.Fragment
setFragmentOffset(short fragmentOffset)
Sets the fragment offset of this header.Fragment
setIdentification(int identification)
Sets the identification of this header.Fragment
setMoreFragment(byte moreFragment)
Sets the more fragment flag of this header.Fragment
setNextHeader(byte nextHeader)
Sets the type of next header.String
toString()
-
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:IExtensionHeader
Gets the type of next header.- Specified by:
getNextHeader
in interfaceIExtensionHeader
- Returns:
- next header
-
setNextHeader
public Fragment setNextHeader(byte nextHeader)
Description copied from interface:IExtensionHeader
Sets the type of next header.- Specified by:
setNextHeader
in 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:IPacket
Sets all payloads parent packet if applicable, then serializes this packet and all payloads.
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classBasePacket
-
equals
public boolean equals(Object obj)
- Overrides:
equals
in classBasePacket
-
deserializer
public static Deserializer<Fragment> deserializer()
Deserializer function for fragment headers.- Returns:
- deserializer function
-
-