On Tue, 28 Dec 2004, Robert Story wrote:
On Tue, 28 Dec 2004 16:43:23 -0500 (EST) Igor wrote: IB> Can you make libraries self-contained (net-snmp-config sort of IB> compensates for that)? There seem to be a cyclical dependency between IB> agent and mib libraries, so hopefully your effort will fix this issue.
That's exactly what I'm trying to do.. if you've had problems and could verify that this patch (against 5.2.1.pre1) solves the problem, that would be very helpful.
I get a compile error on Solaris 9. I think some code is missing for solaris so I just made it compile so that I can test the build:
mibII/interfaces.c: In function `var_ifEntry': mibII/interfaces.c:1256: `Name' undeclared (first use in this function) mibII/interfaces.c:1256: (Each undeclared identifier is reported only once mibII/interfaces.c:1256: for each function it appears in.)
There is a bug in 5.2 and 5.2.1 with tcp wrappers. Here is a quick and dirty fix:
--- snmp_agent.c 2004-10-13 00:10:05.000000000 -0400
+++ /var/src/net-snmp-5.2/agent/snmp_agent.c 2004-12-15 14:27:44.647944000 -0500
@@ -825,13 +825,16 @@
return 0;
}
} else {
- if (hosts_ctl("snmpd", STRING_UNKNOWN, STRING_UNKNOWN, STRING_UNKNOWN)){
- snmp_log(allow_severity, "Connection from <UNKNOWN>\n");
- addr_string = strdup("<UNKNOWN>");
- } else {
- snmp_log(deny_severity, "Connection from <UNKNOWN> REFUSED\n");
- return 0;
- }
+ if ( strncmp(addr_string, "Local", 5) != 0 &&
+ strncmp(addr_string, "callback", 8) != 0 ) {
+ if (hosts_ctl("snmpd", STRING_UNKNOWN, STRING_UNKNOWN, STRING_UNKNOWN)){
+ snmp_log(allow_severity, "Connection from <UNKNOWN>\n");
+ addr_string = strdup("<UNKNOWN>");
+ } else {
+ snmp_log(deny_severity, "Connection from <UNKNOWN> REFUSED %s\n", addr_string);
+ return 0;
+ }
+ }
}
#endif /*USE_LIBWRAP */
There is a cyclical dependency between libnetsnmphelpers and libnetsnmp(agent|mibs).
Undefined symbols in libnetsnmphelpers:
netsnmp_register_handler_by_name baby_steps.lo netsnmp_check_requests_error baby_steps.lo netsnmp_find_handler_data_by_name table.lo netsnmp_register_handler_nocallback old_api.lo netsnmp_marker_uptime watcher.lo netsnmp_free_request_data_sets table_iterator.lo netsnmp_call_next_handler baby_steps.lo netsnmp_create_handler_registration instance.lo netsnmp_request_add_list_data instance.lo netsnmp_register_handler cache_handler.lo netsnmp_free_agent_data_sets table.lo netsnmp_set_request_error instance.lo netsnmp_handler_free baby_steps.lo netsnmp_inject_handler cache_handler.lo netsnmp_handler_registration_free old_api.lo netsnmp_create_handler baby_steps.lo netsnmp_call_handler multiplexer.lo netsnmp_request_get_list_data instance.lo netsnmp_agent_get_list_data cache_handler.lo netsnmp_agent_add_list_data cache_handler.lo netsnmp_set_all_requests_error cache_handler.lo
Undefined symbols in libnetsnmpmibs:
callback_master_num mibgroup/disman/mteTriggerTable.lo unregister_mib_context mibgroup/ucd-snmp/proxy.lo netsnmp_handler_check_cache mibgroup/ucd-snmp/proxy.lo update_config mibgroup/ucd-snmp/versioninfo.lo snmp_enableauthentraps mibgroup/mibII/snmp_mib.lo register_mib_priority mibgroup/mibII/sysORTable.lo netsnmp_create_delegated_cache mibgroup/ucd-snmp/proxy.lo snmpd_store_config mibgroup/mibII/system_mib.lo return_buf mibgroup/mibII/interfaces.lo register_mib_context mibgroup/snmpv3/usmUser.lo netsnmp_create_handler_registration mibgroup/mibII/ip.lo long_return mibgroup/mibII/system_mib.lo snmpd_register_config_handler mibgroup/ucd-snmp/diskio.lo netsnmp_set_request_error mibgroup/mibII/ip.lo starttime mibgroup/host/hr_swinst.lo snmpd_unregister_config_handler mibgroup/ucd-snmp/dlmod.lo snmp_enableauthentrapsset mibgroup/mibII/snmp_mib.lo netsnmp_create_handler mibgroup/utilities/override.lo nullOid mibgroup/host/hr_device.lo run_shell_command mibgroup/ucd-snmp/extensible.lo unregister_mib mibgroup/ucd-snmp/pass.lo netsnmp_handler_mark_requests_as_delegated mibgroup/ucd-snmp/proxy.lo send_v2trap mibgroup/disman/mteTriggerTable.lo netsnmp_get_agent_uptime mibgroup/mibII/system_mib.lo send_trap_to_sess mibgroup/notification/snmpNotifyTable.lo netsnmp_free_delegated_cache mibgroup/ucd-snmp/proxy.lo netsnmp_inject_handler mibgroup/mibII/ip.lo get_top_context_cache mibgroup/agent/nsModuleTable.lo nullOidLen mibgroup/host/hr_device.lo netsnmp_timeval_uptime mibgroup/mibII/system_mib.lo register_mib mibgroup/ucd-snmp/diskio.lo run_exec_command mibgroup/ucd-snmp/extensible.lo netsnmp_register_handler mibgroup/ucd-snmp/proxy.lo agent_delegated_list mibgroup/agent/nsTransactionTable.lo
undefined symbols in libnetsnmpagent:
unregister_sysORTable_sess mibgroup/agentx/master_admin.lo make_tempfile mibgroup/utilities/execute.lo register_sysORTable_sess mibgroup/agentx/master_admin.lo parse_miboid mibgroup/smux/smux.lo setPerrorstatus mibgroup/utilities/execute.lo version_sysoid mibgroup/agentx/client.lo unregister_sysORTable_by_session mibgroup/agentx/master_admin.lo
Some of the undefined symbols may be ok depending on how api is designed, but there are still agent calls in both mibs and helpers libs.
-- Igor
------------------------------------------------------- The SF.Net email is sponsored by: Beat the post-holiday blues Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek. It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt _______________________________________________ Net-snmp-coders mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/net-snmp-coders
