Package org.onlab.packet.ipv6
Class Routing
- java.lang.Object
-
- org.onlab.packet.BasePacket
-
- org.onlab.packet.ipv6.Routing
-
- All Implemented Interfaces:
IPacket
,IExtensionHeader
public class Routing extends BasePacket implements IExtensionHeader
Implements IPv6 routing extension header format. (RFC 2460)
-
-
Field Summary
Fields Modifier and Type Field Description static byte
FIXED_HEADER_LENGTH
static byte
FIXED_ROUTING_DATA_LENGTH
protected byte
headerExtLength
static byte
LENGTH_UNIT
protected byte
nextHeader
protected byte[]
routingData
protected byte
routingType
protected byte
segmentsLeft
-
Fields inherited from class org.onlab.packet.BasePacket
parent, payload
-
-
Constructor Summary
Constructors Constructor Description Routing()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Deserializer<Routing>
deserializer()
Deserializer function for routing headers.boolean
equals(Object obj)
byte
getHeaderExtLength()
Gets the extension length of this header.byte
getNextHeader()
Gets the type of next header.byte[]
getRoutingData()
Gets the routing data.byte
getRoutingType()
Gets the routing type of this header.byte
getSegmentsLeft()
Gets the number of remaining route segments of this header.int
hashCode()
byte[]
serialize()
Sets all payloads parent packet if applicable, then serializes this packet and all payloads.Routing
setHeaderExtLength(byte headerExtLength)
Sets the extension length of this header.Routing
setNextHeader(byte nextHeader)
Sets the type of next header.Routing
setRoutingData(byte[] routingData)
Sets the routing data.Routing
setRoutingType(byte routingType)
Sets the routing type of this header.Routing
setSegmntsLeft(byte segmentsLeft)
Sets the number of remaining route segments of this header.String
toString()
-
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_ROUTING_DATA_LENGTH
public static final byte FIXED_ROUTING_DATA_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
-
routingType
protected byte routingType
-
segmentsLeft
protected byte segmentsLeft
-
routingData
protected byte[] routingData
-
-
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 Routing 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
-
getHeaderExtLength
public byte getHeaderExtLength()
Gets the extension length of this header.- Returns:
- header length
-
setHeaderExtLength
public Routing setHeaderExtLength(byte headerExtLength)
Sets the extension length of this header.- Parameters:
headerExtLength
- the header length to set- Returns:
- this
-
getRoutingType
public byte getRoutingType()
Gets the routing type of this header.- Returns:
- routing type
-
setRoutingType
public Routing setRoutingType(byte routingType)
Sets the routing type of this header.- Parameters:
routingType
- the routing type to set- Returns:
- this
-
getSegmentsLeft
public byte getSegmentsLeft()
Gets the number of remaining route segments of this header.- Returns:
- number of remaining route segments
-
setSegmntsLeft
public Routing setSegmntsLeft(byte segmentsLeft)
Sets the number of remaining route segments of this header.- Parameters:
segmentsLeft
- the number of remaining route segments to set- Returns:
- this
-
getRoutingData
public byte[] getRoutingData()
Gets the routing data.- Returns:
- the routing data
-
setRoutingData
public Routing setRoutingData(byte[] routingData)
Sets the routing data.- Parameters:
routingData
- the routing data 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<Routing> deserializer()
Deserializer function for routing headers.- Returns:
- deserializer function
-
-