Re: how can I decode a PDU?

Wes Hardaker <[email protected]>
Newsgroups gmane.network.net-snmp.user
Organization Sparta
Message-ID <[email protected]>
>>>>> On Mon, 20 Sep 2010 14:21:41 +0200, Ottavio Campana <[email protected]> said:

OC> I have an application that receives SNMP PDU from a serial port.
OC> I correctly get the PDU and I'd like to use the library provided by
OC> net-snmp to decode the PDU.

OC> My problem is that I cannot find how to use it. If I use xdump I see the
OC> correct unit, but it is not clear to me if I have to use
OC> snmp_parse_var_op or some other function to decode the PDU.

The code for decoding PDUs can be found in snmplib/snmp_api.c and
snmplib/asn1.c.  But, it's not trivial to understand.

The better solution is that if you're receiving a SNMP packet over a
serial link, instead write a new transport for the serial link instead.
This is actually the "right" solution but isn't necessarily easier
either, as the transport code is tricky to understand.  I actually have
a "write a transport tutorial" on my todo list, but I haven't succeeded
in actually writing it yet.
-- 
Wes Hardaker
Cobham Analytic Solutions

------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
Net-snmp-users mailing list
[email protected]
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.