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,
|
2005-10-13 05:23:01 +00:00
|
|
|
* RTMP, PAP.
|
1998-10-16 01:18:35 +00:00
|
|
|
*
|
|
|
|
* Simon Wilkinson <sxw@dcs.ed.ac.uk>
|
|
|
|
*
|
2006-05-21 04:49:01 +00:00
|
|
|
* Wireshark - Network traffic analyzer
|
|
|
|
* By Gerald Combs <gerald@wireshark.org>
|
2001-12-03 04:00:26 +00:00
|
|
|
* 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
|
2012-06-28 22:56:06 +00:00
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
1998-10-16 01:18:35 +00:00
|
|
|
*/
|
|
|
|
|
2012-09-20 02:03:38 +00:00
|
|
|
#include "config.h"
|
1998-10-16 01:18:35 +00:00
|
|
|
|
2002-05-03 21:25:43 +00:00
|
|
|
|
2014-12-20 21:23:59 +00:00
|
|
|
#include <epan/packet.h>
|
2005-09-17 00:02:31 +00:00
|
|
|
#include <epan/etypes.h>
|
|
|
|
#include <epan/ppptypes.h>
|
|
|
|
#include <epan/aftypes.h>
|
|
|
|
#include <epan/arcnet_pids.h>
|
2002-04-25 23:58:02 +00:00
|
|
|
#include <epan/conversation.h>
|
2004-09-27 22:55:15 +00:00
|
|
|
#include <epan/prefs.h>
|
2005-02-09 23:38:00 +00:00
|
|
|
#include <epan/reassemble.h>
|
2015-02-08 18:49:57 +00:00
|
|
|
#include <epan/address_types.h>
|
2015-01-08 16:54:36 +00:00
|
|
|
#include <epan/to_str.h>
|
2014-12-20 21:23:59 +00:00
|
|
|
#include <wiretap/wtap.h>
|
2015-12-13 04:38:21 +00:00
|
|
|
#include <epan/capture_dissectors.h>
|
2005-08-14 23:25:20 +00:00
|
|
|
#include "packet-atalk.h"
|
2002-04-25 23:58:02 +00:00
|
|
|
#include "packet-afp.h"
|
|
|
|
|
2013-03-13 21:14:20 +00:00
|
|
|
void proto_register_atalk(void);
|
|
|
|
void proto_reg_handoff_atalk(void);
|
|
|
|
|
2002-04-30 22:05:33 +00:00
|
|
|
/* Tables for reassembly of fragments. */
|
2013-03-22 23:59:54 +00:00
|
|
|
static reassembly_table atp_reassembly_table;
|
2002-04-30 22:05:33 +00:00
|
|
|
|
|
|
|
/* desegmentation of ATP */
|
|
|
|
static gboolean atp_defragment = TRUE;
|
|
|
|
|
2002-04-25 23:58:02 +00:00
|
|
|
static dissector_handle_t afp_handle;
|
2014-04-06 19:12:59 +00:00
|
|
|
static dissector_handle_t afp_server_status_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
|
|
|
|
2003-11-16 23:17:27 +00:00
|
|
|
static dissector_handle_t ddp_handle;
|
2015-11-26 13:25:32 +00:00
|
|
|
static dissector_handle_t ddp_short_handle;
|
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)
|
|
|
|
*/
|
2010-05-10 15:54:57 +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
|
|
|
|
2010-05-10 15:54:57 +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-04-25 23:58:02 +00:00
|
|
|
|
2002-08-28 21:04:11 +00:00
|
|
|
/* ------------------------- */
|
2002-04-25 23:58:02 +00:00
|
|
|
static dissector_handle_t asp_handle;
|
2005-10-13 05:23:01 +00:00
|
|
|
static dissector_handle_t pap_handle;
|
2002-04-25 23:58:02 +00:00
|
|
|
|
|
|
|
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;
|
2011-01-30 21:01:07 +00:00
|
|
|
static int hf_atp_segment_count = -1;
|
2003-04-20 11:36:16 +00:00
|
|
|
static int hf_atp_reassembled_in = -1;
|
2010-02-02 16:01:52 +00:00
|
|
|
static int hf_atp_reassembled_length = -1;
|
2002-05-01 07:26:45 +00:00
|
|
|
|
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;
|
2010-05-10 15:54:57 +00:00
|
|
|
static int hf_zip_zero_value = -1;
|
2002-06-29 21:27:39 +00:00
|
|
|
|
|
|
|
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;
|
|
|
|
|
2014-09-11 00:04:22 +00:00
|
|
|
static int hf_zip_flags = -1;
|
2002-06-29 21:27:39 +00:00
|
|
|
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}
|
|
|
|
};
|
2010-11-08 21:59:39 +00:00
|
|
|
static value_string_ext zip_function_vals_ext = VALUE_STRING_EXT_INIT(zip_function_vals);
|
2002-06-29 21:27:39 +00:00
|
|
|
|
|
|
|
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
|
2009-03-18 23:30:21 +00:00
|
|
|
#define ASPERR_OK 0
|
|
|
|
#define ASPERR_BADVERS (-1066)
|
|
|
|
#define ASPERR_BUFSMALL (-1067)
|
|
|
|
#define ASPERR_NOSESS (-1068)
|
|
|
|
#define ASPERR_NOSERV (-1069)
|
|
|
|
#define ASPERR_PARM (-1070)
|
|
|
|
#define ASPERR_SERVBUSY (-1071)
|
|
|
|
#define ASPERR_SESSCLOS (-1072)
|
|
|
|
#define ASPERR_SIZERR (-1073)
|
|
|
|
#define ASPERR_TOOMANY (-1074)
|
|
|
|
#define ASPERR_NOACK (-1075)
|
2002-04-25 23:58:02 +00:00
|
|
|
|
2009-07-23 21:25:02 +00:00
|
|
|
static int proto_asp = -1;
|
|
|
|
static int hf_asp_func = -1;
|
|
|
|
static int hf_asp_error = -1;
|
2010-05-10 15:54:57 +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;
|
2002-05-03 21:25:43 +00:00
|
|
|
|
2002-04-25 23:58:02 +00:00
|
|
|
typedef struct {
|
2009-07-23 21:25:02 +00:00
|
|
|
guint32 conversation;
|
|
|
|
guint8 src[4];
|
2010-05-10 15:54:57 +00:00
|
|
|
guint16 seq;
|
2002-04-25 23:58:02 +00:00
|
|
|
} asp_request_key;
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2002-04-25 23:58:02 +00:00
|
|
|
typedef struct {
|
2010-05-10 15:54:57 +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;
|
|
|
|
|
|
|
|
/* Hash Functions */
|
|
|
|
static gint asp_equal (gconstpointer v, gconstpointer v2)
|
|
|
|
{
|
2009-07-23 21:25:02 +00:00
|
|
|
const asp_request_key *val1 = (const asp_request_key*)v;
|
|
|
|
const asp_request_key *val2 = (const asp_request_key*)v2;
|
|
|
|
|
|
|
|
if (val1->conversation == val2->conversation &&
|
|
|
|
val1->seq == val2->seq &&
|
|
|
|
!memcmp(val1->src, val2->src, 4)) {
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
return 0;
|
2002-04-25 23:58:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static guint asp_hash (gconstpointer v)
|
|
|
|
{
|
2009-07-23 21:25:02 +00:00
|
|
|
const asp_request_key *asp_key = (const asp_request_key*)v;
|
|
|
|
return asp_key->seq;
|
2002-04-25 23:58:02 +00:00
|
|
|
}
|
|
|
|
|
2002-05-03 21:25:43 +00:00
|
|
|
/* ------------------------------------ */
|
|
|
|
static GHashTable *atp_request_hash = 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;
|
2005-10-13 05:23:01 +00:00
|
|
|
static gint ett_pap = -1;
|
2002-04-25 23:58:02 +00:00
|
|
|
|
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-10-24 06:17:36 +00:00
|
|
|
static const fragment_items atp_frag_items = {
|
2009-07-23 21:25:02 +00:00
|
|
|
&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,
|
2011-01-30 21:01:07 +00:00
|
|
|
&hf_atp_segment_count,
|
2009-07-23 21:25:02 +00:00
|
|
|
&hf_atp_reassembled_in,
|
2010-02-02 16:01:52 +00:00
|
|
|
&hf_atp_reassembled_length,
|
2012-09-07 02:09:59 +00:00
|
|
|
/* Reassembled data field */
|
|
|
|
NULL,
|
2009-07-23 21:25:02 +00:00
|
|
|
"segments"
|
2002-06-07 10:11:41 +00:00
|
|
|
};
|
|
|
|
|
2005-10-13 05:23:01 +00:00
|
|
|
/* -------------------------------- */
|
|
|
|
|
|
|
|
#define PAPOpenConn 1
|
|
|
|
#define PAPOpenConnReply 2
|
|
|
|
#define PAPSendData 3
|
|
|
|
#define PAPData 4
|
|
|
|
#define PAPTickle 5
|
|
|
|
#define PAPCloseConn 6
|
|
|
|
#define PAPCloseConnReply 7
|
|
|
|
#define PAPSendStatus 8
|
|
|
|
#define PAPStatus 9
|
|
|
|
|
|
|
|
static int proto_pap = -1;
|
|
|
|
|
|
|
|
static int hf_pap_connid = -1;
|
|
|
|
static int hf_pap_function = -1;
|
|
|
|
static int hf_pap_socket = -1;
|
|
|
|
static int hf_pap_quantum = -1;
|
|
|
|
static int hf_pap_waittime = -1;
|
|
|
|
static int hf_pap_result = -1;
|
|
|
|
static int hf_pap_status = -1;
|
|
|
|
static int hf_pap_seq = -1;
|
|
|
|
static int hf_pap_eof = -1;
|
|
|
|
|
|
|
|
static int hf_pap_pad = -1;
|
|
|
|
|
2015-02-08 18:49:57 +00:00
|
|
|
static int atalk_address_type = -1;
|
|
|
|
|
2005-10-13 05:23:01 +00:00
|
|
|
static const value_string pap_function_vals[] = {
|
|
|
|
{PAPOpenConn , "Open Connection Query"},
|
|
|
|
{PAPOpenConnReply , "Open Connection Reply"},
|
|
|
|
{PAPSendData , "Send Data"},
|
|
|
|
{PAPData , "Data"},
|
|
|
|
{PAPTickle , "Tickle"},
|
|
|
|
{PAPCloseConn , "Close Connection Query"},
|
|
|
|
{PAPCloseConnReply , "Close Connection reply"},
|
|
|
|
{PAPSendStatus , "Send Status"},
|
|
|
|
{PAPStatus , "Status"},
|
2007-11-28 15:55:50 +00:00
|
|
|
|
2005-10-13 05:23:01 +00:00
|
|
|
{0, NULL}
|
|
|
|
};
|
2010-11-08 21:59:39 +00:00
|
|
|
static value_string_ext pap_function_vals_ext = VALUE_STRING_EXT_INIT(pap_function_vals);
|
2005-10-13 05:23:01 +00:00
|
|
|
|
|
|
|
/* -------------------------------- */
|
|
|
|
|
2000-05-28 22:59:18 +00:00
|
|
|
static dissector_table_t ddp_dissector_table;
|
|
|
|
|
2001-11-30 07:14:22 +00:00
|
|
|
#define DDP_SHORT_HEADER_SIZE 5
|
|
|
|
|
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" },
|
2010-11-08 21:59:39 +00:00
|
|
|
{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"},
|
|
|
|
{DDP_EIGRP, "Cisco EIGRP for AppleTalk"},
|
1999-10-22 08:11:40 +00:00
|
|
|
{0, NULL}
|
|
|
|
};
|
2010-11-08 21:59:39 +00:00
|
|
|
static value_string_ext op_vals_ext = VALUE_STRING_EXT_INIT(op_vals);
|
1999-10-22 08:11:40 +00:00
|
|
|
|
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[] = {
|
2010-05-10 15:54:57 +00:00
|
|
|
{ASPFUNC_CLOSE, "CloseSession" },
|
|
|
|
{ASPFUNC_CMD, "Command" },
|
|
|
|
{ASPFUNC_STAT, "GetStatus" },
|
|
|
|
{ASPFUNC_OPEN, "OpenSession" },
|
|
|
|
{ASPFUNC_TICKLE, "Tickle" },
|
|
|
|
{ASPFUNC_WRITE, "Write" },
|
|
|
|
{ASPFUNC_WRTCONT, "Write Cont" },
|
|
|
|
{ASPFUNC_ATTN, "Attention" },
|
|
|
|
{0, NULL } };
|
2010-11-08 21:59:39 +00:00
|
|
|
static value_string_ext asp_func_vals_ext = VALUE_STRING_EXT_INIT(asp_func_vals);
|
2002-04-25 23:58:02 +00:00
|
|
|
|
2010-11-08 21:59:39 +00:00
|
|
|
/* XXX: Array sorted in ascending order (unsigned) to allow value_string_ext binary search */
|
|
|
|
static const value_string asp_error_vals[] = {
|
2010-05-10 15:54:57 +00:00
|
|
|
{AFP_OK , "success"},
|
|
|
|
{AFPERR_USRLOGIN , "user already logged on" },
|
2010-11-08 21:59:39 +00:00
|
|
|
{AFPERR_PWDPOLCY , "password fails policy check" },
|
|
|
|
{AFPERR_PWDCHNG , "password needs to be changed" },
|
|
|
|
{AFPERR_INTRASH , "shared folder in trash." },
|
|
|
|
{AFPERR_INSHRD , "folder being shared is inside a shared folder." },
|
|
|
|
{AFPERR_PWDEXPR , "password expired" },
|
|
|
|
{AFPERR_PWDSHORT , "password too short" },
|
|
|
|
{AFPERR_PWDSAME , "same password/can't change password" },
|
|
|
|
{AFPERR_BADID , "non-existent file id" },
|
|
|
|
{AFPERR_SAMEOBJ , "source file == destination file" },
|
|
|
|
{AFPERR_CATCHNG , "catalog has changed" },
|
|
|
|
{AFPERR_DIFFVOL , "different volume" },
|
|
|
|
{AFPERR_EXISTID , "file already has an id" },
|
|
|
|
{AFPERR_NOID , "file thread not found" },
|
|
|
|
{AFPERR_CTNSHRD , "share point contains a share point" },
|
|
|
|
{AFPERR_OLOCK , "object locked" },
|
|
|
|
{AFPERR_VLOCK , "volume locked" },
|
|
|
|
{AFPERR_ITYPE , "wrong icon type" },
|
|
|
|
{AFPERR_NODIR , "couldn't find directory" },
|
|
|
|
{AFPERR_NORENAME , "can't rename" },
|
|
|
|
{AFPERR_SHUTDOWN , "server is going down" },
|
|
|
|
{AFPERR_NFILE , "too many files open" },
|
|
|
|
{AFPERR_BADTYPE , "object is the wrong type" },
|
|
|
|
{AFPERR_NOOP , "command not supported" },
|
|
|
|
{AFPERR_NOTAUTH , "user not authenticated" },
|
|
|
|
{AFPERR_SESSCLOS , "session closed" },
|
|
|
|
{AFPERR_RANGEOVR , "range overlap" },
|
|
|
|
{AFPERR_NORANGE , "no range lock" },
|
|
|
|
{AFPERR_PARAM , "parameter error" },
|
|
|
|
{AFPERR_NOOBJ , "object not found" },
|
|
|
|
{AFPERR_EXIST , "object already exists" },
|
|
|
|
{AFPERR_NOSRVR , "no response by server at that address" },
|
|
|
|
{AFPERR_NLOCK , "no more locks" },
|
|
|
|
{AFPERR_MISC , "misc. err" },
|
|
|
|
{AFPERR_LOCK , "LockErr" },
|
|
|
|
{AFPERR_NOITEM , "ItemNotFound" },
|
|
|
|
{AFPERR_FLATVOL , "volume doesn't support directories" },
|
|
|
|
{AFPERR_BUSY , "FileBusy" },
|
|
|
|
{AFPERR_EOF , "end of file" },
|
|
|
|
{AFPERR_DFULL , "disk full" },
|
|
|
|
{AFPERR_DIRNEMPT , "directory not empty" },
|
|
|
|
{AFPERR_DENYCONF , "file synchronization locks conflict" },
|
|
|
|
{AFPERR_CANTMOVE , "can't move file" },
|
|
|
|
{AFPERR_BITMAP , "invalid bitmap" },
|
|
|
|
{AFPERR_BADVERS , "bad afp version number" },
|
|
|
|
{AFPERR_BADUAM , "uam doesn't exist" },
|
|
|
|
{AFPERR_AUTHCONT , "logincont" },
|
|
|
|
{AFPERR_ACCESS , "permission denied" },
|
|
|
|
{ASPERR_SESSCLOS , "session closed (ASP)" },
|
|
|
|
{ASPERR_NOSESS , "no more sessions available"},
|
2010-05-10 15:54:57 +00:00
|
|
|
{0, NULL } };
|
2010-11-08 21:59:39 +00:00
|
|
|
value_string_ext asp_error_vals_ext = VALUE_STRING_EXT_INIT(asp_error_vals);
|
2002-04-25 23:58:02 +00:00
|
|
|
|
2000-11-13 04:26:14 +00:00
|
|
|
/*
|
2014-09-11 00:04:22 +00:00
|
|
|
* hf_index must be a FT_UINT_STRING type
|
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,
|
2009-07-23 21:25:02 +00:00
|
|
|
int hf_index)
|
1999-12-09 04:02:50 +00:00
|
|
|
{
|
2012-03-06 03:20:17 +00:00
|
|
|
int len;
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2009-07-23 21:25:02 +00:00
|
|
|
len = tvb_get_guint8(tvb, offset);
|
2014-09-18 14:35:48 +00:00
|
|
|
proto_tree_add_item(tree, hf_index, tvb, offset, 1, ENC_ASCII|ENC_BIG_ENDIAN);
|
1999-12-09 04:02:50 +00:00
|
|
|
|
2014-09-11 00:04:22 +00:00
|
|
|
offset += (len+1);
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2009-07-23 21:25:02 +00:00
|
|
|
return offset;
|
1999-12-09 04:02:50 +00:00
|
|
|
}
|
|
|
|
|
2015-11-15 13:00:10 +00:00
|
|
|
static int
|
|
|
|
dissect_rtmp_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) {
|
2000-11-13 04:26:14 +00:00
|
|
|
proto_tree *rtmp_tree;
|
|
|
|
proto_item *ti;
|
2012-03-06 03:20:17 +00:00
|
|
|
guint8 function;
|
2000-11-13 04:26:14 +00:00
|
|
|
|
2009-08-09 06:26:46 +00:00
|
|
|
col_set_str(pinfo->cinfo, COL_PROTOCOL, "RTMP");
|
2009-08-09 07:36:13 +00:00
|
|
|
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
|
|
|
|
2011-09-26 08:25:18 +00:00
|
|
|
col_add_str(pinfo->cinfo, COL_INFO,
|
|
|
|
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) {
|
2011-10-21 02:10:19 +00:00
|
|
|
ti = proto_tree_add_item(tree, proto_rtmp, tvb, 0, 1, ENC_NA);
|
2000-11-13 04:26:14 +00:00
|
|
|
rtmp_tree = proto_item_add_subtree(ti, ett_rtmp);
|
|
|
|
|
|
|
|
proto_tree_add_uint(rtmp_tree, hf_rtmp_function, tvb, 0, 1, function);
|
|
|
|
}
|
2015-11-15 13:00:10 +00:00
|
|
|
return tvb_captured_length(tvb);
|
1999-12-08 23:25:37 +00:00
|
|
|
}
|
|
|
|
|
2015-11-15 13:00:10 +00:00
|
|
|
static int
|
|
|
|
dissect_rtmp_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) {
|
1999-12-09 17:06:37 +00:00
|
|
|
proto_tree *rtmp_tree;
|
|
|
|
proto_item *ti;
|
2012-03-06 03:20:17 +00:00
|
|
|
int offset = 0;
|
|
|
|
guint16 net;
|
|
|
|
guint8 nodelen,nodelen_bits;
|
|
|
|
guint16 node; /* might be more than 8 bits */
|
|
|
|
int i;
|
1999-12-09 17:06:37 +00:00
|
|
|
|
2009-08-09 06:26:46 +00:00
|
|
|
col_set_str(pinfo->cinfo, COL_PROTOCOL, "RTMP");
|
2009-08-09 07:36:13 +00:00
|
|
|
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 ) {
|
2013-10-16 14:17:05 +00:00
|
|
|
node = tvb_get_guint8(tvb, offset+3);
|
2000-11-13 04:26:14 +00:00
|
|
|
nodelen = 1;
|
1999-12-09 17:06:37 +00:00
|
|
|
} else {
|
2013-10-16 14:17:05 +00:00
|
|
|
node = tvb_get_ntohs(tvb, offset+3);
|
2000-11-13 04:26:14 +00:00
|
|
|
nodelen = 2;
|
1999-12-09 17:06:37 +00:00
|
|
|
}
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2011-09-26 08:25:18 +00:00
|
|
|
col_add_fstr(pinfo->cinfo, COL_INFO, "Net: %u Node Len: %u Node: %u",
|
|
|
|
net, nodelen_bits, node);
|
2002-08-28 21:04:11 +00:00
|
|
|
|
1999-12-09 17:06:37 +00:00
|
|
|
if (tree) {
|
2011-10-21 02:10:19 +00:00
|
|
|
ti = proto_tree_add_item(tree, proto_rtmp, tvb, offset, -1, ENC_NA);
|
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,
|
2010-05-10 15:54:57 +00:00
|
|
|
nodelen_bits);
|
2000-11-13 04:26:14 +00:00
|
|
|
proto_tree_add_uint(rtmp_tree, hf_rtmp_node, tvb, offset+3, nodelen,
|
2010-05-10 15:54:57 +00:00
|
|
|
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)) {
|
2014-06-22 20:01:36 +00:00
|
|
|
proto_tree *tuple_tree;
|
2000-11-13 04:26:14 +00:00
|
|
|
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);
|
2014-06-22 20:01:36 +00:00
|
|
|
tuple_tree = proto_tree_add_subtree_format(rtmp_tree, tvb, offset, 6,
|
|
|
|
ett_rtmp_tuple, NULL,
|
2010-05-10 15:54:57 +00:00
|
|
|
"Tuple %d: Range Start: %u Dist: %u Range End: %u",
|
|
|
|
i, tuple_net, tuple_dist&0x7F, tuple_range_end);
|
2000-11-13 04:26:14 +00:00
|
|
|
} else {
|
2014-06-22 20:01:36 +00:00
|
|
|
tuple_tree = proto_tree_add_subtree_format(rtmp_tree, tvb, offset, 3,
|
|
|
|
ett_rtmp_tuple, NULL,
|
2010-05-10 15:54:57 +00:00
|
|
|
"Tuple %d: Net: %u Dist: %u",
|
|
|
|
i, tuple_net, tuple_dist);
|
2000-11-13 04:26:14 +00:00
|
|
|
}
|
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,
|
2010-05-10 15:54:57 +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,
|
2010-05-10 15:54:57 +00:00
|
|
|
tuple_net);
|
2000-11-13 04:26:14 +00:00
|
|
|
}
|
|
|
|
proto_tree_add_uint(tuple_tree, hf_rtmp_tuple_dist, tvb, offset+2, 1,
|
2010-05-10 15:54:57 +00:00
|
|
|
tuple_dist & 0x7F);
|
2000-11-13 04:26:14 +00:00
|
|
|
|
|
|
|
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,
|
2011-09-26 08:25:18 +00:00
|
|
|
ENC_BIG_ENDIAN);
|
2010-05-10 15:54:57 +00:00
|
|
|
offset += 6;
|
2000-11-13 04:26:14 +00:00
|
|
|
} else
|
|
|
|
offset += 3;
|
|
|
|
|
|
|
|
i++;
|
|
|
|
}
|
1999-12-09 17:06:37 +00:00
|
|
|
}
|
2015-11-15 13:00:10 +00:00
|
|
|
return tvb_captured_length(tvb);
|
1999-12-08 23:21:08 +00:00
|
|
|
}
|
|
|
|
|
2015-11-15 13:00:10 +00:00
|
|
|
static int
|
|
|
|
dissect_nbp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) {
|
1999-12-08 23:55:01 +00:00
|
|
|
proto_tree *nbp_tree;
|
|
|
|
proto_tree *nbp_info_tree;
|
|
|
|
proto_item *ti, *info_item;
|
2012-03-06 03:20:17 +00:00
|
|
|
int offset = 0;
|
|
|
|
guint8 info;
|
|
|
|
guint op, count;
|
|
|
|
guint i;
|
1999-12-08 23:55:01 +00:00
|
|
|
|
2009-08-09 06:26:46 +00:00
|
|
|
col_set_str(pinfo->cinfo, COL_PROTOCOL, "NBP");
|
2009-08-09 07:36:13 +00:00
|
|
|
col_clear(pinfo->cinfo, COL_INFO);
|
1999-12-08 23:55:01 +00:00
|
|
|
|
2012-03-06 03:20:17 +00:00
|
|
|
info = tvb_get_guint8(tvb, offset);
|
|
|
|
op = info >> 4;
|
2000-11-13 04:26:14 +00:00
|
|
|
count = info & 0x0F;
|
1999-12-08 23:55:01 +00:00
|
|
|
|
2011-09-26 08:25:18 +00:00
|
|
|
col_add_fstr(pinfo->cinfo, COL_INFO, "Op: %s Count: %u",
|
|
|
|
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) {
|
2011-10-21 02:10:19 +00:00
|
|
|
ti = proto_tree_add_item(tree, proto_nbp, tvb, offset, -1, ENC_NA);
|
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,
|
2010-05-10 15:54:57 +00:00
|
|
|
info,
|
|
|
|
"Info: 0x%01X Operation: %s Count: %u", info,
|
|
|
|
val_to_str(op, nbp_op_vals, "Unknown (0x%01X)"),
|
|
|
|
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);
|
2011-09-26 08:25:18 +00:00
|
|
|
proto_tree_add_item(nbp_tree, hf_nbp_tid, tvb, offset+1, 1, ENC_BIG_ENDIAN);
|
2000-11-13 04:26:14 +00:00
|
|
|
offset += 2;
|
1999-12-09 04:02:50 +00:00
|
|
|
|
2012-03-06 03:20:17 +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
|
|
|
|
2014-06-22 20:01:36 +00:00
|
|
|
node_tree = proto_tree_add_subtree_format(nbp_tree, tvb, offset, -1,
|
|
|
|
ett_nbp_node, &node_item, "Node %u", i+1);
|
2000-11-13 04:26:14 +00:00
|
|
|
|
2011-09-26 08:25:18 +00:00
|
|
|
proto_tree_add_item(node_tree, hf_nbp_node_net, tvb, offset, 2, ENC_BIG_ENDIAN);
|
2000-11-13 04:26:14 +00:00
|
|
|
offset += 2;
|
2011-09-26 08:25:18 +00:00
|
|
|
proto_tree_add_item(node_tree, hf_nbp_node_node, tvb, offset, 1, ENC_BIG_ENDIAN);
|
2000-11-13 04:26:14 +00:00
|
|
|
offset++;
|
2011-09-26 08:25:18 +00:00
|
|
|
proto_tree_add_item(node_tree, hf_nbp_node_port, tvb, offset, 1, ENC_BIG_ENDIAN);
|
2000-11-13 04:26:14 +00:00
|
|
|
offset++;
|
2011-09-26 08:25:18 +00:00
|
|
|
proto_tree_add_item(node_tree, hf_nbp_node_enum, tvb, offset, 1, ENC_BIG_ENDIAN);
|
2000-11-13 04:26:14 +00:00
|
|
|
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
|
|
|
}
|
|
|
|
|
2015-11-15 13:00:10 +00:00
|
|
|
return tvb_captured_length(tvb);
|
1999-12-08 23:21:08 +00:00
|
|
|
}
|
|
|
|
|
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
|
|
|
*/
|
2015-11-25 02:59:51 +00:00
|
|
|
static int
|
|
|
|
dissect_atp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) {
|
2012-03-06 03:20:17 +00:00
|
|
|
proto_tree *atp_tree = NULL;
|
|
|
|
proto_item *ti;
|
|
|
|
proto_tree *atp_info_tree;
|
|
|
|
proto_item *info_item;
|
|
|
|
int offset = 0;
|
|
|
|
guint8 ctrlinfo;
|
|
|
|
guint8 frag_number = 0;
|
|
|
|
guint op;
|
|
|
|
guint16 tid;
|
|
|
|
guint8 query;
|
|
|
|
struct aspinfo aspinfo;
|
|
|
|
tvbuff_t *new_tvb = NULL;
|
|
|
|
gboolean save_fragmented;
|
|
|
|
gboolean more_fragment = FALSE;
|
|
|
|
int len;
|
|
|
|
guint8 bitmap;
|
|
|
|
guint8 nbe = 0;
|
|
|
|
guint8 t = 0;
|
2005-10-13 05:23:01 +00:00
|
|
|
conversation_t *conversation;
|
2012-03-06 03:20:17 +00:00
|
|
|
asp_request_val *request_val = NULL;
|
2007-11-28 15:55:50 +00:00
|
|
|
|
2009-08-09 06:26:46 +00:00
|
|
|
col_set_str(pinfo->cinfo, COL_PROTOCOL, "ATP");
|
2002-04-25 23:58:02 +00:00
|
|
|
|
|
|
|
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) {
|
2009-07-23 21:25:02 +00:00
|
|
|
nbe++;
|
|
|
|
t >>= 1;
|
2002-05-03 21:25:43 +00:00
|
|
|
}
|
|
|
|
|
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);
|
|
|
|
|
2010-05-13 18:28:34 +00:00
|
|
|
conversation = find_or_create_conversation(pinfo);
|
2002-05-03 21:25:43 +00:00
|
|
|
|
2005-10-13 05:23:01 +00:00
|
|
|
if (atp_defragment) {
|
2009-07-23 21:25:02 +00:00
|
|
|
asp_request_key request_key;
|
2002-05-03 21:25:43 +00:00
|
|
|
|
2016-06-23 15:51:41 +00:00
|
|
|
request_key.conversation = conversation->conv_index;
|
2009-07-23 21:25:02 +00:00
|
|
|
memcpy(request_key.src, (!aspinfo.reply)?pinfo->src.data:pinfo->dst.data, 4);
|
|
|
|
request_key.seq = aspinfo.seq;
|
2002-05-03 21:25:43 +00:00
|
|
|
|
2009-07-23 21:25:02 +00:00
|
|
|
request_val = (asp_request_val *) g_hash_table_lookup(atp_request_hash, &request_key);
|
2002-05-03 21:25:43 +00:00
|
|
|
|
2009-07-23 21:25:02 +00:00
|
|
|
if (!request_val && query && nbe > 1) {
|
|
|
|
asp_request_key *new_request_key;
|
2005-10-13 05:23:01 +00:00
|
|
|
|
2009-07-23 21:25:02 +00:00
|
|
|
/* only save nbe packets if more than 1 requested
|
|
|
|
save some memory and help the defragmentation if tid wraparound, ie
|
|
|
|
we have both a request for 1 packet and a request for n packets,
|
|
|
|
hopefully most of the time ATP_EOM will be set in the last packet.
|
|
|
|
*/
|
2013-09-12 20:37:30 +00:00
|
|
|
new_request_key = wmem_new(wmem_file_scope(), asp_request_key);
|
2009-07-23 21:25:02 +00:00
|
|
|
*new_request_key = request_key;
|
2005-10-13 05:23:01 +00:00
|
|
|
|
2013-09-12 20:37:30 +00:00
|
|
|
request_val = wmem_new(wmem_file_scope(), asp_request_val);
|
2009-07-23 21:25:02 +00:00
|
|
|
request_val->value = nbe;
|
2002-05-03 21:25:43 +00:00
|
|
|
|
2009-07-23 21:25:02 +00:00
|
|
|
g_hash_table_insert(atp_request_hash, new_request_key,request_val);
|
|
|
|
}
|
2002-05-03 21:25:43 +00:00
|
|
|
}
|
|
|
|
|
2002-08-28 21:04:11 +00:00
|
|
|
/*
|
2009-07-23 21:25:02 +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
|
|
|
|
2009-07-23 21:25:02 +00:00
|
|
|
So it needs to keep the number of packets asked in request.
|
|
|
|
*/
|
2002-05-03 21:25:43 +00:00
|
|
|
|
2002-04-30 22:05:33 +00:00
|
|
|
if (aspinfo.reply) {
|
2009-07-23 21:25:02 +00:00
|
|
|
more_fragment = !(ATP_EOM & ctrlinfo) && request_val;
|
|
|
|
frag_number = bitmap;
|
2002-04-30 22:05:33 +00:00
|
|
|
}
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2011-09-26 08:25:18 +00:00
|
|
|
col_clear(pinfo->cinfo, COL_INFO);
|
|
|
|
col_add_fstr(pinfo->cinfo, COL_INFO, "%s transaction %u",
|
|
|
|
val_to_str(op, atp_function_vals, "Unknown (0x%01x)"),tid);
|
|
|
|
if (more_fragment)
|
|
|
|
col_append_str(pinfo->cinfo, COL_INFO, " [fragment]");
|
2002-04-30 22:05:33 +00:00
|
|
|
|
2002-04-25 23:58:02 +00:00
|
|
|
if (tree) {
|
2011-10-21 02:10:19 +00:00
|
|
|
ti = proto_tree_add_item(tree, proto_atp, tvb, offset, -1, ENC_NA);
|
2002-04-25 23:58:02 +00:00
|
|
|
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
|
|
|
|
2011-09-26 08:25:18 +00:00
|
|
|
info_item = proto_tree_add_item(atp_tree, hf_atp_ctrlinfo, tvb, offset, 1, ENC_BIG_ENDIAN);
|
2002-04-25 23:58:02 +00:00
|
|
|
atp_info_tree = proto_item_add_subtree(info_item, ett_atp_info);
|
|
|
|
|
2011-09-26 08:25:18 +00:00
|
|
|
proto_tree_add_item(atp_info_tree, hf_atp_function, tvb, offset, 1, ENC_BIG_ENDIAN);
|
|
|
|
proto_tree_add_item(atp_info_tree, hf_atp_xo, tvb, offset, 1, ENC_BIG_ENDIAN);
|
|
|
|
proto_tree_add_item(atp_info_tree, hf_atp_eom, tvb, offset, 1, ENC_BIG_ENDIAN);
|
|
|
|
proto_tree_add_item(atp_info_tree, hf_atp_sts, tvb, offset, 1, ENC_BIG_ENDIAN);
|
2002-04-26 07:41:31 +00:00
|
|
|
if ((ctrlinfo & (ATP_FUNCMASK|ATP_XO)) == (0x40|ATP_XO)) {
|
|
|
|
/* TReq with XO set */
|
2011-09-26 08:25:18 +00:00
|
|
|
proto_tree_add_item(atp_info_tree, hf_atp_treltimer, tvb, offset, 1, ENC_BIG_ENDIAN);
|
2002-04-26 07:41:31 +00:00
|
|
|
}
|
2002-05-03 21:25:43 +00:00
|
|
|
if (query) {
|
2014-09-11 00:04:22 +00:00
|
|
|
proto_tree_add_uint_format_value(atp_tree, hf_atp_bitmap, tvb, offset +1, 1,
|
|
|
|
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 {
|
2011-09-26 08:25:18 +00:00
|
|
|
proto_tree_add_item(atp_tree, hf_atp_bitmap, tvb, offset +1, 1, ENC_BIG_ENDIAN);
|
2002-04-26 07:41:31 +00:00
|
|
|
}
|
2011-09-26 08:25:18 +00:00
|
|
|
proto_tree_add_item(atp_tree, hf_atp_tid, tvb, offset +2, 2, ENC_BIG_ENDIAN);
|
2002-05-03 21:25:43 +00:00
|
|
|
|
|
|
|
if (aspinfo.release)
|
2011-09-26 08:25:18 +00:00
|
|
|
proto_tree_add_item(atp_tree, hf_atp_user_bytes, tvb, offset +4, 4, ENC_BIG_ENDIAN);
|
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)
|
2015-11-25 02:59:51 +00:00
|
|
|
return tvb_captured_length(tvb);
|
2002-05-03 21:25:43 +00:00
|
|
|
|
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)) {
|
2013-07-17 21:12:24 +00:00
|
|
|
fragment_head *fd_head;
|
2009-07-23 21:25:02 +00:00
|
|
|
int hdr;
|
|
|
|
|
|
|
|
hdr = ATP_HDRSIZE -1;
|
|
|
|
if (frag_number != 0)
|
2010-05-10 15:54:57 +00:00
|
|
|
hdr += 4; /* asp header */
|
2009-07-23 21:25:02 +00:00
|
|
|
len = tvb_reported_length_remaining(tvb, hdr);
|
2013-03-22 23:59:54 +00:00
|
|
|
fd_head = fragment_add_seq_check(&atp_reassembly_table,
|
|
|
|
tvb, hdr, pinfo, tid, NULL,
|
2010-05-10 15:54:57 +00:00
|
|
|
frag_number,
|
|
|
|
len,
|
|
|
|
more_fragment);
|
2009-07-23 21:25:02 +00:00
|
|
|
new_tvb = process_reassembled_data(tvb, ATP_HDRSIZE -1, pinfo,
|
|
|
|
"Reassembled ATP", fd_head, &atp_frag_items,
|
|
|
|
NULL, atp_tree);
|
2002-04-30 22:05:33 +00:00
|
|
|
}
|
|
|
|
else {
|
2009-07-23 21:25:02 +00:00
|
|
|
/* full packet */
|
2012-03-06 03:20:17 +00:00
|
|
|
new_tvb = tvb_new_subset_remaining(tvb, ATP_HDRSIZE -1 );
|
2002-04-30 22:05:33 +00:00
|
|
|
}
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2002-04-30 22:05:33 +00:00
|
|
|
if (new_tvb) {
|
2009-07-23 21:25:02 +00:00
|
|
|
/* if port == 6 it's not an ASP packet but a ZIP packet */
|
|
|
|
if (pinfo->srcport == 6 || pinfo->destport == 6 )
|
2013-10-21 00:27:36 +00:00
|
|
|
call_dissector_with_data(zip_atp_handle, new_tvb, pinfo, tree, &aspinfo);
|
2009-07-23 21:25:02 +00:00
|
|
|
else {
|
|
|
|
/* XXX need a conversation_get_dissector function ? */
|
2016-01-24 03:40:51 +00:00
|
|
|
if (!aspinfo.reply && !conversation_get_dissector(conversation, pinfo->num)) {
|
2009-07-23 21:25:02 +00:00
|
|
|
dissector_handle_t sub;
|
|
|
|
|
|
|
|
/* if it's a known ASP function call ASP dissector
|
|
|
|
else assume it's a PAP connection ID.
|
|
|
|
the test is wrong because PAP conn IDs overlapped with ASP fn
|
|
|
|
but I don't want to keep track of NBP msgs and open connection
|
|
|
|
port allocation.
|
|
|
|
*/
|
|
|
|
guint8 fn = tvb_get_guint8(new_tvb, 0);
|
|
|
|
|
|
|
|
if (!fn || fn > ASPFUNC_ATTN) {
|
|
|
|
sub = pap_handle;
|
2005-10-13 05:23:01 +00:00
|
|
|
}
|
2009-07-23 21:25:02 +00:00
|
|
|
else {
|
|
|
|
sub = asp_handle;
|
2005-10-13 05:23:01 +00:00
|
|
|
}
|
2013-10-21 00:27:36 +00:00
|
|
|
call_dissector_with_data(sub, new_tvb, pinfo, tree, &aspinfo);
|
2009-07-23 21:25:02 +00:00
|
|
|
conversation_set_dissector(conversation, sub);
|
|
|
|
}
|
|
|
|
else if (!try_conversation_dissector(&pinfo->src, &pinfo->dst, pinfo->ptype,
|
2013-12-13 23:32:00 +00:00
|
|
|
pinfo->srcport, pinfo->destport, new_tvb,pinfo, tree, &aspinfo)) {
|
2016-03-20 00:33:14 +00:00
|
|
|
call_data_dissector(new_tvb, pinfo, tree);
|
2009-07-23 21:25:02 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
}
|
2002-04-30 22:05:33 +00:00
|
|
|
}
|
|
|
|
else {
|
|
|
|
/* Just show this as a fragment. */
|
2009-08-16 12:36:22 +00:00
|
|
|
new_tvb = tvb_new_subset_remaining (tvb, ATP_HDRSIZE -1);
|
2016-03-20 00:33:14 +00:00
|
|
|
call_data_dissector(new_tvb, pinfo, tree);
|
2002-04-30 22:05:33 +00:00
|
|
|
}
|
|
|
|
pinfo->fragmented = save_fragmented;
|
2015-11-25 02:59:51 +00:00
|
|
|
return tvb_captured_length(tvb);
|
2002-04-25 23:58:02 +00:00
|
|
|
}
|
|
|
|
|
2005-10-13 05:23:01 +00:00
|
|
|
/* -----------------------------
|
|
|
|
PAP protocol cf. inside appletalk chap. 10
|
|
|
|
*/
|
2011-10-04 22:44:31 +00:00
|
|
|
#define PAD(x) { proto_tree_add_item(pap_tree, hf_pap_pad, tvb, offset, x, ENC_NA); offset += x; }
|
2005-10-13 05:23:01 +00:00
|
|
|
|
2012-02-06 22:16:22 +00:00
|
|
|
static int
|
2012-09-10 21:40:21 +00:00
|
|
|
dissect_pap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
|
2005-10-13 05:23:01 +00:00
|
|
|
{
|
2012-03-06 03:20:17 +00:00
|
|
|
int offset = 0;
|
|
|
|
guint8 fn;
|
|
|
|
guint8 connID;
|
2005-10-13 05:23:01 +00:00
|
|
|
proto_tree *pap_tree = NULL;
|
|
|
|
proto_item *ti;
|
|
|
|
|
2009-08-09 06:26:46 +00:00
|
|
|
col_set_str(pinfo->cinfo, COL_PROTOCOL, "PAP");
|
2009-08-09 07:36:13 +00:00
|
|
|
col_clear(pinfo->cinfo, COL_INFO);
|
2005-10-13 05:23:01 +00:00
|
|
|
|
|
|
|
if (tree) {
|
2011-10-21 02:10:19 +00:00
|
|
|
ti = proto_tree_add_item(tree, proto_pap, tvb, offset, -1, ENC_NA);
|
2005-10-13 05:23:01 +00:00
|
|
|
pap_tree = proto_item_add_subtree(ti, ett_pap);
|
|
|
|
}
|
|
|
|
|
|
|
|
connID = tvb_get_guint8(tvb, offset);
|
2011-09-26 08:25:18 +00:00
|
|
|
proto_tree_add_item(pap_tree, hf_pap_connid, tvb, offset, 1, ENC_BIG_ENDIAN);
|
2005-10-13 05:23:01 +00:00
|
|
|
offset++;
|
|
|
|
|
|
|
|
fn = tvb_get_guint8(tvb, offset);
|
2011-09-26 08:25:18 +00:00
|
|
|
proto_tree_add_item(pap_tree, hf_pap_function, tvb, offset, 1, ENC_BIG_ENDIAN);
|
2005-10-13 05:23:01 +00:00
|
|
|
offset++;
|
|
|
|
|
2011-09-26 08:25:18 +00:00
|
|
|
col_add_fstr(pinfo->cinfo, COL_INFO, "%s ID: %d",
|
|
|
|
val_to_str_ext(fn, &pap_function_vals_ext, "Unknown (0x%01x)"), connID);
|
|
|
|
|
2005-10-13 05:23:01 +00:00
|
|
|
switch(fn) {
|
|
|
|
case PAPOpenConn:
|
2009-07-23 21:25:02 +00:00
|
|
|
PAD(2);
|
2011-09-26 08:25:18 +00:00
|
|
|
proto_tree_add_item(pap_tree, hf_pap_socket, tvb, offset, 1, ENC_BIG_ENDIAN);
|
2009-07-23 21:25:02 +00:00
|
|
|
offset++;
|
2011-09-26 08:25:18 +00:00
|
|
|
proto_tree_add_item(pap_tree, hf_pap_quantum, tvb, offset, 1, ENC_BIG_ENDIAN);
|
2009-07-23 21:25:02 +00:00
|
|
|
offset++;
|
2011-09-26 08:25:18 +00:00
|
|
|
proto_tree_add_item(pap_tree, hf_pap_waittime, tvb, offset, 2, ENC_BIG_ENDIAN);
|
2009-07-23 21:25:02 +00:00
|
|
|
offset += 2;
|
|
|
|
break;
|
2005-10-13 05:23:01 +00:00
|
|
|
|
|
|
|
case PAPOpenConnReply:
|
2009-07-23 21:25:02 +00:00
|
|
|
PAD(2);
|
2011-09-26 08:25:18 +00:00
|
|
|
proto_tree_add_item(pap_tree, hf_pap_socket, tvb, offset, 1, ENC_BIG_ENDIAN);
|
2009-07-23 21:25:02 +00:00
|
|
|
offset++;
|
2011-09-26 08:25:18 +00:00
|
|
|
proto_tree_add_item(pap_tree, hf_pap_quantum, tvb, offset, 1, ENC_BIG_ENDIAN);
|
2009-07-23 21:25:02 +00:00
|
|
|
offset++;
|
2011-09-26 08:25:18 +00:00
|
|
|
proto_tree_add_item(pap_tree, hf_pap_result, tvb, offset, 2, ENC_BIG_ENDIAN);
|
2009-07-23 21:25:02 +00:00
|
|
|
offset += 2;
|
2005-10-13 05:23:01 +00:00
|
|
|
offset = dissect_pascal_string(tvb, offset, pap_tree, hf_pap_status);
|
2009-07-23 21:25:02 +00:00
|
|
|
break;
|
2005-10-13 05:23:01 +00:00
|
|
|
|
|
|
|
case PAPSendData:
|
2011-09-26 08:25:18 +00:00
|
|
|
proto_tree_add_item(pap_tree, hf_pap_seq, tvb, offset, 2, ENC_BIG_ENDIAN);
|
2009-07-23 21:25:02 +00:00
|
|
|
offset += 2;
|
|
|
|
break;
|
2005-10-13 05:23:01 +00:00
|
|
|
|
|
|
|
case PAPData:
|
2011-09-26 08:25:18 +00:00
|
|
|
proto_tree_add_item(pap_tree, hf_pap_eof, tvb, offset, 1, ENC_BIG_ENDIAN);
|
2009-07-23 21:25:02 +00:00
|
|
|
offset++;
|
|
|
|
PAD(1);
|
|
|
|
/* follow by data */
|
2016-03-20 00:33:14 +00:00
|
|
|
call_data_dissector(tvb_new_subset_remaining(tvb, offset), pinfo, tree);
|
2009-07-23 21:25:02 +00:00
|
|
|
break;
|
2005-10-13 05:23:01 +00:00
|
|
|
|
|
|
|
case PAPTickle:
|
|
|
|
case PAPCloseConn:
|
|
|
|
case PAPCloseConnReply:
|
2009-07-23 21:25:02 +00:00
|
|
|
PAD(2);
|
|
|
|
break;
|
2005-10-13 05:23:01 +00:00
|
|
|
|
|
|
|
case PAPSendStatus:
|
2009-07-23 21:25:02 +00:00
|
|
|
PAD(2);
|
|
|
|
break;
|
2007-11-28 15:55:50 +00:00
|
|
|
|
2005-10-13 05:23:01 +00:00
|
|
|
case PAPStatus:
|
2009-07-23 21:25:02 +00:00
|
|
|
PAD(2);
|
|
|
|
PAD(4);
|
2005-10-13 05:23:01 +00:00
|
|
|
offset = dissect_pascal_string(tvb, offset, pap_tree, hf_pap_status);
|
2009-07-23 21:25:02 +00:00
|
|
|
break;
|
2005-10-13 05:23:01 +00:00
|
|
|
|
|
|
|
default: /* unknown */
|
|
|
|
break;
|
|
|
|
}
|
2012-02-06 22:16:22 +00:00
|
|
|
return offset;
|
2005-10-13 05:23:01 +00:00
|
|
|
}
|
|
|
|
|
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 *
|
2013-10-21 00:27:36 +00:00
|
|
|
get_transaction(tvbuff_t *tvb, packet_info *pinfo, struct aspinfo *aspinfo)
|
2002-04-25 23:58:02 +00:00
|
|
|
{
|
2012-03-06 03:20:17 +00:00
|
|
|
conversation_t *conversation;
|
|
|
|
asp_request_key request_key, *new_request_key;
|
2002-04-25 23:58:02 +00:00
|
|
|
asp_request_val *request_val;
|
2012-03-06 03:20:17 +00:00
|
|
|
guint8 fn;
|
2002-04-25 23:58:02 +00:00
|
|
|
|
2016-01-26 15:53:39 +00:00
|
|
|
conversation = find_or_create_conversation(pinfo);
|
2002-04-25 23:58:02 +00:00
|
|
|
|
2016-06-23 15:51:41 +00:00
|
|
|
request_key.conversation = conversation->conv_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;
|
|
|
|
|
2009-07-23 21:25:02 +00:00
|
|
|
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 ) {
|
2009-07-23 21:25:02 +00:00
|
|
|
fn = tvb_get_guint8(tvb, 0);
|
2013-09-12 20:37:30 +00:00
|
|
|
new_request_key = wmem_new(wmem_file_scope(), asp_request_key);
|
2009-07-23 21:25:02 +00:00
|
|
|
*new_request_key = request_key;
|
2002-04-25 23:58:02 +00:00
|
|
|
|
2013-09-12 20:37:30 +00:00
|
|
|
request_val = wmem_new(wmem_file_scope(), asp_request_val);
|
2009-07-23 21:25:02 +00:00
|
|
|
request_val->value = fn;
|
2002-04-25 23:58:02 +00:00
|
|
|
|
2009-07-23 21:25:02 +00:00
|
|
|
g_hash_table_insert(asp_request_hash, new_request_key, request_val);
|
2002-04-25 23:58:02 +00:00
|
|
|
}
|
|
|
|
|
2002-08-28 21:04:11 +00:00
|
|
|
if (!request_val)
|
2009-07-23 21:25:02 +00:00
|
|
|
return NULL;
|
2002-06-29 21:27:39 +00:00
|
|
|
|
|
|
|
aspinfo->command = request_val->value;
|
|
|
|
return aspinfo;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2012-02-06 22:16:22 +00:00
|
|
|
static int
|
2013-10-21 00:27:36 +00:00
|
|
|
dissect_asp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
|
2002-06-29 21:27:39 +00:00
|
|
|
{
|
|
|
|
struct aspinfo *aspinfo;
|
2012-03-06 03:20:17 +00:00
|
|
|
int offset = 0;
|
|
|
|
proto_tree *asp_tree = NULL;
|
|
|
|
proto_item *ti;
|
|
|
|
guint8 fn;
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2013-12-11 23:04:09 +00:00
|
|
|
/* Reject the packet if data is NULL */
|
|
|
|
if (data == NULL)
|
|
|
|
return 0;
|
|
|
|
|
2009-08-09 06:26:46 +00:00
|
|
|
col_set_str(pinfo->cinfo, COL_PROTOCOL, "ASP");
|
2009-08-09 07:36:13 +00:00
|
|
|
col_clear(pinfo->cinfo, COL_INFO);
|
2002-04-25 23:58:02 +00:00
|
|
|
|
2013-10-21 00:27:36 +00:00
|
|
|
aspinfo = get_transaction(tvb, pinfo, (struct aspinfo *)data);
|
2002-06-29 21:27:39 +00:00
|
|
|
if (!aspinfo)
|
2012-02-06 22:16:22 +00:00
|
|
|
return 0;
|
2002-06-29 21:27:39 +00:00
|
|
|
|
2004-01-05 19:31:44 +00:00
|
|
|
fn = (guint8) aspinfo->command;
|
2002-04-25 23:58:02 +00:00
|
|
|
|
2011-09-26 08:25:18 +00:00
|
|
|
if (aspinfo->reply)
|
|
|
|
col_add_fstr(pinfo->cinfo, COL_INFO, "Reply tid %u",aspinfo->seq);
|
|
|
|
else
|
|
|
|
col_add_fstr(pinfo->cinfo, COL_INFO, "Function: %s tid %u",
|
|
|
|
val_to_str_ext(fn, &asp_func_vals_ext, "Unknown (0x%01x)"), aspinfo->seq);
|
2002-04-25 23:58:02 +00:00
|
|
|
|
|
|
|
if (tree) {
|
2011-10-21 02:10:19 +00:00
|
|
|
ti = proto_tree_add_item(tree, proto_asp, tvb, offset, -1, ENC_NA);
|
2002-04-25 23:58:02 +00:00
|
|
|
asp_tree = proto_item_add_subtree(ti, ett_asp);
|
|
|
|
}
|
2002-05-03 21:25:43 +00:00
|
|
|
if (!aspinfo->reply) {
|
2009-07-23 21:25:02 +00:00
|
|
|
tvbuff_t *new_tvb;
|
|
|
|
/* let the called deal with asp_tree == NULL */
|
|
|
|
|
2011-09-26 08:25:18 +00:00
|
|
|
proto_tree_add_item(asp_tree, hf_asp_func, tvb, offset, 1, ENC_BIG_ENDIAN);
|
2009-07-23 21:25:02 +00:00
|
|
|
offset++;
|
|
|
|
switch(fn) {
|
|
|
|
case ASPFUNC_OPEN:
|
2011-09-26 08:25:18 +00:00
|
|
|
proto_tree_add_item(asp_tree, hf_asp_socket, tvb, offset, 1, ENC_BIG_ENDIAN);
|
2009-07-23 21:25:02 +00:00
|
|
|
offset++;
|
2011-09-26 08:25:18 +00:00
|
|
|
proto_tree_add_item(asp_tree, hf_asp_version, tvb, offset, 2, ENC_BIG_ENDIAN);
|
2009-07-23 21:25:02 +00:00
|
|
|
offset += 2;
|
|
|
|
break;
|
|
|
|
case ASPFUNC_TICKLE:
|
|
|
|
case ASPFUNC_CLOSE:
|
2011-09-26 08:25:18 +00:00
|
|
|
proto_tree_add_item(asp_tree, hf_asp_session_id, tvb, offset, 1, ENC_BIG_ENDIAN);
|
2009-07-23 21:25:02 +00:00
|
|
|
offset++;
|
2011-10-04 22:44:31 +00:00
|
|
|
proto_tree_add_item(asp_tree, hf_asp_zero_value, tvb, offset, 2, ENC_NA);
|
2009-07-23 21:25:02 +00:00
|
|
|
offset +=2;
|
|
|
|
break;
|
|
|
|
case ASPFUNC_STAT:
|
2011-10-04 22:44:31 +00:00
|
|
|
proto_tree_add_item(asp_tree, hf_asp_zero_value, tvb, offset, 1, ENC_NA);
|
2009-07-23 21:25:02 +00:00
|
|
|
offset++;
|
2011-10-04 22:44:31 +00:00
|
|
|
proto_tree_add_item(asp_tree, hf_asp_zero_value, tvb, offset, 2, ENC_NA);
|
2009-07-23 21:25:02 +00:00
|
|
|
offset += 2;
|
|
|
|
break;
|
|
|
|
case ASPFUNC_ATTN:
|
2011-09-26 08:25:18 +00:00
|
|
|
proto_tree_add_item(asp_tree, hf_asp_session_id, tvb, offset, 1, ENC_BIG_ENDIAN);
|
2009-07-23 21:25:02 +00:00
|
|
|
offset++;
|
2011-09-26 08:25:18 +00:00
|
|
|
proto_tree_add_item(asp_tree, hf_asp_attn_code, tvb, offset, 2, ENC_BIG_ENDIAN);
|
2009-07-23 21:25:02 +00:00
|
|
|
offset +=2;
|
|
|
|
break;
|
|
|
|
case ASPFUNC_CMD:
|
|
|
|
case ASPFUNC_WRITE:
|
|
|
|
proto_item_set_len(asp_tree, 4);
|
2011-09-26 08:25:18 +00:00
|
|
|
proto_tree_add_item(asp_tree, hf_asp_session_id, tvb, offset, 1, ENC_BIG_ENDIAN);
|
2009-07-23 21:25:02 +00:00
|
|
|
offset++;
|
2011-09-26 08:25:18 +00:00
|
|
|
proto_tree_add_item(asp_tree, hf_asp_seq, tvb, offset, 2, ENC_BIG_ENDIAN);
|
2009-07-23 21:25:02 +00:00
|
|
|
offset += 2;
|
2014-04-06 19:12:59 +00:00
|
|
|
new_tvb = tvb_new_subset_remaining(tvb, offset);
|
2013-11-18 11:16:32 +00:00
|
|
|
call_dissector_with_data(afp_handle, new_tvb, pinfo, tree, aspinfo);
|
2009-07-23 21:25:02 +00:00
|
|
|
break;
|
|
|
|
case ASPFUNC_WRTCONT:
|
2011-09-26 08:25:18 +00:00
|
|
|
proto_tree_add_item(asp_tree, hf_asp_session_id, tvb, offset, 1, ENC_BIG_ENDIAN);
|
2009-07-23 21:25:02 +00:00
|
|
|
offset++;
|
2011-09-26 08:25:18 +00:00
|
|
|
proto_tree_add_item(asp_tree, hf_asp_seq, tvb, offset, 2, ENC_BIG_ENDIAN);
|
2009-07-23 21:25:02 +00:00
|
|
|
offset += 2;
|
2011-09-26 08:25:18 +00:00
|
|
|
proto_tree_add_item(asp_tree, hf_asp_size, tvb, offset, 2, ENC_BIG_ENDIAN);
|
2009-07-23 21:25:02 +00:00
|
|
|
offset += 2;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
proto_item_set_len(asp_tree, 4);
|
|
|
|
offset += 3;
|
2016-03-20 00:33:14 +00:00
|
|
|
call_data_dissector(tvb_new_subset_remaining(tvb, offset), pinfo, tree);
|
2009-07-23 21:25:02 +00:00
|
|
|
break;
|
|
|
|
}
|
2002-04-25 23:58:02 +00:00
|
|
|
}
|
2002-05-03 21:25:43 +00:00
|
|
|
else {
|
2009-07-23 21:25:02 +00:00
|
|
|
tvbuff_t *new_tvb;
|
|
|
|
|
|
|
|
proto_tree_add_uint(asp_tree, hf_asp_func, tvb, 0, 0, fn);
|
|
|
|
switch(fn) {
|
|
|
|
case ASPFUNC_OPEN:
|
2011-09-26 08:25:18 +00:00
|
|
|
proto_tree_add_item(asp_tree, hf_asp_socket, tvb, offset, 1, ENC_BIG_ENDIAN);
|
2009-07-23 21:25:02 +00:00
|
|
|
offset++;
|
2011-09-26 08:25:18 +00:00
|
|
|
proto_tree_add_item(asp_tree, hf_asp_session_id, tvb, offset, 1, ENC_BIG_ENDIAN);
|
2009-07-23 21:25:02 +00:00
|
|
|
offset++;
|
2011-09-26 08:25:18 +00:00
|
|
|
proto_tree_add_item(asp_tree, hf_asp_init_error, tvb, offset, 2, ENC_BIG_ENDIAN);
|
2009-07-23 21:25:02 +00:00
|
|
|
offset += 2;
|
|
|
|
break;
|
|
|
|
case ASPFUNC_CLOSE:
|
2011-10-04 22:44:31 +00:00
|
|
|
proto_tree_add_item(asp_tree, hf_asp_zero_value, tvb, offset, 1, ENC_NA);
|
2009-07-23 21:25:02 +00:00
|
|
|
offset++;
|
2011-10-04 22:44:31 +00:00
|
|
|
proto_tree_add_item(asp_tree, hf_asp_zero_value, tvb, offset, 1, ENC_NA);
|
2009-07-23 21:25:02 +00:00
|
|
|
offset++;
|
2011-10-04 22:44:31 +00:00
|
|
|
proto_tree_add_item(asp_tree, hf_asp_zero_value, tvb, offset, 2, ENC_NA);
|
2009-07-23 21:25:02 +00:00
|
|
|
offset += 2;
|
|
|
|
break;
|
|
|
|
case ASPFUNC_STAT:
|
2011-10-04 22:44:31 +00:00
|
|
|
proto_tree_add_item(asp_tree, hf_asp_zero_value, tvb, offset, 4, ENC_NA);
|
2009-07-23 21:25:02 +00:00
|
|
|
offset += 4;
|
2014-04-06 19:12:59 +00:00
|
|
|
/* XXX - what if something other than AFP is running atop ASP? */
|
|
|
|
new_tvb = tvb_new_subset_remaining(tvb, offset);
|
|
|
|
call_dissector(afp_server_status_handle, new_tvb, pinfo, asp_tree);
|
2009-07-23 21:25:02 +00:00
|
|
|
break;
|
|
|
|
case ASPFUNC_CMD:
|
|
|
|
case ASPFUNC_WRITE:
|
|
|
|
proto_item_set_len(asp_tree, 4);
|
|
|
|
aspinfo->code = tvb_get_ntohl(tvb, offset);
|
2011-09-26 08:25:18 +00:00
|
|
|
proto_tree_add_item(asp_tree, hf_asp_error, tvb, offset, 4, ENC_BIG_ENDIAN);
|
2009-07-23 21:25:02 +00:00
|
|
|
offset += 4;
|
2014-04-06 19:12:59 +00:00
|
|
|
new_tvb = tvb_new_subset_remaining(tvb, offset);
|
2013-11-18 11:16:32 +00:00
|
|
|
call_dissector_with_data(afp_handle, new_tvb, pinfo, tree, aspinfo);
|
2009-07-23 21:25:02 +00:00
|
|
|
break;
|
|
|
|
case ASPFUNC_TICKLE:
|
|
|
|
case ASPFUNC_WRTCONT:
|
2011-10-04 22:44:31 +00:00
|
|
|
proto_tree_add_item(asp_tree, hf_asp_zero_value, tvb, offset, 4, ENC_NA);
|
2009-07-23 21:25:02 +00:00
|
|
|
/* fall */
|
2010-05-10 15:54:57 +00:00
|
|
|
case ASPFUNC_ATTN: /* FIXME capture and spec disagree */
|
2009-07-23 21:25:02 +00:00
|
|
|
default:
|
|
|
|
proto_item_set_len(asp_tree, 4);
|
|
|
|
offset += 4;
|
2016-03-20 00:33:14 +00:00
|
|
|
call_data_dissector(tvb_new_subset_remaining(tvb, offset), pinfo, tree);
|
2009-07-23 21:25:02 +00:00
|
|
|
break;
|
|
|
|
}
|
2002-04-25 23:58:02 +00:00
|
|
|
}
|
2012-02-06 22:16:22 +00:00
|
|
|
return offset;
|
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
|
|
|
|
*/
|
2015-02-08 18:49:57 +00:00
|
|
|
/*
|
|
|
|
* Structure used to represent a DDP address; gives the layout of the
|
|
|
|
* data pointed to by an Appletalk "address" structure.
|
|
|
|
*/
|
|
|
|
struct atalk_ddp_addr {
|
|
|
|
guint16 net;
|
|
|
|
guint8 node;
|
|
|
|
};
|
|
|
|
|
2015-02-12 17:03:49 +00:00
|
|
|
|
|
|
|
static int atalk_str_len(const address* addr _U_)
|
|
|
|
{
|
|
|
|
return 8;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int atalk_to_str(const address* addr, gchar *buf, int buf_len _U_)
|
2015-02-08 18:49:57 +00:00
|
|
|
{
|
|
|
|
struct atalk_ddp_addr atalk;
|
|
|
|
memcpy(&atalk, addr->data, sizeof atalk);
|
|
|
|
|
|
|
|
buf = word_to_hex(buf, atalk.net);
|
|
|
|
*buf++ = '.';
|
|
|
|
buf = bytes_to_hexstr(buf, &atalk.node, 1);
|
|
|
|
*buf++ = '\0'; /* NULL terminate */
|
|
|
|
|
2015-02-12 17:03:49 +00:00
|
|
|
return atalk_str_len(addr);
|
2015-02-08 18:49:57 +00:00
|
|
|
}
|
|
|
|
|
2015-02-09 01:36:03 +00:00
|
|
|
static const char* atalk_col_filter_str(const address* addr _U_, gboolean is_src)
|
2015-02-08 18:49:57 +00:00
|
|
|
{
|
|
|
|
if (is_src)
|
|
|
|
return "ddp.src";
|
|
|
|
|
|
|
|
return "ddp.dst";
|
|
|
|
}
|
|
|
|
|
2015-02-09 01:36:03 +00:00
|
|
|
static int atalk_len(void)
|
|
|
|
{
|
|
|
|
return 3;
|
|
|
|
}
|
2015-02-08 18:49:57 +00:00
|
|
|
|
2013-10-21 00:27:36 +00:00
|
|
|
static int
|
|
|
|
dissect_atp_zip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
|
2002-06-29 21:27:39 +00:00
|
|
|
{
|
|
|
|
struct aspinfo *aspinfo;
|
2012-03-06 03:20:17 +00:00
|
|
|
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
|
|
|
|
2013-12-11 23:04:09 +00:00
|
|
|
/* Reject the packet if data is NULL */
|
|
|
|
if (data == NULL)
|
|
|
|
return 0;
|
|
|
|
|
2009-08-09 06:26:46 +00:00
|
|
|
col_set_str(pinfo->cinfo, COL_PROTOCOL, "ZIP");
|
2009-08-09 07:36:13 +00:00
|
|
|
col_clear(pinfo->cinfo, COL_INFO);
|
2002-06-29 21:27:39 +00:00
|
|
|
|
2013-10-21 00:27:36 +00:00
|
|
|
aspinfo = get_transaction(tvb, pinfo, (struct aspinfo *)data);
|
2002-06-29 21:27:39 +00:00
|
|
|
if (!aspinfo)
|
2015-04-15 15:20:35 +00:00
|
|
|
return tvb_reported_length(tvb);
|
2002-06-29 21:27:39 +00:00
|
|
|
|
2004-01-05 19:31:44 +00:00
|
|
|
fn = (guint8) aspinfo->command;
|
2002-06-29 21:27:39 +00:00
|
|
|
|
2011-09-26 08:25:18 +00:00
|
|
|
if (aspinfo->reply)
|
|
|
|
col_add_fstr(pinfo->cinfo, COL_INFO, "Reply tid %u",aspinfo->seq);
|
|
|
|
else
|
|
|
|
col_add_fstr(pinfo->cinfo, COL_INFO, "Function: %s tid %u",
|
|
|
|
val_to_str(fn, zip_atp_function_vals, "Unknown (0x%01x)"), aspinfo->seq);
|
2002-06-29 21:27:39 +00:00
|
|
|
|
2002-08-28 21:04:11 +00:00
|
|
|
if (!tree)
|
2015-04-15 15:20:35 +00:00
|
|
|
return tvb_reported_length(tvb);
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2011-10-21 02:10:19 +00:00
|
|
|
ti = proto_tree_add_item(tree, proto_zip, tvb, offset, -1, ENC_NA);
|
2002-06-29 21:27:39 +00:00
|
|
|
zip_tree = proto_item_add_subtree(ti, ett_zip);
|
|
|
|
|
|
|
|
if (!aspinfo->reply) {
|
2011-09-26 08:25:18 +00:00
|
|
|
proto_tree_add_item(zip_tree, hf_zip_atp_function, tvb, offset, 1, ENC_BIG_ENDIAN);
|
2009-07-23 21:25:02 +00:00
|
|
|
offset++;
|
|
|
|
switch(fn) {
|
2010-05-10 15:54:57 +00:00
|
|
|
case 7: /* start_index = 0 */
|
2009-07-23 21:25:02 +00:00
|
|
|
case 8:
|
|
|
|
case 9:
|
2011-10-04 22:44:31 +00:00
|
|
|
proto_tree_add_item(zip_tree, hf_zip_zero_value, tvb, offset, 1, ENC_NA);
|
2009-07-23 21:25:02 +00:00
|
|
|
offset++;
|
2011-09-26 08:25:18 +00:00
|
|
|
proto_tree_add_item(zip_tree, hf_zip_start_index, tvb, offset, 2, ENC_BIG_ENDIAN);
|
2009-07-23 21:25:02 +00:00
|
|
|
break;
|
|
|
|
}
|
2002-06-29 21:27:39 +00:00
|
|
|
}
|
|
|
|
else {
|
2009-07-23 21:25:02 +00:00
|
|
|
guint i;
|
|
|
|
|
|
|
|
proto_tree_add_uint(zip_tree, hf_zip_atp_function, tvb, 0, 0, fn);
|
|
|
|
switch(fn) {
|
|
|
|
case 7:
|
|
|
|
case 8:
|
|
|
|
case 9:
|
2011-09-26 08:25:18 +00:00
|
|
|
proto_tree_add_item(zip_tree, hf_zip_last_flag, tvb, offset, 1, ENC_BIG_ENDIAN);
|
2009-07-23 21:25:02 +00:00
|
|
|
offset++;
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2011-10-04 22:44:31 +00:00
|
|
|
proto_tree_add_item(zip_tree, hf_zip_zero_value, tvb, offset, 1, ENC_NA);
|
2009-07-23 21:25:02 +00:00
|
|
|
offset++;
|
|
|
|
count = tvb_get_ntohs(tvb, offset);
|
2011-09-26 08:25:18 +00:00
|
|
|
ti = proto_tree_add_item(zip_tree, hf_zip_count, tvb, offset, 2, ENC_BIG_ENDIAN);
|
2009-07-23 21:25:02 +00:00
|
|
|
offset += 2;
|
|
|
|
sub_tree = proto_item_add_subtree(ti, ett_zip_zones_list);
|
2012-03-06 03:20:17 +00:00
|
|
|
for (i = 0; i < count; i++) {
|
2009-07-23 21:25:02 +00:00
|
|
|
len = tvb_get_guint8(tvb, offset);
|
2014-09-18 14:35:48 +00:00
|
|
|
proto_tree_add_item(sub_tree, hf_zip_zone_name, tvb, offset, 1,ENC_ASCII|ENC_BIG_ENDIAN);
|
2009-07-23 21:25:02 +00:00
|
|
|
offset += len +1;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
2002-06-29 21:27:39 +00:00
|
|
|
}
|
2013-10-21 00:27:36 +00:00
|
|
|
|
2015-04-15 15:20:35 +00:00
|
|
|
return tvb_reported_length(tvb);
|
2002-06-29 21:27:39 +00:00
|
|
|
}
|
|
|
|
|
2015-11-15 13:00:10 +00:00
|
|
|
static int
|
|
|
|
dissect_ddp_zip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
|
2002-06-29 21:27:39 +00:00
|
|
|
{
|
|
|
|
proto_tree *zip_tree = NULL;
|
|
|
|
proto_item *ti;
|
2012-03-06 03:20:17 +00:00
|
|
|
guint8 fn;
|
|
|
|
guint8 len;
|
|
|
|
gint offset = 0;
|
2002-06-29 21:27:39 +00:00
|
|
|
proto_tree *sub_tree;
|
|
|
|
proto_tree *net_tree;
|
2012-03-06 03:20:17 +00:00
|
|
|
guint8 flag;
|
|
|
|
guint16 net;
|
|
|
|
guint i;
|
|
|
|
guint count;
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2014-09-11 00:04:22 +00:00
|
|
|
static const int * zip_flags[] = {
|
|
|
|
&hf_zip_flags_zone_invalid,
|
|
|
|
&hf_zip_flags_use_broadcast,
|
|
|
|
&hf_zip_flags_only_one_zone,
|
|
|
|
NULL
|
|
|
|
};
|
|
|
|
|
2009-08-09 06:26:46 +00:00
|
|
|
col_set_str(pinfo->cinfo, COL_PROTOCOL, "ZIP");
|
2009-08-09 07:36:13 +00:00
|
|
|
col_clear(pinfo->cinfo, COL_INFO);
|
2002-06-29 21:27:39 +00:00
|
|
|
|
|
|
|
fn = tvb_get_guint8(tvb, 0);
|
2011-09-26 08:25:18 +00:00
|
|
|
col_add_str(pinfo->cinfo, COL_INFO,
|
|
|
|
val_to_str_ext(fn, &zip_function_vals_ext, "Unknown ZIP function (%02x)"));
|
2002-06-29 21:27:39 +00:00
|
|
|
|
2002-08-28 21:04:11 +00:00
|
|
|
if (!tree)
|
2015-11-15 13:00:10 +00:00
|
|
|
return tvb_captured_length(tvb);
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2011-10-21 02:10:19 +00:00
|
|
|
ti = proto_tree_add_item(tree, proto_zip, tvb, 0, -1, ENC_NA);
|
2002-06-29 21:27:39 +00:00
|
|
|
zip_tree = proto_item_add_subtree(ti, ett_zip);
|
|
|
|
|
2011-09-26 08:25:18 +00:00
|
|
|
proto_tree_add_item(zip_tree, hf_zip_function, tvb, offset, 1,ENC_BIG_ENDIAN);
|
2002-06-29 21:27:39 +00:00
|
|
|
offset++;
|
|
|
|
/* fn 1,7,2,8 are not tested */
|
|
|
|
switch (fn) {
|
|
|
|
case 1: /* Query */
|
2009-07-23 21:25:02 +00:00
|
|
|
count = tvb_get_guint8(tvb, offset);
|
2012-03-06 03:20:17 +00:00
|
|
|
ti = proto_tree_add_item(zip_tree, hf_zip_network_count, tvb, offset, 1, ENC_BIG_ENDIAN);
|
2009-07-23 21:25:02 +00:00
|
|
|
offset++;
|
|
|
|
sub_tree = proto_item_add_subtree(ti, ett_zip_network_list);
|
2012-03-06 03:20:17 +00:00
|
|
|
for (i = 0; i < count; i++) {
|
2011-09-26 08:25:18 +00:00
|
|
|
proto_tree_add_item(sub_tree, hf_zip_network, tvb, offset, 2, ENC_BIG_ENDIAN);
|
2009-07-23 21:25:02 +00:00
|
|
|
offset += 2;
|
|
|
|
}
|
|
|
|
break;
|
2002-06-29 21:27:39 +00:00
|
|
|
case 7: /* Notify */
|
2014-09-11 00:04:22 +00:00
|
|
|
proto_tree_add_bitmask(zip_tree, tvb, offset, hf_zip_flags, ett_zip_flags, zip_flags, ENC_NA);
|
2009-07-23 21:25:02 +00:00
|
|
|
offset++;
|
|
|
|
|
2011-10-04 22:44:31 +00:00
|
|
|
proto_tree_add_item(zip_tree, hf_zip_zero_value, tvb, offset, 4, ENC_NA);
|
2009-07-23 21:25:02 +00:00
|
|
|
offset += 4;
|
|
|
|
|
|
|
|
len = tvb_get_guint8(tvb, offset);
|
2014-09-18 14:35:48 +00:00
|
|
|
proto_tree_add_item(zip_tree, hf_zip_zone_name, tvb, offset, 1,ENC_ASCII|ENC_BIG_ENDIAN);
|
2009-07-23 21:25:02 +00:00
|
|
|
offset += len +1;
|
|
|
|
|
|
|
|
len = tvb_get_guint8(tvb, offset);
|
2011-09-26 08:25:18 +00:00
|
|
|
proto_tree_add_item(zip_tree, hf_zip_multicast_length,tvb, offset, 1,ENC_BIG_ENDIAN);
|
2009-07-23 21:25:02 +00:00
|
|
|
offset++;
|
2011-10-04 22:44:31 +00:00
|
|
|
proto_tree_add_item(zip_tree, hf_zip_multicast_address,tvb, offset, len,ENC_NA);
|
2009-07-23 21:25:02 +00:00
|
|
|
offset += len;
|
|
|
|
|
2014-09-18 14:35:48 +00:00
|
|
|
proto_tree_add_item(zip_tree, hf_zip_zone_name, tvb, offset, 1,ENC_ASCII|ENC_BIG_ENDIAN);
|
2009-07-23 21:25:02 +00:00
|
|
|
break;
|
2002-06-29 21:27:39 +00:00
|
|
|
|
|
|
|
case 2: /* Reply */
|
|
|
|
case 8: /* Extended Reply */
|
2009-07-23 21:25:02 +00:00
|
|
|
count = tvb_get_guint8(tvb, offset);
|
2011-09-26 08:25:18 +00:00
|
|
|
ti = proto_tree_add_item(zip_tree, hf_zip_network_count, tvb, offset, 1, ENC_BIG_ENDIAN);
|
2009-07-23 21:25:02 +00:00
|
|
|
offset++;
|
|
|
|
sub_tree = proto_item_add_subtree(ti, ett_zip_network_list);
|
2012-03-06 03:20:17 +00:00
|
|
|
for (i = 0; i < count; i++) {
|
2009-07-23 21:25:02 +00:00
|
|
|
net = tvb_get_ntohs(tvb, offset);
|
2014-09-11 00:04:22 +00:00
|
|
|
net_tree = proto_tree_add_subtree_format(sub_tree, tvb, offset, 2, ett_zip_network_list, &ti, "Zone for network: %u", net);
|
2011-09-26 08:25:18 +00:00
|
|
|
proto_tree_add_item(net_tree, hf_zip_network, tvb, offset, 2, ENC_BIG_ENDIAN);
|
2009-07-23 21:25:02 +00:00
|
|
|
offset += 2;
|
|
|
|
len = tvb_get_guint8(tvb, offset);
|
2014-09-18 14:35:48 +00:00
|
|
|
proto_tree_add_item(net_tree, hf_zip_zone_name, tvb, offset, 1,ENC_ASCII|ENC_BIG_ENDIAN);
|
2009-07-23 21:25:02 +00:00
|
|
|
offset += len +1;
|
2014-09-11 00:04:22 +00:00
|
|
|
proto_item_set_len(ti, len+3);
|
2009-07-23 21:25:02 +00:00
|
|
|
}
|
|
|
|
break;
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2002-06-29 21:27:39 +00:00
|
|
|
case 5 : /* GetNetInfo request */
|
2011-10-04 22:44:31 +00:00
|
|
|
proto_tree_add_item(zip_tree, hf_zip_zero_value, tvb, offset, 1, ENC_NA);
|
2009-07-23 21:25:02 +00:00
|
|
|
offset++;
|
2011-10-04 22:44:31 +00:00
|
|
|
proto_tree_add_item(zip_tree, hf_zip_zero_value, tvb, offset, 4, ENC_NA);
|
2009-07-23 21:25:02 +00:00
|
|
|
offset += 4;
|
2014-09-18 14:35:48 +00:00
|
|
|
proto_tree_add_item(zip_tree, hf_zip_zone_name, tvb, offset, 1,ENC_ASCII|ENC_BIG_ENDIAN);
|
2009-07-23 21:25:02 +00:00
|
|
|
break;
|
2002-06-29 21:27:39 +00:00
|
|
|
|
|
|
|
case 6 : /* GetNetInfo reply */
|
2009-07-23 21:25:02 +00:00
|
|
|
flag = tvb_get_guint8(tvb, offset);
|
2014-09-11 00:04:22 +00:00
|
|
|
proto_tree_add_bitmask(zip_tree, tvb, offset, hf_zip_flags, ett_zip_flags, zip_flags, ENC_NA);
|
2009-07-23 21:25:02 +00:00
|
|
|
offset++;
|
|
|
|
|
2011-09-26 08:25:18 +00:00
|
|
|
proto_tree_add_item(zip_tree, hf_zip_network_start, tvb, offset, 2, ENC_BIG_ENDIAN);
|
2009-07-23 21:25:02 +00:00
|
|
|
offset += 2;
|
2002-06-29 21:27:39 +00:00
|
|
|
|
2011-09-26 08:25:18 +00:00
|
|
|
proto_tree_add_item(zip_tree, hf_zip_network_end, tvb, offset, 2, ENC_BIG_ENDIAN);
|
2009-07-23 21:25:02 +00:00
|
|
|
offset += 2;
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2009-07-23 21:25:02 +00:00
|
|
|
len = tvb_get_guint8(tvb, offset);
|
2014-09-18 14:35:48 +00:00
|
|
|
proto_tree_add_item(zip_tree, hf_zip_zone_name, tvb, offset, 1,ENC_ASCII|ENC_BIG_ENDIAN);
|
2009-07-23 21:25:02 +00:00
|
|
|
offset += len +1;
|
|
|
|
|
|
|
|
len = tvb_get_guint8(tvb, offset);
|
2011-09-26 08:25:18 +00:00
|
|
|
proto_tree_add_item(zip_tree, hf_zip_multicast_length,tvb, offset, 1,ENC_BIG_ENDIAN);
|
2009-07-23 21:25:02 +00:00
|
|
|
offset++;
|
2011-10-04 22:44:31 +00:00
|
|
|
proto_tree_add_item(zip_tree, hf_zip_multicast_address,tvb, offset, len,ENC_NA);
|
2009-07-23 21:25:02 +00:00
|
|
|
offset += len;
|
|
|
|
if ((flag & 0x80) != 0)
|
2014-09-18 14:35:48 +00:00
|
|
|
proto_tree_add_item(zip_tree, hf_zip_default_zone, tvb, offset, 1,ENC_ASCII|ENC_BIG_ENDIAN);
|
2009-07-23 21:25:02 +00:00
|
|
|
break;
|
2002-06-29 21:27:39 +00:00
|
|
|
|
|
|
|
default:
|
2009-07-23 21:25:02 +00:00
|
|
|
break;
|
2002-06-29 21:27:39 +00:00
|
|
|
}
|
2015-11-15 13:00:10 +00:00
|
|
|
return tvb_captured_length(tvb);
|
2002-06-29 21:27:39 +00:00
|
|
|
}
|
2002-04-25 23:58:02 +00:00
|
|
|
|
2015-11-26 13:25:32 +00:00
|
|
|
typedef struct ddp_nodes
|
|
|
|
{
|
|
|
|
guint8 dnode;
|
|
|
|
guint8 snode;
|
|
|
|
|
|
|
|
} ddp_nodes_t;
|
|
|
|
|
|
|
|
static int
|
|
|
|
dissect_ddp_short(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
|
2001-11-30 07:14:22 +00:00
|
|
|
{
|
2015-01-11 14:35:08 +00:00
|
|
|
guint16 len;
|
|
|
|
guint8 dport;
|
|
|
|
guint8 sport;
|
|
|
|
guint8 type;
|
|
|
|
proto_tree *ddp_tree = NULL;
|
|
|
|
proto_item *ti, *hidden_item;
|
2015-01-13 04:35:44 +00:00
|
|
|
struct atalk_ddp_addr *src = wmem_new0(pinfo->pool, struct atalk_ddp_addr),
|
|
|
|
*dst = wmem_new0(pinfo->pool, struct atalk_ddp_addr);
|
2015-01-11 14:35:08 +00:00
|
|
|
tvbuff_t *new_tvb;
|
2015-11-26 13:25:32 +00:00
|
|
|
ddp_nodes_t *ddp_node = (ddp_nodes_t*)data;
|
2001-11-30 07:14:22 +00:00
|
|
|
|
2009-08-09 06:26:46 +00:00
|
|
|
col_set_str(pinfo->cinfo, COL_PROTOCOL, "DDP");
|
2009-08-09 07:36:13 +00:00
|
|
|
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,
|
2011-10-21 02:10:19 +00:00
|
|
|
ENC_NA);
|
2001-11-30 07:14:22 +00:00
|
|
|
ddp_tree = proto_item_add_subtree(ti, ett_ddp);
|
|
|
|
}
|
|
|
|
len = tvb_get_ntohs(tvb, 0);
|
|
|
|
if (tree)
|
2009-07-23 21:25:02 +00:00
|
|
|
proto_tree_add_uint(ddp_tree, hf_ddp_len, tvb, 0, 2, len);
|
2001-11-30 07:14:22 +00:00
|
|
|
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
|
|
|
|
2015-01-11 14:35:08 +00:00
|
|
|
src->net = 0;
|
2015-11-26 13:25:32 +00:00
|
|
|
src->node = ddp_node->snode;
|
2015-01-11 14:35:08 +00:00
|
|
|
dst->net = 0;
|
2015-11-26 13:25:32 +00:00
|
|
|
dst->node = ddp_node->dnode;
|
2015-10-21 19:04:16 +00:00
|
|
|
set_address(&pinfo->net_src, atalk_address_type, sizeof(struct atalk_ddp_addr), src);
|
|
|
|
copy_address_shallow(&pinfo->src, &pinfo->net_src);
|
|
|
|
set_address(&pinfo->net_dst, atalk_address_type, sizeof(struct atalk_ddp_addr), dst);
|
|
|
|
copy_address_shallow(&pinfo->dst, &pinfo->net_dst);
|
2001-11-30 07:14:22 +00:00
|
|
|
|
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
|
|
|
|
2011-09-26 08:25:18 +00:00
|
|
|
col_add_str(pinfo->cinfo, COL_INFO,
|
|
|
|
val_to_str_ext(type, &op_vals_ext, "Unknown DDP protocol (%02x)"));
|
|
|
|
|
2002-06-28 20:13:03 +00:00
|
|
|
if (tree) {
|
2008-05-09 13:59:10 +00:00
|
|
|
hidden_item = proto_tree_add_string(ddp_tree, hf_ddp_src, tvb,
|
2015-02-08 18:49:57 +00:00
|
|
|
4, 3, address_to_str(wmem_packet_scope(), &pinfo->src));
|
2009-07-23 21:25:02 +00:00
|
|
|
PROTO_ITEM_SET_HIDDEN(hidden_item);
|
2008-05-09 13:59:10 +00:00
|
|
|
hidden_item = proto_tree_add_string(ddp_tree, hf_ddp_dst, tvb,
|
2015-02-08 18:49:57 +00:00
|
|
|
6, 3, address_to_str(wmem_packet_scope(), &pinfo->dst));
|
2009-07-23 21:25:02 +00:00
|
|
|
PROTO_ITEM_SET_HIDDEN(hidden_item);
|
2002-06-28 20:13:03 +00:00
|
|
|
|
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
|
|
|
}
|
2009-08-16 12:36:22 +00:00
|
|
|
new_tvb = tvb_new_subset_remaining(tvb, DDP_SHORT_HEADER_SIZE);
|
2001-11-30 07:14:22 +00:00
|
|
|
|
2010-12-20 05:35:29 +00:00
|
|
|
if (!dissector_try_uint(ddp_dissector_table, type, new_tvb, pinfo, tree))
|
2016-03-20 00:33:14 +00:00
|
|
|
call_data_dissector(new_tvb, pinfo, tree);
|
2015-11-26 13:25:32 +00:00
|
|
|
|
|
|
|
return tvb_captured_length(tvb);
|
2001-11-30 07:14:22 +00:00
|
|
|
}
|
|
|
|
|
2015-11-15 13:00:10 +00:00
|
|
|
static int
|
|
|
|
dissect_ddp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
|
2001-11-30 07:14:22 +00:00
|
|
|
{
|
2015-01-11 14:35:08 +00:00
|
|
|
proto_tree *ddp_tree;
|
|
|
|
proto_item *ti, *hidden_item;
|
2015-01-13 04:35:44 +00:00
|
|
|
struct atalk_ddp_addr *src = wmem_new0(pinfo->pool, struct atalk_ddp_addr),
|
|
|
|
*dst = wmem_new0(pinfo->pool, struct atalk_ddp_addr);
|
2015-01-11 14:35:08 +00:00
|
|
|
tvbuff_t *new_tvb;
|
2016-07-11 03:47:28 +00:00
|
|
|
guint type;
|
1998-10-16 01:18:35 +00:00
|
|
|
|
2009-08-09 06:26:46 +00:00
|
|
|
col_set_str(pinfo->cinfo, COL_PROTOCOL, "DDP");
|
2009-08-09 07:36:13 +00:00
|
|
|
col_clear(pinfo->cinfo, COL_INFO);
|
1999-10-07 17:11:11 +00:00
|
|
|
|
2002-06-28 20:13:03 +00:00
|
|
|
pinfo->ptype = PT_DDP;
|
|
|
|
|
2016-07-11 03:47:28 +00:00
|
|
|
ti = proto_tree_add_item(tree, proto_ddp, tvb, 0, DDP_HEADER_SIZE, ENC_NA);
|
|
|
|
ddp_tree = proto_item_add_subtree(ti, ett_ddp);
|
2002-06-28 20:13:03 +00:00
|
|
|
|
2016-07-11 03:47:28 +00:00
|
|
|
hidden_item = proto_tree_add_string(ddp_tree, hf_ddp_src, tvb,
|
2015-02-08 18:49:57 +00:00
|
|
|
4, 3, address_to_str(wmem_packet_scope(), &pinfo->src));
|
2016-07-11 03:47:28 +00:00
|
|
|
PROTO_ITEM_SET_HIDDEN(hidden_item);
|
2008-05-09 13:59:10 +00:00
|
|
|
|
2016-07-11 03:47:28 +00:00
|
|
|
hidden_item = proto_tree_add_string(ddp_tree, hf_ddp_dst, tvb,
|
2015-02-08 18:49:57 +00:00
|
|
|
6, 3, address_to_str(wmem_packet_scope(), &pinfo->dst));
|
2016-07-11 03:47:28 +00:00
|
|
|
PROTO_ITEM_SET_HIDDEN(hidden_item);
|
|
|
|
|
|
|
|
proto_tree_add_item(ddp_tree, hf_ddp_hopcount, tvb, 0, 2, ENC_BIG_ENDIAN);
|
|
|
|
proto_tree_add_item(ddp_tree, hf_ddp_len, tvb, 0, 2, ENC_BIG_ENDIAN);
|
|
|
|
proto_tree_add_checksum(ddp_tree, tvb, 0, hf_ddp_checksum, -1, NULL, pinfo, 0, ENC_BIG_ENDIAN, PROTO_CHECKSUM_NO_FLAGS);
|
|
|
|
dst->net = tvb_get_ntohs(tvb, 4);
|
|
|
|
proto_tree_add_uint(ddp_tree, hf_ddp_dst_net, tvb, 4, 2, dst->net);
|
|
|
|
src->net = tvb_get_ntohs(tvb, 6);
|
|
|
|
proto_tree_add_uint(ddp_tree, hf_ddp_src_net, tvb, 6, 2, src->net);
|
|
|
|
dst->node = tvb_get_guint8(tvb, 8);
|
|
|
|
proto_tree_add_uint(ddp_tree, hf_ddp_dst_node, tvb, 8, 1, dst->node);
|
|
|
|
src->node = tvb_get_guint8(tvb, 9);
|
|
|
|
proto_tree_add_uint(ddp_tree, hf_ddp_src_node, tvb, 9, 1, src->node);
|
|
|
|
proto_tree_add_item_ret_uint(ddp_tree, hf_ddp_dst_socket, tvb, 10, 1, ENC_NA, &pinfo->destport);
|
|
|
|
proto_tree_add_item_ret_uint(ddp_tree, hf_ddp_src_socket, tvb, 11, 1, ENC_NA, &pinfo->srcport);
|
|
|
|
proto_tree_add_item_ret_uint(ddp_tree, hf_ddp_type, tvb, 12, 1, ENC_NA, &type);
|
2002-06-28 20:13:03 +00:00
|
|
|
|
2016-07-11 03:47:28 +00:00
|
|
|
col_add_str(pinfo->cinfo, COL_INFO,
|
|
|
|
val_to_str_ext(type, &op_vals_ext, "Unknown DDP protocol (%02x)"));
|
|
|
|
|
|
|
|
set_address(&pinfo->net_src, atalk_address_type, sizeof(struct atalk_ddp_addr), src);
|
|
|
|
copy_address_shallow(&pinfo->src, &pinfo->net_src);
|
|
|
|
set_address(&pinfo->net_dst, atalk_address_type, sizeof(struct atalk_ddp_addr), dst);
|
|
|
|
copy_address_shallow(&pinfo->dst, &pinfo->net_dst);
|
1998-10-16 01:18:35 +00:00
|
|
|
|
2009-08-16 12:36:22 +00:00
|
|
|
new_tvb = tvb_new_subset_remaining(tvb, DDP_HEADER_SIZE);
|
1998-10-16 01:18:35 +00:00
|
|
|
|
2016-07-11 03:47:28 +00:00
|
|
|
if (!dissector_try_uint(ddp_dissector_table, type, new_tvb, pinfo, tree))
|
2015-11-15 13:00:10 +00:00
|
|
|
{
|
2016-03-20 00:33:14 +00:00
|
|
|
call_data_dissector(new_tvb, pinfo, tree);
|
2015-11-15 13:00:10 +00:00
|
|
|
}
|
|
|
|
return tvb_captured_length(tvb);
|
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}
|
|
|
|
};
|
2010-11-08 21:59:39 +00:00
|
|
|
static value_string_ext llap_type_vals_ext = VALUE_STRING_EXT_INIT(llap_type_vals);
|
2001-11-30 07:14:22 +00:00
|
|
|
|
2015-12-13 21:54:16 +00:00
|
|
|
static gboolean
|
2015-12-15 00:25:31 +00:00
|
|
|
capture_llap(const guchar *pd _U_, int offset _U_, int len _U_, capture_packet_info_t *cpinfo _U_, const union wtap_pseudo_header *pseudo_header _U_)
|
2001-11-30 07:14:22 +00:00
|
|
|
{
|
2015-12-13 21:54:16 +00:00
|
|
|
/* XXX - get its own counter
|
2015-12-15 00:25:31 +00:00
|
|
|
counts->other++; */
|
2015-12-13 21:54:16 +00:00
|
|
|
return FALSE;
|
2001-11-30 07:14:22 +00:00
|
|
|
}
|
|
|
|
|
2015-11-15 13:00:10 +00:00
|
|
|
static int
|
|
|
|
dissect_llap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
|
2001-11-30 07:14:22 +00:00
|
|
|
{
|
2015-11-26 13:25:32 +00:00
|
|
|
ddp_nodes_t ddp_node;
|
2001-11-30 07:14:22 +00:00
|
|
|
guint8 type;
|
2014-01-12 17:57:21 +00:00
|
|
|
proto_tree *llap_tree;
|
2001-11-30 07:14:22 +00:00
|
|
|
proto_item *ti;
|
|
|
|
tvbuff_t *new_tvb;
|
|
|
|
|
2009-08-09 06:26:46 +00:00
|
|
|
col_set_str(pinfo->cinfo, COL_PROTOCOL, "LLAP");
|
2009-08-09 07:36:13 +00:00
|
|
|
col_clear(pinfo->cinfo, COL_INFO);
|
2001-11-30 07:14:22 +00:00
|
|
|
|
2014-01-12 17:57:21 +00:00
|
|
|
ti = proto_tree_add_item(tree, proto_llap, tvb, 0, 3, ENC_NA);
|
|
|
|
llap_tree = proto_item_add_subtree(ti, ett_llap);
|
2001-11-30 07:14:22 +00:00
|
|
|
|
2015-11-26 13:25:32 +00:00
|
|
|
ddp_node.dnode = tvb_get_guint8(tvb, 0);
|
|
|
|
proto_tree_add_uint(llap_tree, hf_llap_dst, tvb, 0, 1, ddp_node.dnode);
|
2014-01-12 17:57:21 +00:00
|
|
|
|
2015-11-26 13:25:32 +00:00
|
|
|
ddp_node.snode = tvb_get_guint8(tvb, 1);
|
|
|
|
proto_tree_add_uint(llap_tree, hf_llap_src, tvb, 1, 1, ddp_node.snode);
|
2014-01-12 17:57:21 +00:00
|
|
|
|
2001-11-30 07:14:22 +00:00
|
|
|
type = tvb_get_guint8(tvb, 2);
|
2011-09-26 08:25:18 +00:00
|
|
|
col_add_str(pinfo->cinfo, COL_INFO,
|
|
|
|
val_to_str_ext(type, &llap_type_vals_ext, "Unknown LLAP type (%02x)"));
|
2014-01-12 17:57:21 +00:00
|
|
|
proto_tree_add_uint(llap_tree, hf_llap_type, tvb, 2, 1, type);
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2009-08-16 12:36:22 +00:00
|
|
|
new_tvb = tvb_new_subset_remaining(tvb, 3);
|
2001-11-30 07:14:22 +00:00
|
|
|
|
2003-11-16 23:17:27 +00:00
|
|
|
switch (type) {
|
2014-01-12 17:49:30 +00:00
|
|
|
case 0x01:
|
2015-11-26 13:25:32 +00:00
|
|
|
if (call_dissector_with_data(ddp_short_handle, new_tvb, pinfo, tree, &ddp_node))
|
2015-11-15 13:00:10 +00:00
|
|
|
return tvb_captured_length(tvb);
|
2014-01-12 17:49:30 +00:00
|
|
|
break;
|
|
|
|
case 0x02:
|
|
|
|
if (call_dissector(ddp_handle, new_tvb, pinfo, tree))
|
2015-11-15 13:00:10 +00:00
|
|
|
return tvb_captured_length(tvb);
|
2014-01-12 17:49:30 +00:00
|
|
|
break;
|
2001-11-30 07:14:22 +00:00
|
|
|
}
|
2016-03-20 00:33:14 +00:00
|
|
|
call_data_dissector(new_tvb, pinfo, tree);
|
2015-11-15 13:00:10 +00:00
|
|
|
return tvb_captured_length(tvb);
|
2001-11-30 07:14:22 +00:00
|
|
|
}
|
|
|
|
|
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
|
|
|
{
|
2013-03-22 23:59:54 +00:00
|
|
|
reassembly_table_init(&atp_reassembly_table,
|
|
|
|
&addresses_reassembly_table_functions);
|
2009-07-23 21:25:02 +00:00
|
|
|
atp_request_hash = g_hash_table_new(asp_hash, asp_equal);
|
2015-06-28 23:02:45 +00:00
|
|
|
}
|
2002-05-03 21:25:43 +00:00
|
|
|
|
2015-06-28 23:02:45 +00:00
|
|
|
static void
|
|
|
|
atp_cleanup(void)
|
|
|
|
{
|
|
|
|
reassembly_table_destroy(&atp_reassembly_table);
|
|
|
|
g_hash_table_destroy(atp_request_hash);
|
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
|
|
|
{
|
|
|
|
|
2009-07-23 21:25:02 +00:00
|
|
|
if (asp_request_hash)
|
|
|
|
g_hash_table_destroy(asp_request_hash);
|
2002-04-25 23:58:02 +00:00
|
|
|
|
2009-07-23 21:25:02 +00:00
|
|
|
asp_request_hash = g_hash_table_new(asp_hash, asp_equal);
|
2002-04-25 23:58:02 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
|
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,
|
2010-05-10 15:54:57 +00:00
|
|
|
{ "Destination Node", "llap.dst", FT_UINT8, BASE_DEC, NULL, 0x0,
|
|
|
|
NULL, HFILL }},
|
2001-11-30 07:14:22 +00:00
|
|
|
|
|
|
|
{ &hf_llap_src,
|
2010-05-10 15:54:57 +00:00
|
|
|
{ "Source Node", "llap.src", FT_UINT8, BASE_DEC, NULL, 0x0,
|
|
|
|
NULL, HFILL }},
|
2001-11-30 07:14:22 +00:00
|
|
|
|
|
|
|
{ &hf_llap_type,
|
2010-11-08 21:59:39 +00:00
|
|
|
{ "Type", "llap.type", FT_UINT8, BASE_HEX|BASE_EXT_STRING, &llap_type_vals_ext, 0x0,
|
2010-05-10 15:54:57 +00:00
|
|
|
NULL, HFILL }},
|
2001-11-30 07:14:22 +00:00
|
|
|
};
|
|
|
|
|
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,
|
2016-07-11 03:47:28 +00:00
|
|
|
{ "Hop count", "ddp.hopcount", FT_UINT16, BASE_DEC, NULL, 0x3C00,
|
2010-05-10 15:54:57 +00:00
|
|
|
NULL, HFILL }},
|
1999-10-12 06:21:15 +00:00
|
|
|
|
1999-10-07 17:11:11 +00:00
|
|
|
{ &hf_ddp_len,
|
2016-07-11 03:47:28 +00:00
|
|
|
{ "Datagram length", "ddp.len", FT_UINT16, BASE_DEC, NULL, 0x0300,
|
2010-05-10 15:54:57 +00:00
|
|
|
NULL, HFILL }},
|
1999-10-12 06:21:15 +00:00
|
|
|
|
1999-10-07 17:11:11 +00:00
|
|
|
{ &hf_ddp_checksum,
|
2010-05-10 15:54:57 +00:00
|
|
|
{ "Checksum", "ddp.checksum", FT_UINT16, BASE_DEC, NULL, 0x0,
|
|
|
|
NULL, HFILL }},
|
1999-10-12 06:21:15 +00:00
|
|
|
|
2002-06-28 20:13:03 +00:00
|
|
|
{ &hf_ddp_dst,
|
2010-05-10 15:54:57 +00:00
|
|
|
{ "Destination address", "ddp.dst", FT_STRING, BASE_NONE, NULL, 0x0,
|
|
|
|
NULL, HFILL }},
|
2002-06-28 20:13:03 +00:00
|
|
|
|
1999-10-07 17:11:11 +00:00
|
|
|
{ &hf_ddp_dst_net,
|
2010-05-10 15:54:57 +00:00
|
|
|
{ "Destination Net", "ddp.dst.net", FT_UINT16, BASE_DEC, NULL, 0x0,
|
|
|
|
NULL, HFILL }},
|
1999-10-12 06:21:15 +00:00
|
|
|
|
2002-06-28 20:13:03 +00:00
|
|
|
{ &hf_ddp_src,
|
2010-05-10 15:54:57 +00:00
|
|
|
{ "Source address", "ddp.src", FT_STRING, BASE_NONE, NULL, 0x0,
|
|
|
|
NULL, HFILL }},
|
2002-06-28 20:13:03 +00:00
|
|
|
|
1999-10-07 17:11:11 +00:00
|
|
|
{ &hf_ddp_src_net,
|
2010-05-10 15:54:57 +00:00
|
|
|
{ "Source Net", "ddp.src.net", FT_UINT16, BASE_DEC, NULL, 0x0,
|
|
|
|
NULL, HFILL }},
|
1999-10-12 06:21:15 +00:00
|
|
|
|
1999-10-07 17:11:11 +00:00
|
|
|
{ &hf_ddp_dst_node,
|
2010-05-10 15:54:57 +00:00
|
|
|
{ "Destination Node", "ddp.dst.node", FT_UINT8, BASE_DEC, NULL, 0x0,
|
|
|
|
NULL, HFILL }},
|
1999-10-12 06:21:15 +00:00
|
|
|
|
1999-10-07 17:11:11 +00:00
|
|
|
{ &hf_ddp_src_node,
|
2010-05-10 15:54:57 +00:00
|
|
|
{ "Source Node", "ddp.src.node", FT_UINT8, BASE_DEC, NULL, 0x0,
|
|
|
|
NULL, HFILL }},
|
1999-10-12 06:21:15 +00:00
|
|
|
|
1999-10-07 17:11:11 +00:00
|
|
|
{ &hf_ddp_dst_socket,
|
2010-05-10 15:54:57 +00:00
|
|
|
{ "Destination Socket", "ddp.dst_socket", FT_UINT8, BASE_DEC, NULL, 0x0,
|
|
|
|
NULL, HFILL }},
|
1999-10-12 06:21:15 +00:00
|
|
|
|
1999-10-07 17:11:11 +00:00
|
|
|
{ &hf_ddp_src_socket,
|
2010-05-10 15:54:57 +00:00
|
|
|
{ "Source Socket", "ddp.src_socket", FT_UINT8, BASE_DEC, NULL, 0x0,
|
|
|
|
NULL, HFILL }},
|
1999-10-12 06:21:15 +00:00
|
|
|
|
1999-10-07 17:11:11 +00:00
|
|
|
{ &hf_ddp_type,
|
2010-11-08 21:59:39 +00:00
|
|
|
{ "Protocol type", "ddp.type", FT_UINT8, BASE_DEC|BASE_EXT_STRING, &op_vals_ext, 0x0,
|
2010-05-10 15:54:57 +00:00
|
|
|
NULL, 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,
|
2010-05-10 15:54:57 +00:00
|
|
|
{ "Operation", "nbp.op", FT_UINT8, BASE_DEC,
|
|
|
|
VALS(nbp_op_vals), 0xF0, NULL, HFILL }},
|
1999-12-08 23:55:01 +00:00
|
|
|
{ &hf_nbp_info,
|
2010-05-10 15:54:57 +00:00
|
|
|
{ "Info", "nbp.info", FT_UINT8, BASE_HEX,
|
|
|
|
NULL, 0x0, NULL, HFILL }},
|
1999-12-08 23:55:01 +00:00
|
|
|
{ &hf_nbp_count,
|
2010-05-10 15:54:57 +00:00
|
|
|
{ "Count", "nbp.count", FT_UINT8, BASE_DEC,
|
|
|
|
NULL, 0x0F, NULL, HFILL }},
|
1999-12-09 04:02:50 +00:00
|
|
|
{ &hf_nbp_node_net,
|
2010-05-10 15:54:57 +00:00
|
|
|
{ "Network", "nbp.net", FT_UINT16, BASE_DEC,
|
|
|
|
NULL, 0x0, NULL, HFILL }},
|
1999-12-09 04:02:50 +00:00
|
|
|
{ &hf_nbp_node_node,
|
2010-05-10 15:54:57 +00:00
|
|
|
{ "Node", "nbp.node", FT_UINT8, BASE_DEC,
|
|
|
|
NULL, 0x0, NULL, HFILL }},
|
1999-12-09 04:02:50 +00:00
|
|
|
{ &hf_nbp_node_port,
|
2010-05-10 15:54:57 +00:00
|
|
|
{ "Port", "nbp.port", FT_UINT8, BASE_DEC,
|
|
|
|
NULL, 0x0, NULL, HFILL }},
|
1999-12-09 15:31:24 +00:00
|
|
|
{ &hf_nbp_node_enum,
|
2010-05-10 15:54:57 +00:00
|
|
|
{ "Enumerator", "nbp.enum", FT_UINT8, BASE_DEC,
|
|
|
|
NULL, 0x0, NULL, HFILL }},
|
1999-12-09 15:31:24 +00:00
|
|
|
{ &hf_nbp_node_object,
|
2014-09-11 00:04:22 +00:00
|
|
|
{ "Object", "nbp.object", FT_UINT_STRING, BASE_NONE,
|
2010-05-10 15:54:57 +00:00
|
|
|
NULL, 0x0, NULL, HFILL }},
|
1999-12-09 04:02:50 +00:00
|
|
|
{ &hf_nbp_node_type,
|
2014-09-11 00:04:22 +00:00
|
|
|
{ "Type", "nbp.type", FT_UINT_STRING, BASE_NONE,
|
2010-05-10 15:54:57 +00:00
|
|
|
NULL, 0x0, NULL, HFILL }},
|
1999-12-09 15:31:24 +00:00
|
|
|
{ &hf_nbp_node_zone,
|
2014-09-11 00:04:22 +00:00
|
|
|
{ "Zone", "nbp.zone", FT_UINT_STRING, BASE_NONE,
|
2010-05-10 15:54:57 +00:00
|
|
|
NULL, 0x0, NULL, HFILL }},
|
1999-12-08 23:55:01 +00:00
|
|
|
{ &hf_nbp_tid,
|
2010-05-10 15:54:57 +00:00
|
|
|
{ "Transaction ID", "nbp.tid", FT_UINT8, BASE_DEC,
|
|
|
|
NULL, 0x0, NULL, 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,
|
2010-05-10 15:54:57 +00:00
|
|
|
{ "Net", "rtmp.net", FT_UINT16, BASE_DEC,
|
|
|
|
NULL, 0x0, NULL, HFILL }},
|
1999-12-09 17:06:37 +00:00
|
|
|
{ &hf_rtmp_node,
|
2010-05-10 15:54:57 +00:00
|
|
|
{ "Node", "nbp.nodeid", FT_UINT8, BASE_DEC,
|
|
|
|
NULL, 0x0, NULL, HFILL }},
|
1999-12-09 17:06:37 +00:00
|
|
|
{ &hf_rtmp_node_len,
|
2010-05-10 15:54:57 +00:00
|
|
|
{ "Node Length", "nbp.nodeid.length", FT_UINT8, BASE_DEC,
|
|
|
|
NULL, 0x0, NULL, HFILL }},
|
1999-12-09 17:06:37 +00:00
|
|
|
{ &hf_rtmp_tuple_net,
|
2010-05-10 15:54:57 +00:00
|
|
|
{ "Net", "rtmp.tuple.net", FT_UINT16, BASE_DEC,
|
|
|
|
NULL, 0x0, NULL, HFILL }},
|
2000-11-13 04:26:14 +00:00
|
|
|
{ &hf_rtmp_tuple_range_start,
|
2010-05-10 15:54:57 +00:00
|
|
|
{ "Range Start", "rtmp.tuple.range_start", FT_UINT16, BASE_DEC,
|
|
|
|
NULL, 0x0, NULL, HFILL }},
|
2000-11-13 04:26:14 +00:00
|
|
|
{ &hf_rtmp_tuple_range_end,
|
2010-05-10 15:54:57 +00:00
|
|
|
{ "Range End", "rtmp.tuple.range_end", FT_UINT16, BASE_DEC,
|
|
|
|
NULL, 0x0, NULL, HFILL }},
|
1999-12-09 17:06:37 +00:00
|
|
|
{ &hf_rtmp_tuple_dist,
|
2010-05-10 15:54:57 +00:00
|
|
|
{ "Distance", "rtmp.tuple.dist", FT_UINT16, BASE_DEC,
|
|
|
|
NULL, 0x0, NULL, HFILL }},
|
2000-11-13 04:26:14 +00:00
|
|
|
{ &hf_rtmp_function,
|
2010-05-10 15:54:57 +00:00
|
|
|
{ "Function", "rtmp.function", FT_UINT8, BASE_DEC,
|
|
|
|
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,
|
2010-05-10 15:54:57 +00:00
|
|
|
{ "Control info", "atp.ctrlinfo", FT_UINT8, BASE_HEX,
|
2010-09-23 21:46:31 +00:00
|
|
|
NULL, 0, NULL, HFILL }},
|
2002-04-25 23:58:02 +00:00
|
|
|
|
|
|
|
{ &hf_atp_function,
|
2010-05-10 15:54:57 +00:00
|
|
|
{ "Function", "atp.function", FT_UINT8, BASE_DEC,
|
|
|
|
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,
|
2010-05-10 15:54:57 +00:00
|
|
|
{ "XO", "atp.xo", FT_BOOLEAN, 8,
|
|
|
|
NULL, ATP_XO, "Exactly-once flag", HFILL }},
|
2002-04-26 07:41:31 +00:00
|
|
|
|
|
|
|
{ &hf_atp_eom,
|
2010-05-10 15:54:57 +00:00
|
|
|
{ "EOM", "atp.eom", FT_BOOLEAN, 8,
|
|
|
|
NULL, ATP_EOM, "End-of-message", HFILL }},
|
2002-04-26 07:41:31 +00:00
|
|
|
|
|
|
|
{ &hf_atp_sts,
|
2010-05-10 15:54:57 +00:00
|
|
|
{ "STS", "atp.sts", FT_BOOLEAN, 8,
|
|
|
|
NULL, ATP_STS, "Send transaction status", HFILL }},
|
2002-04-26 07:41:31 +00:00
|
|
|
|
|
|
|
{ &hf_atp_treltimer,
|
2010-05-10 15:54:57 +00:00
|
|
|
{ "TRel timer", "atp.treltimer", FT_UINT8, BASE_DEC,
|
|
|
|
VALS(atp_trel_timer_vals), 0x07, NULL, HFILL }},
|
2002-04-25 23:58:02 +00:00
|
|
|
|
|
|
|
{ &hf_atp_bitmap,
|
2010-05-10 15:54:57 +00:00
|
|
|
{ "Bitmap", "atp.bitmap", FT_UINT8, BASE_HEX,
|
|
|
|
NULL, 0x0, "Bitmap or sequence number", HFILL }},
|
2002-05-01 07:26:45 +00:00
|
|
|
|
2002-04-25 23:58:02 +00:00
|
|
|
{ &hf_atp_tid,
|
2010-05-10 15:54:57 +00:00
|
|
|
{ "TID", "atp.tid", FT_UINT16, BASE_DEC,
|
|
|
|
NULL, 0x0, "Transaction id", HFILL }},
|
2002-05-03 21:25:43 +00:00
|
|
|
{ &hf_atp_user_bytes,
|
2010-05-10 15:54:57 +00:00
|
|
|
{ "User bytes", "atp.user_bytes", FT_UINT32, BASE_HEX,
|
|
|
|
NULL, 0x0, NULL, HFILL }},
|
2002-05-01 07:26:45 +00:00
|
|
|
|
|
|
|
{ &hf_atp_segment_overlap,
|
2010-05-10 15:54:57 +00:00
|
|
|
{ "Segment overlap", "atp.segment.overlap", FT_BOOLEAN, BASE_NONE,
|
|
|
|
NULL, 0x0, "Segment overlaps with other segments", HFILL }},
|
2002-05-01 07:26:45 +00:00
|
|
|
|
|
|
|
{ &hf_atp_segment_overlap_conflict,
|
2002-10-24 06:17:36 +00:00
|
|
|
{ "Conflicting data in segment overlap", "atp.segment.overlap.conflict",
|
2010-05-10 15:54:57 +00:00
|
|
|
FT_BOOLEAN, BASE_NONE,
|
|
|
|
NULL, 0x0, "Overlapping segments contained conflicting data", HFILL }},
|
2002-05-01 07:26:45 +00:00
|
|
|
|
|
|
|
{ &hf_atp_segment_multiple_tails,
|
|
|
|
{ "Multiple tail segments found", "atp.segment.multipletails",
|
2010-05-10 15:54:57 +00:00
|
|
|
FT_BOOLEAN, BASE_NONE,
|
|
|
|
NULL, 0x0, "Several tails were found when desegmenting the packet", HFILL }},
|
2002-05-01 07:26:45 +00:00
|
|
|
|
|
|
|
{ &hf_atp_segment_too_long_segment,
|
2010-05-10 15:54:57 +00:00
|
|
|
{ "Segment too long", "atp.segment.toolongsegment", FT_BOOLEAN, BASE_NONE,
|
|
|
|
NULL, 0x0, "Segment contained data past end of packet", HFILL }},
|
2002-05-01 07:26:45 +00:00
|
|
|
|
|
|
|
{ &hf_atp_segment_error,
|
2010-05-10 15:54:57 +00:00
|
|
|
{"Desegmentation error", "atp.segment.error", FT_FRAMENUM, BASE_NONE,
|
|
|
|
NULL, 0x0, "Desegmentation error due to illegal segments", HFILL }},
|
2002-05-01 07:26:45 +00:00
|
|
|
|
2011-01-30 21:01:07 +00:00
|
|
|
{ &hf_atp_segment_count,
|
|
|
|
{ "Segment count", "atp.segment.count", FT_UINT32, BASE_DEC, NULL, 0x0,
|
|
|
|
NULL, HFILL }},
|
|
|
|
|
2002-05-01 07:26:45 +00:00
|
|
|
{ &hf_atp_segment,
|
2010-05-10 15:54:57 +00:00
|
|
|
{ "ATP Fragment", "atp.fragment", FT_FRAMENUM, BASE_NONE,
|
|
|
|
NULL, 0x0, NULL, HFILL }},
|
2002-05-01 07:26:45 +00:00
|
|
|
|
|
|
|
{ &hf_atp_segments,
|
2010-05-10 15:54:57 +00:00
|
|
|
{ "ATP Fragments", "atp.fragments", FT_NONE, BASE_NONE,
|
|
|
|
NULL, 0x0, NULL, HFILL }},
|
2003-04-20 11:36:16 +00:00
|
|
|
|
|
|
|
{ &hf_atp_reassembled_in,
|
|
|
|
{ "Reassembled ATP in frame", "atp.reassembled_in", FT_FRAMENUM, BASE_NONE, NULL, 0x0,
|
2010-02-02 16:01:52 +00:00
|
|
|
"This ATP packet is reassembled in this frame", HFILL }},
|
|
|
|
|
|
|
|
{ &hf_atp_reassembled_length,
|
2010-02-03 08:47:15 +00:00
|
|
|
{ "Reassembled ATP length", "atp.reassembled.length", FT_UINT32, BASE_DEC, NULL, 0x0,
|
2010-02-02 16:01:52 +00:00
|
|
|
"The total length of the reassembled payload", HFILL }}
|
2002-04-25 23:58:02 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
static hf_register_info hf_asp[] = {
|
|
|
|
{ &hf_asp_func,
|
2010-11-08 21:59:39 +00:00
|
|
|
{ "asp function", "asp.function", FT_UINT8, BASE_DEC|BASE_EXT_STRING,
|
|
|
|
&asp_func_vals_ext, 0, NULL, HFILL }},
|
1999-12-09 17:06:37 +00:00
|
|
|
|
2002-04-25 23:58:02 +00:00
|
|
|
{ &hf_asp_error,
|
2010-11-08 21:59:39 +00:00
|
|
|
{ "asp error", "asp.error", FT_INT32, BASE_DEC|BASE_EXT_STRING,
|
|
|
|
&asp_error_vals_ext, 0, "return error code", HFILL }},
|
2002-05-03 21:25:43 +00:00
|
|
|
|
|
|
|
{ &hf_asp_version,
|
2010-05-10 15:54:57 +00:00
|
|
|
{ "Version", "asp.version", FT_UINT16, BASE_HEX,
|
|
|
|
NULL, 0, "asp version", HFILL }},
|
2002-05-03 21:25:43 +00:00
|
|
|
|
|
|
|
{ &hf_asp_attn_code,
|
2010-05-10 15:54:57 +00:00
|
|
|
{ "Attn code", "asp.attn_code", FT_UINT16, BASE_HEX,
|
|
|
|
NULL, 0, "asp attention code", HFILL }},
|
2002-05-03 21:25:43 +00:00
|
|
|
|
|
|
|
{ &hf_asp_init_error,
|
2010-05-10 15:54:57 +00:00
|
|
|
{ "Error", "asp.init_error", FT_UINT16, BASE_DEC,
|
|
|
|
NULL, 0, "asp init error", HFILL }},
|
2002-05-03 21:25:43 +00:00
|
|
|
|
|
|
|
{ &hf_asp_session_id,
|
2010-05-10 15:54:57 +00:00
|
|
|
{ "Session ID", "asp.session_id", FT_UINT8, BASE_DEC,
|
|
|
|
NULL, 0, "asp session id", HFILL }},
|
2002-05-03 21:25:43 +00:00
|
|
|
|
|
|
|
{ &hf_asp_socket,
|
2010-05-10 15:54:57 +00:00
|
|
|
{ "Socket", "asp.socket", FT_UINT8, BASE_DEC,
|
|
|
|
NULL, 0, "asp socket", HFILL }},
|
2002-05-03 21:25:43 +00:00
|
|
|
|
|
|
|
{ &hf_asp_seq,
|
2010-05-10 15:54:57 +00:00
|
|
|
{ "Sequence", "asp.seq", FT_UINT16, BASE_DEC,
|
|
|
|
NULL, 0, "asp sequence number", HFILL }},
|
2002-05-03 21:25:43 +00:00
|
|
|
|
|
|
|
{ &hf_asp_size,
|
2010-05-10 15:54:57 +00:00
|
|
|
{ "size", "asp.size", FT_UINT16, BASE_DEC,
|
|
|
|
NULL, 0, "asp available size for reply", HFILL }},
|
2002-05-03 21:25:43 +00:00
|
|
|
|
|
|
|
{ &hf_asp_zero_value,
|
|
|
|
{ "Pad (0)", "asp.zero_value",
|
2010-05-10 15:54:57 +00:00
|
|
|
FT_BYTES, BASE_NONE, NULL, 0x0,
|
|
|
|
"Pad", 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,
|
2010-11-08 21:59:39 +00:00
|
|
|
{ "Function", "zip.function", FT_UINT8, BASE_DEC|BASE_EXT_STRING, &zip_function_vals_ext, 0x0,
|
2010-05-10 15:54:57 +00:00
|
|
|
"ZIP function", HFILL }},
|
2002-06-29 21:27:39 +00:00
|
|
|
|
|
|
|
{ &hf_zip_zero_value,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
{ "Pad (0)", "zip.zero_value",FT_BYTES, BASE_NONE, NULL, 0x0,
|
2010-05-10 15:54:57 +00:00
|
|
|
"Pad", HFILL }},
|
2002-06-29 21:27:39 +00:00
|
|
|
|
|
|
|
{ &hf_zip_atp_function,
|
2010-05-10 15:54:57 +00:00
|
|
|
{ "Function", "zip.atp_function", FT_UINT8, BASE_DEC, VALS(zip_atp_function_vals), 0x0,
|
|
|
|
NULL, HFILL }},
|
2002-06-29 21:27:39 +00:00
|
|
|
|
|
|
|
{ &hf_zip_start_index,
|
2010-05-10 15:54:57 +00:00
|
|
|
{ "Start index", "zip.start_index", FT_UINT16, BASE_DEC, NULL, 0x0,
|
|
|
|
NULL, HFILL }},
|
2002-06-29 21:27:39 +00:00
|
|
|
|
|
|
|
{ &hf_zip_count,
|
2010-05-10 15:54:57 +00:00
|
|
|
{ "Count", "zip.count", FT_UINT16, BASE_DEC, NULL, 0x0,
|
|
|
|
NULL, HFILL }},
|
2002-06-29 21:27:39 +00:00
|
|
|
|
|
|
|
{ &hf_zip_network_count,
|
2010-05-10 15:54:57 +00:00
|
|
|
{ "Count", "zip.network_count", FT_UINT8, BASE_DEC, NULL, 0x0,
|
|
|
|
NULL, HFILL }},
|
2002-06-29 21:27:39 +00:00
|
|
|
{ &hf_zip_network,
|
|
|
|
{ "Network","zip.network", FT_UINT16, BASE_DEC, NULL, 0x0,
|
2010-05-10 15:54:57 +00:00
|
|
|
NULL, HFILL }},
|
2002-06-29 21:27:39 +00:00
|
|
|
{ &hf_zip_network_start,
|
|
|
|
{ "Network start","zip.network_start", FT_UINT16, BASE_DEC, NULL, 0x0,
|
2010-05-10 15:54:57 +00:00
|
|
|
NULL, HFILL }},
|
2002-06-29 21:27:39 +00:00
|
|
|
{ &hf_zip_network_end,
|
2010-05-10 15:54:57 +00:00
|
|
|
{ "Network end", "zip.network_end", FT_UINT16, BASE_DEC, NULL, 0x0,
|
|
|
|
NULL, HFILL }},
|
2002-06-29 21:27:39 +00:00
|
|
|
|
|
|
|
{ &hf_zip_flags,
|
2014-09-11 00:04:22 +00:00
|
|
|
{ "Flags", "zip.flags", FT_UINT8, BASE_HEX, NULL, 0xC0,
|
2010-05-10 15:54:57 +00:00
|
|
|
NULL, HFILL }},
|
2002-06-29 21:27:39 +00:00
|
|
|
{ &hf_zip_last_flag,
|
2010-05-10 15:54:57 +00:00
|
|
|
{ "Last Flag", "zip.last_flag", FT_BOOLEAN, BASE_NONE, NULL, 0x0,
|
|
|
|
"Non zero if contains last zone name in the zone list", HFILL }},
|
2002-06-29 21:27:39 +00:00
|
|
|
|
|
|
|
{ &hf_zip_flags_zone_invalid,
|
2010-05-10 15:54:57 +00:00
|
|
|
{ "Zone invalid", "zip.flags.zone_invalid", FT_BOOLEAN, 8, NULL, 0x80,
|
|
|
|
NULL, HFILL }},
|
2002-06-29 21:27:39 +00:00
|
|
|
|
|
|
|
{ &hf_zip_flags_use_broadcast,
|
|
|
|
{ "Use broadcast","zip.flags.use_broadcast", FT_BOOLEAN, 8, NULL, 0x40,
|
2010-05-10 15:54:57 +00:00
|
|
|
NULL, HFILL }},
|
2002-06-29 21:27:39 +00:00
|
|
|
|
|
|
|
{ &hf_zip_flags_only_one_zone,
|
|
|
|
{ "Only one zone","zip.flags.only_one_zone", FT_BOOLEAN, 8, NULL, 0x20,
|
2010-05-10 15:54:57 +00:00
|
|
|
NULL, HFILL }},
|
2002-06-29 21:27:39 +00:00
|
|
|
|
|
|
|
{ &hf_zip_zone_name,
|
|
|
|
{ "Zone", "zip.zone_name", FT_UINT_STRING, BASE_NONE, NULL, 0x0,
|
2010-05-10 15:54:57 +00:00
|
|
|
NULL, HFILL }},
|
2002-06-29 21:27:39 +00:00
|
|
|
|
|
|
|
{ &hf_zip_default_zone,
|
|
|
|
{ "Default zone", "zip.default_zone",FT_UINT_STRING, BASE_NONE, NULL, 0x0,
|
2010-05-10 15:54:57 +00:00
|
|
|
NULL, HFILL }},
|
2002-06-29 21:27:39 +00:00
|
|
|
|
|
|
|
{ &hf_zip_multicast_length,
|
2010-05-10 15:54:57 +00:00
|
|
|
{ "Multicast length", "zip.multicast_length", FT_UINT8, BASE_DEC, NULL, 0x0,
|
|
|
|
"Multicast address length", HFILL }},
|
2002-06-29 21:27:39 +00:00
|
|
|
|
|
|
|
{ &hf_zip_multicast_address,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
{ "Multicast address", "zip.multicast_address",FT_BYTES, BASE_NONE, NULL, 0x0,
|
2010-05-10 15:54:57 +00:00
|
|
|
NULL, HFILL }},
|
2002-06-29 21:27:39 +00:00
|
|
|
|
|
|
|
};
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2005-10-13 05:23:01 +00:00
|
|
|
static hf_register_info hf_pap[] = {
|
|
|
|
{ &hf_pap_connid,
|
2012-07-22 03:06:37 +00:00
|
|
|
{ "ConnID", "prap.connid", FT_UINT8, BASE_DEC, NULL, 0x0,
|
2010-05-10 15:54:57 +00:00
|
|
|
"PAP connection ID", HFILL }},
|
2005-10-13 05:23:01 +00:00
|
|
|
|
|
|
|
{ &hf_pap_function,
|
2012-07-22 03:06:37 +00:00
|
|
|
{ "Function", "prap.function", FT_UINT8, BASE_DEC|BASE_EXT_STRING, &pap_function_vals_ext, 0x0,
|
2010-05-10 15:54:57 +00:00
|
|
|
"PAP function", HFILL }},
|
2005-10-13 05:23:01 +00:00
|
|
|
|
|
|
|
{ &hf_pap_socket,
|
2012-07-22 03:06:37 +00:00
|
|
|
{ "Socket", "prap.socket", FT_UINT8, BASE_DEC, NULL, 0x0,
|
2010-05-10 15:54:57 +00:00
|
|
|
"ATP responding socket number", HFILL }},
|
2005-10-13 05:23:01 +00:00
|
|
|
|
|
|
|
{ &hf_pap_quantum,
|
2012-07-22 03:06:37 +00:00
|
|
|
{ "Quantum", "prap.quantum", FT_UINT8, BASE_DEC, NULL, 0x0,
|
2010-05-10 15:54:57 +00:00
|
|
|
"Flow quantum", HFILL }},
|
2005-10-13 05:23:01 +00:00
|
|
|
|
|
|
|
{ &hf_pap_waittime,
|
2012-07-22 03:06:37 +00:00
|
|
|
{ "Wait time", "prap.waittime", FT_UINT16, BASE_DEC, NULL, 0x0,
|
2010-05-10 15:54:57 +00:00
|
|
|
NULL, HFILL }},
|
2005-10-13 05:23:01 +00:00
|
|
|
|
|
|
|
{ &hf_pap_result,
|
2012-07-22 03:06:37 +00:00
|
|
|
{ "Result", "prap.result", FT_UINT16, BASE_DEC, NULL, 0x0,
|
2010-05-10 15:54:57 +00:00
|
|
|
NULL, HFILL }},
|
2005-10-13 05:23:01 +00:00
|
|
|
|
|
|
|
{ &hf_pap_seq,
|
2012-07-22 03:06:37 +00:00
|
|
|
{ "Sequence", "prap.seq", FT_UINT16, BASE_DEC, NULL, 0x0,
|
2010-05-10 15:54:57 +00:00
|
|
|
"Sequence number", HFILL }},
|
2005-10-13 05:23:01 +00:00
|
|
|
|
|
|
|
{ &hf_pap_status,
|
2014-09-11 00:04:22 +00:00
|
|
|
{ "Status", "prap.status", FT_UINT_STRING, BASE_NONE, NULL, 0x0,
|
2010-05-10 15:54:57 +00:00
|
|
|
"Printer status", HFILL }},
|
2007-11-28 15:55:50 +00:00
|
|
|
|
2005-10-13 05:23:01 +00:00
|
|
|
{ &hf_pap_eof,
|
2012-07-22 03:06:37 +00:00
|
|
|
{ "EOF", "prap.eof", FT_BOOLEAN, BASE_NONE,
|
2010-05-10 15:54:57 +00:00
|
|
|
NULL, 0x0, NULL, HFILL }},
|
2007-11-28 15:55:50 +00:00
|
|
|
|
2005-10-13 05:23:01 +00:00
|
|
|
{ &hf_pap_pad,
|
2012-07-22 03:06:37 +00:00
|
|
|
{ "Pad", "prap.pad", FT_NONE, BASE_NONE, NULL, 0,
|
2010-05-10 15:54:57 +00:00
|
|
|
"Pad Byte", HFILL }},
|
2005-10-13 05:23:01 +00:00
|
|
|
|
|
|
|
};
|
|
|
|
|
1999-11-16 11:44:20 +00:00
|
|
|
static gint *ett[] = {
|
2009-07-23 21:25:02 +00:00
|
|
|
&ett_llap,
|
|
|
|
&ett_ddp,
|
|
|
|
&ett_atp,
|
|
|
|
&ett_atp_info,
|
|
|
|
&ett_atp_segments,
|
|
|
|
&ett_atp_segment,
|
|
|
|
&ett_asp,
|
|
|
|
&ett_pap,
|
|
|
|
|
|
|
|
&ett_nbp,
|
|
|
|
&ett_nbp_info,
|
|
|
|
&ett_nbp_node,
|
|
|
|
&ett_pstring,
|
|
|
|
&ett_rtmp,
|
|
|
|
&ett_rtmp_tuple,
|
|
|
|
|
|
|
|
&ett_zip,
|
|
|
|
&ett_zip_flags,
|
|
|
|
&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));
|
|
|
|
|
2012-07-22 03:06:37 +00:00
|
|
|
proto_pap = proto_register_protocol("Printer Access Protocol", "PrAP", "prap");
|
2005-10-13 05:23:01 +00:00
|
|
|
proto_register_field_array(proto_pap, hf_pap, array_length(hf_pap));
|
|
|
|
|
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",
|
2004-08-21 09:02:52 +00:00
|
|
|
"Reassemble ATP messages spanning multiple DDP packets",
|
|
|
|
"Whether the ATP dissector should reassemble messages spanning multiple DDP packets",
|
2002-04-30 22:05:33 +00:00
|
|
|
&atp_defragment);
|
|
|
|
|
2000-11-13 04:26:14 +00:00
|
|
|
proto_rtmp = proto_register_protocol("Routing Table Maintenance Protocol",
|
2010-05-10 15:54:57 +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 */
|
2016-03-13 11:51:45 +00:00
|
|
|
ddp_dissector_table = register_dissector_table("ddp.type", "DDP packet type", proto_ddp,
|
2016-08-30 22:51:54 +00:00
|
|
|
FT_UINT8, BASE_HEX);
|
2015-02-08 18:49:57 +00:00
|
|
|
|
2016-06-22 02:23:05 +00:00
|
|
|
atalk_address_type = address_type_dissector_register("AT_ATALK", "Appletalk DDP", atalk_to_str, atalk_str_len, NULL, atalk_col_filter_str, atalk_len, NULL, NULL);
|
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)
|
|
|
|
{
|
2003-11-16 23:17:27 +00:00
|
|
|
dissector_handle_t 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;
|
2016-10-26 16:07:47 +00:00
|
|
|
capture_dissector_handle_t llap_cap_handle;
|
2001-12-03 04:00:26 +00:00
|
|
|
|
2015-12-09 03:49:44 +00:00
|
|
|
ddp_short_handle = create_dissector_handle(dissect_ddp_short, proto_ddp);
|
|
|
|
ddp_handle = create_dissector_handle(dissect_ddp, proto_ddp);
|
2010-12-20 05:35:29 +00:00
|
|
|
dissector_add_uint("ethertype", ETHERTYPE_ATALK, ddp_handle);
|
2013-09-11 21:37:58 +00:00
|
|
|
dissector_add_uint("chdlc.protocol", ETHERTYPE_ATALK, ddp_handle);
|
2010-12-20 05:35:29 +00:00
|
|
|
dissector_add_uint("ppp.protocol", PPP_AT, ddp_handle);
|
|
|
|
dissector_add_uint("null.type", BSD_AF_APPLETALK, ddp_handle);
|
|
|
|
dissector_add_uint("arcnet.protocol_id", ARCNET_PROTO_APPLETALK, ddp_handle);
|
2001-12-03 04:00:26 +00:00
|
|
|
|
2015-12-09 03:49:44 +00:00
|
|
|
nbp_handle = create_dissector_handle(dissect_nbp, proto_nbp);
|
2010-12-20 05:35:29 +00:00
|
|
|
dissector_add_uint("ddp.type", DDP_NBP, nbp_handle);
|
2016-10-05 20:33:54 +00:00
|
|
|
dissector_add_for_decode_as_with_preference("udp.port", nbp_handle);
|
2001-12-03 04:00:26 +00:00
|
|
|
|
2015-12-09 03:49:44 +00:00
|
|
|
atp_handle = create_dissector_handle(dissect_atp, proto_atp);
|
2010-12-20 05:35:29 +00:00
|
|
|
dissector_add_uint("ddp.type", DDP_ATP, atp_handle);
|
2002-04-25 23:58:02 +00:00
|
|
|
|
2015-12-09 03:49:44 +00:00
|
|
|
asp_handle = create_dissector_handle(dissect_asp, proto_asp);
|
|
|
|
pap_handle = create_dissector_handle(dissect_pap, proto_pap);
|
2002-04-25 23:58:02 +00:00
|
|
|
|
2015-12-09 03:49:44 +00:00
|
|
|
rtmp_request_handle = create_dissector_handle(dissect_rtmp_request, proto_rtmp);
|
|
|
|
rtmp_data_handle = create_dissector_handle(dissect_rtmp_data, proto_rtmp);
|
2010-12-20 05:35:29 +00:00
|
|
|
dissector_add_uint("ddp.type", DDP_RTMPREQ, rtmp_request_handle);
|
|
|
|
dissector_add_uint("ddp.type", DDP_RTMPDATA, rtmp_data_handle);
|
2001-12-03 04:00:26 +00:00
|
|
|
|
2015-12-09 03:49:44 +00:00
|
|
|
zip_ddp_handle = create_dissector_handle(dissect_ddp_zip, proto_zip);
|
2010-12-20 05:35:29 +00:00
|
|
|
dissector_add_uint("ddp.type", DDP_ZIP, zip_ddp_handle);
|
2002-06-29 21:27:39 +00:00
|
|
|
|
2015-12-09 03:49:44 +00:00
|
|
|
zip_atp_handle = create_dissector_handle(dissect_atp_zip, proto_zip);
|
2002-06-29 21:27:39 +00:00
|
|
|
|
2015-12-09 03:49:44 +00:00
|
|
|
llap_handle = create_dissector_handle(dissect_llap, proto_llap);
|
2010-12-20 05:35:29 +00:00
|
|
|
dissector_add_uint("wtap_encap", WTAP_ENCAP_LOCALTALK, llap_handle);
|
2016-10-26 16:07:47 +00:00
|
|
|
llap_cap_handle = create_capture_dissector_handle(capture_llap, proto_llap);
|
|
|
|
capture_dissector_add_uint("wtap_encap", WTAP_ENCAP_LOCALTALK, llap_cap_handle);
|
2001-12-03 04:00:26 +00:00
|
|
|
|
2002-05-03 21:25:43 +00:00
|
|
|
register_init_routine( atp_init);
|
2015-06-28 23:02:45 +00:00
|
|
|
register_cleanup_routine( atp_cleanup);
|
2002-04-25 23:58:02 +00:00
|
|
|
register_init_routine( &asp_reinit);
|
|
|
|
|
2016-03-16 13:02:52 +00:00
|
|
|
afp_handle = find_dissector_add_dependency("afp", proto_asp);
|
|
|
|
afp_server_status_handle = find_dissector_add_dependency("afp_server_status", proto_asp);
|
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
|
|
|
}
|
2009-07-23 21:25:02 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Editor modelines - http://www.wireshark.org/tools/modelines.html
|
|
|
|
*
|
|
|
|
* Local variables:
|
|
|
|
* c-basic-offset: 2
|
|
|
|
* tab-width: 8
|
|
|
|
* indent-tabs-mode: nil
|
|
|
|
* End:
|
|
|
|
*
|
2011-09-21 16:28:53 +00:00
|
|
|
* vi: set shiftwidth=2 tabstop=8 expandtab:
|
2009-07-23 21:25:02 +00:00
|
|
|
* :indentSize=4:tabSize=8:noTabs=true:
|
|
|
|
*/
|