2002-06-02 12:33:15 +00:00
|
|
|
/* packet-dcerpc-tapi.c
|
|
|
|
* Routines for DCERPC TAPI packet disassembly
|
|
|
|
* Copyright 2002, Ronnie Sahlberg
|
|
|
|
*
|
2004-07-18 00:24:25 +00:00
|
|
|
* $Id$
|
2002-06-02 12:33:15 +00:00
|
|
|
*
|
2006-05-21 04:49:01 +00:00
|
|
|
* Wireshark - Network traffic analyzer
|
|
|
|
* By Gerald Combs <gerald@wireshark.org>
|
2002-06-02 12:33:15 +00:00
|
|
|
* Copyright 1998 Gerald Combs
|
2002-08-28 21:04:11 +00:00
|
|
|
*
|
2002-06-02 12:33:15 +00:00
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
2002-08-28 21:04:11 +00:00
|
|
|
*
|
2002-06-02 12:33:15 +00:00
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
2002-08-28 21:04:11 +00:00
|
|
|
*
|
2002-06-02 12:33:15 +00:00
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
2002-08-28 21:04:11 +00:00
|
|
|
/* The IDL file for this interface can be extracted by grepping for idl
|
2002-06-02 12:33:15 +00:00
|
|
|
* in capitals.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
#include "config.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include <glib.h>
|
|
|
|
#include <epan/packet.h>
|
|
|
|
#include "packet-dcerpc.h"
|
|
|
|
#include "packet-dcerpc-nt.h"
|
|
|
|
#include "packet-dcerpc-tapi.h"
|
2004-08-03 02:28:49 +00:00
|
|
|
#include "packet-windows-common.h"
|
2002-06-02 12:33:15 +00:00
|
|
|
|
|
|
|
static int proto_dcerpc_tapi = -1;
|
2003-06-26 04:30:31 +00:00
|
|
|
static int hf_tapi_opnum = -1;
|
2002-06-02 12:33:15 +00:00
|
|
|
static int hf_tapi_rc = -1;
|
|
|
|
static int hf_tapi_hnd = -1;
|
|
|
|
static int hf_tapi_unknown_long = -1;
|
|
|
|
static int hf_tapi_unknown_string = -1;
|
|
|
|
static int hf_tapi_unknown_bytes = -1;
|
|
|
|
|
|
|
|
static gint ett_dcerpc_tapi = -1;
|
|
|
|
|
|
|
|
/*
|
|
|
|
IDL [ uuid(2f5f6520-ca46-1067-b319-00dd010662da),
|
|
|
|
IDL version(1.0),
|
|
|
|
IDL implicit_handle(handle_t rpc_binding)
|
|
|
|
IDL ] interface tapi
|
|
|
|
IDL {
|
|
|
|
*/
|
|
|
|
static e_uuid_t uuid_dcerpc_tapi = {
|
|
|
|
0x2f5f6520, 0xca46, 0x1067,
|
|
|
|
{ 0xb3, 0x19, 0x00, 0xdd, 0x01, 0x06, 0x62, 0xda }
|
|
|
|
};
|
|
|
|
|
|
|
|
static guint16 ver_dcerpc_tapi = 1;
|
|
|
|
|
|
|
|
/*
|
2003-10-22 01:55:04 +00:00
|
|
|
IDL long ClientAttach(
|
2002-06-02 12:33:15 +00:00
|
|
|
IDL [out] [context_handle] void *element_1,
|
|
|
|
IDL [in] long element_2,
|
|
|
|
IDL [out] long element_3,
|
|
|
|
IDL [in] [string] [ref] wchar_t *element_4,
|
|
|
|
IDL [in] [string] [ref] wchar_t *element_5
|
|
|
|
IDL );
|
|
|
|
*/
|
|
|
|
static int
|
2003-10-22 01:55:04 +00:00
|
|
|
dissect_tapi_client_attach_rqst(tvbuff_t *tvb, int offset,
|
2002-06-02 12:33:15 +00:00
|
|
|
packet_info *pinfo, proto_tree *tree,
|
2004-01-19 20:10:37 +00:00
|
|
|
guint8 *drep)
|
2002-06-02 12:33:15 +00:00
|
|
|
{
|
|
|
|
offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
|
|
|
|
hf_tapi_unknown_long, NULL);
|
|
|
|
|
2003-01-28 06:39:41 +00:00
|
|
|
offset = dissect_ndr_str_pointer_item(tvb, offset, pinfo, tree, drep,
|
2010-09-23 21:46:31 +00:00
|
|
|
NDR_POINTER_REF, "unknown string",
|
2003-01-30 08:19:39 +00:00
|
|
|
hf_tapi_unknown_string, 0);
|
2002-06-02 12:33:15 +00:00
|
|
|
|
2003-01-28 06:39:41 +00:00
|
|
|
offset = dissect_ndr_str_pointer_item(tvb, offset, pinfo, tree, drep,
|
2010-09-23 21:46:31 +00:00
|
|
|
NDR_POINTER_REF, "unknown string",
|
2003-01-30 08:19:39 +00:00
|
|
|
hf_tapi_unknown_string, 0);
|
2002-06-02 12:33:15 +00:00
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
static int
|
2003-10-22 01:55:04 +00:00
|
|
|
dissect_tapi_client_attach_reply(tvbuff_t *tvb, int offset,
|
2002-06-02 12:33:15 +00:00
|
|
|
packet_info *pinfo, proto_tree *tree,
|
2004-01-19 20:10:37 +00:00
|
|
|
guint8 *drep)
|
2002-06-02 12:33:15 +00:00
|
|
|
{
|
|
|
|
offset = dissect_ndr_ctx_hnd(tvb, offset, pinfo, tree, drep,
|
|
|
|
hf_tapi_hnd, NULL);
|
|
|
|
|
|
|
|
offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
|
|
|
|
hf_tapi_unknown_long, NULL);
|
|
|
|
|
|
|
|
offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
|
|
|
|
hf_tapi_rc, NULL);
|
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
2003-10-22 01:55:04 +00:00
|
|
|
IDL long ClientRequest(
|
2002-06-02 12:33:15 +00:00
|
|
|
IDL [in] [context_handle] void *element_6,
|
|
|
|
IDL [in,out] [size_is(element_8)] [length_is(???)] char element_7[*],
|
|
|
|
IDL [in] long element_8
|
|
|
|
IDL );
|
|
|
|
*/
|
|
|
|
static int
|
|
|
|
dissect_tapi_TYPE_1(tvbuff_t *tvb, int offset,
|
|
|
|
packet_info *pinfo, proto_tree *tree,
|
2004-01-19 20:10:37 +00:00
|
|
|
guint8 *drep)
|
2002-06-02 12:33:15 +00:00
|
|
|
{
|
|
|
|
dcerpc_info *di;
|
|
|
|
|
|
|
|
di=pinfo->private_data;
|
|
|
|
if(di->conformant_run){
|
2006-05-21 04:49:01 +00:00
|
|
|
/* this call is to make wireshark eat the array header for the conformant run */
|
2002-06-02 12:33:15 +00:00
|
|
|
offset =dissect_ndr_ucvarray(tvb, offset, pinfo, tree, drep, NULL);
|
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
proto_tree_add_item(tree, hf_tapi_unknown_bytes, tvb, offset,
|
|
|
|
di->array_actual_count, FALSE);
|
|
|
|
offset += di->array_actual_count;
|
|
|
|
|
|
|
|
return offset;
|
2002-08-28 21:04:11 +00:00
|
|
|
}
|
2002-06-02 12:33:15 +00:00
|
|
|
|
|
|
|
static int
|
2003-10-22 01:55:04 +00:00
|
|
|
dissect_tapi_client_request_rqst(tvbuff_t *tvb, int offset,
|
2002-06-02 12:33:15 +00:00
|
|
|
packet_info *pinfo, proto_tree *tree,
|
2004-01-19 20:10:37 +00:00
|
|
|
guint8 *drep)
|
2002-06-02 12:33:15 +00:00
|
|
|
{
|
|
|
|
offset = dissect_ndr_ctx_hnd(tvb, offset, pinfo, tree, drep,
|
|
|
|
hf_tapi_hnd, NULL);
|
|
|
|
|
|
|
|
offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
|
|
|
|
dissect_tapi_TYPE_1, NDR_POINTER_REF,
|
2003-01-28 06:39:41 +00:00
|
|
|
"unknown array", -1);
|
2002-06-02 12:33:15 +00:00
|
|
|
|
|
|
|
offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
|
|
|
|
hf_tapi_unknown_long, NULL);
|
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
static int
|
2003-10-22 01:55:04 +00:00
|
|
|
dissect_tapi_client_request_reply(tvbuff_t *tvb, int offset,
|
2002-06-02 12:33:15 +00:00
|
|
|
packet_info *pinfo, proto_tree *tree,
|
2004-01-19 20:10:37 +00:00
|
|
|
guint8 *drep)
|
2002-06-02 12:33:15 +00:00
|
|
|
{
|
|
|
|
offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
|
|
|
|
hf_tapi_rc, NULL);
|
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
2003-10-22 01:55:04 +00:00
|
|
|
IDL void ClientDetach(
|
2002-06-02 12:33:15 +00:00
|
|
|
IDL void
|
|
|
|
IDL );
|
|
|
|
*/
|
|
|
|
static int
|
2003-10-22 01:55:04 +00:00
|
|
|
dissect_tapi_client_detach_rqst(tvbuff_t *tvb _U_, int offset _U_,
|
2002-06-02 12:33:15 +00:00
|
|
|
packet_info *pinfo _U_, proto_tree *tree _U_,
|
2004-01-19 20:10:37 +00:00
|
|
|
guint8 *drep _U_)
|
2002-06-02 12:33:15 +00:00
|
|
|
{
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
static int
|
2003-10-22 01:55:04 +00:00
|
|
|
dissect_tapi_client_detach_reply(tvbuff_t *tvb _U_, int offset _U_,
|
2002-06-02 12:33:15 +00:00
|
|
|
packet_info *pinfo _U_, proto_tree *tree _U_,
|
2004-01-19 20:10:37 +00:00
|
|
|
guint8 *drep _U_)
|
2002-06-02 12:33:15 +00:00
|
|
|
{
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
IDL }
|
|
|
|
*/
|
|
|
|
static dcerpc_sub_dissector dcerpc_tapi_dissectors[] = {
|
2003-10-22 01:55:04 +00:00
|
|
|
{ TAPI_CLIENT_ATTACH, "ClientAttach",
|
|
|
|
dissect_tapi_client_attach_rqst,
|
|
|
|
dissect_tapi_client_attach_reply },
|
|
|
|
{ TAPI_CLIENT_REQUEST, "ClientRequest",
|
|
|
|
dissect_tapi_client_request_rqst,
|
|
|
|
dissect_tapi_client_request_reply },
|
|
|
|
{ TAPI_CLIENT_DETACH, "ClientDetach",
|
|
|
|
dissect_tapi_client_detach_rqst,
|
|
|
|
dissect_tapi_client_detach_reply },
|
2002-06-02 12:33:15 +00:00
|
|
|
|
|
|
|
{0, NULL, NULL, NULL }
|
|
|
|
};
|
|
|
|
|
2002-08-28 21:04:11 +00:00
|
|
|
void
|
2002-06-02 12:33:15 +00:00
|
|
|
proto_register_dcerpc_tapi(void)
|
|
|
|
{
|
|
|
|
static hf_register_info hf[] = {
|
2010-09-23 21:46:31 +00:00
|
|
|
{ &hf_tapi_opnum, {
|
2003-06-26 04:30:31 +00:00
|
|
|
"Operation", "tapi.opnum", FT_UINT16, BASE_DEC,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, 0x0, NULL, HFILL }},
|
2002-08-28 21:04:11 +00:00
|
|
|
{ &hf_tapi_rc, {
|
|
|
|
"Return code", "tapi.rc", FT_UINT32, BASE_HEX,
|
2002-06-02 12:33:15 +00:00
|
|
|
VALS(NT_errors), 0x0, "TAPI return code", HFILL }},
|
|
|
|
{ &hf_tapi_hnd, {
|
|
|
|
"Context Handle", "tapi.hnd", FT_BYTES, BASE_NONE,
|
2010-09-23 21:46:31 +00:00
|
|
|
NULL, 0x0, NULL, HFILL }},
|
2002-08-28 21:04:11 +00:00
|
|
|
{ &hf_tapi_unknown_long, {
|
|
|
|
"Unknown long", "tapi.unknown.long", FT_UINT32, BASE_HEX,
|
2006-05-21 04:49:01 +00:00
|
|
|
NULL, 0x0, "Unknown long. If you know what this is, contact wireshark developers.", HFILL }},
|
2002-08-28 21:04:11 +00:00
|
|
|
{ &hf_tapi_unknown_string, {
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
"Unknown string", "tapi.unknown.string", FT_STRING, BASE_NONE,
|
2006-05-21 04:49:01 +00:00
|
|
|
NULL, 0x0, "Unknown string. If you know what this is, contact wireshark developers.", HFILL }},
|
2002-08-28 21:04:11 +00:00
|
|
|
{ &hf_tapi_unknown_bytes, {
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
"Unknown bytes", "tapi.unknown.bytes", FT_BYTES, BASE_NONE,
|
2006-05-21 04:49:01 +00:00
|
|
|
NULL, 0x0, "Unknown bytes. If you know what this is, contact wireshark developers.", HFILL }}
|
2002-06-02 12:33:15 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
static gint *ett[] = {
|
|
|
|
&ett_dcerpc_tapi
|
|
|
|
};
|
|
|
|
|
|
|
|
proto_dcerpc_tapi = proto_register_protocol(
|
|
|
|
"Microsoft Telephony API Service", "TAPI", "tapi");
|
|
|
|
|
2002-08-28 21:04:11 +00:00
|
|
|
proto_register_field_array(proto_dcerpc_tapi, hf,
|
2002-06-02 12:33:15 +00:00
|
|
|
array_length(hf));
|
|
|
|
|
|
|
|
proto_register_subtree_array(ett, array_length(ett));
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
proto_reg_handoff_dcerpc_tapi(void)
|
|
|
|
{
|
|
|
|
/* Register protocol as dcerpc */
|
|
|
|
|
2002-08-28 21:04:11 +00:00
|
|
|
dcerpc_init_uuid(proto_dcerpc_tapi, ett_dcerpc_tapi,
|
|
|
|
&uuid_dcerpc_tapi, ver_dcerpc_tapi,
|
2003-06-26 04:30:31 +00:00
|
|
|
dcerpc_tapi_dissectors, hf_tapi_opnum);
|
2002-06-02 12:33:15 +00:00
|
|
|
}
|