I'm using net-snmp-5.4

I'm building a subagent using mib2c.table_data.conf.  This created
mraOneTable.c and mraOneTable.h.  I then filled in the "NNN"'s.

I created mraOneTable_subagent.c using the mib2c.mfd.conf

When I tried compiling it, I got the warning 
mraOneTable_subagent.c:134: warning: implicit declaration of function 
'netsnmp_enable_subagent'

netsnmp_enable_subagent is defined in <net-snmp/agent/snmp_vars.h> and
depends on the define of USING_AGENTX_SUBAGENT_MODULE, which is
defined in <net-snmp/agent/agent_module_config.h>

Both <net-snmp/agent/snmp_vars.h> and <net-snmp/agent/agent_module_config.h>
are included together by <net-snmp/agent/net-snmp-agent-includes.h>.  However,
agent_module_config.h is included *after* snmp_vars.h, and so
USING_AGENTX_SUBAGENT_MODULE isnt yet defined, and so
netsnmp_enable_subagent doesnt get declared.

Is this a bug?

My workaround right now is to add
  #include <net-snmp/agent/mib_module_config.h>
  #include <net-snmp/agent/agent_module_config.h>
right before the
  #include <net-snmp/agent/net-snmp-agent-includes.h>
in the generated mraOneTable_subagent.c


-- 
Mark Atwood                 When you do things right, people won't be sure
[EMAIL PROTECTED]         you've done anything at all.
http://mark.atwood.name/   http://fallenpegasus.livejournal.com/

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to