public class LLDPTLV extends Packet
Modifier and Type | Class and Description |
---|---|
static class |
LLDPTLV.TLVType |
Modifier and Type | Field and Description |
---|---|
protected Map<String,byte[]> |
fieldValues |
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 CustomTLVKey |
createPortSubTypeCustomTLVKey() |
static CustomTLVKey |
createSecSubTypeCustomTLVKey() |
static byte[] |
createSecSubTypeCustomTLVValue(byte[] customValue)
Creates a custom TLV value including OUI of sub type custom sec and custom bytes value.
|
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()
Returns the length of TLV.
|
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()
Returns the type of TLV.
|
byte[] |
getValue()
Returns the value field of TLV.
|
int |
hashCode() |
void |
setHeaderField(String headerField,
byte[] readValue) |
LLDPTLV |
setLength(short length)
Sets the length.
|
LLDPTLV |
setType(byte type)
Sets the type.
|
LLDPTLV |
setValue(byte[] value)
Sets the value.
|
deserialize, getfieldOffset, getHeaderSize, getParent, getPayload, getRawPayload, isCorrupted, postDeserializeCustomOperation, postSerializeCustomOperation, serialize, setParent, setPayload, setRawPayload, toString
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 byte[] createSecSubTypeCustomTLVValue(byte[] customValue)
customValue
- the custom valuepublic 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)
public static CustomTLVKey createPortSubTypeCustomTLVKey() throws BufferException
BufferException
public static CustomTLVKey createSecSubTypeCustomTLVKey() throws BufferException
BufferException
Copyright © 2019 OpenDaylight. All rights reserved.