Is it possible to change the agent-addr value

Jochen Katz katz____agentpp.com
Fri Jun 16 01:07:05 CEST 2000


Hi,

> The module I'm working on will sit between a Cisco SNMP proxy and a SNMP
> manager. Is there any way for my SNMP++ module to change the agent-addr
> value? Of course by default this agent-addr value is set to the IP address
> of the machine running the SNMP++ program. What I would like to do is take a
> var binding from the Cisco PDU that contains the switchname and look this up
> into an IP address then use this as the agent-addr value for the traps I
> forward.

the agent-addr is a real problem in SNMP++: the Pdu object doesn't have
a variable for the agent-addr. For this reason the class SnmpMessage
uses the local IP address as agent-addr (see the comment "DON'T forget
about the v1 trap agent address" in snmpmsg.cpp) and ignores the
agent-addr if a trap is received.

Do you need the agent-addr only for outgoing traps or for both (outgoing
and incoming) traps?

In the first case I would suggest that you change snmpmsg.cpp after the
comment.

In the second case the Pdu class has to be extended with a new variable
agent_addr and the necessary set and get methods and some other methods
(like compare operators) have to be changed. The new methods can be used
in snmpmsg.cpp to set/get the agent-addr.

Best regards,
  Jochen



More information about the AGENTPP mailing list