Class LLDP
java.lang.Object
org.opendaylight.openflowplugin.libraries.liblldp.Packet
org.opendaylight.openflowplugin.libraries.liblldp.LLDP
Class that represents the LLDP frame objects.
-
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 TypeMethodDescriptionaddCustomTLV
(LLDPTLV customTLV) deserialize
(byte[] data, int bitOffset, int size) This method deserializes the data bits obtained from the wire into the respective header and payload which are of type Packet.Returns the chassisId TLV.getCustomTLV
(CustomTLVKey key) Returns the customTlvList.Return the ManagementAddress TLV.Returns the optionalTLVList.Return the PortDesc TLV.Returns the portId TLV.Return the SystemCapabilities TLV.Return the SystemDesc TLV.Returns the SystemName TLV.Gets the full LLDPTLV.getTtl()
Return the ttl TLV.byte[]
This method serializes the header and payload from the respective packet class, into a single stream of bytes to be sent on the wire.setChassisId
(LLDPTLV chassisId) setManagementAddress
(LLDPTLV managementAddress) setOptionalTLVList
(List<LLDPTLV> optionalTLVList) setPortDesc
(LLDPTLV portDesc) setSystemCapabilities
(LLDPTLV systemCapabilities) setSystemDesc
(LLDPTLV systemDesc) setSystemNameId
(LLDPTLV systemNameId) void
Sets the LLDPTLV for a type.Methods inherited from class org.opendaylight.openflowplugin.libraries.liblldp.Packet
equals, getfieldnumBits, getfieldOffset, getHeaderSize, getParent, getPayload, getRawPayload, hashCode, isCorrupted, postDeserializeCustomOperation, postSerializeCustomOperation, setHeaderField, setParent, setPayload, setRawPayload, toString
-
Field Details
-
LLDP_MULTICAST_MAC
public static final byte[] LLDP_MULTICAST_MAC
-
-
Constructor Details
-
LLDP
public LLDP()Default constructor that creates the tlvList LinkedHashMap. -
LLDP
public LLDP(boolean writeAccess) Constructor that creates the tlvList LinkedHashMap and sets the write access for the same.
-
-
Method Details
-
getTLV
Gets the full LLDPTLV.- Parameters:
type
- description of the type of TLV- Returns:
- LLDPTLV - full TLV
-
getCustomTLV
-
setTLV
Sets the LLDPTLV for a type.- Parameters:
type
- description of the type of TLVtlv
- tlv to set
-
getChassisId
Returns the chassisId TLV. -
setChassisId
-
getSystemNameId
Returns the SystemName TLV. -
setSystemNameId
-
getPortId
Returns the portId TLV. -
setPortId
-
getTtl
Return the ttl TLV. -
setTtl
-
getSystemDesc
Return the SystemDesc TLV. -
setSystemDesc
-
getPortDesc
Return the PortDesc TLV. -
setPortDesc
-
getSystemCapabilities
Return the SystemCapabilities TLV. -
setSystemCapabilities
-
getManagementAddress
Return the ManagementAddress TLV. -
setManagementAddress
-
getOptionalTLVList
Returns the optionalTLVList. -
getCustomTlvList
Returns the customTlvList. -
setOptionalTLVList
-
addCustomTLV
-
deserialize
Description copied from class:Packet
This method deserializes the data bits obtained from the wire into the respective header and payload which are of type Packet.- Overrides:
deserialize
in classPacket
- Parameters:
data
- - data from wire to deserializebitOffset
- bit position where packet header starts in data arraysize
- size of packet in bits- Returns:
- Packet
- Throws:
PacketException
- if deserialization fails
-
serialize
Description copied from class:Packet
This method serializes the header and payload from the respective packet class, into a single stream of bytes to be sent on the wire.- Overrides:
serialize
in classPacket
- Returns:
- The byte array representing the serialized Packet
- Throws:
PacketException
- if serialization fails
-