1 /* packet-dcerpc-conv.c
2 * Routines for dcerpc conv dissection
3 * Copyright 2001, Todd Sabin <tas@webspan.net>
7 * Wireshark - Network traffic analyzer
8 * By Gerald Combs <gerald@wireshark.org>
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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
30 #include <epan/packet.h>
31 #include "packet-dcerpc.h"
32 #include "packet-dcerpc-dce122.h"
35 static int proto_conv
= -1;
36 static int hf_conv_opnum
= -1;
37 static int hf_conv_rc
= -1;
38 static int hf_conv_who_are_you_rqst_actuid
= -1;
39 static int hf_conv_who_are_you_rqst_boot_time
= -1;
40 static int hf_conv_who_are_you2_rqst_actuid
= -1;
41 static int hf_conv_who_are_you2_rqst_boot_time
= -1;
42 static int hf_conv_who_are_you_resp_seq
= -1;
43 static int hf_conv_who_are_you2_resp_seq
= -1;
44 static int hf_conv_who_are_you2_resp_casuuid
= -1;
46 static gint ett_conv
= -1;
49 static e_uuid_t uuid_conv
= { 0x333a2276, 0x0000, 0x0000, { 0x0d, 0x00, 0x00, 0x80, 0x9c, 0x00, 0x00, 0x00 } };
50 static guint16 ver_conv
= 3;
54 conv_dissect_who_are_you_rqst (tvbuff_t
*tvb
, int offset
,
55 packet_info
*pinfo
, proto_tree
*tree
,
56 dcerpc_info
*di
, guint8
*drep
)
59 * [in] uuid_t *actuid,
60 * [in] unsigned32 boot_time,
64 offset
= dissect_ndr_uuid_t(tvb
, offset
, pinfo
, tree
, di
, drep
, hf_conv_who_are_you_rqst_actuid
, &actuid
);
65 offset
= dissect_ndr_time_t(tvb
, offset
, pinfo
, tree
, di
, drep
, hf_conv_who_are_you_rqst_boot_time
, NULL
);
67 col_add_fstr(pinfo
->cinfo
, COL_INFO
,
68 "conv_who_are_you request actuid: %08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x",
69 actuid
.Data1
, actuid
.Data2
, actuid
.Data3
,
70 actuid
.Data4
[0], actuid
.Data4
[1], actuid
.Data4
[2], actuid
.Data4
[3],
71 actuid
.Data4
[4], actuid
.Data4
[5], actuid
.Data4
[6], actuid
.Data4
[7]);
77 conv_dissect_who_are_you_resp (tvbuff_t
*tvb
, int offset
,
78 packet_info
*pinfo
, proto_tree
*tree
,
79 dcerpc_info
*di
, guint8
*drep
)
82 * [out] unsigned32 *seq,
83 * [out] unsigned32 *st
87 offset
= dissect_ndr_uint32 (tvb
, offset
, pinfo
, tree
, di
, drep
, hf_conv_who_are_you_resp_seq
, &seq
);
88 offset
= dissect_ndr_uint32 (tvb
, offset
, pinfo
, tree
, di
, drep
, hf_conv_rc
, &st
);
91 col_add_fstr(pinfo
->cinfo
, COL_INFO
, "conv_who_are_you response seq:%u st:%s",
92 seq
, val_to_str_ext(st
, &dce_error_vals_ext
, "%u"));
100 conv_dissect_who_are_you2_rqst (tvbuff_t
*tvb
, int offset
,
101 packet_info
*pinfo
, proto_tree
*tree
,
102 dcerpc_info
*di
, guint8
*drep
)
105 * [in] uuid_t *actuid,
106 * [in] unsigned32 boot_time,
110 offset
= dissect_ndr_uuid_t(tvb
, offset
, pinfo
, tree
, di
, drep
, hf_conv_who_are_you2_rqst_actuid
, &actuid
);
111 offset
= dissect_ndr_time_t(tvb
, offset
, pinfo
, tree
, di
, drep
, hf_conv_who_are_you2_rqst_boot_time
, NULL
);
113 col_add_fstr(pinfo
->cinfo
, COL_INFO
,
114 "conv_who_are_you2 request actuid: %08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x",
115 actuid
.Data1
, actuid
.Data2
, actuid
.Data3
,
116 actuid
.Data4
[0], actuid
.Data4
[1], actuid
.Data4
[2], actuid
.Data4
[3],
117 actuid
.Data4
[4], actuid
.Data4
[5], actuid
.Data4
[6], actuid
.Data4
[7]);
122 conv_dissect_who_are_you2_resp (tvbuff_t
*tvb
, int offset
,
123 packet_info
*pinfo
, proto_tree
*tree
,
124 dcerpc_info
*di
, guint8
*drep
)
127 * [out] unsigned32 *seq,
128 * [out] uuid_t *cas_uuid,
130 * [out] unsigned32 *st
135 offset
= dissect_ndr_uint32 (tvb
, offset
, pinfo
, tree
, di
, drep
, hf_conv_who_are_you2_resp_seq
, &seq
);
136 offset
= dissect_ndr_uuid_t (tvb
, offset
, pinfo
, tree
, di
, drep
, hf_conv_who_are_you2_resp_casuuid
, &cas_uuid
);
137 offset
= dissect_ndr_uint32 (tvb
, offset
, pinfo
, tree
, di
, drep
, hf_conv_rc
, &st
);
139 col_add_fstr(pinfo
->cinfo
, COL_INFO
,
140 "conv_who_are_you2 response seq:%u st:%s cas:%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x",
141 seq
, val_to_str_ext(st
, &dce_error_vals_ext
, "%u"),
142 cas_uuid
.Data1
, cas_uuid
.Data2
, cas_uuid
.Data3
,
143 cas_uuid
.Data4
[0], cas_uuid
.Data4
[1], cas_uuid
.Data4
[2], cas_uuid
.Data4
[3],
144 cas_uuid
.Data4
[4], cas_uuid
.Data4
[5], cas_uuid
.Data4
[6], cas_uuid
.Data4
[7]);
150 static dcerpc_sub_dissector conv_dissectors
[] = {
152 conv_dissect_who_are_you_rqst
, conv_dissect_who_are_you_resp
},
154 conv_dissect_who_are_you2_rqst
, conv_dissect_who_are_you2_resp
},
155 { 2, "are_you_there",
157 { 3, "who_are_you_auth",
159 { 4, "who_are_you_auth_more",
161 { 0, NULL
, NULL
, NULL
}
165 proto_register_conv (void)
167 static hf_register_info hf
[] = {
169 { "Operation", "conv.opnum", FT_UINT16
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
171 {"Status", "conv.status", FT_UINT32
, BASE_DEC
|BASE_EXT_STRING
, &dce_error_vals_ext
, 0x0, NULL
, HFILL
}},
173 { &hf_conv_who_are_you_rqst_actuid
,
174 {"Activity UID", "conv.who_are_you_rqst_actuid", FT_GUID
, BASE_NONE
, NULL
, 0x0, "UUID", HFILL
}},
175 { &hf_conv_who_are_you_rqst_boot_time
,
176 {"Boot time", "conv.who_are_you_rqst_boot_time", FT_ABSOLUTE_TIME
, ABSOLUTE_TIME_LOCAL
, NULL
, 0x0, NULL
, HFILL
}},
177 { &hf_conv_who_are_you2_rqst_actuid
,
178 {"Activity UID", "conv.who_are_you2_rqst_actuid", FT_GUID
, BASE_NONE
, NULL
, 0x0, "UUID", HFILL
}},
179 { &hf_conv_who_are_you2_rqst_boot_time
,
180 {"Boot time", "conv.who_are_you2_rqst_boot_time", FT_ABSOLUTE_TIME
, ABSOLUTE_TIME_LOCAL
, NULL
, 0x0, NULL
, HFILL
}},
182 { &hf_conv_who_are_you_resp_seq
,
183 {"Sequence Number", "conv.who_are_you_resp_seq", FT_UINT32
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
184 { &hf_conv_who_are_you2_resp_seq
,
185 {"Sequence Number", "conv.who_are_you2_resp_seq", FT_UINT32
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
186 { &hf_conv_who_are_you2_resp_casuuid
,
187 {"Client's address space UUID", "conv.who_are_you2_resp_casuuid", FT_GUID
, BASE_NONE
, NULL
, 0x0, "UUID", HFILL
}}
190 static gint
*ett
[] = {
193 proto_conv
= proto_register_protocol ("DCE/RPC Conversation Manager", "CONV", "conv");
194 proto_register_field_array (proto_conv
, hf
, array_length (hf
));
195 proto_register_subtree_array (ett
, array_length (ett
));
199 proto_reg_handoff_conv (void)
201 /* Register the protocol as dcerpc */
202 dcerpc_init_uuid (proto_conv
, ett_conv
, &uuid_conv
, ver_conv
, conv_dissectors
, hf_conv_opnum
);