Class LLDP
- java.lang.Object
-
- org.opendaylight.openflowplugin.libraries.liblldp.Packet
-
- org.opendaylight.openflowplugin.libraries.liblldp.LLDP
-
public class LLDP extends Packet
Class that represents the LLDP frame objects.
-
-
Field Summary
Fields Modifier and Type Field Description static byte[]LLDP_MULTICAST_MAC-
Fields inherited from class org.opendaylight.openflowplugin.libraries.liblldp.Packet
corrupted, hdrFieldCoordMap, hdrFieldsMap, parent, payload, payloadFactory, rawPayload, writeAccess
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description LLDPaddCustomTLV(LLDPTLV customTLV)Packetdeserialize(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.LLDPTLVgetChassisId()Returns the chassisId TLV.LLDPTLVgetCustomTLV(CustomTLVKey key)Iterable<LLDPTLV>getCustomTlvList()Returns the customTlvList.LLDPTLVgetManagementAddress()Return the ManagementAddress TLV.Iterable<LLDPTLV>getOptionalTLVList()Returns the optionalTLVList.LLDPTLVgetPortDesc()Return the PortDesc TLV.LLDPTLVgetPortId()Returns the portId TLV.LLDPTLVgetSystemCapabilities()Return the SystemCapabilities TLV.LLDPTLVgetSystemDesc()Return the SystemDesc TLV.LLDPTLVgetSystemNameId()Returns the SystemName TLV.LLDPTLVgetTLV(String type)Gets the full LLDPTLV.LLDPTLVgetTtl()Return the ttl TLV.byte[]serialize()This method serializes the header and payload from the respective packet class, into a single stream of bytes to be sent on the wire.LLDPsetChassisId(LLDPTLV chassisId)LLDPsetManagementAddress(LLDPTLV managementAddress)LLDPsetOptionalTLVList(List<LLDPTLV> optionalTLVList)LLDPsetPortDesc(LLDPTLV portDesc)LLDPsetPortId(LLDPTLV portId)LLDPsetSystemCapabilities(LLDPTLV systemCapabilities)LLDPsetSystemDesc(LLDPTLV systemDesc)LLDPsetSystemNameId(LLDPTLV systemNameId)voidsetTLV(String type, LLDPTLV tlv)Sets the LLDPTLV for a type.LLDPsetTtl(LLDPTLV ttl)-
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
-
-
-
-
Method Detail
-
getTLV
public LLDPTLV getTLV(String type)
Gets the full LLDPTLV.- Parameters:
type- description of the type of TLV- Returns:
- LLDPTLV - full TLV
-
getCustomTLV
public LLDPTLV getCustomTLV(CustomTLVKey key)
-
setTLV
public void setTLV(String type, LLDPTLV tlv)
Sets the LLDPTLV for a type.- Parameters:
type- description of the type of TLVtlv- tlv to set
-
getChassisId
public LLDPTLV getChassisId()
Returns the chassisId TLV.
-
getSystemNameId
public LLDPTLV getSystemNameId()
Returns the SystemName TLV.
-
getPortId
public LLDPTLV getPortId()
Returns the portId TLV.
-
getTtl
public LLDPTLV getTtl()
Return the ttl TLV.
-
getSystemDesc
public LLDPTLV getSystemDesc()
Return the SystemDesc TLV.
-
getPortDesc
public LLDPTLV getPortDesc()
Return the PortDesc TLV.
-
getSystemCapabilities
public LLDPTLV getSystemCapabilities()
Return the SystemCapabilities TLV.
-
getManagementAddress
public LLDPTLV getManagementAddress()
Return the ManagementAddress TLV.
-
deserialize
public Packet deserialize(byte[] data, int bitOffset, int size) throws PacketException
Description copied from class:PacketThis method deserializes the data bits obtained from the wire into the respective header and payload which are of type Packet.- Overrides:
deserializein 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
public byte[] serialize() throws PacketExceptionDescription copied from class:PacketThis method serializes the header and payload from the respective packet class, into a single stream of bytes to be sent on the wire.- Overrides:
serializein classPacket- Returns:
- The byte array representing the serialized Packet
- Throws:
PacketException- if serialization fails
-
-