ANNOUNCEMENT: Live Wireshark University & Allegro Packets online APAC Wireshark Training Session
July 17th, 2024 | 10:00am-11:55am SGT (UTC+8) | Online

Ethereal-dev: [Ethereal-dev] Patch for packet-snmp

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: Joe Clarke <jclarke@xxxxxxxxx>
Date: Mon, 21 May 2001 18:12:59 -0400 (EDT)
I was noticing that ethereal does not properly display decoded OID
varbinds.  Since .1.3 is encoded as one octet (2b), ethereal ends up
chopping off the last octet in an OID varbind.  I noticed this when trying
to decode sysObjectID from one of our routers.  ethereal always reported
.1.3.6.1.4.1.9.1 and never mentioned the trailing .50.  The asn.1 code is
correct, but the code that displays the data is forgetting the last octet.
Attached is a patch for the CVS packet-snmp.c that fixes this.

Not sure if it's the best way to do it, but it works for me on FreeBSD
4.3.

By the way, thanks for all the hard work with ethereal.

Joe Clarke

--
Joe Clarke, CCIE #5384             |          |
Customer Support Engineer        |||||      |||||
Phone: +1 (919) 392-2867    ..:|||||||||::|||||||||:..
Email: jclarke@xxxxxxxxx     c i s c o  S y s t e m s

----------------------------------------------------------------------------

*** packet-snmp.c.orig	Mon May 21 18:08:07 2001
--- packet-snmp.c	Mon May 21 18:08:18 2001
***************
*** 902,908 ****
  				variable.val.objid = vb_oid;
  				vb_display_string = format_var(&variable,
  				    variable_oid, variable_oid_length, vb_type,
! 				    vb_length);
  				proto_tree_add_text(snmp_tree, asn1->tvb, offset,
  				    length,
  				    "Value: %s", vb_display_string);
--- 902,908 ----
  				variable.val.objid = vb_oid;
  				vb_display_string = format_var(&variable,
  				    variable_oid, variable_oid_length, vb_type,
! 				    vb_length+1);
  				proto_tree_add_text(snmp_tree, asn1->tvb, offset,
  				    length,
  				    "Value: %s", vb_display_string);