I have a AgentX sub-agent working with net-snmp master agent. I want to convert an unsigned int value to the snmp type and print it using the snmpget command. I have used the following function:
snmp_set_var_typed_value(var,
ASN_UNSIGNED,
(u_char *)&runnableEntry_tbl[major-1].runnableObjectCounters.counters[counter_index-1].value,
sizeof(unsigned int));
(where runnableEntry_tbl[major-1].runnableObjectCounters.counters[counter_index-1].value
is an unsigned value).
The problem is the value is getting transmitted as a Gauge32 (as per wireshark), also the display of the value with snmpget is something like:
runnableObjectCounters.1.1 = Gauge32: 4294967294
Can the Gauge32 be removed somehow? Or is there some other type for Unsigned32 as per ASN, please help me.
I am working on Linux.