2 * WiMax Utility Decoders
4 * Copyright (c) 2007 by Intel Corporation.
6 * Author: Lu Pan <lu.pan@intel.com>
10 * Wireshark - Network traffic analyzer
11 * By Gerald Combs <gerald@wireshark.org>
12 * Copyright 1999 Gerald Combs
14 * This program is free software; you can redistribute it and/or
15 * modify it under the terms of the GNU General Public License
16 * as published by the Free Software Foundation; either version 2
17 * of the License, or (at your option) any later version.
19 * This program is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
24 * You should have received a copy of the GNU General Public License
25 * along with this program; if not, write to the Free Software
26 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
38 #include <epan/packet.h>
39 #include "wimax_tlv.h"
40 #include "wimax_mac.h"
42 #include "wimax_bits.h"
44 extern gint proto_mac_mgmt_msg_rng_req_decoder;
45 extern gint proto_mac_mgmt_msg_reg_req_decoder;
47 extern gint mac_sdu_length; /* declared in packet-wmx.c */
48 extern gboolean include_cor2_changes;
50 /* forward reference */
51 void wimax_service_flow_encodings_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
52 void wimax_error_parameter_set_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
53 void wimax_security_negotiation_parameters_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
54 void wimax_tek_parameters_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
55 void wimax_pkm_configuration_settings_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
56 void wimax_sa_descriptor_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
57 void wimax_pkm_tlv_encoded_attributes_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
58 void wimax_cryptographic_suite_list_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
59 void wimax_security_capabilities_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
60 void wimax_vendor_specific_information_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
61 guint wimax_common_tlv_encoding_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
63 static gint proto_wimax_utility_decoders = -1;
64 static gint ett_wimax_service_flow_encodings = -1;
65 static gint ett_wimax_cst_encoding_rules = -1;
66 static gint ett_wimax_error_parameter_set = -1;
67 static gint ett_wimax_hmac_tuple = -1;
68 static gint ett_wimax_cmac_tuple = -1;
69 static gint ett_wimax_short_hmac_tuple = -1;
70 static gint ett_security_negotiation_parameters = -1;
71 static gint ett_pkm_tlv_encoded_attributes_decoder = -1;
72 static gint ett_sa_descriptor_decoder = -1;
73 static gint ett_cryptographic_suite_list_decoder = -1;
74 static gint ett_security_capabilities_decoder = -1;
75 static gint ett_vendor_specific_info_decoder = -1;
76 static gint ett_vendor_id_encoding_decoder = -1;
77 static gint ett_ul_service_flow_decoder = -1;
78 static gint ett_dl_service_flow_decoder = -1;
80 static dissector_handle_t eap_handle = NULL;
82 /* The following two variables save the Scheduling Service type for
83 the Grant Management subheader dissector and track whether or not
86 static guint scheduling_service_type = -1;
87 gint seen_a_service_type = 0;
89 /* The following two functions set and access the variables above */
90 guint get_service_type( void )
92 return scheduling_service_type;
95 void set_service_type( guint set_to )
97 if( seen_a_service_type == 0 ){
98 scheduling_service_type = set_to;
99 seen_a_service_type = 1;
103 /* Setup protocol subtree array */
106 &ett_wimax_service_flow_encodings,
107 &ett_wimax_cst_encoding_rules,
108 &ett_wimax_error_parameter_set,
109 &ett_wimax_hmac_tuple,
110 &ett_wimax_cmac_tuple,
111 &ett_wimax_short_hmac_tuple,
112 &ett_security_negotiation_parameters,
113 &ett_pkm_tlv_encoded_attributes_decoder,
114 &ett_sa_descriptor_decoder,
115 &ett_cryptographic_suite_list_decoder,
116 &ett_security_capabilities_decoder,
117 &ett_vendor_specific_info_decoder,
118 &ett_vendor_id_encoding_decoder,
119 &ett_ul_service_flow_decoder,
120 &ett_dl_service_flow_decoder,
123 static const value_string vals_mbs_service[] =
125 {0, "No available MBS"},
126 {1, "Single-BS-MBS"},
131 static const value_string vals_ul_grant_scheduling[] =
134 {1, "Undefined (BS implementation-dependent)"},
138 {5, "Extended rtPS"},
143 static const value_string vals_fixed_len_sdu[] =
145 {0, "Variable-length SDUs (default)"},
146 {1, "Fixed-length SDUs"},
150 static const value_string vals_arq_enable[] =
152 {0, "ARQ not requested/accepted"},
153 {1, "ARQ requested/accepted"},
156 static const value_string vals_arq_block_lifetime[] =
161 static const value_string vals_arq_sync_loss_timeout[] =
167 static const value_string vals_arq_deliver_in_order[] =
169 {0, "Order of delivery is not preserved"},
170 {1, "Order of delivery is preserved"},
173 static const value_string vals_arq_rx_purge_timeout[] =
179 static const value_string vals_fsn_size[] =
182 {1, "11-bit FSN (default)"},
186 static const value_string vals_sn_fb_enable[] =
188 {0, "Is disabled (default)"},
193 static const value_string vals_harq[] =
195 {0, "Non HARQ (default)"},
196 {1, "HARQ connection" },
200 static const value_string vals_cs_specification[] =
205 {3, "Packet, IEEE 802.3/Ethernet"},
206 {4, "Packet, IEEE 802.1Q VLAN"},
207 {5, "Packet, IPv4 over IEEE 802.3/Ethernet"},
208 {6, "Packet, IPv6 over IEEE 802.3/Ethernet"},
209 {7, "Packet, IPv4 over IEEE 802.1Q VLAN"},
210 {8, "Packet, IPv6 over IEEE 802.1Q VLAN"},
212 {10, "Packet, IEEE 802.3/Ethernet with ROCH header compression"},
213 {11, "Packet, IEEE 802.3/Ethernet with ECRTP header compression"},
214 {12, "Packet, IP2 with ROCH header compression"},
215 {13, "Packet, IP2 with ECRTP header compression"},
219 static const value_string vals_type_of_data_delivery_services[] =
221 {0, "Continuing grant service"},
222 {1, "Real time variable rate service"},
223 {2, "Non-real time variable rate service"},
224 {3, "Best-efforts service"},
225 {4, "Extended real-time variable rate service"},
229 static const value_string vals_paging_preference[] =
231 {0, "No paging generation"},
232 {1, "Paging generation"},
235 static const value_string vals_pdu_sn_ext_subheader[] =
237 {0, "No support for PDU SN in this connection (default)"},
238 {1, "PDU SN (short) extended Subheader"},
239 {2, "PDU SN (long) extended Subheader"},
243 static const value_string vals_cst_classifier_action[] =
245 {0, "DSC Add Classifier"},
246 {1, "DSC Replace Classifier"},
247 {2, "DSC Delete Classifier"},
251 static const value_string vals_cst_phs_dsc_action[] =
255 {2, "Delete PHS rule"},
256 {3, "Delete all PHS rules"},
260 static const value_string vals_verify[] =
267 static const value_string vals_atm_switching_encodings[] =
269 {0, "No switching methodology applied"},
275 static const value_string vals_cc[] =
279 {2, "Reject-unrecognized-configuration-setting"},
280 {3, "Reject-temporary / reject-resource"},
281 {4, "Reject-permanent / reject-admin"},
282 {5, "Reject-not-owner"},
283 {6, "Reject-service-flow-not-found"},
284 {7, "Reject-service-flow-exists"},
285 {8, "Reject-required-parameter-not-present"},
286 {9, "Reject-header-suppression"},
287 {10, "Reject-unknown-transaction-id"},
288 {11, "Reject-authentication-failure"},
289 {12, "Reject-add-aborted"},
290 {13, "Reject-exceeded-dynamic-service-limit"},
291 {14, "Reject-not-authorized-for-the-request-SAID"},
292 {15, "Reject-fail-to-establish-the-requested-SA"},
293 {16, "Reject-not-supported-parameter"},
294 {17, "Reject-not-supported-parameter-value"},
298 static const value_string vals_classification_action_rule[] =
301 {1, "Discarded packet"},
305 static const true_false_string tfs_supported =
311 static const true_false_string disabled_enabled =
317 static const true_false_string default_enabled =
323 static const value_string vals_pkm_attr_error_codes[] =
325 {0, "All (no information)"},
326 {1, "Auth Reject Auth Invalid (unauthorized SS)"},
327 {2, "Auth Reject, Key Reject (unauthorized SAID)"},
328 {3, "Auth Invalid (unsolicited)"},
329 {4, "Auth Invalid, TEK Invalid (invalid key sequence number)"},
330 {5, "Auth Invalid (message (key request) authorization failure)"},
331 {6, "Auth Reject (permanent authorization failure)"},
335 static const value_string vs_sa_type[] =
343 static const value_string va_key_push_modes[] =
345 {0, "GKEK update mode"},
346 {1, "GTEK update mode"},
350 static const value_string vals_pkm_version[] =
353 {1, "PKM (Initial standard release"},
357 static const value_string vs_success_reject[] =
364 static const value_string vs_sa_service_type[] =
366 {0, "Unicast service"},
367 {1, "Group multicast service"},
372 static const value_string vals_data_encryption_ids[] =
374 {0, "No data encryption"},
375 {1, "CBC-Mode, 56-bit DES"},
376 {2, "CCM-Mode, 128-bit AES"},
377 {3, "CBC-Mode, 128-bit AES"},
378 {128, "CTR-Mode, 128-bit AES for MBS with 8 bit ROC"},
382 static const value_string vals_data_authentication_ids[] =
384 {0, "No data authentication"},
385 {1, "CCM-Mode, 128-bit AES"},
389 static const value_string vals_tek_encryption_ids[] =
392 {1, "3-DES EDE with 128-bit key"},
393 {2, "RSA with 1024-bit key"},
394 {3, "ECB mode AES with 128-bit key"},
395 {4, "AES key wrap with 128-bit key"},
399 static const value_string vals_dcd_mac_version[] =
401 {1, "Conformance with IEEE Std 802.16-2001"},
402 {2, "Conformance with IEEE Std 802.16c-2002 and its predecessors"},
403 {3, "Conformance with IEEE Std 802.16a-2003 and its predecessors"},
404 {4, "Conformance with IEEE Std 802.16-2004"},
405 {5, "Conformance with IEEE Std 802.16-2004 and IEEE Std 802.16e-2005"},
411 static gint hf_sfe_unknown_type = -1;
412 static gint hf_sfe_sf_id = -1;
413 static gint hf_sfe_cid = -1;
414 static gint hf_sfe_service_class_name = -1;
415 static gint hf_sfe_mbs_service = -1;
416 static gint hf_sfe_qos_params_set = -1;
417 static gint hf_sfe_set_provisioned = -1;
418 static gint hf_sfe_set_admitted = -1;
419 static gint hf_sfe_set_active = -1;
420 static gint hf_sfe_set_rsvd = -1;
421 static gint hf_sfe_traffic_priority = -1;
422 static gint hf_sfe_max_str = -1;
423 static gint hf_sfe_max_traffic_burst = -1;
424 static gint hf_sfe_min_rtr = -1;
425 static gint hf_sfe_reserved_10 = -1;
426 static gint hf_sfe_ul_grant_scheduling = -1;
427 static gint hf_sfe_req_tx_policy = -1;
428 static gint hf_sfe_policy_broadcast_bwr = -1;
429 static gint hf_sfe_policy_multicast_bwr = -1;
430 static gint hf_sfe_policy_piggyback = -1;
431 static gint hf_sfe_policy_fragment = -1;
432 static gint hf_sfe_policy_headers = -1;
433 static gint hf_sfe_policy_packing = -1;
434 static gint hf_sfe_policy_crc = -1;
435 static gint hf_sfe_policy_rsvd1 = -1;
436 static gint hf_sfe_jitter = -1;
437 static gint hf_sfe_max_latency = -1;
438 static gint hf_sfe_fixed_len_sdu = -1;
439 static gint hf_sfe_sdu_size = -1;
440 static gint hf_sfe_target_said = -1;
441 static gint hf_sfe_cs_specification = -1;
442 static gint hf_sfe_type_of_data_delivery_services = -1;
443 static gint hf_sfe_sdu_inter_arrival_interval = -1;
444 static gint hf_sfe_time_base = -1;
445 static gint hf_sfe_paging_preference = -1;
446 static gint hf_sfe_mbs_zone_identifier_assignment = -1;
447 static gint hf_sfe_sn_feedback_enabled = -1;
448 static gint hf_sfe_harq_service_flows = -1;
449 static gint hf_sfe_harq_channel_mapping_index = -1;
450 static gint hf_sfe_fsn_size = -1;
451 static gint hf_sfe_unsolicited_grant_interval = -1;
452 static gint hf_sfe_unsolicited_polling_interval = -1;
453 static gint hf_sfe_harq_channel_mapping = -1;
454 static gint hf_sfe_global_service_class_name = -1;
455 static gint hf_sfe_reserved_36 = -1;
456 static gint hf_sfe_reserved_34 = -1;
458 static gint hf_sfe_arq_enable = -1;
459 static gint hf_sfe_arq_transmitter_delay = -1;
460 static gint hf_sfe_arq_receiver_delay = -1;
461 static gint hf_sfe_arq_block_lifetime = -1;
462 static gint hf_sfe_arq_sync_loss_timeout = -1;
463 static gint hf_sfe_arq_transmitter_delay_cor2 = -1;
464 static gint hf_sfe_arq_receiver_delay_cor2 = -1;
465 static gint hf_sfe_arq_block_lifetime_cor2 = -1;
466 static gint hf_sfe_arq_sync_loss_timeout_cor2 = -1;
467 static gint hf_sfe_arq_deliver_in_order = -1;
468 static gint hf_sfe_arq_rx_purge_timeout = -1;
469 static gint hf_sfe_arq_window_size = -1;
470 static gint hf_sfe_arq_block_size = -1;
471 static gint hf_sfe_arq_block_size_cor2 = -1;
472 static gint hf_sfe_arq_min_block_size = -1;
473 static gint hf_sfe_arq_max_block_size = -1;
475 static gint hf_sfe_cid_alloc_for_active_bs = -1;
476 static gint hf_sfe_cid_alloc_for_active_bs_cid = -1;
477 static gint hf_sfe_pdu_sn_ext_subheader_reorder = -1;
478 static gint hf_sfe_mbs_contents_ids = -1;
479 static gint hf_sfe_mbs_contents_ids_id = -1;
480 static gint hf_sfe_authorization_token = -1;
482 static gint hf_cst_classifier_dsc_action = -1;
483 static gint hf_cst_error_set_errored_param = -1;
484 static gint hf_cst_error_set_error_code = -1;
485 static gint hf_cst_error_set_error_msg = -1;
487 static gint hf_cst_pkt_class_rule = -1;
489 static gint hf_cst_pkt_class_rule_priority = -1;
490 static gint hf_cst_pkt_class_rule_range_mask = -1;
491 static gint hf_cst_pkt_class_rule_tos_low = -1;
492 static gint hf_cst_pkt_class_rule_tos_high = -1;
493 static gint hf_cst_pkt_class_rule_tos_mask = -1;
494 static gint hf_cst_pkt_class_rule_protocol = -1;
495 /*static gint hf_cst_pkt_class_rule_protocol_number = -1;*/
496 static gint hf_cst_pkt_class_rule_ip_masked_src_address = -1;
497 static gint hf_cst_pkt_class_rule_ip_masked_dest_address = -1;
498 static gint hf_cst_pkt_class_rule_src_ipv4 = -1;
499 static gint hf_cst_pkt_class_rule_dest_ipv4 = -1;
500 static gint hf_cst_pkt_class_rule_mask_ipv4 = -1;
501 static gint hf_cst_pkt_class_rule_src_ipv6 = -1;
502 static gint hf_cst_pkt_class_rule_dest_ipv6 = -1;
503 static gint hf_cst_pkt_class_rule_mask_ipv6 = -1;
504 static gint hf_cst_pkt_class_rule_prot_src_port_range = -1;
505 static gint hf_cst_pkt_class_rule_src_port_low = -1;
506 static gint hf_cst_pkt_class_rule_src_port_high = -1;
507 static gint hf_cst_pkt_class_rule_prot_dest_port_range = -1;
508 static gint hf_cst_pkt_class_rule_dest_port_low = -1;
509 static gint hf_cst_pkt_class_rule_dest_port_high = -1;
510 static gint hf_cst_pkt_class_rule_dest_mac_address = -1;
511 static gint hf_cst_pkt_class_rule_dest_mac = -1;
512 static gint hf_cst_pkt_class_rule_src_mac_address = -1;
513 static gint hf_cst_pkt_class_rule_src_mac = -1;
514 static gint hf_cst_pkt_class_rule_mask_mac = -1;
515 static gint hf_cst_pkt_class_rule_ethertype = -1;
516 static gint hf_cst_pkt_class_rule_etype = -1;
517 static gint hf_cst_pkt_class_rule_eprot1 = -1;
518 static gint hf_cst_pkt_class_rule_eprot2 = -1;
519 static gint hf_cst_pkt_class_rule_user_priority = -1;
520 static gint hf_cst_pkt_class_rule_pri_low = -1;
521 static gint hf_cst_pkt_class_rule_pri_high = -1;
522 static gint hf_cst_pkt_class_rule_vlan_id = -1;
523 static gint hf_cst_pkt_class_rule_vlan_id1 = -1;
524 static gint hf_cst_pkt_class_rule_vlan_id2 = -1;
525 static gint hf_cst_pkt_class_rule_phsi = -1;
526 static gint hf_cst_pkt_class_rule_index = -1;
527 static gint hf_cst_pkt_class_rule_ipv6_flow_label = -1;
528 static gint hf_cst_pkt_class_rule_vendor_spec = -1;
529 static gint hf_cst_pkt_class_rule_classifier_action_rule = -1;
530 static gint hf_cst_pkt_class_rule_classifier_action_rule_bit0 = -1;
531 static gint hf_cst_pkt_class_rule_classifier_action_rule_bit1 = -1;
533 static gint hf_cst_large_context_id = -1;
534 static gint hf_cst_short_format_context_id = -1;
536 static gint hf_cst_phs_dsc_action = -1;
537 static gint hf_cst_phs_rule = -1;
538 static gint hf_cst_phs_phsi = -1;
539 static gint hf_cst_phs_phsf = -1;
540 static gint hf_cst_phs_phsm = -1;
541 static gint hf_cst_phs_phss = -1;
542 static gint hf_cst_phs_phsv = -1;
543 static gint hf_cst_phs_vendor_spec = -1;
544 static gint hf_cst_invalid_tlv = -1;
546 static gint hf_csper_atm_switching_encoding = -1;
547 static gint hf_csper_atm_classifier = -1;
548 static gint hf_csper_atm_classifier_vpi = -1;
549 static gint hf_csper_atm_classifier_vci = -1;
550 static gint hf_csper_atm_classifier_id = -1;
551 /*static gint hf_csper_atm_classifier_dsc_action = -1;*/
552 static gint hf_csper_unknown_type = -1;
554 static gint hf_xmac_tuple_rsvd = -1;
555 static gint hf_xmac_tuple_key_seq_num = -1;
556 static gint hf_hmac_tuple_hmac_digest = -1;
557 static gint hf_packet_number_counter = -1;
558 static gint hf_cmac_tuple_cmac_value = -1;
559 static gint hf_cmac_tuple_bsid = -1;
563 #define SFE_QOS_PARAMS_SET_PROVISIONED_SET 0x01
564 #define SFE_QOS_PARAMS_SET_ADMITTED_SET 0x02
565 #define SFE_QOS_PARAMS_SET_ACTIVE_SET 0x04
566 #define SFE_QOS_PARAMS_SET_RESERVED 0xF8
568 #define SFE_REQ_TX_POLICY_BROADCAST_BWR 0x01
569 #define SFE_REQ_TX_POLICY_MULTICAST_BWR 0x02
570 #define SFE_REQ_TX_POLICY_PIGGYBACK 0x04
571 #define SFE_REQ_TX_POLICY_FRAGMENT_DATA 0x08
572 #define SFE_REQ_TX_POLICY_PAYLOAD_HEADER 0x10
573 #define SFE_REQ_TX_POLICY_PACKINGS 0x20
574 #define SFE_REQ_TX_POLICY_CRC 0x40
575 #define SFE_REQ_TX_POLICY_RESERVED 0x80
577 /* WiMax Service Flow Encodings display */
578 static hf_register_info hf_sfe[] =
580 { /* 1 Service Flow ID */
582 {"Service Flow ID", "wmx.sfe.sf_id", FT_UINT32, BASE_HEX, NULL, 0x0, "", HFILL}
586 {"CID", "wmx.sfe.cid", FT_UINT16, BASE_DEC, NULL, 0x0, "", HFILL}
588 { /* 3 Service Class Name */
589 &hf_sfe_service_class_name,
590 {"Service Class Name", "wmx.sfe.service_class_name", FT_STRING, BASE_NONE, NULL, 0x0, "", HFILL}
592 { /* 4 MBS Service */
594 {"MBS Service", "wmx.sfe.mbs_service", FT_UINT8, BASE_DEC, VALS(vals_mbs_service), 0x0, "", HFILL}
596 { /* 5 QoS Parameter Set Type */
597 &hf_sfe_qos_params_set,
598 {"QoS Parameter Set Type", "wmx.sfe.qos_params_set", FT_UINT8, BASE_HEX, NULL, 0x0, "", HFILL}
601 &hf_sfe_set_provisioned,
602 {"Provisioned Set", "wmx.sfe.qos_params_set.provisioned", FT_BOOLEAN, 8, NULL, SFE_QOS_PARAMS_SET_PROVISIONED_SET, "", HFILL}
605 &hf_sfe_set_admitted,
606 {"Admitted Set", "wmx.sfe.qos_params_set.admitted", FT_BOOLEAN, 8, NULL, SFE_QOS_PARAMS_SET_ADMITTED_SET, "", HFILL}
610 {"Active Set", "wmx.sfe.qos_params_set.active", FT_BOOLEAN, 8, NULL, SFE_QOS_PARAMS_SET_ACTIVE_SET, "", HFILL}
614 {"Reserved", "wmx.sfe.qos_params_set.rsvd", FT_UINT8, BASE_HEX, NULL, SFE_QOS_PARAMS_SET_RESERVED, "", HFILL}
616 { /* 6 Traffic Priority */
617 &hf_sfe_traffic_priority,
618 {"Traffic Priority", "wmx.sfe.traffic_priority", FT_UINT8, BASE_DEC, NULL, 0x0, "", HFILL}
620 { /* 7 Maximum Sustained Traffic Rate */
622 {"Maximum Sustained Traffic Rate", "wmx.sfe.msr", FT_UINT32, BASE_DEC, NULL, 0x0, "", HFILL}
624 { /* 8 Maximum Traffic Burst */
625 &hf_sfe_max_traffic_burst,
626 {"Maximum Traffic Burst", "wmx.sfe.max_traffic_burst", FT_UINT32, BASE_DEC, NULL, 0x0, "", HFILL}
628 { /* 9 Minimum Reserved Traffic Rate */
630 {"Minimum Reserved Traffic Rate", "wmx.sfe.mrr", FT_UINT32, BASE_DEC, NULL, 0x0, "", HFILL}
635 {"Reserved", "wmx.sfe.reserved_10", FT_UINT32, BASE_DEC, NULL, 0x0, "", HFILL}
638 { /* 10 reserved by 16E */
640 {"Minimum tolerable traffic rate", "wmx.sfe.mtr", FT_UINT32, BASE_HEX, NULL, 0x0, "", HFILL}
643 { /* 11 Service Flow Scheduling Type */
644 &hf_sfe_ul_grant_scheduling,
645 {"Uplink Grant Scheduling Type", "wmx.sfe.uplink_grant_scheduling", FT_UINT8, BASE_DEC, VALS(vals_ul_grant_scheduling), 0x0, "", HFILL}
647 { /* 12 Request/Transmission Policy */
648 &hf_sfe_req_tx_policy,
649 {"Request/Transmission Policy", "wmx.sfe.req_tx_policy", FT_UINT32, BASE_HEX, NULL, 0x0, "", HFILL}
652 &hf_sfe_policy_broadcast_bwr,
653 {"The Service Flow Shall Not Use Broadcast Bandwidth Request Opportunities", "wmx.sfe.policy.broadcast_bwr", FT_BOOLEAN, 8, NULL, SFE_REQ_TX_POLICY_BROADCAST_BWR, "", HFILL}
656 &hf_sfe_policy_multicast_bwr,
657 {"The Service Flow Shall Not Use Multicast Bandwidth Request Opportunities", "wmx.sfe.policy.bit1", FT_BOOLEAN, 8, NULL, SFE_REQ_TX_POLICY_MULTICAST_BWR, "", HFILL}
660 &hf_sfe_policy_piggyback,
661 {"The Service Flow Shall Not Piggyback Requests With Data", "wmx.sfe.policy.piggyback", FT_BOOLEAN, 8, NULL, SFE_REQ_TX_POLICY_PIGGYBACK, "", HFILL}
664 &hf_sfe_policy_fragment,
665 {"The Service Flow Shall Not Fragment Data", "wmx.sfe.policy.fragment", FT_BOOLEAN, 8, NULL, SFE_REQ_TX_POLICY_FRAGMENT_DATA, "", HFILL}
668 &hf_sfe_policy_headers,
669 {"The Service Flow Shall Not Suppress Payload Headers", "wmx.sfe.policy.headers", FT_BOOLEAN, 8, NULL, SFE_REQ_TX_POLICY_PAYLOAD_HEADER, "", HFILL}
672 &hf_sfe_policy_packing,
673 {"The Service Flow Shall Not Pack Multiple SDUs (Or Fragments) Into Single MAC PDUs", "wmx.sfe.policy.packing", FT_BOOLEAN, 8, NULL, SFE_REQ_TX_POLICY_PACKINGS, "", HFILL}
677 {"The Service Flow Shall Not Include CRC In The MAC PDU", "wmx.sfe.policy.crc", FT_BOOLEAN, 8, NULL, SFE_REQ_TX_POLICY_CRC, "", HFILL}
680 &hf_sfe_policy_rsvd1,
681 {"Reserved", "wmx.sfe.policy.rsvd1", FT_UINT8, BASE_HEX, NULL, SFE_REQ_TX_POLICY_RESERVED, "", HFILL}
683 { /* 13 Tolerated Jitter */
685 {"Tolerated Jitter", "wmx.sfe.jitter", FT_UINT32, BASE_DEC, NULL, 0x0, "", HFILL}
687 { /* 14 Maximum Latency */
689 {"Maximum Latency", "wmx.sfe.max_latency", FT_UINT32, BASE_DEC, NULL, 0x0, "", HFILL}
691 { /* 15 Fixed/Variable Length SDU */
692 &hf_sfe_fixed_len_sdu,
693 {"Fixed/Variable Length SDU", "wmx.sfe.fixed_len_sdu", FT_UINT8, BASE_DEC, VALS(vals_fixed_len_sdu), 0x0, "", HFILL}
697 {"SDU Size", "wmx.sfe.sdu_size", FT_UINT8, BASE_DEC, NULL, 0x0, "", HFILL}
699 { /* 17 SAID Onto Which SF Is Mapped */
701 {"SAID Onto Which SF Is Mapped", "wmx.sfe.target_said", FT_UINT16, BASE_HEX, NULL, 0x0, "", HFILL}
703 { /* 18 ARQ Enable */
705 {"ARQ Enable", "wmx.arq.enable", FT_UINT8, BASE_DEC, VALS(vals_arq_enable), 0x0, "", HFILL}
707 { /* 19 ARQ Window Size */
708 &hf_sfe_arq_window_size,
709 {"ARQ Window Size", "wmx.arq.window_size", FT_UINT16, BASE_DEC, NULL, 0x0, "", HFILL}
711 { /* 20 ARQ Transmitter Delay */
712 &hf_sfe_arq_transmitter_delay,
713 {"ARQ Transmitter Delay (10us granularity)", "wmx.arq.transmitter_delay", FT_UINT16, BASE_DEC, NULL, 0x0, "", HFILL}
715 { /* 21 ARQ Receiver Delay */
716 &hf_sfe_arq_receiver_delay,
717 {"ARQ Receiver Delay (10us granularity)", "wmx.arq.receiver_delay", FT_UINT16, BASE_DEC, NULL, 0x0, "", HFILL}
719 { /* 22 ARQ Block Lifetime */
720 &hf_sfe_arq_block_lifetime,
721 {"ARQ Block Lifetime (10us granularity)", "wmx.arq.block_lifetime", FT_UINT16, BASE_DEC, NULL, 0x0, "", HFILL}
723 { /* 23 ARQ Sync Loss Timeout */
724 &hf_sfe_arq_sync_loss_timeout,
725 {"ARQ Sync Loss Timeout (10us granularity)", "wmx.arq.sync_loss_timeout", FT_UINT16, BASE_DEC, VALS(&vals_arq_sync_loss_timeout), 0x0, "", HFILL}
727 { /* 20 ARQ Transmitter Delay */
728 &hf_sfe_arq_transmitter_delay_cor2,
729 {"ARQ Transmitter Delay (100us granularity)", "wmx.arq.transmitter_delay", FT_UINT16, BASE_DEC, NULL, 0x0, "", HFILL}
731 { /* 21 ARQ Receiver Delay */
732 &hf_sfe_arq_receiver_delay_cor2,
733 {"ARQ Receiver Delay (100us granularity)", "wmx.arq.receiver_delay", FT_UINT16, BASE_DEC, NULL, 0x0, "", HFILL}
735 { /* 22 ARQ Block Lifetime */
736 &hf_sfe_arq_block_lifetime_cor2,
737 {"ARQ Block Lifetime (100us granularity)", "wmx.arq.block_lifetime", FT_UINT16, BASE_DEC, NULL, 0x0, "", HFILL}
739 { /* 23 ARQ Sync Loss Timeout */
740 &hf_sfe_arq_sync_loss_timeout_cor2,
741 {"ARQ Sync Loss Timeout (100us granularity)", "wmx.arq.sync_loss_timeout", FT_UINT16, BASE_DEC, VALS(&vals_arq_sync_loss_timeout), 0x0, "", HFILL}
743 { /* 24 ARQ Deliver In Order */
744 &hf_sfe_arq_deliver_in_order,
745 {"ARQ Deliver In Order", "wmx.arq.deliver_in_order", FT_UINT8, BASE_DEC, VALS(&vals_arq_deliver_in_order), 0x0, "", HFILL}
747 { /* 25 ARQ Purge Timeout */
748 &hf_sfe_arq_rx_purge_timeout,
749 {"ARQ RX Purge Timeout (100us granularity)", "wmx.arq.rx_purge_timeout", FT_UINT16, BASE_DEC, VALS(&vals_arq_rx_purge_timeout), 0x0, "", HFILL}
751 { /* 26 ARQ Block Size */
752 &hf_sfe_arq_block_size,
753 {"ARQ Block Size", "wmx.arq.block_size", FT_UINT16, BASE_DEC, NULL, 0x0, "", HFILL}
755 { /* 26 ARQ Block Size */
756 &hf_sfe_arq_block_size_cor2,
757 {"ARQ Block Size", "wmx.arq.block_size", FT_UINT8, BASE_HEX, NULL, 0x0, "", HFILL}
759 { /* 26 ARQ Block Size for Corrigendum 2 */
760 &hf_sfe_arq_min_block_size,
761 {"ARQ Minumum Block Size", "wmx.arq.min_block_size", FT_UINT8, BASE_DEC, NULL, 0x0F, "", HFILL}
763 { /* 26 ARQ Block Size for Corrigendum 2 */
764 &hf_sfe_arq_max_block_size,
765 {"ARQ Maximum Block Size", "wmx.arq.max_block_size", FT_UINT8, BASE_DEC, NULL, 0xF0, "", HFILL}
768 { /* 28 CS Specification */
769 &hf_sfe_cs_specification,
770 {"CS Specification", "wmx.sfe.cs_specification", FT_UINT8, BASE_DEC, VALS(vals_cs_specification), 0x0, "", HFILL}
772 { /* 29 Type of Data Delivery Services */
773 &hf_sfe_type_of_data_delivery_services,
774 {"Type of Data Delivery Services", "wmx.sfe.type_of_data_delivery_services", FT_UINT8, BASE_DEC, VALS(vals_type_of_data_delivery_services), 0x0, "", HFILL}
776 { /* 30 SDU Inter-Arrival Interval */
777 &hf_sfe_sdu_inter_arrival_interval,
778 {"SDU Inter-Arrival Interval (in the resolution of 0.5 ms)", "wmx.sfe.sdu_inter_arrival_interval", FT_UINT16, BASE_DEC, NULL, 0x0, "", HFILL}
782 {"Time Base", "wmx.sfe.time_base", FT_UINT16, BASE_DEC, NULL, 0x0, "", HFILL}
784 { /* 32 Paging Preference */
785 &hf_sfe_paging_preference,
786 {"Paging Preference", "wmx.sfe.paging_preference", FT_UINT8, BASE_DEC, VALS(vals_paging_preference), 0x0, "", HFILL}
788 { /* 33 MBS Zone Identifier */
789 &hf_sfe_mbs_zone_identifier_assignment,
790 {"MBS Zone Identifier", "wmx.sfe.mbs_zone_identifier", FT_BYTES, BASE_HEX, NULL, 0x0, "", HFILL}
792 { /* 34 Traffic Indication Preference */
794 {"Reserved", "wmx.sfe.reserved_34", FT_UINT8, BASE_DEC, NULL /*VALS(vals_traffic_indication_preference)*/, 0x0, "", HFILL}
796 { /* 35 Global Service Class Name */
797 &hf_sfe_global_service_class_name,
798 {"Global Service Class Name", "wmx.sfe.global_service_class_name", FT_STRING, BASE_NONE, NULL, 0x0, "", HFILL}
800 /* 36 reserved by 16E */
804 {"Reserved", "wmx.sfe.reserved_36", FT_UINT8, BASE_DEC, NULL, 0x0, "", HFILL}
806 { /* 37 SN Feedback Enable */
807 &hf_sfe_sn_feedback_enabled,
808 {"SN Feedback", "wmx.sfe.sn_feedback_enabled", FT_UINT8, BASE_DEC, VALS(vals_sn_fb_enable), 0x0, "", HFILL}
812 {"FSN Size", "wmx.sfe.fsn_size", FT_UINT8, BASE_DEC, VALS(vals_fsn_size), 0x0, "", HFILL}
814 { /* 39 CID allocation for Active BSs */
815 &hf_sfe_cid_alloc_for_active_bs,
816 {"CID Allocation For Active BSs", "wmx.sfe.cid_alloc_for_active_bs", FT_BYTES, BASE_HEX, NULL, 0x0, "", HFILL}
819 &hf_sfe_cid_alloc_for_active_bs_cid,
820 {"CID", "wmx.sfe.cid_alloc_for_active_bs_cid", FT_UINT16, BASE_DEC, NULL, 0x0, "", HFILL}
822 { /* 40 Unsolicited Grant Interval */
823 &hf_sfe_unsolicited_grant_interval,
824 {"Unsolicited Grant Interval", "wmx.sfe.unsolicited_grant_interval", FT_UINT16, BASE_DEC, NULL, 0x0, "", HFILL}
826 { /* 41 Unsolicited Polling Interval */
827 &hf_sfe_unsolicited_polling_interval,
828 {"Unsolicited Polling Interval", "wmx.sfe.unsolicited_polling_interval", FT_UINT16, BASE_DEC, NULL, 0x0, "", HFILL}
830 { /* 42 PDU SN extended subheader for HARQ reordering */
831 &hf_sfe_pdu_sn_ext_subheader_reorder,
832 {"PDU SN Extended Subheader For HARQ Reordering", "wmx.sfe.pdu_sn_ext_subheader_reorder", FT_UINT8, BASE_DEC, VALS(vals_pdu_sn_ext_subheader), 0x0, "", HFILL}
834 { /* 43 MBS contents ID */
835 &hf_sfe_mbs_contents_ids,
836 {"MBS contents IDs", "wmx.sfe.mbs_contents_ids", FT_BYTES, BASE_HEX, NULL, 0x0, "", HFILL}
839 &hf_sfe_mbs_contents_ids_id,
840 {"MBS Contents ID", "wmx.sfe.mbs_contents_ids_id", FT_UINT16, BASE_DEC, NULL, 0x0, "", HFILL}
842 { /* 44 HARQ Service Flows */
843 &hf_sfe_harq_service_flows,
844 {"HARQ Service Flows", "wmx.sfe.harq_service_flows", FT_UINT8, BASE_DEC, VALS(vals_harq), 0x0, "", HFILL}
846 { /* 45 Authorization Token */
847 &hf_sfe_authorization_token,
848 {"Authorization Token", "wmx.sfe.authorization_token", FT_BYTES, BASE_HEX, NULL, 0x0, "", HFILL}
850 { /* 46 HARQ Channel Mapping */
851 &hf_sfe_harq_channel_mapping,
852 {"HARQ Channel Mapping", "wmx.sfe.harq_channel_mapping", FT_BYTES, BASE_HEX, NULL, 0x0, "", HFILL}
854 { /* 46.1 HARQ Channel Index*/
855 &hf_sfe_harq_channel_mapping_index,
856 {"HARQ Channel Index", "wmx.sfe.harq_channel_mapping.index", FT_UINT8, BASE_DEC, NULL, 0x0, "", HFILL}
859 { /* unknown SFE types */
860 &hf_sfe_unknown_type,
861 {"Unknown SFE TLV type", "wmx.sfe.unknown_type", FT_BYTES, BASE_HEX, NULL, 0x0, "", HFILL}
866 /* 11.13.19.3.4.17 */
867 #define CST_PKT_CLASS_RULE_CLASSIFIER_ACTION_RULE_BIT0 0x80
868 #define CST_PKT_CLASS_RULE_CLASSIFIER_ACTION_RULE_RSV 0x7F
870 /* WiMax Convergence Service Parameter Encoding Rules display */
871 static hf_register_info hf_csper[] =
872 { /* 99 - 111 CS parameter encoding rules */
873 { /* Classifier DSC Action */
874 &hf_cst_classifier_dsc_action,
875 {"Classifier DSC Action", "wmx.cst.classifier_action", FT_UINT8, BASE_DEC, VALS(vals_cst_classifier_action), 0x0, "", HFILL}
877 { /* Errored Parameter */
878 &hf_cst_error_set_errored_param,
879 {"Errored Parameter", "wmx.cst.error_set.errored_param", FT_BYTES, BASE_HEX, NULL, 0x0, "", HFILL}
882 &hf_cst_error_set_error_code,
883 {"Error Code", "wmx.cst.error_set.error_code", FT_UINT8, BASE_HEX, VALS(vals_cc), 0x0, "", HFILL}
885 { /* Error Message */
886 &hf_cst_error_set_error_msg,
887 {"Error Message", "wmx.cst.error_set.error_msg", FT_STRINGZ, BASE_NONE, NULL, 0x0, "", HFILL}
889 { /* Packet Classification Rule */
890 &hf_cst_pkt_class_rule,
891 {"Packet Classification Rule", "wmx.cst.pkt_class_rule", FT_BYTES, BASE_HEX, NULL, 0x0, "", HFILL}
893 { /* Classification Rule Priority */
894 &hf_cst_pkt_class_rule_priority,
895 {"Classification Rule Priority", "wmx.cst.pkt_class_rule.priority", FT_UINT8, BASE_DEC, NULL, 0x0, "", HFILL}
897 { /* ToS/Differentiated Services Codepoint (DSCP) Range And Mask */
898 &hf_cst_pkt_class_rule_range_mask,
899 {"ToS/Differentiated Services Codepoint (DSCP) Range And Mask", "wmx.cst.pkt_class_rule.range_mask", FT_BYTES, BASE_HEX, NULL, 0x0, "", HFILL}
902 &hf_cst_pkt_class_rule_tos_low,
903 {"ToS-Low", "wmx.cst.pkt_class_rule.tos-low", FT_UINT8, BASE_HEX, NULL, 0x0, "", HFILL}
906 &hf_cst_pkt_class_rule_tos_high,
907 {"ToS-High", "wmx.cst.pkt_class_rule.tos-high", FT_UINT8, BASE_HEX, NULL, 0x0, "", HFILL}
910 &hf_cst_pkt_class_rule_tos_mask,
911 {"ToS-Mask", "wmx.cst.pkt_class_rule.tos-mask", FT_UINT8, BASE_HEX, NULL, 0x0, "", HFILL}
914 &hf_cst_pkt_class_rule_protocol,
915 {"Protocol", "wmx.cst.pkt_class_rule.protocol", FT_UINT8, BASE_HEX, NULL, 0x0, "", HFILL}
917 #if 0 /* Removed by the changes of 802.16E 2005 */
919 &hf_cst_pkt_class_rule_protocol,
920 {"Protocol", "wmx.cst.pkt_class_rule.protocol", FT_BYTES, BASE_HEX, NULL, 0x0, "", HFILL}
922 { /* Protocol Number */
923 &hf_cst_pkt_class_rule_protocol_number,
924 {"Protocol Number", "wmx.cst.pkt_class_rule.protocol.number", FT_UINT8, BASE_DEC, NULL, 0x0, "", HFILL}
927 { /* IP Masked Source Address */
928 &hf_cst_pkt_class_rule_ip_masked_src_address,
929 {"IP Masked Source Address", "wmx.cst.pkt_class_rule.ip_masked_src_address", FT_BYTES, BASE_HEX, NULL, 0x0, "", HFILL}
931 { /* IP Masked Destination Address */
932 &hf_cst_pkt_class_rule_ip_masked_dest_address,
933 {"IP Masked Destination Address", "wmx.cst.pkt_class_rule.ip_masked_dest_address", FT_BYTES, BASE_HEX, NULL, 0x0, "", HFILL}
935 { /* IPv4 Source Address */
936 &hf_cst_pkt_class_rule_src_ipv4,
937 {"IPv4 Source Address", "wmx.cst.pkt_class_rule.src_ipv4", FT_IPv4, BASE_NONE, NULL, 0x0, "", HFILL}
939 { /* IPv4 Destination Address */
940 &hf_cst_pkt_class_rule_dest_ipv4,
941 {"IPv4 Destination Address", "wmx.cst.pkt_class_rule.dst_ipv4", FT_IPv4, BASE_NONE, NULL, 0x0, "", HFILL}
944 &hf_cst_pkt_class_rule_mask_ipv4,
945 {"IPv4 Mask", "wmx.cst.pkt_class_rule.mask_ipv4", FT_IPv4, BASE_NONE, NULL, 0x0, "", HFILL}
947 { /* IPv6 Source Address */
948 &hf_cst_pkt_class_rule_src_ipv6,
949 {"IPv6 Source Address", "wmx.cst.pkt_class_rule.src_ipv6", FT_IPv6, BASE_NONE, NULL, 0x0, "", HFILL}
951 { /* IPv6 Destination Address */
952 &hf_cst_pkt_class_rule_dest_ipv6,
953 {"IPv6 Destination Address", "wmx.cst.pkt_class_rule.dst_ipv6", FT_IPv6, BASE_NONE, NULL, 0x0, "", HFILL}
956 &hf_cst_pkt_class_rule_mask_ipv6,
957 {"IPv6 Mask", "wmx.cst.pkt_class_rule.mask_ipv6", FT_IPv6, BASE_NONE, NULL, 0x0, "", HFILL}
959 { /* Protocol Source Port Range */
960 &hf_cst_pkt_class_rule_prot_src_port_range,
961 {"Protocol Source Port Range", "wmx.cst.pkt_class_rule.prot_src_port_range", FT_BYTES, BASE_HEX, NULL, 0x0, "", HFILL}
964 &hf_cst_pkt_class_rule_src_port_low,
965 {"Src-Port Low", "wmx.cst.pkt_class_rule.src_port_low", FT_UINT16, BASE_DEC, NULL, 0x0, "", HFILL}
967 { /* Src-Port High */
968 &hf_cst_pkt_class_rule_src_port_high,
969 {"Src-Port High", "wmx.cst.pkt_class_rule.src_port_high", FT_UINT16, BASE_DEC, NULL, 0x0, "", HFILL}
971 { /* Protocol Destination Port Range */
972 &hf_cst_pkt_class_rule_prot_dest_port_range,
973 {"Protocol Destination Port Range", "wmx.cst.pkt_class_rule.prot_dest_port_range", FT_BYTES, BASE_HEX, NULL, 0x0, "", HFILL}
976 &hf_cst_pkt_class_rule_dest_port_low,
977 {"Dst-Port Low", "wmx.cst.pkt_class_rule.dst_port_low", FT_UINT16, BASE_DEC, NULL, 0x0, "", HFILL}
979 { /* Dst-Port High */
980 &hf_cst_pkt_class_rule_dest_port_high,
981 {"Dst-Port High", "wmx.cst.pkt_class_rule.dst_port_high", FT_UINT16, BASE_DEC, NULL, 0x0, "", HFILL}
983 { /* 802.3/Ethernet Destination MAC Address */
984 &hf_cst_pkt_class_rule_dest_mac_address,
985 {"802.3/Ethernet Destination MAC Address", "wmx.cst.pkt_class_rule.dest_mac_address", FT_BYTES, BASE_HEX, NULL, 0x0, "", HFILL}
987 { /* Destination MAC Address */
988 &hf_cst_pkt_class_rule_dest_mac,
989 {"Destination MAC Address", "wmx.cst.pkt_class_rule.dst_mac", FT_ETHER, BASE_NONE, NULL, 0x0, "", HFILL}
991 { /* 802.3/Ethernet Source MAC Address */
992 &hf_cst_pkt_class_rule_src_mac_address,
993 {"802.3/Ethernet Source MAC Address", "wmx.cst.pkt_class_rule.src_mac_address", FT_BYTES, BASE_HEX, NULL, 0x0, "", HFILL}
995 { /* Source MAC Address */
996 &hf_cst_pkt_class_rule_src_mac,
997 {"Source MAC Address", "wmx.cst.pkt_class_rule.src_mac", FT_ETHER, BASE_NONE, NULL, 0x0, "", HFILL}
999 { /* MAC Address Mask */
1000 &hf_cst_pkt_class_rule_mask_mac,
1001 {"MAC Address Mask", "wmx.cst.pkt_class_rule.mask_mac", FT_ETHER, BASE_NONE, NULL, 0x0, "", HFILL}
1003 { /* Ethertype/IEEE Std 802.2-1998 SAP */
1004 &hf_cst_pkt_class_rule_ethertype,
1005 {"Ethertype/IEEE Std 802.2-1998 SAP", "wmx.cst.pkt_class_rule.ethertype", FT_BYTES, BASE_HEX, NULL, 0x0, "", HFILL}
1008 &hf_cst_pkt_class_rule_etype,
1009 {"Ethertype", "wmx.cst.pkt_class_rule.ethertype", FT_UINT8, BASE_DEC, NULL, 0x0, "", HFILL}
1012 &hf_cst_pkt_class_rule_eprot1,
1013 {"Eprot1", "wmx.cst.pkt_class_rule.eprot1", FT_UINT8, BASE_HEX, NULL, 0x0, "", HFILL}
1016 &hf_cst_pkt_class_rule_eprot2,
1017 {"Eprot2", "wmx.cst.pkt_class_rule.eprot2", FT_UINT8, BASE_HEX, NULL, 0x0, "", HFILL}
1019 { /* IEEE Std 802.1D-1998 User_Priority */
1020 &hf_cst_pkt_class_rule_user_priority,
1021 {"IEEE Std 802.1D-1998 User_Priority", "wmx.cst.pkt_class_rule.user_priority", FT_BYTES, BASE_HEX, NULL, 0x0, "", HFILL}
1024 &hf_cst_pkt_class_rule_pri_low,
1025 {"Pri-Low", "wmx.cst.pkt_class_rule.pri-low", FT_UINT8, BASE_DEC, NULL, 0x0, "", HFILL}
1028 &hf_cst_pkt_class_rule_pri_high,
1029 {"Pri-High", "wmx.cst.pkt_class_rule.pri-high", FT_UINT8, BASE_DEC, NULL, 0x0, "", HFILL}
1031 { /* IEEE Std 802.1Q-1998 VLAN_ID */
1032 &hf_cst_pkt_class_rule_vlan_id,
1033 {"IEEE Std 802.1Q-1998 VLAN_ID", "wmx.cst.pkt_class_rule.vlan_id", FT_BYTES, BASE_HEX, NULL, 0x0, "", HFILL}
1036 &hf_cst_pkt_class_rule_vlan_id1,
1037 {"Vlan_Id1", "wmx.cst.pkt_class_rule.vlan_id1", FT_UINT8, BASE_HEX, NULL, 0x0, "", HFILL}
1040 &hf_cst_pkt_class_rule_vlan_id2,
1041 {"Vlan_Id2", "wmx.cst.pkt_class_rule.vlan_id2", FT_UINT8, BASE_HEX, NULL, 0x0, "", HFILL}
1043 { /* Associated PHSI */
1044 &hf_cst_pkt_class_rule_phsi,
1045 {"Associated PHSI", "wmx.cst.pkt_class_rule.phsi", FT_UINT8, BASE_DEC, NULL, 0x0, "", HFILL}
1047 { /* Packet Classifier Rule Index */
1048 &hf_cst_pkt_class_rule_index,
1049 {"Packet Classifier Rule Index (PCRI)", "wmx.cst.pkt_class_rule.index", FT_UINT16, BASE_DEC, NULL, 0x0, "", HFILL}
1051 { /* Large Context ID for ROHC/ECRTP Compressed Packet or ROHC Feedback Packet */
1052 &hf_cst_large_context_id,
1053 {"Large Context ID", "wmx.cst.large_context_id", FT_UINT16, BASE_DEC, NULL, 0x0, "", HFILL}
1055 { /* Short-Format Context ID for ROHC/ECRTP Compressed Packet or ROHC Feedback Packet */
1056 &hf_cst_short_format_context_id,
1057 {"Short-Format Context ID", "wmx.cst.short_format_context_id", FT_UINT16, BASE_DEC, NULL, 0x0, "", HFILL}
1059 { /* Vendor-Specific Classifier Parameters */
1060 &hf_cst_pkt_class_rule_vendor_spec,
1061 {"Vendor-Specific Classifier Parameters", "wmx.cst.pkt_class_rule.vendor_spec", FT_BYTES, BASE_HEX, NULL, 0x0, "", HFILL}
1063 { /* Classifier Action Rule */
1064 &hf_cst_pkt_class_rule_classifier_action_rule,
1065 {"Classifier Action Rule", "wmx.cst.pkt_class_rule.classifier.action.rule", FT_UINT8, BASE_HEX, NULL, 0x0, "", HFILL}
1068 &hf_cst_pkt_class_rule_classifier_action_rule_bit0,
1069 {"Bit #0", "wmx.cst.pkt_class_rule.classifier.action.rule.bit0", FT_UINT8, BASE_HEX, VALS(vals_classification_action_rule), CST_PKT_CLASS_RULE_CLASSIFIER_ACTION_RULE_BIT0, "", HFILL}
1072 &hf_cst_pkt_class_rule_classifier_action_rule_bit1,
1073 {"Reserved", "wmx.cst.pkt_class_rule.classifier.action.rule.reserved", FT_UINT8, BASE_HEX, NULL, CST_PKT_CLASS_RULE_CLASSIFIER_ACTION_RULE_RSV, "", HFILL}
1075 { /* PHS DSC action */
1076 &hf_cst_phs_dsc_action,
1077 {"PHS DSC action", "wmx.cst.phs_dsc_action", FT_UINT8, BASE_DEC, VALS(vals_cst_phs_dsc_action), 0x0, "", HFILL}
1081 {"PHS Rule", "wmx.cst.phs_rule", FT_BYTES, BASE_HEX, NULL, 0x0, "", HFILL}
1085 {"PHSI", "wmx.cst.phs_rule.phsi", FT_UINT8, BASE_DEC, NULL, 0x0, "", HFILL}
1089 {"PHSF", "wmx.cst.phs_rule.phsf", FT_BYTES, BASE_HEX, NULL, 0x0, "", HFILL}
1093 {"PHSM (bit x: 0-don't suppress the (x+1) byte; 1-suppress the (x+1) byte)", "wmx.cst.phs_rule.phsm", FT_BYTES, BASE_HEX, NULL, 0x0, "", HFILL}
1097 {"PHSS", "wmx.cst.phs_rule.phss", FT_UINT8, BASE_DEC, NULL, 0x0, "", HFILL}
1101 {"PHSV", "wmx.cst.phs_rule.phsv", FT_UINT8, BASE_DEC, VALS(vals_verify), 0x0, "", HFILL}
1103 { /* PHS Rule 143 */
1104 &hf_cst_phs_vendor_spec,
1105 {"Vendor-Specific PHS Parameters", "wmx.cst.phs.vendor_spec", FT_BYTES, BASE_HEX, NULL, 0x0, "", HFILL}
1107 { /* IPv6 Flow Label */
1108 &hf_cst_pkt_class_rule_ipv6_flow_label,
1109 {"IPv6 Flow Label", "wmx.cst.pkt_class_rule.ipv6_flow_label", FT_UINT24, BASE_HEX, NULL, 0x0, "", HFILL}
1111 { /* ATM Switching Encoding */
1112 &hf_csper_atm_switching_encoding,
1113 {"ATM Switching Encoding", "wmx.csper.atm_switching_encoding", FT_UINT8, BASE_DEC, VALS(vals_atm_switching_encodings), 0x0, "", HFILL}
1115 { /* ATM Classifier TLV */
1116 &hf_csper_atm_classifier,
1117 {"ATM Classifier TLV", "wmx.csper.atm_classifier", FT_BYTES, BASE_HEX, NULL, 0x0, "", HFILL}
1119 { /* ATM VPI Classifier */
1120 &hf_csper_atm_classifier_vpi,
1121 {"VPI Classifier", "wmx.csper.atm_classifier_vpi", FT_UINT16, BASE_HEX, NULL, 0x0, "", HFILL}
1123 { /* ATM VCI Classifier */
1124 &hf_csper_atm_classifier_vci,
1125 {"VCI Classifier", "wmx.csper.atm_classifier_vci", FT_UINT16, BASE_HEX, NULL, 0x0, "", HFILL}
1127 { /* ATM Classifier ID */
1128 &hf_csper_atm_classifier_id,
1129 {"Classifier ID", "wmx.csper.atm_classifier_tlv", FT_UINT16, BASE_DEC, NULL, 0x0, "", HFILL}
1132 { /* unknown CSPER types */
1133 &hf_csper_unknown_type,
1134 {"Unknown CSPER TLV type", "wmx.csper.unknown_type", FT_BYTES, BASE_HEX, NULL, 0x0, "", HFILL}
1137 &hf_cst_invalid_tlv,
1138 {"Invalid TLV", "wmx.cst.invalid_tlv", FT_BYTES, BASE_HEX, NULL, 0x0, "", HFILL}
1143 /* 11.1.2 (table 348) */
1144 #define XMAC_TUPLE_RESERVED 0xF0
1145 #define XMAC_TUPLE_KEY_SEQ_NUM 0x0F
1147 /* WiMax HMAC/CMAC/Short-HMAC Tuples display */
1148 static hf_register_info hf_xmac[] =
1151 &hf_xmac_tuple_rsvd,
1152 {"Reserved", "wmx.xmac_tuple.reserved", FT_UINT8, BASE_HEX, NULL, XMAC_TUPLE_RESERVED, "", HFILL}
1155 &hf_xmac_tuple_key_seq_num,
1156 {"Key Sequence Number", "wmx.xmac_tuple.key_sn", FT_UINT8, BASE_DEC, NULL, XMAC_TUPLE_KEY_SEQ_NUM, "", HFILL}
1159 &hf_hmac_tuple_hmac_digest,
1160 {"HMAC Digest", "wmx.xmac_tuple.hmac_digest", FT_BYTES, BASE_HEX, NULL, 0x0, "", HFILL}
1163 &hf_cmac_tuple_bsid,
1164 {"BSID", "wmx.cmac_tuple.bsid", FT_ETHER, BASE_HEX, NULL, 0x0, "", HFILL}
1167 &hf_cmac_tuple_cmac_value,
1168 {"CMAC Value", "wmx.cmac_tuple.cmac.value", FT_BYTES, BASE_HEX, NULL, 0x0, "", HFILL}
1171 &hf_packet_number_counter,
1172 {"Packet Number Counter", "wmx.xmac_tuple.packet_number_count", FT_UINT32, BASE_DEC, NULL, 0x0, "", HFILL}
1176 /* WiMax Security Negotiation Parameters display */
1177 static gint hf_snp_pkm_version_support = -1;
1178 static gint hf_snp_pkm_version_support_bit0 = -1;
1179 static gint hf_snp_pkm_version_support_bit1 = -1;
1180 static gint hf_snp_pkm_version_support_reserved = -1;
1181 static gint hf_snp_auth_policy_support = -1;
1182 static gint hf_snp_auth_policy_support_bit0 = -1;
1183 static gint hf_snp_auth_policy_support_bit1 = -1;
1184 static gint hf_snp_auth_policy_support_bit2 = -1;
1185 static gint hf_snp_auth_policy_support_bit3 = -1;
1186 static gint hf_snp_auth_policy_support_bit4 = -1;
1187 static gint hf_snp_auth_policy_support_bit5 = -1;
1188 static gint hf_snp_auth_policy_support_bit6 = -1;
1189 static gint hf_snp_auth_policy_support_bit7 = -1;
1190 static gint hf_snp_mac_mode = -1;
1191 static gint hf_snp_mac_mode_bit0 = -1;
1192 static gint hf_snp_mac_mode_bit1 = -1;
1193 static gint hf_snp_mac_mode_bit1_rsvd = -1;
1194 static gint hf_snp_mac_mode_bit2 = -1;
1195 static gint hf_snp_mac_mode_bit3 = -1;
1196 static gint hf_snp_mac_mode_bit4 = -1;
1197 static gint hf_snp_mac_mode_bit5 = -1;
1198 static gint hf_snp_mac_mode_reserved = -1;
1199 static gint hf_snp_mac_mode_reserved1 = -1;
1200 static gint hf_snp_pn_window_size = -1;
1201 static gint hf_snp_max_conc_transactions = -1;
1202 static gint hf_snp_max_suppt_sec_assns = -1;
1203 static gint hf_snp_unknown_type = -1;
1207 #define SNP_PKM_VERSION_SUPPORT_BIT0 0x01
1208 #define SNP_PKM_VERSION_SUPPORT_BIT1 0x02
1209 #define SNP_PKM_VERSION_SUPPORT_RSV 0xFC
1211 #define SNP_AUTH_POLICY_SUPPORT_BIT0 0x01
1212 #define SNP_AUTH_POLICY_SUPPORT_BIT1 0x02
1213 #define SNP_AUTH_POLICY_SUPPORT_BIT2 0x04
1214 #define SNP_AUTH_POLICY_SUPPORT_BIT3 0x08
1215 #define SNP_AUTH_POLICY_SUPPORT_BIT4 0x10
1216 #define SNP_AUTH_POLICY_SUPPORT_BIT5 0x20
1217 #define SNP_AUTH_POLICY_SUPPORT_BIT6 0x40
1218 #define SNP_AUTH_POLICY_SUPPORT_BIT7 0x80
1220 #define SNP_MAC_MODE_BIT0 0x01
1221 #define SNP_MAC_MODE_BIT1 0x02
1222 #define SNP_MAC_MODE_BIT2 0x04
1223 #define SNP_MAC_MODE_BIT3 0x08
1224 #define SNP_MAC_MODE_BIT4 0x10
1225 #define SNP_MAC_MODE_BIT5 0x20
1226 #define SNP_MAC_MODE_RSV 0xE0
1227 #define SNP_MAC_MODE_RSV1 0xC0
1229 static hf_register_info hf_snp[] =
1232 &hf_snp_pkm_version_support,
1233 {"PKM Version Support", "wmx.security_negotiation_parameters.pkm_version_support",FT_UINT8, BASE_HEX, NULL, 0x0, "", HFILL}
1236 &hf_snp_pkm_version_support_bit0,
1237 {"PKM version 1", "wmx.security_negotiation_parameters.pkm_version_support.bit0",FT_BOOLEAN, 8, TFS(&tfs_supported), SNP_PKM_VERSION_SUPPORT_BIT0, "", HFILL}
1240 &hf_snp_pkm_version_support_bit1,
1241 {"PKM version 2", "wmx.security_negotiation_parameters.pkm_version_support.bit1",FT_BOOLEAN, 8, TFS(&tfs_supported), SNP_PKM_VERSION_SUPPORT_BIT1, "", HFILL}
1244 &hf_snp_pkm_version_support_reserved,
1245 {"Reserved", "wmx.security_negotiation_parameters.pkm_version_support.reserved",FT_UINT8, BASE_HEX, NULL, SNP_PKM_VERSION_SUPPORT_RSV, "", HFILL}
1248 &hf_snp_auth_policy_support,
1249 {"Authorization Policy Support", "wmx.security_negotiation_parameters.auth_policy_support",FT_UINT8, BASE_HEX, NULL, 0x0, "", HFILL}
1252 &hf_snp_auth_policy_support_bit0,
1253 {"RSA-based Authorization At The Initial Network Entry", "wmx.security_negotiation_parameters.auth_policy_support.bit0",FT_BOOLEAN, 8, TFS(&tfs_supported), SNP_AUTH_POLICY_SUPPORT_BIT0, "", HFILL}
1256 &hf_snp_auth_policy_support_bit1,
1257 {"EAP-based Authorization At The Initial Network Entry", "wmx.security_negotiation_parameters.auth_policy_support.bit1",FT_BOOLEAN, 8, TFS(&tfs_supported), SNP_AUTH_POLICY_SUPPORT_BIT1, "", HFILL}
1260 &hf_snp_auth_policy_support_bit2,
1261 {"Authenticated EAP-based Authorization At The Initial Network Entry", "wmx.security_negotiation_parameters.auth_policy_support.bit2",FT_BOOLEAN, 8, TFS(&tfs_supported), SNP_AUTH_POLICY_SUPPORT_BIT2, "", HFILL}
1264 &hf_snp_auth_policy_support_bit3,
1265 {"Reserved", "wmx.security_negotiation_parameters.auth_policy_support.bit3",FT_UINT8, BASE_HEX, NULL, SNP_AUTH_POLICY_SUPPORT_BIT3, "", HFILL}
1268 &hf_snp_auth_policy_support_bit4,
1269 {"RSA-based Authorization At Re-entry", "wmx.security_negotiation_parameters.auth_policy_support.bit4",FT_BOOLEAN, 8, TFS(&tfs_supported), SNP_AUTH_POLICY_SUPPORT_BIT4, "", HFILL}
1272 &hf_snp_auth_policy_support_bit5,
1273 {"EAP-based Authorization At Re-entry", "wmx.security_negotiation_parameters.auth_policy_support.bit5",FT_BOOLEAN, 8, TFS(&tfs_supported), SNP_AUTH_POLICY_SUPPORT_BIT5, "", HFILL}
1276 &hf_snp_auth_policy_support_bit6,
1277 {"Authenticated EAP-based Authorization At Re-entry", "wmx.security_negotiation_parameters.auth_policy_support.bit6",FT_BOOLEAN, 8, TFS(&tfs_supported), SNP_AUTH_POLICY_SUPPORT_BIT6, "", HFILL}
1280 &hf_snp_auth_policy_support_bit7,
1281 {"Reserved", "wmx.security_negotiation_parameters.auth_policy_support.bit7",FT_UINT8, BASE_HEX, NULL, SNP_AUTH_POLICY_SUPPORT_BIT7, "", HFILL}
1285 {"MAC (Message Authentication Code) Mode", "wmx.security_negotiation_parameters.mac_mode",FT_UINT8, BASE_HEX, NULL, 0x0, "", HFILL}
1288 &hf_snp_mac_mode_bit0,
1289 {"HMAC", "wmx.security_negotiation_parameters.mac_mode.bit0",FT_BOOLEAN, 8, TFS(&tfs_supported), SNP_MAC_MODE_BIT0, "", HFILL}
1292 &hf_snp_mac_mode_bit1,
1293 {"CMAC", "wmx.security_negotiation_parameters.mac_mode.bit1",FT_BOOLEAN, 8, TFS(&tfs_supported), SNP_MAC_MODE_BIT1, "", HFILL}
1296 &hf_snp_mac_mode_bit1_rsvd,
1297 {"Reserved", "wmx.security_negotiation_parameters.mac_mode.bit1_rsvd",FT_BOOLEAN, 8, TFS(&tfs_supported), SNP_MAC_MODE_BIT1, "", HFILL}
1300 &hf_snp_mac_mode_bit2,
1301 {"64-bit Short-HMAC", "wmx.security_negotiation_parameters.mac_mode.bit2",FT_BOOLEAN, 8, TFS(&tfs_supported), SNP_MAC_MODE_BIT2, "", HFILL}
1304 &hf_snp_mac_mode_bit3,
1305 {"80-bit Short-HMAC", "wmx.security_negotiation_parameters.mac_mode.bit3",FT_BOOLEAN, 8, TFS(&tfs_supported), SNP_MAC_MODE_BIT3, "", HFILL}
1308 &hf_snp_mac_mode_bit4,
1309 {"96-bit Short-HMAC", "wmx.security_negotiation_parameters.mac_mode.bit4",FT_BOOLEAN, 8, TFS(&tfs_supported), SNP_MAC_MODE_BIT4, "", HFILL}
1312 &hf_snp_mac_mode_bit5,
1313 {"CMAC", "wmx.security_negotiation_parameters.mac_mode.bit5",FT_BOOLEAN, 8, TFS(&tfs_supported), SNP_MAC_MODE_BIT5, "", HFILL}
1316 &hf_snp_mac_mode_reserved,
1317 {"Reserved", "wmx.security_negotiation_parameters.mac_mode.reserved",FT_UINT8, BASE_HEX, NULL, SNP_MAC_MODE_RSV, "", HFILL}
1320 &hf_snp_mac_mode_reserved1,
1321 {"Reserved", "wmx.security_negotiation_parameters.mac_mode.reserved",FT_UINT8, BASE_HEX, NULL, SNP_MAC_MODE_RSV1, "", HFILL}
1324 &hf_snp_pn_window_size,
1325 {"PN Window Size", "wmx.security_negotiation_parameters.pn_window_size",FT_UINT16, BASE_DEC, NULL, 0x0, "", HFILL}
1328 &hf_snp_max_conc_transactions,
1329 {"Maximum concurrent transactions (0 indicates no limit)", "wmx.security_negotiation_parameters.max_conc_transactions",FT_UINT8, BASE_DEC, NULL, 0x0, "", HFILL}
1332 &hf_snp_max_suppt_sec_assns,
1333 {"Maximum number of security associations supported by the SS", "wmx.security_negotiation_parameters.max_suppt_sec_assns",FT_UINT8, BASE_DEC, NULL, 0x0, "", HFILL}
1336 &hf_snp_unknown_type,
1337 {"Unknown Security Negotiation Parameter type", "wmx.security_negotiation_parameters.unknown.type",FT_BYTES, BASE_HEX, NULL, 0x0, "", HFILL}
1342 static gint hf_pkm_msg_unknown_type = -1;
1343 static gint hf_pkm_msg_attr_display = -1;
1344 static gint hf_pkm_config_settings_authorize_waitout = -1;
1345 static gint hf_pkm_config_settings_reauthorize_waitout = -1;
1346 static gint hf_pkm_config_settings_grace_time = -1;
1347 static gint hf_pkm_config_settings_operational_waittime = -1;
1348 static gint hf_pkm_msg_attr_auth_key = -1;
1349 static gint hf_pkm_msg_attr_tek = -1;
1350 static gint hf_pkm_msg_attr_key_life_time = -1;
1351 static gint hf_pkm_msg_attr_key_seq_num = -1;
1352 static gint hf_pkm_msg_attr_hmac_digest = -1;
1353 static gint hf_pkm_msg_attr_said = -1;
1354 static gint hf_pkm_msg_attr_cbc_iv = -1;
1355 static gint hf_pkm_msg_attr_error_code = -1;
1356 static gint hf_pkm_msg_attr_ca_certificate = -1;
1357 static gint hf_pkm_msg_attr_ss_certificate = -1;
1358 static gint hf_pkm_attr_auth_result_code = -1;
1359 static gint hf_pkm_attr_sa_service_type = -1;
1360 static gint hf_pkm_attr_frame_number = -1;
1361 static gint hf_pkm_attr_ss_random = -1;
1362 static gint hf_pkm_attr_bs_random = -1;
1363 static gint hf_pkm_attr_pre_pak = -1;
1364 static gint hf_pkm_attr_bs_certificate = -1;
1365 static gint hf_pkm_attr_sig_bs = -1;
1366 static gint hf_pkm_attr_ms_mac_address = -1;
1367 static gint hf_pkm_attr_cmac_digest = -1;
1368 static gint hf_pkm_attr_cmac_digest_pn = -1;
1369 static gint hf_pkm_attr_cmac_digest_value = -1;
1370 static gint hf_pkm_attr_eap_payload = -1;
1371 static gint hf_pkm_attr_nonce = -1;
1372 static gint hf_pkm_sa_type = -1;
1373 static gint hf_pkm_msg_crypto_suite = -1;
1374 static gint hf_pkm_msg_crypto_suite_msb = -1;
1375 static gint hf_pkm_msg_crypto_suite_middle = -1;
1376 static gint hf_pkm_msg_crypto_suite_lsb = -1;
1377 /*static gint hf_pkm_msg_version = -1;*/
1378 static gint hf_pkm_attr_push_modes = -1;
1379 static gint hf_pkm_attr_key_push_counter = -1;
1380 static gint hf_pkm_attr_gkek = -1;
1381 static gint hf_pkm_attr_sig_ss = -1;
1382 static gint hf_pkm_attr_akid = -1;
1383 static gint hf_pkm_config_settings_rekey_wait_timeout = -1;
1384 static gint hf_pkm_config_settings_tek_grace_time = -1;
1385 static gint hf_pkm_config_settings_authorize_reject_wait_timeout = -1;
1387 static gint hf_pkm_attr_pak_ak_seq_number = -1;
1388 static gint hf_pkm_attr_associated_gkek_seq_number = -1;
1389 static gint hf_pkm_attr_gkek_params = -1;
1391 static hf_register_info hf_pkm[] =
1393 { /* 11.9.1 - type 6 */
1394 &hf_pkm_msg_attr_display,
1395 {"Display String", "wmx.pkm_msg.pkm_attr.display_string", FT_STRING, BASE_NONE, NULL, 0x0, "", HFILL}
1397 { /* 11.9.2 - type 7 */
1398 &hf_pkm_msg_attr_auth_key,
1399 {"Auth Key", "wmx.pkm_msg.pkm_attr.auth_key", FT_BYTES, BASE_HEX, NULL, 0x0, "", HFILL}
1401 { /* 11.9.3 - type 8 */
1402 &hf_pkm_msg_attr_tek,
1403 {"TEK", "wmx.pkm_msg.pkm_attr.tek", FT_BYTES, BASE_HEX, NULL, 0x0, "", HFILL}
1405 { /* 11.9.4 - type 9 */
1406 &hf_pkm_msg_attr_key_life_time,
1407 {"Key Lifetime", "wmx.pkm_msg.pkm_attr.key_life_time", FT_UINT32, BASE_HEX, NULL, 0x0, "", HFILL}
1409 { /* 11.9.5 - type 10 */
1410 &hf_pkm_msg_attr_key_seq_num,
1411 {"Key Sequence Number", "wmx.pkm_msg.pkm_attr.key_seq_num", FT_UINT8, BASE_DEC, NULL, 0x0, "", HFILL}
1413 { /* 11.9.6 - type 11 */
1414 &hf_pkm_msg_attr_hmac_digest,
1415 {"HMAC-Digest", "wmx.pkm_msg.pkm_attr.hmac_digest", FT_BYTES, BASE_HEX, NULL, 0x0, "", HFILL}
1417 { /* 11.9.7 - type 12 */
1418 &hf_pkm_msg_attr_said,
1419 {"SAID", "wmx.pkm_msg.pkm_attr.said", FT_UINT16, BASE_HEX, NULL, 0x0, "", HFILL}
1421 #if 0 /* not been used */
1422 { /* 11.9.8 - type 13 */
1423 &hf_pkm_msg_attr_tek_param,
1424 {"TEK Parameters", "wmx.pkm_msg.pkm_attr.tek_parameters", FT_BYTES, BASE_HEX, NULL, 0x0, "", HFILL}
1427 { /* 11.9.9 - type 15 */
1428 &hf_pkm_msg_attr_cbc_iv,
1429 {"CBC IV", "wmx.pkm_msg.pkm_attr.cbc_iv", FT_BYTES, BASE_HEX, NULL, 0x0, "", HFILL}
1431 { /* 11.9.10 - type 16 */
1432 &hf_pkm_msg_attr_error_code,
1433 {"Error Code", "wmx.pkm_msg.pkm_attr.error_code", FT_UINT8, BASE_DEC, VALS(vals_pkm_attr_error_codes), 0x0, "", HFILL}
1435 { /* 11.9.11 - type 17 */
1436 &hf_pkm_msg_attr_ca_certificate,
1437 {"CA Certificate", "wmx.pkm_msg.pkm_attr.ca_certificate", FT_BYTES, BASE_HEX, NULL, 0x0, "", HFILL}
1439 { /* 11.9.12 - type 18 */
1440 &hf_pkm_msg_attr_ss_certificate,
1441 {"SS Certificate", "wmx.pkm_msg.pkm_attr.ss_certificate", FT_BYTES, BASE_HEX, NULL, 0x0, "", HFILL}
1443 #if 0 /* not been used */
1444 { /* 11.9.13 - type 19 */
1445 &hf_pkm_msg_attr_security_capabilities,
1446 {"Security Capabilities", "wmx.pkm_msg.pkm_attr.security_capabilities", FT_BYTES, BASE_HEX, NULL, 0x0, "", HFILL}
1449 { /* 11.9.14 - type 20 */
1450 &hf_pkm_msg_crypto_suite,
1451 {"Cryptography", "wmx.pkm_msg.pkm_attr.crypto_suite", FT_BYTES, BASE_HEX, NULL, 0x0, "", HFILL}
1454 &hf_pkm_msg_crypto_suite_msb,
1455 {"Data Encryption Algorithm Identifiers", "wmx.pkm_msg.pkm_attr.crypto_suite.msb", FT_UINT8, BASE_DEC, VALS(vals_data_encryption_ids), 0x0, "", HFILL}
1458 &hf_pkm_msg_crypto_suite_middle,
1459 {"Data Authentication Algorithm Identifiers", "wmx.pkm_msg.pkm_attr.crypto_suite.middle", FT_UINT8, BASE_DEC, VALS(vals_data_authentication_ids), 0x0, "", HFILL}
1462 &hf_pkm_msg_crypto_suite_lsb,
1463 {"TEK Encryption Algorithm Identifiers", "wmx.pkm_msg.pkm_attr.crypto_suite.lsb", FT_UINT8, BASE_DEC, VALS(vals_tek_encryption_ids), 0x0, "", HFILL}
1465 #if 0 /* not been used */
1466 { /* 11.9.15 - type 21 */
1467 &hf_pkm_msg_crypto_list,
1468 {"Cryptographic-Suite List", "wmx.pkm_msg.pkm_attr.crypto_suite_list", FT_BYTES, BASE_HEX, NULL, 0x0, "", HFILL}
1471 #if 0 /* deleted by 802.16E */
1472 { /* 11.9.16 - type 22 */
1473 &hf_pkm_msg_version,
1474 {"Reserved ", "wmx.pkm_msg.pkm_attr.version", FT_UINT8, BASE_HEX, NULL, 0x0, "", HFILL}
1477 #if 0 /* not been used */
1478 { /* 11.9.17 - type 23 */
1479 &hf_pkm_msg_sa_descriptor,
1480 {"SA Descriptor", "wmx.pkm_msg.pkm_attr.sa_descriptor", FT_BYTES, BASE_HEX, NULL, 0x0, "", HFILL}
1483 { /* 11.9.18 - type 24 */
1485 {"SA Type", "wmx.pkm_msg.pkm_attr.sa_type", FT_UINT8, BASE_DEC, VALS(vs_sa_type), 0x0, "", HFILL}
1487 #if 0 /* not been used */
1488 { /* 11.9.?? - type 25 */
1489 &hf_pkm_attr_security_negotiation_parameters,
1490 {"Security Negotiation Parameters", "wmx.pkm_msg.pkm_attr.security_negotiation_parameters", FT_BYTES, BASE_HEX, NULL, 0x0, "", HFILL}
1493 #if 0 /* not been used */
1494 { /* 11.9.19 - type 27 */
1495 &hf_pkm_attr_config_settings,
1496 {"PKM Configuration Settings", "wmx.pkm_msg.pkm_attr.config_settings", FT_BYTES, BASE_HEX, NULL, 0x0, "", HFILL}
1500 &hf_pkm_config_settings_authorize_waitout,
1501 {"Authorize Wait Timeout (in seconds)", "wmx.pkm_msg.pkm_attr.config_settings.authorize_waitout", FT_UINT32, BASE_DEC, NULL, 0x0, "", HFILL}
1504 &hf_pkm_config_settings_reauthorize_waitout,
1505 {"Reauthorize Wait Timeout (in seconds)", "wmx.pkm_msg.pkm_attr.config_settings.reauthorize_waitout", FT_UINT32, BASE_DEC, NULL, 0x0, "", HFILL}
1508 &hf_pkm_config_settings_grace_time,
1509 {"Authorization Grace Time (in seconds)", "wmx.pkm_msg.pkm_attr.config_settings.grace_time", FT_UINT32, BASE_DEC, NULL, 0x0, "", HFILL}
1512 &hf_pkm_config_settings_operational_waittime,
1513 {"Operational Wait Timeout (in seconds)", "wmx.pkm_msg.pkm_attr.config_settings.operational_wait_timeout", FT_UINT32, BASE_DEC, NULL, 0x0, "", HFILL}
1516 &hf_pkm_config_settings_rekey_wait_timeout,
1517 {"Rekey Wait Timeout (in seconds)", "wmx.pkm_msg.pkm_attr.config_settings.rekey_wait_timeout", FT_UINT32, BASE_DEC, NULL, 0x0, "", HFILL}
1520 &hf_pkm_config_settings_tek_grace_time,
1521 {"TEK Grace Time (in seconds)", "wmx.pkm_msg.pkm_attr.config_settings.tek_grace_time", FT_UINT32, BASE_DEC, NULL, 0x0, "", HFILL}
1524 &hf_pkm_config_settings_authorize_reject_wait_timeout,
1525 {"Authorize Reject Wait Timeout(in seconds)", "wmx.pkm_msg.pkm_attr.config_settings.authorize_reject_wait_timeout", FT_UINT32, BASE_DEC, NULL, 0x0, "", HFILL}
1527 { /* 11.9.20 - type 29 */
1529 {"Nonce", "wmx.pkm_msg.pkm_attr.nonce", FT_BYTES, BASE_HEX, NULL, 0x0, "", HFILL}
1531 { /* 11.9.21 - type 33 */
1532 &hf_pkm_attr_ss_random,
1533 {"SS_RANDOM", "wmx.pkm_msg.pkm_attr.ss_random", FT_BYTES, BASE_HEX, NULL, 0x0, "", HFILL}
1535 { /* 11.9.22 - type 34 */
1536 &hf_pkm_attr_bs_random,
1537 {"BS_RANDOM", "wmx.pkm_msg.pkm_attr.bs_random", FT_BYTES, BASE_HEX, NULL, 0x0, "", HFILL}
1539 { /* 11.9.23 - type 35 */
1540 &hf_pkm_attr_pre_pak,
1541 {"Pre-PAK", "wmx.pkm_msg.pkm_attr.pre_pak", FT_BYTES, BASE_HEX, NULL, 0x0, "", HFILL}
1543 #if 1 /* no definition */
1544 { /* 11.9.?? - type 36 */
1545 &hf_pkm_attr_pak_ak_seq_number,
1546 {"PAK/AK Sequence Number", "wmx.pkm_msg.pkm_attr.pak_ak_seq_number", FT_BYTES, BASE_HEX, NULL, 0x0, "", HFILL}
1549 { /* 11.9.24 - type 37 */
1550 &hf_pkm_attr_bs_certificate,
1551 {"BS Certificate", "wmx.pkm_msg.pkm_attr.bs_certificate", FT_BYTES, BASE_HEX, NULL, 0x0, "", HFILL}
1553 { /* 11.9.25 - type 38 */
1554 &hf_pkm_attr_sig_bs,
1555 {"SigBS", "wmx.pkm_msg.pkm_attr.sig_bs",FT_BYTES, BASE_HEX, NULL, 0x0, "", HFILL}
1557 { /* 11.9.26 - type 39 */
1558 &hf_pkm_attr_ms_mac_address,
1559 {"MS-MAC Address", "wmx.pkm_msg.pkm_attr.ms_mac_address",FT_ETHER, BASE_HEX, NULL, 0x0, "", HFILL}
1561 { /* 11.9.27 - type 40 */
1562 &hf_pkm_attr_cmac_digest,
1563 {"CMAC Digest", "wmx.pkm_msg.pkm_attr.cmac_digest",FT_BYTES, BASE_HEX, NULL, 0x0, "", HFILL}
1566 &hf_pkm_attr_cmac_digest_pn,
1567 {"CMAC Packet Number counter, CMAC_PN_*", "wmx.pkm_msg.pkm_attr.cmac_digest.pn",FT_UINT32, BASE_HEX, NULL, 0x0, "", HFILL}
1570 &hf_pkm_attr_cmac_digest_value,
1571 {"CMAC Value", "wmx.pkm_msg.pkm_attr.cmac_digest.value",FT_BYTES, BASE_HEX, NULL, 0x0, "", HFILL}
1573 { /* 11.9.28 - type 41 */
1574 &hf_pkm_attr_push_modes,
1575 {"Key Push Modes", "wmx.pkm_msg.pkm_attr.key_push_modes",FT_UINT8, BASE_DEC, VALS(va_key_push_modes), 0x0, "", HFILL}
1577 { /* 11.9.29 - type 42 */
1578 &hf_pkm_attr_key_push_counter,
1579 {"Key Push Counter", "wmx.pkm_msg.pkm_attr.key_push_counter",FT_UINT16, BASE_DEC, NULL, 0x0, "", HFILL}
1581 { /* 11.9.30 - type 43 */
1583 {"GKEK", "wmx.pkm_msg.pkm_attr.gkek",FT_BYTES, BASE_HEX, NULL, 0x0, "", HFILL}
1585 { /* 11.9.31 - type 44 */
1586 &hf_pkm_attr_sig_ss,
1587 {"SigSS", "wmx.pkm_msg.pkm_attr.sig_ss",FT_BYTES, BASE_HEX, NULL, 0x0, "", HFILL}
1589 { /* 11.9.32 - type 45 */
1591 {"AKID", "wmx.pkm_msg.pkm_attr.akid",FT_BYTES, BASE_HEX, NULL, 0x0, "", HFILL}
1593 { /* 11.9.33 - type 28 */
1594 &hf_pkm_attr_eap_payload,
1595 {"EAP Payload", "wmx.pkm_msg.pkm_attr.eap_payload", FT_BYTES, BASE_HEX, NULL, 0x0, "", HFILL}
1597 { /* 11.9.34 - type 30 */
1598 &hf_pkm_attr_auth_result_code,
1599 {"Auth Result Code", "wmx.pkm_msg.pkm_attr.auth_result_code", FT_UINT8, BASE_DEC, VALS(vs_success_reject), 0x0, "", HFILL}
1601 { /* 11.9.35 - type 31 */
1602 &hf_pkm_attr_sa_service_type,
1603 {"SA Service Type", "wmx.pkm_msg.pkm_attr.sa_service_type", FT_UINT8, BASE_DEC, VALS(vs_sa_service_type), 0x0, "", HFILL}
1605 #if 0 /* same as 11.9.19 */
1606 { /* 11.9.36 - type 27 */
1607 &hf_pkm_attr_config_settings,
1608 {"PKMv2 Configuration Settings", "wmx.pkm_msg.pkm_attr.config_settings", FT_BYTES, BASE_HEX, NULL, 0x0, "", HFILL}
1611 { /* 11.9.37 - type 32 */
1612 &hf_pkm_attr_frame_number,
1613 {"Frame Number", "wmx.pkm_msg.pkm_attr.frame_number", FT_UINT24, BASE_DEC, NULL, 0x0, "", HFILL}
1615 #if 1 /* no definitions */
1616 { /* 11.9.?? - type 46 */
1617 &hf_pkm_attr_associated_gkek_seq_number,
1618 {"Associated GKEK Sequence Number", "wmx.pkm_msg.pkm_attr.associated_gkek_seq_number",FT_BYTES, BASE_HEX, NULL, 0x0, "", HFILL}
1620 { /* 11.9.?? - type 47 */
1621 &hf_pkm_attr_gkek_params,
1622 {"GKEK Parameters", "wmx.pkm_msg.pkm_attr.gkek_params",FT_BYTES, BASE_HEX, NULL, 0x0, "", HFILL}
1626 &hf_pkm_msg_unknown_type,
1627 {"Unknown Type", "wmx.pkm.unknown.type", FT_BYTES, BASE_HEX, NULL, 0x0, "", HFILL}
1631 static gint hf_common_tlv_unknown_type = -1;
1632 static gint hf_common_tlv_mac_version = -1;
1633 static gint hf_common_tlv_vendor_id = -1;
1634 static gint hf_common_tlv_vendor_specific_type = -1;
1635 static gint hf_common_tlv_vendor_specific_length = -1;
1636 static gint hf_common_tlv_vendor_specific_length_size = -1;
1637 static gint hf_common_tlv_vendor_specific_value = -1;
1639 /* WiMax Common TLV Encoding display */
1640 static hf_register_info hf_common_tlv[] =
1643 &hf_common_tlv_mac_version,
1644 { "MAC Version", "wmx.common_tlv.mac_version", FT_UINT8, BASE_DEC, VALS(vals_dcd_mac_version), 0x0, "", HFILL}
1647 &hf_common_tlv_vendor_id,
1648 { "Vendor ID Encoding", "wmx.common_tlv.vendor_id_encoding", FT_BYTES, BASE_HEX, NULL, 0x0, "", HFILL}
1651 &hf_common_tlv_vendor_specific_type,
1652 { "Vendor Specific Type", "wmx.common_tlv.vendor_specific_type", FT_UINT8, BASE_HEX, NULL, 0x0, "", HFILL}
1655 &hf_common_tlv_vendor_specific_length_size,
1657 "Vendor Specific Length Size", "wmx.common_tlv.vendor_specific_length_size",
1658 FT_UINT8, BASE_HEX, NULL, 0x0,
1663 &hf_common_tlv_vendor_specific_length,
1664 { "Vendor Specific Length", "wmx.common_tlv.vendor_specific_length", FT_UINT16, BASE_DEC, NULL, 0x0, "", HFILL}
1667 &hf_common_tlv_vendor_specific_value,
1668 { "Vendor Specific Value", "wmx.common_tlv.vendor_specific_value", FT_BYTES, BASE_HEX, NULL, 0x0, "", HFILL}
1671 &hf_common_tlv_unknown_type,
1672 {"Unknown Common TLV Type", "wmx.common_tlv.unknown_type", FT_BYTES, BASE_HEX, NULL, 0x0, "", HFILL}
1676 /* Register WiMax Utility Routines */
1677 void proto_register_wimax_utility_decoders(void)
1679 if(proto_wimax_utility_decoders == -1)
1681 proto_wimax_utility_decoders = proto_register_protocol (
1682 "WiMax Sub-TLV Messages", /* name */
1683 "WiMax Sub-TLV (sub)", /* short name */
1684 "wmx.sub" /* abbrev */
1687 proto_register_subtree_array(ett, array_length(ett));
1688 proto_register_field_array(proto_mac_mgmt_msg_reg_req_decoder, hf_sfe, array_length(hf_sfe));
1689 proto_register_field_array(proto_wimax_utility_decoders, hf_csper, array_length(hf_csper));
1690 proto_register_field_array(proto_wimax_utility_decoders, hf_xmac, array_length(hf_xmac));
1691 proto_register_field_array(proto_wimax_utility_decoders, hf_snp, array_length(hf_snp));
1692 proto_register_field_array(proto_wimax_utility_decoders, hf_pkm, array_length(hf_pkm));
1693 proto_register_field_array(proto_wimax_utility_decoders, hf_common_tlv, array_length(hf_common_tlv));
1695 eap_handle = find_dissector("eap");
1699 /**************************************************************/
1700 /* wimax_error_parameter_set_decoder() */
1701 /* decode and display the WiMax Error Parameter Set */
1703 /* tvb - pointer of the tvb of error_parameter_set */
1704 /* tree - pointer of Wireshark display tree */
1705 /* pinfo - pointer of Wireshark packet information structure*/
1706 /**************************************************************/
1707 void wimax_error_parameter_set_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
1710 guint tvb_len, tlv_len;
1712 proto_item *ceps_item = NULL;
1713 proto_tree *ceps_tree = NULL;
1714 proto_tree *tlv_tree = NULL;
1715 tlv_info_t tlv_info;
1717 /* get the tvb reported length */
1718 tvb_len = tvb_reported_length(tvb);
1720 /* display error parameter information */
1721 ceps_item = proto_tree_add_protocol_format(tree, proto_wimax_utility_decoders, tvb, offset, tvb_len, "Error Parameter Set (%u bytes)", tvb_len);
1722 /* add CS Parameter Encoding Rules subtree */
1723 ceps_tree = proto_item_add_subtree(ceps_item, ett_wimax_error_parameter_set);
1724 /* do nothing if the TLV fields is not exist */
1727 /* report error if the packet size is less than 2 bytes (type+length) */
1729 { /* invalid tlv info */
1732 col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "Invalid Error Parameter Set");
1736 /* process the classifier error parameter set */
1737 while(offset < tvb_len)
1738 { /* get the TLV information */
1739 init_tlv_info(&tlv_info, tvb, offset);
1740 /* get the TLV type */
1741 tlv_type = get_tlv_type(&tlv_info);
1742 /* get the TLV length */
1743 tlv_len = get_tlv_length(&tlv_info);
1744 if(tlv_type == -1 || tlv_len > MAX_TLV_LEN || tlv_len < 1)
1745 { /* invalid tlv info */
1748 col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "EPS TLV error");
1750 proto_tree_add_item(ceps_tree, hf_cst_invalid_tlv, tvb, offset, (tvb_len - offset), FALSE);
1753 #ifdef DEBUG /* for debug only */
1754 proto_tree_add_protocol_format(ceps_tree, proto_wimax_utility_decoders, tvb, offset, (tlv_len+2+get_tlv_size_of_length(&tlv_info)), "EPS TLV Type: %u (%u bytes, offset=%u, tvb_len=%u)", tlv_type, tlv_len, offset, tvb_len);
1756 /* update the offset */
1757 offset += get_tlv_value_offset(&tlv_info);
1758 /* parse the Classifier Error Parameter Set */
1761 case CST_ERROR_SET_ERRORED_PARAM:
1762 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_error_parameter_set, ceps_tree, hf_cst_error_set_errored_param, tvb, offset, tlv_len, FALSE);
1763 proto_tree_add_item(tlv_tree, hf_cst_error_set_errored_param, tvb, offset, tlv_len, FALSE);
1765 case CST_ERROR_SET_ERROR_CODE:
1766 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_error_parameter_set, ceps_tree, hf_cst_error_set_error_code, tvb, offset, tlv_len, FALSE);
1767 proto_tree_add_item(tlv_tree, hf_cst_error_set_error_code, tvb, offset, tlv_len, FALSE);
1769 case CST_ERROR_SET_ERROR_MSG:
1770 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_error_parameter_set, ceps_tree, hf_cst_error_set_error_msg, tvb, offset, tlv_len, FALSE);
1771 proto_tree_add_item(tlv_tree, hf_cst_error_set_error_msg, tvb, offset, tlv_len, FALSE);
1778 /****************************************************************/
1779 /* wimax_convengence_service_parameter_encoding_rules_decoder() */
1780 /* decode and display the WiMax Convergence Service Parameter */
1781 /* Encoding Rules */
1783 /* sfe_type - Service Flow Encodings type */
1784 /* tvb - pointer of the tvb of service flow encodings */
1785 /* tree - pointer of Wireshark display tree */
1786 /* pinfo - pointer of Wireshark packet information structure */
1787 /****************************************************************/
1788 /* CS Parameter Encoding Rules handling function */
1789 void wimax_convengence_service_parameter_encoding_rules_decoder(guint sfe_type, tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
1791 guint offset, tlv_offset;
1792 guint tvb_len, tlv_len, length;
1794 proto_item *csper_item = NULL;
1795 proto_tree *csper_tree = NULL;
1796 proto_tree *tlv_tree = NULL;
1797 proto_tree *ti_tree = NULL;
1798 tlv_info_t tlv_info;
1799 gboolean ipv6 = ((sfe_type == SFE_CSPER_PACKET_IPV6) || (sfe_type == SFE_CSPER_PACKET_IPV6_802_3) || (sfe_type == SFE_CSPER_PACKET_IPV6_802_1Q));
1802 if((sfe_type < SFE_CSPER_ATM) || (sfe_type > SFE_CSPER_PACKET_IP_802_3_ECRTP_COMPRESSION))
1803 return; /* invalid CS Parameter Encodings */
1805 /* get the tvb reported length */
1806 tvb_len = tvb_reported_length(tvb);
1808 /* display SFE information */
1809 csper_item = proto_tree_add_protocol_format(tree, proto_wimax_utility_decoders, tvb, offset, tvb_len, "Convergence Service Parameter Encoding Rules (%u bytes)", tvb_len);
1810 /* add CS Parameter Encoding Rules subtree */
1811 csper_tree = proto_item_add_subtree(csper_item, ett_wimax_cst_encoding_rules);
1812 /* do nothing if the TLV fields is not exist */
1815 /* report error if the packet size is less than 2 bytes (type+length) */
1817 { /* invalid tlv info */
1820 col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "Invalid Convergence Service Parameter Encoding Rules");
1824 /* process WiMax Service Flow Encodings */
1825 while(offset < tvb_len)
1826 { /* get the TLV information */
1827 init_tlv_info(&tlv_info, tvb, offset);
1828 /* get the TLV type */
1829 tlv_type = get_tlv_type(&tlv_info);
1830 /* get the TLV length */
1831 tlv_len = get_tlv_length(&tlv_info);
1832 if(tlv_type == -1 || tlv_len > MAX_TLV_LEN || tlv_len < 1)
1833 { /* invalid tlv info */
1836 col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "CSPER TLV error");
1838 proto_tree_add_item(csper_tree, hf_cst_invalid_tlv, tvb, offset, (tvb_len - offset), FALSE);
1841 #ifdef DEBUG /* for debug only */
1842 proto_tree_add_protocol_format(csper_tree, proto_wimax_utility_decoders, tvb, offset, (tlv_len+2+get_tlv_size_of_length(&tlv_info)), "CSPER TLV Type: %u (%u bytes, offset=%u, tvb_len=%u)", tlv_type, tlv_len, offset, tvb_len);
1844 /* update the offset */
1845 offset += get_tlv_value_offset(&tlv_info);
1846 /* parse the CS parameter Encoding Rule TLV */
1847 if(sfe_type == SFE_CSPER_ATM)
1848 { /* ATM CS Encodings */
1851 case CST_ATM_SWITCHING:
1852 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_cst_encoding_rules, csper_tree, hf_csper_atm_switching_encoding, tvb, offset, tlv_len, FALSE);
1853 proto_tree_add_item(tlv_tree, hf_csper_atm_switching_encoding, tvb, offset, tlv_len, FALSE);
1855 case CST_ATM_CLASSIFIER:
1856 /* add TLV subtree */
1857 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_cst_encoding_rules, csper_tree, hf_csper_atm_classifier, tvb, offset, tlv_len, FALSE);
1858 tlv_offset = offset;
1859 while(tlv_offset < (tlv_len + offset))
1861 /* get the TLV information */
1862 init_tlv_info(&tlv_info, tvb, tlv_offset);
1863 /* get the TLV type */
1864 tlv_type = get_tlv_type(&tlv_info);
1865 /* get the TLV length */
1866 length = get_tlv_length(&tlv_info);
1867 if(tlv_type == -1 || length > MAX_TLV_LEN || length < 1)
1868 { /* invalid tlv info */
1871 col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "ATM Classifier TLV error");
1873 proto_tree_add_item(tlv_tree, hf_cst_invalid_tlv, tvb, offset, (tlv_len - tlv_offset), FALSE);
1876 #ifdef DEBUG /* for debug only */
1877 proto_tree_add_protocol_format(csper_tree, proto_wimax_utility_decoders, tvb, offset, (tlv_len+2+get_tlv_size_of_length(&tlv_info)), "ATM Classifier TLV Type: %u (%u bytes, offset=%u, tlv_len=%u)", tlv_type, length, offset, tlv_len);
1879 /* update the offset */
1880 tlv_offset += get_tlv_value_offset(&tlv_info);
1883 case ATM_VPI_CLASSIFIER:
1884 ti_tree = add_tlv_subtree(&tlv_info, ett_wimax_cst_encoding_rules, tlv_tree, hf_csper_atm_classifier_vpi, tvb, tlv_offset, length, FALSE);
1885 proto_tree_add_item(ti_tree, hf_csper_atm_classifier_vpi, tvb, tlv_offset, length, FALSE);
1887 case ATM_VCI_CLASSIFIER:
1888 ti_tree = add_tlv_subtree(&tlv_info, ett_wimax_cst_encoding_rules, tlv_tree, hf_csper_atm_classifier_vci, tvb, tlv_offset, length, FALSE);
1889 proto_tree_add_item(ti_tree, hf_csper_atm_classifier_vci, tvb, tlv_offset, length, FALSE);
1891 case ATM_CLASSIFIER_ID:
1892 ti_tree = add_tlv_subtree(&tlv_info, ett_wimax_cst_encoding_rules, tlv_tree, hf_csper_atm_classifier_id, tvb, tlv_offset, length, FALSE);
1893 proto_tree_add_item(ti_tree, hf_csper_atm_classifier_id, tvb, tlv_offset, length, FALSE);
1898 tlv_offset += length;
1899 } /* end of while loop */
1901 case CST_ATM_CLASSIFIER_DSC_ACTION:
1902 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_cst_encoding_rules, csper_tree, hf_cst_classifier_dsc_action, tvb, offset, tlv_len, FALSE);
1903 proto_tree_add_item(tlv_tree, hf_cst_classifier_dsc_action, tvb, offset, tlv_len, FALSE);
1905 case CST_ATM_CLASSIFIER_ERROR_PARAMETER_SET:
1906 /* call the error parameter set function */
1907 tlv_tree = add_protocol_subtree(&tlv_info, ett_wimax_cst_encoding_rules, csper_tree, proto_wimax_utility_decoders, tvb, offset, tlv_len, "Classifier Error Parameter Set (%u byte(s))", tlv_len);
1908 wimax_error_parameter_set_decoder(tvb_new_subset(tvb, offset, tlv_len, tlv_len), pinfo, tlv_tree);
1911 /* display the unknown ATM CS encoding in hex */
1912 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_cst_encoding_rules, csper_tree, hf_csper_unknown_type, tvb, offset, tlv_len, FALSE);
1913 proto_tree_add_item(tlv_tree, hf_csper_unknown_type, tvb, offset, tlv_len, FALSE);
1921 case CST_CLASSIFIER_ACTION:
1922 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_cst_encoding_rules, csper_tree, hf_cst_classifier_dsc_action, tvb, offset, tlv_len, FALSE);
1923 proto_tree_add_item(tlv_tree, hf_cst_classifier_dsc_action, tvb, offset, tlv_len, FALSE);
1925 case CST_CLASSIFIER_ERROR_PARAM_SET:
1926 case CST_PHS_ERROR_PARAM_SET:
1927 tlv_tree = add_protocol_subtree(&tlv_info, ett_wimax_cst_encoding_rules, csper_tree, proto_wimax_utility_decoders, tvb, offset, tlv_len, "Classifier Error Parameter Set (%u byte(s))", tlv_len);
1928 /* call the error parameter set function */
1929 wimax_error_parameter_set_decoder(tvb_new_subset(tvb, offset, tlv_len, tlv_len), pinfo, tlv_tree);
1931 case CST_PACKET_CLASSIFICATION_RULE:
1933 /* add TLV subtree */
1934 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_cst_encoding_rules, csper_tree, hf_cst_pkt_class_rule, tvb, offset, tlv_len, FALSE);
1935 tlv_offset = offset;
1936 while(tlv_offset < (tlv_len + offset))
1938 /* get the TLV information */
1939 init_tlv_info(&tlv_info, tvb, tlv_offset);
1940 /* get the TLV type */
1941 tlv_type = get_tlv_type(&tlv_info);
1942 /* get the TLV length */
1943 length = get_tlv_length(&tlv_info);
1944 if(tlv_type == -1 || length > MAX_TLV_LEN || length < 1)
1945 { /* invalid tlv info */
1948 col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "Packet Classification Rule TLV error");
1950 proto_tree_add_item(tlv_tree, hf_cst_invalid_tlv, tvb, offset, (tlv_len - tlv_offset), FALSE);
1953 #ifdef DEBUG /* for debug only */
1954 proto_tree_add_protocol_format(csper_tree, proto_wimax_utility_decoders, tvb, tlv_offset, (length + get_tlv_value_offset(&tlv_info)), "Packet Classification Rule TLV Type: %u (%u bytes, offset=%u, tlv_len=%u)", tlv_type, length, tlv_offset, tlv_len);
1956 /* update the offset */
1957 tlv_offset += get_tlv_value_offset(&tlv_info);
1960 case CST_PKT_CLASS_RULE_PRIORITY:
1961 ti_tree = add_tlv_subtree(&tlv_info, ett_wimax_cst_encoding_rules, tlv_tree, hf_cst_pkt_class_rule_priority, tvb, tlv_offset, length, FALSE);
1962 proto_tree_add_item(ti_tree, hf_cst_pkt_class_rule_priority, tvb, tlv_offset, length, FALSE);
1964 case CST_PKT_CLASS_RULE_RANGE_MASK:
1965 /* add TLV subtree */
1966 ti_tree = add_tlv_subtree(&tlv_info, ett_wimax_cst_encoding_rules, tlv_tree, hf_cst_pkt_class_rule_range_mask, tvb, tlv_offset, length, FALSE);
1967 proto_tree_add_item(ti_tree, hf_cst_pkt_class_rule_tos_low, tvb,
1968 tlv_offset, 1, FALSE);
1969 proto_tree_add_item(ti_tree, hf_cst_pkt_class_rule_tos_high, tvb,
1970 tlv_offset + 1, 1, FALSE);
1971 proto_tree_add_item(ti_tree, hf_cst_pkt_class_rule_tos_mask, tvb,
1972 tlv_offset + 2, 1, FALSE);
1974 case CST_PKT_CLASS_RULE_PROTOCOL:
1975 ti_tree = add_tlv_subtree(&tlv_info, ett_wimax_cst_encoding_rules, tlv_tree, hf_cst_pkt_class_rule_protocol, tvb, tlv_offset, length, FALSE);
1976 proto_tree_add_item(ti_tree, hf_cst_pkt_class_rule_protocol, tvb, tlv_offset, length, FALSE);
1978 case CST_PKT_CLASS_RULE_SRC_IP:
1979 /* add TLV subtree */
1980 ti_tree = add_tlv_subtree(&tlv_info, ett_wimax_cst_encoding_rules, tlv_tree, hf_cst_pkt_class_rule_ip_masked_src_address, tvb, tlv_offset, length, FALSE);
1983 proto_tree_add_item(ti_tree, hf_cst_pkt_class_rule_src_ipv6, tvb, tlv_offset, 16, FALSE);
1984 proto_tree_add_item(ti_tree, hf_cst_pkt_class_rule_mask_ipv6, tvb, tlv_offset + 16, 16, FALSE);
1988 proto_tree_add_item(ti_tree, hf_cst_pkt_class_rule_src_ipv4, tvb, tlv_offset, 4, FALSE);
1989 proto_tree_add_item(ti_tree, hf_cst_pkt_class_rule_mask_ipv4, tvb, tlv_offset + 4, 4, FALSE);
1992 case CST_PKT_CLASS_RULE_DST_IP:
1993 /* add TLV subtree */
1994 ti_tree = add_tlv_subtree(&tlv_info, ett_wimax_cst_encoding_rules, tlv_tree, hf_cst_pkt_class_rule_ip_masked_dest_address, tvb, tlv_offset, length, FALSE);
1997 proto_tree_add_item(ti_tree, hf_cst_pkt_class_rule_dest_ipv6, tvb, tlv_offset, 16, FALSE);
1998 proto_tree_add_item(ti_tree, hf_cst_pkt_class_rule_mask_ipv6, tvb, tlv_offset + 16, 16, FALSE);
2002 proto_tree_add_item(ti_tree, hf_cst_pkt_class_rule_dest_ipv4, tvb, tlv_offset, 4, FALSE);
2003 proto_tree_add_item(ti_tree, hf_cst_pkt_class_rule_mask_ipv4, tvb, tlv_offset + 4, 4, FALSE);
2006 case CST_PKT_CLASS_RULE_SRCPORT_RANGE:
2007 /* add TLV subtree */
2008 ti_tree = add_tlv_subtree(&tlv_info, ett_wimax_cst_encoding_rules, tlv_tree, hf_cst_pkt_class_rule_prot_src_port_range, tvb, tlv_offset, length, FALSE);
2009 proto_tree_add_item(ti_tree, hf_cst_pkt_class_rule_src_port_low, tvb, tlv_offset, 2, FALSE);
2010 proto_tree_add_item(ti_tree, hf_cst_pkt_class_rule_src_port_high, tvb, tlv_offset + 2, 2, FALSE);
2012 case CST_PKT_CLASS_RULE_DSTPORT_RANGE:
2013 /* add TLV subtree */
2014 ti_tree = add_tlv_subtree(&tlv_info, ett_wimax_cst_encoding_rules, tlv_tree, hf_cst_pkt_class_rule_prot_dest_port_range, tvb, tlv_offset, length, FALSE);
2015 proto_tree_add_item(ti_tree, hf_cst_pkt_class_rule_dest_port_low, tvb, tlv_offset, 2, FALSE);
2016 proto_tree_add_item(ti_tree, hf_cst_pkt_class_rule_dest_port_high, tvb, tlv_offset + 2, 2, FALSE);
2018 case CST_PKT_CLASS_RULE_DST_MAC:
2019 ti_tree = add_tlv_subtree(&tlv_info, ett_wimax_cst_encoding_rules, tlv_tree, hf_cst_pkt_class_rule_dest_mac_address, tvb, tlv_offset, length, FALSE);
2020 /* add TLV subtree */
2021 proto_tree_add_item(ti_tree, hf_cst_pkt_class_rule_dest_mac, tvb, tlv_offset, 6, FALSE);
2022 proto_tree_add_item(ti_tree, hf_cst_pkt_class_rule_mask_mac, tvb, tlv_offset + 6, 6, FALSE);
2024 case CST_PKT_CLASS_RULE_SRC_MAC:
2025 /* add TLV subtree */
2026 ti_tree = add_tlv_subtree(&tlv_info, ett_wimax_cst_encoding_rules, tlv_tree, hf_cst_pkt_class_rule_src_mac_address, tvb, tlv_offset, length, FALSE);
2027 proto_tree_add_item(ti_tree, hf_cst_pkt_class_rule_src_mac, tvb, tlv_offset, 6, FALSE);
2028 proto_tree_add_item(ti_tree, hf_cst_pkt_class_rule_mask_mac, tvb, tlv_offset + 6, 6, FALSE);
2030 case CST_PKT_CLASS_RULE_ETHERTYPE:
2031 /* add TLV subtree */
2032 ti_tree = add_tlv_subtree(&tlv_info, ett_wimax_cst_encoding_rules, tlv_tree, hf_cst_pkt_class_rule_ethertype, tvb, tlv_offset, length, FALSE);
2033 proto_tree_add_item(ti_tree, hf_cst_pkt_class_rule_etype, tvb, tlv_offset, 1, FALSE);
2034 proto_tree_add_item(ti_tree, hf_cst_pkt_class_rule_eprot1, tvb, tlv_offset + 1, 1, FALSE);
2035 proto_tree_add_item(ti_tree, hf_cst_pkt_class_rule_eprot2, tvb, tlv_offset + 2, 1, FALSE);
2037 case CST_PKT_CLASS_RULE_USER_PRIORITY:
2038 /* add TLV subtree */
2039 ti_tree = add_tlv_subtree(&tlv_info, ett_wimax_cst_encoding_rules, tlv_tree, hf_cst_pkt_class_rule_user_priority, tvb, tlv_offset, length, FALSE);
2040 proto_tree_add_item(ti_tree, hf_cst_pkt_class_rule_pri_low, tvb, tlv_offset, 1, FALSE);
2041 proto_tree_add_item(ti_tree, hf_cst_pkt_class_rule_pri_high, tvb, tlv_offset + 1, 1, FALSE);
2043 case CST_PKT_CLASS_RULE_VLAN_ID:
2044 /* add TLV subtree */
2045 ti_tree = add_tlv_subtree(&tlv_info, ett_wimax_cst_encoding_rules, tlv_tree, hf_cst_pkt_class_rule_vlan_id, tvb, tlv_offset, length, FALSE);
2046 proto_tree_add_item(ti_tree, hf_cst_pkt_class_rule_vlan_id1, tvb, tlv_offset, 1, FALSE);
2047 proto_tree_add_item(ti_tree, hf_cst_pkt_class_rule_vlan_id2, tvb, tlv_offset + 1, 1, FALSE);
2049 case CST_PKT_CLASS_RULE_PHSI:
2050 ti_tree = add_tlv_subtree(&tlv_info, ett_wimax_cst_encoding_rules, tlv_tree, hf_cst_pkt_class_rule_phsi, tvb, tlv_offset, length, FALSE);
2051 proto_tree_add_item(ti_tree, hf_cst_pkt_class_rule_phsi, tvb, tlv_offset, length, FALSE);
2053 case CST_PKT_CLASS_RULE_INDEX:
2054 ti_tree = add_tlv_subtree(&tlv_info, ett_wimax_cst_encoding_rules, tlv_tree, hf_cst_pkt_class_rule_index, tvb, tlv_offset, length, FALSE);
2055 proto_tree_add_item(ti_tree, hf_cst_pkt_class_rule_index, tvb, tlv_offset, length, FALSE);
2057 case CST_PKT_CLASS_RULE_IPv6_FLOW_LABEL:
2059 ti_tree = add_tlv_subtree(&tlv_info, ett_wimax_cst_encoding_rules, tlv_tree, hf_cst_pkt_class_rule_ipv6_flow_label, tvb, tlv_offset, length, FALSE);
2060 proto_tree_add_item(ti_tree, hf_cst_pkt_class_rule_ipv6_flow_label, tvb, tlv_offset, length, FALSE);
2062 case CST_PKT_CLASS_RULE_VENDOR_SPEC:
2063 ti_tree = add_tlv_subtree(&tlv_info, ett_wimax_cst_encoding_rules, tlv_tree, hf_cst_pkt_class_rule_vendor_spec, tvb, tlv_offset, length, FALSE);
2064 proto_tree_add_item(ti_tree, hf_cst_pkt_class_rule_vendor_spec, tvb, tlv_offset, length, FALSE);
2066 case CST_CLASSIFIER_ACTION_RULE:
2067 /* add TLV subtree */
2068 ti_tree = add_tlv_subtree(&tlv_info, ett_wimax_cst_encoding_rules, tlv_tree, hf_cst_pkt_class_rule_classifier_action_rule, tvb, tlv_offset, length, FALSE);
2069 proto_tree_add_item(ti_tree, hf_cst_pkt_class_rule_classifier_action_rule_bit0, tvb, tlv_offset, 1, FALSE);
2070 proto_tree_add_item(ti_tree, hf_cst_pkt_class_rule_classifier_action_rule_bit1, tvb, tlv_offset, 1, FALSE);
2072 case CST_PKT_CLASS_RULE_LARGE_CONTEXT_ID:
2073 ti_tree = add_tlv_subtree(&tlv_info, ett_wimax_cst_encoding_rules, tlv_tree, hf_cst_large_context_id, tvb, tlv_offset, length, FALSE);
2074 proto_tree_add_item(ti_tree, hf_cst_large_context_id, tvb, tlv_offset, length, FALSE);
2076 case CST_PKT_CLASS_RULE_SHORT_FORMAT_CONTEXT_ID:
2077 ti_tree = add_tlv_subtree(&tlv_info, ett_wimax_cst_encoding_rules, tlv_tree, hf_cst_short_format_context_id, tvb, tlv_offset, length, FALSE);
2078 proto_tree_add_item(ti_tree, hf_cst_short_format_context_id, tvb, tlv_offset, length, FALSE);
2082 } /* end of switch */
2083 tlv_offset += length;
2084 } /* end of while loop */
2087 case CST_PHS_DSC_ACTION:
2088 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_cst_encoding_rules, csper_tree, hf_cst_phs_dsc_action, tvb, offset, tlv_len, FALSE);
2089 proto_tree_add_item(tlv_tree, hf_cst_phs_dsc_action, tvb, offset, tlv_len, FALSE);
2093 /* add TLV subtree */
2094 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_cst_encoding_rules, csper_tree, hf_cst_phs_rule, tvb, offset, tlv_len, FALSE);
2095 tlv_offset = offset;
2096 while(tlv_offset < (tlv_len + offset))
2098 /* get the TLV information */
2099 init_tlv_info(&tlv_info, tvb, tlv_offset);
2100 /* get the TLV type */
2101 tlv_type = get_tlv_type(&tlv_info);
2102 /* get the TLV length */
2103 length = get_tlv_length(&tlv_info);
2104 if(tlv_type == -1 || length > MAX_TLV_LEN || length < 1)
2105 { /* invalid tlv info */
2108 col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "PHS n Rule TLV error");
2110 proto_tree_add_item(tlv_tree, hf_cst_invalid_tlv, tvb, offset, (tlv_len - tlv_offset), FALSE);
2113 #ifdef DEBUG /* for debug only */
2114 proto_tree_add_protocol_format(csper_tree, proto_wimax_utility_decoders, tvb, offset, (tlv_len+2+get_tlv_size_of_length(&tlv_info)), "PHS Rule TLV Type: %u (%u bytes, offset=%u, tlv_len=%u)", tlv_type, length, offset, tlv_len);
2116 /* update the offset */
2117 tlv_offset += get_tlv_value_offset(&tlv_info);
2121 ti_tree = add_tlv_subtree(&tlv_info, ett_wimax_cst_encoding_rules, tlv_tree, hf_cst_phs_phsi, tvb, tlv_offset, length, FALSE);
2122 proto_tree_add_item(ti_tree, hf_cst_phs_phsi, tvb, tlv_offset, length, FALSE);
2125 ti_tree = add_tlv_subtree(&tlv_info, ett_wimax_cst_encoding_rules, tlv_tree, hf_cst_phs_phsf, tvb, tlv_offset, length, FALSE);
2126 proto_tree_add_item(ti_tree, hf_cst_phs_phsf, tvb, tlv_offset, length, FALSE);
2129 ti_tree = add_tlv_subtree(&tlv_info, ett_wimax_cst_encoding_rules, tlv_tree, hf_cst_phs_phsm, tvb, tlv_offset, length, FALSE);
2130 proto_tree_add_item(ti_tree, hf_cst_phs_phsm, tvb, tlv_offset, length, FALSE);
2133 ti_tree = add_tlv_subtree(&tlv_info, ett_wimax_cst_encoding_rules, tlv_tree, hf_cst_phs_phss, tvb, tlv_offset, length, FALSE);
2134 proto_tree_add_item(ti_tree, hf_cst_phs_phss, tvb, tlv_offset, length, FALSE);
2137 ti_tree = add_tlv_subtree(&tlv_info, ett_wimax_cst_encoding_rules, tlv_tree, hf_cst_phs_phsv, tvb, tlv_offset, length, FALSE);
2138 proto_tree_add_item(ti_tree, hf_cst_phs_phsv, tvb, tlv_offset, length, FALSE);
2140 case CST_PHS_VENDOR_SPEC:
2141 ti_tree = add_tlv_subtree(&tlv_info, ett_wimax_cst_encoding_rules, tlv_tree, hf_cst_phs_vendor_spec, tvb, tlv_offset, length, FALSE);
2142 proto_tree_add_item(ti_tree, hf_cst_phs_vendor_spec, tvb, tlv_offset, length, FALSE);
2145 tlv_offset += length;
2150 /* display the unknown csper type in hex */
2151 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_cst_encoding_rules, tree, hf_csper_unknown_type, tvb, offset, tlv_len, FALSE);
2152 proto_tree_add_item(tlv_tree, hf_csper_unknown_type, tvb, offset, tlv_len, FALSE);
2154 } /* end of switch */
2157 } /* end of while loop */
2160 /**************************************************************/
2161 /* wimax_service_flow_encodings_decoder() */
2162 /* decode and display the WiMax Service Flow Encodings */
2164 /* tvb - pointer of the tvb of service flow encodings */
2165 /* tree - pointer of Wireshark display tree */
2166 /* pinfo - pointer of Wireshark packet information structure*/
2167 /**************************************************************/
2168 void wimax_service_flow_encodings_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
2171 guint tvb_len, tlv_len, tlv_value_offset, tlv_value;
2174 proto_item *tlv_item = NULL;
2175 proto_tree *tlv_tree = NULL;
2176 tlv_info_t tlv_info;
2178 /* get the tvb reported length */
2179 tvb_len = tvb_reported_length(tvb);
2180 #ifdef DEBUG /* for debug only */
2181 /* display dissector information */
2182 proto_tree_add_protocol_format(tree, proto_wimax_utility_decoders, tvb, 0, tvb_len, "WiMax Service Flow Encodings (%u bytes)", tvb_len);
2184 /* process WiMax Service Flow Encodings */
2186 /* do nothing if the TLV fields is not exist */
2189 /* report error if the packet size is less than 2 bytes (type+length) */
2191 { /* invalid tlv info */
2194 col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "Invalid Service Flow Encodings");
2198 while(offset < tvb_len)
2199 { /* get the TLV information */
2200 init_tlv_info(&tlv_info, tvb, offset);
2201 /* get the TLV type */
2202 tlv_type = get_tlv_type(&tlv_info);
2203 /* get the TLV length */
2204 tlv_len = get_tlv_length(&tlv_info);
2205 if(tlv_type == -1 || tlv_len > MAX_TLV_LEN || tlv_len < 1)
2206 { /* invalid tlv info */
2209 col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "Service Flow Encodings TLV error");
2211 proto_tree_add_item(tree, hf_cst_invalid_tlv, tvb, offset, (tvb_len - offset), FALSE);
2214 /* get the TLV value offset */
2215 tlv_value_offset = get_tlv_value_offset(&tlv_info);
2216 #ifdef DEBUG /* for debug only */
2217 proto_tree_add_protocol_format(tree, proto_wimax_utility_decoders, tvb, offset, (tlv_len + tlv_value_offset), "Service Flow Encodings TLV Type: %u (%u bytes, offset=%u, tvb_len=%u)", tlv_type, tlv_len, offset, tvb_len);
2219 /* update the offset */
2220 offset += tlv_value_offset;
2221 /* parse the Service Flow Encodings TLV */
2225 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_service_flow_encodings, tree, hf_sfe_sf_id, tvb, offset, tlv_len, FALSE);
2226 proto_tree_add_item(tlv_tree, hf_sfe_sf_id, tvb, offset, tlv_len, FALSE);
2229 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_service_flow_encodings, tree, hf_sfe_cid, tvb, offset, tlv_len, FALSE);
2230 proto_tree_add_item(tlv_tree, hf_sfe_cid, tvb, offset, tlv_len, FALSE);
2232 case SFE_SERVICE_CLASS_NAME:
2233 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_service_flow_encodings, tree, hf_sfe_service_class_name, tvb, offset, tlv_len, FALSE);
2234 proto_tree_add_item(tlv_tree, hf_sfe_service_class_name, tvb, offset, tlv_len, FALSE);
2236 case SFE_MBS_SERVICE:
2237 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_service_flow_encodings, tree, hf_sfe_mbs_service, tvb, offset, tlv_len, FALSE);
2238 proto_tree_add_item(tlv_tree, hf_sfe_mbs_service, tvb, offset, tlv_len, FALSE);
2240 case SFE_QOS_PARAMS_SET:
2241 /* add TLV subtree */
2242 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_service_flow_encodings, tree, hf_sfe_qos_params_set, tvb, offset, tlv_len, FALSE);
2243 proto_tree_add_item(tlv_tree, hf_sfe_set_provisioned, tvb, offset, 1, FALSE);
2244 proto_tree_add_item(tlv_tree, hf_sfe_set_admitted, tvb, offset, 1, FALSE);
2245 proto_tree_add_item(tlv_tree, hf_sfe_set_active, tvb, offset, 1, FALSE);
2246 proto_tree_add_item(tlv_tree, hf_sfe_set_rsvd, tvb, offset, 1, FALSE);
2248 case SFE_TRAFFIC_PRIORITY:
2249 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_service_flow_encodings, tree, hf_sfe_traffic_priority, tvb, offset, tlv_len, FALSE);
2250 tlv_item = proto_tree_add_item(tlv_tree, hf_sfe_traffic_priority, tvb, offset, tlv_len, FALSE);
2251 proto_item_append_text(tlv_item, " (allowed values are 0-7)");
2254 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_service_flow_encodings, tree, hf_sfe_max_str, tvb, offset, tlv_len, FALSE);
2255 tlv_item = proto_tree_add_item(tlv_tree, hf_sfe_max_str, tvb, offset, tlv_len, FALSE);
2256 proto_item_append_text(tlv_item, " bps");
2258 case SFE_MAX_TRAFFIC_BURST:
2259 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_service_flow_encodings, tree, hf_sfe_max_traffic_burst, tvb, offset, tlv_len, FALSE);
2260 tlv_item = proto_tree_add_item(tlv_tree, hf_sfe_max_traffic_burst, tvb, offset, tlv_len, FALSE);
2261 proto_item_append_text(tlv_item, " bytes");
2264 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_service_flow_encodings, tree, hf_sfe_min_rtr, tvb, offset, tlv_len, FALSE);
2265 tlv_item = proto_tree_add_item(tlv_tree, hf_sfe_min_rtr, tvb, offset, tlv_len, FALSE);
2266 proto_item_append_text(tlv_item, " bps");
2268 case SFE_RESERVED_10:
2269 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_service_flow_encodings, tree, hf_sfe_reserved_10, tvb, offset, tlv_len, FALSE);
2270 proto_tree_add_item(tlv_tree, hf_sfe_reserved_10, tvb, offset, tlv_len, FALSE);
2272 case SFE_UL_SCHEDULING:
2273 /* TODO: Find a way to get the correct service type from the TLV */
2274 tlv_value = tvb_get_guint8(tvb, offset);
2275 set_service_type( tlv_value );
2276 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_service_flow_encodings, tree, hf_sfe_ul_grant_scheduling, tvb, offset, tlv_len, FALSE);
2277 proto_tree_add_item(tlv_tree, hf_sfe_ul_grant_scheduling, tvb, offset, tlv_len, FALSE);
2280 /* add TLV subtree */
2281 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_service_flow_encodings, tree, hf_sfe_req_tx_policy, tvb, offset, tlv_len, FALSE);
2282 proto_tree_add_item(tlv_tree, hf_sfe_policy_broadcast_bwr, tvb, offset, 1, FALSE);
2283 proto_tree_add_item(tlv_tree, hf_sfe_policy_multicast_bwr, tvb, offset, 1, FALSE);
2284 proto_tree_add_item(tlv_tree, hf_sfe_policy_piggyback, tvb, offset, 1, FALSE);
2285 proto_tree_add_item(tlv_tree, hf_sfe_policy_fragment, tvb, offset, 1, FALSE);
2286 proto_tree_add_item(tlv_tree, hf_sfe_policy_headers, tvb, offset, 1, FALSE);
2287 proto_tree_add_item(tlv_tree, hf_sfe_policy_packing, tvb, offset, 1, FALSE);
2288 proto_tree_add_item(tlv_tree, hf_sfe_policy_crc, tvb, offset, 1, FALSE);
2289 proto_tree_add_item(tlv_tree, hf_sfe_policy_rsvd1, tvb, offset, 1, FALSE);
2291 case SFE_TOLERATED_JITTER:
2292 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_service_flow_encodings, tree, hf_sfe_jitter, tvb, offset, tlv_len, FALSE);
2293 tlv_item = proto_tree_add_item(tlv_tree, hf_sfe_jitter, tvb, offset, tlv_len, FALSE);
2294 proto_item_append_text(tlv_item, " ms");
2296 case SFE_MAX_LATENCY:
2297 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_service_flow_encodings, tree, hf_sfe_max_latency, tvb, offset, tlv_len, FALSE);
2298 tlv_item = proto_tree_add_item(tlv_tree, hf_sfe_max_latency, tvb, offset, tlv_len, FALSE);
2299 proto_item_append_text(tlv_item, " ms");
2301 case SFE_FIXED_LEN_SDU:
2302 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_service_flow_encodings, tree, hf_sfe_fixed_len_sdu, tvb, offset, tlv_len, FALSE);
2303 proto_tree_add_item(tlv_tree, hf_sfe_fixed_len_sdu, tvb, offset, tlv_len, FALSE);
2306 /* save the SDU size */
2307 mac_sdu_length = tvb_get_guint8(tvb, offset);
2308 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_service_flow_encodings, tree, hf_sfe_sdu_size, tvb, offset, tlv_len, FALSE);
2309 tlv_item = proto_tree_add_item(tlv_tree, hf_sfe_sdu_size, tvb, offset, tlv_len, FALSE);
2310 proto_item_append_text(tlv_item, " bytes");
2312 case SFE_TARGET_SAID:
2313 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_service_flow_encodings, tree, hf_sfe_target_said, tvb, offset, tlv_len, FALSE);
2314 proto_tree_add_item(tlv_tree, hf_sfe_target_said, tvb, offset, tlv_len, FALSE);
2316 case SFE_ARQ_ENABLE:
2317 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_service_flow_encodings, tree, hf_sfe_arq_enable, tvb, offset, tlv_len, FALSE);
2318 proto_tree_add_item(tlv_tree, hf_sfe_arq_enable, tvb, offset, tlv_len, FALSE);
2320 case SFE_ARQ_WINDOW_SIZE:
2321 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_service_flow_encodings, tree, hf_sfe_arq_window_size, tvb, offset, tlv_len, FALSE);
2322 proto_tree_add_item(tlv_tree, hf_sfe_arq_window_size, tvb, offset, tlv_len, FALSE);
2324 case SFE_ARQ_TRANSMITTER_DELAY:
2325 if (include_cor2_changes)
2327 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_service_flow_encodings, tree, hf_sfe_arq_transmitter_delay_cor2, tvb, offset, tlv_len, FALSE);
2328 proto_tree_add_item(tlv_tree, hf_sfe_arq_transmitter_delay_cor2, tvb, offset, tlv_len, FALSE);
2332 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_service_flow_encodings, tree, hf_sfe_arq_transmitter_delay, tvb, offset, tlv_len, FALSE);
2333 proto_tree_add_item(tlv_tree, hf_sfe_arq_transmitter_delay, tvb, offset, tlv_len, FALSE);
2336 case SFE_ARQ_RECEIVER_DELAY:
2337 if (include_cor2_changes)
2339 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_service_flow_encodings, tree, hf_sfe_arq_receiver_delay_cor2, tvb, offset, tlv_len, FALSE);
2340 proto_tree_add_item(tlv_tree, hf_sfe_arq_receiver_delay_cor2, tvb, offset, tlv_len, FALSE);
2344 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_service_flow_encodings, tree, hf_sfe_arq_receiver_delay, tvb, offset, tlv_len, FALSE);
2345 proto_tree_add_item(tlv_tree, hf_sfe_arq_receiver_delay, tvb, offset, tlv_len, FALSE);
2348 case SFE_ARQ_BLOCK_LIFETIME:
2349 if (include_cor2_changes)
2351 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_service_flow_encodings, tree, hf_sfe_arq_block_lifetime_cor2, tvb, offset, tlv_len, FALSE);
2352 proto_tree_add_item(tlv_tree, hf_sfe_arq_block_lifetime_cor2, tvb, offset, tlv_len, FALSE);
2356 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_service_flow_encodings, tree, hf_sfe_arq_block_lifetime, tvb, offset, tlv_len, FALSE);
2357 proto_tree_add_item(tlv_tree, hf_sfe_arq_block_lifetime, tvb, offset, tlv_len, FALSE);
2360 case SFE_ARQ_SYNC_LOSS_TIMEOUT:
2361 if (include_cor2_changes)
2363 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_service_flow_encodings, tree, hf_sfe_arq_sync_loss_timeout_cor2, tvb, offset, tlv_len, FALSE);
2364 proto_tree_add_item(tlv_tree, hf_sfe_arq_sync_loss_timeout_cor2, tvb, offset, tlv_len, FALSE);
2368 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_service_flow_encodings, tree, hf_sfe_arq_sync_loss_timeout, tvb, offset, tlv_len, FALSE);
2369 proto_tree_add_item(tlv_tree, hf_sfe_arq_sync_loss_timeout, tvb, offset, tlv_len, FALSE);
2372 case SFE_ARQ_DELIVER_IN_ORDER:
2373 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_service_flow_encodings, tree, hf_sfe_arq_deliver_in_order, tvb, offset, tlv_len, FALSE);
2374 proto_tree_add_item(tlv_tree, hf_sfe_arq_deliver_in_order, tvb, offset, tlv_len, FALSE);
2376 case SFE_ARQ_RX_PURGE_TIMEOUT:
2377 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_service_flow_encodings, tree, hf_sfe_arq_rx_purge_timeout, tvb, offset, tlv_len, FALSE);
2378 proto_tree_add_item(tlv_tree, hf_sfe_arq_rx_purge_timeout, tvb, offset, tlv_len, FALSE);
2380 case SFE_ARQ_BLOCK_SIZE:
2381 if (include_cor2_changes)
2383 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_service_flow_encodings, tree, hf_sfe_arq_block_size_cor2, tvb, offset, tlv_len, FALSE);
2384 tlv_item = proto_tree_add_item(tlv_tree, hf_sfe_arq_block_size_cor2, tvb, offset, tlv_len, FALSE);
2385 /* add TLV subtree */
2386 tlv_tree = proto_item_add_subtree(tlv_item, ett_wimax_service_flow_encodings);
2387 value = tvb_get_guint8(tvb, offset);
2388 tlv_item = proto_tree_add_item(tlv_tree, hf_sfe_arq_min_block_size, tvb, offset, 1, FALSE);
2389 /* Size is 2^((value & 0x0F) + 4)) */
2390 proto_item_append_text(tlv_item, " ( %d bytes )", 0x10 << (value & 0x0F));
2391 tlv_item = proto_tree_add_item(tlv_tree, hf_sfe_arq_max_block_size, tvb, offset, 1, FALSE);
2393 /* Size is 2^(((value & 0xF0) >> 4) + 4)) */
2394 proto_item_append_text(tlv_item, " ( %d bytes )", 0x10 << ((value & 0xF0) >> 4));
2398 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_service_flow_encodings, tree, hf_sfe_arq_block_size, tvb, offset, tlv_len, FALSE);
2399 proto_tree_add_item(tlv_tree, hf_sfe_arq_block_size, tvb, offset, tlv_len, FALSE);
2402 case SFE_CS_SPECIFICATION:
2403 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_service_flow_encodings, tree, hf_sfe_cs_specification, tvb, offset, tlv_len, FALSE);
2404 proto_tree_add_item(tlv_tree, hf_sfe_cs_specification, tvb, offset, tlv_len, FALSE);
2406 case SFE_TYPE_OF_DATA_DELIVERY_SERVICES:
2407 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_service_flow_encodings, tree, hf_sfe_type_of_data_delivery_services, tvb, offset, tlv_len, FALSE);
2408 proto_tree_add_item(tlv_tree, hf_sfe_type_of_data_delivery_services, tvb, offset, tlv_len, FALSE);
2410 case SFE_SDU_INTER_ARRIVAL_INTERVAL:
2411 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_service_flow_encodings, tree, hf_sfe_sdu_inter_arrival_interval, tvb, offset, tlv_len, FALSE);
2412 proto_tree_add_item(tlv_tree, hf_sfe_sdu_inter_arrival_interval, tvb, offset, tlv_len, FALSE);
2415 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_service_flow_encodings, tree, hf_sfe_time_base, tvb, offset, tlv_len, FALSE);
2416 tlv_item = proto_tree_add_item(tlv_tree, hf_sfe_time_base, tvb, offset, tlv_len, FALSE);
2417 proto_item_append_text(tlv_item, " ms");
2419 case SFE_PAGING_PREFERENCE:
2420 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_service_flow_encodings, tree, hf_sfe_paging_preference, tvb, offset, tlv_len, FALSE);
2421 proto_tree_add_item(tlv_tree, hf_sfe_paging_preference, tvb, offset, tlv_len, FALSE);
2423 case SFE_MBS_ZONE_IDENTIFIER_ASSIGNMENT:
2424 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_service_flow_encodings, tree, hf_sfe_mbs_zone_identifier_assignment, tvb, offset, tlv_len, FALSE);
2425 proto_tree_add_item(tlv_tree, hf_sfe_mbs_zone_identifier_assignment, tvb, offset, tlv_len, FALSE);
2427 case SFE_RESERVED_34:
2428 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_service_flow_encodings, tree, hf_sfe_reserved_34, tvb, offset, tlv_len, FALSE);
2429 proto_tree_add_item(tlv_tree, hf_sfe_reserved_34, tvb, offset, tlv_len, FALSE);
2431 case SFE_GLOBAL_SERVICE_CLASS_NAME:
2432 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_service_flow_encodings, tree, hf_sfe_global_service_class_name, tvb, offset, tlv_len, FALSE);
2433 proto_tree_add_item(tlv_tree, hf_sfe_global_service_class_name, tvb, offset, tlv_len, FALSE);
2436 case SFE_RESERVED_36:
2437 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_service_flow_encodings, tree, hf_sfe_reserved_36, tvb, offset, tlv_len, FALSE);
2438 proto_tree_add_item(tlv_tree, hf_sfe_reserved_36, tvb, offset, tlv_len, FALSE);
2441 case SFE_SN_FEEDBACK_ENABLED:
2442 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_service_flow_encodings, tree, hf_sfe_sn_feedback_enabled, tvb, offset, tlv_len, FALSE);
2443 proto_tree_add_item(tlv_tree, hf_sfe_sn_feedback_enabled, tvb, offset, tlv_len, FALSE);
2446 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_service_flow_encodings, tree, hf_sfe_fsn_size, tvb, offset, tlv_len, FALSE);
2447 proto_tree_add_item(tlv_tree, hf_sfe_fsn_size, tvb, offset, tlv_len, FALSE);
2449 case SFE_CID_ALLOCATION_FOR_ACTIVE_BS:
2450 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_service_flow_encodings, tree, hf_sfe_cid_alloc_for_active_bs_cid, tvb, offset, tlv_len, FALSE);
2451 for(i = 0; i < tlv_len; i+=2)
2452 proto_tree_add_item(tlv_tree, hf_sfe_cid_alloc_for_active_bs_cid, tvb, (offset+i), 2, FALSE);
2454 case SFE_UNSOLICITED_GRANT_INTERVAL:
2455 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_service_flow_encodings, tree, hf_sfe_unsolicited_grant_interval, tvb, offset, tlv_len, FALSE);
2456 tlv_item = proto_tree_add_item(tlv_tree, hf_sfe_unsolicited_grant_interval, tvb, offset, tlv_len, FALSE);
2457 proto_item_append_text(tlv_item, " ms");
2459 case SFE_UNSOLOCITED_POLLING_INTERVAL:
2460 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_service_flow_encodings, tree, hf_sfe_unsolicited_polling_interval, tvb, offset, tlv_len, FALSE);
2461 tlv_item = proto_tree_add_item(tlv_tree, hf_sfe_unsolicited_polling_interval, tvb, offset, tlv_len, FALSE);
2462 proto_item_append_text(tlv_item, " ms");
2464 case SFE_PDU_SN_EXT_SUBHEADER_HARQ_REORDER:
2465 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_service_flow_encodings, tree, hf_sfe_pdu_sn_ext_subheader_reorder, tvb, offset, tlv_len, FALSE);
2466 proto_tree_add_item(tlv_tree, hf_sfe_pdu_sn_ext_subheader_reorder, tvb, offset, tlv_len, FALSE);
2468 case SFE_MBS_CONTENTS_ID:
2469 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_service_flow_encodings, tree, hf_sfe_mbs_contents_ids, tvb, offset, tlv_len, FALSE);
2470 proto_tree_add_item(tlv_tree, hf_sfe_mbs_contents_ids, tvb, offset, tlv_len, FALSE);
2471 for(i = 0; i < tlv_len; i+=2)
2472 proto_tree_add_item(tlv_tree, hf_sfe_mbs_contents_ids_id, tvb, (offset+i), 2, FALSE);
2474 case SFE_HARQ_SERVICE_FLOWS:
2475 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_service_flow_encodings, tree, hf_sfe_harq_service_flows, tvb, offset, tlv_len, FALSE);
2476 proto_tree_add_item(tlv_tree, hf_sfe_harq_service_flows, tvb, offset, tlv_len, FALSE);
2478 case SFE_AUTHORIZATION_TOKEN:
2479 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_service_flow_encodings, tree, hf_sfe_authorization_token, tvb, offset, tlv_len, FALSE);
2480 proto_tree_add_item(tlv_tree, hf_sfe_authorization_token, tvb, offset, tlv_len, FALSE);
2482 case SFE_HARQ_CHANNEL_MAPPING:
2483 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_service_flow_encodings, tree, hf_sfe_harq_channel_mapping_index, tvb, offset, tlv_len, FALSE);
2484 for(i = 0; i < tlv_len; i++)
2485 proto_tree_add_item(tlv_tree, hf_sfe_harq_channel_mapping_index, tvb, (offset+i), 1, FALSE);
2487 /* 99 - 111 CS parameter encodings */
2489 case SFE_CSPER_PACKET_IPV4:
2490 case SFE_CSPER_PACKET_IPV6:
2491 case SFE_CSPER_PACKET_802_3:
2492 case SFE_CSPER_PACKET_802_1Q:
2493 case SFE_CSPER_PACKET_IPV4_802_3:
2494 case SFE_CSPER_PACKET_IPV6_802_3:
2495 case SFE_CSPER_PACKET_IPV4_802_1Q:
2496 case SFE_CSPER_PACKET_IPV6_802_1Q:
2497 case SFE_CSPER_PACKET_IP_ROCH_COMPRESSION:
2498 case SFE_CSPER_PACKET_IP_ECRTP_COMPRESSION:
2499 case SFE_CSPER_PACKET_IP_802_3_ROCH_COMPRESSION:
2500 case SFE_CSPER_PACKET_IP_802_3_ECRTP_COMPRESSION:
2501 /* call CS Parameter Encoding Rules handling function */
2502 tlv_tree = add_protocol_subtree(&tlv_info, ett_wimax_service_flow_encodings, tree, proto_wimax_utility_decoders, tvb, offset, tlv_len, "CS Parameter Encoding Rules (%u byte(s))", tlv_len);
2503 wimax_convengence_service_parameter_encoding_rules_decoder(tlv_type, tvb_new_subset(tvb, offset, tlv_len, tlv_len), pinfo, tlv_tree);
2506 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_service_flow_encodings, tree, hf_sfe_unknown_type, tvb, offset, tlv_len, FALSE);
2507 /* display the unknown sfe type in hex */
2508 proto_tree_add_item(tlv_tree, hf_sfe_unknown_type, tvb, offset, tlv_len, FALSE);
2510 } /* end of switch */
2512 } /* end of while loop */
2515 /**************************************************************/
2516 /* wimax_hmac_tuple_decoder() */
2517 /* decode and display the WiMax HMAC Tuple (Table 348) */
2519 /* tree - pointer of Wireshark display tree */
2520 /* tvb - pointer of the tvb which contains the HMAC Tuple */
2521 /* offset - the HMAC Tuple offset in the tvb */
2522 /* length - length of the HMAC Tuple */
2523 /**************************************************************/
2524 void wimax_hmac_tuple_decoder(proto_tree *tree, tvbuff_t *tvb, guint offset, guint length)
2527 proto_item *hmac_item = NULL;
2528 proto_tree *hmac_tree = NULL;
2530 /* display decoder info (length should be 21 bytes) */
2531 hmac_item = proto_tree_add_protocol_format(tree, proto_wimax_utility_decoders, tvb, offset, length, "HMAC Tuple (%u bytes)", length);
2532 /* add HMAC subtree */
2533 hmac_tree = proto_item_add_subtree(hmac_item, ett_wimax_hmac_tuple);
2534 /* init the local offset */
2535 hmac_offset = offset;
2536 /* decode and display HMAC Tuple */
2537 proto_tree_add_item(hmac_tree, hf_xmac_tuple_rsvd, tvb, hmac_offset, 1, FALSE);
2538 proto_tree_add_item(hmac_tree, hf_xmac_tuple_key_seq_num, tvb, hmac_offset, 1, FALSE);
2540 proto_tree_add_item(hmac_tree, hf_hmac_tuple_hmac_digest, tvb, hmac_offset, (length-1), FALSE);
2543 /**************************************************************/
2544 /* wimax_cmac_tuple_decoder() */
2545 /* decode and display the WiMax CMAC Tuple (Table 348b) */
2547 /* tree - pointer of Wireshark display tree */
2548 /* tvb - pointer of the tvb which contains the CMAC Tuple */
2549 /* offset - the CMAC Tuple offset in the tvb */
2550 /* length - length of the CMAC Tuple */
2551 /**************************************************************/
2552 void wimax_cmac_tuple_decoder(proto_tree *tree, tvbuff_t *tvb, guint offset, guint length)
2555 proto_item *cmac_item = NULL;
2556 proto_tree *cmac_tree = NULL;
2558 /* display decoder info (length should be 13 or 19 bytes) */
2559 cmac_item = proto_tree_add_protocol_format(tree, proto_wimax_utility_decoders, tvb, offset, length, "CMAC Tuple (%u bytes)", length);
2560 /* add CMAC subtree */
2561 cmac_tree = proto_item_add_subtree(cmac_item, ett_wimax_cmac_tuple);
2562 /* init the local offset */
2563 cmac_offset = offset;
2564 /* decode and display CMAC Tuple */
2565 proto_tree_add_item(cmac_tree, hf_xmac_tuple_rsvd, tvb, cmac_offset, 1, FALSE);
2566 proto_tree_add_item(cmac_tree, hf_xmac_tuple_key_seq_num, tvb, cmac_offset, 1, FALSE);
2570 proto_tree_add_item(cmac_tree, hf_cmac_tuple_bsid, tvb, cmac_offset, 6, FALSE);
2573 proto_tree_add_item(cmac_tree, hf_packet_number_counter, tvb, cmac_offset, 4, FALSE);
2575 proto_tree_add_item(cmac_tree, hf_cmac_tuple_cmac_value, tvb, cmac_offset, 8, FALSE);
2578 /******************************************************************/
2579 /* wimax_short_hmac_tuple_decoder() */
2580 /* decode and display the WiMax Short-HMAC Tuple (Table 348d) */
2582 /* tree - pointer of Wireshark display tree */
2583 /* tvb - pointer of the tvb which contains the Short-HMAC Tuple */
2584 /* offset - the Short-HMAC Tuple offset in the tvb */
2585 /* length - length of the Short-HMAC Tuple */
2586 /******************************************************************/
2587 void wimax_short_hmac_tuple_decoder(proto_tree *tree, tvbuff_t *tvb, guint offset, guint length)
2590 proto_item *hmac_item = NULL;
2591 proto_tree *hmac_tree = NULL;
2593 /* display decoder info (length should be at least 13 bytes ???) */
2594 hmac_item = proto_tree_add_protocol_format(tree, proto_wimax_utility_decoders, tvb, offset, length, "Short-HMAC Tuple (%u bytes)", length);
2595 /* add Short-HMAC subtree */
2596 hmac_tree = proto_item_add_subtree(hmac_item, ett_wimax_short_hmac_tuple);
2597 /* init the local offset */
2598 hmac_offset = offset;
2599 /* decode and display Short-HMAC Tuple */
2600 proto_tree_add_item(hmac_tree, hf_xmac_tuple_rsvd, tvb, hmac_offset, 1, FALSE);
2601 proto_tree_add_item(hmac_tree, hf_xmac_tuple_key_seq_num, tvb, hmac_offset, 1, FALSE);
2603 proto_tree_add_item(hmac_tree, hf_packet_number_counter, tvb, hmac_offset, 4, FALSE);
2605 proto_tree_add_item(hmac_tree, hf_hmac_tuple_hmac_digest, tvb, hmac_offset, length - offset - 3, FALSE);
2608 /******************************************************************/
2609 /* wimax_security_negotiation_parameters_decoder() */
2610 /* decode and display the WiMax Security Negotiation Parameters */
2612 /* tvb - pointer of the tvb of service flow encodings */
2613 /* tree - pointer of Wireshark display tree */
2614 /* pinfo - pointer of Wireshark packet information structure */
2615 /******************************************************************/
2616 void wimax_security_negotiation_parameters_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
2619 guint tvb_len, tlv_len, tlv_value_offset;
2621 proto_tree *tlv_tree = NULL;
2622 tlv_info_t tlv_info;
2624 /* get the tvb reported length */
2625 tvb_len = tvb_reported_length(tvb);
2626 /* do nothing if the TLV fields is not exist */
2629 /* report error if the packet size is less than 2 bytes (type+length) */
2631 { /* invalid tlv info */
2634 col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "Invalid Security Negotiation Parameters");
2638 /* process Security Negotiation Parameter TLVs */
2639 for(offset = 0; offset < tvb_len; )
2641 /* get the TLV information */
2642 init_tlv_info(&tlv_info, tvb, offset);
2643 /* get the TLV type */
2644 tlv_type = get_tlv_type(&tlv_info);
2645 /* get the TLV length */
2646 tlv_len = get_tlv_length(&tlv_info);
2647 if(tlv_type == -1 || tlv_len > MAX_TLV_LEN || tlv_len < 1)
2648 { /* invalid tlv info */
2651 col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "Security Negotiation Params TLV error");
2653 proto_tree_add_item(tree, hf_cst_invalid_tlv, tvb, offset, (tvb_len - offset), FALSE);
2656 /* get the TLV value offset */
2657 tlv_value_offset = get_tlv_value_offset(&tlv_info);
2658 #ifdef DEBUG /* for debug only */
2659 proto_tree_add_protocol_format(tree, proto_wimax_utility_decoders, tvb, offset, (tlv_len + tlv_value_offset), "Security Negotiation Parameters Type: %u (%u bytes, offset=%u, tvb_len=%u)", tlv_type, (tlv_len + tlv_value_offset), offset, tvb_len);
2661 /* update the offset */
2662 offset += tlv_value_offset;
2663 /* parse Security Negotiation Parameters TLVs */
2666 case PKM_ATTR_SECURITY_NEGOTIATION_PARAMETER_SUB_PKM_VERSION_SUPPORT:
2667 /* add TLV subtree */
2668 tlv_tree = add_tlv_subtree(&tlv_info, ett_security_negotiation_parameters, tree, hf_snp_pkm_version_support, tvb, offset, tlv_len, FALSE);
2669 proto_tree_add_item(tlv_tree, hf_snp_pkm_version_support_bit0, tvb, offset, 1, FALSE);
2670 proto_tree_add_item(tlv_tree, hf_snp_pkm_version_support_bit1, tvb, offset, 1, FALSE);
2671 proto_tree_add_item(tlv_tree, hf_snp_pkm_version_support_reserved, tvb, offset, 1, FALSE);
2673 case PKM_ATTR_SECURITY_NEGOTIATION_PARAMETER_SUB_AUTHORIZATION_POLICY_SUPPORT:
2674 /* add TLV subtree */
2675 tlv_tree = add_tlv_subtree(&tlv_info, ett_security_negotiation_parameters, tree, hf_snp_auth_policy_support, tvb, offset, tlv_len, FALSE);
2676 proto_tree_add_item(tlv_tree, hf_snp_auth_policy_support_bit0, tvb, offset, 1, FALSE);
2677 proto_tree_add_item(tlv_tree, hf_snp_auth_policy_support_bit1, tvb, offset, 1, FALSE);
2678 proto_tree_add_item(tlv_tree, hf_snp_auth_policy_support_bit2, tvb, offset, 1, FALSE);
2679 proto_tree_add_item(tlv_tree, hf_snp_auth_policy_support_bit3, tvb, offset, 1, FALSE);
2680 proto_tree_add_item(tlv_tree, hf_snp_auth_policy_support_bit4, tvb, offset, 1, FALSE);
2681 proto_tree_add_item(tlv_tree, hf_snp_auth_policy_support_bit5, tvb, offset, 1, FALSE);
2682 proto_tree_add_item(tlv_tree, hf_snp_auth_policy_support_bit6, tvb, offset, 1, FALSE);
2683 proto_tree_add_item(tlv_tree, hf_snp_auth_policy_support_bit7, tvb, offset, 1, FALSE);
2685 case PKM_ATTR_SECURITY_NEGOTIATION_PARAMETER_SUB_MESSAGE_AUTHENTICATION_CODE:
2686 /* add TLV subtree */
2687 tlv_tree = add_tlv_subtree(&tlv_info, ett_security_negotiation_parameters, tree, hf_snp_mac_mode, tvb, offset, tlv_len, FALSE);
2688 proto_tree_add_item(tlv_tree, hf_snp_mac_mode_bit0, tvb, offset, 1, FALSE);
2689 if (include_cor2_changes)
2691 proto_tree_add_item(tlv_tree, hf_snp_mac_mode_bit1_rsvd, tvb, offset, 1, FALSE);
2695 proto_tree_add_item(tlv_tree, hf_snp_mac_mode_bit1, tvb, offset, 1, FALSE);
2697 proto_tree_add_item(tlv_tree, hf_snp_mac_mode_bit2, tvb, offset, 1, FALSE);
2698 proto_tree_add_item(tlv_tree, hf_snp_mac_mode_bit3, tvb, offset, 1, FALSE);
2699 proto_tree_add_item(tlv_tree, hf_snp_mac_mode_bit4, tvb, offset, 1, FALSE);
2700 if (include_cor2_changes)
2702 proto_tree_add_item(tlv_tree, hf_snp_mac_mode_bit5, tvb, offset, 1, FALSE);
2703 proto_tree_add_item(tlv_tree, hf_snp_mac_mode_reserved1, tvb, offset, 1, FALSE);
2707 proto_tree_add_item(tlv_tree, hf_snp_mac_mode_reserved, tvb, offset, 1, FALSE);
2710 case PKM_ATTR_SECURITY_NEGOTIATION_PARAMETER_SUB_PN_WINDOW_SIZE:
2711 tlv_tree = add_tlv_subtree(&tlv_info, ett_security_negotiation_parameters, tree, hf_snp_pn_window_size, tvb, offset, tlv_len, FALSE);
2712 proto_tree_add_item(tlv_tree, hf_snp_pn_window_size, tvb, offset, tlv_len, FALSE);
2714 case PKM_ATTR_SECURITY_NEGOTIATION_PARAMETER_SUB_PKM_FLOW_CONTROL:
2715 proto_tree_add_item(tlv_tree, hf_snp_max_conc_transactions, tvb, offset, 1, FALSE);
2717 case PKM_ATTR_SECURITY_NEGOTIATION_PARAMETER_SUB_MAX_SUPPT_SECURITY_ASSNS:
2718 proto_tree_add_item(tlv_tree, hf_snp_max_suppt_sec_assns, tvb, offset, 1, FALSE);
2721 tlv_tree = add_tlv_subtree(&tlv_info, ett_security_negotiation_parameters, tree, hf_snp_unknown_type, tvb, offset, tlv_len, FALSE);
2722 proto_tree_add_item(tlv_tree, hf_snp_unknown_type, tvb, offset, tlv_len, FALSE);
2729 /******************************************************************/
2730 /* wimax_cryptographic_suite_list_decoder() */
2731 /* decode and display the WiMax Cryptographic Suite List */
2733 /* tvb - pointer of the tvb of service flow encodings */
2734 /* tree - pointer of Wireshark display tree */
2735 /* pinfo - pointer of Wireshark packet information structure */
2736 /******************************************************************/
2737 void wimax_cryptographic_suite_list_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
2740 guint tvb_len, tlv_len, tlv_value_offset;
2742 proto_tree *tlv_tree = NULL;
2743 tlv_info_t tlv_info;
2745 /* get the tvb reported length */
2746 tvb_len = tvb_reported_length(tvb);
2747 /* do nothing if the TLV fields is not exist */
2750 /* report error if the packet size is less than 2 bytes (type+length) */
2752 { /* invalid tlv info */
2755 col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "Invalid Crypto Suite List");
2759 /* process Cryptographic Suite List (11.9.15) */
2760 for(offset = 0; offset < tvb_len; )
2761 { /* get the TLV information */
2762 init_tlv_info(&tlv_info, tvb, offset);
2763 /* get the TLV type */
2764 tlv_type = get_tlv_type(&tlv_info);
2765 /* get the TLV length */
2766 tlv_len = get_tlv_length(&tlv_info);
2767 if(tlv_type == -1 || tlv_len > MAX_TLV_LEN || tlv_len < 1)
2768 { /* invalid tlv info */
2771 col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "Crypto Suite List TLV error");
2773 proto_tree_add_item(tree, hf_cst_invalid_tlv, tvb, offset, (tvb_len - offset), FALSE);
2776 /* get the TLV value offset */
2777 tlv_value_offset = get_tlv_value_offset(&tlv_info);
2778 #ifdef DEBUG /* for debug only */
2779 proto_tree_add_protocol_format(tree, proto_wimax_utility_decoders, tvb, offset, (tlv_len + tlv_value_offset), "Cryptographic Suite List TLV Type: %u (%u bytes, offset=%u, tvb_len=%u)", tlv_type, (tlv_len + tlv_value_offset), offset, tvb_len);
2781 /* update the offset for the TLV value */
2782 offset += tlv_value_offset;
2783 /* parse Cryptographic Suite List */
2786 case PKM_ATTR_CRYPTO_SUITE:
2788 tlv_tree = add_tlv_subtree(&tlv_info, ett_cryptographic_suite_list_decoder, tree, hf_pkm_msg_crypto_suite, tvb, offset, tlv_len, FALSE);
2789 proto_tree_add_item(tlv_tree, hf_pkm_msg_crypto_suite_msb, tvb, offset, 1, FALSE);
2790 proto_tree_add_item(tlv_tree, hf_pkm_msg_crypto_suite_middle, tvb, offset+1, 1, FALSE);
2791 proto_tree_add_item(tlv_tree, hf_pkm_msg_crypto_suite_lsb, tvb, offset+2, 1, FALSE);
2794 tlv_tree = add_tlv_subtree(&tlv_info, ett_cryptographic_suite_list_decoder, tree, hf_pkm_msg_unknown_type, tvb, offset, tlv_len, FALSE);
2795 proto_tree_add_item(tlv_tree, hf_pkm_msg_unknown_type, tvb, offset, tlv_len, FALSE);
2799 } /* end of TLV process while loop */
2802 /******************************************************************/
2803 /* wimax_pkm_tlv_encoded_attributes_decoder() */
2804 /* decode and display the WiMax PKM message TLV Encoded Attributes*/
2806 /* tvb - pointer of the tvb of service flow encodings */
2807 /* tree - pointer of Wireshark display tree */
2808 /* pinfo - pointer of Wireshark packet information structure */
2809 /******************************************************************/
2810 void wimax_pkm_tlv_encoded_attributes_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
2813 guint tvb_len, tlv_len, tlv_value_offset;
2815 proto_tree *tlv_tree = NULL;
2816 tlv_info_t tlv_info;
2818 /* get the tvb reported length */
2819 tvb_len = tvb_reported_length(tvb);
2820 /* do nothing if the TLV fields is not exist */
2823 /* report error if the packet size is less than 2 bytes (type+length) */
2825 { /* invalid tlv info */
2828 col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "Invalid PKM TLV");
2832 /* process PKM message TLV Encoded Attributes (11.9) */
2833 for(offset = 0; offset < tvb_len; )
2835 /* get the TLV information */
2836 init_tlv_info(&tlv_info, tvb, offset);
2837 /* get the TLV type */
2838 tlv_type = get_tlv_type(&tlv_info);
2839 /* get the TLV length */
2840 tlv_len = get_tlv_length(&tlv_info);
2841 if(tlv_type == -1 || tlv_len > MAX_TLV_LEN || tlv_len < 1)
2842 { /* invalid tlv info */
2845 col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "PKM TLV error");
2847 proto_tree_add_item(tree, hf_cst_invalid_tlv, tvb, offset, (tvb_len - offset), FALSE);
2850 /* get the TLV value offset */
2851 tlv_value_offset = get_tlv_value_offset(&tlv_info);
2852 #ifdef DEBUG /* for debug only */
2853 proto_tree_add_protocol_format(tree, proto_wimax_utility_decoders, tvb, offset, (tlv_len + tlv_value_offset), "PKM TLV Encoded Attributes TLV Type: %u (%u bytes, offset=%u, tvb_len=%u)", tlv_type, (tlv_len + tlv_value_offset), offset, tvb_len);
2855 /* update the offset for the TLV value */
2856 offset += tlv_value_offset;
2857 /* parse PKM TLV Encoded Attributes (table 370) */
2860 case PKM_ATTR_DISPLAY_STRING:
2861 tlv_tree = add_tlv_subtree(&tlv_info, ett_pkm_tlv_encoded_attributes_decoder, tree, hf_pkm_msg_attr_display, tvb, offset, tlv_len, FALSE);
2862 proto_tree_add_item(tlv_tree, hf_pkm_msg_attr_display, tvb, offset, tlv_len, FALSE);
2864 case PKM_ATTR_AUTH_KEY:
2865 tlv_tree = add_tlv_subtree(&tlv_info, ett_pkm_tlv_encoded_attributes_decoder, tree, hf_pkm_msg_attr_auth_key, tvb, offset, tlv_len, FALSE);
2866 proto_tree_add_item(tlv_tree, hf_pkm_msg_attr_auth_key, tvb, offset, tlv_len, FALSE);
2869 tlv_tree = add_tlv_subtree(&tlv_info, ett_pkm_tlv_encoded_attributes_decoder, tree, hf_pkm_msg_attr_tek, tvb, offset, tlv_len, FALSE);
2870 proto_tree_add_item(tlv_tree, hf_pkm_msg_attr_tek, tvb, offset, tlv_len, FALSE);
2872 case PKM_ATTR_KEY_LIFE_TIME:
2873 tlv_tree = add_tlv_subtree(&tlv_info, ett_pkm_tlv_encoded_attributes_decoder, tree, hf_pkm_msg_attr_key_life_time, tvb, offset, tlv_len, FALSE);
2874 proto_tree_add_item(tlv_tree, hf_pkm_msg_attr_key_life_time, tvb, offset, tlv_len, FALSE);
2876 case PKM_ATTR_KEY_SEQ_NUM:
2877 tlv_tree = add_tlv_subtree(&tlv_info, ett_pkm_tlv_encoded_attributes_decoder, tree, hf_pkm_msg_attr_key_seq_num, tvb, offset, tlv_len, FALSE);
2878 proto_tree_add_item(tlv_tree, hf_pkm_msg_attr_key_seq_num, tvb, offset, tlv_len, FALSE);
2880 case PKM_ATTR_HMAC_DIGEST:
2881 tlv_tree = add_tlv_subtree(&tlv_info, ett_pkm_tlv_encoded_attributes_decoder, tree, hf_pkm_msg_attr_hmac_digest, tvb, offset, tlv_len, FALSE);
2882 proto_tree_add_item(tlv_tree, hf_pkm_msg_attr_hmac_digest, tvb, offset, tlv_len, FALSE);
2885 tlv_tree = add_tlv_subtree(&tlv_info, ett_pkm_tlv_encoded_attributes_decoder, tree, hf_pkm_msg_attr_said, tvb, offset, tlv_len, FALSE);
2886 proto_tree_add_item(tlv_tree, hf_pkm_msg_attr_said, tvb, offset, tlv_len, FALSE);
2888 case PKM_ATTR_TEK_PARAM:
2889 tlv_tree = add_protocol_subtree(&tlv_info, ett_pkm_tlv_encoded_attributes_decoder, tree, proto_wimax_utility_decoders, tvb, offset, tlv_len, "TEK Parameters (%u bytes)", tlv_len);
2891 wimax_tek_parameters_decoder(tvb_new_subset(tvb, offset, tlv_len, tlv_len), pinfo, tlv_tree);
2893 case PKM_ATTR_CBC_IV:
2894 tlv_tree = add_tlv_subtree(&tlv_info, ett_pkm_tlv_encoded_attributes_decoder, tree, hf_pkm_msg_attr_cbc_iv, tvb, offset, tlv_len, FALSE);
2895 proto_tree_add_item(tlv_tree, hf_pkm_msg_attr_cbc_iv, tvb, offset, tlv_len, FALSE);
2897 case PKM_ATTR_ERROR_CODE:
2898 tlv_tree = add_tlv_subtree(&tlv_info, ett_pkm_tlv_encoded_attributes_decoder, tree, hf_pkm_msg_attr_error_code, tvb, offset, tlv_len, FALSE);
2899 proto_tree_add_item(tlv_tree, hf_pkm_msg_attr_error_code, tvb, offset, tlv_len, FALSE);
2901 case PKM_ATTR_CA_CERTIFICATE:
2902 tlv_tree = add_tlv_subtree(&tlv_info, ett_pkm_tlv_encoded_attributes_decoder, tree, hf_pkm_msg_attr_ca_certificate, tvb, offset, tlv_len, FALSE);
2903 proto_tree_add_item(tlv_tree, hf_pkm_msg_attr_ca_certificate, tvb, offset, tlv_len, FALSE);
2905 case PKM_ATTR_SS_CERTIFICATE:
2906 tlv_tree = add_tlv_subtree(&tlv_info, ett_pkm_tlv_encoded_attributes_decoder, tree, hf_pkm_msg_attr_ss_certificate, tvb, offset, tlv_len, FALSE);
2907 proto_tree_add_item(tlv_tree, hf_pkm_msg_attr_ss_certificate, tvb, offset, tlv_len, FALSE);
2909 case PKM_ATTR_SECURITY_CAPABILITIES:
2910 tlv_tree = add_protocol_subtree(&tlv_info, ett_pkm_tlv_encoded_attributes_decoder, tree, proto_wimax_utility_decoders, tvb, offset, tlv_len, "Security Capabilities (%u bytes)", tlv_len);
2912 wimax_security_capabilities_decoder(tvb_new_subset(tvb, offset, tlv_len, tlv_len), pinfo, tlv_tree);
2914 case PKM_ATTR_CRYPTO_SUITE:
2916 tlv_tree = add_tlv_subtree(&tlv_info, ett_pkm_tlv_encoded_attributes_decoder, tree, hf_pkm_msg_crypto_suite, tvb, offset, tlv_len, FALSE);
2917 proto_tree_add_item(tlv_tree, hf_pkm_msg_crypto_suite_msb, tvb, offset, 1, FALSE);
2918 proto_tree_add_item(tlv_tree, hf_pkm_msg_crypto_suite_middle, tvb, offset+1, 1, FALSE);
2919 proto_tree_add_item(tlv_tree, hf_pkm_msg_crypto_suite_lsb, tvb, offset+2, 1, FALSE);
2921 case PKM_ATTR_CRYPTO_LIST:
2922 tlv_tree = add_protocol_subtree(&tlv_info, ett_pkm_tlv_encoded_attributes_decoder, tree, proto_wimax_utility_decoders, tvb, offset, tlv_len, "Cryptographic-Suite List (%u bytes)", tlv_len);
2924 wimax_cryptographic_suite_list_decoder(tvb_new_subset(tvb, offset, tlv_len, tlv_len), pinfo, tlv_tree);
2926 #if 0 /* rserved by IEE 802.16E */
2927 case PKM_ATTR_VERSION:
2928 proto_tree_add_item(tree, hf_pkm_msg_version, tvb, offset, tlv_len, FALSE);
2931 case PKM_ATTR_SA_DESCRIPTOR:
2932 tlv_tree = add_protocol_subtree(&tlv_info, ett_pkm_tlv_encoded_attributes_decoder, tree, proto_wimax_utility_decoders, tvb, offset, tlv_len, "SA-Descriptor (%u bytes)", tlv_len);
2934 wimax_sa_descriptor_decoder(tvb_new_subset(tvb, offset, tlv_len, tlv_len), pinfo, tlv_tree);
2936 case PKM_ATTR_SA_TYPE:
2937 tlv_tree = add_tlv_subtree(&tlv_info, ett_pkm_tlv_encoded_attributes_decoder, tree, hf_pkm_sa_type, tvb, offset, tlv_len, FALSE);
2938 proto_tree_add_item(tlv_tree, hf_pkm_sa_type, tvb, offset, tlv_len, FALSE);
2940 case PKM_ATTR_SECURITY_NEGOTIATION_PARAMETERS:
2941 tlv_tree = add_protocol_subtree(&tlv_info, ett_pkm_tlv_encoded_attributes_decoder, tree, proto_wimax_utility_decoders, tvb, offset, tlv_len, "Security Negotiation Parameters (%u bytes)", tlv_len);
2943 wimax_security_negotiation_parameters_decoder(tvb_new_subset(tvb, offset, tlv_len, tlv_len), pinfo, tlv_tree);
2945 case PKM_ATTR_PKM_CONFIG_SETTINGS:
2947 tlv_tree = add_protocol_subtree(&tlv_info, ett_pkm_tlv_encoded_attributes_decoder, tree, proto_wimax_utility_decoders, tvb, offset, tlv_len, "PKM Configuration Settings (%u bytes)", tlv_len);
2948 wimax_pkm_configuration_settings_decoder(tvb_new_subset(tvb, offset, tlv_len, tlv_len), pinfo, tlv_tree);
2950 case PKM_ATTR_PKM_EAP_PAYLOAD:
2951 tlv_tree = add_tlv_subtree(&tlv_info, ett_pkm_tlv_encoded_attributes_decoder, tree, hf_pkm_attr_eap_payload, tvb, offset, tlv_len, FALSE);
2953 call_dissector(eap_handle, tvb_new_subset(tvb, offset, tlv_len, tlv_len), pinfo, tlv_tree);
2955 proto_tree_add_item(tlv_tree, hf_pkm_attr_eap_payload, tvb, offset, tlv_len, FALSE);
2957 case PKM_ATTR_PKM_NONCE:
2958 tlv_tree = add_tlv_subtree(&tlv_info, ett_pkm_tlv_encoded_attributes_decoder, tree, hf_pkm_attr_nonce, tvb, offset, tlv_len, FALSE);
2959 proto_tree_add_item(tlv_tree, hf_pkm_attr_nonce, tvb, offset, tlv_len, FALSE);
2961 case PKM_ATTR_AUTH_RESULT_CODE:
2962 tlv_tree = add_tlv_subtree(&tlv_info, ett_pkm_tlv_encoded_attributes_decoder, tree, hf_pkm_attr_auth_result_code, tvb, offset, tlv_len, FALSE);
2963 proto_tree_add_item(tlv_tree, hf_pkm_attr_auth_result_code, tvb, offset, tlv_len, FALSE);
2965 case PKM_ATTR_SA_SERVICE_TYPE:
2966 tlv_tree = add_tlv_subtree(&tlv_info, ett_pkm_tlv_encoded_attributes_decoder, tree, hf_pkm_attr_sa_service_type, tvb, offset, tlv_len, FALSE);
2967 proto_tree_add_item(tlv_tree, hf_pkm_attr_sa_service_type, tvb, offset, tlv_len, FALSE);
2969 case PKM_ATTR_FRAME_NUMBER:
2970 tlv_tree = add_tlv_subtree(&tlv_info, ett_pkm_tlv_encoded_attributes_decoder, tree, hf_pkm_attr_frame_number, tvb, offset, tlv_len, FALSE);
2971 proto_tree_add_item(tlv_tree, hf_pkm_attr_frame_number, tvb, offset, tlv_len, FALSE);
2973 case PKM_ATTR_SS_RANDOM:
2974 tlv_tree = add_tlv_subtree(&tlv_info, ett_pkm_tlv_encoded_attributes_decoder, tree, hf_pkm_attr_ss_random, tvb, offset, tlv_len, FALSE);
2975 proto_tree_add_item(tlv_tree, hf_pkm_attr_ss_random, tvb, offset, tlv_len, FALSE);
2977 case PKM_ATTR_BS_RANDOM:
2978 tlv_tree = add_tlv_subtree(&tlv_info, ett_pkm_tlv_encoded_attributes_decoder, tree, hf_pkm_attr_bs_random, tvb, offset, tlv_len, FALSE);
2979 proto_tree_add_item(tlv_tree, hf_pkm_attr_bs_random, tvb, offset, tlv_len, FALSE);
2981 case PKM_ATTR_PRE_PAK:
2982 tlv_tree = add_tlv_subtree(&tlv_info, ett_pkm_tlv_encoded_attributes_decoder, tree, hf_pkm_attr_pre_pak, tvb, offset, tlv_len, FALSE);
2983 proto_tree_add_item(tlv_tree, hf_pkm_attr_pre_pak, tvb, offset, tlv_len, FALSE);
2985 case PKM_ATTR_BS_CERTIFICATE:
2986 tlv_tree = add_tlv_subtree(&tlv_info, ett_pkm_tlv_encoded_attributes_decoder, tree, hf_pkm_attr_bs_certificate, tvb, offset, tlv_len, FALSE);
2987 proto_tree_add_item(tlv_tree, hf_pkm_attr_bs_certificate, tvb, offset, tlv_len, FALSE);
2989 case PKM_ATTR_SIG_BS:
2990 tlv_tree = add_tlv_subtree(&tlv_info, ett_pkm_tlv_encoded_attributes_decoder, tree, hf_pkm_attr_sig_bs, tvb, offset, tlv_len, FALSE);
2991 proto_tree_add_item(tlv_tree, hf_pkm_attr_sig_bs, tvb, offset, tlv_len, FALSE);
2993 case PKM_ATTR_MS_MAC_ADDRESS:
2994 tlv_tree = add_tlv_subtree(&tlv_info, ett_pkm_tlv_encoded_attributes_decoder, tree, hf_pkm_attr_ms_mac_address, tvb, offset, tlv_len, FALSE);
2995 proto_tree_add_item(tlv_tree, hf_pkm_attr_ms_mac_address, tvb, offset, tlv_len, FALSE);
2997 case PKM_ATTR_CMAC_DIGEST:
2998 /* add TLV subtree */
2999 tlv_tree = add_tlv_subtree(&tlv_info, ett_pkm_tlv_encoded_attributes_decoder, tree, hf_pkm_attr_cmac_digest, tvb, offset, tlv_len, FALSE);
3000 proto_tree_add_item(tlv_tree, hf_pkm_attr_cmac_digest_pn, tvb, offset, 4, FALSE);
3001 proto_tree_add_item(tlv_tree, hf_pkm_attr_cmac_digest_value, tvb, (offset + 4), 8, FALSE);
3003 case PKM_ATTR_KEY_PUSH_MODES:
3004 tlv_tree = add_tlv_subtree(&tlv_info, ett_pkm_tlv_encoded_attributes_decoder, tree, hf_pkm_attr_push_modes, tvb, offset, tlv_len, FALSE);
3005 proto_tree_add_item(tlv_tree, hf_pkm_attr_push_modes, tvb, offset, tlv_len, FALSE);
3007 case PKM_ATTR_KEY_PUSH_COUNTER:
3008 tlv_tree = add_tlv_subtree(&tlv_info, ett_pkm_tlv_encoded_attributes_decoder, tree, hf_pkm_attr_key_push_counter, tvb, offset, tlv_len, FALSE);
3009 proto_tree_add_item(tlv_tree, hf_pkm_attr_key_push_counter, tvb, offset, tlv_len, FALSE);
3012 tlv_tree = add_tlv_subtree(&tlv_info, ett_pkm_tlv_encoded_attributes_decoder, tree, hf_pkm_attr_gkek, tvb, offset, tlv_len, FALSE);
3013 proto_tree_add_item(tlv_tree, hf_pkm_attr_gkek, tvb, offset, tlv_len, FALSE);
3015 case PKM_ATTR_SIG_SS:
3016 tlv_tree = add_tlv_subtree(&tlv_info, ett_pkm_tlv_encoded_attributes_decoder, tree, hf_pkm_attr_sig_ss, tvb, offset, tlv_len, FALSE);
3017 proto_tree_add_item(tlv_tree, hf_pkm_attr_sig_ss, tvb, offset, tlv_len, FALSE);
3020 tlv_tree = add_tlv_subtree(&tlv_info, ett_pkm_tlv_encoded_attributes_decoder, tree, hf_pkm_attr_akid, tvb, offset, tlv_len, FALSE);
3021 proto_tree_add_item(tlv_tree, hf_pkm_attr_akid, tvb, offset, tlv_len, FALSE);
3024 tlv_tree = add_tlv_subtree(&tlv_info, ett_pkm_tlv_encoded_attributes_decoder, tree, hf_pkm_msg_unknown_type, tvb, offset, tlv_len, FALSE);
3025 proto_tree_add_item(tlv_tree, hf_pkm_msg_unknown_type, tvb, offset, tlv_len, FALSE);
3029 } /* end of TLV process while loop */
3032 /******************************************************************/
3033 /* wimax_tek_parameters_decoder() */
3034 /* decode and display the WiMax TEK Parameters subattributes */
3036 /* tvb - pointer of the tvb of service flow encodings */
3037 /* tree - pointer of Wireshark display tree */
3038 /* pinfo - pointer of Wireshark packet information structure */
3039 /******************************************************************/
3040 void wimax_tek_parameters_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
3043 guint tvb_len, tlv_len, tlv_value_offset;
3045 proto_tree *tlv_tree = NULL;
3046 tlv_info_t tlv_info;
3048 /* get the tvb reported length */
3049 tvb_len = tvb_reported_length(tvb);
3050 /* do nothing if the TLV fields is not exist */
3053 /* report error if the packet size is less than 2 bytes (type+length) */
3055 { /* invalid tlv info */
3058 col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "Invalid TEK Params");
3062 /* process PKM Message TEK Parameters (11.9.8) */
3063 for(offset = 0; offset < tvb_len; )
3065 /* get the TLV information */
3066 init_tlv_info(&tlv_info, tvb, offset);
3067 /* get the TLV type */
3068 tlv_type = get_tlv_type(&tlv_info);
3069 /* get the TLV length */
3070 tlv_len = get_tlv_length(&tlv_info);
3071 if(tlv_type == -1 || tlv_len > MAX_TLV_LEN || tlv_len < 1)
3072 { /* invalid tlv info */
3075 col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "TEK Param TLV error");
3077 proto_tree_add_item(tree, hf_cst_invalid_tlv, tvb, offset, (tvb_len - offset), FALSE);
3080 /* get the TLV value offset */
3081 tlv_value_offset = get_tlv_value_offset(&tlv_info);
3082 #ifdef DEBUG /* for debug only */
3083 proto_tree_add_protocol_format(tree, proto_wimax_utility_decoders, tvb, offset, (tlv_len + tlv_value_offset), "TEK Parameters Subattributes TLV Type: %u (%u bytes, offset=%u, tvb_len=%u)", tlv_type, (tlv_len + tlv_value_offset), offset, tvb_len);
3085 /* update the offset for the TLV value */
3086 offset += tlv_value_offset;
3087 /* parse TEK Parameters Subattributes (table 372) */
3091 tlv_tree = add_tlv_subtree(&tlv_info, ett_pkm_tlv_encoded_attributes_decoder, tree, hf_pkm_msg_attr_tek, tvb, offset, tlv_len, FALSE);
3092 proto_tree_add_item(tlv_tree, hf_pkm_msg_attr_tek, tvb, offset, tlv_len, FALSE);
3094 case PKM_ATTR_KEY_LIFE_TIME:
3095 tlv_tree = add_tlv_subtree(&tlv_info, ett_pkm_tlv_encoded_attributes_decoder, tree, hf_pkm_msg_attr_key_life_time, tvb, offset, tlv_len, FALSE);
3096 proto_tree_add_item(tlv_tree, hf_pkm_msg_attr_key_life_time, tvb, offset, tlv_len, FALSE);
3098 case PKM_ATTR_KEY_SEQ_NUM:
3099 tlv_tree = add_tlv_subtree(&tlv_info, ett_pkm_tlv_encoded_attributes_decoder, tree, hf_pkm_msg_attr_key_seq_num, tvb, offset, tlv_len, FALSE);
3100 proto_tree_add_item(tlv_tree, hf_pkm_msg_attr_key_seq_num, tvb, offset, tlv_len, FALSE);
3102 case PKM_ATTR_CBC_IV:
3103 tlv_tree = add_tlv_subtree(&tlv_info, ett_pkm_tlv_encoded_attributes_decoder, tree, hf_pkm_msg_attr_cbc_iv, tvb, offset, tlv_len, FALSE);
3104 proto_tree_add_item(tlv_tree, hf_pkm_msg_attr_cbc_iv, tvb, offset, tlv_len, FALSE);
3106 case PKM_ATTR_ASSOCIATED_GKEK_SEQ_NUM:
3107 tlv_tree = add_tlv_subtree(&tlv_info, ett_pkm_tlv_encoded_attributes_decoder, tree, hf_pkm_attr_associated_gkek_seq_number, tvb, offset, tlv_len, FALSE);
3108 proto_tree_add_item(tlv_tree, hf_pkm_attr_associated_gkek_seq_number, tvb, offset, tlv_len, FALSE);
3111 tlv_tree = add_tlv_subtree(&tlv_info, ett_pkm_tlv_encoded_attributes_decoder, tree, hf_pkm_msg_unknown_type, tvb, offset, tlv_len, FALSE);
3112 proto_tree_add_item(tlv_tree, hf_pkm_msg_unknown_type, tvb, offset, tlv_len, FALSE);
3116 } /* end of TLV process while loop */
3119 /******************************************************************/
3120 /* wimax_pkm_configuration_settings_decoder() */
3121 /* decode and display the WiMax PKM Configuration Settings */
3123 /* tvb - pointer of the tvb of service flow encodings */
3124 /* tree - pointer of Wireshark display tree */
3125 /* pinfo - pointer of Wireshark packet information structure */
3126 /******************************************************************/
3127 void wimax_pkm_configuration_settings_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
3130 guint tvb_len, tlv_len, tlv_value_offset;
3132 proto_tree *tlv_tree;
3133 tlv_info_t tlv_info;
3135 /* get the tvb reported length */
3136 tvb_len = tvb_reported_length(tvb);
3137 /* do nothing if the TLV fields is not exist */
3140 /* report error if the packet size is less than 2 bytes (type+length) */
3142 { /* invalid tlv info */
3145 col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "Invalid PKM Config Settings");
3149 /* process PKM Configuration Settings (11.9.19) */
3150 for(offset = 0; offset < tvb_len; )
3152 /* get the TLV information */
3153 init_tlv_info(&tlv_info, tvb, offset);
3154 /* get the TLV type */
3155 tlv_type = get_tlv_type(&tlv_info);
3156 /* get the TLV length */
3157 tlv_len = get_tlv_length(&tlv_info);
3158 if(tlv_type == -1 || tlv_len > MAX_TLV_LEN || tlv_len < 1)
3159 { /* invalid tlv info */
3162 col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "PKM Config Settings TLV error");
3164 proto_tree_add_item(tree, hf_cst_invalid_tlv, tvb, offset, (tvb_len - offset), FALSE);
3167 /* get the TLV value offset */
3168 tlv_value_offset = get_tlv_value_offset(&tlv_info);
3169 #ifdef DEBUG /* for debug only */
3170 proto_tree_add_protocol_format(tree, proto_wimax_utility_decoders, tvb, offset, (tlv_len + tlv_value_offset), "PKM Configuration Settings TLV Type: %u (%u bytes, offset=%u, tvb_len=%u)", tlv_type, (tlv_len + tlv_value_offset), offset, tvb_len);
3172 /* update the offset for the TLV value */
3173 offset += tlv_value_offset;
3174 /* parse PKM Configuration Settings (11.9.19.1 - 11.9.19.7 */
3177 case PKM_ATTR_PKM_CONFIG_SETTINGS_AUTHORIZE_WAIT_TIMEOUT:
3178 tlv_tree = add_tlv_subtree(&tlv_info, ett_pkm_tlv_encoded_attributes_decoder, tree, hf_pkm_config_settings_authorize_waitout, tvb, offset, tlv_len, FALSE);
3179 proto_tree_add_item(tlv_tree, hf_pkm_config_settings_authorize_waitout, tvb, offset, tlv_len, FALSE);
3181 case PKM_ATTR_PKM_CONFIG_SETTINGS_REAUTHORIZE_WAIT_TIMEOUT:
3182 tlv_tree = add_tlv_subtree(&tlv_info, ett_pkm_tlv_encoded_attributes_decoder, tree, hf_pkm_config_settings_reauthorize_waitout, tvb, offset, tlv_len, FALSE);
3183 proto_tree_add_item(tlv_tree, hf_pkm_config_settings_reauthorize_waitout, tvb, offset, tlv_len, FALSE);
3185 case PKM_ATTR_PKM_CONFIG_SETTINGS_AUTHORIZATION_GRACE_TIME:
3186 tlv_tree = add_tlv_subtree(&tlv_info, ett_pkm_tlv_encoded_attributes_decoder, tree, hf_pkm_config_settings_grace_time, tvb, offset, tlv_len, FALSE);
3187 proto_tree_add_item(tlv_tree, hf_pkm_config_settings_grace_time, tvb, offset, tlv_len, FALSE);
3189 case PKM_ATTR_PKM_CONFIG_SETTINGS_OPERATIONAL_WAIT_TIMEOUT:
3190 tlv_tree = add_tlv_subtree(&tlv_info, ett_pkm_tlv_encoded_attributes_decoder, tree, hf_pkm_config_settings_operational_waittime, tvb, offset, tlv_len, FALSE);
3191 proto_tree_add_item(tlv_tree, hf_pkm_config_settings_operational_waittime, tvb, offset, tlv_len, FALSE);
3193 case PKM_ATTR_PKM_CONFIG_SETTINGS_REKEY_WAIT_TIMEOUT:
3194 tlv_tree = add_tlv_subtree(&tlv_info, ett_pkm_tlv_encoded_attributes_decoder, tree, hf_pkm_config_settings_rekey_wait_timeout, tvb, offset, tlv_len, FALSE);
3195 proto_tree_add_item(tlv_tree, hf_pkm_config_settings_rekey_wait_timeout, tvb, offset, tlv_len, FALSE);
3197 case PKM_ATTR_PKM_CONFIG_SETTINGS_TEK_GRACE_TIME:
3198 tlv_tree = add_tlv_subtree(&tlv_info, ett_pkm_tlv_encoded_attributes_decoder, tree, hf_pkm_config_settings_tek_grace_time, tvb, offset, tlv_len, FALSE);
3199 proto_tree_add_item(tlv_tree, hf_pkm_config_settings_tek_grace_time, tvb, offset, tlv_len, FALSE);
3201 case PKM_ATTR_PKM_CONFIG_SETTINGS_AUTHORIZE_REJECT_WAIT_TIMEOUT:
3202 tlv_tree = add_tlv_subtree(&tlv_info, ett_pkm_tlv_encoded_attributes_decoder, tree, hf_pkm_config_settings_authorize_reject_wait_timeout, tvb, offset, tlv_len, FALSE);
3203 proto_tree_add_item(tlv_tree, hf_pkm_config_settings_authorize_reject_wait_timeout, tvb, offset, tlv_len, FALSE);
3206 tlv_tree = add_tlv_subtree(&tlv_info, ett_pkm_tlv_encoded_attributes_decoder, tree, hf_pkm_config_settings_authorize_reject_wait_timeout, tvb, offset, tlv_len, FALSE);
3207 proto_tree_add_item(tlv_tree, hf_pkm_msg_unknown_type, tvb, offset, tlv_len, FALSE);
3211 } /* end of TLV process while loop */
3214 /******************************************************************/
3215 /* wimax_sa_descriptor_decoder() */
3216 /* decode and display the WiMax PKM message SA-Descriptor */
3218 /* tvb - pointer of the tvb of service flow encodings */
3219 /* tree - pointer of Wireshark display tree */
3220 /* pinfo - pointer of Wireshark packet information structure */
3221 /******************************************************************/
3222 void wimax_sa_descriptor_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
3225 guint tvb_len, tlv_len, tlv_value_offset;
3227 proto_tree *tlv_tree = NULL;
3228 tlv_info_t tlv_info;
3230 /* get the tvb reported length */
3231 tvb_len = tvb_reported_length(tvb);
3232 /* do nothing if the TLV fields is not exist */
3235 /* report error if the packet size is less than 2 bytes (type+length) */
3237 { /* invalid tlv info */
3240 col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "Invalid SA-Descriptor");
3244 /* process SA-Descriptor (11.9.17) */
3245 for(offset = 0; offset < tvb_len; )
3247 /* get the TLV information */
3248 init_tlv_info(&tlv_info, tvb, offset);
3249 /* get the TLV type */
3250 tlv_type = get_tlv_type(&tlv_info);
3251 /* get the TLV length */
3252 tlv_len = get_tlv_length(&tlv_info);
3253 if(tlv_type == -1 || tlv_len > MAX_TLV_LEN || tlv_len < 1)
3254 { /* invalid tlv info */
3257 col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "SA-Descriptor TLV error");
3259 proto_tree_add_item(tree, hf_cst_invalid_tlv, tvb, offset, (tvb_len - offset), FALSE);
3262 /* get the TLV value offset */
3263 tlv_value_offset = get_tlv_value_offset(&tlv_info);
3264 #ifdef DEBUG /* for debug only */
3265 proto_tree_add_protocol_format(tree, proto_wimax_utility_decoders, tvb, offset, (tlv_len + tlv_value_offset), "SA-Descriptor TLV Type: %u (%u bytes, offset=%u, tvb_len=%u)", tlv_type, (tlv_len + tlv_value_offset), offset, tvb_len);
3267 /* update the offset for the TLV value */
3268 offset += tlv_value_offset;
3269 /* parse SA-Descriptor (table 380) */
3273 tlv_tree = add_tlv_subtree(&tlv_info, ett_sa_descriptor_decoder, tree, hf_pkm_msg_attr_said, tvb, offset, tlv_len, FALSE);
3274 proto_tree_add_item(tlv_tree, hf_pkm_msg_attr_said, tvb, offset, tlv_len, FALSE);
3276 case PKM_ATTR_SA_TYPE:
3277 tlv_tree = add_tlv_subtree(&tlv_info, ett_sa_descriptor_decoder, tree, hf_pkm_sa_type, tvb, offset, tlv_len, FALSE);
3278 proto_tree_add_item(tlv_tree, hf_pkm_sa_type, tvb, offset, tlv_len, FALSE);
3280 case PKM_ATTR_SA_SERVICE_TYPE:
3281 tlv_tree = add_tlv_subtree(&tlv_info, ett_sa_descriptor_decoder, tree, hf_pkm_attr_sa_service_type, tvb, offset, tlv_len, FALSE);
3282 proto_tree_add_item(tlv_tree, hf_pkm_attr_sa_service_type, tvb, offset, tlv_len, FALSE);
3284 case PKM_ATTR_CRYPTO_SUITE:
3286 tlv_tree = add_tlv_subtree(&tlv_info, ett_sa_descriptor_decoder, tree, hf_pkm_msg_crypto_suite, tvb, offset, tlv_len, FALSE);
3287 proto_tree_add_item(tlv_tree, hf_pkm_msg_crypto_suite_msb, tvb, offset, 1, FALSE);
3288 proto_tree_add_item(tlv_tree, hf_pkm_msg_crypto_suite_middle, tvb, offset+1, 1, FALSE);
3289 proto_tree_add_item(tlv_tree, hf_pkm_msg_crypto_suite_lsb, tvb, offset+2, 1, FALSE);
3292 tlv_tree = add_tlv_subtree(&tlv_info, ett_sa_descriptor_decoder, tree, hf_pkm_msg_unknown_type, tvb, offset, tlv_len, FALSE);
3293 proto_tree_add_item(tlv_tree, hf_pkm_msg_unknown_type, tvb, offset, tlv_len, FALSE);
3297 } /* end of TLV process while loop */
3300 /******************************************************************/
3301 /* wimax_security_capabilities_decoder() */
3302 /* decode and display the WiMax Security Capabilities */
3304 /* tvb - pointer of the tvb of service flow encodings */
3305 /* tree - pointer of Wireshark display tree */
3306 /* pinfo - pointer of Wireshark packet information structure */
3307 /******************************************************************/
3308 void wimax_security_capabilities_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
3311 guint tvb_len, tlv_len, tlv_value_offset;
3313 proto_tree *tlv_tree = NULL;
3314 tlv_info_t tlv_info;
3316 /* get the tvb reported length */
3317 tvb_len = tvb_reported_length(tvb);
3318 /* do nothing if the TLV fields is not exist */
3321 /* report error if the packet size is less than 2 bytes (type+length) */
3323 { /* invalid tlv info */
3326 col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "Invalid Security Capabilities");
3330 /* process Security Capabilities (11.9.13) */
3331 for(offset = 0; offset < tvb_len; )
3333 /* get the TLV information */
3334 init_tlv_info(&tlv_info, tvb, offset);
3335 /* get the TLV type */
3336 tlv_type = get_tlv_type(&tlv_info);
3337 /* get the TLV length */
3338 tlv_len = get_tlv_length(&tlv_info);
3339 if(tlv_type == -1 || tlv_len > MAX_TLV_LEN || tlv_len < 1)
3340 { /* invalid tlv info */
3343 col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "Security Capabilities TLV error");
3345 proto_tree_add_item(tree, hf_cst_invalid_tlv, tvb, offset, (tvb_len - offset), FALSE);
3348 /* get the TLV value offset */
3349 tlv_value_offset = get_tlv_value_offset(&tlv_info);
3350 #ifdef DEBUG /* for debug only */
3351 proto_tree_add_protocol_format(tree, proto_wimax_utility_decoders, tvb, offset, (tlv_len + tlv_value_offset), "Security Capabilities TLV Type: %u (%u bytes, offset=%u, tvb_len=%u)", tlv_type, (tlv_len + tlv_value_offset), offset, tvb_len);
3353 /* update the offset for the TLV value */
3354 offset += tlv_value_offset;
3355 /* parse Security Capabilities (table 374) */
3358 case PKM_ATTR_CRYPTO_LIST:
3359 tlv_tree = add_protocol_subtree(&tlv_info, ett_security_capabilities_decoder, tree, proto_wimax_utility_decoders, tvb, offset, tlv_len, "Cryptographic-Suite List (%u bytes)", tlv_len);
3361 wimax_cryptographic_suite_list_decoder(tvb_new_subset(tvb, offset, tlv_len, tlv_len), pinfo, tlv_tree);
3364 tlv_tree = add_tlv_subtree(&tlv_info, ett_security_capabilities_decoder, tree, proto_wimax_utility_decoders, tvb, offset, tlv_len, FALSE);
3365 proto_tree_add_item(tlv_tree, hf_pkm_msg_unknown_type, tvb, offset, tlv_len, FALSE);
3369 } /* end of TLV process while loop */
3372 /******************************************************************/
3373 /* wimax_vendor_specific_information_decoder() */
3374 /* decode and display the WiMax Vendor-Specific Information */
3376 /* tvb - pointer of the tvb of service flow encodings */
3377 /* tree - pointer of Wireshark display tree */
3378 /* pinfo - pointer of Wireshark packet information structure */
3379 /******************************************************************/
3380 void wimax_vendor_specific_information_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
3382 proto_tree *tlv_tree = NULL;
3384 guint tvb_len, tlv_len, tlv_value_offset;
3386 tlv_info_t tlv_info;
3388 /* get the tvb reported length */
3389 tvb_len = tvb_reported_length(tvb);
3390 /* do nothing if the TLV fields is not exist */
3393 /* report error if the packet size is less than 2 bytes (type+length) */
3395 { /* invalid tlv info */
3398 col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "Invalid Vendor Specific Info");
3400 proto_tree_add_text(tree, tvb, 0, tvb_len, "Invalid TLV info");
3403 /* process Vendor Specific Information (11.1.6) */
3404 for(offset = 0; offset < tvb_len; )
3406 /* get the TLV information */
3407 init_tlv_info(&tlv_info, tvb, offset);
3408 /* get the TLV type */
3409 tlv_type = get_tlv_type(&tlv_info);
3410 /* get the TLV length */
3411 tlv_len = get_tlv_length(&tlv_info);
3412 if(tlv_type == -1 || tlv_len > MAX_TLV_LEN || tlv_len < 1)
3413 { /* invalid tlv info */
3416 col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "Vendor Specific Info TLV error");
3418 proto_tree_add_item(tree, hf_cst_invalid_tlv, tvb, offset, (tvb_len - offset), FALSE);
3421 /* get the TLV value offset */
3422 tlv_value_offset = get_tlv_value_offset(&tlv_info);
3423 #ifdef DEBUG /* for debug only */
3424 proto_tree_add_protocol_format(tree, proto_wimax_utility_decoders, tvb, offset, (tlv_len + tlv_value_offset), "Vendor Specific Info TLV Type: %u (%u bytes, offset=%u, tvb_len=%u)", tlv_type, (tlv_len + tlv_value_offset), offset, tvb_len);
3426 /* parse Vendor Specific Information (11.1.6) */
3427 if(tlv_type == VENDOR_ID_ENCODING)
3429 /* decode and display the Vendor ID Encoding */
3430 tlv_tree = add_tlv_subtree(&tlv_info, ett_vendor_id_encoding_decoder, tree, hf_common_tlv_vendor_id, tvb, (offset + tlv_value_offset), tlv_len, FALSE);
3431 proto_tree_add_item(tlv_tree, hf_common_tlv_vendor_id, tvb, (offset + tlv_value_offset), tlv_len, FALSE);
3435 /* decode and display the Vendor Specific Info */
3436 proto_tree_add_item(tree, hf_common_tlv_vendor_specific_type, tvb, offset, 1, FALSE);
3437 if(get_tlv_length_type(&tlv_info) == 0)
3438 { /* single byte TLV length */
3439 proto_tree_add_item(tree, hf_common_tlv_vendor_specific_length, tvb, (offset + 1), 1, FALSE);
3442 { /* multiple bytes TLV length */
3443 /* display the length of the TLV length with MSB */
3444 proto_tree_add_item(tree, hf_common_tlv_vendor_specific_length_size, tvb, (offset + 1), 1, FALSE);
3445 if(get_tlv_size_of_length(&tlv_info))
3446 { /* display the multiple byte TLV length */
3447 proto_tree_add_text(tree, tvb, (offset + 2), get_tlv_size_of_length(&tlv_info), "Vendor Specific Length: %u", get_tlv_size_of_length(&tlv_info));
3454 proto_tree_add_item(tree, hf_common_tlv_vendor_specific_value, tvb, (offset + tlv_value_offset), tlv_len, FALSE);
3456 /* update the offset */
3457 offset += tlv_value_offset + tlv_len;
3461 /******************************************************************/
3462 /* wimax_common_tlv_encoding_decoder() */
3463 /* decode and display the WiMax Common TLV Encoding (Table 346) */
3465 /* tvb - pointer of the tvb of service flow encodings */
3466 /* tree - pointer of Wireshark display tree */
3467 /* pinfo - pointer of Wireshark packet information structure */
3468 /******************************************************************/
3469 guint wimax_common_tlv_encoding_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
3471 guint offset, value;
3472 guint tvb_len, tlv_len, tlv_value_offset;
3474 proto_tree *tlv_tree = NULL;
3475 tlv_info_t tlv_info;
3476 gfloat current_power;
3478 /* get the tvb reported length */
3479 tvb_len = tvb_reported_length(tvb);
3480 /* do nothing if the TLV fields is not exist */
3483 /* report error if the packet size is less than 2 bytes (type+length) */
3485 { /* invalid tlv info */
3488 col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "Invalid Common TLV encoding");
3490 proto_tree_add_item(tree, hf_cst_invalid_tlv, tvb, 0, tvb_len, FALSE);
3493 /* process Common TLV Encoding (11.1) */
3494 for(offset = 0; offset < tvb_len; )
3496 /* get the TLV information */
3497 init_tlv_info(&tlv_info, tvb, offset);
3498 /* get the TLV type */
3499 tlv_type = get_tlv_type(&tlv_info);
3500 /* get the TLV length */
3501 tlv_len = get_tlv_length(&tlv_info);
3502 if(tlv_type == -1 || tlv_len > MAX_TLV_LEN || tlv_len < 1)
3503 { /* invalid tlv info */
3506 col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "Common TLV encoding TLV error");
3508 proto_tree_add_item(tree, hf_cst_invalid_tlv, tvb, offset, (tvb_len - offset), FALSE);
3511 /* get the TLV value offset */
3512 tlv_value_offset = get_tlv_value_offset(&tlv_info);
3513 #ifdef DEBUG /* for debug only */
3514 proto_tree_add_protocol_format(tree, proto_wimax_utility_decoders, tvb, offset, (tlv_len + tlv_value_offset), "Common TLV Encoding TLV Type: %u (%u bytes, offset=%u, tvb_len=%u)", tlv_type, (tlv_len + tlv_value_offset), offset, tvb_len);
3516 /* update the offset for the TLV value */
3517 offset += tlv_value_offset;
3518 /* parse Common TLV Encoding (table 346) */
3521 case VENDOR_SPECIFIC_INFO:
3522 /* display Vendor-Specific Information */
3524 tlv_tree = add_protocol_subtree(&tlv_info, ett_vendor_specific_info_decoder, tree, proto_wimax_utility_decoders, tvb, offset, tlv_len, "Vendor-Specific Information (%u bytes)", tlv_len);
3525 /* decode and display the Vendor-Specific Information */
3526 wimax_vendor_specific_information_decoder(tvb_new_subset(tvb, offset, tlv_len, tlv_len), pinfo, tlv_tree);
3528 case VENDOR_ID_ENCODING:
3529 /* display Vendor ID Encoding */
3531 tlv_tree = add_protocol_subtree(&tlv_info, ett_vendor_specific_info_decoder, tree, proto_wimax_utility_decoders, tvb, offset, tlv_len, "Vendor ID Encoding (%u bytes)", tlv_len);
3532 /* decode and display the Vendor ID Encoding */
3533 proto_tree_add_item(tlv_tree, hf_common_tlv_vendor_id, tvb, offset, tlv_len, FALSE);
3535 case DSx_UPLINK_FLOW:
3536 /* display Uplink Service Flow Encodings info */
3538 tlv_tree = add_protocol_subtree(&tlv_info, ett_ul_service_flow_decoder, tree, proto_wimax_utility_decoders, tvb, offset, tlv_len, "Uplink Service Flow Encodings (%u bytes)", tlv_len);
3539 /* decode and display the UL Service Flow Encodings */
3540 wimax_service_flow_encodings_decoder(tvb_new_subset(tvb, offset, tlv_len, tlv_len), pinfo, tlv_tree);
3542 case DSx_DOWNLINK_FLOW:
3543 /* display Downlink Service Flow Encodings info */
3545 tlv_tree = add_protocol_subtree(&tlv_info, ett_dl_service_flow_decoder, tree, proto_wimax_utility_decoders, tvb, offset, tlv_len, "Downlink Service Flow Encodings (%u bytes)", tlv_len);
3546 /* decode and display the DL Service Flow Encodings */
3547 wimax_service_flow_encodings_decoder(tvb_new_subset(tvb,offset, tlv_len, tlv_len), pinfo, tlv_tree);
3549 case CURRENT_TX_POWER:
3550 tlv_tree = add_protocol_subtree(&tlv_info, ett_dl_service_flow_decoder, tree, proto_wimax_utility_decoders, tvb, offset, tlv_len, "Current Transmitted Power (%u byte(s))", tlv_len);
3551 value = tvb_get_guint8(tvb, offset);
3552 current_power = (gfloat)(value - 128) / 2;
3553 proto_tree_add_text(tlv_tree, tvb, offset, 1, "Current Transmitted Power: %.2f dBm (Value: 0x%x)", (gdouble)current_power, value);
3555 case MAC_VERSION_ENCODING:
3556 /* display MAC Version Encoding */
3558 tlv_tree = add_protocol_subtree(&tlv_info, ett_vendor_specific_info_decoder, tree, proto_wimax_utility_decoders, tvb, offset, tlv_len, "MAC Version Encoding (%u byte)", tlv_len);
3559 /* decode and display the MAC Version Encoding */
3560 proto_tree_add_item(tlv_tree, hf_common_tlv_mac_version, tvb, offset, tlv_len, FALSE);
3562 case HMAC_TUPLE: /* Table 348d */
3563 tlv_tree = add_protocol_subtree(&tlv_info, ett_vendor_specific_info_decoder, tree, proto_wimax_utility_decoders, tvb, offset, tlv_len, "HMAC Tuple (%u byte(s))", tlv_len);
3564 /* decode and display the HMAC Tuple */
3565 wimax_hmac_tuple_decoder(tlv_tree, tvb, offset, tlv_len);
3567 case CMAC_TUPLE: /* Table 348b */
3568 tlv_tree = add_protocol_subtree(&tlv_info, ett_vendor_specific_info_decoder, tree, proto_wimax_utility_decoders, tvb, offset, tlv_len, "HMAC Tuple (%u byte(s))", tlv_len);
3569 /* decode and display the CMAC Tuple */
3570 wimax_cmac_tuple_decoder(tlv_tree, tvb, offset, tlv_len);
3573 /* Back to calling routine to finish decoding. */
3574 return offset - tlv_value_offset; /* Ret amount decoded. */
3578 } /* end of while loop */