some questions about appending a table

This is a discussion on some questions about appending a table within the SNMP Coders forums, part of the Networking and Network Related category; I have some questions with appending a table to the snmpd. --------------- /* from the comment in the source code */ /*quote one*/ ...


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

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 11-07-2005
Zax
 
Posts: n/a
Default some questions about appending a table

I have some questions with appending a table to the snmpd.

---------------
/*
from the comment in the source code
*/

/*quote one*/
get_first_data_point
return the first set of "index" data.

get_next_data_point
return the next loop context

/*
from
http://www.net-snmp.org/dev/agent/gr..._iterator.html
*/

/*quote two*/
the get_next_data_point hook is then called repeatedly
----------------

From the quote one, I don't know what "the first set of 'index' data"
mean? The first set of "index" data point to the index

colomn data in table ,isn't it?

From the quote two, I know get_next_data_point is called repeatedly.
When will it stop?

Is there some offical document for describeing the architecture of snmpd?




/*mib definition*/
=09SeqEntry ::=3D SEQUENCE {
=09testOne=09=09DisplayString,
=09=09testTwo=09=09INTEGER
=09}

/*my added code*/
/*table structure*/
struct node
{
=09char *string;
=09long num;
=09struct node * next;
};

-------get_first_data---------

struct node *head =3D producedata();=09
netsnmp_variable_list *vptr;

*my_loop_context =3Dhead /** XXX */;
*my_data_context =3Dhead/** XXX */;

vptr =3D put_index_data;
snmp_set_var_value(vptr, (u_char *)head->string/** XXX: testOne
data */,strlen(head->string) /** XXX: length of testOne

data */);
vptr =3D vptr->next_variable;
return put_index_data;

-------get_next_data---------

struct node *tmp =3D my_loop_context;
tmp =3D tmp->next;
if(!tmp)
=09return NULL;

netsnmp_variable_list *vptr;
*my_loop_context =3D tmp/** XXX */;
*my_data_context =3D tmp/** XXX */;
vptr =3D put_index_data;
snmp_set_var_value(vptr, (u_char *)tmp->string /** XXX: testOne
data */, strlen(tmp->string) /** XXX: length of testOne

data */);
vptr =3D vptr->next_variable;
return put_index_data;


-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/...et-snmp-coders
Reply With Quote
Reply


Thread Tools
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

vB 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 10:57 PM.


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