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 /* The following two variables save the Scheduling Service type for
81 the Grant Management subheader dissector and track whether or not
84 static guint scheduling_service_type = -1;
85 gint seen_a_service_type = 0;
87 /* The following two functions set and access the variables above */
88 guint get_service_type( void )
90 return scheduling_service_type;
93 void set_service_type( guint set_to )
95 if( seen_a_service_type == 0 ){
96 scheduling_service_type = set_to;
97 seen_a_service_type = 1;
101 /* Setup protocol subtree array */
104 &ett_wimax_service_flow_encodings,
105 &ett_wimax_cst_encoding_rules,
106 &ett_wimax_error_parameter_set,
107 &ett_wimax_hmac_tuple,
108 &ett_wimax_cmac_tuple,
109 &ett_wimax_short_hmac_tuple,
110 &ett_security_negotiation_parameters,
111 &ett_pkm_tlv_encoded_attributes_decoder,
112 &ett_sa_descriptor_decoder,
113 &ett_cryptographic_suite_list_decoder,
114 &ett_security_capabilities_decoder,
115 &ett_vendor_specific_info_decoder,
116 &ett_vendor_id_encoding_decoder,
117 &ett_ul_service_flow_decoder,
118 &ett_dl_service_flow_decoder,
121 static const value_string vals_mbs_service[] =
123 {0, "No available MBS"},
124 {1, "Single-BS-MBS"},
129 static const value_string vals_ul_grant_scheduling[] =
132 {1, "Undefined (BS implementation-dependent)"},
136 {5, "Extended rtPS"},
141 static const value_string vals_fixed_len_sdu[] =
143 {0, "Variable-length SDUs (default)"},
144 {1, "Fixed-length SDUs"},
148 static const value_string vals_arq_enable[] =
150 {0, "ARQ not requested/accepted"},
151 {1, "ARQ requested/accepted"},
154 static const value_string vals_arq_block_lifetime[] =
159 static const value_string vals_arq_sync_loss_timeout[] =
165 static const value_string vals_arq_deliver_in_order[] =
167 {0, "Order of delivery is not preserved"},
168 {1, "Order of delivery is preserved"},
171 static const value_string vals_arq_rx_purge_timeout[] =
177 static const value_string vals_fsn_size[] =
180 {1, "11-bit FSN (default)"},
184 static const value_string vals_sn_fb_enable[] =
186 {0, "Is disabled (default)"},
191 static const value_string vals_harq[] =
193 {0, "Non HARQ (default)"},
194 {1, "HARQ connection" },
198 static const value_string vals_cs_specification[] =
203 {3, "Packet, IEEE 802.3/Ethernet"},
204 {4, "Packet, IEEE 802.1Q VLAN"},
205 {5, "Packet, IPv4 over IEEE 802.3/Ethernet"},
206 {6, "Packet, IPv6 over IEEE 802.3/Ethernet"},
207 {7, "Packet, IPv4 over IEEE 802.1Q VLAN"},
208 {8, "Packet, IPv6 over IEEE 802.1Q VLAN"},
210 {10, "Packet, IEEE 802.3/Ethernet with ROCH header compression"},
211 {11, "Packet, IEEE 802.3/Ethernet with ECRTP header compression"},
212 {12, "Packet, IP2 with ROCH header compression"},
213 {13, "Packet, IP2 with ECRTP header compression"},
217 static const value_string vals_type_of_data_delivery_services[] =
219 {0, "Continuing grant service"},
220 {1, "Real time variable rate service"},
221 {2, "Non-real time variable rate service"},
222 {3, "Best-efforts service"},
223 {4, "Extended real-time variable rate service"},
227 static const value_string vals_paging_preference[] =
229 {0, "No paging generation"},
230 {1, "Paging generation"},
233 static const value_string vals_pdu_sn_ext_subheader[] =
235 {0, "No support for PDU SN in this connection (default)"},
236 {1, "PDU SN (short) extended Subheader"},
237 {2, "PDU SN (long) extended Subheader"},
241 static const value_string vals_cst_classifier_action[] =
243 {0, "DSC Add Classifier"},
244 {1, "DSC Replace Classifier"},
245 {2, "DSC Delete Classifier"},
249 static const value_string vals_cst_phs_dsc_action[] =
253 {2, "Delete PHS rule"},
254 {3, "Delete all PHS rules"},
258 static const value_string vals_verify[] =
265 static const value_string vals_atm_switching_encodings[] =
267 {0, "No switching methodology applied"},
273 static const value_string vals_cc[] =
277 {2, "Reject-unrecognized-configuration-setting"},
278 {3, "Reject-temporary / reject-resource"},
279 {4, "Reject-permanent / reject-admin"},
280 {5, "Reject-not-owner"},
281 {6, "Reject-service-flow-not-found"},
282 {7, "Reject-service-flow-exists"},
283 {8, "Reject-required-parameter-not-present"},
284 {9, "Reject-header-suppression"},
285 {10, "Reject-unknown-transaction-id"},
286 {11, "Reject-authentication-failure"},
287 {12, "Reject-add-aborted"},
288 {13, "Reject-exceeded-dynamic-service-limit"},
289 {14, "Reject-not-authorized-for-the-request-SAID"},
290 {15, "Reject-fail-to-establish-the-requested-SA"},
291 {16, "Reject-not-supported-parameter"},
292 {17, "Reject-not-supported-parameter-value"},
296 static const value_string vals_classification_action_rule[] =
299 {1, "Discarded packet"},
303 static const true_false_string tfs_supported =
309 static const true_false_string disabled_enabled =
315 static const true_false_string default_enabled =
321 static const value_string vals_pkm_attr_error_codes[] =
323 {0, "All (no information)"},
324 {1, "Auth Reject Auth Invalid (unauthorized SS)"},
325 {2, "Auth Reject, Key Reject (unauthorized SAID)"},
326 {3, "Auth Invalid (unsolicited)"},
327 {4, "Auth Invalid, TEK Invalid (invalid key sequence number)"},
328 {5, "Auth Invalid (message (key request) authorization failure)"},
329 {6, "Auth Reject (permanent authorization failure)"},
333 static const value_string vs_sa_type[] =
341 static const value_string va_key_push_modes[] =
343 {0, "GKEK update mode"},
344 {1, "GTEK update mode"},
348 static const value_string vals_pkm_version[] =
351 {1, "PKM (Initial standard release"},
355 static const value_string vs_success_reject[] =
362 static const value_string vs_sa_service_type[] =
364 {0, "Unicast service"},
365 {1, "Group multicast service"},
370 static const value_string vals_data_encryption_ids[] =
372 {0, "No data encryption"},
373 {1, "CBC-Mode, 56-bit DES"},
374 {2, "CCM-Mode, 128-bit AES"},
375 {3, "CBC-Mode, 128-bit AES"},
376 {128, "CTR-Mode, 128-bit AES for MBS with 8 bit ROC"},
380 static const value_string vals_data_authentication_ids[] =
382 {0, "No data authentication"},
383 {1, "CCM-Mode, 128-bit AES"},
387 static const value_string vals_tek_encryption_ids[] =
390 {1, "3-DES EDE with 128-bit key"},
391 {2, "RSA with 1024-bit key"},
392 {3, "ECB mode AES with 128-bit key"},
393 {3, "AES key wrap with 128-bit key"},
397 static const value_string vals_dcd_mac_version[] =
399 {1, "Conformance with IEEE Std 802.16-2001"},
400 {2, "Conformance with IEEE Std 802.16c-2002 and its predecessors"},
401 {3, "Conformance with IEEE Std 802.16a-2003 and its predecessors"},
402 {4, "Conformance with IEEE Std 802.16-2004"},
403 {5, "Conformance with IEEE Std 802.16-2004 and IEEE Std 802.16e-2005"},
409 static gint hf_sfe_unknown_type = -1;
410 static gint hf_sfe_sf_id = -1;
411 static gint hf_sfe_cid = -1;
412 static gint hf_sfe_service_class_name = -1;
413 static gint hf_sfe_mbs_service = -1;
414 static gint hf_sfe_qos_params_set = -1;
415 static gint hf_sfe_set_provisioned = -1;
416 static gint hf_sfe_set_admitted = -1;
417 static gint hf_sfe_set_active = -1;
418 static gint hf_sfe_set_rsvd = -1;
419 static gint hf_sfe_traffic_priority = -1;
420 static gint hf_sfe_max_str = -1;
421 static gint hf_sfe_max_traffic_burst = -1;
422 static gint hf_sfe_min_rtr = -1;
423 static gint hf_sfe_reserved_10 = -1;
424 static gint hf_sfe_ul_grant_scheduling = -1;
425 static gint hf_sfe_req_tx_policy = -1;
426 static gint hf_sfe_policy_broadcast_bwr = -1;
427 static gint hf_sfe_policy_multicast_bwr = -1;
428 static gint hf_sfe_policy_piggyback = -1;
429 static gint hf_sfe_policy_fragment = -1;
430 static gint hf_sfe_policy_headers = -1;
431 static gint hf_sfe_policy_packing = -1;
432 static gint hf_sfe_policy_crc = -1;
433 static gint hf_sfe_policy_rsvd1 = -1;
434 static gint hf_sfe_jitter = -1;
435 static gint hf_sfe_max_latency = -1;
436 static gint hf_sfe_fixed_len_sdu = -1;
437 static gint hf_sfe_sdu_size = -1;
438 static gint hf_sfe_target_said = -1;
439 static gint hf_sfe_cs_specification = -1;
440 static gint hf_sfe_type_of_data_delivery_services = -1;
441 static gint hf_sfe_sdu_inter_arrival_interval = -1;
442 static gint hf_sfe_time_base = -1;
443 static gint hf_sfe_paging_preference = -1;
444 static gint hf_sfe_mbs_zone_identifier_assignment = -1;
445 static gint hf_sfe_sn_feedback_enabled = -1;
446 static gint hf_sfe_harq_service_flows = -1;
447 static gint hf_sfe_harq_channel_mapping_index = -1;
448 static gint hf_sfe_fsn_size = -1;
449 static gint hf_sfe_unsolicited_grant_interval = -1;
450 static gint hf_sfe_unsolicited_polling_interval = -1;
451 static gint hf_sfe_harq_channel_mapping = -1;
452 static gint hf_sfe_global_service_class_name = -1;
453 static gint hf_sfe_reserved_36 = -1;
454 static gint hf_sfe_reserved_34 = -1;
456 static gint hf_sfe_arq_enable = -1;
457 static gint hf_sfe_arq_transmitter_delay = -1;
458 static gint hf_sfe_arq_receiver_delay = -1;
459 static gint hf_sfe_arq_block_lifetime = -1;
460 static gint hf_sfe_arq_sync_loss_timeout = -1;
461 static gint hf_sfe_arq_transmitter_delay_cor2 = -1;
462 static gint hf_sfe_arq_receiver_delay_cor2 = -1;
463 static gint hf_sfe_arq_block_lifetime_cor2 = -1;
464 static gint hf_sfe_arq_sync_loss_timeout_cor2 = -1;
465 static gint hf_sfe_arq_deliver_in_order = -1;
466 static gint hf_sfe_arq_rx_purge_timeout = -1;
467 static gint hf_sfe_arq_window_size = -1;
468 static gint hf_sfe_arq_block_size = -1;
469 static gint hf_sfe_arq_block_size_cor2 = -1;
470 static gint hf_sfe_arq_min_block_size = -1;
471 static gint hf_sfe_arq_max_block_size = -1;
473 static gint hf_sfe_cid_alloc_for_active_bs = -1;
474 static gint hf_sfe_cid_alloc_for_active_bs_cid = -1;
475 static gint hf_sfe_pdu_sn_ext_subheader_reorder = -1;
476 static gint hf_sfe_mbs_contents_ids = -1;
477 static gint hf_sfe_mbs_contents_ids_id = -1;
478 static gint hf_sfe_authorization_token = -1;
480 static gint hf_cst_classifier_dsc_action = -1;
481 static gint hf_cst_error_set_errored_param = -1;
482 static gint hf_cst_error_set_error_code = -1;
483 static gint hf_cst_error_set_error_msg = -1;
485 static gint hf_cst_pkt_class_rule = -1;
487 static gint hf_cst_pkt_class_rule_priority = -1;
488 static gint hf_cst_pkt_class_rule_range_mask = -1;
489 static gint hf_cst_pkt_class_rule_tos_low = -1;
490 static gint hf_cst_pkt_class_rule_tos_high = -1;
491 static gint hf_cst_pkt_class_rule_tos_mask = -1;
492 static gint hf_cst_pkt_class_rule_protocol = -1;
493 /*static gint hf_cst_pkt_class_rule_protocol_number = -1;*/
494 static gint hf_cst_pkt_class_rule_ip_masked_src_address = -1;
495 static gint hf_cst_pkt_class_rule_ip_masked_dest_address = -1;
496 static gint hf_cst_pkt_class_rule_src_ipv4 = -1;
497 static gint hf_cst_pkt_class_rule_dest_ipv4 = -1;
498 static gint hf_cst_pkt_class_rule_mask_ipv4 = -1;
499 static gint hf_cst_pkt_class_rule_src_ipv6 = -1;
500 static gint hf_cst_pkt_class_rule_dest_ipv6 = -1;
501 static gint hf_cst_pkt_class_rule_mask_ipv6 = -1;
502 static gint hf_cst_pkt_class_rule_prot_src_port_range = -1;
503 static gint hf_cst_pkt_class_rule_src_port_low = -1;
504 static gint hf_cst_pkt_class_rule_src_port_high = -1;
505 static gint hf_cst_pkt_class_rule_prot_dest_port_range = -1;
506 static gint hf_cst_pkt_class_rule_dest_port_low = -1;
507 static gint hf_cst_pkt_class_rule_dest_port_high = -1;
508 static gint hf_cst_pkt_class_rule_dest_mac_address = -1;
509 static gint hf_cst_pkt_class_rule_dest_mac = -1;
510 static gint hf_cst_pkt_class_rule_src_mac_address = -1;
511 static gint hf_cst_pkt_class_rule_src_mac = -1;
512 static gint hf_cst_pkt_class_rule_mask_mac = -1;
513 static gint hf_cst_pkt_class_rule_ethertype = -1;
514 static gint hf_cst_pkt_class_rule_etype = -1;
515 static gint hf_cst_pkt_class_rule_eprot1 = -1;
516 static gint hf_cst_pkt_class_rule_eprot2 = -1;
517 static gint hf_cst_pkt_class_rule_user_priority = -1;
518 static gint hf_cst_pkt_class_rule_pri_low = -1;
519 static gint hf_cst_pkt_class_rule_pri_high = -1;
520 static gint hf_cst_pkt_class_rule_vlan_id = -1;
521 static gint hf_cst_pkt_class_rule_vlan_id1 = -1;
522 static gint hf_cst_pkt_class_rule_vlan_id2 = -1;
523 static gint hf_cst_pkt_class_rule_phsi = -1;
524 static gint hf_cst_pkt_class_rule_index = -1;
525 static gint hf_cst_pkt_class_rule_ipv6_flow_label = -1;
526 static gint hf_cst_pkt_class_rule_vendor_spec = -1;
527 static gint hf_cst_pkt_class_rule_classifier_action_rule = -1;
528 static gint hf_cst_pkt_class_rule_classifier_action_rule_bit0 = -1;
529 static gint hf_cst_pkt_class_rule_classifier_action_rule_bit1 = -1;
531 static gint hf_cst_large_context_id = -1;
532 static gint hf_cst_short_format_context_id = -1;
534 static gint hf_cst_phs_dsc_action = -1;
535 static gint hf_cst_phs_rule = -1;
536 static gint hf_cst_phs_phsi = -1;
537 static gint hf_cst_phs_phsf = -1;
538 static gint hf_cst_phs_phsm = -1;
539 static gint hf_cst_phs_phss = -1;
540 static gint hf_cst_phs_phsv = -1;
541 static gint hf_cst_phs_vendor_spec = -1;
542 static gint hf_cst_invalid_tlv = -1;
544 static gint hf_csper_atm_switching_encoding = -1;
545 static gint hf_csper_atm_classifier = -1;
546 static gint hf_csper_atm_classifier_vpi = -1;
547 static gint hf_csper_atm_classifier_vci = -1;
548 static gint hf_csper_atm_classifier_id = -1;
549 /*static gint hf_csper_atm_classifier_dsc_action = -1;*/
550 static gint hf_csper_unknown_type = -1;
552 static gint hf_xmac_tuple_rsvd = -1;
553 static gint hf_xmac_tuple_key_seq_num = -1;
554 static gint hf_hmac_tuple_hmac_digest = -1;
555 static gint hf_packet_number_counter = -1;
556 static gint hf_cmac_tuple_cmac_value = -1;
557 static gint hf_cmac_tuple_bsid = -1;
561 #define SFE_QOS_PARAMS_SET_PROVISIONED_SET 0x01
562 #define SFE_QOS_PARAMS_SET_ADMITTED_SET 0x02
563 #define SFE_QOS_PARAMS_SET_ACTIVE_SET 0x04
564 #define SFE_QOS_PARAMS_SET_RESERVED 0xF8
566 #define SFE_REQ_TX_POLICY_BROADCAST_BWR 0x01
567 #define SFE_REQ_TX_POLICY_MULTICAST_BWR 0x02
568 #define SFE_REQ_TX_POLICY_PIGGYBACK 0x04
569 #define SFE_REQ_TX_POLICY_FRAGMENT_DATA 0x08
570 #define SFE_REQ_TX_POLICY_PAYLOAD_HEADER 0x10
571 #define SFE_REQ_TX_POLICY_PACKINGS 0x20
572 #define SFE_REQ_TX_POLICY_CRC 0x40
573 #define SFE_REQ_TX_POLICY_RESERVED 0x80
575 /* WiMax Service Flow Encodings display */
576 static hf_register_info hf_sfe[] =
578 { /* 1 Service Flow ID */
580 {"Service Flow ID", "wimax.sfe.sf_id", FT_UINT32, BASE_HEX, NULL, 0x0, "", HFILL}
584 {"CID", "wimax.sfe.cid", FT_UINT16, BASE_DEC, NULL, 0x0, "", HFILL}
586 { /* 3 Service Class Name */
587 &hf_sfe_service_class_name,
588 {"Service Class Name", "wimax.sfe.service_class_name", FT_STRING, BASE_NONE, NULL, 0x0, "", HFILL}
590 { /* 4 MBS Service */
592 {"MBS Service", "wimax.sfe.mbs_service", FT_UINT8, BASE_DEC, VALS(vals_mbs_service), 0x0, "", HFILL}
594 { /* 5 QoS Parameter Set Type */
595 &hf_sfe_qos_params_set,
596 {"QoS Parameter Set Type", "wimax.sfe.qos_params_set", FT_UINT8, BASE_HEX, NULL, 0x0, "", HFILL}
599 &hf_sfe_set_provisioned,
600 {"Provisioned Set", "wimax.sfe.qos_params_set.provisioned", FT_BOOLEAN, 8, NULL, SFE_QOS_PARAMS_SET_PROVISIONED_SET, "", HFILL}
603 &hf_sfe_set_admitted,
604 {"Admitted Set", "wimax.sfe.qos_params_set.admitted", FT_BOOLEAN, 8, NULL, SFE_QOS_PARAMS_SET_ADMITTED_SET, "", HFILL}
608 {"Active Set", "wimax.sfe.qos_params_set.active", FT_BOOLEAN, 8, NULL, SFE_QOS_PARAMS_SET_ACTIVE_SET, "", HFILL}
612 {"Reserved", "wimax.sfe.qos_params_set.rsvd", FT_UINT8, BASE_HEX, NULL, SFE_QOS_PARAMS_SET_RESERVED, "", HFILL}
614 { /* 6 Traffic Priority */
615 &hf_sfe_traffic_priority,
616 {"Traffic Priority", "wimax.sfe.traffic_priority", FT_UINT8, BASE_DEC, NULL, 0x0, "", HFILL}
618 { /* 7 Maximum Sustained Traffic Rate */
620 {"Maximum Sustained Traffic Rate", "wimax.sfe.msr", FT_UINT32, BASE_DEC, NULL, 0x0, "", HFILL}
622 { /* 8 Maximum Traffic Burst */
623 &hf_sfe_max_traffic_burst,
624 {"Maximum Traffic Burst", "wimax.sfe.max_traffic_burst", FT_UINT32, BASE_DEC, NULL, 0x0, "", HFILL}
626 { /* 9 Minimum Reserved Traffic Rate */
628 {"Minimum Reserved Traffic Rate", "wimax.sfe.mrr", FT_UINT32, BASE_DEC, NULL, 0x0, "", HFILL}
633 {"Reserved", "wimax.sfe.reserved_10", FT_UINT32, BASE_DEC, NULL, 0x0, "", HFILL}
636 { /* 10 reserved by 16E */
638 {"Minimum tolerable traffic rate", "wimax.sfe.mtr", FT_UINT32, BASE_HEX, NULL, 0x0, "", HFILL}
641 { /* 11 Service Flow Scheduling Type */
642 &hf_sfe_ul_grant_scheduling,
643 {"Uplink Grant Scheduling Type", "wimax.sfe.uplink_grant_scheduling", FT_UINT8, BASE_DEC, VALS(vals_ul_grant_scheduling), 0x0, "", HFILL}
645 { /* 12 Request/Transmission Policy */
646 &hf_sfe_req_tx_policy,
647 {"Request/Transmission Policy", "wimax.sfe.req_tx_policy", FT_UINT32, BASE_HEX, NULL, 0x0, "", HFILL}
650 &hf_sfe_policy_broadcast_bwr,
651 {"The Service Flow Shall Not Use Broadcast Bandwidth Request Opportunities", "wimax.sfe.policy.broadcast_bwr", FT_BOOLEAN, 8, NULL, SFE_REQ_TX_POLICY_BROADCAST_BWR, "", HFILL}
654 &hf_sfe_policy_multicast_bwr,
655 {"The Service Flow Shall Not Use Multicast Bandwidth Request Opportunities", "wimax.sfe.policy.bit1", FT_BOOLEAN, 8, NULL, SFE_REQ_TX_POLICY_MULTICAST_BWR, "", HFILL}
658 &hf_sfe_policy_piggyback,
659 {"The Service Flow Shall Not Piggyback Requests With Data", "wimax.sfe.policy.piggyback", FT_BOOLEAN, 8, NULL, SFE_REQ_TX_POLICY_PIGGYBACK, "", HFILL}
662 &hf_sfe_policy_fragment,
663 {"The Service Flow Shall Not Fragment Data", "wimax.sfe.policy.fragment", FT_BOOLEAN, 8, NULL, SFE_REQ_TX_POLICY_FRAGMENT_DATA, "", HFILL}
666 &hf_sfe_policy_headers,
667 {"The Service Flow Shall Not Suppress Payload Headers", "wimax.sfe.policy.headers", FT_BOOLEAN, 8, NULL, SFE_REQ_TX_POLICY_PAYLOAD_HEADER, "", HFILL}
670 &hf_sfe_policy_packing,
671 {"The Service Flow Shall Not Pack Multiple SDUs (Or Fragments) Into Single MAC PDUs", "wimax.sfe.policy.packing", FT_BOOLEAN, 8, NULL, SFE_REQ_TX_POLICY_PACKINGS, "", HFILL}
675 {"The Service Flow Shall Not Include CRC In The MAC PDU", "wimax.sfe.policy.crc", FT_BOOLEAN, 8, NULL, SFE_REQ_TX_POLICY_CRC, "", HFILL}
678 &hf_sfe_policy_rsvd1,
679 {"Reserved", "wimax.sfe.policy.rsvd1", FT_UINT8, BASE_HEX, NULL, SFE_REQ_TX_POLICY_RESERVED, "", HFILL}
681 { /* 13 Tolerated Jitter */
683 {"Tolerated Jitter", "wimax.sfe.jitter", FT_UINT32, BASE_DEC, NULL, 0x0, "", HFILL}
685 { /* 14 Maximum Latency */
687 {"Maximum Latency", "wimax.sfe.max_latency", FT_UINT32, BASE_DEC, NULL, 0x0, "", HFILL}
689 { /* 15 Fixed/Variable Length SDU */
690 &hf_sfe_fixed_len_sdu,
691 {"Fixed/Variable Length SDU", "wimax.sfe.fixed_len_sdu", FT_UINT8, BASE_DEC, VALS(vals_fixed_len_sdu), 0x0, "", HFILL}
695 {"SDU Size", "wimax.sfe.sdu_size", FT_UINT8, BASE_DEC, NULL, 0x0, "", HFILL}
697 { /* 17 SAID Onto Which SF Is Mapped */
699 {"SAID Onto Which SF Is Mapped", "wimax.sfe.target_said", FT_UINT16, BASE_HEX, NULL, 0x0, "", HFILL}
701 { /* 18 ARQ Enable */
703 {"ARQ Enable", "wimax.arq.enable", FT_UINT8, BASE_DEC, VALS(vals_arq_enable), 0x0, "", HFILL}
705 { /* 19 ARQ Window Size */
706 &hf_sfe_arq_window_size,
707 {"ARQ Window Size", "wimax.arq.window_size", FT_UINT16, BASE_DEC, NULL, 0x0, "", HFILL}
709 { /* 20 ARQ Transmitter Delay */
710 &hf_sfe_arq_transmitter_delay,
711 {"ARQ Transmitter Delay (10us granularity)", "wimax.arq.transmitter_delay", FT_UINT16, BASE_DEC, NULL, 0x0, "", HFILL}
713 { /* 21 ARQ Receiver Delay */
714 &hf_sfe_arq_receiver_delay,
715 {"ARQ Receiver Delay (10us granularity)", "wimax.arq.receiver_delay", FT_UINT16, BASE_DEC, NULL, 0x0, "", HFILL}
717 { /* 22 ARQ Block Lifetime */
718 &hf_sfe_arq_block_lifetime,
719 {"ARQ Block Lifetime (10us granularity)", "wimax.arq.block_lifetime", FT_UINT16, BASE_DEC, NULL, 0x0, "", HFILL}
721 { /* 23 ARQ Sync Loss Timeout */
722 &hf_sfe_arq_sync_loss_timeout,
723 {"ARQ Sync Loss Timeout (10us granularity)", "wimax.arq.sync_loss_timeout", FT_UINT16, BASE_DEC, VALS(&vals_arq_sync_loss_timeout), 0x0, "", HFILL}
725 { /* 20 ARQ Transmitter Delay */
726 &hf_sfe_arq_transmitter_delay_cor2,
727 {"ARQ Transmitter Delay (100us granularity)", "wimax.arq.transmitter_delay", FT_UINT16, BASE_DEC, NULL, 0x0, "", HFILL}
729 { /* 21 ARQ Receiver Delay */
730 &hf_sfe_arq_receiver_delay_cor2,
731 {"ARQ Receiver Delay (100us granularity)", "wimax.arq.receiver_delay", FT_UINT16, BASE_DEC, NULL, 0x0, "", HFILL}
733 { /* 22 ARQ Block Lifetime */
734 &hf_sfe_arq_block_lifetime_cor2,
735 {"ARQ Block Lifetime (100us granularity)", "wimax.arq.block_lifetime", FT_UINT16, BASE_DEC, NULL, 0x0, "", HFILL}
737 { /* 23 ARQ Sync Loss Timeout */
738 &hf_sfe_arq_sync_loss_timeout_cor2,
739 {"ARQ Sync Loss Timeout (100us granularity)", "wimax.arq.sync_loss_timeout", FT_UINT16, BASE_DEC, VALS(&vals_arq_sync_loss_timeout), 0x0, "", HFILL}
741 { /* 24 ARQ Deliver In Order */
742 &hf_sfe_arq_deliver_in_order,
743 {"ARQ Deliver In Order", "wimax.arq.deliver_in_order", FT_UINT8, BASE_DEC, VALS(&vals_arq_deliver_in_order), 0x0, "", HFILL}
745 { /* 25 ARQ Purge Timeout */
746 &hf_sfe_arq_rx_purge_timeout,
747 {"ARQ RX Purge Timeout (100us granularity)", "wimax.arq.rx_purge_timeout", FT_UINT16, BASE_DEC, VALS(&vals_arq_rx_purge_timeout), 0x0, "", HFILL}
749 { /* 26 ARQ Block Size */
750 &hf_sfe_arq_block_size,
751 {"ARQ Block Size", "wimax.arq.block_size", FT_UINT16, BASE_DEC, NULL, 0x0, "", HFILL}
753 { /* 26 ARQ Block Size */
754 &hf_sfe_arq_block_size_cor2,
755 {"ARQ Block Size", "wimax.arq.block_size", FT_UINT8, BASE_HEX, NULL, 0x0, "", HFILL}
757 { /* 26 ARQ Block Size for Corrigendum 2 */
758 &hf_sfe_arq_min_block_size,
759 {"ARQ Minumum Block Size", "wimax.arq.min_block_size", FT_UINT8, BASE_DEC, NULL, 0x0F, "", HFILL}
761 { /* 26 ARQ Block Size for Corrigendum 2 */
762 &hf_sfe_arq_max_block_size,
763 {"ARQ Maximum Block Size", "wimax.arq.max_block_size", FT_UINT8, BASE_DEC, NULL, 0xF0, "", HFILL}
766 { /* 28 CS Specification */
767 &hf_sfe_cs_specification,
768 {"CS Specification", "wimax.sfe.cs_specification", FT_UINT8, BASE_DEC, VALS(vals_cs_specification), 0x0, "", HFILL}
770 { /* 29 Type of Data Delivery Services */
771 &hf_sfe_type_of_data_delivery_services,
772 {"Type of Data Delivery Services", "wimax.sfe.type_of_data_delivery_services", FT_UINT8, BASE_DEC, VALS(vals_type_of_data_delivery_services), 0x0, "", HFILL}
774 { /* 30 SDU Inter-Arrival Interval */
775 &hf_sfe_sdu_inter_arrival_interval,
776 {"SDU Inter-Arrival Interval (in the resolution of 0.5 ms)", "wimax.sfe.sdu_inter_arrival_interval", FT_UINT16, BASE_DEC, NULL, 0x0, "", HFILL}
780 {"Time Base", "wimax.sfe.time_base", FT_UINT16, BASE_DEC, NULL, 0x0, "", HFILL}
782 { /* 32 Paging Preference */
783 &hf_sfe_paging_preference,
784 {"Paging Preference", "wimax.sfe.paging_preference", FT_UINT8, BASE_DEC, VALS(vals_paging_preference), 0x0, "", HFILL}
786 { /* 33 MBS Zone Identifier */
787 &hf_sfe_mbs_zone_identifier_assignment,
788 {"MBS Zone Identifier", "wimax.sfe.mbs_zone_identifier", FT_BYTES, BASE_HEX, NULL, 0x0, "", HFILL}
790 { /* 34 Traffic Indication Preference */
792 {"Reserved", "wimax.sfe.reserved_34", FT_UINT8, BASE_DEC, NULL /*VALS(vals_traffic_indication_preference)*/, 0x0, "", HFILL}
794 { /* 35 Global Service Class Name */
795 &hf_sfe_global_service_class_name,
796 {"Global Service Class Name", "wimax.sfe.global_service_class_name", FT_STRING, BASE_NONE, NULL, 0x0, "", HFILL}
798 /* 36 reserved by 16E */
802 {"Reserved", "wimax.sfe.reserved_36", FT_UINT8, BASE_DEC, NULL, 0x0, "", HFILL}
804 { /* 37 SN Feedback Enable */
805 &hf_sfe_sn_feedback_enabled,
806 {"SN Feedback", "wimax.sfe.sn_feedback_enabled", FT_UINT8, BASE_DEC, VALS(vals_sn_fb_enable), 0x0, "", HFILL}
810 {"FSN Size", "wimax.sfe.fsn_size", FT_UINT8, BASE_DEC, VALS(vals_fsn_size), 0x0, "", HFILL}
812 { /* 39 CID allocation for Active BSs */
813 &hf_sfe_cid_alloc_for_active_bs,
814 {"CID Allocation For Active BSs", "wimax.sfe.cid_alloc_for_active_bs", FT_BYTES, BASE_HEX, NULL, 0x0, "", HFILL}
817 &hf_sfe_cid_alloc_for_active_bs_cid,
818 {"CID", "wimax.sfe.cid_alloc_for_active_bs_cid", FT_UINT16, BASE_DEC, NULL, 0x0, "", HFILL}
820 { /* 40 Unsolicited Grant Interval */
821 &hf_sfe_unsolicited_grant_interval,
822 {"Unsolicited Grant Interval", "wimax.sfe.unsolicited_grant_interval", FT_UINT16, BASE_DEC, NULL, 0x0, "", HFILL}
824 { /* 41 Unsolicited Polling Interval */
825 &hf_sfe_unsolicited_polling_interval,
826 {"Unsolicited Polling Interval", "wimax.sfe.unsolicited_polling_interval", FT_UINT16, BASE_DEC, NULL, 0x0, "", HFILL}
828 { /* 42 PDU SN extended subheader for HARQ reordering */
829 &hf_sfe_pdu_sn_ext_subheader_reorder,
830 {"PDU SN Extended Subheader For HARQ Reordering", "wimax.sfe.pdu_sn_ext_subheader_reorder", FT_UINT8, BASE_DEC, VALS(vals_pdu_sn_ext_subheader), 0x0, "", HFILL}
832 { /* 43 MBS contents ID */
833 &hf_sfe_mbs_contents_ids,
834 {"MBS contents IDs", "wimax.sfe.mbs_contents_ids", FT_BYTES, BASE_HEX, NULL, 0x0, "", HFILL}
837 &hf_sfe_mbs_contents_ids_id,
838 {"MBS Contents ID", "wimax.sfe.mbs_contents_ids_id", FT_UINT16, BASE_DEC, NULL, 0x0, "", HFILL}
840 { /* 44 HARQ Service Flows */
841 &hf_sfe_harq_service_flows,
842 {"HARQ Service Flows", "wimax.sfe.harq_service_flows", FT_UINT8, BASE_DEC, VALS(vals_harq), 0x0, "", HFILL}
844 { /* 45 Authorization Token */
845 &hf_sfe_authorization_token,
846 {"Authorization Token", "wimax.sfe.authorization_token", FT_BYTES, BASE_HEX, NULL, 0x0, "", HFILL}
848 { /* 46 HARQ Channel Mapping */
849 &hf_sfe_harq_channel_mapping,
850 {"HARQ Channel Mapping", "wimax.sfe.harq_channel_mapping", FT_BYTES, BASE_HEX, NULL, 0x0, "", HFILL}
852 { /* 46.1 HARQ Channel Index*/
853 &hf_sfe_harq_channel_mapping_index,
854 {"HARQ Channel Index", "wimax.sfe.harq_channel_mapping.index", FT_UINT8, BASE_DEC, NULL, 0x0, "", HFILL}
857 { /* unknown SFE types */
858 &hf_sfe_unknown_type,
859 {"Unknown SFE TLV type", "wimax.sfe.unknown_type", FT_BYTES, BASE_HEX, NULL, 0x0, "", HFILL}
864 /* 11.13.19.3.4.17 */
865 #define CST_PKT_CLASS_RULE_CLASSIFIER_ACTION_RULE_BIT0 0x80
866 #define CST_PKT_CLASS_RULE_CLASSIFIER_ACTION_RULE_RSV 0x7F
868 /* WiMax Convergence Service Parameter Encoding Rules display */
869 static hf_register_info hf_csper[] =
870 { /* 99 - 111 CS parameter encoding rules */
871 { /* Classifier DSC Action */
872 &hf_cst_classifier_dsc_action,
873 {"Classifier DSC Action", "wimax.cst.classifier_action", FT_UINT8, BASE_DEC, VALS(vals_cst_classifier_action), 0x0, "", HFILL}
875 { /* Errored Parameter */
876 &hf_cst_error_set_errored_param,
877 {"Errored Parameter", "wimax.cst.error_set.errored_param", FT_BYTES, BASE_HEX, NULL, 0x0, "", HFILL}
880 &hf_cst_error_set_error_code,
881 {"Error Code", "wimax.cst.error_set.error_code", FT_UINT8, BASE_HEX, VALS(vals_cc), 0x0, "", HFILL}
883 { /* Error Message */
884 &hf_cst_error_set_error_msg,
885 {"Error Message", "wimax.cst.error_set.error_msg", FT_STRINGZ, BASE_NONE, NULL, 0x0, "", HFILL}
887 { /* Packet Classification Rule */
888 &hf_cst_pkt_class_rule,
889 {"Packet Classification Rule", "wimax.cst.pkt_class_rule", FT_BYTES, BASE_HEX, NULL, 0x0, "", HFILL}
891 { /* Classification Rule Priority */
892 &hf_cst_pkt_class_rule_priority,
893 {"Classification Rule Priority", "wimax.cst.pkt_class_rule.priority", FT_UINT8, BASE_DEC, NULL, 0x0, "", HFILL}
895 { /* ToS/Differentiated Services Codepoint (DSCP) Range And Mask */
896 &hf_cst_pkt_class_rule_range_mask,
897 {"ToS/Differentiated Services Codepoint (DSCP) Range And Mask", "wimax.cst.pkt_class_rule.range_mask", FT_BYTES, BASE_HEX, NULL, 0x0, "", HFILL}
900 &hf_cst_pkt_class_rule_tos_low,
901 {"ToS-Low", "wimax.cst.pkt_class_rule.tos-low", FT_UINT8, BASE_HEX, NULL, 0x0, "", HFILL}
904 &hf_cst_pkt_class_rule_tos_high,
905 {"ToS-High", "wimax.cst.pkt_class_rule.tos-high", FT_UINT8, BASE_HEX, NULL, 0x0, "", HFILL}
908 &hf_cst_pkt_class_rule_tos_mask,
909 {"ToS-Mask", "wimax.cst.pkt_class_rule.tos-mask", FT_UINT8, BASE_HEX, NULL, 0x0, "", HFILL}
912 &hf_cst_pkt_class_rule_protocol,
913 {"Protocol", "wimax.cst.pkt_class_rule.protocol", FT_UINT8, BASE_HEX, NULL, 0x0, "", HFILL}
915 #if 0 /* Removed by the changes of 802.16E 2005 */
917 &hf_cst_pkt_class_rule_protocol,
918 {"Protocol", "wimax.cst.pkt_class_rule.protocol", FT_BYTES, BASE_HEX, NULL, 0x0, "", HFILL}
920 { /* Protocol Number */
921 &hf_cst_pkt_class_rule_protocol_number,
922 {"Protocol Number", "wimax.cst.pkt_class_rule.protocol.number", FT_UINT8, BASE_DEC, NULL, 0x0, "", HFILL}
925 { /* IP Masked Source Address */
926 &hf_cst_pkt_class_rule_ip_masked_src_address,
927 {"IP Masked Source Address", "wimax.cst.pkt_class_rule.ip_masked_src_address", FT_BYTES, BASE_HEX, NULL, 0x0, "", HFILL}
929 { /* IP Masked Destination Address */
930 &hf_cst_pkt_class_rule_ip_masked_dest_address,
931 {"IP Masked Destination Address", "wimax.cst.pkt_class_rule.ip_masked_dest_address", FT_BYTES, BASE_HEX, NULL, 0x0, "", HFILL}
933 { /* IPv4 Source Address */
934 &hf_cst_pkt_class_rule_src_ipv4,
935 {"IPv4 Source Address", "wimax.cst.pkt_class_rule.src_ipv4", FT_IPv4, BASE_NONE, NULL, 0x0, "", HFILL}
937 { /* IPv4 Destination Address */
938 &hf_cst_pkt_class_rule_dest_ipv4,
939 {"IPv4 Destination Address", "wimax.cst.pkt_class_rule.dst_ipv4", FT_IPv4, BASE_NONE, NULL, 0x0, "", HFILL}
942 &hf_cst_pkt_class_rule_mask_ipv4,
943 {"IPv4 Mask", "wimax.cst.pkt_class_rule.mask_ipv4", FT_IPv4, BASE_NONE, NULL, 0x0, "", HFILL}
945 { /* IPv6 Source Address */
946 &hf_cst_pkt_class_rule_src_ipv6,
947 {"IPv6 Source Address", "wimax.cst.pkt_class_rule.src_ipv6", FT_IPv6, BASE_NONE, NULL, 0x0, "", HFILL}
949 { /* IPv6 Destination Address */
950 &hf_cst_pkt_class_rule_dest_ipv6,
951 {"IPv6 Destination Address", "wimax.cst.pkt_class_rule.dst_ipv6", FT_IPv6, BASE_NONE, NULL, 0x0, "", HFILL}
954 &hf_cst_pkt_class_rule_mask_ipv6,
955 {"IPv6 Mask", "wimax.cst.pkt_class_rule.mask_ipv6", FT_IPv6, BASE_NONE, NULL, 0x0, "", HFILL}
957 { /* Protocol Source Port Range */
958 &hf_cst_pkt_class_rule_prot_src_port_range,
959 {"Protocol Source Port Range", "wimax.cst.pkt_class_rule.prot_src_port_range", FT_BYTES, BASE_HEX, NULL, 0x0, "", HFILL}
962 &hf_cst_pkt_class_rule_src_port_low,
963 {"Src-Port Low", "wimax.cst.pkt_class_rule.src_port_low", FT_UINT16, BASE_DEC, NULL, 0x0, "", HFILL}
965 { /* Src-Port High */
966 &hf_cst_pkt_class_rule_src_port_high,
967 {"Src-Port High", "wimax.cst.pkt_class_rule.src_port_high", FT_UINT16, BASE_DEC, NULL, 0x0, "", HFILL}
969 { /* Protocol Destination Port Range */
970 &hf_cst_pkt_class_rule_prot_dest_port_range,
971 {"Protocol Destination Port Range", "wimax.cst.pkt_class_rule.prot_dest_port_range", FT_BYTES, BASE_HEX, NULL, 0x0, "", HFILL}
974 &hf_cst_pkt_class_rule_dest_port_low,
975 {"Dst-Port Low", "wimax.cst.pkt_class_rule.dst_port_low", FT_UINT16, BASE_DEC, NULL, 0x0, "", HFILL}
977 { /* Dst-Port High */
978 &hf_cst_pkt_class_rule_dest_port_high,
979 {"Dst-Port High", "wimax.cst.pkt_class_rule.dst_port_high", FT_UINT16, BASE_DEC, NULL, 0x0, "", HFILL}
981 { /* 802.3/Ethernet Destination MAC Address */
982 &hf_cst_pkt_class_rule_dest_mac_address,
983 {"802.3/Ethernet Destination MAC Address", "wimax.cst.pkt_class_rule.dest_mac_address", FT_BYTES, BASE_HEX, NULL, 0x0, "", HFILL}
985 { /* Destination MAC Address */
986 &hf_cst_pkt_class_rule_dest_mac,
987 {"Destination MAC Address", "wimax.cst.pkt_class_rule.dst_mac", FT_ETHER, BASE_NONE, NULL, 0x0, "", HFILL}
989 { /* 802.3/Ethernet Source MAC Address */
990 &hf_cst_pkt_class_rule_src_mac_address,
991 {"802.3/Ethernet Source MAC Address", "wimax.cst.pkt_class_rule.src_mac_address", FT_BYTES, BASE_HEX, NULL, 0x0, "", HFILL}
993 { /* Source MAC Address */
994 &hf_cst_pkt_class_rule_src_mac,
995 {"Source MAC Address", "wimax.cst.pkt_class_rule.src_mac", FT_ETHER, BASE_NONE, NULL, 0x0, "", HFILL}
997 { /* MAC Address Mask */
998 &hf_cst_pkt_class_rule_mask_mac,
999 {"MAC Address Mask", "wimax.cst.pkt_class_rule.mask_mac", FT_ETHER, BASE_NONE, NULL, 0x0, "", HFILL}
1001 { /* Ethertype/IEEE Std 802.2-1998 SAP */
1002 &hf_cst_pkt_class_rule_ethertype,
1003 {"Ethertype/IEEE Std 802.2-1998 SAP", "wimax.cst.pkt_class_rule.ethertype", FT_BYTES, BASE_HEX, NULL, 0x0, "", HFILL}
1006 &hf_cst_pkt_class_rule_etype,
1007 {"Ethertype", "wimax.cst.pkt_class_rule.ethertype", FT_UINT8, BASE_DEC, NULL, 0x0, "", HFILL}
1010 &hf_cst_pkt_class_rule_eprot1,
1011 {"Eprot1", "wimax.cst.pkt_class_rule.eprot1", FT_UINT8, BASE_HEX, NULL, 0x0, "", HFILL}
1014 &hf_cst_pkt_class_rule_eprot2,
1015 {"Eprot2", "wimax.cst.pkt_class_rule.eprot2", FT_UINT8, BASE_HEX, NULL, 0x0, "", HFILL}
1017 { /* IEEE Std 802.1D-1998 User_Priority */
1018 &hf_cst_pkt_class_rule_user_priority,
1019 {"IEEE Std 802.1D-1998 User_Priority", "wimax.cst.pkt_class_rule.user_priority", FT_BYTES, BASE_HEX, NULL, 0x0, "", HFILL}
1022 &hf_cst_pkt_class_rule_pri_low,
1023 {"Pri-Low", "wimax.cst.pkt_class_rule.pri-low", FT_UINT8, BASE_DEC, NULL, 0x0, "", HFILL}
1026 &hf_cst_pkt_class_rule_pri_high,
1027 {"Pri-High", "wimax.cst.pkt_class_rule.pri-high", FT_UINT8, BASE_DEC, NULL, 0x0, "", HFILL}
1029 { /* IEEE Std 802.1Q-1998 VLAN_ID */
1030 &hf_cst_pkt_class_rule_vlan_id,
1031 {"IEEE Std 802.1Q-1998 VLAN_ID", "wimax.cst.pkt_class_rule.vlan_id", FT_BYTES, BASE_HEX, NULL, 0x0, "", HFILL}
1034 &hf_cst_pkt_class_rule_vlan_id1,
1035 {"Vlan_Id1", "wimax.cst.pkt_class_rule.vlan_id1", FT_UINT8, BASE_HEX, NULL, 0x0, "", HFILL}
1038 &hf_cst_pkt_class_rule_vlan_id2,
1039 {"Vlan_Id2", "wimax.cst.pkt_class_rule.vlan_id2", FT_UINT8, BASE_HEX, NULL, 0x0, "", HFILL}
1041 { /* Associated PHSI */
1042 &hf_cst_pkt_class_rule_phsi,
1043 {"Associated PHSI", "wimax.cst.pkt_class_rule.phsi", FT_UINT8, BASE_DEC, NULL, 0x0, "", HFILL}
1045 { /* Packet Classifier Rule Index */
1046 &hf_cst_pkt_class_rule_index,
1047 {"Packet Classifier Rule Index (PCRI)", "wimax.cst.pkt_class_rule.index", FT_UINT16, BASE_DEC, NULL, 0x0, "", HFILL}
1049 { /* Large Context ID for ROHC/ECRTP Compressed Packet or ROHC Feedback Packet */
1050 &hf_cst_large_context_id,
1051 {"Large Context ID", "wimax.cst.large_context_id", FT_UINT16, BASE_DEC, NULL, 0x0, "", HFILL}
1053 { /* Short-Format Context ID for ROHC/ECRTP Compressed Packet or ROHC Feedback Packet */
1054 &hf_cst_short_format_context_id,
1055 {"Short-Format Context ID", "wimax.cst.short_format_context_id", FT_UINT16, BASE_DEC, NULL, 0x0, "", HFILL}
1057 { /* Vendor-Specific Classifier Parameters */
1058 &hf_cst_pkt_class_rule_vendor_spec,
1059 {"Vendor-Specific Classifier Parameters", "wimax.cst.pkt_class_rule.vendor_spec", FT_BYTES, BASE_HEX, NULL, 0x0, "", HFILL}
1061 { /* Classifier Action Rule */
1062 &hf_cst_pkt_class_rule_classifier_action_rule,
1063 {"Classifier Action Rule", "wimax.cst.pkt_class_rule.classifier.action.rule", FT_UINT8, BASE_HEX, NULL, 0x0, "", HFILL}
1066 &hf_cst_pkt_class_rule_classifier_action_rule_bit0,
1067 {"Bit #0", "wimax.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}
1070 &hf_cst_pkt_class_rule_classifier_action_rule_bit1,
1071 {"Reserved", "wimax.cst.pkt_class_rule.classifier.action.rule.reserved", FT_UINT8, BASE_HEX, NULL, CST_PKT_CLASS_RULE_CLASSIFIER_ACTION_RULE_RSV, "", HFILL}
1073 { /* PHS DSC action */
1074 &hf_cst_phs_dsc_action,
1075 {"PHS DSC action", "wimax.cst.phs_dsc_action", FT_UINT8, BASE_DEC, VALS(vals_cst_phs_dsc_action), 0x0, "", HFILL}
1079 {"PHS Rule", "wimax.cst.phs_rule", FT_BYTES, BASE_HEX, NULL, 0x0, "", HFILL}
1083 {"PHSI", "wimax.cst.phs_rule.phsi", FT_UINT8, BASE_DEC, NULL, 0x0, "", HFILL}
1087 {"PHSF", "wimax.cst.phs_rule.phsf", FT_BYTES, BASE_HEX, NULL, 0x0, "", HFILL}
1091 {"PHSM (bit x: 0-don't suppress the (x+1) byte; 1-suppress the (x+1) byte)", "wimax.cst.phs_rule.phsm", FT_BYTES, BASE_HEX, NULL, 0x0, "", HFILL}
1095 {"PHSS", "wimax.cst.phs_rule.phss", FT_UINT8, BASE_DEC, NULL, 0x0, "", HFILL}
1099 {"PHSV", "wimax.cst.phs_rule.phsv", FT_UINT8, BASE_DEC, VALS(vals_verify), 0x0, "", HFILL}
1101 { /* PHS Rule 143 */
1102 &hf_cst_phs_vendor_spec,
1103 {"Vendor-Specific PHS Parameters", "wimax.cst.phs.vendor_spec", FT_BYTES, BASE_HEX, NULL, 0x0, "", HFILL}
1105 { /* IPv6 Flow Label */
1106 &hf_cst_pkt_class_rule_ipv6_flow_label,
1107 {"IPv6 Flow Label", "wimax.cst.pkt_class_rule.ipv6_flow_label", FT_UINT24, BASE_HEX, NULL, 0x0, "", HFILL}
1109 { /* ATM Switching Encoding */
1110 &hf_csper_atm_switching_encoding,
1111 {"ATM Switching Encoding", "wimax.csper.atm_switching_encoding", FT_UINT8, BASE_DEC, VALS(vals_atm_switching_encodings), 0x0, "", HFILL}
1113 { /* ATM Classifier TLV */
1114 &hf_csper_atm_classifier,
1115 {"ATM Classifier TLV", "wimax.csper.atm_classifier", FT_BYTES, BASE_HEX, NULL, 0x0, "", HFILL}
1117 { /* ATM VPI Classifier */
1118 &hf_csper_atm_classifier_vpi,
1119 {"VPI Classifier", "wimax.csper.atm_classifier_vpi", FT_UINT16, BASE_HEX, NULL, 0x0, "", HFILL}
1121 { /* ATM VCI Classifier */
1122 &hf_csper_atm_classifier_vci,
1123 {"VCI Classifier", "wimax.csper.atm_classifier_vci", FT_UINT16, BASE_HEX, NULL, 0x0, "", HFILL}
1125 { /* ATM Classifier ID */
1126 &hf_csper_atm_classifier_id,
1127 {"Classifier ID", "wimax.csper.atm_classifier_tlv", FT_UINT16, BASE_DEC, NULL, 0x0, "", HFILL}
1130 { /* unknown CSPER types */
1131 &hf_csper_unknown_type,
1132 {"Unknown CSPER TLV type", "wimax.csper.unknown_type", FT_BYTES, BASE_HEX, NULL, 0x0, "", HFILL}
1135 &hf_cst_invalid_tlv,
1136 {"Invalid TLV", "wimax.cst.invalid_tlv", FT_BYTES, BASE_HEX, NULL, 0x0, "", HFILL}
1141 /* 11.1.2 (table 348) */
1142 #define XMAC_TUPLE_RESERVED 0xF0
1143 #define XMAC_TUPLE_KEY_SEQ_NUM 0x0F
1145 /* WiMax HMAC/CMAC/Short-HMAC Tuples display */
1146 static hf_register_info hf_xmac[] =
1149 &hf_xmac_tuple_rsvd,
1150 {"Reserved", "wimax.xmac_tuple.reserved", FT_UINT8, BASE_HEX, NULL, XMAC_TUPLE_RESERVED, "", HFILL}
1153 &hf_xmac_tuple_key_seq_num,
1154 {"Key Sequence Number", "wimax.xmac_tuple.key_sn", FT_UINT8, BASE_DEC, NULL, XMAC_TUPLE_KEY_SEQ_NUM, "", HFILL}
1157 &hf_hmac_tuple_hmac_digest,
1158 {"HMAC Digest", "wimax.xmac_tuple.hmac_digest", FT_BYTES, BASE_HEX, NULL, 0x0, "", HFILL}
1161 &hf_cmac_tuple_bsid,
1162 {"BSID", "wimax.cmac_tuple.bsid", FT_ETHER, BASE_HEX, NULL, 0x0, "", HFILL}
1165 &hf_cmac_tuple_cmac_value,
1166 {"CMAC Value", "wimax.cmac_tuple.cmac.value", FT_BYTES, BASE_HEX, NULL, 0x0, "", HFILL}
1169 &hf_packet_number_counter,
1170 {"Packet Number Counter", "wimax.xmac_tuple.packet_number_count", FT_UINT32, BASE_DEC, NULL, 0x0, "", HFILL}
1174 /* WiMax Security Negotiation Parameters display */
1175 static gint hf_snp_pkm_version_support = -1;
1176 static gint hf_snp_pkm_version_support_bit0 = -1;
1177 static gint hf_snp_pkm_version_support_bit1 = -1;
1178 static gint hf_snp_pkm_version_support_reserved = -1;
1179 static gint hf_snp_auth_policy_support = -1;
1180 static gint hf_snp_auth_policy_support_bit0 = -1;
1181 static gint hf_snp_auth_policy_support_bit1 = -1;
1182 static gint hf_snp_auth_policy_support_bit2 = -1;
1183 static gint hf_snp_auth_policy_support_bit3 = -1;
1184 static gint hf_snp_auth_policy_support_bit4 = -1;
1185 static gint hf_snp_auth_policy_support_bit5 = -1;
1186 static gint hf_snp_auth_policy_support_bit6 = -1;
1187 static gint hf_snp_auth_policy_support_bit7 = -1;
1188 static gint hf_snp_mac_mode = -1;
1189 static gint hf_snp_mac_mode_bit0 = -1;
1190 static gint hf_snp_mac_mode_bit1 = -1;
1191 static gint hf_snp_mac_mode_bit1_rsvd = -1;
1192 static gint hf_snp_mac_mode_bit2 = -1;
1193 static gint hf_snp_mac_mode_bit3 = -1;
1194 static gint hf_snp_mac_mode_bit4 = -1;
1195 static gint hf_snp_mac_mode_bit5 = -1;
1196 static gint hf_snp_mac_mode_reserved = -1;
1197 static gint hf_snp_mac_mode_reserved1 = -1;
1198 static gint hf_snp_pn_window_size = -1;
1199 static gint hf_snp_max_conc_transactions = -1;
1200 static gint hf_snp_max_suppt_sec_assns = -1;
1201 static gint hf_snp_unknown_type = -1;
1205 #define SNP_PKM_VERSION_SUPPORT_BIT0 0x01
1206 #define SNP_PKM_VERSION_SUPPORT_BIT1 0x02
1207 #define SNP_PKM_VERSION_SUPPORT_RSV 0xFC
1209 #define SNP_AUTH_POLICY_SUPPORT_BIT0 0x01
1210 #define SNP_AUTH_POLICY_SUPPORT_BIT1 0x02
1211 #define SNP_AUTH_POLICY_SUPPORT_BIT2 0x04
1212 #define SNP_AUTH_POLICY_SUPPORT_BIT3 0x08
1213 #define SNP_AUTH_POLICY_SUPPORT_BIT4 0x10
1214 #define SNP_AUTH_POLICY_SUPPORT_BIT5 0x20
1215 #define SNP_AUTH_POLICY_SUPPORT_BIT6 0x40
1216 #define SNP_AUTH_POLICY_SUPPORT_BIT7 0x80
1218 #define SNP_MAC_MODE_BIT0 0x01
1219 #define SNP_MAC_MODE_BIT1 0x02
1220 #define SNP_MAC_MODE_BIT2 0x04
1221 #define SNP_MAC_MODE_BIT3 0x08
1222 #define SNP_MAC_MODE_BIT4 0x10
1223 #define SNP_MAC_MODE_BIT5 0x20
1224 #define SNP_MAC_MODE_RSV 0xE0
1225 #define SNP_MAC_MODE_RSV1 0xC0
1227 static hf_register_info hf_snp[] =
1230 &hf_snp_pkm_version_support,
1231 {"PKM Version Support", "wimax.security_negotiation_parameters.pkm_version_support",FT_UINT8, BASE_HEX, NULL, 0x0, "", HFILL}
1234 &hf_snp_pkm_version_support_bit0,
1235 {"PKM version 1", "wimax.security_negotiation_parameters.pkm_version_support.bit0",FT_BOOLEAN, 8, TFS(&tfs_supported), SNP_PKM_VERSION_SUPPORT_BIT0, "", HFILL}
1238 &hf_snp_pkm_version_support_bit1,
1239 {"PKM version 2", "wimax.security_negotiation_parameters.pkm_version_support.bit1",FT_BOOLEAN, 8, TFS(&tfs_supported), SNP_PKM_VERSION_SUPPORT_BIT1, "", HFILL}
1242 &hf_snp_pkm_version_support_reserved,
1243 {"Reserved", "wimax.security_negotiation_parameters.pkm_version_support.reserved",FT_UINT8, BASE_HEX, NULL, SNP_PKM_VERSION_SUPPORT_RSV, "", HFILL}
1246 &hf_snp_auth_policy_support,
1247 {"Authorization Policy Support", "wimax.security_negotiation_parameters.auth_policy_support",FT_UINT8, BASE_HEX, NULL, 0x0, "", HFILL}
1250 &hf_snp_auth_policy_support_bit0,
1251 {"RSA-based Authorization At The Initial Network Entry", "wimax.security_negotiation_parameters.auth_policy_support.bit0",FT_BOOLEAN, 8, TFS(&tfs_supported), SNP_AUTH_POLICY_SUPPORT_BIT0, "", HFILL}
1254 &hf_snp_auth_policy_support_bit1,
1255 {"EAP-based Authorization At The Initial Network Entry", "wimax.security_negotiation_parameters.auth_policy_support.bit1",FT_BOOLEAN, 8, TFS(&tfs_supported), SNP_AUTH_POLICY_SUPPORT_BIT1, "", HFILL}
1258 &hf_snp_auth_policy_support_bit2,
1259 {"Authenticated EAP-based Authorization At The Initial Network Entry", "wimax.security_negotiation_parameters.auth_policy_support.bit2",FT_BOOLEAN, 8, TFS(&tfs_supported), SNP_AUTH_POLICY_SUPPORT_BIT2, "", HFILL}
1262 &hf_snp_auth_policy_support_bit3,
1263 {"Reserved", "wimax.security_negotiation_parameters.auth_policy_support.bit3",FT_UINT8, BASE_HEX, NULL, SNP_AUTH_POLICY_SUPPORT_BIT3, "", HFILL}
1266 &hf_snp_auth_policy_support_bit4,
1267 {"RSA-based Authorization At Re-entry", "wimax.security_negotiation_parameters.auth_policy_support.bit4",FT_BOOLEAN, 8, TFS(&tfs_supported), SNP_AUTH_POLICY_SUPPORT_BIT4, "", HFILL}
1270 &hf_snp_auth_policy_support_bit5,
1271 {"EAP-based Authorization At Re-entry", "wimax.security_negotiation_parameters.auth_policy_support.bit5",FT_BOOLEAN, 8, TFS(&tfs_supported), SNP_AUTH_POLICY_SUPPORT_BIT5, "", HFILL}
1274 &hf_snp_auth_policy_support_bit6,
1275 {"Authenticated EAP-based Authorization At Re-entry", "wimax.security_negotiation_parameters.auth_policy_support.bit6",FT_BOOLEAN, 8, TFS(&tfs_supported), SNP_AUTH_POLICY_SUPPORT_BIT6, "", HFILL}
1278 &hf_snp_auth_policy_support_bit7,
1279 {"Reserved", "wimax.security_negotiation_parameters.auth_policy_support.bit7",FT_UINT8, BASE_HEX, NULL, SNP_AUTH_POLICY_SUPPORT_BIT7, "", HFILL}
1283 {"MAC (Message Authentication Code) Mode", "wimax.security_negotiation_parameters.mac_mode",FT_UINT8, BASE_HEX, NULL, 0x0, "", HFILL}
1286 &hf_snp_mac_mode_bit0,
1287 {"HMAC", "wimax.security_negotiation_parameters.mac_mode.bit0",FT_BOOLEAN, 8, TFS(&tfs_supported), SNP_MAC_MODE_BIT0, "", HFILL}
1290 &hf_snp_mac_mode_bit1,
1291 {"CMAC", "wimax.security_negotiation_parameters.mac_mode.bit1",FT_BOOLEAN, 8, TFS(&tfs_supported), SNP_MAC_MODE_BIT1, "", HFILL}
1294 &hf_snp_mac_mode_bit1_rsvd,
1295 {"Reserved", "wimax.security_negotiation_parameters.mac_mode.bit1_rsvd",FT_BOOLEAN, 8, TFS(&tfs_supported), SNP_MAC_MODE_BIT1, "", HFILL}
1298 &hf_snp_mac_mode_bit2,
1299 {"64-bit Short-HMAC", "wimax.security_negotiation_parameters.mac_mode.bit2",FT_BOOLEAN, 8, TFS(&tfs_supported), SNP_MAC_MODE_BIT2, "", HFILL}
1302 &hf_snp_mac_mode_bit3,
1303 {"80-bit Short-HMAC", "wimax.security_negotiation_parameters.mac_mode.bit3",FT_BOOLEAN, 8, TFS(&tfs_supported), SNP_MAC_MODE_BIT3, "", HFILL}
1306 &hf_snp_mac_mode_bit4,
1307 {"96-bit Short-HMAC", "wimax.security_negotiation_parameters.mac_mode.bit4",FT_BOOLEAN, 8, TFS(&tfs_supported), SNP_MAC_MODE_BIT4, "", HFILL}
1310 &hf_snp_mac_mode_bit5,
1311 {"CMAC", "wimax.security_negotiation_parameters.mac_mode.bit5",FT_BOOLEAN, 8, TFS(&tfs_supported), SNP_MAC_MODE_BIT5, "", HFILL}
1314 &hf_snp_mac_mode_reserved,
1315 {"Reserved", "wimax.security_negotiation_parameters.mac_mode.reserved",FT_UINT8, BASE_HEX, NULL, SNP_MAC_MODE_RSV, "", HFILL}
1318 &hf_snp_mac_mode_reserved1,
1319 {"Reserved", "wimax.security_negotiation_parameters.mac_mode.reserved",FT_UINT8, BASE_HEX, NULL, SNP_MAC_MODE_RSV1, "", HFILL}
1322 &hf_snp_pn_window_size,
1323 {"PN Window Size", "wimax.security_negotiation_parameters.pn_window_size",FT_UINT16, BASE_DEC, NULL, 0x0, "", HFILL}
1326 &hf_snp_max_conc_transactions,
1327 {"Maximum concurrent transactions (0 indicates no limit)", "wimax.security_negotiation_parameters.max_conc_transactions",FT_UINT8, BASE_DEC, NULL, 0x0, "", HFILL}
1330 &hf_snp_max_suppt_sec_assns,
1331 {"Maximum number of security associations supported by the SS", "wimax.security_negotiation_parameters.max_suppt_sec_assns",FT_UINT8, BASE_DEC, NULL, 0x0, "", HFILL}
1334 &hf_snp_unknown_type,
1335 {"Unknown Security Negotiation Parameter type", "wimax.security_negotiation_parameters.unknown.type",FT_BYTES, BASE_HEX, NULL, 0x0, "", HFILL}
1340 static gint hf_pkm_msg_unknown_type = -1;
1341 static gint hf_pkm_msg_attr_display = -1;
1342 static gint hf_pkm_config_settings_authorize_waitout = -1;
1343 static gint hf_pkm_config_settings_reauthorize_waitout = -1;
1344 static gint hf_pkm_config_settings_grace_time = -1;
1345 static gint hf_pkm_config_settings_operational_waittime = -1;
1346 static gint hf_pkm_msg_attr_auth_key = -1;
1347 static gint hf_pkm_msg_attr_tek = -1;
1348 static gint hf_pkm_msg_attr_key_life_time = -1;
1349 static gint hf_pkm_msg_attr_key_seq_num = -1;
1350 static gint hf_pkm_msg_attr_hmac_digest = -1;
1351 static gint hf_pkm_msg_attr_said = -1;
1352 static gint hf_pkm_msg_attr_cbc_iv = -1;
1353 static gint hf_pkm_msg_attr_error_code = -1;
1354 static gint hf_pkm_msg_attr_ca_certificate = -1;
1355 static gint hf_pkm_msg_attr_ss_certificate = -1;
1356 static gint hf_pkm_attr_auth_result_code = -1;
1357 static gint hf_pkm_attr_sa_service_type = -1;
1358 static gint hf_pkm_attr_frame_number = -1;
1359 static gint hf_pkm_attr_ss_random = -1;
1360 static gint hf_pkm_attr_bs_random = -1;
1361 static gint hf_pkm_attr_pre_pak = -1;
1362 static gint hf_pkm_attr_bs_certificate = -1;
1363 static gint hf_pkm_attr_sig_bs = -1;
1364 static gint hf_pkm_attr_ms_mac_address = -1;
1365 static gint hf_pkm_attr_cmac_digest = -1;
1366 static gint hf_pkm_attr_cmac_digest_pn = -1;
1367 static gint hf_pkm_attr_cmac_digest_value = -1;
1368 static gint hf_pkm_attr_eap_payload = -1;
1369 static gint hf_pkm_attr_nonce = -1;
1370 static gint hf_pkm_sa_type = -1;
1371 static gint hf_pkm_msg_crypto_suite = -1;
1372 static gint hf_pkm_msg_crypto_suite_msb = -1;
1373 static gint hf_pkm_msg_crypto_suite_middle = -1;
1374 static gint hf_pkm_msg_crypto_suite_lsb = -1;
1375 /*static gint hf_pkm_msg_version = -1;*/
1376 static gint hf_pkm_attr_push_modes = -1;
1377 static gint hf_pkm_attr_key_push_counter = -1;
1378 static gint hf_pkm_attr_gkek = -1;
1379 static gint hf_pkm_attr_sig_ss = -1;
1380 static gint hf_pkm_attr_akid = -1;
1381 static gint hf_pkm_config_settings_rekey_wait_timeout = -1;
1382 static gint hf_pkm_config_settings_tek_grace_time = -1;
1383 static gint hf_pkm_config_settings_authorize_reject_wait_timeout = -1;
1385 static gint hf_pkm_attr_pak_ak_seq_number = -1;
1386 static gint hf_pkm_attr_associated_gkek_seq_number = -1;
1387 static gint hf_pkm_attr_gkek_params = -1;
1389 static hf_register_info hf_pkm[] =
1391 { /* 11.9.1 - type 6 */
1392 &hf_pkm_msg_attr_display,
1393 {"Display String", "wimax.pkm_msg.pkm_attr.display_string", FT_STRING, BASE_NONE, NULL, 0x0, "", HFILL}
1395 { /* 11.9.2 - type 7 */
1396 &hf_pkm_msg_attr_auth_key,
1397 {"Auth Key", "wimax.pkm_msg.pkm_attr.auth_key", FT_BYTES, BASE_HEX, NULL, 0x0, "", HFILL}
1399 { /* 11.9.3 - type 8 */
1400 &hf_pkm_msg_attr_tek,
1401 {"TEK", "wimax.pkm_msg.pkm_attr.tek", FT_BYTES, BASE_HEX, NULL, 0x0, "", HFILL}
1403 { /* 11.9.4 - type 9 */
1404 &hf_pkm_msg_attr_key_life_time,
1405 {"Key Lifetime", "wimax.pkm_msg.pkm_attr.key_life_time", FT_UINT32, BASE_HEX, NULL, 0x0, "", HFILL}
1407 { /* 11.9.5 - type 10 */
1408 &hf_pkm_msg_attr_key_seq_num,
1409 {"Key Sequence Number", "wimax.pkm_msg.pkm_attr.key_seq_num", FT_UINT8, BASE_DEC, NULL, 0x0, "", HFILL}
1411 { /* 11.9.6 - type 11 */
1412 &hf_pkm_msg_attr_hmac_digest,
1413 {"HMAC-Digest", "wimax.pkm_msg.pkm_attr.hmac_digest", FT_BYTES, BASE_HEX, NULL, 0x0, "", HFILL}
1415 { /* 11.9.7 - type 12 */
1416 &hf_pkm_msg_attr_said,
1417 {"SAID", "wimax.pkm_msg.pkm_attr.said", FT_UINT16, BASE_HEX, NULL, 0x0, "", HFILL}
1419 #if 0 /* not been used */
1420 { /* 11.9.8 - type 13 */
1421 &hf_pkm_msg_attr_tek_param,
1422 {"TEK Parameters", "wimax.pkm_msg.pkm_attr.tek_parameters", FT_BYTES, BASE_HEX, NULL, 0x0, "", HFILL}
1425 { /* 11.9.9 - type 15 */
1426 &hf_pkm_msg_attr_cbc_iv,
1427 {"CBC IV", "wimax.pkm_msg.pkm_attr.cbc_iv", FT_BYTES, BASE_HEX, NULL, 0x0, "", HFILL}
1429 { /* 11.9.10 - type 16 */
1430 &hf_pkm_msg_attr_error_code,
1431 {"Error Code", "wimax.pkm_msg.pkm_attr.error_code", FT_UINT8, BASE_DEC, VALS(vals_pkm_attr_error_codes), 0x0, "", HFILL}
1433 { /* 11.9.11 - type 17 */
1434 &hf_pkm_msg_attr_ca_certificate,
1435 {"CA Certificate", "wimax.pkm_msg.pkm_attr.ca_certificate", FT_BYTES, BASE_HEX, NULL, 0x0, "", HFILL}
1437 { /* 11.9.12 - type 18 */
1438 &hf_pkm_msg_attr_ss_certificate,
1439 {"SS Certificate", "wimax.pkm_msg.pkm_attr.ss_certificate", FT_BYTES, BASE_HEX, NULL, 0x0, "", HFILL}
1441 #if 0 /* not been used */
1442 { /* 11.9.13 - type 19 */
1443 &hf_pkm_msg_attr_security_capabilities,
1444 {"Security Capabilities", "wimax.pkm_msg.pkm_attr.security_capabilities", FT_BYTES, BASE_HEX, NULL, 0x0, "", HFILL}
1447 { /* 11.9.14 - type 20 */
1448 &hf_pkm_msg_crypto_suite,
1449 {"Cryptography", "wimax.pkm_msg.pkm_attr.crypto_suite", FT_BYTES, BASE_HEX, NULL, 0x0, "", HFILL}
1452 &hf_pkm_msg_crypto_suite_msb,
1453 {"Data Encryption Algorithm Identifiers", "wimax.pkm_msg.pkm_attr.crypto_suite.msb", FT_UINT8, BASE_DEC, VALS(vals_data_encryption_ids), 0x0, "", HFILL}
1456 &hf_pkm_msg_crypto_suite_middle,
1457 {"Data Authentication Algorithm Identifiers", "wimax.pkm_msg.pkm_attr.crypto_suite.middle", FT_UINT8, BASE_DEC, VALS(vals_data_authentication_ids), 0x0, "", HFILL}
1460 &hf_pkm_msg_crypto_suite_lsb,
1461 {"TEK Encryption Algorithm Identifiers", "wimax.pkm_msg.pkm_attr.crypto_suite.lsb", FT_UINT8, BASE_DEC, VALS(vals_tek_encryption_ids), 0x0, "", HFILL}
1463 #if 0 /* not been used */
1464 { /* 11.9.15 - type 21 */
1465 &hf_pkm_msg_crypto_list,
1466 {"Cryptographic-Suite List", "wimax.pkm_msg.pkm_attr.crypto_suite_list", FT_BYTES, BASE_HEX, NULL, 0x0, "", HFILL}
1469 #if 0 /* deleted by 802.16E */
1470 { /* 11.9.16 - type 22 */
1471 &hf_pkm_msg_version,
1472 {"Reserved ", "wimax.pkm_msg.pkm_attr.version", FT_UINT8, BASE_HEX, NULL, 0x0, "", HFILL}
1475 #if 0 /* not been used */
1476 { /* 11.9.17 - type 23 */
1477 &hf_pkm_msg_sa_descriptor,
1478 {"SA Descriptor", "wimax.pkm_msg.pkm_attr.sa_descriptor", FT_BYTES, BASE_HEX, NULL, 0x0, "", HFILL}
1481 { /* 11.9.18 - type 24 */
1483 {"SA Type", "wimax.pkm_msg.pkm_attr.sa_type", FT_UINT8, BASE_DEC, VALS(vs_sa_type), 0x0, "", HFILL}
1485 #if 0 /* not been used */
1486 { /* 11.9.?? - type 25 */
1487 &hf_pkm_attr_security_negotiation_parameters,
1488 {"Security Negotiation Parameters", "wimax.pkm_msg.pkm_attr.security_negotiation_parameters", FT_BYTES, BASE_HEX, NULL, 0x0, "", HFILL}
1491 #if 0 /* not been used */
1492 { /* 11.9.19 - type 27 */
1493 &hf_pkm_attr_config_settings,
1494 {"PKM Configuration Settings", "wimax.pkm_msg.pkm_attr.config_settings", FT_BYTES, BASE_HEX, NULL, 0x0, "", HFILL}
1498 &hf_pkm_config_settings_authorize_waitout,
1499 {"Authorize Wait Timeout (in seconds)", "wimax.pkm_msg.pkm_attr.config_settings.authorize_waitout", FT_UINT32, BASE_DEC, NULL, 0x0, "", HFILL}
1502 &hf_pkm_config_settings_reauthorize_waitout,
1503 {"Reauthorize Wait Timeout (in seconds)", "wimax.pkm_msg.pkm_attr.config_settings.reauthorize_waitout", FT_UINT32, BASE_DEC, NULL, 0x0, "", HFILL}
1506 &hf_pkm_config_settings_grace_time,
1507 {"Authorization Grace Time (in seconds)", "wimax.pkm_msg.pkm_attr.config_settings.grace_time", FT_UINT32, BASE_DEC, NULL, 0x0, "", HFILL}
1510 &hf_pkm_config_settings_operational_waittime,
1511 {"Operational Wait Timeout (in seconds)", "wimax.pkm_msg.pkm_attr.config_settings.operational_wait_timeout", FT_UINT32, BASE_DEC, NULL, 0x0, "", HFILL}
1514 &hf_pkm_config_settings_rekey_wait_timeout,
1515 {"Rekey Wait Timeout (in seconds)", "wimax.pkm_msg.pkm_attr.config_settings.rekey_wait_timeout", FT_UINT32, BASE_DEC, NULL, 0x0, "", HFILL}
1518 &hf_pkm_config_settings_tek_grace_time,
1519 {"TEK Grace Time (in seconds)", "wimax.pkm_msg.pkm_attr.config_settings.tek_grace_time", FT_UINT32, BASE_DEC, NULL, 0x0, "", HFILL}
1522 &hf_pkm_config_settings_authorize_reject_wait_timeout,
1523 {"Authorize Reject Wait Timeout(in seconds)", "wimax.pkm_msg.pkm_attr.config_settings.authorize_reject_wait_timeout", FT_UINT32, BASE_DEC, NULL, 0x0, "", HFILL}
1525 { /* 11.9.20 - type 29 */
1527 {"Nonce", "wimax.pkm_msg.pkm_attr.nonce", FT_BYTES, BASE_HEX, NULL, 0x0, "", HFILL}
1529 { /* 11.9.21 - type 33 */
1530 &hf_pkm_attr_ss_random,
1531 {"SS_RANDOM", "wimax.pkm_msg.pkm_attr.ss_random", FT_BYTES, BASE_HEX, NULL, 0x0, "", HFILL}
1533 { /* 11.9.22 - type 34 */
1534 &hf_pkm_attr_bs_random,
1535 {"BS_RANDOM", "wimax.pkm_msg.pkm_attr.bs_random", FT_BYTES, BASE_HEX, NULL, 0x0, "", HFILL}
1537 { /* 11.9.23 - type 35 */
1538 &hf_pkm_attr_pre_pak,
1539 {"Pre-PAK", "wimax.pkm_msg.pkm_attr.pre_pak", FT_BYTES, BASE_HEX, NULL, 0x0, "", HFILL}
1541 #if 1 /* no definition */
1542 { /* 11.9.?? - type 36 */
1543 &hf_pkm_attr_pak_ak_seq_number,
1544 {"PAK/AK Sequence Number", "wimax.pkm_msg.pkm_attr.pak_ak_seq_number", FT_BYTES, BASE_HEX, NULL, 0x0, "", HFILL}
1547 { /* 11.9.24 - type 37 */
1548 &hf_pkm_attr_bs_certificate,
1549 {"BS Certificate", "wimax.pkm_msg.pkm_attr.bs_certificate", FT_BYTES, BASE_HEX, NULL, 0x0, "", HFILL}
1551 { /* 11.9.25 - type 38 */
1552 &hf_pkm_attr_sig_bs,
1553 {"SigBS", "wimax.pkm_msg.pkm_attr.sig_bs",FT_BYTES, BASE_HEX, NULL, 0x0, "", HFILL}
1555 { /* 11.9.26 - type 39 */
1556 &hf_pkm_attr_ms_mac_address,
1557 {"MS-MAC Address", "wimax.pkm_msg.pkm_attr.ms_mac_address",FT_ETHER, BASE_HEX, NULL, 0x0, "", HFILL}
1559 { /* 11.9.27 - type 40 */
1560 &hf_pkm_attr_cmac_digest,
1561 {"CMAC Digest", "wimax.pkm_msg.pkm_attr.cmac_digest",FT_BYTES, BASE_HEX, NULL, 0x0, "", HFILL}
1564 &hf_pkm_attr_cmac_digest_pn,
1565 {"CMAC Packet Number counter, CMAC_PN_*", "wimax.pkm_msg.pkm_attr.cmac_digest.pn",FT_UINT32, BASE_HEX, NULL, 0x0, "", HFILL}
1568 &hf_pkm_attr_cmac_digest_value,
1569 {"CMAC Value", "wimax.pkm_msg.pkm_attr.cmac_digest.value",FT_BYTES, BASE_HEX, NULL, 0x0, "", HFILL}
1571 { /* 11.9.28 - type 41 */
1572 &hf_pkm_attr_push_modes,
1573 {"Key Push Modes", "wimax.pkm_msg.pkm_attr.key_push_modes",FT_UINT8, BASE_DEC, VALS(va_key_push_modes), 0x0, "", HFILL}
1575 { /* 11.9.29 - type 42 */
1576 &hf_pkm_attr_key_push_counter,
1577 {"Key Push Counter", "wimax.pkm_msg.pkm_attr.key_push_counter",FT_UINT16, BASE_DEC, NULL, 0x0, "", HFILL}
1579 { /* 11.9.30 - type 43 */
1581 {"GKEK", "wimax.pkm_msg.pkm_attr.gkek",FT_BYTES, BASE_HEX, NULL, 0x0, "", HFILL}
1583 { /* 11.9.31 - type 44 */
1584 &hf_pkm_attr_sig_ss,
1585 {"SigSS", "wimax.pkm_msg.pkm_attr.sig_ss",FT_BYTES, BASE_HEX, NULL, 0x0, "", HFILL}
1587 { /* 11.9.32 - type 45 */
1589 {"AKID", "wimax.pkm_msg.pkm_attr.akid",FT_BYTES, BASE_HEX, NULL, 0x0, "", HFILL}
1591 { /* 11.9.33 - type 28 */
1592 &hf_pkm_attr_eap_payload,
1593 {"EAP Payload", "wimax.pkm_msg.pkm_attr.eap_payload", FT_BYTES, BASE_HEX, NULL, 0x0, "", HFILL}
1595 { /* 11.9.34 - type 30 */
1596 &hf_pkm_attr_auth_result_code,
1597 {"Auth Result Code", "wimax.pkm_msg.pkm_attr.auth_result_code", FT_UINT8, BASE_DEC, VALS(vs_success_reject), 0x0, "", HFILL}
1599 { /* 11.9.35 - type 31 */
1600 &hf_pkm_attr_sa_service_type,
1601 {"SA Service Type", "wimax.pkm_msg.pkm_attr.sa_service_type", FT_UINT8, BASE_DEC, VALS(vs_sa_service_type), 0x0, "", HFILL}
1603 #if 0 /* same as 11.9.19 */
1604 { /* 11.9.36 - type 27 */
1605 &hf_pkm_attr_config_settings,
1606 {"PKMv2 Configuration Settings", "wimax.pkm_msg.pkm_attr.config_settings", FT_BYTES, BASE_HEX, NULL, 0x0, "", HFILL}
1609 { /* 11.9.37 - type 32 */
1610 &hf_pkm_attr_frame_number,
1611 {"Frame Number", "wimax.pkm_msg.pkm_attr.frame_number", FT_UINT24, BASE_DEC, NULL, 0x0, "", HFILL}
1613 #if 1 /* no definitions */
1614 { /* 11.9.?? - type 46 */
1615 &hf_pkm_attr_associated_gkek_seq_number,
1616 {"Associated GKEK Sequence Number", "wimax.pkm_msg.pkm_attr.associated_gkek_seq_number",FT_BYTES, BASE_HEX, NULL, 0x0, "", HFILL}
1618 { /* 11.9.?? - type 47 */
1619 &hf_pkm_attr_gkek_params,
1620 {"GKEK Parameters", "wimax.pkm_msg.pkm_attr.gkek_params",FT_BYTES, BASE_HEX, NULL, 0x0, "", HFILL}
1624 &hf_pkm_msg_unknown_type,
1625 {"Unknown Type", "wimax.pkm.unknown.type", FT_BYTES, BASE_HEX, NULL, 0x0, "", HFILL}
1629 static gint hf_common_tlv_unknown_type = -1;
1630 static gint hf_common_tlv_mac_version = -1;
1631 static gint hf_common_tlv_vendor_id = -1;
1632 static gint hf_common_tlv_vendor_specific_type = -1;
1633 static gint hf_common_tlv_vendor_specific_length = -1;
1634 static gint hf_common_tlv_vendor_specific_length_size = -1;
1635 static gint hf_common_tlv_vendor_specific_value = -1;
1637 /* WiMax Common TLV Encoding display */
1638 static hf_register_info hf_common_tlv[] =
1641 &hf_common_tlv_mac_version,
1642 { "MAC Version", "wimax.common_tlv.mac_version", FT_UINT8, BASE_DEC, VALS(vals_dcd_mac_version), 0x0, "", HFILL}
1645 &hf_common_tlv_vendor_id,
1646 { "Vendor ID Encoding", "wimax.common_tlv.vendor_id_encoding", FT_BYTES, BASE_HEX, NULL, 0x0, "", HFILL}
1649 &hf_common_tlv_vendor_specific_type,
1650 { "Vendor Specific Type", "wimax.common_tlv.vendor_specific_type", FT_UINT8, BASE_HEX, NULL, 0x0, "", HFILL}
1653 &hf_common_tlv_vendor_specific_length_size,
1655 "Vendor Specific Length Size", "wimax.common_tlv.vendor_specific_length_size",
1656 FT_UINT8, BASE_HEX, NULL, 0x0,
1661 &hf_common_tlv_vendor_specific_length,
1662 { "Vendor Specific Length", "wimax.common_tlv.vendor_specific_length", FT_UINT16, BASE_DEC, NULL, 0x0, "", HFILL}
1665 &hf_common_tlv_vendor_specific_value,
1666 { "Vendor Specific Value", "wimax.common_tlv.vendor_specific_value", FT_BYTES, BASE_HEX, NULL, 0x0, "", HFILL}
1669 &hf_common_tlv_unknown_type,
1670 {"Unknown Common TLV Type", "wimax.common_tlv.unknown_type", FT_BYTES, BASE_HEX, NULL, 0x0, "", HFILL}
1674 /* Register WiMax Utility Routines */
1675 void proto_register_wimax_utility_decoders(void)
1677 if(proto_wimax_utility_decoders == -1)
1679 proto_wimax_utility_decoders = proto_register_protocol (
1680 "WiMax Sub-TLV Messages", /* name */
1681 "WiMax Sub-TLV (sub)", /* short name */
1685 proto_register_subtree_array(ett, array_length(ett));
1686 proto_register_field_array(proto_mac_mgmt_msg_reg_req_decoder, hf_sfe, array_length(hf_sfe));
1687 proto_register_field_array(proto_wimax_utility_decoders, hf_csper, array_length(hf_csper));
1688 proto_register_field_array(proto_wimax_utility_decoders, hf_xmac, array_length(hf_xmac));
1689 proto_register_field_array(proto_wimax_utility_decoders, hf_snp, array_length(hf_snp));
1690 proto_register_field_array(proto_wimax_utility_decoders, hf_pkm, array_length(hf_pkm));
1691 proto_register_field_array(proto_wimax_utility_decoders, hf_common_tlv, array_length(hf_common_tlv));
1695 /**************************************************************/
1696 /* wimax_error_parameter_set_decoder() */
1697 /* decode and display the WiMax Error Parameter Set */
1699 /* tvb - pointer of the tvb of error_parameter_set */
1700 /* tree - pointer of Wireshark display tree */
1701 /* pinfo - pointer of Wireshark packet information structure*/
1702 /**************************************************************/
1703 void wimax_error_parameter_set_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
1706 guint tvb_len, tlv_len;
1708 proto_item *ceps_item = NULL;
1709 proto_tree *ceps_tree = NULL;
1710 proto_tree *tlv_tree = NULL;
1711 tlv_info_t tlv_info;
1713 /* get the tvb reported length */
1714 tvb_len = tvb_reported_length(tvb);
1716 /* display error parameter information */
1717 ceps_item = proto_tree_add_protocol_format(tree, proto_wimax_utility_decoders, tvb, offset, tvb_len, "Error Parameter Set (%u bytes)", tvb_len);
1718 /* add CS Parameter Encoding Rules subtree */
1719 ceps_tree = proto_item_add_subtree(ceps_item, ett_wimax_error_parameter_set);
1720 /* do nothing if the TLV fields is not exist */
1723 /* report error if the packet size is less than 2 bytes (type+length) */
1725 { /* invalid tlv info */
1728 col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "Invalid Error Parameter Set");
1732 /* process the classifier error parameter set */
1733 while(offset < tvb_len)
1734 { /* get the TLV information */
1735 init_tlv_info(&tlv_info, tvb, offset);
1736 /* get the TLV type */
1737 tlv_type = get_tlv_type(&tlv_info);
1738 /* get the TLV length */
1739 tlv_len = get_tlv_length(&tlv_info);
1740 if(tlv_type == -1 || tlv_len > MAX_TLV_LEN || tlv_len < 1)
1741 { /* invalid tlv info */
1744 col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "EPS TLV error");
1746 proto_tree_add_item(ceps_tree, hf_cst_invalid_tlv, tvb, offset, (tvb_len - offset), FALSE);
1749 #ifdef DEBUG /* for debug only */
1750 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);
1752 /* update the offset */
1753 offset += get_tlv_value_offset(&tlv_info);
1754 /* parse the Classifier Error Parameter Set */
1757 case CST_ERROR_SET_ERRORED_PARAM:
1758 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);
1759 proto_tree_add_item(tlv_tree, hf_cst_error_set_errored_param, tvb, offset, tlv_len, FALSE);
1761 case CST_ERROR_SET_ERROR_CODE:
1762 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);
1763 proto_tree_add_item(tlv_tree, hf_cst_error_set_error_code, tvb, offset, tlv_len, FALSE);
1765 case CST_ERROR_SET_ERROR_MSG:
1766 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);
1767 proto_tree_add_item(tlv_tree, hf_cst_error_set_error_msg, tvb, offset, tlv_len, FALSE);
1774 /****************************************************************/
1775 /* wimax_convengence_service_parameter_encoding_rules_decoder() */
1776 /* decode and display the WiMax Convergence Service Parameter */
1777 /* Encoding Rules */
1779 /* sfe_type - Service Flow Encodings type */
1780 /* tvb - pointer of the tvb of service flow encodings */
1781 /* tree - pointer of Wireshark display tree */
1782 /* pinfo - pointer of Wireshark packet information structure */
1783 /****************************************************************/
1784 /* CS Parameter Encoding Rules handling function */
1785 void wimax_convengence_service_parameter_encoding_rules_decoder(guint sfe_type, tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
1787 guint offset, tlv_offset;
1788 guint tvb_len, tlv_len, length;
1790 proto_item *csper_item = NULL;
1791 proto_tree *csper_tree = NULL;
1792 proto_tree *tlv_tree = NULL;
1793 proto_tree *ti_tree = NULL;
1794 tlv_info_t tlv_info;
1795 gboolean ipv6 = ((sfe_type == SFE_CSPER_PACKET_IPV6) || (sfe_type == SFE_CSPER_PACKET_IPV6_802_3) || (sfe_type == SFE_CSPER_PACKET_IPV6_802_1Q));
1798 if((sfe_type < SFE_CSPER_ATM) || (sfe_type > SFE_CSPER_PACKET_IP_802_3_ECRTP_COMPRESSION))
1799 return; /* invalid CS Parameter Encodings */
1801 /* get the tvb reported length */
1802 tvb_len = tvb_reported_length(tvb);
1804 /* display SFE information */
1805 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);
1806 /* add CS Parameter Encoding Rules subtree */
1807 csper_tree = proto_item_add_subtree(csper_item, ett_wimax_cst_encoding_rules);
1808 /* do nothing if the TLV fields is not exist */
1811 /* report error if the packet size is less than 2 bytes (type+length) */
1813 { /* invalid tlv info */
1816 col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "Invalid Convergence Service Parameter Encoding Rules");
1820 /* process WiMax Service Flow Encodings */
1821 while(offset < tvb_len)
1822 { /* get the TLV information */
1823 init_tlv_info(&tlv_info, tvb, offset);
1824 /* get the TLV type */
1825 tlv_type = get_tlv_type(&tlv_info);
1826 /* get the TLV length */
1827 tlv_len = get_tlv_length(&tlv_info);
1828 if(tlv_type == -1 || tlv_len > MAX_TLV_LEN || tlv_len < 1)
1829 { /* invalid tlv info */
1832 col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "CSPER TLV error");
1834 proto_tree_add_item(csper_tree, hf_cst_invalid_tlv, tvb, offset, (tvb_len - offset), FALSE);
1837 #ifdef DEBUG /* for debug only */
1838 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);
1840 /* update the offset */
1841 offset += get_tlv_value_offset(&tlv_info);
1842 /* parse the CS parameter Encoding Rule TLV */
1843 if(sfe_type == SFE_CSPER_ATM)
1844 { /* ATM CS Encodings */
1847 case CST_ATM_SWITCHING:
1848 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_cst_encoding_rules, csper_tree, hf_csper_atm_switching_encoding, tvb, offset, tlv_len, FALSE);
1849 proto_tree_add_item(tlv_tree, hf_csper_atm_switching_encoding, tvb, offset, tlv_len, FALSE);
1851 case CST_ATM_CLASSIFIER:
1852 /* add TLV subtree */
1853 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_cst_encoding_rules, csper_tree, hf_csper_atm_classifier, tvb, offset, tlv_len, FALSE);
1854 tlv_offset = offset;
1855 while(tlv_offset < (tlv_len + offset))
1857 /* get the TLV information */
1858 init_tlv_info(&tlv_info, tvb, tlv_offset);
1859 /* get the TLV type */
1860 tlv_type = get_tlv_type(&tlv_info);
1861 /* get the TLV length */
1862 length = get_tlv_length(&tlv_info);
1863 if(tlv_type == -1 || length > MAX_TLV_LEN || length < 1)
1864 { /* invalid tlv info */
1867 col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "ATM Classifier TLV error");
1869 proto_tree_add_item(tlv_tree, hf_cst_invalid_tlv, tvb, offset, (tlv_len - tlv_offset), FALSE);
1872 #ifdef DEBUG /* for debug only */
1873 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);
1875 /* update the offset */
1876 tlv_offset += get_tlv_value_offset(&tlv_info);
1879 case ATM_VPI_CLASSIFIER:
1880 ti_tree = add_tlv_subtree(&tlv_info, ett_wimax_cst_encoding_rules, tlv_tree, hf_csper_atm_classifier_vpi, tvb, tlv_offset, length, FALSE);
1881 proto_tree_add_item(ti_tree, hf_csper_atm_classifier_vpi, tvb, tlv_offset, length, FALSE);
1883 case ATM_VCI_CLASSIFIER:
1884 ti_tree = add_tlv_subtree(&tlv_info, ett_wimax_cst_encoding_rules, tlv_tree, hf_csper_atm_classifier_vci, tvb, tlv_offset, length, FALSE);
1885 proto_tree_add_item(ti_tree, hf_csper_atm_classifier_vci, tvb, tlv_offset, length, FALSE);
1887 case ATM_CLASSIFIER_ID:
1888 ti_tree = add_tlv_subtree(&tlv_info, ett_wimax_cst_encoding_rules, tlv_tree, hf_csper_atm_classifier_id, tvb, tlv_offset, length, FALSE);
1889 proto_tree_add_item(ti_tree, hf_csper_atm_classifier_id, tvb, tlv_offset, length, FALSE);
1894 tlv_offset += length;
1895 } /* end of while loop */
1897 case CST_ATM_CLASSIFIER_DSC_ACTION:
1898 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_cst_encoding_rules, csper_tree, hf_cst_classifier_dsc_action, tvb, offset, tlv_len, FALSE);
1899 proto_tree_add_item(tlv_tree, hf_cst_classifier_dsc_action, tvb, offset, tlv_len, FALSE);
1901 case CST_ATM_CLASSIFIER_ERROR_PARAMETER_SET:
1902 /* call the error parameter set function */
1903 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);
1904 wimax_error_parameter_set_decoder(tvb_new_subset(tvb, offset, tlv_len, tlv_len), pinfo, tlv_tree);
1907 /* display the unknown ATM CS encoding in hex */
1908 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_cst_encoding_rules, csper_tree, hf_csper_unknown_type, tvb, offset, tlv_len, FALSE);
1909 proto_tree_add_item(tlv_tree, hf_csper_unknown_type, tvb, offset, tlv_len, FALSE);
1917 case CST_CLASSIFIER_ACTION:
1918 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_cst_encoding_rules, csper_tree, hf_cst_classifier_dsc_action, tvb, offset, tlv_len, FALSE);
1919 proto_tree_add_item(tlv_tree, hf_cst_classifier_dsc_action, tvb, offset, tlv_len, FALSE);
1921 case CST_CLASSIFIER_ERROR_PARAM_SET:
1922 case CST_PHS_ERROR_PARAM_SET:
1923 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);
1924 /* call the error parameter set function */
1925 wimax_error_parameter_set_decoder(tvb_new_subset(tvb, offset, tlv_len, tlv_len), pinfo, tlv_tree);
1927 case CST_PACKET_CLASSIFICATION_RULE:
1929 /* add TLV subtree */
1930 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_cst_encoding_rules, csper_tree, hf_cst_pkt_class_rule, tvb, offset, tlv_len, FALSE);
1931 tlv_offset = offset;
1932 while(tlv_offset < (tlv_len + offset))
1934 /* get the TLV information */
1935 init_tlv_info(&tlv_info, tvb, tlv_offset);
1936 /* get the TLV type */
1937 tlv_type = get_tlv_type(&tlv_info);
1938 /* get the TLV length */
1939 length = get_tlv_length(&tlv_info);
1940 if(tlv_type == -1 || length > MAX_TLV_LEN || length < 1)
1941 { /* invalid tlv info */
1944 col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "Packet Classification Rule TLV error");
1946 proto_tree_add_item(tlv_tree, hf_cst_invalid_tlv, tvb, offset, (tlv_len - tlv_offset), FALSE);
1949 #ifdef DEBUG /* for debug only */
1950 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);
1952 /* update the offset */
1953 tlv_offset += get_tlv_value_offset(&tlv_info);
1956 case CST_PKT_CLASS_RULE_PRIORITY:
1957 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);
1958 proto_tree_add_item(ti_tree, hf_cst_pkt_class_rule_priority, tvb, tlv_offset, length, FALSE);
1960 case CST_PKT_CLASS_RULE_RANGE_MASK:
1961 /* add TLV subtree */
1962 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);
1963 proto_tree_add_item(ti_tree, hf_cst_pkt_class_rule_tos_low, tvb,
1964 tlv_offset, 1, FALSE);
1965 proto_tree_add_item(ti_tree, hf_cst_pkt_class_rule_tos_high, tvb,
1966 tlv_offset + 1, 1, FALSE);
1967 proto_tree_add_item(ti_tree, hf_cst_pkt_class_rule_tos_mask, tvb,
1968 tlv_offset + 2, 1, FALSE);
1970 case CST_PKT_CLASS_RULE_PROTOCOL:
1971 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);
1972 proto_tree_add_item(ti_tree, hf_cst_pkt_class_rule_protocol, tvb, tlv_offset, length, FALSE);
1974 case CST_PKT_CLASS_RULE_SRC_IP:
1975 /* add TLV subtree */
1976 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);
1979 proto_tree_add_item(ti_tree, hf_cst_pkt_class_rule_src_ipv6, tvb, tlv_offset, 16, FALSE);
1980 proto_tree_add_item(ti_tree, hf_cst_pkt_class_rule_mask_ipv6, tvb, tlv_offset + 16, 16, FALSE);
1984 proto_tree_add_item(ti_tree, hf_cst_pkt_class_rule_src_ipv4, tvb, tlv_offset, 4, FALSE);
1985 proto_tree_add_item(ti_tree, hf_cst_pkt_class_rule_mask_ipv4, tvb, tlv_offset + 4, 4, FALSE);
1988 case CST_PKT_CLASS_RULE_DST_IP:
1989 /* add TLV subtree */
1990 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);
1993 proto_tree_add_item(ti_tree, hf_cst_pkt_class_rule_dest_ipv6, tvb, tlv_offset, 16, FALSE);
1994 proto_tree_add_item(ti_tree, hf_cst_pkt_class_rule_mask_ipv6, tvb, tlv_offset + 16, 16, FALSE);
1998 proto_tree_add_item(ti_tree, hf_cst_pkt_class_rule_dest_ipv4, tvb, tlv_offset, 4, FALSE);
1999 proto_tree_add_item(ti_tree, hf_cst_pkt_class_rule_mask_ipv4, tvb, tlv_offset + 4, 4, FALSE);
2002 case CST_PKT_CLASS_RULE_SRCPORT_RANGE:
2003 /* add TLV subtree */
2004 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);
2005 proto_tree_add_item(ti_tree, hf_cst_pkt_class_rule_src_port_low, tvb, tlv_offset, 2, FALSE);
2006 proto_tree_add_item(ti_tree, hf_cst_pkt_class_rule_src_port_high, tvb, tlv_offset + 2, 2, FALSE);
2008 case CST_PKT_CLASS_RULE_DSTPORT_RANGE:
2009 /* add TLV subtree */
2010 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);
2011 proto_tree_add_item(ti_tree, hf_cst_pkt_class_rule_dest_port_low, tvb, tlv_offset, 2, FALSE);
2012 proto_tree_add_item(ti_tree, hf_cst_pkt_class_rule_dest_port_high, tvb, tlv_offset + 2, 2, FALSE);
2014 case CST_PKT_CLASS_RULE_DST_MAC:
2015 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);
2016 /* add TLV subtree */
2017 proto_tree_add_item(ti_tree, hf_cst_pkt_class_rule_dest_mac, tvb, tlv_offset, 6, FALSE);
2018 proto_tree_add_item(ti_tree, hf_cst_pkt_class_rule_mask_mac, tvb, tlv_offset + 6, 6, FALSE);
2020 case CST_PKT_CLASS_RULE_SRC_MAC:
2021 /* add TLV subtree */
2022 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);
2023 proto_tree_add_item(ti_tree, hf_cst_pkt_class_rule_src_mac, tvb, tlv_offset, 6, FALSE);
2024 proto_tree_add_item(ti_tree, hf_cst_pkt_class_rule_mask_mac, tvb, tlv_offset + 6, 6, FALSE);
2026 case CST_PKT_CLASS_RULE_ETHERTYPE:
2027 /* add TLV subtree */
2028 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);
2029 proto_tree_add_item(ti_tree, hf_cst_pkt_class_rule_etype, tvb, tlv_offset, 1, FALSE);
2030 proto_tree_add_item(ti_tree, hf_cst_pkt_class_rule_eprot1, tvb, tlv_offset + 1, 1, FALSE);
2031 proto_tree_add_item(ti_tree, hf_cst_pkt_class_rule_eprot2, tvb, tlv_offset + 2, 1, FALSE);
2033 case CST_PKT_CLASS_RULE_USER_PRIORITY:
2034 /* add TLV subtree */
2035 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);
2036 proto_tree_add_item(ti_tree, hf_cst_pkt_class_rule_pri_low, tvb, tlv_offset, 1, FALSE);
2037 proto_tree_add_item(ti_tree, hf_cst_pkt_class_rule_pri_high, tvb, tlv_offset + 1, 1, FALSE);
2039 case CST_PKT_CLASS_RULE_VLAN_ID:
2040 /* add TLV subtree */
2041 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);
2042 proto_tree_add_item(ti_tree, hf_cst_pkt_class_rule_vlan_id1, tvb, tlv_offset, 1, FALSE);
2043 proto_tree_add_item(ti_tree, hf_cst_pkt_class_rule_vlan_id2, tvb, tlv_offset + 1, 1, FALSE);
2045 case CST_PKT_CLASS_RULE_PHSI:
2046 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);
2047 proto_tree_add_item(ti_tree, hf_cst_pkt_class_rule_phsi, tvb, tlv_offset, length, FALSE);
2049 case CST_PKT_CLASS_RULE_INDEX:
2050 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);
2051 proto_tree_add_item(ti_tree, hf_cst_pkt_class_rule_index, tvb, tlv_offset, length, FALSE);
2053 case CST_PKT_CLASS_RULE_IPv6_FLOW_LABEL:
2055 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);
2056 proto_tree_add_item(ti_tree, hf_cst_pkt_class_rule_ipv6_flow_label, tvb, tlv_offset, length, FALSE);
2058 case CST_PKT_CLASS_RULE_VENDOR_SPEC:
2059 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);
2060 proto_tree_add_item(ti_tree, hf_cst_pkt_class_rule_vendor_spec, tvb, tlv_offset, length, FALSE);
2062 case CST_CLASSIFIER_ACTION_RULE:
2063 /* add TLV subtree */
2064 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);
2065 proto_tree_add_item(ti_tree, hf_cst_pkt_class_rule_classifier_action_rule_bit0, tvb, tlv_offset, 1, FALSE);
2066 proto_tree_add_item(ti_tree, hf_cst_pkt_class_rule_classifier_action_rule_bit1, tvb, tlv_offset, 1, FALSE);
2068 case CST_PKT_CLASS_RULE_LARGE_CONTEXT_ID:
2069 ti_tree = add_tlv_subtree(&tlv_info, ett_wimax_cst_encoding_rules, tlv_tree, hf_cst_large_context_id, tvb, tlv_offset, length, FALSE);
2070 proto_tree_add_item(ti_tree, hf_cst_large_context_id, tvb, tlv_offset, length, FALSE);
2072 case CST_PKT_CLASS_RULE_SHORT_FORMAT_CONTEXT_ID:
2073 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);
2074 proto_tree_add_item(ti_tree, hf_cst_short_format_context_id, tvb, tlv_offset, length, FALSE);
2078 } /* end of switch */
2079 tlv_offset += length;
2080 } /* end of while loop */
2083 case CST_PHS_DSC_ACTION:
2084 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_cst_encoding_rules, csper_tree, hf_cst_phs_dsc_action, tvb, offset, tlv_len, FALSE);
2085 proto_tree_add_item(tlv_tree, hf_cst_phs_dsc_action, tvb, offset, tlv_len, FALSE);
2089 /* add TLV subtree */
2090 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_cst_encoding_rules, csper_tree, hf_cst_phs_rule, tvb, offset, tlv_len, FALSE);
2091 tlv_offset = offset;
2092 while(tlv_offset < (tlv_len + offset))
2094 /* get the TLV information */
2095 init_tlv_info(&tlv_info, tvb, tlv_offset);
2096 /* get the TLV type */
2097 tlv_type = get_tlv_type(&tlv_info);
2098 /* get the TLV length */
2099 length = get_tlv_length(&tlv_info);
2100 if(tlv_type == -1 || length > MAX_TLV_LEN || length < 1)
2101 { /* invalid tlv info */
2104 col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "PHS n Rule TLV error");
2106 proto_tree_add_item(tlv_tree, hf_cst_invalid_tlv, tvb, offset, (tlv_len - tlv_offset), FALSE);
2109 #ifdef DEBUG /* for debug only */
2110 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);
2112 /* update the offset */
2113 tlv_offset += get_tlv_value_offset(&tlv_info);
2117 ti_tree = add_tlv_subtree(&tlv_info, ett_wimax_cst_encoding_rules, tlv_tree, hf_cst_phs_phsi, tvb, tlv_offset, length, FALSE);
2118 proto_tree_add_item(ti_tree, hf_cst_phs_phsi, tvb, tlv_offset, length, FALSE);
2121 ti_tree = add_tlv_subtree(&tlv_info, ett_wimax_cst_encoding_rules, tlv_tree, hf_cst_phs_phsf, tvb, tlv_offset, length, FALSE);
2122 proto_tree_add_item(ti_tree, hf_cst_phs_phsf, tvb, tlv_offset, length, FALSE);
2125 ti_tree = add_tlv_subtree(&tlv_info, ett_wimax_cst_encoding_rules, tlv_tree, hf_cst_phs_phsm, tvb, tlv_offset, length, FALSE);
2126 proto_tree_add_item(ti_tree, hf_cst_phs_phsm, tvb, tlv_offset, length, FALSE);
2129 ti_tree = add_tlv_subtree(&tlv_info, ett_wimax_cst_encoding_rules, tlv_tree, hf_cst_phs_phss, tvb, tlv_offset, length, FALSE);
2130 proto_tree_add_item(ti_tree, hf_cst_phs_phss, tvb, tlv_offset, length, FALSE);
2133 ti_tree = add_tlv_subtree(&tlv_info, ett_wimax_cst_encoding_rules, tlv_tree, hf_cst_phs_phsv, tvb, tlv_offset, length, FALSE);
2134 proto_tree_add_item(ti_tree, hf_cst_phs_phsv, tvb, tlv_offset, length, FALSE);
2136 case CST_PHS_VENDOR_SPEC:
2137 ti_tree = add_tlv_subtree(&tlv_info, ett_wimax_cst_encoding_rules, tlv_tree, hf_cst_phs_vendor_spec, tvb, tlv_offset, length, FALSE);
2138 proto_tree_add_item(ti_tree, hf_cst_phs_vendor_spec, tvb, tlv_offset, length, FALSE);
2141 tlv_offset += length;
2146 /* display the unknown csper type in hex */
2147 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_cst_encoding_rules, tree, hf_csper_unknown_type, tvb, offset, tlv_len, FALSE);
2148 proto_tree_add_item(tlv_tree, hf_csper_unknown_type, tvb, offset, tlv_len, FALSE);
2150 } /* end of switch */
2153 } /* end of while loop */
2156 /**************************************************************/
2157 /* wimax_service_flow_encodings_decoder() */
2158 /* decode and display the WiMax Service Flow Encodings */
2160 /* tvb - pointer of the tvb of service flow encodings */
2161 /* tree - pointer of Wireshark display tree */
2162 /* pinfo - pointer of Wireshark packet information structure*/
2163 /**************************************************************/
2164 void wimax_service_flow_encodings_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
2167 guint tvb_len, tlv_len, tlv_value_offset, tlv_value;
2170 proto_item *tlv_item = NULL;
2171 proto_tree *tlv_tree = NULL;
2172 tlv_info_t tlv_info;
2174 /* get the tvb reported length */
2175 tvb_len = tvb_reported_length(tvb);
2176 #ifdef DEBUG /* for debug only */
2177 /* display dissector information */
2178 proto_tree_add_protocol_format(tree, proto_wimax_utility_decoders, tvb, 0, tvb_len, "WiMax Service Flow Encodings (%u bytes)", tvb_len);
2180 /* process WiMax Service Flow Encodings */
2182 /* do nothing if the TLV fields is not exist */
2185 /* report error if the packet size is less than 2 bytes (type+length) */
2187 { /* invalid tlv info */
2190 col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "Invalid Service Flow Encodings");
2194 while(offset < tvb_len)
2195 { /* get the TLV information */
2196 init_tlv_info(&tlv_info, tvb, offset);
2197 /* get the TLV type */
2198 tlv_type = get_tlv_type(&tlv_info);
2199 /* get the TLV length */
2200 tlv_len = get_tlv_length(&tlv_info);
2201 if(tlv_type == -1 || tlv_len > MAX_TLV_LEN || tlv_len < 1)
2202 { /* invalid tlv info */
2205 col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "Service Flow Encodings TLV error");
2207 proto_tree_add_item(tree, hf_cst_invalid_tlv, tvb, offset, (tvb_len - offset), FALSE);
2210 /* get the TLV value offset */
2211 tlv_value_offset = get_tlv_value_offset(&tlv_info);
2212 #ifdef DEBUG /* for debug only */
2213 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);
2215 /* update the offset */
2216 offset += tlv_value_offset;
2217 /* parse the Service Flow Encodings TLV */
2221 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_service_flow_encodings, tree, hf_sfe_sf_id, tvb, offset, tlv_len, FALSE);
2222 proto_tree_add_item(tlv_tree, hf_sfe_sf_id, tvb, offset, tlv_len, FALSE);
2225 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_service_flow_encodings, tree, hf_sfe_cid, tvb, offset, tlv_len, FALSE);
2226 proto_tree_add_item(tlv_tree, hf_sfe_cid, tvb, offset, tlv_len, FALSE);
2228 case SFE_SERVICE_CLASS_NAME:
2229 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_service_flow_encodings, tree, hf_sfe_service_class_name, tvb, offset, tlv_len, FALSE);
2230 proto_tree_add_item(tlv_tree, hf_sfe_service_class_name, tvb, offset, tlv_len, FALSE);
2232 case SFE_MBS_SERVICE:
2233 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_service_flow_encodings, tree, hf_sfe_mbs_service, tvb, offset, tlv_len, FALSE);
2234 proto_tree_add_item(tlv_tree, hf_sfe_mbs_service, tvb, offset, tlv_len, FALSE);
2236 case SFE_QOS_PARAMS_SET:
2237 /* add TLV subtree */
2238 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_service_flow_encodings, tree, hf_sfe_qos_params_set, tvb, offset, tlv_len, FALSE);
2239 proto_tree_add_item(tlv_tree, hf_sfe_set_provisioned, tvb, offset, 1, FALSE);
2240 proto_tree_add_item(tlv_tree, hf_sfe_set_admitted, tvb, offset, 1, FALSE);
2241 proto_tree_add_item(tlv_tree, hf_sfe_set_active, tvb, offset, 1, FALSE);
2242 proto_tree_add_item(tlv_tree, hf_sfe_set_rsvd, tvb, offset, 1, FALSE);
2244 case SFE_TRAFFIC_PRIORITY:
2245 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_service_flow_encodings, tree, hf_sfe_traffic_priority, tvb, offset, tlv_len, FALSE);
2246 tlv_item = proto_tree_add_item(tlv_tree, hf_sfe_traffic_priority, tvb, offset, tlv_len, FALSE);
2247 proto_item_append_text(tlv_item, " (allowed values are 0-7)");
2250 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_service_flow_encodings, tree, hf_sfe_max_str, tvb, offset, tlv_len, FALSE);
2251 tlv_item = proto_tree_add_item(tlv_tree, hf_sfe_max_str, tvb, offset, tlv_len, FALSE);
2252 proto_item_append_text(tlv_item, " bps");
2254 case SFE_MAX_TRAFFIC_BURST:
2255 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_service_flow_encodings, tree, hf_sfe_max_traffic_burst, tvb, offset, tlv_len, FALSE);
2256 tlv_item = proto_tree_add_item(tlv_tree, hf_sfe_max_traffic_burst, tvb, offset, tlv_len, FALSE);
2257 proto_item_append_text(tlv_item, " bytes");
2260 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_service_flow_encodings, tree, hf_sfe_min_rtr, tvb, offset, tlv_len, FALSE);
2261 tlv_item = proto_tree_add_item(tlv_tree, hf_sfe_min_rtr, tvb, offset, tlv_len, FALSE);
2262 proto_item_append_text(tlv_item, " bps");
2264 case SFE_RESERVED_10:
2265 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_service_flow_encodings, tree, hf_sfe_reserved_10, tvb, offset, tlv_len, FALSE);
2266 proto_tree_add_item(tlv_tree, hf_sfe_reserved_10, tvb, offset, tlv_len, FALSE);
2268 case SFE_UL_SCHEDULING:
2269 /* TODO: Find a way to get the correct service type from the TLV */
2270 tlv_value = tvb_get_guint8(tvb, offset);
2271 set_service_type( tlv_value );
2272 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_service_flow_encodings, tree, hf_sfe_ul_grant_scheduling, tvb, offset, tlv_len, FALSE);
2273 proto_tree_add_item(tlv_tree, hf_sfe_ul_grant_scheduling, tvb, offset, tlv_len, FALSE);
2276 /* add TLV subtree */
2277 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_service_flow_encodings, tree, hf_sfe_req_tx_policy, tvb, offset, tlv_len, FALSE);
2278 proto_tree_add_item(tlv_tree, hf_sfe_policy_broadcast_bwr, tvb, offset, 1, FALSE);
2279 proto_tree_add_item(tlv_tree, hf_sfe_policy_multicast_bwr, tvb, offset, 1, FALSE);
2280 proto_tree_add_item(tlv_tree, hf_sfe_policy_piggyback, tvb, offset, 1, FALSE);
2281 proto_tree_add_item(tlv_tree, hf_sfe_policy_fragment, tvb, offset, 1, FALSE);
2282 proto_tree_add_item(tlv_tree, hf_sfe_policy_headers, tvb, offset, 1, FALSE);
2283 proto_tree_add_item(tlv_tree, hf_sfe_policy_packing, tvb, offset, 1, FALSE);
2284 proto_tree_add_item(tlv_tree, hf_sfe_policy_crc, tvb, offset, 1, FALSE);
2285 proto_tree_add_item(tlv_tree, hf_sfe_policy_rsvd1, tvb, offset, 1, FALSE);
2287 case SFE_TOLERATED_JITTER:
2288 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_service_flow_encodings, tree, hf_sfe_jitter, tvb, offset, tlv_len, FALSE);
2289 tlv_item = proto_tree_add_item(tlv_tree, hf_sfe_jitter, tvb, offset, tlv_len, FALSE);
2290 proto_item_append_text(tlv_item, " ms");
2292 case SFE_MAX_LATENCY:
2293 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_service_flow_encodings, tree, hf_sfe_max_latency, tvb, offset, tlv_len, FALSE);
2294 tlv_item = proto_tree_add_item(tlv_tree, hf_sfe_max_latency, tvb, offset, tlv_len, FALSE);
2295 proto_item_append_text(tlv_item, " ms");
2297 case SFE_FIXED_LEN_SDU:
2298 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_service_flow_encodings, tree, hf_sfe_fixed_len_sdu, tvb, offset, tlv_len, FALSE);
2299 proto_tree_add_item(tlv_tree, hf_sfe_fixed_len_sdu, tvb, offset, tlv_len, FALSE);
2302 /* save the SDU size */
2303 mac_sdu_length = tvb_get_guint8(tvb, offset);
2304 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_service_flow_encodings, tree, hf_sfe_sdu_size, tvb, offset, tlv_len, FALSE);
2305 tlv_item = proto_tree_add_item(tlv_tree, hf_sfe_sdu_size, tvb, offset, tlv_len, FALSE);
2306 proto_item_append_text(tlv_item, " bytes");
2308 case SFE_TARGET_SAID:
2309 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_service_flow_encodings, tree, hf_sfe_target_said, tvb, offset, tlv_len, FALSE);
2310 proto_tree_add_item(tlv_tree, hf_sfe_target_said, tvb, offset, tlv_len, FALSE);
2312 case SFE_ARQ_ENABLE:
2313 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_service_flow_encodings, tree, hf_sfe_arq_enable, tvb, offset, tlv_len, FALSE);
2314 proto_tree_add_item(tlv_tree, hf_sfe_arq_enable, tvb, offset, tlv_len, FALSE);
2316 case SFE_ARQ_WINDOW_SIZE:
2317 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_service_flow_encodings, tree, hf_sfe_arq_window_size, tvb, offset, tlv_len, FALSE);
2318 proto_tree_add_item(tlv_tree, hf_sfe_arq_window_size, tvb, offset, tlv_len, FALSE);
2320 case SFE_ARQ_TRANSMITTER_DELAY:
2321 if (include_cor2_changes)
2323 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_service_flow_encodings, tree, hf_sfe_arq_transmitter_delay_cor2, tvb, offset, tlv_len, FALSE);
2324 proto_tree_add_item(tlv_tree, hf_sfe_arq_transmitter_delay_cor2, tvb, offset, tlv_len, FALSE);
2328 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_service_flow_encodings, tree, hf_sfe_arq_transmitter_delay, tvb, offset, tlv_len, FALSE);
2329 proto_tree_add_item(tlv_tree, hf_sfe_arq_transmitter_delay, tvb, offset, tlv_len, FALSE);
2332 case SFE_ARQ_RECEIVER_DELAY:
2333 if (include_cor2_changes)
2335 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_service_flow_encodings, tree, hf_sfe_arq_receiver_delay_cor2, tvb, offset, tlv_len, FALSE);
2336 proto_tree_add_item(tlv_tree, hf_sfe_arq_receiver_delay_cor2, tvb, offset, tlv_len, FALSE);
2340 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_service_flow_encodings, tree, hf_sfe_arq_receiver_delay, tvb, offset, tlv_len, FALSE);
2341 proto_tree_add_item(tlv_tree, hf_sfe_arq_receiver_delay, tvb, offset, tlv_len, FALSE);
2344 case SFE_ARQ_BLOCK_LIFETIME:
2345 if (include_cor2_changes)
2347 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_service_flow_encodings, tree, hf_sfe_arq_block_lifetime_cor2, tvb, offset, tlv_len, FALSE);
2348 proto_tree_add_item(tlv_tree, hf_sfe_arq_block_lifetime_cor2, tvb, offset, tlv_len, FALSE);
2352 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_service_flow_encodings, tree, hf_sfe_arq_block_lifetime, tvb, offset, tlv_len, FALSE);
2353 proto_tree_add_item(tlv_tree, hf_sfe_arq_block_lifetime, tvb, offset, tlv_len, FALSE);
2356 case SFE_ARQ_SYNC_LOSS_TIMEOUT:
2357 if (include_cor2_changes)
2359 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);
2360 proto_tree_add_item(tlv_tree, hf_sfe_arq_sync_loss_timeout_cor2, tvb, offset, tlv_len, FALSE);
2364 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_service_flow_encodings, tree, hf_sfe_arq_sync_loss_timeout, tvb, offset, tlv_len, FALSE);
2365 proto_tree_add_item(tlv_tree, hf_sfe_arq_sync_loss_timeout, tvb, offset, tlv_len, FALSE);
2368 case SFE_ARQ_DELIVER_IN_ORDER:
2369 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_service_flow_encodings, tree, hf_sfe_arq_deliver_in_order, tvb, offset, tlv_len, FALSE);
2370 proto_tree_add_item(tlv_tree, hf_sfe_arq_deliver_in_order, tvb, offset, tlv_len, FALSE);
2372 case SFE_ARQ_RX_PURGE_TIMEOUT:
2373 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_service_flow_encodings, tree, hf_sfe_arq_rx_purge_timeout, tvb, offset, tlv_len, FALSE);
2374 proto_tree_add_item(tlv_tree, hf_sfe_arq_rx_purge_timeout, tvb, offset, tlv_len, FALSE);
2376 case SFE_ARQ_BLOCK_SIZE:
2377 if (include_cor2_changes)
2379 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_service_flow_encodings, tree, hf_sfe_arq_block_size_cor2, tvb, offset, tlv_len, FALSE);
2380 tlv_item = proto_tree_add_item(tlv_tree, hf_sfe_arq_block_size_cor2, tvb, offset, tlv_len, FALSE);
2381 /* add TLV subtree */
2382 tlv_tree = proto_item_add_subtree(tlv_item, ett_wimax_service_flow_encodings);
2383 value = tvb_get_guint8(tvb, offset);
2384 tlv_item = proto_tree_add_item(tlv_tree, hf_sfe_arq_min_block_size, tvb, offset, 1, FALSE);
2385 /* Size is 2^((value & 0x0F) + 4)) */
2386 proto_item_append_text(tlv_item, " ( %d bytes )", 0x10 << (value & 0x0F));
2387 tlv_item = proto_tree_add_item(tlv_tree, hf_sfe_arq_max_block_size, tvb, offset, 1, FALSE);
2389 /* Size is 2^(((value & 0xF0) >> 4) + 4)) */
2390 proto_item_append_text(tlv_item, " ( %d bytes )", 0x10 << ((value & 0xF0) >> 4));
2394 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_service_flow_encodings, tree, hf_sfe_arq_block_size, tvb, offset, tlv_len, FALSE);
2395 proto_tree_add_item(tlv_tree, hf_sfe_arq_block_size, tvb, offset, tlv_len, FALSE);
2398 case SFE_CS_SPECIFICATION:
2399 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_service_flow_encodings, tree, hf_sfe_cs_specification, tvb, offset, tlv_len, FALSE);
2400 proto_tree_add_item(tlv_tree, hf_sfe_cs_specification, tvb, offset, tlv_len, FALSE);
2402 case SFE_TYPE_OF_DATA_DELIVERY_SERVICES:
2403 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);
2404 proto_tree_add_item(tlv_tree, hf_sfe_type_of_data_delivery_services, tvb, offset, tlv_len, FALSE);
2406 case SFE_SDU_INTER_ARRIVAL_INTERVAL:
2407 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_service_flow_encodings, tree, hf_sfe_sdu_inter_arrival_interval, tvb, offset, tlv_len, FALSE);
2408 proto_tree_add_item(tlv_tree, hf_sfe_sdu_inter_arrival_interval, tvb, offset, tlv_len, FALSE);
2411 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_service_flow_encodings, tree, hf_sfe_time_base, tvb, offset, tlv_len, FALSE);
2412 tlv_item = proto_tree_add_item(tlv_tree, hf_sfe_time_base, tvb, offset, tlv_len, FALSE);
2413 proto_item_append_text(tlv_item, " ms");
2415 case SFE_PAGING_PREFERENCE:
2416 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_service_flow_encodings, tree, hf_sfe_paging_preference, tvb, offset, tlv_len, FALSE);
2417 proto_tree_add_item(tlv_tree, hf_sfe_paging_preference, tvb, offset, tlv_len, FALSE);
2419 case SFE_MBS_ZONE_IDENTIFIER_ASSIGNMENT:
2420 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_service_flow_encodings, tree, hf_sfe_mbs_zone_identifier_assignment, tvb, offset, tlv_len, FALSE);
2421 proto_tree_add_item(tlv_tree, hf_sfe_mbs_zone_identifier_assignment, tvb, offset, tlv_len, FALSE);
2423 case SFE_RESERVED_34:
2424 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_service_flow_encodings, tree, hf_sfe_reserved_34, tvb, offset, tlv_len, FALSE);
2425 proto_tree_add_item(tlv_tree, hf_sfe_reserved_34, tvb, offset, tlv_len, FALSE);
2427 case SFE_GLOBAL_SERVICE_CLASS_NAME:
2428 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_service_flow_encodings, tree, hf_sfe_global_service_class_name, tvb, offset, tlv_len, FALSE);
2429 proto_tree_add_item(tlv_tree, hf_sfe_global_service_class_name, tvb, offset, tlv_len, FALSE);
2432 case SFE_RESERVED_36:
2433 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_service_flow_encodings, tree, hf_sfe_reserved_36, tvb, offset, tlv_len, FALSE);
2434 proto_tree_add_item(tlv_tree, hf_sfe_reserved_36, tvb, offset, tlv_len, FALSE);
2437 case SFE_SN_FEEDBACK_ENABLED:
2438 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_service_flow_encodings, tree, hf_sfe_sn_feedback_enabled, tvb, offset, tlv_len, FALSE);
2439 proto_tree_add_item(tlv_tree, hf_sfe_sn_feedback_enabled, tvb, offset, tlv_len, FALSE);
2442 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_service_flow_encodings, tree, hf_sfe_fsn_size, tvb, offset, tlv_len, FALSE);
2443 proto_tree_add_item(tlv_tree, hf_sfe_fsn_size, tvb, offset, tlv_len, FALSE);
2445 case SFE_CID_ALLOCATION_FOR_ACTIVE_BS:
2446 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);
2447 for(i = 0; i < tlv_len; i+=2)
2448 proto_tree_add_item(tlv_tree, hf_sfe_cid_alloc_for_active_bs_cid, tvb, (offset+i), 2, FALSE);
2450 case SFE_UNSOLICITED_GRANT_INTERVAL:
2451 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_service_flow_encodings, tree, hf_sfe_unsolicited_grant_interval, tvb, offset, tlv_len, FALSE);
2452 tlv_item = proto_tree_add_item(tlv_tree, hf_sfe_unsolicited_grant_interval, tvb, offset, tlv_len, FALSE);
2453 proto_item_append_text(tlv_item, " ms");
2455 case SFE_UNSOLOCITED_POLLING_INTERVAL:
2456 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_service_flow_encodings, tree, hf_sfe_unsolicited_polling_interval, tvb, offset, tlv_len, FALSE);
2457 tlv_item = proto_tree_add_item(tlv_tree, hf_sfe_unsolicited_polling_interval, tvb, offset, tlv_len, FALSE);
2458 proto_item_append_text(tlv_item, " ms");
2460 case SFE_PDU_SN_EXT_SUBHEADER_HARQ_REORDER:
2461 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);
2462 proto_tree_add_item(tlv_tree, hf_sfe_pdu_sn_ext_subheader_reorder, tvb, offset, tlv_len, FALSE);
2464 case SFE_MBS_CONTENTS_ID:
2465 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_service_flow_encodings, tree, hf_sfe_mbs_contents_ids, tvb, offset, tlv_len, FALSE);
2466 proto_tree_add_item(tlv_tree, hf_sfe_mbs_contents_ids, tvb, offset, tlv_len, FALSE);
2467 for(i = 0; i < tlv_len; i+=2)
2468 proto_tree_add_item(tlv_tree, hf_sfe_mbs_contents_ids_id, tvb, (offset+i), 2, FALSE);
2470 case SFE_HARQ_SERVICE_FLOWS:
2471 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_service_flow_encodings, tree, hf_sfe_harq_service_flows, tvb, offset, tlv_len, FALSE);
2472 proto_tree_add_item(tlv_tree, hf_sfe_harq_service_flows, tvb, offset, tlv_len, FALSE);
2474 case SFE_AUTHORIZATION_TOKEN:
2475 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_service_flow_encodings, tree, hf_sfe_authorization_token, tvb, offset, tlv_len, FALSE);
2476 proto_tree_add_item(tlv_tree, hf_sfe_authorization_token, tvb, offset, tlv_len, FALSE);
2478 case SFE_HARQ_CHANNEL_MAPPING:
2479 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_service_flow_encodings, tree, hf_sfe_harq_channel_mapping_index, tvb, offset, tlv_len, FALSE);
2480 for(i = 0; i < tlv_len; i++)
2481 proto_tree_add_item(tlv_tree, hf_sfe_harq_channel_mapping_index, tvb, (offset+i), 1, FALSE);
2483 /* 99 - 111 CS parameter encodings */
2485 case SFE_CSPER_PACKET_IPV4:
2486 case SFE_CSPER_PACKET_IPV6:
2487 case SFE_CSPER_PACKET_802_3:
2488 case SFE_CSPER_PACKET_802_1Q:
2489 case SFE_CSPER_PACKET_IPV4_802_3:
2490 case SFE_CSPER_PACKET_IPV6_802_3:
2491 case SFE_CSPER_PACKET_IPV4_802_1Q:
2492 case SFE_CSPER_PACKET_IPV6_802_1Q:
2493 case SFE_CSPER_PACKET_IP_ROCH_COMPRESSION:
2494 case SFE_CSPER_PACKET_IP_ECRTP_COMPRESSION:
2495 case SFE_CSPER_PACKET_IP_802_3_ROCH_COMPRESSION:
2496 case SFE_CSPER_PACKET_IP_802_3_ECRTP_COMPRESSION:
2497 /* call CS Parameter Encoding Rules handling function */
2498 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);
2499 wimax_convengence_service_parameter_encoding_rules_decoder(tlv_type, tvb_new_subset(tvb, offset, tlv_len, tlv_len), pinfo, tlv_tree);
2502 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_service_flow_encodings, tree, hf_sfe_unknown_type, tvb, offset, tlv_len, FALSE);
2503 /* display the unknown sfe type in hex */
2504 proto_tree_add_item(tlv_tree, hf_sfe_unknown_type, tvb, offset, tlv_len, FALSE);
2506 } /* end of switch */
2508 } /* end of while loop */
2511 /**************************************************************/
2512 /* wimax_hmac_tuple_decoder() */
2513 /* decode and display the WiMax HMAC Tuple (Table 348) */
2515 /* tree - pointer of Wireshark display tree */
2516 /* tvb - pointer of the tvb which contains the HMAC Tuple */
2517 /* offset - the HMAC Tuple offset in the tvb */
2518 /* length - length of the HMAC Tuple */
2519 /**************************************************************/
2520 void wimax_hmac_tuple_decoder(proto_tree *tree, tvbuff_t *tvb, guint offset, guint length)
2523 proto_item *hmac_item = NULL;
2524 proto_tree *hmac_tree = NULL;
2526 /* display decoder info (length should be 21 bytes) */
2527 hmac_item = proto_tree_add_protocol_format(tree, proto_wimax_utility_decoders, tvb, offset, length, "HMAC Tuple (%u bytes)", length);
2528 /* add HMAC subtree */
2529 hmac_tree = proto_item_add_subtree(hmac_item, ett_wimax_hmac_tuple);
2530 /* init the local offset */
2531 hmac_offset = offset;
2532 /* decode and display HMAC Tuple */
2533 proto_tree_add_item(hmac_tree, hf_xmac_tuple_rsvd, tvb, hmac_offset, 1, FALSE);
2534 proto_tree_add_item(hmac_tree, hf_xmac_tuple_key_seq_num, tvb, hmac_offset, 1, FALSE);
2536 proto_tree_add_item(hmac_tree, hf_hmac_tuple_hmac_digest, tvb, hmac_offset, (length-1), FALSE);
2539 /**************************************************************/
2540 /* wimax_cmac_tuple_decoder() */
2541 /* decode and display the WiMax CMAC Tuple (Table 348b) */
2543 /* tree - pointer of Wireshark display tree */
2544 /* tvb - pointer of the tvb which contains the CMAC Tuple */
2545 /* offset - the CMAC Tuple offset in the tvb */
2546 /* length - length of the CMAC Tuple */
2547 /**************************************************************/
2548 void wimax_cmac_tuple_decoder(proto_tree *tree, tvbuff_t *tvb, guint offset, guint length)
2551 proto_item *cmac_item = NULL;
2552 proto_tree *cmac_tree = NULL;
2554 /* display decoder info (length should be 13 or 19 bytes) */
2555 cmac_item = proto_tree_add_protocol_format(tree, proto_wimax_utility_decoders, tvb, offset, length, "CMAC Tuple (%u bytes)", length);
2556 /* add CMAC subtree */
2557 cmac_tree = proto_item_add_subtree(cmac_item, ett_wimax_cmac_tuple);
2558 /* init the local offset */
2559 cmac_offset = offset;
2560 /* decode and display CMAC Tuple */
2561 proto_tree_add_item(cmac_tree, hf_xmac_tuple_rsvd, tvb, cmac_offset, 1, FALSE);
2562 proto_tree_add_item(cmac_tree, hf_xmac_tuple_key_seq_num, tvb, cmac_offset, 1, FALSE);
2566 proto_tree_add_item(cmac_tree, hf_cmac_tuple_bsid, tvb, cmac_offset, 6, FALSE);
2569 proto_tree_add_item(cmac_tree, hf_packet_number_counter, tvb, cmac_offset, 4, FALSE);
2571 proto_tree_add_item(cmac_tree, hf_cmac_tuple_cmac_value, tvb, cmac_offset, 8, FALSE);
2574 /******************************************************************/
2575 /* wimax_short_hmac_tuple_decoder() */
2576 /* decode and display the WiMax Short-HMAC Tuple (Table 348d) */
2578 /* tree - pointer of Wireshark display tree */
2579 /* tvb - pointer of the tvb which contains the Short-HMAC Tuple */
2580 /* offset - the Short-HMAC Tuple offset in the tvb */
2581 /* length - length of the Short-HMAC Tuple */
2582 /******************************************************************/
2583 void wimax_short_hmac_tuple_decoder(proto_tree *tree, tvbuff_t *tvb, guint offset, guint length)
2586 proto_item *hmac_item = NULL;
2587 proto_tree *hmac_tree = NULL;
2589 /* display decoder info (length should be at least 13 bytes ???) */
2590 hmac_item = proto_tree_add_protocol_format(tree, proto_wimax_utility_decoders, tvb, offset, length, "Short-HMAC Tuple (%u bytes)", length);
2591 /* add Short-HMAC subtree */
2592 hmac_tree = proto_item_add_subtree(hmac_item, ett_wimax_short_hmac_tuple);
2593 /* init the local offset */
2594 hmac_offset = offset;
2595 /* decode and display Short-HMAC Tuple */
2596 proto_tree_add_item(hmac_tree, hf_xmac_tuple_rsvd, tvb, hmac_offset, 1, FALSE);
2597 proto_tree_add_item(hmac_tree, hf_xmac_tuple_key_seq_num, tvb, hmac_offset, 1, FALSE);
2599 proto_tree_add_item(hmac_tree, hf_packet_number_counter, tvb, hmac_offset, 4, FALSE);
2601 proto_tree_add_item(hmac_tree, hf_hmac_tuple_hmac_digest, tvb, hmac_offset, length - offset - 3, FALSE);
2604 /******************************************************************/
2605 /* wimax_security_negotiation_parameters_decoder() */
2606 /* decode and display the WiMax Security Negotiation Parameters */
2608 /* tvb - pointer of the tvb of service flow encodings */
2609 /* tree - pointer of Wireshark display tree */
2610 /* pinfo - pointer of Wireshark packet information structure */
2611 /******************************************************************/
2612 void wimax_security_negotiation_parameters_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
2615 guint tvb_len, tlv_len, tlv_value_offset;
2617 proto_tree *tlv_tree = NULL;
2618 tlv_info_t tlv_info;
2620 /* get the tvb reported length */
2621 tvb_len = tvb_reported_length(tvb);
2622 /* do nothing if the TLV fields is not exist */
2625 /* report error if the packet size is less than 2 bytes (type+length) */
2627 { /* invalid tlv info */
2630 col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "Invalid Security Negotiation Parameters");
2634 /* process Security Negotiation Parameter TLVs */
2635 for(offset = 0; offset < tvb_len; )
2637 /* get the TLV information */
2638 init_tlv_info(&tlv_info, tvb, offset);
2639 /* get the TLV type */
2640 tlv_type = get_tlv_type(&tlv_info);
2641 /* get the TLV length */
2642 tlv_len = get_tlv_length(&tlv_info);
2643 if(tlv_type == -1 || tlv_len > MAX_TLV_LEN || tlv_len < 1)
2644 { /* invalid tlv info */
2647 col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "Security Negotiation Params TLV error");
2649 proto_tree_add_item(tree, hf_cst_invalid_tlv, tvb, offset, (tvb_len - offset), FALSE);
2652 /* get the TLV value offset */
2653 tlv_value_offset = get_tlv_value_offset(&tlv_info);
2654 #ifdef DEBUG /* for debug only */
2655 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);
2657 /* update the offset */
2658 offset += tlv_value_offset;
2659 /* parse Security Negotiation Parameters TLVs */
2662 case PKM_ATTR_SECURITY_NEGOTIATION_PARAMETER_SUB_PKM_VERSION_SUPPORT:
2663 /* add TLV subtree */
2664 tlv_tree = add_tlv_subtree(&tlv_info, ett_security_negotiation_parameters, tree, hf_snp_pkm_version_support, tvb, offset, tlv_len, FALSE);
2665 proto_tree_add_item(tlv_tree, hf_snp_pkm_version_support_bit0, tvb, offset, 1, FALSE);
2666 proto_tree_add_item(tlv_tree, hf_snp_pkm_version_support_bit1, tvb, offset, 1, FALSE);
2667 proto_tree_add_item(tlv_tree, hf_snp_pkm_version_support_reserved, tvb, offset, 1, FALSE);
2669 case PKM_ATTR_SECURITY_NEGOTIATION_PARAMETER_SUB_AUTHORIZATION_POLICY_SUPPORT:
2670 /* add TLV subtree */
2671 tlv_tree = add_tlv_subtree(&tlv_info, ett_security_negotiation_parameters, tree, hf_snp_pkm_version_support, tvb, offset, tlv_len, FALSE);
2672 proto_tree_add_item(tlv_tree, hf_snp_auth_policy_support_bit0, tvb, offset, 1, FALSE);
2673 proto_tree_add_item(tlv_tree, hf_snp_auth_policy_support_bit1, tvb, offset, 1, FALSE);
2674 proto_tree_add_item(tlv_tree, hf_snp_auth_policy_support_bit2, tvb, offset, 1, FALSE);
2675 proto_tree_add_item(tlv_tree, hf_snp_auth_policy_support_bit3, tvb, offset, 1, FALSE);
2676 proto_tree_add_item(tlv_tree, hf_snp_auth_policy_support_bit4, tvb, offset, 1, FALSE);
2677 proto_tree_add_item(tlv_tree, hf_snp_auth_policy_support_bit5, tvb, offset, 1, FALSE);
2678 proto_tree_add_item(tlv_tree, hf_snp_auth_policy_support_bit6, tvb, offset, 1, FALSE);
2679 proto_tree_add_item(tlv_tree, hf_snp_auth_policy_support_bit7, tvb, offset, 1, FALSE);
2681 case PKM_ATTR_SECURITY_NEGOTIATION_PARAMETER_SUB_MESSAGE_AUTHENTICATION_CODE:
2682 /* add TLV subtree */
2683 tlv_tree = add_tlv_subtree(&tlv_info, ett_security_negotiation_parameters, tree, hf_snp_mac_mode, tvb, offset, tlv_len, FALSE);
2684 proto_tree_add_item(tlv_tree, hf_snp_mac_mode_bit0, tvb, offset, 1, FALSE);
2685 if (include_cor2_changes)
2687 proto_tree_add_item(tlv_tree, hf_snp_mac_mode_bit1_rsvd, tvb, offset, 1, FALSE);
2691 proto_tree_add_item(tlv_tree, hf_snp_mac_mode_bit1, tvb, offset, 1, FALSE);
2693 proto_tree_add_item(tlv_tree, hf_snp_mac_mode_bit2, tvb, offset, 1, FALSE);
2694 proto_tree_add_item(tlv_tree, hf_snp_mac_mode_bit3, tvb, offset, 1, FALSE);
2695 proto_tree_add_item(tlv_tree, hf_snp_mac_mode_bit4, tvb, offset, 1, FALSE);
2696 if (include_cor2_changes)
2698 proto_tree_add_item(tlv_tree, hf_snp_mac_mode_bit5, tvb, offset, 1, FALSE);
2699 proto_tree_add_item(tlv_tree, hf_snp_mac_mode_reserved1, tvb, offset, 1, FALSE);
2703 proto_tree_add_item(tlv_tree, hf_snp_mac_mode_reserved, tvb, offset, 1, FALSE);
2706 case PKM_ATTR_SECURITY_NEGOTIATION_PARAMETER_SUB_PN_WINDOW_SIZE:
2707 tlv_tree = add_tlv_subtree(&tlv_info, ett_security_negotiation_parameters, tree, hf_snp_pn_window_size, tvb, offset, tlv_len, FALSE);
2708 proto_tree_add_item(tlv_tree, hf_snp_pn_window_size, tvb, offset, tlv_len, FALSE);
2710 case PKM_ATTR_SECURITY_NEGOTIATION_PARAMETER_SUB_PKM_FLOW_CONTROL:
2711 proto_tree_add_item(tlv_tree, hf_snp_max_conc_transactions, tvb, offset, 1, FALSE);
2713 case PKM_ATTR_SECURITY_NEGOTIATION_PARAMETER_SUB_MAX_SUPPT_SECURITY_ASSNS:
2714 proto_tree_add_item(tlv_tree, hf_snp_max_suppt_sec_assns, tvb, offset, 1, FALSE);
2717 tlv_tree = add_tlv_subtree(&tlv_info, ett_security_negotiation_parameters, tree, hf_snp_unknown_type, tvb, offset, tlv_len, FALSE);
2718 proto_tree_add_item(tlv_tree, hf_snp_unknown_type, tvb, offset, tlv_len, FALSE);
2725 /******************************************************************/
2726 /* wimax_cryptographic_suite_list_decoder() */
2727 /* decode and display the WiMax Cryptographic Suite List */
2729 /* tvb - pointer of the tvb of service flow encodings */
2730 /* tree - pointer of Wireshark display tree */
2731 /* pinfo - pointer of Wireshark packet information structure */
2732 /******************************************************************/
2733 void wimax_cryptographic_suite_list_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
2736 guint tvb_len, tlv_len, tlv_value_offset;
2738 proto_tree *tlv_tree = NULL;
2739 tlv_info_t tlv_info;
2741 /* get the tvb reported length */
2742 tvb_len = tvb_reported_length(tvb);
2743 /* do nothing if the TLV fields is not exist */
2746 /* report error if the packet size is less than 2 bytes (type+length) */
2748 { /* invalid tlv info */
2751 col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "Invalid Crypto Suite List");
2755 /* process Cryptographic Suite List (11.9.15) */
2756 for(offset = 0; offset < tvb_len; )
2757 { /* get the TLV information */
2758 init_tlv_info(&tlv_info, tvb, offset);
2759 /* get the TLV type */
2760 tlv_type = get_tlv_type(&tlv_info);
2761 /* get the TLV length */
2762 tlv_len = get_tlv_length(&tlv_info);
2763 if(tlv_type == -1 || tlv_len > MAX_TLV_LEN || tlv_len < 1)
2764 { /* invalid tlv info */
2767 col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "Crypto Suite List TLV error");
2769 proto_tree_add_item(tree, hf_cst_invalid_tlv, tvb, offset, (tvb_len - offset), FALSE);
2772 /* get the TLV value offset */
2773 tlv_value_offset = get_tlv_value_offset(&tlv_info);
2774 #ifdef DEBUG /* for debug only */
2775 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);
2777 /* update the offset for the TLV value */
2778 offset += tlv_value_offset;
2779 /* parse Cryptographic Suite List */
2782 case PKM_ATTR_CRYPTO_SUITE:
2784 tlv_tree = add_tlv_subtree(&tlv_info, ett_cryptographic_suite_list_decoder, tree, hf_pkm_msg_crypto_suite, tvb, offset, tlv_len, FALSE);
2785 proto_tree_add_item(tlv_tree, hf_pkm_msg_crypto_suite_msb, tvb, offset, 1, FALSE);
2786 proto_tree_add_item(tlv_tree, hf_pkm_msg_crypto_suite_middle, tvb, offset, 1, FALSE);
2787 proto_tree_add_item(tlv_tree, hf_pkm_msg_crypto_suite_lsb, tvb, offset, 1, FALSE);
2790 tlv_tree = add_tlv_subtree(&tlv_info, ett_cryptographic_suite_list_decoder, tree, hf_pkm_msg_unknown_type, tvb, offset, tlv_len, FALSE);
2791 proto_tree_add_item(tlv_tree, hf_pkm_msg_unknown_type, tvb, offset, tlv_len, FALSE);
2795 } /* end of TLV process while loop */
2798 /******************************************************************/
2799 /* wimax_pkm_tlv_encoded_attributes_decoder() */
2800 /* decode and display the WiMax PKM message TLV Encoded Attributes*/
2802 /* tvb - pointer of the tvb of service flow encodings */
2803 /* tree - pointer of Wireshark display tree */
2804 /* pinfo - pointer of Wireshark packet information structure */
2805 /******************************************************************/
2806 void wimax_pkm_tlv_encoded_attributes_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
2809 guint tvb_len, tlv_len, tlv_value_offset;
2811 proto_tree *tlv_tree = NULL;
2812 tlv_info_t tlv_info;
2814 /* get the tvb reported length */
2815 tvb_len = tvb_reported_length(tvb);
2816 /* do nothing if the TLV fields is not exist */
2819 /* report error if the packet size is less than 2 bytes (type+length) */
2821 { /* invalid tlv info */
2824 col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "Invalid PKM TLV");
2828 /* process PKM message TLV Encoded Attributes (11.9) */
2829 for(offset = 0; offset < tvb_len; )
2831 /* get the TLV information */
2832 init_tlv_info(&tlv_info, tvb, offset);
2833 /* get the TLV type */
2834 tlv_type = get_tlv_type(&tlv_info);
2835 /* get the TLV length */
2836 tlv_len = get_tlv_length(&tlv_info);
2837 if(tlv_type == -1 || tlv_len > MAX_TLV_LEN || tlv_len < 1)
2838 { /* invalid tlv info */
2841 col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "PKM TLV error");
2843 proto_tree_add_item(tree, hf_cst_invalid_tlv, tvb, offset, (tvb_len - offset), FALSE);
2846 /* get the TLV value offset */
2847 tlv_value_offset = get_tlv_value_offset(&tlv_info);
2848 #ifdef DEBUG /* for debug only */
2849 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);
2851 /* update the offset for the TLV value */
2852 offset += tlv_value_offset;
2853 /* parse PKM TLV Encoded Attributes (table 370) */
2856 case PKM_ATTR_DISPLAY_STRING:
2857 tlv_tree = add_tlv_subtree(&tlv_info, ett_pkm_tlv_encoded_attributes_decoder, tree, hf_pkm_msg_attr_display, tvb, offset, tlv_len, FALSE);
2858 proto_tree_add_item(tlv_tree, hf_pkm_msg_attr_display, tvb, offset, tlv_len, FALSE);
2860 case PKM_ATTR_AUTH_KEY:
2861 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);
2862 proto_tree_add_item(tlv_tree, hf_pkm_msg_attr_auth_key, tvb, offset, tlv_len, FALSE);
2865 tlv_tree = add_tlv_subtree(&tlv_info, ett_pkm_tlv_encoded_attributes_decoder, tree, hf_pkm_msg_attr_tek, tvb, offset, tlv_len, FALSE);
2866 proto_tree_add_item(tlv_tree, hf_pkm_msg_attr_tek, tvb, offset, tlv_len, FALSE);
2868 case PKM_ATTR_KEY_LIFE_TIME:
2869 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);
2870 proto_tree_add_item(tlv_tree, hf_pkm_msg_attr_key_life_time, tvb, offset, tlv_len, FALSE);
2872 case PKM_ATTR_KEY_SEQ_NUM:
2873 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);
2874 proto_tree_add_item(tlv_tree, hf_pkm_msg_attr_key_seq_num, tvb, offset, tlv_len, FALSE);
2876 case PKM_ATTR_HMAC_DIGEST:
2877 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);
2878 proto_tree_add_item(tlv_tree, hf_pkm_msg_attr_hmac_digest, tvb, offset, tlv_len, FALSE);
2881 tlv_tree = add_tlv_subtree(&tlv_info, ett_pkm_tlv_encoded_attributes_decoder, tree, hf_pkm_msg_attr_said, tvb, offset, tlv_len, FALSE);
2882 proto_tree_add_item(tlv_tree, hf_pkm_msg_attr_said, tvb, offset, tlv_len, FALSE);
2884 case PKM_ATTR_TEK_PARAM:
2885 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);
2887 wimax_tek_parameters_decoder(tvb_new_subset(tvb, offset, tlv_len, tlv_len), pinfo, tlv_tree);
2889 case PKM_ATTR_CBC_IV:
2890 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);
2891 proto_tree_add_item(tlv_tree, hf_pkm_msg_attr_cbc_iv, tvb, offset, tlv_len, FALSE);
2893 case PKM_ATTR_ERROR_CODE:
2894 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);
2895 proto_tree_add_item(tlv_tree, hf_pkm_msg_attr_error_code, tvb, offset, tlv_len, FALSE);
2897 case PKM_ATTR_CA_CERTIFICATE:
2898 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);
2899 proto_tree_add_item(tlv_tree, hf_pkm_msg_attr_ca_certificate, tvb, offset, tlv_len, FALSE);
2901 case PKM_ATTR_SS_CERTIFICATE:
2902 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);
2903 proto_tree_add_item(tlv_tree, hf_pkm_msg_attr_ss_certificate, tvb, offset, tlv_len, FALSE);
2905 case PKM_ATTR_SECURITY_CAPABILITIES:
2906 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);
2908 wimax_security_capabilities_decoder(tvb_new_subset(tvb, offset, tlv_len, tlv_len), pinfo, tlv_tree);
2910 case PKM_ATTR_CRYPTO_SUITE:
2912 tlv_tree = add_tlv_subtree(&tlv_info, ett_pkm_tlv_encoded_attributes_decoder, tree, hf_pkm_msg_crypto_suite, tvb, offset, tlv_len, FALSE);
2913 proto_tree_add_item(tlv_tree, hf_pkm_msg_crypto_suite_msb, tvb, offset, 1, FALSE);
2914 proto_tree_add_item(tlv_tree, hf_pkm_msg_crypto_suite_middle, tvb, offset, 1, FALSE);
2915 proto_tree_add_item(tlv_tree, hf_pkm_msg_crypto_suite_lsb, tvb, offset, 1, FALSE);
2917 case PKM_ATTR_CRYPTO_LIST:
2918 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);
2920 wimax_cryptographic_suite_list_decoder(tvb_new_subset(tvb, offset, tlv_len, tlv_len), pinfo, tlv_tree);
2922 #if 0 /* rserved by IEE 802.16E */
2923 case PKM_ATTR_VERSION:
2924 proto_tree_add_item(tree, hf_pkm_msg_version, tvb, offset, tlv_len, FALSE);
2927 case PKM_ATTR_SA_DESCRIPTOR:
2928 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);
2930 wimax_sa_descriptor_decoder(tvb_new_subset(tvb, offset, tlv_len, tlv_len), pinfo, tlv_tree);
2932 case PKM_ATTR_SA_TYPE:
2933 tlv_tree = add_tlv_subtree(&tlv_info, ett_pkm_tlv_encoded_attributes_decoder, tree, hf_pkm_sa_type, tvb, offset, tlv_len, FALSE);
2934 proto_tree_add_item(tlv_tree, hf_pkm_sa_type, tvb, offset, tlv_len, FALSE);
2936 case PKM_ATTR_SECURITY_NEGOTIATION_PARAMETERS:
2937 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);
2939 wimax_security_negotiation_parameters_decoder(tvb_new_subset(tvb, offset, tlv_len, tlv_len), pinfo, tlv_tree);
2941 case PKM_ATTR_PKM_CONFIG_SETTINGS:
2943 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);
2944 wimax_pkm_configuration_settings_decoder(tvb_new_subset(tvb, offset, tlv_len, tlv_len), pinfo, tlv_tree);
2946 case PKM_ATTR_PKM_EAP_PAYLOAD:
2947 tlv_tree = add_tlv_subtree(&tlv_info, ett_pkm_tlv_encoded_attributes_decoder, tree, hf_pkm_attr_eap_payload, tvb, offset, tlv_len, FALSE);
2948 proto_tree_add_item(tlv_tree, hf_pkm_attr_eap_payload, tvb, offset, tlv_len, FALSE);
2950 case PKM_ATTR_PKM_NONCE:
2951 tlv_tree = add_tlv_subtree(&tlv_info, ett_pkm_tlv_encoded_attributes_decoder, tree, hf_pkm_attr_nonce, tvb, offset, tlv_len, FALSE);
2952 proto_tree_add_item(tlv_tree, hf_pkm_attr_nonce, tvb, offset, tlv_len, FALSE);
2954 case PKM_ATTR_AUTH_RESULT_CODE:
2955 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);
2956 proto_tree_add_item(tlv_tree, hf_pkm_attr_auth_result_code, tvb, offset, tlv_len, FALSE);
2958 case PKM_ATTR_SA_SERVICE_TYPE:
2959 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);
2960 proto_tree_add_item(tlv_tree, hf_pkm_attr_sa_service_type, tvb, offset, tlv_len, FALSE);
2962 case PKM_ATTR_FRAME_NUMBER:
2963 tlv_tree = add_tlv_subtree(&tlv_info, ett_pkm_tlv_encoded_attributes_decoder, tree, hf_pkm_attr_frame_number, tvb, offset, tlv_len, FALSE);
2964 proto_tree_add_item(tlv_tree, hf_pkm_attr_frame_number, tvb, offset, tlv_len, FALSE);
2966 case PKM_ATTR_SS_RANDOM:
2967 tlv_tree = add_tlv_subtree(&tlv_info, ett_pkm_tlv_encoded_attributes_decoder, tree, hf_pkm_attr_ss_random, tvb, offset, tlv_len, FALSE);
2968 proto_tree_add_item(tlv_tree, hf_pkm_attr_ss_random, tvb, offset, tlv_len, FALSE);
2970 case PKM_ATTR_BS_RANDOM:
2971 tlv_tree = add_tlv_subtree(&tlv_info, ett_pkm_tlv_encoded_attributes_decoder, tree, hf_pkm_attr_bs_random, tvb, offset, tlv_len, FALSE);
2972 proto_tree_add_item(tlv_tree, hf_pkm_attr_bs_random, tvb, offset, tlv_len, FALSE);
2974 case PKM_ATTR_PRE_PAK:
2975 tlv_tree = add_tlv_subtree(&tlv_info, ett_pkm_tlv_encoded_attributes_decoder, tree, hf_pkm_attr_pre_pak, tvb, offset, tlv_len, FALSE);
2976 proto_tree_add_item(tlv_tree, hf_pkm_attr_pre_pak, tvb, offset, tlv_len, FALSE);
2978 case PKM_ATTR_BS_CERTIFICATE:
2979 tlv_tree = add_tlv_subtree(&tlv_info, ett_pkm_tlv_encoded_attributes_decoder, tree, hf_pkm_attr_bs_certificate, tvb, offset, tlv_len, FALSE);
2980 proto_tree_add_item(tlv_tree, hf_pkm_attr_bs_certificate, tvb, offset, tlv_len, FALSE);
2982 case PKM_ATTR_SIG_BS:
2983 tlv_tree = add_tlv_subtree(&tlv_info, ett_pkm_tlv_encoded_attributes_decoder, tree, hf_pkm_attr_sig_bs, tvb, offset, tlv_len, FALSE);
2984 proto_tree_add_item(tlv_tree, hf_pkm_attr_sig_bs, tvb, offset, tlv_len, FALSE);
2986 case PKM_ATTR_MS_MAC_ADDRESS:
2987 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);
2988 proto_tree_add_item(tlv_tree, hf_pkm_attr_ms_mac_address, tvb, offset, tlv_len, FALSE);
2990 case PKM_ATTR_CMAC_DIGEST:
2991 /* add TLV subtree */
2992 tlv_tree = add_tlv_subtree(&tlv_info, ett_pkm_tlv_encoded_attributes_decoder, tree, hf_pkm_attr_cmac_digest, tvb, offset, tlv_len, FALSE);
2993 proto_tree_add_item(tlv_tree, hf_pkm_attr_cmac_digest_pn, tvb, offset, 4, FALSE);
2994 proto_tree_add_item(tlv_tree, hf_pkm_attr_cmac_digest_value, tvb, (offset + 4), 8, FALSE);
2996 case PKM_ATTR_KEY_PUSH_MODES:
2997 tlv_tree = add_tlv_subtree(&tlv_info, ett_pkm_tlv_encoded_attributes_decoder, tree, hf_pkm_attr_push_modes, tvb, offset, tlv_len, FALSE);
2998 proto_tree_add_item(tlv_tree, hf_pkm_attr_push_modes, tvb, offset, tlv_len, FALSE);
3000 case PKM_ATTR_KEY_PUSH_COUNTER:
3001 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);
3002 proto_tree_add_item(tlv_tree, hf_pkm_attr_key_push_counter, tvb, offset, tlv_len, FALSE);
3005 tlv_tree = add_tlv_subtree(&tlv_info, ett_pkm_tlv_encoded_attributes_decoder, tree, hf_pkm_attr_gkek, tvb, offset, tlv_len, FALSE);
3006 proto_tree_add_item(tlv_tree, hf_pkm_attr_gkek, tvb, offset, tlv_len, FALSE);
3008 case PKM_ATTR_SIG_SS:
3009 tlv_tree = add_tlv_subtree(&tlv_info, ett_pkm_tlv_encoded_attributes_decoder, tree, hf_pkm_attr_sig_ss, tvb, offset, tlv_len, FALSE);
3010 proto_tree_add_item(tlv_tree, hf_pkm_attr_sig_ss, tvb, offset, tlv_len, FALSE);
3013 tlv_tree = add_tlv_subtree(&tlv_info, ett_pkm_tlv_encoded_attributes_decoder, tree, hf_pkm_attr_akid, tvb, offset, tlv_len, FALSE);
3014 proto_tree_add_item(tlv_tree, hf_pkm_attr_akid, tvb, offset, tlv_len, FALSE);
3017 tlv_tree = add_tlv_subtree(&tlv_info, ett_pkm_tlv_encoded_attributes_decoder, tree, hf_pkm_msg_unknown_type, tvb, offset, tlv_len, FALSE);
3018 proto_tree_add_item(tlv_tree, hf_pkm_msg_unknown_type, tvb, offset, tlv_len, FALSE);
3022 } /* end of TLV process while loop */
3025 /******************************************************************/
3026 /* wimax_tek_parameters_decoder() */
3027 /* decode and display the WiMax TEK Parameters subattributes */
3029 /* tvb - pointer of the tvb of service flow encodings */
3030 /* tree - pointer of Wireshark display tree */
3031 /* pinfo - pointer of Wireshark packet information structure */
3032 /******************************************************************/
3033 void wimax_tek_parameters_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
3036 guint tvb_len, tlv_len, tlv_value_offset;
3038 proto_tree *tlv_tree = NULL;
3039 tlv_info_t tlv_info;
3041 /* get the tvb reported length */
3042 tvb_len = tvb_reported_length(tvb);
3043 /* do nothing if the TLV fields is not exist */
3046 /* report error if the packet size is less than 2 bytes (type+length) */
3048 { /* invalid tlv info */
3051 col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "Invalid TEK Params");
3055 /* process PKM Message TEK Parameters (11.9.8) */
3056 for(offset = 0; offset < tvb_len; )
3058 /* get the TLV information */
3059 init_tlv_info(&tlv_info, tvb, offset);
3060 /* get the TLV type */
3061 tlv_type = get_tlv_type(&tlv_info);
3062 /* get the TLV length */
3063 tlv_len = get_tlv_length(&tlv_info);
3064 if(tlv_type == -1 || tlv_len > MAX_TLV_LEN || tlv_len < 1)
3065 { /* invalid tlv info */
3068 col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "TEK Param TLV error");
3070 proto_tree_add_item(tree, hf_cst_invalid_tlv, tvb, offset, (tvb_len - offset), FALSE);
3073 /* get the TLV value offset */
3074 tlv_value_offset = get_tlv_value_offset(&tlv_info);
3075 #ifdef DEBUG /* for debug only */
3076 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);
3078 /* update the offset for the TLV value */
3079 offset += tlv_value_offset;
3080 /* parse TEK Parameters Subattributes (table 372) */
3084 tlv_tree = add_tlv_subtree(&tlv_info, ett_pkm_tlv_encoded_attributes_decoder, tree, hf_pkm_msg_attr_tek, tvb, offset, tlv_len, FALSE);
3085 proto_tree_add_item(tlv_tree, hf_pkm_msg_attr_tek, tvb, offset, tlv_len, FALSE);
3087 case PKM_ATTR_KEY_LIFE_TIME:
3088 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);
3089 proto_tree_add_item(tlv_tree, hf_pkm_msg_attr_key_life_time, tvb, offset, tlv_len, FALSE);
3091 case PKM_ATTR_KEY_SEQ_NUM:
3092 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);
3093 proto_tree_add_item(tlv_tree, hf_pkm_msg_attr_key_seq_num, tvb, offset, tlv_len, FALSE);
3095 case PKM_ATTR_CBC_IV:
3096 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);
3097 proto_tree_add_item(tlv_tree, hf_pkm_msg_attr_cbc_iv, tvb, offset, tlv_len, FALSE);
3099 case PKM_ATTR_ASSOCIATED_GKEK_SEQ_NUM:
3100 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);
3101 proto_tree_add_item(tlv_tree, hf_pkm_attr_associated_gkek_seq_number, tvb, offset, tlv_len, FALSE);
3104 tlv_tree = add_tlv_subtree(&tlv_info, ett_pkm_tlv_encoded_attributes_decoder, tree, hf_pkm_msg_unknown_type, tvb, offset, tlv_len, FALSE);
3105 proto_tree_add_item(tlv_tree, hf_pkm_msg_unknown_type, tvb, offset, tlv_len, FALSE);
3109 } /* end of TLV process while loop */
3112 /******************************************************************/
3113 /* wimax_pkm_configuration_settings_decoder() */
3114 /* decode and display the WiMax PKM Configuration Settings */
3116 /* tvb - pointer of the tvb of service flow encodings */
3117 /* tree - pointer of Wireshark display tree */
3118 /* pinfo - pointer of Wireshark packet information structure */
3119 /******************************************************************/
3120 void wimax_pkm_configuration_settings_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
3123 guint tvb_len, tlv_len, tlv_value_offset;
3125 proto_tree *tlv_tree;
3126 tlv_info_t tlv_info;
3128 /* get the tvb reported length */
3129 tvb_len = tvb_reported_length(tvb);
3130 /* do nothing if the TLV fields is not exist */
3133 /* report error if the packet size is less than 2 bytes (type+length) */
3135 { /* invalid tlv info */
3138 col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "Invalid PKM Config Settings");
3142 /* process PKM Configuration Settings (11.9.19) */
3143 for(offset = 0; offset < tvb_len; )
3145 /* get the TLV information */
3146 init_tlv_info(&tlv_info, tvb, offset);
3147 /* get the TLV type */
3148 tlv_type = get_tlv_type(&tlv_info);
3149 /* get the TLV length */
3150 tlv_len = get_tlv_length(&tlv_info);
3151 if(tlv_type == -1 || tlv_len > MAX_TLV_LEN || tlv_len < 1)
3152 { /* invalid tlv info */
3155 col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "PKM Config Settings TLV error");
3157 proto_tree_add_item(tree, hf_cst_invalid_tlv, tvb, offset, (tvb_len - offset), FALSE);
3160 /* get the TLV value offset */
3161 tlv_value_offset = get_tlv_value_offset(&tlv_info);
3162 #ifdef DEBUG /* for debug only */
3163 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);
3165 /* update the offset for the TLV value */
3166 offset += tlv_value_offset;
3167 /* parse PKM Configuration Settings (11.9.19.1 - 11.9.19.7 */
3170 case PKM_ATTR_PKM_CONFIG_SETTINGS_AUTHORIZE_WAIT_TIMEOUT:
3171 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);
3172 proto_tree_add_item(tlv_tree, hf_pkm_config_settings_authorize_waitout, tvb, offset, tlv_len, FALSE);
3174 case PKM_ATTR_PKM_CONFIG_SETTINGS_REAUTHORIZE_WAIT_TIMEOUT:
3175 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);
3176 proto_tree_add_item(tlv_tree, hf_pkm_config_settings_reauthorize_waitout, tvb, offset, tlv_len, FALSE);
3178 case PKM_ATTR_PKM_CONFIG_SETTINGS_AUTHORIZATION_GRACE_TIME:
3179 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);
3180 proto_tree_add_item(tlv_tree, hf_pkm_config_settings_grace_time, tvb, offset, tlv_len, FALSE);
3182 case PKM_ATTR_PKM_CONFIG_SETTINGS_OPERATIONAL_WAIT_TIMEOUT:
3183 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);
3184 proto_tree_add_item(tlv_tree, hf_pkm_config_settings_operational_waittime, tvb, offset, tlv_len, FALSE);
3186 case PKM_ATTR_PKM_CONFIG_SETTINGS_REKEY_WAIT_TIMEOUT:
3187 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);
3188 proto_tree_add_item(tlv_tree, hf_pkm_config_settings_rekey_wait_timeout, tvb, offset, tlv_len, FALSE);
3190 case PKM_ATTR_PKM_CONFIG_SETTINGS_TEK_GRACE_TIME:
3191 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);
3192 proto_tree_add_item(tlv_tree, hf_pkm_config_settings_tek_grace_time, tvb, offset, tlv_len, FALSE);
3194 case PKM_ATTR_PKM_CONFIG_SETTINGS_AUTHORIZE_REJECT_WAIT_TIMEOUT:
3195 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);
3196 proto_tree_add_item(tlv_tree, hf_pkm_config_settings_authorize_reject_wait_timeout, tvb, offset, tlv_len, FALSE);
3199 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);
3200 proto_tree_add_item(tlv_tree, hf_pkm_msg_unknown_type, tvb, offset, tlv_len, FALSE);
3204 } /* end of TLV process while loop */
3207 /******************************************************************/
3208 /* wimax_sa_descriptor_decoder() */
3209 /* decode and display the WiMax PKM message SA-Descriptor */
3211 /* tvb - pointer of the tvb of service flow encodings */
3212 /* tree - pointer of Wireshark display tree */
3213 /* pinfo - pointer of Wireshark packet information structure */
3214 /******************************************************************/
3215 void wimax_sa_descriptor_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
3218 guint tvb_len, tlv_len, tlv_value_offset;
3220 proto_tree *tlv_tree = NULL;
3221 tlv_info_t tlv_info;
3223 /* get the tvb reported length */
3224 tvb_len = tvb_reported_length(tvb);
3225 /* do nothing if the TLV fields is not exist */
3228 /* report error if the packet size is less than 2 bytes (type+length) */
3230 { /* invalid tlv info */
3233 col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "Invalid SA-Descriptor");
3237 /* process SA-Descriptor (11.9.17) */
3238 for(offset = 0; offset < tvb_len; )
3240 /* get the TLV information */
3241 init_tlv_info(&tlv_info, tvb, offset);
3242 /* get the TLV type */
3243 tlv_type = get_tlv_type(&tlv_info);
3244 /* get the TLV length */
3245 tlv_len = get_tlv_length(&tlv_info);
3246 if(tlv_type == -1 || tlv_len > MAX_TLV_LEN || tlv_len < 1)
3247 { /* invalid tlv info */
3250 col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "SA-Descriptor TLV error");
3252 proto_tree_add_item(tree, hf_cst_invalid_tlv, tvb, offset, (tvb_len - offset), FALSE);
3255 /* get the TLV value offset */
3256 tlv_value_offset = get_tlv_value_offset(&tlv_info);
3257 #ifdef DEBUG /* for debug only */
3258 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);
3260 /* update the offset for the TLV value */
3261 offset += tlv_value_offset;
3262 /* parse SA-Descriptor (table 380) */
3266 tlv_tree = add_tlv_subtree(&tlv_info, ett_sa_descriptor_decoder, tree, hf_pkm_msg_attr_said, tvb, offset, tlv_len, FALSE);
3267 proto_tree_add_item(tlv_tree, hf_pkm_msg_attr_said, tvb, offset, tlv_len, FALSE);
3269 case PKM_ATTR_SA_TYPE:
3270 tlv_tree = add_tlv_subtree(&tlv_info, ett_sa_descriptor_decoder, tree, hf_pkm_sa_type, tvb, offset, tlv_len, FALSE);
3271 proto_tree_add_item(tlv_tree, hf_pkm_sa_type, tvb, offset, tlv_len, FALSE);
3273 case PKM_ATTR_SA_SERVICE_TYPE:
3274 tlv_tree = add_tlv_subtree(&tlv_info, ett_sa_descriptor_decoder, tree, hf_pkm_attr_sa_service_type, tvb, offset, tlv_len, FALSE);
3275 proto_tree_add_item(tlv_tree, hf_pkm_attr_sa_service_type, tvb, offset, tlv_len, FALSE);
3277 case PKM_ATTR_CRYPTO_SUITE:
3279 tlv_tree = add_tlv_subtree(&tlv_info, ett_sa_descriptor_decoder, tree, hf_pkm_msg_crypto_suite, tvb, offset, tlv_len, FALSE);
3280 proto_tree_add_item(tlv_tree, hf_pkm_msg_crypto_suite_msb, tvb, offset, 1, FALSE);
3281 proto_tree_add_item(tlv_tree, hf_pkm_msg_crypto_suite_middle, tvb, offset, 1, FALSE);
3282 proto_tree_add_item(tlv_tree, hf_pkm_msg_crypto_suite_lsb, tvb, offset, 1, FALSE);
3285 tlv_tree = add_tlv_subtree(&tlv_info, ett_sa_descriptor_decoder, tree, hf_pkm_msg_unknown_type, tvb, offset, tlv_len, FALSE);
3286 proto_tree_add_item(tlv_tree, hf_pkm_msg_unknown_type, tvb, offset, tlv_len, FALSE);
3290 } /* end of TLV process while loop */
3293 /******************************************************************/
3294 /* wimax_security_capabilities_decoder() */
3295 /* decode and display the WiMax Security Capabilities */
3297 /* tvb - pointer of the tvb of service flow encodings */
3298 /* tree - pointer of Wireshark display tree */
3299 /* pinfo - pointer of Wireshark packet information structure */
3300 /******************************************************************/
3301 void wimax_security_capabilities_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
3304 guint tvb_len, tlv_len, tlv_value_offset;
3306 proto_tree *tlv_tree = NULL;
3307 tlv_info_t tlv_info;
3309 /* get the tvb reported length */
3310 tvb_len = tvb_reported_length(tvb);
3311 /* do nothing if the TLV fields is not exist */
3314 /* report error if the packet size is less than 2 bytes (type+length) */
3316 { /* invalid tlv info */
3319 col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "Invalid Security Capabilities");
3323 /* process Security Capabilities (11.9.13) */
3324 for(offset = 0; offset < tvb_len; )
3326 /* get the TLV information */
3327 init_tlv_info(&tlv_info, tvb, offset);
3328 /* get the TLV type */
3329 tlv_type = get_tlv_type(&tlv_info);
3330 /* get the TLV length */
3331 tlv_len = get_tlv_length(&tlv_info);
3332 if(tlv_type == -1 || tlv_len > MAX_TLV_LEN || tlv_len < 1)
3333 { /* invalid tlv info */
3336 col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "Security Capabilities TLV error");
3338 proto_tree_add_item(tree, hf_cst_invalid_tlv, tvb, offset, (tvb_len - offset), FALSE);
3341 /* get the TLV value offset */
3342 tlv_value_offset = get_tlv_value_offset(&tlv_info);
3343 #ifdef DEBUG /* for debug only */
3344 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);
3346 /* update the offset for the TLV value */
3347 offset += tlv_value_offset;
3348 /* parse Security Capabilities (table 374) */
3351 case PKM_ATTR_CRYPTO_LIST:
3352 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);
3354 wimax_cryptographic_suite_list_decoder(tvb_new_subset(tvb, offset, tlv_len, tlv_len), pinfo, tlv_tree);
3357 tlv_tree = add_tlv_subtree(&tlv_info, ett_security_capabilities_decoder, tree, proto_wimax_utility_decoders, tvb, offset, tlv_len, FALSE);
3358 proto_tree_add_item(tlv_tree, hf_pkm_msg_unknown_type, tvb, offset, tlv_len, FALSE);
3362 } /* end of TLV process while loop */
3365 /******************************************************************/
3366 /* wimax_vendor_specific_information_decoder() */
3367 /* decode and display the WiMax Vendor-Specific Information */
3369 /* tvb - pointer of the tvb of service flow encodings */
3370 /* tree - pointer of Wireshark display tree */
3371 /* pinfo - pointer of Wireshark packet information structure */
3372 /******************************************************************/
3373 void wimax_vendor_specific_information_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
3375 proto_tree *tlv_tree = NULL;
3377 guint tvb_len, tlv_len, tlv_value_offset;
3379 tlv_info_t tlv_info;
3381 /* get the tvb reported length */
3382 tvb_len = tvb_reported_length(tvb);
3383 /* do nothing if the TLV fields is not exist */
3386 /* report error if the packet size is less than 2 bytes (type+length) */
3388 { /* invalid tlv info */
3391 col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "Invalid Vendor Specific Info");
3393 proto_tree_add_text(tree, tvb, 0, tvb_len, "Invalid TLV info");
3396 /* process Vendor Specific Information (11.1.6) */
3397 for(offset = 0; offset < tvb_len; )
3399 /* get the TLV information */
3400 init_tlv_info(&tlv_info, tvb, offset);
3401 /* get the TLV type */
3402 tlv_type = get_tlv_type(&tlv_info);
3403 /* get the TLV length */
3404 tlv_len = get_tlv_length(&tlv_info);
3405 if(tlv_type == -1 || tlv_len > MAX_TLV_LEN || tlv_len < 1)
3406 { /* invalid tlv info */
3409 col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "Vendor Specific Info TLV error");
3411 proto_tree_add_item(tree, hf_cst_invalid_tlv, tvb, offset, (tvb_len - offset), FALSE);
3414 /* get the TLV value offset */
3415 tlv_value_offset = get_tlv_value_offset(&tlv_info);
3416 #ifdef DEBUG /* for debug only */
3417 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);
3419 /* parse Vendor Specific Information (11.1.6) */
3420 if(tlv_type == VENDOR_ID_ENCODING)
3422 /* decode and display the Vendor ID Encoding */
3423 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);
3424 proto_tree_add_item(tlv_tree, hf_common_tlv_vendor_id, tvb, (offset + tlv_value_offset), tlv_len, FALSE);
3428 /* decode and display the Vendor Specific Info */
3429 proto_tree_add_item(tree, hf_common_tlv_vendor_specific_type, tvb, offset, 1, FALSE);
3430 if(get_tlv_length_type(&tlv_info) == 0)
3431 { /* single byte TLV length */
3432 proto_tree_add_item(tree, hf_common_tlv_vendor_specific_length, tvb, (offset + 1), 1, FALSE);
3435 { /* multiple bytes TLV length */
3436 /* display the length of the TLV length with MSB */
3437 proto_tree_add_item(tree, hf_common_tlv_vendor_specific_length_size, tvb, (offset + 1), 1, FALSE);
3438 if(get_tlv_size_of_length(&tlv_info))
3439 { /* display the multiple byte TLV length */
3440 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));
3447 proto_tree_add_item(tree, hf_common_tlv_vendor_specific_value, tvb, (offset + tlv_value_offset), tlv_len, FALSE);
3449 /* update the offset */
3450 offset += tlv_value_offset + tlv_len;
3454 /******************************************************************/
3455 /* wimax_common_tlv_encoding_decoder() */
3456 /* decode and display the WiMax Common TLV Encoding (Table 346) */
3458 /* tvb - pointer of the tvb of service flow encodings */
3459 /* tree - pointer of Wireshark display tree */
3460 /* pinfo - pointer of Wireshark packet information structure */
3461 /******************************************************************/
3462 guint wimax_common_tlv_encoding_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
3464 guint offset, value;
3465 guint tvb_len, tlv_len, tlv_value_offset;
3467 proto_tree *tlv_tree = NULL;
3468 tlv_info_t tlv_info;
3469 gfloat current_power;
3471 /* get the tvb reported length */
3472 tvb_len = tvb_reported_length(tvb);
3473 /* do nothing if the TLV fields is not exist */
3476 /* report error if the packet size is less than 2 bytes (type+length) */
3478 { /* invalid tlv info */
3481 col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "Invalid Common TLV encoding");
3483 proto_tree_add_item(tree, hf_cst_invalid_tlv, tvb, 0, tvb_len, FALSE);
3486 /* process Common TLV Encoding (11.1) */
3487 for(offset = 0; offset < tvb_len; )
3489 /* get the TLV information */
3490 init_tlv_info(&tlv_info, tvb, offset);
3491 /* get the TLV type */
3492 tlv_type = get_tlv_type(&tlv_info);
3493 /* get the TLV length */
3494 tlv_len = get_tlv_length(&tlv_info);
3495 if(tlv_type == -1 || tlv_len > MAX_TLV_LEN || tlv_len < 1)
3496 { /* invalid tlv info */
3499 col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "Common TLV encoding TLV error");
3501 proto_tree_add_item(tree, hf_cst_invalid_tlv, tvb, offset, (tvb_len - offset), FALSE);
3504 /* get the TLV value offset */
3505 tlv_value_offset = get_tlv_value_offset(&tlv_info);
3506 #ifdef DEBUG /* for debug only */
3507 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);
3509 /* update the offset for the TLV value */
3510 offset += tlv_value_offset;
3511 /* parse Common TLV Encoding (table 346) */
3514 case VENDOR_SPECIFIC_INFO:
3515 /* display Vendor-Specific Information */
3517 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);
3518 /* decode and display the Vendor-Specific Information */
3519 wimax_vendor_specific_information_decoder(tvb_new_subset(tvb, offset, tlv_len, tlv_len), pinfo, tlv_tree);
3521 case VENDOR_ID_ENCODING:
3522 /* display Vendor ID Encoding */
3524 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);
3525 /* decode and display the Vendor ID Encoding */
3526 proto_tree_add_item(tlv_tree, hf_common_tlv_vendor_id, tvb, offset, tlv_len, FALSE);
3528 case DSx_UPLINK_FLOW:
3529 /* display Uplink Service Flow Encodings info */
3531 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);
3532 /* decode and display the UL Service Flow Encodings */
3533 wimax_service_flow_encodings_decoder(tvb_new_subset(tvb, offset, tlv_len, tlv_len), pinfo, tlv_tree);
3535 case DSx_DOWNLINK_FLOW:
3536 /* display Downlink Service Flow Encodings info */
3538 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);
3539 /* decode and display the DL Service Flow Encodings */
3540 wimax_service_flow_encodings_decoder(tvb_new_subset(tvb,offset, tlv_len, tlv_len), pinfo, tlv_tree);
3542 case CURRENT_TX_POWER:
3543 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);
3544 value = tvb_get_guint8(tvb, offset);
3545 current_power = (gfloat)(value - 128) / 2;
3546 proto_tree_add_text(tlv_tree, tvb, offset, 1, "Current Transmitted Power: %.2f dBm (Value: 0x%x)", (gdouble)current_power, value);
3548 case MAC_VERSION_ENCODING:
3549 /* display MAC Version Encoding */
3551 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);
3552 /* decode and display the MAC Version Encoding */
3553 proto_tree_add_item(tlv_tree, hf_common_tlv_mac_version, tvb, offset, tlv_len, FALSE);
3555 case HMAC_TUPLE: /* Table 348d */
3556 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);
3557 /* decode and display the HMAC Tuple */
3558 wimax_hmac_tuple_decoder(tlv_tree, tvb, offset, tlv_len);
3560 case CMAC_TUPLE: /* Table 348b */
3561 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);
3562 /* decode and display the CMAC Tuple */
3563 wimax_cmac_tuple_decoder(tlv_tree, tvb, offset, tlv_len);
3566 /* Back to calling routine to finish decoding. */
3567 return offset - tlv_value_offset; /* Ret amount decoded. */
3571 } /* end of while loop */