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 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

      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 TLV
      tlv - tlv to set
    • getChassisId

      public LLDPTLV getChassisId()
      Returns the chassisId TLV.
    • setChassisId

      public LLDP setChassisId(LLDPTLV chassisId)
    • getSystemNameId

      public LLDPTLV getSystemNameId()
      Returns the SystemName TLV.
    • setSystemNameId

      public LLDP setSystemNameId(LLDPTLV systemNameId)
    • getPortId

      public LLDPTLV getPortId()
      Returns the portId TLV.
    • setPortId

      public LLDP setPortId(LLDPTLV portId)
    • getTtl

      public LLDPTLV getTtl()
      Return the ttl TLV.
    • setTtl

      public LLDP setTtl(LLDPTLV ttl)
    • getSystemDesc

      public LLDPTLV getSystemDesc()
      Return the SystemDesc TLV.
    • setSystemDesc

      public LLDP setSystemDesc(LLDPTLV systemDesc)
    • getPortDesc

      public LLDPTLV getPortDesc()
      Return the PortDesc TLV.
    • setPortDesc

      public LLDP setPortDesc(LLDPTLV portDesc)
    • getSystemCapabilities

      public LLDPTLV getSystemCapabilities()
      Return the SystemCapabilities TLV.
    • setSystemCapabilities

      public LLDP setSystemCapabilities(LLDPTLV systemCapabilities)
    • getManagementAddress

      public LLDPTLV getManagementAddress()
      Return the ManagementAddress TLV.
    • setManagementAddress

      public LLDP setManagementAddress(LLDPTLV managementAddress)
    • getOptionalTLVList

      public Iterable<LLDPTLV> getOptionalTLVList()
      Returns the optionalTLVList.
    • getCustomTlvList

      public Iterable<LLDPTLV> getCustomTlvList()
      Returns the customTlvList.
    • setOptionalTLVList

      public LLDP setOptionalTLVList(List<LLDPTLV> optionalTLVList)
    • addCustomTLV

      public LLDP addCustomTLV(LLDPTLV customTLV)
    • 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 class Packet
      Parameters:
      data - - data from wire to deserialize
      bitOffset - bit position where packet header starts in data array
      size - 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 class Packet
      Returns:
      The byte array representing the serialized Packet
      Throws:
      PacketException - if serialization fails