1999-10-22 08:11:40 +00:00
|
|
|
/* packet-atalk.c
|
2002-05-03 21:25:43 +00:00
|
|
|
* Routines for AppleTalk packet disassembly: LLAP, DDP, NBP, ATP, ASP,
|
|
|
|
* RTMP.
|
1998-10-16 01:18:35 +00:00
|
|
|
*
|
2002-08-28 21:04:11 +00:00
|
|
|
* $Id: packet-atalk.c,v 1.81 2002/08/28 21:00:07 jmayer Exp $
|
1999-09-23 05:26:18 +00:00
|
|
|
*
|
1998-10-16 01:18:35 +00:00
|
|
|
* Simon Wilkinson <sxw@dcs.ed.ac.uk>
|
|
|
|
*
|
2001-12-03 04:00:26 +00:00
|
|
|
* Ethereal - Network traffic analyzer
|
|
|
|
* By Gerald Combs <gerald@ethereal.com>
|
|
|
|
* Copyright 1998
|
|
|
|
*
|
1998-10-16 01:18:35 +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
|
|
|
*
|
1998-10-16 01:18:35 +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
|
|
|
*
|
1998-10-16 01:18:35 +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
|
|
|
|
|
1999-03-23 03:14:46 +00:00
|
|
|
#include <glib.h>
|
2002-01-21 07:37:49 +00:00
|
|
|
#include <epan/packet.h>
|
2002-05-03 21:25:43 +00:00
|
|
|
#include <string.h>
|
|
|
|
|
Change the sub-dissector handoff registration routines so that the
sub-dissector table is not stored in the header_field_info struct, but
in a separate namespace. Dissector tables are now registered by name
and not by field ID. For example:
udp_dissector_table = register_dissector_table("udp.port");
Because of this different namespace, dissector tables can have names
that are not field names. This is useful for ethertype, since multiple
fields are "ethertypes".
packet-ethertype.c replaces ethertype.c (the name was changed so that it
would be named in the same fashion as all the filenames passed to make-reg-dotc)
Although it registers no protocol or field, it registers one dissector table:
ethertype_dissector_table = register_dissector_table("ethertype");
All protocols that can be called because of an ethertype field now register
that fact with dissector_add() calls.
In this way, one dissector_table services all ethertype fields
(hf_eth_type, hf_llc_type, hf_null_etype, hf_vlan_etype)
Furthermore, the code allows for names of protocols to exist in the
etype_vals, yet a dissector for that protocol doesn't exist. The name
of the dissector is printed in COL_INFO. You're welcome, Richard. :-)
svn path=/trunk/; revision=1848
2000-04-13 18:18:56 +00:00
|
|
|
#include "etypes.h"
|
2000-04-16 21:37:07 +00:00
|
|
|
#include "ppptypes.h"
|
2000-11-17 06:02:21 +00:00
|
|
|
#include "aftypes.h"
|
2002-01-21 07:37:49 +00:00
|
|
|
#include <epan/atalk-utils.h>
|
2002-04-25 23:58:02 +00:00
|
|
|
#include <epan/conversation.h>
|
|
|
|
|
2002-04-30 22:05:33 +00:00
|
|
|
#include "prefs.h"
|
|
|
|
#include "reassemble.h"
|
|
|
|
|
2002-04-25 23:58:02 +00:00
|
|
|
#include "packet-afp.h"
|
|
|
|
|
2002-04-30 22:05:33 +00:00
|
|
|
/* Tables for reassembly of fragments. */
|
|
|
|
static GHashTable *atp_fragment_table = NULL;
|
|
|
|
static GHashTable *atp_reassembled_table = NULL;
|
|
|
|
|
|
|
|
/* desegmentation of ATP */
|
|
|
|
static gboolean atp_defragment = TRUE;
|
|
|
|
|
2002-04-25 23:58:02 +00:00
|
|
|
static dissector_handle_t afp_handle;
|
1999-03-23 03:14:46 +00:00
|
|
|
|
2001-11-30 07:14:22 +00:00
|
|
|
static int proto_llap = -1;
|
|
|
|
static int hf_llap_dst = -1;
|
|
|
|
static int hf_llap_src = -1;
|
|
|
|
static int hf_llap_type = -1;
|
|
|
|
|
1999-07-29 05:47:07 +00:00
|
|
|
static int proto_ddp = -1;
|
1999-10-07 17:11:11 +00:00
|
|
|
static int hf_ddp_hopcount = -1;
|
|
|
|
static int hf_ddp_len = -1;
|
|
|
|
static int hf_ddp_checksum = -1;
|
2002-06-28 20:13:03 +00:00
|
|
|
static int hf_ddp_dst = -1;
|
1999-10-07 17:11:11 +00:00
|
|
|
static int hf_ddp_dst_net = -1;
|
2002-06-28 20:13:03 +00:00
|
|
|
static int hf_ddp_src = -1;
|
1999-10-07 17:11:11 +00:00
|
|
|
static int hf_ddp_src_net = -1;
|
|
|
|
static int hf_ddp_dst_node = -1;
|
|
|
|
static int hf_ddp_src_node = -1;
|
|
|
|
static int hf_ddp_dst_socket = -1;
|
|
|
|
static int hf_ddp_src_socket = -1;
|
|
|
|
static int hf_ddp_type = -1;
|
1999-07-29 05:47:07 +00:00
|
|
|
|
2002-04-25 23:58:02 +00:00
|
|
|
|
|
|
|
/* --------------------------------------
|
|
|
|
* ATP protocol parameters
|
|
|
|
* from netatalk/include/atalk/atp.h
|
|
|
|
*/
|
|
|
|
#define ATP_MAXDATA (578+4) /* maximum ATP data size */
|
|
|
|
#define ATP_BUFSIZ 587 /* maximum packet size */
|
|
|
|
#define ATP_HDRSIZE 5 /* includes DDP type field */
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2002-04-25 23:58:02 +00:00
|
|
|
#define ATP_TRELMASK 0x07 /* mask all but TREL */
|
|
|
|
#define ATP_RELTIME 30 /* base release timer (in secs) */
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2002-04-25 23:58:02 +00:00
|
|
|
#define ATP_TREL30 0x0 /* release time codes */
|
|
|
|
#define ATP_TREL1M 0x1 /* these are passed in flags of */
|
|
|
|
#define ATP_TREL2M 0x2 /* atp_sreq call, and set in the */
|
|
|
|
#define ATP_TREL4M 0x3 /* packet control info. */
|
|
|
|
#define ATP_TREL8M 0x4
|
|
|
|
|
|
|
|
/* flags for ATP options (and control byte)
|
|
|
|
*/
|
2002-04-26 07:41:31 +00:00
|
|
|
#define ATP_XO 0x20 /* (1<<5) eXactly Once mode */
|
|
|
|
#define ATP_EOM 0x10 /* (1<<4) End Of Message */
|
|
|
|
#define ATP_STS 0x08 /* (1<<3) Transaction Status */
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2002-04-25 23:58:02 +00:00
|
|
|
/* function codes
|
|
|
|
*/
|
|
|
|
#define ATP_FUNCMASK (3<<6) /* mask all but function */
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2002-04-25 23:58:02 +00:00
|
|
|
#define ATP_TREQ 1 /* (1<<6) Trans. REQuest */
|
|
|
|
#define ATP_TRESP 2 /* (2<<6) Trans. RESPonse */
|
|
|
|
#define ATP_TREL 3 /* (3<<6) Trans. RELease */
|
|
|
|
|
2002-08-28 21:04:11 +00:00
|
|
|
/* ------------------------- */
|
2002-04-25 23:58:02 +00:00
|
|
|
static dissector_handle_t asp_handle;
|
|
|
|
|
|
|
|
static int proto_atp = -1;
|
2002-08-02 23:36:07 +00:00
|
|
|
static int hf_atp_ctrlinfo = -1; /* guint8_t control information */
|
2002-04-26 07:41:31 +00:00
|
|
|
static int hf_atp_function = -1; /* bits 7,6 function */
|
|
|
|
static int hf_atp_xo = -1; /* bit 5 exactly-once */
|
|
|
|
static int hf_atp_eom = -1; /* bit 4 end-of-message */
|
|
|
|
static int hf_atp_sts = -1; /* bit 3 send transaction status */
|
|
|
|
static int hf_atp_treltimer = -1; /* bits 2,1,0 TRel timeout indicator */
|
2002-04-25 23:58:02 +00:00
|
|
|
|
2002-08-02 23:36:07 +00:00
|
|
|
static int hf_atp_bitmap = -1; /* guint8_t bitmap or sequence number */
|
|
|
|
static int hf_atp_tid = -1; /* guint16_t transaction id. */
|
2002-05-03 21:25:43 +00:00
|
|
|
static int hf_atp_user_bytes = -1;
|
2002-04-25 23:58:02 +00:00
|
|
|
|
2002-05-01 07:26:45 +00:00
|
|
|
static int hf_atp_segments = -1;
|
|
|
|
static int hf_atp_segment = -1;
|
|
|
|
static int hf_atp_segment_overlap = -1;
|
|
|
|
static int hf_atp_segment_overlap_conflict = -1;
|
|
|
|
static int hf_atp_segment_multiple_tails = -1;
|
|
|
|
static int hf_atp_segment_too_long_segment = -1;
|
|
|
|
static int hf_atp_segment_error = -1;
|
|
|
|
|
2002-08-28 21:04:11 +00:00
|
|
|
/* ------------------------- */
|
2002-06-29 21:27:39 +00:00
|
|
|
static int proto_zip = -1;
|
|
|
|
static dissector_handle_t zip_atp_handle;
|
|
|
|
|
|
|
|
static int hf_zip_function = -1;
|
|
|
|
static int hf_zip_atp_function = -1;
|
|
|
|
static int hf_zip_start_index = -1;
|
|
|
|
static int hf_zip_count = -1;
|
|
|
|
static int hf_zip_zero_value = -1;
|
|
|
|
|
|
|
|
static int hf_zip_network_count = -1;
|
|
|
|
static int hf_zip_network = -1;
|
|
|
|
static int hf_zip_network_start = -1;
|
|
|
|
static int hf_zip_network_end = -1;
|
|
|
|
|
|
|
|
static int hf_zip_flags = -1;
|
|
|
|
|
|
|
|
static int hf_zip_flags_zone_invalid = -1;
|
|
|
|
static int hf_zip_flags_use_broadcast = -1;
|
|
|
|
static int hf_zip_flags_only_one_zone = -1;
|
|
|
|
|
|
|
|
static int hf_zip_last_flag = -1;
|
|
|
|
|
|
|
|
static int hf_zip_zone_name = -1;
|
|
|
|
static int hf_zip_default_zone = -1;
|
|
|
|
|
|
|
|
static int hf_zip_multicast_length = -1;
|
|
|
|
static int hf_zip_multicast_address = -1;
|
|
|
|
|
|
|
|
static const value_string zip_function_vals[] = {
|
|
|
|
{1, "Query"},
|
|
|
|
{2, "Reply"},
|
|
|
|
{5, "GetNetInfo request"},
|
|
|
|
{6, "GetNetInfo reply"},
|
|
|
|
{7, "notify"},
|
|
|
|
{8, "Extended reply"},
|
|
|
|
{0, NULL}
|
|
|
|
};
|
|
|
|
|
|
|
|
static const value_string zip_atp_function_vals[] = {
|
|
|
|
{7, "GetMyZone"},
|
|
|
|
{8, "GetZoneList"},
|
|
|
|
{9, "GetLocalZones"},
|
|
|
|
{0, NULL}
|
|
|
|
};
|
|
|
|
|
|
|
|
static gint ett_zip = -1;
|
|
|
|
static gint ett_zip_flags = -1;
|
|
|
|
static gint ett_zip_zones_list = -1;
|
|
|
|
static gint ett_zip_network_list = -1;
|
|
|
|
|
2002-04-25 23:58:02 +00:00
|
|
|
/* --------------------------------
|
|
|
|
* from netatalk/include/atalk/ats.h
|
|
|
|
*/
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2002-04-25 23:58:02 +00:00
|
|
|
#define ASPFUNC_CLOSE 1
|
|
|
|
#define ASPFUNC_CMD 2
|
|
|
|
#define ASPFUNC_STAT 3
|
|
|
|
#define ASPFUNC_OPEN 4
|
|
|
|
#define ASPFUNC_TICKLE 5
|
|
|
|
#define ASPFUNC_WRITE 6
|
|
|
|
#define ASPFUNC_WRTCONT 7
|
|
|
|
#define ASPFUNC_ATTN 8
|
|
|
|
|
2002-08-28 21:04:11 +00:00
|
|
|
#define ASP_HDRSIZ 4
|
2002-04-25 23:58:02 +00:00
|
|
|
#define ASPERR_OK 0x0000
|
|
|
|
#define ASPERR_BADVERS 0xfbd6
|
|
|
|
#define ASPERR_BUFSMALL 0xfbd5
|
|
|
|
#define ASPERR_NOSESS 0xfbd4
|
|
|
|
#define ASPERR_NOSERV 0xfbd3
|
|
|
|
#define ASPERR_PARM 0xfbd2
|
|
|
|
#define ASPERR_SERVBUSY 0xfbd1
|
|
|
|
#define ASPERR_SESSCLOS 0xfbd0
|
|
|
|
#define ASPERR_SIZERR 0xfbcf
|
|
|
|
#define ASPERR_TOOMANY 0xfbce
|
|
|
|
#define ASPERR_NOACK 0xfbcd
|
|
|
|
|
|
|
|
static int proto_asp = -1;
|
|
|
|
static int hf_asp_func = -1;
|
|
|
|
static int hf_asp_error = -1;
|
2002-05-03 21:25:43 +00:00
|
|
|
static int hf_asp_socket = -1;
|
|
|
|
static int hf_asp_version = -1;
|
|
|
|
static int hf_asp_session_id = -1;
|
|
|
|
static int hf_asp_zero_value = -1;
|
|
|
|
static int hf_asp_init_error = -1;
|
|
|
|
static int hf_asp_attn_code = -1;
|
|
|
|
static int hf_asp_seq = -1;
|
|
|
|
static int hf_asp_size = -1;
|
|
|
|
|
|
|
|
/* status stuff same for asp and afp */
|
|
|
|
static int hf_asp_server_name = -1;
|
|
|
|
static int hf_asp_server_type = -1;
|
|
|
|
static int hf_asp_server_vers = -1;
|
|
|
|
static int hf_asp_server_uams = -1;
|
|
|
|
static int hf_asp_server_icon = -1;
|
|
|
|
static int hf_asp_server_directory = -1;
|
|
|
|
|
|
|
|
static int hf_asp_server_flag = -1;
|
|
|
|
static int hf_asp_server_flag_copyfile = -1;
|
|
|
|
static int hf_asp_server_flag_passwd = -1;
|
|
|
|
static int hf_asp_server_flag_no_save_passwd = -1;
|
|
|
|
static int hf_asp_server_flag_srv_msg = -1;
|
|
|
|
static int hf_asp_server_flag_srv_sig = -1;
|
|
|
|
static int hf_asp_server_flag_tcpip = -1;
|
|
|
|
static int hf_asp_server_flag_notify = -1;
|
|
|
|
static int hf_asp_server_flag_reconnect = -1;
|
|
|
|
static int hf_asp_server_flag_directory = -1;
|
|
|
|
static int hf_asp_server_flag_fast_copy = -1;
|
|
|
|
static int hf_asp_server_signature = -1;
|
|
|
|
|
|
|
|
static int hf_asp_server_addr_len = -1;
|
|
|
|
static int hf_asp_server_addr_type = -1;
|
|
|
|
static int hf_asp_server_addr_value = -1;
|
|
|
|
|
|
|
|
static gint ett_asp_status = -1;
|
|
|
|
static gint ett_asp_uams = -1;
|
|
|
|
static gint ett_asp_vers = -1;
|
|
|
|
static gint ett_asp_addr = -1;
|
2002-05-08 23:46:34 +00:00
|
|
|
static gint ett_asp_addr_line = -1;
|
2002-05-03 21:25:43 +00:00
|
|
|
static gint ett_asp_directory = -1;
|
|
|
|
static gint ett_asp_status_server_flag = -1;
|
2002-04-25 23:58:02 +00:00
|
|
|
|
|
|
|
static guint asp_packet_init_count = 200;
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
guint32 conversation;
|
2002-05-03 21:25:43 +00:00
|
|
|
guint8 src[4];
|
2002-04-25 23:58:02 +00:00
|
|
|
guint16 seq;
|
|
|
|
} asp_request_key;
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2002-04-25 23:58:02 +00:00
|
|
|
typedef struct {
|
2002-05-03 21:25:43 +00:00
|
|
|
guint8 value; /* command for asp, bitmap for atp */
|
2002-04-25 23:58:02 +00:00
|
|
|
} asp_request_val;
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2002-04-25 23:58:02 +00:00
|
|
|
static GHashTable *asp_request_hash = NULL;
|
|
|
|
static GMemChunk *asp_request_keys = NULL;
|
|
|
|
static GMemChunk *asp_request_vals = NULL;
|
|
|
|
|
|
|
|
/* Hash Functions */
|
|
|
|
static gint asp_equal (gconstpointer v, gconstpointer v2)
|
|
|
|
{
|
|
|
|
asp_request_key *val1 = (asp_request_key*)v;
|
|
|
|
asp_request_key *val2 = (asp_request_key*)v2;
|
|
|
|
|
|
|
|
if (val1->conversation == val2->conversation &&
|
2002-05-03 21:25:43 +00:00
|
|
|
val1->seq == val2->seq &&
|
|
|
|
!memcmp(val1->src, val2->src, 4)) {
|
2002-04-25 23:58:02 +00:00
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static guint asp_hash (gconstpointer v)
|
|
|
|
{
|
|
|
|
asp_request_key *asp_key = (asp_request_key*)v;
|
|
|
|
return asp_key->seq;
|
|
|
|
}
|
|
|
|
|
2002-05-03 21:25:43 +00:00
|
|
|
/* ------------------------------------ */
|
|
|
|
static GHashTable *atp_request_hash = NULL;
|
|
|
|
static GMemChunk *atp_request_keys = NULL;
|
|
|
|
static GMemChunk *atp_request_vals = NULL;
|
|
|
|
|
|
|
|
|
2002-04-25 23:58:02 +00:00
|
|
|
/* ------------------------------------ */
|
1999-12-08 23:55:01 +00:00
|
|
|
static int proto_nbp = -1;
|
|
|
|
static int hf_nbp_op = -1;
|
|
|
|
static int hf_nbp_info = -1;
|
|
|
|
static int hf_nbp_count = -1;
|
|
|
|
static int hf_nbp_tid = -1;
|
|
|
|
|
1999-12-09 17:06:37 +00:00
|
|
|
static int hf_nbp_node_net = -1;
|
|
|
|
static int hf_nbp_node_port = -1;
|
|
|
|
static int hf_nbp_node_node = -1;
|
|
|
|
static int hf_nbp_node_enum = -1;
|
|
|
|
static int hf_nbp_node_object = -1;
|
|
|
|
static int hf_nbp_node_type = -1;
|
|
|
|
static int hf_nbp_node_zone = -1;
|
|
|
|
|
|
|
|
static int proto_rtmp = -1;
|
|
|
|
static int hf_rtmp_net = -1;
|
|
|
|
static int hf_rtmp_node_len = -1;
|
|
|
|
static int hf_rtmp_node = -1;
|
2000-11-13 04:26:14 +00:00
|
|
|
static int hf_rtmp_tuple_net = -1;
|
|
|
|
static int hf_rtmp_tuple_range_start = -1;
|
|
|
|
static int hf_rtmp_tuple_range_end = -1;
|
|
|
|
static int hf_rtmp_tuple_dist = -1;
|
|
|
|
static int hf_rtmp_function = -1;
|
1999-12-09 04:02:50 +00:00
|
|
|
|
2002-04-25 23:58:02 +00:00
|
|
|
static gint ett_atp = -1;
|
|
|
|
|
2002-05-01 07:26:45 +00:00
|
|
|
static gint ett_atp_segments = -1;
|
2002-04-30 22:05:33 +00:00
|
|
|
static gint ett_atp_segment = -1;
|
2002-04-25 23:58:02 +00:00
|
|
|
static gint ett_atp_info = -1;
|
|
|
|
static gint ett_asp = -1;
|
|
|
|
|
1999-12-08 23:55:01 +00:00
|
|
|
static gint ett_nbp = -1;
|
|
|
|
static gint ett_nbp_info = -1;
|
1999-12-09 04:02:50 +00:00
|
|
|
static gint ett_nbp_node = -1;
|
1999-12-09 17:06:37 +00:00
|
|
|
static gint ett_rtmp = -1;
|
|
|
|
static gint ett_rtmp_tuple = -1;
|
1999-11-16 11:44:20 +00:00
|
|
|
static gint ett_ddp = -1;
|
2001-11-30 07:14:22 +00:00
|
|
|
static gint ett_llap = -1;
|
1999-12-09 04:02:50 +00:00
|
|
|
static gint ett_pstring = -1;
|
1999-11-16 11:44:20 +00:00
|
|
|
|
2002-06-07 10:11:41 +00:00
|
|
|
fragment_items atp_frag_items = {
|
|
|
|
&ett_atp_segment,
|
|
|
|
&ett_atp_segments,
|
|
|
|
&hf_atp_segments,
|
|
|
|
&hf_atp_segment,
|
|
|
|
&hf_atp_segment_overlap,
|
|
|
|
&hf_atp_segment_overlap_conflict,
|
|
|
|
&hf_atp_segment_multiple_tails,
|
|
|
|
&hf_atp_segment_too_long_segment,
|
|
|
|
&hf_atp_segment_error,
|
|
|
|
"segments"
|
|
|
|
};
|
|
|
|
|
2000-05-28 22:59:18 +00:00
|
|
|
static dissector_table_t ddp_dissector_table;
|
|
|
|
|
2001-11-26 01:03:35 +00:00
|
|
|
static dissector_handle_t data_handle;
|
|
|
|
|
2001-11-30 07:14:22 +00:00
|
|
|
#define DDP_SHORT_HEADER_SIZE 5
|
|
|
|
|
2000-11-11 09:18:15 +00:00
|
|
|
/*
|
|
|
|
* P = Padding, H = Hops, L = Len
|
|
|
|
*
|
|
|
|
* PPHHHHLL LLLLLLLL
|
|
|
|
*
|
|
|
|
* Assumes the argument is in host byte order.
|
|
|
|
*/
|
|
|
|
#define ddp_hops(x) ( ( x >> 10) & 0x3C )
|
|
|
|
#define ddp_len(x) ( x & 0x03ff )
|
1999-02-08 20:02:35 +00:00
|
|
|
typedef struct _e_ddp {
|
|
|
|
guint16 hops_len; /* combines pad, hops, and len */
|
1998-10-16 01:18:35 +00:00
|
|
|
guint16 sum,dnet,snet;
|
|
|
|
guint8 dnode,snode;
|
|
|
|
guint8 dport,sport;
|
|
|
|
guint8 type;
|
|
|
|
} e_ddp;
|
|
|
|
|
1999-10-07 17:11:11 +00:00
|
|
|
#define DDP_HEADER_SIZE 13
|
1998-10-16 01:18:35 +00:00
|
|
|
|
1999-10-22 08:11:40 +00:00
|
|
|
|
|
|
|
static const value_string op_vals[] = {
|
|
|
|
{DDP_RTMPDATA, "AppleTalk Routing Table response or data" },
|
|
|
|
{DDP_NBP, "AppleTalk Name Binding Protocol packet"},
|
|
|
|
{DDP_ATP, "AppleTalk Transaction Protocol packet"},
|
|
|
|
{DDP_AEP, "AppleTalk Echo Protocol packet"},
|
|
|
|
{DDP_RTMPREQ, "AppleTalk Routing Table request"},
|
|
|
|
{DDP_ZIP, "AppleTalk Zone Information Protocol packet"},
|
|
|
|
{DDP_ADSP, "AppleTalk Data Stream Protocol"},
|
2000-05-22 18:09:36 +00:00
|
|
|
{DDP_EIGRP, "Cisco EIGRP for AppleTalk"},
|
1999-10-22 08:11:40 +00:00
|
|
|
{0, NULL}
|
|
|
|
};
|
|
|
|
|
2000-11-13 04:26:14 +00:00
|
|
|
static const value_string rtmp_function_vals[] = {
|
|
|
|
{1, "Request"},
|
|
|
|
{2, "Route Data Request (split horizon processed)"},
|
|
|
|
{3, "Route Data Request (no split horizon processing)"},
|
|
|
|
{0, NULL}
|
|
|
|
};
|
|
|
|
|
2002-04-30 22:05:33 +00:00
|
|
|
#define NBP_BROADCAST 1
|
1999-12-09 17:06:37 +00:00
|
|
|
#define NBP_LOOKUP 2
|
|
|
|
#define NBP_FORWARD 4
|
|
|
|
#define NBP_REPLY 3
|
|
|
|
|
1999-12-08 23:55:01 +00:00
|
|
|
static const value_string nbp_op_vals[] = {
|
2002-04-30 22:05:33 +00:00
|
|
|
{NBP_BROADCAST, "broadcast request"},
|
1999-12-08 23:55:01 +00:00
|
|
|
{NBP_LOOKUP, "lookup"},
|
1999-12-09 17:06:37 +00:00
|
|
|
{NBP_FORWARD, "forward request"},
|
|
|
|
{NBP_REPLY, "reply"},
|
1999-12-08 23:55:01 +00:00
|
|
|
{0, NULL}
|
|
|
|
};
|
|
|
|
|
2002-04-25 23:58:02 +00:00
|
|
|
static const value_string atp_function_vals[] = {
|
|
|
|
{ATP_TREQ ,"REQuest"},
|
|
|
|
{ATP_TRESP ,"RESPonse"},
|
|
|
|
{ATP_TREL ,"RELease"},
|
|
|
|
{0, NULL}
|
|
|
|
};
|
|
|
|
|
2002-04-26 07:41:31 +00:00
|
|
|
static const value_string atp_trel_timer_vals[] = {
|
|
|
|
{0, "30 seconds"},
|
|
|
|
{1, "1 minute"},
|
|
|
|
{2, "2 minutes"},
|
|
|
|
{3, "4 minutes"},
|
|
|
|
{4, "8 minutes"},
|
2002-04-25 23:58:02 +00:00
|
|
|
{0, NULL}
|
|
|
|
};
|
|
|
|
|
|
|
|
/*
|
|
|
|
*/
|
|
|
|
static const value_string asp_func_vals[] = {
|
|
|
|
{ASPFUNC_CLOSE, "CloseSession" },
|
|
|
|
{ASPFUNC_CMD, "Command" },
|
|
|
|
{ASPFUNC_STAT, "GetStatus" },
|
|
|
|
{ASPFUNC_OPEN, "OpenSession" },
|
|
|
|
{ASPFUNC_TICKLE, "Tickle" },
|
|
|
|
{ASPFUNC_WRITE, "Write" },
|
2002-04-26 07:41:31 +00:00
|
|
|
{ASPFUNC_WRTCONT, "Write Cont" },
|
2002-04-25 23:58:02 +00:00
|
|
|
{ASPFUNC_ATTN, "Attention" },
|
|
|
|
{0, NULL } };
|
|
|
|
|
2002-04-28 19:21:39 +00:00
|
|
|
const value_string asp_error_vals[] = {
|
2002-06-29 21:27:39 +00:00
|
|
|
{AFP_OK , "success"},
|
2002-04-25 23:58:02 +00:00
|
|
|
{AFPERR_ACCESS , "permission denied" },
|
|
|
|
{AFPERR_AUTHCONT , "logincont" },
|
|
|
|
{AFPERR_BADUAM , "uam doesn't exist" },
|
|
|
|
{AFPERR_BADVERS , "bad afp version number" },
|
|
|
|
{AFPERR_BITMAP , "invalid bitmap" },
|
|
|
|
{AFPERR_CANTMOVE , "can't move file" },
|
|
|
|
{AFPERR_DENYCONF , "file synchronization locks conflict" },
|
|
|
|
{AFPERR_DIRNEMPT , "directory not empty" },
|
|
|
|
{AFPERR_DFULL , "disk full" },
|
|
|
|
{AFPERR_EOF , "end of file" },
|
|
|
|
{AFPERR_BUSY , "FileBusy" },
|
|
|
|
{AFPERR_FLATVOL , "volume doesn't support directories" },
|
|
|
|
{AFPERR_NOITEM , "ItemNotFound" },
|
|
|
|
{AFPERR_LOCK , "LockErr" },
|
|
|
|
{AFPERR_MISC , "misc. err" },
|
|
|
|
{AFPERR_NLOCK , "no more locks" },
|
|
|
|
{AFPERR_NOSRVR , "no response by server at that address" },
|
|
|
|
{AFPERR_EXIST , "object already exists" },
|
|
|
|
{AFPERR_NOOBJ , "object not found" },
|
|
|
|
{AFPERR_PARAM , "parameter error" },
|
|
|
|
{AFPERR_NORANGE , "no range lock" },
|
|
|
|
{AFPERR_RANGEOVR , "range overlap" },
|
|
|
|
{AFPERR_SESSCLOS , "session closed" },
|
|
|
|
{AFPERR_NOTAUTH , "user not authenticated" },
|
|
|
|
{AFPERR_NOOP , "command not supported" },
|
|
|
|
{AFPERR_BADTYPE , "object is the wrong type" },
|
|
|
|
{AFPERR_NFILE , "too many files open" },
|
|
|
|
{AFPERR_SHUTDOWN , "server is going down" },
|
|
|
|
{AFPERR_NORENAME , "can't rename" },
|
|
|
|
{AFPERR_NODIR , "couldn't find directory" },
|
|
|
|
{AFPERR_ITYPE , "wrong icon type" },
|
|
|
|
{AFPERR_VLOCK , "volume locked" },
|
|
|
|
{AFPERR_OLOCK , "object locked" },
|
|
|
|
{AFPERR_CTNSHRD , "share point contains a share point" },
|
|
|
|
{AFPERR_NOID , "file thread not found" },
|
|
|
|
{AFPERR_EXISTID , "file already has an id" },
|
|
|
|
{AFPERR_DIFFVOL , "different volume" },
|
|
|
|
{AFPERR_CATCHNG , "catalog has changed" },
|
|
|
|
{AFPERR_SAMEOBJ , "source file == destination file" },
|
|
|
|
{AFPERR_BADID , "non-existent file id" },
|
|
|
|
{AFPERR_PWDSAME , "same password/can't change password" },
|
|
|
|
{AFPERR_PWDSHORT , "password too short" },
|
|
|
|
{AFPERR_PWDEXPR , "password expired" },
|
|
|
|
{AFPERR_INSHRD , "folder being shared is inside a shared folder." },
|
|
|
|
{AFPERR_INTRASH , "shared folder in trash." },
|
|
|
|
{AFPERR_PWDCHNG , "password needs to be changed" },
|
|
|
|
{AFPERR_PWDPOLCY , "password fails policy check" },
|
|
|
|
{AFPERR_USRLOGIN , "user already logged on" },
|
|
|
|
{0, NULL } };
|
|
|
|
|
2000-11-13 04:26:14 +00:00
|
|
|
/*
|
|
|
|
* XXX - do this with an FT_UINT_STRING?
|
|
|
|
* Unfortunately, you can't extract from an FT_UINT_STRING the string,
|
|
|
|
* which we'd want to do in order to put it into the "Data:" portion.
|
2002-04-26 07:41:31 +00:00
|
|
|
*
|
|
|
|
* Are these always in the Mac extended character set?
|
2000-11-13 04:26:14 +00:00
|
|
|
*/
|
2002-05-10 23:20:38 +00:00
|
|
|
static int dissect_pascal_string(tvbuff_t *tvb, int offset, proto_tree *tree,
|
2000-11-13 04:26:14 +00:00
|
|
|
int hf_index)
|
1999-12-09 04:02:50 +00:00
|
|
|
{
|
|
|
|
int len;
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2000-11-13 04:26:14 +00:00
|
|
|
len = tvb_get_guint8(tvb, offset);
|
1999-12-09 04:02:50 +00:00
|
|
|
offset++;
|
|
|
|
|
|
|
|
if ( tree )
|
|
|
|
{
|
|
|
|
char *tmp;
|
|
|
|
proto_tree *item;
|
|
|
|
proto_tree *subtree;
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2000-11-13 04:26:14 +00:00
|
|
|
/*
|
|
|
|
* XXX - if we could do this inside the protocol tree
|
|
|
|
* code, we could perhaps avoid allocating and freeing
|
|
|
|
* this string buffer.
|
|
|
|
*/
|
1999-12-09 04:02:50 +00:00
|
|
|
tmp = g_malloc( len+1 );
|
2000-11-13 04:26:14 +00:00
|
|
|
tvb_memcpy(tvb, tmp, offset, len);
|
1999-12-09 04:02:50 +00:00
|
|
|
tmp[len] = 0;
|
2000-11-13 04:26:14 +00:00
|
|
|
item = proto_tree_add_string(tree, hf_index, tvb, offset-1, len+1, tmp);
|
1999-12-09 04:02:50 +00:00
|
|
|
|
|
|
|
subtree = proto_item_add_subtree(item, ett_pstring);
|
2000-11-13 04:26:14 +00:00
|
|
|
proto_tree_add_text(subtree, tvb, offset-1, 1, "Length: %d", len);
|
|
|
|
proto_tree_add_text(subtree, tvb, offset, len, "Data: %s", tmp);
|
2002-08-28 21:04:11 +00:00
|
|
|
|
1999-12-09 04:02:50 +00:00
|
|
|
g_free(tmp);
|
|
|
|
}
|
|
|
|
offset += len;
|
2002-08-28 21:04:11 +00:00
|
|
|
|
|
|
|
return offset;
|
1999-12-09 04:02:50 +00:00
|
|
|
}
|
|
|
|
|
1999-12-08 23:21:08 +00:00
|
|
|
static void
|
2000-11-13 04:26:14 +00:00
|
|
|
dissect_rtmp_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
|
|
|
|
proto_tree *rtmp_tree;
|
|
|
|
proto_item *ti;
|
|
|
|
guint8 function;
|
|
|
|
|
2001-12-10 00:26:21 +00:00
|
|
|
if (check_col(pinfo->cinfo, COL_PROTOCOL))
|
|
|
|
col_set_str(pinfo->cinfo, COL_PROTOCOL, "RTMP");
|
|
|
|
if (check_col(pinfo->cinfo, COL_INFO))
|
|
|
|
col_clear(pinfo->cinfo, COL_INFO);
|
2001-01-22 03:33:45 +00:00
|
|
|
|
|
|
|
function = tvb_get_guint8(tvb, 0);
|
2000-11-13 04:26:14 +00:00
|
|
|
|
2001-12-10 00:26:21 +00:00
|
|
|
if (check_col(pinfo->cinfo, COL_INFO))
|
|
|
|
col_add_fstr(pinfo->cinfo, COL_INFO, "%s",
|
2002-06-25 02:56:59 +00:00
|
|
|
val_to_str(function, rtmp_function_vals, "Unknown function (%02x)"));
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2000-11-13 04:26:14 +00:00
|
|
|
if (tree) {
|
|
|
|
ti = proto_tree_add_item(tree, proto_rtmp, tvb, 0, 1, FALSE);
|
|
|
|
rtmp_tree = proto_item_add_subtree(ti, ett_rtmp);
|
|
|
|
|
|
|
|
proto_tree_add_uint(rtmp_tree, hf_rtmp_function, tvb, 0, 1, function);
|
|
|
|
}
|
1999-12-08 23:25:37 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2000-11-13 04:26:14 +00:00
|
|
|
dissect_rtmp_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
|
1999-12-09 17:06:37 +00:00
|
|
|
proto_tree *rtmp_tree;
|
|
|
|
proto_item *ti;
|
2000-11-13 04:26:14 +00:00
|
|
|
int offset = 0;
|
1999-12-09 17:06:37 +00:00
|
|
|
guint16 net;
|
|
|
|
guint8 nodelen,nodelen_bits;
|
|
|
|
guint16 node; /* might be more than 8 bits */
|
|
|
|
int i;
|
|
|
|
|
2001-12-10 00:26:21 +00:00
|
|
|
if (check_col(pinfo->cinfo, COL_PROTOCOL))
|
|
|
|
col_set_str(pinfo->cinfo, COL_PROTOCOL, "RTMP");
|
|
|
|
if (check_col(pinfo->cinfo, COL_INFO))
|
|
|
|
col_clear(pinfo->cinfo, COL_INFO);
|
1999-12-09 17:06:37 +00:00
|
|
|
|
2000-11-13 04:26:14 +00:00
|
|
|
net = tvb_get_ntohs(tvb, offset);
|
|
|
|
nodelen_bits = tvb_get_guint8(tvb, offset+2);
|
1999-12-09 17:06:37 +00:00
|
|
|
if ( nodelen_bits <= 8 ) {
|
2000-11-13 04:26:14 +00:00
|
|
|
node = tvb_get_guint8(tvb, offset)+1;
|
|
|
|
nodelen = 1;
|
1999-12-09 17:06:37 +00:00
|
|
|
} else {
|
2000-11-13 04:26:14 +00:00
|
|
|
node = tvb_get_ntohs(tvb, offset);
|
|
|
|
nodelen = 2;
|
1999-12-09 17:06:37 +00:00
|
|
|
}
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2001-12-10 00:26:21 +00:00
|
|
|
if (check_col(pinfo->cinfo, COL_INFO))
|
|
|
|
col_add_fstr(pinfo->cinfo, COL_INFO, "Net: %u Node Len: %u Node: %u",
|
1999-12-09 17:06:37 +00:00
|
|
|
net, nodelen_bits, node);
|
2002-08-28 21:04:11 +00:00
|
|
|
|
1999-12-09 17:06:37 +00:00
|
|
|
if (tree) {
|
Allow a length of -1 to be specified when adding FT_NONE and FT_PROTOCOL
items to the protocol tree; it's interpreted as "the rest of the data in
the tvbuff". This can be used if
1) the item covers the entire packet or the remaining payload in
the packet
or
2) the item's length won't be known until it's dissected, and
will be then set with "proto_item_set_len()" - if an
exception is thrown in the dissection, it means the item ran
*past* the end of the tvbuff, so saying it runs to the end of
the tvbuff is reasonable.
Convert a number of "proto_tree_add_XXX()" calls using
"tvb_length_remaining()", values derived from the result of
"tvb_length()", or 0 (in the case of items whose length is unknown) to
use -1 instead (using 0 means that if an exception is thrown, selecting
the item highlights nothing; using -1 means it highlights all the data
for that item that's available).
In some places where "tvb_length()" or "tvb_length_remaining()" was used
to determine how large a packet is, use "tvb_reported_length()" or
"tvb_reported_length_remaining()", instead - the first two calls
indicate how much captured data was in the packet, the latter two calls
indicate how large the packet actually was (and the fact that using the
latter could cause BoundsError exceptions to be thrown is a feature - if
such an exception is thrown, the frame really *was* short, and it should
be tagged as such).
Replace some "proto_tree_add_XXX()" calls with equivalent
"proto_tree_add_item()" calls.
Fix some indentation.
svn path=/trunk/; revision=4578
2002-01-20 22:12:39 +00:00
|
|
|
ti = proto_tree_add_item(tree, proto_rtmp, tvb, offset, -1, FALSE);
|
1999-12-09 17:06:37 +00:00
|
|
|
rtmp_tree = proto_item_add_subtree(ti, ett_rtmp);
|
|
|
|
|
2000-11-13 04:26:14 +00:00
|
|
|
proto_tree_add_uint(rtmp_tree, hf_rtmp_net, tvb, offset, 2, net);
|
|
|
|
proto_tree_add_uint(rtmp_tree, hf_rtmp_node_len, tvb, offset+2, 1,
|
|
|
|
nodelen_bits);
|
|
|
|
proto_tree_add_uint(rtmp_tree, hf_rtmp_node, tvb, offset+3, nodelen,
|
|
|
|
node);
|
1999-12-09 17:06:37 +00:00
|
|
|
offset += 3 + nodelen;
|
|
|
|
|
|
|
|
i = 1;
|
2000-11-13 08:58:17 +00:00
|
|
|
while (tvb_offset_exists(tvb, offset)) {
|
2000-11-13 04:26:14 +00:00
|
|
|
proto_tree *tuple_item, *tuple_tree;
|
|
|
|
guint16 tuple_net;
|
|
|
|
guint8 tuple_dist;
|
|
|
|
guint16 tuple_range_end;
|
|
|
|
|
|
|
|
tuple_net = tvb_get_ntohs(tvb, offset);
|
|
|
|
tuple_dist = tvb_get_guint8(tvb, offset+2);
|
|
|
|
|
|
|
|
if (tuple_dist & 0x80) {
|
|
|
|
tuple_range_end = tvb_get_ntohs(tvb, offset+3);
|
|
|
|
tuple_item = proto_tree_add_text(rtmp_tree, tvb, offset, 6,
|
|
|
|
"Tuple %d: Range Start: %u Dist: %u Range End: %u",
|
|
|
|
i, tuple_net, tuple_dist&0x7F, tuple_range_end);
|
|
|
|
} else {
|
|
|
|
tuple_item = proto_tree_add_text(rtmp_tree, tvb, offset, 3,
|
|
|
|
"Tuple %d: Net: %u Dist: %u",
|
1999-12-09 17:06:37 +00:00
|
|
|
i, tuple_net, tuple_dist);
|
2000-11-13 04:26:14 +00:00
|
|
|
}
|
|
|
|
tuple_tree = proto_item_add_subtree(tuple_item, ett_rtmp_tuple);
|
1999-12-09 17:06:37 +00:00
|
|
|
|
2000-11-13 04:26:14 +00:00
|
|
|
if (tuple_dist & 0x80) {
|
2002-08-28 21:04:11 +00:00
|
|
|
proto_tree_add_uint(tuple_tree, hf_rtmp_tuple_range_start, tvb, offset, 2,
|
1999-12-09 17:06:37 +00:00
|
|
|
tuple_net);
|
2000-11-13 04:26:14 +00:00
|
|
|
} else {
|
2002-08-28 21:04:11 +00:00
|
|
|
proto_tree_add_uint(tuple_tree, hf_rtmp_tuple_net, tvb, offset, 2,
|
2000-11-13 04:26:14 +00:00
|
|
|
tuple_net);
|
|
|
|
}
|
|
|
|
proto_tree_add_uint(tuple_tree, hf_rtmp_tuple_dist, tvb, offset+2, 1,
|
|
|
|
tuple_dist & 0x7F);
|
|
|
|
|
|
|
|
if (tuple_dist & 0x80) {
|
|
|
|
/*
|
|
|
|
* Extended network tuple.
|
|
|
|
*/
|
2002-08-28 21:04:11 +00:00
|
|
|
proto_tree_add_item(tuple_tree, hf_rtmp_tuple_range_end, tvb, offset+3, 2,
|
2000-11-13 04:26:14 +00:00
|
|
|
FALSE);
|
|
|
|
offset += 6;
|
|
|
|
} else
|
|
|
|
offset += 3;
|
|
|
|
|
|
|
|
i++;
|
|
|
|
}
|
1999-12-09 17:06:37 +00:00
|
|
|
}
|
1999-12-08 23:21:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2000-11-13 04:26:14 +00:00
|
|
|
dissect_nbp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
|
1999-12-08 23:55:01 +00:00
|
|
|
proto_tree *nbp_tree;
|
|
|
|
proto_tree *nbp_info_tree;
|
|
|
|
proto_item *ti, *info_item;
|
2000-11-13 04:26:14 +00:00
|
|
|
int offset = 0;
|
|
|
|
guint8 info;
|
1999-12-08 23:55:01 +00:00
|
|
|
guint op, count;
|
2001-04-27 01:27:37 +00:00
|
|
|
unsigned int i;
|
1999-12-08 23:55:01 +00:00
|
|
|
|
2001-12-10 00:26:21 +00:00
|
|
|
if (check_col(pinfo->cinfo, COL_PROTOCOL))
|
|
|
|
col_set_str(pinfo->cinfo, COL_PROTOCOL, "NBP");
|
|
|
|
if (check_col(pinfo->cinfo, COL_INFO))
|
|
|
|
col_clear(pinfo->cinfo, COL_INFO);
|
1999-12-08 23:55:01 +00:00
|
|
|
|
2000-11-13 04:26:14 +00:00
|
|
|
info = tvb_get_guint8(tvb, offset);
|
|
|
|
op = info >> 4;
|
|
|
|
count = info & 0x0F;
|
1999-12-08 23:55:01 +00:00
|
|
|
|
2001-12-10 00:26:21 +00:00
|
|
|
if (check_col(pinfo->cinfo, COL_INFO))
|
|
|
|
col_add_fstr(pinfo->cinfo, COL_INFO, "Op: %s Count: %u",
|
2000-11-13 04:26:14 +00:00
|
|
|
val_to_str(op, nbp_op_vals, "Unknown (0x%01x)"), count);
|
2002-08-28 21:04:11 +00:00
|
|
|
|
1999-12-08 23:55:01 +00:00
|
|
|
if (tree) {
|
Allow a length of -1 to be specified when adding FT_NONE and FT_PROTOCOL
items to the protocol tree; it's interpreted as "the rest of the data in
the tvbuff". This can be used if
1) the item covers the entire packet or the remaining payload in
the packet
or
2) the item's length won't be known until it's dissected, and
will be then set with "proto_item_set_len()" - if an
exception is thrown in the dissection, it means the item ran
*past* the end of the tvbuff, so saying it runs to the end of
the tvbuff is reasonable.
Convert a number of "proto_tree_add_XXX()" calls using
"tvb_length_remaining()", values derived from the result of
"tvb_length()", or 0 (in the case of items whose length is unknown) to
use -1 instead (using 0 means that if an exception is thrown, selecting
the item highlights nothing; using -1 means it highlights all the data
for that item that's available).
In some places where "tvb_length()" or "tvb_length_remaining()" was used
to determine how large a packet is, use "tvb_reported_length()" or
"tvb_reported_length_remaining()", instead - the first two calls
indicate how much captured data was in the packet, the latter two calls
indicate how large the packet actually was (and the fact that using the
latter could cause BoundsError exceptions to be thrown is a feature - if
such an exception is thrown, the frame really *was* short, and it should
be tagged as such).
Replace some "proto_tree_add_XXX()" calls with equivalent
"proto_tree_add_item()" calls.
Fix some indentation.
svn path=/trunk/; revision=4578
2002-01-20 22:12:39 +00:00
|
|
|
ti = proto_tree_add_item(tree, proto_nbp, tvb, offset, -1, FALSE);
|
1999-12-08 23:55:01 +00:00
|
|
|
nbp_tree = proto_item_add_subtree(ti, ett_nbp);
|
|
|
|
|
2000-11-13 04:26:14 +00:00
|
|
|
info_item = proto_tree_add_uint_format(nbp_tree, hf_nbp_info, tvb, offset, 1,
|
|
|
|
info,
|
|
|
|
"Info: 0x%01X Operation: %s Count: %u", info,
|
|
|
|
val_to_str(op, nbp_op_vals, "Unknown (0x%01X)"),
|
1999-12-08 23:55:01 +00:00
|
|
|
count);
|
2000-11-13 04:26:14 +00:00
|
|
|
nbp_info_tree = proto_item_add_subtree(info_item, ett_nbp_info);
|
|
|
|
proto_tree_add_uint(nbp_info_tree, hf_nbp_op, tvb, offset, 1, info);
|
|
|
|
proto_tree_add_uint(nbp_info_tree, hf_nbp_count, tvb, offset, 1, info);
|
|
|
|
proto_tree_add_item(nbp_tree, hf_nbp_tid, tvb, offset+1, 1, FALSE);
|
|
|
|
offset += 2;
|
1999-12-09 04:02:50 +00:00
|
|
|
|
|
|
|
for (i=0; i<count; i++) {
|
2000-11-13 04:26:14 +00:00
|
|
|
proto_tree *node_item,*node_tree;
|
|
|
|
int soffset = offset;
|
1999-12-09 04:02:50 +00:00
|
|
|
|
2002-08-28 21:04:11 +00:00
|
|
|
node_item = proto_tree_add_text(nbp_tree, tvb, offset, -1,
|
2002-06-29 22:15:41 +00:00
|
|
|
"Node %u", i+1);
|
2000-11-13 04:26:14 +00:00
|
|
|
node_tree = proto_item_add_subtree(node_item, ett_nbp_node);
|
|
|
|
|
|
|
|
proto_tree_add_item(node_tree, hf_nbp_node_net, tvb, offset, 2, FALSE);
|
|
|
|
offset += 2;
|
|
|
|
proto_tree_add_item(node_tree, hf_nbp_node_node, tvb, offset, 1, FALSE);
|
|
|
|
offset++;
|
|
|
|
proto_tree_add_item(node_tree, hf_nbp_node_port, tvb, offset, 1, FALSE);
|
|
|
|
offset++;
|
|
|
|
proto_tree_add_item(node_tree, hf_nbp_node_enum, tvb, offset, 1, FALSE);
|
|
|
|
offset++;
|
|
|
|
|
|
|
|
offset = dissect_pascal_string(tvb, offset, node_tree, hf_nbp_node_object);
|
|
|
|
offset = dissect_pascal_string(tvb, offset, node_tree, hf_nbp_node_type);
|
|
|
|
offset = dissect_pascal_string(tvb, offset, node_tree, hf_nbp_node_zone);
|
|
|
|
|
|
|
|
proto_item_set_len(node_item, offset-soffset);
|
|
|
|
}
|
1999-12-08 23:55:01 +00:00
|
|
|
}
|
|
|
|
|
1999-12-08 23:21:08 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2002-08-28 21:04:11 +00:00
|
|
|
/* -----------------------------
|
2002-04-30 22:05:33 +00:00
|
|
|
ATP protocol cf. inside appletalk chap. 9
|
|
|
|
desegmentation from packet-ieee80211.c
|
2002-04-25 23:58:02 +00:00
|
|
|
*/
|
|
|
|
static void
|
|
|
|
dissect_atp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
|
2002-04-30 22:05:33 +00:00
|
|
|
proto_tree *atp_tree = NULL;
|
2002-04-25 23:58:02 +00:00
|
|
|
proto_item *ti;
|
|
|
|
proto_tree *atp_info_tree;
|
|
|
|
proto_item *info_item;
|
|
|
|
int offset = 0;
|
|
|
|
guint8 ctrlinfo;
|
2002-04-30 22:05:33 +00:00
|
|
|
guint8 frag_number = 0;
|
2002-04-25 23:58:02 +00:00
|
|
|
guint op;
|
|
|
|
guint16 tid;
|
2002-05-03 21:25:43 +00:00
|
|
|
guint8 query;
|
2002-04-25 23:58:02 +00:00
|
|
|
struct aspinfo aspinfo;
|
2002-04-30 22:05:33 +00:00
|
|
|
tvbuff_t *new_tvb = NULL;
|
|
|
|
gboolean save_fragmented;
|
|
|
|
gboolean more_fragment = FALSE;
|
2002-04-25 23:58:02 +00:00
|
|
|
int len;
|
2002-04-30 22:05:33 +00:00
|
|
|
guint8 bitmap;
|
2002-05-03 21:25:43 +00:00
|
|
|
guint8 nbe = 0;
|
|
|
|
guint8 t = 0;
|
|
|
|
conversation_t *conversation;
|
|
|
|
asp_request_key request_key, *new_request_key;
|
|
|
|
asp_request_val *request_val;
|
|
|
|
|
2002-04-25 23:58:02 +00:00
|
|
|
if (check_col(pinfo->cinfo, COL_PROTOCOL))
|
|
|
|
col_set_str(pinfo->cinfo, COL_PROTOCOL, "ATP");
|
|
|
|
|
|
|
|
ctrlinfo = tvb_get_guint8(tvb, offset);
|
2002-04-30 22:05:33 +00:00
|
|
|
bitmap = tvb_get_guint8(tvb, offset +1);
|
|
|
|
tid = tvb_get_ntohs(tvb, offset +2);
|
|
|
|
|
2002-05-03 21:25:43 +00:00
|
|
|
t = bitmap;
|
|
|
|
while(t) {
|
|
|
|
nbe++;
|
|
|
|
t >>= 1;
|
|
|
|
}
|
|
|
|
|
2002-04-25 23:58:02 +00:00
|
|
|
op = ctrlinfo >> 6;
|
|
|
|
|
2002-04-26 07:41:31 +00:00
|
|
|
aspinfo.reply = (0x80 == (ctrlinfo & ATP_FUNCMASK))?1:0;
|
|
|
|
aspinfo.release = (0xC0 == (ctrlinfo & ATP_FUNCMASK))?1:0;
|
2002-04-25 23:58:02 +00:00
|
|
|
aspinfo.seq = tid;
|
|
|
|
aspinfo.code = 0;
|
2002-05-03 21:25:43 +00:00
|
|
|
query = (!aspinfo.reply && !aspinfo.release);
|
|
|
|
|
|
|
|
conversation = find_conversation(&pinfo->src, &pinfo->dst, pinfo->ptype,
|
|
|
|
pinfo->srcport, pinfo->destport, 0);
|
2002-04-25 23:58:02 +00:00
|
|
|
|
2002-05-03 21:25:43 +00:00
|
|
|
if (conversation == NULL)
|
|
|
|
{
|
|
|
|
conversation = conversation_new(&pinfo->src, &pinfo->dst,
|
|
|
|
pinfo->ptype, pinfo->srcport, pinfo->destport, 0);
|
|
|
|
}
|
|
|
|
|
|
|
|
request_key.conversation = conversation->index;
|
|
|
|
memcpy(request_key.src, (!aspinfo.reply)?pinfo->src.data:pinfo->dst.data, 4);
|
|
|
|
request_key.seq = aspinfo.seq;
|
|
|
|
|
|
|
|
request_val = (asp_request_val *) g_hash_table_lookup(atp_request_hash, &request_key);
|
|
|
|
|
|
|
|
if (!request_val && query ) {
|
|
|
|
new_request_key = g_mem_chunk_alloc(atp_request_keys);
|
|
|
|
*new_request_key = request_key;
|
|
|
|
|
|
|
|
request_val = g_mem_chunk_alloc(atp_request_vals);
|
|
|
|
request_val->value = nbe;
|
|
|
|
|
|
|
|
g_hash_table_insert(atp_request_hash, new_request_key,request_val);
|
|
|
|
}
|
|
|
|
|
2002-08-28 21:04:11 +00:00
|
|
|
/*
|
2002-04-30 22:05:33 +00:00
|
|
|
ATP_EOM is not mandatory. Some implementations don't always set it
|
|
|
|
if the query is only one packet.
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2002-05-03 21:25:43 +00:00
|
|
|
So it needs to keep the number of packets asked in request.
|
2002-08-28 21:04:11 +00:00
|
|
|
*/
|
2002-05-03 21:25:43 +00:00
|
|
|
|
2002-04-30 22:05:33 +00:00
|
|
|
if (aspinfo.reply) {
|
2002-05-03 21:25:43 +00:00
|
|
|
more_fragment = !((ATP_EOM & ctrlinfo) || (request_val && 1 == request_val->value));
|
2002-04-30 22:05:33 +00:00
|
|
|
frag_number = bitmap;
|
|
|
|
}
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2002-04-30 22:05:33 +00:00
|
|
|
if (check_col(pinfo->cinfo, COL_INFO)) {
|
|
|
|
col_clear(pinfo->cinfo, COL_INFO);
|
2002-08-28 21:04:11 +00:00
|
|
|
col_add_fstr(pinfo->cinfo, COL_INFO, "%s transaction %u",
|
2002-04-30 22:05:33 +00:00
|
|
|
val_to_str(op, atp_function_vals, "Unknown (0x%01x)"),tid);
|
2002-08-28 21:04:11 +00:00
|
|
|
if (more_fragment)
|
2002-04-30 22:05:33 +00:00
|
|
|
col_append_fstr(pinfo->cinfo, COL_INFO, " [fragment]");
|
2002-08-28 21:04:11 +00:00
|
|
|
}
|
2002-04-30 22:05:33 +00:00
|
|
|
|
2002-04-25 23:58:02 +00:00
|
|
|
if (tree) {
|
|
|
|
ti = proto_tree_add_item(tree, proto_atp, tvb, offset, -1, FALSE);
|
|
|
|
atp_tree = proto_item_add_subtree(ti, ett_atp);
|
2002-05-03 21:25:43 +00:00
|
|
|
proto_item_set_len(atp_tree, aspinfo.release?8:ATP_HDRSIZE -1);
|
2002-04-25 23:58:02 +00:00
|
|
|
|
|
|
|
info_item = proto_tree_add_item(atp_tree, hf_atp_ctrlinfo, tvb, offset, 1, FALSE);
|
|
|
|
atp_info_tree = proto_item_add_subtree(info_item, ett_atp_info);
|
|
|
|
|
2002-04-26 07:41:31 +00:00
|
|
|
proto_tree_add_item(atp_info_tree, hf_atp_function, tvb, offset, 1, FALSE);
|
|
|
|
proto_tree_add_item(atp_info_tree, hf_atp_xo, tvb, offset, 1, FALSE);
|
|
|
|
proto_tree_add_item(atp_info_tree, hf_atp_eom, tvb, offset, 1, FALSE);
|
|
|
|
proto_tree_add_item(atp_info_tree, hf_atp_sts, tvb, offset, 1, FALSE);
|
|
|
|
if ((ctrlinfo & (ATP_FUNCMASK|ATP_XO)) == (0x40|ATP_XO)) {
|
|
|
|
/* TReq with XO set */
|
|
|
|
proto_tree_add_item(atp_info_tree, hf_atp_treltimer, tvb, offset, 1, FALSE);
|
|
|
|
}
|
2002-05-03 21:25:43 +00:00
|
|
|
if (query) {
|
2002-04-26 07:41:31 +00:00
|
|
|
proto_tree_add_text(atp_tree, tvb, offset +1, 1,
|
2002-06-29 22:15:41 +00:00
|
|
|
"Bitmap: 0x%02x %u packet(s) max", bitmap, nbe);
|
2002-04-26 07:41:31 +00:00
|
|
|
}
|
2002-04-25 23:58:02 +00:00
|
|
|
else {
|
2002-04-26 07:41:31 +00:00
|
|
|
proto_tree_add_item(atp_tree, hf_atp_bitmap, tvb, offset +1, 1, FALSE);
|
|
|
|
}
|
2002-04-25 23:58:02 +00:00
|
|
|
proto_tree_add_item(atp_tree, hf_atp_tid, tvb, offset +2, 2, FALSE);
|
2002-05-03 21:25:43 +00:00
|
|
|
|
|
|
|
if (aspinfo.release)
|
|
|
|
proto_tree_add_item(atp_tree, hf_atp_user_bytes, tvb, offset +4, 4, FALSE);
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2002-04-25 23:58:02 +00:00
|
|
|
}
|
2002-05-03 21:25:43 +00:00
|
|
|
|
|
|
|
if (aspinfo.release)
|
|
|
|
return;
|
|
|
|
|
2002-04-30 22:05:33 +00:00
|
|
|
save_fragmented = pinfo->fragmented;
|
|
|
|
|
2002-08-28 21:04:11 +00:00
|
|
|
/* FIXME
|
2002-04-30 22:05:33 +00:00
|
|
|
asp doesn't fit very well here
|
|
|
|
move asp back in atp?
|
|
|
|
*/
|
|
|
|
if (atp_defragment && aspinfo.reply && (more_fragment || frag_number != 0)) {
|
|
|
|
fragment_data *fd_head;
|
|
|
|
int hdr;
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2002-04-30 22:05:33 +00:00
|
|
|
hdr = ATP_HDRSIZE -1;
|
|
|
|
if (frag_number != 0)
|
|
|
|
hdr += 4; /* asp header */
|
|
|
|
len = tvb_length_remaining(tvb, hdr);
|
|
|
|
fd_head = fragment_add_seq_check(tvb, hdr, pinfo, tid,
|
|
|
|
atp_fragment_table,
|
|
|
|
atp_reassembled_table,
|
|
|
|
frag_number,
|
|
|
|
len,
|
|
|
|
more_fragment);
|
|
|
|
if (fd_head != NULL) {
|
|
|
|
if (fd_head->next != NULL) {
|
|
|
|
new_tvb = tvb_new_real_data(fd_head->data, fd_head->len, fd_head->len);
|
|
|
|
tvb_set_child_real_data_tvbuff(tvb, new_tvb);
|
2002-06-04 07:03:57 +00:00
|
|
|
add_new_data_source(pinfo, new_tvb, "Reassembled ATP");
|
2002-04-30 22:05:33 +00:00
|
|
|
/* Show all fragments. */
|
2002-06-07 10:11:41 +00:00
|
|
|
if (tree) {
|
|
|
|
show_fragment_seq_tree(fd_head, &atp_frag_items,
|
|
|
|
atp_tree, pinfo, new_tvb);
|
|
|
|
}
|
2002-04-30 22:05:33 +00:00
|
|
|
}
|
2002-08-28 21:04:11 +00:00
|
|
|
else
|
2002-04-30 22:05:33 +00:00
|
|
|
new_tvb = tvb_new_subset(tvb, ATP_HDRSIZE -1, -1, -1);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
new_tvb = NULL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
/* full packet */
|
|
|
|
new_tvb = tvb_new_subset(tvb, ATP_HDRSIZE -1, -1,- 1);
|
|
|
|
}
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2002-04-30 22:05:33 +00:00
|
|
|
if (new_tvb) {
|
|
|
|
pinfo->private_data = &aspinfo;
|
2002-06-29 21:27:39 +00:00
|
|
|
/* if port == 6 it's not an ASP packet but a ZIP packet */
|
|
|
|
if (pinfo->srcport == 6 || pinfo->destport == 6 )
|
|
|
|
call_dissector(zip_atp_handle, new_tvb, pinfo, tree);
|
|
|
|
else
|
|
|
|
call_dissector(asp_handle, new_tvb, pinfo, tree);
|
2002-04-30 22:05:33 +00:00
|
|
|
}
|
|
|
|
else {
|
|
|
|
/* Just show this as a fragment. */
|
|
|
|
new_tvb = tvb_new_subset (tvb, ATP_HDRSIZE -1, -1, -1);
|
|
|
|
call_dissector(data_handle, new_tvb, pinfo, tree);
|
|
|
|
}
|
|
|
|
pinfo->fragmented = save_fragmented;
|
2002-04-25 23:58:02 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2002-05-03 21:25:43 +00:00
|
|
|
/*
|
2002-08-28 21:04:11 +00:00
|
|
|
copy and paste from dsi
|
2002-05-03 21:25:43 +00:00
|
|
|
*/
|
2002-08-28 21:04:11 +00:00
|
|
|
static gint
|
2002-05-03 21:25:43 +00:00
|
|
|
dissect_asp_reply_get_status(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset)
|
|
|
|
{
|
|
|
|
proto_tree *sub_tree;
|
|
|
|
proto_item *ti;
|
|
|
|
|
|
|
|
guint16 ofs;
|
|
|
|
guint16 flag;
|
|
|
|
guint16 sign_ofs = 0;
|
|
|
|
guint16 adr_ofs = 0;
|
|
|
|
guint16 dir_ofs = 0;
|
|
|
|
guint8 nbe;
|
|
|
|
guint8 len;
|
|
|
|
guint8 i;
|
|
|
|
|
|
|
|
if (!tree)
|
|
|
|
return offset;
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2002-05-03 21:25:43 +00:00
|
|
|
ti = proto_tree_add_text(tree, tvb, offset, -1, "Get Status");
|
|
|
|
tree = proto_item_add_subtree(ti, ett_asp_status);
|
|
|
|
|
|
|
|
ofs = tvb_get_ntohs(tvb, offset +AFPSTATUS_MACHOFF);
|
2002-06-29 22:15:41 +00:00
|
|
|
proto_tree_add_text(tree, tvb, offset +AFPSTATUS_MACHOFF, 2, "Machine offset: %u", ofs);
|
2002-05-03 21:25:43 +00:00
|
|
|
|
|
|
|
ofs = tvb_get_ntohs(tvb, offset +AFPSTATUS_VERSOFF);
|
2002-06-29 22:15:41 +00:00
|
|
|
proto_tree_add_text(tree, tvb, offset +AFPSTATUS_VERSOFF, 2, "Version offset: %u", ofs);
|
2002-05-03 21:25:43 +00:00
|
|
|
|
|
|
|
ofs = tvb_get_ntohs(tvb, offset +AFPSTATUS_UAMSOFF);
|
2002-06-29 22:15:41 +00:00
|
|
|
proto_tree_add_text(tree, tvb, offset +AFPSTATUS_UAMSOFF, 2, "UAMS offset: %u", ofs);
|
2002-05-03 21:25:43 +00:00
|
|
|
|
|
|
|
ofs = tvb_get_ntohs(tvb, offset +AFPSTATUS_ICONOFF);
|
2002-06-29 22:15:41 +00:00
|
|
|
proto_tree_add_text(tree, tvb, offset +AFPSTATUS_ICONOFF, 2, "Icon offset: %u", ofs);
|
2002-05-03 21:25:43 +00:00
|
|
|
|
|
|
|
ofs = offset +AFPSTATUS_FLAGOFF;
|
|
|
|
ti = proto_tree_add_item(tree, hf_asp_server_flag, tvb, ofs, 2, FALSE);
|
|
|
|
sub_tree = proto_item_add_subtree(ti, ett_asp_status_server_flag);
|
|
|
|
proto_tree_add_item(sub_tree, hf_asp_server_flag_copyfile , tvb, ofs, 2, FALSE);
|
|
|
|
proto_tree_add_item(sub_tree, hf_asp_server_flag_passwd , tvb, ofs, 2, FALSE);
|
|
|
|
proto_tree_add_item(sub_tree, hf_asp_server_flag_no_save_passwd, tvb, ofs, 2, FALSE);
|
|
|
|
proto_tree_add_item(sub_tree, hf_asp_server_flag_srv_msg , tvb, ofs, 2, FALSE);
|
|
|
|
proto_tree_add_item(sub_tree, hf_asp_server_flag_srv_sig , tvb, ofs, 2, FALSE);
|
|
|
|
proto_tree_add_item(sub_tree, hf_asp_server_flag_tcpip , tvb, ofs, 2, FALSE);
|
|
|
|
proto_tree_add_item(sub_tree, hf_asp_server_flag_notify , tvb, ofs, 2, FALSE);
|
|
|
|
proto_tree_add_item(sub_tree, hf_asp_server_flag_reconnect , tvb, ofs, 2, FALSE);
|
|
|
|
proto_tree_add_item(sub_tree, hf_asp_server_flag_directory , tvb, ofs, 2, FALSE);
|
|
|
|
proto_tree_add_item(sub_tree, hf_asp_server_flag_fast_copy , tvb, ofs, 2, FALSE);
|
|
|
|
|
|
|
|
proto_tree_add_item(tree, hf_asp_server_name, tvb, offset +AFPSTATUS_PRELEN, 1, FALSE);
|
|
|
|
|
|
|
|
flag = tvb_get_ntohs(tvb, ofs);
|
|
|
|
if ((flag & AFPSRVRINFO_SRVSIGNATURE)) {
|
|
|
|
ofs = offset +AFPSTATUS_PRELEN +tvb_get_guint8(tvb, offset +AFPSTATUS_PRELEN);
|
|
|
|
if ((ofs & 1))
|
|
|
|
ofs++;
|
|
|
|
|
|
|
|
sign_ofs = tvb_get_ntohs(tvb, ofs);
|
2002-06-29 22:15:41 +00:00
|
|
|
proto_tree_add_text(tree, tvb, ofs, 2, "Signature offset: %u", sign_ofs);
|
2002-05-03 21:25:43 +00:00
|
|
|
sign_ofs += offset;
|
|
|
|
|
|
|
|
if ((flag & AFPSRVRINFO_TCPIP)) {
|
|
|
|
ofs += 2;
|
|
|
|
adr_ofs = tvb_get_ntohs(tvb, ofs);
|
2002-06-29 22:15:41 +00:00
|
|
|
proto_tree_add_text(tree, tvb, ofs, 2, "Network address offset: %u", adr_ofs);
|
2002-05-03 21:25:43 +00:00
|
|
|
adr_ofs += offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
if ((flag & AFPSRVRINFO_SRVDIRECTORY)) {
|
|
|
|
ofs += 2;
|
|
|
|
dir_ofs = tvb_get_ntohs(tvb, ofs);
|
2002-06-29 22:15:41 +00:00
|
|
|
proto_tree_add_text(tree, tvb, ofs, 2, "Directory services offset: %u", dir_ofs);
|
2002-05-03 21:25:43 +00:00
|
|
|
dir_ofs += offset;
|
|
|
|
}
|
|
|
|
}
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2002-05-03 21:25:43 +00:00
|
|
|
ofs = offset +tvb_get_ntohs(tvb, offset +AFPSTATUS_MACHOFF);
|
|
|
|
if (ofs)
|
|
|
|
proto_tree_add_item(tree, hf_asp_server_type, tvb, ofs, 1, FALSE);
|
|
|
|
|
|
|
|
ofs = offset +tvb_get_ntohs(tvb, offset +AFPSTATUS_VERSOFF);
|
|
|
|
if (ofs) {
|
|
|
|
nbe = tvb_get_guint8(tvb, ofs);
|
2002-06-29 22:15:41 +00:00
|
|
|
ti = proto_tree_add_text(tree, tvb, ofs, 1, "Version list: %u", nbe);
|
2002-05-03 21:25:43 +00:00
|
|
|
ofs++;
|
|
|
|
sub_tree = proto_item_add_subtree(ti, ett_asp_vers);
|
|
|
|
for (i = 0; i < nbe; i++) {
|
|
|
|
len = tvb_get_guint8(tvb, ofs) +1;
|
|
|
|
proto_tree_add_item(sub_tree, hf_asp_server_vers, tvb, ofs, 1, FALSE);
|
|
|
|
ofs += len;
|
|
|
|
}
|
|
|
|
}
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2002-05-03 21:25:43 +00:00
|
|
|
ofs = offset +tvb_get_ntohs(tvb, offset +AFPSTATUS_UAMSOFF);
|
|
|
|
if (ofs) {
|
|
|
|
nbe = tvb_get_guint8(tvb, ofs);
|
2002-06-29 22:15:41 +00:00
|
|
|
ti = proto_tree_add_text(tree, tvb, ofs, 1, "UAMS list: %u", nbe);
|
2002-05-03 21:25:43 +00:00
|
|
|
ofs++;
|
|
|
|
sub_tree = proto_item_add_subtree(ti, ett_asp_uams);
|
|
|
|
for (i = 0; i < nbe; i++) {
|
|
|
|
len = tvb_get_guint8(tvb, ofs) +1;
|
|
|
|
proto_tree_add_item(sub_tree, hf_asp_server_uams, tvb, ofs, 1, FALSE);
|
|
|
|
ofs += len;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
ofs = offset +tvb_get_ntohs(tvb, offset +AFPSTATUS_ICONOFF);
|
|
|
|
if (ofs)
|
|
|
|
proto_tree_add_item(tree, hf_asp_server_icon, tvb, ofs, 256, FALSE);
|
2002-04-30 22:05:33 +00:00
|
|
|
|
2002-05-03 21:25:43 +00:00
|
|
|
if (sign_ofs) {
|
|
|
|
proto_tree_add_item(tree, hf_asp_server_signature, tvb, sign_ofs, 16, FALSE);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (adr_ofs) {
|
2002-05-08 23:46:34 +00:00
|
|
|
proto_tree *adr_tree;
|
|
|
|
char *tmp;
|
|
|
|
const guint8 *ip;
|
|
|
|
guint16 net;
|
|
|
|
guint8 node;
|
|
|
|
guint16 port;
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2002-05-03 21:25:43 +00:00
|
|
|
ofs = adr_ofs;
|
|
|
|
nbe = tvb_get_guint8(tvb, ofs);
|
2002-06-29 22:15:41 +00:00
|
|
|
ti = proto_tree_add_text(tree, tvb, ofs, 1, "Address list: %u", nbe);
|
2002-05-03 21:25:43 +00:00
|
|
|
ofs++;
|
2002-05-08 23:46:34 +00:00
|
|
|
adr_tree = proto_item_add_subtree(ti, ett_asp_addr);
|
2002-05-03 21:25:43 +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);
|
|
|
|
ti = proto_tree_add_text(adr_tree, tvb, ofs, len, "ip %s", ip_to_str(ip));
|
|
|
|
break;
|
|
|
|
case 2: /* IP + port */
|
|
|
|
ip = tvb_get_ptr(tvb, ofs+2, 4);
|
|
|
|
port = tvb_get_ntohs(tvb, ofs+6);
|
2002-06-29 22:15:41 +00:00
|
|
|
ti = proto_tree_add_text(adr_tree, tvb, ofs, len, "ip %s:%u",ip_to_str(ip),port);
|
2002-05-08 23:46:34 +00:00
|
|
|
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);
|
2002-08-28 21:04:11 +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 */
|
|
|
|
if (len > 2) {
|
|
|
|
tmp = g_malloc( len -1);
|
|
|
|
tvb_memcpy(tvb, tmp, ofs +2, len -2);
|
|
|
|
tmp[len -2] = 0;
|
|
|
|
ti = proto_tree_add_text(adr_tree, tvb, ofs, len, "dns %s", tmp);
|
|
|
|
g_free(tmp);
|
|
|
|
break;
|
2002-08-28 21:04:11 +00:00
|
|
|
}
|
2002-05-08 23:46:34 +00:00
|
|
|
/* else fall to default malformed record */
|
|
|
|
default:
|
2002-06-29 22:15:41 +00:00
|
|
|
ti = proto_tree_add_text(adr_tree, tvb, ofs, len,"Unknow type : %u", 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_asp_addr_line);
|
2002-05-03 21:25:43 +00:00
|
|
|
proto_tree_add_item(sub_tree, hf_asp_server_addr_len, tvb, ofs, 1, FALSE);
|
|
|
|
ofs++;
|
2002-08-28 21:04:11 +00:00
|
|
|
proto_tree_add_item(sub_tree, hf_asp_server_addr_type, tvb, ofs, 1, FALSE);
|
2002-05-03 21:25:43 +00:00
|
|
|
ofs++;
|
|
|
|
proto_tree_add_item(sub_tree, hf_asp_server_addr_value,tvb, ofs, len, FALSE);
|
|
|
|
ofs += len;
|
|
|
|
}
|
|
|
|
}
|
2002-05-08 23:46:34 +00:00
|
|
|
|
2002-05-03 21:25:43 +00:00
|
|
|
if (dir_ofs) {
|
|
|
|
ofs = dir_ofs;
|
|
|
|
nbe = tvb_get_guint8(tvb, ofs);
|
2002-06-29 22:15:41 +00:00
|
|
|
ti = proto_tree_add_text(tree, tvb, ofs, 1, "Directory services list: %u", nbe);
|
2002-05-03 21:25:43 +00:00
|
|
|
ofs++;
|
|
|
|
sub_tree = proto_item_add_subtree(ti, ett_asp_directory);
|
|
|
|
for (i = 0; i < nbe; i++) {
|
|
|
|
len = tvb_get_guint8(tvb, ofs) +1;
|
|
|
|
proto_tree_add_item(sub_tree, hf_asp_server_directory, tvb, ofs, 1, FALSE);
|
|
|
|
ofs += len;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
2002-08-28 21:04:11 +00:00
|
|
|
/* -----------------------------
|
2002-05-03 21:25:43 +00:00
|
|
|
ASP protocol cf. inside appletalk chap. 11
|
|
|
|
*/
|
2002-06-29 21:27:39 +00:00
|
|
|
static struct aspinfo *
|
|
|
|
get_transaction(tvbuff_t *tvb, packet_info *pinfo)
|
2002-04-25 23:58:02 +00:00
|
|
|
{
|
|
|
|
struct aspinfo *aspinfo = pinfo->private_data;
|
|
|
|
conversation_t *conversation;
|
|
|
|
asp_request_key request_key, *new_request_key;
|
|
|
|
asp_request_val *request_val;
|
2002-06-29 21:27:39 +00:00
|
|
|
guint8 fn;
|
2002-04-25 23:58:02 +00:00
|
|
|
|
|
|
|
conversation = find_conversation(&pinfo->src, &pinfo->dst, pinfo->ptype,
|
|
|
|
pinfo->srcport, pinfo->destport, 0);
|
|
|
|
|
|
|
|
if (conversation == NULL)
|
|
|
|
{
|
|
|
|
conversation = conversation_new(&pinfo->src, &pinfo->dst,
|
|
|
|
pinfo->ptype, pinfo->srcport, pinfo->destport, 0);
|
|
|
|
}
|
|
|
|
|
2002-08-28 21:04:11 +00:00
|
|
|
request_key.conversation = conversation->index;
|
2002-05-03 21:25:43 +00:00
|
|
|
memcpy(request_key.src, (!aspinfo->reply)?pinfo->src.data:pinfo->dst.data, 4);
|
2002-04-25 23:58:02 +00:00
|
|
|
request_key.seq = aspinfo->seq;
|
|
|
|
|
|
|
|
request_val = (asp_request_val *) g_hash_table_lookup(
|
|
|
|
asp_request_hash, &request_key);
|
2002-05-03 21:25:43 +00:00
|
|
|
if (!request_val && !aspinfo->reply ) {
|
2002-06-29 21:27:39 +00:00
|
|
|
fn = tvb_get_guint8(tvb, 0);
|
2002-04-26 07:41:31 +00:00
|
|
|
new_request_key = g_mem_chunk_alloc(asp_request_keys);
|
2002-04-25 23:58:02 +00:00
|
|
|
*new_request_key = request_key;
|
|
|
|
|
|
|
|
request_val = g_mem_chunk_alloc(asp_request_vals);
|
2002-05-03 21:25:43 +00:00
|
|
|
request_val->value = fn;
|
2002-04-25 23:58:02 +00:00
|
|
|
|
|
|
|
g_hash_table_insert(asp_request_hash, new_request_key,
|
|
|
|
request_val);
|
|
|
|
}
|
|
|
|
|
2002-08-28 21:04:11 +00:00
|
|
|
if (!request_val)
|
2002-06-29 21:27:39 +00:00
|
|
|
return NULL;
|
|
|
|
|
|
|
|
aspinfo->command = request_val->value;
|
|
|
|
return aspinfo;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2002-08-28 21:04:11 +00:00
|
|
|
static void
|
|
|
|
dissect_asp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
2002-06-29 21:27:39 +00:00
|
|
|
{
|
|
|
|
struct aspinfo *aspinfo;
|
|
|
|
int offset = 0;
|
|
|
|
proto_tree *asp_tree = NULL;
|
|
|
|
proto_item *ti;
|
|
|
|
guint8 fn;
|
|
|
|
int len;
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2002-06-29 21:27:39 +00:00
|
|
|
if (check_col(pinfo->cinfo, COL_PROTOCOL))
|
|
|
|
col_set_str(pinfo->cinfo, COL_PROTOCOL, "ASP");
|
|
|
|
if (check_col(pinfo->cinfo, COL_INFO))
|
|
|
|
col_clear(pinfo->cinfo, COL_INFO);
|
2002-04-25 23:58:02 +00:00
|
|
|
|
2002-06-29 21:27:39 +00:00
|
|
|
aspinfo = get_transaction(tvb, pinfo);
|
|
|
|
if (!aspinfo)
|
|
|
|
return;
|
|
|
|
|
|
|
|
fn = aspinfo->command;
|
2002-04-25 23:58:02 +00:00
|
|
|
|
|
|
|
if (check_col(pinfo->cinfo, COL_INFO)) {
|
|
|
|
if (aspinfo->reply)
|
2002-06-29 22:15:41 +00:00
|
|
|
col_add_fstr(pinfo->cinfo, COL_INFO, "Reply tid %u",aspinfo->seq);
|
2002-04-26 07:41:31 +00:00
|
|
|
else
|
2002-06-29 22:15:41 +00:00
|
|
|
col_add_fstr(pinfo->cinfo, COL_INFO, "Function: %s tid %u",
|
2002-04-25 23:58:02 +00:00
|
|
|
val_to_str(fn, asp_func_vals, "Unknown (0x%01x)"), aspinfo->seq);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (tree) {
|
|
|
|
ti = proto_tree_add_item(tree, proto_asp, tvb, offset, -1, FALSE);
|
|
|
|
asp_tree = proto_item_add_subtree(ti, ett_asp);
|
|
|
|
}
|
2002-05-03 21:25:43 +00:00
|
|
|
if (!aspinfo->reply) {
|
2002-04-25 23:58:02 +00:00
|
|
|
tvbuff_t *new_tvb;
|
2002-05-03 21:25:43 +00:00
|
|
|
/* let the called deal with asp_tree == NULL */
|
2002-04-25 23:58:02 +00:00
|
|
|
|
2002-05-03 21:25:43 +00:00
|
|
|
proto_tree_add_item(asp_tree, hf_asp_func, tvb, offset, 1, FALSE);
|
|
|
|
offset++;
|
|
|
|
switch(fn) {
|
|
|
|
case ASPFUNC_OPEN:
|
|
|
|
proto_tree_add_item(asp_tree, hf_asp_socket, tvb, offset, 1, FALSE);
|
|
|
|
offset++;
|
|
|
|
proto_tree_add_item(asp_tree, hf_asp_version, tvb, offset, 2, FALSE);
|
|
|
|
offset += 2;
|
2002-08-28 21:04:11 +00:00
|
|
|
break;
|
2002-05-03 21:25:43 +00:00
|
|
|
case ASPFUNC_TICKLE:
|
|
|
|
case ASPFUNC_CLOSE:
|
|
|
|
proto_tree_add_item(asp_tree, hf_asp_session_id, tvb, offset, 1, FALSE);
|
|
|
|
offset++;
|
|
|
|
proto_tree_add_item(asp_tree, hf_asp_zero_value, tvb, offset, 2, FALSE);
|
|
|
|
offset +=2;
|
|
|
|
break;
|
|
|
|
case ASPFUNC_STAT:
|
|
|
|
proto_tree_add_item(asp_tree, hf_asp_zero_value, tvb, offset, 1, FALSE);
|
|
|
|
offset++;
|
|
|
|
proto_tree_add_item(asp_tree, hf_asp_zero_value, tvb, offset, 2, FALSE);
|
|
|
|
offset += 2;
|
2002-08-28 21:04:11 +00:00
|
|
|
break;
|
2002-05-03 21:25:43 +00:00
|
|
|
case ASPFUNC_ATTN:
|
|
|
|
proto_tree_add_item(asp_tree, hf_asp_session_id, tvb, offset, 1, FALSE);
|
|
|
|
offset++;
|
|
|
|
proto_tree_add_item(asp_tree, hf_asp_attn_code, tvb, offset, 2, FALSE);
|
|
|
|
offset +=2;
|
|
|
|
break;
|
|
|
|
case ASPFUNC_CMD:
|
|
|
|
case ASPFUNC_WRITE:
|
|
|
|
proto_item_set_len(asp_tree, 4);
|
|
|
|
proto_tree_add_item(asp_tree, hf_asp_session_id, tvb, offset, 1, FALSE);
|
|
|
|
offset++;
|
|
|
|
proto_tree_add_item(asp_tree, hf_asp_seq, tvb, offset, 2, FALSE);
|
|
|
|
offset += 2;
|
|
|
|
len = tvb_reported_length_remaining(tvb,offset);
|
|
|
|
new_tvb = tvb_new_subset(tvb, offset,-1,len);
|
2002-08-28 21:04:11 +00:00
|
|
|
call_dissector(afp_handle, new_tvb, pinfo, tree);
|
2002-05-03 21:25:43 +00:00
|
|
|
break;
|
|
|
|
case ASPFUNC_WRTCONT:
|
|
|
|
proto_tree_add_item(asp_tree, hf_asp_session_id, tvb, offset, 1, FALSE);
|
|
|
|
offset++;
|
|
|
|
proto_tree_add_item(asp_tree, hf_asp_seq, tvb, offset, 2, FALSE);
|
|
|
|
offset += 2;
|
|
|
|
proto_tree_add_item(asp_tree, hf_asp_size, tvb, offset, 2, FALSE);
|
|
|
|
offset += 2;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
proto_item_set_len(asp_tree, 4);
|
|
|
|
offset += 3;
|
|
|
|
len = tvb_reported_length_remaining(tvb,offset);
|
2002-08-28 21:04:11 +00:00
|
|
|
call_dissector(data_handle,tvb_new_subset(tvb, offset,-1,len), pinfo, tree);
|
2002-05-03 21:25:43 +00:00
|
|
|
break;
|
|
|
|
}
|
2002-04-25 23:58:02 +00:00
|
|
|
}
|
2002-05-03 21:25:43 +00:00
|
|
|
else {
|
|
|
|
tvbuff_t *new_tvb;
|
|
|
|
|
|
|
|
proto_tree_add_uint(asp_tree, hf_asp_func, tvb, 0, 0, fn);
|
|
|
|
switch(fn) {
|
|
|
|
case ASPFUNC_OPEN:
|
|
|
|
proto_tree_add_item(asp_tree, hf_asp_socket, tvb, offset, 1, FALSE);
|
|
|
|
offset++;
|
|
|
|
proto_tree_add_item(asp_tree, hf_asp_session_id, tvb, offset, 1, FALSE);
|
|
|
|
offset++;
|
|
|
|
proto_tree_add_item(asp_tree, hf_asp_init_error, tvb, offset, 2, FALSE);
|
|
|
|
offset += 2;
|
|
|
|
break;
|
|
|
|
case ASPFUNC_CLOSE:
|
|
|
|
proto_tree_add_item(asp_tree, hf_asp_zero_value, tvb, offset, 1, FALSE);
|
|
|
|
offset++;
|
|
|
|
proto_tree_add_item(asp_tree, hf_asp_zero_value, tvb, offset, 1, FALSE);
|
|
|
|
offset++;
|
|
|
|
proto_tree_add_item(asp_tree, hf_asp_zero_value, tvb, offset, 2, FALSE);
|
|
|
|
offset += 2;
|
2002-08-28 21:04:11 +00:00
|
|
|
break;
|
2002-05-03 21:25:43 +00:00
|
|
|
case ASPFUNC_STAT:
|
|
|
|
proto_tree_add_item(asp_tree, hf_asp_zero_value, tvb, offset, 4, FALSE);
|
|
|
|
offset += 4;
|
|
|
|
dissect_asp_reply_get_status(tvb, pinfo, asp_tree, offset);
|
2002-08-28 21:04:11 +00:00
|
|
|
break;
|
2002-05-03 21:25:43 +00:00
|
|
|
case ASPFUNC_CMD:
|
|
|
|
case ASPFUNC_WRITE:
|
|
|
|
proto_item_set_len(asp_tree, 4);
|
2002-06-20 00:44:33 +00:00
|
|
|
aspinfo->code = tvb_get_ntohl(tvb, offset);;
|
2002-05-03 21:25:43 +00:00
|
|
|
proto_tree_add_item(asp_tree, hf_asp_error, tvb, offset, 4, FALSE);
|
|
|
|
offset += 4;
|
|
|
|
len = tvb_reported_length_remaining(tvb,offset);
|
|
|
|
new_tvb = tvb_new_subset(tvb, offset,-1,len);
|
2002-08-28 21:04:11 +00:00
|
|
|
call_dissector(afp_handle, new_tvb, pinfo, tree);
|
2002-05-03 21:25:43 +00:00
|
|
|
break;
|
|
|
|
case ASPFUNC_TICKLE:
|
|
|
|
case ASPFUNC_WRTCONT:
|
|
|
|
proto_tree_add_item(asp_tree, hf_asp_zero_value, tvb, offset, 4, FALSE);
|
|
|
|
/* fall */
|
|
|
|
case ASPFUNC_ATTN: /* FIXME capture and spec disagree */
|
|
|
|
default:
|
|
|
|
proto_item_set_len(asp_tree, 4);
|
|
|
|
offset += 4;
|
|
|
|
len = tvb_reported_length_remaining(tvb,offset);
|
2002-08-28 21:04:11 +00:00
|
|
|
call_dissector(data_handle,tvb_new_subset(tvb, offset,-1,len), pinfo, tree);
|
2002-05-03 21:25:43 +00:00
|
|
|
break;
|
|
|
|
}
|
2002-04-25 23:58:02 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2002-08-28 21:04:11 +00:00
|
|
|
/* -----------------------------
|
2002-06-29 21:27:39 +00:00
|
|
|
ZIP protocol cf. inside appletalk chap. 8
|
|
|
|
*/
|
|
|
|
static void
|
2002-08-28 21:04:11 +00:00
|
|
|
dissect_atp_zip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
2002-06-29 21:27:39 +00:00
|
|
|
{
|
|
|
|
struct aspinfo *aspinfo;
|
|
|
|
int offset = 0;
|
|
|
|
proto_tree *zip_tree;
|
|
|
|
proto_tree *sub_tree;
|
|
|
|
proto_item *ti;
|
|
|
|
guint8 fn;
|
|
|
|
guint16 count;
|
|
|
|
guint8 len;
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2002-06-29 21:27:39 +00:00
|
|
|
if (check_col(pinfo->cinfo, COL_PROTOCOL))
|
|
|
|
col_set_str(pinfo->cinfo, COL_PROTOCOL, "ZIP");
|
|
|
|
if (check_col(pinfo->cinfo, COL_INFO))
|
|
|
|
col_clear(pinfo->cinfo, COL_INFO);
|
|
|
|
|
|
|
|
aspinfo = get_transaction(tvb, pinfo);
|
|
|
|
if (!aspinfo)
|
|
|
|
return;
|
|
|
|
|
|
|
|
fn = aspinfo->command;
|
|
|
|
|
|
|
|
if (check_col(pinfo->cinfo, COL_INFO)) {
|
|
|
|
if (aspinfo->reply)
|
2002-06-29 22:15:41 +00:00
|
|
|
col_add_fstr(pinfo->cinfo, COL_INFO, "Reply tid %u",aspinfo->seq);
|
2002-06-29 21:27:39 +00:00
|
|
|
else
|
2002-06-29 22:15:41 +00:00
|
|
|
col_add_fstr(pinfo->cinfo, COL_INFO, "Function: %s tid %u",
|
2002-06-29 21:27:39 +00:00
|
|
|
val_to_str(fn, zip_atp_function_vals, "Unknown (0x%01x)"), aspinfo->seq);
|
|
|
|
}
|
|
|
|
|
2002-08-28 21:04:11 +00:00
|
|
|
if (!tree)
|
2002-06-29 21:27:39 +00:00
|
|
|
return;
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2002-06-29 21:27:39 +00:00
|
|
|
ti = proto_tree_add_item(tree, proto_zip, tvb, offset, -1, FALSE);
|
|
|
|
zip_tree = proto_item_add_subtree(ti, ett_zip);
|
|
|
|
|
|
|
|
if (!aspinfo->reply) {
|
|
|
|
proto_tree_add_item(zip_tree, hf_zip_atp_function, tvb, offset, 1, FALSE);
|
|
|
|
offset++;
|
|
|
|
switch(fn) {
|
|
|
|
case 7: /* start_index = 0 */
|
|
|
|
case 8:
|
|
|
|
case 9:
|
|
|
|
proto_tree_add_item(zip_tree, hf_zip_zero_value, tvb, offset, 1, FALSE);
|
|
|
|
offset++;
|
|
|
|
proto_tree_add_item(zip_tree, hf_zip_start_index, tvb, offset, 2, FALSE);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
guint8 i;
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2002-06-29 21:27:39 +00:00
|
|
|
proto_tree_add_uint(zip_tree, hf_zip_atp_function, tvb, 0, 0, fn);
|
|
|
|
switch(fn) {
|
|
|
|
case 7:
|
|
|
|
case 8:
|
|
|
|
case 9:
|
|
|
|
proto_tree_add_item(zip_tree, hf_zip_last_flag, tvb, offset, 1, FALSE);
|
|
|
|
offset++;
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2002-06-29 21:27:39 +00:00
|
|
|
proto_tree_add_item(zip_tree, hf_zip_zero_value, tvb, offset, 1, FALSE);
|
|
|
|
offset++;
|
|
|
|
count = tvb_get_ntohs(tvb, offset);
|
|
|
|
ti = proto_tree_add_item(zip_tree, hf_zip_count, tvb, offset, 2, FALSE);
|
|
|
|
offset += 2;
|
|
|
|
sub_tree = proto_item_add_subtree(ti, ett_zip_zones_list);
|
|
|
|
for (i= 1; i <= count; i++) {
|
|
|
|
len = tvb_get_guint8(tvb, offset);
|
|
|
|
proto_tree_add_item(sub_tree, hf_zip_zone_name, tvb, offset, 1,FALSE);
|
|
|
|
offset += len +1;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2002-08-28 21:04:11 +00:00
|
|
|
dissect_ddp_zip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
2002-06-29 21:27:39 +00:00
|
|
|
{
|
|
|
|
proto_tree *zip_tree = NULL;
|
|
|
|
proto_item *ti;
|
|
|
|
guint8 fn;
|
|
|
|
guint8 len;
|
|
|
|
gint offset = 0;
|
|
|
|
proto_tree *flag_tree;
|
|
|
|
proto_tree *sub_tree;
|
|
|
|
proto_tree *net_tree;
|
|
|
|
guint8 flag;
|
|
|
|
guint16 net;
|
|
|
|
guint8 i;
|
|
|
|
guint8 count;
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2002-06-29 21:27:39 +00:00
|
|
|
if (check_col(pinfo->cinfo, COL_PROTOCOL))
|
|
|
|
col_set_str(pinfo->cinfo, COL_PROTOCOL, "ZIP");
|
|
|
|
if (check_col(pinfo->cinfo, COL_INFO))
|
|
|
|
col_clear(pinfo->cinfo, COL_INFO);
|
|
|
|
|
|
|
|
fn = tvb_get_guint8(tvb, 0);
|
|
|
|
if (check_col(pinfo->cinfo, COL_INFO)) {
|
|
|
|
col_add_str(pinfo->cinfo, COL_INFO,
|
|
|
|
val_to_str(fn, zip_function_vals, "Unknown ZIP function (%02x)"));
|
|
|
|
}
|
|
|
|
|
2002-08-28 21:04:11 +00:00
|
|
|
if (!tree)
|
2002-06-29 21:27:39 +00:00
|
|
|
return;
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2002-06-29 21:27:39 +00:00
|
|
|
ti = proto_tree_add_item(tree, proto_zip, tvb, 0, -1, FALSE);
|
|
|
|
zip_tree = proto_item_add_subtree(ti, ett_zip);
|
|
|
|
|
|
|
|
proto_tree_add_item(zip_tree, hf_zip_function, tvb, offset, 1,FALSE);
|
|
|
|
offset++;
|
|
|
|
/* fn 1,7,2,8 are not tested */
|
|
|
|
switch (fn) {
|
|
|
|
case 1: /* Query */
|
|
|
|
count = tvb_get_guint8(tvb, offset);
|
|
|
|
ti = proto_tree_add_item(zip_tree, hf_zip_network_count, tvb, offset, 1, FALSE);
|
|
|
|
offset++;
|
|
|
|
sub_tree = proto_item_add_subtree(ti, ett_zip_network_list);
|
|
|
|
for (i= 1; i <= count; i++) {
|
|
|
|
proto_tree_add_item(sub_tree, hf_zip_network, tvb, offset, 2, FALSE);
|
|
|
|
offset += 2;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 7: /* Notify */
|
|
|
|
flag = tvb_get_guint8(tvb, offset);
|
|
|
|
ti = proto_tree_add_text(zip_tree, tvb, offset , 1,"Flags : 0x%02x", flag);
|
|
|
|
flag_tree = proto_item_add_subtree(ti, ett_zip_flags);
|
|
|
|
proto_tree_add_item(flag_tree, hf_zip_flags_zone_invalid, tvb, offset, 1,FALSE);
|
|
|
|
proto_tree_add_item(flag_tree, hf_zip_flags_use_broadcast,tvb, offset, 1,FALSE);
|
|
|
|
proto_tree_add_item(flag_tree, hf_zip_flags_only_one_zone,tvb, offset, 1,FALSE);
|
|
|
|
offset++;
|
|
|
|
|
|
|
|
proto_tree_add_item(zip_tree, hf_zip_zero_value, tvb, offset, 4, FALSE);
|
|
|
|
offset += 4;
|
|
|
|
|
|
|
|
len = tvb_get_guint8(tvb, offset);
|
|
|
|
proto_tree_add_item(zip_tree, hf_zip_zone_name, tvb, offset, 1,FALSE);
|
|
|
|
offset += len +1;
|
|
|
|
|
|
|
|
len = tvb_get_guint8(tvb, offset);
|
|
|
|
proto_tree_add_item(zip_tree, hf_zip_multicast_length,tvb, offset, 1,FALSE);
|
|
|
|
offset++;
|
|
|
|
proto_tree_add_item(zip_tree, hf_zip_multicast_address,tvb, offset, len,FALSE);
|
|
|
|
offset += len;
|
|
|
|
|
|
|
|
proto_tree_add_item(zip_tree, hf_zip_zone_name, tvb, offset, 1,FALSE);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 2: /* Reply */
|
|
|
|
case 8: /* Extended Reply */
|
|
|
|
count = tvb_get_guint8(tvb, offset);
|
|
|
|
ti = proto_tree_add_item(zip_tree, hf_zip_network_count, tvb, offset, 1, FALSE);
|
|
|
|
offset++;
|
|
|
|
sub_tree = proto_item_add_subtree(ti, ett_zip_network_list);
|
|
|
|
for (i= 1; i <= count; i++) {
|
|
|
|
net = tvb_get_ntohs(tvb, offset);
|
2002-06-29 22:15:41 +00:00
|
|
|
ti = proto_tree_add_text(zip_tree, tvb, offset , 2, "Zone for network : %u", net);
|
2002-06-29 21:27:39 +00:00
|
|
|
net_tree = proto_item_add_subtree(ti, ett_zip_network_list);
|
|
|
|
proto_tree_add_item(net_tree, hf_zip_network, tvb, offset, 2, FALSE);
|
|
|
|
offset += 2;
|
|
|
|
len = tvb_get_guint8(tvb, offset);
|
|
|
|
proto_tree_add_item(net_tree, hf_zip_zone_name, tvb, offset, 1,FALSE);
|
|
|
|
offset += len +1;
|
|
|
|
}
|
|
|
|
break;
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2002-06-29 21:27:39 +00:00
|
|
|
case 5 : /* GetNetInfo request */
|
|
|
|
proto_tree_add_item(zip_tree, hf_zip_zero_value, tvb, offset, 1, FALSE);
|
|
|
|
offset++;
|
|
|
|
proto_tree_add_item(zip_tree, hf_zip_zero_value, tvb, offset, 4, FALSE);
|
|
|
|
offset += 4;
|
|
|
|
proto_tree_add_item(zip_tree, hf_zip_zone_name, tvb, offset, 1,FALSE);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 6 : /* GetNetInfo reply */
|
|
|
|
flag = tvb_get_guint8(tvb, offset);
|
|
|
|
ti = proto_tree_add_text(zip_tree, tvb, offset , 1,"Flags : 0x%02x", flag);
|
|
|
|
flag_tree = proto_item_add_subtree(ti, ett_zip_flags);
|
|
|
|
proto_tree_add_item(flag_tree, hf_zip_flags_zone_invalid, tvb, offset, 1,FALSE);
|
|
|
|
proto_tree_add_item(flag_tree, hf_zip_flags_use_broadcast,tvb, offset, 1,FALSE);
|
|
|
|
proto_tree_add_item(flag_tree, hf_zip_flags_only_one_zone,tvb, offset, 1,FALSE);
|
|
|
|
offset++;
|
|
|
|
|
|
|
|
proto_tree_add_item(zip_tree, hf_zip_network_start, tvb, offset, 2, FALSE);
|
|
|
|
offset += 2;
|
|
|
|
|
|
|
|
proto_tree_add_item(zip_tree, hf_zip_network_end, tvb, offset, 2, FALSE);
|
|
|
|
offset += 2;
|
|
|
|
|
|
|
|
len = tvb_get_guint8(tvb, offset);
|
|
|
|
proto_tree_add_item(zip_tree, hf_zip_zone_name, tvb, offset, 1,FALSE);
|
|
|
|
offset += len +1;
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2002-06-29 21:27:39 +00:00
|
|
|
len = tvb_get_guint8(tvb, offset);
|
|
|
|
proto_tree_add_item(zip_tree, hf_zip_multicast_length,tvb, offset, 1,FALSE);
|
|
|
|
offset++;
|
|
|
|
proto_tree_add_item(zip_tree, hf_zip_multicast_address,tvb, offset, len,FALSE);
|
|
|
|
offset += len;
|
|
|
|
if ((flag & 0x80) != 0)
|
|
|
|
proto_tree_add_item(zip_tree, hf_zip_default_zone, tvb, offset, 1,FALSE);
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2002-04-25 23:58:02 +00:00
|
|
|
|
2000-11-17 06:02:21 +00:00
|
|
|
static void
|
2001-11-30 07:14:22 +00:00
|
|
|
dissect_ddp_short(tvbuff_t *tvb, packet_info *pinfo, guint8 dnode,
|
|
|
|
guint8 snode, proto_tree *tree)
|
|
|
|
{
|
|
|
|
guint16 len;
|
|
|
|
guint8 dport;
|
|
|
|
guint8 sport;
|
|
|
|
guint8 type;
|
|
|
|
proto_tree *ddp_tree = NULL;
|
|
|
|
proto_item *ti;
|
|
|
|
static struct atalk_ddp_addr src, dst;
|
|
|
|
tvbuff_t *new_tvb;
|
|
|
|
|
2001-12-10 00:26:21 +00:00
|
|
|
if (check_col(pinfo->cinfo, COL_PROTOCOL))
|
|
|
|
col_set_str(pinfo->cinfo, COL_PROTOCOL, "DDP");
|
|
|
|
if (check_col(pinfo->cinfo, COL_INFO))
|
|
|
|
col_clear(pinfo->cinfo, COL_INFO);
|
2001-11-30 07:14:22 +00:00
|
|
|
|
|
|
|
if (tree) {
|
|
|
|
ti = proto_tree_add_item(tree, proto_ddp, tvb, 0, DDP_SHORT_HEADER_SIZE,
|
|
|
|
FALSE);
|
|
|
|
ddp_tree = proto_item_add_subtree(ti, ett_ddp);
|
|
|
|
}
|
|
|
|
len = tvb_get_ntohs(tvb, 0);
|
|
|
|
if (tree)
|
|
|
|
proto_tree_add_uint(ddp_tree, hf_ddp_len, tvb, 0, 2, len);
|
|
|
|
dport = tvb_get_guint8(tvb, 2);
|
|
|
|
if (tree)
|
|
|
|
proto_tree_add_uint(ddp_tree, hf_ddp_dst_socket, tvb, 2, 1, dport);
|
|
|
|
sport = tvb_get_guint8(tvb, 3);
|
|
|
|
if (tree)
|
|
|
|
proto_tree_add_uint(ddp_tree, hf_ddp_src_socket, tvb, 3, 1, sport);
|
|
|
|
type = tvb_get_guint8(tvb, 4);
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2001-11-30 07:14:22 +00:00
|
|
|
src.net = 0;
|
|
|
|
src.node = snode;
|
|
|
|
dst.net = 0;
|
|
|
|
dst.node = dnode;
|
|
|
|
SET_ADDRESS(&pinfo->net_src, AT_ATALK, sizeof src, (guint8 *)&src);
|
|
|
|
SET_ADDRESS(&pinfo->src, AT_ATALK, sizeof src, (guint8 *)&src);
|
|
|
|
SET_ADDRESS(&pinfo->net_dst, AT_ATALK, sizeof dst, (guint8 *)&dst);
|
|
|
|
SET_ADDRESS(&pinfo->dst, AT_ATALK, sizeof dst, (guint8 *)&dst);
|
|
|
|
|
2002-06-28 20:13:03 +00:00
|
|
|
pinfo->ptype = PT_DDP;
|
|
|
|
pinfo->destport = dport;
|
|
|
|
pinfo->srcport = sport;
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2001-12-10 00:26:21 +00:00
|
|
|
if (check_col(pinfo->cinfo, COL_INFO)) {
|
|
|
|
col_add_str(pinfo->cinfo, COL_INFO,
|
2001-11-30 07:14:22 +00:00
|
|
|
val_to_str(type, op_vals, "Unknown DDP protocol (%02x)"));
|
|
|
|
}
|
2002-06-28 20:13:03 +00:00
|
|
|
if (tree) {
|
2002-08-28 21:04:11 +00:00
|
|
|
proto_tree_add_string_hidden(ddp_tree, hf_ddp_src, tvb,
|
2002-06-28 20:13:03 +00:00
|
|
|
4, 3, atalk_addr_to_str(&src));
|
2002-08-28 21:04:11 +00:00
|
|
|
proto_tree_add_string_hidden(ddp_tree, hf_ddp_dst, tvb,
|
2002-06-28 20:13:03 +00:00
|
|
|
6, 3, atalk_addr_to_str(&dst));
|
|
|
|
|
2001-11-30 07:14:22 +00:00
|
|
|
proto_tree_add_uint(ddp_tree, hf_ddp_type, tvb, 4, 1, type);
|
2002-08-28 21:04:11 +00:00
|
|
|
}
|
2001-11-30 07:14:22 +00:00
|
|
|
new_tvb = tvb_new_subset(tvb, DDP_SHORT_HEADER_SIZE, -1, -1);
|
|
|
|
|
|
|
|
if (!dissector_try_port(ddp_dissector_table, type, new_tvb, pinfo, tree))
|
|
|
|
call_dissector(data_handle,new_tvb, pinfo, tree);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
dissect_ddp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|
|
|
{
|
1998-10-16 01:18:35 +00:00
|
|
|
e_ddp ddp;
|
1999-03-23 03:14:46 +00:00
|
|
|
proto_tree *ddp_tree;
|
|
|
|
proto_item *ti;
|
2000-11-19 08:20:34 +00:00
|
|
|
static struct atalk_ddp_addr src, dst;
|
2000-11-13 04:26:14 +00:00
|
|
|
tvbuff_t *new_tvb;
|
1998-10-16 01:18:35 +00:00
|
|
|
|
2001-12-10 00:26:21 +00:00
|
|
|
if (check_col(pinfo->cinfo, COL_PROTOCOL))
|
|
|
|
col_set_str(pinfo->cinfo, COL_PROTOCOL, "DDP");
|
|
|
|
if (check_col(pinfo->cinfo, COL_INFO))
|
|
|
|
col_clear(pinfo->cinfo, COL_INFO);
|
1999-10-07 17:11:11 +00:00
|
|
|
|
2000-11-13 04:26:14 +00:00
|
|
|
tvb_memcpy(tvb, (guint8 *)&ddp, 0, sizeof(e_ddp));
|
2002-08-02 23:36:07 +00:00
|
|
|
ddp.dnet=g_ntohs(ddp.dnet);
|
|
|
|
ddp.snet=g_ntohs(ddp.snet);
|
|
|
|
ddp.sum=g_ntohs(ddp.sum);
|
|
|
|
ddp.hops_len=g_ntohs(ddp.hops_len);
|
2002-08-28 21:04:11 +00:00
|
|
|
|
1999-10-22 08:11:40 +00:00
|
|
|
src.net = ddp.snet;
|
|
|
|
src.node = ddp.snode;
|
|
|
|
dst.net = ddp.dnet;
|
|
|
|
dst.node = ddp.dnode;
|
2000-11-13 04:26:14 +00:00
|
|
|
SET_ADDRESS(&pinfo->net_src, AT_ATALK, sizeof src, (guint8 *)&src);
|
|
|
|
SET_ADDRESS(&pinfo->src, AT_ATALK, sizeof src, (guint8 *)&src);
|
|
|
|
SET_ADDRESS(&pinfo->net_dst, AT_ATALK, sizeof dst, (guint8 *)&dst);
|
|
|
|
SET_ADDRESS(&pinfo->dst, AT_ATALK, sizeof dst, (guint8 *)&dst);
|
|
|
|
|
2002-06-28 20:13:03 +00:00
|
|
|
pinfo->ptype = PT_DDP;
|
|
|
|
pinfo->destport = ddp.dport;
|
|
|
|
pinfo->srcport = ddp.sport;
|
|
|
|
|
2001-12-10 00:26:21 +00:00
|
|
|
if (check_col(pinfo->cinfo, COL_INFO))
|
|
|
|
col_add_str(pinfo->cinfo, COL_INFO,
|
1998-10-20 05:31:03 +00:00
|
|
|
val_to_str(ddp.type, op_vals, "Unknown DDP protocol (%02x)"));
|
2002-08-28 21:04:11 +00:00
|
|
|
|
1998-10-16 01:18:35 +00:00
|
|
|
if (tree) {
|
2000-11-13 04:26:14 +00:00
|
|
|
ti = proto_tree_add_item(tree, proto_ddp, tvb, 0, DDP_HEADER_SIZE,
|
|
|
|
FALSE);
|
1999-11-16 11:44:20 +00:00
|
|
|
ddp_tree = proto_item_add_subtree(ti, ett_ddp);
|
2002-06-28 20:13:03 +00:00
|
|
|
|
2002-08-28 21:04:11 +00:00
|
|
|
proto_tree_add_string_hidden(ddp_tree, hf_ddp_src, tvb,
|
2002-06-28 20:13:03 +00:00
|
|
|
4, 3, atalk_addr_to_str(&src));
|
2002-08-28 21:04:11 +00:00
|
|
|
proto_tree_add_string_hidden(ddp_tree, hf_ddp_dst, tvb,
|
2002-06-28 20:13:03 +00:00
|
|
|
6, 3, atalk_addr_to_str(&dst));
|
|
|
|
|
2000-11-13 04:26:14 +00:00
|
|
|
proto_tree_add_uint(ddp_tree, hf_ddp_hopcount, tvb, 0, 1,
|
1999-10-07 17:11:11 +00:00
|
|
|
ddp_hops(ddp.hops_len));
|
2002-08-28 21:04:11 +00:00
|
|
|
proto_tree_add_uint(ddp_tree, hf_ddp_len, tvb, 0, 2,
|
1999-10-07 17:11:11 +00:00
|
|
|
ddp_len(ddp.hops_len));
|
2000-11-13 04:26:14 +00:00
|
|
|
proto_tree_add_uint(ddp_tree, hf_ddp_checksum, tvb, 2, 2,
|
|
|
|
ddp.sum);
|
|
|
|
proto_tree_add_uint(ddp_tree, hf_ddp_dst_net, tvb, 4, 2,
|
|
|
|
ddp.dnet);
|
|
|
|
proto_tree_add_uint(ddp_tree, hf_ddp_src_net, tvb, 6, 2,
|
|
|
|
ddp.snet);
|
|
|
|
proto_tree_add_uint(ddp_tree, hf_ddp_dst_node, tvb, 8, 1,
|
|
|
|
ddp.dnode);
|
|
|
|
proto_tree_add_uint(ddp_tree, hf_ddp_src_node, tvb, 9, 1,
|
|
|
|
ddp.snode);
|
|
|
|
proto_tree_add_uint(ddp_tree, hf_ddp_dst_socket, tvb, 10, 1,
|
|
|
|
ddp.dport);
|
|
|
|
proto_tree_add_uint(ddp_tree, hf_ddp_src_socket, tvb, 11, 1,
|
|
|
|
ddp.sport);
|
|
|
|
proto_tree_add_uint(ddp_tree, hf_ddp_type, tvb, 12, 1,
|
2002-08-28 21:04:11 +00:00
|
|
|
ddp.type);
|
1998-10-16 01:18:35 +00:00
|
|
|
}
|
|
|
|
|
2000-11-13 04:26:14 +00:00
|
|
|
new_tvb = tvb_new_subset(tvb, DDP_HEADER_SIZE, -1, -1);
|
1998-10-16 01:18:35 +00:00
|
|
|
|
2000-11-13 04:26:14 +00:00
|
|
|
if (!dissector_try_port(ddp_dissector_table, ddp.type, new_tvb, pinfo, tree))
|
2001-11-26 01:03:35 +00:00
|
|
|
call_dissector(data_handle,new_tvb, pinfo, tree);
|
1998-10-16 01:18:35 +00:00
|
|
|
}
|
1999-07-29 05:47:07 +00:00
|
|
|
|
2001-11-30 07:14:22 +00:00
|
|
|
static const value_string llap_type_vals[] = {
|
|
|
|
{0x01, "Short DDP"},
|
|
|
|
{0x02, "DDP" },
|
|
|
|
{0x81, "Enquiry"},
|
|
|
|
{0x82, "Acknowledgement"},
|
|
|
|
{0x84, "RTS"},
|
|
|
|
{0x85, "CTS"},
|
|
|
|
{0, NULL}
|
|
|
|
};
|
|
|
|
|
|
|
|
void
|
2002-04-24 06:03:34 +00:00
|
|
|
capture_llap(packet_counts *ld)
|
2001-11-30 07:14:22 +00:00
|
|
|
{
|
|
|
|
ld->other++;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
dissect_llap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|
|
|
{
|
|
|
|
guint8 dnode;
|
|
|
|
guint8 snode;
|
|
|
|
guint8 type;
|
|
|
|
proto_tree *llap_tree = NULL;
|
|
|
|
proto_item *ti;
|
|
|
|
tvbuff_t *new_tvb;
|
|
|
|
|
2001-12-10 00:26:21 +00:00
|
|
|
if (check_col(pinfo->cinfo, COL_PROTOCOL))
|
|
|
|
col_set_str(pinfo->cinfo, COL_PROTOCOL, "LLAP");
|
|
|
|
if (check_col(pinfo->cinfo, COL_INFO))
|
|
|
|
col_clear(pinfo->cinfo, COL_INFO);
|
2001-11-30 07:14:22 +00:00
|
|
|
|
|
|
|
if (tree) {
|
|
|
|
ti = proto_tree_add_item(tree, proto_llap, tvb, 0, 3, FALSE);
|
|
|
|
llap_tree = proto_item_add_subtree(ti, ett_llap);
|
|
|
|
}
|
|
|
|
|
|
|
|
dnode = tvb_get_guint8(tvb, 0);
|
2002-08-28 21:04:11 +00:00
|
|
|
if (tree)
|
2001-11-30 07:14:22 +00:00
|
|
|
proto_tree_add_uint(llap_tree, hf_llap_dst, tvb, 0, 1, dnode);
|
|
|
|
snode = tvb_get_guint8(tvb, 1);
|
|
|
|
if (tree)
|
|
|
|
proto_tree_add_uint(llap_tree, hf_llap_src, tvb, 1, 1, snode);
|
|
|
|
type = tvb_get_guint8(tvb, 2);
|
2001-12-10 00:26:21 +00:00
|
|
|
if (check_col(pinfo->cinfo, COL_INFO)) {
|
|
|
|
col_add_str(pinfo->cinfo, COL_INFO,
|
2001-11-30 07:14:22 +00:00
|
|
|
val_to_str(type, llap_type_vals, "Unknown LLAP type (%02x)"));
|
|
|
|
}
|
|
|
|
if (tree)
|
|
|
|
proto_tree_add_uint(llap_tree, hf_llap_type, tvb, 2, 1, type);
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2001-11-30 07:14:22 +00:00
|
|
|
new_tvb = tvb_new_subset(tvb, 3, -1, -1);
|
|
|
|
|
|
|
|
if (proto_is_protocol_enabled(proto_ddp)) {
|
|
|
|
pinfo->current_proto = "DDP";
|
|
|
|
switch (type) {
|
|
|
|
|
|
|
|
case 0x01:
|
|
|
|
dissect_ddp_short(new_tvb, pinfo, dnode, snode, tree);
|
|
|
|
return;
|
|
|
|
|
|
|
|
case 0x02:
|
|
|
|
dissect_ddp(new_tvb, pinfo, tree);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
call_dissector(data_handle,new_tvb, pinfo, tree);
|
|
|
|
}
|
|
|
|
|
2002-04-30 22:05:33 +00:00
|
|
|
static void
|
2002-05-03 21:25:43 +00:00
|
|
|
atp_init(void)
|
2002-04-30 22:05:33 +00:00
|
|
|
{
|
2002-05-03 21:25:43 +00:00
|
|
|
/* fragment */
|
|
|
|
fragment_table_init(&atp_fragment_table);
|
|
|
|
reassembled_table_init(&atp_reassembled_table);
|
|
|
|
/* bitmap */
|
|
|
|
if (atp_request_hash)
|
|
|
|
g_hash_table_destroy(atp_request_hash);
|
|
|
|
if (atp_request_keys)
|
|
|
|
g_mem_chunk_destroy(atp_request_keys);
|
|
|
|
if (atp_request_vals)
|
|
|
|
g_mem_chunk_destroy(atp_request_vals);
|
|
|
|
|
|
|
|
atp_request_hash = g_hash_table_new(asp_hash, asp_equal);
|
|
|
|
|
|
|
|
atp_request_keys = g_mem_chunk_new("atp_request_keys",
|
|
|
|
sizeof(asp_request_key),
|
|
|
|
asp_packet_init_count * sizeof(asp_request_key),
|
|
|
|
G_ALLOC_AND_FREE);
|
|
|
|
atp_request_vals = g_mem_chunk_new("atp_request_vals",
|
|
|
|
sizeof(asp_request_val),
|
|
|
|
asp_packet_init_count * sizeof(asp_request_val),
|
|
|
|
G_ALLOC_AND_FREE);
|
2002-04-30 22:05:33 +00:00
|
|
|
}
|
|
|
|
|
2002-08-28 21:04:11 +00:00
|
|
|
static void
|
2002-04-30 22:05:33 +00:00
|
|
|
asp_reinit( void)
|
2002-04-25 23:58:02 +00:00
|
|
|
{
|
|
|
|
|
|
|
|
if (asp_request_hash)
|
|
|
|
g_hash_table_destroy(asp_request_hash);
|
|
|
|
if (asp_request_keys)
|
|
|
|
g_mem_chunk_destroy(asp_request_keys);
|
|
|
|
if (asp_request_vals)
|
|
|
|
g_mem_chunk_destroy(asp_request_vals);
|
|
|
|
|
|
|
|
asp_request_hash = g_hash_table_new(asp_hash, asp_equal);
|
|
|
|
|
|
|
|
asp_request_keys = g_mem_chunk_new("asp_request_keys",
|
|
|
|
sizeof(asp_request_key),
|
|
|
|
asp_packet_init_count * sizeof(asp_request_key),
|
|
|
|
G_ALLOC_AND_FREE);
|
|
|
|
asp_request_vals = g_mem_chunk_new("asp_request_vals",
|
|
|
|
sizeof(asp_request_val),
|
|
|
|
asp_packet_init_count * sizeof(asp_request_val),
|
|
|
|
G_ALLOC_AND_FREE);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
1999-07-29 05:47:07 +00:00
|
|
|
void
|
|
|
|
proto_register_atalk(void)
|
|
|
|
{
|
2001-11-30 07:14:22 +00:00
|
|
|
static hf_register_info hf_llap[] = {
|
|
|
|
{ &hf_llap_dst,
|
|
|
|
{ "Destination Node", "llap.dst", FT_UINT8, BASE_DEC, NULL, 0x0,
|
|
|
|
"", HFILL }},
|
|
|
|
|
|
|
|
{ &hf_llap_src,
|
|
|
|
{ "Source Node", "llap.src", FT_UINT8, BASE_DEC, NULL, 0x0,
|
|
|
|
"", HFILL }},
|
|
|
|
|
|
|
|
{ &hf_llap_type,
|
|
|
|
{ "Type", "llap.type", FT_UINT8, BASE_HEX, VALS(llap_type_vals), 0x0,
|
|
|
|
"", HFILL }},
|
|
|
|
};
|
|
|
|
|
1999-12-08 23:55:01 +00:00
|
|
|
static hf_register_info hf_ddp[] = {
|
1999-10-07 17:11:11 +00:00
|
|
|
{ &hf_ddp_hopcount,
|
1999-10-12 06:21:15 +00:00
|
|
|
{ "Hop count", "ddp.hopcount", FT_UINT8, BASE_DEC, NULL, 0x0,
|
2001-06-18 02:18:27 +00:00
|
|
|
"", HFILL }},
|
1999-10-12 06:21:15 +00:00
|
|
|
|
1999-10-07 17:11:11 +00:00
|
|
|
{ &hf_ddp_len,
|
1999-10-12 06:21:15 +00:00
|
|
|
{ "Datagram length", "ddp.len", FT_UINT16, BASE_DEC, NULL, 0x0,
|
2001-06-18 02:18:27 +00:00
|
|
|
"", HFILL }},
|
1999-10-12 06:21:15 +00:00
|
|
|
|
1999-10-07 17:11:11 +00:00
|
|
|
{ &hf_ddp_checksum,
|
1999-10-12 06:21:15 +00:00
|
|
|
{ "Checksum", "ddp.checksum", FT_UINT16, BASE_DEC, NULL, 0x0,
|
2001-06-18 02:18:27 +00:00
|
|
|
"", HFILL }},
|
1999-10-12 06:21:15 +00:00
|
|
|
|
2002-06-28 20:13:03 +00:00
|
|
|
{ &hf_ddp_dst,
|
|
|
|
{ "Destination address", "ddp.dst", FT_STRING, BASE_NONE, NULL, 0x0,
|
|
|
|
"", HFILL }},
|
|
|
|
|
1999-10-07 17:11:11 +00:00
|
|
|
{ &hf_ddp_dst_net,
|
1999-10-12 06:21:15 +00:00
|
|
|
{ "Destination Net", "ddp.dst.net", FT_UINT16, BASE_DEC, NULL, 0x0,
|
2001-06-18 02:18:27 +00:00
|
|
|
"", HFILL }},
|
1999-10-12 06:21:15 +00:00
|
|
|
|
2002-06-28 20:13:03 +00:00
|
|
|
{ &hf_ddp_src,
|
|
|
|
{ "Source address", "ddp.src", FT_STRING, BASE_NONE, NULL, 0x0,
|
|
|
|
"", HFILL }},
|
|
|
|
|
1999-10-07 17:11:11 +00:00
|
|
|
{ &hf_ddp_src_net,
|
1999-10-12 06:21:15 +00:00
|
|
|
{ "Source Net", "ddp.src.net", FT_UINT16, BASE_DEC, NULL, 0x0,
|
2001-06-18 02:18:27 +00:00
|
|
|
"", HFILL }},
|
1999-10-12 06:21:15 +00:00
|
|
|
|
1999-10-07 17:11:11 +00:00
|
|
|
{ &hf_ddp_dst_node,
|
1999-10-12 06:21:15 +00:00
|
|
|
{ "Destination Node", "ddp.dst.node", FT_UINT8, BASE_DEC, NULL, 0x0,
|
2001-06-18 02:18:27 +00:00
|
|
|
"", HFILL }},
|
1999-10-12 06:21:15 +00:00
|
|
|
|
1999-10-07 17:11:11 +00:00
|
|
|
{ &hf_ddp_src_node,
|
1999-10-12 06:21:15 +00:00
|
|
|
{ "Source Node", "ddp.src.node", FT_UINT8, BASE_DEC, NULL, 0x0,
|
2001-06-18 02:18:27 +00:00
|
|
|
"", HFILL }},
|
1999-10-12 06:21:15 +00:00
|
|
|
|
1999-10-07 17:11:11 +00:00
|
|
|
{ &hf_ddp_dst_socket,
|
2002-06-29 21:27:39 +00:00
|
|
|
{ "Destination Socket", "ddp.dst_socket", FT_UINT8, BASE_DEC, NULL, 0x0,
|
2001-06-18 02:18:27 +00:00
|
|
|
"", HFILL }},
|
1999-10-12 06:21:15 +00:00
|
|
|
|
1999-10-07 17:11:11 +00:00
|
|
|
{ &hf_ddp_src_socket,
|
2002-06-29 21:27:39 +00:00
|
|
|
{ "Source Socket", "ddp.src_socket", FT_UINT8, BASE_DEC, NULL, 0x0,
|
2001-06-18 02:18:27 +00:00
|
|
|
"", HFILL }},
|
1999-10-12 06:21:15 +00:00
|
|
|
|
1999-10-07 17:11:11 +00:00
|
|
|
{ &hf_ddp_type,
|
1999-10-22 08:11:40 +00:00
|
|
|
{ "Protocol type", "ddp.type", FT_UINT8, BASE_DEC, VALS(op_vals), 0x0,
|
2001-06-18 02:18:27 +00:00
|
|
|
"", HFILL }},
|
1999-10-07 17:11:11 +00:00
|
|
|
};
|
1999-12-08 23:55:01 +00:00
|
|
|
|
|
|
|
static hf_register_info hf_nbp[] = {
|
|
|
|
{ &hf_nbp_op,
|
2002-08-28 21:04:11 +00:00
|
|
|
{ "Operation", "nbp.op", FT_UINT8, BASE_DEC,
|
2001-06-18 02:18:27 +00:00
|
|
|
VALS(nbp_op_vals), 0xF0, "Operation", HFILL }},
|
1999-12-08 23:55:01 +00:00
|
|
|
{ &hf_nbp_info,
|
2002-08-28 21:04:11 +00:00
|
|
|
{ "Info", "nbp.info", FT_UINT8, BASE_HEX,
|
2001-06-18 02:18:27 +00:00
|
|
|
NULL, 0x0, "Info", HFILL }},
|
1999-12-08 23:55:01 +00:00
|
|
|
{ &hf_nbp_count,
|
2002-08-28 21:04:11 +00:00
|
|
|
{ "Count", "nbp.count", FT_UINT8, BASE_DEC,
|
2001-06-18 02:18:27 +00:00
|
|
|
NULL, 0x0F, "Count", HFILL }},
|
1999-12-09 04:02:50 +00:00
|
|
|
{ &hf_nbp_node_net,
|
2002-08-28 21:04:11 +00:00
|
|
|
{ "Network", "nbp.net", FT_UINT16, BASE_DEC,
|
2001-06-18 02:18:27 +00:00
|
|
|
NULL, 0x0, "Network", HFILL }},
|
1999-12-09 04:02:50 +00:00
|
|
|
{ &hf_nbp_node_node,
|
2002-08-28 21:04:11 +00:00
|
|
|
{ "Node", "nbp.node", FT_UINT8, BASE_DEC,
|
2001-06-18 02:18:27 +00:00
|
|
|
NULL, 0x0, "Node", HFILL }},
|
1999-12-09 04:02:50 +00:00
|
|
|
{ &hf_nbp_node_port,
|
2002-08-28 21:04:11 +00:00
|
|
|
{ "Port", "nbp.port", FT_UINT8, BASE_DEC,
|
2001-06-18 02:18:27 +00:00
|
|
|
NULL, 0x0, "Port", HFILL }},
|
1999-12-09 15:31:24 +00:00
|
|
|
{ &hf_nbp_node_enum,
|
2002-08-28 21:04:11 +00:00
|
|
|
{ "Enumerator", "nbp.enum", FT_UINT8, BASE_DEC,
|
2001-06-18 02:18:27 +00:00
|
|
|
NULL, 0x0, "Enumerator", HFILL }},
|
1999-12-09 15:31:24 +00:00
|
|
|
{ &hf_nbp_node_object,
|
2002-08-28 21:04:11 +00:00
|
|
|
{ "Object", "nbp.object", FT_STRING, BASE_DEC,
|
2001-06-18 02:18:27 +00:00
|
|
|
NULL, 0x0, "Object", HFILL }},
|
1999-12-09 04:02:50 +00:00
|
|
|
{ &hf_nbp_node_type,
|
2002-08-28 21:04:11 +00:00
|
|
|
{ "Type", "nbp.type", FT_STRING, BASE_DEC,
|
2001-06-18 02:18:27 +00:00
|
|
|
NULL, 0x0, "Type", HFILL }},
|
1999-12-09 15:31:24 +00:00
|
|
|
{ &hf_nbp_node_zone,
|
2002-08-28 21:04:11 +00:00
|
|
|
{ "Zone", "nbp.zone", FT_STRING, BASE_DEC,
|
2001-06-18 02:18:27 +00:00
|
|
|
NULL, 0x0, "Zone", HFILL }},
|
1999-12-08 23:55:01 +00:00
|
|
|
{ &hf_nbp_tid,
|
2002-08-28 21:04:11 +00:00
|
|
|
{ "Transaction ID", "nbp.tid", FT_UINT8, BASE_DEC,
|
2001-06-18 02:18:27 +00:00
|
|
|
NULL, 0x0, "Transaction ID", HFILL }}
|
1999-12-08 23:55:01 +00:00
|
|
|
};
|
|
|
|
|
1999-12-09 17:06:37 +00:00
|
|
|
static hf_register_info hf_rtmp[] = {
|
|
|
|
{ &hf_rtmp_net,
|
2002-08-28 21:04:11 +00:00
|
|
|
{ "Net", "rtmp.net", FT_UINT16, BASE_DEC,
|
2001-06-18 02:18:27 +00:00
|
|
|
NULL, 0x0, "Net", HFILL }},
|
1999-12-09 17:06:37 +00:00
|
|
|
{ &hf_rtmp_node,
|
2002-08-28 21:04:11 +00:00
|
|
|
{ "Node", "nbp.nodeid", FT_UINT8, BASE_DEC,
|
2001-06-18 02:18:27 +00:00
|
|
|
NULL, 0x0, "Node", HFILL }},
|
1999-12-09 17:06:37 +00:00
|
|
|
{ &hf_rtmp_node_len,
|
2002-08-28 21:04:11 +00:00
|
|
|
{ "Node Length", "nbp.nodeid.length", FT_UINT8, BASE_DEC,
|
2001-06-18 02:18:27 +00:00
|
|
|
NULL, 0x0, "Node Length", HFILL }},
|
1999-12-09 17:06:37 +00:00
|
|
|
{ &hf_rtmp_tuple_net,
|
2002-08-28 21:04:11 +00:00
|
|
|
{ "Net", "rtmp.tuple.net", FT_UINT16, BASE_DEC,
|
2001-06-18 02:18:27 +00:00
|
|
|
NULL, 0x0, "Net", HFILL }},
|
2000-11-13 04:26:14 +00:00
|
|
|
{ &hf_rtmp_tuple_range_start,
|
2002-08-28 21:04:11 +00:00
|
|
|
{ "Range Start", "rtmp.tuple.range_start", FT_UINT16, BASE_DEC,
|
2001-06-18 02:18:27 +00:00
|
|
|
NULL, 0x0, "Range Start", HFILL }},
|
2000-11-13 04:26:14 +00:00
|
|
|
{ &hf_rtmp_tuple_range_end,
|
2002-08-28 21:04:11 +00:00
|
|
|
{ "Range End", "rtmp.tuple.range_end", FT_UINT16, BASE_DEC,
|
2001-06-18 02:18:27 +00:00
|
|
|
NULL, 0x0, "Range End", HFILL }},
|
1999-12-09 17:06:37 +00:00
|
|
|
{ &hf_rtmp_tuple_dist,
|
2002-08-28 21:04:11 +00:00
|
|
|
{ "Distance", "rtmp.tuple.dist", FT_UINT16, BASE_DEC,
|
2001-06-18 02:18:27 +00:00
|
|
|
NULL, 0x0, "Distance", HFILL }},
|
2000-11-13 04:26:14 +00:00
|
|
|
{ &hf_rtmp_function,
|
2002-08-28 21:04:11 +00:00
|
|
|
{ "Function", "rtmp.function", FT_UINT8, BASE_DEC,
|
2001-06-18 02:18:27 +00:00
|
|
|
VALS(rtmp_function_vals), 0x0, "Request Function", HFILL }}
|
1999-12-09 17:06:37 +00:00
|
|
|
};
|
|
|
|
|
2002-04-25 23:58:02 +00:00
|
|
|
static hf_register_info hf_atp[] = {
|
|
|
|
{ &hf_atp_ctrlinfo,
|
2002-08-28 21:04:11 +00:00
|
|
|
{ "Control info", "atp.ctrlinfo", FT_UINT8, BASE_HEX,
|
2002-04-25 23:58:02 +00:00
|
|
|
NULL, 0, "control info", HFILL }},
|
|
|
|
|
|
|
|
{ &hf_atp_function,
|
2002-08-28 21:04:11 +00:00
|
|
|
{ "Function", "atp.function", FT_UINT8, BASE_DEC,
|
2002-04-26 07:41:31 +00:00
|
|
|
VALS(atp_function_vals), ATP_FUNCMASK, "function code", HFILL }},
|
2002-04-25 23:58:02 +00:00
|
|
|
|
2002-04-26 07:41:31 +00:00
|
|
|
|
|
|
|
{ &hf_atp_xo,
|
|
|
|
{ "XO", "atp.xo", FT_BOOLEAN, 8,
|
|
|
|
NULL, ATP_XO, "Exactly-once flag", HFILL }},
|
|
|
|
|
|
|
|
{ &hf_atp_eom,
|
|
|
|
{ "EOM", "atp.eom", FT_BOOLEAN, 8,
|
|
|
|
NULL, ATP_EOM, "End-of-message", HFILL }},
|
|
|
|
|
|
|
|
{ &hf_atp_sts,
|
|
|
|
{ "STS", "atp.sts", FT_BOOLEAN, 8,
|
|
|
|
NULL, ATP_STS, "Send transaction status", HFILL }},
|
|
|
|
|
|
|
|
{ &hf_atp_treltimer,
|
|
|
|
{ "TRel timer", "atp.treltimer", FT_UINT8, BASE_DEC,
|
|
|
|
VALS(atp_trel_timer_vals), 0x07, "TRel timer", HFILL }},
|
2002-04-25 23:58:02 +00:00
|
|
|
|
|
|
|
{ &hf_atp_bitmap,
|
2002-08-28 21:04:11 +00:00
|
|
|
{ "Bitmap", "atp.bitmap", FT_UINT8, BASE_HEX,
|
2002-05-01 07:26:45 +00:00
|
|
|
NULL, 0x0, "Bitmap or sequence number", HFILL }},
|
|
|
|
|
2002-04-25 23:58:02 +00:00
|
|
|
{ &hf_atp_tid,
|
2002-08-28 21:04:11 +00:00
|
|
|
{ "TID", "atp.tid", FT_UINT16, BASE_DEC,
|
2002-05-01 07:26:45 +00:00
|
|
|
NULL, 0x0, "Transaction id", HFILL }},
|
2002-05-03 21:25:43 +00:00
|
|
|
{ &hf_atp_user_bytes,
|
2002-08-28 21:04:11 +00:00
|
|
|
{ "User bytes", "atp.user_bytes", FT_UINT32, BASE_HEX,
|
2002-05-03 21:25:43 +00:00
|
|
|
NULL, 0x0, "User bytes", HFILL }},
|
2002-05-01 07:26:45 +00:00
|
|
|
|
|
|
|
{ &hf_atp_segment_overlap,
|
|
|
|
{ "Segment overlap", "atp.segment.overlap", FT_BOOLEAN, BASE_NONE,
|
|
|
|
NULL, 0x0, "Segment overlaps with other segments", HFILL }},
|
|
|
|
|
|
|
|
{ &hf_atp_segment_overlap_conflict,
|
|
|
|
{ "Conflicting data in seagment overlap", "atp.segment.overlap.conflict",
|
|
|
|
FT_BOOLEAN, BASE_NONE,
|
|
|
|
NULL, 0x0, "Overlapping segments contained conflicting data", HFILL }},
|
|
|
|
|
|
|
|
{ &hf_atp_segment_multiple_tails,
|
|
|
|
{ "Multiple tail segments found", "atp.segment.multipletails",
|
|
|
|
FT_BOOLEAN, BASE_NONE,
|
|
|
|
NULL, 0x0, "Several tails were found when desegmenting the packet", HFILL }},
|
|
|
|
|
|
|
|
{ &hf_atp_segment_too_long_segment,
|
|
|
|
{ "Segment too long", "atp.segment.toolongsegment", FT_BOOLEAN, BASE_NONE,
|
|
|
|
NULL, 0x0, "Segment contained data past end of packet", HFILL }},
|
|
|
|
|
|
|
|
{ &hf_atp_segment_error,
|
|
|
|
{" Desegmentation error", "atp.segment.error", FT_NONE, BASE_NONE,
|
|
|
|
NULL, 0x0, "Desegmentation error due to illegal segments", HFILL }},
|
|
|
|
|
|
|
|
{ &hf_atp_segment,
|
|
|
|
{ "ATP Fragment", "atp.fragment", FT_NONE, BASE_NONE,
|
|
|
|
NULL, 0x0, "ATP Fragment", HFILL }},
|
|
|
|
|
|
|
|
{ &hf_atp_segments,
|
|
|
|
{ "ATP Fragments", "atp.fragments", FT_NONE, BASE_NONE,
|
|
|
|
NULL, 0x0, "ATP Fragments", HFILL }},
|
2002-04-25 23:58:02 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
static hf_register_info hf_asp[] = {
|
|
|
|
{ &hf_asp_func,
|
2002-08-28 21:04:11 +00:00
|
|
|
{ "asp function", "asp.function", FT_UINT8, BASE_DEC,
|
2002-04-25 23:58:02 +00:00
|
|
|
VALS(asp_func_vals), 0, "asp function", HFILL }},
|
1999-12-09 17:06:37 +00:00
|
|
|
|
2002-04-25 23:58:02 +00:00
|
|
|
{ &hf_asp_error,
|
2002-08-28 21:04:11 +00:00
|
|
|
{ "asp error", "asp.error", FT_INT32, BASE_DEC,
|
2002-04-25 23:58:02 +00:00
|
|
|
VALS(asp_error_vals), 0, "return error code", HFILL }},
|
2002-05-03 21:25:43 +00:00
|
|
|
|
|
|
|
{ &hf_asp_version,
|
2002-08-28 21:04:11 +00:00
|
|
|
{ "Version", "asp.version", FT_UINT16, BASE_HEX,
|
2002-05-03 21:25:43 +00:00
|
|
|
NULL, 0, "asp version", HFILL }},
|
|
|
|
|
|
|
|
{ &hf_asp_attn_code,
|
2002-08-28 21:04:11 +00:00
|
|
|
{ "Attn code", "asp.attn_code", FT_UINT16, BASE_HEX,
|
2002-05-03 21:25:43 +00:00
|
|
|
NULL, 0, "asp attention code", HFILL }},
|
|
|
|
|
|
|
|
{ &hf_asp_init_error,
|
2002-08-28 21:04:11 +00:00
|
|
|
{ "Error", "asp.init_error", FT_UINT16, BASE_DEC,
|
2002-05-03 21:25:43 +00:00
|
|
|
NULL, 0, "asp init error", HFILL }},
|
|
|
|
|
|
|
|
{ &hf_asp_session_id,
|
2002-08-28 21:04:11 +00:00
|
|
|
{ "Session ID", "asp.session_id", FT_UINT8, BASE_DEC,
|
2002-05-03 21:25:43 +00:00
|
|
|
NULL, 0, "asp session id", HFILL }},
|
|
|
|
|
|
|
|
{ &hf_asp_socket,
|
2002-08-28 21:04:11 +00:00
|
|
|
{ "Socket", "asp.socket", FT_UINT8, BASE_DEC,
|
2002-05-03 21:25:43 +00:00
|
|
|
NULL, 0, "asp socket", HFILL }},
|
|
|
|
|
|
|
|
{ &hf_asp_seq,
|
2002-08-28 21:04:11 +00:00
|
|
|
{ "Sequence", "asp.seq", FT_UINT16, BASE_DEC,
|
2002-05-03 21:25:43 +00:00
|
|
|
NULL, 0, "asp sequence number", HFILL }},
|
|
|
|
|
|
|
|
{ &hf_asp_size,
|
2002-08-28 21:04:11 +00:00
|
|
|
{ "size", "asp.size", FT_UINT16, BASE_DEC,
|
2002-05-03 21:25:43 +00:00
|
|
|
NULL, 0, "asp available size for reply", HFILL }},
|
|
|
|
|
|
|
|
{ &hf_asp_zero_value,
|
|
|
|
{ "Pad (0)", "asp.zero_value",
|
|
|
|
FT_BYTES, BASE_HEX, NULL, 0x0,
|
|
|
|
"Pad", HFILL }},
|
|
|
|
|
|
|
|
/* asp ,dsi, afp */
|
|
|
|
{ &hf_asp_server_name,
|
|
|
|
{ "Server name", "asp.server_name",
|
|
|
|
FT_UINT_STRING, BASE_NONE, NULL, 0x0,
|
|
|
|
"Server name", HFILL }},
|
|
|
|
|
|
|
|
{ &hf_asp_server_type,
|
|
|
|
{ "Server type", "asp.server_type",
|
|
|
|
FT_UINT_STRING, BASE_NONE, NULL, 0x0,
|
|
|
|
"Server type", HFILL }},
|
|
|
|
|
|
|
|
{ &hf_asp_server_vers,
|
|
|
|
{ "AFP version", "asp.server_vers",
|
|
|
|
FT_UINT_STRING, BASE_NONE, NULL, 0x0,
|
|
|
|
"AFP version", HFILL }},
|
|
|
|
|
|
|
|
{ &hf_asp_server_uams,
|
|
|
|
{ "UAM", "asp.server_uams",
|
|
|
|
FT_UINT_STRING, BASE_NONE, NULL, 0x0,
|
|
|
|
"UAM", HFILL }},
|
|
|
|
|
|
|
|
{ &hf_asp_server_icon,
|
|
|
|
{ "Icon bitmap", "asp.server_icon",
|
|
|
|
FT_BYTES, BASE_HEX, NULL, 0x0,
|
|
|
|
"Server icon bitmap", HFILL }},
|
|
|
|
|
|
|
|
{ &hf_asp_server_directory,
|
|
|
|
{ "Directory service", "asp.server_directory",
|
|
|
|
FT_UINT_STRING, BASE_NONE, NULL, 0x0,
|
|
|
|
"Server directory service", HFILL }},
|
|
|
|
|
|
|
|
{ &hf_asp_server_signature,
|
|
|
|
{ "Server signature", "asp.server_signature",
|
|
|
|
FT_BYTES, BASE_HEX, NULL, 0x0,
|
|
|
|
"Server signature", HFILL }},
|
|
|
|
|
|
|
|
{ &hf_asp_server_flag,
|
|
|
|
{ "Flag", "asp.server_flag",
|
|
|
|
FT_UINT16, BASE_HEX, NULL, 0x0,
|
|
|
|
"Server capabilities flag", HFILL }},
|
|
|
|
{ &hf_asp_server_flag_copyfile,
|
|
|
|
{ "Support copyfile", "asp.server_flag.copyfile",
|
|
|
|
FT_BOOLEAN, 16, NULL, AFPSRVRINFO_COPY,
|
|
|
|
"Server support copyfile", HFILL }},
|
|
|
|
{ &hf_asp_server_flag_passwd,
|
|
|
|
{ "Support change password", "asp.server_flag.passwd",
|
|
|
|
FT_BOOLEAN, 16, NULL, AFPSRVRINFO_PASSWD,
|
|
|
|
"Server support change password", HFILL }},
|
|
|
|
{ &hf_asp_server_flag_no_save_passwd,
|
|
|
|
{ "Don't allow save password", "asp.server_flag.no_save_passwd",
|
|
|
|
FT_BOOLEAN, 16, NULL, AFPSRVRINFO_NOSAVEPASSWD,
|
|
|
|
"Don't allow save password", HFILL }},
|
|
|
|
{ &hf_asp_server_flag_srv_msg,
|
|
|
|
{ "Support server message", "asp.server_flag.srv_msg",
|
|
|
|
FT_BOOLEAN, 16, NULL, AFPSRVRINFO_SRVMSGS,
|
|
|
|
"Support server message", HFILL }},
|
|
|
|
{ &hf_asp_server_flag_srv_sig,
|
|
|
|
{ "Support server signature", "asp.server_flag.srv_sig",
|
|
|
|
FT_BOOLEAN, 16, NULL, AFPSRVRINFO_SRVSIGNATURE,
|
|
|
|
"Support server signature", HFILL }},
|
|
|
|
{ &hf_asp_server_flag_tcpip,
|
|
|
|
{ "Support TCP/IP", "asp.server_flag.tcpip",
|
|
|
|
FT_BOOLEAN, 16, NULL, AFPSRVRINFO_TCPIP,
|
|
|
|
"Server support TCP/IP", HFILL }},
|
|
|
|
{ &hf_asp_server_flag_notify,
|
|
|
|
{ "Support server notifications", "asp.server_flag.notify",
|
|
|
|
FT_BOOLEAN, 16, NULL, AFPSRVRINFO_SRVNOTIFY,
|
|
|
|
"Server support notifications", HFILL }},
|
|
|
|
{ &hf_asp_server_flag_reconnect,
|
|
|
|
{ "Support server reconnect", "asp.server_flag.reconnect",
|
|
|
|
FT_BOOLEAN, 16, NULL, AFPSRVRINFO_SRVRECONNECT,
|
|
|
|
"Server support reconnect", HFILL }},
|
|
|
|
{ &hf_asp_server_flag_directory,
|
|
|
|
{ "Support directory services", "asp.server_flag.directory",
|
|
|
|
FT_BOOLEAN, 16, NULL, AFPSRVRINFO_SRVDIRECTORY,
|
|
|
|
"Server support directory services", HFILL }},
|
|
|
|
{ &hf_asp_server_flag_fast_copy,
|
|
|
|
{ "Support fast copy", "asp.server_flag.fast_copy",
|
|
|
|
FT_BOOLEAN, 16, NULL, AFPSRVRINFO_FASTBOZO,
|
|
|
|
"Server support fast copy", HFILL }},
|
|
|
|
|
|
|
|
{ &hf_asp_server_addr_len,
|
|
|
|
{ "Length", "asp.server_addr.len",
|
|
|
|
FT_UINT8, BASE_DEC, NULL, 0x0,
|
|
|
|
"Address length.", HFILL }},
|
|
|
|
|
|
|
|
{ &hf_asp_server_addr_type,
|
|
|
|
{ "Type", "asp.server_addr.type",
|
|
|
|
FT_UINT8, BASE_DEC, VALS(afp_server_addr_type_vals), 0x0,
|
|
|
|
"Address type.", HFILL }},
|
|
|
|
|
|
|
|
{ &hf_asp_server_addr_value,
|
|
|
|
{ "Value", "asp.server_addr.value",
|
|
|
|
FT_BYTES, BASE_HEX, NULL, 0x0,
|
|
|
|
"Address value", HFILL }},
|
|
|
|
|
2002-04-25 23:58:02 +00:00
|
|
|
};
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2002-06-29 21:27:39 +00:00
|
|
|
static hf_register_info hf_zip[] = {
|
|
|
|
{ &hf_zip_function,
|
|
|
|
{ "Function", "zip.function", FT_UINT8, BASE_DEC, VALS(zip_function_vals), 0x0,
|
|
|
|
"ZIP function", HFILL }},
|
|
|
|
|
|
|
|
{ &hf_zip_zero_value,
|
|
|
|
{ "Pad (0)", "zip.zero_value",FT_BYTES, BASE_HEX, NULL, 0x0,
|
|
|
|
"Pad", HFILL }},
|
|
|
|
|
|
|
|
{ &hf_zip_atp_function,
|
|
|
|
{ "Function", "zip.atp_function", FT_UINT8, BASE_DEC, VALS(zip_atp_function_vals), 0x0,
|
|
|
|
"", HFILL }},
|
|
|
|
|
|
|
|
{ &hf_zip_start_index,
|
|
|
|
{ "Start index", "zip.start_index", FT_UINT16, BASE_DEC, NULL, 0x0,
|
|
|
|
"", HFILL }},
|
|
|
|
|
|
|
|
{ &hf_zip_count,
|
|
|
|
{ "Count", "zip.count", FT_UINT16, BASE_DEC, NULL, 0x0,
|
|
|
|
"", HFILL }},
|
|
|
|
|
|
|
|
{ &hf_zip_network_count,
|
|
|
|
{ "Count", "zip.network_count", FT_UINT8, BASE_DEC, NULL, 0x0,
|
|
|
|
"", HFILL }},
|
|
|
|
{ &hf_zip_network,
|
|
|
|
{ "Network","zip.network", FT_UINT16, BASE_DEC, NULL, 0x0,
|
|
|
|
"", HFILL }},
|
|
|
|
{ &hf_zip_network_start,
|
|
|
|
{ "Network start","zip.network_start", FT_UINT16, BASE_DEC, NULL, 0x0,
|
|
|
|
"", HFILL }},
|
|
|
|
{ &hf_zip_network_end,
|
|
|
|
{ "Network end", "zip.network_end", FT_UINT16, BASE_DEC, NULL, 0x0,
|
|
|
|
"", HFILL }},
|
|
|
|
|
|
|
|
{ &hf_zip_flags,
|
|
|
|
{ "Flags", "zip.flags", FT_BOOLEAN, 8, NULL, 0xC0,
|
|
|
|
"", HFILL }},
|
|
|
|
|
|
|
|
{ &hf_zip_last_flag,
|
|
|
|
{ "Last Flag", "zip.last_flag", FT_BOOLEAN, 8, NULL, 0,
|
|
|
|
"Non zero if contains last zone name in the zone list", HFILL }},
|
|
|
|
|
|
|
|
{ &hf_zip_flags_zone_invalid,
|
|
|
|
{ "Zone invalid", "zip.flags.zone_invalid", FT_BOOLEAN, 8, NULL, 0x80,
|
|
|
|
"", HFILL }},
|
|
|
|
|
|
|
|
{ &hf_zip_flags_use_broadcast,
|
|
|
|
{ "Use broadcast","zip.flags.use_broadcast", FT_BOOLEAN, 8, NULL, 0x40,
|
|
|
|
"", HFILL }},
|
|
|
|
|
|
|
|
{ &hf_zip_flags_only_one_zone,
|
|
|
|
{ "Only one zone","zip.flags.only_one_zone", FT_BOOLEAN, 8, NULL, 0x20,
|
|
|
|
"", HFILL }},
|
|
|
|
|
|
|
|
{ &hf_zip_zone_name,
|
|
|
|
{ "Zone", "zip.zone_name", FT_UINT_STRING, BASE_NONE, NULL, 0x0,
|
|
|
|
"", HFILL }},
|
|
|
|
|
|
|
|
{ &hf_zip_default_zone,
|
|
|
|
{ "Default zone", "zip.default_zone",FT_UINT_STRING, BASE_NONE, NULL, 0x0,
|
|
|
|
"", HFILL }},
|
|
|
|
|
|
|
|
{ &hf_zip_multicast_length,
|
|
|
|
{ "Multicast length", "zip.multicast_length", FT_UINT8, BASE_DEC, NULL, 0x0,
|
|
|
|
"Multicast address length", HFILL }},
|
|
|
|
|
|
|
|
{ &hf_zip_multicast_address,
|
|
|
|
{ "Multicast address", "zip.multicast_address",FT_BYTES, BASE_HEX, NULL, 0x0,
|
|
|
|
"Multicast address", HFILL }},
|
|
|
|
|
|
|
|
};
|
2002-08-28 21:04:11 +00:00
|
|
|
|
1999-11-16 11:44:20 +00:00
|
|
|
static gint *ett[] = {
|
2001-11-30 07:14:22 +00:00
|
|
|
&ett_llap,
|
2001-01-03 06:56:03 +00:00
|
|
|
&ett_ddp,
|
2002-04-25 23:58:02 +00:00
|
|
|
&ett_atp,
|
|
|
|
&ett_atp_info,
|
2002-05-01 07:26:45 +00:00
|
|
|
&ett_atp_segments,
|
2002-04-30 22:05:33 +00:00
|
|
|
&ett_atp_segment,
|
2002-04-25 23:58:02 +00:00
|
|
|
&ett_asp,
|
2002-05-03 21:25:43 +00:00
|
|
|
|
|
|
|
/* asp dsi afp */
|
|
|
|
&ett_asp_status,
|
|
|
|
&ett_asp_status_server_flag,
|
|
|
|
&ett_asp_vers,
|
|
|
|
&ett_asp_uams,
|
|
|
|
&ett_asp_addr,
|
2002-05-08 23:46:34 +00:00
|
|
|
&ett_asp_addr_line,
|
2002-05-03 21:25:43 +00:00
|
|
|
&ett_asp_directory,
|
2002-08-28 21:04:11 +00:00
|
|
|
|
1999-12-08 23:55:01 +00:00
|
|
|
&ett_nbp,
|
1999-12-09 04:02:50 +00:00
|
|
|
&ett_nbp_info,
|
|
|
|
&ett_nbp_node,
|
1999-12-09 17:06:37 +00:00
|
|
|
&ett_pstring,
|
|
|
|
&ett_rtmp,
|
2002-04-25 23:58:02 +00:00
|
|
|
&ett_rtmp_tuple,
|
2002-06-29 21:27:39 +00:00
|
|
|
|
|
|
|
&ett_zip,
|
|
|
|
&ett_zip_flags,
|
2002-08-28 21:04:11 +00:00
|
|
|
&ett_zip_zones_list,
|
|
|
|
&ett_zip_network_list,
|
1999-11-16 11:44:20 +00:00
|
|
|
};
|
2002-04-30 22:05:33 +00:00
|
|
|
module_t *atp_module;
|
1999-07-29 05:47:07 +00:00
|
|
|
|
2001-11-30 07:14:22 +00:00
|
|
|
proto_llap = proto_register_protocol("LocalTalk Link Access Protocol", "LLAP", "llap");
|
|
|
|
proto_register_field_array(proto_llap, hf_llap, array_length(hf_llap));
|
|
|
|
|
2001-01-03 06:56:03 +00:00
|
|
|
proto_ddp = proto_register_protocol("Datagram Delivery Protocol", "DDP", "ddp");
|
1999-12-08 23:55:01 +00:00
|
|
|
proto_register_field_array(proto_ddp, hf_ddp, array_length(hf_ddp));
|
|
|
|
|
2001-01-03 06:56:03 +00:00
|
|
|
proto_nbp = proto_register_protocol("Name Binding Protocol", "NBP", "nbp");
|
1999-12-08 23:55:01 +00:00
|
|
|
proto_register_field_array(proto_nbp, hf_nbp, array_length(hf_nbp));
|
|
|
|
|
2002-04-25 23:58:02 +00:00
|
|
|
proto_atp = proto_register_protocol("AppleTalk Transaction Protocol packet", "ATP", "atp");
|
|
|
|
proto_register_field_array(proto_atp, hf_atp, array_length(hf_atp));
|
|
|
|
|
2002-04-26 07:41:31 +00:00
|
|
|
proto_asp = proto_register_protocol("AppleTalk Session Protocol", "ASP", "asp");
|
2002-04-25 23:58:02 +00:00
|
|
|
proto_register_field_array(proto_asp, hf_asp, array_length(hf_asp));
|
|
|
|
|
2002-06-29 21:27:39 +00:00
|
|
|
proto_zip = proto_register_protocol("Zone Information Protocol", "ZIP", "zip");
|
|
|
|
proto_register_field_array(proto_zip, hf_zip, array_length(hf_zip));
|
|
|
|
|
2002-04-30 22:05:33 +00:00
|
|
|
atp_module = prefs_register_protocol(proto_atp, NULL);
|
|
|
|
prefs_register_bool_preference(atp_module, "desegment",
|
|
|
|
"Desegment all ATP messages spanning multiple DDP packets",
|
|
|
|
"Whether the ATP dissector should desegment all messages spanning multiple DDP packets",
|
|
|
|
&atp_defragment);
|
|
|
|
|
2000-11-13 04:26:14 +00:00
|
|
|
proto_rtmp = proto_register_protocol("Routing Table Maintenance Protocol",
|
2001-01-03 06:56:03 +00:00
|
|
|
"RTMP", "rtmp");
|
1999-12-09 17:06:37 +00:00
|
|
|
proto_register_field_array(proto_rtmp, hf_rtmp, array_length(hf_rtmp));
|
|
|
|
|
1999-11-16 11:44:20 +00:00
|
|
|
proto_register_subtree_array(ett, array_length(ett));
|
2000-05-28 22:59:18 +00:00
|
|
|
|
|
|
|
/* subdissector code */
|
2001-12-08 06:41:48 +00:00
|
|
|
ddp_dissector_table = register_dissector_table("ddp.type", "DDP packet type",
|
|
|
|
FT_UINT8, BASE_HEX);
|
1999-07-29 05:47:07 +00:00
|
|
|
}
|
Change the sub-dissector handoff registration routines so that the
sub-dissector table is not stored in the header_field_info struct, but
in a separate namespace. Dissector tables are now registered by name
and not by field ID. For example:
udp_dissector_table = register_dissector_table("udp.port");
Because of this different namespace, dissector tables can have names
that are not field names. This is useful for ethertype, since multiple
fields are "ethertypes".
packet-ethertype.c replaces ethertype.c (the name was changed so that it
would be named in the same fashion as all the filenames passed to make-reg-dotc)
Although it registers no protocol or field, it registers one dissector table:
ethertype_dissector_table = register_dissector_table("ethertype");
All protocols that can be called because of an ethertype field now register
that fact with dissector_add() calls.
In this way, one dissector_table services all ethertype fields
(hf_eth_type, hf_llc_type, hf_null_etype, hf_vlan_etype)
Furthermore, the code allows for names of protocols to exist in the
etype_vals, yet a dissector for that protocol doesn't exist. The name
of the dissector is printed in COL_INFO. You're welcome, Richard. :-)
svn path=/trunk/; revision=1848
2000-04-13 18:18:56 +00:00
|
|
|
|
|
|
|
void
|
|
|
|
proto_reg_handoff_atalk(void)
|
|
|
|
{
|
2001-12-03 04:00:26 +00:00
|
|
|
dissector_handle_t ddp_handle, nbp_handle, rtmp_request_handle;
|
2002-04-25 23:58:02 +00:00
|
|
|
dissector_handle_t atp_handle;
|
2002-06-29 21:27:39 +00:00
|
|
|
dissector_handle_t zip_ddp_handle;
|
2001-12-03 04:00:26 +00:00
|
|
|
dissector_handle_t rtmp_data_handle, llap_handle;
|
|
|
|
|
|
|
|
ddp_handle = create_dissector_handle(dissect_ddp, proto_ddp);
|
|
|
|
dissector_add("ethertype", ETHERTYPE_ATALK, ddp_handle);
|
|
|
|
dissector_add("chdlctype", ETHERTYPE_ATALK, ddp_handle);
|
|
|
|
dissector_add("ppp.protocol", PPP_AT, ddp_handle);
|
|
|
|
dissector_add("null.type", BSD_AF_APPLETALK, ddp_handle);
|
|
|
|
|
|
|
|
nbp_handle = create_dissector_handle(dissect_nbp, proto_nbp);
|
|
|
|
dissector_add("ddp.type", DDP_NBP, nbp_handle);
|
|
|
|
|
2002-04-25 23:58:02 +00:00
|
|
|
atp_handle = create_dissector_handle(dissect_atp, proto_atp);
|
|
|
|
dissector_add("ddp.type", DDP_ATP, atp_handle);
|
|
|
|
|
|
|
|
asp_handle = create_dissector_handle(dissect_asp, proto_asp);
|
|
|
|
|
2001-12-03 04:00:26 +00:00
|
|
|
rtmp_request_handle = create_dissector_handle(dissect_rtmp_request, proto_rtmp);
|
|
|
|
rtmp_data_handle = create_dissector_handle(dissect_rtmp_data, proto_rtmp);
|
|
|
|
dissector_add("ddp.type", DDP_RTMPREQ, rtmp_request_handle);
|
|
|
|
dissector_add("ddp.type", DDP_RTMPDATA, rtmp_data_handle);
|
|
|
|
|
2002-06-29 21:27:39 +00:00
|
|
|
zip_ddp_handle = create_dissector_handle(dissect_ddp_zip, proto_zip);
|
|
|
|
dissector_add("ddp.type", DDP_ZIP, zip_ddp_handle);
|
|
|
|
|
|
|
|
zip_atp_handle = create_dissector_handle(dissect_atp_zip, proto_zip);
|
|
|
|
|
2001-12-03 04:00:26 +00:00
|
|
|
llap_handle = create_dissector_handle(dissect_llap, proto_llap);
|
|
|
|
dissector_add("wtap_encap", WTAP_ENCAP_LOCALTALK, llap_handle);
|
|
|
|
|
2002-05-03 21:25:43 +00:00
|
|
|
register_init_routine( atp_init);
|
2002-04-25 23:58:02 +00:00
|
|
|
register_init_routine( &asp_reinit);
|
|
|
|
|
|
|
|
afp_handle = find_dissector("afp");
|
2001-11-26 01:03:35 +00:00
|
|
|
data_handle = find_dissector("data");
|
Change the sub-dissector handoff registration routines so that the
sub-dissector table is not stored in the header_field_info struct, but
in a separate namespace. Dissector tables are now registered by name
and not by field ID. For example:
udp_dissector_table = register_dissector_table("udp.port");
Because of this different namespace, dissector tables can have names
that are not field names. This is useful for ethertype, since multiple
fields are "ethertypes".
packet-ethertype.c replaces ethertype.c (the name was changed so that it
would be named in the same fashion as all the filenames passed to make-reg-dotc)
Although it registers no protocol or field, it registers one dissector table:
ethertype_dissector_table = register_dissector_table("ethertype");
All protocols that can be called because of an ethertype field now register
that fact with dissector_add() calls.
In this way, one dissector_table services all ethertype fields
(hf_eth_type, hf_llc_type, hf_null_etype, hf_vlan_etype)
Furthermore, the code allows for names of protocols to exist in the
etype_vals, yet a dissector for that protocol doesn't exist. The name
of the dissector is printed in COL_INFO. You're welcome, Richard. :-)
svn path=/trunk/; revision=1848
2000-04-13 18:18:56 +00:00
|
|
|
}
|