On 2024/01/02 19:48, Denis Hainsworth wrote:
> Apologies if this is terribly off topic. However its a very niche
> mib/snmp question I'm hoping someone can guide me on as to if a vendor
> is right or not.
>
> Up till now all vendors I know have implemented the index for
> .iso.org.dod.internet.mgmt.mib-2.ip.ipAddressTable.ipAddressEntry.ipAddressIfIndex.ipv4
> or
> 1.3.6.1.2.1.4.34.1.3
>
> as quad dotted decimal so type .ipv4. index is readable in the OID and for
> .ipv6. it is 16 dotted decimal conversion of the hex.
>
> examples
> iso.3.6.1.2.1.4.34.1.3.1.4.127.0.0.1 = INTEGER: 21
> iso.3.6.1.2.1.4.34.1.3.2.16.254.128.0.0.0.0.0.0.2.0.0.255.254.0.0.4 =
> INTEGER: 18
>
> a new whitebox router vendor drivenets is returning both as ascii
> encoded values like so which snmptranslate does a fine job handling
>
> snmptranslate -M /usr/share/snmp/mibs/ -Of
> 1.3.6.1.2.1.4.34.1.3.1.7.49.46.49.46.49.46.49
> .iso.org.dod.internet.mgmt.mib-2.ip.ipAddressTable.ipAddressEntry.ipAddressIfIndex.ipv4."1.1.1.1"
>
> What for the life of me I cant follow are the MIB RFCs to the point of
> telling if they did it in an annnoying but not illegal way or if this is
> the cool new way the RFCs suggest should be used. I'm stuck a lot on
> the wording of INET-ADDRESS-MIB.txt for things like InetAddressIPv4 as
> well as https://datatracker.ietf.org/doc/html/rfc2578#section-7.7
>
> Anyone have an informed opinion as to if I should push back on that kind
> of ascii encoded formatting of the index of the ipAddressTable.
>
> Are they simply equally valid? Or could one format be considered more
> valid.
They're doing it wrong, the inetAddressType is ipv4, so this applies
InetAddressIPv4 ::= TEXTUAL-CONVENTION
DISPLAY-HINT "1d.1d.1d.1d"
STATUS current
DESCRIPTION
"Represents an IPv4 network address:
Octets Contents Encoding
1-4 IPv4 address network-byte order
The corresponding InetAddressType value is ipv4(1).
This textual convention SHOULD NOT be used directly in object
definitions, as it restricts addresses to a specific format.
However, if it is used, it MAY be used either on its own or in
conjunction with InetAddressType, as a pair."
SYNTAX OCTET STRING (SIZE (4))
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders