GSM A DTAP: add UMTS EVS to supported codecs list IE
[metze/wireshark/wip.git] / epan / dissectors / packet-dcerpc-rs_pgo.c
index c2919dd21f7462de77a392291a3bd2f4e71d3841..c1fc3cb26be4ef2b0fe46492470d99aaa7fe0bd0 100644 (file)
@@ -9,25 +9,12 @@
  * 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"
 
 
-#include <glib.h>
 #include <epan/packet.h>
 #include "packet-dcerpc.h"
 #include "packet-dcerpc-dce122.h"
@@ -118,7 +105,7 @@ static gint ett_rs_pgo_result_t = -1;
 
 static gint ett_rs_pgo = -1;
 
-static e_uuid_t uuid_rs_pgo =
+static e_guid_t uuid_rs_pgo =
   { 0x4c878280, 0x3000, 0x0000, {0x0d, 0x00, 0x02, 0x87, 0x14, 0x00, 0x00,
                                  0x00}
 };
@@ -141,8 +128,7 @@ dissect_error_status_t (tvbuff_t * tvb, int offset,
     return offset;
   }
 
-  item = proto_tree_add_text (parent_tree, tvb, offset, -1, "error_status_t");
-  tree = proto_item_add_subtree (item, ett_error_status_t);
+  tree = proto_tree_add_subtree(parent_tree, tvb, offset, -1, ett_error_status_t, &item, "error_status_t");
 
   offset =
     dissect_ndr_uint32 (tvb, offset, pinfo, tree, di, drep, hf_error_status_t,
@@ -163,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' *
@@ -179,12 +166,7 @@ dissect    sec_rgy_pname const signed32        sec_rgy_pname_t_size  = 257; * In
     }
 
 
-  if (parent_tree)
-    {
-      item =
-        proto_tree_add_text (parent_tree, tvb, offset, -1, "sec_rgy_pname_t");
-      tree = proto_item_add_subtree (item, ett_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);
@@ -193,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;
     }
