2 * Routines for Aruba ADP header disassembly
6 * Giles Scott < gscott <at> arubanetworks dot com>
8 * Wireshark - Network traffic analyzer
9 * By Gerald Combs <gerald@wireshark.org>
10 * Copyright 1998 Gerald Combs
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, write to the Free Software
24 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
30 #include <epan/packet.h>
31 #include <epan/addr_resolv.h>
33 #define UDP_PORT_ADP 8200
35 #define ADP_RESPONSE 2
37 void proto_register_aruba_adp(void);
38 void proto_reg_handoff_aruba_adp(void);
40 static int proto_aruba_adp
= -1;
41 static gint ett_aruba_adp
= -1;
43 static int hf_adp_version
= -1;
44 static int hf_adp_type
= -1;
45 static int hf_adp_id
= -1;
46 static int hf_adp_mac
= -1;
47 static int hf_adp_switchip
= -1;
49 static const value_string adp_type_val
[] =
57 dissect_aruba_adp(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
)
59 proto_tree
*ti
= NULL
;
60 proto_tree
*aruba_adp_tree
= NULL
;
63 const gchar
*switchip
;
66 col_set_str(pinfo
->cinfo
, COL_PROTOCOL
, "ADP");
67 col_clear(pinfo
->cinfo
, COL_INFO
);
71 ti
= proto_tree_add_item(tree
, proto_aruba_adp
, tvb
, 0, 0, ENC_NA
);
72 aruba_adp_tree
= proto_item_add_subtree(ti
, ett_aruba_adp
);
74 proto_tree_add_item(aruba_adp_tree
, hf_adp_version
, tvb
, 0, 2, ENC_BIG_ENDIAN
);
76 type
= tvb_get_ntohs(tvb
, 2);
79 proto_tree_add_item(aruba_adp_tree
, hf_adp_type
, tvb
, 2, 2, ENC_BIG_ENDIAN
);
81 proto_tree_add_item(aruba_adp_tree
, hf_adp_id
, tvb
, 4, 2, ENC_BIG_ENDIAN
);
87 proto_tree_add_item(aruba_adp_tree
, hf_adp_mac
, tvb
, 6, 6, ENC_NA
);
88 mac_str
= tvb_ether_to_str(tvb
, 6);
90 col_add_fstr(pinfo
->cinfo
, COL_INFO
, "ADP Request Src MAC: %s", mac_str
);
92 proto_item_append_text(ti
, ", Request Src MAC: %s", mac_str
);
97 proto_tree_add_item(aruba_adp_tree
, hf_adp_switchip
, tvb
, 6, 4, ENC_BIG_ENDIAN
);
98 switchip
= tvb_ip_to_str(tvb
, 6);
100 col_add_fstr(pinfo
->cinfo
, COL_INFO
, "ADP Response Switch IP: %s", switchip
);
102 proto_item_append_text(ti
, ", Response Switch IP: %s", switchip
);
112 proto_register_aruba_adp(void)
114 static hf_register_info hf
[] = {
116 { "Version", "adp.version", FT_UINT16
, BASE_DEC
, NULL
,0x0,
117 "ADP version", HFILL
}},
120 { "Type", "adp.type", FT_UINT16
, BASE_DEC
, VALS(adp_type_val
), 0x0,
124 { "Transaction ID", "adp.id", FT_UINT16
, BASE_DEC
, NULL
, 0x0,
125 "ADP transaction ID", HFILL
}},
128 { "MAC address", "adp.mac", FT_ETHER
, BASE_NONE
, NULL
, 0x0,
132 { "Switch IP", "adp.switch", FT_IPv4
, BASE_NONE
, NULL
, 0x0,
133 "Switch IP address", HFILL
}},
137 static gint
*ett
[] = {
141 proto_aruba_adp
= proto_register_protocol("Aruba Discovery Protocol",
143 proto_register_field_array(proto_aruba_adp
, hf
, array_length(hf
));
144 proto_register_subtree_array(ett
, array_length(ett
));
149 proto_reg_handoff_aruba_adp(void)
151 dissector_handle_t adp_handle
;
153 adp_handle
= create_dissector_handle(dissect_aruba_adp
, proto_aruba_adp
);
154 dissector_add_uint("udp.port", UDP_PORT_ADP
, adp_handle
);
163 * indent-tabs-mode: nil
166 * ex: set shiftwidth=2 tabstop=8 expandtab:
167 * :indentSize=2:tabSize=8:noTabs=true: