aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-arp.c
diff options
context:
space:
mode:
authorJörg Mayer <jmayer@loplof.de>2009-05-21 05:15:03 +0000
committerJörg Mayer <jmayer@loplof.de>2009-05-21 05:15:03 +0000
commit61d5b442f4042f4480e21191111150e8aecfa64b (patch)
treef1f34a94c82ccf3395a3ab4a651a79777f370032 /epan/dissectors/packet-arp.c
parent19a0011c59691053568397d94ba8199b738aa165 (diff)
Add filterable generated item arp.isgratuitous. Inspired
by question on wireshark-users ML by wireshark.20090520@tozer.org.uk svn path=/trunk/; revision=28436
Diffstat (limited to 'epan/dissectors/packet-arp.c')
-rw-r--r--epan/dissectors/packet-arp.c77
1 files changed, 43 insertions, 34 deletions
diff --git a/epan/dissectors/packet-arp.c b/epan/dissectors/packet-arp.c
index 71a47c1a93..9eafb9b4a2 100644
--- a/epan/dissectors/packet-arp.c
+++ b/epan/dissectors/packet-arp.c
@@ -49,6 +49,7 @@ static int hf_atmarp_sst = -1;
static int hf_atmarp_ssl = -1;
static int hf_arp_proto_size = -1;
static int hf_arp_opcode = -1;
+static int hf_arp_isgratuitous = -1;
static int hf_atmarp_spln = -1;
static int hf_atmarp_tht = -1;
static int hf_atmarp_thl = -1;
@@ -785,6 +786,7 @@ dissect_atmarp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_tree_add_uint(arp_tree, hf_arp_opcode, tvb, AR_OP, 2, ar_op);
+
proto_tree_add_uint(arp_tree, hf_atmarp_spln, tvb, ATM_AR_SPLN, 1, ar_spln);
tl = proto_tree_add_text(arp_tree, tvb, ATM_AR_THTL, 1,
@@ -857,7 +859,7 @@ dissect_arp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
guint16 ar_op;
int tot_len;
proto_tree *arp_tree = NULL;
- proto_item *ti;
+ proto_item *ti, *item;
const gchar *op_str;
int sha_offset, spa_offset, tha_offset, tpa_offset;
const guint8 *sha_val, *spa_val, *tha_val, *tpa_val;
@@ -1062,6 +1064,8 @@ dissect_arp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_tree_add_uint(arp_tree, hf_arp_hard_size, tvb, AR_HLN, 1, ar_hln);
proto_tree_add_uint(arp_tree, hf_arp_proto_size, tvb, AR_PLN, 1, ar_pln);
proto_tree_add_uint(arp_tree, hf_arp_opcode, tvb, AR_OP, 2, ar_op);
+ item = proto_tree_add_boolean(arp_tree, hf_arp_isgratuitous, tvb, AR_OP, 2, is_gratuitous);
+ PROTO_ITEM_SET_GENERATED(item);
if (ar_hln != 0) {
proto_tree_add_item(arp_tree,
ARP_HW_IS_ETHER(ar_hrd, ar_hln) ?
@@ -1117,167 +1121,172 @@ proto_register_arp(void)
{ &hf_arp_hard_type,
{ "Hardware type", "arp.hw.type",
FT_UINT16, BASE_HEX, VALS(hrd_vals), 0x0,
- "", HFILL }},
+ NULL, HFILL }},
{ &hf_arp_proto_type,
{ "Protocol type", "arp.proto.type",
FT_UINT16, BASE_HEX, VALS(etype_vals), 0x0,
- "", HFILL }},
+ NULL, HFILL }},
{ &hf_arp_hard_size,
{ "Hardware size", "arp.hw.size",
FT_UINT8, BASE_DEC, NULL, 0x0,
- "", HFILL }},
+ NULL, HFILL }},
{ &hf_atmarp_sht,
{ "Sender ATM number type", "arp.src.htype",
FT_BOOLEAN, 8, TFS(&tfs_type_bit), ATMARP_IS_E164,
- "", HFILL }},
+ NULL, HFILL }},
{ &hf_atmarp_shl,
{ "Sender ATM number length", "arp.src.hlen",
FT_UINT8, BASE_DEC, NULL, ATMARP_LEN_MASK,
- "", HFILL }},
+ NULL, HFILL }},
{ &hf_atmarp_sst,
{ "Sender ATM subaddress type", "arp.src.stype",
FT_BOOLEAN, 8, TFS(&tfs_type_bit), ATMARP_IS_E164,
- "", HFILL }},
+ NULL, HFILL }},
{ &hf_atmarp_ssl,
{ "Sender ATM subaddress length", "arp.src.slen",
FT_UINT8, BASE_DEC, NULL, ATMARP_LEN_MASK,
- "", HFILL }},
+ NULL, HFILL }},
{ &hf_arp_proto_size,
{ "Protocol size", "arp.proto.size",
FT_UINT8, BASE_DEC, NULL, 0x0,
- "", HFILL }},
+ NULL, HFILL }},
{ &hf_arp_opcode,
{ "Opcode", "arp.opcode",
FT_UINT16, BASE_HEX, VALS(op_vals), 0x0,
- "", HFILL }},
+ NULL, HFILL }},
+
+ { &hf_arp_isgratuitous,
+ { "Is gratuitous", "arp.isgratuitous",
+ FT_BOOLEAN, BASE_NONE, TFS(&tfs_true_false), 0x0,
+ NULL, HFILL }},
{ &hf_atmarp_spln,
{ "Sender protocol size", "arp.src.pln",
FT_UINT8, BASE_DEC, NULL, 0x0,
- "", HFILL }},
+ NULL, HFILL }},
{ &hf_atmarp_tht,
{ "Target ATM number type", "arp.dst.htype",
FT_BOOLEAN, 8, TFS(&tfs_type_bit), ATMARP_IS_E164,
- "", HFILL }},
+ NULL, HFILL }},
{ &hf_atmarp_thl,
{ "Target ATM number length", "arp.dst.hlen",
FT_UINT8, BASE_DEC, NULL, ATMARP_LEN_MASK,
- "", HFILL }},
+ NULL, HFILL }},
{ &hf_atmarp_tst,
{ "Target ATM subaddress type", "arp.dst.stype",
FT_BOOLEAN, 8, TFS(&tfs_type_bit), ATMARP_IS_E164,
- "", HFILL }},
+ NULL, HFILL }},
{ &hf_atmarp_tsl,
{ "Target ATM subaddress length", "arp.dst.slen",
FT_UINT8, BASE_DEC, NULL, ATMARP_LEN_MASK,
- "", HFILL }},
+ NULL, HFILL }},
{ &hf_atmarp_tpln,
{ "Target protocol size", "arp.dst.pln",
FT_UINT8, BASE_DEC, NULL, 0x0,
- "", HFILL }},
+ NULL, HFILL }},
{ &hf_arp_src_hw,
{ "Sender hardware address", "arp.src.hw",
FT_BYTES, BASE_NONE, NULL, 0x0,
- "", HFILL }},
+ NULL, HFILL }},
{ &hf_arp_src_hw_mac,
{ "Sender MAC address", "arp.src.hw_mac",
FT_ETHER, BASE_NONE, NULL, 0x0,
- "", HFILL }},
+ NULL, HFILL }},
{ &hf_atmarp_src_atm_num_e164,
{ "Sender ATM number (E.164)", "arp.src.atm_num_e164",
FT_STRING, BASE_NONE, NULL, 0x0,
- "", HFILL }},
+ NULL, HFILL }},
{ &hf_atmarp_src_atm_num_nsap,
{ "Sender ATM number (NSAP)", "arp.src.atm_num_nsap",
FT_BYTES, BASE_NONE, NULL, 0x0,
- "", HFILL }},
+ NULL, HFILL }},
{ &hf_atmarp_src_atm_subaddr,
{ "Sender ATM subaddress", "arp.src.atm_subaddr",
FT_BYTES, BASE_NONE, NULL, 0x0,
- "", HFILL }},
+ NULL, HFILL }},
{ &hf_arp_src_proto,
{ "Sender protocol address", "arp.src.proto",
FT_BYTES, BASE_NONE, NULL, 0x0,
- "", HFILL }},
+ NULL, HFILL }},
{ &hf_arp_src_proto_ipv4,
{ "Sender IP address", "arp.src.proto_ipv4",
FT_IPv4, BASE_NONE, NULL, 0x0,
- "", HFILL }},
+ NULL, HFILL }},
{ &hf_arp_dst_hw,
{ "Target hardware address", "arp.dst.hw",
FT_BYTES, BASE_NONE, NULL, 0x0,
- "", HFILL }},
+ NULL, HFILL }},
{ &hf_arp_dst_hw_mac,
{ "Target MAC address", "arp.dst.hw_mac",
FT_ETHER, BASE_NONE, NULL, 0x0,
- "", HFILL }},
+ NULL, HFILL }},
{ &hf_atmarp_dst_atm_num_e164,
{ "Target ATM number (E.164)", "arp.dst.atm_num_e164",
FT_STRING, BASE_NONE, NULL, 0x0,
- "", HFILL }},
+ NULL, HFILL }},
{ &hf_atmarp_dst_atm_num_nsap,
{ "Target ATM number (NSAP)", "arp.dst.atm_num_nsap",
FT_BYTES, BASE_NONE, NULL, 0x0,
- "", HFILL }},
+ NULL, HFILL }},
{ &hf_atmarp_dst_atm_subaddr,
{ "Target ATM subaddress", "arp.dst.atm_subaddr",
FT_BYTES, BASE_NONE, NULL, 0x0,
- "", HFILL }},
+ NULL, HFILL }},
{ &hf_arp_dst_proto,
{ "Target protocol address", "arp.dst.proto",
FT_BYTES, BASE_NONE, NULL, 0x0,
- "", HFILL }},
+ NULL, HFILL }},
{ &hf_arp_dst_proto_ipv4,
{ "Target IP address", "arp.dst.proto_ipv4",
FT_IPv4, BASE_NONE, NULL, 0x0,
- "", HFILL }},
+ NULL, HFILL }},
{ &hf_arp_packet_storm,
{ "Packet storm detected", "arp.packet-storm-detected",
FT_NONE, BASE_NONE, NULL, 0x0,
- "", HFILL }},
+ NULL, HFILL }},
{ &hf_arp_duplicate_ip_address,
{ "Duplicate IP address detected", "arp.duplicate-address-detected",
FT_NONE, BASE_NONE, NULL, 0x0,
- "", HFILL }},
+ NULL, HFILL }},
{ &hf_arp_duplicate_ip_address_earlier_frame,
{ "Frame showing earlier use of IP address", "arp.duplicate-address-frame",
FT_FRAMENUM, BASE_NONE, NULL, 0x0,
- "", HFILL }},
+ NULL, HFILL }},
{ &hf_arp_duplicate_ip_address_seconds_since_earlier_frame,
{ "Seconds since earlier frame seen", "arp.seconds-since-duplicate-address-frame",
FT_UINT32, BASE_DEC, NULL, 0x0,
- "", HFILL }},
+ NULL, HFILL }},
};