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, payloadClass, rawPayload, writeAccess
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description LLDP
addCustomTLV(LLDPTLV customTLV)
Packet
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.LLDPTLV
getChassisId()
Returns the chassisId TLV.LLDPTLV
getCustomTLV(CustomTLVKey key)
Iterable<LLDPTLV>
getCustomTlvList()
Returns the customTlvList.LLDPTLV
getManagementAddress()
Return the ManagementAddress TLV.Iterable<LLDPTLV>
getOptionalTLVList()
Returns the optionalTLVList.LLDPTLV
getPortDesc()
Return the PortDesc TLV.LLDPTLV
getPortId()
Returns the portId TLV.LLDPTLV
getSystemCapabilities()
Return the SystemCapabilities TLV.LLDPTLV
getSystemDesc()
Return the SystemDesc TLV.LLDPTLV
getSystemNameId()
Returns the SystemName TLV.LLDPTLV
getTLV(String type)
Gets the full LLDPTLV.LLDPTLV
getTtl()
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.LLDP
setChassisId(LLDPTLV chassisId)
LLDP
setManagementAddress(LLDPTLV managementAddress)
LLDP
setOptionalTLVList(List<LLDPTLV> optionalTLVList)
LLDP
setPortDesc(LLDPTLV portDesc)
LLDP
setPortId(LLDPTLV portId)
LLDP
setSystemCapabilities(LLDPTLV systemCapabilities)
LLDP
setSystemDesc(LLDPTLV systemDesc)
LLDP
setSystemNameId(LLDPTLV systemNameId)
void
setTLV(String type, LLDPTLV tlv)
Sets the LLDPTLV for a type.LLDP
setTtl(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: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
public byte[] serialize() throws PacketException
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
-
-