--===============2108113661==
Content-Type: multipart/alternative;
boundary="----=_Part_7877_29814430.1196700746970"

------=_Part_7877_29814430.1196700746970
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Hi all,

Please excuse me for my bad english, I hope you'll understand my problem.

I've set an Opaque type (float) in my MIB. In my subagent C file, I wrote :

static float myFloat;
...
int SnmpEagleSubagent::handleInstance(...)
{
switch (reqinfo->mode)
{
case MODE_GET:
snmp_set_var_typed_value(
requests->requestvb,
ASN_OPAQUE_FLOAT,
(u_char *) &(myFloat),
sizeof(myFloat));
break;
...
case MODE_SET_ACTION:
myFloat = atof(netsnmp_strdup_and_null(requests->requestvb->
val.string, requests->requestvb->val_len));
break;
...
}
}
....

Then I have a problem as I try to set a value with snmpset :

$ snmpset -v 1 -c private localhost myFloat.0 s 2.5
myFloat.0: Bad variable type (Type of attribute is Opaque, not OCTET STRING)

$ snmpset -v 1 -c private localhost myFloat.0 p 2.5
myFloat.0: Bad object type: p

In the snmpset man page, there isn't type value for Opaque....
Is it impossible to set an Opaque value with snmpset?
Is there other solution?

Thank you for your help,

Violette

------=_Part_7877_29814430.1196700746970
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Hi all,

Please excuse me for my bad english, I hope you'll understand my problem.

I've set an Opaque type (float) in my MIB. In my subagent C file, I wrote :

static float myFloat;
 ...
int SnmpEagleSubagent::handleInstance(...)

{
    switch (reqinfo->mode)
    {
        case MODE_GET:
                 snmp_set_var_typed_value(
                           requests->requestvb,
                           ASN_OPAQUE_FLOAT,

                           (u_char *) &(myFloat),
                           sizeof(myFloat));
        break;
        ...
        case MODE_SET_ACTION:
              myFloat = atof(netsnmp_strdup_and_null(requests->requestvb->
val.string, requests->requestvb->val_len));
        break;
        ...
     }
}
...

Then I have a problem as I try to set a value with snmpset :

$ snmpset -v 1 -c private localhost myFloat.0
s 2.5
myFloat.0: Bad variable type (Type of attribute is Opaque, not OCTET STRING)

$ snmpset -v 1 -c private localhost myFloat.0 p 2.5

myFloat.0: Bad object type: p

In the snmpset man page, there isn't type value for Opaque....
Is it impossible to set an Opaque value with snmpset?
Is there other solution?

Thank you for your help,


Violette


------=_Part_7877_29814430.1196700746970--


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

-------------------------------------------------------------------------
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell. From the desktop to the data center, Linux is going
mainstream. Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
--===============2108113661==
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

--===============2108113661==--