about the problem of index

This is a discussion on about the problem of index within the SNMP Coders forums, part of the Networking and Network Related category; --===============1920737901== Content-Type: multipart/alternative; boundary="----=_Part_202862_6293869.1174641757607" ------=_Part_202862_6293869.1174641757607 Content-Type: text/plain; charset=ISO-8859-1; ...


Go Back   Usenet Forums > Networking and Network Related > SNMP Coders

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 03-23-2007
Clement Hsu
 
Posts: n/a
Default about the problem of index

--===============1920737901==
Content-Type: multipart/alternative;
boundary="----=_Part_202862_6293869.1174641757607"

------=_Part_202862_6293869.1174641757607
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Dear All:

I am Clement. I meet a problem about write 802dot11MIB table. the MIB is as
following:


__________________________________________________ _________________________________________

[802dot11MIB-dot11GroupAddressesTable]:

dot11GroupAddressesTable OBJECT-TYPE
SYNTAX SEQUENCE OF Dot11GroupAddressesEntry
MAX-ACCESS not-accessible
STATUS current
DESCRIPTION
"A conceptual table containing a set of MAC addresses
identifying the multicast addresses for which this STA
will receive frames. The default value of this attribute
shall be null."
::= { dot11mac 3 }

dot11GroupAddressesEntry OBJECT-TYPE
SYNTAX Dot11GroupAddressesEntry
MAX-ACCESS not-accessible
STATUS current
DESCRIPTION
"An Entry (conceptual row) in the Group Addresses Table.

ifIndex - Each IEEE 802.11 interface is represented by an
ifEntry. Interface tables in this MIB module are indexed
by ifIndex."
INDEX { ifIndex,
dot11GroupAddressesIndex}
::= { dot11GroupAddressesTable 1 }

Dot11GroupAddressesEntry ::=
SEQUENCE { dot11GroupAddressesIndex Integer32,
dot11Address MacAddress,
dot11GroupAddressesStatus RowStatus }

dot11GroupAddressesIndex OBJECT-TYPE
SYNTAX Integer32
MAX-ACCESS not-accessible
STATUS current
DESCRIPTION
"The auxiliary variable used to identify instances
of the columnar objects in the Group Addresses Table."
::= { dot11GroupAddressesEntry 1 }

dot11Address OBJECT-TYPE
SYNTAX MacAddress
MAX-ACCESS read-create
STATUS current
DESCRIPTION
"MAC address identifying a multicast addresses
from which this STA will receive frames."
::= { dot11GroupAddressesEntry 2 }

dot11GroupAddressesStatus OBJECT-TYPE
SYNTAX RowStatus
MAX-ACCESS read-create
STATUS current
DESCRIPTION
"The status column used for creating, modifying, and
deleting instances of the columnar objects in the Group
Addresses Table."
DEFVAL { active }
::= { dot11GroupAddressesEntry 3 }









-----------------------------------------------------------------------------------



the problem is about dot11GroupAddressesIndex, I don't know how to
implement
this object exactly. To implement it, i write the codes as belowing:




[Implementation]




typedef struct
{
int index;
char wifi_Address[6]; /* MacAddress */
char wifi_GroupAddressesStatus; /*RowStatus*/
}dot11GroupAddressesTable;







netsnmp_variable_list *
dot11StationConfigTable_get_first_data_point(void **my_loop_context,
void **my_data_context,
netsnmp_variable_list *
put_index_data,
netsnmp_iterator_info *mydata)
{

netsnmp_variable_list *vptr;

LoopContext = 1;

dot11GroupAddressesTable[LoopContext].index = LoopContext;
*my_loop_context = &LoopContext;

vptr = put_index_data;

snmp_set_var_value(vptr, (u_char *)&LoopContext, sizeof(LoopContext));
vptr = vptr->next_variable;


return put_index_data;
}


----------------------------------------------------------------

When I perform snmpwork, I got the following result:

IEEE802dot11-MIB::dot11GroupAddressesStatus.1.0 = INTEGER: active(1)
IEEE802dot11-MIB::dot11GroupAddressesStatus.2.0 = INTEGER: active(1)
IEEE802dot11-MIB::dot11GroupAddressesStatus.3.0 = INTEGER: active(1)
IEEE802dot11-MIB::dot11GroupAddressesStatus.4.0 = INTEGER: active(1)


but the exact result should be

IEEE802dot11-MIB::dot11GroupAddressesStatus.1 = INTEGER: active(1)
IEEE802dot11-MIB::dot11GroupAddressesStatus.2 = INTEGER: active(1)
IEEE802dot11-MIB::dot11GroupAddressesStatus.3 = INTEGER: active(1)
IEEE802dot11-MIB::dot11GroupAddressesStatus.4 = INTEGER: active(1)


I don't realize how to solve this problem , can any one give me suggestion?
thank you.

Best Regards,
Clement Hsu

------=_Part_202862_6293869.1174641757607
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Dear All:<br><br>I am Clement. I meet a problem about write 802dot11MIB table. the MIB is as following:<br><br><br>____________________________ __________________________________________________ _____________<br><br>[802dot11MIB-dot11GroupAddressesTable]:
<br><br>dot11GroupAddressesTable OBJECT-TYPE<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SYNTAX SEQUENCE OF Dot11GroupAddressesEntry
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MAX-ACCESS not-accessible<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; STATUS current<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb sp; DESCRIPTION<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp ;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;A conceptual table containing a set of MAC addresses<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;& nbsp;&nbsp;&nbsp;&nbsp;&nbsp; identifying the multicast addresses for which this STA
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs p;&nbsp;&nbsp;&nbsp; will receive frames.&nbsp; The default value of this attribute<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;& nbsp;&nbsp;&nbsp;&nbsp;&nbsp; shall be null.&quot;<br>&nbsp;&nbsp;&nbsp; ::= { dot11mac 3 }<br><br>dot11GroupAddressesEntry OBJECT-TYPE<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SYNTAX Dot11GroupAddressesEntry
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MAX-ACCESS not-accessible<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; STATUS current<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb sp; DESCRIPTION<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp ;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;An Entry (conceptual row) in the Group Addresses Table.<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ifIndex - Each IEEE 802.11 interface is represented by an
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs p;&nbsp;&nbsp;&nbsp; ifEntry.&nbsp; Interface tables in this MIB module are indexed<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb sp;&nbsp;&nbsp;&nbsp;&nbsp; by ifIndex.&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n bsp;&nbsp; INDEX { ifIndex, <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; dot11GroupAddressesIndex}<br>&nbsp;&nbsp;&nbsp; ::= { dot11GroupAddressesTable&nbsp; 1 }
<br><br>Dot11GroupAddressesEntry ::= <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SEQUENCE {&nbsp;&nbsp; &nbsp;dot11GroupAddressesIndex&nbsp;&nbsp;&nbsp ; Integer32,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;dot11Address&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs p;&nbsp; MacAddress,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp ;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;dot11GroupAddressesStatus&nbsp;&nbsp; RowStatus }
<br><br>dot11GroupAddressesIndex OBJECT-TYPE<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SYNTAX Integer32<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;& nbsp; MAX-ACCESS not-accessible<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; STATUS current<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb sp; DESCRIPTION<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp ;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;The auxiliary variable used to identify instances
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs p;&nbsp;&nbsp;&nbsp; of the columnar objects in the Group Addresses Table.&quot;<br>&nbsp;&nbsp;&nbsp; ::= { dot11GroupAddressesEntry 1 }<br><br>dot11Address OBJECT-TYPE<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SYNTAX MacAddress<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; MAX-ACCESS read-create<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs p; STATUS current
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; DESCRIPTION<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp ;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;MAC address identifying a multicast addresses<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;& nbsp;&nbsp;&nbsp;&nbsp;&nbsp; from which this STA will receive frames.&quot;<br>&nbsp;&nbsp;&nbsp; ::= { dot11GroupAddressesEntry 2 }<br><br>dot11GroupAddressesStatus OBJECT-TYPE
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SYNTAX RowStatus<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;& nbsp; MAX-ACCESS read-create<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs p; STATUS current<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb sp; DESCRIPTION<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp ;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;The status column used for creating, modifying, and<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;& nbsp;&nbsp;&nbsp;&nbsp; deleting instances of the columnar objects in the Group
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs p;&nbsp;&nbsp;&nbsp; Addresses Table.&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs p;&nbsp; DEFVAL { active }<br>&nbsp;&nbsp;&nbsp; ::= { dot11GroupAddressesEntry 3 }<br><br><br><br><br><br><br><br><br><br>-----------------------------------------------------------------------------------
<br><br><br>the problem is about&nbsp; dot11GroupAddressesIndex, I don't know how to implement <br>this object exactly. To implement it, i write the codes as belowing:<br><br><br><br><br>[Implementation]<br><br><br><br><br>
typedef struct<br>{<br>int index;<br>char wifi_Address[6];&nbsp;&nbsp;&nbsp; /* MacAddress */<br>char wifi_GroupAddressesStatus;&nbsp; /*RowStatus*/<br>}dot11GroupAddressesTable;<br><br><br><br><br> <br><br><br>netsnmp_variable_list *<br>dot11StationConfigTable_get_first_data_point( void **my_loop_context,
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; void **my_data_context,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbs p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; netsnmp_variable_list *
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; put_index_data,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;& nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp ;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;& nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; netsnmp_iterator_info *mydata)<br>{<br><br>&nbsp;&nbsp;&nbsp; netsnmp_variable_list *vptr;<br><br>&nbsp;&nbsp;&nbsp; LoopContext = 1;<br>

&nbsp; <br>&nbsp;&nbsp; dot11GroupAddressesTable[LoopContext].index = LoopContext;<br>&nbsp; *my_loop_context = &amp;LoopContext; <br>&nbsp; <br>&nbsp;&nbsp; vptr = put_index_data;<br>
<br>&nbsp;&nbsp;&nbsp; snmp_set_var_value(vptr, (u_char *)&amp;LoopContext, sizeof(LoopContext));<br>&nbsp;&nbsp;&nbsp; vptr = vptr-&gt;next_variable;<br><br><br>&nbsp;&nbsp;&nbsp ; return put_index_data;<br>}<br><br><br>----------------------------------------------------------------
<br><br>When I perform snmpwork, I got the following result:<br><br>IEEE802dot11-MIB::dot11GroupAddressesStatus.1.0 = INTEGER: active(1)<br>
IEEE802dot11-MIB::dot11GroupAddressesStatus.2.0 = INTEGER: active(1)<br>IEEE802dot11-MIB::dot11GroupAddressesStatus.3.0 = INTEGER: active(1)<br>
IEEE802dot11-MIB::dot11GroupAddressesStatus.4.0 = INTEGER: active(1)<br><br><br>but the exact result should be <br><br>IEEE802dot11-MIB::dot11GroupAddressesStatus.1&nbsp; = INTEGER: active(1)<br>

IEEE802dot11-MIB::dot11GroupAddressesStatus.2&nbsp; = INTEGER: active(1)<br>
IEEE802dot11-MIB::dot11GroupAddressesStatus.3&nbsp; = INTEGER: active(1)<br>

IEEE802dot11-MIB::dot11GroupAddressesStatus.4&nbsp; = INTEGER: active(1)<br><br><br>I don't realize how to solve this problem , can any one give me suggestion? thank you.<br><br>Best Regards,<br>Clement Hsu<br><br>

------=_Part_202862_6293869.1174641757607--


--===============1920737901==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

-------------------------------------------------------------------------
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?p...rge&CID=DEVDEV
--===============1920737901==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/...et-snmp-coders

--===============1920737901==--

Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 11:10 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0