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 byteFIXED_HEADER_LENGTHstatic byteFIXED_ROUTING_DATA_LENGTHprotected byteheaderExtLengthstatic byteLENGTH_UNITprotected bytenextHeaderprotected byte[]routingDataprotected byteroutingTypeprotected bytesegmentsLeft-
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.booleanequals(java.lang.Object obj)bytegetHeaderExtLength()Gets the extension length of this header.bytegetNextHeader()Gets the type of next header.byte[]getRoutingData()Gets the routing data.bytegetRoutingType()Gets the routing type of this header.bytegetSegmentsLeft()Gets the number of remaining route segments of this header.inthashCode()byte[]serialize()Sets all payloads parent packet if applicable, then serializes this packet and all payloads.RoutingsetHeaderExtLength(byte headerExtLength)Sets the extension length of this header.RoutingsetNextHeader(byte nextHeader)Sets the type of next header.RoutingsetRoutingData(byte[] routingData)Sets the routing data.RoutingsetRoutingType(byte routingType)Sets the routing type of this header.RoutingsetSegmntsLeft(byte segmentsLeft)Sets the number of remaining route segments of this header.java.lang.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_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:IExtensionHeaderGets the type of next header.- Specified by:
getNextHeaderin interfaceIExtensionHeader- Returns:
- next header
-
setNextHeader
public Routing 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 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: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<Routing> deserializer()
Deserializer function for routing headers.- Returns:
- deserializer function
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-