2 * Definitions for MIH (Media independent Handover) packet disassembly structures and routines
3 * Refer to (IEEE 802.21) IEEE Standard for Local and metropolitan area networks- Part 21: Media Independent Handover Services, 21 Jan 2009
5 * Copyright 2011, ANKITH AGARWAL <ankitha@cdac.in>
7 * The original patch submitted in 2011 was improved and expanded in 2012 by Fraunhofer Institute for Open Communication Systems (FOKUS)
8 * The improvements include filtering of all fields as well as including definitions from the revised IEEE 802.21b document from 10 May 2012
10 * Copyright 2012, Alton MacDonald <alton.kenneth.macdonald@fokus.fraunhofer.de>
12 * Wireshark - Network traffic analyzer
13 * By Gerald Combs <gerald@wireshark.org>
14 * Copyright 1998 Gerald Combs
16 * SPDX-License-Identifier: GPL-2.0-or-later
23 #include <epan/packet.h>
24 #include <epan/exceptions.h>
25 #include <epan/etypes.h>
26 void proto_register_mih(void);
27 void proto_reg_handoff_mih(void);
29 static dissector_handle_t mih_handle
;
33 #define VERSION_MASK 0xF0
34 #define ACKREQ_MASK 0x8
35 #define ACKRESP_MASK 0x4
37 #define MORE_FRAG_MASK 0x1
38 #define FRAG_NO_MASK 0xFE
39 #define SID_MASK 0xF000
40 #define OPCODE_MASK 0x0C00
41 #define AID_MASK 0x03FF
42 #define TRANS_ID_MASK 0x0FFF
43 #define LEN_OF_LEN_MASK 0x80
45 /*Type values for TLV encoding*/
47 #define DEST_MIHF_ID 2
50 #define MIH_EVT_LIST 5
51 #define MIH_CMD_LIST 6
52 #define MIH_IQ_TYPE_LIST 7
53 #define MIH_TRANS_LIST 8
54 #define LINK_ADDR_LIST 9
55 #define MBB_HO_SUPP_LIST 10
56 #define REG_REQUEST_CODE 11
57 #define VALID_TIME_INTR 12
59 #define NEW_LINK_ID 14
60 #define OLD_ACCESS_ROUTER 15
61 #define NEW_ACCESS_ROUTER 16
62 #define IP_RENEWAL_FLAG 17
63 #define IP_MOB_MGMT 18
64 #define IP_CFG_MTHDS 19
65 #define LINK_DN_REASON 20
66 #define TIMER_INTERVAL 21
67 #define LINK_GOING_DN_REASON 22
68 #define LINK_PARAM_RPT_LIST 23
69 #define DEV_STATES_REQ 24
70 #define LINK_ID_LIST 25
71 #define DEV_STATES_RSP_LIST 26
72 #define STATUS_REQ_SET 27
73 #define STATUS_RSP_LIST 28
74 #define CFG_REQ_LIST 29
75 #define CFG_RSP_LIST 30
76 #define LINK_POA_LIST 31
77 #define PREF_LINK_LIST 32
78 #define HO_REQ_QUERY_LIST 33
80 #define ACCESS_ROUTER_ADDR 35
81 #define DHCP_SER_ADDR 36
83 #define LINK_ACTION_REQ_LIST 38
84 #define LINK_ACTION_RSP_LIST 39
86 #define LINK_RES_STATUS 41
87 #define RES_RETENTION_STATUS 42
88 #define IQ_BIN_DATA_LIST 43
89 #define IQ_RDF_DATA_LIST 44
90 #define IQ_RDF_SCHEMA_URL 45
91 #define IQ_RDF_SCHM_LIST 46
92 #define MAX_RSP_SIZE 47
93 #define IR_BIN_DATA_LIST 48
94 #define IR_RDF_DATA_LIST 49
95 #define IR_SCHM_URL_LIST 50
96 #define IR_RDF_SCHM_LIST 51
98 #define Q_RES_RPT_FLAG 53
99 #define EVT_CFG_INFO_LIST 54
100 #define TGT_NET_INFO 55
101 #define TGT_NET_INFO_LIST 56
102 #define ASGN_RES_SET 57
103 #define LINK_DET_INFO_LIST 58
104 #define MN_LINK_ID 59
105 #define POA_LINK_ADDR 60
106 #define UNAUTH_INFO_REQ 61
108 #define REQ_RES_SET 63
109 #define VEND_SPECIFIC_TLV 100
111 /*Bitmasks in 802.21 are encoded in Network-Byte-Order: bit0 is leftmost bit*/
113 /*MASK for event list*/
114 #define LINK_DETECT_MASK 0x80000000
115 #define LINK_UP_MASK 0x40000000
116 #define LINK_DOWN_MASK 0x20000000
117 #define LINK_PARAM_MASK 0x10000000
118 #define LINK_GD_MASK 0x08000000
119 #define LINK_HO_IMM_MASK 0x04000000
120 #define LINK_HO_COMP_MASK 0x02000000
121 #define LINK_PDU_MASK 0x01000000
123 /*MASK for command list*/
124 /*1st bit is reserved*/
125 #define CMD_EVT_SUBS_MASK 0x40000000
126 #define CMD_EVT_UNSUBS_MASK 0x20000000
127 #define CMD_GET_PARA_MASK 0x10000000
128 #define CMD_CONF_TH_MASK 0x08000000
129 #define CMD_LINK_AC_MASK 0x04000000
131 /*MASK for Info Query list*/
132 #define IQ_BIN_DATA_MASK 0x80000000
133 #define IQ_RDF_DATA_MASK 0x40000000
134 #define IQ_RDF_SCH_U_MASK 0x20000000
135 #define IQ_RDF_SCH_MASK 0x10000000
136 #define IQ_IE_NET_TYPE_MASK 0x08000000
137 #define IQ_IE_OP_ID_MASK 0x04000000
138 #define IQ_SERV_ID_MASK 0x02000000
139 #define IQ_IE_COUN_MASK 0x01000000
140 #define IQ_NET_ID_MASK 0x00800000
141 #define IQ_NET_AUX_MASK 0x00400000
142 #define IQ_IE_ROAM_MASK 0x00200000
143 #define IQ_IE_COST_MASK 0x00100000
144 #define IQ_IE_QOS_MASK 0x00080000
145 #define IQ_IE_DATA_MASK 0x00040000
146 #define IQ_IE_REGDOM_MASK 0x00020000
147 #define IQ_IE_FREQ_MASK 0x00010000
148 #define IQ_IE_IP_CFG_MASK 0x00008000
149 #define IQ_IE_CAP_MASK 0x00004000
150 #define IQ_IE_SUP_MASK 0x00002000
151 #define IQ_IE_MOB_MG_MASK 0x00001000
152 #define IQ_IE_EM_SERV_MASK 0x00000800
153 #define IQ_IE_IMS_MASK 0x00000400
154 #define IQ_IE_MOB_NET_MASK 0x00000200
155 #define IQ_IE_POA_ADDR_MASK 0x00000100
156 #define IQ_IE_POA_LOC_MASK 0x00000080
157 #define IQ_IE_POA_CHAN_MASK 0x00000040
158 #define IQ_IE_POA_SYS_MASK 0x00000020
159 #define IQ_IE_POA_SUB_MASK 0x00000010
160 #define IQ_IE_POA_IP_MASK 0x00000008
162 /*MASK for mobility Management methods*/
163 #define MOB_MIP4_MASK 0x8000
164 #define MOB_MIP4_REG_MASK 0x4000
165 #define MOB_MIP6_MASK 0x2000
166 #define MOB_HMIP6_MASK 0x1000
167 #define MOB_LOW_LAT_MASK 0x0800
168 #define MOB_FMIP6_MASK 0x0400
169 #define MOB_IKE_MULTI_MASK 0x0200
171 /*MASK for ip configuration methods*/
172 #define IP_CFG_STAT_MASK 0x80000000
173 #define IP_CFG_DHCP4_MASK 0x40000000
174 #define IP_CFG_MIP4_FA_MASK 0x20000000
175 #define IP_CFG_MIP4_NFA_MASK 0x10000000
176 /*bits 4-10 reserved for IPv4 address configuration*/
177 #define IP_CFG_IP6_SL_MASK 0x00100000
178 #define IP_CFG_DHCP6_MASK 0x00080000
179 #define IP_CFG_IP6_MAN_MASK 0x00040000
181 /*information holder integers...*/
182 static int proto_mih
;
183 static int hf_mih_version
;
184 static int hf_mih_ack_req
;
185 static int hf_mih_ack_resp
;
186 static int hf_mih_uir
;
187 static int hf_mih_more_frag
;
188 static int hf_mih_frag_no
;
189 static int hf_mih_mid
;
190 static int hf_mih_service_id
;
191 static int hf_mih_opcode
;
192 static int hf_mih_serv_actionid
;
193 static int hf_mih_event_actionid
;
194 static int hf_mih_command_actionid
;
195 static int hf_mih_info_actionid
;
196 static int hf_mih_tid
;
197 static int hf_mih_pay_len
;
198 static int hf_mih_type
;
199 static int hf_mih_type_length
;
200 static int hf_mih_type_length_ext
;
201 static int hf_mihf_id
;
202 static int hf_mihf_id_mac
;
203 static int hf_mihf_id_ipv4
;
204 static int hf_mihf_id_ipv6
;
205 static int hf_status
;
206 static int hf_ip_methods_supported
;
207 static int hf_ip_dhcp_services
;
208 static int hf_fn_agent
;
209 static int hf_access_router
;
210 static int hf_link_type
;
211 static int hf_link_type_ext
;
212 static int hf_ipv4_addr
;
213 static int hf_ipv6_addr
;
214 static int hf_link_dn_reason
;
215 static int hf_link_gdn_reason
;
216 static int hf_mac_addr
;
217 static int hf_link_param_gen
;
218 static int hf_link_param_qos
;
219 static int hf_link_param_gg
;
220 static int hf_link_param_802_11
;
221 static int hf_link_param_fdd
;
222 static int hf_link_param_edge
;
223 static int hf_link_param_eth
;
224 static int hf_link_param_c2k
;
225 static int hf_link_param_hrpd
;
226 static int hf_link_param_802_16
;
227 static int hf_link_param_802_20
;
228 static int hf_link_param_802_22
;
229 static int hf_link_param_value
;
230 static int hf_op_mode
;
231 static int hf_link_ac_type
;
232 static int hf_link_ac_ext_time
;
233 static int hf_link_ac_result
;
234 static int hf_ho_reason
;
235 static int hf_ho_status
;
236 static int hf_reg_request_code
;
237 static int hf_ip_renewal
;
238 static int hf_max_resp_size
;
239 static int hf_time_interval
;
240 static int hf_valid_time_interval
;
241 static int hf_tsp_carrier
;
242 static int hf_mbb_ho_supp
;
243 static int hf_link_addr_type
;
244 static int hf_link_transport_addr_type
;
245 static int hf_link_addr_string
;
246 static int hf_link_data_rate
;
247 static int hf_plmn_id
;
248 static int hf_location_area_id
;
249 static int hf_cell_id
;
251 static int hf_threshold_val
;
252 static int hf_threshold_x_dir
;
253 static int hf_threshold_action
;
254 static int hf_config_status
;
255 static int hf_num_cos
;
256 static int hf_num_queue
;
257 static int hf_channel_id
;
258 static int hf_predef_cfg_id
;
259 static int hf_network_id
;
260 static int hf_net_aux_id
;
261 static int hf_sig_strength_dbm
;
262 static int hf_sig_strength_per
;
263 static int hf_cos_id
;
264 static int hf_cos_value
;
266 static int hf_rdf_data
;
267 static int hf_rdf_mime_type
;
268 static int hf_link_res_status
;
269 static int hf_res_retention_status
;
270 static int hf_res_rpt_flag
;
271 static int hf_unauth_info_req
;
272 static int hf_rdf_sch
;
273 static int hf_rdf_sch_url
;
274 static int hf_ir_bin_data
;
275 static int hf_iq_bin_data_x
;
276 static int hf_vendor_specific_tlv
;
277 static int hf_reserved_tlv
;
278 static int hf_experimental_tlv
;
279 static int hf_unknown_tlv
;
280 static int hf_fragmented_tlv
;
282 /*header fields for event list */
283 static int hf_event_list
;
284 static int hf_event_link_detect
;
285 static int hf_event_link_up
;
286 static int hf_event_link_dn
;
287 static int hf_event_link_param
;
288 static int hf_event_link_gd
;
289 static int hf_event_ho_imm
;
290 static int hf_event_ho_comp
;
291 static int hf_event_pdu_tx_stat
;
293 /*header fields for command list*/
294 static int hf_cmd_list
;
295 static int hf_cmd_event_subs
;
296 static int hf_cmd_event_unsub
;
297 static int hf_cmd_get_param
;
298 static int hf_cmd_con_thres
;
299 static int hf_cmd_link_action
;
301 /*header fields for iq type list*/
302 static int hf_iq_list
;
303 static int hf_iq_bin_data
;
304 static int hf_iq_rdf_data
;
305 static int hf_iq_rdf_sch_url
;
306 static int hf_iq_rdf_sch
;
307 static int hf_iq_net_type
;
308 static int hf_iq_op_id
;
309 static int hf_iq_serv_pro_id
;
310 static int hf_iq_country_code
;
311 static int hf_iq_net_id
;
312 static int hf_iq_net_aux_id
;
313 static int hf_iq_roam_part
;
314 static int hf_iq_cost
;
315 static int hf_iq_net_qos
;
316 static int hf_iq_net_dat_rt
;
317 static int hf_iq_net_reg_dom
;
318 static int hf_iq_freq_bands
;
319 static int hf_iq_ip_cfg_mthds
;
320 static int hf_iq_net_cap
;
321 static int hf_iq_supp_lcp
;
322 static int hf_iq_net_mob_mg
;
323 static int hf_iq_net_emserv
;
324 static int hf_iq_net_ims_pcscf
;
325 static int hf_iq_net_mob_net
;
326 static int hf_iq_link_addr
;
327 static int hf_iq_poa_loc
;
328 static int hf_iq_poa_chan_range
;
329 static int hf_iq_poa_sys_info
;
330 static int hf_iq_poa_sub_info
;
331 static int hf_iq_poa_ip
;
333 /*header fields for mob mgmt*/
334 static int hf_mob_list
;
335 static int hf_mob_mip4
;
336 static int hf_mob_mip4_reg
;
337 static int hf_mob_mip6
;
338 static int hf_mob_hmip6
;
339 static int hf_mob_low_lat
;
340 static int hf_mob_fmip6
;
341 static int hf_mob_ike_multi
;
343 /*header fields for configure methods*/
344 static int hf_cfg_mthds
;
345 static int hf_cfg_ip4_stat
;
346 static int hf_cfg_dhcp4
;
347 static int hf_cfg_mip_fa
;
348 static int hf_cfg_mip_wo_fa
;
349 static int hf_cfg_ip6_sac
;
350 static int hf_cfg_dhcp6
;
351 static int hf_cfg_ip6_manual
;
353 /*header fields for transport list*/
354 static int hf_trans_list
;
355 static int hf_trans_udp
;
356 static int hf_trans_tcp
;
358 /*header fields for device state requests and responses*/
359 static int hf_dev_states_req
;
360 static int hf_dev_states_req_dev_info
;
361 static int hf_dev_states_req_batt_lvl
;
362 static int hf_dev_states_resp
;
363 static int hf_dev_batt_level
;
364 static int hf_dev_info
;
366 /*header fields for Link Action Attributes*/
367 static int hf_link_ac_attr
;
368 static int hf_link_ac_attr_link_scan
;
369 static int hf_link_ac_attr_link_res_retain
;
370 static int hf_link_ac_attr_data_fwd_req
;
372 /*header fields for transport subtypes*/
373 static int hf_link_subtype_eth
;
374 static int hf_link_subtype_eth_10m
;
375 static int hf_link_subtype_eth_100m
;
376 static int hf_link_subtype_eth_1000m
;
377 static int hf_link_subtype_wireless_other
;
378 static int hf_link_subtype_wireless_other_dvb
;
379 static int hf_link_subtype_wireless_other_tdmb
;
380 static int hf_link_subtype_wireless_other_atsc
;
381 static int hf_link_subtype_ieee80211
;
382 static int hf_link_subtype_ieee80211_24
;
383 static int hf_link_subtype_ieee80211_5
;
384 static int hf_link_subtype_ieee80211_49
;
385 static int hf_link_subtype_ieee80211_365
;
386 static int hf_link_subtype_ieee80211_316
;
387 static int hf_link_subtype_umts
;
388 static int hf_link_subtype_umts_99
;
389 static int hf_link_subtype_umts_4
;
390 static int hf_link_subtype_umts_5
;
391 static int hf_link_subtype_umts_6
;
392 static int hf_link_subtype_umts_7
;
393 static int hf_link_subtype_umts_8
;
394 static int hf_link_subtype_cdma2000
;
395 static int hf_link_subtype_cdma2000_0
;
396 static int hf_link_subtype_cdma2000_a
;
397 static int hf_link_subtype_cdma2000_b
;
398 static int hf_link_subtype_cdma2000_c
;
399 static int hf_link_subtype_ieee80216
;
400 static int hf_link_subtype_ieee80216_25
;
401 static int hf_link_subtype_ieee80216_35
;
403 /*header fields for MIH Capabilities*/
404 static int hf_mihcap
;
405 static int hf_mihcap_es
;
406 static int hf_mihcap_cs
;
407 static int hf_mihcap_is
;
409 /*header fields for High Level Network Capabilities*/
410 static int hf_net_caps
;
411 static int hf_net_caps_sec
;
412 static int hf_net_caps_qos0
;
413 static int hf_net_caps_qos1
;
414 static int hf_net_caps_qos2
;
415 static int hf_net_caps_qos3
;
416 static int hf_net_caps_qos4
;
417 static int hf_net_caps_qos5
;
418 static int hf_net_caps_ia
;
419 static int hf_net_caps_es
;
420 static int hf_net_caps_mihcap
;
422 /*trees and subtrees...*/
424 static int ett_ver_flags
;
427 static int ett_cmd_bitmap
;
428 static int ett_event_bitmap
;
429 static int ett_mob_mgt_bitmap
;
430 static int ett_cfg_mtd_bitmap
;
431 static int ett_iq_type_bitmap
;
432 static int ett_trans_list_bitmap
;
433 static int ett_dev_states_bitmap
;
434 static int ett_mihcap_bitmap
;
435 static int ett_net_caps_bitmap
;
436 static int ett_ac_attr_bitmap
;
437 static int ett_subtype_eth_bitmap
;
438 static int ett_subtype_wireless_other_bitmap
;
439 static int ett_subtype_ieee80211_bitmap
;
440 static int ett_subtype_umts_bitmap
;
441 static int ett_subtype_cdma2000_bitmap
;
442 static int ett_subtype_ieee80216_bitmap
;
443 static int ett_min_pk_tx_delay
;
444 static int ett_avg_pk_tx_delay
;
445 static int ett_max_pk_tx_delay
;
446 static int ett_pk_delay_jitter
;
447 static int ett_pk_loss_rate
;
448 static int ett_list_prefer_link
;
449 static int ett_ip_dhcp_server
;
450 static int ett_fn_agent
;
451 static int ett_access_router
;
452 static int ett_link_states_req
;
453 static int ett_link_desc_req
;
454 static int ett_dev_states_resp
;
456 /*field definitions of evt, cmd, mob mgmt, ip cfg, iq type */
457 static int * const event_fields
[] = {
458 &hf_event_link_detect
,
461 &hf_event_link_param
,
465 &hf_event_pdu_tx_stat
,
469 static int * const cmd_fields
[] = {
478 static int * const iq_type_fields
[] = {
500 &hf_iq_net_ims_pcscf
,
504 &hf_iq_poa_chan_range
,
511 static int * const mob_fields
[] = {
522 static int * const cfg_fields
[] = {
533 /*field definitions for various bitmaps */
534 static int * const trans_fields
[] = {
540 static int * const dev_states_fields
[] = {
541 &hf_dev_states_req_dev_info
,
542 &hf_dev_states_req_batt_lvl
,
546 static int * const mihcap_fields
[] = {
553 static int * const net_caps_fields
[] = {
567 static int * const ac_attr_fields
[] = {
568 &hf_link_ac_attr_link_scan
,
569 &hf_link_ac_attr_link_res_retain
,
570 &hf_link_ac_attr_data_fwd_req
,
574 static int * const subtype_eth_fields
[] = {
575 &hf_link_subtype_eth_10m
,
576 &hf_link_subtype_eth_100m
,
577 &hf_link_subtype_eth_1000m
,
581 static int * const subtype_wireless_other_fields
[] = {
582 &hf_link_subtype_wireless_other_dvb
,
583 &hf_link_subtype_wireless_other_tdmb
,
584 &hf_link_subtype_wireless_other_atsc
,
588 static int * const subtype_ieee80211_fields
[] = {
589 &hf_link_subtype_ieee80211_24
,
590 &hf_link_subtype_ieee80211_5
,
591 &hf_link_subtype_ieee80211_49
,
592 &hf_link_subtype_ieee80211_365
,
593 &hf_link_subtype_ieee80211_316
,
597 static int * const subtype_umts_fields
[] = {
598 &hf_link_subtype_umts_99
,
599 &hf_link_subtype_umts_4
,
600 &hf_link_subtype_umts_5
,
601 &hf_link_subtype_umts_6
,
602 &hf_link_subtype_umts_7
,
603 &hf_link_subtype_umts_8
,
607 static int * const subtype_cdma2000_fields
[] = {
608 &hf_link_subtype_cdma2000_0
,
609 &hf_link_subtype_cdma2000_a
,
610 &hf_link_subtype_cdma2000_b
,
611 &hf_link_subtype_cdma2000_c
,
615 static int * const subtype_ieee80216_fields
[] = {
616 &hf_link_subtype_ieee80216_25
,
617 &hf_link_subtype_ieee80216_35
,
621 static const value_string servicevalues
[] = {
622 {1, "Service Management"},
623 {2, "Event Service"},
624 {3, "Command Service"},
625 {4, "Information Service"},
629 static const value_string opcodevalues
[] = {
637 static const value_string link_ac_result_vals
[] = {
645 static const value_string serv_act_id_values
[] = {
646 {1, "MIH_Capability_Discover"},
648 {3, "MIH_DeRegister"},
649 {4, "MIH_Event_Subscribe"},
650 {5, "MIH_Event_Unsubscribe"},
654 static const value_string event_act_id_values
[] = {
655 {1, "MIH_Link_Detected"},
657 {3, "MIH_Link_Down"},
658 {5, "MIH_Link_Parameter_Report"},
659 {6, "MIH_Link_Going_down"},
660 {7, "MIH_Link_Handover_Imminent"},
661 {8, "MIH_Handover_Complete"},
665 static const value_string status_types
[] = {
667 {1, "Unspecified Failure"},
669 {3, "Authorization Failure"},
670 {4, "Network Error"},
674 static const value_string ho_status_vals
[] = {
675 {0, "Handover Permitted"},
676 {1, "Handover Declined"},
680 static const value_string mbb_ho_supp_vals
[] = {
681 {0, "Make before break is not supported."},
682 {1, "Make before break is supported."},
686 static const value_string reg_request_code_vals
[] = {
688 {1, "Re-Registration"},
692 static const value_string ip_renewal_vals
[] = {
693 {0, "Change Not Required"},
694 {1, "Change Required"},
698 static const value_string dev_states_req_vals
[] = {
704 static const value_string link_addr_types
[] ={
706 {1, "3GPP_3G_CELL_ID"},
707 {2, "3GPP_2G_CELL_ID"},
710 {5, "OTHER_L2_ADDR"},
714 static const value_string threshold_x_dir_vals
[] ={
715 {0, "Above Threshold"},
716 {1, "Below Threshold"},
720 static const value_string threshold_action_vals
[] ={
721 {0, "Set Normal Threshold"},
722 {1, "Set one-shot Threshold"},
723 {2, "Cancel Threshold"},
727 static const value_string boolean_types
[] ={
733 static const value_string command_act_id_values
[] = {
734 {1, "MIH_Link_Get_Parameters"},
735 {2, "MIH_Link_Configure_Thresholds"},
736 {3, "MIH_Link_Actions"},
737 {4, "MIH_Net_HO_Candidate_Query"},
738 {5, "MIH_MN_HO_Candidate_Query"},
739 {6, "MIH_N2N_HO_Query_Resources"},
740 {7, "MIH_MN_HO_Commit"},
741 {8, "MIH_Net_HO-Commit"},
742 {9, "MN_N2N_HO_Commit"},
743 {10, "MIH_MN_HO_Complete"},
744 {11, "MIH_N2N_HO_Complete"},
745 {12, "MIH_Net_HO_Best_Commit"},
749 static const value_string info_act_id_values
[] = {
750 {1, "MIH_Get_Information"},
751 {2, "MIH_Push_information"},
755 static const value_string link_dn_reason_vals
[] = {
756 {0, "Explicit Disconnect"},
757 {1, "Packet Timeout"},
760 {4, "Authentication Failure"},
761 {5, "Billing Failure"},
765 static const value_string link_gdn_reason_vals
[] = {
766 {0, "Explicit Disconnect"},
767 {1, "Link Parameter Degrading"},
773 static const value_string link_type_vals
[] = {
775 {1, "Wireless - GSM"},
776 {2, "Wireless - GPRS"},
777 {3, "Wireless - EDGE"},
779 {18, "Wireless - Other"},
780 {19, "Wireless - IEEE 802.11"},
781 {22, "Wireless - CDMA2000"},
782 {23, "Wireless - UMTS"},
783 {24, "Wireless - cdma2000-HRPD"},
784 {27, "Wireless - IEEE 802.16"},
785 {28, "Wireless - IEEE 802.20"},
786 {29, "Wireless - IEEE 802.22"},
793 static const value_string link_param_gen_vals
[] = {
795 {1, "Signal Strength"},
798 {4, "Packet Error Rate"},
799 {5, "Channel Frequency"},
800 {6, "Channel Bandwidth"},
801 {7, "Channel TX Power"},
802 {8, "Higher Adjacent Channel Frequency"},
803 {9, "Higher Adjacent Channel Bandwidth"},
804 {10, "Higher Adjacent Channel TX Power"},
805 {11, "Lower Adjacent Channel Frequency"},
806 {12, "Lower Adjacent Channel Bandwidth"},
807 {13, "Lower Adjacent Channel TX Power"},
811 static const value_string link_ac_type_vals
[] = {
813 {1, "LINK_DISCONNECT"},
814 {2, "LINK_LOW_POWER"},
815 {3, "LINK_POWER_DOWN"},
816 {4, "LINK_POWER_UP"},
817 {5, "LINK_CONFIGURE"},
821 static const value_string link_param_gg_vals
[] = {
829 static const value_string link_param_fdd_vals
[] = {
832 {2, "UTRA carrier RSSI"},
833 {3, "GSM carrier RSSI"},
835 {5, "Transport channel BLER"},
836 {6, "User equipment (UE) transmitted power"},
840 static const value_string link_param_802_11_vals
[] = {
842 {1, "No QoS resource Available"},
843 {2, "Multicast packet loss rate"},
847 static const value_string op_mode_vals
[] = {
849 {1, "Power Saving Mode"},
854 static const value_string link_param_qos_vals
[] = {
855 {0, "Max no of differentiable classes"},
856 {1, "Min Packet transfer delay"},
857 {2, "Avg packet transfer delay"},
858 {3, "Max packet transfer delay"},
864 static const value_string link_param_c2k_hrpd_vals
[] = {
865 {0, "Pilot Strength"},
869 static const value_string typevaluenames
[] = {
870 { 1, "Source MIHIF ID" },
871 { 2, "Destination MIHIF ID" },
874 { 5, "MIH event list" },
875 { 6, "MIH command list" },
876 { 7, "MIIS query type list" },
877 { 8, "Transport option list" },
878 { 9, "Link address list" },
879 { 10, "MBB handover support" },
880 { 11, "Register request code" },
881 { 12, "Valid time interval" },
882 { 13, "Link identifier" },
883 { 14, "New Link identifier" },
884 { 15, "Old access router" },
885 { 16, "New access router" },
886 { 17, "IP renewal flag" },
887 { 18, "Mobility management support" },
888 { 19, "IP address configuration methods" },
889 { 20, "Link down reason code" },
890 { 21, "Time interval" },
891 { 22, "Link going down reason" },
892 { 23, "Link parameter report list" },
893 { 24, "Device states request" },
894 { 25, "Link identifier list" },
895 { 26, "Device states response list" },
896 { 27, "Get status request set" },
897 { 28, "Get status response list" },
898 { 29, "Configure request list" },
899 { 30, "Configure response list" },
900 { 31, "List of link PoA list" },
901 { 32, "Preferred link list" },
902 { 33, "Handover resource query list" },
903 { 34, "Handover status" },
904 { 35, "Access router address" },
905 { 36, "DHCP server address" },
906 { 37, "FA address" },
907 { 38, "Link actions list" },
908 { 39, "Link actions result list" },
909 { 40, "Handover result" },
910 { 41, "Resource status" },
911 { 42, "Resource retention status" },
912 { 43, "Info query binary data list" },
913 { 44, "Info query RDF data list" },
914 { 45, "Info query RDF schema URL" },
915 { 46, "Info query RDF schema list" },
916 { 47, "Max response size" },
917 { 48, "Info response binary data list" },
918 { 49, "Info response RDF data list" },
919 { 50, "Info response RDF schema URL list" },
920 { 51, "Info response RDF schema list" },
921 { 52, "Mobile node MIHF ID" },
922 { 53, "Query resource report flag" },
923 { 54, "Event configuration info list" },
924 { 55, "Target network info" },
925 { 56, "List of target network info" },
926 { 57, "Assigned resource set" },
927 { 58, "Link detected info list" },
928 { 59, "MN link ID" },
930 { 61, "Unauthenticated information request" },
931 { 62, "Network type" },
932 { 63, "Requested resource set" },
936 static int16_t dissect_mih_list(tvbuff_t
*tvb
, int16_t offset
, proto_tree
*tlv_tree
, int16_t (*base_dissect
)(tvbuff_t
*tvb
, int16_t offset
, proto_tree
*tlv_tree
))
939 uint8_t list_len
= tvb_get_uint8(tvb
, offset
);
941 for(i
=0; i
< list_len
; i
++)
942 offset
= base_dissect(tvb
, offset
, tlv_tree
);
946 static int16_t dissect_ip_addr(tvbuff_t
*tvb
, int16_t offset
, proto_tree
*tlv_tree
)
948 uint16_t addr_type
= tvb_get_ntohs(tvb
, offset
);
953 len
= tvb_get_uint8(tvb
, offset
+ 3);
954 proto_tree_add_item(tlv_tree
, hf_ipv4_addr
, tvb
, offset
+2, len
, ENC_BIG_ENDIAN
);
955 return (offset
+3+len
);
960 len
= tvb_get_uint8(tvb
, offset
+ 3);
961 proto_tree_add_item(tlv_tree
,hf_ipv6_addr
, tvb
, offset
+2, len
, ENC_NA
);
962 return (offset
+3+len
);
966 len
= tvb_get_uint8(tvb
, offset
+ 3);
967 return (offset
+3+len
);
971 static int16_t dissect_qos_val(tvbuff_t
*tvb
, int16_t offset
, proto_tree
*tlv_tree
)
973 proto_tree_add_item(tlv_tree
, hf_cos_id
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
975 proto_tree_add_item(tlv_tree
, hf_cos_value
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
980 static int16_t dissect_link_addr(tvbuff_t
*tvb
, int16_t offset
, proto_tree
*tlv_tree
)
982 uint8_t link_addr_choice
= tvb_get_uint8(tvb
, offset
);
985 proto_tree_add_item(tlv_tree
, hf_link_addr_type
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
986 switch (link_addr_choice
)
988 case 0 : /*MAC_ADDR*/
989 proto_tree_add_item(tlv_tree
, hf_link_transport_addr_type
, tvb
, offset
+1, 2, ENC_BIG_ENDIAN
);
990 if(tvb_get_ntohs(tvb
, offset
+1) == 0x06)
991 proto_tree_add_item(tlv_tree
, hf_mac_addr
, tvb
, offset
+4, tvb_get_uint8(tvb
, offset
+3), ENC_NA
);
992 return (offset
+ 10);
994 case 1 :/*3GPP_3G_CELL_ID*/
995 proto_tree_add_item(tlv_tree
, hf_plmn_id
, tvb
, offset
+1, 3, ENC_BIG_ENDIAN
);
996 proto_tree_add_item(tlv_tree
, hf_cell_id
, tvb
, offset
+4, 4, ENC_BIG_ENDIAN
);
999 case 2 :/*3GPP_2G_CELL_ID*/
1000 proto_tree_add_item(tlv_tree
, hf_plmn_id
, tvb
, offset
+1, 3, ENC_BIG_ENDIAN
);
1001 proto_tree_add_item(tlv_tree
, hf_location_area_id
, tvb
, offset
+4, 2, ENC_BIG_ENDIAN
);
1002 proto_tree_add_item(tlv_tree
, hf_ci
, tvb
, offset
+6, 2, ENC_BIG_ENDIAN
);
1003 return (offset
+ 8);
1005 case 3 :/*3GPP_ADDR*/
1006 case 4 :/*3GPP2_ADDR*/
1007 case 5 :/*OTHER_L2_ADDR*/
1008 len
= tvb_get_uint8(tvb
, offset
+1);
1009 proto_tree_add_item(tlv_tree
, hf_link_addr_string
, tvb
, offset
+2, len
, ENC_ASCII
);
1010 return (offset
+ 2 + len
);
1015 static int16_t dissect_tsp_container(tvbuff_t
*tvb
, int16_t offset
, proto_tree
*tlv_tree
)
1018 if(tvb_get_uint8(tvb
, offset
) == 1)
1020 proto_tree_add_item(tlv_tree
, hf_predef_cfg_id
, tvb
, offset
+1, 1, ENC_BIG_ENDIAN
);
1021 return (offset
+ 2);
1023 else if(tvb_get_uint8(tvb
, offset
) == 2)
1025 len
= tvb_get_uint8(tvb
, offset
+1);
1026 proto_tree_add_item(tlv_tree
, hf_tsp_carrier
, tvb
, offset
+2, len
, ENC_ASCII
);
1027 return (offset
+ len
+ 2);
1030 return (offset
+ 1);
1033 static int16_t dissect_iq_rdf_data(tvbuff_t
*tvb
, int16_t offset
, proto_tree
*tlv_tree
)
1036 if(tvb_get_uint8(tvb
, offset
))
1038 len
= tvb_get_uint8(tvb
, offset
+1);
1039 proto_tree_add_item(tlv_tree
, hf_rdf_mime_type
, tvb
, offset
+2, len
, ENC_ASCII
);
1043 len
= tvb_get_uint8(tvb
, offset
);
1044 proto_tree_add_item(tlv_tree
, hf_rdf_data
, tvb
, offset
+1, len
, ENC_ASCII
);
1045 return (offset
+len
+1);
1048 static int16_t dissect_qos_list(tvbuff_t
*tvb
, int16_t offset
, proto_tree
*tlv_tree
)
1050 proto_tree
*subtree
;
1052 proto_tree_add_item(tlv_tree
, hf_num_cos
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1054 subtree
= proto_tree_add_subtree(tlv_tree
, tvb
, offset
, 1, ett_min_pk_tx_delay
, NULL
, "MIN_PK_TX_DELAY");
1055 offset
= dissect_mih_list(tvb
, offset
, subtree
, dissect_qos_val
);
1056 subtree
= proto_tree_add_subtree(tlv_tree
, tvb
, offset
, 1, ett_avg_pk_tx_delay
, NULL
, "AVG_PK_TX_DELAY");
1057 offset
= dissect_mih_list(tvb
, offset
, subtree
, dissect_qos_val
);
1058 subtree
= proto_tree_add_subtree(tlv_tree
, tvb
, offset
, 1, ett_max_pk_tx_delay
, NULL
, "MAX_PK_TX_DELAY");
1059 offset
= dissect_mih_list(tvb
, offset
, subtree
, dissect_qos_val
);
1060 subtree
= proto_tree_add_subtree(tlv_tree
, tvb
, offset
, 1, ett_pk_delay_jitter
, NULL
, "PK_DELAY_JITTER");
1061 offset
= dissect_mih_list(tvb
, offset
, subtree
, dissect_qos_val
);
1062 subtree
= proto_tree_add_subtree(tlv_tree
, tvb
, offset
, 1, ett_pk_loss_rate
, NULL
, "PK_LOSS_RATE");
1063 offset
= dissect_mih_list(tvb
, offset
, subtree
, dissect_qos_val
);
1067 static int16_t dissect_dev_states(tvbuff_t
*tvb
, int16_t offset
, proto_tree
*tlv_tree
)
1071 proto_tree
*sub_tree
;
1073 item
= proto_tree_add_item(tlv_tree
, hf_dev_states_resp
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1074 sub_tree
= proto_item_add_subtree(item
, ett_dev_states_resp
);
1075 if(tvb_get_uint8(tvb
, offset
))
1079 proto_tree_add_item(sub_tree
, hf_dev_batt_level
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1086 len
= tvb_get_uint8(tvb
, offset
);
1087 proto_tree_add_item(sub_tree
, hf_dev_info
, tvb
, offset
+1, len
, ENC_ASCII
);
1088 return (offset
+ len
+ 1);
1093 static int16_t dissect_net_type(tvbuff_t
*tvb
, int16_t offset
, proto_tree
*tlv_tree
)
1097 if(!tvb_get_uint8(tvb
, offset
))
1100 type
= tvb_get_uint8(tvb
, offset
+1);
1101 proto_tree_add_item(tlv_tree
, hf_link_type
, tvb
, offset
+1, 1, ENC_BIG_ENDIAN
);
1105 if(!tvb_get_uint8(tvb
, offset
))
1110 /* last 32 bits are not read since proto_tree_add_bitmask only handles bitmasks of length 32
1111 Even though the standard defines a bitmasks of length 64, there are no definitions in the standard that require more than 32 bits
1112 1 (identifier) + 4(bitmask defined values) + 4 (unused bits) = 9 (final offset)*/
1113 case 15 : /*subtype ethernet*/
1114 proto_tree_add_bitmask(tlv_tree
, tvb
, offset
+1, hf_link_subtype_eth
, ett_subtype_eth_bitmap
, subtype_eth_fields
, ENC_BIG_ENDIAN
);
1116 case 18 : /*subtype wireless other*/
1117 proto_tree_add_bitmask(tlv_tree
, tvb
, offset
+1, hf_link_subtype_wireless_other
, ett_subtype_wireless_other_bitmap
, subtype_wireless_other_fields
, ENC_BIG_ENDIAN
);
1119 case 19 : /*subtype 802.11*/
1120 proto_tree_add_bitmask(tlv_tree
, tvb
, offset
+1, hf_link_subtype_ieee80211
, ett_subtype_ieee80211_bitmap
, subtype_ieee80211_fields
, ENC_BIG_ENDIAN
);
1122 case 23 : /*subtype UMTS*/
1123 proto_tree_add_bitmask(tlv_tree
, tvb
, offset
+1, hf_link_subtype_umts
, ett_subtype_umts_bitmap
, subtype_umts_fields
, ENC_BIG_ENDIAN
);
1125 case 24 : /*subtype cdma2000*/
1126 proto_tree_add_bitmask(tlv_tree
, tvb
, offset
+1, hf_link_subtype_cdma2000
, ett_subtype_cdma2000_bitmap
, subtype_cdma2000_fields
, ENC_BIG_ENDIAN
);
1128 case 27 : /*subtype 802.16*/
1129 proto_tree_add_bitmask(tlv_tree
, tvb
, offset
+1, hf_link_subtype_ieee80216
, ett_subtype_ieee80216_bitmap
, subtype_ieee80216_fields
, ENC_BIG_ENDIAN
);
1132 proto_item_append_text(tlv_tree
, "N/A");
1134 /*4(bitmask defined values) + 4 (unused bits) = 8 bits*/
1137 /*1 (identifier) = 1 bit*/
1139 if(!tvb_get_uint8(tvb
, offset
))
1142 len
= tvb_get_uint8(tvb
, offset
+1);
1143 proto_tree_add_item(tlv_tree
, hf_link_type_ext
, tvb
, offset
+2, len
, ENC_ASCII
);
1149 static int16_t dissect_net_type_addr(tvbuff_t
*tvb
, int16_t offset
, proto_tree
*tlv_tree
)
1151 offset
= dissect_net_type(tvb
, offset
, tlv_tree
);
1152 offset
= dissect_link_addr(tvb
, offset
, tlv_tree
);
1156 static int16_t dissect_mbb_ho_supp(tvbuff_t
*tvb
, int16_t offset
, proto_tree
*tlv_tree
)
1158 offset
= dissect_net_type(tvb
, offset
, tlv_tree
);
1159 offset
= dissect_net_type(tvb
, offset
, tlv_tree
);
1160 proto_tree_add_item(tlv_tree
, hf_mbb_ho_supp
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1165 static int16_t dissect_tgt_net_info(tvbuff_t
*tvb
, int16_t offset
, proto_tree
*tlv_tree
)
1168 if(!tvb_get_uint8(tvb
, offset
))
1173 len
= tvb_get_uint8(tvb
, offset
);
1174 proto_tree_add_item(tlv_tree
, hf_network_id
, tvb
, offset
+1, len
, ENC_ASCII
);
1176 if(!tvb_get_uint8(tvb
, offset
))
1180 len
= tvb_get_uint8(tvb
, offset
);
1181 proto_tree_add_item(tlv_tree
, hf_net_aux_id
, tvb
, offset
+1, len
, ENC_ASCII
);
1182 return (offset
+ 1);
1184 return (offset
+ 2);
1190 offset
= dissect_link_addr(tvb
, offset
, tlv_tree
);
1195 static int16_t dissect_link_id(tvbuff_t
*tvb
, int16_t offset
, proto_tree
*tlv_tree
)
1198 int16_t next_offset
= 0;
1201 proto_tree_add_item(tlv_tree
, hf_link_type
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1202 next_offset
= dissect_link_addr(tvb
, offset
+1, tlv_tree
);
1203 return (next_offset
);
1206 static int16_t dissect_link_poa(tvbuff_t
*tvb
, int16_t offset
, proto_tree
*tlv_tree
)
1208 offset
= dissect_link_id(tvb
, offset
, tlv_tree
);
1209 offset
= dissect_mih_list(tvb
, offset
, tlv_tree
, dissect_link_addr
);
1213 static int16_t dissect_rq_result(tvbuff_t
*tvb
, int16_t offset
, proto_tree
*tlv_tree
)
1215 proto_tree
*subtree
;
1216 subtree
= proto_tree_add_subtree(tlv_tree
, tvb
, offset
, 1, ett_list_prefer_link
, NULL
, "List of preferred links");
1217 offset
= dissect_link_poa(tvb
, offset
, subtree
);
1218 offset
= dissect_qos_list(tvb
, offset
, tlv_tree
);
1220 switch(tvb_get_uint8(tvb
, offset
-1))
1223 proto_tree_add_item(tlv_tree
, hf_ip_methods_supported
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1227 proto_tree_add_bitmask(tlv_tree
, tvb
, offset
, hf_cfg_mthds
, ett_cfg_mtd_bitmap
, cfg_fields
, ENC_BIG_ENDIAN
);
1232 switch(tvb_get_uint8(tvb
, offset
-1))
1235 proto_tree_add_item(tlv_tree
, hf_ip_dhcp_services
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1238 case 2: subtree
= proto_tree_add_subtree(tlv_tree
, tvb
, offset
, 1, ett_ip_dhcp_server
, NULL
, "IP DHCP server");
1239 offset
= dissect_ip_addr(tvb
, offset
, subtree
);
1243 switch(tvb_get_uint8(tvb
, offset
-1))
1246 proto_tree_add_item(tlv_tree
, hf_fn_agent
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1249 case 2: subtree
= proto_tree_add_subtree(tlv_tree
, tvb
, offset
, 1, ett_fn_agent
, NULL
, "FN Agent");
1250 offset
= dissect_ip_addr(tvb
, offset
, subtree
);
1254 switch(tvb_get_uint8(tvb
, offset
-1))
1257 proto_tree_add_item(tlv_tree
, hf_access_router
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1260 case 2: subtree
= proto_tree_add_subtree(tlv_tree
, tvb
, offset
, 1, ett_access_router
, NULL
, "Access Router");
1261 offset
= dissect_ip_addr(tvb
, offset
, subtree
);
1267 static int16_t dissect_link_det_info(tvbuff_t
*tvb
, int16_t offset
, proto_tree
*tlv_tree
)
1270 offset
= dissect_link_id(tvb
, offset
, tlv_tree
);
1271 if(tvb_get_uint8(tvb
, offset
))
1274 offset
= dissect_link_addr(tvb
, offset
, tlv_tree
);
1278 len
= tvb_get_uint8(tvb
, offset
);
1279 proto_tree_add_item(tlv_tree
, hf_network_id
, tvb
, offset
+1, len
, ENC_ASCII
);
1281 len
= tvb_get_uint8(tvb
, offset
);
1282 proto_tree_add_item(tlv_tree
, hf_net_aux_id
, tvb
, offset
+1, len
, ENC_ASCII
);
1284 if(tvb_get_uint8(tvb
, offset
))
1285 proto_tree_add_item(tlv_tree
, hf_sig_strength_per
, tvb
, offset
+1, 1, ENC_BIG_ENDIAN
);
1287 proto_tree_add_item(tlv_tree
, hf_sig_strength_dbm
, tvb
, offset
+1, 1, ENC_BIG_ENDIAN
);
1289 proto_tree_add_item(tlv_tree
, hf_sinr
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1291 proto_tree_add_item(tlv_tree
, hf_link_data_rate
, tvb
, offset
,4, ENC_BIG_ENDIAN
);
1293 proto_tree_add_bitmask(tlv_tree
, tvb
, offset
, hf_mihcap
, ett_mihcap_bitmap
, mihcap_fields
, ENC_BIG_ENDIAN
);
1295 proto_tree_add_bitmask(tlv_tree
, tvb
, offset
, hf_net_caps
, ett_net_caps_bitmap
, net_caps_fields
, ENC_BIG_ENDIAN
);
1300 static int16_t dissect_link_scan_rsp(tvbuff_t
*tvb
, int16_t offset
, proto_tree
*tlv_tree
)
1303 offset
= dissect_link_addr(tvb
, offset
, tlv_tree
);
1304 len
= tvb_get_uint8(tvb
, offset
);
1305 proto_tree_add_item(tlv_tree
, hf_network_id
, tvb
, offset
+1, len
, ENC_ASCII
);
1306 offset
= offset
+ len
+ 1;
1307 if(tvb_get_uint8(tvb
, offset
))
1308 proto_tree_add_item(tlv_tree
, hf_sig_strength_per
, tvb
, offset
+1, 1, ENC_BIG_ENDIAN
);
1310 proto_tree_add_item(tlv_tree
, hf_sig_strength_dbm
, tvb
, offset
+1, 1, ENC_BIG_ENDIAN
);
1314 static int16_t dissect_link_action_rsp(tvbuff_t
*tvb
, int16_t offset
, proto_tree
*tlv_tree
)
1316 offset
= dissect_link_id(tvb
, offset
, tlv_tree
);
1317 proto_tree_add_item(tlv_tree
, hf_link_ac_result
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1319 if(tvb_get_uint8(tvb
, offset
))
1321 offset
= dissect_mih_list(tvb
, offset
+1, tlv_tree
, dissect_link_scan_rsp
);
1329 static int16_t dissect_link_action_req(tvbuff_t
*tvb
, int16_t offset
, proto_tree
*tlv_tree
)
1331 offset
= dissect_link_id(tvb
, offset
, tlv_tree
);
1332 if(tvb_get_uint8(tvb
, offset
))
1334 offset
= dissect_link_addr(tvb
, offset
+1, tlv_tree
);
1340 proto_tree_add_item(tlv_tree
, hf_link_ac_type
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1342 proto_tree_add_bitmask(tlv_tree
, tvb
, offset
, hf_link_ac_attr
, ett_ac_attr_bitmap
, ac_attr_fields
, ENC_BIG_ENDIAN
);
1344 proto_tree_add_item(tlv_tree
, hf_link_ac_ext_time
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1348 static int16_t dissect_link_states_rsp(tvbuff_t
*tvb
, int16_t offset
, proto_tree
*tlv_tree
)
1350 if(!tvb_get_uint8(tvb
, offset
))
1352 proto_tree_add_item(tlv_tree
, hf_op_mode
, tvb
, offset
+1, 1, ENC_BIG_ENDIAN
);
1357 proto_tree_add_item(tlv_tree
, hf_channel_id
, tvb
, offset
+1, 2, ENC_BIG_ENDIAN
);
1363 static int16_t dissect_link_param_type(tvbuff_t
*tvb
, int16_t offset
, proto_tree
*tlv_tree
)
1365 uint8_t type
= tvb_get_uint8(tvb
, offset
);
1371 case 0 :/*LINK_PARAM_GEN*/
1372 proto_tree_add_item(tlv_tree
, hf_link_param_gen
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1375 case 1 :/*LINK_PARAM_QOS*/
1376 proto_tree_add_item(tlv_tree
, hf_link_param_qos
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1379 case 2 :/*LINK_PARAM_GG*/
1380 proto_tree_add_item(tlv_tree
, hf_link_param_gg
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1383 case 3 :/*LINK_PARAM_EDGE*/
1384 proto_tree_add_item(tlv_tree
, hf_link_param_edge
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1387 case 4 :/*LINK_PARAM_ETH*/
1388 proto_tree_add_item(tlv_tree
, hf_link_param_eth
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1391 case 5 :/*LINK_PARAM_802_11*/
1392 proto_tree_add_item(tlv_tree
, hf_link_param_802_11
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1395 case 6 :/*LINK_PARAM_C2K*/
1396 proto_tree_add_item(tlv_tree
, hf_link_param_c2k
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1399 case 7 :/*LINK_PARAM_FDD*/
1400 proto_tree_add_item(tlv_tree
, hf_link_param_fdd
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1403 case 8 :/*LINK_PARAM_HRPD*/
1404 proto_tree_add_item(tlv_tree
, hf_link_param_hrpd
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1407 case 9 :/*LINK_PARAM_802_16*/
1408 proto_tree_add_item(tlv_tree
, hf_link_param_802_16
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1411 case 10 :/*LINK_PARAM_802_20*/
1412 proto_tree_add_item(tlv_tree
, hf_link_param_802_20
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1415 case 11 :/*LINK_PARAM_802_22*/
1416 proto_tree_add_item(tlv_tree
, hf_link_param_802_22
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1422 static void dissect_link_status_req(tvbuff_t
*tvb
, int16_t offset
, proto_tree
*tlv_tree
)
1424 proto_tree
*subtree
;
1427 uint16_t temp
= tvb_get_ntohs(tvb
, offset
);
1430 subtree
= proto_tree_add_subtree(tlv_tree
, tvb
, offset
, 3, ett_link_states_req
, NULL
, "LINK_STATES_REQ: ");
1431 proto_tree_add_item(subtree
, hf_op_mode
, tvb
, offset
+2, 1, ENC_BIG_ENDIAN
);
1436 subtree
= proto_tree_add_subtree(tlv_tree
, tvb
, offset
, 4, ett_link_states_req
, NULL
, "LINK_STATES_REQ: ");
1437 proto_tree_add_item(subtree
, hf_channel_id
, tvb
, offset
+2, 2, ENC_BIG_ENDIAN
);
1441 /*LINK_PARAM_TYPE_LIST*/
1442 offset
= dissect_mih_list(tvb
, offset
, tlv_tree
, dissect_link_param_type
);
1445 temp
= tvb_get_ntohs(tvb
, offset
);
1446 subtree
= proto_tree_add_subtree(tlv_tree
, tvb
, offset
, 3, ett_link_desc_req
, NULL
, "LINK_DESC_REQ");
1449 proto_tree_add_item(subtree
, hf_num_cos
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1451 proto_tree_add_item(subtree
, hf_num_queue
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1454 static int16_t dissect_link_cfg_status(tvbuff_t
*tvb
, int16_t offset
, proto_tree
*tlv_tree
)
1456 offset
= dissect_link_param_type(tvb
, offset
, tlv_tree
);
1457 proto_tree_add_item(tlv_tree
, hf_threshold_val
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1459 proto_tree_add_item(tlv_tree
, hf_threshold_x_dir
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1461 proto_tree_add_item(tlv_tree
, hf_config_status
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1465 static int16_t dissect_link_param(tvbuff_t
*tvb
, int16_t offset
, proto_tree
*tlv_tree
)
1468 offset
= dissect_link_param_type(tvb
, offset
, tlv_tree
);
1469 if(!tvb_get_uint8(tvb
, offset
))
1472 /*LINK_PARAM_VALUE*/
1473 proto_tree_add_item(tlv_tree
, hf_link_param_value
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1478 proto_tree
*subtree
;
1481 switch(tvb_get_uint8(tvb
, offset
))
1484 proto_tree_add_item(tlv_tree
, hf_num_cos
, tvb
, offset
+1, 1, ENC_BIG_ENDIAN
);
1488 subtree
= proto_tree_add_subtree(tlv_tree
, tvb
, offset
+1, 1, ett_min_pk_tx_delay
, NULL
, "MIN_PK_TX_DELAY");
1489 offset
= dissect_mih_list(tvb
, offset
+1, subtree
, dissect_qos_val
);
1492 subtree
= proto_tree_add_subtree(tlv_tree
, tvb
, offset
+1, 1, ett_avg_pk_tx_delay
, NULL
, "AVG_PK_TX_DELAY");
1493 offset
= dissect_mih_list(tvb
, offset
+1, subtree
, dissect_qos_val
);
1496 subtree
= proto_tree_add_subtree(tlv_tree
, tvb
, offset
+1, 1, ett_max_pk_tx_delay
, NULL
, "MAX_PK_TX_DELAY");
1497 offset
= dissect_mih_list(tvb
, offset
+1, subtree
, dissect_qos_val
);
1500 subtree
= proto_tree_add_subtree(tlv_tree
, tvb
, offset
+1, 1, ett_pk_delay_jitter
, NULL
, "PK_DELAY_JITTER");
1501 offset
= dissect_mih_list(tvb
, offset
+1, subtree
, dissect_qos_val
);
1504 subtree
= proto_tree_add_subtree(tlv_tree
, tvb
, offset
+1, 1, ett_pk_loss_rate
, NULL
, "PK_LOSS_RATE");
1505 offset
= dissect_mih_list(tvb
, offset
+1, subtree
, dissect_qos_val
);
1512 static int16_t dissect_link_param_rpt(tvbuff_t
*tvb
, int16_t offset
, proto_tree
*tlv_tree
)
1515 offset
= dissect_link_param(tvb
, offset
, tlv_tree
);
1516 if(tvb_get_uint8(tvb
, offset
))
1520 proto_tree_add_item(tlv_tree
, hf_threshold_val
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1522 proto_tree_add_item(tlv_tree
, hf_threshold_x_dir
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1529 static int16_t dissect_link_desc_rsp(tvbuff_t
*tvb
, int16_t offset
, proto_tree
*tlv_tree
)
1531 if(!tvb_get_uint8(tvb
, offset
))
1532 proto_tree_add_item(tlv_tree
, hf_num_cos
, tvb
, offset
+1, 1, ENC_BIG_ENDIAN
);
1534 proto_tree_add_item(tlv_tree
, hf_num_queue
, tvb
, offset
+1, 1, ENC_BIG_ENDIAN
);
1538 static int16_t dissect_status_list(tvbuff_t
*tvb
, int16_t offset
, proto_tree
*tlv_tree
)
1541 offset
= dissect_link_id(tvb
, offset
, tlv_tree
);
1544 offset
= dissect_mih_list(tvb
, offset
, tlv_tree
, dissect_link_states_rsp
);
1547 offset
= dissect_mih_list(tvb
, offset
, tlv_tree
, dissect_link_param
);
1550 offset
= dissect_mih_list(tvb
, offset
, tlv_tree
, dissect_link_desc_rsp
);
1554 static int16_t dissect_link_det_cfg(tvbuff_t
*tvb
, int16_t offset
, proto_tree
*tlv_tree
)
1557 if(tvb_get_uint8(tvb
, offset
))
1559 len
= tvb_get_uint8(tvb
, offset
+1);
1560 proto_tree_add_item(tlv_tree
, hf_network_id
, tvb
, offset
+2, len
, ENC_ASCII
);
1564 if(tvb_get_uint8(tvb
, offset
))
1566 if(tvb_get_uint8(tvb
, offset
+1))
1567 proto_tree_add_item(tlv_tree
, hf_sig_strength_per
, tvb
, offset
+2, 1, ENC_BIG_ENDIAN
);
1569 proto_tree_add_item(tlv_tree
, hf_sig_strength_dbm
, tvb
, offset
+2, 1, ENC_BIG_ENDIAN
);
1573 if(tvb_get_uint8(tvb
, offset
))
1575 proto_tree_add_item(tlv_tree
, hf_link_data_rate
, tvb
, offset
+1,4, ENC_BIG_ENDIAN
);
1581 static int16_t dissect_link_cfg_param(tvbuff_t
*tvb
, int16_t offset
, proto_tree
*tlv_tree
)
1583 offset
= dissect_link_param_type(tvb
, offset
, tlv_tree
);
1584 if(tvb_get_uint8(tvb
, offset
))
1586 proto_tree_add_item(tlv_tree
, hf_time_interval
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1590 proto_tree_add_item(tlv_tree
, hf_threshold_action
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1592 proto_tree_add_item(tlv_tree
, hf_threshold_val
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1594 proto_tree_add_item(tlv_tree
, hf_threshold_x_dir
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1598 static int16_t dissect_mih_evt_cfg_info(tvbuff_t
*tvb
, int16_t offset
, proto_tree
*tlv_tree
)
1600 offset
= dissect_mih_list(tvb
, offset
, tlv_tree
, dissect_link_det_cfg
);
1601 offset
= dissect_mih_list(tvb
, offset
, tlv_tree
, dissect_link_cfg_param
);
1605 static void dissect_mih_tlv(tvbuff_t
*tvb
,int offset
, proto_tree
*tlv_tree
, uint8_t type
, uint32_t length
)
1608 uint8_t mihf_id_len
= 0;
1609 char mihf_id_first_char
= 0;
1613 tvbuff_t
*volatile tvb_mihf_id
= NULL
;
1614 tvbuff_t
* tvb_temp
= NULL
;
1615 volatile bool composite_error
= false;
1617 /*For Value fields*/
1624 mihf_id_len
= tvb_get_uint8(tvb
, offset
);
1625 /*taken from the 802.21 standard:
1626 If L2 communication is used then MIHF_ID is the NAI-encoded linklayer
1627 address (LINK_ADDR) of the entity that hosts the MIH services.
1628 In an NAI-encoded IP address or link-layer address, each octet
1629 of binary-encoded IP4_ADDR, IP6_ADDR and LINK_ADDR data is
1630 encoded in the username part of the NAI as "\" followed by the octet
1632 mihf_id_first_char
= (char)tvb_get_uint8(tvb
, offset
+1);
1633 if(mihf_id_first_char
!='\\')
1634 proto_tree_add_item(tlv_tree
, hf_mihf_id
, tvb
, offset
+1, mihf_id_len
, ENC_ASCII
);
1637 if(mihf_id_len
<tvb_reported_length_remaining(tvb
,0) && (mihf_id_len
==12 || mihf_id_len
==64 || mihf_id_len
==128))
1639 tvb_mihf_id
= tvb_new_composite();
1640 for(i
=0; i
< mihf_id_len
/2; i
++)
1642 tvb_temp
= tvb_new_subset_length(tvb
, offset
+ 2 + 2*i
, 1);
1643 if (tvb_captured_length(tvb_temp
)) {
1644 tvb_composite_append(tvb_mihf_id
, tvb_temp
);
1649 tvb_composite_finalize(tvb_mihf_id
);
1653 composite_error
= true;
1657 if(!composite_error
)
1661 case 12: /* checks if the length corresponds to a MAC address */
1662 proto_tree_add_item(tlv_tree
, hf_mihf_id_mac
, tvb_mihf_id
, 0, mihf_id_len
/2, ENC_NA
);
1664 case 64: /* checks if the length corresponds to an IPv4 address */
1665 proto_tree_add_item(tlv_tree
, hf_mihf_id_ipv4
, tvb_mihf_id
, 0, mihf_id_len
/2, ENC_BIG_ENDIAN
);
1667 case 128: /* checks if the length corresponds to an IPv6 address */
1668 proto_tree_add_item(tlv_tree
, hf_mihf_id_ipv6
, tvb_mihf_id
, 0, mihf_id_len
/2, ENC_NA
);
1673 tvb_free(tvb_mihf_id
);
1680 proto_tree_add_item(tlv_tree
, hf_status
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1685 proto_tree_add_item(tlv_tree
, hf_link_type
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1690 proto_tree_add_bitmask(tlv_tree
/*evt_list_tree*/, tvb
, offset
, hf_event_list
, ett_event_bitmap
, event_fields
, ENC_BIG_ENDIAN
);
1695 proto_tree_add_bitmask(tlv_tree
, tvb
, offset
, hf_cmd_list
, ett_cmd_bitmap
, cmd_fields
, ENC_BIG_ENDIAN
);
1698 case MIH_IQ_TYPE_LIST
:
1699 /*MIH_IQ_TYPE_LIST*/
1700 /*last 32 bits are not read since proto_tree_add_bitmask only handles bitmasks of length 32
1701 Even though the standard defines a bitmasks of length 64, there are no definitions in the standard that require more than 32 bits*/
1702 proto_tree_add_bitmask(tlv_tree
, tvb
, offset
, hf_iq_list
, ett_iq_type_bitmap
, iq_type_fields
, ENC_BIG_ENDIAN
);
1705 case MIH_TRANS_LIST
:
1707 proto_tree_add_bitmask(tlv_tree
, tvb
, offset
, hf_trans_list
, ett_trans_list_bitmap
, trans_fields
, ENC_BIG_ENDIAN
);
1710 case LINK_ADDR_LIST
:
1711 /*NET_TYPE_ADDR_LIST*/
1712 dissect_mih_list(tvb
, offset
, tlv_tree
, dissect_net_type_addr
);
1715 case MBB_HO_SUPP_LIST
:
1716 /*MBB_HO_SUPP_LIST*/
1717 dissect_mih_list(tvb
, offset
, tlv_tree
, dissect_mbb_ho_supp
);
1720 case REG_REQUEST_CODE
:
1721 /*REG_REQUEST_CODE*/
1722 proto_tree_add_item(tlv_tree
, hf_reg_request_code
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1725 case VALID_TIME_INTR
:
1726 /*Valid Time interval*/
1727 proto_tree_add_item(tlv_tree
, hf_valid_time_interval
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1734 dissect_link_id(tvb
, offset
, tlv_tree
);
1737 case OLD_ACCESS_ROUTER
:
1738 case NEW_ACCESS_ROUTER
:
1739 case POA_LINK_ADDR
:
1741 dissect_link_addr(tvb
, offset
, tlv_tree
);
1744 case IP_RENEWAL_FLAG
:
1746 proto_tree_add_item(tlv_tree
, hf_ip_renewal
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1751 proto_tree_add_bitmask(tlv_tree
, tvb
, offset
, hf_mob_list
, ett_mob_mgt_bitmap
, mob_fields
, ENC_BIG_ENDIAN
);
1756 proto_tree_add_bitmask(tlv_tree
, tvb
, offset
, hf_cfg_mthds
, ett_cfg_mtd_bitmap
, cfg_fields
, ENC_BIG_ENDIAN
);
1759 case LINK_DN_REASON
:
1761 proto_tree_add_item(tlv_tree
, hf_link_dn_reason
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1764 case TIMER_INTERVAL
:
1766 proto_tree_add_item(tlv_tree
, hf_time_interval
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1769 case LINK_GOING_DN_REASON
:
1770 /*LINK_GOING_DN REASON*/
1771 proto_tree_add_item(tlv_tree
, hf_link_gdn_reason
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1774 case LINK_PARAM_RPT_LIST
:
1775 /*LINK_PARAM_RPT_LIST*/
1776 dissect_mih_list(tvb
, offset
, tlv_tree
, dissect_link_param_rpt
);
1779 case DEV_STATES_REQ
:
1781 proto_tree_add_bitmask(tlv_tree
, tvb
, offset
, hf_dev_states_req
, ett_dev_states_bitmap
, dev_states_fields
, ENC_BIG_ENDIAN
);
1786 dissect_mih_list(tvb
, offset
, tlv_tree
, dissect_link_id
);
1789 case DEV_STATES_RSP_LIST
:
1790 /*DEV_STATES_RSP List*/
1791 dissect_mih_list(tvb
, offset
, tlv_tree
, dissect_dev_states
);
1794 case STATUS_REQ_SET
:
1796 dissect_link_status_req(tvb
, offset
, tlv_tree
);
1799 case STATUS_RSP_LIST
:
1800 /*Status Response List*/
1801 dissect_mih_list(tvb
, offset
, tlv_tree
, dissect_status_list
);
1805 /*LINK_CFG_PARAM_LIST*/
1806 dissect_mih_list(tvb
, offset
, tlv_tree
, dissect_link_cfg_param
);
1810 /*LINK_CFG_STATUS_LIST*/
1811 dissect_mih_list(tvb
, offset
, tlv_tree
, dissect_link_cfg_status
);
1814 case LINK_POA_LIST
:
1816 dissect_mih_list(tvb
, offset
, tlv_tree
, dissect_link_poa
);
1819 case PREF_LINK_LIST
:
1821 dissect_mih_list(tvb
, offset
, tlv_tree
, dissect_rq_result
);
1824 case HO_REQ_QUERY_LIST
:
1826 dissect_qos_list(tvb
, offset
, tlv_tree
);
1831 proto_tree_add_item(tlv_tree
, hf_ho_status
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1834 case ACCESS_ROUTER_ADDR
:
1835 case DHCP_SER_ADDR
:
1838 dissect_ip_addr(tvb
, offset
, tlv_tree
);
1841 case LINK_ACTION_REQ_LIST
:
1842 /*LINK_ACTION_REQ LIST*/
1843 dissect_mih_list(tvb
, offset
, tlv_tree
, dissect_link_action_req
);
1846 case LINK_ACTION_RSP_LIST
:
1847 /*LINK_ACTION_RSP LIST*/
1848 dissect_mih_list(tvb
, offset
, tlv_tree
, dissect_link_action_rsp
);
1853 proto_tree_add_item(tlv_tree
, hf_status
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1856 case LINK_RES_STATUS
:
1858 proto_tree_add_item(tlv_tree
, hf_link_res_status
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1861 case RES_RETENTION_STATUS
:
1863 proto_tree_add_item(tlv_tree
, hf_res_retention_status
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1866 case IQ_RDF_SCHEMA_URL
:
1868 proto_tree_add_item(tlv_tree
, hf_iq_rdf_sch_url
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1871 case Q_RES_RPT_FLAG
:
1873 proto_tree_add_item(tlv_tree
, hf_res_rpt_flag
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1876 case UNAUTH_INFO_REQ
:
1878 proto_tree_add_item(tlv_tree
, hf_unauth_info_req
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1881 case IQ_BIN_DATA_LIST
:
1882 /*IQ_BIN_DATA LIST*/
1883 proto_tree_add_item(tlv_tree
, hf_iq_bin_data_x
, tvb
, offset
, length
, ENC_ASCII
);
1886 case IQ_RDF_DATA_LIST
:
1887 case IR_RDF_DATA_LIST
:
1888 case IR_RDF_SCHM_LIST
:
1889 /*IQ_RDF_DATA LIST*/
1890 dissect_mih_list(tvb
, offset
, tlv_tree
, dissect_iq_rdf_data
);
1893 case IQ_RDF_SCHM_LIST
:
1895 for(i
=0; i
< tvb_get_uint8(tvb
, offset
); i
++)
1897 len
= tvb_get_uint8(tvb
, offset
+1);
1898 proto_tree_add_item(tlv_tree
, hf_rdf_sch
, tvb
, offset
+2, len
, ENC_ASCII
);
1904 /*Max Response Size*/
1905 proto_tree_add_item(tlv_tree
, hf_max_resp_size
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1908 case IR_BIN_DATA_LIST
:
1909 /*IR_BIN_DATA LIST*/
1910 proto_tree_add_item(tlv_tree
, hf_ir_bin_data
, tvb
, offset
, length
, ENC_ASCII
);
1913 case IR_SCHM_URL_LIST
:
1915 for(i
=0; i
< tvb_get_uint8(tvb
, offset
); i
++)
1917 len
= tvb_get_uint8(tvb
, offset
+1);
1918 proto_tree_add_item(tlv_tree
, hf_rdf_sch_url
, tvb
, offset
+2, len
, ENC_ASCII
);
1923 case EVT_CFG_INFO_LIST
:
1924 /*EVT_CFG_INFO LIST*/
1925 dissect_mih_list(tvb
, offset
, tlv_tree
, dissect_mih_evt_cfg_info
);
1930 dissect_tgt_net_info(tvb
, offset
, tlv_tree
);
1933 case TGT_NET_INFO_LIST
:
1934 /*List of TGT_NET_INFO*/
1935 dissect_mih_list(tvb
, offset
, tlv_tree
, dissect_tgt_net_info
);
1940 offset
= dissect_qos_list(tvb
, offset
, tlv_tree
);
1941 dissect_tsp_container(tvb
, offset
, tlv_tree
);
1944 case LINK_DET_INFO_LIST
:
1945 /*LINK_DET_INFO LIST*/
1946 dissect_mih_list(tvb
, offset
, tlv_tree
, dissect_link_det_info
);
1951 dissect_net_type(tvb
, offset
, tlv_tree
);
1956 offset
= dissect_qos_list(tvb
, offset
, tlv_tree
);
1957 offset
= dissect_tsp_container(tvb
, offset
, tlv_tree
);
1958 proto_tree_add_item(tlv_tree
, hf_ho_reason
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1961 case VEND_SPECIFIC_TLV
:
1962 /*Vendor specific tlv*/
1963 proto_tree_add_item(tlv_tree
, hf_vendor_specific_tlv
, tvb
, offset
, length
, ENC_ASCII
);
1966 default :/*did not match type*/
1967 /*do switch case for range of numbers*/
1970 if(type
> 63 && type
< 100)
1971 proto_tree_add_item(tlv_tree
, hf_reserved_tlv
, tvb
, offset
, length
, ENC_ASCII
);
1973 /*EXPERIMENTAL TLVs*/
1974 else if(type
> 100 && type
< 255)
1975 proto_tree_add_item(tlv_tree
, hf_experimental_tlv
, tvb
, offset
, length
, ENC_ASCII
);
1979 proto_tree_add_item(tlv_tree
, hf_unknown_tlv
, tvb
, offset
, length
, ENC_ASCII
);
1984 static int dissect_mih(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void* data _U_
)
1986 proto_item
*ti
= NULL
;
1988 proto_item
*item
= NULL
;
1989 proto_tree
*mih_tree
= NULL
;
1990 proto_tree
*ver_flags_tree
= NULL
;
1991 uint8_t serviceid
= 0;
1993 uint8_t service
= 0;
1994 uint16_t action
= 0;
1995 int32_t payload_length
= 0;
1997 uint8_t len_of_len
= 0;
1999 proto_tree
*mid_tree
= NULL
;
2000 proto_tree
*tlv_tree
= NULL
;
2001 uint8_t fragment
= 0;
2003 col_set_str(pinfo
->cinfo
, COL_PROTOCOL
, "MIH");
2004 col_clear(pinfo
->cinfo
,COL_INFO
);
2006 /* we are being asked for details */
2007 ti
= proto_tree_add_item(tree
, proto_mih
, tvb
, 0, -1, ENC_NA
);
2008 mih_tree
= proto_item_add_subtree(ti
, ett_mih
);
2011 /* TODO: should have a different hf item for this version root */
2012 item
= proto_tree_add_item(mih_tree
, hf_mih_version
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
2014 ver_flags_tree
= proto_item_add_subtree(item
, ett_ver_flags
);
2015 proto_tree_add_item(ver_flags_tree
, hf_mih_version
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
2016 proto_tree_add_item(ver_flags_tree
, hf_mih_ack_req
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
2017 proto_tree_add_item(ver_flags_tree
, hf_mih_ack_resp
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
2018 proto_tree_add_item(ver_flags_tree
, hf_mih_uir
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
2019 proto_tree_add_item(ver_flags_tree
, hf_mih_more_frag
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
2021 fragment
= tvb_get_uint8(tvb
, offset
);
2022 fragment
= fragment
<< 7;
2028 /*flags and version tree is done.....*/
2029 proto_tree_add_item(mih_tree
, hf_mih_frag_no
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
2031 /*for MIH message ID*/
2032 item
= proto_tree_add_item(mih_tree
, hf_mih_mid
, tvb
, offset
+ 1, 2, ENC_BIG_ENDIAN
);
2034 fragment
= fragment
+ (tvb_get_uint8(tvb
, offset
)>>1);
2036 mid_tree
= proto_item_add_subtree(item
, ett_mid
);
2037 serviceid
= tvb_get_uint8(tvb
, offset
);
2038 serviceid
= serviceid
& 0xF0;
2040 proto_tree_add_item(mid_tree
, hf_mih_service_id
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
2042 /*filling the info column with the service type...*/
2043 col_append_fstr(pinfo
->cinfo
, COL_INFO
, "%s ", val_to_str_const(serviceid
, servicevalues
, "Unknown"));
2044 opcode
= tvb_get_uint8(tvb
, offset
);
2045 opcode
= opcode
& 0x0C;
2048 proto_tree_add_item(mid_tree
, hf_mih_opcode
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
2050 /*filling the info column with the opcode type...*/
2051 col_append_fstr(pinfo
->cinfo
, COL_INFO
, "%s ", val_to_str_const(opcode
, opcodevalues
, "Unknown"));
2053 /*check for type of service..*/
2054 service
= tvb_get_uint8(tvb
, offset
);
2055 service
= service
& 0xF0;
2058 /*get the action id.*/
2059 action
= tvb_get_ntohs(tvb
, offset
);
2060 action
= action
& 0x03FF;
2063 case 1 :/*for Service Management..*/
2064 proto_tree_add_item(mid_tree
, hf_mih_serv_actionid
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
2065 col_append_fstr(pinfo
->cinfo
, COL_INFO
, "\"%s\"", val_to_str_const(action
, serv_act_id_values
, "Unknown"));
2067 case 2 :/*for event services..*/
2068 proto_tree_add_item(mid_tree
, hf_mih_event_actionid
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
2069 col_append_fstr(pinfo
->cinfo
, COL_INFO
, "\"%s\"", val_to_str_const(action
, event_act_id_values
, "Unknown"));
2071 case 3 :/*for Command Services..*/
2072 proto_tree_add_item(mid_tree
, hf_mih_command_actionid
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
2073 col_append_fstr(pinfo
->cinfo
, COL_INFO
, "\"%s\"", val_to_str_const(action
, command_act_id_values
, "Unknown"));
2075 case 4 :/*for Information Services..*/
2076 proto_tree_add_item(mid_tree
, hf_mih_info_actionid
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
2077 col_append_fstr(pinfo
->cinfo
, COL_INFO
, "\"%s\"", val_to_str_const(action
, info_act_id_values
, "Unknown"));
2084 /* displaying the transaction id*/
2085 proto_tree_add_item(mih_tree
, hf_mih_tid
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
2087 /*displaying the payload length...*/
2088 proto_tree_add_item(mih_tree
, hf_mih_pay_len
, tvb
, offset
+ 2, 2, ENC_BIG_ENDIAN
);
2091 payload_length
= tvb_get_ntohs(tvb
, offset
);
2094 /*now the type length values list is present get them and decode it...
2095 loop for showing all the tlvs....*/
2096 while(payload_length
> 0 && fragment
==0)
2098 /* Adding a third case here since the 802.21 standard defines 3 cases */
2100 /*case 1: If the number of octets occupied by the Value field is LESS THAN 128, the size of the Length field is always
2101 one octet and the MSB of the octet is set to the value 0. The values of the other seven bits of this octet
2102 indicate the actual length of the Value field.
2104 /*case 2: If the number of octets occupied by the Value field is EXACTLY 128, the size of the Length field is one octet.
2105 The MSB of the Length octet is set to the value '1' and the other seven bits of this octet are all set to the value '0'.
2107 /*case 3: If the number of octets occupied by the Value field is GREATER THAN 128, then the Length field is always greater
2108 than one octet. The MSB of the first octet of the Length field is set to the value 1 and the remaining seven
2109 bits of the first octet indicate the number of octets that are appended further. The number represented by the
2110 second and subsequent octets of the Length field, when added to 128, indicates the total size of the Value field, in octets.
2112 /*cases 2 and 3 can be logically programmed as the same condition since the whole octet is used to represent the len_of_len parameter. */
2114 /*code for testing if length is less than or equal to 128*/
2115 len
= tvb_get_uint8(tvb
, offset
+1);
2118 /*length is greater than 128 => len of len is greater than 1 byte*/
2119 /*Expanding conditions where the length values can be from 1- 8 octets long*/
2120 /*TODO: this assumes the maximum value length is 2^64. If larger data types are used, we have to implement our own tvb_get function*/
2121 len_of_len
= (uint8_t)len
- 128;
2122 switch (len_of_len
) /*depending on the detected length , we read a different amount of bytes from the tvb buffer*/
2125 len
= tvb_get_uint8(tvb
, offset
+2);
2128 len
= tvb_get_ntohs(tvb
, offset
+2);
2131 len
= tvb_get_ntoh24(tvb
, offset
+2);
2134 len
= tvb_get_ntohl(tvb
, offset
+2);
2137 len
= tvb_get_ntoh40(tvb
, offset
+2);
2140 len
= tvb_get_ntoh48(tvb
, offset
+2);
2143 len
= tvb_get_ntoh56(tvb
, offset
+2);
2146 len
= tvb_get_ntoh64(tvb
, offset
+2);
2155 /*TODO: TLVs greater than the payload_length are fragmented, and currently not parsed*/
2156 if(len
<= (uint64_t)payload_length
)
2159 tlv_tree
= proto_tree_add_subtree_format(mih_tree
, tvb
, offset
, 1 + len_of_len
+ (uint32_t)len
, ett_tlv
, NULL
,
2160 "MIH TLV : %s", val_to_str_const(tvb_get_uint8(tvb
, offset
), typevaluenames
, "UNKNOWN"));
2163 proto_tree_add_item(tlv_tree
, hf_mih_type
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
2164 type
= tvb_get_uint8(tvb
, offset
);
2169 proto_tree_add_item(tlv_tree
, hf_mih_type_length
, tvb
, offset
+1, len_of_len
, ENC_BIG_ENDIAN
);
2171 else if(len_of_len
>1 && len_of_len
<=5)
2173 proto_tree_add_item(tlv_tree
, hf_mih_type_length_ext
, tvb
, offset
+2, len_of_len
-1, ENC_BIG_ENDIAN
);
2177 offset
+= 1 + len_of_len
;
2179 /*For Value fields*/
2180 /*TODO: this assumes the maximum value length is 2^32. Dissecting bigger data fields would require breaking the data into chunks*/
2181 if(len
< (UINT64_C(1) << 32)){ /* XXX: always true ? see above */
2182 dissect_mih_tlv(tvb
, offset
, tlv_tree
, type
, (uint32_t)len
);
2183 offset
+= (uint32_t)len
;
2184 payload_length
-= (1 + len_of_len
+ (uint32_t)len
);
2191 proto_tree_add_item(mih_tree
, hf_fragmented_tlv
, tvb
, offset
, -1, ENC_NA
);
2196 proto_tree_add_item(mih_tree
, hf_fragmented_tlv
, tvb
, offset
, -1, ENC_NA
);
2198 return tvb_captured_length(tvb
);
2201 /*dissector initialisation*/
2202 void proto_register_mih(void)
2204 static hf_register_info hf
[] =
2245 "MIH Unauthenticated info request",
2257 "MIH more fragment",
2297 VALS(servicevalues
),
2315 &hf_mih_serv_actionid
,
2321 VALS(serv_act_id_values
),
2327 &hf_mih_event_actionid
,
2333 VALS(event_act_id_values
),
2339 &hf_mih_command_actionid
,
2345 VALS(command_act_id_values
),
2351 &hf_mih_info_actionid
,
2357 VALS(info_act_id_values
),
2393 VALS(typevaluenames
),
2399 &hf_mih_type_length
,
2411 &hf_mih_type_length_ext
,
2414 "mih.tlv_length_ext",
2483 &hf_ip_methods_supported
,
2485 "IP methods supported",
2486 "mih.ip_methods_supported",
2489 VALS(boolean_types
),
2495 &hf_ip_dhcp_services
,
2498 "mih.ip_dhcp_services",
2501 VALS(boolean_types
),
2513 VALS(boolean_types
),
2522 "mih.access_router",
2525 VALS(boolean_types
),
2537 VALS(link_type_vals
),
2543 &hf_link_subtype_eth
,
2545 "Ethernet - IEEE802.3 Subtype",
2546 "mih.link_subtype_eth",
2555 &hf_link_subtype_eth_10m
,
2558 "mih.link_subtype_eth.10mb",
2567 &hf_link_subtype_eth_100m
,
2570 "mih.link_subtype_eth.100mb",
2579 &hf_link_subtype_eth_1000m
,
2582 "mih.link_subtype_eth.1000mb",
2591 &hf_link_subtype_wireless_other
,
2593 "Wireless Other Subtype",
2594 "mih.link_subtype_wireless_other",
2603 &hf_link_subtype_wireless_other_dvb
,
2606 "mih.link_subtype_wireless_other.dvb",
2615 &hf_link_subtype_wireless_other_tdmb
,
2618 "mih.link_subtype_wireless_other.tdmb",
2627 &hf_link_subtype_wireless_other_atsc
,
2630 "mih.link_subtype_wireless_other.atsc",
2639 &hf_link_subtype_ieee80211
,
2641 "Wireless - IEEE 802.11 Subtype",
2642 "mih.link_subtype_ieee80211",
2651 &hf_link_subtype_ieee80211_24
,
2654 "mih.link_subtype_ieee80211.2_4ghz",
2663 &hf_link_subtype_ieee80211_5
,
2666 "mih.link_subtype_ieee80211.5ghz",
2675 &hf_link_subtype_ieee80211_49
,
2678 "mih.link_subtype_ieee80211.4_9ghz",
2687 &hf_link_subtype_ieee80211_365
,
2690 "mih.link_subtype_ieee80211.3_65ghz",
2699 &hf_link_subtype_ieee80211_316
,
2702 "mih.link_subtype_ieee80211.316thz",
2711 &hf_link_subtype_umts
,
2713 "Wireless - UMTS Subtype",
2714 "mih.link_subtype_umts",
2723 &hf_link_subtype_umts_99
,
2726 "mih.link_subtype_umts.rel99",
2735 &hf_link_subtype_umts_4
,
2738 "mih.link_subtype_umts.rel4",
2747 &hf_link_subtype_umts_5
,
2750 "mih.link_subtype_umts.rel5",
2759 &hf_link_subtype_umts_6
,
2762 "mih.link_subtype_umts.rel6",
2771 &hf_link_subtype_umts_7
,
2773 "Rel-7 (MIMO/OFDM)",
2774 "mih.link_subtype_umts.rel7",
2783 &hf_link_subtype_umts_8
,
2786 "mih.link_subtype_umts.rel8",
2795 &hf_link_subtype_cdma2000
,
2797 "Wireless - cdma2000-HRPD",
2798 "mih.link_subtype_cdma2000",
2807 &hf_link_subtype_cdma2000_0
,
2810 "mih.link_subtype_cdma2000.rev0",
2819 &hf_link_subtype_cdma2000_a
,
2822 "mih.link_subtype_cdma2000.reva",
2831 &hf_link_subtype_cdma2000_b
,
2834 "mih.link_subtype_cdma2000.revb",
2843 &hf_link_subtype_cdma2000_c
,
2846 "mih.link_subtype_cdma2000.revc",
2855 &hf_link_subtype_ieee80216
,
2857 "Wireless - IEEE 802.16",
2858 "mih.link_subtype_ieee80216",
2867 &hf_link_subtype_ieee80216_25
,
2870 "mih.link_subtype_ieee80216.2_5ghz",
2879 &hf_link_subtype_ieee80216_35
,
2882 "mih.link_subtype_ieee80216.3_5ghz",
2894 "mih.link_type_ext",
2930 "mih.link_dn_reason",
2933 VALS(link_dn_reason_vals
),
2939 &hf_link_gdn_reason
,
2941 "LINK Going Down Reason",
2942 "mih.link_gdn_reason",
2945 VALS(link_gdn_reason_vals
),
2966 "mih.link_param_gen",
2969 VALS(link_param_gen_vals
),
2978 "mih.link_param_qos",
2981 VALS(link_param_qos_vals
),
2990 "mih.link_param_gg",
2993 VALS(link_param_gg_vals
),
2999 &hf_link_param_edge
,
3002 "mih.link_param_edge",
3014 "mih.link_param_eth",
3023 &hf_link_param_802_11
,
3026 "mih.link_param_802_11",
3029 VALS(link_param_802_11_vals
),
3038 "mih.link_param_c2k",
3041 VALS(link_param_c2k_hrpd_vals
),
3050 "mih.link_param_fdd",
3053 VALS(link_param_fdd_vals
),
3059 &hf_link_param_hrpd
,
3062 "mih.link_param_hrpd",
3065 VALS(link_param_c2k_hrpd_vals
),
3071 &hf_link_param_802_16
,
3074 "mih.link_param_802_16",
3083 &hf_link_param_802_20
,
3086 "mih.link_param_802_20",
3095 &hf_link_param_802_22
,
3098 "mih.link_param_802_22",
3107 &hf_link_param_value
,
3110 "mih.link_param_value",
3137 VALS(link_ac_type_vals
),
3143 &hf_link_ac_ext_time
,
3146 "mih.link_ac_ext_time",
3158 "mih.link_ac_result",
3161 VALS(link_ac_result_vals
),
3173 VALS(link_dn_reason_vals
),
3185 VALS(ho_status_vals
),
3197 VALS(mbb_ho_supp_vals
),
3203 &hf_reg_request_code
,
3205 "REGISTER REQUEST CODE",
3206 "mih.reg_request_code",
3209 VALS(reg_request_code_vals
),
3221 VALS(ip_renewal_vals
),
3227 &hf_dev_states_resp
,
3229 "SUPPORTED TRANSPORTS",
3230 "mih.dev_states_resp",
3233 VALS(dev_states_req_vals
),
3242 "mih.dev_states_resp.batt_level",
3254 "mih.dev_states_resp.dev_info",
3265 "Maximum Response Size",
3266 "mih.max_resp_size",
3278 "mih.time_interval",
3287 &hf_valid_time_interval
,
3289 "Valid Time Interval",
3290 "mih.valid_time_interval",
3313 "Link Address Type",
3314 "mih.link_addr_type",
3317 VALS(link_addr_types
),
3323 &hf_link_transport_addr_type
,
3325 "Link Transport Address Type",
3326 "mih.link_transport_addr_type",
3335 &hf_link_addr_string
,
3337 "Link Address String",
3338 "mih.link_addr_string",
3373 "Public Land Mobile Network (PLMN) ID",
3383 &hf_location_area_id
,
3385 "Location Area Code (LAC)",
3398 "mih.threshold_val",
3407 &hf_threshold_x_dir
,
3409 "Threshold Direction",
3410 "mih.threshold_x_dir",
3413 VALS(threshold_x_dir_vals
),
3419 &hf_threshold_action
,
3422 "mih.threshold_action",
3425 VALS(threshold_action_vals
),
3434 "mih.config_status",
3437 VALS(boolean_types
),
3445 "Number of differentiable classes",
3457 "Number of transmit queues supported",
3481 "Pre-defined Configuration Identifier",
3482 "mih.predef_cfg_id",
3505 "Auxiliary Network ID",
3515 &hf_sig_strength_dbm
,
3517 "Signal Strength (dBm)",
3527 &hf_sig_strength_per
,
3529 "Signal Strength (%)",
3541 "Class of Service ID",
3553 "Class of Service Value",
3577 "Link Data Rate (kb/s)",
3578 "mih.link_data_rate",
3602 "mih.rdf_mime_type",
3611 &hf_link_res_status
,
3617 VALS(boolean_types
),
3623 &hf_res_retention_status
,
3625 "Info query RDF schema URL",
3626 "mih.res_retention_status",
3629 VALS(boolean_types
),
3637 "Query resource report flag",
3641 VALS(boolean_types
),
3647 &hf_unauth_info_req
,
3649 "Unauthenticated information request",
3650 "mih.unauth_info_req",
3653 VALS(boolean_types
),
3707 &hf_vendor_specific_tlv
,
3709 "Vendor Specific TLV",
3710 "mih.vendor_specific_tlv",
3731 &hf_experimental_tlv
,
3734 "mih.experimental_tlv",
3758 "mih.fragmented_tlv",
3767 /*event related hf fields*/
3781 &hf_event_link_detect
,
3783 "MIH LINK Detected",
3784 "mih.event_list.link_detect",
3796 "mih.event_list.link_up",
3808 "mih.event_list.link_down",
3817 &hf_event_link_param
,
3819 "MIH LINK Parameters Report",
3820 "mih.event_list.link_param_rpt",
3831 "MIH LINK Going Down",
3832 "mih.event_list.link_gd",
3843 "Link Handover Imminent",
3844 "mih.event_list.link_ho_imm",
3855 "MIH LINK Handover Complete",
3856 "mih.event_list.link_ho_comp",
3865 &hf_event_pdu_tx_stat
,
3867 "MIH LINK PDU Transmit Status",
3868 "mih.event_list.link_pdu_tx_stat",
3877 /* cmd related hf fields */
3894 "MIH LINK Event Subscribe",
3895 "mih.cmd_list.evt_subs",
3904 &hf_cmd_event_unsub
,
3906 "Link Event Unsubscribe",
3907 "mih.cmd_list.evt_unsubs",
3911 CMD_EVT_UNSUBS_MASK
,
3918 "MIH LINK Get Parameters",
3919 "mih.cmd_list.evt_get_param",
3930 "Link Configure Thresholds",
3931 "mih.cmd_list.evt_conf_th",
3940 &hf_cmd_link_action
,
3943 "mih.cmd_list.evt_link_action",
3952 /*header fields for iq type list*/
3956 "List of of IS query types",
3969 "mih.iq_type_list.bin_data",
3981 "mih.iq_type_list.rdf_data",
3993 "mih.iq_type_list.rdf_sch_u",
4005 "mih.iq_type_list.rdf_sch",
4017 "mih.iq_type_list.ie_net_type",
4021 IQ_IE_NET_TYPE_MASK
,
4029 "mih.iq_type_list.ie_op_id",
4040 "IE_SERVICE_PROVIDER_ID",
4041 "mih.iq_type_list.ie_serv_id",
4050 &hf_iq_country_code
,
4053 "mih.iq_type_list.ie_country_code",
4065 "mih.iq_type_list.ie_net_id",
4076 "IE_NETWORK_AUX_ID",
4077 "mih.iq_type_list.net_aux_id",
4088 "IE_ROAMING_PARTNERS",
4089 "mih.iq_type_list.ie_roam_part",
4101 "mih.iq_type_list.ie_cost",
4113 "mih.iq_type_list.ie_net_qos",
4124 "IE_NETWORK_DATA_RATE",
4125 "mih.iq_type_list.ie_net_dat_rt",
4136 "IE_NET_REGULT_DOMAIN",
4137 "mih.iq_type_list.ie_net_reg_dom",
4148 "IE_NET_FREQUENCY_BANDS",
4149 "mih.iq_type_list.ie_net_freq",
4158 &hf_iq_ip_cfg_mthds
,
4160 "IE_NET_IP_CFG_METHODS",
4161 "mih.iq_type_list.ie_net_ip_cfg",
4172 "IE_NET_CAPABILITIES",
4173 "mih.iq_type_list.ie_net_cap",
4184 "IE_NET_SUPPORTED_LCP",
4185 "mih.iq_type_list.ie_net_sup_lcp",
4196 "IE_NET_MOB_MGMT_PROT",
4197 "mih.iq_type_list.ie_net_mob_mg",
4208 "IE_NET_EMSERV_PROXY",
4209 "mih.iq_type_list.ie_net_emer_serv",
4218 &hf_iq_net_ims_pcscf
,
4220 "IE_NET_IMS_PROXY_CSCF",
4221 "mih.iq_type_list.ie_net_ims_pcscf",
4232 "IE_NET_MOBILE_NETWORK",
4233 "mih.iq_type_list.ie_net_mob_net",
4245 "mih.iq_type_list.ie_poa_link",
4249 IQ_IE_POA_ADDR_MASK
,
4257 "mih.iq_type_list.ie_poa_loc",
4266 &hf_iq_poa_chan_range
,
4268 "IE_POA_CHANNEL_RANGE",
4269 "mih.iq_type_list.ie_poa_chan_rg",
4273 IQ_IE_POA_CHAN_MASK
,
4278 &hf_iq_poa_sys_info
,
4280 "IE_POA_SYSTEM_INFO",
4281 "mih.iq_type_list.ie_poa_syst_info",
4290 &hf_iq_poa_sub_info
,
4292 "IE_POA_SUBNET_INFO",
4293 "mih.iq_type_list.ie_poa_sub_info",
4305 "mih.iq_type_list.ie_poa_ip",
4314 /*header fields for mob mgmt*/
4318 "List of supported mobility management protocols",
4331 "mih.mob_list.mip4",
4342 "Mobile IPv4 Regional Registration",
4343 "mih.mob_list.mip4_reg",
4355 "mih.mob_list.mip6",
4366 "Hierarchical Mobile IPv6",
4367 "mih.mob_list.hmip6",
4378 "Low Latency Handoffs",
4379 "mih.mob_list.low_lat",
4390 "Mobile IPv6 Fast Handovers",
4391 "mih.mob_list.fmip6",
4402 "IKEv2 Mobility and Multihoming Protocol",
4403 "mih.mob_list.ike_multi",
4412 /*header fields for configure methods*/
4416 "A set of IP configuration methods",
4428 "IPv4 static configuration",
4429 "mih.ip_cfg_mthds.static",
4441 "mih.ip_cfg_mthds.dhcp4",
4452 "Mobile IPv4 with foreign agent",
4453 "mih.ip_cfg_mthds.mip4_fa",
4457 IP_CFG_MIP4_FA_MASK
,
4464 "Mobile IPv4 without FA",
4465 "mih.ip_cfg_mthds.mip4_wo_fa",
4469 IP_CFG_MIP4_NFA_MASK
,
4476 "IPv6 stateless address configuration",
4477 "mih.ip_cfg_mthds.ip6_state_less",
4489 "mih.ip_cfg_mthds.dhcp6",
4500 "IPv6 manual configuration",
4501 "mih.ip_cfg_mthds.ip6_manual",
4505 IP_CFG_IP6_MAN_MASK
,
4510 /*header fields for transport lists*/
4514 "Supported Transports",
4527 "mih.trans_list.udp",
4539 "mih.trans_list.tcp",
4548 /*header fields for device state request*/
4552 "Device Status Request",
4553 "mih.dev_states_req",
4562 &hf_dev_states_req_dev_info
,
4565 "mih.dev_states_req.dev_info",
4574 &hf_dev_states_req_batt_lvl
,
4577 "mih.dev_states_req.batt_level",
4586 /*header fields for MIH Capabilities*/
4590 "Supported MIH Capability",
4602 "Event Service (ES)",
4603 "mih.mihcap.event_service",
4614 "Command Service (CS)",
4615 "mih.mihcap.command_service",
4626 "Information Service (IS)",
4627 "mih.mihcap.information_service",
4636 /*header fields for High Level Network Capabilities*/
4640 "High Level Network Capability",
4665 "mih.net_caps.qos0",
4677 "mih.net_caps.qos1",
4689 "mih.net_caps.qos2",
4701 "mih.net_caps.qos3",
4713 "mih.net_caps.qos4",
4725 "mih.net_caps.qos5",
4737 "mih.net_caps.internet_access",
4748 "Emergency Services",
4749 "mih.net_caps.emergency_services",
4758 &hf_net_caps_mihcap
,
4761 "mih.net_caps.mihcap",
4770 /*header fields for Link Action attributes*/
4774 "Link Action Attribute",
4784 &hf_link_ac_attr_link_scan
,
4787 "mih.link_ac_attr.link_scan",
4796 &hf_link_ac_attr_link_res_retain
,
4798 "Link Resource Retain",
4799 "mih.link_ac_attr.link_res_retain",
4808 &hf_link_ac_attr_data_fwd_req
,
4810 "Forward Data Request",
4811 "mih.link_ac_attr.data_fwd_req",
4821 /* Setup protocol subtree array */
4830 &ett_mob_mgt_bitmap
,
4831 &ett_cfg_mtd_bitmap
,
4832 &ett_iq_type_bitmap
,
4833 &ett_trans_list_bitmap
,
4834 &ett_dev_states_bitmap
,
4836 &ett_net_caps_bitmap
,
4837 &ett_ac_attr_bitmap
,
4838 &ett_subtype_eth_bitmap
,
4839 &ett_subtype_wireless_other_bitmap
,
4840 &ett_subtype_ieee80211_bitmap
,
4841 &ett_subtype_umts_bitmap
,
4842 &ett_subtype_cdma2000_bitmap
,
4843 &ett_subtype_ieee80216_bitmap
,
4844 &ett_min_pk_tx_delay
,
4845 &ett_avg_pk_tx_delay
,
4846 &ett_max_pk_tx_delay
,
4847 &ett_pk_delay_jitter
,
4849 &ett_list_prefer_link
,
4850 &ett_ip_dhcp_server
,
4853 &ett_link_states_req
,
4855 &ett_dev_states_resp
4858 proto_mih
= proto_register_protocol("Media-Independent Handover", "MIH", "mih");
4859 proto_register_field_array(proto_mih
, hf
, array_length(hf
));
4860 proto_register_subtree_array(ett
, array_length(ett
));
4862 mih_handle
= register_dissector("mih", dissect_mih
, proto_mih
);
4866 /*dissector handoff*/
4867 void proto_reg_handoff_mih(void)
4870 dissector_add_uint_with_preference("udp.port", MIH_PORT
, mih_handle
);
4871 dissector_add_uint_with_preference("tcp.port", MIH_PORT
, mih_handle
);
4874 dissector_add_uint("ethertype", ETHERTYPE_MIH
, mih_handle
);
4879 * Editor modelines - https://www.wireshark.org/tools/modelines.html
4884 * indent-tabs-mode: nil
4887 * vi: set shiftwidth=8 tabstop=8 expandtab:
4888 * :indentSize=8:tabSize=8:noTabs=true: