2 * Routines for Token-Ring Media Access Control
3 * Gilbert Ramirez <gram@alumni.rice.edu>
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/to_str.h>
16 #include <epan/expert.h>
18 void proto_register_trmac(void);
20 static int proto_trmac = -1;
21 static int hf_trmac_mv = -1;
22 static int hf_trmac_length = -1;
23 static int hf_trmac_srcclass = -1;
24 static int hf_trmac_dstclass = -1;
25 static int hf_trmac_sv_len = -1;
26 static int hf_trmac_sv_id = -1;
27 static int hf_trmac_errors_iso = -1;
28 static int hf_trmac_errors_line = -1;
29 static int hf_trmac_errors_internal = -1;
30 static int hf_trmac_errors_burst = -1;
31 static int hf_trmac_errors_ac = -1;
32 static int hf_trmac_errors_abort = -1;
33 static int hf_trmac_errors_noniso = -1;
34 static int hf_trmac_errors_lost = -1;
35 static int hf_trmac_errors_congestion = -1;
36 static int hf_trmac_errors_fc = -1;
37 static int hf_trmac_errors_freq = -1;
38 static int hf_trmac_errors_token = -1;
39 static int hf_trmac_naun = -1;
40 static int hf_trmac_beacon_type = -1;
41 static int hf_trmac_assign_physical_drop_number = -1;
42 static int hf_trmac_error_code = -1;
43 static int hf_trmac_group_address32 = -1;
44 static int hf_trmac_transmit_status_code = -1;
45 static int hf_trmac_station_identifier = -1;
46 static int hf_trmac_sa_of_last_amp_or_smp_frame = -1;
47 static int hf_trmac_error_report_timer_value = -1;
48 static int hf_trmac_individual_address_count = -1;
49 static int hf_trmac_correlator = -1;
50 static int hf_trmac_group_address_ether = -1;
51 static int hf_trmac_authorized_access_priority = -1;
52 static int hf_trmac_physical_drop_number = -1;
53 static int hf_trmac_authorized_function_classes = -1;
54 static int hf_trmac_local_ring_number = -1;
55 static int hf_trmac_functional_addresses = -1;
56 /* Generated from convert_proto_tree_add_text.pl */
57 static int hf_trmac_unknown_subvector = -1;
58 static int hf_trmac_response_code48 = -1;
59 static int hf_trmac_product_instance_id = -1;
60 static int hf_trmac_ring_station_version_number = -1;
61 static int hf_trmac_wrap_data = -1;
62 static int hf_trmac_ring_station_status = -1;
63 static int hf_trmac_frame_forward = -1;
64 static int hf_trmac_response_code32 = -1;
66 static gint ett_tr_mac = -1;
67 static gint ett_tr_sv = -1;
68 static gint ett_tr_ierr_cnt = -1;
69 static gint ett_tr_nerr_cnt = -1;
71 static expert_field ei_trmac_sv_len = EI_INIT;
74 static const value_string major_vector_vs[] = {
77 { 0x03, "Claim Token" },
78 { 0x04, "Ring Purge" },
79 { 0x05, "Active Monitor Present" },
80 { 0x06, "Standby Monitor Present" },
81 { 0x07, "Duplicate Address Test" },
82 { 0x09, "Transmit Forward" },
83 { 0x0B, "Remove Ring Station" },
84 { 0x0C, "Change Parameters" },
85 { 0x0D, "Initialize Ring Station" },
86 { 0x0E, "Request Ring Station Address" },
87 { 0x0F, "Request Ring Station Address" },
88 { 0x10, "Request Ring Station Attachments" },
89 { 0x20, "Request Initialization" },
90 { 0x22, "Report Ring Station Address" },
91 { 0x23, "Report Ring Station State" },
92 { 0x24, "Report Ring Station Attachments" },
93 { 0x25, "Report New Active Monitor" },
94 { 0x26, "Report NAUN Change" },
95 { 0x27, "Report Poll Error" },
96 { 0x28, "Report Monitor Errors" },
97 { 0x29, "Report Error" },
98 { 0x2A, "Report Transmit Forward" },
101 static value_string_ext major_vector_vs_ext = VALUE_STRING_EXT_INIT(major_vector_vs);
103 /* Src. and Dest. Classes */
104 static const value_string classes_vs[] = {
105 { 0x00, "Ring Station" },
106 { 0x01, "LLC Manager" },
107 { 0x04, "Configuration Report Server" },
108 { 0x05, "Ring Parameter Server" },
109 { 0x06, "Ring Error Monitor" },
113 static const value_string subvector_vs[] = {
114 { 0x01, "Beacon Type" },
115 { 0x02, "Upstream Neighbor's Address" },
116 { 0x03, "Local Ring Number" },
117 { 0x04, "Assign Physical Drop Number" },
118 { 0x05, "Error Report Timer Value" },
119 { 0x06, "Authorized Function Classes" },
120 { 0x07, "Authorized Access Priority" },
121 { 0x09, "Correlator" },
122 { 0x0A, "SA of Last AMP or SMP Frame" },
123 { 0x0B, "Physical Drop Number" },
124 { 0x20, "Response Code" },
125 { 0x21, "Individual Address Count" },
126 { 0x22, "Product Instance ID" },
127 { 0x23, "Ring Station Version Number" },
128 { 0x26, "Wrap Data" },
129 { 0x27, "Frame Forward" },
130 { 0x28, "Station Identifier" },
131 { 0x29, "Ring Station Status" },
132 { 0x2A, "Transmit Forward Status Code" },
133 { 0x2B, "Group Addresses" },
134 { 0x2C, "Functional Addresses" },
135 { 0x2D, "Isolating Error Counts" },
136 { 0x2E, "Non-Isolating Error Counts" },
137 { 0x2F, "Function Request ID" },
138 { 0x30, "Error Code" },
141 static value_string_ext subvector_vs_ext = VALUE_STRING_EXT_INIT(subvector_vs);
143 static const value_string beacon_vs[] = {
144 { 0x00, "Recovery mode set" },
145 { 0x01, "Signal loss error" },
146 { 0x02, "Streaming signal not Claim Token MAC frame" },
147 { 0x03, "Streaming signal, Claim Token MAC frame" },
153 sv_text(tvbuff_t *tvb, int svoff, packet_info *pinfo, proto_tree *tree)
155 guint sv_length, sv_id;
156 guint16 beacon_type, ring;
157 guint32 error_report_timer_value;
159 proto_tree *sv_tree, *sv_subtree;
160 proto_item *sv_item, *len_item, *ti;
162 guchar errors[6]; /* isolating or non-isolating */
164 sv_tree = proto_tree_add_subtree(tree, tvb, svoff+0, 1, ett_tr_sv, &sv_item, "Subvector");
166 sv_length = tvb_get_guint8(tvb, svoff+0);
167 len_item = proto_tree_add_item(sv_tree, hf_trmac_sv_len, tvb, svoff+0, 1, ENC_BIG_ENDIAN);
169 /* Check the SV length; it must be at least 2, to include
170 the subvector length and indicator. */
172 expert_add_info_format(pinfo, len_item, &ei_trmac_sv_len,
173 "Invalid subvector: length < 2");
174 return 0; /* tells our caller to give up */
177 sv_id = tvb_get_guint8(tvb, svoff+1);
178 proto_tree_add_item(sv_tree, hf_trmac_sv_id, tvb, svoff+1, 1, ENC_BIG_ENDIAN);
179 proto_item_append_text(sv_item, " (%s)", val_to_str_ext(sv_id, &subvector_vs_ext, "Unknown subvector ID 0x%02X"));
182 case 0x01: /* Beacon Type */
183 if (sv_length != 4) {
184 expert_add_info_format(pinfo, len_item, &ei_trmac_sv_len,
185 "Subvector length is != 4");
188 beacon_type = tvb_get_ntohs(tvb, svoff+2);
189 proto_tree_add_item(sv_tree, hf_trmac_beacon_type, tvb, svoff+2, sv_length-2, ENC_BIG_ENDIAN);
190 proto_item_append_text(sv_item,
191 ": %s", val_to_str(beacon_type, beacon_vs, "Illegal value: %d"));
194 case 0x02: /* Upstream Neighbor's Address */
195 if (sv_length != 8) {
196 expert_add_info_format(pinfo, len_item, &ei_trmac_sv_len,
197 "Subvector length is != 8");
200 proto_tree_add_item(sv_tree, hf_trmac_naun, tvb, svoff+2, sv_length-2, ENC_NA);
201 proto_item_append_text(sv_item, ": %s",
202 tvb_ether_to_str(tvb, svoff+2));
205 case 0x03: /* Local Ring Number */
206 if (sv_length != 4) {
207 expert_add_info_format(pinfo, len_item, &ei_trmac_sv_len,
208 "Subvector length is != 4");
211 ring = tvb_get_ntohs(tvb, svoff+2);
212 proto_tree_add_item(sv_tree, hf_trmac_local_ring_number, tvb, svoff+2, sv_length-2, ENC_BIG_ENDIAN);
213 proto_item_append_text(sv_item,
214 ": 0x%04X (%d)", ring, ring);
217 case 0x04: /* Assign Physical Drop Number */
218 if (sv_length != 6) {
219 expert_add_info_format(pinfo, len_item, &ei_trmac_sv_len,
220 "Subvector length is != 6");
223 proto_tree_add_item(sv_tree, hf_trmac_assign_physical_drop_number, tvb, svoff+2, sv_length-2, ENC_BIG_ENDIAN);
224 proto_item_append_text(sv_item,
225 ": 0x%08X", tvb_get_ntohl(tvb, svoff+2) );
228 case 0x05: /* Error Report Timer Value */
229 if (sv_length != 4) {
230 expert_add_info_format(pinfo, len_item, &ei_trmac_sv_len,
231 "Subvector length is != 4");
235 error_report_timer_value = 10 * tvb_get_ntohs(tvb, svoff+2);
236 proto_tree_add_uint(sv_tree, hf_trmac_error_report_timer_value, tvb, svoff+2, sv_length-2, error_report_timer_value);
237 proto_item_append_text(sv_item,
238 ": %u ms", error_report_timer_value );
241 case 0x06: /* Authorized Function Classes */
242 if (sv_length != 4) {
243 expert_add_info_format(pinfo, len_item, &ei_trmac_sv_len,
244 "Subvector length is != 4");
247 proto_tree_add_item(sv_tree, hf_trmac_authorized_function_classes, tvb, svoff+2, sv_length-2, ENC_BIG_ENDIAN);
248 proto_item_append_text(sv_item,
249 ": %04X", tvb_get_ntohs(tvb, svoff+2) );
252 case 0x07: /* Authorized Access Priority */
253 if (sv_length != 4) {
254 expert_add_info_format(pinfo, len_item, &ei_trmac_sv_len,
255 "Subvector length is != 4");
258 proto_tree_add_item(sv_tree, hf_trmac_authorized_access_priority, tvb, svoff+2, sv_length-2, ENC_BIG_ENDIAN);
259 proto_item_append_text(sv_item,
260 ": %04X", tvb_get_ntohs(tvb, svoff+2) );
263 case 0x09: /* Correlator */
264 if (sv_length != 4) {
265 expert_add_info_format(pinfo, len_item, &ei_trmac_sv_len,
266 "Subvector length is != 4");
269 proto_tree_add_item(sv_tree, hf_trmac_correlator, tvb, svoff+2, sv_length-2, ENC_BIG_ENDIAN);
270 proto_item_append_text(sv_item,
271 ": %04X", tvb_get_ntohs(tvb, svoff+2) );
274 case 0x0A: /* SA of Last AMP or SMP Frame */
275 if (sv_length != 8) {
276 expert_add_info_format(pinfo, len_item, &ei_trmac_sv_len,
277 "Subvector length is != 8");
280 proto_tree_add_item(sv_tree, hf_trmac_sa_of_last_amp_or_smp_frame, tvb, svoff+2, sv_length-2, ENC_NA);
281 proto_item_append_text(sv_item,
283 tvb_ether_to_str(tvb, svoff+2));
286 case 0x0B: /* Physical Drop Number */
287 if (sv_length != 6) {
288 expert_add_info_format(pinfo, len_item, &ei_trmac_sv_len,
289 "Subvector length is != 6");
292 proto_tree_add_item(sv_tree, hf_trmac_physical_drop_number, tvb, svoff+2, sv_length-2, ENC_BIG_ENDIAN);
293 proto_item_append_text(sv_item,
294 ": 0x%08X", tvb_get_ntohl(tvb, svoff+2) );
297 case 0x20: /* Response Code */
298 if (sv_length != 4 && sv_length != 6) {
299 expert_add_info_format(pinfo, len_item, &ei_trmac_sv_len,
300 "Subvector length is != 4 and != 6");
303 if (sv_length == 4) {
304 proto_tree_add_uint_format_value(sv_tree, hf_trmac_response_code32, tvb, svoff+2, sv_length-2,
305 tvb_get_ntohl(tvb, svoff+2), "0x%04X 0x%02X 0x%02x",
306 tvb_get_ntohs(tvb, svoff+2), tvb_get_guint8(tvb, svoff+4), tvb_get_guint8(tvb, svoff+5));
307 proto_item_append_text(sv_item,
308 ": 0x%04X 0x%02X 0x%02x",
309 tvb_get_ntohs(tvb, svoff+2),
310 tvb_get_guint8(tvb, svoff+4),
311 tvb_get_guint8(tvb, svoff+5));
313 proto_tree_add_uint64_format_value(sv_tree, hf_trmac_response_code48, tvb, svoff+2, sv_length-2,
314 tvb_get_ntoh48(tvb, svoff+2), "0x%04X 0x%02X 0x%06X",
315 tvb_get_ntohs(tvb, svoff+2),
316 tvb_get_guint8(tvb, svoff+4),
317 tvb_get_ntoh24(tvb, svoff+5));
318 proto_item_append_text(sv_item,
319 ": 0x%04X 0x%02X 0x%06X",
320 tvb_get_ntohs(tvb, svoff+2),
321 tvb_get_guint8(tvb, svoff+4),
322 tvb_get_ntoh24(tvb, svoff+5));
326 case 0x21: /* Individual Address Count */
327 if (sv_length != 4) {
328 expert_add_info_format(pinfo, len_item, &ei_trmac_sv_len,
329 "Subvector length is != 4");
332 proto_tree_add_item(sv_tree, hf_trmac_individual_address_count, tvb, svoff+2, sv_length-2, ENC_BIG_ENDIAN);
333 proto_item_append_text(sv_item,
334 ": %u", tvb_get_ntohs(tvb, svoff+2) );
337 case 0x22: /* Product Instance ID */
338 proto_tree_add_item(sv_tree, hf_trmac_product_instance_id, tvb, svoff+2, sv_length-2, ENC_NA);
341 case 0x23: /* Ring Station Version Number */
342 proto_tree_add_item(sv_tree, hf_trmac_ring_station_version_number, tvb, svoff+2, sv_length-2, ENC_NA);
345 case 0x26: /* Wrap data */
346 proto_tree_add_item(sv_tree, hf_trmac_wrap_data, tvb, svoff+2, sv_length-2, ENC_NA);
349 case 0x27: /* Frame Forward */
350 proto_tree_add_item(sv_tree, hf_trmac_frame_forward, tvb, svoff+2, sv_length-2, ENC_NA);
353 case 0x28: /* Station Identifier */
354 if (sv_length != 8) {
355 expert_add_info_format(pinfo, len_item, &ei_trmac_sv_len,
356 "Subvector length is != 8");
359 proto_tree_add_item(sv_tree, hf_trmac_station_identifier, tvb, svoff+2, sv_length-2, ENC_NA);
360 proto_item_append_text(sv_item,
362 tvb_ether_to_str(tvb, svoff+2));
365 case 0x29: /* Ring Station Status */
366 proto_tree_add_item(sv_tree, hf_trmac_ring_station_status, tvb, svoff+2, sv_length-2, ENC_NA);
369 case 0x2A: /* Transmit Status Code */
370 if (sv_length != 4) {
371 expert_add_info_format(pinfo, len_item, &ei_trmac_sv_len,
372 "Subvector length is != 4");
375 proto_tree_add_item(sv_tree, hf_trmac_transmit_status_code, tvb, svoff+2, sv_length-2, ENC_BIG_ENDIAN);
376 proto_item_append_text(sv_item,
377 ": %04X", tvb_get_ntohs(tvb, svoff+2) );
380 case 0x2B: /* Group Address */
381 if (sv_length != 6 && sv_length != 8) {
382 expert_add_info_format(pinfo, len_item, &ei_trmac_sv_len,
383 "Subvector length is != 6 and != 8");
386 if (sv_length == 6) {
387 proto_tree_add_item(sv_tree, hf_trmac_group_address32, tvb, svoff+2, sv_length-2, ENC_BIG_ENDIAN);
388 proto_item_append_text(sv_item,
389 ": %08X", tvb_get_ntohl(tvb, svoff+2) );
391 proto_tree_add_item(sv_tree, hf_trmac_group_address_ether, tvb, svoff+2, sv_length-2, ENC_NA);
392 proto_item_append_text(sv_item,
394 tvb_ether_to_str(tvb, svoff+2));
398 case 0x2C: /* Functional Addresses */
399 if (sv_length != 6) {
400 expert_add_info_format(pinfo, len_item, &ei_trmac_sv_len,
401 "Subvector length is != 6");
404 proto_tree_add_item(sv_tree, hf_trmac_functional_addresses, tvb, svoff+2, sv_length-2, ENC_BIG_ENDIAN);
405 proto_item_append_text(sv_item,
406 ": %08X", tvb_get_ntohl(tvb, svoff+2) );
409 case 0x2D: /* Isolating Error Counts */
410 if (sv_length != 8) {
411 expert_add_info_format(pinfo, len_item, &ei_trmac_sv_len,
412 "Subvector length is != 8");
415 tvb_memcpy(tvb, errors, svoff+2, 6);
416 ti = proto_tree_add_uint(sv_tree, hf_trmac_errors_iso, tvb, svoff+2, sv_length-2,
417 errors[0] + errors[1] + errors[2] + errors[3] + errors[4]);
418 sv_subtree = proto_item_add_subtree(ti, ett_tr_ierr_cnt);
420 proto_tree_add_uint(sv_subtree, hf_trmac_errors_line, tvb, svoff+2, 1, errors[0]);
421 proto_tree_add_uint(sv_subtree, hf_trmac_errors_internal, tvb, svoff+3, 1, errors[1]);
422 proto_tree_add_uint(sv_subtree, hf_trmac_errors_burst, tvb, svoff+4, 1, errors[2]);
423 proto_tree_add_uint(sv_subtree, hf_trmac_errors_ac, tvb, svoff+5, 1, errors[3]);
424 proto_tree_add_uint(sv_subtree, hf_trmac_errors_abort, tvb, svoff+6, 1, errors[4]);
428 case 0x2E: /* Non-Isolating Error Counts */
429 if (sv_length != 8) {
430 expert_add_info_format(pinfo, len_item, &ei_trmac_sv_len,
431 "Subvector length is != 8");
434 tvb_memcpy(tvb, errors, svoff+2, 6);
435 ti = proto_tree_add_uint(sv_tree, hf_trmac_errors_noniso, tvb, svoff+2, sv_length-2,
436 errors[0] + errors[1] + errors[2] + errors[3] + errors[4]);
437 sv_subtree = proto_item_add_subtree(ti, ett_tr_nerr_cnt);
439 proto_tree_add_uint(sv_subtree, hf_trmac_errors_lost, tvb, svoff+2, 1, errors[0]);
440 proto_tree_add_uint(sv_subtree, hf_trmac_errors_congestion, tvb, svoff+3, 1, errors[1]);
441 proto_tree_add_uint(sv_subtree, hf_trmac_errors_fc, tvb, svoff+4, 1, errors[2]);
442 proto_tree_add_uint(sv_subtree, hf_trmac_errors_freq, tvb, svoff+5, 1, errors[3]);
443 proto_tree_add_uint(sv_subtree, hf_trmac_errors_token, tvb, svoff+6, 1, errors[4]);
446 case 0x30: /* Error Code */
447 if (sv_length != 4) {
448 expert_add_info_format(pinfo, len_item, &ei_trmac_sv_len,
449 "Subvector length is != 4");
452 proto_tree_add_item(sv_tree, hf_trmac_error_code, tvb, svoff+2, sv_length-2, ENC_BIG_ENDIAN);
453 proto_item_append_text(sv_item,
454 ": %04X", tvb_get_ntohs(tvb, svoff+2) );
457 default: /* Unknown */
458 proto_tree_add_item(sv_tree, hf_trmac_unknown_subvector, tvb, svoff+2, sv_length-2, ENC_NA);
465 dissect_trmac(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
467 proto_tree *mac_tree;
470 guint32 mv_val, mv_length, sv_offset;
472 if (tvb_captured_length(tvb) < 3)
475 col_set_str(pinfo->cinfo, COL_PROTOCOL, "TR MAC");
476 col_clear(pinfo->cinfo, COL_INFO);
478 ti = proto_tree_add_item(tree, proto_trmac, tvb, 0, -1, ENC_NA);
479 mac_tree = proto_item_add_subtree(ti, ett_tr_mac);
481 proto_tree_add_item_ret_uint(mac_tree, hf_trmac_mv, tvb, 3, 1, ENC_NA, &mv_val);
482 proto_tree_add_item_ret_uint(mac_tree, hf_trmac_length, tvb, 0, 2, ENC_BIG_ENDIAN, &mv_length);
483 proto_item_set_len(ti, mv_length);
484 proto_tree_add_item(mac_tree, hf_trmac_srcclass, tvb, 2, 1, ENC_NA);
485 proto_tree_add_item(mac_tree, hf_trmac_dstclass, tvb, 2, 1, ENC_NA);
487 /* Interpret the major vector */
488 col_add_str(pinfo->cinfo, COL_INFO,
489 val_to_str_ext(mv_val, &major_vector_vs_ext, "Unknown Major Vector: %u"));
491 /* interpret the subvectors */
493 while (sv_offset < mv_length) {
494 sv_additional = sv_text(tvb, sv_offset, pinfo, mac_tree);
496 /* if this is a bad packet, we could get a 0-length added here,
498 if (sv_additional > 0)
499 sv_offset += sv_additional;
504 return tvb_captured_length(tvb);
508 proto_register_trmac(void)
510 static hf_register_info hf[] = {
512 { "Major Vector", "trmac.mvec", FT_UINT8, BASE_HEX|BASE_EXT_STRING, &major_vector_vs_ext, 0x0,
516 { "Total Length", "trmac.length", FT_UINT8, BASE_DEC|BASE_UNIT_STRING, &units_byte_bytes, 0x0,
519 { &hf_trmac_srcclass,
520 { "Source Class", "trmac.srcclass", FT_UINT8, BASE_HEX, VALS(classes_vs), 0x0F,
523 { &hf_trmac_dstclass,
524 { "Destination Class", "trmac.dstclass", FT_UINT8, BASE_HEX, VALS(classes_vs), 0xF0,
528 { "Subvector Length", "trmac.svec.len", FT_UINT8, BASE_DEC, NULL, 0x0,
532 { "Subvector Identifier", "trmac.svec.id", FT_UINT8, BASE_HEX|BASE_EXT_STRING, &subvector_vs_ext, 0x0,
535 { &hf_trmac_errors_iso,
536 { "Isolating Errors", "trmac.errors.iso", FT_UINT16, BASE_DEC, NULL, 0x0,
539 { &hf_trmac_errors_line,
540 { "Line Errors", "trmac.errors.line", FT_UINT8, BASE_DEC, NULL, 0x0,
543 { &hf_trmac_errors_internal,
544 { "Internal Errors", "trmac.errors.internal", FT_UINT8, BASE_DEC, NULL, 0x0,
547 { &hf_trmac_errors_burst,
548 { "Burst Errors", "trmac.errors.burst", FT_UINT8, BASE_DEC, NULL, 0x0,
551 { &hf_trmac_errors_ac,
552 { "A/C Errors", "trmac.errors.ac", FT_UINT8, BASE_DEC, NULL, 0x0,
555 { &hf_trmac_errors_abort,
556 { "Abort Delimiter Transmitted Errors", "trmac.errors.abort", FT_UINT8, BASE_DEC, NULL, 0x0,
559 { &hf_trmac_errors_noniso,
560 { "Non-Isolating Errors", "trmac.errors.noniso", FT_UINT16, BASE_DEC, NULL, 0x0,
563 { &hf_trmac_errors_lost,
564 { "Lost Frame Errors", "trmac.errors.lost", FT_UINT8, BASE_DEC, NULL, 0x0,
567 { &hf_trmac_errors_congestion,
568 { "Receiver Congestion Errors", "trmac.errors.congestion", FT_UINT8, BASE_DEC, NULL, 0x0,
571 { &hf_trmac_errors_fc,
572 { "Frame-Copied Errors", "trmac.errors.fc", FT_UINT8, BASE_DEC, NULL, 0x0,
575 { &hf_trmac_errors_freq,
576 { "Frequency Errors", "trmac.errors.freq", FT_UINT8, BASE_DEC, NULL, 0x0,
579 { &hf_trmac_errors_token,
580 { "Token Errors", "trmac.errors.token", FT_UINT8, BASE_DEC, NULL, 0x0,
584 { "Upstream Neighbor's Address", "trmac.naun", FT_ETHER, BASE_NONE, NULL, 0x0,
587 { &hf_trmac_beacon_type,
588 { "Beacon Type", "trmac.beacon_type", FT_UINT16, BASE_DEC, VALS(beacon_vs), 0x0,
591 { &hf_trmac_local_ring_number,
592 { "Local Ring Number", "trmac.local_ring_number", FT_UINT16, BASE_HEX_DEC, NULL, 0x0,
595 { &hf_trmac_assign_physical_drop_number,
596 { "Assign Physical Drop Number", "trmac.assign_physical_drop_number", FT_UINT32, BASE_HEX, NULL, 0x0,
599 { &hf_trmac_error_report_timer_value,
600 { "Error Report Timer Value", "trmac.error_report_timer_value", FT_UINT16, BASE_DEC|BASE_UNIT_STRING, &units_milliseconds, 0x0,
603 { &hf_trmac_authorized_function_classes,
604 { "Authorized Function Classes", "trmac.authorized_function_classes", FT_UINT16, BASE_HEX, NULL, 0x0,
607 { &hf_trmac_authorized_access_priority,
608 { "Authorized Access Priority", "trmac.authorized_access_priority", FT_UINT16, BASE_HEX, NULL, 0x0,
611 { &hf_trmac_correlator,
612 { "Correlator", "trmac.correlator", FT_UINT16, BASE_HEX, NULL, 0x0,
615 { &hf_trmac_sa_of_last_amp_or_smp_frame,
616 { "SA of Last AMP or SMP Frame", "trmac.sa_of_last_amp_or_smp_frame", FT_ETHER, BASE_NONE, NULL, 0x0,
619 { &hf_trmac_physical_drop_number,
620 { "Physical Drop Number", "trmac.physical_drop_number", FT_UINT32, BASE_HEX, NULL, 0x0,
623 { &hf_trmac_individual_address_count,
624 { "Individual Address Count", "trmac.individual_address_count", FT_UINT16, BASE_DEC, NULL, 0x0,
627 { &hf_trmac_station_identifier,
628 { "Station Identifier", "trmac.station_identifier", FT_ETHER, BASE_NONE, NULL, 0x0,
631 { &hf_trmac_transmit_status_code,
632 { "Transmit Status Code", "trmac.transmit_status_code", FT_UINT16, BASE_HEX, NULL, 0x0,
635 { &hf_trmac_group_address32,
636 { "Group Address", "trmac.group_addres32s", FT_UINT32, BASE_HEX, NULL, 0x0,
639 { &hf_trmac_group_address_ether,
640 { "Group Address", "trmac.group_address_ether", FT_ETHER, BASE_NONE, NULL, 0x0,
643 { &hf_trmac_functional_addresses,
644 { "Functional Addresses", "trmac.functional_addresses", FT_UINT32, BASE_HEX, NULL, 0x0,
647 { &hf_trmac_error_code,
648 { "Error Code", "trmac.error_code", FT_UINT16, BASE_HEX, NULL, 0x0,
651 /* Generated from convert_proto_tree_add_text.pl */
652 { &hf_trmac_response_code32, { "Response Code", "trmac.response_code", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }},
653 { &hf_trmac_response_code48, { "Response Code", "trmac.response_code48", FT_UINT64, BASE_HEX, NULL, 0x0, NULL, HFILL }},
654 { &hf_trmac_product_instance_id, { "Product Instance ID", "trmac.product_instance_id", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
655 { &hf_trmac_ring_station_version_number, { "Ring Station Version Number", "trmac.ring_station_version_number", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
656 { &hf_trmac_wrap_data, { "Wrap Data", "trmac.wrap_data", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
657 { &hf_trmac_frame_forward, { "Frame Forward", "trmac.frame_forward", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
658 { &hf_trmac_ring_station_status, { "Ring Station Status", "trmac.ring_station_status", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
659 { &hf_trmac_unknown_subvector, { "Unknown Subvector", "trmac.unknown_subvector", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
662 static gint *ett[] = {
669 static ei_register_info ei[] = {
670 { &ei_trmac_sv_len, { "trmac.svec.len.invalid", PI_MALFORMED, PI_ERROR, "Invalid length", EXPFILL }},
673 expert_module_t* expert_trmac;
675 proto_trmac = proto_register_protocol("Token-Ring Media Access Control", "TR MAC", "trmac");
676 proto_register_field_array(proto_trmac, hf, array_length(hf));
677 proto_register_subtree_array(ett, array_length(ett));
678 expert_trmac = expert_register_protocol(proto_trmac);
679 expert_register_field_array(expert_trmac, ei, array_length(ei));
681 register_dissector("trmac", dissect_trmac, proto_trmac);
685 * Editor modelines - https://www.wireshark.org/tools/modelines.html
690 * indent-tabs-mode: t
693 * vi: set shiftwidth=8 tabstop=8 noexpandtab:
694 * :indentSize=8:tabSize=8:noTabs=false: