Package org.onlab.packet
Class LLDP
- java.lang.Object
-
- org.onlab.packet.BasePacket
-
- org.onlab.packet.LLDP
-
- All Implemented Interfaces:
IPacket
- Direct Known Subclasses:
ONOSLLDP
public class LLDP extends BasePacket
Representation of an LLDP Packet.
-
-
Field Summary
Fields Modifier and Type Field Description static short
CHASSIS_TLV_SIZE
static byte
CHASSIS_TLV_SUBTYPE
static byte
CHASSIS_TLV_TYPE
protected LLDPTLV
chassisId
protected short
ethType
protected List<LLDPTLV>
optionalTLVList
static byte
PORT_TLV_COMPONENT_SUBTYPE
static byte
PORT_TLV_INTERFACE_NAME_SUBTYPE
static short
PORT_TLV_SIZE
static byte
PORT_TLV_TYPE
protected LLDPTLV
portId
protected LLDPTLV
ttl
static short
TTL_TLV_SIZE
static byte
TTL_TLV_TYPE
-
Fields inherited from class org.onlab.packet.BasePacket
parent, payload
-
-
Constructor Summary
Constructors Constructor Description LLDP()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description LLDP
addOptionalTLV(LLDPTLV lldptlv)
Adds additional TLV to optionalTLVList.static Deserializer<LLDP>
deserializer()
Deserializer function for LLDP packets.boolean
equals(Object obj)
LLDPTLV
getChassisId()
List<LLDPTLV>
getOptionalTLVList()
LLDPTLV
getPortId()
LLDPTLV
getTtl()
int
hashCode()
byte[]
serialize()
Sets all payloads parent packet if applicable, then serializes this packet and all payloads.LLDP
setChassisId(LLDPTLV chassis)
LLDP
setOptionalTLVList(List<LLDPTLV> optionalTLVList)
LLDP
setPortId(LLDPTLV portId)
LLDP
setTtl(LLDPTLV ttl)
String
toString()
-
Methods inherited from class org.onlab.packet.BasePacket
clone, getParent, getPayload, resetChecksum, setParent, setPayload
-
-
-
-
Field Detail
-
CHASSIS_TLV_TYPE
public static final byte CHASSIS_TLV_TYPE
- See Also:
- Constant Field Values
-
CHASSIS_TLV_SIZE
public static final short CHASSIS_TLV_SIZE
- See Also:
- Constant Field Values
-
CHASSIS_TLV_SUBTYPE
public static final byte CHASSIS_TLV_SUBTYPE
- See Also:
- Constant Field Values
-
PORT_TLV_TYPE
public static final byte PORT_TLV_TYPE
- See Also:
- Constant Field Values
-
PORT_TLV_SIZE
public static final short PORT_TLV_SIZE
- See Also:
- Constant Field Values
-
PORT_TLV_COMPONENT_SUBTYPE
public static final byte PORT_TLV_COMPONENT_SUBTYPE
- See Also:
- Constant Field Values
-
PORT_TLV_INTERFACE_NAME_SUBTYPE
public static final byte PORT_TLV_INTERFACE_NAME_SUBTYPE
- See Also:
- Constant Field Values
-
TTL_TLV_TYPE
public static final byte TTL_TLV_TYPE
- See Also:
- Constant Field Values
-
TTL_TLV_SIZE
public static final short TTL_TLV_SIZE
- See Also:
- Constant Field Values
-
chassisId
protected LLDPTLV chassisId
-
portId
protected LLDPTLV portId
-
ttl
protected LLDPTLV ttl
-
ethType
protected short ethType
-
-
Method Detail
-
getChassisId
public LLDPTLV getChassisId()
- Returns:
- the chassisId
-
setChassisId
public LLDP setChassisId(LLDPTLV chassis)
- Parameters:
chassis
- the chassisId to set- Returns:
- this
-
getPortId
public LLDPTLV getPortId()
- Returns:
- the portId
-
setPortId
public LLDP setPortId(LLDPTLV portId)
- Parameters:
portId
- the portId to set- Returns:
- this
-
getTtl
public LLDPTLV getTtl()
- Returns:
- the ttl
-
setOptionalTLVList
public LLDP setOptionalTLVList(List<LLDPTLV> optionalTLVList)
- Parameters:
optionalTLVList
- the optionalTLVList to set- Returns:
- this
-
addOptionalTLV
public LLDP addOptionalTLV(LLDPTLV lldptlv)
Adds additional TLV to optionalTLVList.- Parameters:
lldptlv
- the optional TLV to be added- Returns:
- this
-
serialize
public byte[] serialize()
Description copied from interface:IPacket
Sets all payloads parent packet if applicable, then serializes this packet and all payloads.- Returns:
- a byte[] containing this packet and payloads
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classBasePacket
-
equals
public boolean equals(Object obj)
- Overrides:
equals
in classBasePacket
-
deserializer
public static Deserializer<LLDP> deserializer()
Deserializer function for LLDP packets.- Returns:
- deserializer function
-
-