I have this object in MIB
userId OBJECT-TYPE
SYNTAX DisplayString (SIZE(0..30))
MAX-ACCESS read-write
STATUS current
DESCRIPTION
"Id for user"
REFERENCE "CFG:WRITE"
::= { config 1 }
I access to this object via snmp request. Using snm4j.
But when i execute this code
VariableBinding vb = res.get(j);
Variable v = vb.getVariable();
log.debug(vb.getVariable().getSyntaxString());
it return only "OCTET STRING" and nothing about SIZE(0..30)
can i get information about SIZE(0..30) via snmp get request, using snmp4j?
To expand on the comment by Lex Li, the snmp4j class that you're using has no MIB information. It is only decoding the type information as seen in the network bytes. You can see, using for example Wireshark, that the bytes sent do not include any size constraints.
In order to know about the constraint, you would have to read the MIB file before decoding the SNMP PDU. Normally an enterprise-grade SNMP manager would load MIB files for managed agents in order to do this. As Lex said, the SNMP4J library does not do this in the free version. There is the SMI Pro version, if you require that feature.