On Mon, 2005-04-25 at 16:38, Shobana Sampath wrote:
> I tried to add a varbind to set the snmpTrapAddress,
> but no luck, the resulting pdu does not have the
> agent_address set as they say in the RFC:

No - you're not mean to add a varbind to do this.
You are meant to assign a suitable address to
the 'agent_addr' field.



> oid objid_snmpTrapAddress[] = { 1, 3, 6, 1, 6, 3, 18,
> 1, 3, 0 };     
> snmp_add_var(pdu, objid_snmpTrapAddress,
>              sizeof(objid_snmpTrapAddress) /
>              sizeof(oid), 'a', "10.86.160.102");

Try

    in_addr_t *addr;
    addr = (in_addr_t *)pdu->agent_addr;
   *addr = parse_address( "10.86.160.102" );

Dave



-------------------------------------------------------
SF.Net email is sponsored by: Tell us your software development plans!
Take this survey and enter to win a one-year sub to SourceForge.net
Plus IDC's 2005 look-ahead and a copy of this survey
Click here to start!  http://www.idcswdc.com/cgi-bin/survey?id=105hix
_______________________________________________
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to