Difference between ASN_OPAQUE and ASN_OCTET_STR? (except for the display)
Dirk Süsserott <[email protected]>
| Newsgroups | gmane.network.net-snmp.user |
|---|---|
| Message-ID | <[email protected]> |
Hello all,
I've a question concerning the type ASN_OPAQUE. In my SNMP "server" I
want to offer a "counter" which actually holds some binary data with
reasonable size (up to 100 bytes or so).
I don't (and don't want to) use any MIB module files, but just register
a callback for my counter.
When my callback gets called (when 'snmpwalk/get' is issued), I call
(beyond others):
snmp_set_var_typed_value( [variable_binding], ASN_OPAQUE, data, len );
data is a void* to my data, len is its length.
When the datatype is ASN_OCTET_STR this works very good. There's no need
to free any additional data, no memory leaks occur. I just have to
handle my own data. (Sometimes it's not clear which
snmp_free()-functions have to be called in addition. That's not the case
for ASN_OCTET_STR.)
The question is: Does this also apply to the type ASN_OPAQUE, i.e. can I
safely interchange the types ASN_OCTET_STR and ASN_OPAQUE?
Do they have the very same behaviour regarding memory handling and
differ only in the type? That would be great for my purpose.
Thanks in advance,
-- Dirk
-------------------------------------------------------------------------
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services
for just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
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