Hi Jan,
I checked the patch for 'v1trapaddress', it used the following to register the
v1trapaddress string in the snmpd.conf:
netsnmp_ds_register_config(ASN_OCTET_STR, app, "v1trapaddress",
NETSNMP_DS_APPLICATION_ID,
NETSNMP_DS_AGENT_TRAP_ADDR);
Once the snmpd is re-read as it receives a SIGHUP signal, the string
v1trapaddress will not be refreshed. For example, if I manually remove the
'v1trapaddress 10.0.0.1' from the snmpd.conf, then a SIGHUP is sent, the snmp
daemon still thinks that the string defined for v1trapaddress is there.
I wonder if we should use the register_app_config_handler instead of
netsnmp_ds_register_config. When v1trapaddress is registered with
register_app_config_handler( ), it will defines callback function to update it
properly.
Cheers, Henry
> Date: Fri, 15 Aug 2008 15:25:39 +0200
> From: [EMAIL PROTECTED]
> To: [EMAIL PROTECTED]
> CC: [email protected]
> Subject: Re: Is it possible to set the L3 source interface IP address in a
> trap packet?
>
> Zhouhuai Shen wrote:
> > Hi all,
> >
> > Is it possible to set the layer 3 source IP address for a trap packet to
> > a certain interface on the device, other than the outgoing interface?
> >
> > I have tried to set the member localname of the netsnmp_session data
> > structure to the desired interface address in the function
> > send_trap_to_sess() in agent_trap.c, but it doesn't work. The localname
> > in the function is null, I suppose the source interface for the trap
> > packet will be filled up later on.
> >
> > Can anyone please give me some help?
>
> You can use '[snmp] clientaddr' option to set source address of UDP
> packet with the trap and with patch [1] you can use 'v1trapaddress'
> option to set address of the agent sent inside the trap.
>
> [1]:
> http://sourceforge.net/tracker/index.php?func=detail&aid=1916840&group_id=12694&atid=312694
>
> Jan
_________________________________________________________________
Buy, rent, invest property online today.
http://a.ninemsn.com.au/b.aspx?URL=http%3A%2F%2Fwww%2Eallrealestate%2Eco%2Enz%2Freview%2Fhome%2Dbuying%2Dinfo%2Ehtml%3Frsf%3Dmsnnz%5Ftextlink&_t=26000&_r=REA_NZ_tagline&_m=EXT-------------------------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders