Class LLDPTLV
java.lang.Object
org.opendaylight.openflowplugin.libraries.liblldp.Packet
org.opendaylight.openflowplugin.libraries.liblldp.LLDPTLV
Class that represents the LLDPTLV objects.
-
Nested Class Summary
-
Field Summary
Fields inherited from class org.opendaylight.openflowplugin.libraries.liblldp.Packet
corrupted, hdrFieldCoordMap, hdrFieldsMap, parent, payload, payloadFactory, rawPayload, writeAccess
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic byte[]
createChassisIDTLVValue
(String nodeId) Creates the ChassisID TLV value including the subtype and ChassisID string.static byte[]
createCustomTLVValue
(byte[] subtype, byte[] customByteArray) Creates the custom TLV value including OUI, subtype and custom string.static byte[]
createCustomTLVValue
(String customString) Creates the custom TLV value including OUI, subtype and custom string.static byte[]
createPortIDTLVValue
(String portId) Creates the PortID TLV value including the subtype and PortID string.static CustomTLVKey
static CustomTLVKey
static byte[]
createSecSubTypeCustomTLVValue
(byte[] customValue) Creates a custom TLV value including OUI of sub type custom sec and custom bytes value.static byte[]
createSystemNameTLVValue
(String nodeId) Creates the SystemName TLV value.boolean
static int
extractCustomOUI
(LLDPTLV lldptlv) static byte
extractCustomSubtype
(LLDPTLV lldptlv) static String
getCustomString
(byte[] customTlvValue, int customTlvLen) Retrieves the custom string from the Custom TLV value which includes OUI, subtype and custom string.int
getfieldnumBits
(String fieldName) This method fetches the number of bits for header field specified by 'fieldname'.static String
getHexStringValue
(byte[] tlvValue, int tlvLen) Retrieves the string from TLV value and returns it in HexString format.int
Returns the length of TLV.static String
getStringValue
(byte[] tlvValue, int tlvLen) Retrieves the string from TLV value.int
Returns the size in bits of the whole TLV.byte
getType()
Returns the type of TLV.byte[]
getValue()
Returns the value field of TLV.int
hashCode()
void
setHeaderField
(String headerField, byte[] readValue) setLength
(short length) Sets the length.setType
(byte type) Sets the type.setValue
(byte[] value) Sets the value.Methods inherited from class org.opendaylight.openflowplugin.libraries.liblldp.Packet
deserialize, getfieldOffset, getHeaderSize, getParent, getPayload, getRawPayload, isCorrupted, postDeserializeCustomOperation, postSerializeCustomOperation, serialize, setParent, setPayload, setRawPayload, toString
-
Field Details
-
fieldValues
-
-
Constructor Details
-
LLDPTLV
public LLDPTLV()Default constructor that creates and sets the hash map values and sets the payload to null. -
LLDPTLV
Constructor that writes the passed LLDPTLV values to the hdrFieldsMap.
-
-
Method Details
-
getLength
public int getLength()Returns the length of TLV. -
getType
public byte getType()Returns the type of TLV. -
getValue
public byte[] getValue()Returns the value field of TLV. -
setType
Sets the type.- Parameters:
type
- the type to set- Returns:
- LLDPTLV
-
setLength
Sets the length.- Parameters:
length
- the length to set- Returns:
- LLDPTLV
-
setValue
Sets the value.- Parameters:
value
- the value to set- Returns:
- LLDPTLV
-
setHeaderField
- Overrides:
setHeaderField
in classPacket
-
hashCode
public int hashCode() -
equals
-
getfieldnumBits
Description copied from class:Packet
This method fetches the number of bits for header field specified by 'fieldname'. The numBits are present in the hdrFieldCoordMap of the respective packet class- Overrides:
getfieldnumBits
in classPacket
- Returns:
- Integer - number of bits of the requested field
-
getTLVSize
public int getTLVSize()Returns the size in bits of the whole TLV.- Returns:
- int - size in bits of full TLV
-
createSystemNameTLVValue
Creates the SystemName TLV value.- Parameters:
nodeId
- node identifier string- Returns:
- the SystemName TLV value in byte array
-
createChassisIDTLVValue
Creates the ChassisID TLV value including the subtype and ChassisID string.- Parameters:
nodeId
- node identifier string- Returns:
- the ChassisID TLV value in byte array
-
createPortIDTLVValue
Creates the PortID TLV value including the subtype and PortID string.- Parameters:
portId
- port identifier string- Returns:
- the PortID TLV value in byte array
-
createCustomTLVValue
Creates the custom TLV value including OUI, subtype and custom string.- Parameters:
customString
- port identifier string- Returns:
- the custom TLV value in byte array
- See Also:
-
createCustomTLVValue
public static byte[] createCustomTLVValue(byte[] subtype, byte[] customByteArray) Creates the custom TLV value including OUI, subtype and custom string.- Parameters:
subtype
- openflow subtypecustomByteArray
- port identifier string- Returns:
- the custom TLV value in byte array
-
createSecSubTypeCustomTLVValue
public static byte[] createSecSubTypeCustomTLVValue(byte[] customValue) Creates a custom TLV value including OUI of sub type custom sec and custom bytes value.- Parameters:
customValue
- the custom value- Returns:
- the custom TLV value in byte array
-
getHexStringValue
Retrieves the string from TLV value and returns it in HexString format.- Parameters:
tlvValue
- the TLV valuetlvLen
- the TLV length- Returns:
- the HexString
-
getStringValue
Retrieves the string from TLV value.- Parameters:
tlvValue
- the TLV valuetlvLen
- the TLV length- Returns:
- the string
-
getCustomString
Retrieves the custom string from the Custom TLV value which includes OUI, subtype and custom string.- Parameters:
customTlvValue
- the custom TLV valuecustomTlvLen
- the custom TLV length- Returns:
- the custom string
-
extractCustomOUI
-
extractCustomSubtype
-
createPortSubTypeCustomTLVKey
-
createSecSubTypeCustomTLVKey
-