Re: which variable type to use when extending a unsigned32 or gauge32
Leo Lin <[email protected]>
| Newsgroups | gmane.network.net-snmp.user |
|---|---|
| Message-ID | <[email protected]> |
I found the problem, you are right, I forgot to set my var_typed_value to ASN_UNSIGNED, like so, snmp_set_var_typed_value(requests->requestvb, ASN_UNSIGNED, (unsigned int *) &my_oid, sizeof(my_oid)); Thanks!!! Leo; --- On Tue, 5/10/11, Dave Shield <[email protected]> wrote: From: Dave Shield <[email protected]> Subject: Re: which variable type to use when extending a unsigned32 or gauge32 To: "Leo Lin" <[email protected]> Cc: [email protected] Date: Tuesday, May 10, 2011, 12:55 AM On 10 May 2011 03:08, Leo Lin <[email protected]> wrote: > I have a scalar OID of unsigned32. On my mib module, I declare a variable that hold an unsigned int, like so, > > unsigned int my_oid; Such variables are typically declared as 'long' rather than 'int'. But I doubt that's the cause of the problems you are seeing. > when I issue an snmpget, I get the following error > > "Wrong type (should be Gauge32 or Unsigned32) INTEGER:30" > > How can I declare a Unsigned32 or Gauge32 variable in my C module? That feels as if the varbind that is being returned has been given the wrong type tag. What does the code that implements this MIB object look like? Dave ------------------------------------------------------------------------------ Achieve unprecedented app performance and reliability What every C/C++ and Fortran developer should know. Learn how Intel has extended the reach of its next-generation tools to help boost performance applications - inlcuding clusters. http://p.sf.net/sfu/intel-dev2devmay _______________________________________________ Net-snmp-users mailing list [email protected] Please see the following page to unsubscribe or change other options: https://lists.sourceforge.net/lists/listinfo/net-snmp-users