Hi,
Here is some simple changes to the source code that will add support of
context to NetSNMP::agent perl module.
This is simply the result of diff commands:

-------------------------------------------------------------------------------
$ diff NetSNMP-agent-5.0404/agent.pm NetSNMP-agent-with-context-support/
agent.pm
-------------------------------------------------------------------------------

181,183c181,184
< sub register($$$$) {
<     my ($self, $name, $oid, $sub) = @_;
<     my $reg = NetSNMP::agent::netsnmp_handler_registration::new($name,
$oid, $sub);
---
> sub register() {
>     my ($self, $name, $oid, $sub, $context) = @_;
>     $context = "" if not defined $context; # maybe it's better to
retrieve the default context from Default Store, or use undef instead?!?
>     my $reg = NetSNMP::agent::netsnmp_handler_registration::new($name,
$oid, $sub, $context);


----------------------------------------------------------------------
diff NetSNMP-agent-5.0404/agent.xs
NetSNMP-agent--with-context-support/agent.xs
----------------------------------------------------------------------
500c500
< nsahr_new(name, regoid, perlcallback)
---
> nsahr_new(name, regoid, perlcallback, context)
503a504
>     char *context;
523a525
>             RETVAL->contextName = strdup(context);

------------------------------------------------------------------------
PS: let me khow if I should do something else rather than suggesting
updates in this mailing list

Thanks,
Hamid Alaei V.
------------------------------------------------------------------------------
HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions
Find What Matters Most in Your Big Data with HPCC Systems
Open Source. Fast. Scalable. Simple. Ideal for Dirty Data.
Leverages Graph Analysis for Fast Processing & Easy Data Exploration
http://p.sf.net/sfu/hpccsystems
_______________________________________________
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to