1 /* packet-dcerpc-rs_acct.c
3 * Routines for DFS/RS_ACCT
4 * Copyright 2002, Jaime Fournier <jafour1@yahoo.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
8 * $Id: packet-dcerpc-rs_acct.c,v 1.3 2002/11/28 04:57:43 guy Exp $
10 * Ethereal - Network traffic analyzer
11 * By Gerald Combs <gerald@ethereal.com>
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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
34 #ifdef HAVE_SYS_TYPES_H
35 #include <sys/types.h>
41 #include <epan/packet.h>
42 #include "packet-dcerpc.h"
45 static int proto_rs_acct = -1;
46 static int hf_rs_acct_opnum = -1;
47 static int hf_rs_acct_lookup_rqst_var = -1;
48 static int hf_rs_acct_lookup_rqst_key_size = -1;
49 static int hf_rs_acct_lookup_rqst_key_t = -1;
50 static int hf_rs_acct_get_projlist_rqst_var1 = -1;
51 static int hf_rs_acct_get_projlist_rqst_key_size = -1;
52 static int hf_rs_acct_get_projlist_rqst_key_t = -1;
55 static gint ett_rs_acct = -1;
59 static e_uuid_t uuid_rs_acct = { 0x4c878280, 0x2000, 0x0000, { 0x0d, 0x00, 0x02, 0x87, 0x14, 0x00, 0x00, 0x00 } };
60 static guint16 ver_rs_acct = 1;
64 rs_acct_dissect_lookup_rqst (tvbuff_t *tvb, int offset,
65 packet_info *pinfo, proto_tree *tree, char *drep)
68 const char *key_t = NULL;
70 offset = dissect_ndr_uint32 (tvb, offset, pinfo, tree, drep,
71 hf_rs_acct_lookup_rqst_var, NULL);
72 offset = dissect_ndr_uint32 (tvb, offset, pinfo, tree, drep,
73 hf_rs_acct_lookup_rqst_key_size, &key_size);
75 if (key_size){ /* Not able to yet decipher the OTHER versions of this call just yet. */
76 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));
77 key_t = (const char *)tvb_get_ptr(tvb,offset,key_size);
80 if (check_col(pinfo->cinfo, COL_INFO)) {
81 col_append_fstr(pinfo->cinfo, COL_INFO,
82 " Request for: %s ", key_t);
85 if (check_col(pinfo->cinfo, COL_INFO)) {
86 col_append_str(pinfo->cinfo, COL_INFO,
97 rs_acct_dissect_get_projlist_rqst (tvbuff_t *tvb, int offset,
98 packet_info *pinfo, proto_tree *tree, char *drep)
101 const char *key_t = NULL;
103 offset = dissect_ndr_uint32 (tvb, offset, pinfo, tree, drep,
104 hf_rs_acct_get_projlist_rqst_var1, NULL);
105 offset = dissect_ndr_uint32 (tvb, offset, pinfo, tree, drep,
106 hf_rs_acct_get_projlist_rqst_key_size, &key_size);
108 proto_tree_add_string (tree, hf_rs_acct_get_projlist_rqst_key_t,
109 tvb, offset, hf_rs_acct_get_projlist_rqst_key_size,
110 tvb_get_ptr (tvb, offset, key_size));
111 key_t = (const char *)tvb_get_ptr(tvb,offset,key_size);
114 if (check_col(pinfo->cinfo, COL_INFO)) {
115 col_append_fstr(pinfo->cinfo, COL_INFO,
116 " Request for: %s", key_t);
123 static dcerpc_sub_dissector rs_acct_dissectors[] = {
124 { 0, "rs_acct_add", NULL, NULL},
125 { 1, "rs_acct_delete", NULL, NULL},
126 { 2, "rs_acct_rename", NULL, NULL},
127 { 3, "rs_acct_lookup", rs_acct_dissect_lookup_rqst, NULL},
128 { 4, "rs_acct_replace", NULL, NULL},
129 { 5, "rs_acct_get_projlist", rs_acct_dissect_get_projlist_rqst, NULL},
130 { 0, NULL, NULL, NULL }
133 static const value_string rs_acct_opnum_vals[] = {
134 { 0, "rs_acct_add" },
135 { 1, "rs_acct_delete" },
136 { 2, "rs_acct_rename" },
137 { 3, "rs_acct_lookup" },
138 { 4, "rs_acct_replace" },
139 { 5, "rs_acct_get_projlist" },
144 proto_register_rs_acct (void)
146 static hf_register_info hf[] = {
148 { "Operation", "rs_acct.opnum", FT_UINT16, BASE_DEC, VALS(rs_acct_opnum_vals), 0x0, "Operation", HFILL }},
149 { &hf_rs_acct_lookup_rqst_var,
150 { "Var", "rs_acct.lookup_rqst_var", FT_UINT32, BASE_DEC, NULL, 0x0, "", HFILL }},
151 { &hf_rs_acct_lookup_rqst_key_size,
152 { "Key Size", "rs_acct.lookup_rqst_key_size", FT_UINT32, BASE_DEC, NULL, 0x0, "", HFILL }},
153 { &hf_rs_acct_lookup_rqst_key_t,
154 { "Key", "rs_lookup.get_rqst_key_t", FT_STRING, BASE_NONE, NULL, 0x0, "", HFILL }},
155 { &hf_rs_acct_get_projlist_rqst_var1,
156 { "Var1", "rs_acct.get_projlist_rqst_var1", FT_UINT32, BASE_DEC, NULL, 0x0, "", HFILL }},
157 { &hf_rs_acct_get_projlist_rqst_key_size,
158 { "Var1", "rs_acct.get_projlist_rqst_key_size", FT_UINT32, BASE_DEC, NULL, 0x0, "", HFILL }},
159 { &hf_rs_acct_get_projlist_rqst_key_t,
160 { "Var1", "rs_acct.get_projlist_rqst_key_t", FT_STRING, BASE_NONE, NULL, 0x0, "", HFILL }}
163 static gint *ett[] = {
166 proto_rs_acct = proto_register_protocol ("DCE/RPC RS_ACCT", "RS_ACCT", "rs_acct");
167 proto_register_field_array (proto_rs_acct, hf, array_length (hf));
168 proto_register_subtree_array (ett, array_length (ett));
174 proto_reg_handoff_rs_acct (void)
176 /* Register the protocol as dcerpc */
177 dcerpc_init_uuid (proto_rs_acct, ett_rs_acct, &uuid_rs_acct, ver_rs_acct, rs_acct_dissectors, hf_rs_acct_opnum);