2001-05-24 20:25:25 +00:00
|
|
|
/* packet-dsi.c
|
|
|
|
* Routines for dsi packet dissection
|
|
|
|
* Copyright 2001, Randy McEoin <rmceoin@pe.com>
|
|
|
|
*
|
2004-07-18 00:24:25 +00:00
|
|
|
* $Id$
|
2001-05-24 20:25:25 +00:00
|
|
|
*
|
2006-05-21 04:49:01 +00:00
|
|
|
* Wireshark - Network traffic analyzer
|
|
|
|
* By Gerald Combs <gerald@wireshark.org>
|
2001-05-24 20:25:25 +00:00
|
|
|
* Copyright 1998 Gerald Combs
|
|
|
|
*
|
|
|
|
* Copied from packet-pop.c
|
|
|
|
*
|
|
|
|
* 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
|
|
|
*
|
2001-05-24 20:25:25 +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
|
|
|
*
|
2001-05-24 20:25:25 +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.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
# include "config.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include <glib.h>
|
2002-01-21 07:37:49 +00:00
|
|
|
#include <epan/packet.h>
|
2002-04-22 08:50:49 +00:00
|
|
|
|
2004-09-27 22:55:15 +00:00
|
|
|
#include <epan/prefs.h>
|
Make a "tcp_dissect_pdus()" with the standard loop for a TCP segment,
extracting PDUs from it and possibly doing reassembly. Make the COPS,
DNS, DSI, Gryphon, and SCCP dissectors use it.
Add "set_actual_length()", "tcp_dissect_pdus()",
"decode_boolean_bitfield()", "decode_numeric_bitfield()", and
"decode_enumerated_bitfield()" to the list of routines available to
dissectors on platforms where routines in the main program aren't
available to dynamically-loaded code.
Declare routines in "to_str.h" as "extern"; as I remember, that's
necessary to allow the "decode_XXX_bitfield()" routines declared therein
to be made available to plugins as per the above.
Note that new exported routines should be added to the end of the table
if that's the only change being made to the table.
Create a new "plugin_api_decls.h" header file, used to declare both the
"p_" variables and the "p_" structure members in the routine-exporting
mechanism; this reduces the number of places you have to change to
change the list of exported routines.
svn path=/trunk/; revision=5394
2002-05-05 00:16:38 +00:00
|
|
|
#include "packet-tcp.h"
|
2002-04-25 23:58:02 +00:00
|
|
|
#include "packet-afp.h"
|
|
|
|
|
2001-05-24 20:25:25 +00:00
|
|
|
/* The information in this module (DSI) comes from:
|
|
|
|
|
2008-03-14 03:28:12 +00:00
|
|
|
AFP 2.1 & 2.2 documentation, in PDF form, at
|
|
|
|
|
|
|
|
http://developer.apple.com/DOCUMENTATION/macos8/pdf/ASAppleTalkFiling2.1_2.2.pdf
|
2001-05-24 20:25:25 +00:00
|
|
|
|
|
|
|
The netatalk source code by Wesley Craig & Adrian Sun
|
|
|
|
|
2005-03-31 22:04:59 +00:00
|
|
|
The Data Stream Interface description from
|
|
|
|
http://developer.apple.com/documentation/Networking/Conceptual/AFPClient/AFPClient-6.html
|
|
|
|
|
2008-03-14 03:28:12 +00:00
|
|
|
(no longer available, apparently)
|
2009-09-10 06:07:31 +00:00
|
|
|
|
|
|
|
Also, AFP 3.3 documents parts of DSI at:
|
|
|
|
http://developer.apple.com/mac/library/documentation/Networking/Conceptual/AFP/Introduction/Introduction.html
|
2008-03-14 03:28:12 +00:00
|
|
|
|
2001-05-24 20:25:25 +00:00
|
|
|
* What a Data Stream Interface packet looks like:
|
|
|
|
* 0 32
|
|
|
|
* |-------------------------------|
|
|
|
|
* |flags |command| requestID |
|
|
|
|
* |-------------------------------|
|
|
|
|
* |error code/enclosed data offset|
|
|
|
|
* |-------------------------------|
|
|
|
|
* |total data length |
|
|
|
|
* |-------------------------------|
|
|
|
|
* |reserved field |
|
|
|
|
* |-------------------------------|
|
2002-04-22 08:50:49 +00:00
|
|
|
*/
|
2005-06-19 00:08:30 +00:00
|
|
|
#define INET6_ADDRLEN 16
|
2001-05-24 20:25:25 +00:00
|
|
|
|
|
|
|
static int proto_dsi = -1;
|
|
|
|
static int hf_dsi_flags = -1;
|
|
|
|
static int hf_dsi_command = -1;
|
|
|
|
static int hf_dsi_requestid = -1;
|
2002-04-28 22:10:00 +00:00
|
|
|
static int hf_dsi_offset = -1;
|
2002-04-28 19:21:39 +00:00
|
|
|
static int hf_dsi_error = -1;
|
2001-05-24 20:25:25 +00:00
|
|
|
static int hf_dsi_length = -1;
|
|
|
|
static int hf_dsi_reserved = -1;
|
|
|
|
|
|
|
|
static gint ett_dsi = -1;
|
|
|
|
|
2002-05-08 23:46:34 +00:00
|
|
|
static int hf_dsi_open_type = -1;
|
|
|
|
static int hf_dsi_open_len = -1;
|
|
|
|
static int hf_dsi_open_quantum = -1;
|
2009-09-10 06:07:31 +00:00
|
|
|
static int hf_dsi_replay_cache_size = -1;
|
2002-05-08 23:46:34 +00:00
|
|
|
static int hf_dsi_open_option = -1;
|
|
|
|
|
|
|
|
static int hf_dsi_attn_flag = -1;
|
|
|
|
static int hf_dsi_attn_flag_shutdown = -1;
|
|
|
|
static int hf_dsi_attn_flag_crash = -1;
|
|
|
|
static int hf_dsi_attn_flag_msg = -1;
|
|
|
|
static int hf_dsi_attn_flag_reconnect = -1;
|
|
|
|
static int hf_dsi_attn_flag_time = -1;
|
|
|
|
static int hf_dsi_attn_flag_bitmap = -1;
|
|
|
|
|
|
|
|
static gint ett_dsi_open = -1;
|
|
|
|
static gint ett_dsi_attn = -1;
|
|
|
|
static gint ett_dsi_attn_flag = -1;
|
|
|
|
|
2002-05-10 23:20:38 +00:00
|
|
|
static const value_string dsi_attn_flag_vals[] = {
|
2002-05-08 23:46:34 +00:00
|
|
|
{0x0, "Reserved" }, /* 0000 */
|
|
|
|
{0x1, "Reserved" }, /* 0001 */
|
|
|
|
{0x2, "Server message" }, /* 0010 */
|
|
|
|
{0x3, "Server notification, cf. extended bitmap" }, /* 0011 */
|
|
|
|
{0x4, "Server is shutting down, internal error" }, /* 0100 */
|
|
|
|
{0x8, "Server is shutting down" }, /* 1000 */
|
|
|
|
{0x9, "Server disconnects user" }, /* 1001 */
|
|
|
|
{0x10,"Server is shutting down, message" }, /* 1010 */
|
|
|
|
{0x11,"Server is shutting down, message,no reconnect"}, /* 1011 */
|
|
|
|
{0, NULL } };
|
|
|
|
|
2002-05-10 23:20:38 +00:00
|
|
|
static const value_string dsi_open_type_vals[] = {
|
2002-05-08 23:46:34 +00:00
|
|
|
{0, "Server quantum" },
|
|
|
|
{1, "Attention quantum" },
|
2009-09-10 06:07:31 +00:00
|
|
|
{2, "Replay cache size" },
|
2002-05-08 23:46:34 +00:00
|
|
|
{0, NULL } };
|
|
|
|
|
2002-04-30 22:05:33 +00:00
|
|
|
/* status stuff same for asp and afp */
|
|
|
|
static int hf_dsi_server_name = -1;
|
2003-04-15 05:45:02 +00:00
|
|
|
static int hf_dsi_utf8_server_name_len = -1;
|
|
|
|
static int hf_dsi_utf8_server_name = -1;
|
2002-04-30 22:05:33 +00:00
|
|
|
static int hf_dsi_server_type = -1;
|
|
|
|
static int hf_dsi_server_vers = -1;
|
|
|
|
static int hf_dsi_server_uams = -1;
|
|
|
|
static int hf_dsi_server_icon = -1;
|
2002-05-03 21:25:43 +00:00
|
|
|
static int hf_dsi_server_directory = -1;
|
2002-04-30 22:05:33 +00:00
|
|
|
|
|
|
|
static int hf_dsi_server_flag = -1;
|
|
|
|
static int hf_dsi_server_flag_copyfile = -1;
|
|
|
|
static int hf_dsi_server_flag_passwd = -1;
|
|
|
|
static int hf_dsi_server_flag_no_save_passwd = -1;
|
|
|
|
static int hf_dsi_server_flag_srv_msg = -1;
|
|
|
|
static int hf_dsi_server_flag_srv_sig = -1;
|
|
|
|
static int hf_dsi_server_flag_tcpip = -1;
|
|
|
|
static int hf_dsi_server_flag_notify = -1;
|
2002-05-03 21:25:43 +00:00
|
|
|
static int hf_dsi_server_flag_reconnect = -1;
|
|
|
|
static int hf_dsi_server_flag_directory = -1;
|
2002-10-17 22:38:19 +00:00
|
|
|
static int hf_dsi_server_flag_utf8_name = -1;
|
2005-06-19 00:08:30 +00:00
|
|
|
static int hf_dsi_server_flag_uuid = -1;
|
2009-09-10 06:07:31 +00:00
|
|
|
static int hf_dsi_server_flag_ext_sleep = -1;
|
2002-04-30 22:05:33 +00:00
|
|
|
static int hf_dsi_server_flag_fast_copy = -1;
|
|
|
|
static int hf_dsi_server_signature = -1;
|
|
|
|
|
|
|
|
static int hf_dsi_server_addr_len = -1;
|
|
|
|
static int hf_dsi_server_addr_type = -1;
|
|
|
|
static int hf_dsi_server_addr_value = -1;
|
|
|
|
|
|
|
|
static gint ett_dsi_status = -1;
|
|
|
|
static gint ett_dsi_uams = -1;
|
|
|
|
static gint ett_dsi_vers = -1;
|
|
|
|
static gint ett_dsi_addr = -1;
|
2002-05-08 23:46:34 +00:00
|
|
|
static gint ett_dsi_addr_line = -1;
|
2002-05-03 21:25:43 +00:00
|
|
|
static gint ett_dsi_directory = -1;
|
2003-04-15 05:45:02 +00:00
|
|
|
static gint ett_dsi_utf8_name = -1;
|
2002-04-30 22:05:33 +00:00
|
|
|
static gint ett_dsi_status_server_flag = -1;
|
|
|
|
|
|
|
|
const value_string afp_server_addr_type_vals[] = {
|
|
|
|
{1, "IP address" },
|
|
|
|
{2, "IP+port address" },
|
|
|
|
{3, "DDP address" },
|
|
|
|
{4, "DNS name" },
|
2002-10-17 22:38:19 +00:00
|
|
|
{5, "IP+port ssh tunnel" },
|
2005-06-19 00:08:30 +00:00
|
|
|
{6, "IP6 address" },
|
|
|
|
{7, "IP6+port address" },
|
2002-04-30 22:05:33 +00:00
|
|
|
{0, NULL } };
|
|
|
|
|
|
|
|
/* end status stuff */
|
|
|
|
|
2002-04-22 08:50:49 +00:00
|
|
|
/* desegmentation of DSI */
|
|
|
|
static gboolean dsi_desegment = TRUE;
|
|
|
|
|
2001-11-26 04:52:51 +00:00
|
|
|
static dissector_handle_t data_handle;
|
2002-04-25 23:58:02 +00:00
|
|
|
static dissector_handle_t afp_handle;
|
2001-11-26 04:52:51 +00:00
|
|
|
|
2001-05-24 20:25:25 +00:00
|
|
|
#define TCP_PORT_DSI 548
|
|
|
|
|
2002-04-25 23:58:02 +00:00
|
|
|
#define DSI_BLOCKSIZ 16
|
|
|
|
|
2001-05-24 20:25:25 +00:00
|
|
|
/* DSI flags */
|
|
|
|
#define DSIFL_REQUEST 0x00
|
|
|
|
#define DSIFL_REPLY 0x01
|
|
|
|
#define DSIFL_MAX 0x01
|
|
|
|
|
|
|
|
/* DSI Commands */
|
|
|
|
#define DSIFUNC_CLOSE 1 /* DSICloseSession */
|
|
|
|
#define DSIFUNC_CMD 2 /* DSICommand */
|
|
|
|
#define DSIFUNC_STAT 3 /* DSIGetStatus */
|
|
|
|
#define DSIFUNC_OPEN 4 /* DSIOpenSession */
|
|
|
|
#define DSIFUNC_TICKLE 5 /* DSITickle */
|
|
|
|
#define DSIFUNC_WRITE 6 /* DSIWrite */
|
|
|
|
#define DSIFUNC_ATTN 8 /* DSIAttention */
|
|
|
|
#define DSIFUNC_MAX 8 /* largest command */
|
|
|
|
|
|
|
|
static const value_string flag_vals[] = {
|
|
|
|
{DSIFL_REQUEST, "Request" },
|
|
|
|
{DSIFL_REPLY, "Reply" },
|
|
|
|
{0, NULL } };
|
|
|
|
|
|
|
|
static const value_string func_vals[] = {
|
|
|
|
{DSIFUNC_CLOSE, "CloseSession" },
|
|
|
|
{DSIFUNC_CMD, "Command" },
|
|
|
|
{DSIFUNC_STAT, "GetStatus" },
|
|
|
|
{DSIFUNC_OPEN, "OpenSession" },
|
|
|
|
{DSIFUNC_TICKLE, "Tickle" },
|
|
|
|
{DSIFUNC_WRITE, "Write" },
|
|
|
|
{DSIFUNC_ATTN, "Attention" },
|
|
|
|
{0, NULL } };
|
|
|
|
|
2002-08-28 21:04:11 +00:00
|
|
|
static gint
|
2009-09-10 06:07:31 +00:00
|
|
|
dissect_dsi_open_session(tvbuff_t *tvb, proto_tree *dsi_tree, gint offset, gint dsi_length)
|
2002-05-08 23:46:34 +00:00
|
|
|
{
|
|
|
|
proto_tree *tree;
|
|
|
|
proto_item *ti;
|
|
|
|
guint8 type;
|
|
|
|
guint8 len;
|
|
|
|
|
|
|
|
ti = proto_tree_add_text(dsi_tree, tvb, offset, -1, "Open Session");
|
|
|
|
tree = proto_item_add_subtree(ti, ett_dsi_open);
|
2009-09-10 06:07:31 +00:00
|
|
|
|
|
|
|
while( dsi_length >2 ) {
|
|
|
|
|
|
|
|
type = tvb_get_guint8(tvb, offset);
|
|
|
|
proto_tree_add_item(tree, hf_dsi_open_type, tvb, offset, 1, FALSE);
|
|
|
|
offset++;
|
|
|
|
len = tvb_get_guint8(tvb, offset);
|
|
|
|
proto_tree_add_item(tree, hf_dsi_open_len, tvb, offset, 1, FALSE);
|
|
|
|
offset++;
|
|
|
|
switch (type) {
|
|
|
|
case 0:
|
|
|
|
proto_tree_add_item(tree, hf_dsi_open_quantum, tvb, offset, 4, FALSE);
|
|
|
|
break;
|
|
|
|
case 1:
|
|
|
|
proto_tree_add_item(tree, hf_dsi_open_quantum, tvb, offset, 4, FALSE);
|
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
proto_tree_add_item(tree, hf_dsi_replay_cache_size, tvb, offset, 4, FALSE);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
proto_tree_add_item(tree, hf_dsi_open_option, tvb, offset, len, FALSE);
|
|
|
|
}
|
|
|
|
|
|
|
|
dsi_length -= len + 2;
|
|
|
|
|
|
|
|
offset += len;
|
2002-05-08 23:46:34 +00:00
|
|
|
}
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
2002-08-28 21:04:11 +00:00
|
|
|
static gint
|
2002-05-08 23:46:34 +00:00
|
|
|
dissect_dsi_attention(tvbuff_t *tvb, proto_tree *dsi_tree, gint offset)
|
|
|
|
{
|
|
|
|
proto_tree *tree;
|
|
|
|
proto_item *ti;
|
|
|
|
guint16 flag;
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2002-05-08 23:46:34 +00:00
|
|
|
if (!tvb_reported_length_remaining(tvb,offset))
|
|
|
|
return offset;
|
|
|
|
|
|
|
|
flag = tvb_get_ntohs(tvb, offset);
|
|
|
|
ti = proto_tree_add_text(dsi_tree, tvb, offset, -1, "Attention");
|
|
|
|
tree = proto_item_add_subtree(ti, ett_dsi_attn);
|
|
|
|
|
|
|
|
ti = proto_tree_add_item(tree, hf_dsi_attn_flag, tvb, offset, 2, FALSE);
|
|
|
|
tree = proto_item_add_subtree(ti, ett_dsi_attn_flag);
|
|
|
|
proto_tree_add_item(tree, hf_dsi_attn_flag_shutdown, tvb, offset, 2, FALSE);
|
|
|
|
proto_tree_add_item(tree, hf_dsi_attn_flag_crash, tvb, offset, 2, FALSE);
|
|
|
|
proto_tree_add_item(tree, hf_dsi_attn_flag_msg, tvb, offset, 2, FALSE);
|
|
|
|
proto_tree_add_item(tree, hf_dsi_attn_flag_reconnect, tvb, offset, 2, FALSE);
|
|
|
|
/* FIXME */
|
2002-08-28 21:04:11 +00:00
|
|
|
if ((flag & 0xf000) != 0x3000)
|
2002-05-08 23:46:34 +00:00
|
|
|
proto_tree_add_item(tree, hf_dsi_attn_flag_time, tvb, offset, 2, FALSE);
|
|
|
|
else
|
|
|
|
proto_tree_add_item(tree, hf_dsi_attn_flag_bitmap, tvb, offset, 2, FALSE);
|
|
|
|
offset += 2;
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
2002-08-28 21:04:11 +00:00
|
|
|
/* -----------------------------
|
2002-04-30 22:05:33 +00:00
|
|
|
from netatalk/etc/afpd/status.c
|
|
|
|
*/
|
2002-08-28 21:04:11 +00:00
|
|
|
static gint
|
2002-05-01 07:07:09 +00:00
|
|
|
dissect_dsi_reply_get_status(tvbuff_t *tvb, proto_tree *tree, gint offset)
|
2002-04-30 22:05:33 +00:00
|
|
|
{
|
|
|
|
proto_tree *sub_tree;
|
|
|
|
proto_item *ti;
|
|
|
|
|
|
|
|
guint16 ofs;
|
|
|
|
guint16 flag;
|
|
|
|
guint16 sign_ofs = 0;
|
|
|
|
guint16 adr_ofs = 0;
|
2002-05-03 21:25:43 +00:00
|
|
|
guint16 dir_ofs = 0;
|
2003-04-15 05:45:02 +00:00
|
|
|
guint16 utf_ofs = 0;
|
2002-04-30 22:05:33 +00:00
|
|
|
guint8 nbe;
|
|
|
|
guint8 len;
|
|
|
|
guint8 i;
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2002-05-03 21:25:43 +00:00
|
|
|
if (!tree)
|
|
|
|
return offset;
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2002-04-30 22:05:33 +00:00
|
|
|
ti = proto_tree_add_text(tree, tvb, offset, -1, "Get Status");
|
|
|
|
tree = proto_item_add_subtree(ti, ett_dsi_status);
|
|
|
|
|
|
|
|
ofs = tvb_get_ntohs(tvb, offset +AFPSTATUS_MACHOFF);
|
|
|
|
proto_tree_add_text(tree, tvb, offset +AFPSTATUS_MACHOFF, 2, "Machine offset: %d", ofs);
|
|
|
|
|
|
|
|
ofs = tvb_get_ntohs(tvb, offset +AFPSTATUS_VERSOFF);
|
|
|
|
proto_tree_add_text(tree, tvb, offset +AFPSTATUS_VERSOFF, 2, "Version offset: %d", ofs);
|
|
|
|
|
|
|
|
ofs = tvb_get_ntohs(tvb, offset +AFPSTATUS_UAMSOFF);
|
|
|
|
proto_tree_add_text(tree, tvb, offset +AFPSTATUS_UAMSOFF, 2, "UAMS offset: %d", ofs);
|
|
|
|
|
|
|
|
ofs = tvb_get_ntohs(tvb, offset +AFPSTATUS_ICONOFF);
|
|
|
|
proto_tree_add_text(tree, tvb, offset +AFPSTATUS_ICONOFF, 2, "Icon offset: %d", ofs);
|
|
|
|
|
|
|
|
ofs = offset +AFPSTATUS_FLAGOFF;
|
|
|
|
ti = proto_tree_add_item(tree, hf_dsi_server_flag, tvb, ofs, 2, FALSE);
|
|
|
|
sub_tree = proto_item_add_subtree(ti, ett_dsi_status_server_flag);
|
|
|
|
proto_tree_add_item(sub_tree, hf_dsi_server_flag_copyfile , tvb, ofs, 2, FALSE);
|
|
|
|
proto_tree_add_item(sub_tree, hf_dsi_server_flag_passwd , tvb, ofs, 2, FALSE);
|
|
|
|
proto_tree_add_item(sub_tree, hf_dsi_server_flag_no_save_passwd, tvb, ofs, 2, FALSE);
|
|
|
|
proto_tree_add_item(sub_tree, hf_dsi_server_flag_srv_msg , tvb, ofs, 2, FALSE);
|
|
|
|
proto_tree_add_item(sub_tree, hf_dsi_server_flag_srv_sig , tvb, ofs, 2, FALSE);
|
|
|
|
proto_tree_add_item(sub_tree, hf_dsi_server_flag_tcpip , tvb, ofs, 2, FALSE);
|
|
|
|
proto_tree_add_item(sub_tree, hf_dsi_server_flag_notify , tvb, ofs, 2, FALSE);
|
2002-05-03 21:25:43 +00:00
|
|
|
proto_tree_add_item(sub_tree, hf_dsi_server_flag_reconnect , tvb, ofs, 2, FALSE);
|
|
|
|
proto_tree_add_item(sub_tree, hf_dsi_server_flag_directory , tvb, ofs, 2, FALSE);
|
2002-10-17 22:38:19 +00:00
|
|
|
proto_tree_add_item(sub_tree, hf_dsi_server_flag_utf8_name , tvb, ofs, 2, FALSE);
|
2005-06-19 00:08:30 +00:00
|
|
|
proto_tree_add_item(sub_tree, hf_dsi_server_flag_uuid , tvb, ofs, 2, FALSE);
|
2009-09-10 06:07:31 +00:00
|
|
|
proto_tree_add_item(sub_tree, hf_dsi_server_flag_ext_sleep , tvb, ofs, 2, FALSE);
|
2002-04-30 22:05:33 +00:00
|
|
|
proto_tree_add_item(sub_tree, hf_dsi_server_flag_fast_copy , tvb, ofs, 2, FALSE);
|
|
|
|
|
|
|
|
proto_tree_add_item(tree, hf_dsi_server_name, tvb, offset +AFPSTATUS_PRELEN, 1, FALSE);
|
|
|
|
|
|
|
|
flag = tvb_get_ntohs(tvb, ofs);
|
|
|
|
if ((flag & AFPSRVRINFO_SRVSIGNATURE)) {
|
2002-10-17 22:38:19 +00:00
|
|
|
ofs = offset +AFPSTATUS_PRELEN +tvb_get_guint8(tvb, offset +AFPSTATUS_PRELEN) +1;
|
2002-04-30 22:05:33 +00:00
|
|
|
if ((ofs & 1))
|
|
|
|
ofs++;
|
|
|
|
|
|
|
|
sign_ofs = tvb_get_ntohs(tvb, ofs);
|
|
|
|
proto_tree_add_text(tree, tvb, ofs, 2, "Signature offset: %d", sign_ofs);
|
|
|
|
sign_ofs += offset;
|
|
|
|
|
|
|
|
if ((flag & AFPSRVRINFO_TCPIP)) {
|
|
|
|
ofs += 2;
|
|
|
|
adr_ofs = tvb_get_ntohs(tvb, ofs);
|
|
|
|
proto_tree_add_text(tree, tvb, ofs, 2, "Network address offset: %d", adr_ofs);
|
|
|
|
adr_ofs += offset;
|
|
|
|
}
|
2002-05-03 21:25:43 +00:00
|
|
|
|
|
|
|
if ((flag & AFPSRVRINFO_SRVDIRECTORY)) {
|
|
|
|
ofs += 2;
|
|
|
|
dir_ofs = tvb_get_ntohs(tvb, ofs);
|
|
|
|
proto_tree_add_text(tree, tvb, ofs, 2, "Directory services offset: %d", dir_ofs);
|
|
|
|
dir_ofs += offset;
|
|
|
|
}
|
2003-04-15 05:45:02 +00:00
|
|
|
if ((flag & AFPSRVRINFO_SRVUTF8)) {
|
|
|
|
ofs += 2;
|
|
|
|
utf_ofs = tvb_get_ntohs(tvb, ofs);
|
|
|
|
proto_tree_add_text(tree, tvb, ofs, 2, "UTF8 server name offset: %d", utf_ofs);
|
|
|
|
utf_ofs += offset;
|
|
|
|
}
|
2002-04-30 22:05:33 +00:00
|
|
|
}
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2002-04-30 22:05:33 +00:00
|
|
|
ofs = offset +tvb_get_ntohs(tvb, offset +AFPSTATUS_MACHOFF);
|
|
|
|
if (ofs)
|
|
|
|
proto_tree_add_item(tree, hf_dsi_server_type, tvb, ofs, 1, FALSE);
|
|
|
|
|
|
|
|
ofs = offset +tvb_get_ntohs(tvb, offset +AFPSTATUS_VERSOFF);
|
|
|
|
if (ofs) {
|
|
|
|
nbe = tvb_get_guint8(tvb, ofs);
|
|
|
|
ti = proto_tree_add_text(tree, tvb, ofs, 1, "Version list: %d", nbe);
|
|
|
|
ofs++;
|
|
|
|
sub_tree = proto_item_add_subtree(ti, ett_dsi_vers);
|
|
|
|
for (i = 0; i < nbe; i++) {
|
2004-01-13 21:49:52 +00:00
|
|
|
len = tvb_get_guint8(tvb, ofs);
|
|
|
|
proto_tree_add_item(sub_tree, hf_dsi_server_vers, tvb, ofs, 1, FALSE);
|
|
|
|
ofs += len + 1;
|
2002-04-30 22:05:33 +00:00
|
|
|
}
|
|
|
|
}
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2002-04-30 22:05:33 +00:00
|
|
|
ofs = offset +tvb_get_ntohs(tvb, offset +AFPSTATUS_UAMSOFF);
|
|
|
|
if (ofs) {
|
|
|
|
nbe = tvb_get_guint8(tvb, ofs);
|
|
|
|
ti = proto_tree_add_text(tree, tvb, ofs, 1, "UAMS list: %d", nbe);
|
|
|
|
ofs++;
|
|
|
|
sub_tree = proto_item_add_subtree(ti, ett_dsi_uams);
|
|
|
|
for (i = 0; i < nbe; i++) {
|
2004-01-13 21:49:52 +00:00
|
|
|
len = tvb_get_guint8(tvb, ofs);
|
|
|
|
proto_tree_add_item(sub_tree, hf_dsi_server_uams, tvb, ofs, 1, FALSE);
|
|
|
|
ofs += len + 1;
|
2002-04-30 22:05:33 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
ofs = offset +tvb_get_ntohs(tvb, offset +AFPSTATUS_ICONOFF);
|
|
|
|
if (ofs)
|
|
|
|
proto_tree_add_item(tree, hf_dsi_server_icon, tvb, ofs, 256, FALSE);
|
|
|
|
|
|
|
|
if (sign_ofs) {
|
|
|
|
proto_tree_add_item(tree, hf_dsi_server_signature, tvb, sign_ofs, 16, FALSE);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (adr_ofs) {
|
2002-05-08 23:46:34 +00:00
|
|
|
proto_tree *adr_tree;
|
2005-06-19 00:08:30 +00:00
|
|
|
unsigned char *tmp;
|
2002-05-08 23:46:34 +00:00
|
|
|
const guint8 *ip;
|
|
|
|
guint16 net;
|
|
|
|
guint8 node;
|
|
|
|
guint16 port;
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2002-04-30 22:05:33 +00:00
|
|
|
ofs = adr_ofs;
|
|
|
|
nbe = tvb_get_guint8(tvb, ofs);
|
|
|
|
ti = proto_tree_add_text(tree, tvb, ofs, 1, "Address list: %d", nbe);
|
|
|
|
ofs++;
|
2002-05-08 23:46:34 +00:00
|
|
|
adr_tree = proto_item_add_subtree(ti, ett_dsi_addr);
|
2002-04-30 22:05:33 +00:00
|
|
|
for (i = 0; i < nbe; i++) {
|
2002-05-08 23:46:34 +00:00
|
|
|
guint8 type;
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2002-05-08 23:46:34 +00:00
|
|
|
len = tvb_get_guint8(tvb, ofs);
|
|
|
|
type = tvb_get_guint8(tvb, ofs +1);
|
|
|
|
switch (type) {
|
|
|
|
case 1: /* IP */
|
|
|
|
ip = tvb_get_ptr(tvb, ofs+2, 4);
|
2003-04-15 05:45:02 +00:00
|
|
|
ti = proto_tree_add_text(adr_tree, tvb, ofs, len, "ip: %s", ip_to_str(ip));
|
2002-05-08 23:46:34 +00:00
|
|
|
break;
|
|
|
|
case 2: /* IP + port */
|
|
|
|
ip = tvb_get_ptr(tvb, ofs+2, 4);
|
|
|
|
port = tvb_get_ntohs(tvb, ofs+6);
|
|
|
|
ti = proto_tree_add_text(adr_tree, tvb, ofs, len, "ip %s:%d",ip_to_str(ip),port);
|
|
|
|
break;
|
|
|
|
case 3: /* DDP, atalk_addr_to_str want host order not network */
|
|
|
|
net = tvb_get_ntohs(tvb, ofs+2);
|
2002-08-28 21:04:11 +00:00
|
|
|
node = tvb_get_guint8(tvb, ofs +4);
|
2002-05-08 23:46:34 +00:00
|
|
|
port = tvb_get_guint8(tvb, ofs +5);
|
2003-04-15 05:45:02 +00:00
|
|
|
ti = proto_tree_add_text(adr_tree, tvb, ofs, len, "ddp: %u.%u:%u",
|
2002-05-08 23:46:34 +00:00
|
|
|
net, node, port);
|
|
|
|
break;
|
|
|
|
case 4: /* DNS */
|
2003-04-15 05:45:02 +00:00
|
|
|
case 5: /* SSH tunnel */
|
2002-05-08 23:46:34 +00:00
|
|
|
if (len > 2) {
|
2005-08-10 13:41:13 +00:00
|
|
|
tmp = tvb_get_ephemeral_string(tvb, ofs +2, len -2);
|
2003-04-15 05:45:02 +00:00
|
|
|
ti = proto_tree_add_text(adr_tree, tvb, ofs, len, "%s: %s",
|
|
|
|
(type==4)?"dns":"ssh tunnel", tmp);
|
2002-05-08 23:46:34 +00:00
|
|
|
break;
|
2002-08-28 21:04:11 +00:00
|
|
|
}
|
2003-04-15 05:45:02 +00:00
|
|
|
else {
|
|
|
|
ti = proto_tree_add_text(adr_tree, tvb, ofs, len,"Malformed address type %d", type);
|
|
|
|
}
|
|
|
|
break;
|
2005-06-19 00:08:30 +00:00
|
|
|
case 6: /* IP6 */
|
|
|
|
ip = tvb_get_ptr(tvb, ofs+2, INET6_ADDRLEN);
|
|
|
|
ti = proto_tree_add_text(adr_tree, tvb, ofs, len, "ip6: %s",
|
|
|
|
ip6_to_str((const struct e_in6_addr *)ip));
|
|
|
|
break;
|
|
|
|
case 7: /* IP6 + 2bytes port */
|
|
|
|
ip = tvb_get_ptr(tvb, ofs+2, INET6_ADDRLEN);
|
|
|
|
port = tvb_get_ntohs(tvb, ofs+ 2+INET6_ADDRLEN);
|
|
|
|
ti = proto_tree_add_text(adr_tree, tvb, ofs, len, "ip6 %s:%d",
|
|
|
|
ip6_to_str((const struct e_in6_addr *)ip),port);
|
|
|
|
break;
|
2002-05-08 23:46:34 +00:00
|
|
|
default:
|
2008-12-18 19:08:49 +00:00
|
|
|
ti = proto_tree_add_text(adr_tree, tvb, ofs, len,"Unknown type : %d", type);
|
2002-05-08 23:46:34 +00:00
|
|
|
break;
|
2002-08-28 21:04:11 +00:00
|
|
|
}
|
2002-05-08 23:46:34 +00:00
|
|
|
len -= 2;
|
|
|
|
sub_tree = proto_item_add_subtree(ti,ett_dsi_addr_line);
|
2002-04-30 22:05:33 +00:00
|
|
|
proto_tree_add_item(sub_tree, hf_dsi_server_addr_len, tvb, ofs, 1, FALSE);
|
|
|
|
ofs++;
|
2002-08-28 21:04:11 +00:00
|
|
|
proto_tree_add_item(sub_tree, hf_dsi_server_addr_type, tvb, ofs, 1, FALSE);
|
2002-04-30 22:05:33 +00:00
|
|
|
ofs++;
|
|
|
|
proto_tree_add_item(sub_tree, hf_dsi_server_addr_value,tvb, ofs, len, FALSE);
|
|
|
|
ofs += len;
|
|
|
|
}
|
|
|
|
}
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2002-05-03 21:25:43 +00:00
|
|
|
if (dir_ofs) {
|
|
|
|
ofs = dir_ofs;
|
|
|
|
nbe = tvb_get_guint8(tvb, ofs);
|
|
|
|
ti = proto_tree_add_text(tree, tvb, ofs, 1, "Directory services list: %d", nbe);
|
|
|
|
ofs++;
|
|
|
|
sub_tree = proto_item_add_subtree(ti, ett_dsi_directory);
|
|
|
|
for (i = 0; i < nbe; i++) {
|
2004-01-13 21:49:52 +00:00
|
|
|
len = tvb_get_guint8(tvb, ofs);
|
|
|
|
proto_tree_add_item(sub_tree, hf_dsi_server_directory, tvb, ofs, 1, FALSE);
|
|
|
|
ofs += len + 1;
|
2002-05-03 21:25:43 +00:00
|
|
|
}
|
|
|
|
}
|
2003-04-15 05:45:02 +00:00
|
|
|
if (utf_ofs) {
|
|
|
|
guint16 ulen;
|
2004-01-06 02:20:32 +00:00
|
|
|
char *tmp;
|
2003-04-15 05:45:02 +00:00
|
|
|
|
|
|
|
ofs = utf_ofs;
|
|
|
|
ulen = tvb_get_ntohs(tvb, ofs);
|
2007-03-28 21:55:11 +00:00
|
|
|
tmp = tvb_get_ephemeral_string(tvb, ofs + 2, ulen);
|
2004-01-06 02:20:32 +00:00
|
|
|
ti = proto_tree_add_text(tree, tvb, ofs, ulen + 2, "UTF8 server name: %s", tmp);
|
2003-04-15 05:45:02 +00:00
|
|
|
sub_tree = proto_item_add_subtree(ti, ett_dsi_utf8_name);
|
2004-01-06 02:20:32 +00:00
|
|
|
proto_tree_add_uint(sub_tree, hf_dsi_utf8_server_name_len, tvb, ofs, 2, ulen);
|
2003-04-15 05:45:02 +00:00
|
|
|
ofs += 2;
|
2004-01-06 02:20:32 +00:00
|
|
|
proto_tree_add_string(sub_tree, hf_dsi_utf8_server_name, tvb, ofs, ulen, tmp);
|
|
|
|
ofs += ulen;
|
2003-04-15 05:45:02 +00:00
|
|
|
}
|
2002-05-03 21:25:43 +00:00
|
|
|
|
2002-04-30 22:05:33 +00:00
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
2001-05-24 20:25:25 +00:00
|
|
|
static void
|
2002-04-22 08:50:49 +00:00
|
|
|
dissect_dsi_packet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
2001-05-24 20:25:25 +00:00
|
|
|
{
|
2009-09-10 06:07:31 +00:00
|
|
|
proto_tree *dsi_tree;
|
2001-05-24 20:25:25 +00:00
|
|
|
proto_item *ti;
|
2002-04-22 08:50:49 +00:00
|
|
|
guint8 dsi_flags,dsi_command;
|
|
|
|
guint16 dsi_requestid;
|
|
|
|
gint32 dsi_code;
|
|
|
|
guint32 dsi_length;
|
|
|
|
guint32 dsi_reserved;
|
2002-04-25 23:58:02 +00:00
|
|
|
struct aspinfo aspinfo;
|
2003-12-08 20:36:59 +00:00
|
|
|
gint col_info;
|
|
|
|
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2009-08-09 06:26:46 +00:00
|
|
|
col_set_str(pinfo->cinfo, COL_PROTOCOL, "DSI");
|
2003-12-08 20:36:59 +00:00
|
|
|
col_info = check_col(pinfo->cinfo, COL_INFO);
|
|
|
|
if (col_info)
|
2001-12-10 00:26:21 +00:00
|
|
|
col_clear(pinfo->cinfo, COL_INFO);
|
2001-05-24 20:25:25 +00:00
|
|
|
|
2002-04-22 08:50:49 +00:00
|
|
|
dsi_flags = tvb_get_guint8(tvb, 0);
|
|
|
|
dsi_command = tvb_get_guint8(tvb, 1);
|
|
|
|
dsi_requestid = tvb_get_ntohs(tvb, 2);
|
|
|
|
dsi_code = tvb_get_ntohl(tvb, 4);
|
|
|
|
dsi_length = tvb_get_ntohl(tvb, 8);
|
|
|
|
dsi_reserved = tvb_get_ntohl(tvb, 12);
|
|
|
|
|
2003-12-08 20:36:59 +00:00
|
|
|
if (col_info) {
|
2002-04-22 08:50:49 +00:00
|
|
|
col_add_fstr(pinfo->cinfo, COL_INFO, "%s %s (%u)",
|
|
|
|
val_to_str(dsi_flags, flag_vals,
|
|
|
|
"Unknown flag (0x%02x)"),
|
|
|
|
val_to_str(dsi_command, func_vals,
|
|
|
|
"Unknown function (0x%02x)"),
|
|
|
|
dsi_requestid);
|
2001-05-24 20:25:25 +00:00
|
|
|
}
|
|
|
|
|
2002-04-22 08:50:49 +00:00
|
|
|
|
|
|
|
if (tree) {
|
|
|
|
ti = proto_tree_add_item(tree, proto_dsi, tvb, 0, -1, FALSE);
|
|
|
|
dsi_tree = proto_item_add_subtree(ti, ett_dsi);
|
|
|
|
|
|
|
|
proto_tree_add_uint(dsi_tree, hf_dsi_flags, tvb,
|
|
|
|
0, 1, dsi_flags);
|
|
|
|
proto_tree_add_uint(dsi_tree, hf_dsi_command, tvb,
|
|
|
|
1, 1, dsi_command);
|
|
|
|
proto_tree_add_uint(dsi_tree, hf_dsi_requestid, tvb,
|
|
|
|
2, 2, dsi_requestid);
|
2002-04-28 22:10:00 +00:00
|
|
|
switch (dsi_flags) {
|
|
|
|
|
|
|
|
case DSIFL_REQUEST:
|
|
|
|
proto_tree_add_int(dsi_tree, hf_dsi_offset, tvb,
|
2002-04-28 19:21:39 +00:00
|
|
|
4, 4, dsi_code);
|
2002-04-28 22:10:00 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case DSIFL_REPLY:
|
|
|
|
proto_tree_add_int(dsi_tree, hf_dsi_error, tvb,
|
2002-04-28 19:21:39 +00:00
|
|
|
4, 4, dsi_code);
|
2002-04-28 22:10:00 +00:00
|
|
|
break;
|
2002-04-28 19:21:39 +00:00
|
|
|
}
|
2002-04-22 08:50:49 +00:00
|
|
|
proto_tree_add_uint_format(dsi_tree, hf_dsi_length, tvb,
|
|
|
|
8, 4, dsi_length,
|
|
|
|
"Length: %u bytes", dsi_length);
|
|
|
|
proto_tree_add_uint(dsi_tree, hf_dsi_reserved, tvb,
|
|
|
|
12, 4, dsi_reserved);
|
2002-04-25 23:58:02 +00:00
|
|
|
}
|
2002-08-28 21:04:11 +00:00
|
|
|
else
|
2002-04-25 23:58:02 +00:00
|
|
|
dsi_tree = tree;
|
2002-04-30 22:05:33 +00:00
|
|
|
switch (dsi_command) {
|
2002-05-08 23:46:34 +00:00
|
|
|
case DSIFUNC_OPEN:
|
|
|
|
if (tree) {
|
2009-09-10 06:07:31 +00:00
|
|
|
dissect_dsi_open_session(tvb, dsi_tree, DSI_BLOCKSIZ, dsi_length);
|
2002-05-08 23:46:34 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case DSIFUNC_ATTN:
|
|
|
|
if (tree) {
|
|
|
|
dissect_dsi_attention(tvb, dsi_tree, DSI_BLOCKSIZ);
|
|
|
|
}
|
|
|
|
break;
|
2002-04-30 22:05:33 +00:00
|
|
|
case DSIFUNC_STAT:
|
|
|
|
if (tree && (dsi_flags == DSIFL_REPLY)) {
|
2002-05-01 07:07:09 +00:00
|
|
|
dissect_dsi_reply_get_status(tvb, dsi_tree, DSI_BLOCKSIZ);
|
2002-04-30 22:05:33 +00:00
|
|
|
}
|
2002-08-28 21:04:11 +00:00
|
|
|
break;
|
2002-04-30 22:05:33 +00:00
|
|
|
case DSIFUNC_CMD:
|
|
|
|
case DSIFUNC_WRITE:
|
|
|
|
{
|
|
|
|
tvbuff_t *new_tvb;
|
2009-05-19 17:16:14 +00:00
|
|
|
void* pd_save;
|
2002-04-30 22:05:33 +00:00
|
|
|
int len = tvb_reported_length_remaining(tvb,DSI_BLOCKSIZ);
|
|
|
|
|
|
|
|
aspinfo.reply = (dsi_flags == DSIFL_REPLY);
|
|
|
|
aspinfo.command = dsi_command;
|
|
|
|
aspinfo.seq = dsi_requestid;
|
|
|
|
aspinfo.code = dsi_code;
|
2009-05-19 17:16:14 +00:00
|
|
|
pd_save = pinfo->private_data;
|
2002-04-30 22:05:33 +00:00
|
|
|
pinfo->private_data = &aspinfo;
|
|
|
|
proto_item_set_len(dsi_tree, DSI_BLOCKSIZ);
|
|
|
|
|
|
|
|
new_tvb = tvb_new_subset(tvb, DSI_BLOCKSIZ,-1,len);
|
|
|
|
call_dissector(afp_handle, new_tvb, pinfo, tree);
|
2009-05-19 17:16:14 +00:00
|
|
|
pinfo->private_data = pd_save;
|
2002-04-30 22:05:33 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
default:
|
2002-08-28 21:04:11 +00:00
|
|
|
if (tree) {
|
2002-05-30 01:56:55 +00:00
|
|
|
call_dissector(data_handle,
|
2009-08-16 12:36:22 +00:00
|
|
|
tvb_new_subset_remaining(tvb, DSI_BLOCKSIZ),
|
2002-05-30 01:56:55 +00:00
|
|
|
pinfo, dsi_tree);
|
2002-04-30 22:05:33 +00:00
|
|
|
}
|
|
|
|
break;
|
2001-05-24 20:25:25 +00:00
|
|
|
}
|
2002-04-22 08:50:49 +00:00
|
|
|
}
|
2001-05-24 20:25:25 +00:00
|
|
|
|
Make a "tcp_dissect_pdus()" with the standard loop for a TCP segment,
extracting PDUs from it and possibly doing reassembly. Make the COPS,
DNS, DSI, Gryphon, and SCCP dissectors use it.
Add "set_actual_length()", "tcp_dissect_pdus()",
"decode_boolean_bitfield()", "decode_numeric_bitfield()", and
"decode_enumerated_bitfield()" to the list of routines available to
dissectors on platforms where routines in the main program aren't
available to dynamically-loaded code.
Declare routines in "to_str.h" as "extern"; as I remember, that's
necessary to allow the "decode_XXX_bitfield()" routines declared therein
to be made available to plugins as per the above.
Note that new exported routines should be added to the end of the table
if that's the only change being made to the table.
Create a new "plugin_api_decls.h" header file, used to declare both the
"p_" variables and the "p_" structure members in the routine-exporting
mechanism; this reduces the number of places you have to change to
change the list of exported routines.
svn path=/trunk/; revision=5394
2002-05-05 00:16:38 +00:00
|
|
|
static guint
|
2006-10-31 09:29:07 +00:00
|
|
|
get_dsi_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset)
|
2002-04-22 08:50:49 +00:00
|
|
|
{
|
|
|
|
guint32 plen;
|
2003-12-08 20:36:59 +00:00
|
|
|
guint8 dsi_flags,dsi_command;
|
|
|
|
|
|
|
|
dsi_flags = tvb_get_guint8(tvb, offset);
|
|
|
|
dsi_command = tvb_get_guint8(tvb, offset+ 1);
|
|
|
|
if ( dsi_flags > DSIFL_MAX || !dsi_command || dsi_command > DSIFUNC_MAX)
|
|
|
|
{
|
|
|
|
/* it's not a known dsi pdu start sequence */
|
|
|
|
return tvb_length_remaining(tvb, offset);
|
|
|
|
}
|
2001-05-24 20:25:25 +00:00
|
|
|
|
Make a "tcp_dissect_pdus()" with the standard loop for a TCP segment,
extracting PDUs from it and possibly doing reassembly. Make the COPS,
DNS, DSI, Gryphon, and SCCP dissectors use it.
Add "set_actual_length()", "tcp_dissect_pdus()",
"decode_boolean_bitfield()", "decode_numeric_bitfield()", and
"decode_enumerated_bitfield()" to the list of routines available to
dissectors on platforms where routines in the main program aren't
available to dynamically-loaded code.
Declare routines in "to_str.h" as "extern"; as I remember, that's
necessary to allow the "decode_XXX_bitfield()" routines declared therein
to be made available to plugins as per the above.
Note that new exported routines should be added to the end of the table
if that's the only change being made to the table.
Create a new "plugin_api_decls.h" header file, used to declare both the
"p_" variables and the "p_" structure members in the routine-exporting
mechanism; this reduces the number of places you have to change to
change the list of exported routines.
svn path=/trunk/; revision=5394
2002-05-05 00:16:38 +00:00
|
|
|
/*
|
|
|
|
* Get the length of the DSI packet.
|
|
|
|
*/
|
|
|
|
plen = tvb_get_ntohl(tvb, offset+8);
|
2001-05-24 20:25:25 +00:00
|
|
|
|
Make a "tcp_dissect_pdus()" with the standard loop for a TCP segment,
extracting PDUs from it and possibly doing reassembly. Make the COPS,
DNS, DSI, Gryphon, and SCCP dissectors use it.
Add "set_actual_length()", "tcp_dissect_pdus()",
"decode_boolean_bitfield()", "decode_numeric_bitfield()", and
"decode_enumerated_bitfield()" to the list of routines available to
dissectors on platforms where routines in the main program aren't
available to dynamically-loaded code.
Declare routines in "to_str.h" as "extern"; as I remember, that's
necessary to allow the "decode_XXX_bitfield()" routines declared therein
to be made available to plugins as per the above.
Note that new exported routines should be added to the end of the table
if that's the only change being made to the table.
Create a new "plugin_api_decls.h" header file, used to declare both the
"p_" variables and the "p_" structure members in the routine-exporting
mechanism; this reduces the number of places you have to change to
change the list of exported routines.
svn path=/trunk/; revision=5394
2002-05-05 00:16:38 +00:00
|
|
|
/*
|
|
|
|
* That length doesn't include the length of the header itself;
|
|
|
|
* add that in.
|
|
|
|
*/
|
|
|
|
return plen + 16;
|
|
|
|
}
|
2001-05-24 20:25:25 +00:00
|
|
|
|
Make a "tcp_dissect_pdus()" with the standard loop for a TCP segment,
extracting PDUs from it and possibly doing reassembly. Make the COPS,
DNS, DSI, Gryphon, and SCCP dissectors use it.
Add "set_actual_length()", "tcp_dissect_pdus()",
"decode_boolean_bitfield()", "decode_numeric_bitfield()", and
"decode_enumerated_bitfield()" to the list of routines available to
dissectors on platforms where routines in the main program aren't
available to dynamically-loaded code.
Declare routines in "to_str.h" as "extern"; as I remember, that's
necessary to allow the "decode_XXX_bitfield()" routines declared therein
to be made available to plugins as per the above.
Note that new exported routines should be added to the end of the table
if that's the only change being made to the table.
Create a new "plugin_api_decls.h" header file, used to declare both the
"p_" variables and the "p_" structure members in the routine-exporting
mechanism; this reduces the number of places you have to change to
change the list of exported routines.
svn path=/trunk/; revision=5394
2002-05-05 00:16:38 +00:00
|
|
|
static void
|
|
|
|
dissect_dsi(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|
|
|
{
|
|
|
|
tcp_dissect_pdus(tvb, pinfo, tree, dsi_desegment, 12,
|
|
|
|
get_dsi_pdu_len, dissect_dsi_packet);
|
2001-05-24 20:25:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
proto_register_dsi(void)
|
|
|
|
{
|
|
|
|
|
|
|
|
static hf_register_info hf[] = {
|
|
|
|
{ &hf_dsi_flags,
|
|
|
|
{ "Flags", "dsi.flags",
|
|
|
|
FT_UINT8, BASE_HEX, VALS(flag_vals), 0x0,
|
2001-06-18 02:18:27 +00:00
|
|
|
"Indicates request or reply.", HFILL }},
|
2001-05-24 20:25:25 +00:00
|
|
|
|
|
|
|
{ &hf_dsi_command,
|
2002-04-28 19:21:39 +00:00
|
|
|
{ "Command", "dsi.command",
|
2001-05-24 20:25:25 +00:00
|
|
|
FT_UINT8, BASE_DEC, VALS(func_vals), 0x0,
|
2001-06-18 02:18:27 +00:00
|
|
|
"Represents a DSI command.", HFILL }},
|
2001-05-24 20:25:25 +00:00
|
|
|
|
|
|
|
{ &hf_dsi_requestid,
|
2002-04-28 19:21:39 +00:00
|
|
|
{ "Request ID", "dsi.requestid",
|
2001-05-24 20:25:25 +00:00
|
|
|
FT_UINT16, BASE_DEC, NULL, 0x0,
|
2001-06-18 02:18:27 +00:00
|
|
|
"Keeps track of which request this is. Replies must match a Request. IDs must be generated in sequential order.", HFILL }},
|
2001-05-24 20:25:25 +00:00
|
|
|
|
2002-04-28 22:10:00 +00:00
|
|
|
{ &hf_dsi_offset,
|
2002-04-28 19:21:39 +00:00
|
|
|
{ "Data offset", "dsi.data_offset",
|
2002-04-14 22:56:02 +00:00
|
|
|
FT_INT32, BASE_DEC, NULL, 0x0,
|
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, HFILL }},
|
2002-04-28 19:21:39 +00:00
|
|
|
|
|
|
|
{ &hf_dsi_error,
|
|
|
|
{ "Error code", "dsi.error_code",
|
|
|
|
FT_INT32, BASE_DEC, VALS(asp_error_vals), 0x0,
|
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, HFILL }},
|
2001-05-24 20:25:25 +00:00
|
|
|
|
|
|
|
{ &hf_dsi_length,
|
|
|
|
{ "Length", "dsi.length",
|
|
|
|
FT_UINT32, BASE_DEC, NULL, 0x0,
|
2001-06-18 02:18:27 +00:00
|
|
|
"Total length of the data that follows the DSI header.", HFILL }},
|
2001-05-24 20:25:25 +00:00
|
|
|
|
|
|
|
{ &hf_dsi_reserved,
|
2002-04-28 19:21:39 +00:00
|
|
|
{ "Reserved", "dsi.reserved",
|
2001-05-24 20:25:25 +00:00
|
|
|
FT_UINT32, BASE_HEX, NULL, 0x0,
|
2001-06-18 02:18:27 +00:00
|
|
|
"Reserved for future use. Should be set to zero.", HFILL }},
|
2002-05-03 21:25:43 +00:00
|
|
|
/* asp , afp */
|
2003-04-15 05:45:02 +00:00
|
|
|
{ &hf_dsi_utf8_server_name_len,
|
|
|
|
{ "Length", "dsi.utf8_server_name_len",
|
|
|
|
FT_UINT16, BASE_DEC, NULL, 0x0,
|
|
|
|
"UTF8 server name length.", HFILL }},
|
|
|
|
{ &hf_dsi_utf8_server_name,
|
|
|
|
{ "UTF8 Server name", "dsi.utf8_server_name",
|
|
|
|
FT_STRING, BASE_NONE, NULL, 0x0,
|
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, HFILL }},
|
2003-04-15 05:45:02 +00:00
|
|
|
|
2002-04-30 22:05:33 +00:00
|
|
|
{ &hf_dsi_server_name,
|
|
|
|
{ "Server name", "dsi.server_name",
|
|
|
|
FT_UINT_STRING, BASE_NONE, NULL, 0x0,
|
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, HFILL }},
|
2002-04-30 22:05:33 +00:00
|
|
|
|
|
|
|
{ &hf_dsi_server_type,
|
|
|
|
{ "Server type", "dsi.server_type",
|
|
|
|
FT_UINT_STRING, BASE_NONE, NULL, 0x0,
|
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, HFILL }},
|
2002-04-30 22:05:33 +00:00
|
|
|
|
|
|
|
{ &hf_dsi_server_vers,
|
|
|
|
{ "AFP version", "dsi.server_vers",
|
|
|
|
FT_UINT_STRING, BASE_NONE, NULL, 0x0,
|
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, HFILL }},
|
2002-04-30 22:05:33 +00:00
|
|
|
|
|
|
|
{ &hf_dsi_server_uams,
|
|
|
|
{ "UAM", "dsi.server_uams",
|
|
|
|
FT_UINT_STRING, BASE_NONE, NULL, 0x0,
|
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, HFILL }},
|
2002-04-30 22:05:33 +00:00
|
|
|
|
|
|
|
{ &hf_dsi_server_icon,
|
|
|
|
{ "Icon bitmap", "dsi.server_icon",
|
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
|
|
|
FT_BYTES, BASE_NONE, NULL, 0x0,
|
2002-04-30 22:05:33 +00:00
|
|
|
"Server icon bitmap", HFILL }},
|
|
|
|
|
2002-05-03 21:25:43 +00:00
|
|
|
{ &hf_dsi_server_directory,
|
|
|
|
{ "Directory service", "dsi.server_directory",
|
|
|
|
FT_UINT_STRING, BASE_NONE, NULL, 0x0,
|
|
|
|
"Server directory service", HFILL }},
|
|
|
|
|
2002-04-30 22:05:33 +00:00
|
|
|
{ &hf_dsi_server_signature,
|
|
|
|
{ "Server signature", "dsi.server_signature",
|
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
|
|
|
FT_BYTES, BASE_NONE, NULL, 0x0,
|
|
|
|
NULL, HFILL }},
|
2002-04-30 22:05:33 +00:00
|
|
|
|
|
|
|
{ &hf_dsi_server_flag,
|
|
|
|
{ "Flag", "dsi.server_flag",
|
|
|
|
FT_UINT16, BASE_HEX, NULL, 0x0,
|
|
|
|
"Server capabilities flag", HFILL }},
|
|
|
|
{ &hf_dsi_server_flag_copyfile,
|
|
|
|
{ "Support copyfile", "dsi.server_flag.copyfile",
|
|
|
|
FT_BOOLEAN, 16, NULL, AFPSRVRINFO_COPY,
|
|
|
|
"Server support copyfile", HFILL }},
|
|
|
|
{ &hf_dsi_server_flag_passwd,
|
|
|
|
{ "Support change password", "dsi.server_flag.passwd",
|
|
|
|
FT_BOOLEAN, 16, NULL, AFPSRVRINFO_PASSWD,
|
|
|
|
"Server support change password", HFILL }},
|
|
|
|
{ &hf_dsi_server_flag_no_save_passwd,
|
|
|
|
{ "Don't allow save password", "dsi.server_flag.no_save_passwd",
|
|
|
|
FT_BOOLEAN, 16, NULL, AFPSRVRINFO_NOSAVEPASSWD,
|
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, HFILL }},
|
2002-04-30 22:05:33 +00:00
|
|
|
{ &hf_dsi_server_flag_srv_msg,
|
|
|
|
{ "Support server message", "dsi.server_flag.srv_msg",
|
|
|
|
FT_BOOLEAN, 16, NULL, AFPSRVRINFO_SRVMSGS,
|
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, HFILL }},
|
2002-04-30 22:05:33 +00:00
|
|
|
{ &hf_dsi_server_flag_srv_sig,
|
|
|
|
{ "Support server signature", "dsi.server_flag.srv_sig",
|
|
|
|
FT_BOOLEAN, 16, NULL, AFPSRVRINFO_SRVSIGNATURE,
|
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, HFILL }},
|
2002-04-30 22:05:33 +00:00
|
|
|
{ &hf_dsi_server_flag_tcpip,
|
|
|
|
{ "Support TCP/IP", "dsi.server_flag.tcpip",
|
|
|
|
FT_BOOLEAN, 16, NULL, AFPSRVRINFO_TCPIP,
|
|
|
|
"Server support TCP/IP", HFILL }},
|
|
|
|
{ &hf_dsi_server_flag_notify,
|
|
|
|
{ "Support server notifications", "dsi.server_flag.notify",
|
|
|
|
FT_BOOLEAN, 16, NULL, AFPSRVRINFO_SRVNOTIFY,
|
|
|
|
"Server support notifications", HFILL }},
|
2002-05-03 21:25:43 +00:00
|
|
|
{ &hf_dsi_server_flag_reconnect,
|
|
|
|
{ "Support server reconnect", "dsi.server_flag.reconnect",
|
|
|
|
FT_BOOLEAN, 16, NULL, AFPSRVRINFO_SRVRECONNECT,
|
|
|
|
"Server support reconnect", HFILL }},
|
|
|
|
{ &hf_dsi_server_flag_directory,
|
|
|
|
{ "Support directory services", "dsi.server_flag.directory",
|
|
|
|
FT_BOOLEAN, 16, NULL, AFPSRVRINFO_SRVDIRECTORY,
|
|
|
|
"Server support directory services", HFILL }},
|
2002-10-17 22:38:19 +00:00
|
|
|
{ &hf_dsi_server_flag_utf8_name,
|
|
|
|
{ "Support UTF8 server name", "dsi.server_flag.utf8_name",
|
|
|
|
FT_BOOLEAN, 16, NULL, AFPSRVRINFO_SRVUTF8,
|
|
|
|
"Server support UTF8 server name", HFILL }},
|
2005-06-19 00:08:30 +00:00
|
|
|
{ &hf_dsi_server_flag_uuid,
|
|
|
|
{ "Support UUIDs", "dsi.server_flag.uuids",
|
|
|
|
FT_BOOLEAN, 16, NULL, AFPSRVRINFO_UUID,
|
|
|
|
"Server supports UUIDs", HFILL }},
|
2009-09-10 06:07:31 +00:00
|
|
|
{ &hf_dsi_server_flag_ext_sleep,
|
|
|
|
{ "Support extended sleep", "dsi.server_flag.ext_sleep",
|
|
|
|
FT_BOOLEAN, 16, NULL, AFPSRVRINFO_EXT_SLEEP,
|
|
|
|
"Server supports extended sleep", HFILL }},
|
2002-04-30 22:05:33 +00:00
|
|
|
{ &hf_dsi_server_flag_fast_copy,
|
|
|
|
{ "Support fast copy", "dsi.server_flag.fast_copy",
|
|
|
|
FT_BOOLEAN, 16, NULL, AFPSRVRINFO_FASTBOZO,
|
|
|
|
"Server support fast copy", HFILL }},
|
|
|
|
|
|
|
|
|
|
|
|
{ &hf_dsi_server_addr_len,
|
|
|
|
{ "Length", "dsi.server_addr.len",
|
|
|
|
FT_UINT8, BASE_DEC, NULL, 0x0,
|
|
|
|
"Address length.", HFILL }},
|
|
|
|
|
|
|
|
{ &hf_dsi_server_addr_type,
|
|
|
|
{ "Type", "dsi.server_addr.type",
|
|
|
|
FT_UINT8, BASE_DEC, VALS(afp_server_addr_type_vals), 0x0,
|
|
|
|
"Address type.", HFILL }},
|
|
|
|
|
|
|
|
{ &hf_dsi_server_addr_value,
|
|
|
|
{ "Value", "dsi.server_addr.value",
|
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
|
|
|
FT_BYTES, BASE_NONE, NULL, 0x0,
|
2002-04-30 22:05:33 +00:00
|
|
|
"Address value", HFILL }},
|
|
|
|
|
2002-05-08 23:46:34 +00:00
|
|
|
{ &hf_dsi_open_type,
|
2009-09-10 06:07:31 +00:00
|
|
|
{ "Option", "dsi.open_type",
|
2002-05-08 23:46:34 +00:00
|
|
|
FT_UINT8, BASE_DEC, VALS(dsi_open_type_vals), 0x0,
|
|
|
|
"Open session option type.", HFILL }},
|
|
|
|
|
|
|
|
{ &hf_dsi_open_len,
|
|
|
|
{ "Length", "dsi.open_len",
|
|
|
|
FT_UINT8, BASE_DEC, NULL, 0x0,
|
|
|
|
"Open session option len", HFILL }},
|
|
|
|
|
|
|
|
{ &hf_dsi_open_quantum,
|
|
|
|
{ "Quantum", "dsi.open_quantum",
|
|
|
|
FT_UINT32, BASE_DEC, NULL, 0x0,
|
|
|
|
"Server/Attention quantum", HFILL }},
|
|
|
|
|
2009-09-10 06:07:31 +00:00
|
|
|
{ &hf_dsi_replay_cache_size,
|
|
|
|
{ "Replay", "dsi.replay_cache",
|
|
|
|
FT_UINT32, BASE_DEC, NULL, 0x0,
|
|
|
|
"Replay cache size", HFILL }},
|
|
|
|
|
2002-05-08 23:46:34 +00:00
|
|
|
{ &hf_dsi_open_option,
|
|
|
|
{ "Option", "dsi.open_option",
|
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
|
|
|
FT_BYTES, BASE_NONE, NULL, 0x0,
|
2002-05-08 23:46:34 +00:00
|
|
|
"Open session options (undecoded)", HFILL }},
|
|
|
|
|
|
|
|
{ &hf_dsi_attn_flag,
|
|
|
|
{ "Flags", "dsi.attn_flag",
|
|
|
|
FT_UINT16, BASE_HEX, VALS(dsi_attn_flag_vals), 0xf000,
|
|
|
|
"Server attention flag", HFILL }},
|
|
|
|
{ &hf_dsi_attn_flag_shutdown,
|
|
|
|
{ "Shutdown", "dsi.attn_flag.shutdown",
|
|
|
|
FT_BOOLEAN, 16, NULL, 1<<15,
|
|
|
|
"Attention flag, server is shutting down", HFILL }},
|
|
|
|
{ &hf_dsi_attn_flag_crash,
|
|
|
|
{ "Crash", "dsi.attn_flag.crash",
|
|
|
|
FT_BOOLEAN, 16, NULL, 1<<14,
|
|
|
|
"Attention flag, server crash bit", HFILL }},
|
|
|
|
{ &hf_dsi_attn_flag_msg,
|
|
|
|
{ "Message", "dsi.attn_flag.msg",
|
|
|
|
FT_BOOLEAN, 16, NULL, 1<<13,
|
|
|
|
"Attention flag, server message bit", HFILL }},
|
|
|
|
{ &hf_dsi_attn_flag_reconnect,
|
|
|
|
{ "Don't reconnect", "dsi.attn_flag.reconnect",
|
|
|
|
FT_BOOLEAN, 16, NULL, 1<<12,
|
|
|
|
"Attention flag, don't reconnect bit", HFILL }},
|
|
|
|
{ &hf_dsi_attn_flag_time,
|
|
|
|
{ "Minutes", "dsi.attn_flag.time",
|
|
|
|
FT_UINT16, BASE_DEC, NULL, 0xfff,
|
|
|
|
"Number of minutes", HFILL }},
|
|
|
|
{ &hf_dsi_attn_flag_bitmap,
|
|
|
|
{ "Bitmap", "dsi.attn_flag.time",
|
|
|
|
FT_UINT16, BASE_HEX, NULL, 0xfff,
|
|
|
|
"Attention extended bitmap", HFILL }},
|
|
|
|
|
2001-05-24 20:25:25 +00:00
|
|
|
};
|
2002-05-08 23:46:34 +00:00
|
|
|
|
2001-05-24 20:25:25 +00:00
|
|
|
static gint *ett[] = {
|
|
|
|
&ett_dsi,
|
2002-05-08 23:46:34 +00:00
|
|
|
&ett_dsi_open,
|
|
|
|
&ett_dsi_attn,
|
|
|
|
&ett_dsi_attn_flag,
|
2002-05-03 21:25:43 +00:00
|
|
|
/* asp afp */
|
2002-04-30 22:05:33 +00:00
|
|
|
&ett_dsi_status,
|
|
|
|
&ett_dsi_status_server_flag,
|
|
|
|
&ett_dsi_vers,
|
|
|
|
&ett_dsi_uams,
|
|
|
|
&ett_dsi_addr,
|
2002-05-08 23:46:34 +00:00
|
|
|
&ett_dsi_addr_line,
|
2002-05-03 21:25:43 +00:00
|
|
|
&ett_dsi_directory,
|
2003-04-15 05:45:02 +00:00
|
|
|
&ett_dsi_utf8_name,
|
2001-05-24 20:25:25 +00:00
|
|
|
};
|
2002-04-22 08:50:49 +00:00
|
|
|
module_t *dsi_module;
|
2001-05-24 20:25:25 +00:00
|
|
|
|
|
|
|
proto_dsi = proto_register_protocol("Data Stream Interface", "DSI", "dsi");
|
|
|
|
proto_register_field_array(proto_dsi, hf, array_length(hf));
|
|
|
|
proto_register_subtree_array(ett, array_length(ett));
|
|
|
|
|
2002-04-22 08:50:49 +00:00
|
|
|
dsi_module = prefs_register_protocol(proto_dsi, NULL);
|
|
|
|
prefs_register_bool_preference(dsi_module, "desegment",
|
2004-08-21 09:02:52 +00:00
|
|
|
"Reassemble DSI messages spanning multiple TCP segments",
|
|
|
|
"Whether the DSI dissector should reassemble messages spanning multiple TCP segments."
|
|
|
|
" To use this option, you must also enable \"Allow subdissectors to reassemble TCP streams\" in the TCP protocol settings.",
|
2002-04-22 08:50:49 +00:00
|
|
|
&dsi_desegment);
|
2001-05-24 20:25:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
proto_reg_handoff_dsi(void)
|
|
|
|
{
|
2008-09-25 02:21:04 +00:00
|
|
|
dissector_handle_t dsi_handle;
|
2002-04-22 08:50:49 +00:00
|
|
|
|
|
|
|
dsi_handle = create_dissector_handle(dissect_dsi, proto_dsi);
|
2001-12-03 04:00:26 +00:00
|
|
|
dissector_add("tcp.port", TCP_PORT_DSI, dsi_handle);
|
2002-04-22 08:50:49 +00:00
|
|
|
|
|
|
|
data_handle = find_dissector("data");
|
2002-04-25 23:58:02 +00:00
|
|
|
afp_handle = find_dissector("afp");
|
2001-05-24 20:25:25 +00:00
|
|
|
}
|