public class LLDPTLV extends Packet
Modifier and Type | Class and Description |
---|---|
static class |
LLDPTLV.TLVType |
Modifier and Type | Field and Description |
---|---|
static byte[] |
chassisIDSubType |
static byte[] |
CUSTOM_TLV_SUB_TYPE_CUSTOM_SEC
OpenFlow subtype: custom sec = hash code of verification of origin of LLDP
|
static byte[] |
CUSTOM_TLV_SUB_TYPE_NODE_CONNECTOR_ID
OpenFlow subtype: nodeConnectorId of source
|
static int |
customTlvOffset |
protected Map<String,byte[]> |
fieldValues |
static byte[] |
OFOUI
OpenFlow OUI
|
static byte[] |
portIDSubType |
corrupted, hdrFieldCoordMap, hdrFieldsMap, parent, payload, payloadClass, rawPayload, writeAccess
Constructor and Description |
---|
LLDPTLV()
Default constructor that creates and sets the hash map values and sets
the payload to null
|
LLDPTLV(LLDPTLV other)
Constructor that writes the passed LLDPTLV values to the hdrFieldsMap
|
Modifier and Type | Method and Description |
---|---|
static byte[] |
createChassisIDTLVValue(String nodeId)
Creates the ChassisID TLV value including the subtype and ChassisID
string
|
static byte[] |
createCustomTLVValue(byte[] subtype,
byte[] customByteArray)
Creates the custom TLV value including OUI, subtype and custom string
|
static byte[] |
createCustomTLVValue(String customString)
Creates the custom TLV value including OUI, subtype and custom string
|
static byte[] |
createPortIDTLVValue(String portId)
Creates the PortID TLV value including the subtype and PortID string
|
static byte[] |
createSystemNameTLVValue(String nodeId)
Creates the SystemName TLV value
|
boolean |
equals(Object obj) |
static int |
extractCustomOUI(LLDPTLV lldptlv) |
static byte |
extractCustomSubtype(LLDPTLV lldptlv) |
static String |
getCustomString(byte[] customTlvValue,
int customTlvLen)
Retrieves the custom string from the Custom TLV value which includes OUI,
subtype and custom string
|
int |
getfieldnumBits(String fieldName)
This method fetches the number of bits for header field specified by
'fieldname'.
|
static String |
getHexStringValue(byte[] tlvValue,
int tlvLen)
Retrieves the string from TLV value and returns it in HexString format
|
int |
getLength() |
static String |
getStringValue(byte[] tlvValue,
int tlvLen)
Retrieves the string from TLV value
|
int |
getTLVSize()
Returns the size in bits of the whole TLV
|
byte |
getType() |
byte[] |
getValue() |
int |
hashCode() |
void |
setHeaderField(String headerField,
byte[] readValue) |
LLDPTLV |
setLength(short length) |
LLDPTLV |
setType(byte type) |
LLDPTLV |
setValue(byte[] value) |
deserialize, getfieldOffset, getHeaderSize, getParent, getPayload, getRawPayload, isCorrupted, postDeserializeCustomOperation, postSerializeCustomOperation, serialize, setParent, setPayload, setRawPayload, toString
public static final byte[] OFOUI
public static final byte[] CUSTOM_TLV_SUB_TYPE_NODE_CONNECTOR_ID
public static final byte[] CUSTOM_TLV_SUB_TYPE_CUSTOM_SEC
public static final int customTlvOffset
public static final byte[] chassisIDSubType
public static final byte[] portIDSubType
public LLDPTLV()
public LLDPTLV(LLDPTLV other)
public int getLength()
public byte getType()
public byte[] getValue()
public LLDPTLV setType(byte type)
type
- the type to setpublic LLDPTLV setLength(short length)
length
- the length to setpublic LLDPTLV setValue(byte[] value)
value
- the value to setpublic void setHeaderField(String headerField, byte[] readValue)
setHeaderField
in class Packet
public int getfieldnumBits(String fieldName)
Packet
getfieldnumBits
in class Packet
public int getTLVSize()
public static byte[] createSystemNameTLVValue(String nodeId)
nodeId
- node identifier stringpublic static byte[] createChassisIDTLVValue(String nodeId)
nodeId
- node identifier stringpublic static byte[] createPortIDTLVValue(String portId)
portId
- port identifier stringpublic static byte[] createCustomTLVValue(String customString)
customString
- port identifier stringcreateCustomTLVValue(byte[],byte[])
public static byte[] createCustomTLVValue(byte[] subtype, byte[] customByteArray)
subtype
- openflow subtypecustomByteArray
- port identifier stringpublic static String getHexStringValue(byte[] tlvValue, int tlvLen)
tlvValue
- the TLV valuetlvLen
- the TLV lengthpublic static String getStringValue(byte[] tlvValue, int tlvLen)
tlvValue
- the TLV valuetlvLen
- the TLV lengthpublic static String getCustomString(byte[] customTlvValue, int customTlvLen)
customTlvValue
- the custom TLV valuecustomTlvLen
- the custom TLV lengthpublic static int extractCustomOUI(LLDPTLV lldptlv)
public static byte extractCustomSubtype(LLDPTLV lldptlv)
Copyright © 2019 OpenDaylight. All rights reserved.