Hi there,
In order to dynamically set the trap receiver's ip address, I used
snmpd_parse_config_trap2sink(), it looks ok, but the session with remote
port 162 is not established. The following is my code:
{
char tmp[64];
char host[]="192.168.x.x";
char community[]="public";
int port = 162;
snprintf(tmp, 64, "%s %s %hd", host, community, port);
/*there is a space between %s %s %hd */
snmpd_parse_config_trap2sink("trap2sink", tmp);
}
It looks ok, but when I debug in the function create_trap_session()(which is
also in agent_trap.c), after "sesp = snmp_open(&session)", I find in the
returned structure "sesp", the member "peername" is what expected,
(peername= "udp:192.168.x.x:162"), localname=NULL, and the
"sesp->remote_port" and "sesp->local_port" are always 0.
Is that ok? In fact, I can not setup the session with the remote trap
receiver (the host of 192.168.x.x).
Can somebody help me? Thanks a lot!
Li
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders