various string related changes, mainly replace sprintf/snprintf by g_snprintf
[obnox/wireshark/wip.git] / packet-dcerpc-rs_acct.c
index cf2b185290f9b72cc5dfa1abfa9b879c8b4d97ec..9eb321f34e91e1476e90c5bf9662323a09c9701e 100644 (file)
@@ -1,11 +1,11 @@
 /* packet-dcerpc-rs_acct.c
  *
  * Routines for DFS/RS_ACCT
- * Copyright 2002, Jaime Fournier <jafour1@yahoo.com>
+ * Copyright 2002, Jaime Fournier <Jaime.Fournier@hush.com>
  * This information is based off the released idl files from opengroup.
  * ftp://ftp.opengroup.org/pub/dce122/dce/src/security.tar.gz security/idl/rs_acct.idl
  *      
- * $Id: packet-dcerpc-rs_acct.c,v 1.2 2002/11/08 19:42:40 guy Exp $
+ * $Id: packet-dcerpc-rs_acct.c,v 1.8 2004/01/27 04:15:48 guy Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -62,10 +62,10 @@ static guint16  ver_rs_acct = 1;
 
 static int
 rs_acct_dissect_lookup_rqst (tvbuff_t *tvb, int offset,
-               packet_info *pinfo, proto_tree *tree, char *drep)
+               packet_info *pinfo, proto_tree *tree, guint8 *drep)
 {
        guint32 key_size;
-       char *key_t = NULL;
+       const char *key_t = NULL;
 
        offset = dissect_ndr_uint32 (tvb, offset, pinfo, tree, drep, 
                        hf_rs_acct_lookup_rqst_var, NULL);
@@ -74,7 +74,7 @@ rs_acct_dissect_lookup_rqst (tvbuff_t *tvb, int offset,
 
        if (key_size){ /* Not able to yet decipher the OTHER versions of this call just yet. */
                proto_tree_add_string (tree, hf_rs_acct_lookup_rqst_key_t, tvb, offset, hf_rs_acct_lookup_rqst_key_size, tvb_get_ptr (tvb, offset, key_size));
-               key_t = (char *)tvb_get_ptr(tvb,offset,key_size);
+               key_t = (const char *)tvb_get_ptr(tvb,offset,key_size);
                offset += key_size;
 
                if (check_col(pinfo->cinfo, COL_INFO)) {
@@ -89,16 +89,16 @@ rs_acct_dissect_lookup_rqst (tvbuff_t *tvb, int offset,
        }
 
        return offset;
-};
+}
 
 
 
 static int
 rs_acct_dissect_get_projlist_rqst (tvbuff_t *tvb, int offset,
-               packet_info *pinfo, proto_tree *tree, char *drep)
+               packet_info *pinfo, proto_tree *tree, guint8 *drep)
 {
        guint32 key_size;
-       char *key_t = NULL;
+       const char *key_t = NULL;
 
        offset = dissect_ndr_uint32 (tvb, offset, pinfo, tree, drep, 
                        hf_rs_acct_get_projlist_rqst_var1, NULL);
@@ -108,7 +108,7 @@ rs_acct_dissect_get_projlist_rqst (tvbuff_t *tvb, int offset,
        proto_tree_add_string (tree, hf_rs_acct_get_projlist_rqst_key_t, 
                        tvb, offset, hf_rs_acct_get_projlist_rqst_key_size, 
                        tvb_get_ptr (tvb, offset, key_size));
-       key_t = (char *)tvb_get_ptr(tvb,offset,key_size);
+       key_t = (const char *)tvb_get_ptr(tvb,offset,key_size);
        offset += key_size;
 
        if (check_col(pinfo->cinfo, COL_INFO)) {
@@ -130,22 +130,12 @@ static dcerpc_sub_dissector rs_acct_dissectors[] = {
         { 0, NULL, NULL, NULL }
 };
 
-static const value_string rs_acct_opnum_vals[] = {
-        { 0, "rs_acct_add" },
-        { 1, "rs_acct_delete" },
-        { 2, "rs_acct_rename" },
-        { 3, "rs_acct_lookup" },
-        { 4, "rs_acct_replace" },
-        { 5, "rs_acct_get_projlist" },
-        { 0, NULL }
-};
-
 void
 proto_register_rs_acct (void)
 {
        static hf_register_info hf[] = {
        { &hf_rs_acct_opnum,
-               { "Operation", "rs_acct.opnum", FT_UINT16, BASE_DEC, VALS(rs_acct_opnum_vals), 0x0, "Operation", HFILL }},
+               { "Operation", "rs_acct.opnum", FT_UINT16, BASE_DEC, NULL, 0x0, "Operation", HFILL }},
        { &hf_rs_acct_lookup_rqst_var,
                { "Var", "rs_acct.lookup_rqst_var", FT_UINT32, BASE_DEC, NULL, 0x0, "", HFILL }},
        { &hf_rs_acct_lookup_rqst_key_size,