This is a multi-part message in MIME format.

--===============1839712737==
Content-class: urn:content-classes:message
Content-Type: multipart/alternative;
boundary="----_=_NextPart_001_01C78D6A.4BE3A5F2"

This is a multi-part message in MIME format.

------_=_NextPart_001_01C78D6A.4BE3A5F2
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Dear Friends

Greetings to all,

I have an issue with SNMP GET Request.

I have used net-snmp 5.1.2 and created the snmp subAgent, the values =
supplied to the agent externally.
I have used mib2c iterator config to generate net-snmp style of code for =
my alarm related history. I have modifed the skeleton code such a way =
that it will contain 20 no of rows and using position count as loop =
context.

When i make the SNMP Get request on first columnar object for say =
ALARMID thro adventnet MIbBrowser, it retrived
the 20 intances of that alarmID
alarmID.1:-->1234
alarmID.2:-->1234
alarmID.3:-->1234
..
..
..
alarmID.18:-->1234
alarmID.19:-->1234
alarmID.20:-->1234
But, from the agent side,it will make the SNMP Get Request on next =
columnar object for say alarmType.
If i use the same for last columnar object in the table,it will return =
20 intances of that object and handler called another mibtable for =
example to say table2,same sceneraio, happen for GET-BULK request.

for your reference i have to provide the index code,first-get and =
get-next hooks.


alarmHisTableEntry *getAlarmIndex()
{

uint32_t Index =3D0;

memset(AlarmHisEntry,0,((sizeof(alarmHisTableEntry )) * 20));

for(uint32_t iterate =3D0; iterate < 20 ;iterate++)
{
Index =3D iterate +1;
AlarmHisEntry[iterate].alarmSerNo =3D Index;
}

return AlarmHisEntry;

}





/* Example iterator hook routines - using 'get_next' to do most of the =
work */

netsnmp_variable_list *
alarmHisTable_get_first_data_point(void **my_loop_context,
void **my_data_context,
netsnmp_variable_list *put_index_data,
netsnmp_iterator_info *mydata)
{
/**my_loop_context =3D alarmHisTable_head;
return alarmHisTable_get_next_data_point(my_loop_context, =
my_data_context,
put_index_data, mydata );*/

netsnmp_variable_list *vptr;
alarmHisTableEntry *myEntry;
=09
/* We use the positinonal count as our loop context */
int *position =3D (int*)malloc(sizeof(int));
*position =3D 0;


*my_loop_context =3D position /** XXX */ ;

myEntry =3D getAlarmIndex();

*my_data_context =3D (void *)&myEntry[*position] /** XXX */ ;
vptr =3D put_index_data;

snmp_set_var_value(vptr, (u_char *)&myEntry[*position].alarmSerNo,
sizeof(&myEntry[*position].alarmSerNo));
=09
vptr =3D vptr->next_variable;

return put_index_data;


=09
}

netsnmp_variable_list *
alarmHisTable_get_next_data_point(void **my_loop_context,
void **my_data_context,
netsnmp_variable_list *put_index_data,
netsnmp_iterator_info *mydata)
{
netsnmp_variable_list *vptr;
alarmHisTableEntry *myEntry;

int *position =3D (int *) *my_loop_context;

/* make sure we were called correctly */
if (!position)
return NULL;

/* go to the next route in the list */
(*position)++;
=20
printf("Value of position =3D %d\n",*position);
=20
/* change for no of rows.....*/
/* Are we beyond the end? */
if (*position >=3D 20 ) =20
{
/* End of routes. stop here by returning NULL */
SNMP_FREE(position);
*my_loop_context =3D NULL;
*my_data_context =3D NULL;
return NULL;
}

*my_loop_context =3D position /** XXX */ ;

myEntry =3D getAlarmIndex();

*my_data_context =3D (void *)&myEntry[*position] /** XXX */ ;

vptr =3D put_index_data;

snmp_set_var_value(vptr, (u_char *)&myEntry[*position].alarmSerNo,
sizeof(&myEntry[*position].alarmSerNo));
=20
vptr =3D vptr->next_variable;

return put_index_data;
=20
}

Pls any of you help me to resolve this issue.


With thanks and Regards,
D.SenthilNathan




------_=_NextPart_001_01C78D6A.4BE3A5F2
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable




charset=3Diso-8859-1">
6.5.7651.59">
SNMP GET issue...




Dear Friends



Greetings to all,



I have an issue with SNMP GET Request.



