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 byteFIXED_HEADER_LENGTHprotected byte[]integrityCheckstatic byteLENGTH_UNITstatic byteMINUSprotected bytenextHeaderprotected bytepayloadLengthprotected intsecurityParamIndexprotected intsequence-
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.booleanequals(Object obj)byte[]getIntegrityCheck()Gets the integrity check value of this header.bytegetNextHeader()Gets the type of next header.bytegetPayloadLength()Gets the payload length of this header.intgetSecurityParamIndex()Gets the security parameter index of this header.intgetSequence()Gets the sequence number of this header.intgetTotalLength()Gets the total length of this header.inthashCode()byte[]serialize()Sets all payloads parent packet if applicable, then serializes this packet and all payloads.AuthenticationsetIngegrityCheck(byte[] integrityCheck)Sets the integrity check value of this header.AuthenticationsetNextHeader(byte nextHeader)Sets the type of next header.AuthenticationsetPayloadLength(byte payloadLength)Sets the payload length of this header.AuthenticationsetSecurityParamIndex(int securityParamIndex)Sets the security parameter index of this header.AuthenticationsetSequence(int sequence)Sets the sequence number of this header.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
-
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:IExtensionHeaderGets the type of next header.- Specified by:
getNextHeaderin interfaceIExtensionHeader- Returns:
- next header
-
setNextHeader
public Authentication 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
-
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: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<Authentication> deserializer()
Deserializer function for authentication headers.- Returns:
- deserializer function
-
-