Package org.onlab.packet.ipv6
Class BaseOptions
- java.lang.Object
-
- org.onlab.packet.BasePacket
-
- org.onlab.packet.ipv6.BaseOptions
-
- All Implemented Interfaces:
IPacket,IExtensionHeader
- Direct Known Subclasses:
DestinationOptions,HopByHopOptions
public class BaseOptions extends BasePacket implements IExtensionHeader
Base class for hop-by-hop options and destination options.
-
-
Field Summary
Fields Modifier and Type Field Description static byteFIXED_HEADER_LENGTHstatic byteFIXED_OPTIONS_LENGTHprotected byteheaderExtLengthstatic byteLENGTH_UNITprotected bytenextHeaderprotected byte[]optionsprotected bytetype-
Fields inherited from class org.onlab.packet.BasePacket
parent, payload
-
-
Constructor Summary
Constructors Constructor Description BaseOptions()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Deserializer<BaseOptions>deserializer()Deserializer function for IPv6 base options.booleanequals(Object obj)bytegetHeaderExtLength()Gets the extension length of this header.bytegetNextHeader()Gets the type of next header.byte[]getOptions()Gets the options.protected bytegetType()Gets the type of this option.inthashCode()byte[]serialize()Sets all payloads parent packet if applicable, then serializes this packet and all payloads.BaseOptionssetHeaderExtLength(byte headerExtLength)Sets the extension length of this header.BaseOptionssetNextHeader(byte nextHeader)Sets the type of next header.BaseOptionssetOptions(byte[] options)Sets the options.protected BaseOptionssetType(byte type)Sets the type of this option.StringtoString()-
Methods inherited from class org.onlab.packet.BasePacket
clone, getParent, getPayload, resetChecksum, setParent, setPayload
-
-
-
-
Field Detail
-
FIXED_HEADER_LENGTH
public static final byte FIXED_HEADER_LENGTH
- See Also:
- Constant Field Values
-
FIXED_OPTIONS_LENGTH
public static final byte FIXED_OPTIONS_LENGTH
- See Also:
- Constant Field Values
-
LENGTH_UNIT
public static final byte LENGTH_UNIT
- See Also:
- Constant Field Values
-
nextHeader
protected byte nextHeader
-
headerExtLength
protected byte headerExtLength
-
options
protected byte[] options
-
type
protected byte type
-
-
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 BaseOptions 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
-
getHeaderExtLength
public byte getHeaderExtLength()
Gets the extension length of this header.- Returns:
- header length
-
setHeaderExtLength
public BaseOptions setHeaderExtLength(byte headerExtLength)
Sets the extension length of this header.- Parameters:
headerExtLength- the header length to set- Returns:
- this
-
getOptions
public byte[] getOptions()
Gets the options.- Returns:
- the options
-
setOptions
public BaseOptions setOptions(byte[] options)
Sets the options.- Parameters:
options- the options to set- Returns:
- this
-
getType
protected byte getType()
Gets the type of this option.- Returns:
- the type
-
setType
protected BaseOptions setType(byte type)
Sets the type of this option. Must be either IPv6.PROTOCOL_HOPOPT or IPv6.PROTOCOL_DSTOPT- Parameters:
type- the type 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(Object obj)
- Overrides:
equalsin classBasePacket
-
deserializer
public static Deserializer<BaseOptions> deserializer()
Deserializer function for IPv6 base options.- Returns:
- deserializer function
-
-