epan/dissectors/pidl/samr/samr.cnf cnf_dissect_lsa_BinaryString => lsarpc_dissect_str...
[wireshark-sm.git] / epan / dissectors / packet-elmi.c
blob0a2f6a0e6e5b9215cc91c76b141cd2db9b545bd0
1 /* packet-elmi.c
2 * Routines for Ethernet Local Management Interface (E-LMI) dissection
3 * Copyright 2014, Martin Kaiser <martin@kaiser.cx>
5 * based on a dissector written in lua
6 * Copyright 2013, Werner Fischer (fischer-interactive.de)
8 * Wireshark - Network traffic analyzer
9 * By Gerald Combs <gerald@wireshark.org>
10 * Copyright 1998 Gerald Combs
12 * SPDX-License-Identifier: GPL-2.0-or-later
15 /* E-LMI is defined in the MEF16 specification from Metro Ethernet Forum
16 http://www.metroethernetforum.org/PDF_Documents/technical-specifications/MEF16.pdf */
18 #include "config.h"
20 #include <epan/packet.h>
21 #include <epan/etypes.h>
22 #include <epan/tfs.h>
24 static int proto_elmi;
26 void proto_register_elmi(void);
27 void proto_reg_handoff_elmi(void);
29 static dissector_handle_t elmi_handle;
31 static int ett_elmi;
32 static int ett_elmi_info_elem;
33 static int ett_elmi_sub_info_elem;
35 static int hf_elmi_ver;
36 static int hf_elmi_msg_type;
37 static int hf_elmi_info_elem;
38 static int hf_elmi_info_elem_len;
39 static int hf_elmi_report_type;
40 static int hf_elmi_snd_seq_num;
41 static int hf_elmi_rcv_seq_num;
42 static int hf_elmi_dat_inst;
43 static int hf_elmi_reserved;
44 static int hf_elmi_uni_status;
45 static int hf_elmi_evc_refid;
46 static int hf_elmi_evc_status;
47 static int hf_last_ie;
48 static int hf_map_seq;
49 static int hf_priority;
50 static int hf_default_evc;
51 static int hf_elmi_sub_info_elem;
52 static int hf_elmi_sub_info_elem_len;
53 static int hf_elmi_uni_id;
54 static int hf_elmi_evc_type;
55 static int hf_elmi_evc_id;
56 static int hf_elmi_ce_vlan_id;
57 static int hf_elmi_sub_info_color_mode_flag;
58 static int hf_elmi_sub_info_coupling_flag;
59 static int hf_elmi_sub_info_per_cos_bit;
60 static int hf_elmi_sub_cir_magnitude;
61 static int hf_elmi_sub_cir_multiplier;
62 static int hf_elmi_sub_cbs_magnitude;
63 static int hf_elmi_sub_cbs_multiplier;
64 static int hf_elmi_sub_eir_magnitude;
65 static int hf_elmi_sub_eir_multiplier;
66 static int hf_elmi_sub_ebs_magnitude;
67 static int hf_elmi_sub_ebs_multiplier;
68 static int hf_elmi_sub_user_prio_0;
69 static int hf_elmi_sub_user_prio_1;
70 static int hf_elmi_sub_user_prio_2;
71 static int hf_elmi_sub_user_prio_3;
72 static int hf_elmi_sub_user_prio_4;
73 static int hf_elmi_sub_user_prio_5;
74 static int hf_elmi_sub_user_prio_6;
75 static int hf_elmi_sub_user_prio_7;
77 static const value_string elmi_msg_type[] = {
78 { 0x75, "Status enquiry" },
79 { 0x7D, "Status" },
80 { 0, NULL }
83 #define TAG_REPORT_TYPE 0x01
84 #define TAG_SEQ_NUM 0x02
85 #define TAG_DATA_INST 0x03
86 #define TAG_UNI_STATUS 0x11
87 #define TAG_EVC_STATUS 0x21
88 #define TAG_VLAN_EVC 0x22
90 static const value_string elmi_info_elem_tag[] = {
91 { TAG_REPORT_TYPE, "Report type" },
92 { TAG_SEQ_NUM, "Sequence numbers" },
93 { TAG_DATA_INST, "Data instance" },
94 { TAG_UNI_STATUS, "UNI Status" },
95 { TAG_EVC_STATUS, "EVC Status" },
96 { TAG_VLAN_EVC, "CE-VLAN ID/EVC Map" },
97 { 0, NULL }
100 static const value_string elmi_report_type[] = {
101 { 0x00, "Full status" },
102 { 0x01, "E-LMI check" },
103 { 0x02, "Single EVC async status" },
104 { 0x03, "Full status continued" },
105 { 0, NULL }
108 #define SUB_TAG_UNI_ID 0x51
109 #define SUB_TAG_EVC_PRM 0x61
110 #define SUB_TAG_EVC_ID 0x62
111 #define SUB_TAG_EVC_MAP 0x63
112 #define SUB_TAG_BW_PRO 0x71
114 static const value_string elmi_sub_info_elem_tag[] = {
115 { SUB_TAG_UNI_ID, "UNI Identifier" },
116 { SUB_TAG_EVC_PRM, "EVC Parameters" },
117 { SUB_TAG_EVC_ID, "EVC Identifier" },
118 { SUB_TAG_EVC_MAP, "EVC Map Entry" },
119 { SUB_TAG_BW_PRO, "Bandwidth Profile" },
120 { 0, NULL }
123 static const value_string elmi_vlan_id_evc_map_type[] = {
124 { 0x01, "All to one binding" },
125 { 0x02, "Service Multiplexing with no bundling" },
126 { 0x03, "Bundling" },
127 { 0, NULL }
130 static const value_string elmi_evc_status_type[] = {
131 { 0x00, "Not Active" },
132 { 0x01, "New and Not Active" },
133 { 0x02, "Active" },
134 { 0x03, "New and Active" },
135 { 0x04, "Partially Active" },
136 { 0x05, "New and Partially Active" },
137 { 0, NULL }
140 static const value_string elmi_evc_type[] = {
141 { 0x00, "Point-to-Point EVC" },
142 { 0x01, "Multipoint-to-Multipoint EVC" },
143 { 0, NULL }
146 static int
147 dissect_elmi_sub_info_elem(
148 tvbuff_t *tvb, int offset, proto_tree *tree)
150 int offset_start;
151 uint8_t sub_tag, len;
152 proto_item *tree_pi;
153 proto_tree *sub_info_elem_tree = tree;
155 offset_start = offset;
157 sub_tag = tvb_get_uint8(tvb, offset);
158 len = tvb_get_uint8(tvb, offset + 1);
160 sub_info_elem_tree = proto_tree_add_subtree_format(
161 tree, tvb, offset, len + 2, ett_elmi_sub_info_elem, &tree_pi,
162 "Sub-information element: %s", val_to_str_const(sub_tag, elmi_sub_info_elem_tag, "unknown"));
164 proto_tree_add_item(sub_info_elem_tree, hf_elmi_sub_info_elem, tvb, offset, 1, ENC_BIG_ENDIAN);
165 offset++;
167 proto_tree_add_item(sub_info_elem_tree, hf_elmi_sub_info_elem_len, tvb, offset, 1, ENC_BIG_ENDIAN);
168 offset++;
170 switch (sub_tag) {
171 case SUB_TAG_UNI_ID:
172 proto_tree_add_item(sub_info_elem_tree, hf_elmi_uni_id, tvb, offset, len, ENC_ASCII);
173 offset += len;
174 break;
175 case SUB_TAG_EVC_PRM:
176 proto_tree_add_item(sub_info_elem_tree, hf_elmi_evc_type, tvb, offset, 1, ENC_BIG_ENDIAN);
177 offset++;
178 break;
179 case SUB_TAG_EVC_ID:
180 proto_tree_add_item(sub_info_elem_tree, hf_elmi_evc_id, tvb, offset, len, ENC_ASCII);
181 offset += len;
182 break;
183 case SUB_TAG_EVC_MAP:
184 while(offset < (offset_start + len + 2)) {
185 proto_tree_add_item(sub_info_elem_tree, hf_elmi_ce_vlan_id, tvb, offset, 2, ENC_BIG_ENDIAN);
186 offset += 2;
188 break;
189 case SUB_TAG_BW_PRO:
190 proto_tree_add_item(sub_info_elem_tree, hf_elmi_sub_info_color_mode_flag, tvb, offset, 1, ENC_BIG_ENDIAN);
191 proto_tree_add_item(sub_info_elem_tree, hf_elmi_sub_info_coupling_flag, tvb, offset, 1, ENC_BIG_ENDIAN);
192 proto_tree_add_item(sub_info_elem_tree, hf_elmi_sub_info_per_cos_bit, tvb, offset, 1, ENC_BIG_ENDIAN);
193 offset++;
195 proto_tree_add_item(sub_info_elem_tree, hf_elmi_sub_cir_magnitude, tvb, offset, 1, ENC_BIG_ENDIAN);
196 offset++;
197 proto_tree_add_item(sub_info_elem_tree, hf_elmi_sub_cir_multiplier, tvb, offset, 2, ENC_BIG_ENDIAN);
198 offset += 2;
200 proto_tree_add_item(sub_info_elem_tree, hf_elmi_sub_cbs_magnitude, tvb, offset, 1, ENC_BIG_ENDIAN);
201 offset++;
202 proto_tree_add_item(sub_info_elem_tree, hf_elmi_sub_cbs_multiplier, tvb, offset, 1, ENC_BIG_ENDIAN);
203 offset++;
205 proto_tree_add_item(sub_info_elem_tree, hf_elmi_sub_eir_magnitude, tvb, offset, 1, ENC_BIG_ENDIAN);
206 offset++;
207 proto_tree_add_item(sub_info_elem_tree, hf_elmi_sub_eir_multiplier, tvb, offset, 2, ENC_BIG_ENDIAN);
208 offset += 2;
210 proto_tree_add_item(sub_info_elem_tree, hf_elmi_sub_ebs_magnitude, tvb, offset, 1, ENC_BIG_ENDIAN);
211 offset++;
212 proto_tree_add_item(sub_info_elem_tree, hf_elmi_sub_ebs_multiplier, tvb, offset, 1, ENC_BIG_ENDIAN);
213 offset++;
215 proto_tree_add_item(sub_info_elem_tree, hf_elmi_sub_user_prio_0, tvb, offset, 1, ENC_BIG_ENDIAN);
216 proto_tree_add_item(sub_info_elem_tree, hf_elmi_sub_user_prio_1, tvb, offset, 1, ENC_BIG_ENDIAN);
217 proto_tree_add_item(sub_info_elem_tree, hf_elmi_sub_user_prio_2, tvb, offset, 1, ENC_BIG_ENDIAN);
218 proto_tree_add_item(sub_info_elem_tree, hf_elmi_sub_user_prio_3, tvb, offset, 1, ENC_BIG_ENDIAN);
219 proto_tree_add_item(sub_info_elem_tree, hf_elmi_sub_user_prio_4, tvb, offset, 1, ENC_BIG_ENDIAN);
220 proto_tree_add_item(sub_info_elem_tree, hf_elmi_sub_user_prio_5, tvb, offset, 1, ENC_BIG_ENDIAN);
221 proto_tree_add_item(sub_info_elem_tree, hf_elmi_sub_user_prio_6, tvb, offset, 1, ENC_BIG_ENDIAN);
222 proto_tree_add_item(sub_info_elem_tree, hf_elmi_sub_user_prio_7, tvb, offset, 1, ENC_BIG_ENDIAN);
224 offset ++;
225 break;
226 default:
227 offset += len;
228 break;
231 proto_item_set_len(tree_pi, offset-offset_start);
232 return offset-offset_start;
236 static int
237 dissect_elmi_info_elem(
238 tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree)
240 int offset_start;
241 uint8_t tag, len, ret;
242 proto_item *tree_pi;
243 proto_tree *info_elem_tree;
245 offset_start = offset;
247 tag = tvb_get_uint8(tvb, offset);
248 if (tag==0)
249 return -1;
251 info_elem_tree = proto_tree_add_subtree_format(
252 tree, tvb, offset, -1, ett_elmi_info_elem, &tree_pi,
253 "Information element: %s", val_to_str_const(tag, elmi_info_elem_tag, "unknown"));
255 proto_tree_add_item(info_elem_tree, hf_elmi_info_elem,
256 tvb, offset, 1, ENC_BIG_ENDIAN);
257 offset++;
259 len = tvb_get_uint8(tvb, offset);
260 proto_tree_add_item(info_elem_tree, hf_elmi_info_elem_len,
261 tvb, offset, 1, ENC_BIG_ENDIAN);
262 offset++;
264 switch (tag) {
265 case TAG_REPORT_TYPE:
266 proto_tree_add_item(info_elem_tree, hf_elmi_report_type,
267 tvb, offset, 1, ENC_BIG_ENDIAN);
268 offset++;
269 break;
270 case TAG_SEQ_NUM:
271 proto_tree_add_item(info_elem_tree, hf_elmi_snd_seq_num,
272 tvb, offset, 1, ENC_BIG_ENDIAN);
273 offset++;
274 proto_tree_add_item(info_elem_tree, hf_elmi_rcv_seq_num,
275 tvb, offset, 1, ENC_BIG_ENDIAN);
276 offset++;
277 break;
278 case TAG_DATA_INST:
279 proto_tree_add_item(info_elem_tree, hf_elmi_reserved, tvb, offset, 1, ENC_BIG_ENDIAN);
280 offset++;
281 proto_tree_add_item(info_elem_tree, hf_elmi_dat_inst,
282 tvb, offset, 4, ENC_BIG_ENDIAN);
283 offset+=4;
284 break;
285 case TAG_UNI_STATUS:
286 proto_tree_add_item(info_elem_tree, hf_elmi_uni_status, tvb, offset, 1, ENC_BIG_ENDIAN);
287 offset++;
289 while(offset < (offset_start + len + 2)) {
290 ret = dissect_elmi_sub_info_elem(tvb, offset, info_elem_tree);
291 if (ret<=0)
292 break;
293 offset += ret;
295 break;
296 case TAG_EVC_STATUS:
297 proto_tree_add_item(info_elem_tree, hf_elmi_evc_refid, tvb, offset, 2, ENC_BIG_ENDIAN);
298 offset+=2;
299 proto_tree_add_item(info_elem_tree, hf_elmi_evc_status, tvb, offset, 1, ENC_BIG_ENDIAN);
300 offset++;
302 while(offset < (offset_start + len + 2)) {
303 ret = dissect_elmi_sub_info_elem(tvb, offset, info_elem_tree);
304 if (ret<=0)
305 break;
306 offset += ret;
308 break;
309 case TAG_VLAN_EVC:
310 proto_tree_add_item(info_elem_tree, hf_elmi_evc_refid, tvb, offset, 2, ENC_BIG_ENDIAN);
311 offset+=2;
312 proto_tree_add_item(info_elem_tree, hf_last_ie, tvb, offset, 1, ENC_BIG_ENDIAN);
313 proto_tree_add_item(info_elem_tree, hf_map_seq, tvb, offset, 1, ENC_BIG_ENDIAN);
314 offset++;
315 proto_tree_add_item(info_elem_tree, hf_priority, tvb, offset, 1, ENC_BIG_ENDIAN);
316 proto_tree_add_item(info_elem_tree, hf_default_evc, tvb, offset, 1, ENC_BIG_ENDIAN);
317 offset++;
319 while(offset < (offset_start + len + 2)) {
320 ret = dissect_elmi_sub_info_elem(tvb, offset, info_elem_tree);
321 if (ret<=0)
322 break;
323 offset += ret;
325 break;
326 default:
327 offset += len;
328 break;
331 proto_item_set_len(tree_pi, offset-offset_start);
332 return offset-offset_start;
336 static int
337 dissect_elmi(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
339 proto_item *pi;
340 proto_tree *elmi_tree;
341 int offset=0;
342 uint8_t msg_type;
343 int ret;
345 col_clear(pinfo->cinfo, COL_INFO);
346 col_set_str(pinfo->cinfo, COL_PROTOCOL, "E-LMI");
348 pi = proto_tree_add_protocol_format(tree, proto_elmi,
349 tvb, 0, tvb_captured_length(tvb),
350 "Ethernet Local Management Interface (E-LMI)");
351 elmi_tree = proto_item_add_subtree(pi, ett_elmi);
353 proto_tree_add_item(elmi_tree, hf_elmi_ver, tvb, offset, 1, ENC_BIG_ENDIAN);
354 offset++;
356 msg_type = tvb_get_uint8(tvb, offset);
357 proto_tree_add_item(elmi_tree, hf_elmi_msg_type,
358 tvb, offset, 1, ENC_BIG_ENDIAN);
359 col_append_str(pinfo->cinfo, COL_INFO,
360 val_to_str(msg_type, elmi_msg_type, "unknown (0x%x)"));
361 offset++;
363 while (tvb_reported_length_remaining(tvb, offset) > 0) {
364 ret = dissect_elmi_info_elem(tvb, offset, pinfo, elmi_tree);
365 if (ret<=0)
366 break;
367 offset += ret;
370 /* XXX - can we make the eth dissector handle our (standard) padding
371 * and FCS? */
372 return tvb_captured_length(tvb);
376 void
377 proto_register_elmi(void)
379 static hf_register_info hf[] = {
380 { &hf_elmi_ver,
381 { "Version", "elmi.version", FT_UINT8, BASE_DEC,
382 NULL, 0, NULL, HFILL } },
383 { &hf_elmi_msg_type,
384 { "Message type", "elmi.message_type", FT_UINT8, BASE_HEX,
385 VALS(elmi_msg_type), 0, NULL, HFILL } },
386 { &hf_elmi_info_elem,
387 { "Tag", "elmi.info_element.tag", FT_UINT8, BASE_HEX,
388 VALS(elmi_info_elem_tag), 0, NULL, HFILL } },
389 { &hf_elmi_info_elem_len,
390 { "Length", "elmi.info_element.length", FT_UINT8, BASE_DEC,
391 NULL, 0, NULL, HFILL } },
392 { &hf_elmi_report_type,
393 { "Report type", "elmi.report_type", FT_UINT8, BASE_DEC,
394 VALS(elmi_report_type), 0, NULL, HFILL } },
395 { &hf_elmi_snd_seq_num,
396 { "Send sequence number", "elmi.snd_seq_num", FT_UINT8, BASE_DEC,
397 NULL, 0, NULL, HFILL } },
398 { &hf_elmi_rcv_seq_num,
399 { "Receive sequence number", "elmi.rcv_seq_num", FT_UINT8, BASE_DEC,
400 NULL, 0, NULL, HFILL } },
401 { &hf_elmi_dat_inst,
402 { "Data instance", "elmi.data_instance", FT_UINT32, BASE_HEX,
403 NULL, 0, NULL, HFILL } },
404 { &hf_elmi_reserved,
405 { "Reserved", "elmi.reserved", FT_UINT8, BASE_HEX,
406 NULL, 0, NULL, HFILL } },
407 { &hf_elmi_uni_status,
408 { "CE-VLAN ID/EVC Map Type", "elmi.map_type", FT_UINT8, BASE_HEX,
409 VALS(elmi_vlan_id_evc_map_type), 0, NULL, HFILL } },
410 { &hf_elmi_evc_refid,
411 { "EVC Reference Id", "elmi.evc.refid", FT_UINT16, BASE_DEC,
412 NULL, 0, NULL, HFILL } },
413 { &hf_elmi_evc_status,
414 { "EVC Status Type", "elmi.evc.status", FT_UINT8, BASE_HEX,
415 VALS(elmi_evc_status_type), 0x7, NULL, HFILL } },
416 { &hf_last_ie,
417 { "Last Information Element", "elmi.map.last_ie", FT_BOOLEAN, 8,
418 TFS(&tfs_yes_no), 0x40, NULL, HFILL } },
419 { &hf_map_seq,
420 { "CE-VLAN ID/EVC Map Sequence", "elmi.map.seq", FT_UINT8, BASE_DEC,
421 NULL, 0x3F, NULL, HFILL } },
422 { &hf_priority,
423 { "Priority Tagged", "elmi.map.priority", FT_BOOLEAN, 8,
424 TFS(&tfs_yes_no), 0x2, NULL, HFILL } },
425 { &hf_default_evc,
426 { "Default EVC", "elmi.map.evc", FT_BOOLEAN, 8,
427 TFS(&tfs_set_notset), 0x1, NULL, HFILL } },
428 { &hf_elmi_sub_info_elem,
429 { "Sub-Info Element", "elmi.sub_info.tag", FT_UINT8, BASE_HEX,
430 VALS(elmi_sub_info_elem_tag), 0, NULL, HFILL } },
431 { &hf_elmi_sub_info_elem_len,
432 { "Sub-Info Length", "elmi.sub_info.len", FT_UINT8, BASE_DEC,
433 NULL, 0, NULL, HFILL } },
434 { &hf_elmi_uni_id,
435 { "UNI Identifier", "elmi.sub_info.uni_id", FT_STRING, BASE_NONE,
436 NULL, 0, NULL, HFILL } },
437 { &hf_elmi_evc_type,
438 { "EVC Type", "elmi.sub_info.evc_type", FT_UINT8, BASE_DEC,
439 VALS(elmi_evc_type), 0x7, NULL, HFILL } },
440 { &hf_elmi_evc_id,
441 { "EVC Identifier", "elmi.sub_info.evc_id", FT_STRING, BASE_NONE,
442 NULL, 0, NULL, HFILL } },
443 { &hf_elmi_ce_vlan_id,
444 { "CE-VLAN ID", "elmi.sub_info.vlan_id", FT_UINT16, BASE_DEC,
445 NULL, 0, NULL, HFILL } },
446 { &hf_elmi_sub_info_color_mode_flag,
447 { "Color Mode Flag", "elmi.sub_info.color_mode_flag", FT_BOOLEAN, 8,
448 TFS(&tfs_set_notset), 0x4, NULL, HFILL } },
449 { &hf_elmi_sub_info_coupling_flag,
450 { "Coupling Flag", "elmi.sub_info.coupling_flag", FT_BOOLEAN, 8,
451 TFS(&tfs_set_notset), 0x2, NULL, HFILL } },
452 { &hf_elmi_sub_info_per_cos_bit,
453 { "Per CoS bit values", "elmi.sub_info.per_cos_bit", FT_BOOLEAN, 8,
454 TFS(&tfs_used_notused), 0x1, NULL, HFILL } },
455 { &hf_elmi_sub_cir_magnitude,
456 { "CIR Magnitude", "elmi.sub_info.cir_mag", FT_UINT8, BASE_DEC,
457 NULL, 0, NULL, HFILL } },
458 { &hf_elmi_sub_cir_multiplier,
459 { "CIR Multiplier", "elmi.sub_info.cir_mult", FT_UINT16, BASE_DEC,
460 NULL, 0, NULL, HFILL } },
461 { &hf_elmi_sub_cbs_magnitude,
462 { "CBS Magnitude", "elmi.sub_info.cbs_mag", FT_UINT8, BASE_DEC,
463 NULL, 0, NULL, HFILL } },
464 { &hf_elmi_sub_cbs_multiplier,
465 { "CBS Multiplier", "elmi.sub_info.cbs_mult", FT_UINT8, BASE_DEC,
466 NULL, 0, NULL, HFILL } },
467 { &hf_elmi_sub_eir_magnitude,
468 { "EIR Magnitude", "elmi.sub_info.eir_mag", FT_UINT8, BASE_DEC,
469 NULL, 0, NULL, HFILL } },
470 { &hf_elmi_sub_eir_multiplier,
471 { "EIR Multiplier", "elmi.sub_info.eir_mult", FT_UINT16, BASE_DEC,
472 NULL, 0, NULL, HFILL } },
473 { &hf_elmi_sub_ebs_magnitude,
474 { "EBS Magnitude", "elmi.sub_info.ebs_mag", FT_UINT8, BASE_DEC,
475 NULL, 0, NULL, HFILL } },
476 { &hf_elmi_sub_ebs_multiplier,
477 { "EBS Multiplier", "elmi.sub_info.ebs_mult", FT_UINT8, BASE_DEC,
478 NULL, 0, NULL, HFILL } },
479 { &hf_elmi_sub_user_prio_0,
480 { "User Priority 0", "elmi.sub_info.bw_prio0", FT_BOOLEAN, 8,
481 TFS(&tfs_applicable_not_applicable), 0x1, NULL, HFILL } },
482 { &hf_elmi_sub_user_prio_1,
483 { "User Priority 1", "elmi.sub_info.bw_prio1", FT_BOOLEAN, 8,
484 TFS(&tfs_applicable_not_applicable), 0x2, NULL, HFILL } },
485 { &hf_elmi_sub_user_prio_2,
486 { "User Priority 2", "elmi.sub_info.bw_prio2", FT_BOOLEAN, 8,
487 TFS(&tfs_applicable_not_applicable), 0x4, NULL, HFILL } },
488 { &hf_elmi_sub_user_prio_3,
489 { "User Priority 3", "elmi.sub_info.bw_prio3", FT_BOOLEAN, 8,
490 TFS(&tfs_applicable_not_applicable), 0x8, NULL, HFILL } },
491 { &hf_elmi_sub_user_prio_4,
492 { "User Priority 4", "elmi.sub_info.bw_prio4", FT_BOOLEAN, 8,
493 TFS(&tfs_applicable_not_applicable), 0x10, NULL, HFILL } },
494 { &hf_elmi_sub_user_prio_5,
495 { "User Priority 5", "elmi.sub_info.bw_prio5", FT_BOOLEAN, 8,
496 TFS(&tfs_applicable_not_applicable), 0x20, NULL, HFILL } },
497 { &hf_elmi_sub_user_prio_6,
498 { "User Priority 6", "elmi.sub_info.bw_prio6", FT_BOOLEAN, 8,
499 TFS(&tfs_applicable_not_applicable), 0x40, NULL, HFILL } },
500 { &hf_elmi_sub_user_prio_7,
501 { "User Priority 7", "elmi.sub_info.bw_prio7", FT_BOOLEAN, 8,
502 TFS(&tfs_applicable_not_applicable), 0x80, NULL, HFILL } },
505 static int *ett[] = {
506 &ett_elmi,
507 &ett_elmi_info_elem,
508 &ett_elmi_sub_info_elem
512 proto_elmi = proto_register_protocol("Ethernet Local Management Interface", "E-LMI", "elmi");
514 proto_register_field_array(proto_elmi, hf, array_length(hf));
515 proto_register_subtree_array(ett, array_length(ett));
517 elmi_handle = register_dissector("elmi", dissect_elmi, proto_elmi);
521 void
522 proto_reg_handoff_elmi(void)
524 dissector_add_uint("ethertype", ETHERTYPE_ELMI, elmi_handle);
528 * Editor modelines - https://www.wireshark.org/tools/modelines.html
530 * Local variables:
531 * c-basic-offset: 4
532 * tab-width: 8
533 * indent-tabs-mode: nil
534 * End:
536 * vi: set shiftwidth=4 tabstop=8 expandtab:
537 * :indentSize=4:tabSize=8:noTabs=true: