2 * WiMax Utility Decoders
4 * Copyright (c) 2007 by Intel Corporation.
6 * Author: Lu Pan <lu.pan@intel.com>
10 * Wireshark - Network traffic analyzer
11 * By Gerald Combs <gerald@wireshark.org>
12 * Copyright 1999 Gerald Combs
14 * This program is free software; you can redistribute it and/or
15 * modify it under the terms of the GNU General Public License
16 * as published by the Free Software Foundation; either version 2
17 * of the License, or (at your option) any later version.
19 * This program is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
24 * You should have received a copy of the GNU General Public License
25 * along with this program; if not, write to the Free Software
26 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
38 #include <epan/packet.h>
39 #include "wimax_tlv.h"
40 #include "wimax_mac.h"
42 #include "wimax_bits.h"
44 extern gint proto_mac_mgmt_msg_rng_req_decoder;
45 extern gint proto_mac_mgmt_msg_reg_req_decoder;
47 extern gint mac_sdu_length; /* declared in packet-wmx.c */
48 extern gboolean include_cor2_changes;
50 /* forward reference */
51 void wimax_service_flow_encodings_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
52 void wimax_error_parameter_set_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
53 void wimax_security_negotiation_parameters_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
54 void wimax_tek_parameters_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
55 void wimax_pkm_configuration_settings_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
56 void wimax_sa_descriptor_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
57 void wimax_pkm_tlv_encoded_attributes_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
58 void wimax_cryptographic_suite_list_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
59 void wimax_security_capabilities_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
60 void wimax_vendor_specific_information_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
61 guint wimax_common_tlv_encoding_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
63 static gint proto_wimax_utility_decoders = -1;
64 static gint ett_wimax_service_flow_encodings = -1;
65 static gint ett_wimax_cst_encoding_rules = -1;
66 static gint ett_wimax_error_parameter_set = -1;
67 static gint ett_wimax_hmac_tuple = -1;
68 static gint ett_wimax_cmac_tuple = -1;
69 static gint ett_wimax_short_hmac_tuple = -1;
70 static gint ett_security_negotiation_parameters = -1;
71 static gint ett_pkm_tlv_encoded_attributes_decoder = -1;
72 static gint ett_sa_descriptor_decoder = -1;
73 static gint ett_cryptographic_suite_list_decoder = -1;
74 static gint ett_security_capabilities_decoder = -1;
75 static gint ett_vendor_specific_info_decoder = -1;
76 static gint ett_vendor_id_encoding_decoder = -1;
77 static gint ett_ul_service_flow_decoder = -1;
78 static gint ett_dl_service_flow_decoder = -1;
80 static dissector_handle_t eap_handle = NULL;
82 /* The following two variables save the Scheduling Service type for
83 the Grant Management subheader dissector and track whether or not
86 static guint scheduling_service_type = -1;
87 gint seen_a_service_type = 0;
89 /* The following two functions set and access the variables above */
90 guint get_service_type( void )
92 return scheduling_service_type;
95 void set_service_type( guint set_to )
97 if( seen_a_service_type == 0 ){
98 scheduling_service_type = set_to;
99 seen_a_service_type = 1;
103 /* Setup protocol subtree array */
106 &ett_wimax_service_flow_encodings,
107 &ett_wimax_cst_encoding_rules,
108 &ett_wimax_error_parameter_set,
109 &ett_wimax_hmac_tuple,
110 &ett_wimax_cmac_tuple,
111 &ett_wimax_short_hmac_tuple,
112 &ett_security_negotiation_parameters,
113 &ett_pkm_tlv_encoded_attributes_decoder,
114 &ett_sa_descriptor_decoder,
115 &ett_cryptographic_suite_list_decoder,
116 &ett_security_capabilities_decoder,
117 &ett_vendor_specific_info_decoder,
118 &ett_vendor_id_encoding_decoder,
119 &ett_ul_service_flow_decoder,
120 &ett_dl_service_flow_decoder,
123 static const value_string vals_mbs_service[] =
125 {0, "No available MBS"},
126 {1, "Single-BS-MBS"},
131 static const value_string vals_ul_grant_scheduling[] =
134 {1, "Undefined (BS implementation-dependent)"},
138 {5, "Extended rtPS"},
143 static const value_string vals_fixed_len_sdu[] =
145 {0, "Variable-length SDUs (default)"},
146 {1, "Fixed-length SDUs"},
150 static const value_string vals_arq_enable[] =
152 {0, "ARQ not requested/accepted"},
153 {1, "ARQ requested/accepted"},
156 static const value_string vals_arq_block_lifetime[] =
161 static const value_string vals_arq_sync_loss_timeout[] =
167 static const value_string vals_arq_deliver_in_order[] =
169 {0, "Order of delivery is not preserved"},
170 {1, "Order of delivery is preserved"},
173 static const value_string vals_arq_rx_purge_timeout[] =
179 static const value_string vals_fsn_size[] =
182 {1, "11-bit FSN (default)"},
186 static const value_string vals_sn_fb_enable[] =
188 {0, "Is disabled (default)"},
193 static const value_string vals_harq[] =
195 {0, "Non HARQ (default)"},
196 {1, "HARQ connection" },
200 static const value_string vals_cs_specification[] =
205 {3, "Packet, IEEE 802.3/Ethernet"},
206 {4, "Packet, IEEE 802.1Q VLAN"},
207 {5, "Packet, IPv4 over IEEE 802.3/Ethernet"},
208 {6, "Packet, IPv6 over IEEE 802.3/Ethernet"},
209 {7, "Packet, IPv4 over IEEE 802.1Q VLAN"},
210 {8, "Packet, IPv6 over IEEE 802.1Q VLAN"},
212 {10, "Packet, IEEE 802.3/Ethernet with ROCH header compression"},
213 {11, "Packet, IEEE 802.3/Ethernet with ECRTP header compression"},
214 {12, "Packet, IP2 with ROCH header compression"},
215 {13, "Packet, IP2 with ECRTP header compression"},
219 static const value_string vals_type_of_data_delivery_services[] =
221 {0, "Continuing grant service"},
222 {1, "Real time variable rate service"},
223 {2, "Non-real time variable rate service"},
224 {3, "Best-efforts service"},
225 {4, "Extended real-time variable rate service"},
229 static const value_string vals_paging_preference[] =
231 {0, "No paging generation"},
232 {1, "Paging generation"},
235 static const value_string vals_pdu_sn_ext_subheader[] =
237 {0, "No support for PDU SN in this connection (default)"},
238 {1, "PDU SN (short) extended Subheader"},
239 {2, "PDU SN (long) extended Subheader"},
243 static const value_string vals_cst_classifier_action[] =
245 {0, "DSC Add Classifier"},
246 {1, "DSC Replace Classifier"},
247 {2, "DSC Delete Classifier"},
251 static const value_string vals_cst_phs_dsc_action[] =
255 {2, "Delete PHS rule"},
256 {3, "Delete all PHS rules"},
260 static const value_string vals_verify[] =
267 static const value_string vals_atm_switching_encodings[] =
269 {0, "No switching methodology applied"},
275 static const value_string vals_cc[] =
279 {2, "Reject-unrecognized-configuration-setting"},
280 {3, "Reject-temporary / reject-resource"},
281 {4, "Reject-permanent / reject-admin"},
282 {5, "Reject-not-owner"},
283 {6, "Reject-service-flow-not-found"},
284 {7, "Reject-service-flow-exists"},
285 {8, "Reject-required-parameter-not-present"},
286 {9, "Reject-header-suppression"},
287 {10, "Reject-unknown-transaction-id"},
288 {11, "Reject-authentication-failure"},
289 {12, "Reject-add-aborted"},
290 {13, "Reject-exceeded-dynamic-service-limit"},
291 {14, "Reject-not-authorized-for-the-request-SAID"},
292 {15, "Reject-fail-to-establish-the-requested-SA"},
293 {16, "Reject-not-supported-parameter"},
294 {17, "Reject-not-supported-parameter-value"},
298 static const value_string vals_classification_action_rule[] =
301 {1, "Discarded packet"},
305 static const true_false_string tfs_supported =
311 static const true_false_string disabled_enabled =
317 static const true_false_string default_enabled =
323 static const value_string vals_pkm_attr_error_codes[] =
325 {0, "All (no information)"},
326 {1, "Auth Reject Auth Invalid (unauthorized SS)"},
327 {2, "Auth Reject, Key Reject (unauthorized SAID)"},
328 {3, "Auth Invalid (unsolicited)"},
329 {4, "Auth Invalid, TEK Invalid (invalid key sequence number)"},
330 {5, "Auth Invalid (message (key request) authorization failure)"},
331 {6, "Auth Reject (permanent authorization failure)"},
335 static const value_string vs_sa_type[] =
343 static const value_string va_key_push_modes[] =
345 {0, "GKEK update mode"},
346 {1, "GTEK update mode"},
350 static const value_string vals_pkm_version[] =
353 {1, "PKM (Initial standard release"},
357 static const value_string vs_success_reject[] =
364 static const value_string vs_sa_service_type[] =
366 {0, "Unicast service"},
367 {1, "Group multicast service"},
372 static const value_string vals_data_encryption_ids[] =
374 {0, "No data encryption"},
375 {1, "CBC-Mode, 56-bit DES"},
376 {2, "CCM-Mode, 128-bit AES"},
377 {3, "CBC-Mode, 128-bit AES"},
378 {128, "CTR-Mode, 128-bit AES for MBS with 8 bit ROC"},
382 static const value_string vals_data_authentication_ids[] =
384 {0, "No data authentication"},
385 {1, "CCM-Mode, 128-bit AES"},
389 static const value_string vals_tek_encryption_ids[] =
391 {0, "No TEK encryption"},
392 {1, "3-DES EDE with 128-bit key"},
393 {2, "RSA with 1024-bit key"},
394 {3, "ECB mode AES with 128-bit key"},
395 {4, "AES key wrap with 128-bit key"},
399 static const value_string vals_dcd_mac_version[] =
401 {1, "Conformance with IEEE Std 802.16-2001"},
402 {2, "Conformance with IEEE Std 802.16c-2002 and its predecessors"},
403 {3, "Conformance with IEEE Std 802.16a-2003 and its predecessors"},
404 {4, "Conformance with IEEE Std 802.16-2004"},
405 {5, "Conformance with IEEE Std 802.16-2004 and IEEE Std 802.16e-2005"},
411 static gint hf_sfe_unknown_type = -1;
412 static gint hf_sfe_sf_id = -1;
413 static gint hf_sfe_cid = -1;
414 static gint hf_sfe_service_class_name = -1;
415 static gint hf_sfe_mbs_service = -1;
416 static gint hf_sfe_qos_params_set = -1;
417 static gint hf_sfe_set_provisioned = -1;
418 static gint hf_sfe_set_admitted = -1;
419 static gint hf_sfe_set_active = -1;
420 static gint hf_sfe_set_rsvd = -1;
421 static gint hf_sfe_traffic_priority = -1;
422 static gint hf_sfe_max_str = -1;
423 static gint hf_sfe_max_traffic_burst = -1;
424 static gint hf_sfe_min_rtr = -1;
425 static gint hf_sfe_reserved_10 = -1;
426 static gint hf_sfe_ul_grant_scheduling = -1;
427 static gint hf_sfe_req_tx_policy = -1;
428 static gint hf_sfe_policy_broadcast_bwr = -1;
429 static gint hf_sfe_policy_multicast_bwr = -1;
430 static gint hf_sfe_policy_piggyback = -1;
431 static gint hf_sfe_policy_fragment = -1;
432 static gint hf_sfe_policy_headers = -1;
433 static gint hf_sfe_policy_packing = -1;
434 static gint hf_sfe_policy_crc = -1;
435 static gint hf_sfe_policy_rsvd1 = -1;
436 static gint hf_sfe_jitter = -1;
437 static gint hf_sfe_max_latency = -1;
438 static gint hf_sfe_fixed_len_sdu = -1;
439 static gint hf_sfe_sdu_size = -1;
440 static gint hf_sfe_target_said = -1;
441 static gint hf_sfe_cs_specification = -1;
442 static gint hf_sfe_type_of_data_delivery_services = -1;
443 static gint hf_sfe_sdu_inter_arrival_interval = -1;
444 static gint hf_sfe_time_base = -1;
445 static gint hf_sfe_paging_preference = -1;
446 static gint hf_sfe_mbs_zone_identifier_assignment = -1;
447 static gint hf_sfe_sn_feedback_enabled = -1;
448 static gint hf_sfe_harq_service_flows = -1;
449 static gint hf_sfe_harq_channel_mapping_index = -1;
450 static gint hf_sfe_fsn_size = -1;
451 static gint hf_sfe_unsolicited_grant_interval = -1;
452 static gint hf_sfe_unsolicited_polling_interval = -1;
453 static gint hf_sfe_harq_channel_mapping = -1;
454 static gint hf_sfe_global_service_class_name = -1;
455 static gint hf_sfe_reserved_36 = -1;
456 static gint hf_sfe_reserved_34 = -1;
458 static gint hf_sfe_arq_enable = -1;
459 static gint hf_sfe_arq_transmitter_delay = -1;
460 static gint hf_sfe_arq_receiver_delay = -1;
461 static gint hf_sfe_arq_block_lifetime = -1;
462 static gint hf_sfe_arq_sync_loss_timeout = -1;
463 static gint hf_sfe_arq_transmitter_delay_cor2 = -1;
464 static gint hf_sfe_arq_receiver_delay_cor2 = -1;
465 static gint hf_sfe_arq_block_lifetime_cor2 = -1;
466 static gint hf_sfe_arq_sync_loss_timeout_cor2 = -1;
467 static gint hf_sfe_arq_deliver_in_order = -1;
468 static gint hf_sfe_arq_rx_purge_timeout = -1;
469 static gint hf_sfe_arq_window_size = -1;
470 static gint hf_sfe_arq_block_size = -1;
471 static gint hf_sfe_arq_block_size_cor2 = -1;
472 static gint hf_sfe_arq_min_block_size = -1;
473 static gint hf_sfe_arq_max_block_size = -1;
475 static gint hf_sfe_cid_alloc_for_active_bs = -1;
476 static gint hf_sfe_cid_alloc_for_active_bs_cid = -1;
477 static gint hf_sfe_pdu_sn_ext_subheader_reorder = -1;
478 static gint hf_sfe_mbs_contents_ids = -1;
479 static gint hf_sfe_mbs_contents_ids_id = -1;
480 static gint hf_sfe_authorization_token = -1;
482 static gint hf_cst_classifier_dsc_action = -1;
483 static gint hf_cst_error_set_errored_param = -1;
484 static gint hf_cst_error_set_error_code = -1;
485 static gint hf_cst_error_set_error_msg = -1;
487 static gint hf_cst_pkt_class_rule = -1;
489 static gint hf_cst_pkt_class_rule_priority = -1;
490 static gint hf_cst_pkt_class_rule_range_mask = -1;
491 static gint hf_cst_pkt_class_rule_tos_low = -1;
492 static gint hf_cst_pkt_class_rule_tos_high = -1;
493 static gint hf_cst_pkt_class_rule_tos_mask = -1;
494 static gint hf_cst_pkt_class_rule_protocol = -1;
495 /*static gint hf_cst_pkt_class_rule_protocol_number = -1;*/
496 static gint hf_cst_pkt_class_rule_ip_masked_src_address = -1;
497 static gint hf_cst_pkt_class_rule_ip_masked_dest_address = -1;
498 static gint hf_cst_pkt_class_rule_src_ipv4 = -1;
499 static gint hf_cst_pkt_class_rule_dest_ipv4 = -1;
500 static gint hf_cst_pkt_class_rule_mask_ipv4 = -1;
501 static gint hf_cst_pkt_class_rule_src_ipv6 = -1;
502 static gint hf_cst_pkt_class_rule_dest_ipv6 = -1;
503 static gint hf_cst_pkt_class_rule_mask_ipv6 = -1;
504 static gint hf_cst_pkt_class_rule_prot_src_port_range = -1;
505 static gint hf_cst_pkt_class_rule_src_port_low = -1;
506 static gint hf_cst_pkt_class_rule_src_port_high = -1;
507 static gint hf_cst_pkt_class_rule_prot_dest_port_range = -1;
508 static gint hf_cst_pkt_class_rule_dest_port_low = -1;
509 static gint hf_cst_pkt_class_rule_dest_port_high = -1;
510 static gint hf_cst_pkt_class_rule_dest_mac_address = -1;
511 static gint hf_cst_pkt_class_rule_dest_mac = -1;
512 static gint hf_cst_pkt_class_rule_src_mac_address = -1;
513 static gint hf_cst_pkt_class_rule_src_mac = -1;
514 static gint hf_cst_pkt_class_rule_mask_mac = -1;
515 static gint hf_cst_pkt_class_rule_ethertype = -1;
516 static gint hf_cst_pkt_class_rule_etype = -1;
517 static gint hf_cst_pkt_class_rule_eprot1 = -1;
518 static gint hf_cst_pkt_class_rule_eprot2 = -1;
519 static gint hf_cst_pkt_class_rule_user_priority = -1;
520 static gint hf_cst_pkt_class_rule_pri_low = -1;
521 static gint hf_cst_pkt_class_rule_pri_high = -1;
522 static gint hf_cst_pkt_class_rule_vlan_id = -1;
523 static gint hf_cst_pkt_class_rule_vlan_id1 = -1;
524 static gint hf_cst_pkt_class_rule_vlan_id2 = -1;
525 static gint hf_cst_pkt_class_rule_phsi = -1;
526 static gint hf_cst_pkt_class_rule_index = -1;
527 static gint hf_cst_pkt_class_rule_ipv6_flow_label = -1;
528 static gint hf_cst_pkt_class_rule_vendor_spec = -1;
529 static gint hf_cst_pkt_class_rule_classifier_action_rule = -1;
530 static gint hf_cst_pkt_class_rule_classifier_action_rule_bit0 = -1;
531 static gint hf_cst_pkt_class_rule_classifier_action_rule_bit1 = -1;
533 static gint hf_cst_large_context_id = -1;
534 static gint hf_cst_short_format_context_id = -1;
536 static gint hf_cst_phs_dsc_action = -1;
537 static gint hf_cst_phs_rule = -1;
538 static gint hf_cst_phs_phsi = -1;
539 static gint hf_cst_phs_phsf = -1;
540 static gint hf_cst_phs_phsm = -1;
541 static gint hf_cst_phs_phss = -1;
542 static gint hf_cst_phs_phsv = -1;
543 static gint hf_cst_phs_vendor_spec = -1;
544 static gint hf_cst_invalid_tlv = -1;
546 static gint hf_csper_atm_switching_encoding = -1;
547 static gint hf_csper_atm_classifier = -1;
548 static gint hf_csper_atm_classifier_vpi = -1;
549 static gint hf_csper_atm_classifier_vci = -1;
550 static gint hf_csper_atm_classifier_id = -1;
551 /*static gint hf_csper_atm_classifier_dsc_action = -1;*/
552 static gint hf_csper_unknown_type = -1;
554 static gint hf_xmac_tuple_rsvd = -1;
555 static gint hf_xmac_tuple_key_seq_num = -1;
556 static gint hf_hmac_tuple_hmac_digest = -1;
557 static gint hf_packet_number_counter = -1;
558 static gint hf_cmac_tuple_cmac_value = -1;
559 static gint hf_cmac_tuple_bsid = -1;
563 #define SFE_QOS_PARAMS_SET_PROVISIONED_SET 0x01
564 #define SFE_QOS_PARAMS_SET_ADMITTED_SET 0x02
565 #define SFE_QOS_PARAMS_SET_ACTIVE_SET 0x04
566 #define SFE_QOS_PARAMS_SET_RESERVED 0xF8
568 #define SFE_REQ_TX_POLICY_BROADCAST_BWR 0x01
569 #define SFE_REQ_TX_POLICY_MULTICAST_BWR 0x02
570 #define SFE_REQ_TX_POLICY_PIGGYBACK 0x04
571 #define SFE_REQ_TX_POLICY_FRAGMENT_DATA 0x08
572 #define SFE_REQ_TX_POLICY_PAYLOAD_HEADER 0x10
573 #define SFE_REQ_TX_POLICY_PACKINGS 0x20
574 #define SFE_REQ_TX_POLICY_CRC 0x40
575 #define SFE_REQ_TX_POLICY_RESERVED 0x80
578 /* 11.13.19.3.4.17 */
579 #define CST_PKT_CLASS_RULE_CLASSIFIER_ACTION_RULE_BIT0 0x80
580 #define CST_PKT_CLASS_RULE_CLASSIFIER_ACTION_RULE_RSV 0x7F
583 /* 11.1.2 (table 348) */
584 #define XMAC_TUPLE_RESERVED 0xF0
585 #define XMAC_TUPLE_KEY_SEQ_NUM 0x0F
587 /* WiMax Security Negotiation Parameters display */
588 static gint hf_snp_pkm_version_support = -1;
589 static gint hf_snp_pkm_version_support_bit0 = -1;
590 static gint hf_snp_pkm_version_support_bit1 = -1;
591 static gint hf_snp_pkm_version_support_reserved = -1;
592 static gint hf_snp_auth_policy_support = -1;
593 static gint hf_snp_auth_policy_support_bit0 = -1;
594 static gint hf_snp_auth_policy_support_bit1 = -1;
595 static gint hf_snp_auth_policy_support_bit2 = -1;
596 static gint hf_snp_auth_policy_support_bit3 = -1;
597 static gint hf_snp_auth_policy_support_bit4 = -1;
598 static gint hf_snp_auth_policy_support_bit5 = -1;
599 static gint hf_snp_auth_policy_support_bit6 = -1;
600 static gint hf_snp_auth_policy_support_bit7 = -1;
601 static gint hf_snp_mac_mode = -1;
602 static gint hf_snp_mac_mode_bit0 = -1;
603 static gint hf_snp_mac_mode_bit1 = -1;
604 static gint hf_snp_mac_mode_bit1_rsvd = -1;
605 static gint hf_snp_mac_mode_bit2 = -1;
606 static gint hf_snp_mac_mode_bit3 = -1;
607 static gint hf_snp_mac_mode_bit4 = -1;
608 static gint hf_snp_mac_mode_bit5 = -1;
609 static gint hf_snp_mac_mode_reserved = -1;
610 static gint hf_snp_mac_mode_reserved1 = -1;
611 static gint hf_snp_pn_window_size = -1;
612 static gint hf_snp_max_conc_transactions = -1;
613 static gint hf_snp_max_suppt_sec_assns = -1;
614 static gint hf_snp_unknown_type = -1;
618 #define SNP_PKM_VERSION_SUPPORT_BIT0 0x01
619 #define SNP_PKM_VERSION_SUPPORT_BIT1 0x02
620 #define SNP_PKM_VERSION_SUPPORT_RSV 0xFC
622 #define SNP_AUTH_POLICY_SUPPORT_BIT0 0x01
623 #define SNP_AUTH_POLICY_SUPPORT_BIT1 0x02
624 #define SNP_AUTH_POLICY_SUPPORT_BIT2 0x04
625 #define SNP_AUTH_POLICY_SUPPORT_BIT3 0x08
626 #define SNP_AUTH_POLICY_SUPPORT_BIT4 0x10
627 #define SNP_AUTH_POLICY_SUPPORT_BIT5 0x20
628 #define SNP_AUTH_POLICY_SUPPORT_BIT6 0x40
629 #define SNP_AUTH_POLICY_SUPPORT_BIT7 0x80
631 #define SNP_MAC_MODE_BIT0 0x01
632 #define SNP_MAC_MODE_BIT1 0x02
633 #define SNP_MAC_MODE_BIT2 0x04
634 #define SNP_MAC_MODE_BIT3 0x08
635 #define SNP_MAC_MODE_BIT4 0x10
636 #define SNP_MAC_MODE_BIT5 0x20
637 #define SNP_MAC_MODE_RSV 0xE0
638 #define SNP_MAC_MODE_RSV1 0xC0
641 static gint hf_pkm_msg_unknown_type = -1;
642 static gint hf_pkm_msg_attr_display = -1;
643 static gint hf_pkm_config_settings_authorize_waitout = -1;
644 static gint hf_pkm_config_settings_reauthorize_waitout = -1;
645 static gint hf_pkm_config_settings_grace_time = -1;
646 static gint hf_pkm_config_settings_operational_waittime = -1;
647 static gint hf_pkm_msg_attr_auth_key = -1;
648 static gint hf_pkm_msg_attr_tek = -1;
649 static gint hf_pkm_msg_attr_key_life_time = -1;
650 static gint hf_pkm_msg_attr_key_seq_num = -1;
651 static gint hf_pkm_msg_attr_hmac_digest = -1;
652 static gint hf_pkm_msg_attr_said = -1;
653 static gint hf_pkm_msg_attr_cbc_iv = -1;
654 static gint hf_pkm_msg_attr_error_code = -1;
655 static gint hf_pkm_msg_attr_ca_certificate = -1;
656 static gint hf_pkm_msg_attr_ss_certificate = -1;
657 static gint hf_pkm_attr_auth_result_code = -1;
658 static gint hf_pkm_attr_sa_service_type = -1;
659 static gint hf_pkm_attr_frame_number = -1;
660 static gint hf_pkm_attr_ss_random = -1;
661 static gint hf_pkm_attr_bs_random = -1;
662 static gint hf_pkm_attr_pre_pak = -1;
663 static gint hf_pkm_attr_bs_certificate = -1;
664 static gint hf_pkm_attr_sig_bs = -1;
665 static gint hf_pkm_attr_ms_mac_address = -1;
666 static gint hf_pkm_attr_cmac_digest = -1;
667 static gint hf_pkm_attr_cmac_digest_pn = -1;
668 static gint hf_pkm_attr_cmac_digest_value = -1;
669 static gint hf_pkm_attr_eap_payload = -1;
670 static gint hf_pkm_attr_nonce = -1;
671 static gint hf_pkm_sa_type = -1;
672 static gint hf_pkm_msg_crypto_suite = -1;
673 static gint hf_pkm_msg_crypto_suite_msb = -1;
674 static gint hf_pkm_msg_crypto_suite_middle = -1;
675 static gint hf_pkm_msg_crypto_suite_lsb = -1;
676 /*static gint hf_pkm_msg_version = -1;*/
677 static gint hf_pkm_attr_push_modes = -1;
678 static gint hf_pkm_attr_key_push_counter = -1;
679 static gint hf_pkm_attr_gkek = -1;
680 static gint hf_pkm_attr_sig_ss = -1;
681 static gint hf_pkm_attr_akid = -1;
682 static gint hf_pkm_config_settings_rekey_wait_timeout = -1;
683 static gint hf_pkm_config_settings_tek_grace_time = -1;
684 static gint hf_pkm_config_settings_authorize_reject_wait_timeout = -1;
686 static gint hf_pkm_attr_pak_ak_seq_number = -1;
687 static gint hf_pkm_attr_associated_gkek_seq_number = -1;
688 static gint hf_pkm_attr_gkek_params = -1;
690 static gint hf_common_tlv_unknown_type = -1;
691 static gint hf_common_tlv_mac_version = -1;
692 static gint hf_common_tlv_vendor_id = -1;
693 static gint hf_common_tlv_vendor_specific_type = -1;
694 static gint hf_common_tlv_vendor_specific_length = -1;
695 static gint hf_common_tlv_vendor_specific_length_size = -1;
696 static gint hf_common_tlv_vendor_specific_value = -1;
698 /* Register WiMax Utility Routines */
699 void proto_register_wimax_utility_decoders(void)
701 /* WiMax Service Flow Encodings display */
702 static hf_register_info hf_sfe[] =
704 { /* 1 Service Flow ID */
706 {"Service Flow ID", "wmx.sfe.sf_id", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL}
710 {"CID", "wmx.sfe.cid", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}
712 { /* 3 Service Class Name */
713 &hf_sfe_service_class_name,
714 {"Service Class Name", "wmx.sfe.service_class_name", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL}
716 { /* 4 MBS Service */
718 {"MBS Service", "wmx.sfe.mbs_service", FT_UINT8, BASE_DEC, VALS(vals_mbs_service), 0x0, NULL, HFILL}
720 { /* 5 QoS Parameter Set Type */
721 &hf_sfe_qos_params_set,
722 {"QoS Parameter Set Type", "wmx.sfe.qos_params_set", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
725 &hf_sfe_set_provisioned,
726 {"Provisioned Set", "wmx.sfe.qos_params_set.provisioned", FT_BOOLEAN, 8, NULL, SFE_QOS_PARAMS_SET_PROVISIONED_SET, NULL, HFILL}
729 &hf_sfe_set_admitted,
730 {"Admitted Set", "wmx.sfe.qos_params_set.admitted", FT_BOOLEAN, 8, NULL, SFE_QOS_PARAMS_SET_ADMITTED_SET, NULL, HFILL}
734 {"Active Set", "wmx.sfe.qos_params_set.active", FT_BOOLEAN, 8, NULL, SFE_QOS_PARAMS_SET_ACTIVE_SET, NULL, HFILL}
738 {"Reserved", "wmx.sfe.qos_params_set.rsvd", FT_UINT8, BASE_HEX, NULL, SFE_QOS_PARAMS_SET_RESERVED, NULL, HFILL}
740 { /* 6 Traffic Priority */
741 &hf_sfe_traffic_priority,
742 {"Traffic Priority", "wmx.sfe.traffic_priority", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}
744 { /* 7 Maximum Sustained Traffic Rate */
746 {"Maximum Sustained Traffic Rate", "wmx.sfe.msr", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL}
748 { /* 8 Maximum Traffic Burst */
749 &hf_sfe_max_traffic_burst,
750 {"Maximum Traffic Burst", "wmx.sfe.max_traffic_burst", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL}
752 { /* 9 Minimum Reserved Traffic Rate */
754 {"Minimum Reserved Traffic Rate", "wmx.sfe.mrr", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL}
759 {"Reserved", "wmx.sfe.reserved_10", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL}
762 { /* 10 reserved by 16E */
764 {"Minimum tolerable traffic rate", "wmx.sfe.mtr", FT_UINT32, BASE_HEX, NULL, 0x0, "", HFILL}
767 { /* 11 Service Flow Scheduling Type */
768 &hf_sfe_ul_grant_scheduling,
769 {"Uplink Grant Scheduling Type", "wmx.sfe.uplink_grant_scheduling", FT_UINT8, BASE_DEC, VALS(vals_ul_grant_scheduling), 0x0, NULL, HFILL}
771 { /* 12 Request/Transmission Policy */
772 &hf_sfe_req_tx_policy,
773 {"Request/Transmission Policy", "wmx.sfe.req_tx_policy", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL}
776 &hf_sfe_policy_broadcast_bwr,
777 {"The Service Flow Shall Not Use Broadcast Bandwidth Request Opportunities", "wmx.sfe.policy.broadcast_bwr", FT_BOOLEAN, 8, NULL, SFE_REQ_TX_POLICY_BROADCAST_BWR, NULL, HFILL}
780 &hf_sfe_policy_multicast_bwr,
781 {"The Service Flow Shall Not Use Multicast Bandwidth Request Opportunities", "wmx.sfe.policy.bit1", FT_BOOLEAN, 8, NULL, SFE_REQ_TX_POLICY_MULTICAST_BWR, NULL, HFILL}
784 &hf_sfe_policy_piggyback,
785 {"The Service Flow Shall Not Piggyback Requests With Data", "wmx.sfe.policy.piggyback", FT_BOOLEAN, 8, NULL, SFE_REQ_TX_POLICY_PIGGYBACK, NULL, HFILL}
788 &hf_sfe_policy_fragment,
789 {"The Service Flow Shall Not Fragment Data", "wmx.sfe.policy.fragment", FT_BOOLEAN, 8, NULL, SFE_REQ_TX_POLICY_FRAGMENT_DATA, NULL, HFILL}
792 &hf_sfe_policy_headers,
793 {"The Service Flow Shall Not Suppress Payload Headers", "wmx.sfe.policy.headers", FT_BOOLEAN, 8, NULL, SFE_REQ_TX_POLICY_PAYLOAD_HEADER, NULL, HFILL}
796 &hf_sfe_policy_packing,
797 {"The Service Flow Shall Not Pack Multiple SDUs (Or Fragments) Into Single MAC PDUs", "wmx.sfe.policy.packing", FT_BOOLEAN, 8, NULL, SFE_REQ_TX_POLICY_PACKINGS, NULL, HFILL}
801 {"The Service Flow Shall Not Include CRC In The MAC PDU", "wmx.sfe.policy.crc", FT_BOOLEAN, 8, NULL, SFE_REQ_TX_POLICY_CRC, NULL, HFILL}
804 &hf_sfe_policy_rsvd1,
805 {"Reserved", "wmx.sfe.policy.rsvd1", FT_UINT8, BASE_HEX, NULL, SFE_REQ_TX_POLICY_RESERVED, NULL, HFILL}
807 { /* 13 Tolerated Jitter */
809 {"Tolerated Jitter", "wmx.sfe.jitter", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL}
811 { /* 14 Maximum Latency */
813 {"Maximum Latency", "wmx.sfe.max_latency", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL}
815 { /* 15 Fixed/Variable Length SDU */
816 &hf_sfe_fixed_len_sdu,
817 {"Fixed/Variable Length SDU", "wmx.sfe.fixed_len_sdu", FT_UINT8, BASE_DEC, VALS(vals_fixed_len_sdu), 0x0, NULL, HFILL}
821 {"SDU Size", "wmx.sfe.sdu_size", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}
823 { /* 17 SAID Onto Which SF Is Mapped */
825 {"SAID Onto Which SF Is Mapped", "wmx.sfe.target_said", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}
827 { /* 18 ARQ Enable */
829 {"ARQ Enable", "wmx.arq.enable", FT_UINT8, BASE_DEC, VALS(vals_arq_enable), 0x0, NULL, HFILL}
831 { /* 19 ARQ Window Size */
832 &hf_sfe_arq_window_size,
833 {"ARQ Window Size", "wmx.arq.window_size", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}
835 { /* 20 ARQ Transmitter Delay */
836 &hf_sfe_arq_transmitter_delay,
837 {"ARQ Transmitter Delay (10us granularity)", "wmx.arq.transmitter_delay", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}
839 { /* 21 ARQ Receiver Delay */
840 &hf_sfe_arq_receiver_delay,
841 {"ARQ Receiver Delay (10us granularity)", "wmx.arq.receiver_delay", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}
843 { /* 22 ARQ Block Lifetime */
844 &hf_sfe_arq_block_lifetime,
845 {"ARQ Block Lifetime (10us granularity)", "wmx.arq.block_lifetime", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}
847 { /* 23 ARQ Sync Loss Timeout */
848 &hf_sfe_arq_sync_loss_timeout,
849 {"ARQ Sync Loss Timeout (10us granularity)", "wmx.arq.sync_loss_timeout", FT_UINT16, BASE_DEC, VALS(&vals_arq_sync_loss_timeout), 0x0, NULL, HFILL}
851 { /* 20 ARQ Transmitter Delay */
852 &hf_sfe_arq_transmitter_delay_cor2,
853 {"ARQ Transmitter Delay (100us granularity)", "wmx.arq.transmitter_delay", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}
855 { /* 21 ARQ Receiver Delay */
856 &hf_sfe_arq_receiver_delay_cor2,
857 {"ARQ Receiver Delay (100us granularity)", "wmx.arq.receiver_delay", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}
859 { /* 22 ARQ Block Lifetime */
860 &hf_sfe_arq_block_lifetime_cor2,
861 {"ARQ Block Lifetime (100us granularity)", "wmx.arq.block_lifetime", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}
863 { /* 23 ARQ Sync Loss Timeout */
864 &hf_sfe_arq_sync_loss_timeout_cor2,
865 {"ARQ Sync Loss Timeout (100us granularity)", "wmx.arq.sync_loss_timeout", FT_UINT16, BASE_DEC, VALS(&vals_arq_sync_loss_timeout), 0x0, NULL, HFILL}
867 { /* 24 ARQ Deliver In Order */
868 &hf_sfe_arq_deliver_in_order,
869 {"ARQ Deliver In Order", "wmx.arq.deliver_in_order", FT_UINT8, BASE_DEC, VALS(&vals_arq_deliver_in_order), 0x0, NULL, HFILL}
871 { /* 25 ARQ Purge Timeout */
872 &hf_sfe_arq_rx_purge_timeout,
873 {"ARQ RX Purge Timeout (100us granularity)", "wmx.arq.rx_purge_timeout", FT_UINT16, BASE_DEC, VALS(&vals_arq_rx_purge_timeout), 0x0, NULL, HFILL}
875 { /* 26 ARQ Block Size */
876 &hf_sfe_arq_block_size,
877 {"ARQ Block Size", "wmx.arq.block_size", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}
879 { /* 26 ARQ Block Size */
880 &hf_sfe_arq_block_size_cor2,
881 {"ARQ Block Size", "wmx.arq.block_size", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
883 { /* 26 ARQ Block Size for Corrigendum 2 */
884 &hf_sfe_arq_min_block_size,
885 {"ARQ Minimum Block Size", "wmx.arq.min_block_size", FT_UINT8, BASE_DEC, NULL, 0x0F, NULL, HFILL}
887 { /* 26 ARQ Block Size for Corrigendum 2 */
888 &hf_sfe_arq_max_block_size,
889 {"ARQ Maximum Block Size", "wmx.arq.max_block_size", FT_UINT8, BASE_DEC, NULL, 0xF0, NULL, HFILL}
892 { /* 28 CS Specification */
893 &hf_sfe_cs_specification,
894 {"CS Specification", "wmx.sfe.cs_specification", FT_UINT8, BASE_DEC, VALS(vals_cs_specification), 0x0, NULL, HFILL}
896 { /* 29 Type of Data Delivery Services */
897 &hf_sfe_type_of_data_delivery_services,
898 {"Type of Data Delivery Services", "wmx.sfe.type_of_data_delivery_services", FT_UINT8, BASE_DEC, VALS(vals_type_of_data_delivery_services), 0x0, NULL, HFILL}
900 { /* 30 SDU Inter-Arrival Interval */
901 &hf_sfe_sdu_inter_arrival_interval,
902 {"SDU Inter-Arrival Interval (in the resolution of 0.5 ms)", "wmx.sfe.sdu_inter_arrival_interval", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}
906 {"Time Base", "wmx.sfe.time_base", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}
908 { /* 32 Paging Preference */
909 &hf_sfe_paging_preference,
910 {"Paging Preference", "wmx.sfe.paging_preference", FT_UINT8, BASE_DEC, VALS(vals_paging_preference), 0x0, NULL, HFILL}
912 { /* 33 MBS Zone Identifier */
913 &hf_sfe_mbs_zone_identifier_assignment,
914 {"MBS Zone Identifier", "wmx.sfe.mbs_zone_identifier", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
916 { /* 34 Traffic Indication Preference */
918 {"Reserved", "wmx.sfe.reserved_34", FT_UINT8, BASE_DEC, NULL /*VALS(vals_traffic_indication_preference)*/, 0x0, NULL, HFILL}
920 { /* 35 Global Service Class Name */
921 &hf_sfe_global_service_class_name,
922 {"Global Service Class Name", "wmx.sfe.global_service_class_name", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL}
924 /* 36 reserved by 16E */
928 {"Reserved", "wmx.sfe.reserved_36", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}
930 { /* 37 SN Feedback Enable */
931 &hf_sfe_sn_feedback_enabled,
932 {"SN Feedback", "wmx.sfe.sn_feedback_enabled", FT_UINT8, BASE_DEC, VALS(vals_sn_fb_enable), 0x0, NULL, HFILL}
936 {"FSN Size", "wmx.sfe.fsn_size", FT_UINT8, BASE_DEC, VALS(vals_fsn_size), 0x0, NULL, HFILL}
938 { /* 39 CID allocation for Active BSs */
939 &hf_sfe_cid_alloc_for_active_bs,
940 {"CID Allocation For Active BSs", "wmx.sfe.cid_alloc_for_active_bs", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
943 &hf_sfe_cid_alloc_for_active_bs_cid,
944 {"CID", "wmx.sfe.cid_alloc_for_active_bs_cid", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}
946 { /* 40 Unsolicited Grant Interval */
947 &hf_sfe_unsolicited_grant_interval,
948 {"Unsolicited Grant Interval", "wmx.sfe.unsolicited_grant_interval", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}
950 { /* 41 Unsolicited Polling Interval */
951 &hf_sfe_unsolicited_polling_interval,
952 {"Unsolicited Polling Interval", "wmx.sfe.unsolicited_polling_interval", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}
954 { /* 42 PDU SN extended subheader for HARQ reordering */
955 &hf_sfe_pdu_sn_ext_subheader_reorder,
956 {"PDU SN Extended Subheader For HARQ Reordering", "wmx.sfe.pdu_sn_ext_subheader_reorder", FT_UINT8, BASE_DEC, VALS(vals_pdu_sn_ext_subheader), 0x0, NULL, HFILL}
958 { /* 43 MBS contents ID */
959 &hf_sfe_mbs_contents_ids,
960 {"MBS contents IDs", "wmx.sfe.mbs_contents_ids", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
963 &hf_sfe_mbs_contents_ids_id,
964 {"MBS Contents ID", "wmx.sfe.mbs_contents_ids_id", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}
966 { /* 44 HARQ Service Flows */
967 &hf_sfe_harq_service_flows,
968 {"HARQ Service Flows", "wmx.sfe.harq_service_flows", FT_UINT8, BASE_DEC, VALS(vals_harq), 0x0, NULL, HFILL}
970 { /* 45 Authorization Token */
971 &hf_sfe_authorization_token,
972 {"Authorization Token", "wmx.sfe.authorization_token", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
974 { /* 46 HARQ Channel Mapping */
975 &hf_sfe_harq_channel_mapping,
976 {"HARQ Channel Mapping", "wmx.sfe.harq_channel_mapping", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
978 { /* 46.1 HARQ Channel Index*/
979 &hf_sfe_harq_channel_mapping_index,
980 {"HARQ Channel Index", "wmx.sfe.harq_channel_mapping.index", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}
983 { /* unknown SFE types */
984 &hf_sfe_unknown_type,
985 {"Unknown SFE TLV type", "wmx.sfe.unknown_type", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
989 /* WiMax Convergence Service Parameter Encoding Rules display */
990 static hf_register_info hf_csper[] =
991 { /* 99 - 111 CS parameter encoding rules */
992 { /* Classifier DSC Action */
993 &hf_cst_classifier_dsc_action,
994 {"Classifier DSC Action", "wmx.cst.classifier_action", FT_UINT8, BASE_DEC, VALS(vals_cst_classifier_action), 0x0, NULL, HFILL}
996 { /* Errored Parameter */
997 &hf_cst_error_set_errored_param,
998 {"Errored Parameter", "wmx.cst.error_set.errored_param", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
1001 &hf_cst_error_set_error_code,
1002 {"Error Code", "wmx.cst.error_set.error_code", FT_UINT8, BASE_HEX, VALS(vals_cc), 0x0, NULL, HFILL}
1004 { /* Error Message */
1005 &hf_cst_error_set_error_msg,
1006 {"Error Message", "wmx.cst.error_set.error_msg", FT_STRINGZ, BASE_NONE, NULL, 0x0, NULL, HFILL}
1008 { /* Packet Classification Rule */
1009 &hf_cst_pkt_class_rule,
1010 {"Packet Classification Rule", "wmx.cst.pkt_class_rule", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
1012 { /* Classification Rule Priority */
1013 &hf_cst_pkt_class_rule_priority,
1014 {"Classification Rule Priority", "wmx.cst.pkt_class_rule.priority", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}
1016 { /* ToS/Differentiated Services Codepoint (DSCP) Range And Mask */
1017 &hf_cst_pkt_class_rule_range_mask,
1018 {"ToS/Differentiated Services Codepoint (DSCP) Range And Mask", "wmx.cst.pkt_class_rule.range_mask", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
1021 &hf_cst_pkt_class_rule_tos_low,
1022 {"ToS-Low", "wmx.cst.pkt_class_rule.tos-low", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
1025 &hf_cst_pkt_class_rule_tos_high,
1026 {"ToS-High", "wmx.cst.pkt_class_rule.tos-high", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
1029 &hf_cst_pkt_class_rule_tos_mask,
1030 {"ToS-Mask", "wmx.cst.pkt_class_rule.tos-mask", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
1033 &hf_cst_pkt_class_rule_protocol,
1034 {"Protocol", "wmx.cst.pkt_class_rule.protocol", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
1036 #if 0 /* Removed by the changes of 802.16E 2005 */
1038 &hf_cst_pkt_class_rule_protocol,
1039 {"Protocol", "wmx.cst.pkt_class_rule.protocol", FT_BYTES, BASE_HEX, NULL, 0x0, "", HFILL}
1041 { /* Protocol Number */
1042 &hf_cst_pkt_class_rule_protocol_number,
1043 {"Protocol Number", "wmx.cst.pkt_class_rule.protocol.number", FT_UINT8, BASE_DEC, NULL, 0x0, "", HFILL}
1046 { /* IP Masked Source Address */
1047 &hf_cst_pkt_class_rule_ip_masked_src_address,
1048 {"IP Masked Source Address", "wmx.cst.pkt_class_rule.ip_masked_src_address", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
1050 { /* IP Masked Destination Address */
1051 &hf_cst_pkt_class_rule_ip_masked_dest_address,
1052 {"IP Masked Destination Address", "wmx.cst.pkt_class_rule.ip_masked_dest_address", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
1054 { /* IPv4 Source Address */
1055 &hf_cst_pkt_class_rule_src_ipv4,
1056 {"IPv4 Source Address", "wmx.cst.pkt_class_rule.src_ipv4", FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL}
1058 { /* IPv4 Destination Address */
1059 &hf_cst_pkt_class_rule_dest_ipv4,
1060 {"IPv4 Destination Address", "wmx.cst.pkt_class_rule.dst_ipv4", FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL}
1063 &hf_cst_pkt_class_rule_mask_ipv4,
1064 {"IPv4 Mask", "wmx.cst.pkt_class_rule.mask_ipv4", FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL}
1066 { /* IPv6 Source Address */
1067 &hf_cst_pkt_class_rule_src_ipv6,
1068 {"IPv6 Source Address", "wmx.cst.pkt_class_rule.src_ipv6", FT_IPv6, BASE_NONE, NULL, 0x0, NULL, HFILL}
1070 { /* IPv6 Destination Address */
1071 &hf_cst_pkt_class_rule_dest_ipv6,
1072 {"IPv6 Destination Address", "wmx.cst.pkt_class_rule.dst_ipv6", FT_IPv6, BASE_NONE, NULL, 0x0, NULL, HFILL}
1075 &hf_cst_pkt_class_rule_mask_ipv6,
1076 {"IPv6 Mask", "wmx.cst.pkt_class_rule.mask_ipv6", FT_IPv6, BASE_NONE, NULL, 0x0, NULL, HFILL}
1078 { /* Protocol Source Port Range */
1079 &hf_cst_pkt_class_rule_prot_src_port_range,
1080 {"Protocol Source Port Range", "wmx.cst.pkt_class_rule.prot_src_port_range", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
1082 { /* Src-Port Low */
1083 &hf_cst_pkt_class_rule_src_port_low,
1084 {"Src-Port Low", "wmx.cst.pkt_class_rule.src_port_low", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}
1086 { /* Src-Port High */
1087 &hf_cst_pkt_class_rule_src_port_high,
1088 {"Src-Port High", "wmx.cst.pkt_class_rule.src_port_high", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}
1090 { /* Protocol Destination Port Range */
1091 &hf_cst_pkt_class_rule_prot_dest_port_range,
1092 {"Protocol Destination Port Range", "wmx.cst.pkt_class_rule.prot_dest_port_range", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
1094 { /* Dst-Port Low */
1095 &hf_cst_pkt_class_rule_dest_port_low,
1096 {"Dst-Port Low", "wmx.cst.pkt_class_rule.dst_port_low", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}
1098 { /* Dst-Port High */
1099 &hf_cst_pkt_class_rule_dest_port_high,
1100 {"Dst-Port High", "wmx.cst.pkt_class_rule.dst_port_high", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}
1102 { /* 802.3/Ethernet Destination MAC Address */
1103 &hf_cst_pkt_class_rule_dest_mac_address,
1104 {"802.3/Ethernet Destination MAC Address", "wmx.cst.pkt_class_rule.dest_mac_address", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
1106 { /* Destination MAC Address */
1107 &hf_cst_pkt_class_rule_dest_mac,
1108 {"Destination MAC Address", "wmx.cst.pkt_class_rule.dst_mac", FT_ETHER, BASE_NONE, NULL, 0x0, NULL, HFILL}
1110 { /* 802.3/Ethernet Source MAC Address */
1111 &hf_cst_pkt_class_rule_src_mac_address,
1112 {"802.3/Ethernet Source MAC Address", "wmx.cst.pkt_class_rule.src_mac_address", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
1114 { /* Source MAC Address */
1115 &hf_cst_pkt_class_rule_src_mac,
1116 {"Source MAC Address", "wmx.cst.pkt_class_rule.src_mac", FT_ETHER, BASE_NONE, NULL, 0x0, NULL, HFILL}
1118 { /* MAC Address Mask */
1119 &hf_cst_pkt_class_rule_mask_mac,
1120 {"MAC Address Mask", "wmx.cst.pkt_class_rule.mask_mac", FT_ETHER, BASE_NONE, NULL, 0x0, NULL, HFILL}
1122 { /* Ethertype/IEEE Std 802.2-1998 SAP */
1123 &hf_cst_pkt_class_rule_ethertype,
1124 {"Ethertype/IEEE Std 802.2-1998 SAP", "wmx.cst.pkt_class_rule.ethertype", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
1127 &hf_cst_pkt_class_rule_etype,
1128 {"Ethertype", "wmx.cst.pkt_class_rule.ethertype", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}
1131 &hf_cst_pkt_class_rule_eprot1,
1132 {"Eprot1", "wmx.cst.pkt_class_rule.eprot1", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
1135 &hf_cst_pkt_class_rule_eprot2,
1136 {"Eprot2", "wmx.cst.pkt_class_rule.eprot2", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
1138 { /* IEEE Std 802.1D-1998 User_Priority */
1139 &hf_cst_pkt_class_rule_user_priority,
1140 {"IEEE Std 802.1D-1998 User_Priority", "wmx.cst.pkt_class_rule.user_priority", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
1143 &hf_cst_pkt_class_rule_pri_low,
1144 {"Pri-Low", "wmx.cst.pkt_class_rule.pri-low", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}
1147 &hf_cst_pkt_class_rule_pri_high,
1148 {"Pri-High", "wmx.cst.pkt_class_rule.pri-high", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}
1150 { /* IEEE Std 802.1Q-1998 VLAN_ID */
1151 &hf_cst_pkt_class_rule_vlan_id,
1152 {"IEEE Std 802.1Q-1998 VLAN_ID", "wmx.cst.pkt_class_rule.vlan_id", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
1155 &hf_cst_pkt_class_rule_vlan_id1,
1156 {"Vlan_Id1", "wmx.cst.pkt_class_rule.vlan_id1", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
1159 &hf_cst_pkt_class_rule_vlan_id2,
1160 {"Vlan_Id2", "wmx.cst.pkt_class_rule.vlan_id2", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
1162 { /* Associated PHSI */
1163 &hf_cst_pkt_class_rule_phsi,
1164 {"Associated PHSI", "wmx.cst.pkt_class_rule.phsi", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}
1166 { /* Packet Classifier Rule Index */
1167 &hf_cst_pkt_class_rule_index,
1168 {"Packet Classifier Rule Index (PCRI)", "wmx.cst.pkt_class_rule.index", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}
1170 { /* Large Context ID for ROHC/ECRTP Compressed Packet or ROHC Feedback Packet */
1171 &hf_cst_large_context_id,
1172 {"Large Context ID", "wmx.cst.large_context_id", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}
1174 { /* Short-Format Context ID for ROHC/ECRTP Compressed Packet or ROHC Feedback Packet */
1175 &hf_cst_short_format_context_id,
1176 {"Short-Format Context ID", "wmx.cst.short_format_context_id", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}
1178 { /* Vendor-Specific Classifier Parameters */
1179 &hf_cst_pkt_class_rule_vendor_spec,
1180 {"Vendor-Specific Classifier Parameters", "wmx.cst.pkt_class_rule.vendor_spec", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
1182 { /* Classifier Action Rule */
1183 &hf_cst_pkt_class_rule_classifier_action_rule,
1184 {"Classifier Action Rule", "wmx.cst.pkt_class_rule.classifier.action.rule", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
1187 &hf_cst_pkt_class_rule_classifier_action_rule_bit0,
1188 {"Bit #0", "wmx.cst.pkt_class_rule.classifier.action.rule.bit0", FT_UINT8, BASE_HEX, VALS(vals_classification_action_rule), CST_PKT_CLASS_RULE_CLASSIFIER_ACTION_RULE_BIT0, NULL, HFILL}
1191 &hf_cst_pkt_class_rule_classifier_action_rule_bit1,
1192 {"Reserved", "wmx.cst.pkt_class_rule.classifier.action.rule.reserved", FT_UINT8, BASE_HEX, NULL, CST_PKT_CLASS_RULE_CLASSIFIER_ACTION_RULE_RSV, NULL, HFILL}
1194 { /* PHS DSC action */
1195 &hf_cst_phs_dsc_action,
1196 {"PHS DSC action", "wmx.cst.phs_dsc_action", FT_UINT8, BASE_DEC, VALS(vals_cst_phs_dsc_action), 0x0, NULL, HFILL}
1200 {"PHS Rule", "wmx.cst.phs_rule", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
1204 {"PHSI", "wmx.cst.phs_rule.phsi", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}
1208 {"PHSF", "wmx.cst.phs_rule.phsf", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
1212 {"PHSM (bit x: 0-don't suppress the (x+1) byte; 1-suppress the (x+1) byte)", "wmx.cst.phs_rule.phsm", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
1216 {"PHSS", "wmx.cst.phs_rule.phss", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}
1220 {"PHSV", "wmx.cst.phs_rule.phsv", FT_UINT8, BASE_DEC, VALS(vals_verify), 0x0, NULL, HFILL}
1222 { /* PHS Rule 143 */
1223 &hf_cst_phs_vendor_spec,
1224 {"Vendor-Specific PHS Parameters", "wmx.cst.phs.vendor_spec", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
1226 { /* IPv6 Flow Label */
1227 &hf_cst_pkt_class_rule_ipv6_flow_label,
1228 {"IPv6 Flow Label", "wmx.cst.pkt_class_rule.ipv6_flow_label", FT_UINT24, BASE_HEX, NULL, 0x0, NULL, HFILL}
1230 { /* ATM Switching Encoding */
1231 &hf_csper_atm_switching_encoding,
1232 {"ATM Switching Encoding", "wmx.csper.atm_switching_encoding", FT_UINT8, BASE_DEC, VALS(vals_atm_switching_encodings), 0x0, NULL, HFILL}
1234 { /* ATM Classifier TLV */
1235 &hf_csper_atm_classifier,
1236 {"ATM Classifier TLV", "wmx.csper.atm_classifier", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
1238 { /* ATM VPI Classifier */
1239 &hf_csper_atm_classifier_vpi,
1240 {"VPI Classifier", "wmx.csper.atm_classifier_vpi", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}
1242 { /* ATM VCI Classifier */
1243 &hf_csper_atm_classifier_vci,
1244 {"VCI Classifier", "wmx.csper.atm_classifier_vci", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}
1246 { /* ATM Classifier ID */
1247 &hf_csper_atm_classifier_id,
1248 {"Classifier ID", "wmx.csper.atm_classifier_tlv", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}
1251 { /* unknown CSPER types */
1252 &hf_csper_unknown_type,
1253 {"Unknown CSPER TLV type", "wmx.csper.unknown_type", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
1256 &hf_cst_invalid_tlv,
1257 {"Invalid TLV", "wmx.cst.invalid_tlv", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
1261 /* WiMax HMAC/CMAC/Short-HMAC Tuples display */
1262 static hf_register_info hf_xmac[] =
1265 &hf_xmac_tuple_rsvd,
1266 {"Reserved", "wmx.xmac_tuple.reserved", FT_UINT8, BASE_HEX, NULL, XMAC_TUPLE_RESERVED, NULL, HFILL}
1269 &hf_xmac_tuple_key_seq_num,
1270 {"Key Sequence Number", "wmx.xmac_tuple.key_sn", FT_UINT8, BASE_DEC, NULL, XMAC_TUPLE_KEY_SEQ_NUM, NULL, HFILL}
1273 &hf_hmac_tuple_hmac_digest,
1274 {"HMAC Digest", "wmx.xmac_tuple.hmac_digest", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
1277 &hf_cmac_tuple_bsid,
1278 {"BSID", "wmx.cmac_tuple.bsid", FT_ETHER, BASE_HEX, NULL, 0x0, NULL, HFILL}
1281 &hf_cmac_tuple_cmac_value,
1282 {"CMAC Value", "wmx.cmac_tuple.cmac.value", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
1285 &hf_packet_number_counter,
1286 {"Packet Number Counter", "wmx.xmac_tuple.packet_number_count", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL}
1290 static hf_register_info hf_snp[] =
1293 &hf_snp_pkm_version_support,
1294 {"PKM Version Support", "wmx.security_negotiation_parameters.pkm_version_support",FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
1297 &hf_snp_pkm_version_support_bit0,
1298 {"PKM version 1", "wmx.security_negotiation_parameters.pkm_version_support.bit0",FT_BOOLEAN, 8, TFS(&tfs_supported), SNP_PKM_VERSION_SUPPORT_BIT0, NULL, HFILL}
1301 &hf_snp_pkm_version_support_bit1,
1302 {"PKM version 2", "wmx.security_negotiation_parameters.pkm_version_support.bit1",FT_BOOLEAN, 8, TFS(&tfs_supported), SNP_PKM_VERSION_SUPPORT_BIT1, NULL, HFILL}
1305 &hf_snp_pkm_version_support_reserved,
1306 {"Reserved", "wmx.security_negotiation_parameters.pkm_version_support.reserved",FT_UINT8, BASE_HEX, NULL, SNP_PKM_VERSION_SUPPORT_RSV, NULL, HFILL}
1309 &hf_snp_auth_policy_support,
1310 {"Authorization Policy Support", "wmx.security_negotiation_parameters.auth_policy_support",FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
1313 &hf_snp_auth_policy_support_bit0,
1314 {"RSA-based Authorization At The Initial Network Entry", "wmx.security_negotiation_parameters.auth_policy_support.bit0",FT_BOOLEAN, 8, TFS(&tfs_supported), SNP_AUTH_POLICY_SUPPORT_BIT0, NULL, HFILL}
1317 &hf_snp_auth_policy_support_bit1,
1318 {"EAP-based Authorization At The Initial Network Entry", "wmx.security_negotiation_parameters.auth_policy_support.bit1",FT_BOOLEAN, 8, TFS(&tfs_supported), SNP_AUTH_POLICY_SUPPORT_BIT1, NULL, HFILL}
1321 &hf_snp_auth_policy_support_bit2,
1322 {"Authenticated EAP-based Authorization At The Initial Network Entry", "wmx.security_negotiation_parameters.auth_policy_support.bit2",FT_BOOLEAN, 8, TFS(&tfs_supported), SNP_AUTH_POLICY_SUPPORT_BIT2, NULL, HFILL}
1325 &hf_snp_auth_policy_support_bit3,
1326 {"Reserved", "wmx.security_negotiation_parameters.auth_policy_support.bit3",FT_UINT8, BASE_HEX, NULL, SNP_AUTH_POLICY_SUPPORT_BIT3, NULL, HFILL}
1329 &hf_snp_auth_policy_support_bit4,
1330 {"RSA-based Authorization At Re-entry", "wmx.security_negotiation_parameters.auth_policy_support.bit4",FT_BOOLEAN, 8, TFS(&tfs_supported), SNP_AUTH_POLICY_SUPPORT_BIT4, NULL, HFILL}
1333 &hf_snp_auth_policy_support_bit5,
1334 {"EAP-based Authorization At Re-entry", "wmx.security_negotiation_parameters.auth_policy_support.bit5",FT_BOOLEAN, 8, TFS(&tfs_supported), SNP_AUTH_POLICY_SUPPORT_BIT5, NULL, HFILL}
1337 &hf_snp_auth_policy_support_bit6,
1338 {"Authenticated EAP-based Authorization At Re-entry", "wmx.security_negotiation_parameters.auth_policy_support.bit6",FT_BOOLEAN, 8, TFS(&tfs_supported), SNP_AUTH_POLICY_SUPPORT_BIT6, NULL, HFILL}
1341 &hf_snp_auth_policy_support_bit7,
1342 {"Reserved", "wmx.security_negotiation_parameters.auth_policy_support.bit7",FT_UINT8, BASE_HEX, NULL, SNP_AUTH_POLICY_SUPPORT_BIT7, NULL, HFILL}
1346 {"MAC (Message Authentication Code) Mode", "wmx.security_negotiation_parameters.mac_mode",FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
1349 &hf_snp_mac_mode_bit0,
1350 {"HMAC", "wmx.security_negotiation_parameters.mac_mode.bit0",FT_BOOLEAN, 8, TFS(&tfs_supported), SNP_MAC_MODE_BIT0, NULL, HFILL}
1353 &hf_snp_mac_mode_bit1,
1354 {"CMAC", "wmx.security_negotiation_parameters.mac_mode.bit1",FT_BOOLEAN, 8, TFS(&tfs_supported), SNP_MAC_MODE_BIT1, NULL, HFILL}
1357 &hf_snp_mac_mode_bit1_rsvd,
1358 {"Reserved", "wmx.security_negotiation_parameters.mac_mode.bit1_rsvd",FT_BOOLEAN, 8, TFS(&tfs_supported), SNP_MAC_MODE_BIT1, NULL, HFILL}
1361 &hf_snp_mac_mode_bit2,
1362 {"64-bit Short-HMAC", "wmx.security_negotiation_parameters.mac_mode.bit2",FT_BOOLEAN, 8, TFS(&tfs_supported), SNP_MAC_MODE_BIT2, NULL, HFILL}
1365 &hf_snp_mac_mode_bit3,
1366 {"80-bit Short-HMAC", "wmx.security_negotiation_parameters.mac_mode.bit3",FT_BOOLEAN, 8, TFS(&tfs_supported), SNP_MAC_MODE_BIT3, NULL, HFILL}
1369 &hf_snp_mac_mode_bit4,
1370 {"96-bit Short-HMAC", "wmx.security_negotiation_parameters.mac_mode.bit4",FT_BOOLEAN, 8, TFS(&tfs_supported), SNP_MAC_MODE_BIT4, NULL, HFILL}
1373 &hf_snp_mac_mode_bit5,
1374 {"CMAC", "wmx.security_negotiation_parameters.mac_mode.bit5",FT_BOOLEAN, 8, TFS(&tfs_supported), SNP_MAC_MODE_BIT5, NULL, HFILL}
1377 &hf_snp_mac_mode_reserved,
1378 {"Reserved", "wmx.security_negotiation_parameters.mac_mode.reserved",FT_UINT8, BASE_HEX, NULL, SNP_MAC_MODE_RSV, NULL, HFILL}
1381 &hf_snp_mac_mode_reserved1,
1382 {"Reserved", "wmx.security_negotiation_parameters.mac_mode.reserved",FT_UINT8, BASE_HEX, NULL, SNP_MAC_MODE_RSV1, NULL, HFILL}
1385 &hf_snp_pn_window_size,
1386 {"PN Window Size", "wmx.security_negotiation_parameters.pn_window_size",FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}
1389 &hf_snp_max_conc_transactions,
1390 {"Maximum concurrent transactions (0 indicates no limit)", "wmx.security_negotiation_parameters.max_conc_transactions",FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}
1393 &hf_snp_max_suppt_sec_assns,
1394 {"Maximum number of security associations supported by the SS", "wmx.security_negotiation_parameters.max_suppt_sec_assns",FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}
1397 &hf_snp_unknown_type,
1398 {"Unknown Security Negotiation Parameter type", "wmx.security_negotiation_parameters.unknown.type",FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
1402 static hf_register_info hf_pkm[] =
1404 { /* 11.9.1 - type 6 */
1405 &hf_pkm_msg_attr_display,
1406 {"Display String", "wmx.pkm_msg.pkm_attr.display_string", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL}
1408 { /* 11.9.2 - type 7 */
1409 &hf_pkm_msg_attr_auth_key,
1410 {"Auth Key", "wmx.pkm_msg.pkm_attr.auth_key", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
1412 { /* 11.9.3 - type 8 */
1413 &hf_pkm_msg_attr_tek,
1414 {"TEK", "wmx.pkm_msg.pkm_attr.tek", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
1416 { /* 11.9.4 - type 9 */
1417 &hf_pkm_msg_attr_key_life_time,
1418 {"Key Lifetime", "wmx.pkm_msg.pkm_attr.key_life_time", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL}
1420 { /* 11.9.5 - type 10 */
1421 &hf_pkm_msg_attr_key_seq_num,
1422 {"Key Sequence Number", "wmx.pkm_msg.pkm_attr.key_seq_num", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}
1424 { /* 11.9.6 - type 11 */
1425 &hf_pkm_msg_attr_hmac_digest,
1426 {"HMAC-Digest", "wmx.pkm_msg.pkm_attr.hmac_digest", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
1428 { /* 11.9.7 - type 12 */
1429 &hf_pkm_msg_attr_said,
1430 {"SAID", "wmx.pkm_msg.pkm_attr.said", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}
1432 #if 0 /* not been used */
1433 { /* 11.9.8 - type 13 */
1434 &hf_pkm_msg_attr_tek_param,
1435 {"TEK Parameters", "wmx.pkm_msg.pkm_attr.tek_parameters", FT_BYTES, BASE_HEX, NULL, 0x0, "", HFILL}
1438 { /* 11.9.9 - type 15 */
1439 &hf_pkm_msg_attr_cbc_iv,
1440 {"CBC IV", "wmx.pkm_msg.pkm_attr.cbc_iv", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
1442 { /* 11.9.10 - type 16 */
1443 &hf_pkm_msg_attr_error_code,
1444 {"Error Code", "wmx.pkm_msg.pkm_attr.error_code", FT_UINT8, BASE_DEC, VALS(vals_pkm_attr_error_codes), 0x0, NULL, HFILL}
1446 { /* 11.9.11 - type 17 */
1447 &hf_pkm_msg_attr_ca_certificate,
1448 {"CA Certificate", "wmx.pkm_msg.pkm_attr.ca_certificate", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
1450 { /* 11.9.12 - type 18 */
1451 &hf_pkm_msg_attr_ss_certificate,
1452 {"SS Certificate", "wmx.pkm_msg.pkm_attr.ss_certificate", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
1454 #if 0 /* not been used */
1455 { /* 11.9.13 - type 19 */
1456 &hf_pkm_msg_attr_security_capabilities,
1457 {"Security Capabilities", "wmx.pkm_msg.pkm_attr.security_capabilities", FT_BYTES, BASE_HEX, NULL, 0x0, "", HFILL}
1460 { /* 11.9.14 - type 20 */
1461 &hf_pkm_msg_crypto_suite,
1462 {"Cryptography", "wmx.pkm_msg.pkm_attr.crypto_suite", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
1465 &hf_pkm_msg_crypto_suite_msb,
1466 {"Data Encryption Algorithm Identifiers", "wmx.pkm_msg.pkm_attr.crypto_suite.msb", FT_UINT8, BASE_DEC, VALS(vals_data_encryption_ids), 0x0, NULL, HFILL}
1469 &hf_pkm_msg_crypto_suite_middle,
1470 {"Data Authentication Algorithm Identifiers", "wmx.pkm_msg.pkm_attr.crypto_suite.middle", FT_UINT8, BASE_DEC, VALS(vals_data_authentication_ids), 0x0, NULL, HFILL}
1473 &hf_pkm_msg_crypto_suite_lsb,
1474 {"TEK Encryption Algorithm Identifiers", "wmx.pkm_msg.pkm_attr.crypto_suite.lsb", FT_UINT8, BASE_DEC, VALS(vals_tek_encryption_ids), 0x0, NULL, HFILL}
1476 #if 0 /* not been used */
1477 { /* 11.9.15 - type 21 */
1478 &hf_pkm_msg_crypto_list,
1479 {"Cryptographic-Suite List", "wmx.pkm_msg.pkm_attr.crypto_suite_list", FT_BYTES, BASE_HEX, NULL, 0x0, "", HFILL}
1482 #if 0 /* deleted by 802.16E */
1483 { /* 11.9.16 - type 22 */
1484 &hf_pkm_msg_version,
1485 {"Reserved ", "wmx.pkm_msg.pkm_attr.version", FT_UINT8, BASE_HEX, NULL, 0x0, "", HFILL}
1488 #if 0 /* not been used */
1489 { /* 11.9.17 - type 23 */
1490 &hf_pkm_msg_sa_descriptor,
1491 {"SA Descriptor", "wmx.pkm_msg.pkm_attr.sa_descriptor", FT_BYTES, BASE_HEX, NULL, 0x0, "", HFILL}
1494 { /* 11.9.18 - type 24 */
1496 {"SA Type", "wmx.pkm_msg.pkm_attr.sa_type", FT_UINT8, BASE_DEC, VALS(vs_sa_type), 0x0, NULL, HFILL}
1498 #if 0 /* not been used */
1499 { /* 11.9.?? - type 25 */
1500 &hf_pkm_attr_security_negotiation_parameters,
1501 {"Security Negotiation Parameters", "wmx.pkm_msg.pkm_attr.security_negotiation_parameters", FT_BYTES, BASE_HEX, NULL, 0x0, "", HFILL}
1504 #if 0 /* not been used */
1505 { /* 11.9.19 - type 27 */
1506 &hf_pkm_attr_config_settings,
1507 {"PKM Configuration Settings", "wmx.pkm_msg.pkm_attr.config_settings", FT_BYTES, BASE_HEX, NULL, 0x0, "", HFILL}
1511 &hf_pkm_config_settings_authorize_waitout,
1512 {"Authorize Wait Timeout (in seconds)", "wmx.pkm_msg.pkm_attr.config_settings.authorize_waitout", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL}
1515 &hf_pkm_config_settings_reauthorize_waitout,
1516 {"Reauthorize Wait Timeout (in seconds)", "wmx.pkm_msg.pkm_attr.config_settings.reauthorize_waitout", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL}
1519 &hf_pkm_config_settings_grace_time,
1520 {"Authorization Grace Time (in seconds)", "wmx.pkm_msg.pkm_attr.config_settings.grace_time", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL}
1523 &hf_pkm_config_settings_operational_waittime,
1524 {"Operational Wait Timeout (in seconds)", "wmx.pkm_msg.pkm_attr.config_settings.operational_wait_timeout", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL}
1527 &hf_pkm_config_settings_rekey_wait_timeout,
1528 {"Rekey Wait Timeout (in seconds)", "wmx.pkm_msg.pkm_attr.config_settings.rekey_wait_timeout", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL}
1531 &hf_pkm_config_settings_tek_grace_time,
1532 {"TEK Grace Time (in seconds)", "wmx.pkm_msg.pkm_attr.config_settings.tek_grace_time", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL}
1535 &hf_pkm_config_settings_authorize_reject_wait_timeout,
1536 {"Authorize Reject Wait Timeout(in seconds)", "wmx.pkm_msg.pkm_attr.config_settings.authorize_reject_wait_timeout", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL}
1538 { /* 11.9.20 - type 29 */
1540 {"Nonce", "wmx.pkm_msg.pkm_attr.nonce", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
1542 { /* 11.9.21 - type 33 */
1543 &hf_pkm_attr_ss_random,
1544 {"SS_RANDOM", "wmx.pkm_msg.pkm_attr.ss_random", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
1546 { /* 11.9.22 - type 34 */
1547 &hf_pkm_attr_bs_random,
1548 {"BS_RANDOM", "wmx.pkm_msg.pkm_attr.bs_random", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
1550 { /* 11.9.23 - type 35 */
1551 &hf_pkm_attr_pre_pak,
1552 {"Pre-PAK", "wmx.pkm_msg.pkm_attr.pre_pak", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
1554 #if 1 /* no definition */
1555 { /* 11.9.?? - type 36 */
1556 &hf_pkm_attr_pak_ak_seq_number,
1557 {"PAK/AK Sequence Number", "wmx.pkm_msg.pkm_attr.pak_ak_seq_number", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
1560 { /* 11.9.24 - type 37 */
1561 &hf_pkm_attr_bs_certificate,
1562 {"BS Certificate", "wmx.pkm_msg.pkm_attr.bs_certificate", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
1564 { /* 11.9.25 - type 38 */
1565 &hf_pkm_attr_sig_bs,
1566 {"SigBS", "wmx.pkm_msg.pkm_attr.sig_bs",FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
1568 { /* 11.9.26 - type 39 */
1569 &hf_pkm_attr_ms_mac_address,
1570 {"MS-MAC Address", "wmx.pkm_msg.pkm_attr.ms_mac_address",FT_ETHER, BASE_HEX, NULL, 0x0, NULL, HFILL}
1572 { /* 11.9.27 - type 40 */
1573 &hf_pkm_attr_cmac_digest,
1574 {"CMAC Digest", "wmx.pkm_msg.pkm_attr.cmac_digest",FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
1577 &hf_pkm_attr_cmac_digest_pn,
1578 {"CMAC Packet Number counter, CMAC_PN_*", "wmx.pkm_msg.pkm_attr.cmac_digest.pn",FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL}
1581 &hf_pkm_attr_cmac_digest_value,
1582 {"CMAC Value", "wmx.pkm_msg.pkm_attr.cmac_digest.value",FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
1584 { /* 11.9.28 - type 41 */
1585 &hf_pkm_attr_push_modes,
1586 {"Key Push Modes", "wmx.pkm_msg.pkm_attr.key_push_modes",FT_UINT8, BASE_DEC, VALS(va_key_push_modes), 0x0, NULL, HFILL}
1588 { /* 11.9.29 - type 42 */
1589 &hf_pkm_attr_key_push_counter,
1590 {"Key Push Counter", "wmx.pkm_msg.pkm_attr.key_push_counter",FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}
1592 { /* 11.9.30 - type 43 */
1594 {"GKEK", "wmx.pkm_msg.pkm_attr.gkek",FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
1596 { /* 11.9.31 - type 44 */
1597 &hf_pkm_attr_sig_ss,
1598 {"SigSS", "wmx.pkm_msg.pkm_attr.sig_ss",FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
1600 { /* 11.9.32 - type 45 */
1602 {"AKID", "wmx.pkm_msg.pkm_attr.akid",FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
1604 { /* 11.9.33 - type 28 */
1605 &hf_pkm_attr_eap_payload,
1606 {"EAP Payload", "wmx.pkm_msg.pkm_attr.eap_payload", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
1608 { /* 11.9.34 - type 30 */
1609 &hf_pkm_attr_auth_result_code,
1610 {"Auth Result Code", "wmx.pkm_msg.pkm_attr.auth_result_code", FT_UINT8, BASE_DEC, VALS(vs_success_reject), 0x0, NULL, HFILL}
1612 { /* 11.9.35 - type 31 */
1613 &hf_pkm_attr_sa_service_type,
1614 {"SA Service Type", "wmx.pkm_msg.pkm_attr.sa_service_type", FT_UINT8, BASE_DEC, VALS(vs_sa_service_type), 0x0, NULL, HFILL}
1616 #if 0 /* same as 11.9.19 */
1617 { /* 11.9.36 - type 27 */
1618 &hf_pkm_attr_config_settings,
1619 {"PKMv2 Configuration Settings", "wmx.pkm_msg.pkm_attr.config_settings", FT_BYTES, BASE_HEX, NULL, 0x0, "", HFILL}
1622 { /* 11.9.37 - type 32 */
1623 &hf_pkm_attr_frame_number,
1624 {"Frame Number", "wmx.pkm_msg.pkm_attr.frame_number", FT_UINT24, BASE_DEC, NULL, 0x0, NULL, HFILL}
1626 #if 1 /* no definitions */
1627 { /* 11.9.?? - type 46 */
1628 &hf_pkm_attr_associated_gkek_seq_number,
1629 {"Associated GKEK Sequence Number", "wmx.pkm_msg.pkm_attr.associated_gkek_seq_number",FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
1631 { /* 11.9.?? - type 47 */
1632 &hf_pkm_attr_gkek_params,
1633 {"GKEK Parameters", "wmx.pkm_msg.pkm_attr.gkek_params",FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
1637 &hf_pkm_msg_unknown_type,
1638 {"Unknown Type", "wmx.pkm.unknown.type", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
1642 /* WiMax Common TLV Encoding display */
1643 static hf_register_info hf_common_tlv[] =
1646 &hf_common_tlv_mac_version,
1647 { "MAC Version", "wmx.common_tlv.mac_version", FT_UINT8, BASE_DEC, VALS(vals_dcd_mac_version), 0x0, NULL, HFILL}
1650 &hf_common_tlv_vendor_id,
1651 { "Vendor ID Encoding", "wmx.common_tlv.vendor_id_encoding", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
1654 &hf_common_tlv_vendor_specific_type,
1655 { "Vendor Specific Type", "wmx.common_tlv.vendor_specific_type", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
1658 &hf_common_tlv_vendor_specific_length_size,
1660 "Vendor Specific Length Size", "wmx.common_tlv.vendor_specific_length_size",
1661 FT_UINT8, BASE_HEX, NULL, 0x0,
1666 &hf_common_tlv_vendor_specific_length,
1667 { "Vendor Specific Length", "wmx.common_tlv.vendor_specific_length", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}
1670 &hf_common_tlv_vendor_specific_value,
1671 { "Vendor Specific Value", "wmx.common_tlv.vendor_specific_value", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
1674 &hf_common_tlv_unknown_type,
1675 {"Unknown Common TLV Type", "wmx.common_tlv.unknown_type", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
1679 if(proto_wimax_utility_decoders == -1)
1681 proto_wimax_utility_decoders = proto_register_protocol (
1682 "WiMax Sub-TLV Messages", /* name */
1683 "WiMax Sub-TLV (sub)", /* short name */
1684 "wmx.sub" /* abbrev */
1687 proto_register_subtree_array(ett, array_length(ett));
1688 proto_register_field_array(proto_mac_mgmt_msg_reg_req_decoder, hf_sfe, array_length(hf_sfe));
1689 proto_register_field_array(proto_wimax_utility_decoders, hf_csper, array_length(hf_csper));
1690 proto_register_field_array(proto_wimax_utility_decoders, hf_xmac, array_length(hf_xmac));
1691 proto_register_field_array(proto_wimax_utility_decoders, hf_snp, array_length(hf_snp));
1692 proto_register_field_array(proto_wimax_utility_decoders, hf_pkm, array_length(hf_pkm));
1693 proto_register_field_array(proto_wimax_utility_decoders, hf_common_tlv, array_length(hf_common_tlv));
1695 eap_handle = find_dissector("eap");
1699 /**************************************************************/
1700 /* wimax_error_parameter_set_decoder() */
1701 /* decode and display the WiMax Error Parameter Set */
1703 /* tvb - pointer of the tvb of error_parameter_set */
1704 /* tree - pointer of Wireshark display tree */
1705 /* pinfo - pointer of Wireshark packet information structure*/
1706 /**************************************************************/
1707 void wimax_error_parameter_set_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
1710 guint tvb_len, tlv_len;
1712 proto_item *ceps_item = NULL;
1713 proto_tree *ceps_tree = NULL;
1714 proto_tree *tlv_tree = NULL;
1715 tlv_info_t tlv_info;
1717 /* get the tvb reported length */
1718 tvb_len = tvb_reported_length(tvb);
1720 /* display error parameter information */
1721 ceps_item = proto_tree_add_protocol_format(tree, proto_wimax_utility_decoders, tvb, offset, tvb_len, "Error Parameter Set (%u bytes)", tvb_len);
1722 /* add CS Parameter Encoding Rules subtree */
1723 ceps_tree = proto_item_add_subtree(ceps_item, ett_wimax_error_parameter_set);
1724 /* do nothing if the TLV fields is not exist */
1727 /* report error if the packet size is less than 2 bytes (type+length) */
1729 { /* invalid tlv info */
1730 if(check_col(pinfo->cinfo, COL_INFO))
1732 col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "Invalid Error Parameter Set");
1736 /* process the classifier error parameter set */
1737 while(offset < tvb_len)
1738 { /* get the TLV information */
1739 init_tlv_info(&tlv_info, tvb, offset);
1740 /* get the TLV type */
1741 tlv_type = get_tlv_type(&tlv_info);
1742 /* get the TLV length */
1743 tlv_len = get_tlv_length(&tlv_info);
1744 if(tlv_type == -1 || tlv_len > MAX_TLV_LEN || tlv_len < 1)
1745 { /* invalid tlv info */
1746 if(check_col(pinfo->cinfo, COL_INFO))
1748 col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "EPS TLV error");
1750 proto_tree_add_item(ceps_tree, hf_cst_invalid_tlv, tvb, offset, (tvb_len - offset), FALSE);
1753 #ifdef DEBUG /* for debug only */
1754 proto_tree_add_protocol_format(ceps_tree, proto_wimax_utility_decoders, tvb, offset, (tlv_len+2+get_tlv_size_of_length(&tlv_info)), "EPS TLV Type: %u (%u bytes, offset=%u, tvb_len=%u)", tlv_type, tlv_len, offset, tvb_len);
1756 /* update the offset */
1757 offset += get_tlv_value_offset(&tlv_info);
1758 /* parse the Classifier Error Parameter Set */
1761 case CST_ERROR_SET_ERRORED_PARAM:
1762 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_error_parameter_set, ceps_tree, hf_cst_error_set_errored_param, tvb, offset, tlv_len, FALSE);
1763 proto_tree_add_item(tlv_tree, hf_cst_error_set_errored_param, tvb, offset, tlv_len, FALSE);
1765 case CST_ERROR_SET_ERROR_CODE:
1766 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_error_parameter_set, ceps_tree, hf_cst_error_set_error_code, tvb, offset, tlv_len, FALSE);
1767 proto_tree_add_item(tlv_tree, hf_cst_error_set_error_code, tvb, offset, tlv_len, FALSE);
1769 case CST_ERROR_SET_ERROR_MSG:
1770 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_error_parameter_set, ceps_tree, hf_cst_error_set_error_msg, tvb, offset, tlv_len, FALSE);
1771 proto_tree_add_item(tlv_tree, hf_cst_error_set_error_msg, tvb, offset, tlv_len, FALSE);
1778 /****************************************************************/
1779 /* wimax_convengence_service_parameter_encoding_rules_decoder() */
1780 /* decode and display the WiMax Convergence Service Parameter */
1781 /* Encoding Rules */
1783 /* sfe_type - Service Flow Encodings type */
1784 /* tvb - pointer of the tvb of service flow encodings */
1785 /* tree - pointer of Wireshark display tree */
1786 /* pinfo - pointer of Wireshark packet information structure */
1787 /****************************************************************/
1788 /* CS Parameter Encoding Rules handling function */
1789 void wimax_convengence_service_parameter_encoding_rules_decoder(guint sfe_type, tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
1791 guint offset, tlv_offset;
1792 guint tvb_len, tlv_len, length;
1794 proto_item *csper_item = NULL;
1795 proto_tree *csper_tree = NULL;
1796 proto_tree *tlv_tree = NULL;
1797 proto_tree *ti_tree = NULL;
1798 tlv_info_t tlv_info;
1799 gboolean ipv6 = ((sfe_type == SFE_CSPER_PACKET_IPV6) || (sfe_type == SFE_CSPER_PACKET_IPV6_802_3) || (sfe_type == SFE_CSPER_PACKET_IPV6_802_1Q));
1802 if((sfe_type < SFE_CSPER_ATM) || (sfe_type > SFE_CSPER_PACKET_IP_802_3_ECRTP_COMPRESSION))
1803 return; /* invalid CS Parameter Encodings */
1805 /* get the tvb reported length */
1806 tvb_len = tvb_reported_length(tvb);
1808 /* display SFE information */
1809 csper_item = proto_tree_add_protocol_format(tree, proto_wimax_utility_decoders, tvb, offset, tvb_len, "Convergence Service Parameter Encoding Rules (%u bytes)", tvb_len);
1810 /* add CS Parameter Encoding Rules subtree */
1811 csper_tree = proto_item_add_subtree(csper_item, ett_wimax_cst_encoding_rules);
1812 /* do nothing if the TLV fields is not exist */
1815 /* report error if the packet size is less than 2 bytes (type+length) */
1817 { /* invalid tlv info */
1818 if(check_col(pinfo->cinfo, COL_INFO))
1820 col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "Invalid Convergence Service Parameter Encoding Rules");
1824 /* process WiMax Service Flow Encodings */
1825 while(offset < tvb_len)
1826 { /* get the TLV information */
1827 init_tlv_info(&tlv_info, tvb, offset);
1828 /* get the TLV type */
1829 tlv_type = get_tlv_type(&tlv_info);
1830 /* get the TLV length */
1831 tlv_len = get_tlv_length(&tlv_info);
1832 if(tlv_type == -1 || tlv_len > MAX_TLV_LEN || tlv_len < 1)
1833 { /* invalid tlv info */
1834 if(check_col(pinfo->cinfo, COL_INFO))
1836 col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "CSPER TLV error");
1838 proto_tree_add_item(csper_tree, hf_cst_invalid_tlv, tvb, offset, (tvb_len - offset), FALSE);
1841 #ifdef DEBUG /* for debug only */
1842 proto_tree_add_protocol_format(csper_tree, proto_wimax_utility_decoders, tvb, offset, (tlv_len+2+get_tlv_size_of_length(&tlv_info)), "CSPER TLV Type: %u (%u bytes, offset=%u, tvb_len=%u)", tlv_type, tlv_len, offset, tvb_len);
1844 /* update the offset */
1845 offset += get_tlv_value_offset(&tlv_info);
1846 /* parse the CS parameter Encoding Rule TLV */
1847 if(sfe_type == SFE_CSPER_ATM)
1848 { /* ATM CS Encodings */
1851 case CST_ATM_SWITCHING:
1852 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_cst_encoding_rules, csper_tree, hf_csper_atm_switching_encoding, tvb, offset, tlv_len, FALSE);
1853 proto_tree_add_item(tlv_tree, hf_csper_atm_switching_encoding, tvb, offset, tlv_len, FALSE);
1855 case CST_ATM_CLASSIFIER:
1856 /* add TLV subtree */
1857 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_cst_encoding_rules, csper_tree, hf_csper_atm_classifier, tvb, offset, tlv_len, FALSE);
1858 tlv_offset = offset;
1859 while(tlv_offset < (tlv_len + offset))
1861 /* get the TLV information */
1862 init_tlv_info(&tlv_info, tvb, tlv_offset);
1863 /* get the TLV type */
1864 tlv_type = get_tlv_type(&tlv_info);
1865 /* get the TLV length */
1866 length = get_tlv_length(&tlv_info);
1867 if(tlv_type == -1 || length > MAX_TLV_LEN || length < 1)
1868 { /* invalid tlv info */
1869 if(check_col(pinfo->cinfo, COL_INFO))
1871 col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "ATM Classifier TLV error");
1873 proto_tree_add_item(tlv_tree, hf_cst_invalid_tlv, tvb, offset, (tlv_len - tlv_offset), FALSE);
1876 #ifdef DEBUG /* for debug only */
1877 proto_tree_add_protocol_format(csper_tree, proto_wimax_utility_decoders, tvb, offset, (tlv_len+2+get_tlv_size_of_length(&tlv_info)), "ATM Classifier TLV Type: %u (%u bytes, offset=%u, tlv_len=%u)", tlv_type, length, offset, tlv_len);
1879 /* update the offset */
1880 tlv_offset += get_tlv_value_offset(&tlv_info);
1883 case ATM_VPI_CLASSIFIER:
1884 ti_tree = add_tlv_subtree(&tlv_info, ett_wimax_cst_encoding_rules, tlv_tree, hf_csper_atm_classifier_vpi, tvb, tlv_offset, length, FALSE);
1885 proto_tree_add_item(ti_tree, hf_csper_atm_classifier_vpi, tvb, tlv_offset, length, FALSE);
1887 case ATM_VCI_CLASSIFIER:
1888 ti_tree = add_tlv_subtree(&tlv_info, ett_wimax_cst_encoding_rules, tlv_tree, hf_csper_atm_classifier_vci, tvb, tlv_offset, length, FALSE);
1889 proto_tree_add_item(ti_tree, hf_csper_atm_classifier_vci, tvb, tlv_offset, length, FALSE);
1891 case ATM_CLASSIFIER_ID:
1892 ti_tree = add_tlv_subtree(&tlv_info, ett_wimax_cst_encoding_rules, tlv_tree, hf_csper_atm_classifier_id, tvb, tlv_offset, length, FALSE);
1893 proto_tree_add_item(ti_tree, hf_csper_atm_classifier_id, tvb, tlv_offset, length, FALSE);
1898 tlv_offset += length;
1899 } /* end of while loop */
1901 case CST_ATM_CLASSIFIER_DSC_ACTION:
1902 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_cst_encoding_rules, csper_tree, hf_cst_classifier_dsc_action, tvb, offset, tlv_len, FALSE);
1903 proto_tree_add_item(tlv_tree, hf_cst_classifier_dsc_action, tvb, offset, tlv_len, FALSE);
1905 case CST_ATM_CLASSIFIER_ERROR_PARAMETER_SET:
1906 /* call the error parameter set function */
1907 tlv_tree = add_protocol_subtree(&tlv_info, ett_wimax_cst_encoding_rules, csper_tree, proto_wimax_utility_decoders, tvb, offset, tlv_len, "Classifier Error Parameter Set (%u byte(s))", tlv_len);
1908 wimax_error_parameter_set_decoder(tvb_new_subset(tvb, offset, tlv_len, tlv_len), pinfo, tlv_tree);
1911 /* display the unknown ATM CS encoding in hex */
1912 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_cst_encoding_rules, csper_tree, hf_csper_unknown_type, tvb, offset, tlv_len, FALSE);
1913 proto_tree_add_item(tlv_tree, hf_csper_unknown_type, tvb, offset, tlv_len, FALSE);
1921 case CST_CLASSIFIER_ACTION:
1922 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_cst_encoding_rules, csper_tree, hf_cst_classifier_dsc_action, tvb, offset, tlv_len, FALSE);
1923 proto_tree_add_item(tlv_tree, hf_cst_classifier_dsc_action, tvb, offset, tlv_len, FALSE);
1925 case CST_CLASSIFIER_ERROR_PARAM_SET:
1926 case CST_PHS_ERROR_PARAM_SET:
1927 tlv_tree = add_protocol_subtree(&tlv_info, ett_wimax_cst_encoding_rules, csper_tree, proto_wimax_utility_decoders, tvb, offset, tlv_len, "Classifier Error Parameter Set (%u byte(s))", tlv_len);
1928 /* call the error parameter set function */
1929 wimax_error_parameter_set_decoder(tvb_new_subset(tvb, offset, tlv_len, tlv_len), pinfo, tlv_tree);
1931 case CST_PACKET_CLASSIFICATION_RULE:
1933 /* add TLV subtree */
1934 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_cst_encoding_rules, csper_tree, hf_cst_pkt_class_rule, tvb, offset, tlv_len, FALSE);
1935 tlv_offset = offset;
1936 while(tlv_offset < (tlv_len + offset))
1938 /* get the TLV information */
1939 init_tlv_info(&tlv_info, tvb, tlv_offset);
1940 /* get the TLV type */
1941 tlv_type = get_tlv_type(&tlv_info);
1942 /* get the TLV length */
1943 length = get_tlv_length(&tlv_info);
1944 if(tlv_type == -1 || length > MAX_TLV_LEN || length < 1)
1945 { /* invalid tlv info */
1946 if(check_col(pinfo->cinfo, COL_INFO))
1948 col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "Packet Classification Rule TLV error");
1950 proto_tree_add_item(tlv_tree, hf_cst_invalid_tlv, tvb, offset, (tlv_len - tlv_offset), FALSE);
1953 #ifdef DEBUG /* for debug only */
1954 proto_tree_add_protocol_format(csper_tree, proto_wimax_utility_decoders, tvb, tlv_offset, (length + get_tlv_value_offset(&tlv_info)), "Packet Classification Rule TLV Type: %u (%u bytes, offset=%u, tlv_len=%u)", tlv_type, length, tlv_offset, tlv_len);
1956 /* update the offset */
1957 tlv_offset += get_tlv_value_offset(&tlv_info);
1960 case CST_PKT_CLASS_RULE_PRIORITY:
1961 ti_tree = add_tlv_subtree(&tlv_info, ett_wimax_cst_encoding_rules, tlv_tree, hf_cst_pkt_class_rule_priority, tvb, tlv_offset, length, FALSE);
1962 proto_tree_add_item(ti_tree, hf_cst_pkt_class_rule_priority, tvb, tlv_offset, length, FALSE);
1964 case CST_PKT_CLASS_RULE_RANGE_MASK:
1965 /* add TLV subtree */
1966 ti_tree = add_tlv_subtree(&tlv_info, ett_wimax_cst_encoding_rules, tlv_tree, hf_cst_pkt_class_rule_range_mask, tvb, tlv_offset, length, FALSE);
1967 proto_tree_add_item(ti_tree, hf_cst_pkt_class_rule_tos_low, tvb,
1968 tlv_offset, 1, FALSE);
1969 proto_tree_add_item(ti_tree, hf_cst_pkt_class_rule_tos_high, tvb,
1970 tlv_offset + 1, 1, FALSE);
1971 proto_tree_add_item(ti_tree, hf_cst_pkt_class_rule_tos_mask, tvb,
1972 tlv_offset + 2, 1, FALSE);
1974 case CST_PKT_CLASS_RULE_PROTOCOL:
1975 ti_tree = add_tlv_subtree(&tlv_info, ett_wimax_cst_encoding_rules, tlv_tree, hf_cst_pkt_class_rule_protocol, tvb, tlv_offset, length, FALSE);
1976 proto_tree_add_item(ti_tree, hf_cst_pkt_class_rule_protocol, tvb, tlv_offset, length, FALSE);
1978 case CST_PKT_CLASS_RULE_SRC_IP:
1979 /* add TLV subtree */
1980 ti_tree = add_tlv_subtree(&tlv_info, ett_wimax_cst_encoding_rules, tlv_tree, hf_cst_pkt_class_rule_ip_masked_src_address, tvb, tlv_offset, length, FALSE);
1983 proto_tree_add_item(ti_tree, hf_cst_pkt_class_rule_src_ipv6, tvb, tlv_offset, 16, FALSE);
1984 proto_tree_add_item(ti_tree, hf_cst_pkt_class_rule_mask_ipv6, tvb, tlv_offset + 16, 16, FALSE);
1988 proto_tree_add_item(ti_tree, hf_cst_pkt_class_rule_src_ipv4, tvb, tlv_offset, 4, FALSE);
1989 proto_tree_add_item(ti_tree, hf_cst_pkt_class_rule_mask_ipv4, tvb, tlv_offset + 4, 4, FALSE);
1992 case CST_PKT_CLASS_RULE_DST_IP:
1993 /* add TLV subtree */
1994 ti_tree = add_tlv_subtree(&tlv_info, ett_wimax_cst_encoding_rules, tlv_tree, hf_cst_pkt_class_rule_ip_masked_dest_address, tvb, tlv_offset, length, FALSE);
1997 proto_tree_add_item(ti_tree, hf_cst_pkt_class_rule_dest_ipv6, tvb, tlv_offset, 16, FALSE);
1998 proto_tree_add_item(ti_tree, hf_cst_pkt_class_rule_mask_ipv6, tvb, tlv_offset + 16, 16, FALSE);
2002 proto_tree_add_item(ti_tree, hf_cst_pkt_class_rule_dest_ipv4, tvb, tlv_offset, 4, FALSE);
2003 proto_tree_add_item(ti_tree, hf_cst_pkt_class_rule_mask_ipv4, tvb, tlv_offset + 4, 4, FALSE);
2006 case CST_PKT_CLASS_RULE_SRCPORT_RANGE:
2007 /* add TLV subtree */
2008 ti_tree = add_tlv_subtree(&tlv_info, ett_wimax_cst_encoding_rules, tlv_tree, hf_cst_pkt_class_rule_prot_src_port_range, tvb, tlv_offset, length, FALSE);
2009 proto_tree_add_item(ti_tree, hf_cst_pkt_class_rule_src_port_low, tvb, tlv_offset, 2, FALSE);
2010 proto_tree_add_item(ti_tree, hf_cst_pkt_class_rule_src_port_high, tvb, tlv_offset + 2, 2, FALSE);
2012 case CST_PKT_CLASS_RULE_DSTPORT_RANGE:
2013 /* add TLV subtree */
2014 ti_tree = add_tlv_subtree(&tlv_info, ett_wimax_cst_encoding_rules, tlv_tree, hf_cst_pkt_class_rule_prot_dest_port_range, tvb, tlv_offset, length, FALSE);
2015 proto_tree_add_item(ti_tree, hf_cst_pkt_class_rule_dest_port_low, tvb, tlv_offset, 2, FALSE);
2016 proto_tree_add_item(ti_tree, hf_cst_pkt_class_rule_dest_port_high, tvb, tlv_offset + 2, 2, FALSE);
2018 case CST_PKT_CLASS_RULE_DST_MAC:
2019 ti_tree = add_tlv_subtree(&tlv_info, ett_wimax_cst_encoding_rules, tlv_tree, hf_cst_pkt_class_rule_dest_mac_address, tvb, tlv_offset, length, FALSE);
2020 /* add TLV subtree */
2021 proto_tree_add_item(ti_tree, hf_cst_pkt_class_rule_dest_mac, tvb, tlv_offset, 6, FALSE);
2022 proto_tree_add_item(ti_tree, hf_cst_pkt_class_rule_mask_mac, tvb, tlv_offset + 6, 6, FALSE);
2024 case CST_PKT_CLASS_RULE_SRC_MAC:
2025 /* add TLV subtree */
2026 ti_tree = add_tlv_subtree(&tlv_info, ett_wimax_cst_encoding_rules, tlv_tree, hf_cst_pkt_class_rule_src_mac_address, tvb, tlv_offset, length, FALSE);
2027 proto_tree_add_item(ti_tree, hf_cst_pkt_class_rule_src_mac, tvb, tlv_offset, 6, FALSE);
2028 proto_tree_add_item(ti_tree, hf_cst_pkt_class_rule_mask_mac, tvb, tlv_offset + 6, 6, FALSE);
2030 case CST_PKT_CLASS_RULE_ETHERTYPE:
2031 /* add TLV subtree */
2032 ti_tree = add_tlv_subtree(&tlv_info, ett_wimax_cst_encoding_rules, tlv_tree, hf_cst_pkt_class_rule_ethertype, tvb, tlv_offset, length, FALSE);
2033 proto_tree_add_item(ti_tree, hf_cst_pkt_class_rule_etype, tvb, tlv_offset, 1, FALSE);
2034 proto_tree_add_item(ti_tree, hf_cst_pkt_class_rule_eprot1, tvb, tlv_offset + 1, 1, FALSE);
2035 proto_tree_add_item(ti_tree, hf_cst_pkt_class_rule_eprot2, tvb, tlv_offset + 2, 1, FALSE);
2037 case CST_PKT_CLASS_RULE_USER_PRIORITY:
2038 /* add TLV subtree */
2039 ti_tree = add_tlv_subtree(&tlv_info, ett_wimax_cst_encoding_rules, tlv_tree, hf_cst_pkt_class_rule_user_priority, tvb, tlv_offset, length, FALSE);
2040 proto_tree_add_item(ti_tree, hf_cst_pkt_class_rule_pri_low, tvb, tlv_offset, 1, FALSE);
2041 proto_tree_add_item(ti_tree, hf_cst_pkt_class_rule_pri_high, tvb, tlv_offset + 1, 1, FALSE);
2043 case CST_PKT_CLASS_RULE_VLAN_ID:
2044 /* add TLV subtree */
2045 ti_tree = add_tlv_subtree(&tlv_info, ett_wimax_cst_encoding_rules, tlv_tree, hf_cst_pkt_class_rule_vlan_id, tvb, tlv_offset, length, FALSE);
2046 proto_tree_add_item(ti_tree, hf_cst_pkt_class_rule_vlan_id1, tvb, tlv_offset, 1, FALSE);
2047 proto_tree_add_item(ti_tree, hf_cst_pkt_class_rule_vlan_id2, tvb, tlv_offset + 1, 1, FALSE);
2049 case CST_PKT_CLASS_RULE_PHSI:
2050 ti_tree = add_tlv_subtree(&tlv_info, ett_wimax_cst_encoding_rules, tlv_tree, hf_cst_pkt_class_rule_phsi, tvb, tlv_offset, length, FALSE);
2051 proto_tree_add_item(ti_tree, hf_cst_pkt_class_rule_phsi, tvb, tlv_offset, length, FALSE);
2053 case CST_PKT_CLASS_RULE_INDEX:
2054 ti_tree = add_tlv_subtree(&tlv_info, ett_wimax_cst_encoding_rules, tlv_tree, hf_cst_pkt_class_rule_index, tvb, tlv_offset, length, FALSE);
2055 proto_tree_add_item(ti_tree, hf_cst_pkt_class_rule_index, tvb, tlv_offset, length, FALSE);
2057 case CST_PKT_CLASS_RULE_IPv6_FLOW_LABEL:
2059 ti_tree = add_tlv_subtree(&tlv_info, ett_wimax_cst_encoding_rules, tlv_tree, hf_cst_pkt_class_rule_ipv6_flow_label, tvb, tlv_offset, length, FALSE);
2060 proto_tree_add_item(ti_tree, hf_cst_pkt_class_rule_ipv6_flow_label, tvb, tlv_offset, length, FALSE);
2062 case CST_PKT_CLASS_RULE_VENDOR_SPEC:
2063 ti_tree = add_tlv_subtree(&tlv_info, ett_wimax_cst_encoding_rules, tlv_tree, hf_cst_pkt_class_rule_vendor_spec, tvb, tlv_offset, length, FALSE);
2064 proto_tree_add_item(ti_tree, hf_cst_pkt_class_rule_vendor_spec, tvb, tlv_offset, length, FALSE);
2066 case CST_CLASSIFIER_ACTION_RULE:
2067 /* add TLV subtree */
2068 ti_tree = add_tlv_subtree(&tlv_info, ett_wimax_cst_encoding_rules, tlv_tree, hf_cst_pkt_class_rule_classifier_action_rule, tvb, tlv_offset, length, FALSE);
2069 proto_tree_add_item(ti_tree, hf_cst_pkt_class_rule_classifier_action_rule_bit0, tvb, tlv_offset, 1, FALSE);
2070 proto_tree_add_item(ti_tree, hf_cst_pkt_class_rule_classifier_action_rule_bit1, tvb, tlv_offset, 1, FALSE);
2072 case CST_PKT_CLASS_RULE_LARGE_CONTEXT_ID:
2073 ti_tree = add_tlv_subtree(&tlv_info, ett_wimax_cst_encoding_rules, tlv_tree, hf_cst_large_context_id, tvb, tlv_offset, length, FALSE);
2074 proto_tree_add_item(ti_tree, hf_cst_large_context_id, tvb, tlv_offset, length, FALSE);
2076 case CST_PKT_CLASS_RULE_SHORT_FORMAT_CONTEXT_ID:
2077 ti_tree = add_tlv_subtree(&tlv_info, ett_wimax_cst_encoding_rules, tlv_tree, hf_cst_short_format_context_id, tvb, tlv_offset, length, FALSE);
2078 proto_tree_add_item(ti_tree, hf_cst_short_format_context_id, tvb, tlv_offset, length, FALSE);
2082 } /* end of switch */
2083 tlv_offset += length;
2084 } /* end of while loop */
2087 case CST_PHS_DSC_ACTION:
2088 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_cst_encoding_rules, csper_tree, hf_cst_phs_dsc_action, tvb, offset, tlv_len, FALSE);
2089 proto_tree_add_item(tlv_tree, hf_cst_phs_dsc_action, tvb, offset, tlv_len, FALSE);
2093 /* add TLV subtree */
2094 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_cst_encoding_rules, csper_tree, hf_cst_phs_rule, tvb, offset, tlv_len, FALSE);
2095 tlv_offset = offset;
2096 while(tlv_offset < (tlv_len + offset))
2098 /* get the TLV information */
2099 init_tlv_info(&tlv_info, tvb, tlv_offset);
2100 /* get the TLV type */
2101 tlv_type = get_tlv_type(&tlv_info);
2102 /* get the TLV length */
2103 length = get_tlv_length(&tlv_info);
2104 if(tlv_type == -1 || length > MAX_TLV_LEN || length < 1)
2105 { /* invalid tlv info */
2106 if(check_col(pinfo->cinfo, COL_INFO))
2108 col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "PHS n Rule TLV error");
2110 proto_tree_add_item(tlv_tree, hf_cst_invalid_tlv, tvb, offset, (tlv_len - tlv_offset), FALSE);
2113 #ifdef DEBUG /* for debug only */
2114 proto_tree_add_protocol_format(csper_tree, proto_wimax_utility_decoders, tvb, offset, (tlv_len+2+get_tlv_size_of_length(&tlv_info)), "PHS Rule TLV Type: %u (%u bytes, offset=%u, tlv_len=%u)", tlv_type, length, offset, tlv_len);
2116 /* update the offset */
2117 tlv_offset += get_tlv_value_offset(&tlv_info);
2121 ti_tree = add_tlv_subtree(&tlv_info, ett_wimax_cst_encoding_rules, tlv_tree, hf_cst_phs_phsi, tvb, tlv_offset, length, FALSE);
2122 proto_tree_add_item(ti_tree, hf_cst_phs_phsi, tvb, tlv_offset, length, FALSE);
2125 ti_tree = add_tlv_subtree(&tlv_info, ett_wimax_cst_encoding_rules, tlv_tree, hf_cst_phs_phsf, tvb, tlv_offset, length, FALSE);
2126 proto_tree_add_item(ti_tree, hf_cst_phs_phsf, tvb, tlv_offset, length, FALSE);
2129 ti_tree = add_tlv_subtree(&tlv_info, ett_wimax_cst_encoding_rules, tlv_tree, hf_cst_phs_phsm, tvb, tlv_offset, length, FALSE);
2130 proto_tree_add_item(ti_tree, hf_cst_phs_phsm, tvb, tlv_offset, length, FALSE);
2133 ti_tree = add_tlv_subtree(&tlv_info, ett_wimax_cst_encoding_rules, tlv_tree, hf_cst_phs_phss, tvb, tlv_offset, length, FALSE);
2134 proto_tree_add_item(ti_tree, hf_cst_phs_phss, tvb, tlv_offset, length, FALSE);
2137 ti_tree = add_tlv_subtree(&tlv_info, ett_wimax_cst_encoding_rules, tlv_tree, hf_cst_phs_phsv, tvb, tlv_offset, length, FALSE);
2138 proto_tree_add_item(ti_tree, hf_cst_phs_phsv, tvb, tlv_offset, length, FALSE);
2140 case CST_PHS_VENDOR_SPEC:
2141 ti_tree = add_tlv_subtree(&tlv_info, ett_wimax_cst_encoding_rules, tlv_tree, hf_cst_phs_vendor_spec, tvb, tlv_offset, length, FALSE);
2142 proto_tree_add_item(ti_tree, hf_cst_phs_vendor_spec, tvb, tlv_offset, length, FALSE);
2145 tlv_offset += length;
2150 /* display the unknown csper type in hex */
2151 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_cst_encoding_rules, tree, hf_csper_unknown_type, tvb, offset, tlv_len, FALSE);
2152 proto_tree_add_item(tlv_tree, hf_csper_unknown_type, tvb, offset, tlv_len, FALSE);
2154 } /* end of switch */
2157 } /* end of while loop */
2160 /**************************************************************/
2161 /* wimax_service_flow_encodings_decoder() */
2162 /* decode and display the WiMax Service Flow Encodings */
2164 /* tvb - pointer of the tvb of service flow encodings */
2165 /* tree - pointer of Wireshark display tree */
2166 /* pinfo - pointer of Wireshark packet information structure*/
2167 /**************************************************************/
2168 void wimax_service_flow_encodings_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
2171 guint tvb_len, tlv_len, tlv_value_offset, tlv_value;
2174 proto_item *tlv_item = NULL;
2175 proto_tree *tlv_tree = NULL;
2176 tlv_info_t tlv_info;
2178 /* get the tvb reported length */
2179 tvb_len = tvb_reported_length(tvb);
2180 #ifdef DEBUG /* for debug only */
2181 /* display dissector information */
2182 proto_tree_add_protocol_format(tree, proto_wimax_utility_decoders, tvb, 0, tvb_len, "WiMax Service Flow Encodings (%u bytes)", tvb_len);
2184 /* process WiMax Service Flow Encodings */
2186 /* do nothing if the TLV fields is not exist */
2189 /* report error if the packet size is less than 2 bytes (type+length) */
2191 { /* invalid tlv info */
2192 if(check_col(pinfo->cinfo, COL_INFO))
2194 col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "Invalid Service Flow Encodings");
2198 while(offset < tvb_len)
2199 { /* get the TLV information */
2200 init_tlv_info(&tlv_info, tvb, offset);
2201 /* get the TLV type */
2202 tlv_type = get_tlv_type(&tlv_info);
2203 /* get the TLV length */
2204 tlv_len = get_tlv_length(&tlv_info);
2205 if(tlv_type == -1 || tlv_len > MAX_TLV_LEN || tlv_len < 1)
2206 { /* invalid tlv info */
2207 if(check_col(pinfo->cinfo, COL_INFO))
2209 col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "Service Flow Encodings TLV error");
2211 proto_tree_add_item(tree, hf_cst_invalid_tlv, tvb, offset, (tvb_len - offset), FALSE);
2214 /* get the TLV value offset */
2215 tlv_value_offset = get_tlv_value_offset(&tlv_info);
2216 #ifdef DEBUG /* for debug only */
2217 proto_tree_add_protocol_format(tree, proto_wimax_utility_decoders, tvb, offset, (tlv_len + tlv_value_offset), "Service Flow Encodings TLV Type: %u (%u bytes, offset=%u, tvb_len=%u)", tlv_type, tlv_len, offset, tvb_len);
2219 /* update the offset */
2220 offset += tlv_value_offset;
2221 /* parse the Service Flow Encodings TLV */
2225 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_service_flow_encodings, tree, hf_sfe_sf_id, tvb, offset, tlv_len, FALSE);
2226 proto_tree_add_item(tlv_tree, hf_sfe_sf_id, tvb, offset, tlv_len, FALSE);
2229 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_service_flow_encodings, tree, hf_sfe_cid, tvb, offset, tlv_len, FALSE);
2230 proto_tree_add_item(tlv_tree, hf_sfe_cid, tvb, offset, tlv_len, FALSE);
2232 case SFE_SERVICE_CLASS_NAME:
2233 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_service_flow_encodings, tree, hf_sfe_service_class_name, tvb, offset, tlv_len, FALSE);
2234 proto_tree_add_item(tlv_tree, hf_sfe_service_class_name, tvb, offset, tlv_len, FALSE);
2236 case SFE_MBS_SERVICE:
2237 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_service_flow_encodings, tree, hf_sfe_mbs_service, tvb, offset, tlv_len, FALSE);
2238 proto_tree_add_item(tlv_tree, hf_sfe_mbs_service, tvb, offset, tlv_len, FALSE);
2240 case SFE_QOS_PARAMS_SET:
2241 /* add TLV subtree */
2242 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_service_flow_encodings, tree, hf_sfe_qos_params_set, tvb, offset, tlv_len, FALSE);
2243 proto_tree_add_item(tlv_tree, hf_sfe_set_provisioned, tvb, offset, 1, FALSE);
2244 proto_tree_add_item(tlv_tree, hf_sfe_set_admitted, tvb, offset, 1, FALSE);
2245 proto_tree_add_item(tlv_tree, hf_sfe_set_active, tvb, offset, 1, FALSE);
2246 proto_tree_add_item(tlv_tree, hf_sfe_set_rsvd, tvb, offset, 1, FALSE);
2248 case SFE_TRAFFIC_PRIORITY:
2249 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_service_flow_encodings, tree, hf_sfe_traffic_priority, tvb, offset, tlv_len, FALSE);
2250 tlv_item = proto_tree_add_item(tlv_tree, hf_sfe_traffic_priority, tvb, offset, tlv_len, FALSE);
2251 proto_item_append_text(tlv_item, " (allowed values are 0-7)");
2254 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_service_flow_encodings, tree, hf_sfe_max_str, tvb, offset, tlv_len, FALSE);
2255 tlv_item = proto_tree_add_item(tlv_tree, hf_sfe_max_str, tvb, offset, tlv_len, FALSE);
2256 proto_item_append_text(tlv_item, " bps");
2258 case SFE_MAX_TRAFFIC_BURST:
2259 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_service_flow_encodings, tree, hf_sfe_max_traffic_burst, tvb, offset, tlv_len, FALSE);
2260 tlv_item = proto_tree_add_item(tlv_tree, hf_sfe_max_traffic_burst, tvb, offset, tlv_len, FALSE);
2261 proto_item_append_text(tlv_item, " bytes");
2264 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_service_flow_encodings, tree, hf_sfe_min_rtr, tvb, offset, tlv_len, FALSE);
2265 tlv_item = proto_tree_add_item(tlv_tree, hf_sfe_min_rtr, tvb, offset, tlv_len, FALSE);
2266 proto_item_append_text(tlv_item, " bps");
2268 case SFE_RESERVED_10:
2269 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_service_flow_encodings, tree, hf_sfe_reserved_10, tvb, offset, tlv_len, FALSE);
2270 proto_tree_add_item(tlv_tree, hf_sfe_reserved_10, tvb, offset, tlv_len, FALSE);
2272 case SFE_UL_SCHEDULING:
2273 /* TODO: Find a way to get the correct service type from the TLV */
2274 tlv_value = tvb_get_guint8(tvb, offset);
2275 set_service_type( tlv_value );
2276 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_service_flow_encodings, tree, hf_sfe_ul_grant_scheduling, tvb, offset, tlv_len, FALSE);
2277 proto_tree_add_item(tlv_tree, hf_sfe_ul_grant_scheduling, tvb, offset, tlv_len, FALSE);
2280 /* add TLV subtree */
2281 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_service_flow_encodings, tree, hf_sfe_req_tx_policy, tvb, offset, tlv_len, FALSE);
2282 proto_tree_add_item(tlv_tree, hf_sfe_policy_broadcast_bwr, tvb, offset, 1, FALSE);
2283 proto_tree_add_item(tlv_tree, hf_sfe_policy_multicast_bwr, tvb, offset, 1, FALSE);
2284 proto_tree_add_item(tlv_tree, hf_sfe_policy_piggyback, tvb, offset, 1, FALSE);
2285 proto_tree_add_item(tlv_tree, hf_sfe_policy_fragment, tvb, offset, 1, FALSE);
2286 proto_tree_add_item(tlv_tree, hf_sfe_policy_headers, tvb, offset, 1, FALSE);
2287 proto_tree_add_item(tlv_tree, hf_sfe_policy_packing, tvb, offset, 1, FALSE);
2288 proto_tree_add_item(tlv_tree, hf_sfe_policy_crc, tvb, offset, 1, FALSE);
2289 proto_tree_add_item(tlv_tree, hf_sfe_policy_rsvd1, tvb, offset, 1, FALSE);
2291 case SFE_TOLERATED_JITTER:
2292 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_service_flow_encodings, tree, hf_sfe_jitter, tvb, offset, tlv_len, FALSE);
2293 tlv_item = proto_tree_add_item(tlv_tree, hf_sfe_jitter, tvb, offset, tlv_len, FALSE);
2294 proto_item_append_text(tlv_item, " ms");
2296 case SFE_MAX_LATENCY:
2297 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_service_flow_encodings, tree, hf_sfe_max_latency, tvb, offset, tlv_len, FALSE);
2298 tlv_item = proto_tree_add_item(tlv_tree, hf_sfe_max_latency, tvb, offset, tlv_len, FALSE);
2299 proto_item_append_text(tlv_item, " ms");
2301 case SFE_FIXED_LEN_SDU:
2302 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_service_flow_encodings, tree, hf_sfe_fixed_len_sdu, tvb, offset, tlv_len, FALSE);
2303 proto_tree_add_item(tlv_tree, hf_sfe_fixed_len_sdu, tvb, offset, tlv_len, FALSE);
2306 /* save the SDU size */
2307 mac_sdu_length = tvb_get_guint8(tvb, offset);
2308 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_service_flow_encodings, tree, hf_sfe_sdu_size, tvb, offset, tlv_len, FALSE);
2309 tlv_item = proto_tree_add_item(tlv_tree, hf_sfe_sdu_size, tvb, offset, tlv_len, FALSE);
2310 proto_item_append_text(tlv_item, " bytes");
2312 case SFE_TARGET_SAID:
2313 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_service_flow_encodings, tree, hf_sfe_target_said, tvb, offset, tlv_len, FALSE);
2314 proto_tree_add_item(tlv_tree, hf_sfe_target_said, tvb, offset, tlv_len, FALSE);
2316 case SFE_ARQ_ENABLE:
2317 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_service_flow_encodings, tree, hf_sfe_arq_enable, tvb, offset, tlv_len, FALSE);
2318 proto_tree_add_item(tlv_tree, hf_sfe_arq_enable, tvb, offset, tlv_len, FALSE);
2320 case SFE_ARQ_WINDOW_SIZE:
2321 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_service_flow_encodings, tree, hf_sfe_arq_window_size, tvb, offset, tlv_len, FALSE);
2322 proto_tree_add_item(tlv_tree, hf_sfe_arq_window_size, tvb, offset, tlv_len, FALSE);
2324 case SFE_ARQ_TRANSMITTER_DELAY:
2325 if (include_cor2_changes)
2327 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_service_flow_encodings, tree, hf_sfe_arq_transmitter_delay_cor2, tvb, offset, tlv_len, FALSE);
2328 proto_tree_add_item(tlv_tree, hf_sfe_arq_transmitter_delay_cor2, tvb, offset, tlv_len, FALSE);
2332 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_service_flow_encodings, tree, hf_sfe_arq_transmitter_delay, tvb, offset, tlv_len, FALSE);
2333 proto_tree_add_item(tlv_tree, hf_sfe_arq_transmitter_delay, tvb, offset, tlv_len, FALSE);
2336 case SFE_ARQ_RECEIVER_DELAY:
2337 if (include_cor2_changes)
2339 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_service_flow_encodings, tree, hf_sfe_arq_receiver_delay_cor2, tvb, offset, tlv_len, FALSE);
2340 proto_tree_add_item(tlv_tree, hf_sfe_arq_receiver_delay_cor2, tvb, offset, tlv_len, FALSE);
2344 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_service_flow_encodings, tree, hf_sfe_arq_receiver_delay, tvb, offset, tlv_len, FALSE);
2345 proto_tree_add_item(tlv_tree, hf_sfe_arq_receiver_delay, tvb, offset, tlv_len, FALSE);
2348 case SFE_ARQ_BLOCK_LIFETIME:
2349 if (include_cor2_changes)
2351 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_service_flow_encodings, tree, hf_sfe_arq_block_lifetime_cor2, tvb, offset, tlv_len, FALSE);
2352 proto_tree_add_item(tlv_tree, hf_sfe_arq_block_lifetime_cor2, tvb, offset, tlv_len, FALSE);
2356 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_service_flow_encodings, tree, hf_sfe_arq_block_lifetime, tvb, offset, tlv_len, FALSE);
2357 proto_tree_add_item(tlv_tree, hf_sfe_arq_block_lifetime, tvb, offset, tlv_len, FALSE);
2360 case SFE_ARQ_SYNC_LOSS_TIMEOUT:
2361 if (include_cor2_changes)
2363 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_service_flow_encodings, tree, hf_sfe_arq_sync_loss_timeout_cor2, tvb, offset, tlv_len, FALSE);
2364 proto_tree_add_item(tlv_tree, hf_sfe_arq_sync_loss_timeout_cor2, tvb, offset, tlv_len, FALSE);
2368 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_service_flow_encodings, tree, hf_sfe_arq_sync_loss_timeout, tvb, offset, tlv_len, FALSE);
2369 proto_tree_add_item(tlv_tree, hf_sfe_arq_sync_loss_timeout, tvb, offset, tlv_len, FALSE);
2372 case SFE_ARQ_DELIVER_IN_ORDER:
2373 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_service_flow_encodings, tree, hf_sfe_arq_deliver_in_order, tvb, offset, tlv_len, FALSE);
2374 proto_tree_add_item(tlv_tree, hf_sfe_arq_deliver_in_order, tvb, offset, tlv_len, FALSE);
2376 case SFE_ARQ_RX_PURGE_TIMEOUT:
2377 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_service_flow_encodings, tree, hf_sfe_arq_rx_purge_timeout, tvb, offset, tlv_len, FALSE);
2378 proto_tree_add_item(tlv_tree, hf_sfe_arq_rx_purge_timeout, tvb, offset, tlv_len, FALSE);
2380 case SFE_ARQ_BLOCK_SIZE:
2381 if (include_cor2_changes)
2383 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_service_flow_encodings, tree, hf_sfe_arq_block_size_cor2, tvb, offset, tlv_len, FALSE);
2384 tlv_item = proto_tree_add_item(tlv_tree, hf_sfe_arq_block_size_cor2, tvb, offset, tlv_len, FALSE);
2385 /* add TLV subtree */
2386 tlv_tree = proto_item_add_subtree(tlv_item, ett_wimax_service_flow_encodings);
2387 value = tvb_get_guint8(tvb, offset);
2388 tlv_item = proto_tree_add_item(tlv_tree, hf_sfe_arq_min_block_size, tvb, offset, 1, FALSE);
2389 /* Size is 2^((value & 0x0F) + 4)) */
2390 proto_item_append_text(tlv_item, " ( %d bytes )", 0x10 << (value & 0x0F));
2391 tlv_item = proto_tree_add_item(tlv_tree, hf_sfe_arq_max_block_size, tvb, offset, 1, FALSE);
2393 /* Size is 2^(((value & 0xF0) >> 4) + 4)) */
2394 proto_item_append_text(tlv_item, " ( %d bytes )", 0x10 << ((value & 0xF0) >> 4));
2398 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_service_flow_encodings, tree, hf_sfe_arq_block_size, tvb, offset, tlv_len, FALSE);
2399 proto_tree_add_item(tlv_tree, hf_sfe_arq_block_size, tvb, offset, tlv_len, FALSE);
2402 case SFE_CS_SPECIFICATION:
2403 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_service_flow_encodings, tree, hf_sfe_cs_specification, tvb, offset, tlv_len, FALSE);
2404 proto_tree_add_item(tlv_tree, hf_sfe_cs_specification, tvb, offset, tlv_len, FALSE);
2406 case SFE_TYPE_OF_DATA_DELIVERY_SERVICES:
2407 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_service_flow_encodings, tree, hf_sfe_type_of_data_delivery_services, tvb, offset, tlv_len, FALSE);
2408 proto_tree_add_item(tlv_tree, hf_sfe_type_of_data_delivery_services, tvb, offset, tlv_len, FALSE);
2410 case SFE_SDU_INTER_ARRIVAL_INTERVAL:
2411 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_service_flow_encodings, tree, hf_sfe_sdu_inter_arrival_interval, tvb, offset, tlv_len, FALSE);
2412 proto_tree_add_item(tlv_tree, hf_sfe_sdu_inter_arrival_interval, tvb, offset, tlv_len, FALSE);
2415 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_service_flow_encodings, tree, hf_sfe_time_base, tvb, offset, tlv_len, FALSE);
2416 tlv_item = proto_tree_add_item(tlv_tree, hf_sfe_time_base, tvb, offset, tlv_len, FALSE);
2417 proto_item_append_text(tlv_item, " ms");
2419 case SFE_PAGING_PREFERENCE:
2420 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_service_flow_encodings, tree, hf_sfe_paging_preference, tvb, offset, tlv_len, FALSE);
2421 proto_tree_add_item(tlv_tree, hf_sfe_paging_preference, tvb, offset, tlv_len, FALSE);
2423 case SFE_MBS_ZONE_IDENTIFIER_ASSIGNMENT:
2424 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_service_flow_encodings, tree, hf_sfe_mbs_zone_identifier_assignment, tvb, offset, tlv_len, FALSE);
2425 proto_tree_add_item(tlv_tree, hf_sfe_mbs_zone_identifier_assignment, tvb, offset, tlv_len, FALSE);
2427 case SFE_RESERVED_34:
2428 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_service_flow_encodings, tree, hf_sfe_reserved_34, tvb, offset, tlv_len, FALSE);
2429 proto_tree_add_item(tlv_tree, hf_sfe_reserved_34, tvb, offset, tlv_len, FALSE);
2431 case SFE_GLOBAL_SERVICE_CLASS_NAME:
2432 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_service_flow_encodings, tree, hf_sfe_global_service_class_name, tvb, offset, tlv_len, FALSE);
2433 proto_tree_add_item(tlv_tree, hf_sfe_global_service_class_name, tvb, offset, tlv_len, FALSE);
2436 case SFE_RESERVED_36:
2437 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_service_flow_encodings, tree, hf_sfe_reserved_36, tvb, offset, tlv_len, FALSE);
2438 proto_tree_add_item(tlv_tree, hf_sfe_reserved_36, tvb, offset, tlv_len, FALSE);
2441 case SFE_SN_FEEDBACK_ENABLED:
2442 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_service_flow_encodings, tree, hf_sfe_sn_feedback_enabled, tvb, offset, tlv_len, FALSE);
2443 proto_tree_add_item(tlv_tree, hf_sfe_sn_feedback_enabled, tvb, offset, tlv_len, FALSE);
2446 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_service_flow_encodings, tree, hf_sfe_fsn_size, tvb, offset, tlv_len, FALSE);
2447 proto_tree_add_item(tlv_tree, hf_sfe_fsn_size, tvb, offset, tlv_len, FALSE);
2449 case SFE_CID_ALLOCATION_FOR_ACTIVE_BS:
2450 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_service_flow_encodings, tree, hf_sfe_cid_alloc_for_active_bs_cid, tvb, offset, tlv_len, FALSE);
2451 for(i = 0; i < tlv_len; i+=2)
2452 proto_tree_add_item(tlv_tree, hf_sfe_cid_alloc_for_active_bs_cid, tvb, (offset+i), 2, FALSE);
2454 case SFE_UNSOLICITED_GRANT_INTERVAL:
2455 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_service_flow_encodings, tree, hf_sfe_unsolicited_grant_interval, tvb, offset, tlv_len, FALSE);
2456 tlv_item = proto_tree_add_item(tlv_tree, hf_sfe_unsolicited_grant_interval, tvb, offset, tlv_len, FALSE);
2457 proto_item_append_text(tlv_item, " ms");
2459 case SFE_UNSOLOCITED_POLLING_INTERVAL:
2460 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_service_flow_encodings, tree, hf_sfe_unsolicited_polling_interval, tvb, offset, tlv_len, FALSE);
2461 tlv_item = proto_tree_add_item(tlv_tree, hf_sfe_unsolicited_polling_interval, tvb, offset, tlv_len, FALSE);
2462 proto_item_append_text(tlv_item, " ms");
2464 case SFE_PDU_SN_EXT_SUBHEADER_HARQ_REORDER:
2465 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_service_flow_encodings, tree, hf_sfe_pdu_sn_ext_subheader_reorder, tvb, offset, tlv_len, FALSE);
2466 proto_tree_add_item(tlv_tree, hf_sfe_pdu_sn_ext_subheader_reorder, tvb, offset, tlv_len, FALSE);
2468 case SFE_MBS_CONTENTS_ID:
2469 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_service_flow_encodings, tree, hf_sfe_mbs_contents_ids, tvb, offset, tlv_len, FALSE);
2470 proto_tree_add_item(tlv_tree, hf_sfe_mbs_contents_ids, tvb, offset, tlv_len, FALSE);
2471 for(i = 0; i < tlv_len; i+=2)
2472 proto_tree_add_item(tlv_tree, hf_sfe_mbs_contents_ids_id, tvb, (offset+i), 2, FALSE);
2474 case SFE_HARQ_SERVICE_FLOWS:
2475 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_service_flow_encodings, tree, hf_sfe_harq_service_flows, tvb, offset, tlv_len, FALSE);
2476 proto_tree_add_item(tlv_tree, hf_sfe_harq_service_flows, tvb, offset, tlv_len, FALSE);
2478 case SFE_AUTHORIZATION_TOKEN:
2479 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_service_flow_encodings, tree, hf_sfe_authorization_token, tvb, offset, tlv_len, FALSE);
2480 proto_tree_add_item(tlv_tree, hf_sfe_authorization_token, tvb, offset, tlv_len, FALSE);
2482 case SFE_HARQ_CHANNEL_MAPPING:
2483 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_service_flow_encodings, tree, hf_sfe_harq_channel_mapping_index, tvb, offset, tlv_len, FALSE);
2484 for(i = 0; i < tlv_len; i++)
2485 proto_tree_add_item(tlv_tree, hf_sfe_harq_channel_mapping_index, tvb, (offset+i), 1, FALSE);
2487 /* 99 - 111 CS parameter encodings */
2489 case SFE_CSPER_PACKET_IPV4:
2490 case SFE_CSPER_PACKET_IPV6:
2491 case SFE_CSPER_PACKET_802_3:
2492 case SFE_CSPER_PACKET_802_1Q:
2493 case SFE_CSPER_PACKET_IPV4_802_3:
2494 case SFE_CSPER_PACKET_IPV6_802_3:
2495 case SFE_CSPER_PACKET_IPV4_802_1Q:
2496 case SFE_CSPER_PACKET_IPV6_802_1Q:
2497 case SFE_CSPER_PACKET_IP_ROCH_COMPRESSION:
2498 case SFE_CSPER_PACKET_IP_ECRTP_COMPRESSION:
2499 case SFE_CSPER_PACKET_IP_802_3_ROCH_COMPRESSION:
2500 case SFE_CSPER_PACKET_IP_802_3_ECRTP_COMPRESSION:
2501 /* call CS Parameter Encoding Rules handling function */
2502 tlv_tree = add_protocol_subtree(&tlv_info, ett_wimax_service_flow_encodings, tree, proto_wimax_utility_decoders, tvb, offset, tlv_len, "CS Parameter Encoding Rules (%u byte(s))", tlv_len);
2503 wimax_convengence_service_parameter_encoding_rules_decoder(tlv_type, tvb_new_subset(tvb, offset, tlv_len, tlv_len), pinfo, tlv_tree);
2506 tlv_tree = add_tlv_subtree(&tlv_info, ett_wimax_service_flow_encodings, tree, hf_sfe_unknown_type, tvb, offset, tlv_len, FALSE);
2507 /* display the unknown sfe type in hex */
2508 proto_tree_add_item(tlv_tree, hf_sfe_unknown_type, tvb, offset, tlv_len, FALSE);
2510 } /* end of switch */
2512 } /* end of while loop */
2515 /**************************************************************/
2516 /* wimax_hmac_tuple_decoder() */
2517 /* decode and display the WiMax HMAC Tuple (Table 348) */
2519 /* tree - pointer of Wireshark display tree */
2520 /* tvb - pointer of the tvb which contains the HMAC Tuple */
2521 /* offset - the HMAC Tuple offset in the tvb */
2522 /* length - length of the HMAC Tuple */
2523 /**************************************************************/
2524 void wimax_hmac_tuple_decoder(proto_tree *tree, tvbuff_t *tvb, guint offset, guint length)
2527 proto_item *hmac_item = NULL;
2528 proto_tree *hmac_tree = NULL;
2530 /* display decoder info (length should be 21 bytes) */
2531 hmac_item = proto_tree_add_protocol_format(tree, proto_wimax_utility_decoders, tvb, offset, length, "HMAC Tuple (%u bytes)", length);
2532 /* add HMAC subtree */
2533 hmac_tree = proto_item_add_subtree(hmac_item, ett_wimax_hmac_tuple);
2534 /* init the local offset */
2535 hmac_offset = offset;
2536 /* decode and display HMAC Tuple */
2537 proto_tree_add_item(hmac_tree, hf_xmac_tuple_rsvd, tvb, hmac_offset, 1, FALSE);
2538 proto_tree_add_item(hmac_tree, hf_xmac_tuple_key_seq_num, tvb, hmac_offset, 1, FALSE);
2540 proto_tree_add_item(hmac_tree, hf_hmac_tuple_hmac_digest, tvb, hmac_offset, (length-1), FALSE);
2543 /**************************************************************/
2544 /* wimax_cmac_tuple_decoder() */
2545 /* decode and display the WiMax CMAC Tuple (Table 348b) */
2547 /* tree - pointer of Wireshark display tree */
2548 /* tvb - pointer of the tvb which contains the CMAC Tuple */
2549 /* offset - the CMAC Tuple offset in the tvb */
2550 /* length - length of the CMAC Tuple */
2551 /**************************************************************/
2552 void wimax_cmac_tuple_decoder(proto_tree *tree, tvbuff_t *tvb, guint offset, guint length)
2555 proto_item *cmac_item = NULL;
2556 proto_tree *cmac_tree = NULL;
2558 /* display decoder info (length should be 13 or 19 bytes) */
2559 cmac_item = proto_tree_add_protocol_format(tree, proto_wimax_utility_decoders, tvb, offset, length, "CMAC Tuple (%u bytes)", length);
2560 /* add CMAC subtree */
2561 cmac_tree = proto_item_add_subtree(cmac_item, ett_wimax_cmac_tuple);
2562 /* init the local offset */
2563 cmac_offset = offset;
2564 /* decode and display CMAC Tuple */
2565 proto_tree_add_item(cmac_tree, hf_xmac_tuple_rsvd, tvb, cmac_offset, 1, FALSE);
2566 proto_tree_add_item(cmac_tree, hf_xmac_tuple_key_seq_num, tvb, cmac_offset, 1, FALSE);
2570 proto_tree_add_item(cmac_tree, hf_cmac_tuple_bsid, tvb, cmac_offset, 6, FALSE);
2573 proto_tree_add_item(cmac_tree, hf_packet_number_counter, tvb, cmac_offset, 4, FALSE);
2575 proto_tree_add_item(cmac_tree, hf_cmac_tuple_cmac_value, tvb, cmac_offset, 8, FALSE);
2578 /******************************************************************/
2579 /* wimax_short_hmac_tuple_decoder() */
2580 /* decode and display the WiMax Short-HMAC Tuple (Table 348d) */
2582 /* tree - pointer of Wireshark display tree */
2583 /* tvb - pointer of the tvb which contains the Short-HMAC Tuple */
2584 /* offset - the Short-HMAC Tuple offset in the tvb */
2585 /* length - length of the Short-HMAC Tuple */
2586 /******************************************************************/
2587 void wimax_short_hmac_tuple_decoder(proto_tree *tree, tvbuff_t *tvb, guint offset, guint length)
2590 proto_item *hmac_item = NULL;
2591 proto_tree *hmac_tree = NULL;
2593 /* display decoder info (length should be at least 13 bytes ???) */
2594 hmac_item = proto_tree_add_protocol_format(tree, proto_wimax_utility_decoders, tvb, offset, length, "Short-HMAC Tuple (%u bytes)", length);
2595 /* add Short-HMAC subtree */
2596 hmac_tree = proto_item_add_subtree(hmac_item, ett_wimax_short_hmac_tuple);
2597 /* init the local offset */
2598 hmac_offset = offset;
2599 /* decode and display Short-HMAC Tuple */
2600 proto_tree_add_item(hmac_tree, hf_xmac_tuple_rsvd, tvb, hmac_offset, 1, FALSE);
2601 proto_tree_add_item(hmac_tree, hf_xmac_tuple_key_seq_num, tvb, hmac_offset, 1, FALSE);
2603 proto_tree_add_item(hmac_tree, hf_packet_number_counter, tvb, hmac_offset, 4, FALSE);
2605 proto_tree_add_item(hmac_tree, hf_hmac_tuple_hmac_digest, tvb, hmac_offset, length - offset - 3, FALSE);
2608 /******************************************************************/
2609 /* wimax_security_negotiation_parameters_decoder() */
2610 /* decode and display the WiMax Security Negotiation Parameters */
2612 /* tvb - pointer of the tvb of service flow encodings */
2613 /* tree - pointer of Wireshark display tree */
2614 /* pinfo - pointer of Wireshark packet information structure */
2615 /******************************************************************/
2616 void wimax_security_negotiation_parameters_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
2619 guint tvb_len, tlv_len, tlv_value_offset;
2621 proto_tree *tlv_tree = NULL;
2622 tlv_info_t tlv_info;
2624 /* get the tvb reported length */
2625 tvb_len = tvb_reported_length(tvb);
2626 /* do nothing if the TLV fields is not exist */
2629 /* report error if the packet size is less than 2 bytes (type+length) */
2631 { /* invalid tlv info */
2632 if(check_col(pinfo->cinfo, COL_INFO))
2634 col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "Invalid Security Negotiation Parameters");
2638 /* process Security Negotiation Parameter TLVs */
2639 for(offset = 0; offset < tvb_len; )
2641 /* get the TLV information */
2642 init_tlv_info(&tlv_info, tvb, offset);
2643 /* get the TLV type */
2644 tlv_type = get_tlv_type(&tlv_info);
2645 /* get the TLV length */
2646 tlv_len = get_tlv_length(&tlv_info);
2647 if(tlv_type == -1 || tlv_len > MAX_TLV_LEN || tlv_len < 1)
2648 { /* invalid tlv info */
2649 if(check_col(pinfo->cinfo, COL_INFO))
2651 col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "Security Negotiation Params TLV error");
2653 proto_tree_add_item(tree, hf_cst_invalid_tlv, tvb, offset, (tvb_len - offset), FALSE);
2656 /* get the TLV value offset */
2657 tlv_value_offset = get_tlv_value_offset(&tlv_info);
2658 #ifdef DEBUG /* for debug only */
2659 proto_tree_add_protocol_format(tree, proto_wimax_utility_decoders, tvb, offset, (tlv_len + tlv_value_offset), "Security Negotiation Parameters Type: %u (%u bytes, offset=%u, tvb_len=%u)", tlv_type, (tlv_len + tlv_value_offset), offset, tvb_len);
2661 /* update the offset */
2662 offset += tlv_value_offset;
2663 /* parse Security Negotiation Parameters TLVs */
2666 case PKM_ATTR_SECURITY_NEGOTIATION_PARAMETER_SUB_PKM_VERSION_SUPPORT:
2667 /* add TLV subtree */
2668 tlv_tree = add_tlv_subtree(&tlv_info, ett_security_negotiation_parameters, tree, hf_snp_pkm_version_support, tvb, offset, tlv_len, FALSE);
2669 proto_tree_add_item(tlv_tree, hf_snp_pkm_version_support_bit0, tvb, offset, 1, FALSE);
2670 proto_tree_add_item(tlv_tree, hf_snp_pkm_version_support_bit1, tvb, offset, 1, FALSE);
2671 proto_tree_add_item(tlv_tree, hf_snp_pkm_version_support_reserved, tvb, offset, 1, FALSE);
2673 case PKM_ATTR_SECURITY_NEGOTIATION_PARAMETER_SUB_AUTHORIZATION_POLICY_SUPPORT:
2674 /* add TLV subtree */
2675 tlv_tree = add_tlv_subtree(&tlv_info, ett_security_negotiation_parameters, tree, hf_snp_auth_policy_support, tvb, offset, tlv_len, FALSE);
2676 proto_tree_add_item(tlv_tree, hf_snp_auth_policy_support_bit0, tvb, offset, 1, FALSE);
2677 proto_tree_add_item(tlv_tree, hf_snp_auth_policy_support_bit1, tvb, offset, 1, FALSE);
2678 proto_tree_add_item(tlv_tree, hf_snp_auth_policy_support_bit2, tvb, offset, 1, FALSE);
2679 proto_tree_add_item(tlv_tree, hf_snp_auth_policy_support_bit3, tvb, offset, 1, FALSE);
2680 proto_tree_add_item(tlv_tree, hf_snp_auth_policy_support_bit4, tvb, offset, 1, FALSE);
2681 proto_tree_add_item(tlv_tree, hf_snp_auth_policy_support_bit5, tvb, offset, 1, FALSE);
2682 proto_tree_add_item(tlv_tree, hf_snp_auth_policy_support_bit6, tvb, offset, 1, FALSE);
2683 proto_tree_add_item(tlv_tree, hf_snp_auth_policy_support_bit7, tvb, offset, 1, FALSE);
2685 case PKM_ATTR_SECURITY_NEGOTIATION_PARAMETER_SUB_MESSAGE_AUTHENTICATION_CODE:
2686 /* add TLV subtree */
2687 tlv_tree = add_tlv_subtree(&tlv_info, ett_security_negotiation_parameters, tree, hf_snp_mac_mode, tvb, offset, tlv_len, FALSE);
2688 proto_tree_add_item(tlv_tree, hf_snp_mac_mode_bit0, tvb, offset, 1, FALSE);
2689 if (include_cor2_changes)
2691 proto_tree_add_item(tlv_tree, hf_snp_mac_mode_bit1_rsvd, tvb, offset, 1, FALSE);
2695 proto_tree_add_item(tlv_tree, hf_snp_mac_mode_bit1, tvb, offset, 1, FALSE);
2697 proto_tree_add_item(tlv_tree, hf_snp_mac_mode_bit2, tvb, offset, 1, FALSE);
2698 proto_tree_add_item(tlv_tree, hf_snp_mac_mode_bit3, tvb, offset, 1, FALSE);
2699 proto_tree_add_item(tlv_tree, hf_snp_mac_mode_bit4, tvb, offset, 1, FALSE);
2700 if (include_cor2_changes)
2702 proto_tree_add_item(tlv_tree, hf_snp_mac_mode_bit5, tvb, offset, 1, FALSE);
2703 proto_tree_add_item(tlv_tree, hf_snp_mac_mode_reserved1, tvb, offset, 1, FALSE);
2707 proto_tree_add_item(tlv_tree, hf_snp_mac_mode_reserved, tvb, offset, 1, FALSE);
2710 case PKM_ATTR_SECURITY_NEGOTIATION_PARAMETER_SUB_PN_WINDOW_SIZE:
2711 tlv_tree = add_tlv_subtree(&tlv_info, ett_security_negotiation_parameters, tree, hf_snp_pn_window_size, tvb, offset, tlv_len, FALSE);
2712 proto_tree_add_item(tlv_tree, hf_snp_pn_window_size, tvb, offset, tlv_len, FALSE);
2714 case PKM_ATTR_SECURITY_NEGOTIATION_PARAMETER_SUB_PKM_FLOW_CONTROL:
2715 tlv_tree = add_tlv_subtree(&tlv_info, ett_security_negotiation_parameters, tree, hf_snp_max_conc_transactions, tvb, offset, tlv_len, FALSE);
2716 proto_tree_add_item(tlv_tree, hf_snp_max_conc_transactions, tvb, offset, 1, FALSE);
2718 case PKM_ATTR_SECURITY_NEGOTIATION_PARAMETER_SUB_MAX_SUPPT_SECURITY_ASSNS:
2719 tlv_tree = add_tlv_subtree(&tlv_info, ett_security_negotiation_parameters, tree, hf_snp_max_suppt_sec_assns, tvb, offset, tlv_len, FALSE);
2720 proto_tree_add_item(tlv_tree, hf_snp_max_suppt_sec_assns, tvb, offset, 1, FALSE);
2723 tlv_tree = add_tlv_subtree(&tlv_info, ett_security_negotiation_parameters, tree, hf_snp_unknown_type, tvb, offset, tlv_len, FALSE);
2724 proto_tree_add_item(tlv_tree, hf_snp_unknown_type, tvb, offset, tlv_len, FALSE);
2731 /******************************************************************/
2732 /* wimax_cryptographic_suite_list_decoder() */
2733 /* decode and display the WiMax Cryptographic Suite List */
2735 /* tvb - pointer of the tvb of service flow encodings */
2736 /* tree - pointer of Wireshark display tree */
2737 /* pinfo - pointer of Wireshark packet information structure */
2738 /******************************************************************/
2739 void wimax_cryptographic_suite_list_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
2742 guint tvb_len, tlv_len, tlv_value_offset;
2744 proto_tree *tlv_tree = NULL;
2745 tlv_info_t tlv_info;
2747 /* get the tvb reported length */
2748 tvb_len = tvb_reported_length(tvb);
2749 /* do nothing if the TLV fields is not exist */
2752 /* report error if the packet size is less than 2 bytes (type+length) */
2754 { /* invalid tlv info */
2755 if(check_col(pinfo->cinfo, COL_INFO))
2757 col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "Invalid Crypto Suite List");
2761 /* process Cryptographic Suite List (11.9.15) */
2762 for(offset = 0; offset < tvb_len; )
2763 { /* get the TLV information */
2764 init_tlv_info(&tlv_info, tvb, offset);
2765 /* get the TLV type */
2766 tlv_type = get_tlv_type(&tlv_info);
2767 /* get the TLV length */
2768 tlv_len = get_tlv_length(&tlv_info);
2769 if(tlv_type == -1 || tlv_len > MAX_TLV_LEN || tlv_len < 1)
2770 { /* invalid tlv info */
2771 if(check_col(pinfo->cinfo, COL_INFO))
2773 col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "Crypto Suite List TLV error");
2775 proto_tree_add_item(tree, hf_cst_invalid_tlv, tvb, offset, (tvb_len - offset), FALSE);
2778 /* get the TLV value offset */
2779 tlv_value_offset = get_tlv_value_offset(&tlv_info);
2780 #ifdef DEBUG /* for debug only */
2781 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);
2783 /* update the offset for the TLV value */
2784 offset += tlv_value_offset;
2785 /* parse Cryptographic Suite List */
2788 case PKM_ATTR_CRYPTO_SUITE:
2790 tlv_tree = add_tlv_subtree(&tlv_info, ett_cryptographic_suite_list_decoder, tree, hf_pkm_msg_crypto_suite, tvb, offset, tlv_len, FALSE);
2791 proto_tree_add_item(tlv_tree, hf_pkm_msg_crypto_suite_msb, tvb, offset, 1, FALSE);
2792 proto_tree_add_item(tlv_tree, hf_pkm_msg_crypto_suite_middle, tvb, offset+1, 1, FALSE);
2793 proto_tree_add_item(tlv_tree, hf_pkm_msg_crypto_suite_lsb, tvb, offset+2, 1, FALSE);
2796 tlv_tree = add_tlv_subtree(&tlv_info, ett_cryptographic_suite_list_decoder, tree, hf_pkm_msg_unknown_type, tvb, offset, tlv_len, FALSE);
2797 proto_tree_add_item(tlv_tree, hf_pkm_msg_unknown_type, tvb, offset, tlv_len, FALSE);
2801 } /* end of TLV process while loop */
2804 /******************************************************************/
2805 /* wimax_pkm_tlv_encoded_attributes_decoder() */
2806 /* decode and display the WiMax PKM message TLV Encoded Attributes*/
2808 /* tvb - pointer of the tvb of service flow encodings */
2809 /* tree - pointer of Wireshark display tree */
2810 /* pinfo - pointer of Wireshark packet information structure */
2811 /******************************************************************/
2812 void wimax_pkm_tlv_encoded_attributes_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
2815 guint tvb_len, tlv_len, tlv_value_offset;
2817 proto_tree *tlv_tree = NULL;
2818 tlv_info_t tlv_info;
2820 /* get the tvb reported length */
2821 tvb_len = tvb_reported_length(tvb);
2822 /* do nothing if the TLV fields is not exist */
2825 /* report error if the packet size is less than 2 bytes (type+length) */
2827 { /* invalid tlv info */
2828 if(check_col(pinfo->cinfo, COL_INFO))
2830 col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "Invalid PKM TLV");
2834 /* process PKM message TLV Encoded Attributes (11.9) */
2835 for(offset = 0; offset < tvb_len; )
2837 /* get the TLV information */
2838 init_tlv_info(&tlv_info, tvb, offset);
2839 /* get the TLV type */
2840 tlv_type = get_tlv_type(&tlv_info);
2841 /* get the TLV length */
2842 tlv_len = get_tlv_length(&tlv_info);
2843 if(tlv_type == -1 || tlv_len > MAX_TLV_LEN || tlv_len < 1)
2844 { /* invalid tlv info */
2845 if(check_col(pinfo->cinfo, COL_INFO))
2847 col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "PKM TLV error");
2849 proto_tree_add_item(tree, hf_cst_invalid_tlv, tvb, offset, (tvb_len - offset), FALSE);
2852 /* get the TLV value offset */
2853 tlv_value_offset = get_tlv_value_offset(&tlv_info);
2854 #ifdef DEBUG /* for debug only */
2855 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);
2857 /* update the offset for the TLV value */
2858 offset += tlv_value_offset;
2859 /* parse PKM TLV Encoded Attributes (table 370) */
2862 case PKM_ATTR_DISPLAY_STRING:
2863 tlv_tree = add_tlv_subtree(&tlv_info, ett_pkm_tlv_encoded_attributes_decoder, tree, hf_pkm_msg_attr_display, tvb, offset, tlv_len, FALSE);
2864 proto_tree_add_item(tlv_tree, hf_pkm_msg_attr_display, tvb, offset, tlv_len, FALSE);
2866 case PKM_ATTR_AUTH_KEY:
2867 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);
2868 proto_tree_add_item(tlv_tree, hf_pkm_msg_attr_auth_key, tvb, offset, tlv_len, FALSE);
2871 tlv_tree = add_tlv_subtree(&tlv_info, ett_pkm_tlv_encoded_attributes_decoder, tree, hf_pkm_msg_attr_tek, tvb, offset, tlv_len, FALSE);
2872 proto_tree_add_item(tlv_tree, hf_pkm_msg_attr_tek, tvb, offset, tlv_len, FALSE);
2874 case PKM_ATTR_KEY_LIFE_TIME:
2875 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);
2876 proto_tree_add_item(tlv_tree, hf_pkm_msg_attr_key_life_time, tvb, offset, tlv_len, FALSE);
2878 case PKM_ATTR_KEY_SEQ_NUM:
2879 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);
2880 proto_tree_add_item(tlv_tree, hf_pkm_msg_attr_key_seq_num, tvb, offset, tlv_len, FALSE);
2882 case PKM_ATTR_HMAC_DIGEST:
2883 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);
2884 proto_tree_add_item(tlv_tree, hf_pkm_msg_attr_hmac_digest, tvb, offset, tlv_len, FALSE);
2887 tlv_tree = add_tlv_subtree(&tlv_info, ett_pkm_tlv_encoded_attributes_decoder, tree, hf_pkm_msg_attr_said, tvb, offset, tlv_len, FALSE);
2888 proto_tree_add_item(tlv_tree, hf_pkm_msg_attr_said, tvb, offset, tlv_len, FALSE);
2890 case PKM_ATTR_TEK_PARAM:
2891 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);
2893 wimax_tek_parameters_decoder(tvb_new_subset(tvb, offset, tlv_len, tlv_len), pinfo, tlv_tree);
2895 case PKM_ATTR_CBC_IV:
2896 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);
2897 proto_tree_add_item(tlv_tree, hf_pkm_msg_attr_cbc_iv, tvb, offset, tlv_len, FALSE);
2899 case PKM_ATTR_ERROR_CODE:
2900 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);
2901 proto_tree_add_item(tlv_tree, hf_pkm_msg_attr_error_code, tvb, offset, tlv_len, FALSE);
2903 case PKM_ATTR_CA_CERTIFICATE:
2904 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);
2905 proto_tree_add_item(tlv_tree, hf_pkm_msg_attr_ca_certificate, tvb, offset, tlv_len, FALSE);
2907 case PKM_ATTR_SS_CERTIFICATE:
2908 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);
2909 proto_tree_add_item(tlv_tree, hf_pkm_msg_attr_ss_certificate, tvb, offset, tlv_len, FALSE);
2911 case PKM_ATTR_SECURITY_CAPABILITIES:
2912 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);
2914 wimax_security_capabilities_decoder(tvb_new_subset(tvb, offset, tlv_len, tlv_len), pinfo, tlv_tree);
2916 case PKM_ATTR_CRYPTO_SUITE:
2918 tlv_tree = add_tlv_subtree(&tlv_info, ett_pkm_tlv_encoded_attributes_decoder, tree, hf_pkm_msg_crypto_suite, tvb, offset, tlv_len, FALSE);
2919 proto_tree_add_item(tlv_tree, hf_pkm_msg_crypto_suite_msb, tvb, offset, 1, FALSE);
2920 proto_tree_add_item(tlv_tree, hf_pkm_msg_crypto_suite_middle, tvb, offset+1, 1, FALSE);
2921 proto_tree_add_item(tlv_tree, hf_pkm_msg_crypto_suite_lsb, tvb, offset+2, 1, FALSE);
2923 case PKM_ATTR_CRYPTO_LIST:
2924 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);
2926 wimax_cryptographic_suite_list_decoder(tvb_new_subset(tvb, offset, tlv_len, tlv_len), pinfo, tlv_tree);
2928 #if 0 /* rserved by IEE 802.16E */
2929 case PKM_ATTR_VERSION:
2930 proto_tree_add_item(tree, hf_pkm_msg_version, tvb, offset, tlv_len, FALSE);
2933 case PKM_ATTR_SA_DESCRIPTOR:
2934 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);
2936 wimax_sa_descriptor_decoder(tvb_new_subset(tvb, offset, tlv_len, tlv_len), pinfo, tlv_tree);
2938 case PKM_ATTR_SA_TYPE:
2939 tlv_tree = add_tlv_subtree(&tlv_info, ett_pkm_tlv_encoded_attributes_decoder, tree, hf_pkm_sa_type, tvb, offset, tlv_len, FALSE);
2940 proto_tree_add_item(tlv_tree, hf_pkm_sa_type, tvb, offset, tlv_len, FALSE);
2942 case PKM_ATTR_SECURITY_NEGOTIATION_PARAMETERS:
2943 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);
2945 wimax_security_negotiation_parameters_decoder(tvb_new_subset(tvb, offset, tlv_len, tlv_len), pinfo, tlv_tree);
2947 case PKM_ATTR_PKM_CONFIG_SETTINGS:
2949 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);
2950 wimax_pkm_configuration_settings_decoder(tvb_new_subset(tvb, offset, tlv_len, tlv_len), pinfo, tlv_tree);
2952 case PKM_ATTR_PKM_EAP_PAYLOAD:
2953 tlv_tree = add_tlv_subtree(&tlv_info, ett_pkm_tlv_encoded_attributes_decoder, tree, hf_pkm_attr_eap_payload, tvb, offset, tlv_len, FALSE);
2955 call_dissector(eap_handle, tvb_new_subset(tvb, offset, tlv_len, tlv_len), pinfo, tlv_tree);
2957 proto_tree_add_item(tlv_tree, hf_pkm_attr_eap_payload, tvb, offset, tlv_len, FALSE);
2959 case PKM_ATTR_PKM_NONCE:
2960 tlv_tree = add_tlv_subtree(&tlv_info, ett_pkm_tlv_encoded_attributes_decoder, tree, hf_pkm_attr_nonce, tvb, offset, tlv_len, FALSE);
2961 proto_tree_add_item(tlv_tree, hf_pkm_attr_nonce, tvb, offset, tlv_len, FALSE);
2963 case PKM_ATTR_AUTH_RESULT_CODE:
2964 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);
2965 proto_tree_add_item(tlv_tree, hf_pkm_attr_auth_result_code, tvb, offset, tlv_len, FALSE);
2967 case PKM_ATTR_SA_SERVICE_TYPE:
2968 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);
2969 proto_tree_add_item(tlv_tree, hf_pkm_attr_sa_service_type, tvb, offset, tlv_len, FALSE);
2971 case PKM_ATTR_FRAME_NUMBER:
2972 tlv_tree = add_tlv_subtree(&tlv_info, ett_pkm_tlv_encoded_attributes_decoder, tree, hf_pkm_attr_frame_number, tvb, offset, tlv_len, FALSE);
2973 proto_tree_add_item(tlv_tree, hf_pkm_attr_frame_number, tvb, offset, tlv_len, FALSE);
2975 case PKM_ATTR_SS_RANDOM:
2976 tlv_tree = add_tlv_subtree(&tlv_info, ett_pkm_tlv_encoded_attributes_decoder, tree, hf_pkm_attr_ss_random, tvb, offset, tlv_len, FALSE);
2977 proto_tree_add_item(tlv_tree, hf_pkm_attr_ss_random, tvb, offset, tlv_len, FALSE);
2979 case PKM_ATTR_BS_RANDOM:
2980 tlv_tree = add_tlv_subtree(&tlv_info, ett_pkm_tlv_encoded_attributes_decoder, tree, hf_pkm_attr_bs_random, tvb, offset, tlv_len, FALSE);
2981 proto_tree_add_item(tlv_tree, hf_pkm_attr_bs_random, tvb, offset, tlv_len, FALSE);
2983 case PKM_ATTR_PRE_PAK:
2984 tlv_tree = add_tlv_subtree(&tlv_info, ett_pkm_tlv_encoded_attributes_decoder, tree, hf_pkm_attr_pre_pak, tvb, offset, tlv_len, FALSE);
2985 proto_tree_add_item(tlv_tree, hf_pkm_attr_pre_pak, tvb, offset, tlv_len, FALSE);
2987 case PKM_ATTR_BS_CERTIFICATE:
2988 tlv_tree = add_tlv_subtree(&tlv_info, ett_pkm_tlv_encoded_attributes_decoder, tree, hf_pkm_attr_bs_certificate, tvb, offset, tlv_len, FALSE);
2989 proto_tree_add_item(tlv_tree, hf_pkm_attr_bs_certificate, tvb, offset, tlv_len, FALSE);
2991 case PKM_ATTR_SIG_BS:
2992 tlv_tree = add_tlv_subtree(&tlv_info, ett_pkm_tlv_encoded_attributes_decoder, tree, hf_pkm_attr_sig_bs, tvb, offset, tlv_len, FALSE);
2993 proto_tree_add_item(tlv_tree, hf_pkm_attr_sig_bs, tvb, offset, tlv_len, FALSE);
2995 case PKM_ATTR_MS_MAC_ADDRESS:
2996 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);
2997 proto_tree_add_item(tlv_tree, hf_pkm_attr_ms_mac_address, tvb, offset, tlv_len, FALSE);
2999 case PKM_ATTR_CMAC_DIGEST:
3000 /* add TLV subtree */
3001 tlv_tree = add_tlv_subtree(&tlv_info, ett_pkm_tlv_encoded_attributes_decoder, tree, hf_pkm_attr_cmac_digest, tvb, offset, tlv_len, FALSE);
3002 proto_tree_add_item(tlv_tree, hf_pkm_attr_cmac_digest_pn, tvb, offset, 4, FALSE);
3003 proto_tree_add_item(tlv_tree, hf_pkm_attr_cmac_digest_value, tvb, (offset + 4), 8, FALSE);
3005 case PKM_ATTR_KEY_PUSH_MODES:
3006 tlv_tree = add_tlv_subtree(&tlv_info, ett_pkm_tlv_encoded_attributes_decoder, tree, hf_pkm_attr_push_modes, tvb, offset, tlv_len, FALSE);
3007 proto_tree_add_item(tlv_tree, hf_pkm_attr_push_modes, tvb, offset, tlv_len, FALSE);
3009 case PKM_ATTR_KEY_PUSH_COUNTER:
3010 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);
3011 proto_tree_add_item(tlv_tree, hf_pkm_attr_key_push_counter, tvb, offset, tlv_len, FALSE);
3014 tlv_tree = add_tlv_subtree(&tlv_info, ett_pkm_tlv_encoded_attributes_decoder, tree, hf_pkm_attr_gkek, tvb, offset, tlv_len, FALSE);
3015 proto_tree_add_item(tlv_tree, hf_pkm_attr_gkek, tvb, offset, tlv_len, FALSE);
3017 case PKM_ATTR_SIG_SS:
3018 tlv_tree = add_tlv_subtree(&tlv_info, ett_pkm_tlv_encoded_attributes_decoder, tree, hf_pkm_attr_sig_ss, tvb, offset, tlv_len, FALSE);
3019 proto_tree_add_item(tlv_tree, hf_pkm_attr_sig_ss, tvb, offset, tlv_len, FALSE);
3022 tlv_tree = add_tlv_subtree(&tlv_info, ett_pkm_tlv_encoded_attributes_decoder, tree, hf_pkm_attr_akid, tvb, offset, tlv_len, FALSE);
3023 proto_tree_add_item(tlv_tree, hf_pkm_attr_akid, tvb, offset, tlv_len, FALSE);
3026 tlv_tree = add_tlv_subtree(&tlv_info, ett_pkm_tlv_encoded_attributes_decoder, tree, hf_pkm_msg_unknown_type, tvb, offset, tlv_len, FALSE);
3027 proto_tree_add_item(tlv_tree, hf_pkm_msg_unknown_type, tvb, offset, tlv_len, FALSE);
3031 } /* end of TLV process while loop */
3034 /******************************************************************/
3035 /* wimax_tek_parameters_decoder() */
3036 /* decode and display the WiMax TEK Parameters subattributes */
3038 /* tvb - pointer of the tvb of service flow encodings */
3039 /* tree - pointer of Wireshark display tree */
3040 /* pinfo - pointer of Wireshark packet information structure */
3041 /******************************************************************/
3042 void wimax_tek_parameters_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
3045 guint tvb_len, tlv_len, tlv_value_offset;
3047 proto_tree *tlv_tree = NULL;
3048 tlv_info_t tlv_info;
3050 /* get the tvb reported length */
3051 tvb_len = tvb_reported_length(tvb);
3052 /* do nothing if the TLV fields is not exist */
3055 /* report error if the packet size is less than 2 bytes (type+length) */
3057 { /* invalid tlv info */
3058 if(check_col(pinfo->cinfo, COL_INFO))
3060 col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "Invalid TEK Params");
3064 /* process PKM Message TEK Parameters (11.9.8) */
3065 for(offset = 0; offset < tvb_len; )
3067 /* get the TLV information */
3068 init_tlv_info(&tlv_info, tvb, offset);
3069 /* get the TLV type */
3070 tlv_type = get_tlv_type(&tlv_info);
3071 /* get the TLV length */
3072 tlv_len = get_tlv_length(&tlv_info);
3073 if(tlv_type == -1 || tlv_len > MAX_TLV_LEN || tlv_len < 1)
3074 { /* invalid tlv info */
3075 if(check_col(pinfo->cinfo, COL_INFO))
3077 col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "TEK Param TLV error");
3079 proto_tree_add_item(tree, hf_cst_invalid_tlv, tvb, offset, (tvb_len - offset), FALSE);
3082 /* get the TLV value offset */
3083 tlv_value_offset = get_tlv_value_offset(&tlv_info);
3084 #ifdef DEBUG /* for debug only */
3085 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);
3087 /* update the offset for the TLV value */
3088 offset += tlv_value_offset;
3089 /* parse TEK Parameters Subattributes (table 372) */
3093 tlv_tree = add_tlv_subtree(&tlv_info, ett_pkm_tlv_encoded_attributes_decoder, tree, hf_pkm_msg_attr_tek, tvb, offset, tlv_len, FALSE);
3094 proto_tree_add_item(tlv_tree, hf_pkm_msg_attr_tek, tvb, offset, tlv_len, FALSE);
3096 case PKM_ATTR_KEY_LIFE_TIME:
3097 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);
3098 proto_tree_add_item(tlv_tree, hf_pkm_msg_attr_key_life_time, tvb, offset, tlv_len, FALSE);
3100 case PKM_ATTR_KEY_SEQ_NUM:
3101 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);
3102 proto_tree_add_item(tlv_tree, hf_pkm_msg_attr_key_seq_num, tvb, offset, tlv_len, FALSE);
3104 case PKM_ATTR_CBC_IV:
3105 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);
3106 proto_tree_add_item(tlv_tree, hf_pkm_msg_attr_cbc_iv, tvb, offset, tlv_len, FALSE);
3108 case PKM_ATTR_ASSOCIATED_GKEK_SEQ_NUM:
3109 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);
3110 proto_tree_add_item(tlv_tree, hf_pkm_attr_associated_gkek_seq_number, tvb, offset, tlv_len, FALSE);
3113 tlv_tree = add_tlv_subtree(&tlv_info, ett_pkm_tlv_encoded_attributes_decoder, tree, hf_pkm_msg_unknown_type, tvb, offset, tlv_len, FALSE);
3114 proto_tree_add_item(tlv_tree, hf_pkm_msg_unknown_type, tvb, offset, tlv_len, FALSE);
3118 } /* end of TLV process while loop */
3121 /******************************************************************/
3122 /* wimax_pkm_configuration_settings_decoder() */
3123 /* decode and display the WiMax PKM Configuration Settings */
3125 /* tvb - pointer of the tvb of service flow encodings */
3126 /* tree - pointer of Wireshark display tree */
3127 /* pinfo - pointer of Wireshark packet information structure */
3128 /******************************************************************/
3129 void wimax_pkm_configuration_settings_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
3132 guint tvb_len, tlv_len, tlv_value_offset;
3134 proto_tree *tlv_tree;
3135 tlv_info_t tlv_info;
3137 /* get the tvb reported length */
3138 tvb_len = tvb_reported_length(tvb);
3139 /* do nothing if the TLV fields is not exist */
3142 /* report error if the packet size is less than 2 bytes (type+length) */
3144 { /* invalid tlv info */
3145 if(check_col(pinfo->cinfo, COL_INFO))
3147 col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "Invalid PKM Config Settings");
3151 /* process PKM Configuration Settings (11.9.19) */
3152 for(offset = 0; offset < tvb_len; )
3154 /* get the TLV information */
3155 init_tlv_info(&tlv_info, tvb, offset);
3156 /* get the TLV type */
3157 tlv_type = get_tlv_type(&tlv_info);
3158 /* get the TLV length */
3159 tlv_len = get_tlv_length(&tlv_info);
3160 if(tlv_type == -1 || tlv_len > MAX_TLV_LEN || tlv_len < 1)
3161 { /* invalid tlv info */
3162 if(check_col(pinfo->cinfo, COL_INFO))
3164 col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "PKM Config Settings TLV error");
3166 proto_tree_add_item(tree, hf_cst_invalid_tlv, tvb, offset, (tvb_len - offset), FALSE);
3169 /* get the TLV value offset */
3170 tlv_value_offset = get_tlv_value_offset(&tlv_info);
3171 #ifdef DEBUG /* for debug only */
3172 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);
3174 /* update the offset for the TLV value */
3175 offset += tlv_value_offset;
3176 /* parse PKM Configuration Settings (11.9.19.1 - 11.9.19.7 */
3179 case PKM_ATTR_PKM_CONFIG_SETTINGS_AUTHORIZE_WAIT_TIMEOUT:
3180 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);
3181 proto_tree_add_item(tlv_tree, hf_pkm_config_settings_authorize_waitout, tvb, offset, tlv_len, FALSE);
3183 case PKM_ATTR_PKM_CONFIG_SETTINGS_REAUTHORIZE_WAIT_TIMEOUT:
3184 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);
3185 proto_tree_add_item(tlv_tree, hf_pkm_config_settings_reauthorize_waitout, tvb, offset, tlv_len, FALSE);
3187 case PKM_ATTR_PKM_CONFIG_SETTINGS_AUTHORIZATION_GRACE_TIME:
3188 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);
3189 proto_tree_add_item(tlv_tree, hf_pkm_config_settings_grace_time, tvb, offset, tlv_len, FALSE);
3191 case PKM_ATTR_PKM_CONFIG_SETTINGS_OPERATIONAL_WAIT_TIMEOUT:
3192 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);
3193 proto_tree_add_item(tlv_tree, hf_pkm_config_settings_operational_waittime, tvb, offset, tlv_len, FALSE);
3195 case PKM_ATTR_PKM_CONFIG_SETTINGS_REKEY_WAIT_TIMEOUT:
3196 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);
3197 proto_tree_add_item(tlv_tree, hf_pkm_config_settings_rekey_wait_timeout, tvb, offset, tlv_len, FALSE);
3199 case PKM_ATTR_PKM_CONFIG_SETTINGS_TEK_GRACE_TIME:
3200 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);
3201 proto_tree_add_item(tlv_tree, hf_pkm_config_settings_tek_grace_time, tvb, offset, tlv_len, FALSE);
3203 case PKM_ATTR_PKM_CONFIG_SETTINGS_AUTHORIZE_REJECT_WAIT_TIMEOUT:
3204 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);
3205 proto_tree_add_item(tlv_tree, hf_pkm_config_settings_authorize_reject_wait_timeout, tvb, offset, tlv_len, FALSE);
3208 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);
3209 proto_tree_add_item(tlv_tree, hf_pkm_msg_unknown_type, tvb, offset, tlv_len, FALSE);
3213 } /* end of TLV process while loop */
3216 /******************************************************************/
3217 /* wimax_sa_descriptor_decoder() */
3218 /* decode and display the WiMax PKM message SA-Descriptor */
3220 /* tvb - pointer of the tvb of service flow encodings */
3221 /* tree - pointer of Wireshark display tree */
3222 /* pinfo - pointer of Wireshark packet information structure */
3223 /******************************************************************/
3224 void wimax_sa_descriptor_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
3227 guint tvb_len, tlv_len, tlv_value_offset;
3229 proto_tree *tlv_tree = NULL;
3230 tlv_info_t tlv_info;
3232 /* get the tvb reported length */
3233 tvb_len = tvb_reported_length(tvb);
3234 /* do nothing if the TLV fields is not exist */
3237 /* report error if the packet size is less than 2 bytes (type+length) */
3239 { /* invalid tlv info */
3240 if(check_col(pinfo->cinfo, COL_INFO))
3242 col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "Invalid SA-Descriptor");
3246 /* process SA-Descriptor (11.9.17) */
3247 for(offset = 0; offset < tvb_len; )
3249 /* get the TLV information */
3250 init_tlv_info(&tlv_info, tvb, offset);
3251 /* get the TLV type */
3252 tlv_type = get_tlv_type(&tlv_info);
3253 /* get the TLV length */
3254 tlv_len = get_tlv_length(&tlv_info);
3255 if(tlv_type == -1 || tlv_len > MAX_TLV_LEN || tlv_len < 1)
3256 { /* invalid tlv info */
3257 if(check_col(pinfo->cinfo, COL_INFO))
3259 col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "SA-Descriptor TLV error");
3261 proto_tree_add_item(tree, hf_cst_invalid_tlv, tvb, offset, (tvb_len - offset), FALSE);
3264 /* get the TLV value offset */
3265 tlv_value_offset = get_tlv_value_offset(&tlv_info);
3266 #ifdef DEBUG /* for debug only */
3267 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);
3269 /* update the offset for the TLV value */
3270 offset += tlv_value_offset;
3271 /* parse SA-Descriptor (table 380) */
3275 tlv_tree = add_tlv_subtree(&tlv_info, ett_sa_descriptor_decoder, tree, hf_pkm_msg_attr_said, tvb, offset, tlv_len, FALSE);
3276 proto_tree_add_item(tlv_tree, hf_pkm_msg_attr_said, tvb, offset, tlv_len, FALSE);
3278 case PKM_ATTR_SA_TYPE:
3279 tlv_tree = add_tlv_subtree(&tlv_info, ett_sa_descriptor_decoder, tree, hf_pkm_sa_type, tvb, offset, tlv_len, FALSE);
3280 proto_tree_add_item(tlv_tree, hf_pkm_sa_type, tvb, offset, tlv_len, FALSE);
3282 case PKM_ATTR_SA_SERVICE_TYPE:
3283 tlv_tree = add_tlv_subtree(&tlv_info, ett_sa_descriptor_decoder, tree, hf_pkm_attr_sa_service_type, tvb, offset, tlv_len, FALSE);
3284 proto_tree_add_item(tlv_tree, hf_pkm_attr_sa_service_type, tvb, offset, tlv_len, FALSE);
3286 case PKM_ATTR_CRYPTO_SUITE:
3288 tlv_tree = add_tlv_subtree(&tlv_info, ett_sa_descriptor_decoder, tree, hf_pkm_msg_crypto_suite, tvb, offset, tlv_len, FALSE);
3289 proto_tree_add_item(tlv_tree, hf_pkm_msg_crypto_suite_msb, tvb, offset, 1, FALSE);
3290 proto_tree_add_item(tlv_tree, hf_pkm_msg_crypto_suite_middle, tvb, offset+1, 1, FALSE);
3291 proto_tree_add_item(tlv_tree, hf_pkm_msg_crypto_suite_lsb, tvb, offset+2, 1, FALSE);
3294 tlv_tree = add_tlv_subtree(&tlv_info, ett_sa_descriptor_decoder, tree, hf_pkm_msg_unknown_type, tvb, offset, tlv_len, FALSE);
3295 proto_tree_add_item(tlv_tree, hf_pkm_msg_unknown_type, tvb, offset, tlv_len, FALSE);
3299 } /* end of TLV process while loop */
3302 /******************************************************************/
3303 /* wimax_security_capabilities_decoder() */
3304 /* decode and display the WiMax Security Capabilities */
3306 /* tvb - pointer of the tvb of service flow encodings */
3307 /* tree - pointer of Wireshark display tree */
3308 /* pinfo - pointer of Wireshark packet information structure */
3309 /******************************************************************/
3310 void wimax_security_capabilities_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
3313 guint tvb_len, tlv_len, tlv_value_offset;
3315 proto_tree *tlv_tree = NULL;
3316 tlv_info_t tlv_info;
3318 /* get the tvb reported length */
3319 tvb_len = tvb_reported_length(tvb);
3320 /* do nothing if the TLV fields is not exist */
3323 /* report error if the packet size is less than 2 bytes (type+length) */
3325 { /* invalid tlv info */
3326 if(check_col(pinfo->cinfo, COL_INFO))
3328 col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "Invalid Security Capabilities");
3332 /* process Security Capabilities (11.9.13) */
3333 for(offset = 0; offset < tvb_len; )
3335 /* get the TLV information */
3336 init_tlv_info(&tlv_info, tvb, offset);
3337 /* get the TLV type */
3338 tlv_type = get_tlv_type(&tlv_info);
3339 /* get the TLV length */
3340 tlv_len = get_tlv_length(&tlv_info);
3341 if(tlv_type == -1 || tlv_len > MAX_TLV_LEN || tlv_len < 1)
3342 { /* invalid tlv info */
3343 if(check_col(pinfo->cinfo, COL_INFO))
3345 col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "Security Capabilities TLV error");
3347 proto_tree_add_item(tree, hf_cst_invalid_tlv, tvb, offset, (tvb_len - offset), FALSE);
3350 /* get the TLV value offset */
3351 tlv_value_offset = get_tlv_value_offset(&tlv_info);
3352 #ifdef DEBUG /* for debug only */
3353 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);
3355 /* update the offset for the TLV value */
3356 offset += tlv_value_offset;
3357 /* parse Security Capabilities (table 374) */
3360 case PKM_ATTR_CRYPTO_LIST:
3361 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);
3363 wimax_cryptographic_suite_list_decoder(tvb_new_subset(tvb, offset, tlv_len, tlv_len), pinfo, tlv_tree);
3366 tlv_tree = add_tlv_subtree(&tlv_info, ett_security_capabilities_decoder, tree, proto_wimax_utility_decoders, tvb, offset, tlv_len, FALSE);
3367 proto_tree_add_item(tlv_tree, hf_pkm_msg_unknown_type, tvb, offset, tlv_len, FALSE);
3371 } /* end of TLV process while loop */
3374 /******************************************************************/
3375 /* wimax_vendor_specific_information_decoder() */
3376 /* decode and display the WiMax Vendor-Specific Information */
3378 /* tvb - pointer of the tvb of service flow encodings */
3379 /* tree - pointer of Wireshark display tree */
3380 /* pinfo - pointer of Wireshark packet information structure */
3381 /******************************************************************/
3382 void wimax_vendor_specific_information_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
3384 proto_tree *tlv_tree = NULL;
3386 guint tvb_len, tlv_len, tlv_value_offset;
3388 tlv_info_t tlv_info;
3390 /* get the tvb reported length */
3391 tvb_len = tvb_reported_length(tvb);
3392 /* do nothing if the TLV fields is not exist */
3395 /* report error if the packet size is less than 2 bytes (type+length) */
3397 { /* invalid tlv info */
3398 if(check_col(pinfo->cinfo, COL_INFO))
3400 col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "Invalid Vendor Specific Info");
3402 proto_tree_add_text(tree, tvb, 0, tvb_len, "Invalid TLV info");
3405 /* process Vendor Specific Information (11.1.6) */
3406 for(offset = 0; offset < tvb_len; )
3408 /* get the TLV information */
3409 init_tlv_info(&tlv_info, tvb, offset);
3410 /* get the TLV type */
3411 tlv_type = get_tlv_type(&tlv_info);
3412 /* get the TLV length */
3413 tlv_len = get_tlv_length(&tlv_info);
3414 if(tlv_type == -1 || tlv_len > MAX_TLV_LEN || tlv_len < 1)
3415 { /* invalid tlv info */
3416 if(check_col(pinfo->cinfo, COL_INFO))
3418 col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "Vendor Specific Info TLV error");
3420 proto_tree_add_item(tree, hf_cst_invalid_tlv, tvb, offset, (tvb_len - offset), FALSE);
3423 /* get the TLV value offset */
3424 tlv_value_offset = get_tlv_value_offset(&tlv_info);
3425 #ifdef DEBUG /* for debug only */
3426 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);
3428 /* parse Vendor Specific Information (11.1.6) */
3429 if(tlv_type == VENDOR_ID_ENCODING)
3431 /* decode and display the Vendor ID Encoding */
3432 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);
3433 proto_tree_add_item(tlv_tree, hf_common_tlv_vendor_id, tvb, (offset + tlv_value_offset), tlv_len, FALSE);
3437 /* decode and display the Vendor Specific Info */
3438 proto_tree_add_item(tree, hf_common_tlv_vendor_specific_type, tvb, offset, 1, FALSE);
3439 if(get_tlv_length_type(&tlv_info) == 0)
3440 { /* single byte TLV length */
3441 proto_tree_add_item(tree, hf_common_tlv_vendor_specific_length, tvb, (offset + 1), 1, FALSE);
3444 { /* multiple bytes TLV length */
3445 /* display the length of the TLV length with MSB */
3446 proto_tree_add_item(tree, hf_common_tlv_vendor_specific_length_size, tvb, (offset + 1), 1, FALSE);
3447 if(get_tlv_size_of_length(&tlv_info))
3448 { /* display the multiple byte TLV length */
3449 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));
3456 proto_tree_add_item(tree, hf_common_tlv_vendor_specific_value, tvb, (offset + tlv_value_offset), tlv_len, FALSE);
3458 /* update the offset */
3459 offset += tlv_value_offset + tlv_len;
3463 /******************************************************************/
3464 /* wimax_common_tlv_encoding_decoder() */
3465 /* decode and display the WiMax Common TLV Encoding (Table 346) */
3467 /* tvb - pointer of the tvb of service flow encodings */
3468 /* tree - pointer of Wireshark display tree */
3469 /* pinfo - pointer of Wireshark packet information structure */
3470 /******************************************************************/
3471 guint wimax_common_tlv_encoding_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
3473 guint offset, value;
3474 guint tvb_len, tlv_len, tlv_value_offset;
3476 proto_tree *tlv_tree = NULL;
3477 tlv_info_t tlv_info;
3478 gfloat current_power;
3480 /* get the tvb reported length */
3481 tvb_len = tvb_reported_length(tvb);
3482 /* do nothing if the TLV fields is not exist */
3485 /* report error if the packet size is less than 2 bytes (type+length) */
3487 { /* invalid tlv info */
3488 if(check_col(pinfo->cinfo, COL_INFO))
3490 col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "Invalid Common TLV encoding");
3492 proto_tree_add_item(tree, hf_cst_invalid_tlv, tvb, 0, tvb_len, FALSE);
3495 /* process Common TLV Encoding (11.1) */
3496 for(offset = 0; offset < tvb_len; )
3498 /* get the TLV information */
3499 init_tlv_info(&tlv_info, tvb, offset);
3500 /* get the TLV type */
3501 tlv_type = get_tlv_type(&tlv_info);
3502 /* get the TLV length */
3503 tlv_len = get_tlv_length(&tlv_info);
3504 if(tlv_type == -1 || tlv_len > MAX_TLV_LEN || tlv_len < 1)
3505 { /* invalid tlv info */
3506 if(check_col(pinfo->cinfo, COL_INFO))
3508 col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "Common TLV encoding TLV error");
3510 proto_tree_add_item(tree, hf_cst_invalid_tlv, tvb, offset, (tvb_len - offset), FALSE);
3513 /* get the TLV value offset */
3514 tlv_value_offset = get_tlv_value_offset(&tlv_info);
3515 #ifdef DEBUG /* for debug only */
3516 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);
3518 /* update the offset for the TLV value */
3519 offset += tlv_value_offset;
3520 /* parse Common TLV Encoding (table 346) */
3523 case VENDOR_SPECIFIC_INFO:
3524 /* display Vendor-Specific Information */
3526 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);
3527 /* decode and display the Vendor-Specific Information */
3528 wimax_vendor_specific_information_decoder(tvb_new_subset(tvb, offset, tlv_len, tlv_len), pinfo, tlv_tree);
3530 case VENDOR_ID_ENCODING:
3531 /* display Vendor ID Encoding */
3533 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);
3534 /* decode and display the Vendor ID Encoding */
3535 proto_tree_add_item(tlv_tree, hf_common_tlv_vendor_id, tvb, offset, tlv_len, FALSE);
3537 case DSx_UPLINK_FLOW:
3538 /* display Uplink Service Flow Encodings info */
3540 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);
3541 /* decode and display the UL Service Flow Encodings */
3542 wimax_service_flow_encodings_decoder(tvb_new_subset(tvb, offset, tlv_len, tlv_len), pinfo, tlv_tree);
3544 case DSx_DOWNLINK_FLOW:
3545 /* display Downlink Service Flow Encodings info */
3547 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);
3548 /* decode and display the DL Service Flow Encodings */
3549 wimax_service_flow_encodings_decoder(tvb_new_subset(tvb,offset, tlv_len, tlv_len), pinfo, tlv_tree);
3551 case CURRENT_TX_POWER:
3552 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);
3553 value = tvb_get_guint8(tvb, offset);
3554 current_power = (gfloat)(value - 128) / 2;
3555 proto_tree_add_text(tlv_tree, tvb, offset, 1, "Current Transmitted Power: %.2f dBm (Value: 0x%x)", (gdouble)current_power, value);
3557 case MAC_VERSION_ENCODING:
3558 /* display MAC Version Encoding */
3560 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);
3561 /* decode and display the MAC Version Encoding */
3562 proto_tree_add_item(tlv_tree, hf_common_tlv_mac_version, tvb, offset, tlv_len, FALSE);
3564 case HMAC_TUPLE: /* Table 348d */
3565 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);
3566 /* decode and display the HMAC Tuple */
3567 wimax_hmac_tuple_decoder(tlv_tree, tvb, offset, tlv_len);
3569 case CMAC_TUPLE: /* Table 348b */
3570 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);
3571 /* decode and display the CMAC Tuple */
3572 wimax_cmac_tuple_decoder(tlv_tree, tvb, offset, tlv_len);
3575 /* Back to calling routine to finish decoding. */
3576 return offset - tlv_value_offset; /* Ret amount decoded. */
3580 } /* end of while loop */