@@ -240,10 +221,9 @@ dissect_sec_rgy_pgo_flags_t (tvbuff_t * tvb, int offset,
 
   if (parent_tree)
     {
-      item =
-        proto_tree_add_text (parent_tree, tvb, offset, -1,
-                             "sec_rgy_pgo_flags_t ");
-      tree = proto_item_add_subtree (item, ett_sec_rgy_pgo_flags_t);
+      tree =
+        proto_tree_add_subtree(parent_tree, tvb, offset, -1,
+                             ett_sec_rgy_pgo_flags_t, &item, "sec_rgy_pgo_flags_t ");
     }
 
   offset =
@@ -328,7 +308,7 @@ dissect_rs_cache_data_t (tvbuff_t * tvb, int offset,
   proto_tree *tree = NULL;
   int old_offset = offset;
   guint32 person_dtm, group_dtm, org_dtm;
-  e_uuid_t uuid1;
+  e_guid_t uuid1;
 
 
   if (di->conformant_run)
@@ -339,9 +319,8 @@ dissect_rs_cache_data_t (tvbuff_t * tvb, int offset,
 
   if (parent_tree)
     {
-      item =
-        proto_tree_add_text (parent_tree, tvb, offset, -1, "rs_cache_data_t");
-      tree = proto_item_add_subtree (item, ett_rs_cache_data_t);
+      tree =
+        proto_tree_add_subtree(parent_tree, tvb, offset, -1, ett_rs_cache_data_t, &item, "rs_cache_data_t");
     }
 
 
@@ -359,10 +338,10 @@ dissect_rs_cache_data_t (tvbuff_t * tvb, int offset,
 
   col_append_fstr (pinfo->cinfo, COL_INFO,
                      " siteid %08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x person_dtm:%u group_dtm:%u org_dtm:%u",
-                     uuid1.Data1, uuid1.Data2, uuid1.Data3, uuid1.Data4[0],
-                     uuid1.Data4[1], uuid1.Data4[2], uuid1.Data4[3],
-                     uuid1.Data4[4], uuid1.Data4[5], uuid1.Data4[6],
-                     uuid1.Data4[7], person_dtm, group_dtm, org_dtm);
+                     uuid1.data1, uuid1.data2, uuid1.data3, uuid1.data4[0],
+                     uuid1.data4[1], uuid1.data4[2], uuid1.data4[3],
+                     uuid1.data4[4], uuid1.data4[5], uuid1.data4[6],
+                     uuid1.data4[7], person_dtm, group_dtm, org_dtm);
 
   proto_item_set_len (item, offset - old_offset);
   return offset;
@@ -377,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;
@@ -390,12 +370,7 @@ dissect_sec_rgy_name_t (tvbuff_t * tvb, int offset,
     }
 
 
-  if (parent_tree)
-    {
-      item =
-        proto_tree_add_text (parent_tree, tvb, offset, -1, "sec_rgy_name_t");
-      tree = proto_item_add_subtree (item, ett_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,
@@ -405,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;
     }
@@ -449,9 +423,8 @@ dissect_sec_rgy_domain_t (tvbuff_t * tvb, int offset,
 
   if (parent_tree)
     {
-      item =
-        proto_tree_add_text (parent_tree, tvb, offset, -1, "sec_rgy_domain_t");
-      tree = proto_item_add_subtree (item, ett_sec_rgy_domain_t);
+      tree =
+        proto_tree_add_subtree(parent_tree, tvb, offset, -1, ett_sec_rgy_domain_t, &item, "sec_rgy_domain_t");
     }
 
 
@@ -487,7 +460,7 @@ dissect_sec_rgy_pgo_item_t (tvbuff_t * tvb, int offset,
   proto_item *item = NULL;
   proto_tree *tree = NULL;
   int old_offset = offset;
-  e_uuid_t id;
+  e_guid_t id;
   guint32 unix_num, quota;
 
   if (di->conformant_run)
@@ -498,10 +471,9 @@ dissect_sec_rgy_pgo_item_t (tvbuff_t * tvb, int offset,
 
   if (parent_tree)
     {
-      item =
-        proto_tree_add_text (parent_tree, tvb, offset, -1,
-                             " sec_rgy_pgo_item_t ");
-      tree = proto_item_add_subtree (item, ett_sec_rgy_pgo_item_t);
+      tree =
+        proto_tree_add_subtree(parent_tree, tvb, offset, -1,
+                             ett_sec_rgy_pgo_item_t, &item, " sec_rgy_pgo_item_t ");
     }
 
   offset =
@@ -518,10 +490,10 @@ dissect_sec_rgy_pgo_item_t (tvbuff_t * tvb, int offset,
 
   col_append_fstr (pinfo->cinfo, COL_INFO,
                      " sec_rgy_pgo_item_t - id %08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x unix_num:%u quota:%u",
-                     id.Data1, id.Data2, id.Data3, id.Data4[0],
-                     id.Data4[1], id.Data4[2], id.Data4[3],
-                     id.Data4[4], id.Data4[5], id.Data4[6],
-                     id.Data4[7], unix_num, quota);
+                     id.data1, id.data2, id.data3, id.data4[0],
+                     id.data4[1], id.data4[2], id.data4[3],
+                     id.data4[4], id.data4[5], id.data4[6],
+                     id.data4[7], unix_num, quota);
 
   proto_item_set_len (item, offset - old_offset);
   return offset;
@@ -549,7 +521,7 @@ dissect_sec_rgy_cursor_t (tvbuff_t * tvb, int offset,
   proto_item *item = NULL;
   proto_tree *tree = NULL;
   int old_offset = offset;
-  e_uuid_t source;
+  e_guid_t source;
   guint32 handle, valid;
 
   if (di->conformant_run)
@@ -560,10 +532,9 @@ dissect_sec_rgy_cursor_t (tvbuff_t * tvb, int offset,
 
   if (parent_tree)
     {
-      item =
-        proto_tree_add_text (parent_tree, tvb, offset, -1,
-                             " sec_rgy_cursor_t ");
-      tree = proto_item_add_subtree (item, ett_sec_rgy_cursor_t);
+      tree =
+        proto_tree_add_subtree(parent_tree, tvb, offset, -1,
+                             ett_sec_rgy_cursor_t, &item, " sec_rgy_cursor_t ");
     }
 
   offset =
@@ -577,10 +548,10 @@ dissect_sec_rgy_cursor_t (tvbuff_t * tvb, int offset,
 
   col_append_fstr (pinfo->cinfo, COL_INFO,
                      " sec_rgy_cursor_t - source %08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x handle:%u valid:%u",
-                     source.Data1, source.Data2, source.Data3,
-                     source.Data4[0], source.Data4[1], source.Data4[2],
-                     source.Data4[3], source.Data4[4], source.Data4[5],
-                     source.Data4[6], source.Data4[7], handle, valid);
+                     source.data1, source.data2, source.data3,
+                     source.data4[0], source.data4[1], source.data4[2],
+                     source.data4[3], source.data4[4], source.data4[5],
+                     source.data4[6], source.data4[7], handle, valid);
 
   proto_item_set_len (item, offset - old_offset);
   return offset;
@@ -615,9 +586,8 @@ dissect_rs_pgo_query_t (tvbuff_t * tvb, int offset,
 
   if (parent_tree)
     {
-      item =
-        proto_tree_add_text (parent_tree, tvb, offset, -1, "rs_pgo_query_t ");
-      tree = proto_item_add_subtree (item, ett_rs_pgo_query_t);
+      tree =
+        proto_tree_add_subtree(parent_tree, tvb, offset, -1, ett_rs_pgo_query_t, &item, "rs_pgo_query_t ");
     }
   offset =
     dissect_ndr_uint8 (tvb, offset, pinfo, tree, di, drep, hf_rs_pgo_query_t,
@@ -668,7 +638,7 @@ dissect_rs_pgo_id_key_t (tvbuff_t * tvb, int offset,
   proto_item *item = NULL;
   proto_tree *tree = NULL;
   int old_offset = offset;
-  e_uuid_t id;
+  e_guid_t id;
 
   if (di->conformant_run)
     {
@@ -678,10 +648,9 @@ dissect_rs_pgo_id_key_t (tvbuff_t * tvb, int offset,
 
   if (parent_tree)
     {
-      item =
-        proto_tree_add_text (parent_tree, tvb, offset, -1,
-                             "rs_pgo_id_key_t ");
-      tree = proto_item_add_subtree (item, ett_rs_pgo_id_key_t);
+      tree =
+        proto_tree_add_subtree(parent_tree, tvb, offset, -1,
+                             ett_rs_pgo_id_key_t, &item, "rs_pgo_id_key_t ");
     }
 
   offset =
@@ -690,9 +659,9 @@ dissect_rs_pgo_id_key_t (tvbuff_t * tvb, int offset,
 
   col_append_fstr (pinfo->cinfo, COL_INFO,
                      " rs_pgo_id_key_t - id %08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x",
-                     id.Data1, id.Data2, id.Data3, id.Data4[0],
-                     id.Data4[1], id.Data4[2], id.Data4[3],
-                     id.Data4[4], id.Data4[5], id.Data4[6], id.Data4[7]);
+                     id.data1, id.data2, id.data3, id.data4[0],
+                     id.data4[1], id.data4[2], id.data4[3],
+                     id.data4[4], id.data4[5], id.data4[6], id.data4[7]);
 
   proto_item_set_len (item, offset - old_offset);
   return offset;
@@ -725,10 +694,9 @@ dissect_rs_pgo_result_t (tvbuff_t * tvb, int offset,
 
   if (parent_tree)
     {
-      item =
-        proto_tree_add_text (parent_tree, tvb, offset, -1,
-                             "rs_pgo_result_t ");
-      tree = proto_item_add_subtree (item, ett_rs_pgo_result_t);
+      tree =
+        proto_tree_add_subtree(parent_tree, tvb, offset, -1,
+                             ett_rs_pgo_result_t, &item, "rs_pgo_result_t ");
     }
 
   offset = dissect_sec_rgy_name_t (tvb, offset, pinfo, tree, di, drep);
@@ -770,10 +738,9 @@ r
 
   if (parent_tree)
     {
-      item =
-        proto_tree_add_text (parent_tree, tvb, offset, -1,
-                             " rs_pgo_unix_num_key_t ");
-      tree = proto_item_add_subtree (item, ett_rs_pgo_unix_num_key_t);
+      tree =
+        proto_tree_add_subtree(parent_tree, tvb, offset, -1,
+                             ett_rs_pgo_unix_num_key_t, &item, " rs_pgo_unix_num_key_t ");
     }
 
   offset =
@@ -837,10 +804,9 @@ dissect_rs_pgo_query_key_t (tvbuff_t * tvb, int offset,
 
   if (parent_tree)
     {
-      item =
-        proto_tree_add_text (parent_tree, tvb, offset, -1,
-                             "rs_pgo_query_key_t ");
-      tree = proto_item_add_subtree (item, ett_rs_pgo_query_key_t);
+      tree =
+        proto_tree_add_subtree(parent_tree, tvb, offset, -1,
+                             ett_rs_pgo_query_key_t, &item, "rs_pgo_query_key_t ");
     }
   offset =
     dissect_ndr_uint16 (tvb, offset, pinfo, tree, di, drep, hf_rs_pgo_query_key_t,
@@ -909,9 +875,8 @@ dissect_rs_pgo_query_result_t (tvbuff_t * tvb, int offset,
 
   if (parent_tree)
     {
-      item = proto_tree_add_text (parent_tree, tvb, offset, -1,
-                                  "rs_pgo_query_result_t");
-      tree = proto_item_add_subtree (item, ett_rs_pgo_query_result_t);
+      tree = proto_tree_add_subtree(parent_tree, tvb, offset, -1,
+                                  ett_rs_pgo_query_result_t, &item, "rs_pgo_query_result_t");
     }
 
   offset =
@@ -1625,3 +1590,16 @@ proto_reg_handoff_rs_pgo (void)
   dcerpc_init_uuid (proto_rs_pgo, ett_rs_pgo, &uuid_rs_pgo, ver_rs_pgo,
                     rs_pgo_dissectors, hf_rs_pgo_opnum);
 }
+
+/*
+ * Editor modelines  -  http://www.wireshark.org/tools/modelines.html
+ *
+ * Local Variables:
+ * c-basic-offset: 2
+ * tab-width: 8
+ * indent-tabs-mode: nil
+ * End:
+ *
+ * ex: set shiftwidth=2 tabstop=8 expandtab:
+ * :indentSize=2:tabSize=8:noTabs=true:
+ */