On an ethereal trace after doing what is described below, I had to also add this code because I noticed that snmp_pdu_build does not add the agent_addr for v2c traps
cp = asn_build_string(cp, pkt_len, (u_char) (ASN_IPADDRESS | ASN_PRIMITIVE), (u_char *) pdu->agent_addr, 4); My ethereal trace shows: "40 04 0a 56 f0 1d" as the last few bytes and the address matches what I set: 10.86.240.29 How do I make the receiving end recognize this as the agent_address? Thanks. /Shobana --- Dave Shield <[EMAIL PROTECTED]> wrote: > 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 > > __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com ------------------------------------------------------- This SF.Net email is sponsored by Oracle Space Sweepstakes Want to be the first software developer in space? Enter now for the Oracle Space Sweepstakes! http://ads.osdn.com/?ad_id=7393&alloc_id=16281&op=click _______________________________________________ Net-snmp-coders mailing list Net-snmp-coders@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/net-snmp-coders