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>
14 * Wireshark - Network traffic analyzer
15 * By Gerald Combs <gerald@wireshark.org>
16 * Copyright 1998 Gerald Combs
18 * This program is free software; you can redistribute it and/or
19 * modify it under the terms of the GNU General Public License
20 * as published by the Free Software Foundation; either version 2
21 * of the License, or (at your option) any later version.
23 * This program is distributed in the hope that it will be useful,
24 * but WITHOUT ANY WARRANTY; without even the implied warranty of
25 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
26 * GNU General Public License for more details.
28 * You should have received a copy of the GNU General Public License
29 * along with this program; if not, write to the Free Software
30 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
37 #include <epan/packet.h>
38 #include <epan/exceptions.h>
39 #include <epan/prefs.h>
40 #include <epan/reassemble.h>
41 #include <epan/proto.h>
42 #include <epan/etypes.h>
48 #define VERSION_MASK 0xF0
49 #define ACKREQ_MASK 0x8
50 #define ACKRESP_MASK 0x4
52 #define MORE_FRAG_MASK 0x1
53 #define FRAG_NO_MASK 0xFE
54 #define SID_MASK 0xF000
55 #define OPCODE_MASK 0xC00
56 #define AID_MASK 0x3FF
57 #define TRANS_ID_MASK 0x0FFF
58 #define LEN_OF_LEN_MASK 0x80
60 /*Type values for TLV encoding*/
62 #define DEST_MIHF_ID 2
65 #define MIH_EVT_LIST 5
66 #define MIH_CMD_LIST 6
67 #define MIH_IQ_TYPE_LIST 7
68 #define MIH_TRANS_LIST 8
69 #define LINK_ADDR_LIST 9
70 #define MBB_HO_SUPP_LIST 10
71 #define REG_REQUEST_CODE 11
72 #define VALID_TIME_INTR 12
74 #define NEW_LINK_ID 14
75 #define OLD_ACCESS_ROUTER 15
76 #define NEW_ACCESS_ROUTER 16
77 #define IP_RENEWAL_FLAG 17
78 #define IP_MOB_MGMT 18
79 #define IP_CFG_MTHDS 19
80 #define LINK_DN_REASON 20
81 #define TIMER_INTERVAL 21
82 #define LINK_GOING_DN_REASON 22
83 #define LINK_PARAM_RPT_LIST 23
84 #define DEV_STATES_REQ 24
85 #define LINK_ID_LIST 25
86 #define DEV_STATES_RSP_LIST 26
87 #define STATUS_REQ_SET 27
88 #define STATUS_RSP_LIST 28
89 #define CFG_REQ_LIST 29
90 #define CFG_RSP_LIST 30
91 #define LINK_POA_LIST 31
92 #define PREF_LINK_LIST 32
93 #define HO_REQ_QUERY_LIST 33
95 #define ACCESS_ROUTER_ADDR 35
96 #define DHCP_SER_ADDR 36
98 #define LINK_ACTION_REQ_LIST 38
99 #define LINK_ACTION_RSP_LIST 39
101 #define LINK_RES_STATUS 41
102 #define RES_RETENTION_STATUS 42
103 #define IQ_BIN_DATA_LIST 43
104 #define IQ_RDF_DATA_LIST 44
105 #define IQ_RDF_SCHEMA_URL 45
106 #define IQ_RDF_SCHM_LIST 46
107 #define MAX_RSP_SIZE 47
108 #define IR_BIN_DATA_LIST 48
109 #define IR_RDF_DATA_LIST 49
110 #define IR_SCHM_URL_LIST 50
111 #define IR_RDF_SCHM_LIST 51
112 #define MN_MIHF_ID 52
113 #define Q_RES_RPT_FLAG 53
114 #define EVT_CFG_INFO_LIST 54
115 #define TGT_NET_INFO 55
116 #define TGT_NET_INFO_LIST 56
117 #define ASGN_RES_SET 57
118 #define LINK_DET_INFO_LIST 58
119 #define MN_LINK_ID 59
120 #define POA_LINK_ADDR 60
121 #define UNAUTH_INFO_REQ 61
123 #define REQ_RES_SET 63
124 #define VEND_SPECIFIC_TLV 100
126 /*Bitmasks in 802.21 are encoded in Network-Byte-Order: bit0 is leftmost bit*/
128 /*MASK for event list*/
129 #define LINK_DETECT_MASK 0x80000000
130 #define LINK_UP_MASK 0x40000000
131 #define LINK_DOWN_MASK 0x20000000
132 #define LINK_PARAM_MASK 0x10000000
133 #define LINK_GD_MASK 0x08000000
134 #define LINK_HO_IMM_MASK 0x04000000
135 #define LINK_HO_COMP_MASK 0x02000000
136 #define LINK_PDU_MASK 0x01000000
138 /*MASK for command list*/
139 /*1st bit is reserved*/
140 #define CMD_EVT_SUBS_MASK 0x40000000
141 #define CMD_EVT_UNSUBS_MASK 0x20000000
142 #define CMD_GET_PARA_MASK 0x10000000
143 #define CMD_CONF_TH_MASK 0x08000000
144 #define CMD_LINK_AC_MASK 0x04000000
146 /*MASK for Info Query list*/
147 #define IQ_BIN_DATA_MASK 0x80000000
148 #define IQ_RDF_DATA_MASK 0x40000000
149 #define IQ_RDF_SCH_U_MASK 0x20000000
150 #define IQ_RDF_SCH_MASK 0x10000000
151 #define IQ_IE_NET_TYPE_MASK 0x08000000
152 #define IQ_IE_OP_ID_MASK 0x04000000
153 #define IQ_SERV_ID_MASK 0x02000000
154 #define IQ_IE_COUN_MASK 0x01000000
155 #define IQ_NET_ID_MASK 0x00800000
156 #define IQ_NET_AUX_MASK 0x00400000
157 #define IQ_IE_ROAM_MASK 0x00200000
158 #define IQ_IE_COST_MASK 0x00100000
159 #define IQ_IE_QOS_MASK 0x00080000
160 #define IQ_IE_DATA_MASK 0x00040000
161 #define IQ_IE_REGDOM_MASK 0x00020000
162 #define IQ_IE_FREQ_MASK 0x00010000
163 #define IQ_IE_IP_CFG_MASK 0x00008000
164 #define IQ_IE_CAP_MASK 0x00004000
165 #define IQ_IE_SUP_MASK 0x00002000
166 #define IQ_IE_MOB_MG_MASK 0x00001000
167 #define IQ_IE_EM_SERV_MASK 0x00000800
168 #define IQ_IE_IMS_MASK 0x00000400
169 #define IQ_IE_MOB_NET_MASK 0x00000200
170 #define IQ_IE_POA_ADDR_MASK 0x00000100
171 #define IQ_IE_POA_LOC_MASK 0x00000080
172 #define IQ_IE_POA_CHAN_MASK 0x00000040
173 #define IQ_IE_POA_SYS_MASK 0x00000020
174 #define IQ_IE_POA_SUB_MASK 0x00000010
175 #define IQ_IE_POA_IP_MASK 0x00000008
177 /*MASK for mobility Management methods*/
178 #define MOB_MIP4_MASK 0x8000
179 #define MOB_MIP4_REG_MASK 0x4000
180 #define MOB_MIP6_MASK 0x2000
181 #define MOB_HMIP6_MASK 0x1000
182 #define MOB_LOW_LAT_MASK 0x0800
183 #define MOB_FMIP6_MASK 0x0400
184 #define MOB_IKE_MULTI_MASK 0x0200
186 /*MASK for ip configuration methods*/
187 #define IP_CFG_STAT_MASK 0x80000000
188 #define IP_CFG_DHCP4_MASK 0x40000000
189 #define IP_CFG_MIP4_FA_MASK 0x20000000
190 #define IP_CFG_MIP4_NFA_MASK 0x10000000
191 /*bits 4-10 reserved for IPv4 address configuration*/
192 #define IP_CFG_IP6_SL_MASK 0x00100000
193 #define IP_CFG_DHCP6_MASK 0x00080000
194 #define IP_CFG_IP6_MAN_MASK 0x00040000
196 /*information holder integers...*/
197 static int proto_mih
= -1;
198 static int hf_mih_version
= -1;
199 static int hf_mih_ack_req
= -1;
200 static int hf_mih_ack_resp
= -1;
201 static int hf_mih_uir
= -1;
202 static int hf_mih_more_frag
= -1;
203 static int hf_mih_frag_no
= -1;
204 static int hf_mih_mid
= -1;
205 static int hf_mih_service_id
= -1;
206 static int hf_mih_opcode
= -1;
207 static int hf_mih_serv_actionid
= -1;
208 static int hf_mih_event_actionid
= -1;
209 static int hf_mih_command_actionid
= -1;
210 static int hf_mih_info_actionid
= -1;
211 static int hf_mih_tid
= -1;
212 static int hf_mih_pay_len
= -1;
213 static int hf_mih_type
= -1;
214 static int hf_mih_type_length
= -1;
215 static int hf_mih_type_length_ext
= -1;
216 static int hf_mihf_id
= -1;
217 static int hf_mihf_id_mac
= -1;
218 static int hf_mihf_id_ipv4
= -1;
219 static int hf_mihf_id_ipv6
= -1;
220 static int hf_status
= -1;
221 static int hf_boolean
= -1;
222 static int hf_link_type
= -1;
223 static int hf_link_type_ext
= -1;
224 static int hf_ipv4_addr
= -1;
225 static int hf_ipv6_addr
= -1;
226 static int hf_link_dn_reason
= -1;
227 static int hf_link_gdn_reason
= -1;
228 static int hf_mac_addr
= -1;
229 static int hf_link_param_gen
= -1;
230 static int hf_link_param_qos
= -1;
231 static int hf_link_param_gg
= -1;
232 static int hf_link_param_802_11
= -1;
233 static int hf_link_param_fdd
= -1 ;
234 static int hf_link_param_edge
= -1;
235 static int hf_link_param_eth
= -1;
236 static int hf_link_param_c2k
= -1;
237 static int hf_link_param_hrpd
= -1;
238 static int hf_link_param_802_16
= -1;
239 static int hf_link_param_802_20
= -1;
240 static int hf_link_param_802_22
= -1;
241 static int hf_link_param_value
= -1;
242 static int hf_op_mode
= -1;
243 static int hf_link_ac_type
= -1;
244 static int hf_link_ac_ext_time
= -1;
245 static int hf_link_ac_result
= -1;
246 static int hf_ho_reason
= -1;
247 static int hf_ho_status
= -1;
248 static int hf_reg_request_code
= -1;
249 static int hf_ip_renewal
= -1;
250 static int hf_max_resp_size
= -1;
251 static int hf_time_interval
= -1;
252 static int hf_valid_time_interval
= -1;
253 static int hf_tsp_carrier
= -1;
254 static int hf_mbb_ho_supp
= -1;
255 static int hf_link_addr_type
= -1;
256 static int hf_link_transport_addr_type
= -1;
257 static int hf_link_addr_string
= -1;
258 static int hf_link_data_rate
= -1;
259 static int hf_plmn_id
= -1;
260 static int hf_location_area_id
= -1;
261 static int hf_cell_id
= -1;
262 static int hf_ci
= -1;
263 static int hf_threshold_val
= -1;
264 static int hf_threshold_x_dir
= -1;
265 static int hf_threshold_action
= -1;
266 static int hf_config_status
= -1;
267 static int hf_num_cos
= -1;
268 static int hf_num_queue
= -1;
269 static int hf_channel_id
= -1;
270 static int hf_predef_cfg_id
= -1;
271 static int hf_network_id
= -1;
272 static int hf_net_aux_id
= -1;
273 static int hf_sig_strength_dbm
= -1;
274 static int hf_sig_strength_per
= -1;
275 static int hf_cos_id
= -1;
276 static int hf_cos_value
= -1;
277 static int hf_sinr
= -1;
278 static int hf_rdf_data
= -1;
279 static int hf_rdf_mime_type
= -1;
280 static int hf_link_res_status
= -1;
281 static int hf_res_retention_status
= -1;
282 static int hf_res_rpt_flag
= -1;
283 static int hf_unauth_info_req
= -1;
284 static int hf_rdf_sch
= -1;
285 static int hf_rdf_sch_url
= -1;
286 static int hf_ir_bin_data
= -1;
287 static int hf_iq_bin_data_x
= -1;
289 /*header fields for event list */
290 static int hf_event_list
= -1;
291 static int hf_event_link_detect
= -1;
292 static int hf_event_link_up
= -1;
293 static int hf_event_link_dn
= -1;
294 static int hf_event_link_param
= -1;
295 static int hf_event_link_gd
= -1;
296 static int hf_event_ho_imm
= -1;
297 static int hf_event_ho_comp
= -1;
298 static int hf_event_pdu_tx_stat
= -1;
300 /*header fields for command list*/
301 static int hf_cmd_list
= -1;
302 static int hf_cmd_event_subs
= -1;
303 static int hf_cmd_event_unsub
= -1;
304 static int hf_cmd_get_param
= -1;
305 static int hf_cmd_con_thres
= -1;
306 static int hf_cmd_link_action
= -1;
308 /*header fields for iq type list*/
309 static int hf_iq_list
= -1;
310 static int hf_iq_bin_data
= -1;
311 static int hf_iq_rdf_data
= -1;
312 static int hf_iq_rdf_sch_url
= -1;
313 static int hf_iq_rdf_sch
= -1;
314 static int hf_iq_net_type
= -1;
315 static int hf_iq_op_id
= -1;
316 static int hf_iq_serv_pro_id
= -1;
317 static int hf_iq_country_code
= -1;
318 static int hf_iq_net_id
= -1;
319 static int hf_iq_net_aux_id
= -1;
320 static int hf_iq_roam_part
= -1;
321 static int hf_iq_cost
= -1;
322 static int hf_iq_net_qos
= -1;
323 static int hf_iq_net_dat_rt
= -1;
324 static int hf_iq_net_reg_dom
= -1;
325 static int hf_iq_freq_bands
= -1;
326 static int hf_iq_ip_cfg_mthds
= -1;
327 static int hf_iq_net_cap
= -1;
328 static int hf_iq_supp_lcp
= -1;
329 static int hf_iq_net_mob_mg
= -1;
330 static int hf_iq_net_emserv
= -1;
331 static int hf_iq_net_ims_pcscf
= -1;
332 static int hf_iq_net_mob_net
= -1;
333 static int hf_iq_link_addr
= -1;
334 static int hf_iq_poa_loc
= -1;
335 static int hf_iq_poa_chan_range
= -1;
336 static int hf_iq_poa_sys_info
= -1;
337 static int hf_iq_poa_sub_info
= -1;
338 static int hf_iq_poa_ip
= -1;
340 /*header fields for mob mgmt*/
341 static int hf_mob_list
= -1;
342 static int hf_mob_mip4
= -1;
343 static int hf_mob_mip4_reg
= -1;
344 static int hf_mob_mip6
= -1;
345 static int hf_mob_hmip6
= -1;
346 static int hf_mob_low_lat
= -1;
347 static int hf_mob_fmip6
= -1;
348 static int hf_mob_ike_multi
= -1;
350 /*header fields for configure methods*/
351 static int hf_cfg_mthds
= -1;
352 static int hf_cfg_ip4_stat
= -1;
353 static int hf_cfg_dhcp4
= -1;
354 static int hf_cfg_mip_fa
= -1;
355 static int hf_cfg_mip_wo_fa
= -1;
356 static int hf_cfg_ip6_sac
= -1;
357 static int hf_cfg_dhcp6
= -1;
358 static int hf_cfg_ip6_manual
= -1;
360 /*header fields for transport list*/
361 static int hf_trans_list
= -1;
362 static int hf_trans_udp
= -1;
363 static int hf_trans_tcp
= -1;
365 /*header fields for device state requests and responses*/
366 static int hf_dev_states_req
= -1;
367 static int hf_dev_states_req_dev_info
= -1;
368 static int hf_dev_states_req_batt_lvl
= -1;
369 static int hf_dev_states_resp
= -1;
370 static int hf_dev_batt_level
= -1;
371 static int hf_dev_info
= -1;
373 /*header fields for Link Action Attributes*/
374 static int hf_link_ac_attr
= -1;
375 static int hf_link_ac_attr_link_scan
= -1;
376 static int hf_link_ac_attr_link_res_retain
= -1;
377 static int hf_link_ac_attr_data_fwd_req
= -1;
379 /*header fields for transport subtypes*/
380 static int hf_link_subtype_eth
= -1;
381 static int hf_link_subtype_eth_10m
= -1;
382 static int hf_link_subtype_eth_100m
= -1;
383 static int hf_link_subtype_eth_1000m
= -1;
384 static int hf_link_subtype_wireless_other
= -1;
385 static int hf_link_subtype_wireless_other_dvb
= -1;
386 static int hf_link_subtype_wireless_other_tdmb
= -1;
387 static int hf_link_subtype_wireless_other_atsc
= -1;
388 static int hf_link_subtype_ieee80211
= -1;
389 static int hf_link_subtype_ieee80211_24
= -1;
390 static int hf_link_subtype_ieee80211_5
= -1;
391 static int hf_link_subtype_ieee80211_49
= -1;
392 static int hf_link_subtype_ieee80211_365
= -1;
393 static int hf_link_subtype_ieee80211_316
= -1;
394 static int hf_link_subtype_umts
= -1;
395 static int hf_link_subtype_umts_99
= -1;
396 static int hf_link_subtype_umts_4
= -1;
397 static int hf_link_subtype_umts_5
= -1;
398 static int hf_link_subtype_umts_6
= -1;
399 static int hf_link_subtype_umts_7
= -1;
400 static int hf_link_subtype_umts_8
= -1;
401 static int hf_link_subtype_cdma2000
= -1;
402 static int hf_link_subtype_cdma2000_0
= -1;
403 static int hf_link_subtype_cdma2000_a
= -1;
404 static int hf_link_subtype_cdma2000_b
= -1;
405 static int hf_link_subtype_cdma2000_c
= -1;
406 static int hf_link_subtype_ieee80216
= -1;
407 static int hf_link_subtype_ieee80216_25
= -1;
408 static int hf_link_subtype_ieee80216_35
= -1;
410 /*header fields for MIH Capabilities*/
411 static int hf_mihcap
= -1;
412 static int hf_mihcap_es
= -1;
413 static int hf_mihcap_cs
= -1;
414 static int hf_mihcap_is
= -1;
416 /*header fields for High Level Network Capabilities*/
417 static int hf_net_caps
= -1;
418 static int hf_net_caps_sec
= -1;
419 static int hf_net_caps_qos0
= -1;
420 static int hf_net_caps_qos1
= -1;
421 static int hf_net_caps_qos2
= -1;
422 static int hf_net_caps_qos3
= -1;
423 static int hf_net_caps_qos4
= -1;
424 static int hf_net_caps_qos5
= -1;
425 static int hf_net_caps_ia
= -1;
426 static int hf_net_caps_es
= -1;
427 static int hf_net_caps_mihcap
= -1;
429 /*trees and subtrees...*/
430 static gint ett_mih
= -1;
431 static gint ett_ver_flags
= -1;
432 static gint ett_mid
= -1;
433 static gint ett_tlv
= -1;
434 static gint ett_cmd_bitmap
= -1;
435 static gint ett_event_bitmap
= -1;
436 static gint ett_mob_mgt_bitmap
= -1;
437 static gint ett_cfg_mtd_bitmap
= -1;
438 static gint ett_iq_type_bitmap
= -1;
439 static gint ett_trans_list_bitmap
= -1;
440 static gint ett_dev_states_bitmap
= -1;
441 static gint ett_mihcap_bitmap
= -1;
442 static gint ett_net_caps_bitmap
= -1;
443 static gint ett_ac_attr_bitmap
= -1;
444 static gint ett_subtype_eth_bitmap
= -1;
445 static gint ett_subtype_wireless_other_bitmap
= -1;
446 static gint ett_subtype_ieee80211_bitmap
= -1;
447 static gint ett_subtype_umts_bitmap
= -1;
448 static gint ett_subtype_cdma2000_bitmap
= -1;
449 static gint ett_subtype_ieee80216_bitmap
= -1;
451 /*field definitions of evt, cmd, mob mgmt, ip cfg, iq type */
452 static const int *event_fields
[] = {
453 &hf_event_link_detect
,
456 &hf_event_link_param
,
460 &hf_event_pdu_tx_stat
,
464 static const int *cmd_fields
[] = {
473 static const int *iq_type_fields
[] = {
495 &hf_iq_net_ims_pcscf
,
499 &hf_iq_poa_chan_range
,
506 static const int *mob_fields
[] = {
517 static const int *cfg_fields
[] = {
528 /*field definitions for various bitmaps */
529 static const int *trans_fields
[] = {
535 static const int *dev_states_fields
[] = {
536 &hf_dev_states_req_dev_info
,
537 &hf_dev_states_req_batt_lvl
,
541 static const int *mihcap_fields
[] = {
548 static const int *net_caps_fields
[] = {
562 static const int *ac_attr_fields
[] = {
563 &hf_link_ac_attr_link_scan
,
564 &hf_link_ac_attr_link_res_retain
,
565 &hf_link_ac_attr_data_fwd_req
,
569 static const int *subtype_eth_fields
[] = {
570 &hf_link_subtype_eth_10m
,
571 &hf_link_subtype_eth_100m
,
572 &hf_link_subtype_eth_1000m
,
576 static const int *subtype_wireless_other_fields
[] = {
577 &hf_link_subtype_wireless_other_dvb
,
578 &hf_link_subtype_wireless_other_tdmb
,
579 &hf_link_subtype_wireless_other_atsc
,
583 static const int *subtype_ieee80211_fields
[] = {
584 &hf_link_subtype_ieee80211_24
,
585 &hf_link_subtype_ieee80211_5
,
586 &hf_link_subtype_ieee80211_49
,
587 &hf_link_subtype_ieee80211_365
,
588 &hf_link_subtype_ieee80211_316
,
592 static const int *subtype_umts_fields
[] = {
593 &hf_link_subtype_umts_99
,
594 &hf_link_subtype_umts_4
,
595 &hf_link_subtype_umts_5
,
596 &hf_link_subtype_umts_6
,
597 &hf_link_subtype_umts_7
,
598 &hf_link_subtype_umts_8
,
602 static const int *subtype_cdma2000_fields
[] = {
603 &hf_link_subtype_cdma2000_0
,
604 &hf_link_subtype_cdma2000_a
,
605 &hf_link_subtype_cdma2000_b
,
606 &hf_link_subtype_cdma2000_c
,
610 static const int *subtype_ieee80216_fields
[] = {
611 &hf_link_subtype_ieee80216_25
,
612 &hf_link_subtype_ieee80216_35
,
616 static const value_string servicevalues
[] = {
617 {1, "Service Management"},
618 {2, "Event Service"},
619 {3, "Command Service"},
620 {4, "Information Service"},
624 static const value_string opcodevalues
[] = {
632 static const value_string link_ac_result_vals
[] = {
640 static const value_string serv_act_id_values
[] = {
641 {1, "MIH_Capability_Discover"},
643 {3, "MIH_DeRegister"},
644 {4, "MIH_Event_Subscribe"},
645 {5, "MIH_Event_Unsubscribe"},
649 static const value_string event_act_id_values
[] = {
650 {1, "MIH_Link_Detected"},
652 {3, "MIH_Link_Down"},
653 {5, "MIH_Link_Parameter_Report"},
654 {6, "MIH_Link_Going_down"},
655 {7, "MIH_Link_Handover_Imminent"},
656 {8, "MIH_Handover_Complete"},
660 static const value_string status_types
[] = {
662 {1, "Unspecified Failure"},
664 {3, "Authorization Failure"},
665 {4, "Network Error"},
669 static const value_string ho_status_vals
[] = {
670 {0, "Handover Permitted"},
671 {1, "Handover Declined"},
675 static const value_string mbb_ho_supp_vals
[] = {
676 {0, "Make before break is not supported."},
677 {1, "Make before break is supported."},
681 static const value_string reg_request_code_vals
[] = {
683 {1, "Re-Registration"},
687 static const value_string ip_renewal_vals
[] = {
688 {0, "Change Not Requiered"},
689 {1, "Change Required"},
693 static const value_string dev_states_req_vals
[] = {
699 static const value_string link_addr_types
[] ={
701 {1, "3GPP_3G_CELL_ID"},
702 {2, "3GPP_2G_CELL_ID"},
705 {5, "OTHER_L2_ADDR"},
709 static const value_string threshold_x_dir_vals
[] ={
710 {0, "Above Threshold"},
711 {1, "Below Threshold"},
715 static const value_string threshold_action_vals
[] ={
716 {0, "Set Normal Threshold"},
717 {1, "Set one-shot Threshold"},
718 {2, "Cancel Threshold"},
722 static const value_string boolean_types
[] ={
728 static const value_string command_act_id_values
[] = {
729 {1, "MIH_Link_Get_Parameters"},
730 {2, "MIH_Link_Configure_Thresholds"},
731 {3, "MIH_Link_Actions"},
732 {4, "MIH_Net_HO_Candidate_Query"},
733 {5, "MIH_MN_HO_Candidate_Query"},
734 {6, "MIH_N2N_HO_Query_Resources"},
735 {7, "MIH_MN_HO_Commit"},
736 {8, "MIH_Net_HO-Commit"},
737 {9, "MN_N2N_HO_Commit"},
738 {10, "MIH_MN_HO_Complete"},
739 {11, "MIH_N2N_HO_Complete"},
740 {12, "MIH_Net_HO_Best_Commit"},
744 static const value_string info_act_id_values
[] = {
745 {1, "MIH_Get_Information"},
746 {2, "MIH_Push_information"},
750 static const value_string link_dn_reason_vals
[] = {
751 {0, "Explicit Disconnect"},
752 {1, "Packet Timeout"},
755 {4, "Authentication Failure"},
756 {5, "Billing Failure"},
760 static const value_string link_gdn_reason_vals
[] = {
761 {0, "Explicit Disconnect"},
762 {1, "Link Parameter Degrading"},
768 static const value_string link_type_vals
[] = {
770 {1, "Wireless - GSM"},
771 {2, "Wireless - GPRS"},
772 {3, "Wireless - EDGE"},
774 {18, "Wireless - Other"},
775 {19, "Wireless - IEEE 802.11"},
776 {22, "Wireless - CDMA2000"},
777 {23, "Wireless - UMTS"},
778 {24, "Wireless - cdma2000-HRPD"},
779 {27, "Wireless - IEEE 802.16"},
780 {28, "Wireless - IEEE 802.20"},
781 {29, "Wireless - IEEE 802.22"},
788 static const value_string link_param_gen_vals
[] = {
790 {1, "Signal Strength"},
793 {4, "Packet Error Rate"},
794 {5, "Channel Frequency"},
795 {6, "Channel Bandwidth"},
796 {7, "Channel TX Power"},
797 {8, "Higher Adjacent Channel Frequency"},
798 {9, "Higher Adjacent Channel Bandwidth"},
799 {10, "Higher Adjacent Channel TX Power"},
800 {11, "Lower Adjacent Channel Frequency"},
801 {12, "Lower Adjacent Channel Bandwidth"},
802 {13, "Lower Adjacent Channel TX Power"},
806 static const value_string link_ac_type_vals
[] = {
808 {1, "LINK_DISCONNECT"},
809 {2, "LINK_LOW_POWER"},
810 {3, "LINK_POWER_DOWN"},
811 {4, "LINK_POWER_UP"},
812 {5, "LINK_CONFIGURE"},
816 static const value_string link_param_gg_vals
[] = {
824 static const value_string link_param_fdd_vals
[] = {
827 {2, "UTRA carrier RSSI"},
828 {3, "GSM carrier RSSI"},
830 {5, "Transport channel BLER"},
831 {6, "User equipment (UE) transmitted power"},
835 static const value_string link_param_802_11_vals
[] = {
837 {1, "No QoS resource Available"},
838 {2, "Multiast packet loss rate"},
842 static const value_string op_mode_vals
[] = {
844 {1, "Power Saving Mode"},
849 static const value_string link_param_qos_vals
[] = {
850 {0, "Max no of differentiable classes"},
851 {1, "Min Packet transfer delay"},
852 {2, "Avg packet ransfer delay"},
853 {3, "Max packet ransfer delay"},
859 static const value_string link_param_c2k_hrpd_vals
[] = {
860 {0, "Pilot Strength"},
864 static const value_string typevaluenames
[] = {
865 { 1, "Source MIHIF ID" },
866 { 2, "Destination MIHIF ID" },
869 { 5, "MIH event list" },
870 { 6, "MIH command list" },
871 { 7, "MIIS query type list" },
872 { 8, "Transport option list" },
873 { 9, "Link address list" },
874 { 10, "MBB handover support" },
875 { 11, "Register request code" },
876 { 12, "Valid time interval" },
877 { 13, "Link identifier" },
878 { 14, "New Link identifier" },
879 { 15, "Old access router" },
880 { 16, "New access router" },
881 { 17, "IP renewal flag" },
882 { 18, "Mobility management support" },
883 { 19, "IP address configuration methods" },
884 { 20, "Link down reason code" },
885 { 21, "Time interval" },
886 { 22, "Link going down reason" },
887 { 23, "Link parameter report list" },
888 { 24, "Device states request" },
889 { 25, "Link identifier list" },
890 { 26, "Device states response list" },
891 { 27, "Get status request set" },
892 { 28, "Get status response list" },
893 { 29, "Configure request list" },
894 { 30, "Configure response list" },
895 { 31, "List of link PoA list" },
896 { 32, "Preferred link list" },
897 { 33, "Handover resource query list" },
898 { 34, "Handover status" },
899 { 35, "Access router address" },
900 { 36, "DHCP server address" },
901 { 37, "FA address" },
902 { 38, "Link actions list" },
903 { 39, "Link actions result list" },
904 { 40, "Handover result" },
905 { 41, "Resource status" },
906 { 42, "Resource retention status" },
907 { 43, "Info query binary data list" },
908 { 44, "Info query RDF data list" },
909 { 45, "Info query RDF schema URL" },
910 { 46, "Info query RDF schema list" },
911 { 47, "Max response size" },
912 { 48, "Info response binary data list" },
913 { 49, "Info response RDF data list" },
914 { 50, "Info response RDF schema URL list" },
915 { 51, "Info response RDF schema list" },
916 { 52, "Mobile node MIHF ID" },
917 { 53, "Query resource report flag" },
918 { 54, "Event configuration info list" },
919 { 55, "Target network info" },
920 { 56, "List of target network info" },
921 { 57, "Assigned resource set" },
922 { 58, "Link detected info list" },
923 { 59, "MN link ID" },
925 { 61, "Unauthenticated information request" },
926 { 62, "Network type" },
927 { 63, "Requested resource set" },
931 static gint16
dissect_mih_list(tvbuff_t
*tvb
, gint16 offset
, proto_tree
*tlv_tree
, gint16 (*base_dissect
)(tvbuff_t
*tvb
, gint16 offset
, proto_tree
*tlv_tree
))
934 guint8 list_len
= tvb_get_guint8(tvb
, offset
);
936 for(i
=0; i
< list_len
; i
++)
937 offset
= base_dissect(tvb
, offset
, tlv_tree
);
941 static gint16
dissect_ip_addr(tvbuff_t
*tvb
, gint16 offset
, proto_tree
*tlv_tree
)
943 guint16 addr_type
= tvb_get_ntohs(tvb
, offset
);
948 len
= tvb_get_guint8(tvb
, offset
+ 3);
949 proto_tree_add_item(tlv_tree
, hf_ipv4_addr
, tvb
, offset
+2, len
, ENC_BIG_ENDIAN
);
950 return (offset
+3+len
);
955 len
= tvb_get_guint8(tvb
, offset
+ 3);
956 proto_tree_add_item(tlv_tree
,hf_ipv6_addr
, tvb
, offset
+2, len
, ENC_BIG_ENDIAN
);
957 return (offset
+3+len
);
961 len
= tvb_get_guint8(tvb
, offset
+ 3);
962 return (offset
+3+len
);
966 static gint16
dissect_qos_val(tvbuff_t
*tvb
, gint16 offset
, proto_tree
*tlv_tree
)
968 proto_tree_add_item(tlv_tree
, hf_cos_id
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
970 proto_tree_add_item(tlv_tree
, hf_cos_value
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
975 static gint16
dissect_link_addr(tvbuff_t
*tvb
, gint16 offset
, proto_tree
*tlv_tree
)
977 guint8 link_addr_choice
= tvb_get_guint8(tvb
, offset
);
980 proto_tree_add_item(tlv_tree
, hf_link_addr_type
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
981 switch (link_addr_choice
)
983 case 0 : /*MAC_ADDR*/
984 proto_tree_add_item(tlv_tree
, hf_link_transport_addr_type
, tvb
, offset
+1, 2, ENC_BIG_ENDIAN
);
985 if(tvb_get_ntohs(tvb
, offset
+1) == 0x06)
986 proto_tree_add_item(tlv_tree
, hf_mac_addr
, tvb
, offset
+4, tvb_get_guint8(tvb
, offset
+3), ENC_NA
);
987 return (offset
+ 10);
989 case 1 :/*3GPP_3G_CELL_ID*/
990 proto_tree_add_item(tlv_tree
, hf_plmn_id
, tvb
, offset
+1, 3, ENC_BIG_ENDIAN
);
991 proto_tree_add_item(tlv_tree
, hf_cell_id
, tvb
, offset
+4, 4, ENC_BIG_ENDIAN
);
994 case 2 :/*3GPP_2G_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_location_area_id
, tvb
, offset
+4, 2, ENC_BIG_ENDIAN
);
997 proto_tree_add_item(tlv_tree
, hf_ci
, tvb
, offset
+6, 2, ENC_BIG_ENDIAN
);
1000 case 3 :/*3GPP_ADDR*/
1001 case 4 :/*3GPP2_ADDR*/
1002 case 5 :/*OTHER_L2_ADDR*/
1003 len
= tvb_get_guint8(tvb
, offset
+1);
1004 proto_tree_add_item(tlv_tree
, hf_link_addr_string
, tvb
, offset
+2, len
, ENC_ASCII
|ENC_NA
);
1005 return (offset
+ 2 + len
);
1010 static gint16
dissect_tsp_container(tvbuff_t
*tvb
, gint16 offset
, proto_tree
*tlv_tree
)
1013 if(tvb_get_guint8(tvb
, offset
) == 1)
1015 proto_tree_add_item(tlv_tree
, hf_predef_cfg_id
, tvb
, offset
+1, 1, ENC_BIG_ENDIAN
);
1016 return (offset
+ 2);
1018 else if(tvb_get_guint8(tvb
, offset
) == 2)
1020 len
= tvb_get_guint8(tvb
, offset
+1);
1021 proto_tree_add_item(tlv_tree
, hf_tsp_carrier
, tvb
, offset
+2, len
, ENC_ASCII
|ENC_NA
);
1022 return (offset
+ len
+ 2);
1025 return (offset
+ 1);
1028 static gint16
dissect_iq_rdf_data(tvbuff_t
*tvb
, gint16 offset
, proto_tree
*tlv_tree
)
1031 if(tvb_get_guint8(tvb
, offset
))
1033 len
= tvb_get_guint8(tvb
, offset
+1);
1034 proto_tree_add_item(tlv_tree
, hf_rdf_mime_type
, tvb
, offset
+2, len
, ENC_ASCII
|ENC_NA
);
1038 len
= tvb_get_guint8(tvb
, offset
);
1039 proto_tree_add_item(tlv_tree
, hf_rdf_data
, tvb
, offset
+1, len
, ENC_ASCII
|ENC_NA
);
1040 return (offset
+len
+1);
1043 static gint16
dissect_qos_list(tvbuff_t
*tvb
, gint16 offset
, proto_tree
*tlv_tree
)
1045 proto_tree_add_item(tlv_tree
, hf_num_cos
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1047 proto_tree_add_text(tlv_tree
, tvb
, offset
, 1, "MIN_PK_TX_DELAY- ");
1048 offset
= dissect_mih_list(tvb
, offset
, tlv_tree
, dissect_qos_val
);
1049 proto_tree_add_text(tlv_tree
, tvb
, offset
, 1, "AVG_PK_TX_DELAY- ");
1050 offset
= dissect_mih_list(tvb
, offset
, tlv_tree
, dissect_qos_val
);
1051 proto_tree_add_text(tlv_tree
, tvb
, offset
, 1, "MAX_PK_TX_DELAY- ");
1052 offset
= dissect_mih_list(tvb
, offset
, tlv_tree
, dissect_qos_val
);
1053 proto_tree_add_text(tlv_tree
, tvb
, offset
, 1, "PK_DELAY_JITTER - ");
1054 offset
= dissect_mih_list(tvb
, offset
, tlv_tree
, dissect_qos_val
);
1055 proto_tree_add_text(tlv_tree
, tvb
, offset
, 1, "PK_LOSS_RATE- ");
1056 offset
= dissect_mih_list(tvb
, offset
, tlv_tree
, dissect_qos_val
);
1060 static gint16
dissect_dev_states(tvbuff_t
*tvb
, gint16 offset
, proto_tree
*tlv_tree
)
1063 proto_tree
*sub_tree
= NULL
;
1065 sub_tree
= proto_tree_add_item(tlv_tree
, hf_dev_states_resp
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1066 if(tvb_get_guint8(tvb
, offset
))
1070 proto_tree_add_item(sub_tree
, hf_dev_batt_level
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1077 len
= tvb_get_guint8(tvb
, offset
);
1078 proto_tree_add_item(sub_tree
, hf_dev_info
, tvb
, offset
+1, len
, ENC_ASCII
|ENC_NA
);
1079 return (offset
+ len
+ 1);
1084 static gint16
dissect_net_type(tvbuff_t
*tvb
, gint16 offset
, proto_tree
*tlv_tree
)
1088 if(!tvb_get_guint8(tvb
, offset
))
1091 type
= tvb_get_guint8(tvb
, offset
+1);
1092 proto_tree_add_item(tlv_tree
, hf_link_type
, tvb
, offset
+1, 1, ENC_BIG_ENDIAN
);
1096 if(!tvb_get_guint8(tvb
, offset
))
1101 /* last 32 bits are not read since proto_tree_add_bitmask only handles bitmasks of length 32
1102 Even though the standard defines a bitmasks of length 64, there are no definitions in the standard that require more than 32 bits
1103 1 (identifier) + 4(bitmask defined values) + 4 (unused bits) = 9 (final offset)*/
1104 case 15 : /*subtype ethernet*/
1105 proto_tree_add_bitmask(tlv_tree
, tvb
, offset
+1, hf_link_subtype_eth
, ett_subtype_eth_bitmap
, subtype_eth_fields
, ENC_BIG_ENDIAN
);
1107 case 18 : /*subtype wireless other*/
1108 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
);
1110 case 19 : /*subtype 802.11*/
1111 proto_tree_add_bitmask(tlv_tree
, tvb
, offset
+1, hf_link_subtype_ieee80211
, ett_subtype_ieee80211_bitmap
, subtype_ieee80211_fields
, ENC_BIG_ENDIAN
);
1113 case 23 : /*subtype UMTS*/
1114 proto_tree_add_bitmask(tlv_tree
, tvb
, offset
+1, hf_link_subtype_umts
, ett_subtype_umts_bitmap
, subtype_umts_fields
, ENC_BIG_ENDIAN
);
1116 case 24 : /*subtype cdma2000*/
1117 proto_tree_add_bitmask(tlv_tree
, tvb
, offset
+1, hf_link_subtype_cdma2000
, ett_subtype_cdma2000_bitmap
, subtype_cdma2000_fields
, ENC_BIG_ENDIAN
);
1119 case 27 : /*subtype 802.16*/
1120 proto_tree_add_bitmask(tlv_tree
, tvb
, offset
+1, hf_link_subtype_ieee80216
, ett_subtype_ieee80216_bitmap
, subtype_ieee80216_fields
, ENC_BIG_ENDIAN
);
1123 proto_item_append_text(tlv_tree
, "N/A");
1125 /*4(bitmask defined values) + 4 (unused bits) = 8 bits*/
1128 /*1 (identifier) = 1 bit*/
1130 if(!tvb_get_guint8(tvb
, offset
))
1133 len
= tvb_get_guint8(tvb
, offset
+1);
1134 proto_tree_add_item(tlv_tree
, hf_link_type_ext
, tvb
, offset
+2, len
, ENC_ASCII
|ENC_NA
);
1140 static gint16
dissect_net_type_addr(tvbuff_t
*tvb
, gint16 offset
, proto_tree
*tlv_tree
)
1142 offset
= dissect_net_type(tvb
, offset
, tlv_tree
);
1143 offset
= dissect_link_addr(tvb
, offset
, tlv_tree
);
1147 static gint16
dissect_mbb_ho_supp(tvbuff_t
*tvb
, gint16 offset
, proto_tree
*tlv_tree
)
1149 offset
= dissect_net_type(tvb
, offset
, tlv_tree
);
1150 offset
= dissect_net_type(tvb
, offset
, tlv_tree
);
1151 proto_tree_add_item(tlv_tree
, hf_mbb_ho_supp
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1156 static gint16
dissect_tgt_net_info(tvbuff_t
*tvb
, gint16 offset
, proto_tree
*tlv_tree
)
1159 if(!tvb_get_guint8(tvb
, offset
))
1164 len
= tvb_get_guint8(tvb
, offset
);
1165 proto_tree_add_item(tlv_tree
, hf_network_id
, tvb
, offset
+1, len
, ENC_ASCII
|ENC_NA
);
1167 if(!tvb_get_guint8(tvb
, offset
))
1171 len
= tvb_get_guint8(tvb
, offset
);
1172 proto_tree_add_item(tlv_tree
, hf_net_aux_id
, tvb
, offset
+1, len
, ENC_ASCII
|ENC_NA
);
1173 return (offset
+ 1);
1175 return (offset
+ 2);
1181 offset
= dissect_link_addr(tvb
, offset
, tlv_tree
);
1186 static gint16
dissect_link_id(tvbuff_t
*tvb
, gint16 offset
, proto_tree
*tlv_tree
)
1189 gint16 next_offset
= 0;
1192 proto_tree_add_item(tlv_tree
, hf_link_type
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1193 next_offset
= dissect_link_addr(tvb
, offset
+1, tlv_tree
);
1194 return (next_offset
);
1197 static gint16
dissect_link_poa(tvbuff_t
*tvb
, gint16 offset
, proto_tree
*tlv_tree
)
1199 offset
= dissect_link_id(tvb
, offset
, tlv_tree
);
1200 offset
= dissect_mih_list(tvb
, offset
, tlv_tree
, dissect_link_addr
);
1204 static gint16
dissect_rq_result(tvbuff_t
*tvb
, gint16 offset
, proto_tree
*tlv_tree
)
1206 proto_tree
*temp
= NULL
;
1207 temp
= proto_tree_add_text(tlv_tree
, tvb
, offset
, 1, "List of preffered links:");
1208 offset
= dissect_link_poa(tvb
, offset
, temp
);
1209 offset
= dissect_qos_list(tvb
, offset
, tlv_tree
);
1211 switch(tvb_get_guint8(tvb
, offset
-1))
1213 case 1: proto_tree_add_text(tlv_tree
, tvb
, offset
, 1, "IP methods supported: ");
1214 proto_tree_add_item(tlv_tree
, hf_boolean
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1217 case 2: temp
= proto_tree_add_text(tlv_tree
, tvb
, offset
, 2, "ip configuration methods- ");
1218 proto_tree_add_bitmask(temp
, tvb
, offset
, hf_cfg_mthds
, ett_cfg_mtd_bitmap
, cfg_fields
, ENC_BIG_ENDIAN
);
1223 switch(tvb_get_guint8(tvb
, offset
-1))
1225 case 1: proto_tree_add_text(tlv_tree
, tvb
, offset
, 1, "IP DHCP services: ");
1226 proto_tree_add_item(tlv_tree
, hf_boolean
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1229 case 2: proto_tree_add_text(tlv_tree
, tvb
, offset
, 1, "IP DHCP server: ");
1230 offset
= dissect_ip_addr(tvb
, offset
, tlv_tree
);
1234 switch(tvb_get_guint8(tvb
, offset
-1))
1236 case 1: proto_tree_add_text(tlv_tree
, tvb
, offset
, 1, "FN Agent ");
1237 proto_tree_add_item(tlv_tree
, hf_boolean
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1240 case 2: proto_tree_add_text(tlv_tree
, tvb
, offset
, 1, "FN Agent: ");
1241 offset
= dissect_ip_addr(tvb
, offset
, tlv_tree
);
1245 switch(tvb_get_guint8(tvb
, offset
-1))
1247 case 1: proto_tree_add_text(tlv_tree
, tvb
, offset
, 1, "Access Router ");
1248 proto_tree_add_item(tlv_tree
, hf_boolean
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1251 case 2: proto_tree_add_text(tlv_tree
, tvb
, offset
, 1, "Access Router: ");
1252 offset
= dissect_ip_addr(tvb
, offset
, tlv_tree
);
1258 static gint16
dissect_link_det_info(tvbuff_t
*tvb
, gint16 offset
, proto_tree
*tlv_tree
)
1261 offset
= dissect_link_id(tvb
, offset
, tlv_tree
);
1262 if(tvb_get_guint8(tvb
, offset
))
1265 offset
= dissect_link_addr(tvb
, offset
, tlv_tree
);
1269 len
= tvb_get_guint8(tvb
, offset
);
1270 proto_tree_add_item(tlv_tree
, hf_network_id
, tvb
, offset
+1, len
, ENC_ASCII
|ENC_NA
);
1272 len
= tvb_get_guint8(tvb
, offset
);
1273 proto_tree_add_item(tlv_tree
, hf_net_aux_id
, tvb
, offset
+1, len
, ENC_ASCII
|ENC_NA
);
1275 if(tvb_get_guint8(tvb
, offset
))
1276 proto_tree_add_item(tlv_tree
, hf_sig_strength_per
, tvb
, offset
+1, 1, ENC_BIG_ENDIAN
);
1278 proto_tree_add_item(tlv_tree
, hf_sig_strength_dbm
, tvb
, offset
+1, 1, ENC_BIG_ENDIAN
);
1280 proto_tree_add_item(tlv_tree
, hf_sinr
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1282 proto_tree_add_item(tlv_tree
, hf_link_data_rate
, tvb
, offset
,4, ENC_BIG_ENDIAN
);
1284 proto_tree_add_bitmask(tlv_tree
, tvb
, offset
, hf_mihcap
, ett_mihcap_bitmap
, mihcap_fields
, ENC_BIG_ENDIAN
);
1286 proto_tree_add_bitmask(tlv_tree
, tvb
, offset
, hf_net_caps
, ett_net_caps_bitmap
, net_caps_fields
, ENC_BIG_ENDIAN
);
1291 static gint16
dissect_link_scan_rsp(tvbuff_t
*tvb
, gint16 offset
, proto_tree
*tlv_tree
)
1294 offset
= dissect_link_addr(tvb
, offset
, tlv_tree
);
1295 len
= tvb_get_guint8(tvb
, offset
);
1296 proto_tree_add_item(tlv_tree
, hf_network_id
, tvb
, offset
+1, len
, ENC_ASCII
|ENC_NA
);
1297 offset
= offset
+ len
+ 1;
1298 if(tvb_get_guint8(tvb
, offset
))
1299 proto_tree_add_item(tlv_tree
, hf_sig_strength_per
, tvb
, offset
+1, 1, ENC_BIG_ENDIAN
);
1301 proto_tree_add_item(tlv_tree
, hf_sig_strength_dbm
, tvb
, offset
+1, 1, ENC_BIG_ENDIAN
);
1305 static gint16
dissect_link_action_rsp(tvbuff_t
*tvb
, gint16 offset
, proto_tree
*tlv_tree
)
1307 offset
= dissect_link_id(tvb
, offset
, tlv_tree
);
1308 proto_tree_add_item(tlv_tree
, hf_link_ac_result
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1310 if(tvb_get_guint8(tvb
, offset
))
1312 offset
= dissect_mih_list(tvb
, offset
+1, tlv_tree
, dissect_link_scan_rsp
);
1320 static gint16
dissect_link_action_req(tvbuff_t
*tvb
, gint16 offset
, proto_tree
*tlv_tree
)
1322 offset
= dissect_link_id(tvb
, offset
, tlv_tree
);
1323 if(tvb_get_guint8(tvb
, offset
))
1325 offset
= dissect_link_addr(tvb
, offset
+1, tlv_tree
);
1331 proto_tree_add_item(tlv_tree
, hf_link_ac_type
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1333 proto_tree_add_bitmask(tlv_tree
, tvb
, offset
, hf_link_ac_attr
, ett_ac_attr_bitmap
, ac_attr_fields
, ENC_BIG_ENDIAN
);
1335 proto_tree_add_item(tlv_tree
, hf_link_ac_ext_time
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1339 static gint16
dissect_link_states_rsp(tvbuff_t
*tvb
, gint16 offset
, proto_tree
*tlv_tree
)
1341 if(!tvb_get_guint8(tvb
, offset
))
1343 proto_tree_add_item(tlv_tree
, hf_op_mode
, tvb
, offset
+1, 1, ENC_BIG_ENDIAN
);
1348 proto_tree_add_item(tlv_tree
, hf_channel_id
, tvb
, offset
+1, 2, ENC_BIG_ENDIAN
);
1354 static gint16
dissect_link_param_type(tvbuff_t
*tvb
, gint16 offset
, proto_tree
*tlv_tree
)
1356 guint8 type
= tvb_get_guint8(tvb
, offset
);
1362 case 0 :/*LINK_PARAM_GEN*/
1363 proto_tree_add_item(tlv_tree
, hf_link_param_gen
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1366 case 1 :/*LINK_PARAM_QOS*/
1367 proto_tree_add_item(tlv_tree
, hf_link_param_qos
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1370 case 2 :/*LINK_PARAM_GG*/
1371 proto_tree_add_item(tlv_tree
, hf_link_param_gg
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1374 case 3 :/*LINK_PARAM_EDGE*/
1375 proto_tree_add_item(tlv_tree
, hf_link_param_edge
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1378 case 4 :/*LINK_PARAM_ETH*/
1379 proto_tree_add_item(tlv_tree
, hf_link_param_eth
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1382 case 5 :/*LINK_PARAM_802_11*/
1383 proto_tree_add_item(tlv_tree
, hf_link_param_802_11
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1386 case 6 :/*LINK_PARAM_C2K*/
1387 proto_tree_add_item(tlv_tree
, hf_link_param_c2k
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1390 case 7 :/*LINK_PARAM_FDD*/
1391 proto_tree_add_item(tlv_tree
, hf_link_param_fdd
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1394 case 8 :/*LINK_PARAM_HRPD*/
1395 proto_tree_add_item(tlv_tree
, hf_link_param_hrpd
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1398 case 9 :/*LINK_PARAM_802_16*/
1399 proto_tree_add_item(tlv_tree
, hf_link_param_802_16
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1402 case 10 :/*LINK_PARAM_802_20*/
1403 proto_tree_add_item(tlv_tree
, hf_link_param_802_20
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1406 case 11 :/*LINK_PARAM_802_22*/
1407 proto_tree_add_item(tlv_tree
, hf_link_param_802_22
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1413 static void dissect_link_status_req(tvbuff_t
*tvb
, gint16 offset
, proto_tree
*tlv_tree
)
1415 proto_tree
*tree_temp
;
1418 guint16 temp
= tvb_get_ntohs(tvb
, offset
);
1421 tree_temp
= proto_tree_add_text(tlv_tree
, tvb
, offset
, 3, "LINK_STATES_REQ: ");
1422 proto_tree_add_item(tree_temp
, hf_op_mode
, tvb
, offset
+2, 1, ENC_BIG_ENDIAN
);
1427 tree_temp
= proto_tree_add_text(tlv_tree
, tvb
, offset
, 4, "LINK_STATES_REQ: ");
1428 proto_tree_add_item(tree_temp
, hf_channel_id
, tvb
, offset
+2, 2, ENC_BIG_ENDIAN
);
1432 /*LINK_PARAM_TYPE_LIST*/
1433 offset
= dissect_mih_list(tvb
, offset
, tlv_tree
, dissect_link_param_type
);
1436 temp
= tvb_get_ntohs(tvb
, offset
);
1437 tree_temp
= proto_tree_add_text(tlv_tree
, tvb
, offset
, 3, "LINK_DESC_REQ: ");
1440 proto_tree_add_item(tree_temp
, hf_num_cos
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1442 proto_tree_add_item(tree_temp
, hf_num_queue
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1446 static gint16
dissect_link_cfg_status(tvbuff_t
*tvb
, gint16 offset
, proto_tree
*tlv_tree
)
1448 offset
= dissect_link_param_type(tvb
, offset
, tlv_tree
);
1449 proto_tree_add_item(tlv_tree
, hf_threshold_val
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1451 proto_tree_add_item(tlv_tree
, hf_threshold_x_dir
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1453 proto_tree_add_item(tlv_tree
, hf_config_status
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1457 static gint16
dissect_link_param(tvbuff_t
*tvb
, gint16 offset
, proto_tree
*tlv_tree
)
1460 offset
= dissect_link_param_type(tvb
, offset
, tlv_tree
);
1461 if(!tvb_get_guint8(tvb
, offset
))
1464 /*LINK_PARAM_VALUE*/
1465 proto_tree_add_item(tlv_tree
, hf_link_param_value
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1472 switch(tvb_get_guint8(tvb
, offset
))
1475 proto_tree_add_item(tlv_tree
, hf_num_cos
, tvb
, offset
+1, 1, ENC_BIG_ENDIAN
);
1479 proto_tree_add_text(tlv_tree
, tvb
, offset
+1, 1, "MIN_PK_TX_DELAY- ");
1480 offset
= dissect_mih_list(tvb
, offset
+1, tlv_tree
, dissect_qos_val
);
1483 proto_tree_add_text(tlv_tree
, tvb
, offset
+1, 1, "AVG_PK_TX_DELAY- ");
1484 offset
= dissect_mih_list(tvb
, offset
+1, tlv_tree
, dissect_qos_val
);
1487 proto_tree_add_text(tlv_tree
, tvb
, offset
+1, 1, "MAX_PK_TX_DELAY- ");
1488 offset
= dissect_mih_list(tvb
, offset
+1, tlv_tree
, dissect_qos_val
);
1491 proto_tree_add_text(tlv_tree
, tvb
, offset
+1, 1, "PK_DELAY_JITTER - ");
1492 offset
= dissect_mih_list(tvb
, offset
+1, tlv_tree
, dissect_qos_val
);
1495 proto_tree_add_text(tlv_tree
, tvb
, offset
+1, 1, "PK_LOSS_RATE- ");
1496 offset
= dissect_mih_list(tvb
, offset
+1, tlv_tree
, dissect_qos_val
);
1503 static gint16
dissect_link_param_rpt(tvbuff_t
*tvb
, gint16 offset
, proto_tree
*tlv_tree
)
1506 offset
= dissect_link_param(tvb
, offset
, tlv_tree
);
1507 if(tvb_get_guint8(tvb
, offset
))
1511 proto_tree_add_item(tlv_tree
, hf_threshold_val
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1513 proto_tree_add_item(tlv_tree
, hf_threshold_x_dir
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1520 static gint16
dissect_link_desc_rsp(tvbuff_t
*tvb
, gint16 offset
, proto_tree
*tlv_tree
)
1522 if(!tvb_get_guint8(tvb
, offset
))
1523 proto_tree_add_item(tlv_tree
, hf_num_cos
, tvb
, offset
+1, 1, ENC_BIG_ENDIAN
);
1525 proto_tree_add_item(tlv_tree
, hf_num_queue
, tvb
, offset
+1, 1, ENC_BIG_ENDIAN
);
1529 static gint16
dissect_status_list(tvbuff_t
*tvb
, gint16 offset
, proto_tree
*tlv_tree
)
1532 offset
= dissect_link_id(tvb
, offset
, tlv_tree
);
1535 offset
= dissect_mih_list(tvb
, offset
, tlv_tree
, dissect_link_states_rsp
);
1538 offset
= dissect_mih_list(tvb
, offset
, tlv_tree
, dissect_link_param
);
1541 offset
= dissect_mih_list(tvb
, offset
, tlv_tree
, dissect_link_desc_rsp
);
1545 static gint16
dissect_link_det_cfg(tvbuff_t
*tvb
, gint16 offset
, proto_tree
*tlv_tree
)
1548 if(tvb_get_guint8(tvb
, offset
))
1550 len
= tvb_get_guint8(tvb
, offset
+1);
1551 proto_tree_add_item(tlv_tree
, hf_network_id
, tvb
, offset
+2, len
, ENC_ASCII
|ENC_NA
);
1555 if(tvb_get_guint8(tvb
, offset
))
1557 if(tvb_get_guint8(tvb
, offset
+1))
1558 proto_tree_add_item(tlv_tree
, hf_sig_strength_per
, tvb
, offset
+2, 1, ENC_BIG_ENDIAN
);
1560 proto_tree_add_item(tlv_tree
, hf_sig_strength_dbm
, tvb
, offset
+2, 1, ENC_BIG_ENDIAN
);
1564 if(tvb_get_guint8(tvb
, offset
))
1566 proto_tree_add_item(tlv_tree
, hf_link_data_rate
, tvb
, offset
+1,4, ENC_BIG_ENDIAN
);
1572 static gint16
dissect_link_cfg_param(tvbuff_t
*tvb
, gint16 offset
, proto_tree
*tlv_tree
)
1574 offset
= dissect_link_param_type(tvb
, offset
, tlv_tree
);
1575 if(tvb_get_guint8(tvb
, offset
))
1577 proto_tree_add_item(tlv_tree
, hf_time_interval
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1581 proto_tree_add_item(tlv_tree
, hf_threshold_action
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1583 proto_tree_add_item(tlv_tree
, hf_threshold_val
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1585 proto_tree_add_item(tlv_tree
, hf_threshold_x_dir
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1589 static gint16
dissect_mih_evt_cfg_info(tvbuff_t
*tvb
, gint16 offset
, proto_tree
*tlv_tree
)
1591 offset
= dissect_mih_list(tvb
, offset
, tlv_tree
, dissect_link_det_cfg
);
1592 offset
= dissect_mih_list(tvb
, offset
, tlv_tree
, dissect_link_cfg_param
);
1596 static void dissect_mih_tlv(tvbuff_t
*tvb
,int offset
, proto_tree
*tlv_tree
, guint8 type
, guint32 length
)
1599 guint8 mihf_id_len
= 0;
1600 char mihf_id_first_char
= 0;
1604 tvbuff_t
*volatile tvb_mihf_id
= NULL
;
1605 tvbuff_t
* tvb_temp
= NULL
;
1606 volatile gboolean composite_error
= FALSE
;
1608 /*For Value fields*/
1615 mihf_id_len
= tvb_get_guint8(tvb
, offset
);
1616 /*taken from the 802.21 standard:
1617 If L2 communication is used then MIHF_ID is the NAI-encoded linklayer
1618 address (LINK_ADDR) of the entity that hosts the MIH services.
1619 In an NAI-encoded IP address or link-layer address, each octet
1620 of binary-encoded IP4_ADDR, IP6_ADDR and LINK_ADDR data is
1621 encoded in the username part of the NAI as "\" followed by the octet
1623 mihf_id_first_char
= (char)tvb_get_guint8(tvb
, offset
+1);
1624 if(mihf_id_first_char
!='\\')
1625 proto_tree_add_item(tlv_tree
, hf_mihf_id
, tvb
, offset
+1, mihf_id_len
, ENC_ASCII
|ENC_NA
);
1628 if(mihf_id_len
<tvb_length_remaining(tvb
,0) && (mihf_id_len
==12 || mihf_id_len
==64 || mihf_id_len
==128))
1630 tvb_mihf_id
= tvb_new_composite();
1631 for(i
=0; i
< mihf_id_len
/2; i
++)
1633 tvb_temp
= tvb_new_subset(tvb
, offset
+ 2 + 2*i
, 1 , 1);
1634 tvb_composite_append(tvb_mihf_id
, tvb_temp
);
1638 tvb_composite_finalize(tvb_mihf_id
);
1642 composite_error
= TRUE
;
1646 if(!composite_error
)
1650 case 12: /* checks if the length corresponds to a MAC address */
1651 proto_tree_add_item(tlv_tree
, hf_mihf_id_mac
, tvb_mihf_id
, 0, mihf_id_len
/2, ENC_BIG_ENDIAN
);
1653 case 64: /* checks if the length corresponds to an IPv4 address */
1654 proto_tree_add_item(tlv_tree
, hf_mihf_id_ipv4
, tvb_mihf_id
, 0, mihf_id_len
/2, ENC_BIG_ENDIAN
);
1656 case 128: /* checks if the length corresponds to an IPv6 address */
1657 proto_tree_add_item(tlv_tree
, hf_mihf_id_ipv6
, tvb_mihf_id
, 0, mihf_id_len
/2, ENC_BIG_ENDIAN
);
1662 tvb_free(tvb_mihf_id
);
1669 proto_tree_add_item(tlv_tree
, hf_status
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1674 proto_tree_add_item(tlv_tree
, hf_link_type
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1679 proto_tree_add_bitmask(tlv_tree
/*evt_list_tree*/, tvb
, offset
, hf_event_list
, ett_event_bitmap
, event_fields
, ENC_BIG_ENDIAN
);
1684 proto_tree_add_bitmask(tlv_tree
, tvb
, offset
, hf_cmd_list
, ett_cmd_bitmap
, cmd_fields
, ENC_BIG_ENDIAN
);
1687 case MIH_IQ_TYPE_LIST
:
1688 /*MIH_IQ_TYPE_LIST*/
1689 /*last 32 bits are not read since proto_tree_add_bitmask only handles bitmasks of length 32
1690 Even though the standard defines a bitmasks of length 64, there are no definitions in the standard that require more than 32 bits*/
1691 proto_tree_add_bitmask(tlv_tree
, tvb
, offset
, hf_iq_list
, ett_iq_type_bitmap
, iq_type_fields
, ENC_BIG_ENDIAN
);
1694 case MIH_TRANS_LIST
:
1696 proto_tree_add_bitmask(tlv_tree
, tvb
, offset
, hf_trans_list
, ett_trans_list_bitmap
, trans_fields
, ENC_BIG_ENDIAN
);
1699 case LINK_ADDR_LIST
:
1700 /*NET_TYPE_ADDR_LIST*/
1701 dissect_mih_list(tvb
, offset
, tlv_tree
, dissect_net_type_addr
);
1704 case MBB_HO_SUPP_LIST
:
1705 /*MBB_HO_SUPP_LIST*/
1706 dissect_mih_list(tvb
, offset
, tlv_tree
, dissect_mbb_ho_supp
);
1709 case REG_REQUEST_CODE
:
1710 /*REG_REQUEST_CODE*/
1711 proto_tree_add_item(tlv_tree
, hf_reg_request_code
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1714 case VALID_TIME_INTR
:
1715 /*Valid Time interval*/
1716 proto_tree_add_item(tlv_tree
, hf_valid_time_interval
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1723 dissect_link_id(tvb
, offset
, tlv_tree
);
1726 case OLD_ACCESS_ROUTER
:
1727 case NEW_ACCESS_ROUTER
:
1728 case POA_LINK_ADDR
:
1730 dissect_link_addr(tvb
, offset
, tlv_tree
);
1733 case IP_RENEWAL_FLAG
:
1735 proto_tree_add_item(tlv_tree
, hf_ip_renewal
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1740 proto_tree_add_bitmask(tlv_tree
, tvb
, offset
, hf_mob_list
, ett_mob_mgt_bitmap
, mob_fields
, ENC_BIG_ENDIAN
);
1745 proto_tree_add_bitmask(tlv_tree
, tvb
, offset
, hf_cfg_mthds
, ett_cfg_mtd_bitmap
, cfg_fields
, ENC_BIG_ENDIAN
);
1748 case LINK_DN_REASON
:
1750 proto_tree_add_item(tlv_tree
, hf_link_dn_reason
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1753 case TIMER_INTERVAL
:
1755 proto_tree_add_item(tlv_tree
, hf_time_interval
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1758 case LINK_GOING_DN_REASON
:
1759 /*LINK_GOING_DN REASON*/
1760 proto_tree_add_item(tlv_tree
, hf_link_gdn_reason
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1763 case LINK_PARAM_RPT_LIST
:
1764 /*LINK_PARAM_RPT_LIST*/
1765 dissect_mih_list(tvb
, offset
, tlv_tree
, dissect_link_param_rpt
);
1768 case DEV_STATES_REQ
:
1770 proto_tree_add_bitmask(tlv_tree
, tvb
, offset
, hf_dev_states_req
, ett_dev_states_bitmap
, dev_states_fields
, ENC_BIG_ENDIAN
);
1775 dissect_mih_list(tvb
, offset
, tlv_tree
, dissect_link_id
);
1778 case DEV_STATES_RSP_LIST
:
1779 /*DEV_STATES_RSP List*/
1780 dissect_mih_list(tvb
, offset
, tlv_tree
, dissect_dev_states
);
1783 case STATUS_REQ_SET
:
1785 dissect_link_status_req(tvb
, offset
, tlv_tree
);
1788 case STATUS_RSP_LIST
:
1789 /*Status Response List*/
1790 dissect_mih_list(tvb
, offset
, tlv_tree
, dissect_status_list
);
1794 /*LINK_CFG_PARAM_LIST*/
1795 dissect_mih_list(tvb
, offset
, tlv_tree
, dissect_link_cfg_param
);
1799 /*LINK_CFG_STATUS_LIST*/
1800 dissect_mih_list(tvb
, offset
, tlv_tree
, dissect_link_cfg_status
);
1803 case LINK_POA_LIST
:
1805 dissect_mih_list(tvb
, offset
, tlv_tree
, dissect_link_poa
);
1808 case PREF_LINK_LIST
:
1810 dissect_mih_list(tvb
, offset
, tlv_tree
, dissect_rq_result
);
1813 case HO_REQ_QUERY_LIST
:
1815 dissect_qos_list(tvb
, offset
, tlv_tree
);
1820 proto_tree_add_item(tlv_tree
, hf_ho_status
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1823 case ACCESS_ROUTER_ADDR
:
1824 case DHCP_SER_ADDR
:
1827 dissect_ip_addr(tvb
, offset
, tlv_tree
);
1830 case LINK_ACTION_REQ_LIST
:
1831 /*LINK_ACTION_REQ LIST*/
1832 dissect_mih_list(tvb
, offset
, tlv_tree
, dissect_link_action_req
);
1835 case LINK_ACTION_RSP_LIST
:
1836 /*LINK_ACTION_RSP LIST*/
1837 dissect_mih_list(tvb
, offset
, tlv_tree
, dissect_link_action_rsp
);
1842 proto_tree_add_item(tlv_tree
, hf_status
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1845 case LINK_RES_STATUS
:
1847 proto_tree_add_item(tlv_tree
, hf_link_res_status
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1850 case RES_RETENTION_STATUS
:
1852 proto_tree_add_item(tlv_tree
, hf_res_retention_status
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1855 case IQ_RDF_SCHEMA_URL
:
1857 proto_tree_add_item(tlv_tree
, hf_iq_rdf_sch_url
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1860 case Q_RES_RPT_FLAG
:
1862 proto_tree_add_item(tlv_tree
, hf_res_rpt_flag
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1865 case UNAUTH_INFO_REQ
:
1867 proto_tree_add_item(tlv_tree
, hf_unauth_info_req
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1870 case IQ_BIN_DATA_LIST
:
1871 /*IQ_BIN_DATA LIST*/
1872 proto_tree_add_item(tlv_tree
, hf_iq_bin_data_x
, tvb
, offset
, length
, ENC_ASCII
|ENC_NA
);
1875 case IQ_RDF_DATA_LIST
:
1876 case IR_RDF_DATA_LIST
:
1877 case IR_RDF_SCHM_LIST
:
1878 /*IQ_RDF_DATA LIST*/
1879 dissect_mih_list(tvb
, offset
, tlv_tree
, dissect_iq_rdf_data
);
1882 case IQ_RDF_SCHM_LIST
:
1884 for(i
=0; i
< tvb_get_guint8(tvb
, offset
); i
++)
1886 len
= tvb_get_guint8(tvb
, offset
+1);
1887 proto_tree_add_item(tlv_tree
, hf_rdf_sch
, tvb
, offset
+2, len
, ENC_ASCII
|ENC_NA
);
1893 /*Max Response Size*/
1894 proto_tree_add_item(tlv_tree
, hf_max_resp_size
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1897 case IR_BIN_DATA_LIST
:
1898 /*IR_BIN_DATA LIST*/
1899 proto_tree_add_item(tlv_tree
, hf_ir_bin_data
, tvb
, offset
, length
, ENC_ASCII
|ENC_NA
);
1902 case IR_SCHM_URL_LIST
:
1904 for(i
=0; i
< tvb_get_guint8(tvb
, offset
); i
++)
1906 len
= tvb_get_guint8(tvb
, offset
+1);
1907 proto_tree_add_item(tlv_tree
, hf_rdf_sch_url
, tvb
, offset
+2, len
, ENC_ASCII
|ENC_NA
);
1912 case EVT_CFG_INFO_LIST
:
1913 /*EVT_CFG_INFO LIST*/
1914 dissect_mih_list(tvb
, offset
, tlv_tree
, dissect_mih_evt_cfg_info
);
1919 dissect_tgt_net_info(tvb
, offset
, tlv_tree
);
1922 case TGT_NET_INFO_LIST
:
1923 /*List of TGT_NET_INFO*/
1924 dissect_mih_list(tvb
, offset
, tlv_tree
, dissect_tgt_net_info
);
1929 offset
= dissect_qos_list(tvb
, offset
, tlv_tree
);
1930 dissect_tsp_container(tvb
, offset
, tlv_tree
);
1933 case LINK_DET_INFO_LIST
:
1934 /*LINK_DET_INFO LIST*/
1935 dissect_mih_list(tvb
, offset
, tlv_tree
, dissect_link_det_info
);
1940 dissect_net_type(tvb
, offset
, tlv_tree
);
1945 offset
= dissect_qos_list(tvb
, offset
, tlv_tree
);
1946 offset
= dissect_tsp_container(tvb
, offset
, tlv_tree
);
1947 proto_tree_add_item(tlv_tree
, hf_ho_reason
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1950 case VEND_SPECIFIC_TLV
:
1951 /*Vendor specific tlv*/
1952 proto_tree_add_text(tlv_tree
, tvb
, offset
, length
, "Vendor Specific TLV :%s", tvb_get_string(wmem_packet_scope(), tvb
, offset
, length
));
1955 default :/*did not match type*/
1956 /*do switch case for range of numbers*/
1959 if(type
> 63 && type
< 100)
1960 proto_tree_add_text(tlv_tree
, tvb
, offset
, length
, "Reserved TLV :%s", tvb_get_string(wmem_packet_scope(), tvb
, offset
, length
));
1962 /*EXPERIMENTAL TLVs*/
1963 else if(type
> 100 && type
< 255)
1964 proto_tree_add_text(tlv_tree
, tvb
, offset
, length
, "Experimental TLV :%s", tvb_get_string(wmem_packet_scope(), tvb
, offset
, length
));
1968 proto_tree_add_text(tlv_tree
, tvb
, offset
, length
, "UNKNOWN TLV :%s", tvb_get_string(wmem_packet_scope(), tvb
, offset
, length
));
1973 static void dissect_mih(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
)
1975 proto_item
*ti
= NULL
;
1977 proto_item
*item
= NULL
;
1978 proto_tree
*mih_tree
= NULL
;
1979 proto_tree
*ver_flags_tree
= NULL
;
1980 guint8 serviceid
= 0;
1984 gint16 payload_length
= 0;
1986 guint8 len_of_len
= 0;
1988 proto_tree
*mid_tree
= NULL
;
1989 proto_tree
*tlv_tree
= NULL
;
1990 guint8 fragment
= 0;
1992 col_set_str(pinfo
->cinfo
, COL_PROTOCOL
, "MIH");
1993 col_clear(pinfo
->cinfo
,COL_INFO
);
1996 /* we are being asked for details */
1997 ti
= proto_tree_add_item(tree
, proto_mih
, tvb
, 0, -1, ENC_NA
);
2000 mih_tree
= proto_item_add_subtree(ti
, ett_mih
);
2002 item
= proto_tree_add_item(mih_tree
, hf_mih_version
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
2005 ver_flags_tree
= proto_item_add_subtree(item
, ett_ver_flags
);
2006 proto_tree_add_item(ver_flags_tree
, hf_mih_version
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
2007 proto_tree_add_item(ver_flags_tree
, hf_mih_ack_req
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
2008 proto_tree_add_item(ver_flags_tree
, hf_mih_ack_resp
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
2009 proto_tree_add_item(ver_flags_tree
, hf_mih_uir
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
2010 proto_tree_add_item(ver_flags_tree
, hf_mih_more_frag
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
2011 fragment
= tvb_get_guint8(tvb
, offset
);
2012 fragment
= fragment
<< 7;
2018 /*flags and version tree is done.....*/
2019 proto_tree_add_item(mih_tree
, hf_mih_frag_no
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
2020 fragment
= fragment
+ (tvb_get_guint8(tvb
, offset
)>>1);
2022 /*for MIH message ID*/
2023 item
= proto_tree_add_item(mih_tree
, hf_mih_mid
, tvb
, offset
+ 1, 2, ENC_BIG_ENDIAN
);
2026 mid_tree
= proto_item_add_subtree(item
, ett_mid
);
2027 serviceid
= tvb_get_guint8(tvb
, offset
);
2028 serviceid
= serviceid
& 0xF0;
2030 proto_tree_add_item(mid_tree
, hf_mih_service_id
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
2032 /*filling the info column with the service type...*/
2033 col_append_fstr(pinfo
->cinfo
, COL_INFO
, "%s ", val_to_str(serviceid
, servicevalues
, "Unknown"));
2034 opcode
= tvb_get_guint8(tvb
, offset
);
2035 opcode
= opcode
& 0x0C;
2038 proto_tree_add_item(mid_tree
, hf_mih_opcode
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
2040 /*filling the info column with the opcode type...*/
2041 col_append_fstr(pinfo
->cinfo
, COL_INFO
, "%s ", val_to_str(opcode
, opcodevalues
, "Unknown"));
2043 /*check for type of service..*/
2044 service
= tvb_get_guint8(tvb
, offset
);
2045 service
= service
& 0xF0;
2048 /*get the action id.*/
2049 action
= tvb_get_ntohs(tvb
, offset
);
2050 action
= action
& 0x03FF;
2053 case 1 :/*for Service Management..*/
2055 proto_tree_add_item(mid_tree
, hf_mih_serv_actionid
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
2056 col_append_fstr(pinfo
->cinfo
, COL_INFO
, "\"%s\"", val_to_str(action
, serv_act_id_values
, "Unknown"));
2058 case 2 :/*for event services..*/
2060 proto_tree_add_item(mid_tree
, hf_mih_event_actionid
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
2061 col_append_fstr(pinfo
->cinfo
, COL_INFO
, "\"%s\"", val_to_str(action
, event_act_id_values
, "Unknown"));
2063 case 3 :/*for Command Services..*/
2065 proto_tree_add_item(mid_tree
, hf_mih_command_actionid
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
2066 col_append_fstr(pinfo
->cinfo
, COL_INFO
, "\"%s\"", val_to_str(action
, command_act_id_values
, "Unknown"));
2068 case 4 :/*for Information Services..*/
2070 proto_tree_add_item(mid_tree
, hf_mih_info_actionid
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
2071 col_append_fstr(pinfo
->cinfo
, COL_INFO
, "\"%s\"", val_to_str(action
, info_act_id_values
, "Unknown"));
2078 /* displaying the transaction id*/
2079 proto_tree_add_item(mih_tree
, hf_mih_tid
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
2081 /*displaying the payload length...*/
2082 proto_tree_add_item(mih_tree
, hf_mih_pay_len
, tvb
, offset
+ 2, 2, ENC_BIG_ENDIAN
);
2085 payload_length
= tvb_get_ntohs(tvb
, offset
);
2088 /*now the type length values list is present get them and decode it...
2089 loop for showing all the tlvs....*/
2090 while(payload_length
> 0 && fragment
==0)
2092 /* Adding a third case here since the 802.21 standard defines 3 cases */
2094 /*case 1: If the number of octets occupied by the Value field is LESS THAN 128, the size of the Length field is always
2095 one octet and the MSB of the octet is set to the value 0. The values of the other seven bits of this octet
2096 indicate the actual length of the Value field.
2098 /*case 2: If the number of octets occupied by the Value field is EXACTLY 128, the size of the Length field is one octet.
2099 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'.
2101 /*case 3: If the number of octets occupied by the Value field is GREATER THAN 128, then the Length field is always greater
2102 than one octet. The MSB of the first octet of the Length field is set to the value 1 and the remaining seven
2103 bits of the first octet indicate the number of octets that are appended further. The number represented by the
2104 second and subsequent octets of the Length field, when added to 128, indicates the total size of the Value field, in octets.
2106 /*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. */
2108 /*code for testing if length is less than or equal to 128*/
2109 len
= tvb_get_guint8(tvb
, offset
+1);
2112 /*length is greater than 128 => len of len is greater than 1 byte*/
2113 /*Expanding conditions where the length values can be from 1- 8 octets long*/
2114 /*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*/
2115 len_of_len
= (guint8
)len
- 128;
2116 switch (len_of_len
) /*depending on the detected length , we read a different amount of bytes from the tvb buffer*/
2119 len
= tvb_get_guint8(tvb
, offset
+2);
2122 len
= tvb_get_ntohs(tvb
, offset
+2);
2125 len
= tvb_get_ntoh24(tvb
, offset
+2);
2128 len
= tvb_get_ntohl(tvb
, offset
+2);
2131 len
= tvb_get_ntoh40(tvb
, offset
+2);
2134 len
= tvb_get_ntoh48(tvb
, offset
+2);
2137 len
= tvb_get_ntoh56(tvb
, offset
+2);
2140 len
= tvb_get_ntoh64(tvb
, offset
+2);
2149 /*TODO: TLVs greater than the payload_length are fragmented, and currently not parsed*/
2150 if(len
<= (guint64
)payload_length
)
2153 item
= proto_tree_add_text(mih_tree
, tvb
, offset
, 1 + len_of_len
+ (guint32
)len
, "MIH TLV : %s", val_to_str(tvb_get_guint8(tvb
, offset
), typevaluenames
, "UNKNOWN"));
2154 tlv_tree
= proto_item_add_subtree(item
, ett_tlv
);
2157 proto_tree_add_item(tlv_tree
, hf_mih_type
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
2158 type
= tvb_get_guint8(tvb
, offset
);
2163 proto_tree_add_item(tlv_tree
, hf_mih_type_length
, tvb
, offset
+1, len_of_len
, ENC_BIG_ENDIAN
);
2165 else if(len_of_len
>1 && len_of_len
<=5)
2167 proto_tree_add_item(tlv_tree
, hf_mih_type_length_ext
, tvb
, offset
+2, len_of_len
-1, ENC_BIG_ENDIAN
);
2171 offset
+= 1 + len_of_len
;
2173 /*For Value fields*/
2174 /*TODO: this assumes the maximum value length is 2^32. Dissecting bigger data fields would require breaking the data into chunks*/
2176 dissect_mih_tlv(tvb
, offset
, tlv_tree
, type
, (guint32
)len
);
2177 offset
+= (guint32
)len
;
2178 payload_length
-= (1 + len_of_len
+ (guint16
)len
);
2185 proto_tree_add_text(mih_tree
, tvb
, offset
, -1, "FRAGMENTED TLV");
2190 proto_tree_add_text(mih_tree
, tvb
, offset
, -1, "FRAGMENTED TLV");
2193 /*dissector initialistaion*/
2194 void proto_register_mih(void)
2196 static hf_register_info hf
[] =
2237 "MIH Unauthenticated info request",
2249 "MIH more fragment",
2289 VALS(servicevalues
),
2307 &hf_mih_serv_actionid
,
2313 VALS(serv_act_id_values
),
2319 &hf_mih_event_actionid
,
2325 VALS(event_act_id_values
),
2331 &hf_mih_command_actionid
,
2337 VALS(command_act_id_values
),
2343 &hf_mih_info_actionid
,
2349 VALS(info_act_id_values
),
2385 VALS(typevaluenames
),
2391 &hf_mih_type_length
,
2403 &hf_mih_type_length_ext
,
2481 VALS(boolean_types
),
2493 VALS(link_type_vals
),
2499 &hf_link_subtype_eth
,
2501 "Ethernet - IEEE802.3 Subtype",
2502 "mih.link_subtype_eth",
2511 &hf_link_subtype_eth_10m
,
2514 "mih.link_subtype_eth.10mb",
2523 &hf_link_subtype_eth_100m
,
2526 "mih.link_subtype_eth.100mb",
2535 &hf_link_subtype_eth_1000m
,
2538 "mih.link_subtype_eth.1000mb",
2547 &hf_link_subtype_wireless_other
,
2549 "Wireless Other Subtype",
2550 "mih.link_subtype_wireless_other",
2559 &hf_link_subtype_wireless_other_dvb
,
2562 "mih.link_subtype_wireless_other.dvb",
2571 &hf_link_subtype_wireless_other_tdmb
,
2574 "mih.link_subtype_wireless_other.tdmb",
2583 &hf_link_subtype_wireless_other_atsc
,
2586 "mih.link_subtype_wireless_other.atsc",
2595 &hf_link_subtype_ieee80211
,
2597 "Wireless - IEEE 802.11 Subtype",
2598 "mih.link_subtype_ieee80211",
2607 &hf_link_subtype_ieee80211_24
,
2610 "mih.link_subtype_ieee80211.2_4ghz",
2619 &hf_link_subtype_ieee80211_5
,
2622 "mih.link_subtype_ieee80211.5ghz",
2631 &hf_link_subtype_ieee80211_49
,
2634 "mih.link_subtype_ieee80211.4_9ghz",
2643 &hf_link_subtype_ieee80211_365
,
2646 "mih.link_subtype_ieee80211.3_65ghz",
2655 &hf_link_subtype_ieee80211_316
,
2658 "mih.link_subtype_ieee80211.316thz",
2667 &hf_link_subtype_umts
,
2669 "Wireless - UMTS Subtype",
2670 "mih.link_subtype_umts",
2679 &hf_link_subtype_umts_99
,
2682 "mih.link_subtype_umts.rel99",
2691 &hf_link_subtype_umts_4
,
2694 "mih.link_subtype_umts.rel4",
2703 &hf_link_subtype_umts_5
,
2706 "mih.link_subtype_umts.rel5",
2715 &hf_link_subtype_umts_6
,
2718 "mih.link_subtype_umts.rel6",
2727 &hf_link_subtype_umts_7
,
2729 "Rel-7 (MIMO/OFDM)",
2730 "mih.link_subtype_umts.rel7",
2739 &hf_link_subtype_umts_8
,
2742 "mih.link_subtype_umts.rel8",
2751 &hf_link_subtype_cdma2000
,
2753 "Wireless - cdma2000-HRPD",
2754 "mih.link_subtype_cdma2000",
2763 &hf_link_subtype_cdma2000_0
,
2766 "mih.link_subtype_cdma2000.rev0",
2775 &hf_link_subtype_cdma2000_a
,
2778 "mih.link_subtype_cdma2000.reva",
2787 &hf_link_subtype_cdma2000_b
,
2790 "mih.link_subtype_cdma2000.revb",
2799 &hf_link_subtype_cdma2000_c
,
2802 "mih.link_subtype_cdma2000.revc",
2811 &hf_link_subtype_ieee80216
,
2813 "Wireless - IEEE 802.16",
2814 "mih.link_subtype_ieee80216",
2823 &hf_link_subtype_ieee80216_25
,
2826 "mih.link_subtype_ieee80216.2_5ghz",
2835 &hf_link_subtype_ieee80216_35
,
2838 "mih.link_subtype_ieee80216.3_5ghz",
2850 "mih.link_type_ext",
2886 "mih.link_dn_reason",
2889 VALS(link_dn_reason_vals
),
2895 &hf_link_gdn_reason
,
2897 "LINK Going Down Reason",
2898 "mih.link_gdn_reason",
2901 VALS(link_gdn_reason_vals
),
2922 "mih.link_param_gen",
2925 VALS(link_param_gen_vals
),
2934 "mih.link_param_qos",
2937 VALS(link_param_qos_vals
),
2946 "mih.link_param_gg",
2949 VALS(link_param_gg_vals
),
2955 &hf_link_param_edge
,
2958 "mih.link_param_edge",
2970 "mih.link_param_eth",
2979 &hf_link_param_802_11
,
2982 "mih.link_param_802_11",
2985 VALS(link_param_802_11_vals
),
2994 "mih.link_param_c2k",
2997 VALS(link_param_c2k_hrpd_vals
),
3006 "mih.link_param_fdd",
3009 VALS(link_param_fdd_vals
),
3015 &hf_link_param_hrpd
,
3018 "mih.link_param_hrpd",
3021 VALS(link_param_c2k_hrpd_vals
),
3027 &hf_link_param_802_16
,
3030 "mih.link_param_802_16",
3039 &hf_link_param_802_20
,
3042 "mih.link_param_802_20",
3051 &hf_link_param_802_22
,
3054 "mih.link_param_802_22",
3063 &hf_link_param_value
,
3066 "mih.link_param_value",
3093 VALS(link_ac_type_vals
),
3099 &hf_link_ac_ext_time
,
3102 "mih.link_ac_ext_time",
3114 "mih.link_ac_result",
3117 VALS(link_ac_result_vals
),
3129 VALS(link_dn_reason_vals
),
3141 VALS(ho_status_vals
),
3153 VALS(mbb_ho_supp_vals
),
3159 &hf_reg_request_code
,
3161 "REGISTER REQUEST CODE",
3162 "mih.reg_request_code",
3165 VALS(reg_request_code_vals
),
3177 VALS(ip_renewal_vals
),
3183 &hf_dev_states_resp
,
3185 "SUPPORTED TRANSPORTS",
3186 "mih.dev_states_resp",
3189 VALS(dev_states_req_vals
),
3198 "mih.dev_states_resp.batt_level",
3210 "mih.dev_states_resp.dev_info",
3221 "Maximum Response Size",
3222 "mih.max_resp_size",
3234 "mih.time_interval",
3243 &hf_valid_time_interval
,
3245 "Valid Time Interval",
3246 "mih.valid_time_interval",
3269 "Link Address Type",
3270 "mih.link_addr_type",
3273 VALS(link_addr_types
),
3279 &hf_link_transport_addr_type
,
3281 "Link Transport Address Type",
3282 "mih.link_transport_addr_type",
3291 &hf_link_addr_string
,
3293 "Link Address String",
3294 "mih.link_addr_string",
3329 "Public Land Mobile Network (PLMN) ID",
3339 &hf_location_area_id
,
3341 "Location Area Code (LAC)",
3354 "mih.threshold_val",
3363 &hf_threshold_x_dir
,
3365 "Threshold Direction",
3366 "mih.threshold_x_dir",
3369 VALS(threshold_x_dir_vals
),
3375 &hf_threshold_action
,
3378 "mih.threshold_action",
3381 VALS(threshold_action_vals
),
3390 "mih.config_status",
3393 VALS(boolean_types
),
3401 "Number of differentiable classes",
3413 "Number of transmit queues supported",
3437 "Pre-defined Configuration Identifier",
3438 "mih.predef_cfg_id",
3461 "Auxiliary Network ID",
3471 &hf_sig_strength_dbm
,
3473 "Signal Strength (dBm)",
3483 &hf_sig_strength_per
,
3485 "Signal Strength (%)",
3497 "Class of Service ID",
3509 "Class of Service Value",
3533 "Link Data Rate (kb/s)",
3534 "mih.link_data_rate",
3558 "mih.rdf_mime_type",
3567 &hf_link_res_status
,
3573 VALS(boolean_types
),
3579 &hf_res_retention_status
,
3581 "Info query RDF schema URL",
3582 "mih.res_retention_status",
3585 VALS(boolean_types
),
3593 "Query resource report flag",
3597 VALS(boolean_types
),
3603 &hf_unauth_info_req
,
3605 "Unauthenticated information request",
3606 "mih.unauth_info_req",
3609 VALS(boolean_types
),
3663 /*event related hf fields*/
3677 &hf_event_link_detect
,
3679 "MIH LINK Detected",
3680 "mih.event_list.link_detect",
3692 "mih.event_list.link_up",
3704 "mih.event_list.link_down",
3713 &hf_event_link_param
,
3715 "MIH LINK Parameters Report",
3716 "mih.event_list.link_param_rpt",
3727 "MIH LINK Going Down",
3728 "mih.event_list.link_gd",
3739 "Link Handover Imminent",
3740 "mih.event_list.link_ho_imm",
3751 "MIH LINK Handover Complete",
3752 "mih.event_list.link_ho_comp",
3761 &hf_event_pdu_tx_stat
,
3763 "MIH LINK PDU Transmit Status",
3764 "mih.event_list.link_pdu_tx_stat",
3773 /* cmd related hf fields */
3790 "MIH LINK Event Subscribe",
3791 "mih.cmd_list.evt_subs",
3800 &hf_cmd_event_unsub
,
3802 "Link Event Unsubscribe",
3803 "mih.cmd_list.evt_unsubs",
3807 CMD_EVT_UNSUBS_MASK
,
3814 "MIH LINK Get Parameters",
3815 "mih.cmd_list.evt_get_param",
3826 "Link Configure Thresholds",
3827 "mih.cmd_list.evt_conf_th",
3836 &hf_cmd_link_action
,
3839 "mih.cmd_list.evt_link_action",
3848 /*header fields for iq type list*/
3852 "List of of IS query types",
3865 "mih.iq_type_list.bin_data",
3877 "mih.iq_type_list.rdf_data",
3889 "mih.iq_type_list.rdf_sch_u",
3901 "mih.iq_type_list.rdf_sch",
3913 "mih.iq_type_list.ie_net_type",
3917 IQ_IE_NET_TYPE_MASK
,
3925 "mih.iq_type_list.ie_op_id",
3936 "IE_SERVICE_PROVIDER_ID",
3937 "mih.iq_type_list.ie_serv_id",
3946 &hf_iq_country_code
,
3949 "mih.iq_type_list.ie_country_code",
3961 "mih.iq_type_list.ie_net_id",
3972 "IE_NETWORK_AUX_ID",
3973 "mih.iq_type_list.net_aux_id",
3984 "IE_ROAMING_PARTNERS",
3985 "mih.iq_type_list.ie_roam_part",
3997 "mih.iq_type_list.ie_cost",
4009 "mih.iq_type_list.ie_net_qos",
4020 "IE_NETWORK_DATA_RATE",
4021 "mih.iq_type_list.ie_net_dat_rt",
4032 "IE_NET_REGULT_DOMAIN",
4033 "mih.iq_type_list.ie_net_reg_dom",
4044 "IE_NET_FREQUENCY_BANDS",
4045 "mih.iq_type_list.ie_net_freq",
4054 &hf_iq_ip_cfg_mthds
,
4056 "IE_NET_IP_CFG_METHODS",
4057 "mih.iq_type_list.ie_net_ip_cfg",
4068 "IE_NET_CAPABILITIES",
4069 "mih.iq_type_list.ie_net_cap",
4080 "IE_NET_SUPPORTED_LCP",
4081 "mih.iq_type_list.ie_net_sup_lcp",
4092 "IE_NET_MOB_MGMT_PROT",
4093 "mih.iq_type_list.ie_net_mob_mg",
4104 "IE_NET_EMSERV_PROXY",
4105 "mih.iq_type_list.ie_net_emer_serv",
4114 &hf_iq_net_ims_pcscf
,
4116 "IE_NET_IMS_PROXY_CSCF",
4117 "mih.iq_type_list.ie_net_ims_pcscf",
4128 "IE_NET_MOBILE_NETWORK",
4129 "mih.iq_type_list.ie_net_mob_net",
4141 "mih.iq_type_list.ie_poa_link",
4145 IQ_IE_POA_ADDR_MASK
,
4153 "mih.iq_type_list.ie_poa_loc",
4162 &hf_iq_poa_chan_range
,
4164 "IE_POA_CHANNEL_RANGE",
4165 "mih.iq_type_list.ie_poa_chan_rg",
4169 IQ_IE_POA_CHAN_MASK
,
4174 &hf_iq_poa_sys_info
,
4176 "IE_POA_SYSTEM_INFO",
4177 "mih.iq_type_list.ie_poa_syst_info",
4186 &hf_iq_poa_sub_info
,
4188 "IE_POA_SUBNET_INFO",
4189 "mih.iq_type_list.ie_poa_sub_info",
4201 "mih.iq_type_list.ie_poa_ip",
4210 /*header fields for mob mgmt*/
4214 "List of supported mobility management protocols",
4227 "mih.mob_list.mip4",
4238 "Mobile IPv4 Regional Registration",
4239 "mih.mob_list.mip4_reg",
4251 "mih.mob_list.mip6",
4262 "Hierarchical Mobile IPv6",
4263 "mih.mob_list.hmip6",
4274 "Low Latency Handoffs",
4275 "mih.mob_list.low_lat",
4286 "Mobile IPv6 Fast Handovers",
4287 "mih.mob_list.fmip6",
4298 "IKEv2 Mobility and Multihoming Protocol",
4299 "mih.mob_list.ike_multi",
4308 /*header fields for configure methods*/
4312 "A set of IP configuration methods",
4324 "IPv4 static configuration",
4325 "mih.ip_cfg_mthds.static",
4337 "mih.ip_cfg_mthds.dhcp4",
4348 "Mobile IPv4 with foreign agent",
4349 "mih.ip_cfg_mthds.mip4_fa",
4353 IP_CFG_MIP4_FA_MASK
,
4360 "Mobile IPv4 without FA",
4361 "mih.ip_cfg_mthds.mip4_wo_fa",
4365 IP_CFG_MIP4_NFA_MASK
,
4372 "IPv6 stateless address configuration",
4373 "mih.ip_cfg_mthds.ip6_state_less",
4385 "mih.ip_cfg_mthds.dhcp6",
4396 "IPv6 manual configuration",
4397 "mih.ip_cfg_mthds.ip6_manual",
4401 IP_CFG_IP6_MAN_MASK
,
4406 /*header fields for transport lists*/
4410 "Supported Transports",
4423 "mih.trans_list.udp",
4435 "mih.trans_list.tcp",
4444 /*header fields for device state request*/
4448 "Device Status Request",
4449 "mih.dev_states_req",
4458 &hf_dev_states_req_dev_info
,
4461 "mih.dev_states_req.dev_info",
4470 &hf_dev_states_req_batt_lvl
,
4473 "mih.dev_states_req.batt_level",
4482 /*header fields for MIH Capabilities*/
4486 "Supported MIH Capability",
4498 "Event Service (ES)",
4499 "mih.mihcap.event_service",
4510 "Command Service (CS)",
4511 "mih.mihcap.command_service",
4522 "Information Service (IS)",
4523 "mih.mihcap.information_service",
4532 /*header fields for High Level Network Capabilities*/
4536 "High Level Network Capability",
4561 "mih.net_caps.qos0",
4573 "mih.net_caps.qos1",
4585 "mih.net_caps.qos2",
4597 "mih.net_caps.qos3",
4609 "mih.net_caps.qos4",
4621 "mih.net_caps.qos5",
4633 "mih.net_caps.internet_access",
4644 "Emergency Services",
4645 "mih.net_caps.emergency_services",
4654 &hf_net_caps_mihcap
,
4657 "mih.net_caps.mihcap",
4666 /*header fields for Link Action attributes*/
4670 "Link Action Attribute",
4680 &hf_link_ac_attr_link_scan
,
4683 "mih.link_ac_attr.link_scan",
4692 &hf_link_ac_attr_link_res_retain
,
4694 "Link Resource Retain",
4695 "mih.link_ac_attr.link_res_retain",
4704 &hf_link_ac_attr_data_fwd_req
,
4706 "Forward Data Request",
4707 "mih.link_ac_attr.data_fwd_req",
4717 /* Setup protocol subtree array */
4718 static gint
*ett
[] =
4726 &ett_mob_mgt_bitmap
,
4727 &ett_cfg_mtd_bitmap
,
4728 &ett_iq_type_bitmap
,
4729 &ett_trans_list_bitmap
,
4730 &ett_dev_states_bitmap
,
4732 &ett_net_caps_bitmap
,
4733 &ett_ac_attr_bitmap
,
4734 &ett_subtype_eth_bitmap
,
4735 &ett_subtype_wireless_other_bitmap
,
4736 &ett_subtype_ieee80211_bitmap
,
4737 &ett_subtype_umts_bitmap
,
4738 &ett_subtype_cdma2000_bitmap
,
4739 &ett_subtype_ieee80216_bitmap
4742 proto_mih
= proto_register_protocol("Media-Independent Handover", "MIH", "mih");
4743 proto_register_field_array(proto_mih
, hf
, array_length(hf
));
4744 proto_register_subtree_array(ett
, array_length(ett
));
4748 /*dissector handoff*/
4749 void proto_reg_handoff_mih(void)
4751 dissector_handle_t mih_handle
;
4753 mih_handle
= create_dissector_handle(dissect_mih
, proto_mih
);
4755 dissector_add_uint("udp.port", MIH_PORT
, mih_handle
);
4756 dissector_add_uint("tcp.port", MIH_PORT
, mih_handle
);
4759 dissector_add_uint("ethertype", ETHERTYPE_MIH
, mih_handle
);