/src/wireshark/epan/dissectors/packet-aruba-papi.c
Line | Count | Source |
1 | | /* packet-aruba-papi.c |
2 | | * Routines for Aruba PAPI dissection |
3 | | * Copyright 2010, Alexis La Goutte <alexis.lagoutte at gmail dot com> |
4 | | * |
5 | | * Real name of PAPI : Protocol Application Program Interface |
6 | | * Wireshark - Network traffic analyzer |
7 | | * By Gerald Combs <gerald@wireshark.org> |
8 | | * Copyright 1998 Gerald Combs |
9 | | * |
10 | | * SPDX-License-Identifier: GPL-2.0-or-later |
11 | | */ |
12 | | |
13 | | #include "config.h" |
14 | | |
15 | | #include <epan/packet.h> |
16 | | #include <epan/prefs.h> |
17 | | #include <epan/expert.h> |
18 | | #include <epan/addr_resolv.h> |
19 | | #include "packet-ipv6.h" |
20 | | |
21 | | /* This is not IANA assigned nor registered */ |
22 | 16 | #define UDP_PORT_PAPI 8211 |
23 | | |
24 | | void proto_register_papi(void); |
25 | | void proto_reg_handoff_papi(void); |
26 | | |
27 | | static dissector_handle_t papi_handle; |
28 | | |
29 | | /* Initialize the protocol and registered fields */ |
30 | | static int proto_papi; |
31 | | static int hf_papi_hdr_magic; |
32 | | static int hf_papi_hdr_version; |
33 | | static int hf_papi_hdr_dest_ip; |
34 | | static int hf_papi_hdr_src_ip; |
35 | | static int hf_papi_hdr_nat_port_number; |
36 | | static int hf_papi_hdr_garbage; |
37 | | static int hf_papi_hdr_dest_port; |
38 | | static int hf_papi_hdr_src_port; |
39 | | static int hf_papi_hdr_packet_type; |
40 | | static int hf_papi_hdr_packet_size; |
41 | | static int hf_papi_hdr_seq_number; |
42 | | static int hf_papi_hdr_message_code; |
43 | | static int hf_papi_hdr_checksum; |
44 | | |
45 | | static int hf_papi_hdr_srcipv6; |
46 | | static int hf_papi_hdr_destipv6; |
47 | | |
48 | | static int hf_papi_debug; |
49 | | static int hf_papi_debug_text; |
50 | | static int hf_papi_debug_text_length; |
51 | | static int hf_papi_debug_48bits; |
52 | | static int hf_papi_debug_8bits; |
53 | | static int hf_papi_debug_16bits; |
54 | | static int hf_papi_debug_32bits; |
55 | | static int hf_papi_debug_ipv4; |
56 | | static int hf_papi_debug_64bits; |
57 | | static int hf_papi_debug_bytes; |
58 | | static int hf_papi_debug_bytes_length; |
59 | | |
60 | | static int hf_papi_licmgr; |
61 | | static int hf_papi_licmgr_payload_len; |
62 | | static int hf_papi_licmgr_tlv; |
63 | | static int hf_papi_licmgr_type; |
64 | | static int hf_papi_licmgr_length; |
65 | | static int hf_papi_licmgr_value; |
66 | | static int hf_papi_licmgr_ip; |
67 | | static int hf_papi_licmgr_serial_number; |
68 | | static int hf_papi_licmgr_hostname; |
69 | | static int hf_papi_licmgr_mac_address; |
70 | | static int hf_papi_licmgr_license_ap_remaining; |
71 | | static int hf_papi_licmgr_license_pef_remaining; |
72 | | static int hf_papi_licmgr_license_rfp_remaining; |
73 | | static int hf_papi_licmgr_license_xsec_remaining; |
74 | | static int hf_papi_licmgr_license_acr_remaining; |
75 | | static int hf_papi_licmgr_license_ap_used; |
76 | | static int hf_papi_licmgr_license_pef_used; |
77 | | static int hf_papi_licmgr_license_rfp_used; |
78 | | static int hf_papi_licmgr_license_xsec_used; |
79 | | static int hf_papi_licmgr_license_acr_used; |
80 | | static int hf_papi_licmgr_padding; |
81 | | |
82 | | static expert_field ei_papi_debug_unknown; |
83 | | |
84 | | /* variable for dissector table for subdissectors */ |
85 | | static dissector_table_t papi_dissector_table; |
86 | | |
87 | | /* Global PAPI Debug Preference */ |
88 | | static bool g_papi_debug; |
89 | | |
90 | | /* Initialize the subtree pointers */ |
91 | | static int ett_papi; |
92 | | static int ett_papi_licmgr; |
93 | | static int ett_papi_licmgr_tlv; |
94 | | |
95 | | #define SAMBA_WRAPPER 8442 |
96 | | #define RESOLVER_PORT 8392 |
97 | | #define PB_INT_TASK 8448 |
98 | | #define STATION_MANAGEMENT_LOPRI 8419 |
99 | | #define MOBILE_IP 8383 |
100 | | #define SIBYTE_FASTPATH_PORT 8355 |
101 | | #define WLAN_MANAGEMENT_SERVER 8224 |
102 | | #define SIBYTE_CONSOLE_CLIENT2 8357 |
103 | | #define AUTH_SERVER_LOPRI 8420 |
104 | | #define MOB_FASTPATH_PORT 8354 |
105 | | #define SAP_RRAD_PORT 8382 |
106 | | #define REPGEN 8418 |
107 | | #define RAPPER_PORT2 8424 |
108 | | #define IKE_DAEMON_RAW 8232 |
109 | | #define STATION_MANAGEMENT 8345 |
110 | | #define PPPD_START 8241 |
111 | | #define SETUP_DIALOG 8434 |
112 | | #define WEB_GRAPHGEN1 8346 |
113 | | #define SNMP_TRAP_RAW 8402 |
114 | | #define ARUBA_NTPD 8377 |
115 | | #define STATION_MANAGEMENT_LOPRI_AP 8452 |
116 | | #define CLI_LOG_RAW 8364 |
117 | | #define AUTH_SERVER_RAW 8227 |
118 | | #define RAPPER_PORT5 8427 |
119 | | #define MESH_DAEMON 8433 |
120 | | #define PHONE_HOME 8437 |
121 | | #define FPCLI_SIBYTE_CONSOLE2 8368 |
122 | | #define FASTPATH_WEB_CLIENT 8218 |
123 | | #define SERVER_LOAD_BALANCING 8384 |
124 | | #define IKE_DAEMON 8231 |
125 | | #define CPSEC 8453 |
126 | | #define MOBILITY_CLIENT 8217 |
127 | | #define SNMP_TRAPMGR 8363 |
128 | | #define PIM_TOSIBYTE 8416 |
129 | | #define RAPPER_PORT9 8431 |
130 | | #define CERT_MANAGER_MASTER 8353 |
131 | | #define MISC_PROC 8445 |
132 | | #define PPPD_END 8340 |
133 | | #define SYSMGR 8450 |
134 | | #define RAPPER_PORT6 8428 |
135 | | #define RRA_SERVER 8238 |
136 | | #define NANNY_PORT_MEM_MON 8371 |
137 | | #define SYS_MAPPER_LOPRI 8435 |
138 | | #define RAPPER_PORT4 8426 |
139 | | #define SAPM_HYBRID_AP 8436 |
140 | | #define FASTPATH_CLI_CLIENT 8213 |
141 | | #define CFGM_RAW 8362 |
142 | | #define SPOTMGR 8398 |
143 | | #define SYSLOGDWRAP 8407 |
144 | | #define WEBS_AM_PORT 8352 |
145 | | #define QPDQ_STANDALONE 8401 |
146 | | #define FPCLI_RAW 8361 |
147 | | #define VRRP_DAEMON 8391 |
148 | | #define AMAP_MGMT_PORT 8395 |
149 | | #define CAP_MGMT_PORT 8351 |
150 | | #define SAPM_SERVER 8222 |
151 | | #define PPPD_DAEMON 8234 |
152 | | #define LAST_SERVICE 8999 |
153 | | #define DHCP_SERVER 8390 |
154 | | #define ADMINSERVER 8403 |
155 | | #define SYS_MAPPER 8396 |
156 | | #define PUBSUB_SERVER 8378 |
157 | | #define AMAPI_SNMP_TRAP_CLIENT 8440 |
158 | | #define PPTPD 8341 |
159 | | #define SIBYTE_CONSOLE_PORT 8348 |
160 | | #define SNMP_DAEMON 8219 |
161 | | #define SIBYTE_DNLD_FILE 8374 |
162 | | #define UTILITY_PROCESS 8449 |
163 | | #define SAPM_RAPCP 8438 |
164 | | #define SIBYTE_MACH_INFO 8386 |
165 | | #define SIBYTE_CONSOLE_CLIENT1 8356 |
166 | | #define SWKEY 8373 |
167 | | #define RF_CLIENT 8410 |
168 | | #define HAMGR 8408 |
169 | | #define FASTPATH_CLI_SERVER 8239 |
170 | | #define FASTPATH_AUTH_CLIENT 8360 |
171 | | #define CRYPTO_POST_PORT 8400 |
172 | | #define HTTPD_WRAP 8404 |
173 | | #define MMSCONFIGMGR 8412 |
174 | | #define FPAPPS_AUTH_PORT 8381 |
175 | | #define FPWEB_RAW 8415 |
176 | | #define L2TPD 8342 |
177 | | #define CERT_CLIENT 8349 |
178 | | #define SIBYTE_RAW 8228 |
179 | | #define FPAPPS_VRRP_PORT 8379 |
180 | | #define AIR_MONITOR 8225 |
181 | | #define ANOMALY_DETECTION 8387 |
182 | | #define ARUBA_FILTER 8388 |
183 | | #define MSGH_HELPER 8446 |
184 | | #define FASTPATH_SERVER 8212 |
185 | | #define MOBILITY_AGENT 8229 |
186 | | #define OSPF_DAEMON 8441 |
187 | | #define PIM 8385 |
188 | | #define MOBILITY_SERVER 8216 |
189 | | #define SIBYTE_CONSOLE_CLIENT3 8358 |
190 | | #define FPCLI_SIBYTE_CONSOLE1 8367 |
191 | | #define AUTH_CLIENT 8215 |
192 | | #define FPCLI_SIBYTE_CONSOLE3 8369 |
193 | | #define AMAPI_SAMPLE_CLIENT 8221 |
194 | | #define PPPOE_DAEMON 8411 |
195 | | #define UDB_SERVER 8344 |
196 | | #define RAPPER_PORT1 8423 |
197 | | #define PAPI_EPHEMERAL 65535 |
198 | | #define MVC_SERVER 8422 |
199 | | #define RAPPER_PORT3 8425 |
200 | | #define DHCP_DAEMON 8359 |
201 | | #define EMWEB_RAW 8365 |
202 | | #define STATSMGR 8397 |
203 | | #define FASTPATH_ADD_SERVER 8240 |
204 | | #define AMAPI_CLI_CLIENT 8220 |
205 | | #define AUTH_SERVER 8214 |
206 | | #define MESSAGE_HANDLER 8999 |
207 | | #define AMAP_PROC 8394 |
208 | | #define CTS 8413 |
209 | | #define CFGMANAGER 8226 |
210 | | #define RAPPER_PORT8 8430 |
211 | | #define L2TPD_DAEMON_RAW 8233 |
212 | | #define WLAN_MANAGEMENT_SERVER_LOPRI 8421 |
213 | | #define NANNY_PORT 8370 |
214 | | #define RAPPER_PORT10 8432 |
215 | | #define RAPPER_PORT7 8429 |
216 | | #define AMAPI_WEB_CLIENT 8235 |
217 | | #define WEB_CLI_RAW 8375 |
218 | | #define CERT_MANAGER 8343 |
219 | | #define NCFGTEST_APP 8406 |
220 | | #define REM_DSLMGR 8439 |
221 | | #define PROFILE_MANAGER 8405 |
222 | 16 | #define LICENSE_MANAGER 8389 |
223 | | #define MMSWEBSVC 8414 |
224 | | #define SSH_AUTH_PORT 8393 |
225 | | #define STATION_MANAGEMENT_AP 8451 |
226 | | #define AMP_SERVER 8444 |
227 | | #define HTTPD_WRAP_AUTH_PORT 8417 |
228 | | #define FAULTMGR 8399 |
229 | | #define SIBYTE_HEARTBEAT 8237 |
230 | | #define USBHELPER_CLIENT 8447 |
231 | | #define SAPM_CLIENT 8223 |
232 | | #define RF_MANAGER 8409 |
233 | | #define WEB_GRAPHGEN2 8347 |
234 | | #define HARDWARE_MONITOR_PORT 8366 |
235 | | #define P8MGR 8454 |
236 | | #define WIRED_MAC_LOOKUP 8376 |
237 | | #define CDP_PROC 8350 |
238 | | #define AAA_MGMT_PORT 8372 |
239 | | #define DBSYNC_PORT 8380 |
240 | | #define AMAPI_SNMP_CLIENT 8236 |
241 | | #define PORT_UBT 15560 |
242 | | |
243 | | /* defining Packet Size & HDR version no for PAPI */ |
244 | 1 | #define PAPI_PACKET_SIZE 76 |
245 | 1 | #define V4V6_HDR_VERSION 0x03 |
246 | | |
247 | | static const value_string papi_port_vals[] = { |
248 | | { FASTPATH_SERVER, "FASTPATH_SERVER" }, |
249 | | { FASTPATH_CLI_CLIENT, "FASTPATH_CLI_CLIENT" }, |
250 | | { AUTH_SERVER, "AUTH_SERVER" }, |
251 | | { AUTH_CLIENT, "AUTH_CLIENT" }, |
252 | | { MOBILITY_SERVER, "MOBILITY_SERVER" }, |
253 | | { MOBILITY_CLIENT, "MOBILITY_CLIENT" }, |
254 | | { FASTPATH_WEB_CLIENT, "FASTPATH_WEB_CLIENT" }, |
255 | | { SNMP_DAEMON, "SNMP_DAEMON" }, |
256 | | { AMAPI_CLI_CLIENT, "AMAPI_CLI_CLIENT" }, |
257 | | { AMAPI_SAMPLE_CLIENT, "AMAPI_SAMPLE_CLIENT" }, |
258 | | { SAPM_SERVER, "SAPM_SERVER" }, |
259 | | { SAPM_CLIENT, "SAPM_CLIENT" }, |
260 | | { WLAN_MANAGEMENT_SERVER, "WLAN_MANAGEMENT_SERVER" }, |
261 | | { AIR_MONITOR, "AIR_MONITOR" }, |
262 | | { CFGMANAGER, "CFGMANAGER" }, |
263 | | { AUTH_SERVER_RAW, "AUTH_SERVER_RAW" }, |
264 | | { SIBYTE_RAW, "SIBYTE_RAW" }, |
265 | | { MOBILITY_AGENT, "MOBILITY_AGENT" }, |
266 | | { IKE_DAEMON, "IKE_DAEMON" }, |
267 | | { IKE_DAEMON_RAW, "IKE_DAEMON_RAW" }, |
268 | | { L2TPD_DAEMON_RAW, "L2TPD_DAEMON_RAW" }, |
269 | | { PPPD_DAEMON, "PPPD_DAEMON" }, |
270 | | { AMAPI_WEB_CLIENT, "AMAPI_WEB_CLIENT" }, |
271 | | { AMAPI_SNMP_CLIENT, "AMAPI_SNMP_CLIENT" }, |
272 | | { SIBYTE_HEARTBEAT, "SIBYTE_HEARTBEAT" }, |
273 | | { RRA_SERVER, "RRA_SERVER" }, |
274 | | { FASTPATH_CLI_SERVER, "FASTPATH_CLI_SERVER" }, |
275 | | { FASTPATH_ADD_SERVER, "FASTPATH_ADD_SERVER" }, |
276 | | { PPPD_START, "PPPD_START" }, |
277 | | { PPPD_END, "PPPD_END" }, |
278 | | { PPTPD, "PPTPD" }, |
279 | | { L2TPD, "L2TPD" }, |
280 | | { CERT_MANAGER, "CERT_MANAGER" }, |
281 | | { UDB_SERVER, "UDB_SERVER" }, |
282 | | { STATION_MANAGEMENT, "STATION_MANAGEMENT" }, |
283 | | { WEB_GRAPHGEN1, "WEB_GRAPHGEN1" }, |
284 | | { WEB_GRAPHGEN2, "WEB_GRAPHGEN2" }, |
285 | | { SIBYTE_CONSOLE_PORT, "SIBYTE_CONSOLE_PORT" }, |
286 | | { CERT_CLIENT, "CERT_CLIENT" }, |
287 | | { CDP_PROC, "CDP_PROC" }, |
288 | | { CAP_MGMT_PORT, "CAP_MGMT_PORT" }, |
289 | | { WEBS_AM_PORT, "WEBS_AM_PORT" }, |
290 | | { CERT_MANAGER_MASTER, "CERT_MANAGER_MASTER" }, |
291 | | { MOB_FASTPATH_PORT, "MOB_FASTPATH_PORT" }, |
292 | | { SIBYTE_FASTPATH_PORT, "SIBYTE_FASTPATH_PORT" }, |
293 | | { SIBYTE_CONSOLE_CLIENT1, "SIBYTE_CONSOLE_CLIENT1" }, |
294 | | { SIBYTE_CONSOLE_CLIENT2, "SIBYTE_CONSOLE_CLIENT2" }, |
295 | | { SIBYTE_CONSOLE_CLIENT3, "SIBYTE_CONSOLE_CLIENT3" }, |
296 | | { DHCP_DAEMON, "DHCP_DAEMON" }, |
297 | | { FASTPATH_AUTH_CLIENT, "FASTPATH_AUTH_CLIENT" }, |
298 | | { FPCLI_RAW, "FPCLI_RAW" }, |
299 | | { CFGM_RAW, "CFGM_RAW" }, |
300 | | { SNMP_TRAPMGR, "SNMP_TRAPMGR" }, |
301 | | { CLI_LOG_RAW, "CLI_LOG_RAW" }, |
302 | | { EMWEB_RAW, "EMWEB_RAW" }, |
303 | | { HARDWARE_MONITOR_PORT, "HARDWARE_MONITOR_PORT" }, |
304 | | { FPCLI_SIBYTE_CONSOLE1, "FPCLI_SIBYTE_CONSOLE1" }, |
305 | | { FPCLI_SIBYTE_CONSOLE2, "FPCLI_SIBYTE_CONSOLE2" }, |
306 | | { FPCLI_SIBYTE_CONSOLE3, "FPCLI_SIBYTE_CONSOLE3" }, |
307 | | { NANNY_PORT, "NANNY_PORT" }, |
308 | | { NANNY_PORT_MEM_MON, "NANNY_PORT_MEM_MON" }, |
309 | | { AAA_MGMT_PORT, "AAA_MGMT_PORT" }, |
310 | | { SWKEY, "SWKEY" }, |
311 | | { SIBYTE_DNLD_FILE, "SIBYTE_DNLD_FILE" }, |
312 | | { WEB_CLI_RAW, "WEB_CLI_RAW" }, |
313 | | { WIRED_MAC_LOOKUP, "WIRED_MAC_LOOKUP" }, |
314 | | { ARUBA_NTPD, "ARUBA_NTPD" }, |
315 | | { PUBSUB_SERVER, "PUBSUB_SERVER" }, |
316 | | { FPAPPS_VRRP_PORT, "FPAPPS_VRRP_PORT" }, |
317 | | { DBSYNC_PORT, "DBSYNC_PORT" }, |
318 | | { FPAPPS_AUTH_PORT, "FPAPPS_AUTH_PORT" }, |
319 | | { SAP_RRAD_PORT, "SAP_RRAD_PORT" }, |
320 | | { MOBILE_IP, "MOBILE_IP" }, |
321 | | { SERVER_LOAD_BALANCING, "SERVER_LOAD_BALANCING" }, |
322 | | { PIM, "PIM" }, |
323 | | { SIBYTE_MACH_INFO, "SIBYTE_MACH_INFO" }, |
324 | | { ANOMALY_DETECTION, "ANOMALY_DETECTION" }, |
325 | | { ARUBA_FILTER, "ARUBA_FILTER" }, |
326 | | { LICENSE_MANAGER, "LICENSE_MANAGER" }, |
327 | | { DHCP_SERVER, "DHCP_SERVER" }, |
328 | | { VRRP_DAEMON, "VRRP_DAEMON" }, |
329 | | { RESOLVER_PORT, "RESOLVER_PORT" }, |
330 | | { SSH_AUTH_PORT, "SSH_AUTH_PORT" }, |
331 | | { AMAP_PROC, "AMAP_PROC" }, |
332 | | { AMAP_MGMT_PORT, "AMAP_MGMT_PORT" }, |
333 | | { SYS_MAPPER, "SYS_MAPPER" }, |
334 | | { STATSMGR, "STATSMGR" }, |
335 | | { SPOTMGR, "SPOTMGR" }, |
336 | | { FAULTMGR, "FAULTMGR" }, |
337 | | { CRYPTO_POST_PORT, "CRYPTO_POST_PORT" }, |
338 | | { QPDQ_STANDALONE, "QPDQ_STANDALONE" }, |
339 | | { SNMP_TRAP_RAW, "SNMP_TRAP_RAW" }, |
340 | | { ADMINSERVER, "ADMINSERVER" }, |
341 | | { HTTPD_WRAP, "HTTPD_WRAP" }, |
342 | | { PROFILE_MANAGER, "PROFILE_MANAGER" }, |
343 | | { NCFGTEST_APP, "NCFGTEST_APP" }, |
344 | | { SYSLOGDWRAP, "SYSLOGDWRAP" }, |
345 | | { HAMGR, "HAMGR" }, |
346 | | { RF_MANAGER, "RF_MANAGER" }, |
347 | | { RF_CLIENT, "RF_CLIENT" }, |
348 | | { PPPOE_DAEMON, "PPPOE_DAEMON" }, |
349 | | { MMSCONFIGMGR, "MMSCONFIGMGR" }, |
350 | | { CTS, "CTS" }, |
351 | | { MMSWEBSVC, "MMSWEBSVC" }, |
352 | | { FPWEB_RAW, "FPWEB_RAW" }, |
353 | | { PIM_TOSIBYTE, "PIM_TOSIBYTE" }, |
354 | | { HTTPD_WRAP_AUTH_PORT, "HTTPD_WRAP_AUTH_PORT" }, |
355 | | { REPGEN, "REPGEN" }, |
356 | | { STATION_MANAGEMENT_LOPRI, "STATION_MANAGEMENT_LOPRI" }, |
357 | | { AUTH_SERVER_LOPRI, "AUTH_SERVER_LOPRI" }, |
358 | | { WLAN_MANAGEMENT_SERVER_LOPRI, "WLAN_MANAGEMENT_SERVER_LOPRI" }, |
359 | | { MVC_SERVER, "MVC_SERVER" }, |
360 | | { RAPPER_PORT1, "RAPPER_PORT1" }, |
361 | | { RAPPER_PORT2, "RAPPER_PORT2" }, |
362 | | { RAPPER_PORT3, "RAPPER_PORT3" }, |
363 | | { RAPPER_PORT4, "RAPPER_PORT4" }, |
364 | | { RAPPER_PORT5, "RAPPER_PORT5" }, |
365 | | { RAPPER_PORT6, "RAPPER_PORT6" }, |
366 | | { RAPPER_PORT7, "RAPPER_PORT7" }, |
367 | | { RAPPER_PORT8, "RAPPER_PORT8" }, |
368 | | { RAPPER_PORT9, "RAPPER_PORT9" }, |
369 | | { RAPPER_PORT10, "RAPPER_PORT10" }, |
370 | | { MESH_DAEMON, "MESH_DAEMON" }, |
371 | | { SETUP_DIALOG, "SETUP_DIALOG" }, |
372 | | { SYS_MAPPER_LOPRI, "SYS_MAPPER_LOPRI" }, |
373 | | { SAPM_HYBRID_AP, "SAPM_HYBRID_AP" }, |
374 | | { PHONE_HOME, "PHONE_HOME" }, |
375 | | { SAPM_RAPCP, "SAPM_RAPCP" }, |
376 | | { REM_DSLMGR, "REM_DSLMGR" }, |
377 | | { AMAPI_SNMP_TRAP_CLIENT, "AMAPI_SNMP_TRAP_CLIENT" }, |
378 | | { OSPF_DAEMON, "OSPF_DAEMON" }, |
379 | | { SAMBA_WRAPPER, "SAMBA_WRAPPER" }, |
380 | | { AMP_SERVER, "AMP_SERVER" }, |
381 | | { MISC_PROC, "MISC_PROC" }, |
382 | | { MSGH_HELPER, "MSGH_HELPER" }, |
383 | | { USBHELPER_CLIENT, "USBHELPER_CLIENT" }, |
384 | | { PB_INT_TASK, "PB_INT_TASK" }, |
385 | | { UTILITY_PROCESS, "UTILITY_PROCESS" }, |
386 | | { SYSMGR, "SYSMGR" }, |
387 | | { STATION_MANAGEMENT_AP, "STATION_MANAGEMENT_AP" }, |
388 | | { STATION_MANAGEMENT_LOPRI_AP, "STATION_MANAGEMENT_LOPRI_AP" }, |
389 | | { CPSEC, "CPSEC" }, |
390 | | { P8MGR, "P8MGR" }, |
391 | | { LAST_SERVICE, "LAST_SERVICE / MESSAGE_HANDLER" }, |
392 | | //{ MESSAGE_HANDLER, "MESSAGE_HANDLER" }, |
393 | | { PORT_UBT, "PORT_UBT" }, |
394 | | { PAPI_EPHEMERAL, "PAPI_EPHEMERAL" }, |
395 | | { 0, NULL } |
396 | | }; |
397 | | |
398 | | static value_string_ext papi_port_vals_ext = VALUE_STRING_EXT_INIT(papi_port_vals); |
399 | | |
400 | | /* PAPI License Manager ! */ |
401 | | static const value_string licmgr_type_vals[] = { |
402 | | { 1, "IP Address" }, |
403 | | { 2, "Serial Number" }, |
404 | | { 3, "Hostname" }, |
405 | | { 5, "Mac Address" }, |
406 | | { 7, "License AP Remaining" }, |
407 | | { 8, "License PEF Remaining" }, |
408 | | { 9, "License RFP Remaining" }, |
409 | | { 10, "License xSec Remaining " }, |
410 | | { 11, "License ACR Remaining " }, |
411 | | { 12, "License AP Used" }, |
412 | | { 13, "License PEF Used" }, |
413 | | { 14, "License AP Used" }, |
414 | | { 15, "License xSec Used" }, |
415 | | { 16, "License ACR Used" }, |
416 | | { 17, "License WebCC Key ?" }, |
417 | | { 18, "License WebCC Remaining ?" }, |
418 | | { 19, "License WebCC Used ?" }, |
419 | | { 0, NULL } |
420 | | }; |
421 | | static int |
422 | | dissect_papi_license_manager(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) |
423 | 0 | { |
424 | 0 | proto_item *ti; |
425 | 0 | proto_tree *licmgr_tree, *licmgr_subtree; |
426 | 0 | unsigned offset_end, payload_len, offset = 0; |
427 | |
|
428 | 0 | ti = proto_tree_add_item(tree, hf_papi_licmgr, tvb, offset, -1, ENC_NA); |
429 | 0 | licmgr_tree = proto_item_add_subtree(ti, ett_papi_licmgr); |
430 | |
|
431 | 0 | proto_tree_add_item_ret_uint(licmgr_tree, hf_papi_licmgr_payload_len, tvb, offset, 2, ENC_BIG_ENDIAN, &payload_len); |
432 | 0 | offset += 2; |
433 | 0 | col_set_str(pinfo->cinfo, COL_INFO, "PAPI - Licence Manager"); |
434 | |
|
435 | 0 | offset_end = offset + payload_len; |
436 | |
|
437 | 0 | while (offset< offset_end) { |
438 | 0 | unsigned optlen, type; |
439 | 0 | proto_item *tlv_item; |
440 | |
|
441 | 0 | type = tvb_get_ntohs(tvb, offset); |
442 | 0 | optlen = tvb_get_ntohs(tvb, offset+2); |
443 | 0 | tlv_item = proto_tree_add_item(licmgr_tree, hf_papi_licmgr_tlv, tvb, offset, 2+2+optlen, ENC_NA ); |
444 | |
|
445 | 0 | proto_item_append_text(tlv_item, ": (t=%d,l=%d) %s", type, optlen, val_to_str(pinfo->pool, type, licmgr_type_vals, "Unknown Type (%02d)") ); |
446 | |
|
447 | 0 | licmgr_subtree = proto_item_add_subtree(tlv_item, ett_papi_licmgr_tlv); |
448 | |
|
449 | 0 | proto_tree_add_item(licmgr_subtree, hf_papi_licmgr_type, tvb, offset, 2, ENC_BIG_ENDIAN); |
450 | 0 | offset += 2; |
451 | |
|
452 | 0 | proto_tree_add_item(licmgr_subtree, hf_papi_licmgr_length, tvb, offset, 2, ENC_BIG_ENDIAN); |
453 | 0 | offset += 2; |
454 | |
|
455 | 0 | proto_tree_add_item(licmgr_subtree, hf_papi_licmgr_value, tvb, offset, optlen, ENC_NA); |
456 | |
|
457 | 0 | switch (type) { |
458 | 0 | case 1: /* IP Address */ |
459 | 0 | proto_tree_add_item(licmgr_subtree, hf_papi_licmgr_ip, tvb, offset, 4, ENC_BIG_ENDIAN); |
460 | 0 | proto_item_append_text(tlv_item, ": %s", tvb_ip_to_str(pinfo->pool, tvb, offset)); |
461 | 0 | break; |
462 | 0 | case 2: /* Serial Number */ |
463 | 0 | proto_tree_add_item(licmgr_subtree, hf_papi_licmgr_serial_number, tvb, offset, 32, ENC_ASCII); |
464 | 0 | proto_item_append_text(tlv_item, ": %s", tvb_get_string_enc(pinfo->pool,tvb, offset, optlen, ENC_ASCII)); |
465 | 0 | break; |
466 | 0 | case 3: /* Hostname */ |
467 | 0 | proto_tree_add_item(licmgr_subtree, hf_papi_licmgr_hostname, tvb, offset, optlen, ENC_ASCII); |
468 | 0 | proto_item_append_text(tlv_item, ": %s", tvb_get_string_enc(pinfo->pool,tvb, offset, optlen, ENC_ASCII)); |
469 | 0 | break; |
470 | 0 | case 5: /* MAC Address */ |
471 | 0 | proto_tree_add_item(licmgr_subtree, hf_papi_licmgr_mac_address, tvb, offset, optlen, ENC_NA); |
472 | 0 | proto_item_append_text(tlv_item, ": %s", tvb_get_ether_name(tvb, offset)); |
473 | 0 | break; |
474 | 0 | case 7: /* License AP remaining */ |
475 | 0 | proto_tree_add_item(licmgr_subtree, hf_papi_licmgr_license_ap_remaining, tvb, offset, 4, ENC_BIG_ENDIAN); |
476 | 0 | proto_item_append_text(tlv_item, ": %u", tvb_get_ntohl(tvb, offset)); |
477 | 0 | break; |
478 | 0 | case 8: /* License PEF remaining */ |
479 | 0 | proto_tree_add_item(licmgr_subtree, hf_papi_licmgr_license_pef_remaining, tvb, offset, 4, ENC_BIG_ENDIAN); |
480 | 0 | proto_item_append_text(tlv_item, ": %u", tvb_get_ntohl(tvb, offset)); |
481 | 0 | break; |
482 | 0 | case 9: /* License RFP remaining */ |
483 | 0 | proto_tree_add_item(licmgr_subtree, hf_papi_licmgr_license_rfp_remaining, tvb, offset, 4, ENC_BIG_ENDIAN); |
484 | 0 | proto_item_append_text(tlv_item, ": %u", tvb_get_ntohl(tvb, offset)); |
485 | 0 | break; |
486 | 0 | case 10: /* License xSec remaining */ |
487 | 0 | proto_tree_add_item(licmgr_subtree, hf_papi_licmgr_license_xsec_remaining, tvb, offset, 4, ENC_BIG_ENDIAN); |
488 | 0 | proto_item_append_text(tlv_item, ": %u", tvb_get_ntohl(tvb, offset)); |
489 | 0 | break; |
490 | 0 | case 11: /* License ACR remaining */ |
491 | 0 | proto_tree_add_item(licmgr_subtree, hf_papi_licmgr_license_acr_remaining, tvb, offset, 4, ENC_BIG_ENDIAN); |
492 | 0 | proto_item_append_text(tlv_item, ": %u", tvb_get_ntohl(tvb, offset)); |
493 | 0 | break; |
494 | 0 | case 12: /* License AP used */ |
495 | 0 | proto_tree_add_item(licmgr_subtree, hf_papi_licmgr_license_ap_used, tvb, offset, 4, ENC_BIG_ENDIAN); |
496 | 0 | proto_item_append_text(tlv_item, ": %u", tvb_get_ntohl(tvb, offset)); |
497 | 0 | break; |
498 | 0 | case 13: /* License PEF used */ |
499 | 0 | proto_tree_add_item(licmgr_subtree, hf_papi_licmgr_license_pef_used, tvb, offset, 4, ENC_BIG_ENDIAN); |
500 | 0 | proto_item_append_text(tlv_item, ": %u", tvb_get_ntohl(tvb, offset)); |
501 | 0 | break; |
502 | 0 | case 14: /* License RFP used */ |
503 | 0 | proto_tree_add_item(licmgr_subtree, hf_papi_licmgr_license_rfp_used, tvb, offset, 4, ENC_BIG_ENDIAN); |
504 | 0 | proto_item_append_text(tlv_item, ": %u", tvb_get_ntohl(tvb, offset)); |
505 | 0 | break; |
506 | 0 | case 15: /* License xSec used */ |
507 | 0 | proto_tree_add_item(licmgr_subtree, hf_papi_licmgr_license_xsec_used, tvb, offset, 4, ENC_BIG_ENDIAN); |
508 | 0 | proto_item_append_text(tlv_item, ": %u", tvb_get_ntohl(tvb, offset)); |
509 | 0 | break; |
510 | 0 | case 16: /* License ACR used */ |
511 | 0 | proto_tree_add_item(licmgr_subtree, hf_papi_licmgr_license_acr_used, tvb, offset, 4, ENC_BIG_ENDIAN); |
512 | 0 | proto_item_append_text(tlv_item, ": %u", tvb_get_ntohl(tvb, offset)); |
513 | 0 | break; |
514 | 0 | } |
515 | 0 | offset += optlen; |
516 | 0 | } |
517 | | |
518 | 0 | proto_tree_add_item(licmgr_tree, hf_papi_licmgr_padding, tvb, offset, -1, ENC_NA); |
519 | 0 | offset += tvb_reported_length_remaining(tvb, offset); |
520 | |
|
521 | 0 | return offset; |
522 | 0 | } |
523 | | |
524 | | /* PAPI Debug loop ! */ |
525 | | static int |
526 | | dissect_papi_debug(tvbuff_t *tvb, packet_info *pinfo, unsigned offset, proto_tree *tree) |
527 | 0 | { |
528 | 0 | proto_item *ti; |
529 | 0 | proto_tree *debug_tree, *debug_sub_tree; |
530 | | |
531 | |
|
532 | 0 | ti = proto_tree_add_item(tree, hf_papi_debug, tvb, offset, -1, ENC_NA); |
533 | 0 | debug_tree = proto_item_add_subtree(ti, ett_papi); |
534 | |
|
535 | 0 | while(offset < tvb_reported_length(tvb)) { |
536 | 0 | switch(tvb_get_uint8(tvb,offset)) { |
537 | 0 | case 0x00: |
538 | 0 | ti = proto_tree_add_item(debug_tree, hf_papi_debug_text, tvb, offset+3, tvb_get_ntohs(tvb,offset+1), ENC_ASCII); |
539 | 0 | debug_sub_tree = proto_item_add_subtree(ti, ett_papi); |
540 | 0 | proto_tree_add_item(debug_sub_tree, hf_papi_debug_text_length, tvb, offset+1, 2, ENC_BIG_ENDIAN); |
541 | 0 | offset += tvb_get_ntohs(tvb, offset+1) + 3; |
542 | 0 | break; |
543 | 0 | case 0x01: |
544 | 0 | proto_tree_add_item(debug_tree, hf_papi_debug_48bits, tvb, offset+1, 6, ENC_BIG_ENDIAN); |
545 | 0 | offset += 7; |
546 | 0 | break; |
547 | 0 | case 0x02: |
548 | 0 | proto_tree_add_item(debug_tree, hf_papi_debug_8bits, tvb, offset+1, 1, ENC_BIG_ENDIAN); |
549 | 0 | offset += 2; |
550 | 0 | break; |
551 | 0 | case 0x03: |
552 | 0 | proto_tree_add_item(debug_tree, hf_papi_debug_16bits, tvb, offset+1, 2, ENC_BIG_ENDIAN); |
553 | 0 | offset += 3; |
554 | 0 | break; |
555 | 0 | case 0x04: |
556 | 0 | proto_tree_add_item(debug_tree, hf_papi_debug_32bits, tvb, offset+1, 4, ENC_BIG_ENDIAN); |
557 | 0 | offset += 5; |
558 | 0 | break; |
559 | 0 | case 0x05: |
560 | 0 | proto_tree_add_item(debug_tree, hf_papi_debug_ipv4, tvb, offset+1, 4, ENC_BIG_ENDIAN); |
561 | 0 | offset += 5; |
562 | 0 | break; |
563 | 0 | case 0x07: |
564 | 0 | proto_tree_add_item(debug_tree, hf_papi_debug_16bits, tvb, offset+1, 2, ENC_BIG_ENDIAN); |
565 | 0 | offset += 3; |
566 | 0 | break; |
567 | 0 | case 0x08: |
568 | 0 | ti = proto_tree_add_item(debug_tree, hf_papi_debug_bytes, tvb, offset+3, tvb_get_ntohs(tvb,offset+1), ENC_NA); |
569 | 0 | debug_sub_tree = proto_item_add_subtree(ti, ett_papi); |
570 | 0 | proto_tree_add_item(debug_sub_tree, hf_papi_debug_bytes_length, tvb, offset+1, 2, ENC_BIG_ENDIAN); |
571 | 0 | offset += tvb_get_ntohs(tvb,offset+1) + 3; |
572 | 0 | break; |
573 | 0 | case 0x09: |
574 | 0 | proto_tree_add_item(debug_tree, hf_papi_debug_64bits, tvb, offset+1, 8, ENC_BIG_ENDIAN); |
575 | 0 | offset += 9; |
576 | 0 | break; |
577 | 0 | default: |
578 | 0 | proto_tree_add_expert_format(debug_tree, pinfo, &ei_papi_debug_unknown, tvb, offset, 1, "Unknown (%d)", tvb_get_uint8(tvb, offset)); |
579 | 0 | offset +=1; |
580 | 0 | } |
581 | 0 | } |
582 | | |
583 | 0 | return offset; |
584 | 0 | } |
585 | | |
586 | | static int |
587 | | dissect_papi(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) |
588 | 3 | { |
589 | 3 | proto_item *ti; |
590 | 3 | proto_tree *papi_tree; |
591 | 3 | unsigned offset = 0; |
592 | 3 | uint32_t dest_port, src_port, hdr_version; |
593 | 3 | tvbuff_t *next_tvb; |
594 | | |
595 | | |
596 | | /* All PAPI packet start with 0x4972 ! */ |
597 | 3 | if ( tvb_get_ntohs(tvb, offset) != 0x4972 ) |
598 | 2 | return false; |
599 | | |
600 | 1 | col_set_str(pinfo->cinfo, COL_PROTOCOL, "PAPI"); |
601 | 1 | col_set_str(pinfo->cinfo, COL_INFO, "PAPI - Aruba AP Control Protocol"); |
602 | | |
603 | 1 | ti = proto_tree_add_item(tree, proto_papi, tvb, 0, PAPI_PACKET_SIZE, ENC_NA); |
604 | 1 | papi_tree = proto_item_add_subtree(ti, ett_papi); |
605 | | |
606 | 1 | proto_tree_add_item(papi_tree, hf_papi_hdr_magic, tvb, offset, 2, ENC_BIG_ENDIAN); |
607 | 1 | offset += 2; |
608 | | |
609 | 1 | proto_tree_add_item_ret_uint(papi_tree, hf_papi_hdr_version, tvb, offset, 2, ENC_BIG_ENDIAN, &hdr_version); |
610 | 1 | offset += 2; |
611 | | |
612 | 1 | proto_tree_add_item(papi_tree, hf_papi_hdr_dest_ip, tvb, offset, 4, ENC_BIG_ENDIAN); |
613 | 1 | offset += 4; |
614 | | |
615 | 1 | proto_tree_add_item(papi_tree, hf_papi_hdr_src_ip, tvb, offset, 4, ENC_BIG_ENDIAN); |
616 | 1 | offset += 4; |
617 | | |
618 | 1 | proto_tree_add_item(papi_tree, hf_papi_hdr_nat_port_number, tvb, offset, 2, ENC_BIG_ENDIAN); |
619 | 1 | offset += 2; |
620 | | |
621 | 1 | proto_tree_add_item(papi_tree, hf_papi_hdr_garbage, tvb, offset, 2, ENC_BIG_ENDIAN); |
622 | 1 | offset += 2; |
623 | | |
624 | 1 | proto_tree_add_item_ret_uint(papi_tree, hf_papi_hdr_dest_port, tvb, offset, 2, ENC_BIG_ENDIAN, &dest_port); |
625 | 1 | offset += 2; |
626 | | |
627 | 1 | proto_tree_add_item_ret_uint(papi_tree, hf_papi_hdr_src_port, tvb, offset, 2, ENC_BIG_ENDIAN, &src_port); |
628 | 1 | offset += 2; |
629 | | |
630 | 1 | proto_tree_add_item(papi_tree, hf_papi_hdr_packet_type, tvb, offset, 2, ENC_BIG_ENDIAN); |
631 | 1 | offset += 2; |
632 | | |
633 | 1 | proto_tree_add_item(papi_tree, hf_papi_hdr_packet_size, tvb, offset, 2, ENC_BIG_ENDIAN); |
634 | 1 | offset += 2; |
635 | | |
636 | 1 | proto_tree_add_item(papi_tree, hf_papi_hdr_seq_number, tvb, offset, 2, ENC_BIG_ENDIAN); |
637 | 1 | offset += 2; |
638 | | |
639 | 1 | proto_tree_add_item(papi_tree, hf_papi_hdr_message_code, tvb, offset, 2, ENC_BIG_ENDIAN); |
640 | 1 | offset += 2; |
641 | | |
642 | 1 | proto_tree_add_item(papi_tree, hf_papi_hdr_checksum, tvb, offset, 16, ENC_NA); |
643 | 1 | offset += 16; |
644 | | |
645 | 1 | if (hdr_version == V4V6_HDR_VERSION) { |
646 | |
|
647 | 0 | proto_tree_add_item(papi_tree, hf_papi_hdr_destipv6, tvb, offset, IPv6_ADDR_SIZE, ENC_NA); |
648 | 0 | offset += IPv6_ADDR_SIZE; |
649 | |
|
650 | 0 | proto_tree_add_item(papi_tree, hf_papi_hdr_srcipv6, tvb, offset, IPv6_ADDR_SIZE, ENC_NA); |
651 | 0 | offset += IPv6_ADDR_SIZE; |
652 | |
|
653 | 0 | } |
654 | | |
655 | 1 | if(g_papi_debug) |
656 | 0 | { |
657 | 0 | offset = dissect_papi_debug(tvb, pinfo, offset, papi_tree); |
658 | 0 | } |
659 | | |
660 | 1 | next_tvb = tvb_new_subset_remaining(tvb, offset); |
661 | 1 | if (!dissector_try_uint_with_data(papi_dissector_table, dest_port, next_tvb, pinfo, tree, true, NULL)) { |
662 | 0 | if (!dissector_try_uint_with_data(papi_dissector_table, src_port, next_tvb, pinfo, tree, true, NULL)) { |
663 | 0 | call_data_dissector(next_tvb, pinfo, tree); |
664 | 0 | } |
665 | 0 | } |
666 | | |
667 | 1 | return tvb_captured_length(tvb); |
668 | 3 | } |
669 | | |
670 | | void |
671 | | proto_register_papi(void) |
672 | 16 | { |
673 | 16 | module_t *papi_module; |
674 | | |
675 | 16 | static hf_register_info hf[] = { |
676 | 16 | { &hf_papi_hdr_magic, |
677 | 16 | { "Magic", "papi.hdr.magic", |
678 | 16 | FT_UINT16, BASE_HEX, NULL, 0x0, |
679 | 16 | "PAPI Header Magic Number", HFILL } |
680 | 16 | }, |
681 | 16 | { &hf_papi_hdr_version, |
682 | 16 | { "Version", "papi.hdr.version", |
683 | 16 | FT_UINT16, BASE_DEC, NULL, 0x0, |
684 | 16 | "PAPI Protocol Version", HFILL } |
685 | 16 | }, |
686 | 16 | { &hf_papi_hdr_dest_ip, |
687 | 16 | { "Destination IP", "papi.hdr.dest.ip", |
688 | 16 | FT_IPv4, BASE_NONE, NULL, 0x0, |
689 | 16 | NULL, HFILL } |
690 | 16 | }, |
691 | 16 | { &hf_papi_hdr_src_ip, |
692 | 16 | { "Source IP", "papi.hdr.src.ip", |
693 | 16 | FT_IPv4, BASE_NONE, NULL, 0x0, |
694 | 16 | NULL, HFILL } |
695 | 16 | }, |
696 | 16 | { &hf_papi_hdr_nat_port_number, |
697 | 16 | { "NAT Port Number", "papi.hdr.nat_port_number", |
698 | 16 | FT_UINT16, BASE_DEC, NULL, 0x0, |
699 | 16 | NULL, HFILL } |
700 | 16 | }, |
701 | 16 | { &hf_papi_hdr_garbage, |
702 | 16 | { "Garbage", "papi.hdr.garbage", |
703 | 16 | FT_UINT16, BASE_DEC, NULL, 0x0, |
704 | 16 | NULL, HFILL } |
705 | 16 | }, |
706 | 16 | { &hf_papi_hdr_dest_port, |
707 | 16 | { "Destination Port", "papi.hdr.dest.port", |
708 | 16 | FT_UINT16, BASE_DEC|BASE_EXT_STRING, &papi_port_vals_ext, 0x0, |
709 | 16 | NULL, HFILL } |
710 | 16 | }, |
711 | 16 | { &hf_papi_hdr_src_port, |
712 | 16 | { "Source Port", "papi.hdr.src.port", |
713 | 16 | FT_UINT16, BASE_DEC|BASE_EXT_STRING, &papi_port_vals_ext, 0x0, |
714 | 16 | NULL, HFILL } |
715 | 16 | }, |
716 | 16 | { &hf_papi_hdr_packet_type, |
717 | 16 | { "Packet Type", "papi.hdr.packet.type", |
718 | 16 | FT_UINT16, BASE_DEC|BASE_HEX, NULL, 0x0, |
719 | 16 | NULL, HFILL } |
720 | 16 | }, |
721 | 16 | { &hf_papi_hdr_packet_size, |
722 | 16 | { "Packet Size", "papi.hdr.packet.size", |
723 | 16 | FT_UINT16, BASE_DEC, NULL, 0x0, |
724 | 16 | NULL, HFILL } |
725 | 16 | }, |
726 | 16 | { &hf_papi_hdr_seq_number, |
727 | 16 | { "Sequence Number", "papi.hdr.seq_number", |
728 | 16 | FT_UINT16, BASE_DEC, NULL, 0x0, |
729 | 16 | NULL, HFILL } |
730 | 16 | }, |
731 | 16 | { &hf_papi_hdr_message_code, |
732 | 16 | { "Message Code", "papi.hdr.message_code", |
733 | 16 | FT_UINT16, BASE_DEC, NULL, 0x0, |
734 | 16 | NULL, HFILL } |
735 | 16 | }, |
736 | 16 | { &hf_papi_hdr_checksum, |
737 | 16 | { "Checksum", "papi.hdr.checksum", |
738 | 16 | FT_BYTES, BASE_NONE, NULL, 0x0, |
739 | 16 | NULL, HFILL } |
740 | 16 | }, |
741 | 16 | { &hf_papi_hdr_destipv6,/* IPv6 address of Destination */ |
742 | 16 | { "Destination IPv6", "papi.hdr.dest.ipv6", |
743 | 16 | FT_IPv6, BASE_NONE, NULL, 0x0, |
744 | 16 | NULL, HFILL } |
745 | 16 | }, |
746 | 16 | { &hf_papi_hdr_srcipv6,/* IPv6 address of Source */ |
747 | 16 | { "Source IPv6", "papi.hdr.src.ipv6", |
748 | 16 | FT_IPv6, BASE_NONE, NULL, 0x0, |
749 | 16 | NULL, HFILL } |
750 | 16 | }, |
751 | 16 | { &hf_papi_debug, |
752 | 16 | { "Debug", "papi.debug", |
753 | 16 | FT_NONE, BASE_NONE, NULL, 0x0, |
754 | 16 | NULL, HFILL } |
755 | 16 | }, |
756 | 16 | { &hf_papi_debug_text, |
757 | 16 | { "Debug (Text)", "papi.debug.text", |
758 | 16 | FT_STRING, BASE_NONE, NULL, 0x0, |
759 | 16 | NULL, HFILL } |
760 | 16 | }, |
761 | 16 | { &hf_papi_debug_text_length, |
762 | 16 | { "Debug Text Length", "papi.debug.text_length", |
763 | 16 | FT_UINT16, BASE_DEC, NULL, 0x0, |
764 | 16 | NULL, HFILL } |
765 | 16 | }, |
766 | 16 | { &hf_papi_debug_bytes, |
767 | 16 | { "Debug (Bytes)", "papi.debug.bytes", |
768 | 16 | FT_BYTES, BASE_NONE, NULL, 0x0, |
769 | 16 | NULL, HFILL } |
770 | 16 | }, |
771 | 16 | { &hf_papi_debug_bytes_length, |
772 | 16 | { "Debug Bytes Length", "papi.debug.bytes_length", |
773 | 16 | FT_UINT16, BASE_DEC, NULL, 0x0, |
774 | 16 | NULL, HFILL } |
775 | 16 | }, |
776 | 16 | { &hf_papi_debug_48bits, |
777 | 16 | { "Debug (48 Bits)", "papi.debug.48bits", |
778 | 16 | FT_UINT64, BASE_DEC, NULL, 0x0, |
779 | 16 | NULL, HFILL } |
780 | 16 | }, |
781 | 16 | { &hf_papi_debug_8bits, |
782 | 16 | { "Debug (8 Bits)", "papi.debug.8bits", |
783 | 16 | FT_UINT8, BASE_DEC, NULL, 0x0, |
784 | 16 | NULL, HFILL } |
785 | 16 | }, |
786 | 16 | { &hf_papi_debug_16bits, |
787 | 16 | { "Debug (16 Bits)", "papi.debug.16bits", |
788 | 16 | FT_UINT16, BASE_DEC, NULL, 0x0, |
789 | 16 | NULL, HFILL } |
790 | 16 | }, |
791 | 16 | { &hf_papi_debug_32bits, |
792 | 16 | { "Debug (32 Bits)", "papi.debug.32bits", |
793 | 16 | FT_UINT32, BASE_DEC, NULL, 0x0, |
794 | 16 | NULL, HFILL } |
795 | 16 | }, |
796 | 16 | { &hf_papi_debug_ipv4, |
797 | 16 | { "Debug (IPv4)", "papi.debug.ipv4", |
798 | 16 | FT_IPv4, BASE_NONE, NULL, 0x0, |
799 | 16 | NULL, HFILL } |
800 | 16 | }, |
801 | 16 | { &hf_papi_debug_64bits, |
802 | 16 | { "Debug (64 Bits)", "papi.debug.64bits", |
803 | 16 | FT_UINT64, BASE_DEC, NULL, 0x0, |
804 | 16 | NULL, HFILL } |
805 | 16 | }, |
806 | | |
807 | 16 | { &hf_papi_licmgr, |
808 | 16 | { "License Manager", "papi.licmgr", |
809 | 16 | FT_NONE, BASE_NONE, NULL, 0x0, |
810 | 16 | NULL, HFILL } |
811 | 16 | }, |
812 | 16 | { &hf_papi_licmgr_payload_len, |
813 | 16 | { "Payload Length", "papi.licmgr.payload_len", |
814 | 16 | FT_UINT32, BASE_DEC, NULL, 0x0, |
815 | 16 | NULL, HFILL } |
816 | 16 | }, |
817 | 16 | { &hf_papi_licmgr_tlv, |
818 | 16 | { "TLV", "papi.licmgr.tlv", |
819 | 16 | FT_NONE, BASE_NONE, NULL, 0x0, |
820 | 16 | NULL, HFILL } |
821 | 16 | }, |
822 | 16 | { &hf_papi_licmgr_type, |
823 | 16 | { "Type", "papi.licmgr.type", |
824 | 16 | FT_UINT16, BASE_DEC, NULL, 0x0, |
825 | 16 | NULL, HFILL } |
826 | 16 | }, |
827 | 16 | { &hf_papi_licmgr_length, |
828 | 16 | { "Length", "papi.licmgr.length", |
829 | 16 | FT_UINT16, BASE_DEC, NULL, 0x0, |
830 | 16 | NULL, HFILL } |
831 | 16 | }, |
832 | 16 | { &hf_papi_licmgr_value, |
833 | 16 | { "Value", "papi.licmgr.value", |
834 | 16 | FT_BYTES, BASE_NONE, NULL, 0x0, |
835 | 16 | NULL, HFILL } |
836 | 16 | }, |
837 | 16 | { &hf_papi_licmgr_ip, |
838 | 16 | { "License Manager IP Address", "papi.licmgr.ip", |
839 | 16 | FT_IPv4, BASE_NONE, NULL, 0x0, |
840 | 16 | NULL, HFILL } |
841 | 16 | }, |
842 | 16 | { &hf_papi_licmgr_serial_number, |
843 | 16 | { "Serial Number", "papi.licmgr.serial_number", |
844 | 16 | FT_STRING, BASE_NONE, NULL, 0x0, |
845 | 16 | NULL, HFILL } |
846 | 16 | }, |
847 | 16 | { &hf_papi_licmgr_hostname, |
848 | 16 | { "Hostname", "papi.licmgr.hostname", |
849 | 16 | FT_STRING, BASE_NONE, NULL, 0x0, |
850 | 16 | NULL, HFILL } |
851 | 16 | }, |
852 | 16 | { &hf_papi_licmgr_mac_address, |
853 | 16 | { "MAC Address", "papi.licmgr.mac_address", |
854 | 16 | FT_ETHER, BASE_NONE, NULL, 0x0, |
855 | 16 | NULL, HFILL } |
856 | 16 | }, |
857 | 16 | { &hf_papi_licmgr_license_ap_remaining, |
858 | 16 | { "License AP remaining", "papi.licmgr.license.ap.remaining", |
859 | 16 | FT_UINT32, BASE_DEC, NULL, 0x0, |
860 | 16 | NULL, HFILL } |
861 | 16 | }, |
862 | 16 | { &hf_papi_licmgr_license_pef_remaining, |
863 | 16 | { "License PEF remaining", "papi.licmgr.license.pef.remaining", |
864 | 16 | FT_UINT32, BASE_DEC, NULL, 0x0, |
865 | 16 | NULL, HFILL } |
866 | 16 | }, |
867 | 16 | { &hf_papi_licmgr_license_rfp_remaining, |
868 | 16 | { "License RFP remaining", "papi.licmgr.license.rfp.remaining", |
869 | 16 | FT_UINT32, BASE_DEC, NULL, 0x0, |
870 | 16 | NULL, HFILL } |
871 | 16 | }, |
872 | 16 | { &hf_papi_licmgr_license_xsec_remaining, |
873 | 16 | { "License xSEC remaining", "papi.licmgr.license.xsec.remaining", |
874 | 16 | FT_UINT32, BASE_DEC, NULL, 0x0, |
875 | 16 | NULL, HFILL } |
876 | 16 | }, |
877 | 16 | { &hf_papi_licmgr_license_acr_remaining, |
878 | 16 | { "License ACR remaining", "papi.licmgr.license.acr.remaining", |
879 | 16 | FT_UINT32, BASE_DEC, NULL, 0x0, |
880 | 16 | NULL, HFILL } |
881 | 16 | }, |
882 | 16 | { &hf_papi_licmgr_license_ap_used, |
883 | 16 | { "License AP used", "papi.licmgr.license.ap.used", |
884 | 16 | FT_UINT32, BASE_DEC, NULL, 0x0, |
885 | 16 | NULL, HFILL } |
886 | 16 | }, |
887 | 16 | { &hf_papi_licmgr_license_pef_used, |
888 | 16 | { "License PEF used", "papi.licmgr.license.pef.used", |
889 | 16 | FT_UINT32, BASE_DEC, NULL, 0x0, |
890 | 16 | NULL, HFILL } |
891 | 16 | }, |
892 | 16 | { &hf_papi_licmgr_license_rfp_used, |
893 | 16 | { "License RFP used", "papi.licmgr.license.rfp.used", |
894 | 16 | FT_UINT32, BASE_DEC, NULL, 0x0, |
895 | 16 | NULL, HFILL } |
896 | 16 | }, |
897 | 16 | { &hf_papi_licmgr_license_xsec_used, |
898 | 16 | { "License xSec used", "papi.licmgr.license.xsec.used", |
899 | 16 | FT_UINT32, BASE_DEC, NULL, 0x0, |
900 | 16 | NULL, HFILL } |
901 | 16 | }, |
902 | 16 | { &hf_papi_licmgr_license_acr_used, |
903 | 16 | { "License ACR used", "papi.licmgr.license.acr.used", |
904 | 16 | FT_UINT32, BASE_DEC, NULL, 0x0, |
905 | 16 | NULL, HFILL } |
906 | 16 | }, |
907 | 16 | { &hf_papi_licmgr_padding, |
908 | 16 | { "Padding", "papi.licmgr.padding", |
909 | 16 | FT_BYTES, BASE_NONE, NULL, 0x0, |
910 | 16 | NULL, HFILL } |
911 | 16 | }, |
912 | 16 | }; |
913 | | |
914 | | /* Setup protocol subtree array */ |
915 | 16 | static int *ett[] = { |
916 | 16 | &ett_papi, |
917 | 16 | &ett_papi_licmgr, |
918 | 16 | &ett_papi_licmgr_tlv |
919 | 16 | }; |
920 | | |
921 | 16 | static ei_register_info ei[] = { |
922 | 16 | { &ei_papi_debug_unknown, { "papi.debug.unknown", PI_PROTOCOL, PI_WARN, "Unknown", EXPFILL }}, |
923 | 16 | }; |
924 | | |
925 | 16 | expert_module_t* expert_papi; |
926 | | |
927 | 16 | proto_papi = proto_register_protocol("Aruba PAPI", "PAPI", "papi"); |
928 | | |
929 | 16 | proto_register_field_array(proto_papi, hf, array_length(hf)); |
930 | 16 | proto_register_subtree_array(ett, array_length(ett)); |
931 | 16 | expert_papi = expert_register_protocol(proto_papi); |
932 | 16 | expert_register_field_array(expert_papi, ei, array_length(ei)); |
933 | | |
934 | 16 | papi_module = prefs_register_protocol(proto_papi, NULL); |
935 | | |
936 | | /* creating a dissector table for the protocol & registering the same */ |
937 | 16 | papi_dissector_table = register_dissector_table("papi.port", "PAPI protocol", proto_papi, FT_UINT16, BASE_DEC); |
938 | | |
939 | 16 | prefs_register_bool_preference(papi_module, "experimental_decode", |
940 | 16 | "Do experimental decode", |
941 | 16 | "Attempt to decode parts of the message that aren't fully understood yet", |
942 | 16 | &g_papi_debug); |
943 | | |
944 | 16 | papi_handle = register_dissector("papi", dissect_papi, proto_papi); |
945 | 16 | } |
946 | | |
947 | | |
948 | | void |
949 | | proto_reg_handoff_papi(void) |
950 | 16 | { |
951 | 16 | dissector_add_uint("papi.port", LICENSE_MANAGER, create_dissector_handle(dissect_papi_license_manager, -1)); |
952 | 16 | dissector_add_uint_with_preference("udp.port", UDP_PORT_PAPI, papi_handle); |
953 | 16 | } |
954 | | /* |
955 | | * Editor modelines - https://www.wireshark.org/tools/modelines.html |
956 | | * |
957 | | * Local variables: |
958 | | * c-basic-offset: 4 |
959 | | * tab-width: 8 |
960 | | * indent-tabs-mode: nil |
961 | | * End: |
962 | | * |
963 | | * vi: set shiftwidth=4 tabstop=8 expandtab: |
964 | | * :indentSize=4:tabSize=8:noTabs=true: |
965 | | */ |