I have used net-snmp 5.1.2 and created the snmp subAgent, the values =
supplied to the agent externally.

I have used mib2c iterator config to generate net-snmp style of code for =
my alarm related history. I have modifed the skeleton code such a way =
that it will contain 20 no of rows and using position count as loop =
context.



When i make the SNMP Get request on first columnar object for say =
ALARMID  thro adventnet MIbBrowser, it retrived

the 20 intances of that alarmID

alarmID.1:-->1234

alarmID.2:-->1234

alarmID.3:-->1234

..

..

..

alarmID.18:-->1234

alarmID.19:-->1234

alarmID.20:-->1234

But, from the agent side,it will make the SNMP Get Request on next =
columnar object for say alarmType.

If i use the same for last columnar object in the table,it will return =
20 intances of that object and handler called another mibtable for =
example to say  table2,same sceneraio, happen for GET-BULK =
request.



for your reference i have to provide the index code,first-get and =
get-next hooks.





alarmHisTableEntry *getAlarmIndex()

{



        uint32_t Index =3D0;



        =
memset(AlarmHisEntry,0,((sizeof(alarmHisTableEntry )) * 20));



        for(uint32_t iterate =3D0; =
iterate < 20 ;iterate++)

        {

        =
        Index =3D iterate +1;

        =
        =
AlarmHisEntry[iterate].alarmSerNo =3D Index;

        }



        return AlarmHisEntry;



}











/* Example iterator hook routines - using 'get_next' to do most of the =
work */



netsnmp_variable_list *

alarmHisTable_get_first_data_point(void **my_loop_context,

            &=
nbsp;           &n=
bsp; void **my_data_context,

            &=
nbsp;           &n=
bsp; netsnmp_variable_list *put_index_data,

            &=
nbsp;           &n=
bsp; netsnmp_iterator_info *mydata)

{

    /**my_loop_context =3D alarmHisTable_head;

    return =
alarmHisTable_get_next_data_point(my_loop_context, my_data_context,

            &=
nbsp;           &n=
bsp;           =
put_index_data,  mydata );*/



        netsnmp_variable_list =
*vptr;

    alarmHisTableEntry *myEntry;

       

    /* We use the positinonal count as our loop context =
*/

    int *position =3D (int*)malloc(sizeof(int));

    *position =3D 0;





    *my_loop_context =3D position /** XXX */ ;



    myEntry =3D getAlarmIndex();



    *my_data_context =3D (void *)&myEntry[*position] =
/** XXX */ ;

    vptr =3D put_index_data;



    snmp_set_var_value(vptr, (u_char =
*)&myEntry[*position].alarmSerNo,

            &=
nbsp;         =
sizeof(&myEntry[*position].alarmSerNo));

       

    vptr =3D vptr->next_variable;



    return put_index_data;





       

}



netsnmp_variable_list *

alarmHisTable_get_next_data_point(void **my_loop_context,

            &=
nbsp;           &n=
bsp; void **my_data_context,

            &=
nbsp;           &n=
bsp; netsnmp_variable_list *put_index_data,

            &=
nbsp;           &n=
bsp; netsnmp_iterator_info *mydata)

{

         netsnmp_variable_list =
*vptr;

   alarmHisTableEntry *myEntry;



    int *position =3D (int *) *my_loop_context;



    /* make sure we were called correctly */

    if (!position)

        return NULL;



    /* go to the next route in the list */

    (*position)++;

   

        printf("Value of =
position =3D %d\n",*position);

  

        /* change for no of =
rows.....*/

    /* Are we beyond the end? */

    if (*position >=3D 20 ) 

   {

        /* End of routes.  stop =
here by returning NULL */

        SNMP_FREE(position);

        *my_loop_context =3D =
NULL;

        *my_data_context =3D =
NULL;

         return NULL;

    }



    *my_loop_context =3D position /** XXX */ ;



      myEntry =3D getAlarmIndex();



    *my_data_context =3D (void *)&myEntry[*position] =
/** XXX */ ;



      vptr =3D put_index_data;



      snmp_set_var_value(vptr, (u_char =
*)&myEntry[*position].alarmSerNo,

            &=
nbsp;         =
sizeof(&myEntry[*position].alarmSerNo));

         

    vptr =3D vptr->next_variable;



    return put_index_data;

   

}



Pls any of you help me to resolve this issue.





With thanks and Regards,

D.SenthilNathan












------_=_NextPart_001_01C78D6A.4BE3A5F2--


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

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
--===============1839712737==
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

--===============1839712737==--