Package org.onlab.packet
Class ONOSLLDP
- java.lang.Object
-
- org.onlab.packet.BasePacket
-
- org.onlab.packet.LLDP
-
- org.onlab.packet.ONOSLLDP
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
DEFAULT_DEVICE
static java.lang.String
DEFAULT_NAME
protected static byte
DEVICE_SUBTYPE
protected static byte
DOMAIN_SUBTYPE
protected static byte
NAME_SUBTYPE
protected static byte
SIG_SUBTYPE
protected static byte
TIMESTAMP_SUBTYPE
-
Fields inherited from class org.onlab.packet.LLDP
chassisId, ethType, optionalTLVList, PORT_TLV_COMPONENT_SUBTYPE, PORT_TLV_INTERFACE_NAME_SUBTYPE, PORT_TLV_SIZE, PORT_TLV_TYPE, portId, ttl, TTL_TLV_SIZE
-
Fields inherited from class org.onlab.packet.BasePacket
parent, payload
-
-
Constructor Summary
Constructors Constructor Description ONOSLLDP(byte... subtype)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description MacAddress
getChassisIdByMac()
java.lang.String
getDeviceString()
LLDPOrganizationalTLV
getDeviceTLV()
java.lang.String
getDomainString()
LLDPOrganizationalTLV
getDomainTLV()
Gets the TLV associated with remote probing.java.lang.String
getNameString()
LLDPOrganizationalTLV
getNameTLV()
java.lang.Integer
getPort()
java.lang.String
getPortDescString()
LLDPTLV
getPortDescTLV()
java.lang.String
getPortNameString()
byte[]
getSig()
LLDPOrganizationalTLV
getSigTLV()
long
getTimestamp()
LLDPOrganizationalTLV
getTimestampTLV()
short
getTtlBySeconds()
static ONOSLLDP
onosLLDP(java.lang.String deviceId, ChassisId chassisId, int portNum)
Deprecated.since 1.15.static ONOSLLDP
onosLLDP(java.lang.String deviceId, ChassisId chassisId, int portNum, java.lang.String portDesc)
Deprecated.since 1.15.static ONOSLLDP
onosSecureLLDP(java.lang.String deviceId, ChassisId chassisId, int portNum, java.lang.String secret)
Creates a link probe for link discovery/verification.static ONOSLLDP
onosSecureLLDP(java.lang.String deviceId, ChassisId chassisId, int portNum, java.lang.String portDesc, java.lang.String secret)
Creates a link probe for link discovery/verification.static ONOSLLDP
parseLLDP(Ethernet eth)
Given an ethernet packet, returns the device the LLDP came from.static ONOSLLDP
parseONOSLLDP(Ethernet eth)
Given an ethernet packet, determines if this is an LLDP from ONOS and returns the device the LLDP came from.void
setChassisId(ChassisId chassisId)
void
setDevice(java.lang.String device)
void
setDomainInfo(java.lang.String domainId)
void
setName(java.lang.String name)
void
setPortId(int portNumber)
void
setPortName(java.lang.String portName)
void
setSig(byte[] sig)
void
setTimestamp(long timestamp)
static boolean
verify(ONOSLLDP probe, java.lang.String secret, long maxDelay)
-
Methods inherited from class org.onlab.packet.LLDP
addOptionalTLV, deserializer, equals, getChassisId, getOptionalTLVList, getPortId, getTtl, hashCode, serialize, setChassisId, setOptionalTLVList, setPortId, setTtl, toString
-
Methods inherited from class org.onlab.packet.BasePacket
clone, getParent, getPayload, resetChecksum, setParent, setPayload
-
-
-
-
Field Detail
-
DEFAULT_DEVICE
public static final java.lang.String DEFAULT_DEVICE
- See Also:
- Constant Field Values
-
DEFAULT_NAME
public static final java.lang.String DEFAULT_NAME
- See Also:
- Constant Field Values
-
NAME_SUBTYPE
protected static final byte NAME_SUBTYPE
- See Also:
- Constant Field Values
-
DEVICE_SUBTYPE
protected static final byte DEVICE_SUBTYPE
- See Also:
- Constant Field Values
-
DOMAIN_SUBTYPE
protected static final byte DOMAIN_SUBTYPE
- See Also:
- Constant Field Values
-
TIMESTAMP_SUBTYPE
protected static final byte TIMESTAMP_SUBTYPE
- See Also:
- Constant Field Values
-
SIG_SUBTYPE
protected static final byte SIG_SUBTYPE
- See Also:
- Constant Field Values
-
-
Method Detail
-
setName
public void setName(java.lang.String name)
-
setDevice
public void setDevice(java.lang.String device)
-
setDomainInfo
public void setDomainInfo(java.lang.String domainId)
-
setChassisId
public void setChassisId(ChassisId chassisId)
-
setPortId
public void setPortId(int portNumber)
-
setPortName
public void setPortName(java.lang.String portName)
-
setTimestamp
public void setTimestamp(long timestamp)
-
setSig
public void setSig(byte[] sig)
-
getNameTLV
public LLDPOrganizationalTLV getNameTLV()
-
getDeviceTLV
public LLDPOrganizationalTLV getDeviceTLV()
-
getTimestampTLV
public LLDPOrganizationalTLV getTimestampTLV()
-
getSigTLV
public LLDPOrganizationalTLV getSigTLV()
-
getDomainTLV
public LLDPOrganizationalTLV getDomainTLV()
Gets the TLV associated with remote probing. This TLV will be null if remote probing is disabled.- Returns:
- A TLV containing domain ID, or null.
-
getPortDescTLV
public LLDPTLV getPortDescTLV()
-
getNameString
public java.lang.String getNameString()
-
getDeviceString
public java.lang.String getDeviceString()
-
getDomainString
public java.lang.String getDomainString()
-
getPortDescString
public java.lang.String getPortDescString()
-
getPort
public java.lang.Integer getPort()
-
getPortNameString
public java.lang.String getPortNameString()
-
getChassisIdByMac
public MacAddress getChassisIdByMac()
-
getTtlBySeconds
public short getTtlBySeconds()
-
getTimestamp
public long getTimestamp()
-
getSig
public byte[] getSig()
-
parseONOSLLDP
public static ONOSLLDP parseONOSLLDP(Ethernet eth)
Given an ethernet packet, determines if this is an LLDP from ONOS and returns the device the LLDP came from.- Parameters:
eth
- an ethernet packet- Returns:
- a the lldp packet or null
-
parseLLDP
public static ONOSLLDP parseLLDP(Ethernet eth)
Given an ethernet packet, returns the device the LLDP came from.- Parameters:
eth
- an ethernet packet- Returns:
- a the lldp packet or null
-
onosLLDP
@Deprecated public static ONOSLLDP onosLLDP(java.lang.String deviceId, ChassisId chassisId, int portNum)
Deprecated.since 1.15. Insecure, do not use.Creates a link probe for link discovery/verification.- Parameters:
deviceId
- The device ID as a StringchassisId
- The chassis ID of the deviceportNum
- Port number of port to send probe out of- Returns:
- ONOSLLDP probe message
-
onosSecureLLDP
public static ONOSLLDP onosSecureLLDP(java.lang.String deviceId, ChassisId chassisId, int portNum, java.lang.String secret)
Creates a link probe for link discovery/verification.- Parameters:
deviceId
- The device ID as a StringchassisId
- The chassis ID of the deviceportNum
- Port number of port to send probe out ofsecret
- LLDP secret- Returns:
- ONOSLLDP probe message
-
onosLLDP
@Deprecated public static ONOSLLDP onosLLDP(java.lang.String deviceId, ChassisId chassisId, int portNum, java.lang.String portDesc)
Deprecated.since 1.15. Insecure, do not use.Creates a link probe for link discovery/verification.- Parameters:
deviceId
- The device ID as a StringchassisId
- The chassis ID of the deviceportNum
- Port number of port to send probe out ofportDesc
- Port description of port to send probe out of- Returns:
- ONOSLLDP probe message
-
onosSecureLLDP
public static ONOSLLDP onosSecureLLDP(java.lang.String deviceId, ChassisId chassisId, int portNum, java.lang.String portDesc, java.lang.String secret)
Creates a link probe for link discovery/verification.- Parameters:
deviceId
- The device ID as a StringchassisId
- The chassis ID of the deviceportNum
- Port number of port to send probe out ofportDesc
- Port description of port to send probe out ofsecret
- LLDP secret- Returns:
- ONOSLLDP probe message
-
verify
public static boolean verify(ONOSLLDP probe, java.lang.String secret, long maxDelay)
-
-