2 * Routines for Intel ANS probe dissection
6 * Ethereal - Network traffic analyzer
7 * By Gerald Combs <gerald@ethereal.com>
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>
53 #include <epan/proto.h>
56 /* Initialize the protocol and registered fields */
57 static int proto_ans = -1;
59 static int hf_ans_app_id = -1;
60 static int hf_ans_rev_id = -1;
61 static int hf_ans_seq_num = -1;
62 static int hf_ans_sender_id = -1;
63 static int hf_ans_team_id = -1;
65 /* Initialize the subtree pointers */
66 static gint ett_ans = -1;
68 /* Code to actually dissect the packets */
70 dissect_ans(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
73 proto_tree *ans_tree = NULL;
78 if (check_col(pinfo->cinfo, COL_PROTOCOL))
79 col_set_str(pinfo->cinfo, COL_PROTOCOL, "Intel ANS probe");
81 if (check_col(pinfo->cinfo, COL_INFO)) {
82 col_clear(pinfo->cinfo, COL_INFO);
84 seq_num = tvb_get_ntohl(tvb, 4);
85 sender_id = tvb_get_ntohs(tvb, 8);
86 tvb_memcpy(tvb, team_id, 10, 6);
88 col_append_fstr(pinfo->cinfo, COL_INFO, "Sequence: %u, Sender ID %u, Team ID %s",
89 seq_num, sender_id, ether_to_str(team_id));
93 ti = proto_tree_add_item(tree, proto_ans, tvb, 0, -1, FALSE);
94 ans_tree = proto_item_add_subtree(ti, ett_ans);
96 proto_tree_add_item(ans_tree, hf_ans_app_id, tvb, 0, 2, FALSE);
97 proto_tree_add_item(ans_tree, hf_ans_rev_id, tvb, 2, 2, FALSE);
98 proto_tree_add_item(ans_tree, hf_ans_seq_num, tvb, 4, 4, FALSE);
99 proto_tree_add_item(ans_tree, hf_ans_sender_id, tvb, 8, 2, FALSE);
100 proto_tree_add_item(ans_tree, hf_ans_team_id, tvb, 10, 6, FALSE);
106 proto_register_ans(void)
108 static hf_register_info hf[] = {
110 { "Application ID", "ans.app_id",
111 FT_UINT16, BASE_HEX, NULL, 0,
112 "Intel ANS Application ID", HFILL }
115 { "Revision ID", "ans.rev_id",
116 FT_UINT16, BASE_HEX, NULL, 0,
117 "Intel ANS Revision ID", HFILL }
120 { "Sequence Number", "ans.seq_num",
121 FT_UINT32, BASE_DEC, NULL, 0,
122 "Intel ANS Sequence Number", HFILL }
125 { "Sender ID", "ans.sender_id",
126 FT_UINT16, BASE_DEC, NULL, 0,
127 "Intel ANS Sender ID", HFILL }
130 { "Team ID", "ans.team_id",
131 FT_ETHER, BASE_HEX, NULL, 0,
132 "Intel ANS Team ID", HFILL }
136 static gint *ett[] = {
140 proto_ans = proto_register_protocol("Intel ANS probe", "ANS", "ans");
141 proto_register_field_array(proto_ans, hf, array_length(hf));
142 proto_register_subtree_array(ett, array_length(ett));
147 proto_reg_handoff_ans(void)
149 dissector_handle_t ans_handle;
151 ans_handle = create_dissector_handle(dissect_ans, proto_ans);
152 dissector_add("ethertype", ETHERTYPE_INTEL_ANS, ans_handle);