Moved dissector for UNICODE_STRING structure from packet-dcerpc-samr.c to packet...
[obnox/wireshark/wip.git] / packet-ranap.c
index 1d21bc040ee52535cb76db794da03783ab84ff03..7ca4eec7a5f96f3c9d6b1d6c553ad5d9e682073b 100644 (file)
@@ -3,7 +3,7 @@
  * Based on 3GPP TS 25.413 V3.4.0
  * Copyright 2001, Martin Held <Martin.Held@icn.siemens.de>
  *
- * $Id: packet-ranap.c,v 1.8 2001/12/03 03:59:38 guy Exp $
+ * $Id: packet-ranap.c,v 1.11 2002/01/24 09:20:50 guy Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -49,7 +49,7 @@
 # include "snprintf.h"
 #endif
 
-#include "packet.h"
+#include <epan/packet.h>
 
 
 #define SCCP_SSN_RANAP 0x8E
@@ -3424,13 +3424,9 @@ dissect_IE_CriticalityDiagnostics(tvbuff_t *tvb, proto_tree *ie_tree)
 static int
 dissect_unknown_IE(tvbuff_t *tvb, proto_tree *ie_tree)
 {
-  guint                length;
-       
   if (ie_tree)
   {    
-     length = tvb_length(tvb);
-     
-     proto_tree_add_text(ie_tree, tvb, 0, length,
+     proto_tree_add_text(ie_tree, tvb, 0, -1,
                           "IE Contents (dissection not implemented)"); 
   }
   return(0);   
@@ -3991,13 +3987,12 @@ dissect_ranap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
   gint         tmp_bitoffset = 0;
   guint                extension_present;  
   
-  gint         ie_tvb_length;
   tvbuff_t     *ie_tvb;
   
 
   /* make entry in the Protocol column on summary display */
-  if (check_col(pinfo->fd, COL_PROTOCOL)) 
-    col_set_str(pinfo->fd, COL_PROTOCOL, "RANAP");  
+  if (check_col(pinfo->cinfo, COL_PROTOCOL)) 
+    col_set_str(pinfo->cinfo, COL_PROTOCOL, "RANAP");  
   
   /* extract header fields which are needed even if no tree exists */
   
@@ -4008,7 +4003,7 @@ dissect_ranap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
   {
       /* extended choice */ 
       /* decoding is not supported */
-      col_append_str(pinfo->fd, COL_INFO, "RANAP-PDU Protocol extension present, dissection not supported");
+      col_append_str(pinfo->cinfo, COL_INFO, "RANAP-PDU Protocol extension present, dissection not supported");
       return;                           
   }      
   
@@ -4022,14 +4017,14 @@ dissect_ranap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
   tmp_offset += 1;
     
   /* add Procedure Code to Info Column */                             
-  if (check_col(pinfo->fd, COL_INFO)) 
+  if (check_col(pinfo->cinfo, COL_INFO)) 
   {
     if (procedure_code <= PC_max)
     {
-       col_append_str(pinfo->fd, COL_INFO, 
+       col_append_str(pinfo->cinfo, COL_INFO, 
                    val_to_str(pdu_index, ranap_message_names[procedure_code], 
                               "unknown message"));
-       col_append_str(pinfo->fd, COL_INFO, " ");
+       col_append_str(pinfo->cinfo, COL_INFO, " ");
     }
   }
   
@@ -4042,7 +4037,7 @@ dissect_ranap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
   if (tree) 
   {
     /* create the ranap protocol tree */
-    ranap_item = proto_tree_add_item(tree, proto_ranap, tvb, 0, tvb_length(tvb), FALSE);
+    ranap_item = proto_tree_add_item(tree, proto_ranap, tvb, 0, -1, FALSE);
     ranap_tree = proto_item_add_subtree(ranap_item, ett_ranap);
     
     /* Add fields to ranap protocol tree */
@@ -4086,8 +4081,7 @@ dissect_ranap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
   offset = PDU_NUMBER_OF_OCTETS_OFFSET + number_of_octets_size;
            
   /* create a tvb containing the remainder of the PDU */
-  ie_tvb_length = tvb_length(tvb)- offset;
-  ie_tvb = tvb_new_subset(tvb, offset, ie_tvb_length, ie_tvb_length);                  
+  ie_tvb = tvb_new_subset(tvb, offset, -1, -1);
                        
   /* dissect the ies */
   dissect_ranap_ie_container(ie_tvb, pinfo, tree, ranap_tree);