1 /* packet-dcerpc-rs_acct.c
3 * Routines for DFS/RS_ACCT
4 * Copyright 2002, Jaime Fournier <Jaime.Fournier@hush.com>
5 * This information is based off the released idl files from opengroup.
6 * ftp://ftp.opengroup.org/pub/dce122/dce/src/security.tar.gz security/idl/rs_acct.idl
10 * Wireshark - Network traffic analyzer
11 * By Gerald Combs <gerald@wireshark.org>
12 * Copyright 1998 Gerald Combs
14 * This program is free software; you can redistribute it and/or
15 * modify it under the terms of the GNU General Public License
16 * as published by the Free Software Foundation; either version 2
17 * of the License, or (at your option) any later version.
19 * This program is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
24 * You should have received a copy of the GNU General Public License
25 * along with this program; if not, write to the Free Software
26 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
35 #include <epan/packet.h>
36 #include "packet-dcerpc.h"
39 static int proto_rs_acct = -1;
40 static int hf_rs_acct_opnum = -1;
41 static int hf_rs_acct_lookup_rqst_var = -1;
42 static int hf_rs_acct_lookup_rqst_key_size = -1;
43 static int hf_rs_acct_lookup_rqst_key_t = -1;
44 static int hf_rs_acct_get_projlist_rqst_var1 = -1;
45 static int hf_rs_acct_get_projlist_rqst_key_size = -1;
46 static int hf_rs_acct_get_projlist_rqst_key_t = -1;
49 static gint ett_rs_acct = -1;
53 static e_uuid_t uuid_rs_acct = { 0x4c878280, 0x2000, 0x0000, { 0x0d, 0x00, 0x02, 0x87, 0x14, 0x00, 0x00, 0x00 } };
54 static guint16 ver_rs_acct = 1;
58 rs_acct_dissect_lookup_rqst (tvbuff_t *tvb, int offset,
59 packet_info *pinfo, proto_tree *tree, guint8 *drep)
62 const char *keyx_t = NULL;
64 offset = dissect_ndr_uint32 (tvb, offset, pinfo, tree, drep,
65 hf_rs_acct_lookup_rqst_var, NULL);
66 offset = dissect_ndr_uint32 (tvb, offset, pinfo, tree, drep,
67 hf_rs_acct_lookup_rqst_key_size, &key_size);
69 if (key_size){ /* Not able to yet decipher the OTHER versions of this call just yet. */
70 proto_tree_add_item (tree, hf_rs_acct_lookup_rqst_key_t, tvb, offset, key_size, ENC_ASCII|ENC_NA);
71 keyx_t = tvb_get_ephemeral_string(tvb, offset, key_size);
74 if (check_col(pinfo->cinfo, COL_INFO)) {
75 col_append_fstr(pinfo->cinfo, COL_INFO,
76 " Request for: %s ", keyx_t);
79 col_append_str(pinfo->cinfo, COL_INFO,
89 rs_acct_dissect_get_projlist_rqst (tvbuff_t *tvb, int offset,
90 packet_info *pinfo, proto_tree *tree, guint8 *drep)
93 const char *keyx_t = NULL;
95 offset = dissect_ndr_uint32 (tvb, offset, pinfo, tree, drep,
96 hf_rs_acct_get_projlist_rqst_var1, NULL);
97 offset = dissect_ndr_uint32 (tvb, offset, pinfo, tree, drep,
98 hf_rs_acct_get_projlist_rqst_key_size, &key_size);
100 proto_tree_add_item (tree, hf_rs_acct_get_projlist_rqst_key_t,
101 tvb, offset, key_size, ENC_ASCII|ENC_NA);
102 keyx_t = tvb_get_ephemeral_string(tvb, offset, key_size);
105 if (check_col(pinfo->cinfo, COL_INFO)) {
106 col_append_fstr(pinfo->cinfo, COL_INFO,
107 " Request for: %s", keyx_t);
114 static dcerpc_sub_dissector rs_acct_dissectors[] = {
115 { 0, "add", NULL, NULL},
116 { 1, "delete", NULL, NULL},
117 { 2, "rename", NULL, NULL},
118 { 3, "lookup", rs_acct_dissect_lookup_rqst, NULL},
119 { 4, "replace", NULL, NULL},
120 { 5, "get_projlist", rs_acct_dissect_get_projlist_rqst, NULL},
121 { 0, NULL, NULL, NULL }
125 proto_register_rs_acct (void)
127 static hf_register_info hf[] = {
129 { "Operation", "rs_acct.opnum", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
130 { &hf_rs_acct_lookup_rqst_var,
131 { "Var", "rs_acct.lookup_rqst_var", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},
132 { &hf_rs_acct_lookup_rqst_key_size,
133 { "Key Size", "rs_acct.lookup_rqst_key_size", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},
134 { &hf_rs_acct_lookup_rqst_key_t,
135 { "Key", "rs_acct.lookup_rqst_key_t", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }},
136 { &hf_rs_acct_get_projlist_rqst_var1,
137 { "Var1", "rs_acct.get_projlist_rqst_var1", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},
138 { &hf_rs_acct_get_projlist_rqst_key_size,
139 { "Var1", "rs_acct.get_projlist_rqst_key_size", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},
140 { &hf_rs_acct_get_projlist_rqst_key_t,
141 { "Var1", "rs_acct.get_projlist_rqst_key_t", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}
144 static gint *ett[] = {
147 proto_rs_acct = proto_register_protocol ("DCE/RPC RS_ACCT", "RS_ACCT", "rs_acct");
148 proto_register_field_array (proto_rs_acct, hf, array_length (hf));
149 proto_register_subtree_array (ett, array_length (ett));
155 proto_reg_handoff_rs_acct (void)
157 /* Register the protocol as dcerpc */
158 dcerpc_init_uuid (proto_rs_acct, ett_rs_acct, &uuid_rs_acct, ver_rs_acct, rs_acct_dissectors, hf_rs_acct_opnum);