Revert "TODO epan/dissectors/asn1/kerberos/packet-kerberos-template.c new GSS flags"
[wireshark-sm.git] / epan / dissectors / packet-osi-options.c
blob1770ee9d6a2f7ec47bb14e2da2be403eebd03f5c
1 /* packet-osi-options.c
2 * Routines for the decode of ISO/OSI option part
3 * Covers:
4 * ISO 8473 CLNP (ConnectionLess Mode Network Service Protocol)
5 * ISO 10589 ISIS (Intradomain Routing Information Exchange Protocol)
6 * ISO 9542 ESIS (End System To Intermediate System Routing Exchange Protocol)
8 * Ralf Schneider <Ralf.Schneider@t-online.de>
10 * Wireshark - Network traffic analyzer
11 * By Gerald Combs <gerald@wireshark.org>
12 * Copyright 1998 Gerald Combs
14 * SPDX-License-Identifier: GPL-2.0-or-later
17 #include "config.h"
19 #include <epan/packet.h>
20 #include <epan/expert.h>
21 #include <epan/decode_as.h>
22 #include "packet-osi.h"
23 #include "packet-osi-options.h"
25 #define OSI_OPT_SECURITY 0xc5
26 #define OSI_OPT_QOS_MAINTANANCE 0xc3
27 #define OSI_OPT_PRIORITY 0xcd
28 #define OSI_OPT_ADDRESS_MASK 0xe1
29 #define OSI_OPT_SNPA_MASK 0xe2
30 #define OSI_OPT_ES_CONFIG_TIMER 0xc6
32 #define OSI_OPT_MAX_PRIORITY 0x0e
34 #define OSI_OPT_PADDING 0xcc
35 #define OSI_OPT_SOURCE_ROUTING 0xc8
36 #define OSI_OPT_RECORD_OF_ROUTE 0xcb
37 #define OSI_OPT_REASON_OF_DISCARD 0xc1
39 #define OSI_OPT_SEC_MASK 0xc0
40 #define OSI_OPT_SEC_RESERVED 0x00
41 #define OSI_OPT_SEC_SRC_ADR_SPEC 0x01
42 #define OSI_OPT_SEC_DST_ADR_SPEC 0x02
43 #define OSI_OPT_SEC_GLOBAL_UNIQUE 0x03
45 #define OSI_OPT_QOS_MASK 0xc0
46 #define OSI_OPT_QOS_RESERVED 0x00
47 #define OSI_OPT_QOS_SRC_ADR_SPEC 0x01
48 #define OSI_OPT_QOS_DST_ADR_SPEC 0x02
49 #define OSI_OPT_QOS_GLOBAL_UNIQUE 0x03
51 #define OSI_OPT_QOS_SUB_MASK 0x3f
52 #define OSI_OPT_QOS_SUB_RSVD 0x20
53 #define OSI_OPT_QOS_SUB_SEQ_VS_TRS 0x10
54 #define OSI_OPT_QOS_SUB_CONG_EXPED 0x08
55 #define OSI_OPT_QOS_SUB_TSD_VS_COST 0x04
56 #define OSI_OPT_QOS_SUB_RESERR_TRS 0x02
57 #define OSI_OPT_QOS_SUB_RESERR_COST 0x01
59 #define OSI_OPT_RFD_GENERAL 0x00
60 #define OSI_OPT_RFD_ADDRESS 0x08
61 #define OSI_OPT_RFD_SOURCE_ROUTING 0x09
62 #define OSI_OPT_RFD_LIFETIME 0x0a
63 #define OSI_OPT_RFD_PDU_DISCARDED 0x0b
64 #define OSI_OPT_RFD_REASSEMBLY 0x0c
66 #define OSI_OPT_RFD_MASK 0xf0
67 #define OSI_OPT_RFD_SUB_MASK 0x0f
69 /* Generated from convert_proto_tree_add_text.pl */
70 static int hf_osi_options_address_mask;
71 static int hf_osi_options_transit_delay_vs_cost;
72 static int hf_osi_options_rtd_general;
73 static int hf_osi_options_residual_error_prob_vs_transit_delay;
74 static int hf_osi_options_qos_sequencing_vs_transit_delay;
75 static int hf_osi_options_rtd_address;
76 static int hf_osi_options_congestion_experienced;
77 static int hf_osi_options_esct;
78 static int hf_osi_options_rtd_reassembly;
79 static int hf_osi_options_qos_maintenance;
80 static int hf_osi_options_security_type;
81 static int hf_osi_options_route_recording;
82 static int hf_osi_options_last_hop;
83 static int hf_osi_options_route;
84 static int hf_osi_options_rtd_lifetime;
85 static int hf_osi_options_rtd_source_routing;
86 static int hf_osi_options_padding;
87 static int hf_osi_options_rfd_error_class;
88 static int hf_osi_options_snpa_mask;
89 static int hf_osi_options_source_routing;
90 static int hf_osi_options_priority;
91 static int hf_osi_options_qos_reserved;
92 static int hf_osi_options_residual_error_prob_vs_cost;
93 static int hf_osi_options_rtd_pdu_discarded;
94 static int hf_osi_options_rfd_field;
96 static int ett_osi_options;
97 static int ett_osi_qos;
98 static int ett_osi_route;
99 static int ett_osi_redirect;
101 static expert_field ei_osi_options_none;
102 static expert_field ei_osi_options_rfd_error_class;
104 static const value_string osi_opt_sec_vals[] = {
105 {OSI_OPT_SEC_RESERVED, "Reserved"},
106 {OSI_OPT_SEC_SRC_ADR_SPEC, "Source Address Specific"},
107 {OSI_OPT_SEC_DST_ADR_SPEC, "Destination Address Specific"},
108 {OSI_OPT_SEC_GLOBAL_UNIQUE, "Globally Unique"},
109 {0, NULL}
112 static const value_string osi_opt_qos_vals[] = {
113 {OSI_OPT_QOS_RESERVED, "Reserved"},
114 {OSI_OPT_QOS_SRC_ADR_SPEC, "Source Address Specific"},
115 {OSI_OPT_QOS_DST_ADR_SPEC, "Destination Address Specific"},
116 {OSI_OPT_QOS_GLOBAL_UNIQUE, "Globally Unique"},
117 {0, NULL}
120 static const value_string osi_opt_rfd_error_class[] = {
121 {OSI_OPT_RFD_GENERAL, "General"},
122 {OSI_OPT_RFD_ADDRESS, "Address"},
123 {OSI_OPT_RFD_SOURCE_ROUTING, "Source Routing"},
124 {OSI_OPT_RFD_LIFETIME, "Lifetime"},
125 {OSI_OPT_RFD_PDU_DISCARDED, "PDU discarded"},
126 {OSI_OPT_RFD_REASSEMBLY, "Reassembly"},
127 {0, NULL}
130 static const value_string osi_opt_rfd_general[] = {
131 {0x00, "Reason not specified"},
132 {0x01, "Protocol procedure error"},
133 {0x02, "Incorrect checksum"},
134 {0x03, "PDU discarded due to congestion"},
135 {0x04, "Header syntax error ( cannot be parsed )"},
136 {0x05, "Segmentation needed but not permitted"},
137 {0x06, "Incomplete PDU received"},
138 {0x07, "Duplicate option"},
139 {0, NULL}
142 static const value_string osi_opt_rfd_address[] = {
143 {0x00, "Destination Address unreachable"},
144 {0x01, "Destination Address unknown"},
145 {0, NULL}
148 static const value_string osi_opt_rfd_src_route[] = {
149 {0x00, "Unspecified source routing error"},
150 {0x01, "Syntax error in source routing field"},
151 {0x02, "Unknown address in source routing field"},
152 {0x03, "Path not acceptable"},
153 {0, NULL}
156 static const value_string osi_opt_rfd_lifetime[] = {
157 {0x00, "Lifetime expired while data unit in transit"},
158 {0x01, "Lifetime expired during reassembly"},
159 {0, NULL}
162 static const value_string osi_opt_rfd_discarded[] = {
163 {0x00, "Unsupported option not specified"},
164 {0x01, "Unsupported protocol version"},
165 {0x02, "Unsupported security option"},
166 {0x03, "Unsupported source routing option"},
167 {0x04, "Unsupported recording of route option"},
168 {0, NULL}
171 static const value_string osi_opt_rfd_reassembly[] = {
172 {0x00, "Reassembly interference"},
173 {0, NULL} };
175 static dissector_table_t subdissector_decode_as_opt_security_table;
177 static void
178 dissect_option_qos(const uint8_t qos, proto_tree *tree, tvbuff_t *tvb, int offset)
180 proto_item *ti;
181 proto_tree *osi_qos_tree;
183 ti = proto_tree_add_item(tree, hf_osi_options_qos_maintenance, tvb, offset, 1, ENC_BIG_ENDIAN);
184 osi_qos_tree = proto_item_add_subtree(ti, ett_osi_qos);
186 if ( ((qos & OSI_OPT_QOS_MASK) >> 6) == OSI_OPT_QOS_GLOBAL_UNIQUE) { /* Analyze BIT field to get all Values */
187 proto_tree_add_item(osi_qos_tree, hf_osi_options_qos_reserved, tvb, offset, 1, ENC_NA);
188 proto_tree_add_item(osi_qos_tree, hf_osi_options_qos_sequencing_vs_transit_delay, tvb, offset, 1, ENC_NA);
189 proto_tree_add_item(osi_qos_tree, hf_osi_options_congestion_experienced, tvb, offset, 1, ENC_NA);
190 proto_tree_add_item(osi_qos_tree, hf_osi_options_transit_delay_vs_cost, tvb, offset, 1, ENC_NA);
191 proto_tree_add_item(osi_qos_tree, hf_osi_options_residual_error_prob_vs_transit_delay, tvb, offset, 1, ENC_NA);
192 proto_tree_add_item(osi_qos_tree, hf_osi_options_residual_error_prob_vs_cost, tvb, offset, 1, ENC_NA);
196 static void
197 dissect_option_route(unsigned char parm_type, int offset, unsigned char parm_len,
198 tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo )
200 unsigned char next_hop = 0;
201 uint16_t this_hop = 0;
202 unsigned char netl = 0;
203 unsigned char last_hop = 0;
204 unsigned char cnt_hops = 0;
205 unsigned char crr = 0;
206 char* str;
208 proto_tree *osi_route_tree = NULL;
210 if ( parm_type == OSI_OPT_SOURCE_ROUTING ) {
211 next_hop = tvb_get_uint8(tvb, offset + 1);
212 netl = tvb_get_uint8(tvb, next_hop + 2);
213 this_hop = offset + 2; /* points to first netl */
215 proto_tree_add_uint_format_value(tree, hf_osi_options_source_routing, tvb, offset + next_hop, netl,
216 tvb_get_uint8(tvb, offset), "%s ( Next Hop Highlighted In Data Buffer )",
217 (tvb_get_uint8(tvb, offset) == 0) ? "Partial Source Routing" :
218 "Complete Source Routing");
220 else if ( parm_type == OSI_OPT_RECORD_OF_ROUTE ) {
221 crr = tvb_get_uint8(tvb, offset);
222 last_hop = tvb_get_uint8(tvb, offset + 1);
223 osi_route_tree = proto_tree_add_subtree(tree, tvb, offset, parm_len, ett_osi_route, NULL,
224 (crr == 0) ? "Partial Route Recording" : "Complete Route Recording");
226 /* Complete Route Recording or Partial Route Recording */
227 proto_tree_add_uint_format_value(tree, hf_osi_options_route_recording, tvb, offset, 1, crr, "%s ",
228 (crr == 0) ? "Partial Route Recording" :
229 "Complete Route Recording");
231 /* "last_hop" is either :
232 * 0x03 : special value for no NET recorded yet.
233 * 0xFF : special value telling there is no more place
234 in the Route Recording Allocated Length and
235 therefore next NETs won't be recorded.
236 * Other value : Total length of recorded NETs so far.
238 if ( last_hop == 0x03 )
239 proto_tree_add_uint_format(osi_route_tree, hf_osi_options_last_hop, tvb, offset + 1, 1, last_hop,
240 "No Network Entity Titles Recorded Yet");
241 if ( last_hop == 0xFF )
242 proto_tree_add_uint_format(osi_route_tree, hf_osi_options_last_hop, tvb, offset + 1, 1, last_hop,
243 "Recording Terminated : No more space !");
245 if ( last_hop == 255 || last_hop == 0x03 )
246 this_hop = parm_len + 1; /* recording terminated,
247 * or not begun, nothing to show */
248 else
249 this_hop = offset + 2; /* points to first netl */
252 while ( this_hop < offset + last_hop -2 ) { /* -2 for crr and last_hop */
253 netl = tvb_get_uint8(tvb, this_hop);
254 str = print_nsap_net(pinfo->pool, tvb, this_hop + 1, netl);
255 proto_tree_add_string_format(osi_route_tree, hf_osi_options_route, tvb, this_hop, netl + 1, str,
256 "Hop #%3u NETL: %2u, NET: %s", cnt_hops++, netl, str);
257 this_hop += 1 + netl;
262 static void
263 dissect_option_rfd(const unsigned char error, const unsigned char field, int offset,
264 unsigned char len _U_, tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo )
266 proto_item *ti;
268 ti = proto_tree_add_item(tree, hf_osi_options_rfd_error_class, tvb, offset, 1, ENC_BIG_ENDIAN);
270 switch ((error & OSI_OPT_RFD_MASK) >> 4)
272 case OSI_OPT_RFD_GENERAL:
273 proto_tree_add_item(tree, hf_osi_options_rtd_general, tvb, offset, 1, ENC_BIG_ENDIAN);
274 break;
275 case OSI_OPT_RFD_ADDRESS:
276 proto_tree_add_item(tree, hf_osi_options_rtd_address, tvb, offset, 1, ENC_BIG_ENDIAN);
277 break;
278 case OSI_OPT_RFD_SOURCE_ROUTING:
279 proto_tree_add_item(tree, hf_osi_options_rtd_source_routing, tvb, offset, 1, ENC_BIG_ENDIAN);
280 break;
281 case OSI_OPT_RFD_LIFETIME:
282 proto_tree_add_item(tree, hf_osi_options_rtd_lifetime, tvb, offset, 1, ENC_BIG_ENDIAN);
283 break;
284 case OSI_OPT_RFD_PDU_DISCARDED:
285 proto_tree_add_item(tree, hf_osi_options_rtd_pdu_discarded, tvb, offset, 1, ENC_BIG_ENDIAN);
286 break;
287 case OSI_OPT_RFD_REASSEMBLY:
288 proto_tree_add_item(tree, hf_osi_options_rtd_reassembly, tvb, offset, 1, ENC_BIG_ENDIAN);
289 break;
290 default:
291 expert_add_info(pinfo, ti, &ei_osi_options_rfd_error_class);
294 proto_tree_add_uint(tree, hf_osi_options_rfd_field, tvb, offset + field, 1, field);
297 /* ############################## Dissection Functions ###################### */
300 * Name: dissect_osi_options()
302 * Description:
303 * Main entry area for esis de-mangling. This will build the
304 * main esis tree data and call the sub-protocols as needed.
306 * Input:
307 * unsigned char : length of option section
308 * tvbuff_t * : tvbuff containing packet data
309 * int : offset into packet where we are (packet_data[offset]== start
310 * of what we care about)
311 * proto_tree * : tree of display data. May be NULL.
313 * Output:
314 * void, but we will add to the proto_tree if it is not NULL.
316 void
317 dissect_osi_options(unsigned char opt_len, tvbuff_t *tvb, int offset, proto_tree *tree, packet_info *pinfo)
319 proto_item *ti;
320 proto_tree *osi_option_tree = NULL;
321 unsigned char parm_len = 0;
322 unsigned char parm_type = 0;
323 uint8_t octet;
324 uint32_t sec_type;
325 tvbuff_t *next_tvb;
327 osi_option_tree = proto_tree_add_subtree(tree, tvb, offset, opt_len,
328 ett_osi_options, &ti, "### Option Section ###");
329 if ( 0 == opt_len ) {
330 expert_add_info(pinfo, ti, &ei_osi_options_none);
331 return;
334 while ( 0 < opt_len ) {
335 parm_type = tvb_get_uint8(tvb, offset++);
336 parm_len = tvb_get_uint8(tvb, offset++);
338 switch ( parm_type ) {
339 case OSI_OPT_QOS_MAINTANANCE:
340 octet = tvb_get_uint8(tvb, offset);
341 dissect_option_qos(octet, osi_option_tree, tvb, offset);
342 break;
344 case OSI_OPT_SECURITY:
346 * This is unspecified by ISO 8473, and the interpretation
347 * of the value of the security option appears to be
348 * specified by various profiles, such as GOSIP, TUBA, and
349 * ATN.
351 * Thus, we use a payload dissector, so the user can
352 * specify which dissector to use.
354 proto_tree_add_item_ret_uint(osi_option_tree, hf_osi_options_security_type, tvb, offset, 1, ENC_BIG_ENDIAN, &sec_type);
355 /* XXX */
356 switch ( sec_type ) {
358 case OSI_OPT_SEC_RESERVED:
359 case OSI_OPT_SEC_SRC_ADR_SPEC:
360 case OSI_OPT_SEC_DST_ADR_SPEC:
361 default:
362 break;
364 case OSI_OPT_SEC_GLOBAL_UNIQUE:
365 next_tvb = tvb_new_subset_length(tvb, offset + 1, parm_len - 1);
366 dissector_try_payload_with_data(subdissector_decode_as_opt_security_table,
367 next_tvb, pinfo, osi_option_tree, true, NULL);
368 break;
370 break;
372 case OSI_OPT_PRIORITY:
373 octet = tvb_get_uint8(tvb, offset);
374 if ( OSI_OPT_MAX_PRIORITY >= octet ) {
375 ti = proto_tree_add_item(osi_option_tree, hf_osi_options_priority, tvb, offset, 1, ENC_BIG_ENDIAN);
376 } else {
377 ti = proto_tree_add_uint_format_value(osi_option_tree, hf_osi_options_priority, tvb, offset, 1,
378 octet, "%u ( Invalid )", octet);
380 proto_item_set_len(ti, parm_len);
381 break;
383 case OSI_OPT_ADDRESS_MASK:
384 proto_tree_add_bytes_format_value(osi_option_tree, hf_osi_options_address_mask, tvb, offset, parm_len,
385 NULL, "%s",
386 print_area(pinfo->pool, tvb, offset, parm_len));
387 break;
389 case OSI_OPT_SNPA_MASK:
390 proto_tree_add_item(osi_option_tree, hf_osi_options_snpa_mask, tvb, offset, parm_len, ENC_NA);
391 break;
393 case OSI_OPT_ES_CONFIG_TIMER:
394 ti = proto_tree_add_item(osi_option_tree, hf_osi_options_esct, tvb, offset, 2, ENC_BIG_ENDIAN);
395 proto_item_set_len(ti, parm_len); break;
397 case OSI_OPT_PADDING:
398 proto_tree_add_item(osi_option_tree, hf_osi_options_padding, tvb, offset, parm_len, ENC_NA);
399 break;
401 case OSI_OPT_SOURCE_ROUTING:
402 case OSI_OPT_RECORD_OF_ROUTE:
403 dissect_option_route(parm_type, offset, parm_len, tvb,
404 osi_option_tree, pinfo);
405 break;
407 case OSI_OPT_REASON_OF_DISCARD:
408 dissect_option_rfd(tvb_get_uint8(tvb, offset),
409 tvb_get_uint8(tvb, offset + 1), offset, parm_len,
410 tvb, osi_option_tree, pinfo);
411 break;
413 opt_len -= parm_len + 2;
414 offset += parm_len;
416 } /* dissect-osi-options */
420 * Name: proto_register_osi_options()
422 * Description:
423 * main register for esis protocol set. We register some display
424 * formats and the protocol module variables.
426 * NOTE: this procedure to autolinked by the makefile process that
427 * builds register.c
429 * Input:
430 * void
432 * Output:
433 * void
436 void
437 proto_register_osi_options(void) {
439 static hf_register_info hf[] =
441 /* Generated from convert_proto_tree_add_text.pl */
442 { &hf_osi_options_qos_maintenance, { "Quality of service maintenance", "osi.options.qos.maintenance", FT_UINT8, BASE_DEC, VALS(osi_opt_qos_vals), OSI_OPT_QOS_MASK, NULL, HFILL }},
443 { &hf_osi_options_qos_reserved, { "Reserved", "osi.options.qos.reserved", FT_BOOLEAN, 8, NULL, OSI_OPT_QOS_SUB_RSVD, NULL, HFILL }},
444 { &hf_osi_options_qos_sequencing_vs_transit_delay, { "Sequencing versus transit delay", "osi.options.qos.seq_vs_trs", FT_BOOLEAN, 8, NULL, OSI_OPT_QOS_SUB_SEQ_VS_TRS, NULL, HFILL }},
445 { &hf_osi_options_congestion_experienced, { "Congestion experienced", "osi.options.qos.cong_exped", FT_BOOLEAN, 8, NULL, OSI_OPT_QOS_SUB_CONG_EXPED, NULL, HFILL }},
446 { &hf_osi_options_transit_delay_vs_cost, { "Transit delay versus cost", "osi.options.qos.tsd_vs_cost", FT_BOOLEAN, 8, NULL, OSI_OPT_QOS_SUB_TSD_VS_COST, NULL, HFILL }},
447 { &hf_osi_options_residual_error_prob_vs_transit_delay, { "Residual error probability versus transit delay", "osi.options.qos.reserror_trs", FT_BOOLEAN, 8, NULL, OSI_OPT_QOS_SUB_RESERR_TRS, NULL, HFILL }},
448 { &hf_osi_options_residual_error_prob_vs_cost, { "Residual error probability versus cost", "osi.options.qos.reserror_cost", FT_BOOLEAN, 8, NULL, OSI_OPT_QOS_SUB_RESERR_COST, NULL, HFILL }},
449 { &hf_osi_options_source_routing, { "Source Routing", "osi.options.source_routing", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
450 { &hf_osi_options_route_recording, { "Route Recording", "osi.options.route_recording", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
451 { &hf_osi_options_last_hop, { "Last Hop", "osi.options.last_hop", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }},
452 { &hf_osi_options_route, { "Route", "osi.options.route", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }},
453 { &hf_osi_options_rfd_error_class, { "Error Class", "osi.options.rfd.error_class", FT_UINT8, BASE_DEC, VALS(osi_opt_rfd_error_class), OSI_OPT_RFD_MASK, NULL, HFILL }},
454 { &hf_osi_options_rtd_general, { "Reason for discard {General}", "osi.options.rtd_general", FT_UINT8, BASE_DEC, VALS(osi_opt_rfd_general), OSI_OPT_RFD_SUB_MASK, NULL, HFILL }},
455 { &hf_osi_options_rtd_address, { "Reason for discard {Address}", "osi.options.rtd_address", FT_UINT8, BASE_DEC, VALS(osi_opt_rfd_address), OSI_OPT_RFD_SUB_MASK, NULL, HFILL }},
456 { &hf_osi_options_rtd_source_routing, { "Reason for discard {Source Routing}", "osi.options.rtd_source_routing", FT_UINT8, BASE_DEC, VALS(osi_opt_rfd_src_route), OSI_OPT_RFD_SUB_MASK, NULL, HFILL }},
457 { &hf_osi_options_rtd_lifetime, { "Reason for discard {Lifetime}", "osi.options.rtd_lifetime", FT_UINT8, BASE_DEC, VALS(osi_opt_rfd_lifetime), OSI_OPT_RFD_SUB_MASK, NULL, HFILL }},
458 { &hf_osi_options_rtd_pdu_discarded, { "Reason for discard {PDU discarded}", "osi.options.rtd_pdu_discarded", FT_UINT8, BASE_DEC, VALS(osi_opt_rfd_discarded), OSI_OPT_RFD_SUB_MASK, NULL, HFILL }},
459 { &hf_osi_options_rtd_reassembly, { "Reason for discard {Reassembly}", "osi.options.rtd_reassembly", FT_UINT8, BASE_DEC, VALS(osi_opt_rfd_reassembly), OSI_OPT_RFD_SUB_MASK, NULL, HFILL }},
460 { &hf_osi_options_rfd_field, { "Field", "osi.options.rfd.field", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
461 { &hf_osi_options_security_type, { "Security type", "osi.options.security_type", FT_UINT8, BASE_DEC, VALS(osi_opt_sec_vals), OSI_OPT_SEC_MASK, NULL, HFILL }},
462 { &hf_osi_options_priority, { "Priority", "osi.options.priority", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
463 { &hf_osi_options_address_mask, { "Address Mask", "osi.options.address_mask", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
464 { &hf_osi_options_snpa_mask, { "SNPA Mask", "osi.options.snpa_mask", FT_SYSTEM_ID, BASE_NONE, NULL, 0x0, NULL, HFILL }},
465 { &hf_osi_options_esct, { "ESCT (seconds)", "osi.options.esct", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
466 { &hf_osi_options_padding, { "Padding", "osi.options.padding", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
469 static int *ett[] = {
470 &ett_osi_options,
471 &ett_osi_qos,
472 &ett_osi_route,
473 &ett_osi_redirect
476 static ei_register_info ei[] = {
477 { &ei_osi_options_none, { "osi.options.none", PI_PROTOCOL, PI_NOTE, "No Options for this PDU", EXPFILL }},
478 { &ei_osi_options_rfd_error_class, { "osi.options.rfd.error_class.unknown", PI_PROTOCOL, PI_WARN, "UNKNOWN Error Class", EXPFILL }},
481 expert_module_t *expert_osi_options;
483 proto_register_field_array(proto_osi, hf, array_length(hf));
484 proto_register_subtree_array(ett, array_length(ett));
485 expert_osi_options = expert_register_protocol(proto_osi);
486 expert_register_field_array(expert_osi_options, ei, array_length(ei));
488 subdissector_decode_as_opt_security_table = register_decode_as_next_proto(proto_osi,
489 "osi.opt_security", "OSI Security Option", NULL);
493 * Editor modelines - https://www.wireshark.org/tools/modelines.html
495 * Local variables:
496 * c-basic-offset: 2
497 * tab-width: 8
498 * indent-tabs-mode: nil
499 * End:
501 * vi: set shiftwidth=2 tabstop=8 expandtab:
502 * :indentSize=2:tabSize=8:noTabs=true: