Hi,
in a situation where AgentX support is enabled, the subagent receives from master agent the incoming request for processing.
Sometimes the subagent needs to know the IP address of the manager that issued a request; this information is easily found in the source PDU header that can be captured between manager and master agent. Since the master agent merely acts as a dispatcher, the same information should be also made available to the sub-agent. According to documentation, it should be reachable through the NetSNMP API by following reqinfo->asp->session->peername. However, it appears this is not the case. Perhaps the master agent does not propagate this info to the subagent? Anyone ever noticed this (mis)behaviour?

More precisely, netsnmp_session http://www.net-snmp.org/dev/agent/structsnmp__session.html
contains fields peername and remote_port which are respectively the IP address and IP/UDP port of the remote entity from which the SNMP request came from.
A pointer to a netsnmp_session structure is passed in the session field of the netsnmp_agent_session_s structure which is pointed by the asp field of the netsnmp_agent_request_info_s structure which is pointed by the  agent_req_info field of the netsnmp_request_info_s structure which is pointed by reqinfo, the third parameter that is passed to the callback handler that you register with the netsnmp_create_handler_registration API call.

Thanks in advance for any suggestion/comment on this topic,
Marco

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to