Hi Robert:

   Thanks!
RS> Did you generate the code using mib2c?
   Yes, the code was generated  by mib2c. It's quite a neat tool to help a 
complete SNMP layman like me to start my project - and it works fine.

RS> There is only one catch here - indexes aren't supposed to change. 
   Although I don't get the full picture of the catch you were referring to. I 
think I can avoid that happen.  
   
RS> there are tons of examples in the code. There are helper functions 
(header_simplex, header_complex) to help with indexes in the old-api code.
   Okay. I will study those first. That's how I got my first SNMP project 
completed. Certainly I will learn new staff from there.

Thanks,
Jim
-----Original Message-----
From: Robert Story (Users) [mailto:[EMAIL PROTECTED]
Sent: Friday, November 19, 2004 11:14 PM
To: Jim Su
Cc: [EMAIL PROTECTED]
Subject: Re: multiple set of table handling


On Fri, 19 Nov 2004 11:02:35 +0800 Jim wrote:
JS>      What is the possible approach to enhance the current agent to return
JS>      multiple "set" of data in one walk?  The table is defined as variable4
JS>      {}.

Did you generate the code using mib2c?

JS I think to define the multiple sets of data for that  table, I
JS>      need to add the "abcTableSetIndex" in that variable. This number is
JS>      variant - meaning it depends on how many set of data the agent will
JS>      poll out from the share memory.

Exactly. There is only one catch here - indexes aren't supposed to change. For
example, if you have 3 sets of data, the indexes would be (1,2,3). If the
second set goes away, the indexes must be (1,3). You can't just renumber to
(1,2). And if set 2 comes back, it should be 2 again. One could make a case
for just using 4, so you have (1,3,4), but you definitely don't want to end
up with (1,2(previously 3),3(previously 2)). So you will need some way of
uniquely identifying a set.

JS>      How do I specify the oid for each
JS>      table entry for each different set of data, since the number of set is
JS>      unknown at the time this variable is defined?

You don't specify indexes. You define the basic table structure (columns), and
the indexes are dealt with at run-time.

I haven't done old-api code in a while, but there are tons of examples in the
code. There are helper functions (header_simplex, header_complex) to help with
indexes in the old-api code.

-- 
Robert Story; NET-SNMP Junkie
Support: <http://www.net-snmp.org/> <irc://irc.freenode.net/#net-snmp>  
Archive: <http://sourceforge.net/mailarchive/forum.php?forum=net-snmp-users>

You are lost in a twisty maze of little standards, all different. 
N�HS^�隊X���'���u���׫K+-zk!�8��1 
�X��0&�[bv)��Ȩ��]j֛jǭ��\�f��+������y�Z��ޕ�b�v���!��h�'���"��j��}�-��\��+%���8��,��
  ��$0B�
"�׫�+-zk�o�j�!�׭�y��ǫ�f��)��+-5�l�jn���+-��.�ǟ����O��zǞ���Yh�)२������r��z�܅��z�az�)�*'�m����+-��.�ǟ�����+-��b�ا~��z�'���z�

Reply via email to