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 SummaryNested Classes
- 
Field SummaryFieldsFields inherited from class org.opendaylight.openflowplugin.libraries.liblldp.Packetcorrupted, hdrFieldCoordMap, hdrFieldsMap, parent, payload, payloadFactory, rawPayload, writeAccess
- 
Constructor SummaryConstructors
- 
Method SummaryModifier 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 CustomTLVKeystatic CustomTLVKeystatic 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.booleanstatic intextractCustomOUI(LLDPTLV lldptlv) static byteextractCustomSubtype(LLDPTLV lldptlv) static StringgetCustomString(byte[] customTlvValue, int customTlvLen) Retrieves the custom string from the Custom TLV value which includes OUI, subtype and custom string.intgetfieldnumBits(String fieldName) This method fetches the number of bits for header field specified by 'fieldname'.static StringgetHexStringValue(byte[] tlvValue, int tlvLen) Retrieves the string from TLV value and returns it in HexString format.intReturns the length of TLV.static StringgetStringValue(byte[] tlvValue, int tlvLen) Retrieves the string from TLV value.intReturns the size in bits of the whole TLV.bytegetType()Returns the type of TLV.byte[]getValue()Returns the value field of TLV.inthashCode()voidsetHeaderField(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.Packetdeserialize, getfieldOffset, getHeaderSize, getParent, getPayload, getRawPayload, isCorrupted, postDeserializeCustomOperation, postSerializeCustomOperation, serialize, setParent, setPayload, setRawPayload, toString
- 
Field Details- 
fieldValues
 
- 
- 
Constructor Details- 
LLDPTLVpublic LLDPTLV()Default constructor that creates and sets the hash map values and sets the payload to null.
- 
LLDPTLVConstructor that writes the passed LLDPTLV values to the hdrFieldsMap.
 
- 
- 
Method Details- 
getLengthpublic int getLength()Returns the length of TLV.
- 
getTypepublic byte getType()Returns the type of TLV.
- 
getValuepublic byte[] getValue()Returns the value field of TLV.
- 
setTypeSets the type.- Parameters:
- type- the type to set
- Returns:
- LLDPTLV
 
- 
setLengthSets the length.- Parameters:
- length- the length to set
- Returns:
- LLDPTLV
 
- 
setValueSets the value.- Parameters:
- value- the value to set
- Returns:
- LLDPTLV
 
- 
setHeaderField- Overrides:
- setHeaderFieldin class- Packet
 
- 
hashCodepublic int hashCode()
- 
equals
- 
getfieldnumBitsDescription copied from class:PacketThis 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:
- getfieldnumBitsin class- Packet
- Returns:
- Integer - number of bits of the requested field
 
- 
getTLVSizepublic int getTLVSize()Returns the size in bits of the whole TLV.- Returns:
- int - size in bits of full TLV
 
- 
createSystemNameTLVValueCreates the SystemName TLV value.- Parameters:
- nodeId- node identifier string
- Returns:
- the SystemName TLV value in byte array
 
- 
createChassisIDTLVValueCreates the ChassisID TLV value including the subtype and ChassisID string.- Parameters:
- nodeId- node identifier string
- Returns:
- the ChassisID TLV value in byte array
 
- 
createPortIDTLVValueCreates the PortID TLV value including the subtype and PortID string.- Parameters:
- portId- port identifier string
- Returns:
- the PortID TLV value in byte array
 
- 
createCustomTLVValueCreates 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:
 
- 
createCustomTLVValuepublic static byte[] createCustomTLVValue(byte[] subtype, byte[] customByteArray) Creates the custom TLV value including OUI, subtype and custom string.- Parameters:
- subtype- openflow subtype
- customByteArray- port identifier string
- Returns:
- the custom TLV value in byte array
 
- 
createSecSubTypeCustomTLVValuepublic 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
 
- 
getHexStringValueRetrieves the string from TLV value and returns it in HexString format.- Parameters:
- tlvValue- the TLV value
- tlvLen- the TLV length
- Returns:
- the HexString
 
- 
getStringValueRetrieves the string from TLV value.- Parameters:
- tlvValue- the TLV value
- tlvLen- the TLV length
- Returns:
- the string
 
- 
getCustomStringRetrieves the custom string from the Custom TLV value which includes OUI, subtype and custom string.- Parameters:
- customTlvValue- the custom TLV value
- customTlvLen- the custom TLV length
- Returns:
- the custom string
 
- 
extractCustomOUI
- 
extractCustomSubtype
- 
createPortSubTypeCustomTLVKey
- 
createSecSubTypeCustomTLVKey
 
-