2 * Routines for LLTD dissection
3 * Copyright 2012, Michael Mann
5 * Wireshark - Network traffic analyzer
6 * By Gerald Combs <gerald@wireshark.org>
7 * Copyright 1998 Gerald Combs
9 * SPDX-License-Identifier: GPL-2.0-or-later
14 #include <epan/packet.h>
15 #include <epan/etypes.h>
16 #include <epan/expert.h>
18 #include <wsutil/array.h>
20 void proto_register_lltd(void);
21 void proto_reg_handoff_lltd(void);
23 static dissector_handle_t lltd_handle
;
25 static int proto_lltd
;
27 static int hf_lltd_version
;
28 static int hf_lltd_type_of_service
;
29 static int hf_lltd_reserved
;
30 static int hf_lltd_discovery_func
;
31 static int hf_lltd_discovery_real_dest_addr
;
32 static int hf_lltd_discovery_real_src_addr
;
33 static int hf_lltd_discovery_xid
;
34 static int hf_lltd_discovery_seq_num
;
35 static int hf_lltd_discover_gen_num
;
36 static int hf_lltd_discover_num_stations
;
37 static int hf_lltd_discover_station
;
38 static int hf_lltd_hello_gen_num
;
39 static int hf_lltd_hello_current_address
;
40 static int hf_lltd_hello_apparent_address
;
41 static int hf_lltd_tlv_type
;
42 static int hf_lltd_tlv_length
;
43 static int hf_lltd_host_id
;
44 static int hf_lltd_char_p
;
45 static int hf_lltd_char_x
;
46 static int hf_lltd_char_f
;
47 static int hf_lltd_char_m
;
48 static int hf_lltd_char_l
;
49 static int hf_lltd_char_reserved
;
50 static int hf_lltd_physical_medium
;
51 static int hf_lltd_wireless_mode
;
52 static int hf_lltd_bssid
;
53 static int hf_lltd_ssid
;
54 static int hf_lltd_ipv4_address
;
55 static int hf_lltd_ipv6_address
;
56 static int hf_lltd_max_operation_rate
;
57 static int hf_lltd_performance_count_freq
;
58 static int hf_lltd_link_speed
;
59 static int hf_lltd_rssi
;
60 static int hf_lltd_machine_name
;
61 static int hf_lltd_support_info
;
62 static int hf_lltd_device_uuid
;
63 static int hf_lltd_qos_char_e
;
64 static int hf_lltd_qos_char_q
;
65 static int hf_lltd_qos_char_p
;
66 static int hf_lltd_qos_char_reserved
;
67 static int hf_lltd_80211_physical_medium
;
68 static int hf_lltd_sees_list_working_set
;
69 static int hf_lltd_repeater_ap_lineage
;
70 static int hf_lltd_emit_num_descs
;
71 static int hf_lltd_emit_type
;
72 static int hf_lltd_emit_pause
;
73 static int hf_lltd_emit_src_addr
;
74 static int hf_lltd_emit_dest_addr
;
75 static int hf_lltd_queryresp_more_descs
;
76 static int hf_lltd_queryresp_memory_descs
;
77 static int hf_lltd_queryresp_num_descs
;
78 static int hf_lltd_queryresp_type
;
79 static int hf_lltd_queryresp_real_src_addr
;
80 static int hf_lltd_queryresp_ethernet_src_addr
;
81 static int hf_lltd_queryresp_ethernet_dest_addr
;
82 static int hf_lltd_flat_crc_bytes
;
83 static int hf_lltd_flat_crc_packets
;
84 static int hf_lltd_query_large_tlv_type
;
85 static int hf_lltd_query_large_tlv_offset
;
86 static int hf_lltd_querylargeresp_more_descs
;
87 static int hf_lltd_querylargeresp_memory_descs
;
88 static int hf_lltd_querylargeresp_num_descs
;
89 static int hf_lltd_querylargeresp_data
;
91 static int hf_lltd_qos_diag_func
;
92 static int hf_lltd_qos_real_dest_addr
;
93 static int hf_lltd_qos_real_src_addr
;
94 static int hf_lltd_qos_seq_num
;
95 static int hf_lltd_qos_initialize_interrupt_mod
;
96 static int hf_lltd_qos_ready_sink_link_speed
;
97 static int hf_lltd_qos_ready_perf_count_freq
;
98 static int hf_lltd_qos_probe_controller_transmit_timestamp
;
99 static int hf_lltd_qos_probe_sink_receive_timestamp
;
100 static int hf_lltd_qos_probe_sink_transmit_timestamp
;
101 static int hf_lltd_qos_probe_test_type
;
102 static int hf_lltd_qos_probe_packet_id
;
103 static int hf_lltd_qos_probe_t
;
104 static int hf_lltd_qos_probe_8021p_value
;
105 static int hf_lltd_qos_probe_payload
;
106 static int hf_lltd_qos_error_value
;
107 static int hf_lltd_qos_count_snapshot_history
;
108 static int hf_lltd_qos_query_resp_r
;
109 static int hf_lltd_qos_query_resp_e
;
110 static int hf_lltd_qos_query_resp_num_events
;
111 static int hf_lltd_qos_query_resp_controller_timestamp
;
112 static int hf_lltd_qos_query_resp_sink_timestamp
;
113 static int hf_lltd_qos_query_resp_packet_id
;
114 static int hf_lltd_qos_query_resp_reserved
;
115 static int hf_lltd_qos_counter_result_subsec_span
;
116 static int hf_lltd_qos_counter_result_byte_scale
;
117 static int hf_lltd_qos_counter_result_packet_scale
;
118 static int hf_lltd_qos_counter_result_history_size
;
119 static int hf_lltd_qos_snapshot_bytes_recv
;
120 static int hf_lltd_qos_snapshot_packets_recv
;
121 static int hf_lltd_qos_snapshot_bytes_sent
;
122 static int hf_lltd_qos_snapshot_packets_sent
;
126 static int ett_base_header
;
127 static int ett_discover_stations
;
129 static int ett_tlv_item
;
130 static int ett_characteristics
;
131 static int ett_qos_characteristics
;
132 static int ett_repeater_ap_lineage
;
133 static int ett_emitee_descs
;
134 static int ett_emitee_descs_item
;
135 static int ett_recvee_descs
;
136 static int ett_recvee_descs_item
;
137 static int ett_qos_event_descs
;
138 static int ett_qos_event_item
;
139 static int ett_qos_snapshot_list
;
140 static int ett_qos_snapshot_item
;
142 static expert_field ei_lltd_tlv_length_invalid
;
143 static expert_field ei_lltd_too_many_paths
;
144 static expert_field ei_lltd_type_of_service
;
145 static expert_field ei_lltd_char_reserved
;
146 static expert_field ei_lltd_qos_seq_num
;
147 static expert_field ei_lltd_discovery_func
;
148 static expert_field ei_lltd_tlv_type
;
149 static expert_field ei_lltd_qos_diag_func
;
151 #define LLTD_CHARACTERISTIC_P_MASK 0x80000000
152 #define LLTD_CHARACTERISTIC_X_MASK 0x40000000
153 #define LLTD_CHARACTERISTIC_F_MASK 0x20000000
154 #define LLTD_CHARACTERISTIC_M_MASK 0x10000000
155 #define LLTD_CHARACTERISTIC_L_MASK 0x08000000
156 #define LLTD_CHARACTERISTIC_RESERVE_MASK 0x07FFFFFF
158 #define LLTD_QOS_CHARACTERISTIC_E_MASK 0x80000000
159 #define LLTD_QOS_CHARACTERISTIC_Q_MASK 0x40000000
160 #define LLTD_QOS_CHARACTERISTIC_P_MASK 0x20000000
161 #define LLTD_QOS_CHARACTERISTIC_RESERVE_MASK 0x1FFFFFFF
163 #define LLTD_QUERY_RESP_M_MASK 0x8000
164 #define LLTD_QUERY_RESP_E_MASK 0x4000
165 #define LLTD_QUERY_RESP_NUM_DESCS_MASK 0x3FFF
167 static const value_string lltd_tos_vals
[] = {
168 { 0, "Topology discovery" },
169 { 1, "Quick discovery" },
170 { 2, "QoS Diagnostics" },
175 static const value_string lltd_discovery_vals
[] = {
176 { 0x00, "Discover" },
183 { 0x07, "QueryResp" },
187 { 0x0B, "QueryLargeTlv" },
188 { 0x0C, "QueryLargeTlvResp" },
193 static const value_string lltd_qos_diag_vals
[] = {
194 { 0x00, "QosInitializeSink" },
195 { 0x01, "QosReady" },
196 { 0x02, "QosProbe" },
197 { 0x03, "QosQuery" },
198 { 0x04, "QosQueryResp" },
199 { 0x05, "QosReset" },
200 { 0x06, "QosError" },
202 { 0x08, "QosCounterSnapshot" },
203 { 0x09, "QosCounterResult" },
204 { 0x0A, "QosCounterLease" },
209 static const value_string lltd_tlv_type_vals
[] = {
210 { 0x00, "End of Property List" },
212 { 0x02, "Characteristics" },
213 { 0x03, "Physical Medium" },
214 { 0x04, "Wireless Mode" },
215 { 0x05, "802.11 BSSID" },
216 { 0x06, "802.11 SSID" },
217 { 0x07, "IPv4 Address" },
218 { 0x08, "IPv6 Address" },
219 { 0x09, "802.11 Maximum Operation Rate" },
220 { 0x0A, "Performance Counter Frequency" },
221 { 0x0C, "Link Speed" },
222 { 0x0D, "802.11 RSSI" },
223 { 0x0E, "Icon Image" },
224 { 0x0F, "Machine Name" },
225 { 0x10, "Support Information" },
226 { 0x11, "Friendly Name" },
227 { 0x12, "Device UUID" },
228 { 0x13, "Hardware ID" },
229 { 0x14, "QoS Characteristics" },
230 { 0x15, "802.11 Physical Medium" },
231 { 0x16, "AP Association Table" },
232 { 0x18, "Detailed Icon Image" },
233 { 0x19, "Sees-List Working Set" },
234 { 0x1A, "Component Table" },
235 { 0x1B, "Repeater AP Lineage" },
236 { 0x1C, "Repeater AP Table" },
241 static const value_string lltd_wireless_mode_vals
[] = {
242 { 0x00, "802.11 IBSS or ad-hoc mode" },
243 { 0x01, "802.11 infrastructure mode" },
248 static const value_string lltd_80211_physical_medium_vals
[] = {
250 { 0x01, "FHSS 2.4 GHz" },
251 { 0x02, "DSSS 2.4 GHz" },
252 { 0x03, "IR Baseband" },
253 { 0x04, "OFDM 5 GHz" },
260 static const value_string lltd_emit_type_vals
[] = {
267 static const value_string lltd_queryresp_type_vals
[] = {
274 static const value_string lltd_query_large_tlv_type_vals
[] = {
275 { 0x0E, "Icon Image" },
276 { 0x11, "Friendly Name" },
277 { 0x13, "Hardware ID" },
278 { 0x16, "AP Association Table" },
279 { 0x18, "Detailed Icon Image" },
280 { 0x1A, "Component Table" },
281 { 0x1C, "Repeater AP Table" },
286 static const value_string lltd_interrupt_mod_vals
[] = {
287 { 0x00, "Disable interrupt moderation" },
288 { 0x01, "Enable interrupt moderation" },
289 { 0xFF, "Use existing interrupt moderation setting" },
294 static const value_string lltd_qos_probe_test_type_vals
[] = {
295 { 0x00, "Timed Probe" },
296 { 0x01, "Probegap originating from the controller" },
297 { 0x02, "Probegap originating from the sink" },
302 static const value_string lltd_qos_error_vals
[] = {
303 { 0x00, "Insufficient Resources" },
304 { 0x01, "Busy. Try again later" },
305 { 0x02, "Interrupt moderation not available" },
311 static const true_false_string tfs_full_half_duplex
= { "Full Duplex", "Half Duplex" };
315 dissect_lltd_tlv(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, uint32_t offset
, bool* end
)
317 uint8_t type
, length
= 0;
318 proto_item
*tlv_item
, *type_item
;
319 proto_tree
*tlv_tree
, *type_tree
;
322 type
= tvb_get_uint8(tvb
, offset
);
325 /* End of Property type doesn't have length */
326 tlv_tree
= proto_tree_add_subtree(tree
, tvb
, offset
, 1, ett_tlv_item
, &tlv_item
, "TLV Item (End of Property List)");
331 length
= tvb_get_uint8(tvb
, offset
+1);
332 tlv_tree
= proto_tree_add_subtree_format(tree
, tvb
, offset
, length
+2, ett_tlv_item
, &tlv_item
,
333 "TLV Item (%s)", val_to_str(type
, lltd_tlv_type_vals
, "Unknown (0x%02x)"));
337 proto_tree_add_item(tlv_tree
, hf_lltd_tlv_type
, tvb
, offset
, 1, ENC_NA
);
339 proto_tree_add_item(tlv_tree
, hf_lltd_tlv_length
, tvb
, offset
+1, 1, ENC_NA
);
342 if ((type
!= 0) && (length
> tvb_reported_length_remaining(tvb
, offset
+2)))
344 expert_add_info_format(pinfo
, tlv_item
, &ei_lltd_tlv_length_invalid
, "TLV Length field too big");
351 case 0x00: /* End of Property List */
352 /* No data, no length field */
354 case 0x01: /* Host ID */
357 expert_add_info_format(pinfo
, tlv_item
, &ei_lltd_tlv_length_invalid
, "Invalid Host ID length");
360 proto_tree_add_item(tlv_tree
, hf_lltd_host_id
, tvb
, offset
+2, 6, ENC_NA
);
362 case 0x02: /* Characteristics */
365 expert_add_info_format(pinfo
, tlv_item
, &ei_lltd_tlv_length_invalid
, "Characteristics length");
369 type_tree
= proto_tree_add_subtree(tree
, tvb
, offset
+2, 4, ett_characteristics
, &type_item
, "Characteristics");
370 proto_tree_add_item(type_tree
, hf_lltd_char_p
, tvb
, offset
+2, 4, ENC_BIG_ENDIAN
);
371 proto_tree_add_item(type_tree
, hf_lltd_char_x
, tvb
, offset
+2, 4, ENC_BIG_ENDIAN
);
372 proto_tree_add_item(type_tree
, hf_lltd_char_f
, tvb
, offset
+2, 4, ENC_BIG_ENDIAN
);
373 proto_tree_add_item(type_tree
, hf_lltd_char_m
, tvb
, offset
+2, 4, ENC_BIG_ENDIAN
);
374 proto_tree_add_item(type_tree
, hf_lltd_char_l
, tvb
, offset
+2, 4, ENC_BIG_ENDIAN
);
375 proto_tree_add_item(type_tree
, hf_lltd_char_reserved
, tvb
, offset
+2, 4, ENC_BIG_ENDIAN
);
376 if (tvb_get_ntohl(tvb
, offset
+2) & LLTD_CHARACTERISTIC_RESERVE_MASK
)
377 expert_add_info(pinfo
, type_item
, &ei_lltd_char_reserved
);
380 case 0x03: /* Physical Medium */
383 expert_add_info_format(pinfo
, tlv_item
, &ei_lltd_tlv_length_invalid
, "Invalid Physical Medium length");
386 proto_tree_add_item(tlv_tree
, hf_lltd_physical_medium
, tvb
, offset
+2, 4, ENC_BIG_ENDIAN
);
388 case 0x04: /* Wireless Mode */
391 expert_add_info_format(pinfo
, tlv_item
, &ei_lltd_tlv_length_invalid
, "Invalid Wireless Mode length");
394 proto_tree_add_item(tlv_tree
, hf_lltd_wireless_mode
, tvb
, offset
+2, 1, ENC_BIG_ENDIAN
);
396 case 0x05: /* 802.11 BSSID */
399 expert_add_info_format(pinfo
, tlv_item
, &ei_lltd_tlv_length_invalid
, "Invalid BSSID length");
402 proto_tree_add_item(tlv_tree
, hf_lltd_bssid
, tvb
, offset
+2, 6, ENC_NA
);
404 case 0x06: /* 802.11 SSID */
407 expert_add_info_format(pinfo
, tlv_item
, &ei_lltd_tlv_length_invalid
, "SSID length too large");
410 proto_tree_add_item(tlv_tree
, hf_lltd_ssid
, tvb
, offset
+2, length
, ENC_NA
|ENC_ASCII
);
412 case 0x07: /* IPv4 Address */
415 expert_add_info_format(pinfo
, tlv_item
, &ei_lltd_tlv_length_invalid
, "Invalid IPv4 Address length");
418 proto_tree_add_item(tlv_tree
, hf_lltd_ipv4_address
, tvb
, offset
+2, 4, ENC_BIG_ENDIAN
);
420 case 0x08: /* IPv6 Address */
423 expert_add_info_format(pinfo
, tlv_item
, &ei_lltd_tlv_length_invalid
, "Invalid IPv6 Address length");
426 proto_tree_add_item(tlv_tree
, hf_lltd_ipv6_address
, tvb
, offset
+2, 16, ENC_NA
);
428 case 0x09: /* 802.11 Maximum Operation Rate */
431 expert_add_info_format(pinfo
, tlv_item
, &ei_lltd_tlv_length_invalid
, "Invalid Maximum Operation Rate length");
434 proto_tree_add_item(tlv_tree
, hf_lltd_max_operation_rate
, tvb
, offset
+2, 2, ENC_BIG_ENDIAN
);
436 case 0x0A: /* Performance Counter Frequency */
439 expert_add_info_format(pinfo
, tlv_item
, &ei_lltd_tlv_length_invalid
, "Invalid Performance Counter Frequency length");
442 proto_tree_add_item(tlv_tree
, hf_lltd_performance_count_freq
, tvb
, offset
+2, 8, ENC_BIG_ENDIAN
);
444 case 0x0C: /* Link Speed */
447 expert_add_info_format(pinfo
, tlv_item
, &ei_lltd_tlv_length_invalid
, "Invalid Link Speed length");
450 proto_tree_add_item(tlv_tree
, hf_lltd_link_speed
, tvb
, offset
+2, 4, ENC_BIG_ENDIAN
);
452 case 0x0D: /* 802.11 RSSI */
455 expert_add_info_format(pinfo
, tlv_item
, &ei_lltd_tlv_length_invalid
, "Invalid RSSI length");
458 proto_tree_add_item(tlv_tree
, hf_lltd_rssi
, tvb
, offset
+2, 4, ENC_BIG_ENDIAN
);
460 case 0x0F: /* Machine Name */
463 expert_add_info_format(pinfo
, tlv_item
, &ei_lltd_tlv_length_invalid
, "Machine Name length too large");
466 proto_tree_add_item(tlv_tree
, hf_lltd_machine_name
, tvb
, offset
+2, length
, ENC_LITTLE_ENDIAN
|ENC_UCS_2
);
468 case 0x10: /* Support Information */
471 expert_add_info_format(pinfo
, tlv_item
, &ei_lltd_tlv_length_invalid
, "Support Information length too large");
474 proto_tree_add_item(tlv_tree
, hf_lltd_support_info
, tvb
, offset
+2, length
, ENC_LITTLE_ENDIAN
|ENC_UCS_2
);
476 case 0x11: /* Friendly Name */
478 expert_add_info_format(pinfo
, tlv_item
, &ei_lltd_tlv_length_invalid
, "Invalid Friendly Name length");
480 case 0x12: /* Device UUID */
483 expert_add_info_format(pinfo
, tlv_item
, &ei_lltd_tlv_length_invalid
, "Invalid Device UUID length");
486 proto_tree_add_item(tlv_tree
, hf_lltd_device_uuid
, tvb
, offset
+2, 22, ENC_NA
);
488 case 0x13: /* Hardware ID */
490 expert_add_info_format(pinfo
, tlv_item
, &ei_lltd_tlv_length_invalid
, "Invalid Hardware ID length");
492 case 0x14: /* QoS Characteristics */
495 expert_add_info_format(pinfo
, tlv_item
, &ei_lltd_tlv_length_invalid
, "QoS Characteristics length");
499 type_tree
= proto_tree_add_subtree(tlv_tree
, tvb
, offset
+2, 4, ett_qos_characteristics
, &type_item
, "QoS Characteristics");
500 proto_tree_add_item(type_tree
, hf_lltd_qos_char_e
, tvb
, offset
+2, 4, ENC_BIG_ENDIAN
);
501 proto_tree_add_item(type_tree
, hf_lltd_qos_char_q
, tvb
, offset
+2, 4, ENC_BIG_ENDIAN
);
502 proto_tree_add_item(type_tree
, hf_lltd_qos_char_p
, tvb
, offset
+2, 4, ENC_BIG_ENDIAN
);
503 proto_tree_add_item(type_tree
, hf_lltd_qos_char_reserved
, tvb
, offset
+2, 4, ENC_BIG_ENDIAN
);
504 temp32
= tvb_get_ntohl(tvb
, offset
+2);
505 if (temp32
& LLTD_QOS_CHARACTERISTIC_RESERVE_MASK
)
506 expert_add_info(pinfo
, type_item
, &ei_lltd_char_reserved
);
509 case 0x15: /* 802.11 Physical Medium */
512 expert_add_info_format(pinfo
, tlv_item
, &ei_lltd_tlv_length_invalid
, "Invalid 802.11 Physical Medium length");
515 proto_tree_add_item(tlv_tree
, hf_lltd_80211_physical_medium
, tvb
, offset
+2, 1, ENC_BIG_ENDIAN
);
517 case 0x19: /* Sees-List Working Set */
520 expert_add_info_format(pinfo
, tlv_item
, &ei_lltd_tlv_length_invalid
, "Invalid Sees-List Working Set length");
523 proto_tree_add_item(tlv_tree
, hf_lltd_sees_list_working_set
, tvb
, offset
+2, 2, ENC_BIG_ENDIAN
);
525 case 0x1B: /* Repeater AP Lineage */
526 type_tree
= proto_tree_add_subtree(tree
, tvb
, offset
+2, length
, ett_repeater_ap_lineage
, NULL
, "Repeater AP Lineage");
527 for (i
= 0; i
< length
; i
+= 6)
528 proto_tree_add_item(type_tree
, hf_lltd_repeater_ap_lineage
, tvb
, offset
+2+i
, 6, ENC_NA
);
531 expert_add_info(pinfo
, tlv_item
, &ei_lltd_too_many_paths
);
533 case 0x0E: /* Icon Image */
534 case 0x16: /* AP Association Table */
535 case 0x18: /* Detailed Icon Image */
536 case 0x1A: /* Component Table */
537 case 0x1C: /* Repeater AP Table */
539 expert_add_info_format(pinfo
, tlv_item
, &ei_lltd_tlv_length_invalid
, "Invalid length");
542 expert_add_info_format(pinfo
, tlv_item
, &ei_lltd_tlv_type
, "Invalid TLV Type 0x%02x", type
);
550 dissect_lltd_discovery(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, int offset
)
552 proto_item
*header_item
, *func_item
;
553 proto_tree
*header_tree
, *func_tree
, *func_subtree
;
556 bool end_tlv
= false;
557 int loop_offset
, start_offset
;
559 func
= tvb_get_uint8(tvb
, offset
);
560 proto_tree_add_item(tree
, hf_lltd_discovery_func
, tvb
, offset
, 1, ENC_NA
);
561 col_add_str(pinfo
->cinfo
, COL_INFO
, val_to_str(func
, lltd_discovery_vals
, "Unknown (0x%02x)"));
564 /* Demultiplex header */
565 header_tree
= proto_tree_add_subtree(tree
, tvb
, offset
, 14, ett_base_header
, &header_item
, "Base header");
567 proto_tree_add_item(header_tree
, hf_lltd_discovery_real_dest_addr
, tvb
, offset
, 6, ENC_NA
);
568 proto_tree_add_item(header_tree
, hf_lltd_discovery_real_src_addr
, tvb
, offset
+6, 6, ENC_NA
);
570 proto_tree_add_item(header_tree
, hf_lltd_discovery_xid
, tvb
, offset
+12, 2, ENC_BIG_ENDIAN
);
572 proto_tree_add_item(header_tree
, hf_lltd_discovery_seq_num
, tvb
, offset
+12, 2, ENC_BIG_ENDIAN
);
576 case 0x00: /* Discover */
577 proto_tree_add_item(tree
, hf_lltd_discover_gen_num
, tvb
, offset
+14, 2, ENC_BIG_ENDIAN
);
578 proto_tree_add_item(tree
, hf_lltd_discover_num_stations
, tvb
, offset
+16, 2, ENC_BIG_ENDIAN
);
579 temp16
= tvb_get_ntohs(tvb
, offset
+16);
582 func_tree
= proto_tree_add_subtree(tree
, tvb
, offset
+18, temp16
*6, ett_discover_stations
, NULL
, "Stations");
583 for (loop_offset
= 0; loop_offset
< temp16
*6; loop_offset
+= 6)
584 proto_tree_add_item(func_tree
, hf_lltd_discover_station
, tvb
, offset
+18+loop_offset
, 6, ENC_NA
);
587 case 0x01: /* Hello */
588 proto_tree_add_item(tree
, hf_lltd_hello_gen_num
, tvb
, offset
+14, 2, ENC_BIG_ENDIAN
);
589 proto_tree_add_item(tree
, hf_lltd_hello_current_address
, tvb
, offset
+16, 6, ENC_NA
);
590 proto_tree_add_item(tree
, hf_lltd_hello_apparent_address
, tvb
, offset
+22, 6, ENC_NA
);
592 func_tree
= proto_tree_add_subtree(tree
, tvb
, offset
+28, 0, ett_tlv
, &func_item
, "TLVs");
593 start_offset
= loop_offset
= offset
+28;
594 while ((end_tlv
== false) && (tvb_reported_length_remaining(tvb
, loop_offset
) >= 1))
596 loop_offset
+= dissect_lltd_tlv(tvb
, pinfo
, func_tree
, loop_offset
, &end_tlv
);
598 proto_item_set_len(func_item
, loop_offset
-start_offset
);
600 case 0x02: /* Emit */
601 proto_tree_add_item(tree
, hf_lltd_emit_num_descs
, tvb
, offset
+14, 2, ENC_BIG_ENDIAN
);
602 temp16
= tvb_get_ntohs(tvb
, offset
+14);
605 func_tree
= proto_tree_add_subtree(tree
, tvb
, offset
+16, temp16
*14, ett_emitee_descs
, NULL
, "EmiteeDescs");
606 for (loop_offset
= 0; loop_offset
< temp16
*14; loop_offset
+= 14)
608 func_subtree
= proto_tree_add_subtree(func_tree
, tvb
, offset
+16+loop_offset
, 14, ett_emitee_descs_item
, NULL
, "EmiteeDescs Item");
610 proto_tree_add_item(func_subtree
, hf_lltd_emit_type
, tvb
, offset
+16+loop_offset
, 1, ENC_NA
);
611 proto_tree_add_item(func_subtree
, hf_lltd_emit_pause
, tvb
, offset
+16+loop_offset
+1, 1, ENC_NA
);
612 proto_tree_add_item(func_subtree
, hf_lltd_emit_src_addr
, tvb
, offset
+16+loop_offset
+2, 6, ENC_NA
);
613 proto_tree_add_item(func_subtree
, hf_lltd_emit_dest_addr
, tvb
, offset
+16+loop_offset
+8, 6, ENC_NA
);
617 case 0x07: /* QueryResp */
618 proto_tree_add_item(tree
, hf_lltd_queryresp_more_descs
, tvb
, offset
+14, 2, ENC_BIG_ENDIAN
);
619 proto_tree_add_item(tree
, hf_lltd_queryresp_memory_descs
, tvb
, offset
+14, 2, ENC_BIG_ENDIAN
);
620 proto_tree_add_item(tree
, hf_lltd_queryresp_num_descs
, tvb
, offset
+14, 2, ENC_BIG_ENDIAN
);
621 temp16
= tvb_get_ntohs(tvb
, offset
+14) & LLTD_QUERY_RESP_NUM_DESCS_MASK
;
624 func_tree
= proto_tree_add_subtree(tree
, tvb
, offset
+16, temp16
*20, ett_recvee_descs
, NULL
, "RecveeDescs");
625 for (loop_offset
= 0; loop_offset
< temp16
*14; loop_offset
+= 20)
627 func_subtree
= proto_tree_add_subtree(func_tree
, tvb
, offset
+16+loop_offset
, 20,
628 ett_recvee_descs_item
, NULL
, "RecveeDescs Item");
630 proto_tree_add_item(func_subtree
, hf_lltd_queryresp_type
, tvb
, offset
+16+loop_offset
, 2, ENC_BIG_ENDIAN
);
631 proto_tree_add_item(func_subtree
, hf_lltd_queryresp_real_src_addr
, tvb
, offset
+16+loop_offset
+2, 6, ENC_NA
);
632 proto_tree_add_item(func_subtree
, hf_lltd_queryresp_ethernet_src_addr
, tvb
, offset
+16+loop_offset
+8, 6, ENC_NA
);
633 proto_tree_add_item(func_subtree
, hf_lltd_queryresp_ethernet_dest_addr
, tvb
, offset
+16+loop_offset
+14, 6, ENC_NA
);
637 case 0x0A: /* Flat */
638 proto_tree_add_item(tree
, hf_lltd_flat_crc_bytes
, tvb
, offset
+14, 4, ENC_BIG_ENDIAN
);
639 proto_tree_add_item(tree
, hf_lltd_flat_crc_packets
, tvb
, offset
+18, 1, ENC_BIG_ENDIAN
);
641 case 0x0B: /* QueryLargeTlv */
642 proto_tree_add_item(tree
, hf_lltd_query_large_tlv_type
, tvb
, offset
+14, 1, ENC_BIG_ENDIAN
);
643 proto_tree_add_item(tree
, hf_lltd_query_large_tlv_offset
, tvb
, offset
+15, 3, ENC_BIG_ENDIAN
);
645 case 0x0C: /* QueryLargeTlvResp */
646 proto_tree_add_item(tree
, hf_lltd_querylargeresp_more_descs
, tvb
, offset
+14, 2, ENC_BIG_ENDIAN
);
647 proto_tree_add_item(tree
, hf_lltd_querylargeresp_memory_descs
, tvb
, offset
+14, 2, ENC_BIG_ENDIAN
);
648 proto_tree_add_item(tree
, hf_lltd_querylargeresp_num_descs
, tvb
, offset
+14, 2, ENC_BIG_ENDIAN
);
649 temp16
= tvb_get_ntohs(tvb
, offset
+14) & LLTD_QUERY_RESP_NUM_DESCS_MASK
;
651 proto_tree_add_item(tree
, hf_lltd_querylargeresp_data
, tvb
, offset
+16, temp16
, ENC_NA
);
653 case 0x03: /* Train */
654 case 0x04: /* Probe */
656 case 0x06: /* Query */
657 case 0x08: /* Reset */
658 case 0x09: /* Charge */
662 expert_add_info_format(pinfo
, header_item
, &ei_lltd_discovery_func
, "Invalid function 0x%02x", func
);
668 dissect_lltd_qos(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, int offset
)
670 proto_item
*header_item
;
671 proto_tree
*header_tree
, *func_tree
, *func_subtree
;
673 uint16_t seq_num
, temp16
;
676 func
= tvb_get_uint8(tvb
, offset
);
677 proto_tree_add_item(tree
, hf_lltd_qos_diag_func
, tvb
, offset
, 1, ENC_NA
);
678 col_add_str(pinfo
->cinfo
, COL_INFO
, val_to_str(func
, lltd_qos_diag_vals
, "Unknown (0x%02x)"));
681 header_tree
= proto_tree_add_subtree(tree
, tvb
, offset
, 14, ett_base_header
, &header_item
, "Base header");
683 proto_tree_add_item(header_tree
, hf_lltd_qos_real_dest_addr
, tvb
, offset
, 6, ENC_NA
);
684 proto_tree_add_item(header_tree
, hf_lltd_qos_real_src_addr
, tvb
, offset
+6, 6, ENC_NA
);
685 proto_tree_add_item(header_tree
, hf_lltd_qos_seq_num
, tvb
, offset
+12, 2, ENC_BIG_ENDIAN
);
686 seq_num
= tvb_get_ntohs(tvb
, offset
+12);
690 case 0x00: /* QosInitializeSink */
691 proto_tree_add_item(tree
, hf_lltd_qos_initialize_interrupt_mod
, tvb
, offset
+14, 1, ENC_BIG_ENDIAN
);
693 case 0x01: /* QosReady */
694 proto_tree_add_item(tree
, hf_lltd_qos_ready_sink_link_speed
, tvb
, offset
+14, 4, ENC_BIG_ENDIAN
);
695 proto_tree_add_item(tree
, hf_lltd_qos_ready_perf_count_freq
, tvb
, offset
+18, 8, ENC_BIG_ENDIAN
);
697 case 0x02: /* QosProbe */
698 proto_tree_add_item(tree
, hf_lltd_qos_probe_controller_transmit_timestamp
, tvb
, offset
+14, 8, ENC_BIG_ENDIAN
);
699 proto_tree_add_item(tree
, hf_lltd_qos_probe_sink_receive_timestamp
, tvb
, offset
+22, 8, ENC_BIG_ENDIAN
);
700 proto_tree_add_item(tree
, hf_lltd_qos_probe_sink_transmit_timestamp
, tvb
, offset
+30, 8, ENC_BIG_ENDIAN
);
701 proto_tree_add_item(tree
, hf_lltd_qos_probe_test_type
, tvb
, offset
+38, 1, ENC_BIG_ENDIAN
);
702 proto_tree_add_item(tree
, hf_lltd_qos_probe_packet_id
, tvb
, offset
+39, 1, ENC_BIG_ENDIAN
);
703 proto_tree_add_item(tree
, hf_lltd_qos_probe_t
, tvb
, offset
+40, 1, ENC_BIG_ENDIAN
);
704 proto_tree_add_item(tree
, hf_lltd_qos_probe_8021p_value
, tvb
, offset
+40, 1, ENC_BIG_ENDIAN
);
705 proto_tree_add_item(tree
, hf_lltd_qos_probe_payload
, tvb
, offset
+41, 5, ENC_NA
);
707 case 0x03: /* QosQuery */
708 case 0x07: /* QosAck */
710 expert_add_info(pinfo
, header_item
, &ei_lltd_qos_seq_num
);
713 case 0x04: /* QosQueryResp */
714 proto_tree_add_item(tree
, hf_lltd_qos_query_resp_r
, tvb
, offset
+14, 2, ENC_BIG_ENDIAN
);
715 proto_tree_add_item(tree
, hf_lltd_qos_query_resp_e
, tvb
, offset
+14, 2, ENC_BIG_ENDIAN
);
716 proto_tree_add_item(tree
, hf_lltd_qos_query_resp_num_events
, tvb
, offset
+14, 2, ENC_BIG_ENDIAN
);
717 temp16
= tvb_get_ntohs(tvb
, offset
+14) & LLTD_QUERY_RESP_NUM_DESCS_MASK
;
720 func_tree
= proto_tree_add_subtree(tree
, tvb
, offset
+16, temp16
*18, ett_qos_event_descs
, NULL
, "QosEventDesc");
721 for (loop_offset
= 0; loop_offset
< temp16
*18; loop_offset
+= 18)
723 func_subtree
= proto_tree_add_subtree(func_tree
, tvb
, offset
+16+loop_offset
, 18, ett_qos_event_item
, NULL
, "Qos Event");
725 proto_tree_add_item(func_subtree
, hf_lltd_qos_query_resp_controller_timestamp
, tvb
, offset
+16+loop_offset
, 8, ENC_BIG_ENDIAN
);
726 proto_tree_add_item(func_subtree
, hf_lltd_qos_query_resp_sink_timestamp
, tvb
, offset
+16+loop_offset
+8, 8, ENC_BIG_ENDIAN
);
727 proto_tree_add_item(func_subtree
, hf_lltd_qos_query_resp_packet_id
, tvb
, offset
+16+loop_offset
+16, 1, ENC_BIG_ENDIAN
);
728 proto_tree_add_item(func_subtree
, hf_lltd_qos_query_resp_reserved
, tvb
, offset
+16+loop_offset
+17, 1, ENC_BIG_ENDIAN
);
732 case 0x05: /* QosReset */
735 case 0x06: /* QosError */
736 proto_tree_add_item(tree
, hf_lltd_qos_error_value
, tvb
, offset
+14, 2, ENC_BIG_ENDIAN
);
738 case 0x08: /* QosCounterSnapshot */
740 expert_add_info(pinfo
, header_item
, &ei_lltd_qos_seq_num
);
741 proto_tree_add_item(tree
, hf_lltd_qos_count_snapshot_history
, tvb
, offset
+14, 1, ENC_BIG_ENDIAN
);
743 case 0x09: /* QosCounterResult */
744 proto_tree_add_item(tree
, hf_lltd_qos_counter_result_subsec_span
, tvb
, offset
+14, 1, ENC_BIG_ENDIAN
);
745 proto_tree_add_item(tree
, hf_lltd_qos_counter_result_byte_scale
, tvb
, offset
+15, 1, ENC_BIG_ENDIAN
);
746 proto_tree_add_item(tree
, hf_lltd_qos_counter_result_packet_scale
, tvb
, offset
+16, 1, ENC_BIG_ENDIAN
);
747 proto_tree_add_item(tree
, hf_lltd_qos_counter_result_history_size
, tvb
, offset
+17, 1, ENC_BIG_ENDIAN
);
748 temp16
= tvb_get_uint8(tvb
, offset
+17);
751 func_tree
= proto_tree_add_subtree(tree
, tvb
, offset
+18, temp16
*4, ett_qos_snapshot_list
, NULL
, "Snapshot List");
752 for (loop_offset
= 0; loop_offset
< temp16
*4; loop_offset
+= 4)
754 func_subtree
= proto_tree_add_subtree(func_tree
, tvb
, offset
+18+loop_offset
, 4, ett_qos_snapshot_item
, NULL
, "Snapshot");
756 proto_tree_add_item(func_subtree
, hf_lltd_qos_snapshot_bytes_recv
, tvb
, offset
+16+loop_offset
, 2, ENC_BIG_ENDIAN
);
757 proto_tree_add_item(func_subtree
, hf_lltd_qos_snapshot_packets_recv
, tvb
, offset
+16+loop_offset
+2, 2, ENC_BIG_ENDIAN
);
758 proto_tree_add_item(func_subtree
, hf_lltd_qos_snapshot_bytes_sent
, tvb
, offset
+16+loop_offset
+4, 2, ENC_BIG_ENDIAN
);
759 proto_tree_add_item(func_subtree
, hf_lltd_qos_snapshot_packets_sent
, tvb
, offset
+16+loop_offset
+6, 2, ENC_BIG_ENDIAN
);
763 case 0x0A: /* QosCounterLease */
767 expert_add_info_format(pinfo
, header_item
, &ei_lltd_qos_diag_func
, "Invalid function 0x%02x", func
);
773 dissect_lltd(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void *data _U_
)
776 proto_tree
*lltd_tree
;
779 col_set_str(pinfo
->cinfo
, COL_PROTOCOL
, "LLTD");
780 col_clear(pinfo
->cinfo
, COL_INFO
);
782 ti
= proto_tree_add_item(tree
, proto_lltd
, tvb
, 0, -1, ENC_NA
);
783 lltd_tree
= proto_item_add_subtree(ti
, ett_lltd
);
785 proto_tree_add_item(lltd_tree
, hf_lltd_version
, tvb
, 0, 1, ENC_NA
);
786 proto_tree_add_item(lltd_tree
, hf_lltd_type_of_service
, tvb
, 1, 1, ENC_NA
);
787 tos
= tvb_get_uint8(tvb
, 1);
788 proto_tree_add_item(lltd_tree
, hf_lltd_reserved
, tvb
, 2, 1, ENC_NA
);
792 case 0: /* Topology discovery */
793 case 1: /* Quick discovery */
794 dissect_lltd_discovery(tvb
, pinfo
, lltd_tree
, 3);
797 case 2: /* QoS Diagnostics */
798 dissect_lltd_qos(tvb
, pinfo
, lltd_tree
, 3);
802 expert_add_info_format(pinfo
, ti
, &ei_lltd_type_of_service
, "Invalid Type of Service value 0x%02x", tos
);
806 return tvb_captured_length(tvb
);
810 proto_register_lltd(void)
812 static hf_register_info hf
[] = {
814 { &hf_lltd_version
, {"Version", "lltd.version", FT_UINT8
, BASE_DEC
, NULL
, 0, NULL
, HFILL
}},
815 { &hf_lltd_type_of_service
, {"Type of Service", "lltd.tos", FT_UINT8
, BASE_HEX
, VALS(lltd_tos_vals
), 0, NULL
, HFILL
}},
816 { &hf_lltd_reserved
, {"Reserved", "lltd.reserved", FT_UINT8
, BASE_HEX
, NULL
, 0, NULL
, HFILL
}},
817 { &hf_lltd_discovery_func
, {"Discovery function", "lltd.discovery", FT_UINT8
, BASE_HEX
, VALS(lltd_discovery_vals
), 0, NULL
, HFILL
}},
818 { &hf_lltd_discovery_real_dest_addr
, { "Real Destination Address", "lltd.discovery.real_dest_addr", FT_ETHER
, BASE_NONE
, NULL
, 0, NULL
, HFILL
}},
819 { &hf_lltd_discovery_real_src_addr
, { "Real Source Address", "lltd.discovery.real_src_addr", FT_ETHER
, BASE_NONE
, NULL
, 0, NULL
, HFILL
}},
820 { &hf_lltd_discovery_xid
, {"XID", "lltd.discovery.xid", FT_UINT16
, BASE_HEX
, NULL
, 0, NULL
, HFILL
}},
821 { &hf_lltd_discovery_seq_num
, {"Sequence Number", "lltd.discovery.seq_num", FT_UINT16
, BASE_HEX
, NULL
, 0, NULL
, HFILL
}},
822 { &hf_lltd_discover_gen_num
, {"Generation Number", "lltd.discover.gen_num", FT_UINT16
, BASE_HEX
, NULL
, 0, NULL
, HFILL
}},
823 { &hf_lltd_discover_num_stations
, {"Number of Stations", "lltd.discover.num_stations", FT_UINT16
, BASE_DEC
, NULL
, 0, NULL
, HFILL
}},
824 { &hf_lltd_discover_station
, { "Station", "lltd.discover.station", FT_ETHER
, BASE_NONE
, NULL
, 0, NULL
, HFILL
}},
825 { &hf_lltd_hello_gen_num
, {"Generation Number", "lltd.hello.gen_num", FT_UINT16
, BASE_HEX
, NULL
, 0, NULL
, HFILL
}},
826 { &hf_lltd_hello_current_address
, { "Current Mapper Address", "lltd.hello.current_address", FT_ETHER
, BASE_NONE
, NULL
, 0, NULL
, HFILL
}},
827 { &hf_lltd_hello_apparent_address
, { "Current Apparent Address", "lltd.hello.apparent_address", FT_ETHER
, BASE_NONE
, NULL
, 0, NULL
, HFILL
}},
828 { &hf_lltd_tlv_type
, {"Type", "lltd.tlv.type", FT_UINT8
, BASE_HEX
, VALS(lltd_tlv_type_vals
), 0, NULL
, HFILL
}},
829 { &hf_lltd_tlv_length
, {"Length", "lltd.tlv.length", FT_UINT8
, BASE_DEC
, NULL
, 0, NULL
, HFILL
}},
830 { &hf_lltd_host_id
, { "Host ID", "lltd.host_id", FT_ETHER
, BASE_NONE
, NULL
, 0, NULL
, HFILL
}},
831 { &hf_lltd_char_p
, {"Public NAT", "lltd.characteristic.public_nat", FT_BOOLEAN
, 32, NULL
, LLTD_CHARACTERISTIC_P_MASK
, NULL
, HFILL
}},
832 { &hf_lltd_char_x
, {"Private NAT", "lltd.characteristic.private_nat", FT_BOOLEAN
, 32, NULL
, LLTD_CHARACTERISTIC_X_MASK
, NULL
, HFILL
}},
833 { &hf_lltd_char_f
, {"Duplex", "lltd.characteristic.duplex", FT_BOOLEAN
, 32, TFS(&tfs_full_half_duplex
), LLTD_CHARACTERISTIC_F_MASK
, NULL
, HFILL
}},
834 { &hf_lltd_char_m
, {"Management Web Page", "lltd.characteristic.web_page", FT_BOOLEAN
, 32, TFS(&tfs_present_absent
), LLTD_CHARACTERISTIC_M_MASK
, NULL
, HFILL
}},
835 { &hf_lltd_char_l
, {"Looping Outbound Packets", "lltd.characteristic.loop", FT_BOOLEAN
, 32, NULL
, LLTD_CHARACTERISTIC_L_MASK
, NULL
, HFILL
}},
836 { &hf_lltd_char_reserved
, {"Reserved", "lltd.characteristic.reserved", FT_UINT32
, BASE_HEX
, NULL
, LLTD_CHARACTERISTIC_RESERVE_MASK
, NULL
, HFILL
}},
837 { &hf_lltd_physical_medium
, {"Physical Medium", "lltd.physical_medium", FT_UINT32
, BASE_DEC
, NULL
, 0, NULL
, HFILL
}},
838 { &hf_lltd_wireless_mode
, {"Wireless Mode", "lltd.wireless_mode", FT_UINT8
, BASE_HEX
, VALS(lltd_wireless_mode_vals
), 0, NULL
, HFILL
}},
839 { &hf_lltd_bssid
, { "BSSID", "lltd.bssid", FT_ETHER
, BASE_NONE
, NULL
, 0, NULL
, HFILL
}},
840 { &hf_lltd_ssid
, { "SSID", "lltd.ssid", FT_STRING
, BASE_NONE
, NULL
, 0, NULL
, HFILL
}},
841 { &hf_lltd_ipv4_address
, { "IPv4 Address", "lltd.ipv4_address", FT_IPv4
, BASE_NONE
, NULL
, 0, NULL
, HFILL
}},
842 { &hf_lltd_ipv6_address
, { "IPv6 Address", "lltd.ipv6_address", FT_IPv6
, BASE_NONE
, NULL
, 0, NULL
, HFILL
}},
843 { &hf_lltd_max_operation_rate
, {"Maximum Operational Rate (.5 Mbps)", "lltd.max_operation_rate", FT_UINT16
, BASE_DEC
, NULL
, 0, NULL
, HFILL
}},
844 { &hf_lltd_performance_count_freq
, {"Performance Counter Frequency", "lltd.performance_count_freq", FT_UINT64
, BASE_DEC
, NULL
, 0, NULL
, HFILL
}},
845 { &hf_lltd_link_speed
, {"Link Speed (100 bps)", "lltd.link_speed", FT_UINT32
, BASE_DEC
, NULL
, 0, NULL
, HFILL
}},
846 { &hf_lltd_rssi
, {"RSSI", "lltd.rssi", FT_INT32
, BASE_DEC
, NULL
, 0, NULL
, HFILL
}},
847 { &hf_lltd_machine_name
, { "Machine Name", "lltd.machine_name", FT_STRING
/*FT_UCS2_LE */, BASE_NONE
, NULL
, 0, NULL
, HFILL
}},
848 { &hf_lltd_support_info
, { "Support Information", "lltd.support_info", FT_STRING
/*FT_UCS2_LE */, BASE_NONE
, NULL
, 0, NULL
, HFILL
}},
849 { &hf_lltd_device_uuid
, { "Device UUID", "lltd.device_uuid", FT_GUID
, BASE_NONE
, NULL
, 0, NULL
, HFILL
}},
850 { &hf_lltd_qos_char_e
, {"Layer 2 Forwarding", "lltd.qos_characteristic.layer2_forwarding", FT_BOOLEAN
, 32, NULL
, LLTD_QOS_CHARACTERISTIC_E_MASK
, NULL
, HFILL
}},
851 { &hf_lltd_qos_char_q
, {"802.1q VLAN", "lltd.qos_characteristic.vlan", FT_BOOLEAN
, 32, TFS(&tfs_supported_not_supported
), LLTD_QOS_CHARACTERISTIC_Q_MASK
, NULL
, HFILL
}},
852 { &hf_lltd_qos_char_p
, {"802.1q Priority Tagging", "lltd.qos_characteristic.tagging", FT_BOOLEAN
, 32, TFS(&tfs_supported_not_supported
), LLTD_QOS_CHARACTERISTIC_P_MASK
, NULL
, HFILL
}},
853 { &hf_lltd_qos_char_reserved
, {"Reserved", "lltd.qos_characteristic.reserved", FT_UINT32
, BASE_HEX
, NULL
, LLTD_QOS_CHARACTERISTIC_RESERVE_MASK
, NULL
, HFILL
}},
854 { &hf_lltd_80211_physical_medium
, {"802.11 Physical Medium", "lltd.80211_physical_medium", FT_UINT8
, BASE_HEX
, VALS(lltd_80211_physical_medium_vals
), 0, NULL
, HFILL
}},
855 { &hf_lltd_sees_list_working_set
, {"Sees-List Working Set", "lltd.sees_list_working_set", FT_UINT16
, BASE_DEC
, NULL
, 0, NULL
, HFILL
}},
856 { &hf_lltd_repeater_ap_lineage
, { "Address Path to Root", "lltd.address_path_to_root", FT_ETHER
, BASE_NONE
, NULL
, 0, NULL
, HFILL
}},
857 { &hf_lltd_emit_num_descs
, {"Number of EmiteeDescs", "lltd.emit.num_descs", FT_UINT16
, BASE_DEC
, NULL
, 0, NULL
, HFILL
}},
858 { &hf_lltd_emit_type
, {"Type", "lltd.emit.type", FT_UINT8
, BASE_HEX
, VALS(lltd_emit_type_vals
), 0, NULL
, HFILL
}},
859 { &hf_lltd_emit_pause
, {"Pause (ms)", "lltd.emit.pause", FT_UINT8
, BASE_DEC
, NULL
, 0, NULL
, HFILL
}},
860 { &hf_lltd_emit_src_addr
, { "Source Address", "lltd.emit.src_addr", FT_ETHER
, BASE_NONE
, NULL
, 0, NULL
, HFILL
}},
861 { &hf_lltd_emit_dest_addr
, { "Destination Address", "lltd.emit.dest_addr", FT_ETHER
, BASE_NONE
, NULL
, 0, NULL
, HFILL
}},
862 { &hf_lltd_queryresp_more_descs
, {"More RecveeDescs", "lltd.queryresp.more", FT_BOOLEAN
, 16, NULL
, LLTD_QUERY_RESP_M_MASK
, NULL
, HFILL
}},
863 { &hf_lltd_queryresp_memory_descs
, {"No memory left", "lltd.queryresp.memory", FT_BOOLEAN
, 16, NULL
, LLTD_QUERY_RESP_E_MASK
, NULL
, HFILL
}},
864 { &hf_lltd_queryresp_num_descs
, {"Number of RecveeDescs", "lltd.queryresp.num_descs", FT_UINT16
, BASE_DEC
, NULL
, LLTD_QUERY_RESP_NUM_DESCS_MASK
, NULL
, HFILL
}},
865 { &hf_lltd_queryresp_type
, {"Type", "lltd.queryresp.type", FT_UINT16
, BASE_HEX
, VALS(lltd_queryresp_type_vals
), 0, NULL
, HFILL
}},
866 { &hf_lltd_queryresp_real_src_addr
, { "Real Source Address", "lltd.queryresp.real_src_addr", FT_ETHER
, BASE_NONE
, NULL
, 0, NULL
, HFILL
}},
867 { &hf_lltd_queryresp_ethernet_src_addr
, { "Ethernet Source Address", "lltd.queryresp.ethernet_src_addr", FT_ETHER
, BASE_NONE
, NULL
, 0, NULL
, HFILL
}},
868 { &hf_lltd_queryresp_ethernet_dest_addr
, { "Ethernet Destination Address", "lltd.queryresp.ethernet_dest_addr", FT_ETHER
, BASE_NONE
, NULL
, 0, NULL
, HFILL
}},
869 { &hf_lltd_flat_crc_bytes
, {"Current Transmit Credit (bytes)", "lltd.flat.crc_bytes", FT_UINT32
, BASE_DEC
, NULL
, 0, NULL
, HFILL
}},
870 { &hf_lltd_flat_crc_packets
, {"Current Transmit Credit (packets)", "lltd.flat.crc_packets", FT_UINT8
, BASE_DEC
, NULL
, 0, NULL
, HFILL
}},
871 { &hf_lltd_query_large_tlv_type
, {"Type", "lltd.query_large_tlv.type", FT_UINT8
, BASE_HEX
, VALS(lltd_query_large_tlv_type_vals
), 0, NULL
, HFILL
}},
872 { &hf_lltd_query_large_tlv_offset
, {"Offset", "lltd.query_large_tlv.offset", FT_UINT24
, BASE_DEC
, NULL
, 0, NULL
, HFILL
}},
873 { &hf_lltd_querylargeresp_more_descs
, {"More RecveeDescs", "lltd.querylargeresp.more", FT_BOOLEAN
, 16, NULL
, LLTD_QUERY_RESP_M_MASK
, NULL
, HFILL
}},
874 { &hf_lltd_querylargeresp_memory_descs
, {"No memory left", "lltd.querylargeresp.memory", FT_BOOLEAN
, 16, NULL
, LLTD_QUERY_RESP_E_MASK
, NULL
, HFILL
}},
875 { &hf_lltd_querylargeresp_num_descs
, {"Number of RecveeDescs", "lltd.querylargeresp.num_descs", FT_UINT16
, BASE_DEC
, NULL
, LLTD_QUERY_RESP_NUM_DESCS_MASK
, NULL
, HFILL
}},
876 { &hf_lltd_querylargeresp_data
, { "Data", "lltd.querylargeresp.data", FT_BYTES
, BASE_NONE
, NULL
, 0, NULL
, HFILL
}},
878 { &hf_lltd_qos_diag_func
, {"QoS Diagnostics function", "lltd.qos_diag", FT_UINT8
, BASE_HEX
, VALS(lltd_qos_diag_vals
), 0, NULL
, HFILL
}},
879 { &hf_lltd_qos_real_dest_addr
, { "Real Destination Address", "lltd.qos.real_dest_addr", FT_ETHER
, BASE_NONE
, NULL
, 0, NULL
, HFILL
}},
880 { &hf_lltd_qos_real_src_addr
, { "Real Source Address", "lltd.qos.real_src_addr", FT_ETHER
, BASE_NONE
, NULL
, 0, NULL
, HFILL
}},
881 { &hf_lltd_qos_seq_num
, {"Sequence Number", "lltd.qos.seq_num", FT_UINT16
, BASE_HEX
, NULL
, 0, NULL
, HFILL
}},
882 { &hf_lltd_qos_initialize_interrupt_mod
, {"Interrupt Mod", "lltd.qos_initialize.interrupt_mod", FT_UINT8
, BASE_HEX
, VALS(lltd_interrupt_mod_vals
), 0, NULL
, HFILL
}},
883 { &hf_lltd_qos_ready_sink_link_speed
, {"Sink Link Speed (100 bps)", "lltd.qos_ready.sink_link_speed", FT_UINT32
, BASE_DEC
, NULL
, 0, NULL
, HFILL
}},
884 { &hf_lltd_qos_ready_perf_count_freq
, {"Performance Counter Frequency", "lltd.qos_ready.performance_count_freq", FT_UINT64
, BASE_DEC
, NULL
, 0, NULL
, HFILL
}},
885 { &hf_lltd_qos_probe_controller_transmit_timestamp
, {"Controller Transmit Timestamp", "lltd.qos_probe.controller_transmit_timestamp", FT_UINT64
, BASE_DEC
, NULL
, 0, NULL
, HFILL
}},
886 { &hf_lltd_qos_probe_sink_receive_timestamp
, {"Sink Receive Timestamp", "lltd.qos_probe.sink_receive_timestamp", FT_UINT64
, BASE_DEC
, NULL
, 0, NULL
, HFILL
}},
887 { &hf_lltd_qos_probe_sink_transmit_timestamp
, {"Sink Transmit Timestamp", "lltd.qos_probe.sink_transmit_timestamp", FT_UINT64
, BASE_DEC
, NULL
, 0, NULL
, HFILL
}},
888 { &hf_lltd_qos_probe_test_type
, {"Test Type", "lltd.qos_probe.test_type", FT_UINT8
, BASE_HEX
, VALS(lltd_qos_probe_test_type_vals
), 0, NULL
, HFILL
}},
889 { &hf_lltd_qos_probe_packet_id
, {"Packet ID", "lltd.qos_probe.packet_id", FT_UINT8
, BASE_HEX
, NULL
, 0, NULL
, HFILL
}},
890 { &hf_lltd_qos_probe_t
, {"802.1p Tag", "lltd.qos_probe.tag", FT_BOOLEAN
, 8, TFS(&tfs_present_not_present
), 0x80, NULL
, HFILL
}},
891 { &hf_lltd_qos_probe_8021p_value
, {"802.1p Value", "lltd.qos_probe.value", FT_UINT8
, BASE_DEC
, NULL
, 0x7F, NULL
, HFILL
}},
892 { &hf_lltd_qos_probe_payload
, {"Payload", "lltd.qos_probe.payload", FT_BYTES
, BASE_NONE
, NULL
, 0, NULL
, HFILL
}},
893 { &hf_lltd_qos_error_value
, {"Error Code", "lltd.qos_error", FT_UINT16
, BASE_DEC
, VALS(lltd_qos_error_vals
), 0, NULL
, HFILL
}},
894 { &hf_lltd_qos_count_snapshot_history
, {"History Size", "lltd.qos_count_snapshot.history", FT_UINT8
, BASE_DEC
, NULL
, 0, NULL
, HFILL
}},
895 { &hf_lltd_qos_query_resp_r
, {"Receipt", "lltd.qos_query_resp.receipt", FT_BOOLEAN
, 16, NULL
, LLTD_QUERY_RESP_M_MASK
, NULL
, HFILL
}},
896 { &hf_lltd_qos_query_resp_e
, {"No memory left", "lltd.qos_query_resp.memory", FT_BOOLEAN
, 16, NULL
, LLTD_QUERY_RESP_E_MASK
, NULL
, HFILL
}},
897 { &hf_lltd_qos_query_resp_num_events
, {"Number of Events", "lltd.qos_query_resp.num_events", FT_UINT16
, BASE_DEC
, NULL
, LLTD_QUERY_RESP_NUM_DESCS_MASK
, NULL
, HFILL
}},
898 { &hf_lltd_qos_query_resp_controller_timestamp
, {"Controller Transmit Timestamp", "lltd.qos_query_resp.controller_timestamp", FT_UINT64
, BASE_DEC
, NULL
, 0, NULL
, HFILL
}},
899 { &hf_lltd_qos_query_resp_sink_timestamp
, {"Sink Receive Timestamp", "lltd.qos_query_resp.sink_timestamp", FT_UINT64
, BASE_DEC
, NULL
, 0, NULL
, HFILL
}},
900 { &hf_lltd_qos_query_resp_packet_id
, {"Packet ID", "lltd.qos_query_resp.packet_id", FT_UINT8
, BASE_HEX
, NULL
, 0, NULL
, HFILL
}},
901 { &hf_lltd_qos_query_resp_reserved
, {"Reserved", "lltd.qos_query_resp.reserved", FT_UINT8
, BASE_HEX
, NULL
, 0, NULL
, HFILL
}},
902 { &hf_lltd_qos_counter_result_subsec_span
, {"Subsecond Span (1/256th sec)", "lltd.qos_counter_result.subsec_span", FT_UINT8
, BASE_DEC
, NULL
, 0, NULL
, HFILL
}},
903 { &hf_lltd_qos_counter_result_byte_scale
, {"Byte Scale (kb)", "lltd.qos_counter_result.byte_scale", FT_UINT8
, BASE_DEC
, NULL
, 0, NULL
, HFILL
}},
904 { &hf_lltd_qos_counter_result_packet_scale
, {"Packet Scale", "lltd.qos_counter_result.packet_scale", FT_UINT8
, BASE_DEC
, NULL
, 0, NULL
, HFILL
}},
905 { &hf_lltd_qos_counter_result_history_size
, {"History Size", "lltd.qos_counter_result.history_size", FT_UINT8
, BASE_DEC
, NULL
, 0, NULL
, HFILL
}},
906 { &hf_lltd_qos_snapshot_bytes_recv
, {"Bytes Received", "lltd.qos_snapshot.bytes_recv", FT_UINT16
, BASE_DEC
, NULL
, 0, NULL
, HFILL
}},
907 { &hf_lltd_qos_snapshot_packets_recv
, {"Packets Received", "lltd.qos_snapshot.packets_recv", FT_UINT16
, BASE_DEC
, NULL
, 0, NULL
, HFILL
}},
908 { &hf_lltd_qos_snapshot_bytes_sent
, {"Bytes Sent", "lltd.qos_snapshot.bytes_sent", FT_UINT16
, BASE_DEC
, NULL
, 0, NULL
, HFILL
}},
909 { &hf_lltd_qos_snapshot_packets_sent
, {"Packets Sent", "lltd.qos_snapshot.packets_sent", FT_UINT16
, BASE_DEC
, NULL
, 0, NULL
, HFILL
}}
912 static int *ett
[] = {
915 &ett_discover_stations
,
918 &ett_characteristics
,
919 &ett_qos_characteristics
,
920 &ett_repeater_ap_lineage
,
922 &ett_emitee_descs_item
,
924 &ett_recvee_descs_item
,
925 &ett_qos_event_descs
,
927 &ett_qos_snapshot_list
,
928 &ett_qos_snapshot_item
931 static ei_register_info ei
[] = {
932 { &ei_lltd_tlv_length_invalid
, { "lltd.tlv.length.invalid", PI_MALFORMED
, PI_ERROR
, "Invalid length", EXPFILL
}},
933 { &ei_lltd_char_reserved
, { "lltd.characteristic.reserved.not_zero", PI_PROTOCOL
, PI_WARN
, "Non zero reserve bits", EXPFILL
}},
934 { &ei_lltd_too_many_paths
, { "lltd.too_many_paths", PI_PROTOCOL
, PI_WARN
, "Too many paths to root", EXPFILL
}},
935 { &ei_lltd_tlv_type
, { "lltd.tlv.type.invalid", PI_PROTOCOL
, PI_WARN
, "Invalid TLV Type", EXPFILL
}},
936 { &ei_lltd_discovery_func
, { "lltd.discovery.invalid", PI_PROTOCOL
, PI_WARN
, "Invalid function", EXPFILL
}},
937 { &ei_lltd_qos_seq_num
, { "lltd.qos.seq_num.cannot_be_zero", PI_PROTOCOL
, PI_WARN
, "Sequence number can not be 0", EXPFILL
}},
938 { &ei_lltd_qos_diag_func
, { "lltd.qos_diag.invalid", PI_PROTOCOL
, PI_WARN
, "Invalid function", EXPFILL
}},
939 { &ei_lltd_type_of_service
, { "lltd.tos.invalid", PI_PROTOCOL
, PI_WARN
, "Invalid Type of Service value", EXPFILL
}},
942 expert_module_t
* expert_lltd
;
944 proto_lltd
= proto_register_protocol("Link Layer Topology Discovery", "LLTD", "lltd");
945 proto_register_field_array(proto_lltd
, hf
, array_length(hf
));
946 proto_register_subtree_array(ett
, array_length(ett
));
947 expert_lltd
= expert_register_protocol(proto_lltd
);
948 expert_register_field_array(expert_lltd
, ei
, array_length(ei
));
950 lltd_handle
= register_dissector("lltd", dissect_lltd
, proto_lltd
);
954 proto_reg_handoff_lltd(void)
956 dissector_add_uint("ethertype", ETHERTYPE_LLTD
, lltd_handle
);
960 * Editor modelines - https://www.wireshark.org/tools/modelines.html
965 * indent-tabs-mode: nil
968 * vi: set shiftwidth=4 tabstop=8 expandtab:
969 * :indentSize=4:tabSize=8:noTabs=true: