Class BERNode
java.lang.Object
com.snmp4j.smi.ber.BERNode
- Direct Known Subclasses:
BERNodeError
A node in the BER parse tree of an SNMP message.
Each node represents one TLV (tag-length-value) element decoded from the raw bytes.
- Since:
- 2.0.0
- Author:
- Frank Fock
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidorg.snmp4j.smi.VariablegetData()org.snmp4j.smi.OIDgetOid()intgetPos()intintgetTag()Returns the hex representation of the BER tag of this BER node.Returns the name of the BER tag of this BER node.intbooleanvoidsetDecrypted(boolean decrypted) voidsetDescription(String description) voidsetExpectedTags(LinkedList<?> expectedTags) Sets the list of expected tags for this BER node.voidsetFormattedValue(String formattedValue) voidsetOid(org.snmp4j.smi.OID oid) voidsetSequenceLength(int sequenceLength) toString()Returns a multi-line string representation of this BER node.
-
Constructor Details
-
BERNode
public BERNode(int tag, int position, int totalLength, org.snmp4j.smi.Variable variable) Creates a new BER node.- Parameters:
tag- the BER tag valueposition- the position of the BER node in the raw bytestotalLength- the total length of the BER node in the raw bytesvariable- the variable decoded from the BER node
-
BERNode
public BERNode(int tag, int position, int totalLength, org.snmp4j.smi.Variable variable, String description) Creates a new BER node with a description.- Parameters:
tag- the BER tag valueposition- the position of the BER node in the raw bytestotalLength- the total length of the BER node in the raw bytesvariable- the variable decoded from the BER nodedescription- the description of the BER node
-
-
Method Details
-
getTag
public int getTag() -
getPos
public int getPos() -
getTotalLength
public int getTotalLength() -
getSequenceLength
public int getSequenceLength() -
getDescription
-
getFormattedValue
-
getOid
public org.snmp4j.smi.OID getOid() -
getData
public org.snmp4j.smi.Variable getData() -
isDecrypted
public boolean isDecrypted() -
getChildren
-
getExpectedTags
-
setSequenceLength
public void setSequenceLength(int sequenceLength) -
setDescription
-
setFormattedValue
-
setOid
public void setOid(org.snmp4j.smi.OID oid) -
setDecrypted
public void setDecrypted(boolean decrypted) -
setExpectedTags
Sets the list of expected tags for this BER node.- Parameters:
expectedTags- a list of expected tags.
-
addChild
-
getTagHex
Returns the hex representation of the BER tag of this BER node.- Returns:
- the hex representation of the BER tag of this BER node.
-
getTagName
Returns the name of the BER tag of this BER node.- Returns:
- the name of the BER tag of this BER node.
-
toString
-