Revert "TODO epan/dissectors/asn1/kerberos/packet-kerberos-template.c new GSS flags"
[wireshark-sm.git] / epan / dissectors / packet-mpeg-dsmcc.c
blobbdd8c72164f51398efc05d2ea928c0e48f431ef5
1 /* packet-mpeg-dsmcc.c
3 * Routines for ISO/IEC 13818-6 DSM-CC
4 * Copyright 2012, Weston Schmidt <weston_schmidt@alumni.purdue.edu>
5 * Copyright 2019, Anthony Crawford <anthony.r.crawford@charter.com>
7 * Wireshark - Network traffic analyzer
8 * By Gerald Combs <gerald@wireshark.org>
9 * Copyright 1998 Gerald Combs
11 * SPDX-License-Identifier: GPL-2.0-or-later
14 #include "config.h"
16 #include <epan/packet.h>
17 #include <epan/prefs.h>
18 #include <epan/expert.h>
19 #include <epan/crc32-tvb.h>
20 #include "packet-mpeg-sect.h"
22 void proto_register_dsmcc(void);
23 void proto_reg_handoff_dsmcc(void);
25 static dissector_handle_t dsmcc_ts_handle, dsmcc_tcp_handle, dsmcc_udp_handle;
27 /* NOTE: Please try to keep this status comment up to date until the spec is
28 * completely implemented - there are a large number of tables in the spec.
30 * 13818-6 Table status:
32 * Missing tables:
33 * 3-1 3-2 3-3 3-4 3-6 3-7 3-8 3-9
34 * 4-61, 4-81, 4-82, 4-87, 4-88
35 * 5-*
36 * 6-4
37 * 7-5 7-8 7-10 7-12
38 * 8-2 8-3 8-4 8-6
39 * 9-5 9-6
40 * 10-*
41 * 11-*
42 * 12-*
44 * Dissected tables:
45 * 2-1 2-4 2-6 2-7
46 * 4-x
47 * 6-1
48 * 7-6 7-7
49 * 9-2
50 * J.3
52 * Validated (all parameters are checked) U-N Messages:
53 * 0x4010, 0x4011, 0x4020, 0x4021, 0x4022, 0x4023, 0x40b0
54 * 0x8012, 0x8013, 0x8022, 0x8023, 0x8030, 0x8031, 0x8060, 0x8061, 0x80b0
55 * Unvalidated U-N messages:
56 * 4032, 4033, 4042, 4043, 4060, 4061, 4062, 4063,
57 * 4070, 4071, 4072, 4073, 4082, 4090, 40a2, 40a3
58 * 8041, 8042, 8050, 8051, 8062, 8063, 8070, 8071,
59 * 8072, 8073, 8082, 8092, 80a0, 80a1, 80a2, 80a3
64 static int proto_dsmcc;
65 static bool dsmcc_sect_check_crc;
67 /* NOTE: Please add values numerically according to 13818-6 so it is easier to
68 * keep track of what parameters/tables are associated with each other.
71 /* table 2-1 dsmccMessageHeader - start */
72 static int hf_dsmcc_protocol_discriminator;
73 static int hf_dsmcc_type;
74 static int hf_dsmcc_message_id;
75 static int hf_dsmcc_transaction_id;
76 static int hf_dsmcc_header_reserved;
77 static int hf_dsmcc_adaptation_length;
78 static int hf_dsmcc_message_length;
79 /* table 2-1 dsmccMessageHeader - end */
81 /* table 2-3 transactionId - start */
82 static int hf_dsmcc_un_sess_flag_transaction_id_originator;
83 static int hf_dsmcc_un_sess_flag_transaction_id_number;
84 /* table 2-3 transactionId - end */
86 /* table 2-4 dsmccAdaptationHeader - start */
87 static int hf_dsmcc_adaptation_type;
88 /* table 2-4 dsmccAdaptationHeader - end */
90 /* table 2-6 dsmccConditionalAccess - start */
91 static int hf_dsmcc_adaptation_ca_reserved;
92 static int hf_dsmcc_adaptation_ca_system_id;
93 static int hf_dsmcc_adaptation_ca_length;
94 /* table 2-6 dsmccConditionalAccess - end */
96 /* table 2-7 dsmccUserId - start */
97 static int hf_dsmcc_adaptation_user_id_reserved;
98 /* table 2-7 dsmccUserId - end */
100 /* table 4-2, 4-3, 4-4 U-N messageDiscriminator - start */
101 /*static int hf_dsmcc_un_sess_message_discriminator;*/
102 static int hf_dsmcc_un_sess_flag_message_discriminator;
103 static int hf_dsmcc_un_sess_flag_message_scenario;
104 static int hf_dsmcc_un_sess_flag_message_type;
105 /* table 4-2, 4-3, 4-4 U-N messageDiscriminator - end */
107 /* other tables in section 4.2 - start */
108 static int hf_dsmcc_un_sess_response;
109 static int hf_dsmcc_un_sess_reason;
110 static int hf_dsmcc_un_sess_reserved;
111 /* other tables in section 4.2 - end */
113 /* table 4-6 U-N user data format - start */
114 static int hf_dsmcc_un_sess_uu_data_len;
115 static int hf_dsmcc_un_sess_uu_data;
116 static int hf_dsmcc_un_sess_priv_data_len;
117 static int hf_dsmcc_un_sess_priv_data;
118 /* table 4-6 U-N user data format - end */
120 /* table 4-7 U-N Resources - start */
121 static int hf_dsmcc_un_sess_rsrc_desc_count;
122 /* table 4-7 U-N Resources - end */
124 /* table 4-10 U-N Server Session Setup Indication - start */
125 static int hf_dsmcc_un_sess_forward_count;
126 /* table 4-10 U-N Server Session Setup Indication - end */
128 /* 4-26 Server Delete Resource Request - start */
129 static int hf_dsmcc_un_sess_resource_count;
130 static int hf_dsmcc_un_sess_resource_num;
131 /* 4-26 Server Delete Resource Request - end */
133 /* table 4-30, 4-31, 4-32, 4-33, 4-34, 4-35, 4-36 - start */
134 static int hf_dsmcc_un_sess_status_type;
135 static int hf_dsmcc_un_sess_status_count;
136 static int hf_dsmcc_un_sess_status_byte;
137 /* table 4-30, 4-31, 4-32, 4-33, 4-34, 4-35, 4-36 - end */
139 /* table 4-56 Client Session In Progress - start */
140 static int hf_dsmcc_un_sess_session_count;
141 /* table 4-56 Client Session In Progress - end */
143 /* table 4-58 Message Fields data types - start */
144 static int hf_dsmcc_un_sess_session_id_device_id;
145 static int hf_dsmcc_un_sess_session_id_session_number;
146 /* table 4-58 Message Fields data types - end */
148 /* table 4-63 U-N common descriptor header - start */
149 static int hf_dsmcc_un_sess_rsrc_request_id;
150 static int hf_dsmcc_un_sess_rsrc_descriptor_type;
151 static int hf_dsmcc_un_sess_rsrc_number;
152 static int hf_dsmcc_un_sess_rsrc_association_tag;
153 static int hf_dsmcc_un_sess_rsrc_flags;
154 static int hf_dsmcc_un_sess_rsrc_status;
155 static int hf_dsmcc_un_sess_rsrc_desc_data_fields_length;
156 static int hf_dsmcc_un_sess_rsrc_data_field_count;
157 static int hf_dsmcc_un_sess_rsrc_type_owner_id;
158 static int hf_dsmcc_un_sess_rsrc_type_owner_value;
159 /* table 4-63 U-N common descriptor header - end */
161 /* table 4-64 U-N resource number assignor - start */
162 static int hf_dsmcc_un_sess_rsrc_flag_num_assignor;
163 static int hf_dsmcc_un_sess_rsrc_flag_num_value;
164 /* table 4-64 U-N resource number assignor - end */
166 /* table 4-65 U-N resource association tag assignor - start */
167 static int hf_dsmcc_un_sess_rsrc_flag_association_tag_assignor;
168 static int hf_dsmcc_un_sess_rsrc_flag_association_tag_value;
169 /* table 4-65 U-N resource association tag assignor - end */
171 /* table 4-66 U-N resource allocator - start */
172 static int hf_dsmcc_un_sess_rsrc_flag_allocator;
173 /* table 4-66 U-N resource allocator - end */
175 /* table 4-67 U-N resource attribute - start */
176 static int hf_dsmcc_un_sess_rsrc_flag_attribute;
177 /* table 4-67 U-N resource attribute - end */
179 /* table 4-68 U-N resource view - start */
180 static int hf_dsmcc_un_sess_rsrc_flag_view;
181 /* table 4-68 U-N resource view - end */
183 /* table 4-71 U-N dsmccResourceDescriptorValue() format - start */
184 static int hf_dsmcc_un_sess_rsrc_value_type;
185 static int hf_dsmcc_un_sess_rsrc_value_count;
186 static int hf_dsmcc_un_sess_rsrc_value_data;
187 static int hf_dsmcc_un_sess_rsrc_most_desired;
188 static int hf_dsmcc_un_sess_rsrc_least_desired;
189 /* table 4-71 U-N dsmccResourceDescriptorValue() format - end */
191 /* table 4-74 U-N Continuous Feed Session resource descriptor - start */
192 static int hf_dsmcc_un_sess_rsrc_cfs_num_count;
193 static int hf_dsmcc_un_sess_rsrc_cfs_num;
194 /* table 4-74 U-N Continuous Feed Session resource descriptor - end */
196 /* table 4-75 U-N ATM Connection resource descriptor - start */
197 static int hf_dsmcc_un_sess_rsrc_atm_vpi;
198 static int hf_dsmcc_un_sess_rsrc_atm_vci;
199 /* table 4-75 U-N ATM Connection resource descriptor - end */
201 /* table 4-76 MPEG Program - start */
202 static int hf_dsmcc_un_sess_rsrc_mpeg_ca_pid;
203 static int hf_dsmcc_un_sess_rsrc_mpeg_elem_stream_count;
204 /* table 4-76 MPEG Program - end */
206 /* table 4-77 Physical Channel - start */
207 static int hf_dsmcc_un_sess_rsrc_phys_chan_direction;
208 /* table 4-77 Physical Channel - end */
210 /* table 4-84 IP - start */
211 static int hf_dsmcc_un_sess_rsrc_src_ip_addr;
212 static int hf_dsmcc_un_sess_rsrc_src_ip_port;
213 static int hf_dsmcc_un_sess_rsrc_dst_ip_addr;
214 static int hf_dsmcc_un_sess_rsrc_dst_ip_port;
215 static int hf_dsmcc_un_sess_rsrc_ip_protocol;
216 /* table 4-84 IP - end */
218 /* table 4-86 PSTN Setup - start */
219 static int hf_dsmcc_un_sess_rsrc_pstn_calling_id;
220 static int hf_dsmcc_un_sess_rsrc_pstn_called_id;
221 /* table 4-86 PSTN Setup - end */
223 /* Table 4-89 Q.922 Connection - start */
224 static int hf_dsmcc_un_sess_rsrc_dlci_count;
225 static int hf_dsmcc_un_sess_rsrc_dlci;
226 static int hf_dsmcc_un_sess_rsrc_dl_association_tag;
227 /* Table 4-89 Q.922 Connection - end */
229 /* table 4-90 Shared Resource - start */
230 static int hf_dsmcc_un_sess_rsrc_shared_resource_num;
231 /* table 4-90 Shared Resource - end */
233 /* table 4-91 Shared Request ID - start */
234 static int hf_dsmcc_un_sess_rsrc_shared_resource_request_id;
235 /* table 4-91 Shared Request ID - end */
237 /* table 4-92 Headend List - start */
238 static int hf_dsmcc_un_sess_rsrc_headend_count;
239 static int hf_dsmcc_un_sess_rsrc_headend_code;
240 /* table 4-92 Headend List - end */
242 /* table 4-94 SDB Continuous Feed - start */
243 static int hf_dsmcc_un_sess_rsrc_sdb_id;
244 static int hf_dsmcc_un_sess_rsrc_sdb_program_count;
245 static int hf_dsmcc_un_sess_rsrc_sdb_association_tag;
246 static int hf_dsmcc_un_sess_rsrc_sdb_broadcast_program_id;
247 /* table 4-94 SDB Continuous Feed - end */
249 /* table 4-95 SDB Associations - start */
250 static int hf_dsmcc_un_sess_rsrc_sdb_control_association_tag;
251 static int hf_dsmcc_un_sess_rsrc_sdb_program_association_tag;
252 /* table 4-95 SDB Associations - end */
254 /* table 4-96 SDB Entitlement - start */
255 static int hf_dsmcc_un_sess_rsrc_sdb_exclude_count;
256 static int hf_dsmcc_un_sess_rsrc_sdb_include_count;
257 /* table 4-96 SDB Entitlement - end */
259 /* user defined 0xf001-0xf007 - start */
260 /* Time Warner Cable Pegasus Session Setup Protocol
261 * Version 2.3, May 19 2003
262 * These user defined resource descriptors have been implemented in
263 * VOD BackOffice products by Time Warner, Arris and Ericsson. */
264 static int hf_dsmcc_un_sess_rsrc_trans_system;
265 static int hf_dsmcc_un_sess_rsrc_inner_coding;
266 static int hf_dsmcc_un_sess_rsrc_split_bitstream;
267 static int hf_dsmcc_un_sess_rsrc_mod_format;
268 static int hf_dsmcc_un_sess_rsrc_symbol_rate;
269 static int hf_dsmcc_un_sess_rsrc_reserved;
270 static int hf_dsmcc_un_sess_rsrc_interleave_depth;
271 static int hf_dsmcc_un_sess_rsrc_modulation_mode;
272 static int hf_dsmcc_un_sess_rsrc_fec;
273 static int hf_dsmcc_un_sess_rsrc_headend_flag;
274 static int hf_dsmcc_un_sess_rsrc_headend_tsid;
275 static int hf_dsmcc_un_sess_rsrc_server_ca_copyprotect;
276 static int hf_dsmcc_un_sess_rsrc_server_ca_usercount;
277 static int hf_dsmcc_un_sess_rsrc_client_ca_info_length;
278 static int hf_dsmcc_un_sess_rsrc_client_ca_info_data;
279 static int hf_dsmcc_un_sess_rsrc_service_group;
280 /* user defined 0xf001-0xf007 - end */
282 /* table 6-1 compatibilityDescriptor - start */
283 static int hf_compat_desc_length;
284 static int hf_compat_desc_count;
285 static int hf_desc_type;
286 static int hf_desc_length;
287 static int hf_desc_spec_type;
288 static int hf_desc_spec_data;
289 static int hf_desc_model;
290 static int hf_desc_version;
291 static int hf_desc_sub_desc_count;
292 static int hf_desc_sub_desc_type;
293 static int hf_desc_sub_desc_len;
294 /* table 6-1 compatibilityDescriptor - end */
296 /* table 7-3 dsmccDownloadDataHeader - start */
297 static int hf_dsmcc_dd_download_id;
298 static int hf_dsmcc_dd_message_id;
299 /* table 7-3 dsmccDownloadDataHeader - end */
301 /* table 7-6 dsmccDownloadInfoIndication/InfoResponse - start */
302 static int hf_dsmcc_dii_download_id;
303 static int hf_dsmcc_dii_block_size;
304 static int hf_dsmcc_dii_window_size;
305 static int hf_dsmcc_dii_ack_period;
306 static int hf_dsmcc_dii_t_c_download_window;
307 static int hf_dsmcc_dii_t_c_download_scenario;
308 static int hf_dsmcc_dii_number_of_modules;
309 static int hf_dsmcc_dii_module_id;
310 static int hf_dsmcc_dii_module_size;
311 static int hf_dsmcc_dii_module_version;
312 static int hf_dsmcc_dii_module_info_length;
313 static int hf_dsmcc_dii_private_data_length;
314 /* table 7-6 dsmccDownloadInfoIndication/InfoResponse - end */
316 /* table 7-7 dsmccDownloadDataBlock - start */
317 static int hf_dsmcc_ddb_module_id;
318 static int hf_dsmcc_ddb_version;
319 static int hf_dsmcc_ddb_reserved;
320 static int hf_dsmcc_ddb_block_number;
321 /* table 7-7 dsmccDownloadDataBlock - end */
323 /* table 9-2 dsmccSection - start */
324 static int hf_dsmcc_table_id;
325 static int hf_dsmcc_section_syntax_indicator;
326 static int hf_dsmcc_private_indicator;
327 static int hf_dsmcc_reserved;
328 static int hf_dsmcc_section_length;
329 static int hf_dsmcc_table_id_extension;
330 static int hf_dsmcc_reserved2;
331 static int hf_dsmcc_version_number;
332 static int hf_dsmcc_current_next_indicator;
333 static int hf_dsmcc_section_number;
334 static int hf_dsmcc_last_section_number;
335 static int hf_dsmcc_crc;
336 static int hf_dsmcc_checksum;
337 /* table 9-2 dsmccSection - end */
339 /* table J.3 E-164 NSAP - start */
340 static int hf_dsmcc_un_sess_nsap_afi;
341 static int hf_dsmcc_un_sess_nsap_idi;
342 static int hf_dsmcc_un_sess_nsap_ho_dsp;
343 static int hf_dsmcc_un_sess_nsap_esi;
344 static int hf_dsmcc_un_sess_nsap_sel;
345 /* table J.3 E-164 NSAP - end */
347 /* TODO: this should really live in the ETV dissector, but I'm not sure how
348 * to make the functionality work exactly right yet. Will work on a patch
349 * for this next.
351 static int hf_etv_module_abs_path;
352 static int hf_etv_dii_authority;
354 static int ett_dsmcc;
355 static int ett_dsmcc_payload;
356 static int ett_dsmcc_header;
357 static int ett_dsmcc_adaptation_header;
358 static int ett_dsmcc_message_id;
359 static int ett_dsmcc_transaction_id;
360 static int ett_dsmcc_heading;
361 static int ett_dsmcc_rsrc_number;
362 static int ett_dsmcc_rsrc_association_tag;
363 static int ett_dsmcc_rsrc_flags;
364 static int ett_dsmcc_compat;
365 static int ett_dsmcc_compat_sub_desc;
366 static int ett_dsmcc_dii_module;
368 static expert_field ei_dsmcc_invalid_value;
369 static expert_field ei_dsmcc_crc_invalid;
371 #define DSMCC_TCP_PORT 13819
372 #define DSMCC_UDP_PORT 13819
374 /* DSM-CC protocol discriminator, (table 2-1) */
375 #define DSMCC_PROT_DISC 0x11
377 #define DSMCC_SSI_MASK 0x8000
378 #define DSMCC_PRIVATE_MASK 0x4000
379 #define DSMCC_RESERVED_MASK 0x3000
380 #define DSMCC_LENGTH_MASK 0x0fff
381 #define DSMCC_RESERVED2_MASK 0xc0
382 #define DSMCC_VERSION_NUMBER_MASK 0x3e
383 #define DSMCC_CURRENT_NEXT_INDICATOR_MASK 0x01
385 /* DSM-CC U-N Session Flags */
386 #define DMSCC_FLAG_MESS_DISCRIMINATOR 0xc000
387 #define DMSCC_FLAG_MESS_SCENARIO 0x3ff0
388 #define DMSCC_FLAG_MESS_TYPE 0x000f
389 #define DMSCC_FLAG_TRAN_ORIG 0xc0000000
390 #define DMSCC_FLAG_TRAN_NUM 0x3fffffff
391 #define DMSCC_FLAG_RSRC_NUM_ASSIGNOR 0xc000
392 #define DMSCC_FLAG_RSRC_NUM_VALUE 0x3fff
393 #define DMSCC_FLAG_RSRC_ASSOC_TAG_ASSIGNOR 0xc000
394 #define DMSCC_FLAG_RSRC_ASSOC_TAG_VALUE 0x3fff
395 #define DMSCC_FLAG_RSRC_VIEW 0xc0
396 #define DMSCC_FLAG_RSRC_ATTRIBUTE 0x3c
397 #define DMSCC_FLAG_RSRC_ALLOCATOR 0x03
399 /* DSM-CC protocol U-N messages, (table 4-5) */
400 /* 4-5 U-N Session Client Messages */
401 #define DSMCC_UN_SESS_CLN_SESS_SET_REQ 0x4010
402 #define DSMCC_UN_SESS_CLN_SESS_SET_CNF 0x4011
403 #define DSMCC_UN_SESS_CLN_SESS_REL_REQ 0x4020
404 #define DSMCC_UN_SESS_CLN_SESS_REL_CNF 0x4021
405 #define DSMCC_UN_SESS_CLN_SESS_REL_IND 0x4022
406 #define DSMCC_UN_SESS_CLN_SESS_REL_RES 0x4023
407 #define DSMCC_UN_SESS_CLN_ADD_RSRC_IND 0x4032
408 #define DSMCC_UN_SESS_CLN_ADD_RSRC_RES 0x4033
409 #define DSMCC_UN_SESS_CLN_DEL_RSRC_IND 0x4042
410 #define DSMCC_UN_SESS_CLN_DEL_RSRC_RES 0x4043
411 #define DSMCC_UN_SESS_CLN_STATUS_REQ 0x4060
412 #define DSMCC_UN_SESS_CLN_STATUS_CNF 0x4061
413 #define DSMCC_UN_SESS_CLN_STATUS_IND 0x4062
414 #define DSMCC_UN_SESS_CLN_STATUS_RES 0x4063
415 #define DSMCC_UN_SESS_CLN_RESET_REQ 0x4070
416 #define DSMCC_UN_SESS_CLN_RESET_CNF 0x4071
417 #define DSMCC_UN_SESS_CLN_RESET_IND 0x4072
418 #define DSMCC_UN_SESS_CLN_RESET_RES 0x4073
419 #define DSMCC_UN_SESS_CLN_SESS_PROC_IND 0x4082
420 #define DSMCC_UN_SESS_CLN_CONN_REQ 0x4090
421 #define DSMCC_UN_SESS_CLN_SESS_TRN_IND 0x40a2
422 #define DSMCC_UN_SESS_CLN_SESS_TRN_RES 0x40a3
423 #define DSMCC_UN_SESS_CLN_SESS_INP_REQ 0x40b0
424 /* 4-5 U-N Session Server Messages */
425 #define DSMCC_UN_SESS_SRV_SESS_SET_IND 0x8012
426 #define DSMCC_UN_SESS_SRV_SESS_SET_RES 0x8013
427 #define DSMCC_UN_SESS_SRV_SESS_REL_REQ 0x8020
428 #define DSMCC_UN_SESS_SRV_SESS_REL_CNF 0x8021
429 #define DSMCC_UN_SESS_SRV_SESS_REL_IND 0x8022
430 #define DSMCC_UN_SESS_SRV_SESS_REL_RES 0x8023
431 #define DSMCC_UN_SESS_SRV_ADD_RSRC_REQ 0x8030
432 #define DSMCC_UN_SESS_SRV_ADD_RSRC_CNF 0x8031
433 #define DSMCC_UN_SESS_SRV_DEL_RSRC_REQ 0x8040
434 #define DSMCC_UN_SESS_SRV_DEL_RSRC_CNF 0x8041
435 #define DSMCC_UN_SESS_SRV_CONT_FEED_SESS_REQ 0x8050
436 #define DSMCC_UN_SESS_SRV_CONT_FEED_SESS_CNF 0x8051
437 #define DSMCC_UN_SESS_SRV_STATUS_REQ 0x8060
438 #define DSMCC_UN_SESS_SRV_STATUS_CNF 0x8061
439 #define DSMCC_UN_SESS_SRV_STATUS_IND 0x8062
440 #define DSMCC_UN_SESS_SRV_STATUS_RES 0x8063
441 #define DSMCC_UN_SESS_SRV_RESET_REQ 0x8070
442 #define DSMCC_UN_SESS_SRV_RESET_CNF 0x8071
443 #define DSMCC_UN_SESS_SRV_RESET_IND 0x8072
444 #define DSMCC_UN_SESS_SRV_RESET_RES 0x8073
445 #define DSMCC_UN_SESS_SRV_SESS_PROC_IND 0x8082
446 #define DSMCC_UN_SESS_SRV_CONN_IND 0x8092
447 #define DSMCC_UN_SESS_SRV_SESS_TRN_REQ 0x80a0
448 #define DSMCC_UN_SESS_SRV_SESS_TRN_CNF 0x80a1
449 #define DSMCC_UN_SESS_SRV_SESS_TRN_IND 0x80a2
450 #define DSMCC_UN_SESS_SRV_SESS_TRN_RES 0x80a3
451 #define DSMCC_UN_SESS_SRV_SESS_INP_REQ 0x80b0
452 /* 4-73 U-N Session Resource Descriptors */
453 #define RSRC_CONT_FEED_SESS 0x0001
454 #define RSRC_ATM_CONN 0x0002
455 #define RSRC_MPEG_PROG 0x0003
456 #define RSRC_PHYS_CHAN 0x0004
457 #define RSRC_TS_US_BW 0x0005
458 #define RSRC_TS_DS_BW 0x0006
459 #define RSRC_ATM_SVC_CONN 0x0007
460 #define RSRC_CONN_NTFY 0x0008
461 #define RSRC_IP 0x0009
462 #define RSRC_CLN_TDMA_ASSIGN 0x000a
463 #define RSRC_PSTN_SETUP 0x000b
464 #define RSRC_NISDN_SETUP 0x000c
465 #define RSRC_NISDN_CONN 0x000d
466 #define RSRC_Q922_CONN 0x000e
467 #define RSRC_HEADEND_LIST 0x000f
468 #define RSRC_ATM_VC_CONN 0x0010
469 #define RSRC_SDB_CONT_FEED 0x0011
470 #define RSRC_SDB_ASSOC 0x0012
471 #define RSRC_SDB_ENT 0x0013
472 #define RSRC_SHARED_RSRC 0x7ffe
473 #define RSRC_SHARED_REQ_ID 0x7fff
474 #define RSRC_TYPE_OWNER 0xffff
475 /* U-N Session User Defined Resource Descriptors */
476 #define RSRC_MODULATION_MODE 0xf001
477 #define RSRC_HEADEND_ID 0xf003
478 #define RSRC_SERVER_CA 0xf004
479 #define RSRC_CLIENT_CA 0xf005
480 #define RSRC_ETHERNET 0xf006
481 #define RSRC_SERVICE_GROUP 0xf007
484 /* 2-2 */
485 static const range_string dsmcc_header_type_vals[] = {
486 { 0, 0, "ISO/IEC 13818-6 Reserved" },
487 { 0x01, 0x01, "ISO/IEC 13818-6 User-to-Network Configuration Message" },
488 { 0x02, 0x02, "ISO/IEC 13818-6 User-to-Network Session Message" },
489 { 0x03, 0x03, "ISO/IEC 13818-6 Download Message" },
490 { 0x04, 0x04, "ISO/IEC 13818-6 SDB Channel Change Protocol Message" },
491 { 0x05, 0x05, "ISO/IEC 13818-6 User-to-Network Pass-Thru Message" },
492 { 0x06, 0x7f, "ISO/IEC 13818-6 Reserved" },
493 { 0x80, 0xff, "User Defined Message Type" },
494 { 0, 0, NULL }
497 /* 2-3 */
498 static const range_string dsmcc_un_sess_transaction_id_originator_vals[] = {
499 { 0, 0, "Assigned by Client" },
500 { 0x01, 0x01, "Assigned by Server" },
501 { 0x02, 0x02, "Assigned by Network" },
502 { 0x03, 0x03, "ISO/IEC 13818-6 Reserved" },
503 { 0x04, 0xff, "Invalid"},
504 { 0, 0, NULL }
507 /* 2-5 */
508 static const range_string dsmcc_adaptation_header_vals[] = {
509 { 0, 0, "ISO/IEC 13818-6 Reserved" },
510 { 0x01, 0x01, "DSM-CC Conditional Access Adaptation Format" },
511 { 0x02, 0x02, "DSM-CC User ID Adaptation Format" },
512 { 0x03, 0x7f, "ISO/IEC 13818-6 Reserved" },
513 { 0x80, 0xff, "User Defined Adaptation Type" },
514 { 0, 0, NULL }
517 /* 4-2 */
518 static const range_string dsmcc_un_sess_message_discriminator_vals[] = {
519 { 0, 0, "ISO/IEC 13818-6 Reserved" },
520 { 0x01, 0x01, "Client and Network" },
521 { 0x02, 0x02, "Server and Network" },
522 { 0x03, 0x0f, "ISO/IEC 13818-6 Reserved" },
523 { 0x10, 0xff, "Invalid"},
524 { 0, 0, NULL }
527 /* 4-3 */
528 static const range_string dsmcc_un_sess_message_scenario_vals[] = {
529 { 0, 0, "ISO/IEC 13818-6 Reserved" },
530 { 0x0001, 0x0001, "Session Setup" },
531 { 0x0002, 0x0002, "Session Release" },
532 { 0x0003, 0x0003, "Add Resource" },
533 { 0x0004, 0x0004, "Delete Resource" },
534 { 0x0005, 0x0005, "Continuous Feed Session Setup" },
535 { 0x0006, 0x0006, "Status" },
536 { 0x0007, 0x0007, "Reset" },
537 { 0x0008, 0x0008, "Session Proceeding" },
538 { 0x0009, 0x0009, "Session Connect" },
539 { 0x000a, 0x000a, "Session Transfer" },
540 { 0x000b, 0x000b, "Session In Progress" },
541 { 0x000c, 0x01ff, "ISO/IEC 13818-6 Reserved" },
542 { 0x0200, 0x03ff, "User Defined Message Scenario" },
543 { 0x0400, 0xffff, "Invalid"},
544 { 0, 0, NULL }
547 /* 4-4 */
548 static const range_string dsmcc_un_sess_message_type_vals[] = {
549 { 0, 0, "Request Message" },
550 { 0x01, 0x01, "Confirm Message" },
551 { 0x02, 0x02, "Indication Message" },
552 { 0x03, 0x03, "Response Message" },
553 { 0x04, 0x0f, "ISO/IEC 13818-6 Reserved" },
554 { 0x10, 0xff, "Invalid"},
555 { 0, 0, NULL }
558 /* 4-5 */
559 static const value_string dsmcc_un_sess_message_id_vals[] = {
560 { DSMCC_UN_SESS_CLN_SESS_SET_REQ, "Client Session Setup Request" },
561 { DSMCC_UN_SESS_CLN_SESS_SET_CNF, "Client Session Setup Confirm" },
562 { DSMCC_UN_SESS_CLN_SESS_REL_REQ, "Client Session Release Request" },
563 { DSMCC_UN_SESS_CLN_SESS_REL_CNF, "Client Session Release Confirm" },
564 { DSMCC_UN_SESS_CLN_SESS_REL_IND, "Client Session Release Indication" },
565 { DSMCC_UN_SESS_CLN_SESS_REL_RES, "Client Session Release Response" },
566 { DSMCC_UN_SESS_CLN_ADD_RSRC_IND, "Client Add Resource Indication" },
567 { DSMCC_UN_SESS_CLN_ADD_RSRC_RES, "Client Add Resource Response" },
568 { DSMCC_UN_SESS_CLN_DEL_RSRC_IND, "Client Delete Resource Indication" },
569 { DSMCC_UN_SESS_CLN_DEL_RSRC_RES, "Client Delete Resource Response" },
570 { DSMCC_UN_SESS_CLN_STATUS_REQ, "Client Status Request" },
571 { DSMCC_UN_SESS_CLN_STATUS_CNF, "Client Status Confirm" },
572 { DSMCC_UN_SESS_CLN_STATUS_IND, "Client Status Indication" },
573 { DSMCC_UN_SESS_CLN_STATUS_RES, "Client Status Response" },
574 { DSMCC_UN_SESS_CLN_RESET_REQ, "Client Reset Request" },
575 { DSMCC_UN_SESS_CLN_RESET_CNF, "Client Reset Confirm" },
576 { DSMCC_UN_SESS_CLN_RESET_IND, "Client Reset Indication" },
577 { DSMCC_UN_SESS_CLN_RESET_RES, "Client Reset Response" },
578 { DSMCC_UN_SESS_CLN_SESS_PROC_IND, "Client Session Proceeding Indication" },
579 { DSMCC_UN_SESS_CLN_CONN_REQ, "Client Connect Request" },
580 { DSMCC_UN_SESS_CLN_SESS_TRN_IND, "Client Session Transfer Indication" },
581 { DSMCC_UN_SESS_CLN_SESS_TRN_RES, "Client Session Transfer Response" },
582 { DSMCC_UN_SESS_CLN_SESS_INP_REQ, "Client Session In Progress Request" },
583 { DSMCC_UN_SESS_SRV_SESS_SET_IND, "Server Session Setup Indication" },
584 { DSMCC_UN_SESS_SRV_SESS_SET_RES, "Server Session Setup Response" },
585 { DSMCC_UN_SESS_SRV_SESS_REL_REQ, "Server Session Release Request" },
586 { DSMCC_UN_SESS_SRV_SESS_REL_CNF, "Server Session Release Confirm" },
587 { DSMCC_UN_SESS_SRV_SESS_REL_IND, "Server Session Release Indication" },
588 { DSMCC_UN_SESS_SRV_SESS_REL_RES, "Server Session Release Response" },
589 { DSMCC_UN_SESS_SRV_ADD_RSRC_REQ, "Server Add Resource Request" },
590 { DSMCC_UN_SESS_SRV_ADD_RSRC_CNF, "Server Add Resource Confirm" },
591 { DSMCC_UN_SESS_SRV_DEL_RSRC_REQ, "Server Delete Resource Request" },
592 { DSMCC_UN_SESS_SRV_DEL_RSRC_CNF, "Server Delete Resource Confirm" },
593 { DSMCC_UN_SESS_SRV_CONT_FEED_SESS_REQ, "Server Continuous Feed Session Request" },
594 { DSMCC_UN_SESS_SRV_CONT_FEED_SESS_CNF, "Server Continuous Feed Session Confirm" },
595 { DSMCC_UN_SESS_SRV_STATUS_REQ, "Server Status Request" },
596 { DSMCC_UN_SESS_SRV_STATUS_CNF, "Server Status Confirm" },
597 { DSMCC_UN_SESS_SRV_STATUS_IND, "Server Status Indication" },
598 { DSMCC_UN_SESS_SRV_STATUS_RES, "Server Status Response" },
599 { DSMCC_UN_SESS_SRV_RESET_REQ, "Server Reset Request" },
600 { DSMCC_UN_SESS_SRV_RESET_CNF, "Server Reset Confirm" },
601 { DSMCC_UN_SESS_SRV_RESET_IND, "Server Reset Indication" },
602 { DSMCC_UN_SESS_SRV_RESET_RES, "Server Reset Response" },
603 { DSMCC_UN_SESS_SRV_SESS_PROC_IND, "Server Session Proceeding Indication" },
604 { DSMCC_UN_SESS_SRV_CONN_IND, "Server Connect Indication" },
605 { DSMCC_UN_SESS_SRV_SESS_TRN_REQ, "Server Session Transfer Request" },
606 { DSMCC_UN_SESS_SRV_SESS_TRN_CNF, "Server Session Transfer Confirm" },
607 { DSMCC_UN_SESS_SRV_SESS_TRN_IND, "Server Session Transfer Indication" },
608 { DSMCC_UN_SESS_SRV_SESS_TRN_RES, "Server Session Transfer Response" },
609 { DSMCC_UN_SESS_SRV_SESS_INP_REQ, "Server Session In Progress Request" },
610 { 0, NULL }
613 /* 4-59 */
614 static const range_string dsmcc_un_sess_message_reason_codes_vals[] = {
615 { 0, 0, "RsnOK. The command sequence is proceeding normally." },
616 { 0x0001, 0x0001, "RsnNormal. Normal conditions for releasing the session." },
617 { 0x0002, 0x0002, "RsnClProcError. Procedure error detected at the Client." },
618 { 0x0003, 0x0003, "RsnNeProcError. Procedure error detected at the Network." },
619 { 0x0004, 0x0004, "RsnSeProcError. Procedure error detected at the Server." },
620 { 0x0005, 0x0005, "RsnClFormatError. Invalid format (e.g., missing parameter) detected at the Client." },
621 { 0x0006, 0x0006, "RsnNeFormatError. Invalid format (e.g., missing parameter) detected at the Network." },
622 { 0x0007, 0x0007, "RsnSeFormatError. Invalid format (e.g., missing parameter) detected at the Server." },
623 { 0x0008, 0x0008, "RsnNeConfigCnf. Confirmed configuration sequence (i.e., Client must respond)" },
624 { 0x0009, 0x0009, "RsnSeTranRefuse. Session transfer was refused by the destination Server." },
625 { 0x000a, 0x000a, "RsnSeForwardOvl. Session forwarding is due to overload conditions." },
626 { 0x000b, 0x000b, "RsnSeForwardMnt. Session forwarding is due to overload maintenance conditions." },
627 { 0x000c, 0x000c, "RsnSeForwardUncond. Session forwarding is sent as an unconditional request." },
628 { 0x000d, 0x000d, "RsnSeRejResource. Server rejected the assigned resources." },
629 { 0x000e, 0x000e, "RsnNeBroadcast. Message is being broadcast and does not require a response." },
630 { 0x000f, 0x000f, "RsnSeServiceTransfer. Server indicates that the Client shall establish a session to another serverId based on the context provided in the PrivateData()." },
631 { 0x0010, 0x0010, "RsnClNoSession. Client indicates the Session ID is not active." },
632 { 0x0011, 0x0011, "RsnSeNoSession. Server indicates the Session ID is not active." },
633 { 0x0012, 0x0012, "RsnNeNoSession. Network indicates the Session ID is not active." },
634 { 0x0013, 0x0013, "RsnRetrans. Message is a retransmission." },
635 { 0x0014, 0x0014, "RsnNoTransaction. Message was received without a Transaction ID." },
636 { 0x0015, 0x0015, "RsnClNoResource. Requested resource is not supported." },
637 { 0x0016, 0x0016, "RsnClRejResource. Client rejected the assigned resources." },
638 { 0x0017, 0x0017, "RsnNeRejResource. Network rejected the assigned resources assigned by the Server." },
639 { 0x0018, 0x0018, "RsnNeTimerExpired. The message is being sent as the result of an expired timer." },
640 { 0x0019, 0x0019, "RsnClSessionRelease. Client initiated session release." },
641 { 0x001a, 0x001a, "RsnSeSessionRelease. Server initiated session release." },
642 { 0x001b, 0x001b, "RsnNeSessionRelease. Network initiated session release." },
643 { 0x001c, 0x7fff, "Reserved" },
644 { 0x7fff, 0xffff, "User Defined Reason Code" },
645 { 0, 0, NULL }
648 /* 4-60 */
649 static const range_string dsmcc_un_sess_message_response_codes_vals[] = {
650 { 0, 0, "RspOK. Request completed with no errors." },
651 { 0x0001, 0x0001, "RspClNoSession. Client rejected the request because the requested Session ID is invalid." },
652 { 0x0002, 0x0002, "RspNeNoCalls. Network is unable to accept new sessions." },
653 { 0x0003, 0x0003, "RspNeInvalidClient. Network rejected the request due to an invalid Client ID." },
654 { 0x0004, 0x0004, "RspNeInvalidServer. Network rejected the request due to an invalid Server ID." },
655 { 0x0005, 0x0005, "RspNeNoSession. Network rejected the request because the requested Session ID is invalid." },
656 { 0x0006, 0x0006, "RspSeNoCalls. Server is unable to accept new sessions." },
657 { 0x0007, 0x0007, "RspSeInvalidClient. Server rejected the request due to an invalid Client ID." },
658 { 0x0008, 0x0008, "RspSeNoService. Server rejected the request because the requested service could not be provided." },
659 { 0x0009, 0x0009, "RspSeNoCFS. Server rejected the request because the requested Continuous Feed Session could not be found." },
660 { 0x000a, 0x000a, "RspClNoResponse. Network timed out before the Client responded to an Indication message." },
661 { 0x000b, 0x000b, "RspSeNoResponse. Network timed out before the Server responded to an Indication message." },
662 { 0x000c, 0x000f, "ISO/IEC 13818-6 reserved." },
663 { 0x0010, 0x0010, "RspSeNoSession. Server rejected the request because the requested Session ID is invalid." },
664 { 0x0011, 0x0011, "RspNeResourceContinue. Resource request completed with no errors but, an indicated resource was assigned an alternate value by the Network." },
665 { 0x0012, 0x0012, "RspNeResourceFailed. Resource request failed because the Network was unable to assign the requested resources." },
666 { 0x0013, 0x0013, "RspNeResourceOK. Requested command completed with no errors." },
667 { 0x0014, 0x0014, "RspResourceNegotiate. Network was able to complete a request but has assigned alternate values to a negotiable field." },
668 { 0x0015, 0x0015, "RspClSessProceed. Network is waiting on a response from the server." },
669 { 0x0016, 0x0016, "RspClUnkRequestID. Client received a message which contained an unknown Resource Request ID." },
670 { 0x0017, 0x0017, "RspClNoResource. Client rejected a session set-up because it was unable to use the assigned resources." },
671 { 0x0018, 0x0018, "RspClNoCalls. Client rejected a session set-up because it was not accepting calls at that time." },
672 { 0x0019, 0x0019, "RspNeNoResource. Network is unable to assign one or more resources to a session." },
673 { 0x001a, 0x001f, "ISO/IEC 13818-6 reserved." },
674 { 0x0020, 0x0020, "RspSeNoResource. Server is unable to complete a session set-up because the required resources are not available." },
675 { 0x0021, 0x0021, "RspSeRejResource. Server rejected the assigned resources." },
676 { 0x0022, 0x0022, "RspClProcError. Procedure error detected at the Client." },
677 { 0x0023, 0x0023, "RspNeProcError. Procedure error detected at the Network." },
678 { 0x0024, 0x0024, "RspSeProcError. Procedure error detected at the Server." },
679 { 0x0025, 0x0025, "RspClFormatError. Invalid format (e.g., missing parameter) detected at Client." },
680 { 0x0026, 0x0026, "RspNeFormatError. Invalid format (e.g., missing parameter) detected at Network." },
681 { 0x0027, 0x0027, "RspSeFormatError. Invalid format (e.g., missing parameter) detected at Server." },
682 { 0x0028, 0x0028, "RspSeForwardOvl. Session forwarding is due to overload conditions." },
683 { 0x0029, 0x0029, "RspSeForwardMnt. Session forwarding is due to overload maintenance conditions." },
684 { 0x002a, 0x002a, "RspClRejResource. Client rejected a resource assigned to a session." },
685 { 0x002b, 0x002f, "ISO/IEC 13818-6 reserved." },
686 { 0x0030, 0x0030, "RspSeForwardUncond. Session forwarding is sent as an unconditional request." },
687 { 0x0031, 0x0031, "RspNeTransferFailed. Session transfer failed at the Network." },
688 { 0x0032, 0x0032, "RspClTransferReject. Session transfer was rejected by the Client." },
689 { 0x0033, 0x0033, "RspSeTransferReject. Session transfer was rejected by the Server." },
690 { 0x0034, 0x0034, "RspSeTransferResource. Server rejected the session transfer due to insufficient resource." },
691 { 0x0035, 0x0035, "RspResourceCompleted. Server has accepted the resources assigned by the Network." },
692 { 0x0036, 0x0036, "RspForward. Server is requesting a Session Forward." },
693 { 0x0037, 0x0037, "RspNeForwardFailed. Network is unable to process a Session Forward." },
694 { 0x0038, 0x0038, "RspClForwarded. Session was forwarded to the indicated Client ID." },
695 { 0x0039, 0x0040, "ISO/IEC 13818-6 reserved." },
696 { 0x0041, 0x0041, "RspSeTransferNoRes. The transfer to Server could not get enough resources, so it rejected the transfer." },
697 { 0x0042, 0x0042, "RspNeNotOwner. An action was requested on a session by a User which was not the owner of that session." },
698 { 0x0043, 0x7fff, "ISO/IEC 13818-6 reserved." },
699 { 0x8000, 0xffff, "User Defined Response Code" },
700 { 0, 0, NULL }
703 /* 4-61 */
704 static const range_string dsmcc_un_sess_status_type_vals[] = {
705 { 0, 0, "Reserved" },
706 { 0x0001, 0x0001, "Identify Session List" },
707 { 0x0002, 0x0002, "Identify Session Status" },
708 { 0x0003, 0x0003, "Identify Configuration" },
709 { 0x0004, 0x0004, "Query Resource Descriptor" },
710 { 0x0005, 0x0005, "Query Resource Status" },
711 { 0x0006, 0x7fff, "Reserved" },
712 { 0x8000, 0xffff, "User Defined Status Type" },
713 { 0, 0, NULL }
716 /* 4-64 */
717 static const range_string dsmcc_un_sess_rsrc_number_assignor_vals[] = {
718 { 0, 0, "Reserved" },
719 { 0x01, 0x01, "Client" },
720 { 0x02, 0x02, "Server" },
721 { 0x03, 0x03, "Network" },
722 { 0x04, 0xff, "Reserved" },
723 { 0, 0, NULL }
726 /* 4-65 */
727 static const range_string dsmcc_un_sess_rsrc_association_tag_vals[] = {
728 { 0, 0, "Reserved" },
729 { 0x01, 0x01, "Client" },
730 { 0x02, 0x02, "Server" },
731 { 0x03, 0x03, "Network" },
732 { 0x04, 0xff, "Reserved" },
733 { 0, 0, NULL }
736 /* 4-66 */
737 static const range_string dsmcc_un_sess_rsrc_allocator_vals[] = {
738 { 0, 0, "Unspecified" },
739 { 0x01, 0x01, "Client" },
740 { 0x02, 0x02, "Server" },
741 { 0x03, 0x03, "Network" },
742 { 0x04, 0xff, "Reserved" },
743 { 0, 0, NULL }
746 /* 4-67 */
747 static const range_string dsmcc_un_sess_rsrc_attribute_vals[] = {
748 { 0, 0, "Mandatory Non-Negotiable" },
749 { 0x01, 0x01, "Mandatory Negotiable" },
750 { 0x02, 0x02, "Non-Mandatory Non-Negotiable" },
751 { 0x03, 0x03, "Non-Mandatory Negotiable" },
752 { 0x04, 0x0f, "Reserved"},
753 { 0x10, 0xff, "Invalid"},
754 { 0, 0, NULL }
757 /* 4-68 */
758 static const range_string dsmcc_un_sess_rsrc_view_vals[] = {
759 { 0, 0, "Reserved" },
760 { 0x01, 0x01, "Client View" },
761 { 0x02, 0x02, "Server View" },
762 { 0x03, 0x03, "Reserved" },
763 { 0x04, 0xff, "Invalid" },
764 { 0, 0, NULL }
767 /* 4-69 */
768 static const range_string dsmcc_un_sess_rsrc_status_vals[] = {
769 { 0, 0, "Reserved" },
770 { 0x01, 0x01, "Requested" },
771 { 0x02, 0x02, "In Progress" },
772 { 0x03, 0x03, "Alternate Assigned" },
773 { 0x04, 0x04, "Assigned"},
774 { 0x05, 0x05, "Failed"},
775 { 0x06, 0x06, "Unprocessed"},
776 { 0x07, 0x07, "Invalid"},
777 { 0x08, 0x08, "Released"},
778 { 0x09, 0x7f, "Reserved"},
779 { 0x80, 0xff, "User Defined"},
780 { 0, 0, NULL }
783 /* 4-72 */
784 static const range_string dsmcc_un_sess_rsrc_value_types_vals[] = {
785 { 0, 0, "Reserved" },
786 { 0x0001, 0x0001, "Single" },
787 { 0x0002, 0x0002, "List" },
788 { 0x0003, 0x0003, "Range" },
789 { 0x0004, 0x7fff, "Reserved"},
790 { 0x8000, 0xffff, "User Defined"},
791 { 0, 0, NULL }
794 /* 4-73 */
795 static const range_string dsmcc_un_sess_rsrc_descriptor_type_vals[] = {
796 { 0, 0, "Reserved" },
797 { 0x0001, 0x0001, "Continuous Feed Session" },
798 { 0x0002, 0x0002, "ATM Connection" },
799 { 0x0003, 0x0003, "MPEG Program" },
800 { 0x0004, 0x0004, "Physical Channel" },
801 { 0x0005, 0x0005, "TS Upstream Bandwidth" },
802 { 0x0006, 0x0006, "TS Downstream Bandwidth" },
803 { 0x0007, 0x0007, "ATM SVC Connection" },
804 { 0x0008, 0x0008, "Connection Notify" },
805 { 0x0009, 0x0009, "IP" },
806 { 0x000a, 0x000a, "Client TDMA Assignment" },
807 { 0x000b, 0x000b, "PSTN Setup" },
808 { 0x000c, 0x000c, "NISDN Setup" },
809 { 0x000d, 0x000d, "NISDN Connection" },
810 { 0x000e, 0x000e, "Q.922 Connections" },
811 { 0x000f, 0x000f, "Headend List" },
812 { 0x0010, 0x0010, "ATM VC Connection" },
813 { 0x0011, 0x0011, "SDB Continuous Feed" },
814 { 0x0012, 0x0012, "SDB Associations" },
815 { 0x0013, 0x0013, "SDB Entitlement" },
816 { 0x0014, 0x7ffd, "Reserved" },
817 { 0x7ffe, 0x7ffe, "Shared Resource" },
818 { 0x7fff, 0x7fff, "Shared Request ID" },
819 { 0x8000, 0xf000, "User Defined" },
820 { 0xf001, 0xf001, "Modulation Mode" },
821 { 0xf002, 0xf002, "User Defined" },
822 { 0xf003, 0xf003, "Headend ID" },
823 { 0xf004, 0xf004, "Server Conditional Access" },
824 { 0xf005, 0xf005, "Client Conditional Access" },
825 { 0xf006, 0xf006, "Ethernet Interface" },
826 { 0xf007, 0xf007, "Service Group" },
827 { 0xf008, 0xfffe, "User Defined" },
828 { 0xffff, 0xffff, "User Defined Type Owner" },
829 { 0, 0, NULL }
832 /* table 4-78 direction values */
833 static const range_string dsmcc_un_sess_rsrc_phys_chan_direction_vals[] = {
834 { 0, 0, "Downstream (Server to Client)" },
835 { 0x0001, 0x0001, "Upstream (Client to Server)" },
836 { 0x0002, 0xffff, "ISO/IEC 13818-6 Reserved" },
837 { 0, 0, NULL }
840 /* 4-84 IP protocol types */
841 static const range_string dsmcc_un_sess_rsrc_ip_protocol_types_vals[] = {
842 { 0, 0, "Reserved" },
843 { 0x0001, 0x0001, "TCP" },
844 { 0x0002, 0x0002, "UDP" },
845 { 0x0003, 0x7fff, "Reserved" },
846 { 0x8000, 0xffff, "User Defined" },
847 { 0, 0, NULL }
850 /* user defined 0xf001-0xf007 - start */
851 static const range_string dsmcc_un_sess_rsrc_modulation_format_vals[] = {
852 { 0x00, 0x00, "Unknown" },
853 { 0x01, 0x05, "Reserved" },
854 { 0x06, 0x06, "QAM16" },
855 { 0x07, 0x07, "QAM32" },
856 { 0x08, 0x08, "QAM64" },
857 { 0x09, 0x0b, "Reserved" },
858 { 0x0c, 0x0c, "QAM128" },
859 { 0x0d, 0x0f, "Reserved" },
860 { 0x10, 0x10, "QAM256" },
861 { 0x11, 0xff, "Reserved" },
862 { 0, 0, NULL }
865 static const range_string dsmcc_un_sess_rsrc_transmission_system_vals[] = {
866 { 0, 0, "Unknown Transmission System" },
867 { 0x01, 0x01, "SADVB Transmission System" },
868 { 0x02, 0x02, "GI Transmission System" },
869 { 0x03, 0xff, "Reserved" },
870 { 0, 0, NULL }
873 static const range_string dsmcc_un_sess_rsrc_mod_mode_vals[] = {
874 { 0, 0, "No Modulation Mode" },
875 { 0x01, 0x18, "Reserved" },
876 { 0x19, 0x19, "QAM 4 Modulation Mode"},
877 { 0x1a, 0xff, "Reserved" },
878 { 0, 0, NULL }
881 static const range_string dsmcc_un_sess_rsrc_fec_vals[] = {
882 { 0, 0, "FEC Transmission System" },
883 { 0x01, 0x01, "FEC DAVIC" },
884 { 0x02, 0xff, "Reserved"},
885 { 0, 0, NULL }
888 static const range_string dsmcc_un_sess_rsrc_headend_flag_vals[] = {
889 { 0, 0, "Invalid" },
890 { 0x01, 0x01, "The session is intended for the Head End named by the HeadEndId" },
891 { 0x02, 0x02, "The session is intended for the Head End where the content is introduced to the network" },
892 { 0x03, 0x03, "The session is intended for all Head Ends that have QAMs"},
893 { 0x04, 0x04, "The session is intended for the QAM with an output Transport Stream ID named by the TransportStreamId"},
894 { 0x05, 0xff, "Invalid" },
895 { 0, 0, NULL }
897 /* user defined 0xf001-0xf007 - end */
899 /* 7-4 */
900 static const value_string dsmcc_dd_message_id_vals[] = {
901 { 0x1001, "Download Info Request" },
902 { 0x1002, "Download Info Indication" },
903 { 0x1003, "Download Data Block" },
904 { 0x1004, "Download Data Request" },
905 { 0x1005, "Download Data Cancel" },
906 { 0x1006, "Download Server Initiate" },
907 { 0, NULL }
910 /* 9-2 */
911 static const value_string dsmcc_payload_name_vals[] = {
912 { DSMCC_TID_LLCSNAP, "LLCSNAP" },
913 { DSMCC_TID_UN_MSG, "User Network Message" },
914 { DSMCC_TID_DD_MSG, "Download Data Message" },
915 { DSMCC_TID_DESC_LIST, "Descriptor List" },
916 { DSMCC_TID_PRIVATE, "Private" },
917 { 0, NULL }
920 /* U-N Session Message Flags */
921 static int * const bf_message_id[] = {
922 &hf_dsmcc_un_sess_flag_message_discriminator,
923 &hf_dsmcc_un_sess_flag_message_scenario,
924 &hf_dsmcc_un_sess_flag_message_type,
925 NULL
927 static int * const bf_transaction_id[] = {
928 &hf_dsmcc_un_sess_flag_transaction_id_originator,
929 &hf_dsmcc_un_sess_flag_transaction_id_number,
930 NULL
932 static int * const bf_rsrc_number[] = {
933 &hf_dsmcc_un_sess_rsrc_flag_num_assignor,
934 &hf_dsmcc_un_sess_rsrc_flag_num_value,
935 NULL
937 static int * const bf_rsrc_association_tag[] = {
938 &hf_dsmcc_un_sess_rsrc_flag_association_tag_assignor,
939 &hf_dsmcc_un_sess_rsrc_flag_association_tag_value,
940 NULL
942 static int * const bf_rsrc_flags[] = {
943 &hf_dsmcc_un_sess_rsrc_flag_view,
944 &hf_dsmcc_un_sess_rsrc_flag_attribute,
945 &hf_dsmcc_un_sess_rsrc_flag_allocator,
946 NULL
949 /* Table J.3 E.164 NSAP */
950 static unsigned
951 dissect_dsmcc_un_session_nsap(
952 tvbuff_t *tvb, unsigned offset, packet_info *pinfo _U_, proto_tree *sub_tree)
954 unsigned offset_start;
956 offset_start = offset;
957 proto_tree_add_item(sub_tree, hf_dsmcc_un_sess_nsap_afi, tvb, offset, 1, ENC_NA);
958 offset += 1;
959 proto_tree_add_item(sub_tree, hf_dsmcc_un_sess_nsap_idi, tvb, offset, 8, ENC_NA);
960 offset += 8;
961 proto_tree_add_item(sub_tree, hf_dsmcc_un_sess_nsap_ho_dsp, tvb, offset, 4, ENC_BIG_ENDIAN);
962 offset += 4;
963 proto_tree_add_item(sub_tree, hf_dsmcc_un_sess_nsap_esi, tvb, offset, 6, ENC_NA);
964 offset += 6;
965 proto_tree_add_item(sub_tree, hf_dsmcc_un_sess_nsap_sel, tvb, offset, 1, ENC_NA);
966 offset += 1;
968 return offset-offset_start;
971 /* 4-58 SessionId */
972 static unsigned
973 dissect_dsmcc_un_session_id(
974 tvbuff_t *tvb, unsigned offset, packet_info *pinfo _U_, proto_tree *sub_tree)
976 proto_tree *sub_sub_tree;
977 unsigned offset_start;
979 offset_start = offset;
981 sub_sub_tree = proto_tree_add_subtree(sub_tree, tvb, offset, 10, ett_dsmcc_heading, NULL, "Session ID");
982 proto_item_set_text(sub_sub_tree, "Session ID: 0x%s", tvb_bytes_to_str(pinfo->pool, tvb, offset, 10));
983 proto_tree_add_item(sub_sub_tree, hf_dsmcc_un_sess_session_id_device_id, tvb, offset, 6, ENC_NA);
984 offset += 6;
985 proto_tree_add_item(sub_sub_tree, hf_dsmcc_un_sess_session_id_session_number, tvb, offset, 4, ENC_BIG_ENDIAN);
986 offset += 4;
988 return offset-offset_start;
992 /* Table 2-4 Adaptation Header Format */
993 static void
994 dissect_dsmcc_adaptation_header(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
996 tvbuff_t *sub_tvb;
997 unsigned offset = 0;
998 proto_item *pi;
999 proto_tree *sub_tree;
1000 proto_tree *sub_sub_tree;
1001 uint8_t type, tmp;
1002 uint16_t ca_len;
1004 type = tvb_get_uint8(tvb, offset);
1006 if (1 == type) {
1007 sub_tree = proto_tree_add_subtree(tree, tvb, offset, -1, ett_dsmcc_adaptation_header, NULL, "Adaptation Header");
1008 proto_tree_add_item(sub_tree, hf_dsmcc_adaptation_type, tvb, offset, 1, ENC_BIG_ENDIAN);
1009 offset += 1;
1010 tmp = tvb_get_uint8(tvb, offset);
1011 pi = proto_tree_add_item(sub_tree, hf_dsmcc_adaptation_ca_reserved, tvb, offset, 1, ENC_BIG_ENDIAN);
1012 if (0xff != tmp) {
1013 expert_add_info_format(pinfo, pi, &ei_dsmcc_invalid_value, "Invalid value - should be 0xff");
1015 offset += 1;
1016 proto_tree_add_item(sub_tree, hf_dsmcc_adaptation_ca_system_id, tvb, offset, 2, ENC_BIG_ENDIAN);
1017 offset += 2;
1018 ca_len = tvb_get_ntohs(tvb, offset);
1019 proto_tree_add_item(sub_tree, hf_dsmcc_adaptation_ca_length, tvb, offset, 2, ENC_BIG_ENDIAN);
1020 offset += 2;
1021 sub_tvb = tvb_new_subset_length(tvb, offset, ca_len);
1022 call_data_dissector(sub_tvb, pinfo, tree);
1023 } else if (2 == type) {
1024 sub_tree = proto_tree_add_subtree(tree, tvb, offset, -1, ett_dsmcc_adaptation_header, NULL, "Adaptation Header");
1025 proto_tree_add_item(sub_tree, hf_dsmcc_adaptation_type, tvb, offset, 1, ENC_BIG_ENDIAN);
1026 offset += 1;
1027 tmp = tvb_get_uint8(tvb, offset);
1028 pi = proto_tree_add_item(sub_tree, hf_dsmcc_adaptation_user_id_reserved, tvb, offset, 1, ENC_BIG_ENDIAN);
1029 if (0xff != tmp) {
1030 expert_add_info_format(pinfo, pi, &ei_dsmcc_invalid_value, "Invalid value - should be 0xff");
1032 offset += 1;
1033 sub_sub_tree = proto_tree_add_subtree(sub_tree, tvb, offset, 20, ett_dsmcc_heading, NULL, "User ID");
1034 dissect_dsmcc_un_session_nsap(tvb, offset, pinfo, sub_sub_tree);
1035 } else {
1036 sub_tree = proto_tree_add_subtree(tree, tvb, offset, -1, ett_dsmcc_adaptation_header, NULL, "Unknown Adaptation Header");
1037 proto_tree_add_item(sub_tree, hf_dsmcc_adaptation_type, tvb, offset, 1, ENC_BIG_ENDIAN);
1041 /* Table 2-1 DSM-CC Message Header Format */
1042 static unsigned
1043 dissect_dsmcc_header(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset, bool download_header)
1045 tvbuff_t *sub_tvb;
1046 proto_item *pi;
1047 proto_tree *sub_tree;
1048 uint8_t prot_disc, adaptation_len;
1049 unsigned reserved, offset_start;
1050 int msg_id, tx_id;
1052 offset_start = offset;
1054 prot_disc = tvb_get_uint8(tvb, offset);
1055 reserved = tvb_get_uint8(tvb, 8+offset);
1056 adaptation_len = tvb_get_uint8(tvb, 9+offset);
1058 sub_tree = proto_tree_add_subtree(tree, tvb, offset, 12+adaptation_len, ett_dsmcc_header, NULL, "DSM-CC Header");
1059 pi = proto_tree_add_item(sub_tree, hf_dsmcc_protocol_discriminator, tvb, offset, 1, ENC_BIG_ENDIAN);
1060 if (DSMCC_PROT_DISC != prot_disc) {
1061 expert_add_info_format(pinfo, pi, &ei_dsmcc_invalid_value, "Invalid value - should be 0x11");
1063 offset += 1;
1064 proto_tree_add_item(sub_tree, hf_dsmcc_type, tvb, offset, 1, ENC_BIG_ENDIAN);
1065 offset += 1;
1066 if (true == download_header) {
1067 msg_id = hf_dsmcc_dd_message_id;
1068 tx_id = hf_dsmcc_dd_download_id;
1069 proto_tree_add_item(sub_tree, msg_id, tvb, offset, 2, ENC_BIG_ENDIAN);
1070 offset += 2;
1071 proto_tree_add_item(sub_tree, tx_id, tvb, offset, 4, ENC_BIG_ENDIAN);
1072 offset += 4;
1073 } else {
1074 msg_id = hf_dsmcc_message_id;
1075 tx_id = hf_dsmcc_transaction_id;
1076 proto_tree_add_bitmask_with_flags(sub_tree, tvb, offset, msg_id, ett_dsmcc_message_id, bf_message_id, ENC_BIG_ENDIAN, BMT_NO_APPEND);
1077 offset += 2;
1078 proto_tree_add_bitmask_with_flags(sub_tree, tvb, offset, tx_id, ett_dsmcc_transaction_id, bf_transaction_id, ENC_BIG_ENDIAN, BMT_NO_APPEND);
1079 offset += 4;
1082 pi = proto_tree_add_item(sub_tree, hf_dsmcc_header_reserved, tvb, offset, 1, ENC_BIG_ENDIAN);
1083 if (0xff != reserved) {
1084 expert_add_info_format(pinfo, pi, &ei_dsmcc_invalid_value, "Invalid value - should be 0xff");
1086 offset += 1;
1088 proto_tree_add_item(sub_tree, hf_dsmcc_adaptation_length, tvb, offset, 1, ENC_BIG_ENDIAN);
1089 offset += 1;
1090 proto_tree_add_item(sub_tree, hf_dsmcc_message_length, tvb, offset, 2, ENC_BIG_ENDIAN);
1091 offset += 2;
1093 if (0 < adaptation_len) {
1094 sub_tvb = tvb_new_subset_length(tvb, offset, adaptation_len);
1095 dissect_dsmcc_adaptation_header(sub_tvb, pinfo, sub_tree);
1096 offset += adaptation_len;
1099 return offset-offset_start;
1102 static unsigned
1103 dissect_dsmcc_dii_compat_desc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
1104 unsigned offset)
1106 int i, j;
1107 uint8_t sub_count, sub_len;
1108 uint16_t len, count;
1109 proto_tree *compat_tree;
1110 proto_tree *desc_sub_tree;
1112 len = tvb_get_ntohs(tvb, offset);
1113 proto_tree_add_item(tree, hf_compat_desc_length, tvb, offset, 2, ENC_BIG_ENDIAN);
1114 offset += 2;
1116 if (0 < len) {
1117 count = tvb_get_ntohs(tvb, offset);
1118 proto_tree_add_item(tree, hf_compat_desc_count, tvb, offset, 2, ENC_BIG_ENDIAN);
1119 offset += 2;
1121 for (i = 0; i < count; i++) {
1122 compat_tree = proto_tree_add_subtree(tree, tvb, offset, len, ett_dsmcc_compat, NULL, "Compatibility Descriptor");
1123 proto_tree_add_item(compat_tree, hf_desc_type, tvb, offset, 1, ENC_BIG_ENDIAN);
1124 offset += 1;
1125 proto_tree_add_item(compat_tree, hf_desc_length, tvb, offset, 1, ENC_BIG_ENDIAN);
1126 offset += 1;
1127 proto_tree_add_item(compat_tree, hf_desc_spec_type, tvb, offset, 1, ENC_BIG_ENDIAN);
1128 offset += 1;
1129 proto_tree_add_item(compat_tree, hf_desc_spec_data, tvb, offset, 3, ENC_BIG_ENDIAN);
1130 offset += 3;
1131 proto_tree_add_item(compat_tree, hf_desc_model, tvb, offset, 2, ENC_BIG_ENDIAN);
1132 offset += 2;
1133 proto_tree_add_item(compat_tree, hf_desc_version, tvb, offset, 2, ENC_BIG_ENDIAN);
1134 offset += 2;
1136 sub_count = tvb_get_uint8(tvb, offset);
1137 proto_tree_add_item(compat_tree, hf_desc_sub_desc_count, tvb, offset, 1, ENC_BIG_ENDIAN);
1138 offset += 1;
1140 for (j = 0; j < sub_count; j++) {
1141 sub_len = tvb_get_uint8(tvb, offset+1);
1143 desc_sub_tree = proto_tree_add_subtree(compat_tree, tvb, offset, sub_len+2,
1144 ett_dsmcc_compat_sub_desc, NULL, "Sub Descriptor");
1145 proto_tree_add_item(desc_sub_tree, hf_desc_sub_desc_type, tvb, offset, 1, ENC_BIG_ENDIAN);
1146 offset += 1;
1147 proto_tree_add_item(desc_sub_tree, hf_desc_sub_desc_len, tvb, offset, 1, ENC_BIG_ENDIAN);
1148 offset += 1;
1150 offset += sub_len;
1154 if( 1000 == offset ) {
1155 expert_add_info( pinfo, NULL, &ei_dsmcc_crc_invalid);
1159 return 2 + len;
1162 static void
1163 dissect_dsmcc_dii(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
1164 unsigned offset)
1166 uint16_t modules, module_id, private_data_len;
1167 uint8_t module_info_len, module_version;
1168 unsigned i, module_size;
1169 proto_tree *mod_tree;
1171 proto_tree_add_item(tree, hf_dsmcc_dii_download_id, tvb, offset, 4, ENC_BIG_ENDIAN);
1172 offset += 4;
1173 proto_tree_add_item(tree, hf_dsmcc_dii_block_size, tvb, offset, 2, ENC_BIG_ENDIAN);
1174 offset += 2;
1175 proto_tree_add_item(tree, hf_dsmcc_dii_window_size, tvb, offset, 1, ENC_BIG_ENDIAN);
1176 offset +=1;
1177 proto_tree_add_item(tree, hf_dsmcc_dii_ack_period, tvb, offset, 1, ENC_BIG_ENDIAN);
1178 offset +=1;
1179 proto_tree_add_item(tree, hf_dsmcc_dii_t_c_download_window, tvb, offset, 4, ENC_BIG_ENDIAN);
1180 offset += 4;
1181 proto_tree_add_item(tree, hf_dsmcc_dii_t_c_download_scenario, tvb, offset, 4, ENC_BIG_ENDIAN);
1182 offset += 4;
1183 offset += dissect_dsmcc_dii_compat_desc(tvb, pinfo, tree, offset);
1184 proto_tree_add_item(tree, hf_dsmcc_dii_number_of_modules, tvb, offset, 2, ENC_BIG_ENDIAN);
1185 modules = tvb_get_ntohs(tvb, offset);
1186 offset += 2;
1188 for (i = 0; i < modules; i++ ) {
1189 module_id = tvb_get_ntohs(tvb, offset);
1190 module_size = tvb_get_ntohl(tvb, 2+offset);
1191 module_version = tvb_get_uint8(tvb, 6+offset);
1193 mod_tree = proto_tree_add_subtree_format(tree, tvb, offset, -1,
1194 ett_dsmcc_dii_module, NULL, "Module Id: 0x%x, Version: %u, Size: %u",
1195 module_id, module_version, module_size);
1196 proto_tree_add_item(mod_tree, hf_dsmcc_dii_module_id, tvb, offset, 2, ENC_BIG_ENDIAN);
1197 offset += 2;
1198 proto_tree_add_item(mod_tree, hf_dsmcc_dii_module_size, tvb, offset, 4, ENC_BIG_ENDIAN);
1199 offset += 4;
1200 proto_tree_add_item(mod_tree, hf_dsmcc_dii_module_version, tvb, offset, 1, ENC_BIG_ENDIAN);
1201 offset +=1;
1203 module_info_len = tvb_get_uint8(tvb, offset);
1204 proto_tree_add_item(mod_tree, hf_dsmcc_dii_module_info_length, tvb, offset, 1, ENC_BIG_ENDIAN);
1205 offset +=1;
1206 if (0 < module_info_len) {
1207 proto_tree_add_item(mod_tree, hf_etv_module_abs_path, tvb, offset, 1,
1208 ENC_ASCII|ENC_BIG_ENDIAN);
1209 offset += module_info_len;
1213 private_data_len = tvb_get_ntohs(tvb, offset);
1214 proto_tree_add_item(tree, hf_dsmcc_dii_private_data_length, tvb, offset, 2, ENC_BIG_ENDIAN);
1215 offset += 2;
1217 if (0 < private_data_len) {
1218 proto_tree_add_item(tree, hf_etv_dii_authority, tvb, offset, 1,
1219 ENC_ASCII|ENC_BIG_ENDIAN);
1220 /*offset += private_data_len;*/
1225 static void
1226 dissect_dsmcc_ddb(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
1227 proto_tree *top_tree, unsigned offset)
1229 tvbuff_t *sub_tvb;
1230 proto_item *pi;
1231 uint8_t reserved;
1233 proto_tree_add_item(tree, hf_dsmcc_ddb_module_id, tvb, offset, 2, ENC_BIG_ENDIAN);
1234 offset += 2;
1235 proto_tree_add_item(tree, hf_dsmcc_ddb_version, tvb, offset, 1, ENC_BIG_ENDIAN);
1236 offset +=1;
1237 reserved = tvb_get_uint8(tvb, offset);
1238 pi = proto_tree_add_item(tree, hf_dsmcc_ddb_reserved, tvb,
1239 offset, 1, ENC_BIG_ENDIAN);
1240 if (0xff != reserved) {
1241 expert_add_info_format(pinfo, pi, &ei_dsmcc_invalid_value,
1242 "Invalid value - should be 0xff");
1244 offset +=1;
1245 proto_tree_add_item(tree, hf_dsmcc_ddb_block_number, tvb, offset, 2, ENC_BIG_ENDIAN);
1246 offset += 2;
1248 sub_tvb = tvb_new_subset_remaining(tvb, offset);
1249 call_data_dissector(sub_tvb, pinfo, top_tree);
1253 static void
1254 dissect_dsmcc_un_download(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_tree *top_tree)
1256 proto_tree *sub_tree;
1257 uint16_t msg_id;
1258 unsigned offset = 0;
1260 msg_id = tvb_get_ntohs(tvb, offset+2);
1262 sub_tree = proto_tree_add_subtree_format(tree, tvb, 0, -1, ett_dsmcc_payload, NULL,
1263 "User Network Message - %s", val_to_str(msg_id, dsmcc_dd_message_id_vals, "%u"));
1265 switch (msg_id) {
1266 case 0x1001:
1267 case 0x1002:
1268 offset += dissect_dsmcc_header(tvb, pinfo, sub_tree, offset, false);
1269 dissect_dsmcc_dii(tvb, pinfo, sub_tree, offset);
1270 break;
1271 case 0x1003:
1272 offset += dissect_dsmcc_header(tvb, pinfo, sub_tree, offset, true);
1273 dissect_dsmcc_ddb(tvb, pinfo, sub_tree, top_tree, offset);
1274 break;
1275 case 0x1004:
1276 /* TODO: Add support */
1277 break;
1278 case 0x1005:
1279 /* TODO: Add support */
1280 break;
1281 case 0x1006:
1282 /* TODO: Add support */
1283 break;
1284 default:
1285 break;
1289 /* table 4-71 dsmccResourceDescriptorValue format*/
1290 static unsigned
1291 dissect_dsmcc_un_session_resource_value(
1292 tvbuff_t *tvb, unsigned offset, packet_info *pinfo _U_, proto_tree *sub_tree, unsigned value_len)
1294 uint32_t i, counter, resource_value_type;
1295 unsigned offset_start;
1297 offset_start = offset;
1299 proto_tree_add_item_ret_uint(sub_tree, hf_dsmcc_un_sess_rsrc_value_type, tvb, offset, 2, ENC_BIG_ENDIAN, &resource_value_type);
1300 offset += 2;
1301 if (resource_value_type == 1) /* single value */
1303 proto_tree_add_item(sub_tree, hf_dsmcc_un_sess_rsrc_value_data, tvb, offset, value_len, ENC_NA);
1304 offset += value_len;
1306 else if (resource_value_type == 2) /* list value */
1308 proto_tree_add_item_ret_uint(sub_tree, hf_dsmcc_un_sess_rsrc_value_count, tvb, offset, 2, ENC_BIG_ENDIAN, &counter);
1309 offset += 2;
1310 for (i=0; i<counter; i++)
1312 proto_tree_add_item(sub_tree, hf_dsmcc_un_sess_rsrc_value_data, tvb, offset, value_len, ENC_NA);
1313 offset += value_len;
1316 else if (resource_value_type == 3) /* range value */
1318 proto_tree_add_item(sub_tree, hf_dsmcc_un_sess_rsrc_most_desired, tvb, offset, value_len, ENC_NA);
1319 offset += value_len;
1320 proto_tree_add_item(sub_tree, hf_dsmcc_un_sess_rsrc_least_desired, tvb, offset, value_len, ENC_NA);
1321 offset += value_len;
1324 return offset-offset_start;
1328 static unsigned
1329 dissect_dsmcc_un_session_resources(
1330 tvbuff_t *tvb, unsigned offset, packet_info *pinfo _U_, proto_tree *sub_tree)
1332 proto_tree *pi;
1333 proto_tree *sub_sub_tree;
1334 proto_tree *sub_sub_sub_tree;
1335 proto_tree *sub_sub_sub_sub_tree;
1336 proto_tree *rsrc_tree;
1337 uint32_t i, j, counter, resource_count;
1338 uint16_t tmp, resource_type, data_fields_length, counter_ca;
1339 unsigned offset_start;
1341 offset_start = offset;
1343 /* Table 4-62 General format of the DSM-CC Resource Descriptor - dsmccResourceDescriptor() */
1344 proto_tree_add_item_ret_uint(sub_tree, hf_dsmcc_un_sess_rsrc_desc_count, tvb, offset, 2, ENC_BIG_ENDIAN, &resource_count);
1345 offset += 2;
1346 for (j=0; j<resource_count; j++)
1348 sub_sub_tree = proto_tree_add_subtree_format(sub_tree, tvb, offset, 0, ett_dsmcc_heading, NULL, "Resource %u", 1+j);
1350 /* Table 4-63 - commonDescriptorHeader() */
1351 sub_sub_sub_tree = proto_tree_add_subtree(sub_sub_tree, tvb, offset, 14, ett_dsmcc_heading, NULL, "Header");
1352 proto_tree_add_item(sub_sub_sub_tree, hf_dsmcc_un_sess_rsrc_request_id, tvb, offset, 2, ENC_NA);
1353 offset += 2;
1354 proto_tree_add_item(sub_sub_sub_tree, hf_dsmcc_un_sess_rsrc_descriptor_type, tvb, offset, 2, ENC_BIG_ENDIAN);
1355 resource_type = tvb_get_uint16(tvb, offset, ENC_BIG_ENDIAN);
1356 offset += 2;
1357 proto_tree_add_bitmask_with_flags(sub_sub_sub_tree, tvb, offset, hf_dsmcc_un_sess_rsrc_number, ett_dsmcc_rsrc_number, bf_rsrc_number, ENC_BIG_ENDIAN, BMT_NO_APPEND);
1358 offset += 2;
1359 proto_tree_add_bitmask_with_flags(sub_sub_sub_tree, tvb, offset, hf_dsmcc_un_sess_rsrc_association_tag, ett_dsmcc_rsrc_association_tag, bf_rsrc_association_tag, ENC_BIG_ENDIAN, BMT_NO_APPEND);
1360 offset += 2;
1361 proto_tree_add_bitmask_with_flags(sub_sub_sub_tree, tvb, offset, hf_dsmcc_un_sess_rsrc_flags, ett_dsmcc_rsrc_flags, bf_rsrc_flags, ENC_BIG_ENDIAN, BMT_NO_APPEND);
1362 offset += 1;
1363 proto_tree_add_item(sub_sub_sub_tree, hf_dsmcc_un_sess_rsrc_status, tvb, offset, 1, ENC_BIG_ENDIAN);
1364 offset += 1;
1365 proto_tree_add_item(sub_sub_sub_tree, hf_dsmcc_un_sess_rsrc_desc_data_fields_length, tvb, offset, 2, ENC_BIG_ENDIAN);
1366 data_fields_length = tvb_get_uint16(tvb, offset, ENC_BIG_ENDIAN);
1367 offset += 2;
1368 proto_tree_add_item(sub_sub_sub_tree, hf_dsmcc_un_sess_rsrc_data_field_count, tvb, offset, 2, ENC_BIG_ENDIAN);
1369 offset += 2;
1371 /* Resource data - resourceDescriptorDataFields() */
1372 sub_sub_sub_tree = proto_tree_add_subtree(sub_sub_tree, tvb, offset, data_fields_length, ett_dsmcc_heading, NULL, "Data");
1373 switch (resource_type)
1375 /* Table 4-74 Continuous Feed Session */
1376 case RSRC_CONT_FEED_SESS:
1377 rsrc_tree = proto_tree_add_subtree(sub_sub_sub_tree, tvb, offset, 10, ett_dsmcc_heading, NULL, "Session ID");
1378 proto_tree_add_item(rsrc_tree, hf_dsmcc_un_sess_session_id_device_id, tvb, offset, 6, ENC_NA);
1379 offset += 6;
1380 proto_tree_add_item(rsrc_tree, hf_dsmcc_un_sess_session_id_session_number, tvb, offset, 4, ENC_BIG_ENDIAN);
1381 offset += 4;
1382 proto_tree_add_item_ret_uint(sub_sub_sub_tree, hf_dsmcc_un_sess_rsrc_cfs_num_count, tvb, offset, 2, ENC_BIG_ENDIAN, &counter);
1383 offset += 2;
1384 for (i=0; i<counter; i++)
1386 proto_tree_add_item(sub_sub_sub_tree, hf_dsmcc_un_sess_rsrc_cfs_num, tvb, offset, 2, ENC_NA);
1388 break;
1389 /* Table 4-75 ATM Connection */
1390 case RSRC_ATM_CONN:
1391 rsrc_tree = proto_tree_add_subtree(sub_sub_sub_tree, tvb, offset, 0, ett_dsmcc_heading, NULL, "ATM Address:");
1392 offset += dissect_dsmcc_un_session_resource_value(tvb, offset, pinfo, rsrc_tree, 20);
1393 rsrc_tree = proto_tree_add_subtree(sub_sub_sub_tree, tvb, offset, 0, ett_dsmcc_heading, NULL, "ATM VCI:");
1394 offset += dissect_dsmcc_un_session_resource_value(tvb, offset, pinfo, rsrc_tree, 2);
1395 rsrc_tree = proto_tree_add_subtree(sub_sub_sub_tree, tvb, offset, 0, ett_dsmcc_heading, NULL, "ATM VPI:");
1396 offset += dissect_dsmcc_un_session_resource_value(tvb, offset, pinfo, rsrc_tree, 2);
1397 break;
1398 /* Table 4-76 MPEG Program */
1399 case RSRC_MPEG_PROG:
1400 rsrc_tree = proto_tree_add_subtree(sub_sub_sub_tree, tvb, offset, 0, ett_dsmcc_heading, NULL, "MPEG Program Number:");
1401 offset += dissect_dsmcc_un_session_resource_value(tvb, offset, pinfo, rsrc_tree, 2);
1402 rsrc_tree = proto_tree_add_subtree(sub_sub_sub_tree, tvb, offset, 0, ett_dsmcc_heading, NULL, "MPEG PMT PID:");
1403 offset += dissect_dsmcc_un_session_resource_value(tvb, offset, pinfo, rsrc_tree, 2);
1404 proto_tree_add_item(sub_sub_sub_tree, hf_dsmcc_un_sess_rsrc_mpeg_ca_pid, tvb, offset, 2, ENC_BIG_ENDIAN);
1405 offset += 2;
1406 proto_tree_add_item_ret_uint(sub_sub_sub_tree, hf_dsmcc_un_sess_rsrc_mpeg_elem_stream_count, tvb, offset, 2, ENC_BIG_ENDIAN, &counter);
1407 offset += 2;
1408 for (i=0; i<counter; i++)
1410 rsrc_tree = proto_tree_add_subtree(sub_sub_sub_tree, tvb, offset, 0, ett_dsmcc_heading, NULL, "MPEG PID:");
1411 offset += dissect_dsmcc_un_session_resource_value(tvb, offset, pinfo, rsrc_tree, 2);
1412 rsrc_tree = proto_tree_add_subtree(sub_sub_sub_tree, tvb, offset, 0, ett_dsmcc_heading, NULL, "MPEG Stream Type:");
1413 offset += dissect_dsmcc_un_session_resource_value(tvb, offset, pinfo, rsrc_tree, 1);
1414 proto_tree_add_item(sub_sub_sub_tree, hf_dsmcc_un_sess_rsrc_reserved, tvb, offset, 1, ENC_NA);
1415 offset += 1;
1416 rsrc_tree = proto_tree_add_subtree(sub_sub_sub_tree, tvb, offset, 0, ett_dsmcc_heading, NULL, "MPEG Association Tag:");
1417 offset += dissect_dsmcc_un_session_resource_value(tvb, offset, pinfo, rsrc_tree, 2);
1419 rsrc_tree = proto_tree_add_subtree(sub_sub_sub_tree, tvb, offset, 0, ett_dsmcc_heading, NULL, "MPEG PCR:");
1420 offset += dissect_dsmcc_un_session_resource_value(tvb, offset, pinfo, rsrc_tree, 2);
1421 break;
1422 /* Table 4-77 Physical Channel */
1423 case RSRC_PHYS_CHAN:
1424 rsrc_tree = proto_tree_add_subtree(sub_sub_sub_tree, tvb, offset, 0, ett_dsmcc_heading, NULL, "Channel ID (Hz):");
1425 offset += dissect_dsmcc_un_session_resource_value(tvb, offset, pinfo, rsrc_tree, 4);
1426 proto_tree_add_item(sub_sub_sub_tree, hf_dsmcc_un_sess_rsrc_phys_chan_direction, tvb, offset, 2, ENC_BIG_ENDIAN);
1427 offset += 2;
1428 break;
1429 /* Table 4-79 TS Upstream Bandwidth */
1430 case RSRC_TS_US_BW:
1431 rsrc_tree = proto_tree_add_subtree(sub_sub_sub_tree, tvb, offset, 0, ett_dsmcc_heading, NULL, "TS Upstream Bandwidth:");
1432 offset += dissect_dsmcc_un_session_resource_value(tvb, offset, pinfo, rsrc_tree, 4);
1433 rsrc_tree = proto_tree_add_subtree(sub_sub_sub_tree, tvb, offset, 0, ett_dsmcc_heading, NULL, "TS Upstream TSID:");
1434 offset += dissect_dsmcc_un_session_resource_value(tvb, offset, pinfo, rsrc_tree, 4);
1435 break;
1436 /* Table 4-80 TS Downstream Bandwidth */
1437 case RSRC_TS_DS_BW:
1438 rsrc_tree = proto_tree_add_subtree(sub_sub_sub_tree, tvb, offset, 0, ett_dsmcc_heading, NULL, "TS Downstream Bandwidth:");
1439 offset += dissect_dsmcc_un_session_resource_value(tvb, offset, pinfo, rsrc_tree, 4);
1440 rsrc_tree = proto_tree_add_subtree(sub_sub_sub_tree, tvb, offset, 0, ett_dsmcc_heading, NULL, "TS Downstream TSID:");
1441 offset += dissect_dsmcc_un_session_resource_value(tvb, offset, pinfo, rsrc_tree, 4);
1442 break;
1443 /* Table 4-81 ATM SVC Connection */
1444 case RSRC_ATM_SVC_CONN:
1445 /* TODO - Unsure how to implement ITU-T Q.2931 */
1446 break;
1447 /* Table 4-82 Connection Notify */
1448 case RSRC_CONN_NTFY:
1449 /* no data fields */
1450 break;
1451 /* Table 4-84 IP */
1452 case RSRC_IP:
1453 proto_tree_add_item(sub_sub_sub_tree, hf_dsmcc_un_sess_rsrc_src_ip_addr, tvb, offset, 4, ENC_BIG_ENDIAN);
1454 offset += 4;
1455 proto_tree_add_item(sub_sub_sub_tree, hf_dsmcc_un_sess_rsrc_src_ip_port, tvb, offset, 2, ENC_BIG_ENDIAN);
1456 offset += 2;
1457 proto_tree_add_item(sub_sub_sub_tree, hf_dsmcc_un_sess_rsrc_dst_ip_addr, tvb, offset, 4, ENC_BIG_ENDIAN);
1458 offset += 4;
1459 proto_tree_add_item(sub_sub_sub_tree, hf_dsmcc_un_sess_rsrc_dst_ip_port, tvb, offset, 2, ENC_BIG_ENDIAN);
1460 offset += 2;
1461 proto_tree_add_item(sub_sub_sub_tree, hf_dsmcc_un_sess_rsrc_ip_protocol, tvb, offset, 2, ENC_BIG_ENDIAN);
1462 offset += 2;
1463 break;
1464 /* Table 4-85 Client TDMA Assignment */
1465 case RSRC_CLN_TDMA_ASSIGN:
1466 rsrc_tree = proto_tree_add_subtree(sub_sub_sub_tree, tvb, offset, 0, ett_dsmcc_heading, NULL, "Start Slot Number:");
1467 offset += dissect_dsmcc_un_session_resource_value(tvb, offset, pinfo, rsrc_tree, 4);
1468 rsrc_tree = proto_tree_add_subtree(sub_sub_sub_tree, tvb, offset, 0, ett_dsmcc_heading, NULL, "Number of Slots:");
1469 offset += dissect_dsmcc_un_session_resource_value(tvb, offset, pinfo, rsrc_tree, 4);
1470 rsrc_tree = proto_tree_add_subtree(sub_sub_sub_tree, tvb, offset, 0, ett_dsmcc_heading, NULL, "Slot Spacing:");
1471 offset += dissect_dsmcc_un_session_resource_value(tvb, offset, pinfo, rsrc_tree, 4);
1472 rsrc_tree = proto_tree_add_subtree(sub_sub_sub_tree, tvb, offset, 0, ett_dsmcc_heading, NULL, "Upstream Transport ID:");
1473 offset += dissect_dsmcc_un_session_resource_value(tvb, offset, pinfo, rsrc_tree, 4);
1474 break;
1475 /* Table 4-86 PSTN Setup */
1476 case RSRC_PSTN_SETUP:
1477 proto_tree_add_item(sub_sub_sub_tree, hf_dsmcc_un_sess_rsrc_pstn_calling_id, tvb, offset, 12, ENC_NA);
1478 offset += 12;
1479 proto_tree_add_item(sub_sub_sub_tree, hf_dsmcc_un_sess_rsrc_pstn_called_id, tvb, offset, 12, ENC_NA);
1480 offset += 12;
1481 break;
1482 /* Table 4-87 NISDN Setup */
1483 case RSRC_NISDN_SETUP:
1484 /* TODO - Unsure how to implement ITU-T Q.931 */
1485 break;
1486 /* Table 4-88 NISDN Connection */
1487 case RSRC_NISDN_CONN:
1488 /* TODO - Unsure how to implement ITU-T Q.931 */
1489 break;
1490 /* Table 4-89 Q.922 Connection */
1491 case RSRC_Q922_CONN:
1492 proto_tree_add_item_ret_uint(sub_sub_sub_tree, hf_dsmcc_un_sess_rsrc_dlci_count, tvb, offset, 2, ENC_BIG_ENDIAN, &counter);
1493 offset += 2;
1494 for (i=0; i<counter; i++)
1496 proto_tree_add_item(sub_sub_sub_tree, hf_dsmcc_un_sess_rsrc_dlci, tvb, offset, 2, ENC_NA);
1497 offset += 2;
1498 proto_tree_add_item(sub_sub_sub_tree, hf_dsmcc_un_sess_rsrc_dl_association_tag, tvb, offset, 2, ENC_NA);
1499 offset += 2;
1501 break;
1502 /* Table 4-92 Headend List */
1503 case RSRC_HEADEND_LIST:
1504 proto_tree_add_item_ret_uint(sub_sub_sub_tree, hf_dsmcc_un_sess_rsrc_headend_count, tvb, offset, 2, ENC_BIG_ENDIAN, &counter);
1505 offset += 2;
1506 for (i=0; i<counter; i++)
1508 proto_tree_add_item(sub_sub_sub_tree, hf_dsmcc_un_sess_rsrc_headend_code, tvb, offset, 20, ENC_NA);
1509 offset += 20;
1511 break;
1512 /* Table 4-93 ATM VC Connection */
1513 case RSRC_ATM_VC_CONN:
1514 proto_tree_add_item(sub_sub_sub_tree, hf_dsmcc_un_sess_rsrc_atm_vpi, tvb, offset, 2, ENC_NA);
1515 offset += 2;
1516 proto_tree_add_item(sub_sub_sub_tree, hf_dsmcc_un_sess_rsrc_atm_vci, tvb, offset, 2, ENC_NA);
1517 offset += 2;
1518 break;
1519 /* Table 4-94 SDB Continuous Feed */
1520 case RSRC_SDB_CONT_FEED:
1521 proto_tree_add_item(sub_sub_sub_tree, hf_dsmcc_un_sess_rsrc_sdb_id, tvb, offset, 6, ENC_NA);
1522 offset += 6;
1523 proto_tree_add_item_ret_uint(sub_sub_sub_tree, hf_dsmcc_un_sess_rsrc_sdb_program_count, tvb, offset, 2, ENC_BIG_ENDIAN, &counter);
1524 offset += 2;
1525 for (i=0; i<counter; i++)
1527 proto_tree_add_item(sub_sub_sub_tree, hf_dsmcc_un_sess_rsrc_sdb_association_tag, tvb, offset, 2, ENC_NA);
1528 offset += 2;
1529 proto_tree_add_item(sub_sub_sub_tree, hf_dsmcc_un_sess_rsrc_sdb_broadcast_program_id, tvb, offset, 2, ENC_NA);
1530 offset += 2;
1532 break;
1533 /* Table 4-95 SDB Associations */
1534 case RSRC_SDB_ASSOC:
1535 proto_tree_add_item(sub_sub_sub_tree, hf_dsmcc_un_sess_rsrc_sdb_control_association_tag, tvb, offset, 2, ENC_NA);
1536 offset += 2;
1537 proto_tree_add_item(sub_sub_sub_tree, hf_dsmcc_un_sess_rsrc_sdb_program_association_tag, tvb, offset, 2, ENC_NA);
1538 offset += 2;
1539 break;
1540 /* Table 4-96 SDB Entitlement */
1541 case RSRC_SDB_ENT:
1542 proto_tree_add_item(sub_sub_sub_tree, hf_dsmcc_un_sess_rsrc_sdb_id, tvb, offset, 6, ENC_NA);
1543 offset += 6;
1544 proto_tree_add_item_ret_uint(sub_sub_sub_tree, hf_dsmcc_un_sess_rsrc_sdb_exclude_count, tvb, offset, 2, ENC_BIG_ENDIAN, &counter);
1545 offset += 2;
1546 for (i=0; i<counter; i++)
1548 proto_tree_add_item(sub_sub_sub_tree, hf_dsmcc_un_sess_rsrc_sdb_broadcast_program_id, tvb, offset, 2, ENC_NA);
1549 offset += 2;
1551 proto_tree_add_item_ret_uint(sub_sub_sub_tree, hf_dsmcc_un_sess_rsrc_sdb_include_count, tvb, offset, 2, ENC_BIG_ENDIAN, &counter);
1552 offset += 2;
1553 for (i=0; i<counter; i++)
1555 proto_tree_add_item(sub_sub_sub_tree, hf_dsmcc_un_sess_rsrc_sdb_broadcast_program_id, tvb, offset, 2, ENC_NA);
1556 offset += 2;
1558 break;
1559 /* User Defined - Modulation Mode */
1560 case RSRC_MODULATION_MODE:
1561 proto_tree_add_item(sub_sub_sub_tree, hf_dsmcc_un_sess_rsrc_trans_system, tvb, offset, 1, ENC_BIG_ENDIAN);
1562 offset += 1;
1563 proto_tree_add_item(sub_sub_sub_tree, hf_dsmcc_un_sess_rsrc_inner_coding, tvb, offset, 1, ENC_BIG_ENDIAN);
1564 offset += 1;
1565 proto_tree_add_item(sub_sub_sub_tree, hf_dsmcc_un_sess_rsrc_split_bitstream, tvb, offset, 1, ENC_BIG_ENDIAN);
1566 offset += 1;
1567 proto_tree_add_item(sub_sub_sub_tree, hf_dsmcc_un_sess_rsrc_mod_format, tvb, offset, 1, ENC_BIG_ENDIAN);
1568 offset += 1;
1569 proto_tree_add_item(sub_sub_sub_tree, hf_dsmcc_un_sess_rsrc_symbol_rate, tvb, offset, 4, ENC_BIG_ENDIAN);
1570 offset += 4;
1571 proto_tree_add_item(sub_sub_sub_tree, hf_dsmcc_un_sess_rsrc_reserved, tvb, offset, 1, ENC_NA);
1572 offset += 1;
1573 proto_tree_add_item(sub_sub_sub_tree, hf_dsmcc_un_sess_rsrc_interleave_depth, tvb, offset, 1, ENC_BIG_ENDIAN);
1574 offset += 1;
1575 proto_tree_add_item(sub_sub_sub_tree, hf_dsmcc_un_sess_rsrc_modulation_mode, tvb, offset, 1, ENC_BIG_ENDIAN);
1576 offset += 1;
1577 proto_tree_add_item(sub_sub_sub_tree, hf_dsmcc_un_sess_rsrc_fec, tvb, offset, 1, ENC_BIG_ENDIAN);
1578 offset += 1;
1579 break;
1580 /* User Defined - Headend ID */
1581 case RSRC_HEADEND_ID:
1582 tmp = tvb_get_uint16(tvb, offset, ENC_BIG_ENDIAN);
1583 pi = proto_tree_add_item(sub_sub_sub_tree, hf_dsmcc_un_sess_rsrc_headend_flag, tvb, offset, 2, ENC_BIG_ENDIAN);
1584 if ((tmp == 0) || (tmp > 4)) {
1585 expert_add_info_format(pinfo, pi, &ei_dsmcc_invalid_value, "Invalid value - should be values 1 to 4");
1587 offset += 2;
1588 sub_sub_sub_sub_tree = proto_tree_add_subtree(sub_sub_sub_tree, tvb, offset, 20, ett_dsmcc_heading, NULL, "Headend ID:");
1589 offset += dissect_dsmcc_un_session_nsap(tvb, offset, pinfo, sub_sub_sub_sub_tree);
1590 proto_tree_add_item(sub_sub_sub_tree, hf_dsmcc_un_sess_rsrc_headend_tsid, tvb, offset, 4, ENC_BIG_ENDIAN);
1591 offset += 4;
1592 break;
1593 /* User Defined - Server Conditional Access */
1594 case RSRC_SERVER_CA:
1595 rsrc_tree = proto_tree_add_subtree(sub_sub_sub_tree, tvb, offset, 0, ett_dsmcc_heading, NULL, "Server CA System ID:");
1596 offset += dissect_dsmcc_un_session_resource_value(tvb, offset, pinfo, rsrc_tree, 2);
1597 proto_tree_add_item(sub_sub_sub_tree, hf_dsmcc_un_sess_rsrc_server_ca_copyprotect, tvb, offset, 2, ENC_NA);
1598 offset += 2;
1599 proto_tree_add_item_ret_uint(sub_sub_sub_tree, hf_dsmcc_un_sess_rsrc_server_ca_usercount, tvb, offset, 2, ENC_BIG_ENDIAN, &counter);
1600 offset += 2;
1601 for (i=0; i<counter; i++)
1603 sub_sub_sub_sub_tree = proto_tree_add_subtree_format(sub_sub_sub_tree, tvb, offset, 20, ett_dsmcc_heading, NULL, "User ID %u", 1+i);
1604 offset += dissect_dsmcc_un_session_nsap(tvb, offset, pinfo, sub_sub_sub_sub_tree);
1606 break;
1607 /* User Defined - Client Conditional Access */
1608 case RSRC_CLIENT_CA:
1609 rsrc_tree = proto_tree_add_subtree(sub_sub_sub_tree, tvb, offset, 0, ett_dsmcc_heading, NULL, "Client CA System ID:");
1610 offset += dissect_dsmcc_un_session_resource_value(tvb, offset, pinfo, rsrc_tree, 2);
1611 proto_tree_add_item(sub_sub_sub_tree, hf_dsmcc_un_sess_rsrc_client_ca_info_length, tvb, offset, 2, ENC_BIG_ENDIAN);
1612 counter_ca = tvb_get_uint16(tvb, offset, ENC_BIG_ENDIAN);
1613 offset += 2;
1614 if (counter_ca > 0)
1616 proto_tree_add_item(sub_sub_sub_tree, hf_dsmcc_un_sess_rsrc_client_ca_info_data, tvb, offset, counter_ca, ENC_NA);
1617 offset = offset + counter_ca;
1619 break;
1620 /* User Defined - Ethernet Interface */
1621 case RSRC_ETHERNET:
1622 rsrc_tree = proto_tree_add_subtree(sub_sub_sub_tree, tvb, offset, 0, ett_dsmcc_heading, NULL, "Ethernet Source UDP:");
1623 offset += dissect_dsmcc_un_session_resource_value(tvb, offset, pinfo, rsrc_tree, 2);
1624 rsrc_tree = proto_tree_add_subtree(sub_sub_sub_tree, tvb, offset, 0, ett_dsmcc_heading, NULL, "Ethernet Source IP:");
1625 offset += dissect_dsmcc_un_session_resource_value(tvb, offset, pinfo, rsrc_tree, 4);
1626 rsrc_tree = proto_tree_add_subtree(sub_sub_sub_tree, tvb, offset, 0, ett_dsmcc_heading, NULL, "Ethernet Source MAC:");
1627 offset += dissect_dsmcc_un_session_resource_value(tvb, offset, pinfo, rsrc_tree, 6);
1628 rsrc_tree = proto_tree_add_subtree(sub_sub_sub_tree, tvb, offset, 0, ett_dsmcc_heading, NULL, "Ethernet Destination UDP:");
1629 offset += dissect_dsmcc_un_session_resource_value(tvb, offset, pinfo, rsrc_tree, 2);
1630 rsrc_tree = proto_tree_add_subtree(sub_sub_sub_tree, tvb, offset, 0, ett_dsmcc_heading, NULL, "Ethernet Destination IP:");
1631 offset += dissect_dsmcc_un_session_resource_value(tvb, offset, pinfo, rsrc_tree, 4);
1632 rsrc_tree = proto_tree_add_subtree(sub_sub_sub_tree, tvb, offset, 0, ett_dsmcc_heading, NULL, "Ethernet Destination MAC:");
1633 offset += dissect_dsmcc_un_session_resource_value(tvb, offset, pinfo, rsrc_tree, 6);
1634 break;
1635 /* User Defined - Service Group */
1636 case RSRC_SERVICE_GROUP:
1637 proto_tree_add_item(sub_sub_sub_tree, hf_dsmcc_un_sess_rsrc_value_type, tvb, offset, 2, ENC_BIG_ENDIAN);
1638 offset += 2;
1639 proto_tree_add_item(sub_sub_sub_tree, hf_dsmcc_un_sess_rsrc_service_group, tvb, offset, 4, ENC_BIG_ENDIAN);
1640 offset += 4;
1641 break;
1642 /* Table 4-90 Shared Resource */
1643 case RSRC_SHARED_RSRC:
1644 proto_tree_add_item(sub_sub_sub_tree, hf_dsmcc_un_sess_rsrc_shared_resource_num, tvb, offset, 2, ENC_NA);
1645 offset += 2;
1646 break;
1647 /* Table 4-91 Shared Resource Request ID */
1648 case RSRC_SHARED_REQ_ID:
1649 proto_tree_add_item(sub_sub_sub_tree, hf_dsmcc_un_sess_rsrc_shared_resource_request_id, tvb, offset, 2, ENC_NA);
1650 offset += 2;
1651 break;
1652 /* Table 4-63 Type Owner */
1653 case RSRC_TYPE_OWNER:
1654 proto_tree_add_item(sub_sub_sub_tree, hf_dsmcc_un_sess_rsrc_type_owner_id, tvb, offset, 3, ENC_NA);
1655 offset += 3;
1656 proto_tree_add_item(sub_sub_sub_tree, hf_dsmcc_un_sess_rsrc_type_owner_value, tvb, offset, 3, ENC_NA);
1657 offset += 3;
1658 break;
1659 default:
1660 break;
1664 return offset-offset_start;
1667 /* UserData() is vendor proprietary, therefore not dissected. */
1668 static unsigned
1669 dissect_dsmcc_un_session_user_data(
1670 tvbuff_t *tvb, unsigned offset, packet_info *pinfo _U_, proto_tree *tree)
1672 unsigned offset_start;
1673 uint16_t uu_len, priv_len;
1675 offset_start = offset;
1677 uu_len = tvb_get_ntohs(tvb, offset);
1678 proto_tree_add_item(tree, hf_dsmcc_un_sess_uu_data_len, tvb, offset, 2, ENC_BIG_ENDIAN);
1679 offset += 2;
1681 if (uu_len>0) {
1682 proto_tree_add_item(tree, hf_dsmcc_un_sess_uu_data, tvb, offset, uu_len, ENC_NA);
1683 offset += uu_len;
1686 priv_len = tvb_get_ntohs(tvb, offset);
1687 proto_tree_add_item(tree, hf_dsmcc_un_sess_priv_data_len, tvb, offset, 2, ENC_BIG_ENDIAN);
1688 offset += 2;
1690 if (priv_len>0) {
1691 proto_tree_add_item(tree, hf_dsmcc_un_sess_priv_data, tvb, offset, priv_len, ENC_NA);
1692 offset += priv_len;
1695 return offset-offset_start;
1699 static void
1700 dissect_dsmcc_un_session(tvbuff_t *tvb, packet_info *pinfo,
1701 proto_tree *tree, proto_tree *top_tree _U_)
1703 proto_item *pi;
1704 proto_tree *sub_tree;
1705 proto_tree *sub_sub_tree;
1706 uint32_t i, counter;
1707 uint16_t msg_id;
1708 unsigned offset = 0;
1710 msg_id = tvb_get_ntohs(tvb, offset+2);
1712 sub_tree = proto_tree_add_subtree_format(tree, tvb, offset, -1,
1713 ett_dsmcc_payload, &pi, "User Network Message (Session) - %s",
1714 val_to_str(msg_id, dsmcc_un_sess_message_id_vals, "0x%x"));
1715 col_append_sep_str(pinfo->cinfo, COL_INFO, NULL,
1716 val_to_str(msg_id, dsmcc_un_sess_message_id_vals, "0x%x"));
1718 offset += dissect_dsmcc_header(tvb, pinfo, sub_tree, offset, false);
1720 switch (msg_id) {
1722 /* CLIENT Messages */
1723 case DSMCC_UN_SESS_CLN_SESS_SET_REQ:
1724 offset += dissect_dsmcc_un_session_id(tvb, offset, pinfo, sub_tree);
1725 proto_tree_add_item(sub_tree, hf_dsmcc_un_sess_reserved, tvb, offset, 2, ENC_BIG_ENDIAN);
1726 offset += 2;
1727 /* client nsap */
1728 sub_sub_tree = proto_tree_add_subtree(sub_tree, tvb, offset, 20, ett_dsmcc_heading, NULL, "Client ID");
1729 offset += dissect_dsmcc_un_session_nsap(tvb, offset, pinfo, sub_sub_tree);
1730 /* server nsap */
1731 sub_sub_tree = proto_tree_add_subtree(sub_tree, tvb, offset, 20, ett_dsmcc_heading, NULL, "Server ID");
1732 offset += dissect_dsmcc_un_session_nsap(tvb, offset, pinfo, sub_sub_tree);
1733 /* user data */
1734 sub_sub_tree = proto_tree_add_subtree(sub_tree, tvb, offset, -1, ett_dsmcc_heading, NULL, "User Data");
1735 offset += dissect_dsmcc_un_session_user_data(tvb, offset, pinfo, sub_sub_tree);
1736 break;
1737 case DSMCC_UN_SESS_CLN_SESS_SET_CNF:
1738 offset += dissect_dsmcc_un_session_id(tvb, offset, pinfo, sub_tree);
1739 proto_tree_add_item(sub_tree, hf_dsmcc_un_sess_response, tvb, offset, 2, ENC_BIG_ENDIAN);
1740 offset += 2;
1741 sub_sub_tree = proto_tree_add_subtree(sub_tree, tvb, offset, 20, ett_dsmcc_heading, NULL, "Server ID");
1742 offset += dissect_dsmcc_un_session_nsap(tvb, offset, pinfo, sub_sub_tree);
1743 sub_sub_tree = proto_tree_add_subtree(sub_tree, tvb, offset, -1, ett_dsmcc_heading, NULL, "Resources");
1744 offset += dissect_dsmcc_un_session_resources(tvb, offset, pinfo, sub_sub_tree);
1745 sub_sub_tree = proto_tree_add_subtree(sub_tree, tvb, offset, -1, ett_dsmcc_heading, NULL, "User Data");
1746 offset += dissect_dsmcc_un_session_user_data(tvb, offset, pinfo, sub_sub_tree);
1747 break;
1748 case DSMCC_UN_SESS_CLN_SESS_REL_REQ:
1749 offset += dissect_dsmcc_un_session_id(tvb, offset, pinfo, sub_tree);
1750 proto_tree_add_item(sub_tree, hf_dsmcc_un_sess_reason, tvb, offset, 2, ENC_BIG_ENDIAN);
1751 offset += 2;
1752 sub_sub_tree = proto_tree_add_subtree(sub_tree, tvb, offset, -1, ett_dsmcc_heading, NULL, "User Data");
1753 offset += dissect_dsmcc_un_session_user_data(tvb, offset, pinfo, sub_sub_tree);
1754 break;
1755 case DSMCC_UN_SESS_CLN_SESS_REL_CNF:
1756 offset += dissect_dsmcc_un_session_id(tvb, offset, pinfo, sub_tree);
1757 proto_tree_add_item(sub_tree, hf_dsmcc_un_sess_response, tvb, offset, 2, ENC_BIG_ENDIAN);
1758 offset += 2;
1759 sub_sub_tree = proto_tree_add_subtree(sub_tree, tvb, offset, -1, ett_dsmcc_heading, NULL, "User Data");
1760 offset += dissect_dsmcc_un_session_user_data(tvb, offset, pinfo, sub_sub_tree);
1761 break;
1762 case DSMCC_UN_SESS_CLN_SESS_REL_IND:
1763 offset += dissect_dsmcc_un_session_id(tvb, offset, pinfo, sub_tree);
1764 proto_tree_add_item(sub_tree, hf_dsmcc_un_sess_reason, tvb, offset, 2, ENC_BIG_ENDIAN);
1765 offset += 2;
1766 sub_sub_tree = proto_tree_add_subtree(sub_tree, tvb, offset, -1, ett_dsmcc_heading, NULL, "User Data");
1767 offset += dissect_dsmcc_un_session_user_data(tvb, offset, pinfo, sub_sub_tree);
1768 break;
1769 case DSMCC_UN_SESS_CLN_SESS_REL_RES:
1770 offset += dissect_dsmcc_un_session_id(tvb, offset, pinfo, sub_tree);
1771 proto_tree_add_item(sub_tree, hf_dsmcc_un_sess_response, tvb, offset, 2, ENC_BIG_ENDIAN);
1772 offset += 2;
1773 sub_sub_tree = proto_tree_add_subtree(sub_tree, tvb, offset, -1, ett_dsmcc_heading, NULL, "User Data");
1774 offset += dissect_dsmcc_un_session_user_data(tvb, offset, pinfo, sub_sub_tree);
1775 break;
1776 case DSMCC_UN_SESS_CLN_ADD_RSRC_IND:
1777 offset += dissect_dsmcc_un_session_id(tvb, offset, pinfo, sub_tree);
1778 sub_sub_tree = proto_tree_add_subtree(sub_tree, tvb, offset, -1, ett_dsmcc_heading, NULL, "Resources");
1779 offset += dissect_dsmcc_un_session_resources(tvb, offset, pinfo, sub_sub_tree);
1780 sub_sub_tree = proto_tree_add_subtree(sub_tree, tvb, offset, -1, ett_dsmcc_heading, NULL, "User Data");
1781 offset += dissect_dsmcc_un_session_user_data(tvb, offset, pinfo, sub_sub_tree);
1782 break;
1783 case DSMCC_UN_SESS_CLN_ADD_RSRC_RES:
1784 offset += dissect_dsmcc_un_session_id(tvb, offset, pinfo, sub_tree);
1785 proto_tree_add_item(sub_tree, hf_dsmcc_un_sess_response, tvb, offset, 2, ENC_BIG_ENDIAN);
1786 offset += 2;
1787 sub_sub_tree = proto_tree_add_subtree(sub_tree, tvb, offset, -1, ett_dsmcc_heading, NULL, "Resources");
1788 offset += dissect_dsmcc_un_session_resources(tvb, offset, pinfo, sub_sub_tree);
1789 sub_sub_tree = proto_tree_add_subtree(sub_tree, tvb, offset, -1, ett_dsmcc_heading, NULL, "User Data");
1790 offset += dissect_dsmcc_un_session_user_data(tvb, offset, pinfo, sub_sub_tree);
1791 break;
1792 case DSMCC_UN_SESS_CLN_DEL_RSRC_IND:
1793 offset += dissect_dsmcc_un_session_id(tvb, offset, pinfo, sub_tree);
1794 proto_tree_add_item(sub_tree, hf_dsmcc_un_sess_reason, tvb, offset, 2, ENC_BIG_ENDIAN);
1795 offset += 2;
1796 proto_tree_add_item_ret_uint(sub_tree, hf_dsmcc_un_sess_resource_count, tvb, offset, 2, ENC_BIG_ENDIAN, &counter);
1797 offset += 2;
1798 for (i=0; i<counter; i++)
1800 proto_tree_add_item(sub_tree, hf_dsmcc_un_sess_resource_num, tvb, offset, 2, ENC_NA);
1801 offset += 2;
1803 sub_sub_tree = proto_tree_add_subtree(sub_tree, tvb, offset, -1, ett_dsmcc_heading, NULL, "User Data");
1804 offset += dissect_dsmcc_un_session_user_data(tvb, offset, pinfo, sub_sub_tree);
1805 break;
1806 case DSMCC_UN_SESS_CLN_DEL_RSRC_RES:
1807 offset += dissect_dsmcc_un_session_id(tvb, offset, pinfo, sub_tree);
1808 proto_tree_add_item(sub_tree, hf_dsmcc_un_sess_response, tvb, offset, 2, ENC_BIG_ENDIAN);
1809 offset += 2;
1810 sub_sub_tree = proto_tree_add_subtree(sub_tree, tvb, offset, -1, ett_dsmcc_heading, NULL, "User Data");
1811 offset += dissect_dsmcc_un_session_user_data(tvb, offset, pinfo, sub_sub_tree);
1812 break;
1813 case DSMCC_UN_SESS_CLN_STATUS_REQ:
1814 offset += dissect_dsmcc_un_session_id(tvb, offset, pinfo, sub_tree);
1815 proto_tree_add_item(sub_tree, hf_dsmcc_un_sess_reason, tvb, offset, 2, ENC_BIG_ENDIAN);
1816 offset += 2;
1817 sub_sub_tree = proto_tree_add_subtree(sub_tree, tvb, offset, 20, ett_dsmcc_heading, NULL, "Client ID");
1818 offset += dissect_dsmcc_un_session_nsap(tvb, offset, pinfo, sub_sub_tree);
1819 proto_tree_add_item(sub_tree, hf_dsmcc_un_sess_status_type, tvb, offset, 2, ENC_BIG_ENDIAN);
1820 offset += 2;
1821 proto_tree_add_item_ret_uint(sub_tree, hf_dsmcc_un_sess_status_count, tvb, offset, 2, ENC_BIG_ENDIAN, &counter);
1822 offset += 2;
1823 for (i=0; i<counter; i++)
1825 proto_tree_add_item(sub_tree, hf_dsmcc_un_sess_status_byte, tvb, offset, 1, ENC_NA);
1826 offset += 1;
1828 break;
1829 case DSMCC_UN_SESS_CLN_STATUS_CNF:
1830 proto_tree_add_item(sub_tree, hf_dsmcc_un_sess_response, tvb, offset, 2, ENC_BIG_ENDIAN);
1831 offset += 2;
1832 proto_tree_add_item(sub_tree, hf_dsmcc_un_sess_status_type, tvb, offset, 2, ENC_BIG_ENDIAN);
1833 offset += 2;
1834 proto_tree_add_item_ret_uint(sub_tree, hf_dsmcc_un_sess_status_count, tvb, offset, 2, ENC_BIG_ENDIAN, &counter);
1835 offset += 2;
1836 for (i=0; i<counter; i++)
1838 proto_tree_add_item(sub_tree, hf_dsmcc_un_sess_status_byte, tvb, offset, 1, ENC_NA);
1839 offset += 1;
1841 break;
1842 case DSMCC_UN_SESS_CLN_STATUS_IND:
1843 proto_tree_add_item(sub_tree, hf_dsmcc_un_sess_reason, tvb, offset, 2, ENC_BIG_ENDIAN);
1844 offset += 2;
1845 proto_tree_add_item(sub_tree, hf_dsmcc_un_sess_status_type, tvb, offset, 2, ENC_BIG_ENDIAN);
1846 offset += 2;
1847 proto_tree_add_item_ret_uint(sub_tree, hf_dsmcc_un_sess_status_count, tvb, offset, 2, ENC_BIG_ENDIAN, &counter);
1848 offset += 2;
1849 for (i=0; i<counter; i++)
1851 proto_tree_add_item(sub_tree, hf_dsmcc_un_sess_status_byte, tvb, offset, 1, ENC_NA);
1852 offset += 1;
1854 break;
1855 case DSMCC_UN_SESS_CLN_STATUS_RES:
1856 proto_tree_add_item(sub_tree, hf_dsmcc_un_sess_response, tvb, offset, 2, ENC_BIG_ENDIAN);
1857 offset += 2;
1858 proto_tree_add_item(sub_tree, hf_dsmcc_un_sess_status_type, tvb, offset, 2, ENC_BIG_ENDIAN);
1859 offset += 2;
1860 proto_tree_add_item_ret_uint(sub_tree, hf_dsmcc_un_sess_status_count, tvb, offset, 2, ENC_BIG_ENDIAN, &counter);
1861 offset += 2;
1862 for (i=0; i<counter; i++)
1864 proto_tree_add_item(sub_tree, hf_dsmcc_un_sess_status_byte, tvb, offset, 1, ENC_NA);
1865 offset += 1;
1867 break;
1868 case DSMCC_UN_SESS_CLN_RESET_REQ:
1869 sub_sub_tree = proto_tree_add_subtree(sub_tree, tvb, offset, 20, ett_dsmcc_heading, NULL, "Client ID");
1870 offset += dissect_dsmcc_un_session_nsap(tvb, offset, pinfo, sub_sub_tree);
1871 proto_tree_add_item(sub_tree, hf_dsmcc_un_sess_reason, tvb, offset, 2, ENC_BIG_ENDIAN);
1872 offset += 2;
1873 break;
1874 case DSMCC_UN_SESS_CLN_RESET_CNF:
1875 sub_sub_tree = proto_tree_add_subtree(sub_tree, tvb, offset, 20, ett_dsmcc_heading, NULL, "Client ID");
1876 offset += dissect_dsmcc_un_session_nsap(tvb, offset, pinfo, sub_sub_tree);
1877 proto_tree_add_item(sub_tree, hf_dsmcc_un_sess_response, tvb, offset, 2, ENC_BIG_ENDIAN);
1878 offset += 2;
1879 break;
1880 case DSMCC_UN_SESS_CLN_RESET_IND:
1881 sub_sub_tree = proto_tree_add_subtree(sub_tree, tvb, offset, 20, ett_dsmcc_heading, NULL, "Client ID");
1882 offset += dissect_dsmcc_un_session_nsap(tvb, offset, pinfo, sub_sub_tree);
1883 proto_tree_add_item(sub_tree, hf_dsmcc_un_sess_reason, tvb, offset, 2, ENC_BIG_ENDIAN);
1884 offset += 2;
1885 break;
1886 case DSMCC_UN_SESS_CLN_RESET_RES:
1887 sub_sub_tree = proto_tree_add_subtree(sub_tree, tvb, offset, 20, ett_dsmcc_heading, NULL, "Client ID");
1888 offset += dissect_dsmcc_un_session_nsap(tvb, offset, pinfo, sub_sub_tree);
1889 proto_tree_add_item(sub_tree, hf_dsmcc_un_sess_response, tvb, offset, 2, ENC_BIG_ENDIAN);
1890 offset += 2;
1891 break;
1892 case DSMCC_UN_SESS_CLN_SESS_PROC_IND:
1893 offset += dissect_dsmcc_un_session_id(tvb, offset, pinfo, sub_tree);
1894 proto_tree_add_item(sub_tree, hf_dsmcc_un_sess_reason, tvb, offset, 2, ENC_BIG_ENDIAN);
1895 offset += 2;
1896 break;
1897 case DSMCC_UN_SESS_CLN_CONN_REQ:
1898 offset += dissect_dsmcc_un_session_id(tvb, offset, pinfo, sub_tree);
1899 sub_sub_tree = proto_tree_add_subtree(sub_tree, tvb, offset, -1, ett_dsmcc_heading, NULL, "User Data");
1900 offset += dissect_dsmcc_un_session_user_data(tvb, offset, pinfo, sub_sub_tree);
1901 break;
1902 case DSMCC_UN_SESS_CLN_SESS_TRN_IND:
1903 offset += dissect_dsmcc_un_session_id(tvb, offset, pinfo, sub_tree);
1904 proto_tree_add_item(sub_tree, hf_dsmcc_reserved, tvb, offset, 2, ENC_NA);
1905 offset += 2;
1906 /* client */
1907 sub_sub_tree = proto_tree_add_subtree(sub_tree, tvb, offset, 20, ett_dsmcc_heading, NULL, "Client ID");
1908 offset += dissect_dsmcc_un_session_nsap(tvb, offset, pinfo, sub_sub_tree);
1909 /* old server */
1910 sub_sub_tree = proto_tree_add_subtree(sub_tree, tvb, offset, 20, ett_dsmcc_heading, NULL, "Old Server ID");
1911 offset += dissect_dsmcc_un_session_nsap(tvb, offset, pinfo, sub_sub_tree);
1912 /* new server */
1913 sub_sub_tree = proto_tree_add_subtree(sub_tree, tvb, offset, 20, ett_dsmcc_heading, NULL, "New Server ID");
1914 offset += dissect_dsmcc_un_session_nsap(tvb, offset, pinfo, sub_sub_tree);
1915 sub_sub_tree = proto_tree_add_subtree(sub_tree, tvb, offset, -1, ett_dsmcc_heading, NULL, "Resources");
1916 offset += dissect_dsmcc_un_session_resources(tvb, offset, pinfo, sub_sub_tree);
1917 sub_sub_tree = proto_tree_add_subtree(sub_tree, tvb, offset, -1, ett_dsmcc_heading, NULL, "User Data");
1918 offset += dissect_dsmcc_un_session_user_data(tvb, offset, pinfo, sub_sub_tree);
1919 break;
1920 case DSMCC_UN_SESS_CLN_SESS_TRN_RES:
1921 offset += dissect_dsmcc_un_session_id(tvb, offset, pinfo, sub_tree);
1922 proto_tree_add_item(sub_tree, hf_dsmcc_un_sess_response, tvb, offset, 2, ENC_BIG_ENDIAN);
1923 offset += 2;
1924 sub_sub_tree = proto_tree_add_subtree(sub_tree, tvb, offset, -1, ett_dsmcc_heading, NULL, "User Data");
1925 offset += dissect_dsmcc_un_session_user_data(tvb, offset, pinfo, sub_sub_tree);
1926 break;
1927 case DSMCC_UN_SESS_CLN_SESS_INP_REQ:
1928 proto_tree_add_item_ret_uint(sub_tree, hf_dsmcc_un_sess_session_count, tvb, offset, 2, ENC_BIG_ENDIAN, &counter);
1929 offset += 2;
1930 for (i=0; i<counter; i++)
1932 offset += dissect_dsmcc_un_session_id(tvb, offset, pinfo, sub_tree);
1934 break;
1936 /* SERVER Messages */
1937 case DSMCC_UN_SESS_SRV_SESS_SET_IND:
1938 offset += dissect_dsmcc_un_session_id(tvb, offset, pinfo, sub_tree);
1939 proto_tree_add_item(sub_tree, hf_dsmcc_un_sess_reserved, tvb, offset, 2, ENC_BIG_ENDIAN);
1940 offset += 2;
1941 /* client */
1942 sub_sub_tree = proto_tree_add_subtree(sub_tree, tvb, offset, 20, ett_dsmcc_heading, NULL, "Client ID");
1943 offset += dissect_dsmcc_un_session_nsap(tvb, offset, pinfo, sub_sub_tree);
1944 /* server */
1945 sub_sub_tree = proto_tree_add_subtree(sub_tree, tvb, offset, 20, ett_dsmcc_heading, NULL, "Server ID");
1946 offset += dissect_dsmcc_un_session_nsap(tvb, offset, pinfo, sub_sub_tree);
1947 proto_tree_add_item_ret_uint(sub_tree, hf_dsmcc_un_sess_forward_count, tvb, offset, 2, ENC_BIG_ENDIAN, &counter);
1948 offset += 2;
1949 for (i=0; i<counter; i++)
1951 sub_sub_tree = proto_tree_add_subtree(sub_tree, tvb, offset, 20, ett_dsmcc_heading, NULL, "Forward Server ID");
1952 offset += dissect_dsmcc_un_session_nsap(tvb, offset, pinfo, sub_sub_tree);
1954 sub_sub_tree = proto_tree_add_subtree(sub_tree, tvb, offset, -1, ett_dsmcc_heading, NULL, "User Data");
1955 offset += dissect_dsmcc_un_session_user_data(tvb, offset, pinfo, sub_sub_tree);
1956 break;
1957 case DSMCC_UN_SESS_SRV_SESS_SET_RES:
1958 offset += dissect_dsmcc_un_session_id(tvb, offset, pinfo, sub_tree);
1959 proto_tree_add_item(sub_tree, hf_dsmcc_un_sess_response, tvb, offset, 2, ENC_BIG_ENDIAN);
1960 offset += 2;
1961 /* server */
1962 sub_sub_tree = proto_tree_add_subtree(sub_tree, tvb, offset, 20, ett_dsmcc_heading, NULL, "Server ID");
1963 offset += dissect_dsmcc_un_session_nsap(tvb, offset, pinfo, sub_sub_tree);
1964 /* next server */
1965 sub_sub_tree = proto_tree_add_subtree(sub_tree, tvb, offset, 20, ett_dsmcc_heading, NULL, "Next Server ID");
1966 offset += dissect_dsmcc_un_session_nsap(tvb, offset, pinfo, sub_sub_tree);
1967 sub_sub_tree = proto_tree_add_subtree(sub_tree, tvb, offset, -1, ett_dsmcc_heading, NULL, "Resources");
1968 offset += dissect_dsmcc_un_session_resources(tvb, offset, pinfo, sub_sub_tree);
1969 sub_sub_tree = proto_tree_add_subtree(sub_tree, tvb, offset, -1, ett_dsmcc_heading, NULL, "User Data");
1970 offset += dissect_dsmcc_un_session_user_data(tvb, offset, pinfo, sub_sub_tree);
1971 break;
1972 case DSMCC_UN_SESS_SRV_SESS_REL_REQ:
1973 offset += dissect_dsmcc_un_session_id(tvb, offset, pinfo, sub_tree);
1974 proto_tree_add_item(sub_tree, hf_dsmcc_un_sess_reason, tvb, offset, 2, ENC_BIG_ENDIAN);
1975 offset += 2;
1976 sub_sub_tree = proto_tree_add_subtree(sub_tree, tvb, offset, -1, ett_dsmcc_heading, NULL, "User Data");
1977 offset += dissect_dsmcc_un_session_user_data(tvb, offset, pinfo, sub_sub_tree);
1978 break;
1979 case DSMCC_UN_SESS_SRV_SESS_REL_CNF:
1980 offset += dissect_dsmcc_un_session_id(tvb, offset, pinfo, sub_tree);
1981 proto_tree_add_item(sub_tree, hf_dsmcc_un_sess_response, tvb, offset, 2, ENC_BIG_ENDIAN);
1982 offset += 2;
1983 sub_sub_tree = proto_tree_add_subtree(sub_tree, tvb, offset, -1, ett_dsmcc_heading, NULL, "User Data");
1984 offset += dissect_dsmcc_un_session_user_data(tvb, offset, pinfo, sub_sub_tree);
1985 break;
1986 case DSMCC_UN_SESS_SRV_SESS_REL_IND:
1987 offset += dissect_dsmcc_un_session_id(tvb, offset, pinfo, sub_tree);
1988 proto_tree_add_item(sub_tree, hf_dsmcc_un_sess_reason, tvb, offset, 2, ENC_BIG_ENDIAN);
1989 offset += 2;
1990 sub_sub_tree = proto_tree_add_subtree(sub_tree, tvb, offset, -1, ett_dsmcc_heading, NULL, "User Data");
1991 offset += dissect_dsmcc_un_session_user_data(tvb, offset, pinfo, sub_sub_tree);
1992 break;
1993 case DSMCC_UN_SESS_SRV_SESS_REL_RES:
1994 offset += dissect_dsmcc_un_session_id(tvb, offset, pinfo, sub_tree);
1995 proto_tree_add_item(sub_tree, hf_dsmcc_un_sess_response, tvb, offset, 2, ENC_BIG_ENDIAN);
1996 offset += 2;
1997 sub_sub_tree = proto_tree_add_subtree(sub_tree, tvb, offset, -1, ett_dsmcc_heading, NULL, "User Data");
1998 offset += dissect_dsmcc_un_session_user_data(tvb, offset, pinfo, sub_sub_tree);
1999 break;
2000 case DSMCC_UN_SESS_SRV_ADD_RSRC_REQ:
2001 offset += dissect_dsmcc_un_session_id(tvb, offset, pinfo, sub_tree);
2002 sub_sub_tree = proto_tree_add_subtree(sub_tree, tvb, offset, -1, ett_dsmcc_heading, NULL, "Resources");
2003 offset += dissect_dsmcc_un_session_resources(tvb, offset, pinfo, sub_sub_tree);
2004 sub_sub_tree = proto_tree_add_subtree(sub_tree, tvb, offset, -1, ett_dsmcc_heading, NULL, "User Data");
2005 offset += dissect_dsmcc_un_session_user_data(tvb, offset, pinfo, sub_sub_tree);
2006 break;
2007 case DSMCC_UN_SESS_SRV_ADD_RSRC_CNF:
2008 offset += dissect_dsmcc_un_session_id(tvb, offset, pinfo, sub_tree);
2009 proto_tree_add_item(sub_tree, hf_dsmcc_un_sess_response, tvb, offset, 2, ENC_BIG_ENDIAN);
2010 offset += 2;
2011 sub_sub_tree = proto_tree_add_subtree(sub_tree, tvb, offset, -1, ett_dsmcc_heading, NULL, "Resources");
2012 offset += dissect_dsmcc_un_session_resources(tvb, offset, pinfo, sub_sub_tree);
2013 sub_sub_tree = proto_tree_add_subtree(sub_tree, tvb, offset, -1, ett_dsmcc_heading, NULL, "User Data");
2014 offset += dissect_dsmcc_un_session_user_data(tvb, offset, pinfo, sub_sub_tree);
2015 break;
2016 case DSMCC_UN_SESS_SRV_DEL_RSRC_REQ:
2017 offset += dissect_dsmcc_un_session_id(tvb, offset, pinfo, sub_tree);
2018 proto_tree_add_item(sub_tree, hf_dsmcc_un_sess_reason, tvb, offset, 2, ENC_BIG_ENDIAN);
2019 offset += 2;
2020 proto_tree_add_item_ret_uint(sub_tree, hf_dsmcc_un_sess_resource_count, tvb, offset, 2, ENC_BIG_ENDIAN, &counter);
2021 offset += 2;
2022 for (i=0; i<counter; i++)
2024 proto_tree_add_item(sub_tree, hf_dsmcc_un_sess_resource_num, tvb, offset, 2, ENC_NA);
2025 offset += 2;
2027 sub_sub_tree = proto_tree_add_subtree(sub_tree, tvb, offset, -1, ett_dsmcc_heading, NULL, "User Data");
2028 offset += dissect_dsmcc_un_session_user_data(tvb, offset, pinfo, sub_sub_tree);
2029 break;
2030 case DSMCC_UN_SESS_SRV_DEL_RSRC_CNF:
2031 offset += dissect_dsmcc_un_session_id(tvb, offset, pinfo, sub_tree);
2032 proto_tree_add_item(sub_tree, hf_dsmcc_un_sess_response, tvb, offset, 2, ENC_BIG_ENDIAN);
2033 offset += 2;
2034 sub_sub_tree = proto_tree_add_subtree(sub_tree, tvb, offset, -1, ett_dsmcc_heading, NULL, "User Data");
2035 offset += dissect_dsmcc_un_session_user_data(tvb, offset, pinfo, sub_sub_tree);
2036 break;
2037 case DSMCC_UN_SESS_SRV_CONT_FEED_SESS_REQ:
2038 offset += dissect_dsmcc_un_session_id(tvb, offset, pinfo, sub_tree);
2039 proto_tree_add_item(sub_tree, hf_dsmcc_un_sess_reserved, tvb, offset, 2, ENC_BIG_ENDIAN);
2040 offset += 2;
2041 sub_sub_tree = proto_tree_add_subtree(sub_tree, tvb, offset, 20, ett_dsmcc_heading, NULL, "Server ID");
2042 offset += dissect_dsmcc_un_session_nsap(tvb, offset, pinfo, sub_sub_tree);
2043 sub_sub_tree = proto_tree_add_subtree(sub_tree, tvb, offset, -1, ett_dsmcc_heading, NULL, "Resources");
2044 offset += dissect_dsmcc_un_session_resources(tvb, offset, pinfo, sub_sub_tree);
2045 break;
2046 case DSMCC_UN_SESS_SRV_CONT_FEED_SESS_CNF:
2047 offset += dissect_dsmcc_un_session_id(tvb, offset, pinfo, sub_tree);
2048 proto_tree_add_item(sub_tree, hf_dsmcc_un_sess_response, tvb, offset, 2, ENC_BIG_ENDIAN);
2049 offset += 2;
2050 sub_sub_tree = proto_tree_add_subtree(sub_tree, tvb, offset, -1, ett_dsmcc_heading, NULL, "Resources");
2051 offset += dissect_dsmcc_un_session_resources(tvb, offset, pinfo, sub_sub_tree);
2052 break;
2053 case DSMCC_UN_SESS_SRV_STATUS_REQ:
2054 proto_tree_add_item(sub_tree, hf_dsmcc_un_sess_reason, tvb, offset, 2, ENC_BIG_ENDIAN);
2055 offset += 2;
2056 sub_sub_tree = proto_tree_add_subtree(sub_tree, tvb, offset, 20, ett_dsmcc_heading, NULL, "Server ID");
2057 offset += dissect_dsmcc_un_session_nsap(tvb, offset, pinfo, sub_sub_tree);
2058 proto_tree_add_item(sub_tree, hf_dsmcc_un_sess_status_type, tvb, offset, 2, ENC_BIG_ENDIAN);
2059 offset += 2;
2060 proto_tree_add_item_ret_uint(sub_tree, hf_dsmcc_un_sess_status_count, tvb, offset, 2, ENC_BIG_ENDIAN, &counter);
2061 offset += 2;
2062 for (i=0; i<counter; i++)
2064 proto_tree_add_item(sub_tree, hf_dsmcc_un_sess_status_byte, tvb, offset, 1, ENC_NA);
2065 offset += 1;
2067 break;
2068 case DSMCC_UN_SESS_SRV_STATUS_CNF:
2069 proto_tree_add_item(sub_tree, hf_dsmcc_un_sess_response, tvb, offset, 2, ENC_BIG_ENDIAN);
2070 offset += 2;
2071 proto_tree_add_item(sub_tree, hf_dsmcc_un_sess_status_type, tvb, offset, 2, ENC_BIG_ENDIAN);
2072 offset += 2;
2073 proto_tree_add_item_ret_uint(sub_tree, hf_dsmcc_un_sess_status_count, tvb, offset, 2, ENC_BIG_ENDIAN, &counter);
2074 offset += 2;
2075 for (i=0; i<counter; i++)
2077 proto_tree_add_item(sub_tree, hf_dsmcc_un_sess_status_byte, tvb, offset, 1, ENC_NA);
2078 offset += 1;
2080 break;
2081 case DSMCC_UN_SESS_SRV_STATUS_IND:
2082 proto_tree_add_item(sub_tree, hf_dsmcc_un_sess_reason, tvb, offset, 2, ENC_BIG_ENDIAN);
2083 offset += 2;
2084 proto_tree_add_item(sub_tree, hf_dsmcc_un_sess_status_type, tvb, offset, 2, ENC_BIG_ENDIAN);
2085 offset += 2;
2086 proto_tree_add_item_ret_uint(sub_tree, hf_dsmcc_un_sess_status_count, tvb, offset, 2, ENC_BIG_ENDIAN, &counter);
2087 offset += 2;
2088 for (i=0; i<counter; i++)
2090 proto_tree_add_item(sub_tree, hf_dsmcc_un_sess_status_byte, tvb, offset, 1, ENC_NA);
2091 offset += 1;
2093 break;
2094 case DSMCC_UN_SESS_SRV_STATUS_RES:
2095 proto_tree_add_item(sub_tree, hf_dsmcc_un_sess_response, tvb, offset, 2, ENC_BIG_ENDIAN);
2096 offset += 2;
2097 proto_tree_add_item(sub_tree, hf_dsmcc_un_sess_status_type, tvb, offset, 2, ENC_BIG_ENDIAN);
2098 offset += 2;
2099 proto_tree_add_item_ret_uint(sub_tree, hf_dsmcc_un_sess_status_count, tvb, offset, 2, ENC_BIG_ENDIAN, &counter);
2100 offset += 2;
2101 for (i=0; i<counter; i++)
2103 proto_tree_add_item(sub_tree, hf_dsmcc_un_sess_status_byte, tvb, offset, 1, ENC_NA);
2104 offset += 1;
2106 break;
2107 case DSMCC_UN_SESS_SRV_RESET_REQ:
2108 sub_sub_tree = proto_tree_add_subtree(sub_tree, tvb, offset, 20, ett_dsmcc_heading, NULL, "Server ID");
2109 offset += dissect_dsmcc_un_session_nsap(tvb, offset, pinfo, sub_sub_tree);
2110 proto_tree_add_item(sub_tree, hf_dsmcc_un_sess_reason, tvb, offset, 2, ENC_BIG_ENDIAN);
2111 offset += 2;
2112 break;
2113 case DSMCC_UN_SESS_SRV_RESET_CNF:
2114 sub_sub_tree = proto_tree_add_subtree(sub_tree, tvb, offset, 20, ett_dsmcc_heading, NULL, "Server ID");
2115 offset += dissect_dsmcc_un_session_nsap(tvb, offset, pinfo, sub_sub_tree);
2116 proto_tree_add_item(sub_tree, hf_dsmcc_un_sess_response, tvb, offset, 2, ENC_BIG_ENDIAN);
2117 offset += 2;
2118 break;
2119 case DSMCC_UN_SESS_SRV_RESET_IND:
2120 sub_sub_tree = proto_tree_add_subtree(sub_tree, tvb, offset, 20, ett_dsmcc_heading, NULL, "Server ID");
2121 offset += dissect_dsmcc_un_session_nsap(tvb, offset, pinfo, sub_sub_tree);
2122 proto_tree_add_item(sub_tree, hf_dsmcc_un_sess_reason, tvb, offset, 2, ENC_BIG_ENDIAN);
2123 offset += 2;
2124 break;
2125 case DSMCC_UN_SESS_SRV_RESET_RES:
2126 sub_sub_tree = proto_tree_add_subtree(sub_tree, tvb, offset, 20, ett_dsmcc_heading, NULL, "Server ID");
2127 offset += dissect_dsmcc_un_session_nsap(tvb, offset, pinfo, sub_sub_tree);
2128 proto_tree_add_item(sub_tree, hf_dsmcc_un_sess_response, tvb, offset, 2, ENC_BIG_ENDIAN);
2129 offset += 2;
2130 break;
2131 case DSMCC_UN_SESS_SRV_SESS_PROC_IND:
2132 offset += dissect_dsmcc_un_session_id(tvb, offset, pinfo, sub_tree);
2133 proto_tree_add_item(sub_tree, hf_dsmcc_un_sess_reason, tvb, offset, 2, ENC_BIG_ENDIAN);
2134 offset += 2;
2135 break;
2136 case DSMCC_UN_SESS_SRV_CONN_IND:
2137 offset += dissect_dsmcc_un_session_id(tvb, offset, pinfo, sub_tree);
2138 sub_sub_tree = proto_tree_add_subtree(sub_tree, tvb, offset, -1, ett_dsmcc_heading, NULL, "User Data");
2139 offset += dissect_dsmcc_un_session_user_data(tvb, offset, pinfo, sub_sub_tree);
2140 break;
2141 case DSMCC_UN_SESS_SRV_SESS_TRN_REQ:
2142 offset += dissect_dsmcc_un_session_id(tvb, offset, pinfo, sub_tree);
2143 proto_tree_add_item(sub_tree, hf_dsmcc_reserved, tvb, offset, 2, ENC_NA);
2144 offset += 2;
2145 /* destination server */
2146 sub_sub_tree = proto_tree_add_subtree(sub_tree, tvb, offset, 20, ett_dsmcc_heading, NULL, "Destination Server ID");
2147 offset += dissect_dsmcc_un_session_nsap(tvb, offset, pinfo, sub_sub_tree);
2148 /* base server */
2149 sub_sub_tree = proto_tree_add_subtree(sub_tree, tvb, offset, 20, ett_dsmcc_heading, NULL, "Base Server ID");
2150 offset += dissect_dsmcc_un_session_nsap(tvb, offset, pinfo, sub_sub_tree);
2151 sub_sub_tree = proto_tree_add_subtree(sub_tree, tvb, offset, -1, ett_dsmcc_heading, NULL, "User Data");
2152 offset += dissect_dsmcc_un_session_user_data(tvb, offset, pinfo, sub_sub_tree);
2153 break;
2154 case DSMCC_UN_SESS_SRV_SESS_TRN_CNF:
2155 offset += dissect_dsmcc_un_session_id(tvb, offset, pinfo, sub_tree);
2156 proto_tree_add_item(sub_tree, hf_dsmcc_un_sess_response, tvb, offset, 2, ENC_BIG_ENDIAN);
2157 offset += 2;
2158 sub_sub_tree = proto_tree_add_subtree(sub_tree, tvb, offset, -1, ett_dsmcc_heading, NULL, "User Data");
2159 offset += dissect_dsmcc_un_session_user_data(tvb, offset, pinfo, sub_sub_tree);
2160 break;
2161 case DSMCC_UN_SESS_SRV_SESS_TRN_IND:
2162 offset += dissect_dsmcc_un_session_id(tvb, offset, pinfo, sub_tree);
2163 proto_tree_add_item(sub_tree, hf_dsmcc_reserved, tvb, offset, 2, ENC_NA);
2164 offset += 2;
2165 /* client */
2166 sub_sub_tree = proto_tree_add_subtree(sub_tree, tvb, offset, 20, ett_dsmcc_heading, NULL, "Client ID");
2167 offset += dissect_dsmcc_un_session_nsap(tvb, offset, pinfo, sub_sub_tree);
2168 /* source server */
2169 sub_sub_tree = proto_tree_add_subtree(sub_tree, tvb, offset, 20, ett_dsmcc_heading, NULL, "Source Server ID");
2170 offset += dissect_dsmcc_un_session_nsap(tvb, offset, pinfo, sub_sub_tree);
2171 /* base server */
2172 sub_sub_tree = proto_tree_add_subtree(sub_tree, tvb, offset, 20, ett_dsmcc_heading, NULL, "Base Server ID");
2173 offset += dissect_dsmcc_un_session_nsap(tvb, offset, pinfo, sub_sub_tree);
2174 sub_sub_tree = proto_tree_add_subtree(sub_tree, tvb, offset, -1, ett_dsmcc_heading, NULL, "Resources");
2175 offset += dissect_dsmcc_un_session_resources(tvb, offset, pinfo, sub_sub_tree);
2176 sub_sub_tree = proto_tree_add_subtree(sub_tree, tvb, offset, -1, ett_dsmcc_heading, NULL, "User Data");
2177 offset += dissect_dsmcc_un_session_user_data(tvb, offset, pinfo, sub_sub_tree);
2178 break;
2179 case DSMCC_UN_SESS_SRV_SESS_TRN_RES:
2180 offset += dissect_dsmcc_un_session_id(tvb, offset, pinfo, sub_tree);
2181 proto_tree_add_item(sub_tree, hf_dsmcc_un_sess_response, tvb, offset, 2, ENC_BIG_ENDIAN);
2182 offset += 2;
2183 sub_sub_tree = proto_tree_add_subtree(sub_tree, tvb, offset, -1, ett_dsmcc_heading, NULL, "Resources");
2184 offset += dissect_dsmcc_un_session_resources(tvb, offset, pinfo, sub_sub_tree);
2185 sub_sub_tree = proto_tree_add_subtree(sub_tree, tvb, offset, -1, ett_dsmcc_heading, NULL, "User Data");
2186 offset += dissect_dsmcc_un_session_user_data(tvb, offset, pinfo, sub_sub_tree);
2187 break;
2188 case DSMCC_UN_SESS_SRV_SESS_INP_REQ:
2189 proto_tree_add_item_ret_uint(sub_tree, hf_dsmcc_un_sess_session_count, tvb, offset, 2, ENC_BIG_ENDIAN, &counter);
2190 offset += 2;
2191 for (i=0; i<counter; i++)
2193 offset += dissect_dsmcc_un_session_id(tvb, offset, pinfo, sub_tree);
2195 break;
2196 default:
2197 break;
2199 proto_item_set_len(pi, offset);
2203 static void
2204 dissect_dsmcc_un(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
2205 proto_tree *top_tree)
2207 uint8_t type;
2209 /* dsmccMessageHeader.dsmccType */
2210 type = tvb_get_uint8(tvb, 1);
2212 switch (type) {
2213 case 1: /* user-to-network configuration */
2214 /* TODO: Add support */
2215 break;
2216 case 2: /* user-to-network session */
2217 dissect_dsmcc_un_session(tvb, pinfo, tree, top_tree);
2218 break;
2219 case 3: /* user-to-network download */
2220 dissect_dsmcc_un_download(tvb, pinfo, tree, top_tree);
2221 break;
2222 case 4: /* sdb channel change protocol */
2223 /* TODO: Add support */
2224 break;
2225 case 5: /* user-to-network pass-thru */
2226 /* TODO: Add support */
2227 break;
2228 default:
2229 break;
2234 static int
2235 dissect_dsmcc_ts(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree_in, void *data _U_)
2237 proto_item *pi;
2238 proto_tree *tree;
2239 unsigned crc_len;
2240 uint8_t tid;
2241 uint16_t sect_len;
2242 uint32_t crc, calculated_crc;
2243 const char *label;
2244 tvbuff_t *sub_tvb;
2245 uint16_t ssi;
2246 unsigned offset = 0;
2248 pi = proto_tree_add_item(tree_in, proto_dsmcc, tvb, 0, -1, ENC_NA);
2249 tree = proto_item_add_subtree(pi, ett_dsmcc);
2251 col_set_str(pinfo->cinfo, COL_PROTOCOL, "DSM-CC");
2253 tid = tvb_get_uint8(tvb, offset);
2254 proto_tree_add_item(tree, hf_dsmcc_table_id, tvb, offset, 1, ENC_BIG_ENDIAN);
2255 offset +=1;
2256 ssi = tvb_get_ntohs(tvb, offset);
2257 ssi &= DSMCC_SSI_MASK;
2258 proto_tree_add_item(tree, hf_dsmcc_section_syntax_indicator, tvb, offset, 2, ENC_BIG_ENDIAN);
2259 proto_tree_add_item(tree, hf_dsmcc_private_indicator, tvb, offset, 2, ENC_BIG_ENDIAN);
2260 proto_tree_add_item(tree, hf_dsmcc_reserved, tvb, offset, 2, ENC_BIG_ENDIAN);
2261 proto_tree_add_item(tree, hf_dsmcc_section_length, tvb, offset, 2, ENC_BIG_ENDIAN);
2262 sect_len = tvb_get_ntohs(tvb, offset);
2263 sect_len &= DSMCC_LENGTH_MASK;
2264 offset += 2;
2266 proto_tree_add_item(tree, hf_dsmcc_table_id_extension, tvb, offset, 2, ENC_BIG_ENDIAN);
2267 offset += 2;
2268 proto_tree_add_item(tree, hf_dsmcc_reserved2, tvb, offset, 1, ENC_BIG_ENDIAN);
2269 proto_tree_add_item(tree, hf_dsmcc_version_number, tvb, offset, 1, ENC_BIG_ENDIAN);
2270 proto_tree_add_item(tree, hf_dsmcc_current_next_indicator, tvb, offset, 1, ENC_BIG_ENDIAN);
2271 offset +=1;
2272 proto_tree_add_item(tree, hf_dsmcc_section_number, tvb, offset, 1, ENC_BIG_ENDIAN);
2273 offset +=1;
2274 proto_tree_add_item(tree, hf_dsmcc_last_section_number, tvb, offset, 1, ENC_BIG_ENDIAN);
2275 offset +=1;
2277 sub_tvb = tvb_new_subset_length(tvb, offset, sect_len-9);
2278 switch (tid) {
2279 case DSMCC_TID_LLCSNAP:
2280 /* TODO: Add support */
2281 break;
2282 case DSMCC_TID_UN_MSG:
2283 case DSMCC_TID_DD_MSG:
2284 dissect_dsmcc_un(sub_tvb, pinfo, tree, tree_in);
2285 break;
2286 case DSMCC_TID_DESC_LIST:
2287 /* TODO: Add support */
2288 break;
2289 case DSMCC_TID_PRIVATE:
2290 /* TODO: Add support */
2291 break;
2292 default:
2293 break;
2296 crc_len = 3 + sect_len - 4; /* Add the header, remove the crc */
2297 if (ssi) {
2298 crc = tvb_get_ntohl(tvb, crc_len);
2300 calculated_crc = crc;
2301 label = "Unverified";
2302 if (dsmcc_sect_check_crc) {
2303 label = "Verified";
2304 calculated_crc = crc32_mpeg2_tvb_offset(tvb, 0, crc_len);
2307 if (calculated_crc == crc) {
2308 proto_tree_add_uint_format( tree, hf_dsmcc_crc, tvb,
2309 crc_len, 4, crc, "CRC: 0x%08x [%s]", crc, label);
2310 } else {
2311 proto_item *msg_error;
2313 msg_error = proto_tree_add_uint_format( tree, hf_dsmcc_crc, tvb,
2314 crc_len, 4, crc,
2315 "CRC: 0x%08x [Failed Verification (Calculated: 0x%08x)]",
2316 crc, calculated_crc );
2317 proto_item_set_generated(msg_error);
2318 expert_add_info( pinfo, msg_error, &ei_dsmcc_crc_invalid);
2320 } else {
2321 /* TODO: actually check the checksum */
2322 proto_tree_add_checksum(tree, tvb, crc_len, hf_dsmcc_checksum,
2323 -1, NULL, pinfo, 0, ENC_BIG_ENDIAN, PROTO_CHECKSUM_NO_FLAGS);
2326 return tvb_reported_length(tvb);
2330 static int dissect_dsmcc_tcp(tvbuff_t *tvb, packet_info *pinfo,
2331 proto_tree *tree, void *data _U_)
2333 proto_item *pi;
2334 proto_tree *sub_tree;
2336 if (tvb_get_uint8(tvb, 0) != DSMCC_PROT_DISC)
2337 return 0;
2339 col_set_str(pinfo->cinfo, COL_PROTOCOL, "DSM-CC");
2340 col_clear(pinfo->cinfo, COL_INFO);
2342 pi = proto_tree_add_item(tree, proto_dsmcc, tvb, 0, -1, ENC_NA);
2343 sub_tree = proto_item_add_subtree(pi, ett_dsmcc);
2345 dissect_dsmcc_un(tvb, pinfo, sub_tree, tree);
2347 return tvb_reported_length(tvb);
2351 static int dissect_dsmcc_udp(tvbuff_t *tvb, packet_info *pinfo,
2352 proto_tree *tree, void *data _U_)
2354 proto_item *pi;
2355 proto_tree *sub_tree;
2357 if (tvb_get_uint8(tvb, 0) != DSMCC_PROT_DISC)
2358 return 0;
2360 col_set_str(pinfo->cinfo, COL_PROTOCOL, "DSM-CC");
2361 col_clear(pinfo->cinfo, COL_INFO);
2363 pi = proto_tree_add_item(tree, proto_dsmcc, tvb, 0, -1, ENC_NA);
2364 sub_tree = proto_item_add_subtree(pi, ett_dsmcc);
2366 dissect_dsmcc_un(tvb, pinfo, sub_tree, tree);
2368 return tvb_reported_length(tvb);
2372 void
2373 proto_register_dsmcc(void)
2375 /* NOTE: Please add tables numerically according to 13818-6 so it is
2376 * easier to keep track of what parameters/tables are associated with
2377 * each other.
2379 static hf_register_info hf[] = {
2381 /* table 2-1 dsmccMessageHeader - start */
2382 { &hf_dsmcc_protocol_discriminator, {
2383 "Protocol Discriminator", "mpeg_dsmcc.protocol",
2384 FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL
2385 } },
2387 { &hf_dsmcc_type, {
2388 "Type", "mpeg_dsmcc.type",
2389 FT_UINT8, BASE_HEX|BASE_RANGE_STRING,
2390 RVALS(dsmcc_header_type_vals), 0, NULL, HFILL
2391 } },
2393 { &hf_dsmcc_message_id, {
2394 "Message ID", "mpeg_dsmcc.message_id",
2395 FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL
2396 } },
2398 { &hf_dsmcc_transaction_id, {
2399 "Transaction ID", "mpeg_dsmcc.transaction_id",
2400 FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL
2401 } },
2403 { &hf_dsmcc_header_reserved, {
2404 "Reserved", "mpeg_dsmcc.header_reserved",
2405 FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL
2406 } },
2408 { &hf_dsmcc_adaptation_length, {
2409 "Adaptation Length", "mpeg_dsmcc.adaptation_length",
2410 FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL
2411 } },
2413 { &hf_dsmcc_message_length, {
2414 "Message Length", "mpeg_dsmcc.message_length",
2415 FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL
2416 } },
2417 /* table 2-1 dsmccMessageHeader - end */
2419 /* table 2-3 Transaction ID originator - start */
2420 { &hf_dsmcc_un_sess_flag_transaction_id_originator, {
2421 "Transaction ID Originator", "mpeg_dsmcc.transaction_id_originator",
2422 FT_UINT32, BASE_DEC|BASE_RANGE_STRING,
2423 RVALS(dsmcc_un_sess_transaction_id_originator_vals),
2424 DMSCC_FLAG_TRAN_ORIG, NULL, HFILL
2425 } },
2427 { &hf_dsmcc_un_sess_flag_transaction_id_number, {
2428 "Transaction Number", "mpeg_dsmcc.transaction_id_number",
2429 FT_UINT32, BASE_DEC, NULL, DMSCC_FLAG_TRAN_NUM, NULL, HFILL
2430 } },
2431 /* table 2-3 Transaction ID originator - end */
2433 /* table 2-4 dsmccAdaptationHeader - start */
2434 { &hf_dsmcc_adaptation_type, {
2435 "Adaptation Type", "mpeg_dsmcc.adaptation_header.type",
2436 FT_UINT8, BASE_HEX|BASE_RANGE_STRING,
2437 RVALS(dsmcc_adaptation_header_vals), 0, NULL, HFILL
2438 } },
2439 /* table 2-4 dsmccAdaptationHeader - end */
2441 /* table 2-6 dsmccConditionalAccess - start */
2442 { &hf_dsmcc_adaptation_ca_reserved, {
2443 "Reserved", "mpeg_dsmcc.adaptation_header.ca.reserved",
2444 FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL
2445 } },
2447 { &hf_dsmcc_adaptation_ca_system_id, {
2448 "CA System ID", "mpeg_dsmcc.adaptation_header.ca.system_id",
2449 FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL
2450 } },
2452 { &hf_dsmcc_adaptation_ca_length, {
2453 "CA Length", "mpeg_dsmcc.adaptation_header.ca.length",
2454 FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL
2455 } },
2456 /* table 2-6 dsmccConditionalAccess - end */
2458 /* table 2-7 dsmccUserId - start */
2459 { &hf_dsmcc_adaptation_user_id_reserved, {
2460 "Reserved", "mpeg_dsmcc.adaptation_header.uid.reserved",
2461 FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL
2462 } },
2463 /* table 2-7 dsmccUserId - end */
2465 /* other tables in section 4.2 - start */
2466 { &hf_dsmcc_un_sess_response, {
2467 "Response", "mpeg_dsmcc.un_sess.response",
2468 FT_UINT16, BASE_HEX|BASE_RANGE_STRING,
2469 RVALS(dsmcc_un_sess_message_response_codes_vals), 0, NULL, HFILL
2470 } },
2472 { &hf_dsmcc_un_sess_reason, {
2473 "Reason", "mpeg_dsmcc.un_sess.reason",
2474 FT_UINT16, BASE_HEX|BASE_RANGE_STRING,
2475 RVALS(dsmcc_un_sess_message_reason_codes_vals), 0, NULL, HFILL
2476 } },
2478 { &hf_dsmcc_un_sess_reserved, {
2479 "Reserved", "mpeg_dsmcc.un_sess.reserved",
2480 FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL
2481 } },
2482 /* other tables in section 4.2 - end */
2484 /* table 4-2 message discriminator - start */
2485 { &hf_dsmcc_un_sess_flag_message_discriminator, {
2486 "Message Discriminator", "mpeg_dsmcc.message_discriminator",
2487 FT_UINT16, BASE_DEC|BASE_RANGE_STRING,
2488 RVALS(dsmcc_un_sess_message_discriminator_vals),
2489 DMSCC_FLAG_MESS_DISCRIMINATOR, NULL, HFILL
2490 } },
2491 /* table 4-2 message discriminator - end */
2493 /* table 4-3 message scenario - start */
2494 { &hf_dsmcc_un_sess_flag_message_scenario, {
2495 "Message Scenario", "mpeg_dsmcc.message_scenario",
2496 FT_UINT16, BASE_DEC|BASE_RANGE_STRING,
2497 RVALS(dsmcc_un_sess_message_scenario_vals),
2498 DMSCC_FLAG_MESS_SCENARIO, NULL, HFILL
2499 } },
2500 /* table 4-3 message scenario - end */
2502 /* table 4-4 message type - start */
2503 { &hf_dsmcc_un_sess_flag_message_type, {
2504 "Message Type", "mpeg_dsmcc.message_type",
2505 FT_UINT16, BASE_DEC|BASE_RANGE_STRING,
2506 RVALS(dsmcc_un_sess_message_type_vals),
2507 DMSCC_FLAG_MESS_TYPE, NULL, HFILL
2508 } },
2509 /* table 4-4 message type - end */
2511 /* table 4-5 U-N Resources - start */
2512 { &hf_dsmcc_un_sess_rsrc_desc_count, {
2513 "Resource Descriptor Count", "mpeg_dsmcc.un_sess.rsrc_desc_count",
2514 FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL
2515 } },
2516 /* table 4-5 U-N Resources - end */
2518 /* table 4-6 U-N user data format - start */
2519 { &hf_dsmcc_un_sess_uu_data_len, {
2520 "User data length", "mpeg_dsmcc.un_sess.uu_data_len",
2521 FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL
2522 } },
2524 { &hf_dsmcc_un_sess_uu_data, {
2525 "User data", "mpeg_dsmcc.un_sess.uu_data",
2526 FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL
2527 } },
2529 { &hf_dsmcc_un_sess_priv_data_len, {
2530 "Private data length", "mpeg_dsmcc.un_sess.priv_data_len",
2531 FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL
2532 } },
2534 { &hf_dsmcc_un_sess_priv_data, {
2535 "Private data", "mpeg_dsmcc.un_sess.priv_data",
2536 FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL
2537 } },
2538 /* table 4-6 U-N user data format - end */
2540 /* 4-10 - Server Session Setup Indication message - start */
2541 { &hf_dsmcc_un_sess_forward_count, {
2542 "Forward Count", "mpeg_dsmcc.un_sess.forward_count",
2543 FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL
2544 } },
2545 /* 4-10 - Server Session Setup Indication message - start */
2547 /* 4-26 - start */
2548 { &hf_dsmcc_un_sess_resource_count, {
2549 "Resource Count", "mpeg_dsmcc.un_sess.resource_count",
2550 FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL
2551 } },
2553 { &hf_dsmcc_un_sess_resource_num, {
2554 "Resource Number", "mpeg_dsmcc.un_sess.resource_num",
2555 FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL
2556 } },
2557 /* 4-26 - end */
2559 /* table 4-35 ServerStatusRequest message, 4-36 ServerStatusConfirm message - start */
2560 { &hf_dsmcc_un_sess_status_type, {
2561 "Status Type", "mpeg_dsmcc.un_sess.status_type",
2562 FT_UINT16, BASE_DEC|BASE_RANGE_STRING,
2563 RVALS(dsmcc_un_sess_status_type_vals), 0, NULL, HFILL
2564 } },
2566 { &hf_dsmcc_un_sess_status_count, {
2567 "Status Count (Bytes)", "mpeg_dsmcc.un_sess.status_count",
2568 FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL
2569 } },
2571 { &hf_dsmcc_un_sess_status_byte, {
2572 "Status Byte", "mpeg_dsmcc.un_sess.status_byte",
2573 FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL
2574 } },
2575 /* table 4-35 ServerStatusRequest message, 4-36 ServerStatusConfirm message - end */
2577 /* table 4-56 - start */
2578 { &hf_dsmcc_un_sess_session_count, {
2579 "Session Count", "mpeg_dsmcc.un_sess.session_count",
2580 FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL
2581 } },
2582 /* table 4-56 - end */
2584 /* table 4-58 Message Fields data types - start */
2585 { &hf_dsmcc_un_sess_session_id_device_id, {
2586 "Device ID", "mpeg_dsmcc.un_sess.session_id_device_id",
2587 FT_ETHER, BASE_NONE, NULL, 0, NULL, HFILL
2588 } },
2590 { &hf_dsmcc_un_sess_session_id_session_number, {
2591 "Session Number", "mpeg_dsmcc.un_sess.session_id_session_number",
2592 FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL
2593 } },
2594 /* table 4-58 Message Fields data types - start */
2596 /* table 4-63 U-N common descriptor header - start */
2597 { &hf_dsmcc_un_sess_rsrc_request_id, {
2598 "Request ID", "mpeg_dsmcc.un_sess.rsrc_request_id",
2599 FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL
2600 } },
2602 { &hf_dsmcc_un_sess_rsrc_descriptor_type, {
2603 "Descriptor Type", "mpeg_dsmcc.un_sess.rsrc_descriptor_type",
2604 FT_UINT16, BASE_HEX|BASE_RANGE_STRING,
2605 RVALS(dsmcc_un_sess_rsrc_descriptor_type_vals), 0, NULL, HFILL
2606 } },
2608 { &hf_dsmcc_un_sess_rsrc_number, {
2609 "Resource Num", "mpeg_dsmcc.un_sess.rsrc_number",
2610 FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL
2611 } },
2613 { &hf_dsmcc_un_sess_rsrc_association_tag, {
2614 "Association Tag", "mpeg_dsmcc.un_sess.rsrc_association_tag",
2615 FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL
2616 } },
2618 { &hf_dsmcc_un_sess_rsrc_flags, {
2619 "Resource Flags", "mpeg_dsmcc.un_sess.rsrc_flags",
2620 FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL
2621 } },
2623 { &hf_dsmcc_un_sess_rsrc_status, {
2624 "Resource Status", "mpeg_dsmcc.un_sess.rsrc_status",
2625 FT_UINT8, BASE_HEX|BASE_RANGE_STRING,
2626 RVALS(dsmcc_un_sess_rsrc_status_vals), 0, NULL, HFILL
2627 } },
2629 { &hf_dsmcc_un_sess_rsrc_desc_data_fields_length, {
2630 "Data Fields Length", "mpeg_dsmcc.un_sess.rsrc_desc_data_fields_length",
2631 FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL
2632 } },
2634 { &hf_dsmcc_un_sess_rsrc_data_field_count, {
2635 "Data Field Count", "mpeg_dsmcc.un_sess.rsrc_data_field_count",
2636 FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL
2637 } },
2639 { &hf_dsmcc_un_sess_rsrc_type_owner_id, {
2640 "Type Owner ID", "mpeg_dsmcc.un_sess.rsrc_type_owner_id",
2641 FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL
2642 } },
2644 { &hf_dsmcc_un_sess_rsrc_type_owner_value, {
2645 "Type Owner Value", "mpeg_dsmcc.un_sess.rsrc_type_owner_value",
2646 FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL
2647 } },
2648 /* table 4-63 U-N common descriptor header - end */
2650 /* table 4-64 U-N resource number assignor - start */
2651 { &hf_dsmcc_un_sess_rsrc_flag_num_assignor, {
2652 "Resource Num Assignor", "mpeg_dsmcc.un_sess.rsrc_flag_num_assignor",
2653 FT_UINT16, BASE_DEC|BASE_RANGE_STRING,
2654 RVALS(dsmcc_un_sess_rsrc_number_assignor_vals),
2655 DMSCC_FLAG_RSRC_NUM_ASSIGNOR, NULL, HFILL
2656 } },
2658 { &hf_dsmcc_un_sess_rsrc_flag_num_value, {
2659 "Resource Num Value", "mpeg_dsmcc.un_sess.rsrc_flag_num_value",
2660 FT_UINT16, BASE_DEC, NULL, DMSCC_FLAG_RSRC_NUM_VALUE, NULL, HFILL
2661 } },
2662 /* table 4-64 U-N resource number assignor - end */
2664 /* table 4-65 U-N resource association tag assignor - start */
2665 { &hf_dsmcc_un_sess_rsrc_flag_association_tag_assignor, {
2666 "Association Tag Assignor", "mpeg_dsmcc.un_sess.rsrc_flag_association_tag_assignor",
2667 FT_UINT16, BASE_DEC|BASE_RANGE_STRING,
2668 RVALS(dsmcc_un_sess_rsrc_association_tag_vals),
2669 DMSCC_FLAG_RSRC_ASSOC_TAG_ASSIGNOR, NULL, HFILL
2670 } },
2672 { &hf_dsmcc_un_sess_rsrc_flag_association_tag_value, {
2673 "Association Tag Value", "mpeg_dsmcc.un_sess.rsrc_flag_association_tag_value",
2674 FT_UINT16, BASE_DEC, NULL, DMSCC_FLAG_RSRC_ASSOC_TAG_VALUE, NULL, HFILL
2675 } },
2676 /* table 4-65 U-N resource association tag assignor - end */
2678 /* table 4-66 U-N resource allocator - start */
2679 { &hf_dsmcc_un_sess_rsrc_flag_allocator, {
2680 "Resource Allocator", "mpeg_dsmcc.un_sess.rsrc_flag_allocator",
2681 FT_UINT8, BASE_DEC|BASE_RANGE_STRING,
2682 RVALS(dsmcc_un_sess_rsrc_allocator_vals),
2683 DMSCC_FLAG_RSRC_ALLOCATOR, NULL, HFILL
2684 } },
2685 /* table 4-66 U-N resource allocator - end */
2687 /* table 4-67 U-N resource attribute - start */
2688 { &hf_dsmcc_un_sess_rsrc_flag_attribute, {
2689 "Resource Attribute", "mpeg_dsmcc.un_sess.rsrc_flag_attribute",
2690 FT_UINT8, BASE_DEC|BASE_RANGE_STRING,
2691 RVALS(dsmcc_un_sess_rsrc_attribute_vals),
2692 DMSCC_FLAG_RSRC_ATTRIBUTE, NULL, HFILL
2693 } },
2694 /* table 4-67 U-N resource attribute - end */
2696 /* table 4-68 U-N resource view - start */
2697 { &hf_dsmcc_un_sess_rsrc_flag_view, {
2698 "Resource View", "mpeg_dsmcc.un_sess.rsrc_flag_view",
2699 FT_UINT8, BASE_DEC|BASE_RANGE_STRING,
2700 RVALS(dsmcc_un_sess_rsrc_view_vals),
2701 DMSCC_FLAG_RSRC_VIEW, NULL, HFILL
2702 } },
2703 /* table 4-68 U-N resource view - end */
2705 /* table 4-71 U-N dsmccResourceDescriptorValue() field format - start */
2706 { &hf_dsmcc_un_sess_rsrc_value_type, {
2707 "Value Type", "mpeg_dsmcc.un_sess.rsrc_value_type",
2708 FT_UINT16, BASE_DEC|BASE_RANGE_STRING,
2709 RVALS(dsmcc_un_sess_rsrc_value_types_vals), 0, NULL, HFILL
2710 } },
2712 { &hf_dsmcc_un_sess_rsrc_value_count, {
2713 "Value Count", "mpeg_dsmcc.un_sess.rsrc_value_count",
2714 FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL
2715 } },
2717 { &hf_dsmcc_un_sess_rsrc_value_data, {
2718 "Value Data", "mpeg_dsmcc.un_sess.rsrc_value_data",
2719 FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL
2720 } },
2722 { &hf_dsmcc_un_sess_rsrc_most_desired, {
2723 "Most Desired", "mpeg_dsmcc.un_sess.rsrc_most_desired",
2724 FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL
2725 } },
2727 { &hf_dsmcc_un_sess_rsrc_least_desired, {
2728 "Least Desired", "mpeg_dsmcc.un_sess.rsrc_least_desired",
2729 FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL
2730 } },
2731 /* table 4-71 U-N dsmccResourceDescriptorValue() field format - end */
2733 /* table 4-74 U-N Continuous Feed Session resource descriptor - start */
2734 { &hf_dsmcc_un_sess_rsrc_cfs_num_count, {
2735 "Resource Num Count", "mpeg_dsmcc.un_sess.rsrc_cfs_num_count",
2736 FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL
2737 } },
2739 { &hf_dsmcc_un_sess_rsrc_cfs_num, {
2740 "Resource Number", "mpeg_dsmcc.un_sess.rsrc_cfs_num",
2741 FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL
2742 } },
2743 /* table 4-74 U-N Continuous Feed Session resource descriptor - end */
2745 /* table 4-75 U-N ATM Connection resource descriptor - start */
2746 { &hf_dsmcc_un_sess_rsrc_atm_vpi, {
2747 "ATM VPI", "mpeg_dsmcc.un_sess.rsrc_atm_vpi",
2748 FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL
2749 } },
2751 { &hf_dsmcc_un_sess_rsrc_atm_vci, {
2752 "ATM VCI", "mpeg_dsmcc.un_sess.rsrc_atm_vci",
2753 FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL
2754 } },
2755 /* table 4-75 U-N ATM Connection resource descriptor - end */
2757 /* table 4-76 MPEG Program - start */
2758 { &hf_dsmcc_un_sess_rsrc_mpeg_ca_pid, {
2759 "MPEG CA PID", "mpeg_dsmcc.un_sess.rsrc_mpeg_ca_pid",
2760 FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL
2761 } },
2763 { &hf_dsmcc_un_sess_rsrc_mpeg_elem_stream_count, {
2764 "Elementary Stream Count", "mpeg_dsmcc.un_sess.rsrc_mpeg_elem_stream_count",
2765 FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL
2766 } },
2768 { &hf_dsmcc_un_sess_rsrc_reserved, {
2769 "Reserved", "mpeg_dsmcc.un_sess.rsrc_reserved",
2770 FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL
2771 } },
2772 /* table 4-76 MPEG Program - end */
2774 /* table 4-77 Physical Channel - start */
2775 { &hf_dsmcc_un_sess_rsrc_phys_chan_direction, {
2776 "Channel Direction", "mpeg_dsmcc.un_sess.rsrc_phys_chan_direction",
2777 FT_UINT16, BASE_HEX|BASE_RANGE_STRING,
2778 RVALS(dsmcc_un_sess_rsrc_phys_chan_direction_vals), 0, NULL, HFILL
2779 } },
2780 /* table 4-77 Physical Channel - end */
2782 /* table 4-84 IP - start */
2783 { &hf_dsmcc_un_sess_rsrc_src_ip_addr, {
2784 "Source IP Address", "mpeg_dsmcc.un_sess.rsrc_src_ip_addr",
2785 FT_IPv4, BASE_NONE, NULL, 0, NULL, HFILL
2786 } },
2788 { &hf_dsmcc_un_sess_rsrc_src_ip_port, {
2789 "Source IP Port", "mpeg_dsmcc.un_sess.rsrc_src_ip_port",
2790 FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL
2791 } },
2793 { &hf_dsmcc_un_sess_rsrc_dst_ip_addr, {
2794 "Destination IP Address", "mpeg_dsmcc.un_sess.rsrc_dst_ip_addr",
2795 FT_IPv4, BASE_NONE, NULL, 0, NULL, HFILL
2796 } },
2798 { &hf_dsmcc_un_sess_rsrc_dst_ip_port, {
2799 "Destination IP Port", "mpeg_dsmcc.un_sess.rsrc_dst_ip_port",
2800 FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL
2801 } },
2803 { &hf_dsmcc_un_sess_rsrc_ip_protocol, {
2804 "IP Protocol", "mpeg_dsmcc.un_sess.rsrc_ip_protocol",
2805 FT_UINT16, BASE_HEX|BASE_RANGE_STRING,
2806 RVALS(dsmcc_un_sess_rsrc_ip_protocol_types_vals), 0, NULL, HFILL
2807 } },
2808 /* table 4-84 IP - end */
2810 /* table 4-86 PSTN Setup - start */
2811 { &hf_dsmcc_un_sess_rsrc_pstn_calling_id, {
2812 "Calling ID", "mpeg_dsmcc.un_sess.rsrc_pstn_calling_id",
2813 FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL
2814 } },
2816 { &hf_dsmcc_un_sess_rsrc_pstn_called_id, {
2817 "Called ID", "mpeg_dsmcc.un_sess.rsrc_pstn_called_id",
2818 FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL
2819 } },
2820 /* table 4-86 PSTN Setup - end */
2822 /* table 4-89 Q.922 Connection - start */
2823 { &hf_dsmcc_un_sess_rsrc_dlci_count, {
2824 "DL CI Count", "mpeg_dsmcc.un_sess.rsrc_dlci_count",
2825 FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL
2826 } },
2828 { &hf_dsmcc_un_sess_rsrc_dlci, {
2829 "DL CI", "mpeg_dsmcc.un_sess.rsrc_dlci",
2830 FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL
2831 } },
2833 { &hf_dsmcc_un_sess_rsrc_dl_association_tag, {
2834 "Association Tag", "mpeg_dsmcc.un_sess.rsrc_dl_association_tag",
2835 FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL
2836 } },
2837 /* table 4-89 Q.922 Connection - end */
2839 /* table 4-90 Shared Resource - start */
2840 { &hf_dsmcc_un_sess_rsrc_shared_resource_num, {
2841 "Shared Resource Num", "mpeg_dsmcc.un_sess.rsrc_shared_resource_num",
2842 FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL
2843 } },
2844 /* table 4-90 Shared Resource - end */
2846 /* table 4-91 Shared Request ID - start */
2847 { &hf_dsmcc_un_sess_rsrc_shared_resource_request_id, {
2848 "Shared Request ID", "mpeg_dsmcc.un_sess.rsrc_shared_resource_request_id",
2849 FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL
2850 } },
2851 /* table 4-91 Shared Request ID - end */
2853 /* table 4-92 Headend List - start */
2854 { &hf_dsmcc_un_sess_rsrc_headend_count, {
2855 "Headend Count", "mpeg_dsmcc.un_sess.rsrc_headend_count",
2856 FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL
2857 } },
2859 { &hf_dsmcc_un_sess_rsrc_headend_code, {
2860 "Headend Code", "mpeg_dsmcc.un_sess.rsrc_headend_code",
2861 FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL
2862 } },
2863 /* table 4-92 Headend List - end */
2865 /* table 4-94 Continuous Feed - start */
2866 { &hf_dsmcc_un_sess_rsrc_sdb_id, {
2867 "SDB ID", "mpeg_dsmcc.un_sess.rsrc_sdb_id",
2868 FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL
2869 } },
2871 { &hf_dsmcc_un_sess_rsrc_sdb_program_count, {
2872 "Program Count", "mpeg_dsmcc.un_sess.rsrc_sdb_program_count",
2873 FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL
2874 } },
2876 { &hf_dsmcc_un_sess_rsrc_sdb_association_tag, {
2877 "Association Tag", "mpeg_dsmcc.un_sess.rsrc_sdb_association_tag",
2878 FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL
2879 } },
2881 { &hf_dsmcc_un_sess_rsrc_sdb_broadcast_program_id, {
2882 "Broadcast Program ID", "mpeg_dsmcc.un_sess.rsrc_sdb_broadcast_program_id",
2883 FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL
2884 } },
2885 /* table 4-94 Continuous Feed - end */
2887 /* table 4-95 SDB Associations - start */
2888 { &hf_dsmcc_un_sess_rsrc_sdb_control_association_tag, {
2889 "Control Association Tag", "mpeg_dsmcc.un_sess.rsrc_sdb_control_association_tag",
2890 FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL
2891 } },
2893 { &hf_dsmcc_un_sess_rsrc_sdb_program_association_tag, {
2894 "Program Association Tag", "mpeg_dsmcc.un_sess.rsrc_sdb_program_association_tag",
2895 FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL
2896 } },
2897 /* table 4-95 SDB Associations - end */
2899 /* table 4-96 SDB Entitlement - start */
2900 { &hf_dsmcc_un_sess_rsrc_sdb_exclude_count, {
2901 "Exclude Count", "mpeg_dsmcc.un_sess.rsrc_sdb_exclude_count",
2902 FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL
2903 } },
2905 { &hf_dsmcc_un_sess_rsrc_sdb_include_count, {
2906 "Include Count", "mpeg_dsmcc.un_sess.rsrc_sdb_include_count",
2907 FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL
2908 } },
2909 /* table 4-96 SDB Entitlement - end */
2911 /* User defined 0xf001-0xf007 - start */
2912 { &hf_dsmcc_un_sess_rsrc_trans_system, {
2913 "Transmission System", "mpeg_dsmcc.un_sess.rsrc_trans_system",
2914 FT_UINT8, BASE_HEX|BASE_RANGE_STRING,
2915 RVALS(dsmcc_un_sess_rsrc_transmission_system_vals), 0, NULL, HFILL
2916 } },
2918 { &hf_dsmcc_un_sess_rsrc_inner_coding, {
2919 "Inner Coding", "mpeg_dsmcc.un_sess.rsrc_inner_coding",
2920 FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL
2921 } },
2923 { &hf_dsmcc_un_sess_rsrc_split_bitstream, {
2924 "Split Bitstream", "mpeg_dsmcc.un_sess.rsrc_split_bitstream",
2925 FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL
2926 } },
2928 { &hf_dsmcc_un_sess_rsrc_mod_format, {
2929 "Modulation Format", "mpeg_dsmcc.un_sess.rsrc_mod_format",
2930 FT_UINT8, BASE_HEX|BASE_RANGE_STRING,
2931 RVALS(dsmcc_un_sess_rsrc_modulation_format_vals), 0, NULL, HFILL
2932 } },
2934 { &hf_dsmcc_un_sess_rsrc_symbol_rate, {
2935 "Symbol Rate", "mpeg_dsmcc.un_sess.rsrc_symbol_rate",
2936 FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL
2937 } },
2939 { &hf_dsmcc_un_sess_rsrc_interleave_depth, {
2940 "Interleave Depth", "mpeg_dsmcc.un_sess.rsrc_interleave_depth",
2941 FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL
2942 } },
2944 { &hf_dsmcc_un_sess_rsrc_modulation_mode, {
2945 "Modulation Mode", "mpeg_dsmcc.un_sess.rsrc_modulation_mode",
2946 FT_UINT8, BASE_HEX|BASE_RANGE_STRING,
2947 RVALS(dsmcc_un_sess_rsrc_mod_mode_vals), 0, NULL, HFILL
2948 } },
2950 { &hf_dsmcc_un_sess_rsrc_fec, {
2951 "Forward Error Correction", "mpeg_dsmcc.un_sess.rsrc_fec",
2952 FT_UINT8, BASE_HEX|BASE_RANGE_STRING,
2953 RVALS(dsmcc_un_sess_rsrc_fec_vals), 0, NULL, HFILL
2954 } },
2956 { &hf_dsmcc_un_sess_rsrc_headend_flag, {
2957 "Headend Flag", "mpeg_dsmcc.un_sess.rsrc_headend_flag",
2958 FT_UINT16, BASE_DEC|BASE_RANGE_STRING,
2959 RVALS(dsmcc_un_sess_rsrc_headend_flag_vals), 0, NULL, HFILL
2960 } },
2962 { &hf_dsmcc_un_sess_rsrc_headend_tsid, {
2963 "Headend TSID", "mpeg_dsmcc.un_sess.rsrc_headend_tsid",
2964 FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL
2965 } },
2967 { &hf_dsmcc_un_sess_rsrc_server_ca_copyprotect, {
2968 "Copy Protect", "mpeg_dsmcc.un_sess.rsrc_server_ca_copyprotect",
2969 FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL
2970 } },
2972 { &hf_dsmcc_un_sess_rsrc_server_ca_usercount, {
2973 "User Count", "mpeg_dsmcc.un_sess.rsrc_server_ca_usercount",
2974 FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL
2975 } },
2977 { &hf_dsmcc_un_sess_rsrc_client_ca_info_length, {
2978 "CA Info Length", "mpeg_dsmcc.un_sess.rsrc_client_ca_info_length",
2979 FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL
2980 } },
2982 { &hf_dsmcc_un_sess_rsrc_client_ca_info_data, {
2983 "CA Info Data", "mpeg_dsmcc.un_sess.rsrc_client_ca_info_data",
2984 FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL
2985 } },
2987 { &hf_dsmcc_un_sess_rsrc_service_group, {
2988 "Service Group", "mpeg_dsmcc.un_sess.rsrc_service_group",
2989 FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL
2990 } },
2991 /* User defined 0xf001-0xf007 - end */
2993 /* table 6-1 compatibilityDescriptor - start */
2994 { &hf_compat_desc_length, {
2995 "Compatibility Descriptor Length", "mpeg_dsmcc.dii.compat_desc_len",
2996 FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL
2997 } },
2999 { &hf_compat_desc_count, {
3000 "Descriptor Length", "mpeg_dsmcc.dii.compat_desc_count",
3001 FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL
3002 } },
3004 { &hf_desc_type, {
3005 "Descriptor Type", "mpeg_dsmcc.dii.compat.type",
3006 FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL
3007 } },
3009 { &hf_desc_length, {
3010 "Descriptor Length", "mpeg_dsmcc.dii.compat.length",
3011 FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL
3012 } },
3014 { &hf_desc_spec_type, {
3015 "Specifier Type", "mpeg_dsmcc.dii.compat.spec_type",
3016 FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL
3017 } },
3019 { &hf_desc_spec_data, {
3020 "Specifier Data", "mpeg_dsmcc.dii.compat.spec_data",
3021 FT_UINT24, BASE_HEX, NULL, 0, NULL, HFILL
3022 } },
3024 { &hf_desc_model, {
3025 "Model", "mpeg_dsmcc.dii.compat.model",
3026 FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL
3027 } },
3029 { &hf_desc_version, {
3030 "Version", "mpeg_dsmcc.dii.compat.version",
3031 FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL
3032 } },
3034 { &hf_desc_sub_desc_count, {
3035 "Version", "mpeg_dsmcc.dii.compat.sub_count",
3036 FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL
3037 } },
3039 { &hf_desc_sub_desc_type, {
3040 "Type", "mpeg_dsmcc.dii.compat.sub_type",
3041 FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL
3042 } },
3044 { &hf_desc_sub_desc_len, {
3045 "Length", "mpeg_dsmcc.dii.compat.sub_len",
3046 FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL
3047 } },
3048 /* table 6-1 compatibilityDescriptor - end */
3050 /* table 7-3 dsmccDownloadDataHeader - start */
3051 { &hf_dsmcc_dd_download_id, {
3052 "Download ID", "mpeg_dsmcc.download_id",
3053 FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL
3054 } },
3056 { &hf_dsmcc_dd_message_id, {
3057 "Message ID", "mpeg_dsmcc.message_id",
3058 FT_UINT16, BASE_HEX,
3059 VALS(dsmcc_dd_message_id_vals), 0, NULL, HFILL
3060 } },
3061 /* table 7-3 dsmccDownloadDataHeader - end */
3063 /* table 7-6 downloadInfoIndication - start */
3064 { &hf_dsmcc_dii_download_id, {
3065 "Download ID", "mpeg_dsmcc.dii.download_id",
3066 FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL
3067 } },
3069 { &hf_dsmcc_dii_block_size, {
3070 "Block Size", "mpeg_dsmcc.dii.block_size",
3071 FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL
3072 } },
3074 { &hf_dsmcc_dii_window_size, {
3075 "Window Size", "mpeg_dsmcc.dii.window_size",
3076 FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL
3077 } },
3079 { &hf_dsmcc_dii_ack_period, {
3080 "ACK Period", "mpeg_dsmcc.dii.ack_period",
3081 FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL
3082 } },
3084 { &hf_dsmcc_dii_t_c_download_window, {
3085 "Carousel Download Window", "mpeg_dsmcc.dii.carousel_download_window",
3086 FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL
3087 } },
3089 { &hf_dsmcc_dii_t_c_download_scenario, {
3090 "Carousel Download Scenario", "mpeg_dsmcc.dii.carousel_download_scenario",
3091 FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL
3092 } },
3094 { &hf_dsmcc_dii_number_of_modules, {
3095 "Number of Modules", "mpeg_dsmcc.dii.module_count",
3096 FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL
3097 } },
3099 { &hf_dsmcc_dii_module_id, {
3100 "Module ID", "mpeg_dsmcc.dii.module_id",
3101 FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL
3102 } },
3104 { &hf_dsmcc_dii_module_size, {
3105 "Module Size", "mpeg_dsmcc.dii.module_size",
3106 FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL
3107 } },
3109 { &hf_dsmcc_dii_module_version, {
3110 "Module Version", "mpeg_dsmcc.dii.module_version",
3111 FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL
3112 } },
3114 { &hf_dsmcc_dii_module_info_length, {
3115 "Module Info Length", "mpeg_dsmcc.dii.module_info_length",
3116 FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL
3117 } },
3119 { &hf_dsmcc_dii_private_data_length, {
3120 "Private Data Length", "mpeg_dsmcc.dii.private_data_length",
3121 FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL
3122 } },
3123 /* table 7-6 downloadInfoIndication - end */
3125 /* table 7-7 dsmccDownloadDataBlock - start */
3126 { &hf_dsmcc_ddb_module_id, {
3127 "Module ID", "mpeg_dsmcc.ddb.module_id",
3128 FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL
3129 } },
3131 { &hf_dsmcc_ddb_version, {
3132 "Version", "mpeg_dsmcc.ddb.version",
3133 FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL
3134 } },
3136 { &hf_dsmcc_ddb_reserved, {
3137 "Reserved", "mpeg_dsmcc.ddb.reserved",
3138 FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL
3139 } },
3141 { &hf_dsmcc_ddb_block_number, {
3142 "Block Number", "mpeg_dsmcc.ddb.block_num",
3143 FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL
3144 } },
3145 /* table 7-7 dsmccDownloadDataBlock - end */
3147 /* table 9-2 - start */
3148 { &hf_dsmcc_table_id, {
3149 "Table ID", "mpeg_sect.table_id",
3150 FT_UINT8, BASE_HEX, VALS(dsmcc_payload_name_vals), 0, NULL, HFILL
3151 } },
3153 { &hf_dsmcc_section_syntax_indicator, {
3154 "Session Syntax Indicator", "mpeg_sect.ssi",
3155 FT_UINT16, BASE_DEC, NULL, DSMCC_SSI_MASK, NULL, HFILL
3156 } },
3158 { &hf_dsmcc_private_indicator, {
3159 "Private Indicator", "mpeg_dsmcc.private_indicator",
3160 FT_UINT16, BASE_DEC, NULL, DSMCC_PRIVATE_MASK, NULL, HFILL
3161 } },
3163 { &hf_dsmcc_reserved, {
3164 "Reserved", "mpeg_sect.reserved",
3165 FT_UINT16, BASE_HEX, NULL, DSMCC_RESERVED_MASK, NULL, HFILL
3166 } },
3168 { &hf_dsmcc_section_length, {
3169 "Length", "mpeg_sect.section_length",
3170 FT_UINT16, BASE_DEC, NULL, DSMCC_LENGTH_MASK, NULL, HFILL
3171 } },
3173 { &hf_dsmcc_table_id_extension, {
3174 "Table ID Extension", "mpeg_dsmcc.table_id_extension",
3175 FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL
3176 } },
3178 { &hf_dsmcc_reserved2, {
3179 "Reserved", "mpeg_dsmcc.reserved2",
3180 FT_UINT8, BASE_HEX, NULL, DSMCC_RESERVED2_MASK, NULL, HFILL
3181 } },
3183 { &hf_dsmcc_version_number, {
3184 "Version Number", "mpeg_dsmcc.version_number",
3185 FT_UINT8, BASE_DEC, NULL, DSMCC_VERSION_NUMBER_MASK, NULL, HFILL
3186 } },
3188 { &hf_dsmcc_current_next_indicator, {
3189 "Current Next Indicator", "mpeg_dsmcc.current_next_indicator",
3190 FT_UINT8, BASE_DEC, NULL, DSMCC_CURRENT_NEXT_INDICATOR_MASK, NULL, HFILL
3191 } },
3193 { &hf_dsmcc_section_number, {
3194 "Section Number", "mpeg_dsmcc.section_number",
3195 FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL
3196 } },
3198 { &hf_dsmcc_last_section_number, {
3199 "Last Section Number", "mpeg_dsmcc.last_section_number",
3200 FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL
3201 } },
3203 { &hf_dsmcc_crc, {
3204 "CRC 32", "mpeg_sect.crc",
3205 FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL
3206 } },
3208 { &hf_dsmcc_checksum, {
3209 "Checksum", "mpeg_dsmcc.checksum",
3210 FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL
3211 } },
3212 /* table 9-2 - end */
3214 /* table J.3 NSAP - start */
3215 { &hf_dsmcc_un_sess_nsap_afi, {
3216 "Authority and Format Identifier (AFI)", "mpeg_dsmcc.un_sess.dsmcc_nsap_afi",
3217 FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL
3218 } },
3220 { &hf_dsmcc_un_sess_nsap_idi, {
3221 "Initial Domain Identifier (IDI)", "mpeg_dsmcc.un_sess.dsmcc_nsap_idi",
3222 FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL
3223 } },
3225 { &hf_dsmcc_un_sess_nsap_ho_dsp, {
3226 "High Order DSP (HO-DSP)", "mpeg_dsmcc.un_sess.dsmcc_nsap_ho_dsp",
3227 FT_IPv4, BASE_NONE, NULL, 0, NULL, HFILL
3228 } },
3230 { &hf_dsmcc_un_sess_nsap_esi, {
3231 "End System Identifier (ESI)", "mpeg_dsmcc.un_sess.dsmcc_nsap_esi",
3232 FT_ETHER, BASE_NONE, NULL, 0, NULL, HFILL
3233 } },
3235 { &hf_dsmcc_un_sess_nsap_sel, {
3236 "Selector (SEL)", "mpeg_dsmcc.un_sess.dsmcc_nsap_sel",
3237 FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL
3238 } },
3239 /* table J.3 NSAP - end */
3241 { &hf_etv_module_abs_path, {
3242 "Module Absolute Path", "etv.dsmcc.dii.module_abs_path",
3243 FT_UINT_STRING, BASE_NONE, NULL, 0, NULL, HFILL
3244 } },
3246 { &hf_etv_dii_authority, {
3247 "Authority", "etv.dsmcc.dii.authority",
3248 FT_UINT_STRING, BASE_NONE, NULL, 0, NULL, HFILL
3250 /* table J.3 NSAP - end */
3253 static int *ett[] = {
3254 &ett_dsmcc,
3255 &ett_dsmcc_payload,
3256 &ett_dsmcc_adaptation_header,
3257 &ett_dsmcc_header,
3258 &ett_dsmcc_message_id,
3259 &ett_dsmcc_transaction_id,
3260 &ett_dsmcc_heading,
3261 &ett_dsmcc_rsrc_number,
3262 &ett_dsmcc_rsrc_association_tag,
3263 &ett_dsmcc_rsrc_flags,
3264 &ett_dsmcc_compat,
3265 &ett_dsmcc_compat_sub_desc,
3266 &ett_dsmcc_dii_module
3268 static ei_register_info ei[] = {
3269 { &ei_dsmcc_invalid_value, { "mpeg_dsmcc.invalid_value", PI_PROTOCOL, PI_WARN,
3270 "Invalid value", EXPFILL }},
3271 { &ei_dsmcc_crc_invalid, { "mpeg_sect.crc.invalid", PI_CHECKSUM, PI_WARN,
3272 "Invalid CRC", EXPFILL }},
3275 module_t *dsmcc_module;
3276 expert_module_t* expert_dsmcc;
3278 proto_dsmcc = proto_register_protocol("MPEG DSM-CC", "MPEG DSM-CC", "mpeg_dsmcc");
3280 proto_register_field_array(proto_dsmcc, hf, array_length(hf));
3281 proto_register_subtree_array(ett, array_length(ett));
3282 expert_dsmcc = expert_register_protocol(proto_dsmcc);
3283 expert_register_field_array(expert_dsmcc, ei, array_length(ei));
3284 dsmcc_ts_handle = register_dissector("mp2t-dsmcc", dissect_dsmcc_ts, proto_dsmcc);
3285 dsmcc_tcp_handle = register_dissector("mp2t-dsmcc-tcp", dissect_dsmcc_tcp, proto_dsmcc);
3286 dsmcc_udp_handle = register_dissector("mp2t-dsmcc-udp", dissect_dsmcc_udp, proto_dsmcc);
3288 dsmcc_module = prefs_register_protocol(proto_dsmcc, NULL);
3290 prefs_register_bool_preference(dsmcc_module, "verify_crc",
3291 "Verify the section CRC or checksum",
3292 "Whether the section dissector should verify the CRC or checksum",
3293 &dsmcc_sect_check_crc);
3297 void
3298 proto_reg_handoff_dsmcc(void)
3300 dissector_add_uint("mpeg_sect.tid", DSMCC_TID_LLCSNAP, dsmcc_ts_handle);
3301 dissector_add_uint("mpeg_sect.tid", DSMCC_TID_UN_MSG, dsmcc_ts_handle);
3302 dissector_add_uint("mpeg_sect.tid", DSMCC_TID_DD_MSG, dsmcc_ts_handle);
3303 dissector_add_uint("mpeg_sect.tid", DSMCC_TID_DESC_LIST, dsmcc_ts_handle);
3304 /* TID 0x3E is used for both DSMCC_TID_PRIVATE and DVB_DATA_MPE_TID.
3305 * MPE (ETSI EN 301 192) is conformant to the DSSMCC section format
3306 * for private data, and is by far the most common implementation,
3307 * so default register it to the table entry. If someone wants this
3308 * generic DSM-CC dissector to handle it, they can use Decode As.
3310 * dissector_add_uint("mpeg_sect.tid", DSMCC_TID_PRIVATE, dsmcc_ts_handle);
3313 dissector_add_uint_with_preference("tcp.port", DSMCC_TCP_PORT, dsmcc_tcp_handle);
3314 dissector_add_uint_with_preference("udp.port", DSMCC_UDP_PORT, dsmcc_udp_handle);
3318 * Editor modelines - https://www.wireshark.org/tools/modelines.html
3320 * Local variables:
3321 * c-basic-offset: 4
3322 * tab-width: 8
3323 * indent-tabs-mode: nil
3324 * End:
3326 * vi: set shiftwidth=4 tabstop=8 expandtab:
3327 * :indentSize=4:tabSize=8:noTabs=true: