table can't be get and set, var_***Table functin is not invoked anyway

This is a discussion on table can't be get and set, var_***Table functin is not invoked anyway within the SNMP Users forums, part of the Networking and Network Related category; --===============0868981567== Content-Type: multipart/Alternative; boundary="----=_Part_80698_4324422.1188454561445" ------=_Part_80698_4324422.1188454561445 Content-Type: text/plain; charset=gbk Content-Transfer-...


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

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 08-30-2007
ye_cl
 
Posts: n/a
Default table can't be get and set, var_***Table functin is not invoked anyway

--===============0868981567==
Content-Type: multipart/Alternative;
boundary="----=_Part_80698_4324422.1188454561445"

------=_Part_80698_4324422.1188454561445
Content-Type: text/plain; charset=gbk
Content-Transfer-Encoding: 7bit

Hi,
I have a question to ask you.
In my mib2c-produced skeleton source files which are style of ucd-snmp, I can't get or set the node of Simple table. It always responds "1: node39param1.1 (nosuchobject) no such object". I find the table's get function "var_node39Table" is not invoked anyway. When I run "snmptable -v2c -c public 200.162.162.190 .1.3.6.1.4.1.19176.1.1.20.9.1.1.2.1", the agent always responds "Was that a table? SNMPv2-SMI::enterprises.19176.1.1.20.9.1.1.2.1". How can I resolve it?
My source code as follows: static long table_1 = 123;static long table_2 = 223;
static long table_3 = 323;
struct variable13 scomcenter_variables[] = {
......
#define NODE39INDEX 11
{NODE39INDEX, ASN_INTEGER, RWRITE, var_node39Table, 7, {1, 1, 20, 9, 1, 1, 1}},
#define NODE39PARAM1 12
{NODE39PARAM1, ASN_INTEGER, RWRITE, var_node39Table, 7, {1, 1, 20, 9, 1, 1, 2}},
#define NODE39PARAM2 13
{NODE39PARAM2, ASN_INTEGER, RWRITE, var_node39Table, 7, {1, 1, 20, 9, 1, 1, 3}},
};
unsigned char *
var_node39Table(struct variable *vp,
oid * name,
size_t *length,
int exact, size_t *var_len, WriteMethod ** write_method)
{
static long long_ret;
static u_long ulong_ret;
static unsigned char string[SPRINT_MAX_LEN];
static oid objid[MAX_OID_LEN];
static struct counter64 c64; printf("var_node39Table\n");
if (header_simple_table
(vp, name, length, exact, var_len, write_method, TABLE_SIZE)
== MATCH_FAILED){
printf("header_simple_table failed\n");
return NULL;
}
printf("header_simple_table ok\n");

switch (vp->magic) {
case NODE39INDEX:
*write_method = write_node39index;
return (u_char *) &table_1;
case NODE39PARAM1:
*write_method = write_node39param1;
return (u_char *)table_2;
case NODE39PARAM2:
*write_method = write_node39param2;
return (u_char *) &table_3;
default:
ERROR_MSG("");
}
return NULL;
}

------=_Part_80698_4324422.1188454561445
Content-Type: text/html; charset=gbk
Content-Transfer-Encoding: quoted-printable

