Re: Setting the sender address in outgoing SNMP trap packets

This is a discussion on Re: Setting the sender address in outgoing SNMP trap packets within the SNMP Coders forums, part of the Networking and Network Related category; On Mon, 2005-04-18 at 15:55, Shobana Sampath wrote: > When I try to set the agent-addr ...


Go Back   Usenet Forums > Networking and Network Related > SNMP Coders

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-19-2005
Dave Shield
 
Posts: n/a
Default Re: Setting the sender address in outgoing SNMP trap packets

On Mon, 2005-04-18 at 15:55, Shobana Sampath wrote:
> When I try to set the agent-addr using the code below,
> I get the following error:


> I use the following code to add the agent-addr:
> cp = asn_build_string(cp, out_length,
> (u_char) (ASN_IPADDRESS |
> ASN_PRIMITIVE),
> (u_char *) pdu->agent_addr, 4);


But why on earth are you messing about with the code
to build the packet in the first place? The library
already handles this. If you tell it to add the same
value twice, then it's not surprising if it throws
an error!

All you have to do is set the required value
in the 'agent_addr' field of the PDU structure.
The library will do the rest.

Dave



-------------------------------------------------------
This SF.Net email is sponsored by: New Crystal Reports XI.
Version 11 adds new functionality designed to reduce time involved in
creating, integrating, and deploying reporting solutions. Free runtime info,
new features, or free trial, at: http://www.businessobjects.com/devxi/728
_______________________________________________
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/...et-snmp-coders
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 10:28 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0