On Fri, 09 Sep 2005 09:39:20 +0100 Dave wrote:
DS> The place for knowledge about per-transport defaults is in the
DS> transport-specific domain handler, where the person coding this
DS> *would* know what the default values should be for particular
DS> services.
True, but they wouldn't know what the user wanted the default to be.
DS> As far as an application writer is concerned, they should be able
DS> to say:
DS> "I'm talking to a SNMP notification receiver, so use
DS> the appropriate default socket for that service."
I like this idea enough to take it a step further.
DS> - either as a string representation ("udp:localhost:161", etc),
DS> where not all the elements need necessarily be present,
DS> and possibly accompanied by an (optional) default port.
How about actually using a service, as you suggested earlier, and the user
provided strings? Since some existing code gets the information in 3 pieces, I
suggest the api have 3 parameters, plus the local/remote flag:
netsnmp_xxx("snmpd:receive", user_transport, user_peer, user_port, 0);
netsnmp_xxx("snmpd:agentx", user_transport, user_peer, user_port, 0);
netsnmp_xxx("snmpd:trap", user_transport, user_peer, user_port, 1);
During init, defaults would be registered:
netsnmp_yyy("snmpd:receive", "udp", "localhost", "161");
netsnmp_yyy("snmpd:agentx", "unix", "/var/agentx", NULL);
netsnmp_yyy("snmpd:trap", "udp", NULL, 0);
These could be overridden by the user in the conf files during startup.
snmpd:receive tcp:192.168.1.1:1161
snmpd:agentx tcp:localhost:705
--
NOTE: messages sent directly to me, instead of the lists, will be deleted
unless they are requests for paid consulting services.
Robert Story; NET-SNMP Junkie
Support: <http://www.net-snmp.org/> <irc://irc.freenode.net/#net-snmp>
Archive: <http://sourceforge.net/mailarchive/forum.php?forum=net-snmp-coders>
You are lost in a twisty maze of little standards, all different.
-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders