1 /* packet-dcerpc-tapi.c
2 * Routines for DCERPC TAPI packet disassembly
3 * Copyright 2002, Ronnie Sahlberg
5 * $Id: packet-dcerpc-tapi.c,v 1.8 2003/10/22 01:55:04 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.
25 /* The IDL file for this interface can be extracted by grepping for idl
34 #include <epan/packet.h>
35 #include "packet-dcerpc.h"
36 #include "packet-dcerpc-nt.h"
37 #include "packet-dcerpc-tapi.h"
40 static int proto_dcerpc_tapi = -1;
41 static int hf_tapi_opnum = -1;
42 static int hf_tapi_rc = -1;
43 static int hf_tapi_hnd = -1;
44 static int hf_tapi_unknown_long = -1;
45 static int hf_tapi_unknown_string = -1;
46 static int hf_tapi_unknown_bytes = -1;
48 static gint ett_dcerpc_tapi = -1;
51 IDL [ uuid(2f5f6520-ca46-1067-b319-00dd010662da),
53 IDL implicit_handle(handle_t rpc_binding)
57 static e_uuid_t uuid_dcerpc_tapi = {
58 0x2f5f6520, 0xca46, 0x1067,
59 { 0xb3, 0x19, 0x00, 0xdd, 0x01, 0x06, 0x62, 0xda }
62 static guint16 ver_dcerpc_tapi = 1;
65 IDL long ClientAttach(
66 IDL [out] [context_handle] void *element_1,
67 IDL [in] long element_2,
68 IDL [out] long element_3,
69 IDL [in] [string] [ref] wchar_t *element_4,
70 IDL [in] [string] [ref] wchar_t *element_5
74 dissect_tapi_client_attach_rqst(tvbuff_t *tvb, int offset,
75 packet_info *pinfo, proto_tree *tree,
78 offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
79 hf_tapi_unknown_long, NULL);
81 offset = dissect_ndr_str_pointer_item(tvb, offset, pinfo, tree, drep,
82 NDR_POINTER_REF, "unknown string",
83 hf_tapi_unknown_string, 0);
85 offset = dissect_ndr_str_pointer_item(tvb, offset, pinfo, tree, drep,
86 NDR_POINTER_REF, "unknown string",
87 hf_tapi_unknown_string, 0);
92 dissect_tapi_client_attach_reply(tvbuff_t *tvb, int offset,
93 packet_info *pinfo, proto_tree *tree,
96 offset = dissect_ndr_ctx_hnd(tvb, offset, pinfo, tree, drep,
99 offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
100 hf_tapi_unknown_long, NULL);
102 offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
109 IDL long ClientRequest(
110 IDL [in] [context_handle] void *element_6,
111 IDL [in,out] [size_is(element_8)] [length_is(???)] char element_7[*],
112 IDL [in] long element_8
116 dissect_tapi_TYPE_1(tvbuff_t *tvb, int offset,
117 packet_info *pinfo, proto_tree *tree,
122 di=pinfo->private_data;
123 if(di->conformant_run){
124 /* this call is to make ethereal eat the array header for the conformant run */
125 offset =dissect_ndr_ucvarray(tvb, offset, pinfo, tree, drep, NULL);
130 proto_tree_add_item(tree, hf_tapi_unknown_bytes, tvb, offset,
131 di->array_actual_count, FALSE);
132 offset += di->array_actual_count;
138 dissect_tapi_client_request_rqst(tvbuff_t *tvb, int offset,
139 packet_info *pinfo, proto_tree *tree,
142 offset = dissect_ndr_ctx_hnd(tvb, offset, pinfo, tree, drep,
145 offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
146 dissect_tapi_TYPE_1, NDR_POINTER_REF,
147 "unknown array", -1);
149 offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
150 hf_tapi_unknown_long, NULL);
155 dissect_tapi_client_request_reply(tvbuff_t *tvb, int offset,
156 packet_info *pinfo, proto_tree *tree,
159 offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
167 IDL void ClientDetach(
172 dissect_tapi_client_detach_rqst(tvbuff_t *tvb _U_, int offset _U_,
173 packet_info *pinfo _U_, proto_tree *tree _U_,
179 dissect_tapi_client_detach_reply(tvbuff_t *tvb _U_, int offset _U_,
180 packet_info *pinfo _U_, proto_tree *tree _U_,
189 static dcerpc_sub_dissector dcerpc_tapi_dissectors[] = {
190 { TAPI_CLIENT_ATTACH, "ClientAttach",
191 dissect_tapi_client_attach_rqst,
192 dissect_tapi_client_attach_reply },
193 { TAPI_CLIENT_REQUEST, "ClientRequest",
194 dissect_tapi_client_request_rqst,
195 dissect_tapi_client_request_reply },
196 { TAPI_CLIENT_DETACH, "ClientDetach",
197 dissect_tapi_client_detach_rqst,
198 dissect_tapi_client_detach_reply },
200 {0, NULL, NULL, NULL }
204 proto_register_dcerpc_tapi(void)
206 static hf_register_info hf[] = {
208 "Operation", "tapi.opnum", FT_UINT16, BASE_DEC,
209 NULL, 0x0, "", HFILL }},
211 "Return code", "tapi.rc", FT_UINT32, BASE_HEX,
212 VALS(NT_errors), 0x0, "TAPI return code", HFILL }},
214 "Context Handle", "tapi.hnd", FT_BYTES, BASE_NONE,
215 NULL, 0x0, "Context handle", HFILL }},
216 { &hf_tapi_unknown_long, {
217 "Unknown long", "tapi.unknown.long", FT_UINT32, BASE_HEX,
218 NULL, 0x0, "Unknown long. If you know what this is, contact ethereal developers.", HFILL }},
219 { &hf_tapi_unknown_string, {
220 "Unknown string", "tapi.unknown.string", FT_STRING, BASE_HEX,
221 NULL, 0x0, "Unknown string. If you know what this is, contact ethereal developers.", HFILL }},
222 { &hf_tapi_unknown_bytes, {
223 "Unknown bytes", "tapi.unknown.bytes", FT_BYTES, BASE_HEX,
224 NULL, 0x0, "Unknown bytes. If you know what this is, contact ethereal developers.", HFILL }}
227 static gint *ett[] = {
231 proto_dcerpc_tapi = proto_register_protocol(
232 "Microsoft Telephony API Service", "TAPI", "tapi");
234 proto_register_field_array(proto_dcerpc_tapi, hf,
237 proto_register_subtree_array(ett, array_length(ett));
241 proto_reg_handoff_dcerpc_tapi(void)
243 /* Register protocol as dcerpc */
245 dcerpc_init_uuid(proto_dcerpc_tapi, ett_dcerpc_tapi,
246 &uuid_dcerpc_tapi, ver_dcerpc_tapi,
247 dcerpc_tapi_dissectors, hf_tapi_opnum);