Revert "TODO epan/dissectors/asn1/kerberos/packet-kerberos-template.c new GSS flags"
[wireshark-sm.git] / epan / dissectors / packet-ans.c
bloba658365b61414a454f26442f891d92790f2b08d1
1 /* packet-ans.c
2 * Routines for Intel ANS probe dissection
4 * Wireshark - Network traffic analyzer
5 * By Gerald Combs <gerald@wireshark.org>
6 * Copyright 2003 Gerald Combs
8 * SPDX-License-Identifier: GPL-2.0-or-later
10 * The following information was graciously provided by Intel:
11 * Offset Size (bytes) Contents
12 * 0 6 Destination Broadcast probes: {FF,FF,FF,FF,FF,FF}
13 * Multicast probes: {01,AA,00,00,00,00}
14 * 6 6 Source Matches the CurrentMACAddress of the
15 * adapter sending the probe.
16 * 8 2 Type Network order is 0x886D, Intel's reserved
17 * packet type.
18 * 10 (0) 2 ApplicationID Network order is 0x0001, identifies
19 * it as fault tolerance probe.
20 * 12 (2) 2 RevID Network order, identifies the revision id
21 * of Teaming software.
22 * 16 (4) 4 ProbeSequenceNumber Ascending sequence number
23 * that identifies the current probing cycle.
24 * 20 (8) 2 SenderID Unique ID within a team identifying
25 * the member that originally sent the probe.
26 * 22 (10) 6 TeamID Unique ID identifying the team in charge
27 * of this probe.
28 * 28 Padding Reserved
32 #include "config.h"
34 #include <epan/packet.h>
35 #include <epan/to_str.h>
36 #include <epan/etypes.h>
38 void proto_register_ans(void);
39 void proto_reg_handoff_ans(void);
41 static dissector_handle_t ans_handle;
43 /* Initialize the protocol and registered fields */
44 static int proto_ans;
46 static int hf_ans_app_id;
47 static int hf_ans_rev_id;
48 static int hf_ans_seq_num;
49 static int hf_ans_sender_id;
50 static int hf_ans_team_id;
52 /* Initialize the subtree pointers */
53 static int ett_ans;
55 /* Code to actually dissect the packets */
56 static int
57 dissect_ans(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
59 proto_item *ti;
60 proto_tree *ans_tree;
61 uint16_t sender_id;
62 uint32_t seq_num;
64 col_set_str(pinfo->cinfo, COL_PROTOCOL, "Intel ANS probe");
66 seq_num = tvb_get_ntohl(tvb, 4);
67 sender_id = tvb_get_ntohs(tvb, 8);
69 col_add_fstr(pinfo->cinfo, COL_INFO, "Sequence: %u, Sender ID %u, Team ID %s",
70 seq_num, sender_id, tvb_ether_to_str(pinfo->pool, tvb, 10));
72 ti = proto_tree_add_item(tree, proto_ans, tvb, 0, -1, ENC_NA);
73 ans_tree = proto_item_add_subtree(ti, ett_ans);
75 proto_tree_add_item(ans_tree, hf_ans_app_id, tvb, 0, 2, ENC_BIG_ENDIAN);
76 proto_tree_add_item(ans_tree, hf_ans_rev_id, tvb, 2, 2, ENC_BIG_ENDIAN);
77 proto_tree_add_item(ans_tree, hf_ans_seq_num, tvb, 4, 4, ENC_BIG_ENDIAN);
78 proto_tree_add_item(ans_tree, hf_ans_sender_id, tvb, 8, 2, ENC_BIG_ENDIAN);
79 proto_tree_add_item(ans_tree, hf_ans_team_id, tvb, 10, 6, ENC_NA);
81 return tvb_captured_length(tvb);
85 void
86 proto_register_ans(void)
88 static hf_register_info hf[] = {
89 { &hf_ans_app_id,
90 { "Application ID", "ans.app_id",
91 FT_UINT16, BASE_HEX, NULL, 0,
92 "Intel ANS Application ID", HFILL }
94 { &hf_ans_rev_id,
95 { "Revision ID", "ans.rev_id",
96 FT_UINT16, BASE_HEX, NULL, 0,
97 "Intel ANS Revision ID", HFILL }
99 { &hf_ans_seq_num,
100 { "Sequence Number", "ans.seq_num",
101 FT_UINT32, BASE_DEC, NULL, 0,
102 "Intel ANS Sequence Number", HFILL }
104 { &hf_ans_sender_id,
105 { "Sender ID", "ans.sender_id",
106 FT_UINT16, BASE_DEC, NULL, 0,
107 "Intel ANS Sender ID", HFILL }
109 { &hf_ans_team_id,
110 { "Team ID", "ans.team_id",
111 FT_ETHER, BASE_NONE, NULL, 0,
112 "Intel ANS Team ID", HFILL }
116 static int *ett[] = {
117 &ett_ans,
120 proto_ans = proto_register_protocol("Intel ANS probe", "ANS", "ans");
121 proto_register_field_array(proto_ans, hf, array_length(hf));
122 proto_register_subtree_array(ett, array_length(ett));
124 ans_handle = register_dissector("ans", dissect_ans, proto_ans);
128 void
129 proto_reg_handoff_ans(void)
131 dissector_add_uint("ethertype", ETHERTYPE_INTEL_ANS, ans_handle);
135 * Editor modelines - https://www.wireshark.org/tools/modelines.html
137 * Local variables:
138 * c-basic-offset: 8
139 * tab-width: 8
140 * indent-tabs-mode: t
141 * End:
143 * vi: set shiftwidth=8 tabstop=8 noexpandtab:
144 * :indentSize=8:tabSize=8:noTabs=false: