Thank you for answering Magnus,

Sorry for disturbing you, but I've searched net-snmp-5.4.2.1 (the most
current/supported release) sources for WATCHER_SIZE_STRLEN flag and haven't
found one, the only flags defined at ./include/net-snmp/agent/watcher.h are:

#define WATCHER_FIXED_SIZE    0x01
#define WATCHER_MAX_SIZE      0x02

Although the flag difinition (#define WATCHER_SIZE_STRLEN   0x08) could be
found in current SVN repository trunk and the comment says 'since Net-SNMP
5.5'.

Is there any roadmap/info on when the Net-SNMP 5.5 release will be generally
available?

Should I use SVN repository trunk or some branch instead?

Best regards,
Eugene

On Sun, Dec 14, 2008 at 10:28 PM, Magnus Fromreide <[email protected]>wrote:

> On Sun, 2008-12-14 at 16:13 +0200, Eugene Yasman wrote:
> > Hello net-snmp coders,
> >
> > I would like to propose null terminated string "magic tie" helper
> > function implementation: netsnmp_register_str_instance().
> >
> > The C source code for null terminated strings can be then
> > automagically generated from MIB by mib2c.tie.conf, see attachments.
> >
> > netsnmp_register_str_instance() behaves like
> > netsnmp_register_int_instance() function, but should receive pointer
> > to netsnmp_ntstr_t structure instead of int pointer, no API functions
> > were modified.
> >
> >
> //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
>
> >
> //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
> >
> > I have been looking for "magic tie" helper for null terminated strings
> > in net-snmp API but haven't found one. Am I missing some point? Do you
> > think it could be helpful for someone else?
>
> I am not all that certain about what a magically tied string is but if
> you just wish to be able to use nul-terminated strings then I would
> recommend that you take a look on the watcher handler which, among other
> things, already handles nul-terminated strings.
>
> Like this:
>
> netsnmp_watcher_info winfo;
> winfo.data = YourBuffer;
> winfo.max_size = sizeof(YourBuffer) - 1;
> winfo.type = ASN_OCTET_STR;
> winfo.flags = WATCHER_MAX_SIZE | WATCHER_SIZE_STRLEN;
> netsnmp_register_watched_instance(YourRegInfo, &winfo);
>
> With this said I think that a generalized mib2c.tie.conf would be a good
> thing, but it is questionable if we need a new helper.
>
> /MF
>
> > Best regards,
> > Eugene
> >
> >
> ------------------------------------------------------------------------------
> > SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas,
> Nevada.
> > The future of the web can't happen without you.  Join us at MIX09 to help
> > pave the way to the Next Web now. Learn more and register at
> >
> http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
> > _______________________________________________ Net-snmp-coders mailing
> list [email protected]
> https://lists.sourceforge.net/lists/listinfo/net-snmp-coders
>
>
------------------------------------------------------------------------------
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you.  Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to