On Wed, Aug 10, 2005 at 08:44:22AM +0100, saifulla Mohd Abdul wrote:
> 
> Hi,
> 
> Yes, we don't need to process request with
> OID (sub-id count more than 128). 
> 
> RFC 3416 says:
> 
>    SNMP limits OBJECT IDENTIFIER values to a maximum
> of 128 sub-identifiers, where each sub-identifier has
> a maximum value of
>    2**32-1.
> 
> Any PDU with an OID having More than 128
> sub-identifiers is an illegal PDU, and causes an
> ASN.1 Parse error which is counted by RFC 3418's
> snmpInASNParseErrs. 
<snip>

        Now this is a different matter than I was commenting on
earlier (previous email in thread quoted):


> > SMA>  As per the SNMP standard, the MAX OID length
> > should
> > SMA> not be > 128 bytes.


        So.. was the original question regarding sub-identifiers,
or bytes? I have seen objects in the wild with greater than 128 bytes,
but not 128 sub-identifiers. It seems like maybe MAX_OID_LEN used to refer
to the maximum byte count. There's a reference in include/types.h to setting
the oid type to u_char where EIGHTBIT_SUBIDS is set.

#ifndef MAX_SUBID               /* temporary - duplicate definition protection 
*/
#ifndef EIGHTBIT_SUBIDS
typedef u_long  oid;
#define MAX_SUBID   0xFFFFFFFF
#else
typedef u_char  oid;
#define MAX_SUBID   0xFF
#endif
#endif

        I'm unable to find any further reference to EIGHTBIT_SUBIDS anywhere
in the source code, so perhaps it's an obsolete artifact. If it is, maybe
it should be removed.
        So.. the max oid size should be MAX_OID_LEN * sizeof(u_long),
which is a much bigger string than MAX_OID_LEN * sizeof(u_char): 512 vs. 128.

        Probably everyone else but me already knew all that. :-)

        Btw, according to the gcc docs int is always 32 bits, long can
be 64 on 64 bit platforms. If the spec says the max val is 2 ** 32 - 1,
then shouldn't that be u_int instead of u_long?
        
        Austin



-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to