2 * Routines for Intel ANS probe dissection
6 * Wireshark - Network traffic analyzer
7 * By Gerald Combs <gerald@wireshark.org>
8 * Copyright 2003 Gerald Combs
10 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License
12 * as published by the Free Software Foundation; either version 2
13 * of the License, or (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
24 * The following information was graciously provided by Intel:
25 * Offset Size (bytes) Contents
26 * 0 6 Destination Broadcast probes: {FF,FF,FF,FF,FF,FF}
27 * Multicast probes: {01,AA,00,00,00,00}
28 * 6 6 Source Matches the CurrentMACAddress of the
29 * adapter sending the probe.
30 * 8 2 Type Network order is 0x886D, Intel's reserved
32 * 10 (0) 2 ApplicationID Network order is 0x0001, identifies
33 * it as fault tolerance probe.
34 * 12 (2) 2 RevID Network order, identifies the revision id
35 * of Teaming software.
36 * 16 (4) 4 ProbeSequenceNumber Ascending sequence number
37 * that identifies the current probing cycle.
38 * 20 (8) 2 SenderID Unique ID within a team identifying
39 * the member that originally sent the probe.
40 * 22 (10) 6 TeamID Unique ID identifying the team in charge
52 #include <epan/packet.h>
55 /* Initialize the protocol and registered fields */
56 static int proto_ans = -1;
58 static int hf_ans_app_id = -1;
59 static int hf_ans_rev_id = -1;
60 static int hf_ans_seq_num = -1;
61 static int hf_ans_sender_id = -1;
62 static int hf_ans_team_id = -1;
64 /* Initialize the subtree pointers */
65 static gint ett_ans = -1;
67 /* Code to actually dissect the packets */
69 dissect_ans(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
72 proto_tree *ans_tree = NULL;
77 col_set_str(pinfo->cinfo, COL_PROTOCOL, "Intel ANS probe");
79 seq_num = tvb_get_ntohl(tvb, 4);
80 sender_id = tvb_get_ntohs(tvb, 8);
81 tvb_memcpy(tvb, team_id, 10, 6);
83 col_add_fstr(pinfo->cinfo, COL_INFO, "Sequence: %u, Sender ID %u, Team ID %s",
84 seq_num, sender_id, ether_to_str(team_id));
87 ti = proto_tree_add_item(tree, proto_ans, tvb, 0, -1, ENC_BIG_ENDIAN);
88 ans_tree = proto_item_add_subtree(ti, ett_ans);
90 proto_tree_add_item(ans_tree, hf_ans_app_id, tvb, 0, 2, ENC_BIG_ENDIAN);
91 proto_tree_add_item(ans_tree, hf_ans_rev_id, tvb, 2, 2, ENC_BIG_ENDIAN);
92 proto_tree_add_item(ans_tree, hf_ans_seq_num, tvb, 4, 4, ENC_BIG_ENDIAN);
93 proto_tree_add_item(ans_tree, hf_ans_sender_id, tvb, 8, 2, ENC_BIG_ENDIAN);
94 proto_tree_add_item(ans_tree, hf_ans_team_id, tvb, 10, 6, ENC_NA);
100 proto_register_ans(void)
102 static hf_register_info hf[] = {
104 { "Application ID", "ans.app_id",
105 FT_UINT16, BASE_HEX, NULL, 0,
106 "Intel ANS Application ID", HFILL }
109 { "Revision ID", "ans.rev_id",
110 FT_UINT16, BASE_HEX, NULL, 0,
111 "Intel ANS Revision ID", HFILL }
114 { "Sequence Number", "ans.seq_num",
115 FT_UINT32, BASE_DEC, NULL, 0,
116 "Intel ANS Sequence Number", HFILL }
119 { "Sender ID", "ans.sender_id",
120 FT_UINT16, BASE_DEC, NULL, 0,
121 "Intel ANS Sender ID", HFILL }
124 { "Team ID", "ans.team_id",
125 FT_ETHER, BASE_NONE, NULL, 0,
126 "Intel ANS Team ID", HFILL }
130 static gint *ett[] = {
134 proto_ans = proto_register_protocol("Intel ANS probe", "ANS", "ans");
135 proto_register_field_array(proto_ans, hf, array_length(hf));
136 proto_register_subtree_array(ett, array_length(ett));
141 proto_reg_handoff_ans(void)
143 dissector_handle_t ans_handle;
145 ans_handle = create_dissector_handle(dissect_ans, proto_ans);
146 dissector_add_uint("ethertype", ETHERTYPE_INTEL_ANS, ans_handle);