Ethereal-dev: Re: [Ethereal-dev] IS-IS CLNP decoding of ethereal vs sniffer

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

From: Guy Harris <gharris@xxxxxxxxxxxx>
Date: Sat, 23 Dec 2000 11:32:53 -0800
On Wed, Dec 20, 2000 at 04:35:07PM +0100, Zuidweg, R (Rob) wrote:
> Thanks for the explanation.
> As I understand it should be no problem to activate the (partial) second
> part of the CLNP decoding. I hope to see it implemented in one of the future
> releases of ethereal.

I'm about to check the change in; I've attached a patch that should add
it to the current version.
Index: packet-clnp.c
===================================================================
RCS file: /usr/local/cvsroot/ethereal/packet-clnp.c,v
retrieving revision 1.16
diff -c -r1.16 packet-clnp.c
*** packet-clnp.c	2000/11/19 08:53:56	1.16
--- packet-clnp.c	2000/12/23 19:32:02
***************
*** 50,55 ****
--- 50,56 ----
  
  static int  proto_clnp         = -1;
  static gint ett_clnp           = -1;
+ static gint ett_clnp_disc_pdu  = -1;
  static int  proto_cotp         = -1;
  static gint ett_cotp           = -1;
  static int  proto_cltp         = -1;
***************
*** 1555,1560 ****
--- 1556,1563 ----
    u_char      src_len, dst_len, nsel, opt_len = 0;
    guint8     *dst_addr, *src_addr;
    guint       len;
+   guint       next_length;
+   proto_tree *discpdu_tree;
    tvbuff_t   *next_tvb;
  
    CHECK_DISPLAY_AS_DATA(proto_clnp, tvb, pinfo, tree);
***************
*** 1765,1773 ****
      case ER_NPDU:
        /* The payload is the header and "none, some, or all of the data
           part of the discarded PDU", i.e. it's like an ICMP error;
! 	 just as we don't yet trust ourselves to be able to dissect
! 	 the payload of an ICMP error packet, we don't yet trust
! 	 ourselves to dissect the payload of a CLNP ER packet. */
        break;
  
      case ERQ_NPDU:
--- 1768,1790 ----
      case ER_NPDU:
        /* The payload is the header and "none, some, or all of the data
           part of the discarded PDU", i.e. it's like an ICMP error;
! 	 dissect it as a CLNP PDU. */
!       if (tree) {
!         next_length = tvb_length_remaining(tvb, offset);
!         if (next_length != 0) {
!           /* We have payload; dissect it.
! 	     Make the columns non-writable, so the packet isn't shown
! 	     in the summary based on what the discarded PDU's contents
! 	     are. */
! 	  col_set_writable(pinfo->fd, FALSE);
!           ti = proto_tree_add_text(clnp_tree, tvb, offset, next_length,
!             "Discarded PDU");
!           discpdu_tree = proto_item_add_subtree(ti, ett_clnp_disc_pdu);
!           next_tvb = tvb_new_subset(tvb, offset, -1, -1);
!           dissect_clnp(next_tvb, pinfo, discpdu_tree);
!           offset += next_length;
!         }
!       }
        break;
  
      case ERQ_NPDU:
***************
*** 1823,1828 ****
--- 1840,1846 ----
    };
    static gint *ett[] = {
      &ett_clnp,
+     &ett_clnp_disc_pdu,
    };
  
    module_t *clnp_module;