1 /* packet-dcerpc-conv.c
2 * Routines for dcerpc conv dissection
3 * Copyright 2001, Todd Sabin <tas@webspan.net>
5 * $Id: packet-dcerpc-conv.c,v 1.6 2002/09/26 06:13:07 sahlberg Exp $
7 * Ethereal - Network traffic analyzer
8 * By Gerald Combs <gerald@ethereal.com>
9 * Copyright 1998 Gerald Combs
11 * This program is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public License
13 * as published by the Free Software Foundation; either version 2
14 * of the License, or (at your option) any later version.
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
31 #ifdef HAVE_SYS_TYPES_H
32 #include <sys/types.h>
38 #include <epan/packet.h>
39 #include "packet-dcerpc.h"
40 #include "packet-dcerpc-dce122.h"
43 static int proto_conv = -1;
44 static int hf_conv_opnum = -1;
45 static int hf_conv_rc = -1;
46 static int hf_conv_who_are_you_resp_seq = -1;
47 static int hf_conv_who_are_you_rqst_actuid = -1;
48 static int hf_conv_who_are_you_rqst_boot_time = -1;
49 static int hf_conv_who_are_you2_resp_seq = -1;
50 static int hf_conv_who_are_you2_resp_casuuid = -1;
51 static int hf_conv_who_are_you2_rqst_actuid = -1;
52 static int hf_conv_who_are_you2_rqst_boot_time = -1;
54 static gint ett_conv = -1;
57 static e_uuid_t uuid_conv = { 0x333a2276, 0x0000, 0x0000, { 0x0d, 0x00, 0x00, 0x80, 0x9c, 0x00, 0x00, 0x00 } };
58 static guint16 ver_conv = 3;
62 conv_dissect_who_are_you_rqst (tvbuff_t *tvb, int offset,
63 packet_info *pinfo, proto_tree *tree,
67 * [in] uuid_t *actuid,
68 * [in] unsigned32 boot_time,
72 offset = dissect_ndr_uuid_t (tvb, offset, pinfo, tree, drep, hf_conv_who_are_you_rqst_actuid, &actuid);
73 offset = dissect_ndr_time_t (tvb, offset, pinfo, tree, drep, hf_conv_who_are_you_rqst_boot_time, NULL);
75 if (check_col(pinfo->cinfo, COL_INFO)) {
76 col_add_fstr(pinfo->cinfo, COL_INFO,
77 "conv_who_are_you request actuid: %08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x",
78 actuid.Data1, actuid.Data2, actuid.Data3, actuid.Data4[0], actuid.Data4[1],
79 actuid.Data4[2], actuid.Data4[3], actuid.Data4[4], actuid.Data4[5], actuid.Data4[6], actuid.Data4[7]);
86 conv_dissect_who_are_you_resp (tvbuff_t *tvb, int offset,
87 packet_info *pinfo, proto_tree *tree,
91 * [out] unsigned32 *seq,
92 * [out] unsigned32 *st
96 offset = dissect_ndr_uint32 (tvb, offset, pinfo, tree, drep, hf_conv_who_are_you_resp_seq, &seq);
97 offset = dissect_ndr_uint32 (tvb, offset, pinfo, tree, drep, hf_conv_rc, &st);
100 if (check_col(pinfo->cinfo, COL_INFO)) {
101 col_add_fstr(pinfo->cinfo, COL_INFO, "conv_who_are_you reply seq:%u st:%s",
102 seq, val_to_str(st, dce_error_vals, "%u"));
111 conv_dissect_who_are_you2_rqst (tvbuff_t *tvb, int offset,
112 packet_info *pinfo, proto_tree *tree,
116 * [in] uuid_t *actuid,
117 * [in] unsigned32 boot_time,
121 offset = dissect_ndr_uuid_t (tvb, offset, pinfo, tree, drep, hf_conv_who_are_you2_rqst_actuid, &actuid);
122 offset = dissect_ndr_time_t (tvb, offset, pinfo, tree, drep, hf_conv_who_are_you2_rqst_boot_time, NULL);
124 if (check_col(pinfo->cinfo, COL_INFO)) {
125 col_add_fstr(pinfo->cinfo, COL_INFO,
126 "conv_who_are_you request actuid: %08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x",
127 actuid.Data1, actuid.Data2, actuid.Data3, actuid.Data4[0], actuid.Data4[1],
128 actuid.Data4[2], actuid.Data4[3], actuid.Data4[4], actuid.Data4[5], actuid.Data4[6], actuid.Data4[7]);
134 conv_dissect_who_are_you2_resp (tvbuff_t *tvb, int offset,
135 packet_info *pinfo, proto_tree *tree,
139 * [out] unsigned32 *seq,
140 * [out] uuid_t *cas_uuid,
142 * [out] unsigned32 *st
147 offset = dissect_ndr_uint32 (tvb, offset, pinfo, tree, drep, hf_conv_who_are_you2_resp_seq, &seq);
148 offset = dissect_ndr_uuid_t (tvb, offset, pinfo, tree, drep, hf_conv_who_are_you2_resp_casuuid, &cas_uuid);
149 offset = dissect_ndr_uint32 (tvb, offset, pinfo, tree, drep, hf_conv_rc, &st);
151 if (check_col(pinfo->cinfo, COL_INFO)) {
152 col_add_fstr(pinfo->cinfo, COL_INFO,
153 "conv_who_are_you2 reply seq:%u st:%s cas:%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x",
154 seq, val_to_str(st, dce_error_vals, "%u"),
155 cas_uuid.Data1, cas_uuid.Data2, cas_uuid.Data3, cas_uuid.Data4[0], cas_uuid.Data4[1],
156 cas_uuid.Data4[2], cas_uuid.Data4[3], cas_uuid.Data4[4], cas_uuid.Data4[5], cas_uuid.Data4[6], cas_uuid.Data4[7]);
163 static dcerpc_sub_dissector conv_dissectors[] = {
165 conv_dissect_who_are_you_rqst, conv_dissect_who_are_you_resp },
167 conv_dissect_who_are_you2_rqst, conv_dissect_who_are_you2_resp },
168 { 2, "are_you_there", NULL, NULL },
169 { 3, "who_are_you_auth", NULL, NULL },
170 { 4, "who_are_you_auth_more", NULL, NULL },
171 { 0, NULL, NULL, NULL }
174 static const value_string conv_opnum_vals[] = {
175 { 0, "who_are_you" },
176 { 1, "who_are_you2" },
177 { 2, "are_you_there" },
178 { 3, "who_are_you_auth" },
179 { 4, "who_are_you_auth_more" },
185 proto_register_conv (void)
187 static hf_register_info hf[] = {
189 { "Operation", "conv.opnum", FT_UINT16, BASE_DEC, VALS(conv_opnum_vals), 0x0, "Operation", HFILL }},
190 { &hf_conv_who_are_you_resp_seq,
191 {"hf_conv_who_are_you_resp_seq", "conv.who_are_you_resp_seq", FT_UINT32, BASE_DEC, NULL, 0x0, "", HFILL }},
193 {"Status", "conv.status", FT_UINT32, BASE_DEC, VALS(dce_error_vals), 0x0, "", HFILL }},
194 { &hf_conv_who_are_you_rqst_actuid,
195 {"hf_conv_who_are_you_rqst_actuid", "conv.who_are_you_rqst_actuid", FT_STRING, BASE_NONE, NULL, 0x0, "UUID", HFILL }},
196 { &hf_conv_who_are_you_rqst_boot_time,
197 {"hf_conv_who_are_you_rqst_boot_time", "conv.who_are_you_rqst_boot_time", FT_ABSOLUTE_TIME, BASE_NONE, NULL, 0x0, "", HFILL }},
198 { &hf_conv_who_are_you2_rqst_actuid,
199 {"hf_conv_who_are_you2_rqst_actuid", "conv.who_are_you2_rqst_actuid", FT_STRING, BASE_NONE, NULL, 0x0, "UUID", HFILL }},
200 { &hf_conv_who_are_you2_rqst_boot_time,
201 {"hf_conv_who_are_you2_rqst_boot_time", "conv.who_are_you2_rqst_boot_time", FT_ABSOLUTE_TIME, BASE_NONE, NULL, 0x0, "", HFILL }},
202 { &hf_conv_who_are_you2_resp_seq,
203 {"hf_conv_who_are_you2_resp_seq", "conv.who_are_you2_resp_seq", FT_UINT32, BASE_DEC, NULL, 0x0, "", HFILL }},
204 { &hf_conv_who_are_you2_resp_casuuid,
205 {"hf_conv_who_are_you2_resp_casuuid", "conv.who_are_you2_resp_casuuid", FT_STRING, BASE_NONE, NULL, 0x0, "UUID", HFILL }}
208 static gint *ett[] = {
211 proto_conv = proto_register_protocol ("DCE/RPC Conversation Manager", "CONV", "conv");
212 proto_register_field_array (proto_conv, hf, array_length (hf));
213 proto_register_subtree_array (ett, array_length (ett));
217 proto_reg_handoff_conv (void)
219 /* Register the protocol as dcerpc */
220 dcerpc_init_uuid (proto_conv, ett_conv, &uuid_conv, ver_conv, conv_dissectors, hf_conv_opnum);