GSM A DTAP: add UMTS EVS to supported codecs list IE
[metze/wireshark/wip.git] / epan / dissectors / packet-dcerpc-rs_pgo.c
index d4962c8d2f553128c3c2f585813f9d9ef540c318..c1fc3cb26be4ef2b0fe46492470d99aaa7fe0bd0 100644 (file)
@@ -9,19 +9,7 @@
  * By Gerald Combs <gerald@wireshark.org>
  * Copyright 1998 Gerald Combs
  *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ * SPDX-License-Identifier: GPL-2.0-or-later
  */
 
 #include "config.h"
@@ -161,9 +149,10 @@ dissect_sec_rgy_pname_t (tvbuff_t * tvb, int offset,
 {
 
 
-  proto_item *item = NULL;
-  proto_tree *tree = NULL;
+  proto_item *item;
+  proto_tree *tree;
   int old_offset = offset;
+  const guint8 *principal;
 #define    sec_rgy_pname_t_size 257
 /*
 dissect    sec_rgy_pname const signed32        sec_rgy_pname_t_size  = 257; * Include final '\0' *
@@ -177,11 +166,7 @@ dissect    sec_rgy_pname const signed32        sec_rgy_pname_t_size  = 257; * In
     }
 
 
-  if (parent_tree)
-    {
-      tree =
-        proto_tree_add_subtree(parent_tree, tvb, offset, -1, ett_sec_rgy_pname_t, &item, "sec_rgy_pname_t");
-    }
+  tree = proto_tree_add_subtree(parent_tree, tvb, offset, -1, ett_sec_rgy_pname_t, &item, "sec_rgy_pname_t");
 
   offset = dissect_ndr_uint32 (tvb, offset, pinfo, tree, di, drep,
                                hf_sec_rgy_pname_t_size, &string_size);
@@ -190,12 +175,11 @@ dissect    sec_rgy_pname const signed32        sec_rgy_pname_t_size  = 257; * In
     {
 /* proto_tree_add_string(tree, id, tvb, start, length, value_ptr); */
 
-      proto_tree_add_item (tree, hf_sec_rgy_pname_t_principalName_string,
-                           tvb, offset, string_size, ENC_ASCII|ENC_NA);
+      proto_tree_add_item_ret_string(tree, hf_sec_rgy_pname_t_principalName_string,
+                           tvb, offset, string_size, ENC_ASCII|ENC_NA, wmem_packet_scope(), &principal);
       if (string_size > 1)
         {
-          col_append_fstr (pinfo->cinfo, COL_INFO, " Principal:%s",
-                             tvb_get_string_enc(wmem_packet_scope(), tvb, offset, string_size, ENC_ASCII));
+          col_append_fstr (pinfo->cinfo, COL_INFO, " Principal:%s", principal);
         }
       offset += string_size;
     }
@@ -372,9 +356,10 @@ dissect_sec_rgy_name_t (tvbuff_t * tvb, int offset,
 {
 
 
-  proto_item *item = NULL;
-  proto_tree *tree = NULL;
+  proto_item *item;
+  proto_tree *tree;
   int old_offset = offset;
+  const guint8 *principal;
 #define    sec_rgy_name_t_size  1025
 /*    typedef [string] char sec_rgy_name_t[sec_rgy_name_t_size]; */
   guint32 string_size;
@@ -385,11 +370,7 @@ dissect_sec_rgy_name_t (tvbuff_t * tvb, int offset,
     }
 
 
-  if (parent_tree)
-    {
-      tree =
-        proto_tree_add_subtree(parent_tree, tvb, offset, -1, ett_sec_rgy_name_t, &item, "sec_rgy_name_t");
-    }
+  tree = proto_tree_add_subtree(parent_tree, tvb, offset, -1, ett_sec_rgy_name_t, &item, "sec_rgy_name_t");
 
   offset =
     dissect_ndr_uint32(tvb, offset, pinfo, tree, di, drep,
@@ -399,12 +380,11 @@ dissect_sec_rgy_name_t (tvbuff_t * tvb, int offset,
     {
 /* proto_tree_add_string(tree, id, tvb, start, length, value_ptr); */
 
-      proto_tree_add_item (tree, hf_sec_rgy_name_t_principalName_string,
-                           tvb, offset, string_size, ENC_ASCII|ENC_NA);
+      proto_tree_add_item_ret_string(tree, hf_sec_rgy_name_t_principalName_string,
+                           tvb, offset, string_size, ENC_ASCII|ENC_NA, wmem_packet_scope(), &principal);
       if (string_size > 1)
         {
-          col_append_fstr (pinfo->cinfo, COL_INFO, " Principal:%s",
-                             tvb_get_string_enc(wmem_packet_scope(), tvb, offset, string_size, ENC_ASCII));
+          col_append_fstr (pinfo->cinfo, COL_INFO, " Principal:%s", principal);
         }
       offset += string_size;
     }
@@ -967,7 +947,7 @@ rs_pgo_dissect_add_resp (tvbuff_t * tvb, int offset,
         [out]       error_status_t      *status
 */
 
- buff_remain = tvb_length_remaining(tvb, offset);
+ buff_remain = tvb_captured_length_remaining(tvb, offset);
 
 /* found several add_member responses that had 8 bytes of data. first was 4 0's and last was 3 zeros and a 1 */
 if (buff_remain > 8) {
@@ -1019,7 +999,7 @@ rs_pgo_dissect_delete_resp (tvbuff_t * tvb, int offset,
         [out]       rs_cache_data_t     *cache_info,
         [out]       error_status_t      *status
 */
- buff_remain = tvb_length_remaining(tvb, offset);
+ buff_remain = tvb_captured_length_remaining(tvb, offset);
 
 /* found several add_member responses that had 8 bytes of data. first was 4 0's and last was 3 zeros and a 1 */
 
@@ -1185,7 +1165,7 @@ rs_pgo_dissect_add_member_resp (tvbuff_t * tvb, int offset,
         [out]       error_status_t      *status
 */
 
- buff_remain = tvb_length_remaining(tvb, offset);
+ buff_remain = tvb_captured_length_remaining(tvb, offset);
 
 /* found several add responses that had 8 bytes of data. first was 4 0's and last was 3 zeros and a 1 */
 if (buff_remain > 8) {