--===============2131508598==
Content-Type: multipart/alternative;
boundary="=_c5942e665625ac715cd8fddd97629b0e"

--=_c5942e665625ac715cd8fddd97629b0e
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 7bit

Thanks a lot Dave,I changed the code accordingly and it worked for me. But what I doubt is if we send a get request with multiple attributes in a single request how it will be handled by the Master. How it will forward it to the subagent. I can see in the subagent side that different requests are coming from master and if I see the same in master side using wireshark I could see that the a single request has been sent to subagent with multiple var binds??? How actually this handled at master side???On Tue, 22 Jan 2008 15:34:26 +0000 "Dave Shield" wrote On 22 Jan 2008 15:03:29 -0000, girish wrote: > > >What does the code *around* this fragment look like? > >In particular, how is the variable 'requestvb' assigned? > Here is the code which handles response: > Response_handle(unsigned char *Buffer,int size, netsnmp_request_info *requests) > { > ptr = (unsigned char *)pbuf; > netsnmp_variable_list *Vbsvd = NULL; >
for (Vbsvd = requests->requestvb; Vbsvd; Vbsvd = Vbsvd->next_variable ) No - you don't step through the 'requestvb' list. You step through the 'requests' list. Try netsnmp_request_info *r; for ( r=requests; r; r=r->next ) { requestvb = r->requestvb; > case TYPE_STRING: > snmp_set_var_typed_value(requestvb,ASN_OCTET_STR,( u_char *) ptr, str_len); > break; You've never actually given 'requestvb' a value. Your loop uses the variable 'Vbsvb' (although this is wrong anyway). 'requestvb' will probably have some random junk in it, so might easily blow up when you try to access it. > and requestvb at the time of debugging looks like this(for the 1st attribute): I didn't ask what it looked like. I asked how you *assigned* its value. The answer appears to be that you don't. Please try with the code fragments shown abo
ve. It might also be worth starting with a fresh mib2c template output, which should have a cleaner codebase. You seem to have mangled this fairly effectively! Dave ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ 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


Regards,
Girish
--=_c5942e665625ac715cd8fddd97629b0e
Content-Type: text/html; charset="ISO-8859-1"
Content-Transfer-Encoding: quoted-printable

Thanks a lot Dave,
I changed the code accordingly and it worked for me=
..
But what I doubt is if we send a get request with multiple attribut=
es in a single request how it will be handled by the Master. How it will fo=
rward it to the subagent. I can see in the subagent side that different req=
uests are coming from master and if I see the same in master side using wir=
eshark I could see that the a single request has been sent to subagent with=
multiple var binds??? How actually this handled at master side???
/>

On Tue, 22 Jan 2008 15:34:26 +0000 "Dave Shield" wrote

> On 22 Jan 2008 15:03:29 -0000, girish wrote:
>
> &g=
t;What does the code *around* this fragment look like?
> >In=
particular, how is the variable 'requestvb' assigned?

> =
Here is the code which handles response:
> Response_handle(unsign=
ed char *Buffer,int size, netsnmp_request_info *requests)
> {
/> > ptr =3D (unsigned char *)pbuf;
> netsnmp=
_variable_list *Vbsvd =3D NULL;
> for (Vbsvd =3D requests=
->requestvb; Vbsvd; Vbsvd =3D Vbsvd->next_variable )

N=
o - you don't step through the 'requestvb' list.
You step through th=
e 'requests' list.

Try
netsnmp_request_inf=
o *r;

for ( r=3Drequests; r; r=3Dr->next ) =
{
requestvb =3D r->requestvb;


/> > case TYPE_STRING:
> sn=
mp_set_var_typed_value(requestvb,ASN_OCTET_STR,(u_ char *) ptr, str_len); /> > break;

You've never actually g=
iven 'requestvb' a value.
Your loop uses the variable 'Vbsvb' (altho=
ugh this is wrong anyway).
'requestvb' will probably have some rando=
m junk in it, so might easily
blow up when you try to access it.
/>


> and requestvb at the time of debugging loo=
ks like this(for the 1st attribute):

I didn't ask what it lo=
oked like.
I asked how you *assigned* its value.
The answer a=
ppears to be that you don't.




Please =
try with the code fragments shown above.
It might also be worth star=
ting with a fresh mib2c template output,
which should have a cleaner=
codebase. You seem to have mangled
this fairly effectively!
=

Dave

----------------------------------------------=
---------------------------
This SF.net email is sponsored by: Micro=
soft
Defy all challenges. Microsoft(R) Visual Studio 2008.
ht=
tp://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
______________=
_________________________________
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.ne=
t/lists/listinfo/net-snmp-users

=20


Regards,

Girish
ding=3D0 style=3D'font-family:Verdana;font-size:11px;line-height:15px;'>
>

iff.com/signature-home.htm/1050715198@Middle5/2031830_2024620/2031710/1?PAR=
TNER=3D3&OAS_QUERY=3Dnull' target=3Dnew > ff.com/cgi-bin/AdWorks/adimage.cgi/2031830_2024620/creative_2031710.gif' a=
lt=3D'Jeevan Sathi' border=3D0>

--=_c5942e665625ac715cd8fddd97629b0e--


--===============2131508598==
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: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
--===============2131508598==
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

--===============2131508598==--