Re: Regarding setting/getting table with MAC address as Index
Olivier Miakinen <[email protected]>
| Newsgroups | gmane.network.net-snmp.user |
|---|---|
| Message-ID | <[email protected]> |
Hello Vidya,
I don't know why I discover this message only today. Maybe you get an
answer already, otherwise this is mine...
Le 17/12/2013 08:46, Vidya Sagar Saripalli a écrit :
>
> In my project we are using Net-SNMP agent. I need some clarifications
> regarding table with MAC address as Index.
>
> While setting/getting a value from table with MAC address as one of
> its index, Does I need to specify the length of MAC address(6) also
> in OID?
>
> While getting Net-SNMP will put length (6) in the PDU?
>
> In MIB the definition of MAC address is like this
>
> MacAddress ::= TEXTUAL-CONVENTION
> [...]
> SYNTAX OCTET STRING (SIZE (6))
The answer is here :
<cit. http://tools.ietf.org/search/rfc2578#section-7.7>
(2) string-valued, fixed-length strings (or variable-length preceded by
the IMPLIED keyword): `n' sub-identifiers, where `n' is the length
of the string (each octet of the string is encoded in a separate
sub-identifier);
(3) string-valued, variable-length strings (not preceded by the IMPLIED
keyword): `n+1' sub-identifiers, where `n' is the length of the
string (the first sub-identifier is `n' itself, following this,
each octet of the string is encoded in a separate sub-identifier);
</cit.>
Because it is a fixed-length string, 'SIZE(6)' and not 'SIZE(0..6)', we
are in the case number (2) and not in the case number (3) : you don't
have to (and you mustn't) specify the length in the sub-identifiers.
Regards,
--
Olivier Miakinen
------------------------------------------------------------------------------
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments & Everything In Between.
Get a Quote or Start a Free Trial Today.
http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
_______________________________________________
Net-snmp-users mailing list
[email protected]
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users