<DIV>Hi,</DIV>
<DIV><BR>I have a question to ask you.<BR>In my mib2c-produced skeleton sou=
rce files which are style of ucd-snmp, I can't get or set the node of Simpl=
e table. It always responds "1: node39param1.1 (nosuchobject) no such objec=
t". I find the table's get function "var_node39Table" is not invoked anyway=
</DIV>
<DIV>&nbsp;</DIV>
<DIV>When I run "snmptable -v2c -c public 200.162.162.190 .1.3.6.1.4.1.1917=
6.1.1.20.9.1.1.2.1", the agent always responds "Was that a table? SNMPv2-SM=
I::enterprises.19176.1.1.20.9.1.1.2.1".</DIV>
<DIV>&nbsp;</DIV>
<DIV>How can I resolve it?</DIV>
<DIV><BR>My source code as follows:</DIV>
<DIV>&nbsp;</DIV>
<DIV>static long table_1 =3D 123;</DIV>
<DIV>static long table_2 =3D 223;<BR>static long table_3 =3D 323;<BR>struct=
variable13 scomcenter_variables[] =3D {<BR>......<BR>#define NODE39INDEX&n=
bsp;&nbsp;11<BR>&nbsp;&nbsp;&nbsp; {NODE39INDEX, ASN_INTEGER, RWRITE, var_n=
ode39Table, 7,&nbsp;&nbsp; {1, 1, 20, 9, 1, 1, 1}},<BR>#define NODE39PARAM1=
&nbsp;&nbsp;12<BR>&nbsp;&nbsp;&nbsp; {NODE39PARAM1, ASN_INTEGER, RWRITE, va=
r_node39Table, 7,&nbsp; {1, 1, 20, 9, 1, 1, 2}},<BR>#define NODE39PARAM2&nb=
sp;&nbsp;13<BR>&nbsp;&nbsp;&nbsp; {NODE39PARAM2, ASN_INTEGER, RWRITE, var_n=
ode39Table, 7,&nbsp; {1, 1, 20, 9, 1, 1, 3}},<BR>};<BR></DIV>
<DIV>unsigned char&nbsp; *<BR>var_node39Table(struct variable *vp,<BR>&nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;& nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp; oid * name,<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp ;&nbsp;&=
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; size_t *length,<BR>&nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs p;&nbsp;&nbsp;&nbsp;&nbsp=
; int exact, size_t *var_len, WriteMethod ** write_method)<BR>{<BR>&nbsp;&n=
bsp;&nbsp; static long&nbsp;&nbsp;&nbsp;&nbsp; long_ret;<BR>&nbsp;&nbsp;&nb=
sp; static u_long&nbsp;&nbsp; ulong_ret;<BR>&nbsp;&nbsp;&nbsp; static unsig=
ned char string[SPRINT_MAX_LEN];<BR>&nbsp;&nbsp;&nbsp; static oid&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp; objid[MAX_OID_LEN];<BR>&nbsp;&nbsp;&nbsp; static struc=
t counter64 c64;</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;&nbsp; printf("var_node39Table\n");</DIV>
<DIV><BR>&nbsp;&nbsp;&nbsp; if (header_simple_table<BR>&nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp;&nbsp; (vp, name, length, exact, var_len, write_method, TAB=
LE_SIZE)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n bsp; =3D=3D MATCH_FAILED)=
{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; printf("header_simple_table=
failed\n");<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp ;&nbsp; return NULL;<BR>=
&nbsp;&nbsp;&nbsp;&nbsp; }<BR>&nbsp;&nbsp; printf("header_simple_table ok\n=
");<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nb sp;&nbsp; switch (vp-&gt;=
magic) {<BR>&nbsp;&nbsp;&nbsp; case NODE39INDEX:<BR>&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp; *write_method =3D write_node39index;<BR>&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp; return (u_char *) &amp;table_1;<BR>&nbsp;&nbsp;=
&nbsp; case NODE39PARAM1:<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb sp;&nbsp; *wr=
ite_method =3D write_node39param1;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nb sp;&nbsp;&=
nbsp; return (u_char *)table_2;<BR>&nbsp;&nbsp;&nbsp; case NODE39PARAM2:<BR=
>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; *write_method =3D write_node39p=

aram2;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs p; return (u_char *) &amp=
;table_3;<BR>&nbsp;&nbsp;&nbsp; default:<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp; ERROR_MSG("");<BR>&nbsp;&nbsp;&nbsp; }<BR>&nbsp;&nbsp;&nbsp; re=
turn NULL;<BR>}<BR></DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV><br><!-- footer --><br><hr>
<a style=3D"font-size:14px;line-height:15px; color:#000; text-decoration:no=
ne" href=3D"http://event.mail.163.com/chanel/click.htm?from=3DNO_17&domain=
=3D163" target=3D"_blank"><span style=3D"text-decoration:underline; color:b=
lue">2007 =C4=EA =D7=EE =CA=DC =C6=DA =B4=FD =B4=F3 =D0=CD =CD=F8 =D3=CE =
=A1=B6=B4=F3 =BB=B0 =CE=F7 =D3=CE 3=A1=B7=D5=F0 =BA=B3 =B9=AB =B2=E2=A3=A1 =
=B5=E3 =B4=CB =C7=C0 =CF=C8 =C3=E2 =B7=D1 =CC=E5 =D1=E9 >></span> </a>
------=_Part_80698_4324422.1188454561445--



--===============0868981567==
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: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
--===============0868981567==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Net-snmp-users mailing list
Net-snmp-users@lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/...net-snmp-users

--===============0868981567==--


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 12:46 AM.


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