Hi Randall,
I ran into this same problem in implementing an enterprise MIB. Try
changing the type of the index in your MIB implementation to
ASN_PRIV_IMPLIED_OCTET_STR. That tells Net-SNMP that the length of the
octet string index is implied and should not be included in the
response.
In the mib2c generated code, the place I had to change this was in the
initialize_table_* function:
table_info = SNMP_MALLOC_TYPEDEF( netsnmp_table_registration_info );
netsnmp_table_helper_add_indexes(table_info,
ASN_PRIV_IMPLIED_OCTET_STR,
0);
Hope that helps.
Regards,
Eric
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
Randall Loomis
Sent: Wednesday, 11 April, 2007 13:38
To: Dave Shield
Cc: SNMP FORUM
Subject: Re: Is MacAddr a fixed or variable length OID?
On Wed, 2007-04-11 at 10:31 +0100, Dave Shield wrote:
> On 11/04/07, Randall Loomis <[EMAIL PROTECTED]> wrote:
> > Reading section 7.7 of RFC-2578, I interpret an OCTET STRING with
fixed
> > size 6 should be specified thus:
> > <oid_base>.11.22.33.44.55.66.<last_index>
>
> That's correct.
>
>
> > However, when doing an snmpget command, it's requiring me to include
a
> > length 6 as though it were a variable length OCTET STRING
>
> No - it shouldn't work that way.
>
>
>
> > Is this normal, or is there a way I can make the agent understand
this
> > is a fixed size string and doesn't need the preceding length?
>
> Is this a MIB module that you have written yourself, or one from
somewhere
> else? If so, who wrote it? (You're going to say it's a Net-SNMP
standard
> module, aren't you?!)
> It definitely sounds like a bug in the agent MIB module.
>
> Dave
>
Thanks for the reply.
Well, I guess the good news is it isn't a standard net-snmp mib module;
it's a new MIB that came from IEEE that I added to the agent for WiMAX
support.
The bad news is I don't see any obvious errors. Maybe you can help me
spot the problem? Hopefully here's all the relevant parts of the MIB in
question:
The MacAddress TC definition from SNMPv2-TC.txt:
92 MacAddress ::= TEXTUAL-CONVENTION
93 DISPLAY-HINT "1x:"
94 STATUS current
95 DESCRIPTION
96 "Represents an 802 MAC address represented in the
97 `canonical' order defined by IEEE 802.1a, i.e., as if it
98 were transmitted least significant bit first, even though
99 802.5 (in contrast to other 802.x protocols) requires MAC
100 addresses to be transmitted most significant bit first."
101 SYNTAX OCTET STRING (SIZE (6))
The IMPORT section of WMAN-IF-MIB.txt getting the MacAddress TC:
12 TEXTUAL-CONVENTION,
13 MacAddress, RowStatus, TruthValue,
14 TimeStamp, DateAndTime
15 FROM SNMPv2-TC
The table definition section of WMAN-IF-MIB.txt where the MacAddress TC
is used as the SYNTAX for an index value:
676 wmanIfBsSsProvisionedForSfTable OBJECT-TYPE
677 SYNTAX SEQUENCE OF WmanIfBsSsProvisionedForSfEntry
678 MAX-ACCESS not-accessible
679 STATUS current
680 DESCRIPTION
681 "This table maps the MAC addresses of SSs to the service
682 flows provisioned in wmanIfBsProvisionedSfTable."
683 REFERENCE
684 "Subclause 6.3.14 in IEEE Std 802.16-2004"
685 ::= { wmanIfBsPacketCs 2 }
686
687 wmanIfBsSsProvisionedForSfEntry OBJECT-TYPE
688 SYNTAX WmanIfBsSsProvisionedForSfEntry
689 MAX-ACCESS not-accessible
690 STATUS current
691 DESCRIPTION
692 "This table is indexed by wmanIfBsSsProvMacAddress and
693 wmanIfBsProvSfId."
694 INDEX { wmanIfBsSsProvMacAddress, wmanIfBsProvSfId }
695 ::= { wmanIfBsSsProvisionedForSfTable 1 }
696
697 WmanIfBsSsProvisionedForSfEntry ::= SEQUENCE {
698 wmanIfBsSsProvMacAddress MacAddress,
699 wmanIfBsProvSfId Unsigned32,
700 wmanIfBsSsProvisionedForSfRowStatus RowStatus}
701
702 wmanIfBsSsProvMacAddress OBJECT-TYPE
703 SYNTAX MacAddress
704 MAX-ACCESS not-accessible
705 STATUS current
706 DESCRIPTION
707 "The MAC address of the SS, the service flow is created
708 with."
709 ::= { wmanIfBsSsProvisionedForSfEntry 1 }
--
|\/|
|/\|
|\/| Randall S. Loomis
Sr. Software Engineer
Solectek Corporation
www.solectek.com
------------------------------------------------------------------------
-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share
your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDE
V
_______________________________________________
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
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
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