1998-10-16 01:18:35 +00:00
|
|
|
/* packet-aarp.c
|
|
|
|
* Routines for Appletalk ARP packet disassembly
|
|
|
|
*
|
|
|
|
* 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
|
|
|
|
*
|
2018-02-12 11:23:27 +00:00
|
|
|
* SPDX-License-Identifier: GPL-2.0-or-later
|
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-01-21 07:37:49 +00:00
|
|
|
#include <epan/packet.h>
|
2005-09-17 00:02:31 +00:00
|
|
|
#include <epan/etypes.h>
|
2019-04-02 00:51:22 +00:00
|
|
|
#include <epan/expert.h>
|
2013-11-09 13:41:10 +00:00
|
|
|
#include <epan/to_str.h>
|
1998-10-16 01:18:35 +00:00
|
|
|
|
2013-03-12 20:00:50 +00:00
|
|
|
/* Forward declarations */
|
|
|
|
void proto_register_aarp(void);
|
|
|
|
void proto_reg_handoff_aarp(void);
|
|
|
|
|
1999-07-29 05:47:07 +00:00
|
|
|
static int proto_aarp = -1;
|
1999-10-03 15:06:28 +00:00
|
|
|
static int hf_aarp_hard_type = -1;
|
|
|
|
static int hf_aarp_proto_type = -1;
|
|
|
|
static int hf_aarp_hard_size = -1;
|
|
|
|
static int hf_aarp_proto_size = -1;
|
|
|
|
static int hf_aarp_opcode = -1;
|
2002-02-10 23:48:14 +00:00
|
|
|
static int hf_aarp_src_hw = -1;
|
|
|
|
static int hf_aarp_src_hw_mac = -1;
|
|
|
|
static int hf_aarp_src_proto = -1;
|
|
|
|
static int hf_aarp_src_proto_id = -1;
|
|
|
|
static int hf_aarp_dst_hw = -1;
|
|
|
|
static int hf_aarp_dst_hw_mac = -1;
|
|
|
|
static int hf_aarp_dst_proto = -1;
|
|
|
|
static int hf_aarp_dst_proto_id = -1;
|
1999-07-29 05:47:07 +00:00
|
|
|
|
1999-11-16 11:44:20 +00:00
|
|
|
static gint ett_aarp = -1;
|
|
|
|
|
2019-04-02 00:51:22 +00:00
|
|
|
static expert_field ei_aarp_length_invalid = EI_INIT;
|
|
|
|
|
1998-10-16 01:18:35 +00:00
|
|
|
#ifndef AARP_REQUEST
|
2014-10-05 19:57:05 +00:00
|
|
|
#define AARP_REQUEST 0x0001
|
1998-10-16 01:18:35 +00:00
|
|
|
#endif
|
|
|
|
#ifndef AARP_REPLY
|
2014-10-05 19:57:05 +00:00
|
|
|
#define AARP_REPLY 0x0002
|
1998-10-16 01:18:35 +00:00
|
|
|
#endif
|
2002-08-28 21:04:11 +00:00
|
|
|
#ifndef AARP_PROBE
|
2014-10-05 19:57:05 +00:00
|
|
|
#define AARP_PROBE 0x0003
|
1998-10-16 01:18:35 +00:00
|
|
|
#endif
|
|
|
|
|
1999-12-10 00:45:15 +00:00
|
|
|
/* The following is screwed up shit to deal with the fact that
|
|
|
|
the linux kernel edits the packet inline. */
|
|
|
|
#define AARP_REQUEST_SWAPPED 0x0100
|
|
|
|
#define AARP_REPLY_SWAPPED 0x0200
|
|
|
|
#define AARP_PROBE_SWAPPED 0x0300
|
|
|
|
|
1999-11-04 08:21:04 +00:00
|
|
|
static const value_string op_vals[] = {
|
1999-12-08 18:12:06 +00:00
|
|
|
{AARP_REQUEST, "request" },
|
|
|
|
{AARP_REPLY, "reply" },
|
|
|
|
{AARP_PROBE, "probe" },
|
1999-12-10 00:45:15 +00:00
|
|
|
{AARP_REQUEST_SWAPPED, "request" },
|
|
|
|
{AARP_REPLY_SWAPPED, "reply" },
|
|
|
|
{AARP_PROBE_SWAPPED, "probe" },
|
1999-11-04 08:21:04 +00:00
|
|
|
{0, NULL } };
|
|
|
|
|
|
|
|
/* AARP protocol HARDWARE identifiers. */
|
2014-10-05 19:57:05 +00:00
|
|
|
#define AARPHRD_ETHER 1 /* Ethernet 10Mbps */
|
|
|
|
#define AARPHRD_TR 2 /* Token Ring */
|
1999-11-04 08:21:04 +00:00
|
|
|
|
|
|
|
static const value_string hrd_vals[] = {
|
|
|
|
{AARPHRD_ETHER, "Ethernet" },
|
|
|
|
{AARPHRD_TR, "Token Ring" },
|
|
|
|
{0, NULL } };
|
|
|
|
|
2002-02-10 23:48:14 +00:00
|
|
|
/*
|
|
|
|
* Given the hardware address type and length, check whether an address
|
|
|
|
* is an Ethernet address - the address must be of type "Ethernet" or
|
|
|
|
* "Token Ring", and the length must be 6 bytes.
|
|
|
|
*/
|
|
|
|
#define AARP_HW_IS_ETHER(ar_hrd, ar_hln) \
|
2014-10-05 19:57:05 +00:00
|
|
|
(((ar_hrd) == AARPHRD_ETHER || (ar_hrd) == AARPHRD_TR) \
|
|
|
|
&& (ar_hln) == 6)
|
2002-02-10 23:48:14 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Given the protocol address type and length, check whether an address
|
|
|
|
* is an Appletalk address - the address must be of type "Appletalk",
|
|
|
|
* and the length must be 4 bytes.
|
|
|
|
*/
|
|
|
|
#define AARP_PRO_IS_ATALK(ar_pro, ar_pln) \
|
2014-10-05 19:57:05 +00:00
|
|
|
((ar_pro) == ETHERTYPE_ATALK && (ar_pln) == 4)
|
2002-02-10 23:48:14 +00:00
|
|
|
|
1999-11-04 08:21:04 +00:00
|
|
|
static gchar *
|
2011-02-16 02:55:58 +00:00
|
|
|
tvb_atalkid_to_str(tvbuff_t *tvb, gint offset)
|
|
|
|
{
|
1998-10-16 01:18:35 +00:00
|
|
|
gint node;
|
2005-08-17 09:25:04 +00:00
|
|
|
gchar *cur;
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2013-04-24 00:01:45 +00:00
|
|
|
cur=(gchar *)wmem_alloc(wmem_packet_scope(), 16);
|
2014-12-22 03:30:46 +00:00
|
|
|
node=tvb_get_guint8(tvb, offset+1)<<8|tvb_get_guint8(tvb, offset+2);
|
|
|
|
g_snprintf(cur, 16, "%d.%d",node,tvb_get_guint8(tvb, offset+3));
|
1998-10-16 01:18:35 +00:00
|
|
|
return cur;
|
|
|
|
}
|
1999-11-04 08:21:04 +00:00
|
|
|
|
2012-12-26 05:57:06 +00:00
|
|
|
static const gchar *
|
2011-02-16 02:55:58 +00:00
|
|
|
tvb_aarphrdaddr_to_str(tvbuff_t *tvb, gint offset, int ad_len, guint16 type)
|
|
|
|
{
|
2002-02-10 23:48:14 +00:00
|
|
|
if (AARP_HW_IS_ETHER(type, ad_len)) {
|
1999-11-04 08:21:04 +00:00
|
|
|
/* Ethernet address (or Token Ring address, which is the same type
|
|
|
|
of address). */
|
2011-02-16 02:55:58 +00:00
|
|
|
return tvb_ether_to_str(tvb, offset);
|
1999-11-04 08:21:04 +00:00
|
|
|
}
|
2015-01-07 15:11:22 +00:00
|
|
|
return tvb_bytes_to_str(wmem_packet_scope(), tvb, offset, ad_len);
|
1999-11-04 08:21:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static gchar *
|
2011-02-16 02:55:58 +00:00
|
|
|
tvb_aarpproaddr_to_str(tvbuff_t *tvb, gint offset, int ad_len, guint16 type)
|
|
|
|
{
|
2002-02-10 23:48:14 +00:00
|
|
|
if (AARP_PRO_IS_ATALK(type, ad_len)) {
|
|
|
|
/* Appletalk address. */
|
2011-02-16 02:55:58 +00:00
|
|
|
return tvb_atalkid_to_str(tvb, offset);
|
1999-11-04 08:21:04 +00:00
|
|
|
}
|
2015-01-07 15:11:22 +00:00
|
|
|
return tvb_bytes_to_str(wmem_packet_scope(), tvb, offset, ad_len);
|
1999-11-04 08:21:04 +00:00
|
|
|
}
|
2002-08-28 21:04:11 +00:00
|
|
|
|
1999-11-04 08:21:04 +00:00
|
|
|
/* Offsets of fields within an AARP packet. */
|
2014-10-05 19:57:05 +00:00
|
|
|
#define AR_HRD 0
|
|
|
|
#define AR_PRO 2
|
|
|
|
#define AR_HLN 4
|
|
|
|
#define AR_PLN 5
|
|
|
|
#define AR_OP 6
|
|
|
|
#define MIN_AARP_HEADER_SIZE 8
|
1999-11-04 08:21:04 +00:00
|
|
|
|
2015-11-15 13:00:10 +00:00
|
|
|
static int
|
|
|
|
dissect_aarp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) {
|
1999-11-04 08:21:04 +00:00
|
|
|
guint16 ar_hrd;
|
|
|
|
guint16 ar_pro;
|
|
|
|
guint8 ar_hln;
|
|
|
|
guint8 ar_pln;
|
|
|
|
guint16 ar_op;
|
|
|
|
proto_tree *aarp_tree;
|
|
|
|
proto_item *ti;
|
2005-06-26 19:56:52 +00:00
|
|
|
const gchar *op_str;
|
1999-11-04 08:21:04 +00:00
|
|
|
int sha_offset, spa_offset, tha_offset, tpa_offset;
|
2012-12-26 05:57:06 +00:00
|
|
|
const gchar *sha_str, *spa_str, /* *tha_str, */ *tpa_str;
|
1999-11-04 08:21:04 +00:00
|
|
|
|
2009-08-09 06:26:46 +00:00
|
|
|
col_set_str(pinfo->cinfo, COL_PROTOCOL, "AARP");
|
2009-08-09 07:36:13 +00:00
|
|
|
col_clear(pinfo->cinfo, COL_INFO);
|
1999-10-03 15:21:11 +00:00
|
|
|
|
2000-11-13 04:26:53 +00:00
|
|
|
ar_hrd = tvb_get_ntohs(tvb, AR_HRD);
|
|
|
|
ar_pro = tvb_get_ntohs(tvb, AR_PRO);
|
|
|
|
ar_hln = tvb_get_guint8(tvb, AR_HLN);
|
|
|
|
ar_pln = tvb_get_guint8(tvb, AR_PLN);
|
|
|
|
ar_op = tvb_get_ntohs(tvb, AR_OP);
|
1999-11-04 08:21:04 +00:00
|
|
|
|
2002-02-10 23:48:14 +00:00
|
|
|
/* Get the offsets of the addresses. */
|
2000-11-13 04:26:53 +00:00
|
|
|
sha_offset = MIN_AARP_HEADER_SIZE;
|
2002-02-10 23:48:14 +00:00
|
|
|
spa_offset = sha_offset + ar_hln;
|
|
|
|
tha_offset = spa_offset + ar_pln;
|
|
|
|
tpa_offset = tha_offset + ar_hln;
|
|
|
|
|
|
|
|
/* Extract the addresses. */
|
2019-04-02 00:51:22 +00:00
|
|
|
|
|
|
|
if (ar_hln < 1) {
|
|
|
|
expert_add_info_format(pinfo, tree, &ei_aarp_length_invalid,
|
|
|
|
"Invalid hardware address length: %d", ar_hln);
|
|
|
|
sha_str = "Unknown";
|
|
|
|
#if 0
|
|
|
|
tha_str = "Unknown";
|
|
|
|
#endif
|
|
|
|
} else {
|
|
|
|
sha_str = tvb_aarphrdaddr_to_str(tvb, sha_offset, ar_hln, ar_hrd);
|
2011-04-27 05:02:47 +00:00
|
|
|
#if 0
|
2019-04-02 00:51:22 +00:00
|
|
|
/* TODO: tha_str is currently not shown nor parsed */
|
|
|
|
tha_str = tvb_aarphrdaddr_to_str(tvb, tha_offset, ar_hln, ar_hrd);
|
2011-04-27 05:02:47 +00:00
|
|
|
#endif
|
2019-04-02 00:51:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (ar_pln < 1) {
|
|
|
|
expert_add_info_format(pinfo, tree, &ei_aarp_length_invalid,
|
|
|
|
"Invalid protocol address length: %d", ar_pln);
|
|
|
|
spa_str = "Unknown";
|
|
|
|
tpa_str = "Unknown";
|
|
|
|
} else {
|
|
|
|
spa_str = tvb_aarpproaddr_to_str(tvb, spa_offset, ar_pln, ar_pro);
|
|
|
|
tpa_str = tvb_aarpproaddr_to_str(tvb, tpa_offset, ar_pln, ar_pro);
|
|
|
|
}
|
2002-02-10 23:48:14 +00:00
|
|
|
|
2010-03-03 13:52:17 +00:00
|
|
|
switch (ar_op) {
|
|
|
|
case AARP_REQUEST:
|
|
|
|
case AARP_REQUEST_SWAPPED:
|
|
|
|
col_add_fstr(pinfo->cinfo, COL_INFO, "Who has %s? Tell %s", tpa_str, spa_str);
|
|
|
|
break;
|
|
|
|
case AARP_REPLY:
|
|
|
|
case AARP_REPLY_SWAPPED:
|
|
|
|
col_add_fstr(pinfo->cinfo, COL_INFO, "%s is at %s", spa_str, sha_str);
|
|
|
|
break;
|
|
|
|
case AARP_PROBE:
|
|
|
|
case AARP_PROBE_SWAPPED:
|
|
|
|
col_add_fstr(pinfo->cinfo, COL_INFO, "Is there a %s", tpa_str);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
col_add_fstr(pinfo->cinfo, COL_INFO, "Unknown AARP opcode 0x%04x", ar_op);
|
|
|
|
break;
|
1998-10-16 01:18:35 +00:00
|
|
|
}
|
1999-11-04 08:21:04 +00:00
|
|
|
|
|
|
|
if (tree) {
|
2013-03-29 00:26:23 +00:00
|
|
|
if ((op_str = try_val_to_str(ar_op, op_vals)))
|
2000-11-13 04:26:53 +00:00
|
|
|
ti = proto_tree_add_protocol_format(tree, proto_aarp, tvb, 0,
|
2014-10-05 19:57:05 +00:00
|
|
|
MIN_AARP_HEADER_SIZE + 2*ar_hln +
|
|
|
|
2*ar_pln, "AppleTalk Address Resolution Protocol (%s)", op_str);
|
1999-11-04 08:21:04 +00:00
|
|
|
else
|
2000-11-13 04:26:53 +00:00
|
|
|
ti = proto_tree_add_protocol_format(tree, proto_aarp, tvb, 0,
|
2014-10-05 19:57:05 +00:00
|
|
|
MIN_AARP_HEADER_SIZE + 2*ar_hln +
|
|
|
|
2*ar_pln,
|
|
|
|
"AppleTalk Address Resolution Protocol (opcode 0x%04x)", ar_op);
|
1999-11-16 11:44:20 +00:00
|
|
|
aarp_tree = proto_item_add_subtree(ti, ett_aarp);
|
2000-11-13 04:26:53 +00:00
|
|
|
proto_tree_add_uint(aarp_tree, hf_aarp_hard_type, tvb, AR_HRD, 2,
|
2014-10-05 19:57:05 +00:00
|
|
|
ar_hrd);
|
2002-08-28 21:04:11 +00:00
|
|
|
proto_tree_add_uint(aarp_tree, hf_aarp_proto_type, tvb, AR_PRO, 2,
|
2014-10-05 19:57:05 +00:00
|
|
|
ar_pro);
|
2000-11-13 04:26:53 +00:00
|
|
|
proto_tree_add_uint(aarp_tree, hf_aarp_hard_size, tvb, AR_HLN, 1,
|
2014-10-05 19:57:05 +00:00
|
|
|
ar_hln);
|
2000-11-13 04:26:53 +00:00
|
|
|
proto_tree_add_uint(aarp_tree, hf_aarp_proto_size, tvb, AR_PLN, 1,
|
2014-10-05 19:57:05 +00:00
|
|
|
ar_pln);
|
2000-11-13 04:26:53 +00:00
|
|
|
proto_tree_add_uint(aarp_tree, hf_aarp_opcode, tvb, AR_OP, 2,
|
2014-10-05 19:57:05 +00:00
|
|
|
ar_op);
|
2002-02-10 23:48:14 +00:00
|
|
|
if (ar_hln != 0) {
|
|
|
|
proto_tree_add_item(aarp_tree,
|
2014-10-05 19:57:05 +00:00
|
|
|
AARP_HW_IS_ETHER(ar_hrd, ar_hln) ? hf_aarp_src_hw_mac : hf_aarp_src_hw,
|
|
|
|
tvb, sha_offset, ar_hln, ENC_NA);
|
2002-02-10 23:48:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (ar_pln != 0) {
|
|
|
|
if (AARP_PRO_IS_ATALK(ar_pro, ar_pln)) {
|
2006-02-16 11:43:38 +00:00
|
|
|
proto_tree_add_bytes_format_value(aarp_tree, hf_aarp_src_proto_id, tvb,
|
2014-10-05 19:57:05 +00:00
|
|
|
spa_offset, ar_pln, NULL,
|
|
|
|
"%s", spa_str);
|
2002-08-28 21:04:11 +00:00
|
|
|
} else {
|
2006-02-16 11:43:38 +00:00
|
|
|
proto_tree_add_bytes_format_value(aarp_tree, hf_aarp_src_proto, tvb,
|
2014-10-05 19:57:05 +00:00
|
|
|
spa_offset, ar_pln, NULL,
|
|
|
|
"%s", spa_str);
|
2002-02-10 23:48:14 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (ar_hln != 0) {
|
|
|
|
proto_tree_add_item(aarp_tree,
|
2014-10-05 19:57:05 +00:00
|
|
|
AARP_HW_IS_ETHER(ar_hrd, ar_hln) ? hf_aarp_dst_hw_mac : hf_aarp_dst_hw,
|
|
|
|
tvb, tha_offset, ar_hln, ENC_NA);
|
2002-02-10 23:48:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (ar_pln != 0) {
|
|
|
|
if (AARP_PRO_IS_ATALK(ar_pro, ar_pln)) {
|
2006-02-16 11:43:38 +00:00
|
|
|
proto_tree_add_bytes_format_value(aarp_tree, hf_aarp_dst_proto_id, tvb,
|
2014-10-05 19:57:05 +00:00
|
|
|
tpa_offset, ar_pln,
|
|
|
|
NULL, "%s", tpa_str);
|
2002-02-10 23:48:14 +00:00
|
|
|
} else {
|
2006-02-16 11:43:38 +00:00
|
|
|
proto_tree_add_bytes_format_value(aarp_tree, hf_aarp_dst_proto, tvb,
|
2014-10-05 19:57:05 +00:00
|
|
|
tpa_offset, ar_pln,
|
|
|
|
NULL, "%s", tpa_str);
|
2002-02-10 23:48:14 +00:00
|
|
|
}
|
|
|
|
}
|
1999-11-04 08:21:04 +00:00
|
|
|
}
|
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
|
|
|
|
|
|
|
void
|
|
|
|
proto_register_aarp(void)
|
|
|
|
{
|
1999-10-03 15:06:28 +00:00
|
|
|
static hf_register_info hf[] = {
|
|
|
|
{ &hf_aarp_hard_type,
|
2014-10-05 19:57:05 +00:00
|
|
|
{ "Hardware type", "aarp.hard.type",
|
|
|
|
FT_UINT16, BASE_HEX, VALS(hrd_vals), 0x0,
|
|
|
|
NULL, HFILL }},
|
1999-10-12 06:21:15 +00:00
|
|
|
|
1999-10-03 15:06:28 +00:00
|
|
|
{ &hf_aarp_proto_type,
|
2014-10-05 19:57:05 +00:00
|
|
|
{ "Protocol type", "aarp.proto.type",
|
|
|
|
FT_UINT16, BASE_HEX, VALS(etype_vals), 0x0,
|
|
|
|
NULL, HFILL }},
|
1999-10-12 06:21:15 +00:00
|
|
|
|
1999-10-03 15:06:28 +00:00
|
|
|
{ &hf_aarp_hard_size,
|
2014-10-05 19:57:05 +00:00
|
|
|
{ "Hardware size", "aarp.hard.size",
|
|
|
|
FT_UINT8, BASE_DEC, NULL, 0x0,
|
|
|
|
NULL, HFILL }},
|
1999-10-12 06:21:15 +00:00
|
|
|
|
1999-10-03 15:06:28 +00:00
|
|
|
{ &hf_aarp_proto_size,
|
2014-10-05 19:57:05 +00:00
|
|
|
{ "Protocol size", "aarp.proto.size",
|
|
|
|
FT_UINT8, BASE_DEC, NULL, 0x0,
|
|
|
|
NULL, HFILL }},
|
1999-10-12 06:21:15 +00:00
|
|
|
|
1999-10-03 15:06:28 +00:00
|
|
|
{ &hf_aarp_opcode,
|
2014-10-05 19:57:05 +00:00
|
|
|
{ "Opcode", "aarp.opcode",
|
|
|
|
FT_UINT16, BASE_DEC, VALS(op_vals), 0x0,
|
|
|
|
NULL, HFILL }},
|
1999-10-12 06:21:15 +00:00
|
|
|
|
2002-02-10 23:48:14 +00:00
|
|
|
{ &hf_aarp_src_hw,
|
2014-10-05 19:57:05 +00:00
|
|
|
{ "Sender hardware address", "aarp.src.hw",
|
|
|
|
FT_BYTES, BASE_NONE, NULL, 0x0,
|
|
|
|
NULL, HFILL }},
|
2002-02-10 23:48:14 +00:00
|
|
|
|
|
|
|
{ &hf_aarp_src_hw_mac,
|
2014-10-05 19:57:05 +00:00
|
|
|
{ "Sender MAC address", "aarp.src.hw_mac",
|
|
|
|
FT_ETHER, BASE_NONE, NULL, 0x0,
|
|
|
|
NULL, HFILL }},
|
2002-02-10 23:48:14 +00:00
|
|
|
|
|
|
|
{ &hf_aarp_src_proto,
|
2014-10-05 19:57:05 +00:00
|
|
|
{ "Sender protocol address", "aarp.src.proto",
|
|
|
|
FT_BYTES, BASE_NONE, NULL, 0x0,
|
|
|
|
NULL, HFILL }},
|
1999-10-12 06:21:15 +00:00
|
|
|
|
2002-02-10 23:48:14 +00:00
|
|
|
{ &hf_aarp_src_proto_id,
|
2014-10-05 19:57:05 +00:00
|
|
|
{ "Sender ID", "aarp.src.proto_id",
|
|
|
|
FT_BYTES, BASE_NONE, NULL, 0x0,
|
|
|
|
NULL, HFILL }},
|
1999-10-12 06:21:15 +00:00
|
|
|
|
2002-02-10 23:48:14 +00:00
|
|
|
{ &hf_aarp_dst_hw,
|
2014-10-05 19:57:05 +00:00
|
|
|
{ "Target hardware address", "aarp.dst.hw",
|
|
|
|
FT_BYTES, BASE_NONE, NULL, 0x0,
|
|
|
|
NULL, HFILL }},
|
1999-10-12 06:21:15 +00:00
|
|
|
|
2002-02-10 23:48:14 +00:00
|
|
|
{ &hf_aarp_dst_hw_mac,
|
2014-10-05 19:57:05 +00:00
|
|
|
{ "Target MAC address", "aarp.dst.hw_mac",
|
|
|
|
FT_ETHER, BASE_NONE, NULL, 0x0,
|
|
|
|
NULL, HFILL }},
|
2002-02-10 23:48:14 +00:00
|
|
|
|
|
|
|
{ &hf_aarp_dst_proto,
|
2014-10-05 19:57:05 +00:00
|
|
|
{ "Target protocol address", "aarp.dst.proto",
|
|
|
|
FT_BYTES, BASE_NONE, NULL, 0x0,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, HFILL }},
|
2002-02-10 23:48:14 +00:00
|
|
|
|
|
|
|
{ &hf_aarp_dst_proto_id,
|
2014-10-05 19:57:05 +00:00
|
|
|
{ "Target ID", "aarp.dst.proto_id",
|
|
|
|
FT_BYTES, BASE_NONE, NULL, 0x0,
|
|
|
|
NULL, HFILL }},
|
1999-10-03 15:06:28 +00:00
|
|
|
};
|
1999-11-16 11:44:20 +00:00
|
|
|
static gint *ett[] = {
|
|
|
|
&ett_aarp,
|
|
|
|
};
|
1999-07-29 05:47:07 +00:00
|
|
|
|
2019-04-02 00:51:22 +00:00
|
|
|
static ei_register_info ei[] = {
|
|
|
|
{ &ei_aarp_length_invalid, { "aarp.length.invalid", PI_PROTOCOL, PI_WARN, "Invalid length", EXPFILL }},
|
|
|
|
};
|
|
|
|
|
1999-10-03 15:06:28 +00:00
|
|
|
proto_aarp = proto_register_protocol("Appletalk Address Resolution Protocol",
|
2014-10-05 19:57:05 +00:00
|
|
|
"AARP",
|
|
|
|
"aarp");
|
1999-10-03 15:06:28 +00:00
|
|
|
proto_register_field_array(proto_aarp, hf, array_length(hf));
|
1999-11-16 11:44:20 +00:00
|
|
|
proto_register_subtree_array(ett, array_length(ett));
|
2019-04-02 00:51:22 +00:00
|
|
|
|
|
|
|
expert_module_t* expert_aarp = expert_register_protocol(proto_aarp);
|
|
|
|
expert_register_field_array(expert_aarp, ei, array_length(ei));
|
|
|
|
|
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_aarp(void)
|
|
|
|
{
|
2001-12-03 04:00:26 +00:00
|
|
|
dissector_handle_t aarp_handle;
|
|
|
|
|
2015-12-09 03:49:44 +00:00
|
|
|
aarp_handle = create_dissector_handle(dissect_aarp, proto_aarp);
|
2010-12-20 05:35:29 +00:00
|
|
|
dissector_add_uint("ethertype", ETHERTYPE_AARP, aarp_handle);
|
2013-09-11 21:37:58 +00:00
|
|
|
dissector_add_uint("chdlc.protocol", ETHERTYPE_AARP, aarp_handle);
|
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
|
|
|
}
|
2014-10-05 19:57:05 +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:
|
|
|
|
*
|
|
|
|
* ex: set shiftwidth=2 tabstop=8 expandtab:
|
|
|
|
* :indentSize=2:tabSize=8:noTabs=true:
|
|
|
|
*/
|