1 /* packet-dcerpc-messenger.c
2 * Routines for SMB \PIPE\messenger packet disassembly
3 * Copyright 2003 Ronnie Sahlberg
5 * $Id: packet-dcerpc-messenger.c,v 1.3 2003/06/26 10:31:18 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.
32 #include "packet-dcerpc.h"
33 #include "packet-dcerpc-nt.h"
37 static int proto_dcerpc_messenger = -1;
38 static int hf_messenger_opnum = -1;
39 static int hf_messenger_rc = -1;
40 static int hf_messenger_server = -1;
41 static int hf_messenger_client = -1;
42 static int hf_messenger_message = -1;
44 static gint ett_dcerpc_messenger = -1;
46 static e_uuid_t uuid_dcerpc_messenger = {
47 0x5a7b91f8, 0xff00, 0x11d0,
48 { 0xa9, 0xb2, 0x00, 0xc0, 0x4f, 0xb6, 0xe6, 0xfc}
51 static guint16 ver_dcerpc_messenger = 1;
56 * IDL [in][string][ref] char *server;
57 * IDL [in][string][ref] char *client;
58 * IDL [in][string][ref] char *message;
61 messenger_dissect_send_message_rqst(tvbuff_t *tvb, int offset, packet_info *pinfo,
62 proto_tree *tree, char *drep)
64 offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
65 dissect_ndr_char_cvstring, NDR_POINTER_REF,
66 "Server", hf_messenger_server);
67 offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
68 dissect_ndr_char_cvstring, NDR_POINTER_REF,
69 "Client", hf_messenger_client);
70 offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
71 dissect_ndr_char_cvstring, NDR_POINTER_REF,
72 "Message", hf_messenger_message);
78 messenger_dissect_send_message_reply(tvbuff_t *tvb, int offset, packet_info *pinfo,
79 proto_tree *tree, char *drep)
81 offset = dissect_ntstatus(tvb, offset, pinfo, tree, drep,
82 hf_messenger_rc, NULL);
89 static dcerpc_sub_dissector dcerpc_messenger_dissectors[] = {
91 messenger_dissect_send_message_rqst,
92 messenger_dissect_send_message_reply },
93 {0, NULL, NULL, NULL }
97 proto_register_dcerpc_messenger(void)
99 static hf_register_info hf[] = {
101 { &hf_messenger_opnum,
102 { "Operation", "messenger.opnum", FT_UINT16, BASE_DEC,
103 NULL, 0x0, "Operation", HFILL }},
106 { "Return code", "messenger.rc", FT_UINT32, BASE_HEX, VALS (NT_errors), 0x0, "", HFILL }},
108 { &hf_messenger_server, {
109 "Server", "messenger.server",
110 FT_STRING, BASE_NONE, NULL, 0, "Server to send the message to", HFILL }},
112 { &hf_messenger_client, {
113 "Client", "messenger.client",
114 FT_STRING, BASE_NONE, NULL, 0, "Client that sent the message", HFILL }},
116 { &hf_messenger_message, {
117 "Message", "messenger.message",
118 FT_STRING, BASE_NONE, NULL, 0, "The message being sent", HFILL }}
122 static gint *ett[] = {
123 &ett_dcerpc_messenger
126 proto_dcerpc_messenger = proto_register_protocol(
127 "Microsoft Messenger Service", "Messenger", "messenger");
129 proto_register_field_array (proto_dcerpc_messenger, hf, array_length (hf));
130 proto_register_subtree_array(ett, array_length(ett));
135 proto_reg_handoff_dcerpc_messenger(void)
137 header_field_info *hf_info;
139 /* Register protocol as dcerpc */
141 dcerpc_init_uuid(proto_dcerpc_messenger, ett_dcerpc_messenger, &uuid_dcerpc_messenger,
142 ver_dcerpc_messenger, dcerpc_messenger_dissectors, hf_messenger_opnum);
144 /* Set opnum strings from subdissector list */
146 hf_info = proto_registrar_get_nth(hf_messenger_opnum);
147 hf_info->strings = value_string_from_subdissectors(
148 dcerpc_messenger_dissectors, array_length(dcerpc_messenger_dissectors));