Package org.onlab.packet.ipv6
Class Authentication
- java.lang.Object
-
- org.onlab.packet.BasePacket
-
- org.onlab.packet.ipv6.Authentication
-
- All Implemented Interfaces:
IPacket
,IExtensionHeader
public class Authentication extends BasePacket implements IExtensionHeader
Implements IPv6 authentication extension header format. (RFC 4302)
-
-
Field Summary
Fields Modifier and Type Field Description static byte
FIXED_HEADER_LENGTH
protected byte[]
integrityCheck
static byte
LENGTH_UNIT
static byte
MINUS
protected byte
nextHeader
protected byte
payloadLength
protected int
securityParamIndex
protected int
sequence
-
Fields inherited from class org.onlab.packet.BasePacket
parent, payload
-
-
Constructor Summary
Constructors Constructor Description Authentication()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Deserializer<Authentication>
deserializer()
Deserializer function for authentication headers.boolean
equals(java.lang.Object obj)
byte[]
getIntegrityCheck()
Gets the integrity check value of this header.byte
getNextHeader()
Gets the type of next header.byte
getPayloadLength()
Gets the payload length of this header.int
getSecurityParamIndex()
Gets the security parameter index of this header.int
getSequence()
Gets the sequence number of this header.int
getTotalLength()
Gets the total length of this header.int
hashCode()
byte[]
serialize()
Sets all payloads parent packet if applicable, then serializes this packet and all payloads.Authentication
setIngegrityCheck(byte[] integrityCheck)
Sets the integrity check value of this header.Authentication
setNextHeader(byte nextHeader)
Sets the type of next header.Authentication
setPayloadLength(byte payloadLength)
Sets the payload length of this header.Authentication
setSecurityParamIndex(int securityParamIndex)
Sets the security parameter index of this header.Authentication
setSequence(int sequence)
Sets the sequence number of this header.java.lang.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
-
LENGTH_UNIT
public static final byte LENGTH_UNIT
- See Also:
- Constant Field Values
-
MINUS
public static final byte MINUS
- See Also:
- Constant Field Values
-
nextHeader
protected byte nextHeader
-
payloadLength
protected byte payloadLength
-
securityParamIndex
protected int securityParamIndex
-
sequence
protected int sequence
-
integrityCheck
protected byte[] integrityCheck
-
-
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 Authentication 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
-
getPayloadLength
public byte getPayloadLength()
Gets the payload length of this header.- Returns:
- the payload length
-
setPayloadLength
public Authentication setPayloadLength(byte payloadLength)
Sets the payload length of this header.- Parameters:
payloadLength
- the payload length to set- Returns:
- this
-
getSecurityParamIndex
public int getSecurityParamIndex()
Gets the security parameter index of this header.- Returns:
- the security parameter index
-
setSecurityParamIndex
public Authentication setSecurityParamIndex(int securityParamIndex)
Sets the security parameter index of this header.- Parameters:
securityParamIndex
- the security parameter index to set- Returns:
- this
-
getSequence
public int getSequence()
Gets the sequence number of this header.- Returns:
- the sequence number
-
setSequence
public Authentication setSequence(int sequence)
Sets the sequence number of this header.- Parameters:
sequence
- the sequence number to set- Returns:
- this
-
getIntegrityCheck
public byte[] getIntegrityCheck()
Gets the integrity check value of this header.- Returns:
- the integrity check value
-
setIngegrityCheck
public Authentication setIngegrityCheck(byte[] integrityCheck)
Sets the integrity check value of this header.- Parameters:
integrityCheck
- the integrity check value to set- Returns:
- this
-
getTotalLength
public int getTotalLength()
Gets the total length of this header. According to spec, payload length should be the total length of this AH in 4-octet unit, minus 2- Returns:
- the total length
-
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(java.lang.Object obj)
- Overrides:
equals
in classBasePacket
-
deserializer
public static Deserializer<Authentication> deserializer()
Deserializer function for authentication headers.- Returns:
- deserializer function
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-