Coverage Report

Created: 2026-05-14 06:28

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/wireshark/epan/dissectors/packet-mpeg-dsmcc.c
Line
Count
Source
1
/* packet-mpeg-dsmcc.c
2
 *
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>
6
 *
7
 * Wireshark - Network traffic analyzer
8
 * By Gerald Combs <gerald@wireshark.org>
9
 * Copyright 1998 Gerald Combs
10
 *
11
 * SPDX-License-Identifier: GPL-2.0-or-later
12
 */
13
14
#include "config.h"
15
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"
21
22
void proto_register_dsmcc(void);
23
void proto_reg_handoff_dsmcc(void);
24
25
static dissector_handle_t dsmcc_ts_handle, dsmcc_tcp_handle, dsmcc_udp_handle;
26
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.
29
 *
30
 * 13818-6 Table status:
31
 *
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-*
43
 *
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
51
 *
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
60
 *
61
 */
62
63
64
static int proto_dsmcc;
65
static bool dsmcc_sect_check_crc;
66
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.
69
 */
70
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 */
80
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 */
85
86
/* table 2-4 dsmccAdaptationHeader - start */
87
static int hf_dsmcc_adaptation_type;
88
/* table 2-4 dsmccAdaptationHeader - end */
89
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 */
95
96
/* table 2-7 dsmccUserId - start */
97
static int hf_dsmcc_adaptation_user_id_reserved;
98
/* table 2-7 dsmccUserId - end */
99
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 */
106
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 */
112
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 */
119
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 */
123
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 */
127
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 */
132
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 */
138
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 */
142
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 */
147
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 */
160
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 */
165
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 */
170
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 */
174
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 */
178
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 */
182
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 */
190
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  */
195
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  */
200
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 */
205
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 */
209
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 */
217
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 */
222
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 */
228
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 */
232
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 */
236
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 */
241
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 */
248
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 */
253
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 */
258
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 */
281
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 */
295
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 */
300
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 */
315
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 */
322
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 */
338
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 */
346
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.
350
 */
351
static int hf_etv_module_abs_path;
352
static int hf_etv_dii_authority;
353
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;
367
368
static expert_field ei_dsmcc_invalid_value;
369
static expert_field ei_dsmcc_crc_invalid;
370
371
15
#define DSMCC_TCP_PORT          13819
372
15
#define DSMCC_UDP_PORT          13819
373
374
/* DSM-CC protocol discriminator, (table 2-1) */
375
4
#define DSMCC_PROT_DISC         0x11
376
377
22
#define DSMCC_SSI_MASK          0x8000
378
15
#define DSMCC_PRIVATE_MASK      0x4000
379
15
#define DSMCC_RESERVED_MASK              0x3000
380
22
#define DSMCC_LENGTH_MASK                0x0fff
381
15
#define DSMCC_RESERVED2_MASK               0xc0
382
15
#define DSMCC_VERSION_NUMBER_MASK          0x3e
383
15
#define DSMCC_CURRENT_NEXT_INDICATOR_MASK  0x01
384
385
/* DSM-CC U-N Session Flags */
386
15
#define DMSCC_FLAG_MESS_DISCRIMINATOR        0xc000
387
15
#define DMSCC_FLAG_MESS_SCENARIO             0x3ff0
388
15
#define DMSCC_FLAG_MESS_TYPE                 0x000f
389
15
#define DMSCC_FLAG_TRAN_ORIG             0xc0000000
390
15
#define DMSCC_FLAG_TRAN_NUM              0x3fffffff
391
15
#define DMSCC_FLAG_RSRC_NUM_ASSIGNOR         0xc000
392
15
#define DMSCC_FLAG_RSRC_NUM_VALUE            0x3fff
393
15
#define DMSCC_FLAG_RSRC_ASSOC_TAG_ASSIGNOR   0xc000
394
15
#define DMSCC_FLAG_RSRC_ASSOC_TAG_VALUE      0x3fff
395
15
#define DMSCC_FLAG_RSRC_VIEW                   0xc0
396
15
#define DMSCC_FLAG_RSRC_ATTRIBUTE              0x3c
397
15
#define DMSCC_FLAG_RSRC_ALLOCATOR              0x03
398
399
/* DSM-CC protocol U-N messages, (table 4-5) */
400
/* 4-5 U-N Session Client Messages */
401
0
#define DSMCC_UN_SESS_CLN_SESS_SET_REQ       0x4010
402
0
#define DSMCC_UN_SESS_CLN_SESS_SET_CNF       0x4011
403
0
#define DSMCC_UN_SESS_CLN_SESS_REL_REQ       0x4020
404
0
#define DSMCC_UN_SESS_CLN_SESS_REL_CNF       0x4021
405
0
#define DSMCC_UN_SESS_CLN_SESS_REL_IND       0x4022
406
0
#define DSMCC_UN_SESS_CLN_SESS_REL_RES       0x4023
407
0
#define DSMCC_UN_SESS_CLN_ADD_RSRC_IND       0x4032
408
0
#define DSMCC_UN_SESS_CLN_ADD_RSRC_RES       0x4033
409
0
#define DSMCC_UN_SESS_CLN_DEL_RSRC_IND       0x4042
410
0
#define DSMCC_UN_SESS_CLN_DEL_RSRC_RES       0x4043
411
0
#define DSMCC_UN_SESS_CLN_STATUS_REQ         0x4060
412
0
#define DSMCC_UN_SESS_CLN_STATUS_CNF         0x4061
413
0
#define DSMCC_UN_SESS_CLN_STATUS_IND         0x4062
414
0
#define DSMCC_UN_SESS_CLN_STATUS_RES         0x4063
415
0
#define DSMCC_UN_SESS_CLN_RESET_REQ          0x4070
416
0
#define DSMCC_UN_SESS_CLN_RESET_CNF          0x4071
417
0
#define DSMCC_UN_SESS_CLN_RESET_IND          0x4072
418
0
#define DSMCC_UN_SESS_CLN_RESET_RES          0x4073
419
0
#define DSMCC_UN_SESS_CLN_SESS_PROC_IND      0x4082
420
0
#define DSMCC_UN_SESS_CLN_CONN_REQ           0x4090
421
0
#define DSMCC_UN_SESS_CLN_SESS_TRN_IND       0x40a2
422
0
#define DSMCC_UN_SESS_CLN_SESS_TRN_RES       0x40a3
423
0
#define DSMCC_UN_SESS_CLN_SESS_INP_REQ       0x40b0
424
/* 4-5 U-N Session Server Messages */
425
0
#define DSMCC_UN_SESS_SRV_SESS_SET_IND       0x8012
426
0
#define DSMCC_UN_SESS_SRV_SESS_SET_RES       0x8013
427
0
#define DSMCC_UN_SESS_SRV_SESS_REL_REQ       0x8020
428
0
#define DSMCC_UN_SESS_SRV_SESS_REL_CNF       0x8021
429
0
#define DSMCC_UN_SESS_SRV_SESS_REL_IND       0x8022
430
0
#define DSMCC_UN_SESS_SRV_SESS_REL_RES       0x8023
431
0
#define DSMCC_UN_SESS_SRV_ADD_RSRC_REQ       0x8030
432
0
#define DSMCC_UN_SESS_SRV_ADD_RSRC_CNF       0x8031
433
0
#define DSMCC_UN_SESS_SRV_DEL_RSRC_REQ       0x8040
434
0
#define DSMCC_UN_SESS_SRV_DEL_RSRC_CNF       0x8041
435
0
#define DSMCC_UN_SESS_SRV_CONT_FEED_SESS_REQ 0x8050
436
0
#define DSMCC_UN_SESS_SRV_CONT_FEED_SESS_CNF 0x8051
437
0
#define DSMCC_UN_SESS_SRV_STATUS_REQ         0x8060
438
0
#define DSMCC_UN_SESS_SRV_STATUS_CNF         0x8061
439
0
#define DSMCC_UN_SESS_SRV_STATUS_IND         0x8062
440
0
#define DSMCC_UN_SESS_SRV_STATUS_RES         0x8063
441
0
#define DSMCC_UN_SESS_SRV_RESET_REQ          0x8070
442
0
#define DSMCC_UN_SESS_SRV_RESET_CNF          0x8071
443
0
#define DSMCC_UN_SESS_SRV_RESET_IND          0x8072
444
0
#define DSMCC_UN_SESS_SRV_RESET_RES          0x8073
445
0
#define DSMCC_UN_SESS_SRV_SESS_PROC_IND      0x8082
446
0
#define DSMCC_UN_SESS_SRV_CONN_IND           0x8092
447
0
#define DSMCC_UN_SESS_SRV_SESS_TRN_REQ       0x80a0
448
0
#define DSMCC_UN_SESS_SRV_SESS_TRN_CNF       0x80a1
449
0
#define DSMCC_UN_SESS_SRV_SESS_TRN_IND       0x80a2
450
0
#define DSMCC_UN_SESS_SRV_SESS_TRN_RES       0x80a3
451
0
#define DSMCC_UN_SESS_SRV_SESS_INP_REQ       0x80b0
452
/* 4-73 U-N Session Resource Descriptors */
453
0
#define RSRC_CONT_FEED_SESS     0x0001
454
0
#define RSRC_ATM_CONN           0x0002
455
0
#define RSRC_MPEG_PROG          0x0003
456
0
#define RSRC_PHYS_CHAN          0x0004
457
0
#define RSRC_TS_US_BW           0x0005
458
0
#define RSRC_TS_DS_BW           0x0006
459
0
#define RSRC_ATM_SVC_CONN       0x0007
460
0
#define RSRC_CONN_NTFY          0x0008
461
0
#define RSRC_IP                 0x0009
462
0
#define RSRC_CLN_TDMA_ASSIGN    0x000a
463
0
#define RSRC_PSTN_SETUP         0x000b
464
0
#define RSRC_NISDN_SETUP        0x000c
465
0
#define RSRC_NISDN_CONN         0x000d
466
0
#define RSRC_Q922_CONN          0x000e
467
0
#define RSRC_HEADEND_LIST       0x000f
468
0
#define RSRC_ATM_VC_CONN        0x0010
469
0
#define RSRC_SDB_CONT_FEED      0x0011
470
0
#define RSRC_SDB_ASSOC          0x0012
471
0
#define RSRC_SDB_ENT            0x0013
472
0
#define RSRC_SHARED_RSRC        0x7ffe
473
0
#define RSRC_SHARED_REQ_ID      0x7fff
474
0
#define RSRC_TYPE_OWNER         0xffff
475
/* U-N Session User Defined Resource Descriptors */
476
0
#define RSRC_MODULATION_MODE    0xf001
477
0
#define RSRC_HEADEND_ID         0xf003
478
0
#define RSRC_SERVER_CA          0xf004
479
0
#define RSRC_CLIENT_CA          0xf005
480
0
#define RSRC_ETHERNET           0xf006
481
0
#define RSRC_SERVICE_GROUP      0xf007
482
483
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 }
495
};
496
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 }
505
};
506
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 }
515
};
516
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 }
525
};
526
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 }
545
};
546
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 }
556
};
557
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 }
611
};
612
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 }
646
};
647
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 }
701
};
702
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 }
714
};
715
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 }
724
};
725
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 }
734
};
735
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 }
744
};
745
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 }
755
};
756
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 }
765
};
766
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 }
781
};
782
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 }
792
};
793
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 }
830
};
831
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 }
838
};
839
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 }
848
};
849
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 }
863
};
864
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 }
871
};
872
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 }
879
};
880
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 }
886
};
887
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 }
896
};
897
/* user defined 0xf001-0xf007 - end */
898
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 }
908
};
909
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 }
918
};
919
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
926
};
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
931
};
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
936
};
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
941
};
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
947
};
948
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)
953
0
{
954
0
    unsigned offset_start;
955
956
0
    offset_start = offset;
957
0
    proto_tree_add_item(sub_tree, hf_dsmcc_un_sess_nsap_afi, tvb, offset, 1, ENC_NA);
958
0
    offset += 1;
959
0
    proto_tree_add_item(sub_tree, hf_dsmcc_un_sess_nsap_idi, tvb, offset, 8, ENC_NA);
960
0
    offset += 8;
961
0
    proto_tree_add_item(sub_tree, hf_dsmcc_un_sess_nsap_ho_dsp, tvb, offset, 4, ENC_BIG_ENDIAN);
962
0
    offset += 4;
963
0
    proto_tree_add_item(sub_tree, hf_dsmcc_un_sess_nsap_esi, tvb, offset, 6, ENC_NA);
964
0
    offset += 6;
965
0
    proto_tree_add_item(sub_tree, hf_dsmcc_un_sess_nsap_sel, tvb, offset, 1, ENC_NA);
966
0
    offset += 1;
967
968
0
    return offset-offset_start;
969
0
}
970
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)
975
0
{
976
0
    proto_tree *sub_sub_tree;
977
0
    unsigned    offset_start;
978
979
0
    offset_start = offset;
980
981
0
    sub_sub_tree = proto_tree_add_subtree(sub_tree, tvb, offset, 10, ett_dsmcc_heading, NULL, "Session ID");
982
0
    proto_item_set_text(sub_sub_tree, "Session ID: 0x%s", tvb_bytes_to_str(pinfo->pool, tvb, offset, 10));
983
0
    proto_tree_add_item(sub_sub_tree, hf_dsmcc_un_sess_session_id_device_id, tvb, offset, 6, ENC_NA);
984
0
    offset += 6;
985
0
    proto_tree_add_item(sub_sub_tree, hf_dsmcc_un_sess_session_id_session_number, tvb, offset, 4, ENC_BIG_ENDIAN);
986
0
    offset += 4;
987
988
0
    return offset-offset_start;
989
0
}
990
991
992
/* Table 2-4 Adaptation Header Format */
993
static void
994
dissect_dsmcc_adaptation_header(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
995
1
{
996
1
    tvbuff_t   *sub_tvb;
997
1
    unsigned    offset = 0;
998
1
    proto_item *pi;
999
1
    proto_tree *sub_tree;
1000
1
    proto_tree *sub_sub_tree;
1001
1
    uint8_t     type, tmp;
1002
1
    uint16_t    ca_len;
1003
1004
1
    type = tvb_get_uint8(tvb, offset);
1005
1006
1
    if (1 == type) {
1007
0
        sub_tree = proto_tree_add_subtree(tree, tvb, offset, -1, ett_dsmcc_adaptation_header, NULL, "Adaptation Header");
1008
0
        proto_tree_add_item(sub_tree, hf_dsmcc_adaptation_type, tvb, offset, 1, ENC_BIG_ENDIAN);
1009
0
        offset += 1;
1010
0
        tmp = tvb_get_uint8(tvb, offset);
1011
0
        pi = proto_tree_add_item(sub_tree, hf_dsmcc_adaptation_ca_reserved, tvb, offset, 1, ENC_BIG_ENDIAN);
1012
0
        if (0xff != tmp) {
1013
0
            expert_add_info_format(pinfo, pi, &ei_dsmcc_invalid_value, "Invalid value - should be 0xff");
1014
0
        }
1015
0
        offset += 1;
1016
0
        proto_tree_add_item(sub_tree, hf_dsmcc_adaptation_ca_system_id, tvb, offset, 2, ENC_BIG_ENDIAN);
1017
0
        offset += 2;
1018
0
        ca_len = tvb_get_ntohs(tvb, offset);
1019
0
        proto_tree_add_item(sub_tree, hf_dsmcc_adaptation_ca_length, tvb, offset, 2, ENC_BIG_ENDIAN);
1020
0
        offset += 2;
1021
0
        sub_tvb = tvb_new_subset_length(tvb, offset, ca_len);
1022
0
        call_data_dissector(sub_tvb, pinfo, tree);
1023
1
    } else if (2 == type) {
1024
0
        sub_tree = proto_tree_add_subtree(tree, tvb, offset, -1, ett_dsmcc_adaptation_header, NULL, "Adaptation Header");
1025
0
        proto_tree_add_item(sub_tree, hf_dsmcc_adaptation_type, tvb, offset, 1, ENC_BIG_ENDIAN);
1026
0
        offset += 1;
1027
0
        tmp = tvb_get_uint8(tvb, offset);
1028
0
        pi = proto_tree_add_item(sub_tree, hf_dsmcc_adaptation_user_id_reserved, tvb, offset, 1, ENC_BIG_ENDIAN);
1029
0
        if (0xff != tmp) {
1030
0
            expert_add_info_format(pinfo, pi, &ei_dsmcc_invalid_value, "Invalid value - should be 0xff");
1031
0
        }
1032
0
        offset += 1;
1033
0
        sub_sub_tree = proto_tree_add_subtree(sub_tree, tvb, offset, 20, ett_dsmcc_heading, NULL, "User ID");
1034
0
        dissect_dsmcc_un_session_nsap(tvb, offset, pinfo, sub_sub_tree);
1035
1
    } else {
1036
1
        sub_tree = proto_tree_add_subtree(tree, tvb, offset, -1, ett_dsmcc_adaptation_header, NULL, "Unknown Adaptation Header");
1037
1
        proto_tree_add_item(sub_tree, hf_dsmcc_adaptation_type, tvb, offset, 1, ENC_BIG_ENDIAN);
1038
1
    }
1039
1
}
1040
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)
1044
1
{
1045
1
    tvbuff_t   *sub_tvb;
1046
1
    proto_item *pi;
1047
1
    proto_tree *sub_tree;
1048
1
    uint8_t     prot_disc, adaptation_len;
1049
1
    unsigned    reserved, offset_start;
1050
1
    int         msg_id, tx_id;
1051
1052
1
    offset_start = offset;
1053
1054
1
    prot_disc = tvb_get_uint8(tvb, offset);
1055
1
    reserved = tvb_get_uint8(tvb, 8+offset);
1056
1
    adaptation_len = tvb_get_uint8(tvb, 9+offset);
1057
1058
1
    sub_tree = proto_tree_add_subtree(tree, tvb, offset, 12+adaptation_len, ett_dsmcc_header, NULL, "DSM-CC Header");
1059
1
    pi = proto_tree_add_item(sub_tree, hf_dsmcc_protocol_discriminator, tvb, offset, 1, ENC_BIG_ENDIAN);
1060
1
    if (DSMCC_PROT_DISC != prot_disc) {
1061
1
        expert_add_info_format(pinfo, pi, &ei_dsmcc_invalid_value, "Invalid value - should be 0x11");
1062
1
    }
1063
1
    offset += 1;
1064
1
    proto_tree_add_item(sub_tree, hf_dsmcc_type, tvb, offset, 1, ENC_BIG_ENDIAN);
1065
1
    offset += 1;
1066
1
    if (true == download_header) {
1067
0
        msg_id = hf_dsmcc_dd_message_id;
1068
0
        tx_id = hf_dsmcc_dd_download_id;
1069
0
        proto_tree_add_item(sub_tree, msg_id, tvb, offset, 2, ENC_BIG_ENDIAN);
1070
0
        offset += 2;
1071
0
        proto_tree_add_item(sub_tree, tx_id, tvb, offset, 4, ENC_BIG_ENDIAN);
1072
0
        offset += 4;
1073
1
    } else {
1074
1
        msg_id = hf_dsmcc_message_id;
1075
1
        tx_id = hf_dsmcc_transaction_id;
1076
1
        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
1
        offset += 2;
1078
1
        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
1
        offset += 4;
1080
1
    }
1081
1082
1
    pi = proto_tree_add_item(sub_tree, hf_dsmcc_header_reserved, tvb, offset, 1, ENC_BIG_ENDIAN);
1083
1
    if (0xff != reserved) {
1084
1
        expert_add_info_format(pinfo, pi, &ei_dsmcc_invalid_value, "Invalid value - should be 0xff");
1085
1
    }
1086
1
    offset += 1;
1087
1088
1
    proto_tree_add_item(sub_tree, hf_dsmcc_adaptation_length, tvb, offset, 1, ENC_BIG_ENDIAN);
1089
1
    offset += 1;
1090
1
    proto_tree_add_item(sub_tree, hf_dsmcc_message_length, tvb, offset, 2, ENC_BIG_ENDIAN);
1091
1
    offset += 2;
1092
1093
1
    if (0 < adaptation_len) {
1094
1
        sub_tvb = tvb_new_subset_length(tvb, offset, adaptation_len);
1095
1
        dissect_dsmcc_adaptation_header(sub_tvb, pinfo, sub_tree);
1096
1
        offset += adaptation_len;
1097
1
    }
1098
1099
1
    return offset-offset_start;
1100
1
}
1101
1102
static unsigned
1103
dissect_dsmcc_dii_compat_desc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
1104
        unsigned offset)
1105
0
{
1106
0
    int         i, j;
1107
0
    uint8_t     sub_count, sub_len;
1108
0
    uint16_t    len, count;
1109
0
    proto_tree *compat_tree;
1110
0
    proto_tree *desc_sub_tree;
1111
1112
0
    proto_tree_add_item_ret_uint16(tree, hf_compat_desc_length, tvb, offset, 2, ENC_BIG_ENDIAN, &len);
1113
0
    offset += 2;
1114
1115
0
    if (0 < len) {
1116
0
        proto_tree_add_item_ret_uint16(tree, hf_compat_desc_count, tvb, offset, 2, ENC_BIG_ENDIAN, &count);
1117
0
        offset += 2;
1118
1119
0
        for (i = 0; i < count; i++) {
1120
0
            compat_tree = proto_tree_add_subtree(tree, tvb, offset, len, ett_dsmcc_compat, NULL, "Compatibility Descriptor");
1121
0
            proto_tree_add_item(compat_tree, hf_desc_type, tvb, offset, 1, ENC_BIG_ENDIAN);
1122
0
            offset += 1;
1123
0
            proto_tree_add_item(compat_tree, hf_desc_length, tvb, offset, 1, ENC_BIG_ENDIAN);
1124
0
            offset += 1;
1125
0
            proto_tree_add_item(compat_tree, hf_desc_spec_type, tvb, offset, 1, ENC_BIG_ENDIAN);
1126
0
            offset += 1;
1127
0
            proto_tree_add_item(compat_tree, hf_desc_spec_data, tvb, offset, 3, ENC_BIG_ENDIAN);
1128
0
            offset += 3;
1129
0
            proto_tree_add_item(compat_tree, hf_desc_model, tvb, offset, 2, ENC_BIG_ENDIAN);
1130
0
            offset += 2;
1131
0
            proto_tree_add_item(compat_tree, hf_desc_version, tvb, offset, 2, ENC_BIG_ENDIAN);
1132
0
            offset += 2;
1133
1134
0
            sub_count = tvb_get_uint8(tvb, offset);
1135
0
            proto_tree_add_item(compat_tree, hf_desc_sub_desc_count, tvb, offset, 1, ENC_BIG_ENDIAN);
1136
0
            offset += 1;
1137
1138
0
            for (j = 0; j < sub_count; j++) {
1139
0
                sub_len = tvb_get_uint8(tvb, offset+1);
1140
1141
0
                desc_sub_tree = proto_tree_add_subtree(compat_tree, tvb, offset, sub_len+2,
1142
0
                                            ett_dsmcc_compat_sub_desc, NULL, "Sub Descriptor");
1143
0
                proto_tree_add_item(desc_sub_tree, hf_desc_sub_desc_type, tvb, offset, 1, ENC_BIG_ENDIAN);
1144
0
                offset += 1;
1145
0
                proto_tree_add_item(desc_sub_tree, hf_desc_sub_desc_len, tvb, offset, 1, ENC_BIG_ENDIAN);
1146
0
                offset += 1;
1147
1148
0
                offset += sub_len;
1149
0
            }
1150
0
        }
1151
1152
0
        if( 1000 == offset ) {
1153
0
            expert_add_info( pinfo, NULL, &ei_dsmcc_crc_invalid);
1154
0
        }
1155
0
    }
1156
1157
0
    return 2 + len;
1158
0
}
1159
1160
static void
1161
dissect_dsmcc_dii(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
1162
        unsigned offset)
1163
0
{
1164
0
    uint16_t    modules, module_id, private_data_len;
1165
0
    uint8_t     module_info_len, module_version;
1166
0
    unsigned    i, module_size;
1167
0
    proto_tree *mod_tree;
1168
1169
0
    proto_tree_add_item(tree, hf_dsmcc_dii_download_id, tvb, offset, 4, ENC_BIG_ENDIAN);
1170
0
    offset += 4;
1171
0
    proto_tree_add_item(tree, hf_dsmcc_dii_block_size, tvb, offset, 2, ENC_BIG_ENDIAN);
1172
0
    offset += 2;
1173
0
    proto_tree_add_item(tree, hf_dsmcc_dii_window_size, tvb, offset, 1, ENC_BIG_ENDIAN);
1174
0
    offset +=1;
1175
0
    proto_tree_add_item(tree, hf_dsmcc_dii_ack_period, tvb, offset, 1, ENC_BIG_ENDIAN);
1176
0
    offset +=1;
1177
0
    proto_tree_add_item(tree, hf_dsmcc_dii_t_c_download_window, tvb, offset, 4, ENC_BIG_ENDIAN);
1178
0
    offset += 4;
1179
0
    proto_tree_add_item(tree, hf_dsmcc_dii_t_c_download_scenario, tvb, offset, 4, ENC_BIG_ENDIAN);
1180
0
    offset += 4;
1181
0
    offset += dissect_dsmcc_dii_compat_desc(tvb, pinfo, tree, offset);
1182
0
    proto_tree_add_item_ret_uint16(tree, hf_dsmcc_dii_number_of_modules, tvb, offset, 2, ENC_BIG_ENDIAN, &modules);
1183
0
    offset += 2;
1184
1185
0
    for (i = 0; i < modules; i++ ) {
1186
0
        module_id = tvb_get_ntohs(tvb, offset);
1187
0
        module_size = tvb_get_ntohl(tvb, 2+offset);
1188
0
        module_version = tvb_get_uint8(tvb, 6+offset);
1189
1190
0
        mod_tree = proto_tree_add_subtree_format(tree, tvb, offset, -1,
1191
0
                ett_dsmcc_dii_module, NULL, "Module Id: 0x%x, Version: %u, Size: %u",
1192
0
                module_id, module_version, module_size);
1193
0
        proto_tree_add_item(mod_tree, hf_dsmcc_dii_module_id, tvb, offset, 2, ENC_BIG_ENDIAN);
1194
0
        offset += 2;
1195
0
        proto_tree_add_item(mod_tree, hf_dsmcc_dii_module_size, tvb, offset, 4, ENC_BIG_ENDIAN);
1196
0
        offset += 4;
1197
0
        proto_tree_add_item(mod_tree, hf_dsmcc_dii_module_version, tvb, offset, 1, ENC_BIG_ENDIAN);
1198
0
        offset +=1;
1199
1200
0
        module_info_len = tvb_get_uint8(tvb, offset);
1201
0
        proto_tree_add_item(mod_tree, hf_dsmcc_dii_module_info_length, tvb, offset, 1, ENC_BIG_ENDIAN);
1202
0
        offset +=1;
1203
0
        if (0 < module_info_len) {
1204
0
            proto_tree_add_item(mod_tree, hf_etv_module_abs_path, tvb, offset, 1,
1205
0
                ENC_ASCII|ENC_BIG_ENDIAN);
1206
0
            offset += module_info_len;
1207
0
        }
1208
0
    }
1209
1210
0
    private_data_len = tvb_get_ntohs(tvb, offset);
1211
0
    proto_tree_add_item(tree, hf_dsmcc_dii_private_data_length, tvb, offset, 2, ENC_BIG_ENDIAN);
1212
0
    offset += 2;
1213
1214
0
    if (0 < private_data_len) {
1215
0
        proto_tree_add_item(tree, hf_etv_dii_authority, tvb, offset, 1,
1216
0
            ENC_ASCII|ENC_BIG_ENDIAN);
1217
        /*offset += private_data_len;*/
1218
0
    }
1219
0
}
1220
1221
1222
static void
1223
dissect_dsmcc_ddb(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
1224
            proto_tree *top_tree, unsigned offset)
1225
0
{
1226
0
    tvbuff_t   *sub_tvb;
1227
0
    proto_item *pi;
1228
0
    uint8_t     reserved;
1229
1230
0
    proto_tree_add_item(tree, hf_dsmcc_ddb_module_id, tvb, offset, 2, ENC_BIG_ENDIAN);
1231
0
    offset += 2;
1232
0
    proto_tree_add_item(tree, hf_dsmcc_ddb_version, tvb, offset, 1, ENC_BIG_ENDIAN);
1233
0
    offset +=1;
1234
0
    reserved = tvb_get_uint8(tvb, offset);
1235
0
    pi = proto_tree_add_item(tree, hf_dsmcc_ddb_reserved, tvb,
1236
0
        offset, 1, ENC_BIG_ENDIAN);
1237
0
    if (0xff != reserved) {
1238
0
        expert_add_info_format(pinfo, pi, &ei_dsmcc_invalid_value,
1239
0
                    "Invalid value - should be 0xff");
1240
0
    }
1241
0
    offset +=1;
1242
0
    proto_tree_add_item(tree, hf_dsmcc_ddb_block_number, tvb, offset, 2, ENC_BIG_ENDIAN);
1243
0
    offset += 2;
1244
1245
0
    sub_tvb = tvb_new_subset_remaining(tvb, offset);
1246
0
    call_data_dissector(sub_tvb, pinfo, top_tree);
1247
0
}
1248
1249
1250
static void
1251
dissect_dsmcc_un_download(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_tree *top_tree)
1252
0
{
1253
0
    proto_tree *sub_tree;
1254
0
    uint16_t   msg_id;
1255
0
    unsigned   offset = 0;
1256
1257
0
    msg_id = tvb_get_ntohs(tvb, offset+2);
1258
1259
0
    sub_tree = proto_tree_add_subtree_format(tree, tvb, 0, -1, ett_dsmcc_payload, NULL,
1260
0
            "User Network Message - %s", val_to_str(pinfo->pool, msg_id, dsmcc_dd_message_id_vals, "%u"));
1261
1262
0
    switch (msg_id) {
1263
0
        case 0x1001:
1264
0
        case 0x1002:
1265
0
            offset += dissect_dsmcc_header(tvb, pinfo, sub_tree, offset, false);
1266
0
            dissect_dsmcc_dii(tvb, pinfo, sub_tree, offset);
1267
0
            break;
1268
0
        case 0x1003:
1269
0
            offset += dissect_dsmcc_header(tvb, pinfo, sub_tree, offset, true);
1270
0
            dissect_dsmcc_ddb(tvb, pinfo, sub_tree, top_tree, offset);
1271
0
            break;
1272
0
        case 0x1004:
1273
            /* TODO: Add support */
1274
0
            break;
1275
0
        case 0x1005:
1276
            /* TODO: Add support */
1277
0
            break;
1278
0
        case 0x1006:
1279
            /* TODO: Add support */
1280
0
            break;
1281
0
        default:
1282
0
            break;
1283
0
    }
1284
0
}
1285
1286
/* table 4-71 dsmccResourceDescriptorValue format*/
1287
static unsigned
1288
dissect_dsmcc_un_session_resource_value(
1289
        tvbuff_t *tvb, unsigned offset, packet_info *pinfo _U_, proto_tree *sub_tree, unsigned value_len)
1290
0
{
1291
0
    uint32_t i, counter, resource_value_type;
1292
0
    unsigned offset_start;
1293
1294
0
    offset_start = offset;
1295
1296
0
    proto_tree_add_item_ret_uint(sub_tree, hf_dsmcc_un_sess_rsrc_value_type, tvb, offset, 2, ENC_BIG_ENDIAN, &resource_value_type);
1297
0
    offset += 2;
1298
0
    if (resource_value_type == 1)  /* single value */
1299
0
    {
1300
0
        proto_tree_add_item(sub_tree, hf_dsmcc_un_sess_rsrc_value_data, tvb, offset, value_len, ENC_NA);
1301
0
        offset += value_len;
1302
0
    }
1303
0
    else if (resource_value_type == 2)  /* list value */
1304
0
    {
1305
0
        proto_tree_add_item_ret_uint(sub_tree, hf_dsmcc_un_sess_rsrc_value_count, tvb, offset, 2, ENC_BIG_ENDIAN, &counter);
1306
0
        offset += 2;
1307
0
        for (i=0; i<counter; i++)
1308
0
        {
1309
0
            proto_tree_add_item(sub_tree, hf_dsmcc_un_sess_rsrc_value_data, tvb, offset, value_len, ENC_NA);
1310
0
            offset += value_len;
1311
0
        }
1312
0
    }
1313
0
    else if (resource_value_type == 3)  /* range value */
1314
0
    {
1315
0
        proto_tree_add_item(sub_tree, hf_dsmcc_un_sess_rsrc_most_desired, tvb, offset, value_len, ENC_NA);
1316
0
        offset += value_len;
1317
0
        proto_tree_add_item(sub_tree, hf_dsmcc_un_sess_rsrc_least_desired, tvb, offset, value_len, ENC_NA);
1318
0
        offset += value_len;
1319
0
    }
1320
1321
0
    return offset-offset_start;
1322
0
}
1323
1324
1325
static unsigned
1326
dissect_dsmcc_un_session_resources(
1327
        tvbuff_t *tvb, unsigned offset, packet_info *pinfo _U_, proto_tree *sub_tree)
1328
0
{
1329
0
    proto_tree  *pi;
1330
0
    proto_tree  *sub_sub_tree;
1331
0
    proto_tree  *sub_sub_sub_tree;
1332
0
    proto_tree  *sub_sub_sub_sub_tree;
1333
0
    proto_tree  *rsrc_tree;
1334
0
    uint32_t     i, j, counter, resource_count;
1335
0
    uint16_t     tmp, resource_type, data_fields_length, counter_ca;
1336
0
    unsigned     offset_start;
1337
1338
0
    offset_start = offset;
1339
1340
    /* Table 4-62 General format of the DSM-CC Resource Descriptor - dsmccResourceDescriptor() */
1341
0
    proto_tree_add_item_ret_uint(sub_tree, hf_dsmcc_un_sess_rsrc_desc_count, tvb, offset, 2, ENC_BIG_ENDIAN, &resource_count);
1342
0
    offset += 2;
1343
0
    for (j=0; j<resource_count; j++)
1344
0
    {
1345
0
        sub_sub_tree = proto_tree_add_subtree_format(sub_tree, tvb, offset, 0, ett_dsmcc_heading, NULL, "Resource %u", 1+j);
1346
1347
        /* Table 4-63 - commonDescriptorHeader() */
1348
0
        sub_sub_sub_tree = proto_tree_add_subtree(sub_sub_tree, tvb, offset, 14, ett_dsmcc_heading, NULL, "Header");
1349
0
        proto_tree_add_item(sub_sub_sub_tree, hf_dsmcc_un_sess_rsrc_request_id, tvb, offset, 2, ENC_NA);
1350
0
        offset += 2;
1351
0
        proto_tree_add_item_ret_uint16(sub_sub_sub_tree, hf_dsmcc_un_sess_rsrc_descriptor_type, tvb, offset, 2, ENC_BIG_ENDIAN, &resource_type);
1352
0
        offset += 2;
1353
0
        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);
1354
0
        offset += 2;
1355
0
        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);
1356
0
        offset += 2;
1357
0
        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);
1358
0
        offset += 1;
1359
0
        proto_tree_add_item(sub_sub_sub_tree, hf_dsmcc_un_sess_rsrc_status, tvb, offset, 1, ENC_BIG_ENDIAN);
1360
0
        offset += 1;
1361
0
        proto_tree_add_item_ret_uint16(sub_sub_sub_tree, hf_dsmcc_un_sess_rsrc_desc_data_fields_length, tvb, offset, 2, ENC_BIG_ENDIAN, &data_fields_length);
1362
0
        offset += 2;
1363
0
        proto_tree_add_item(sub_sub_sub_tree, hf_dsmcc_un_sess_rsrc_data_field_count, tvb, offset, 2, ENC_BIG_ENDIAN);
1364
0
        offset += 2;
1365
1366
        /* Resource data - resourceDescriptorDataFields() */
1367
0
        sub_sub_sub_tree = proto_tree_add_subtree(sub_sub_tree, tvb, offset, data_fields_length, ett_dsmcc_heading, NULL, "Data");
1368
0
        switch (resource_type)
1369
0
        {
1370
            /* Table 4-74 Continuous Feed Session */
1371
0
            case RSRC_CONT_FEED_SESS:
1372
0
                rsrc_tree = proto_tree_add_subtree(sub_sub_sub_tree, tvb, offset, 10, ett_dsmcc_heading, NULL, "Session ID");
1373
0
                proto_tree_add_item(rsrc_tree, hf_dsmcc_un_sess_session_id_device_id, tvb, offset, 6, ENC_NA);
1374
0
                offset += 6;
1375
0
                proto_tree_add_item(rsrc_tree, hf_dsmcc_un_sess_session_id_session_number, tvb, offset, 4, ENC_BIG_ENDIAN);
1376
0
                offset += 4;
1377
0
                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);
1378
0
                offset += 2;
1379
0
                for (i=0; i<counter; i++)
1380
0
                {
1381
0
                    proto_tree_add_item(sub_sub_sub_tree, hf_dsmcc_un_sess_rsrc_cfs_num, tvb, offset, 2, ENC_NA);
1382
0
                }
1383
0
                break;
1384
            /* Table 4-75 ATM Connection */
1385
0
            case RSRC_ATM_CONN:
1386
0
                rsrc_tree = proto_tree_add_subtree(sub_sub_sub_tree, tvb, offset, 0, ett_dsmcc_heading, NULL, "ATM Address:");
1387
0
                offset += dissect_dsmcc_un_session_resource_value(tvb, offset, pinfo, rsrc_tree, 20);
1388
0
                rsrc_tree = proto_tree_add_subtree(sub_sub_sub_tree, tvb, offset, 0, ett_dsmcc_heading, NULL, "ATM VCI:");
1389
0
                offset += dissect_dsmcc_un_session_resource_value(tvb, offset, pinfo, rsrc_tree, 2);
1390
0
                rsrc_tree = proto_tree_add_subtree(sub_sub_sub_tree, tvb, offset, 0, ett_dsmcc_heading, NULL, "ATM VPI:");
1391
0
                offset += dissect_dsmcc_un_session_resource_value(tvb, offset, pinfo, rsrc_tree, 2);
1392
0
                break;
1393
            /* Table 4-76 MPEG Program */
1394
0
            case RSRC_MPEG_PROG:
1395
0
                rsrc_tree = proto_tree_add_subtree(sub_sub_sub_tree, tvb, offset, 0, ett_dsmcc_heading, NULL, "MPEG Program Number:");
1396
0
                offset += dissect_dsmcc_un_session_resource_value(tvb, offset, pinfo, rsrc_tree, 2);
1397
0
                rsrc_tree = proto_tree_add_subtree(sub_sub_sub_tree, tvb, offset, 0, ett_dsmcc_heading, NULL, "MPEG PMT PID:");
1398
0
                offset += dissect_dsmcc_un_session_resource_value(tvb, offset, pinfo, rsrc_tree, 2);
1399
0
                proto_tree_add_item(sub_sub_sub_tree, hf_dsmcc_un_sess_rsrc_mpeg_ca_pid, tvb, offset, 2, ENC_BIG_ENDIAN);
1400
0
                offset += 2;
1401
0
                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);
1402
0
                offset += 2;
1403
0
                for (i=0; i<counter; i++)
1404
0
                {
1405
0
                    rsrc_tree = proto_tree_add_subtree(sub_sub_sub_tree, tvb, offset, 0, ett_dsmcc_heading, NULL, "MPEG PID:");
1406
0
                    offset += dissect_dsmcc_un_session_resource_value(tvb, offset, pinfo, rsrc_tree, 2);
1407
0
                    rsrc_tree = proto_tree_add_subtree(sub_sub_sub_tree, tvb, offset, 0, ett_dsmcc_heading, NULL, "MPEG Stream Type:");
1408
0
                    offset += dissect_dsmcc_un_session_resource_value(tvb, offset, pinfo, rsrc_tree, 1);
1409
0
                    proto_tree_add_item(sub_sub_sub_tree, hf_dsmcc_un_sess_rsrc_reserved, tvb, offset, 1, ENC_NA);
1410
0
                    offset += 1;
1411
0
                    rsrc_tree = proto_tree_add_subtree(sub_sub_sub_tree, tvb, offset, 0, ett_dsmcc_heading, NULL, "MPEG Association Tag:");
1412
0
                    offset += dissect_dsmcc_un_session_resource_value(tvb, offset, pinfo, rsrc_tree, 2);
1413
0
                }
1414
0
                rsrc_tree = proto_tree_add_subtree(sub_sub_sub_tree, tvb, offset, 0, ett_dsmcc_heading, NULL, "MPEG PCR:");
1415
0
                offset += dissect_dsmcc_un_session_resource_value(tvb, offset, pinfo, rsrc_tree, 2);
1416
0
                break;
1417
            /* Table 4-77 Physical Channel */
1418
0
            case RSRC_PHYS_CHAN:
1419
0
                rsrc_tree = proto_tree_add_subtree(sub_sub_sub_tree, tvb, offset, 0, ett_dsmcc_heading, NULL, "Channel ID (Hz):");
1420
0
                offset += dissect_dsmcc_un_session_resource_value(tvb, offset, pinfo, rsrc_tree, 4);
1421
0
                proto_tree_add_item(sub_sub_sub_tree, hf_dsmcc_un_sess_rsrc_phys_chan_direction, tvb, offset, 2, ENC_BIG_ENDIAN);
1422
0
                offset += 2;
1423
0
                break;
1424
            /* Table 4-79 TS Upstream Bandwidth */
1425
0
            case RSRC_TS_US_BW:
1426
0
                rsrc_tree = proto_tree_add_subtree(sub_sub_sub_tree, tvb, offset, 0, ett_dsmcc_heading, NULL, "TS Upstream Bandwidth:");
1427
0
                offset += dissect_dsmcc_un_session_resource_value(tvb, offset, pinfo, rsrc_tree, 4);
1428
0
                rsrc_tree = proto_tree_add_subtree(sub_sub_sub_tree, tvb, offset, 0, ett_dsmcc_heading, NULL, "TS Upstream TSID:");
1429
0
                offset += dissect_dsmcc_un_session_resource_value(tvb, offset, pinfo, rsrc_tree, 4);
1430
0
                break;
1431
            /* Table 4-80 TS Downstream Bandwidth */
1432
0
            case RSRC_TS_DS_BW:
1433
0
                rsrc_tree = proto_tree_add_subtree(sub_sub_sub_tree, tvb, offset, 0, ett_dsmcc_heading, NULL, "TS Downstream Bandwidth:");
1434
0
                offset += dissect_dsmcc_un_session_resource_value(tvb, offset, pinfo, rsrc_tree, 4);
1435
0
                rsrc_tree = proto_tree_add_subtree(sub_sub_sub_tree, tvb, offset, 0, ett_dsmcc_heading, NULL, "TS Downstream TSID:");
1436
0
                offset += dissect_dsmcc_un_session_resource_value(tvb, offset, pinfo, rsrc_tree, 4);
1437
0
                break;
1438
            /* Table 4-81 ATM SVC Connection */
1439
0
            case RSRC_ATM_SVC_CONN:
1440
                /* TODO - Unsure how to implement ITU-T Q.2931 */
1441
0
                break;
1442
            /* Table 4-82 Connection Notify */
1443
0
            case RSRC_CONN_NTFY:
1444
                /* no data fields */
1445
0
                break;
1446
            /* Table 4-84 IP */
1447
0
            case RSRC_IP:
1448
0
                proto_tree_add_item(sub_sub_sub_tree, hf_dsmcc_un_sess_rsrc_src_ip_addr, tvb, offset, 4, ENC_BIG_ENDIAN);
1449
0
                offset += 4;
1450
0
                proto_tree_add_item(sub_sub_sub_tree, hf_dsmcc_un_sess_rsrc_src_ip_port, tvb, offset, 2, ENC_BIG_ENDIAN);
1451
0
                offset += 2;
1452
0
                proto_tree_add_item(sub_sub_sub_tree, hf_dsmcc_un_sess_rsrc_dst_ip_addr, tvb, offset, 4, ENC_BIG_ENDIAN);
1453
0
                offset += 4;
1454
0
                proto_tree_add_item(sub_sub_sub_tree, hf_dsmcc_un_sess_rsrc_dst_ip_port, tvb, offset, 2, ENC_BIG_ENDIAN);
1455
0
                offset += 2;
1456
0
                proto_tree_add_item(sub_sub_sub_tree, hf_dsmcc_un_sess_rsrc_ip_protocol, tvb, offset, 2, ENC_BIG_ENDIAN);
1457
0
                offset += 2;
1458
0
                break;
1459
            /* Table 4-85 Client TDMA Assignment */
1460
0
            case RSRC_CLN_TDMA_ASSIGN:
1461
0
                rsrc_tree = proto_tree_add_subtree(sub_sub_sub_tree, tvb, offset, 0, ett_dsmcc_heading, NULL, "Start Slot Number:");
1462
0
                offset += dissect_dsmcc_un_session_resource_value(tvb, offset, pinfo, rsrc_tree, 4);
1463
0
                rsrc_tree = proto_tree_add_subtree(sub_sub_sub_tree, tvb, offset, 0, ett_dsmcc_heading, NULL, "Number of Slots:");
1464
0
                offset += dissect_dsmcc_un_session_resource_value(tvb, offset, pinfo, rsrc_tree, 4);
1465
0
                rsrc_tree = proto_tree_add_subtree(sub_sub_sub_tree, tvb, offset, 0, ett_dsmcc_heading, NULL, "Slot Spacing:");
1466
0
                offset += dissect_dsmcc_un_session_resource_value(tvb, offset, pinfo, rsrc_tree, 4);
1467
0
                rsrc_tree = proto_tree_add_subtree(sub_sub_sub_tree, tvb, offset, 0, ett_dsmcc_heading, NULL, "Upstream Transport ID:");
1468
0
                offset += dissect_dsmcc_un_session_resource_value(tvb, offset, pinfo, rsrc_tree, 4);
1469
0
                break;
1470
            /* Table 4-86 PSTN Setup */
1471
0
            case RSRC_PSTN_SETUP:
1472
0
                proto_tree_add_item(sub_sub_sub_tree, hf_dsmcc_un_sess_rsrc_pstn_calling_id, tvb, offset, 12, ENC_NA);
1473
0
                offset += 12;
1474
0
                proto_tree_add_item(sub_sub_sub_tree, hf_dsmcc_un_sess_rsrc_pstn_called_id, tvb, offset, 12, ENC_NA);
1475
0
                offset += 12;
1476
0
                break;
1477
            /* Table 4-87 NISDN Setup */
1478
0
            case RSRC_NISDN_SETUP:
1479
            /*  TODO - Unsure how to implement ITU-T Q.931 */
1480
0
                break;
1481
            /* Table 4-88 NISDN Connection */
1482
0
            case RSRC_NISDN_CONN:
1483
            /*  TODO - Unsure how to implement ITU-T Q.931 */
1484
0
                break;
1485
            /* Table 4-89 Q.922 Connection */
1486
0
            case RSRC_Q922_CONN:
1487
0
                proto_tree_add_item_ret_uint(sub_sub_sub_tree, hf_dsmcc_un_sess_rsrc_dlci_count, tvb, offset, 2, ENC_BIG_ENDIAN, &counter);
1488
0
                offset += 2;
1489
0
                for (i=0; i<counter; i++)
1490
0
                {
1491
0
                    proto_tree_add_item(sub_sub_sub_tree, hf_dsmcc_un_sess_rsrc_dlci, tvb, offset, 2, ENC_NA);
1492
0
                    offset += 2;
1493
0
                    proto_tree_add_item(sub_sub_sub_tree, hf_dsmcc_un_sess_rsrc_dl_association_tag, tvb, offset, 2, ENC_NA);
1494
0
                    offset += 2;
1495
0
                }
1496
0
                break;
1497
            /* Table 4-92 Headend List */
1498
0
            case RSRC_HEADEND_LIST:
1499
0
                proto_tree_add_item_ret_uint(sub_sub_sub_tree, hf_dsmcc_un_sess_rsrc_headend_count, tvb, offset, 2, ENC_BIG_ENDIAN, &counter);
1500
0
                offset += 2;
1501
0
                for (i=0; i<counter; i++)
1502
0
                {
1503
0
                    proto_tree_add_item(sub_sub_sub_tree, hf_dsmcc_un_sess_rsrc_headend_code, tvb, offset, 20, ENC_NA);
1504
0
                    offset += 20;
1505
0
                }
1506
0
                break;
1507
            /* Table 4-93 ATM VC Connection */
1508
0
            case RSRC_ATM_VC_CONN:
1509
0
                proto_tree_add_item(sub_sub_sub_tree, hf_dsmcc_un_sess_rsrc_atm_vpi, tvb, offset, 2, ENC_NA);
1510
0
                offset += 2;
1511
0
                proto_tree_add_item(sub_sub_sub_tree, hf_dsmcc_un_sess_rsrc_atm_vci, tvb, offset, 2, ENC_NA);
1512
0
                offset += 2;
1513
0
                break;
1514
            /* Table 4-94 SDB Continuous Feed */
1515
0
            case RSRC_SDB_CONT_FEED:
1516
0
                proto_tree_add_item(sub_sub_sub_tree, hf_dsmcc_un_sess_rsrc_sdb_id, tvb, offset, 6, ENC_NA);
1517
0
                offset += 6;
1518
0
                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);
1519
0
                offset += 2;
1520
0
                for (i=0; i<counter; i++)
1521
0
                {
1522
0
                    proto_tree_add_item(sub_sub_sub_tree, hf_dsmcc_un_sess_rsrc_sdb_association_tag, tvb, offset, 2, ENC_NA);
1523
0
                    offset += 2;
1524
0
                    proto_tree_add_item(sub_sub_sub_tree, hf_dsmcc_un_sess_rsrc_sdb_broadcast_program_id, tvb, offset, 2, ENC_NA);
1525
0
                    offset += 2;
1526
0
                }
1527
0
                break;
1528
            /* Table 4-95 SDB Associations */
1529
0
            case RSRC_SDB_ASSOC:
1530
0
                proto_tree_add_item(sub_sub_sub_tree, hf_dsmcc_un_sess_rsrc_sdb_control_association_tag, tvb, offset, 2, ENC_NA);
1531
0
                offset += 2;
1532
0
                proto_tree_add_item(sub_sub_sub_tree, hf_dsmcc_un_sess_rsrc_sdb_program_association_tag, tvb, offset, 2, ENC_NA);
1533
0
                offset += 2;
1534
0
                break;
1535
            /* Table 4-96 SDB Entitlement */
1536
0
            case RSRC_SDB_ENT:
1537
0
                proto_tree_add_item(sub_sub_sub_tree, hf_dsmcc_un_sess_rsrc_sdb_id, tvb, offset, 6, ENC_NA);
1538
0
                offset += 6;
1539
0
                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);
1540
0
                offset += 2;
1541
0
                for (i=0; i<counter; i++)
1542
0
                {
1543
0
                    proto_tree_add_item(sub_sub_sub_tree, hf_dsmcc_un_sess_rsrc_sdb_broadcast_program_id, tvb, offset, 2, ENC_NA);
1544
0
                    offset += 2;
1545
0
                }
1546
0
                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);
1547
0
                offset += 2;
1548
0
                for (i=0; i<counter; i++)
1549
0
                {
1550
0
                    proto_tree_add_item(sub_sub_sub_tree, hf_dsmcc_un_sess_rsrc_sdb_broadcast_program_id, tvb, offset, 2, ENC_NA);
1551
0
                    offset += 2;
1552
0
                }
1553
0
                break;
1554
            /* User Defined - Modulation Mode */
1555
0
            case RSRC_MODULATION_MODE:
1556
0
                proto_tree_add_item(sub_sub_sub_tree, hf_dsmcc_un_sess_rsrc_trans_system, tvb, offset, 1, ENC_BIG_ENDIAN);
1557
0
                offset += 1;
1558
0
                proto_tree_add_item(sub_sub_sub_tree, hf_dsmcc_un_sess_rsrc_inner_coding, tvb, offset, 1, ENC_BIG_ENDIAN);
1559
0
                offset += 1;
1560
0
                proto_tree_add_item(sub_sub_sub_tree, hf_dsmcc_un_sess_rsrc_split_bitstream, tvb, offset, 1, ENC_BIG_ENDIAN);
1561
0
                offset += 1;
1562
0
                proto_tree_add_item(sub_sub_sub_tree, hf_dsmcc_un_sess_rsrc_mod_format, tvb, offset, 1, ENC_BIG_ENDIAN);
1563
0
                offset += 1;
1564
0
                proto_tree_add_item(sub_sub_sub_tree, hf_dsmcc_un_sess_rsrc_symbol_rate, tvb, offset, 4, ENC_BIG_ENDIAN);
1565
0
                offset += 4;
1566
0
                proto_tree_add_item(sub_sub_sub_tree, hf_dsmcc_un_sess_rsrc_reserved, tvb, offset, 1, ENC_NA);
1567
0
                offset += 1;
1568
0
                proto_tree_add_item(sub_sub_sub_tree, hf_dsmcc_un_sess_rsrc_interleave_depth, tvb, offset, 1, ENC_BIG_ENDIAN);
1569
0
                offset += 1;
1570
0
                proto_tree_add_item(sub_sub_sub_tree, hf_dsmcc_un_sess_rsrc_modulation_mode, tvb, offset, 1, ENC_BIG_ENDIAN);
1571
0
                offset += 1;
1572
0
                proto_tree_add_item(sub_sub_sub_tree, hf_dsmcc_un_sess_rsrc_fec, tvb, offset, 1, ENC_BIG_ENDIAN);
1573
0
                offset += 1;
1574
0
                break;
1575
            /* User Defined - Headend ID */
1576
0
            case RSRC_HEADEND_ID:
1577
0
                tmp = tvb_get_uint16(tvb, offset, ENC_BIG_ENDIAN);
1578
0
                pi = proto_tree_add_item(sub_sub_sub_tree, hf_dsmcc_un_sess_rsrc_headend_flag, tvb, offset, 2, ENC_BIG_ENDIAN);
1579
0
                if ((tmp == 0) || (tmp > 4)) {
1580
0
                    expert_add_info_format(pinfo, pi, &ei_dsmcc_invalid_value, "Invalid value - should be values 1 to 4");
1581
0
                }
1582
0
                offset += 2;
1583
0
                sub_sub_sub_sub_tree = proto_tree_add_subtree(sub_sub_sub_tree, tvb, offset, 20, ett_dsmcc_heading, NULL, "Headend ID:");
1584
0
                offset += dissect_dsmcc_un_session_nsap(tvb, offset, pinfo, sub_sub_sub_sub_tree);
1585
0
                proto_tree_add_item(sub_sub_sub_tree, hf_dsmcc_un_sess_rsrc_headend_tsid, tvb, offset, 4, ENC_BIG_ENDIAN);
1586
0
                offset += 4;
1587
0
                break;
1588
            /* User Defined - Server Conditional Access */
1589
0
            case RSRC_SERVER_CA:
1590
0
                rsrc_tree = proto_tree_add_subtree(sub_sub_sub_tree, tvb, offset, 0, ett_dsmcc_heading, NULL, "Server CA System ID:");
1591
0
                offset += dissect_dsmcc_un_session_resource_value(tvb, offset, pinfo, rsrc_tree, 2);
1592
0
                proto_tree_add_item(sub_sub_sub_tree, hf_dsmcc_un_sess_rsrc_server_ca_copyprotect, tvb, offset, 2, ENC_NA);
1593
0
                offset += 2;
1594
0
                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);
1595
0
                offset += 2;
1596
0
                for (i=0; i<counter; i++)
1597
0
                {
1598
0
                    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);
1599
0
                    offset += dissect_dsmcc_un_session_nsap(tvb, offset, pinfo, sub_sub_sub_sub_tree);
1600
0
                }
1601
0
                break;
1602
            /* User Defined - Client Conditional Access */
1603
0
            case RSRC_CLIENT_CA:
1604
0
                rsrc_tree = proto_tree_add_subtree(sub_sub_sub_tree, tvb, offset, 0, ett_dsmcc_heading, NULL, "Client CA System ID:");
1605
0
                offset += dissect_dsmcc_un_session_resource_value(tvb, offset, pinfo, rsrc_tree, 2);
1606
0
                proto_tree_add_item(sub_sub_sub_tree, hf_dsmcc_un_sess_rsrc_client_ca_info_length, tvb, offset, 2, ENC_BIG_ENDIAN);
1607
0
                counter_ca = tvb_get_uint16(tvb, offset, ENC_BIG_ENDIAN);
1608
0
                offset += 2;
1609
0
                if (counter_ca > 0)
1610
0
                {
1611
0
                    proto_tree_add_item(sub_sub_sub_tree, hf_dsmcc_un_sess_rsrc_client_ca_info_data, tvb, offset, counter_ca, ENC_NA);
1612
0
                    offset = offset + counter_ca;
1613
0
                }
1614
0
                break;
1615
            /* User Defined - Ethernet Interface */
1616
0
            case RSRC_ETHERNET:
1617
0
                rsrc_tree = proto_tree_add_subtree(sub_sub_sub_tree, tvb, offset, 0, ett_dsmcc_heading, NULL, "Ethernet Source UDP:");
1618
0
                offset += dissect_dsmcc_un_session_resource_value(tvb, offset, pinfo, rsrc_tree, 2);
1619
0
                rsrc_tree = proto_tree_add_subtree(sub_sub_sub_tree, tvb, offset, 0, ett_dsmcc_heading, NULL, "Ethernet Source IP:");
1620
0
                offset += dissect_dsmcc_un_session_resource_value(tvb, offset, pinfo, rsrc_tree, 4);
1621
0
                rsrc_tree = proto_tree_add_subtree(sub_sub_sub_tree, tvb, offset, 0, ett_dsmcc_heading, NULL, "Ethernet Source MAC:");
1622
0
                offset += dissect_dsmcc_un_session_resource_value(tvb, offset, pinfo, rsrc_tree, 6);
1623
0
                rsrc_tree = proto_tree_add_subtree(sub_sub_sub_tree, tvb, offset, 0, ett_dsmcc_heading, NULL, "Ethernet Destination UDP:");
1624
0
                offset += dissect_dsmcc_un_session_resource_value(tvb, offset, pinfo, rsrc_tree, 2);
1625
0
                rsrc_tree = proto_tree_add_subtree(sub_sub_sub_tree, tvb, offset, 0, ett_dsmcc_heading, NULL, "Ethernet Destination IP:");
1626
0
                offset += dissect_dsmcc_un_session_resource_value(tvb, offset, pinfo, rsrc_tree, 4);
1627
0
                rsrc_tree = proto_tree_add_subtree(sub_sub_sub_tree, tvb, offset, 0, ett_dsmcc_heading, NULL, "Ethernet Destination MAC:");
1628
0
                offset += dissect_dsmcc_un_session_resource_value(tvb, offset, pinfo, rsrc_tree, 6);
1629
0
                break;
1630
            /* User Defined - Service Group */
1631
0
            case RSRC_SERVICE_GROUP:
1632
0
                proto_tree_add_item(sub_sub_sub_tree, hf_dsmcc_un_sess_rsrc_value_type, tvb, offset, 2, ENC_BIG_ENDIAN);
1633
0
                offset += 2;
1634
0
                proto_tree_add_item(sub_sub_sub_tree, hf_dsmcc_un_sess_rsrc_service_group, tvb, offset, 4, ENC_BIG_ENDIAN);
1635
0
                offset += 4;
1636
0
                break;
1637
            /* Table 4-90 Shared Resource */
1638
0
            case RSRC_SHARED_RSRC:
1639
0
                proto_tree_add_item(sub_sub_sub_tree, hf_dsmcc_un_sess_rsrc_shared_resource_num, tvb, offset, 2, ENC_NA);
1640
0
                offset += 2;
1641
0
                break;
1642
            /* Table 4-91 Shared Resource Request ID */
1643
0
            case RSRC_SHARED_REQ_ID:
1644
0
                proto_tree_add_item(sub_sub_sub_tree, hf_dsmcc_un_sess_rsrc_shared_resource_request_id, tvb, offset, 2, ENC_NA);
1645
0
                offset += 2;
1646
0
                break;
1647
            /* Table 4-63 Type Owner */
1648
0
            case RSRC_TYPE_OWNER:
1649
0
                proto_tree_add_item(sub_sub_sub_tree, hf_dsmcc_un_sess_rsrc_type_owner_id, tvb, offset, 3, ENC_NA);
1650
0
                offset += 3;
1651
0
                proto_tree_add_item(sub_sub_sub_tree, hf_dsmcc_un_sess_rsrc_type_owner_value, tvb, offset, 3, ENC_NA);
1652
0
                offset += 3;
1653
0
                break;
1654
0
            default:
1655
0
                break;
1656
0
        }
1657
0
    }
1658
1659
0
    return offset-offset_start;
1660
0
}
1661
1662
/* UserData() is vendor proprietary, therefore not dissected. */
1663
static unsigned
1664
dissect_dsmcc_un_session_user_data(
1665
        tvbuff_t *tvb, unsigned offset, packet_info *pinfo _U_, proto_tree *tree)
1666
0
{
1667
0
    unsigned   offset_start;
1668
0
    uint16_t uu_len, priv_len;
1669
1670
0
    offset_start = offset;
1671
1672
0
    uu_len = tvb_get_ntohs(tvb, offset);
1673
0
    proto_tree_add_item(tree, hf_dsmcc_un_sess_uu_data_len, tvb, offset, 2, ENC_BIG_ENDIAN);
1674
0
    offset += 2;
1675
1676
0
    if (uu_len>0) {
1677
0
        proto_tree_add_item(tree, hf_dsmcc_un_sess_uu_data, tvb, offset, uu_len, ENC_NA);
1678
0
        offset += uu_len;
1679
0
    }
1680
1681
0
    priv_len = tvb_get_ntohs(tvb, offset);
1682
0
    proto_tree_add_item(tree, hf_dsmcc_un_sess_priv_data_len, tvb, offset, 2, ENC_BIG_ENDIAN);
1683
0
    offset += 2;
1684
1685
0
    if (priv_len>0) {
1686
0
        proto_tree_add_item(tree, hf_dsmcc_un_sess_priv_data, tvb, offset, priv_len, ENC_NA);
1687
0
        offset += priv_len;
1688
0
    }
1689
1690
0
    return offset-offset_start;
1691
0
}
1692
1693
1694
static void
1695
dissect_dsmcc_un_session(tvbuff_t *tvb, packet_info *pinfo,
1696
        proto_tree *tree, proto_tree *top_tree _U_)
1697
1
{
1698
1
    proto_item  *pi;
1699
1
    proto_tree  *sub_tree;
1700
1
    proto_tree  *sub_sub_tree;
1701
1
    uint32_t    i, counter;
1702
1
    uint16_t    msg_id;
1703
1
    unsigned    offset = 0;
1704
1705
1
    msg_id = tvb_get_ntohs(tvb, offset+2);
1706
1707
1
    sub_tree = proto_tree_add_subtree_format(tree, tvb, offset, -1,
1708
1
            ett_dsmcc_payload, &pi, "User Network Message (Session) - %s",
1709
1
            val_to_str(pinfo->pool, msg_id, dsmcc_un_sess_message_id_vals, "0x%x"));
1710
1
    col_append_sep_str(pinfo->cinfo, COL_INFO, NULL,
1711
1
            val_to_str(pinfo->pool, msg_id, dsmcc_un_sess_message_id_vals, "0x%x"));
1712
1713
1
    offset += dissect_dsmcc_header(tvb, pinfo, sub_tree, offset, false);
1714
1715
1
    switch (msg_id) {
1716
1717
        /* CLIENT Messages */
1718
0
        case DSMCC_UN_SESS_CLN_SESS_SET_REQ:
1719
0
            offset += dissect_dsmcc_un_session_id(tvb, offset, pinfo, sub_tree);
1720
0
            proto_tree_add_item(sub_tree, hf_dsmcc_un_sess_reserved, tvb, offset, 2, ENC_BIG_ENDIAN);
1721
0
            offset += 2;
1722
            /* client nsap */
1723
0
            sub_sub_tree = proto_tree_add_subtree(sub_tree, tvb, offset, 20, ett_dsmcc_heading, NULL, "Client ID");
1724
0
            offset += dissect_dsmcc_un_session_nsap(tvb, offset, pinfo, sub_sub_tree);
1725
            /* server nsap */
1726
0
            sub_sub_tree = proto_tree_add_subtree(sub_tree, tvb, offset, 20, ett_dsmcc_heading, NULL, "Server ID");
1727
0
            offset += dissect_dsmcc_un_session_nsap(tvb, offset, pinfo, sub_sub_tree);
1728
            /* user data */
1729
0
            sub_sub_tree = proto_tree_add_subtree(sub_tree, tvb, offset, -1, ett_dsmcc_heading, NULL, "User Data");
1730
0
            offset += dissect_dsmcc_un_session_user_data(tvb, offset, pinfo, sub_sub_tree);
1731
0
            break;
1732
0
        case DSMCC_UN_SESS_CLN_SESS_SET_CNF:
1733
0
            offset += dissect_dsmcc_un_session_id(tvb, offset, pinfo, sub_tree);
1734
0
            proto_tree_add_item(sub_tree, hf_dsmcc_un_sess_response, tvb, offset, 2, ENC_BIG_ENDIAN);
1735
0
            offset += 2;
1736
0
            sub_sub_tree = proto_tree_add_subtree(sub_tree, tvb, offset, 20, ett_dsmcc_heading, NULL, "Server ID");
1737
0
            offset += dissect_dsmcc_un_session_nsap(tvb, offset, pinfo, sub_sub_tree);
1738
0
            sub_sub_tree = proto_tree_add_subtree(sub_tree, tvb, offset, -1, ett_dsmcc_heading, NULL, "Resources");
1739
0
            offset += dissect_dsmcc_un_session_resources(tvb, offset, pinfo, sub_sub_tree);
1740
0
            sub_sub_tree = proto_tree_add_subtree(sub_tree, tvb, offset, -1, ett_dsmcc_heading, NULL, "User Data");
1741
0
            offset += dissect_dsmcc_un_session_user_data(tvb, offset, pinfo, sub_sub_tree);
1742
0
            break;
1743
0
        case DSMCC_UN_SESS_CLN_SESS_REL_REQ:
1744
0
            offset += dissect_dsmcc_un_session_id(tvb, offset, pinfo, sub_tree);
1745
0
            proto_tree_add_item(sub_tree, hf_dsmcc_un_sess_reason, tvb, offset, 2, ENC_BIG_ENDIAN);
1746
0
            offset += 2;
1747
0
            sub_sub_tree = proto_tree_add_subtree(sub_tree, tvb, offset, -1, ett_dsmcc_heading, NULL, "User Data");
1748
0
            offset += dissect_dsmcc_un_session_user_data(tvb, offset, pinfo, sub_sub_tree);
1749
0
            break;
1750
0
        case DSMCC_UN_SESS_CLN_SESS_REL_CNF:
1751
0
            offset += dissect_dsmcc_un_session_id(tvb, offset, pinfo, sub_tree);
1752
0
            proto_tree_add_item(sub_tree, hf_dsmcc_un_sess_response, tvb, offset, 2, ENC_BIG_ENDIAN);
1753
0
            offset += 2;
1754
0
            sub_sub_tree = proto_tree_add_subtree(sub_tree, tvb, offset, -1, ett_dsmcc_heading, NULL, "User Data");
1755
0
            offset += dissect_dsmcc_un_session_user_data(tvb, offset, pinfo, sub_sub_tree);
1756
0
            break;
1757
0
        case DSMCC_UN_SESS_CLN_SESS_REL_IND:
1758
0
            offset += dissect_dsmcc_un_session_id(tvb, offset, pinfo, sub_tree);
1759
0
            proto_tree_add_item(sub_tree, hf_dsmcc_un_sess_reason, tvb, offset, 2, ENC_BIG_ENDIAN);
1760
0
            offset += 2;
1761
0
            sub_sub_tree = proto_tree_add_subtree(sub_tree, tvb, offset, -1, ett_dsmcc_heading, NULL, "User Data");
1762
0
            offset += dissect_dsmcc_un_session_user_data(tvb, offset, pinfo, sub_sub_tree);
1763
0
            break;
1764
0
        case DSMCC_UN_SESS_CLN_SESS_REL_RES:
1765
0
            offset += dissect_dsmcc_un_session_id(tvb, offset, pinfo, sub_tree);
1766
0
            proto_tree_add_item(sub_tree, hf_dsmcc_un_sess_response, tvb, offset, 2, ENC_BIG_ENDIAN);
1767
0
            offset += 2;
1768
0
            sub_sub_tree = proto_tree_add_subtree(sub_tree, tvb, offset, -1, ett_dsmcc_heading, NULL, "User Data");
1769
0
            offset += dissect_dsmcc_un_session_user_data(tvb, offset, pinfo, sub_sub_tree);
1770
0
            break;
1771
0
        case DSMCC_UN_SESS_CLN_ADD_RSRC_IND:
1772
0
            offset += dissect_dsmcc_un_session_id(tvb, offset, pinfo, sub_tree);
1773
0
            sub_sub_tree = proto_tree_add_subtree(sub_tree, tvb, offset, -1, ett_dsmcc_heading, NULL, "Resources");
1774
0
            offset += dissect_dsmcc_un_session_resources(tvb, offset, pinfo, sub_sub_tree);
1775
0
            sub_sub_tree = proto_tree_add_subtree(sub_tree, tvb, offset, -1, ett_dsmcc_heading, NULL, "User Data");
1776
0
            offset += dissect_dsmcc_un_session_user_data(tvb, offset, pinfo, sub_sub_tree);
1777
0
            break;
1778
0
        case DSMCC_UN_SESS_CLN_ADD_RSRC_RES:
1779
0
            offset += dissect_dsmcc_un_session_id(tvb, offset, pinfo, sub_tree);
1780
0
            proto_tree_add_item(sub_tree, hf_dsmcc_un_sess_response, tvb, offset, 2, ENC_BIG_ENDIAN);
1781
0
            offset += 2;
1782
0
            sub_sub_tree = proto_tree_add_subtree(sub_tree, tvb, offset, -1, ett_dsmcc_heading, NULL, "Resources");
1783
0
            offset += dissect_dsmcc_un_session_resources(tvb, offset, pinfo, sub_sub_tree);
1784
0
            sub_sub_tree = proto_tree_add_subtree(sub_tree, tvb, offset, -1, ett_dsmcc_heading, NULL, "User Data");
1785
0
            offset += dissect_dsmcc_un_session_user_data(tvb, offset, pinfo, sub_sub_tree);
1786
0
            break;
1787
0
        case DSMCC_UN_SESS_CLN_DEL_RSRC_IND:
1788
0
            offset += dissect_dsmcc_un_session_id(tvb, offset, pinfo, sub_tree);
1789
0
            proto_tree_add_item(sub_tree, hf_dsmcc_un_sess_reason, tvb, offset, 2, ENC_BIG_ENDIAN);
1790
0
            offset += 2;
1791
0
            proto_tree_add_item_ret_uint(sub_tree, hf_dsmcc_un_sess_resource_count, tvb, offset, 2, ENC_BIG_ENDIAN, &counter);
1792
0
            offset += 2;
1793
0
            for (i=0; i<counter; i++)
1794
0
            {
1795
0
                proto_tree_add_item(sub_tree, hf_dsmcc_un_sess_resource_num, tvb, offset, 2, ENC_NA);
1796
0
                offset += 2;
1797
0
            }
1798
0
            sub_sub_tree = proto_tree_add_subtree(sub_tree, tvb, offset, -1, ett_dsmcc_heading, NULL, "User Data");
1799
0
            offset += dissect_dsmcc_un_session_user_data(tvb, offset, pinfo, sub_sub_tree);
1800
0
            break;
1801
0
        case DSMCC_UN_SESS_CLN_DEL_RSRC_RES:
1802
0
            offset += dissect_dsmcc_un_session_id(tvb, offset, pinfo, sub_tree);
1803
0
            proto_tree_add_item(sub_tree, hf_dsmcc_un_sess_response, tvb, offset, 2, ENC_BIG_ENDIAN);
1804
0
            offset += 2;
1805
0
            sub_sub_tree = proto_tree_add_subtree(sub_tree, tvb, offset, -1, ett_dsmcc_heading, NULL, "User Data");
1806
0
            offset += dissect_dsmcc_un_session_user_data(tvb, offset, pinfo, sub_sub_tree);
1807
0
            break;
1808
0
        case DSMCC_UN_SESS_CLN_STATUS_REQ:
1809
0
            offset += dissect_dsmcc_un_session_id(tvb, offset, pinfo, sub_tree);
1810
0
            proto_tree_add_item(sub_tree, hf_dsmcc_un_sess_reason, tvb, offset, 2, ENC_BIG_ENDIAN);
1811
0
            offset += 2;
1812
0
            sub_sub_tree = proto_tree_add_subtree(sub_tree, tvb, offset, 20, ett_dsmcc_heading, NULL, "Client ID");
1813
0
            offset += dissect_dsmcc_un_session_nsap(tvb, offset, pinfo, sub_sub_tree);
1814
0
            proto_tree_add_item(sub_tree, hf_dsmcc_un_sess_status_type, tvb, offset, 2, ENC_BIG_ENDIAN);
1815
0
            offset += 2;
1816
0
            proto_tree_add_item_ret_uint(sub_tree, hf_dsmcc_un_sess_status_count, tvb, offset, 2, ENC_BIG_ENDIAN, &counter);
1817
0
            offset += 2;
1818
0
            for (i=0; i<counter; i++)
1819
0
            {
1820
0
                proto_tree_add_item(sub_tree, hf_dsmcc_un_sess_status_byte, tvb, offset, 1, ENC_NA);
1821
0
                offset += 1;
1822
0
            }
1823
0
            break;
1824
0
        case DSMCC_UN_SESS_CLN_STATUS_CNF:
1825
0
            proto_tree_add_item(sub_tree, hf_dsmcc_un_sess_response, tvb, offset, 2, ENC_BIG_ENDIAN);
1826
0
            offset += 2;
1827
0
            proto_tree_add_item(sub_tree, hf_dsmcc_un_sess_status_type, tvb, offset, 2, ENC_BIG_ENDIAN);
1828
0
            offset += 2;
1829
0
            proto_tree_add_item_ret_uint(sub_tree, hf_dsmcc_un_sess_status_count, tvb, offset, 2, ENC_BIG_ENDIAN, &counter);
1830
0
            offset += 2;
1831
0
            for (i=0; i<counter; i++)
1832
0
            {
1833
0
                proto_tree_add_item(sub_tree, hf_dsmcc_un_sess_status_byte, tvb, offset, 1, ENC_NA);
1834
0
                offset += 1;
1835
0
            }
1836
0
            break;
1837
0
        case DSMCC_UN_SESS_CLN_STATUS_IND:
1838
0
            proto_tree_add_item(sub_tree, hf_dsmcc_un_sess_reason, tvb, offset, 2, ENC_BIG_ENDIAN);
1839
0
            offset += 2;
1840
0
            proto_tree_add_item(sub_tree, hf_dsmcc_un_sess_status_type, tvb, offset, 2, ENC_BIG_ENDIAN);
1841
0
            offset += 2;
1842
0
            proto_tree_add_item_ret_uint(sub_tree, hf_dsmcc_un_sess_status_count, tvb, offset, 2, ENC_BIG_ENDIAN, &counter);
1843
0
            offset += 2;
1844
0
            for (i=0; i<counter; i++)
1845
0
            {
1846
0
                proto_tree_add_item(sub_tree, hf_dsmcc_un_sess_status_byte, tvb, offset, 1, ENC_NA);
1847
0
                offset += 1;
1848
0
            }
1849
0
            break;
1850
0
        case DSMCC_UN_SESS_CLN_STATUS_RES:
1851
0
            proto_tree_add_item(sub_tree, hf_dsmcc_un_sess_response, tvb, offset, 2, ENC_BIG_ENDIAN);
1852
0
            offset += 2;
1853
0
            proto_tree_add_item(sub_tree, hf_dsmcc_un_sess_status_type, tvb, offset, 2, ENC_BIG_ENDIAN);
1854
0
            offset += 2;
1855
0
            proto_tree_add_item_ret_uint(sub_tree, hf_dsmcc_un_sess_status_count, tvb, offset, 2, ENC_BIG_ENDIAN, &counter);
1856
0
            offset += 2;
1857
0
            for (i=0; i<counter; i++)
1858
0
            {
1859
0
                proto_tree_add_item(sub_tree, hf_dsmcc_un_sess_status_byte, tvb, offset, 1, ENC_NA);
1860
0
                offset += 1;
1861
0
            }
1862
0
            break;
1863
0
        case DSMCC_UN_SESS_CLN_RESET_REQ:
1864
0
            sub_sub_tree = proto_tree_add_subtree(sub_tree, tvb, offset, 20, ett_dsmcc_heading, NULL, "Client ID");
1865
0
            offset += dissect_dsmcc_un_session_nsap(tvb, offset, pinfo, sub_sub_tree);
1866
0
            proto_tree_add_item(sub_tree, hf_dsmcc_un_sess_reason, tvb, offset, 2, ENC_BIG_ENDIAN);
1867
0
            offset += 2;
1868
0
            break;
1869
0
        case DSMCC_UN_SESS_CLN_RESET_CNF:
1870
0
            sub_sub_tree = proto_tree_add_subtree(sub_tree, tvb, offset, 20, ett_dsmcc_heading, NULL, "Client ID");
1871
0
            offset += dissect_dsmcc_un_session_nsap(tvb, offset, pinfo, sub_sub_tree);
1872
0
            proto_tree_add_item(sub_tree, hf_dsmcc_un_sess_response, tvb, offset, 2, ENC_BIG_ENDIAN);
1873
0
            offset += 2;
1874
0
            break;
1875
0
        case DSMCC_UN_SESS_CLN_RESET_IND:
1876
0
            sub_sub_tree = proto_tree_add_subtree(sub_tree, tvb, offset, 20, ett_dsmcc_heading, NULL, "Client ID");
1877
0
            offset += dissect_dsmcc_un_session_nsap(tvb, offset, pinfo, sub_sub_tree);
1878
0
            proto_tree_add_item(sub_tree, hf_dsmcc_un_sess_reason, tvb, offset, 2, ENC_BIG_ENDIAN);
1879
0
            offset += 2;
1880
0
            break;
1881
0
        case DSMCC_UN_SESS_CLN_RESET_RES:
1882
0
            sub_sub_tree = proto_tree_add_subtree(sub_tree, tvb, offset, 20, ett_dsmcc_heading, NULL, "Client ID");
1883
0
            offset += dissect_dsmcc_un_session_nsap(tvb, offset, pinfo, sub_sub_tree);
1884
0
            proto_tree_add_item(sub_tree, hf_dsmcc_un_sess_response, tvb, offset, 2, ENC_BIG_ENDIAN);
1885
0
            offset += 2;
1886
0
            break;
1887
0
        case DSMCC_UN_SESS_CLN_SESS_PROC_IND:
1888
0
            offset += dissect_dsmcc_un_session_id(tvb, offset, pinfo, sub_tree);
1889
0
            proto_tree_add_item(sub_tree, hf_dsmcc_un_sess_reason, tvb, offset, 2, ENC_BIG_ENDIAN);
1890
0
            offset += 2;
1891
0
            break;
1892
0
        case DSMCC_UN_SESS_CLN_CONN_REQ:
1893
0
            offset += dissect_dsmcc_un_session_id(tvb, offset, pinfo, sub_tree);
1894
0
            sub_sub_tree = proto_tree_add_subtree(sub_tree, tvb, offset, -1, ett_dsmcc_heading, NULL, "User Data");
1895
0
            offset += dissect_dsmcc_un_session_user_data(tvb, offset, pinfo, sub_sub_tree);
1896
0
            break;
1897
0
        case DSMCC_UN_SESS_CLN_SESS_TRN_IND:
1898
0
            offset += dissect_dsmcc_un_session_id(tvb, offset, pinfo, sub_tree);
1899
0
            proto_tree_add_item(sub_tree, hf_dsmcc_reserved, tvb, offset, 2, ENC_BIG_ENDIAN);
1900
0
            offset += 2;
1901
            /* client */
1902
0
            sub_sub_tree = proto_tree_add_subtree(sub_tree, tvb, offset, 20, ett_dsmcc_heading, NULL, "Client ID");
1903
0
            offset += dissect_dsmcc_un_session_nsap(tvb, offset, pinfo, sub_sub_tree);
1904
            /* old server */
1905
0
            sub_sub_tree = proto_tree_add_subtree(sub_tree, tvb, offset, 20, ett_dsmcc_heading, NULL, "Old Server ID");
1906
0
            offset += dissect_dsmcc_un_session_nsap(tvb, offset, pinfo, sub_sub_tree);
1907
            /* new server */
1908
0
            sub_sub_tree = proto_tree_add_subtree(sub_tree, tvb, offset, 20, ett_dsmcc_heading, NULL, "New Server ID");
1909
0
            offset += dissect_dsmcc_un_session_nsap(tvb, offset, pinfo, sub_sub_tree);
1910
0
            sub_sub_tree = proto_tree_add_subtree(sub_tree, tvb, offset, -1, ett_dsmcc_heading, NULL, "Resources");
1911
0
            offset += dissect_dsmcc_un_session_resources(tvb, offset, pinfo, sub_sub_tree);
1912
0
            sub_sub_tree = proto_tree_add_subtree(sub_tree, tvb, offset, -1, ett_dsmcc_heading, NULL, "User Data");
1913
0
            offset += dissect_dsmcc_un_session_user_data(tvb, offset, pinfo, sub_sub_tree);
1914
0
            break;
1915
0
        case DSMCC_UN_SESS_CLN_SESS_TRN_RES:
1916
0
            offset += dissect_dsmcc_un_session_id(tvb, offset, pinfo, sub_tree);
1917
0
            proto_tree_add_item(sub_tree, hf_dsmcc_un_sess_response, tvb, offset, 2, ENC_BIG_ENDIAN);
1918
0
            offset += 2;
1919
0
            sub_sub_tree = proto_tree_add_subtree(sub_tree, tvb, offset, -1, ett_dsmcc_heading, NULL, "User Data");
1920
0
            offset += dissect_dsmcc_un_session_user_data(tvb, offset, pinfo, sub_sub_tree);
1921
0
            break;
1922
0
        case DSMCC_UN_SESS_CLN_SESS_INP_REQ:
1923
0
            proto_tree_add_item_ret_uint(sub_tree, hf_dsmcc_un_sess_session_count, tvb, offset, 2, ENC_BIG_ENDIAN, &counter);
1924
0
            offset += 2;
1925
0
            for (i=0; i<counter; i++)
1926
0
            {
1927
0
                offset += dissect_dsmcc_un_session_id(tvb, offset, pinfo, sub_tree);
1928
0
            }
1929
0
            break;
1930
1931
        /* SERVER Messages */
1932
0
        case DSMCC_UN_SESS_SRV_SESS_SET_IND:
1933
0
            offset += dissect_dsmcc_un_session_id(tvb, offset, pinfo, sub_tree);
1934
0
            proto_tree_add_item(sub_tree, hf_dsmcc_un_sess_reserved, tvb, offset, 2, ENC_BIG_ENDIAN);
1935
0
            offset += 2;
1936
            /* client */
1937
0
            sub_sub_tree = proto_tree_add_subtree(sub_tree, tvb, offset, 20, ett_dsmcc_heading, NULL, "Client ID");
1938
0
            offset += dissect_dsmcc_un_session_nsap(tvb, offset, pinfo, sub_sub_tree);
1939
            /* server */
1940
0
            sub_sub_tree = proto_tree_add_subtree(sub_tree, tvb, offset, 20, ett_dsmcc_heading, NULL, "Server ID");
1941
0
            offset += dissect_dsmcc_un_session_nsap(tvb, offset, pinfo, sub_sub_tree);
1942
0
            proto_tree_add_item_ret_uint(sub_tree, hf_dsmcc_un_sess_forward_count, tvb, offset, 2, ENC_BIG_ENDIAN, &counter);
1943
0
            offset += 2;
1944
0
            for (i=0; i<counter; i++)
1945
0
            {
1946
0
                sub_sub_tree = proto_tree_add_subtree(sub_tree, tvb, offset, 20, ett_dsmcc_heading, NULL, "Forward Server ID");
1947
0
                offset += dissect_dsmcc_un_session_nsap(tvb, offset, pinfo, sub_sub_tree);
1948
0
            }
1949
0
            sub_sub_tree = proto_tree_add_subtree(sub_tree, tvb, offset, -1, ett_dsmcc_heading, NULL, "User Data");
1950
0
            offset += dissect_dsmcc_un_session_user_data(tvb, offset, pinfo, sub_sub_tree);
1951
0
            break;
1952
0
        case DSMCC_UN_SESS_SRV_SESS_SET_RES:
1953
0
            offset += dissect_dsmcc_un_session_id(tvb, offset, pinfo, sub_tree);
1954
0
            proto_tree_add_item(sub_tree, hf_dsmcc_un_sess_response, tvb, offset, 2, ENC_BIG_ENDIAN);
1955
0
            offset += 2;
1956
            /* server */
1957
0
            sub_sub_tree = proto_tree_add_subtree(sub_tree, tvb, offset, 20, ett_dsmcc_heading, NULL, "Server ID");
1958
0
            offset += dissect_dsmcc_un_session_nsap(tvb, offset, pinfo, sub_sub_tree);
1959
            /* next server */
1960
0
            sub_sub_tree = proto_tree_add_subtree(sub_tree, tvb, offset, 20, ett_dsmcc_heading, NULL, "Next Server ID");
1961
0
            offset += dissect_dsmcc_un_session_nsap(tvb, offset, pinfo, sub_sub_tree);
1962
0
            sub_sub_tree = proto_tree_add_subtree(sub_tree, tvb, offset, -1, ett_dsmcc_heading, NULL, "Resources");
1963
0
            offset += dissect_dsmcc_un_session_resources(tvb, offset, pinfo, sub_sub_tree);
1964
0
            sub_sub_tree = proto_tree_add_subtree(sub_tree, tvb, offset, -1, ett_dsmcc_heading, NULL, "User Data");
1965
0
            offset += dissect_dsmcc_un_session_user_data(tvb, offset, pinfo, sub_sub_tree);
1966
0
            break;
1967
0
        case DSMCC_UN_SESS_SRV_SESS_REL_REQ:
1968
0
            offset += dissect_dsmcc_un_session_id(tvb, offset, pinfo, sub_tree);
1969
0
            proto_tree_add_item(sub_tree, hf_dsmcc_un_sess_reason, tvb, offset, 2, ENC_BIG_ENDIAN);
1970
0
            offset += 2;
1971
0
            sub_sub_tree = proto_tree_add_subtree(sub_tree, tvb, offset, -1, ett_dsmcc_heading, NULL, "User Data");
1972
0
            offset += dissect_dsmcc_un_session_user_data(tvb, offset, pinfo, sub_sub_tree);
1973
0
            break;
1974
0
        case DSMCC_UN_SESS_SRV_SESS_REL_CNF:
1975
0
            offset += dissect_dsmcc_un_session_id(tvb, offset, pinfo, sub_tree);
1976
0
            proto_tree_add_item(sub_tree, hf_dsmcc_un_sess_response, tvb, offset, 2, ENC_BIG_ENDIAN);
1977
0
            offset += 2;
1978
0
            sub_sub_tree = proto_tree_add_subtree(sub_tree, tvb, offset, -1, ett_dsmcc_heading, NULL, "User Data");
1979
0
            offset += dissect_dsmcc_un_session_user_data(tvb, offset, pinfo, sub_sub_tree);
1980
0
            break;
1981
0
        case DSMCC_UN_SESS_SRV_SESS_REL_IND:
1982
0
            offset += dissect_dsmcc_un_session_id(tvb, offset, pinfo, sub_tree);
1983
0
            proto_tree_add_item(sub_tree, hf_dsmcc_un_sess_reason, tvb, offset, 2, ENC_BIG_ENDIAN);
1984
0
            offset += 2;
1985
0
            sub_sub_tree = proto_tree_add_subtree(sub_tree, tvb, offset, -1, ett_dsmcc_heading, NULL, "User Data");
1986
0
            offset += dissect_dsmcc_un_session_user_data(tvb, offset, pinfo, sub_sub_tree);
1987
0
            break;
1988
0
        case DSMCC_UN_SESS_SRV_SESS_REL_RES:
1989
0
            offset += dissect_dsmcc_un_session_id(tvb, offset, pinfo, sub_tree);
1990
0
            proto_tree_add_item(sub_tree, hf_dsmcc_un_sess_response, tvb, offset, 2, ENC_BIG_ENDIAN);
1991
0
            offset += 2;
1992
0
            sub_sub_tree = proto_tree_add_subtree(sub_tree, tvb, offset, -1, ett_dsmcc_heading, NULL, "User Data");
1993
0
            offset += dissect_dsmcc_un_session_user_data(tvb, offset, pinfo, sub_sub_tree);
1994
0
            break;
1995
0
        case DSMCC_UN_SESS_SRV_ADD_RSRC_REQ:
1996
0
            offset += dissect_dsmcc_un_session_id(tvb, offset, pinfo, sub_tree);
1997
0
            sub_sub_tree = proto_tree_add_subtree(sub_tree, tvb, offset, -1, ett_dsmcc_heading, NULL, "Resources");
1998
0
            offset += dissect_dsmcc_un_session_resources(tvb, offset, pinfo, sub_sub_tree);
1999
0
            sub_sub_tree = proto_tree_add_subtree(sub_tree, tvb, offset, -1, ett_dsmcc_heading, NULL, "User Data");
2000
0
            offset += dissect_dsmcc_un_session_user_data(tvb, offset, pinfo, sub_sub_tree);
2001
0
            break;
2002
0
        case DSMCC_UN_SESS_SRV_ADD_RSRC_CNF:
2003
0
            offset += dissect_dsmcc_un_session_id(tvb, offset, pinfo, sub_tree);
2004
0
            proto_tree_add_item(sub_tree, hf_dsmcc_un_sess_response, tvb, offset, 2, ENC_BIG_ENDIAN);
2005
0
            offset += 2;
2006
0
            sub_sub_tree = proto_tree_add_subtree(sub_tree, tvb, offset, -1, ett_dsmcc_heading, NULL, "Resources");
2007
0
            offset += dissect_dsmcc_un_session_resources(tvb, offset, pinfo, sub_sub_tree);
2008
0
            sub_sub_tree = proto_tree_add_subtree(sub_tree, tvb, offset, -1, ett_dsmcc_heading, NULL, "User Data");
2009
0
            offset += dissect_dsmcc_un_session_user_data(tvb, offset, pinfo, sub_sub_tree);
2010
0
            break;
2011
0
        case DSMCC_UN_SESS_SRV_DEL_RSRC_REQ:
2012
0
            offset += dissect_dsmcc_un_session_id(tvb, offset, pinfo, sub_tree);
2013
0
            proto_tree_add_item(sub_tree, hf_dsmcc_un_sess_reason, tvb, offset, 2, ENC_BIG_ENDIAN);
2014
0
            offset += 2;
2015
0
            proto_tree_add_item_ret_uint(sub_tree, hf_dsmcc_un_sess_resource_count, tvb, offset, 2, ENC_BIG_ENDIAN, &counter);
2016
0
            offset += 2;
2017
0
            for (i=0; i<counter; i++)
2018
0
            {
2019
0
                proto_tree_add_item(sub_tree, hf_dsmcc_un_sess_resource_num, tvb, offset, 2, ENC_NA);
2020
0
                offset += 2;
2021
0
            }
2022
0
            sub_sub_tree = proto_tree_add_subtree(sub_tree, tvb, offset, -1, ett_dsmcc_heading, NULL, "User Data");
2023
0
            offset += dissect_dsmcc_un_session_user_data(tvb, offset, pinfo, sub_sub_tree);
2024
0
            break;
2025
0
        case DSMCC_UN_SESS_SRV_DEL_RSRC_CNF:
2026
0
            offset += dissect_dsmcc_un_session_id(tvb, offset, pinfo, sub_tree);
2027
0
            proto_tree_add_item(sub_tree, hf_dsmcc_un_sess_response, tvb, offset, 2, ENC_BIG_ENDIAN);
2028
0
            offset += 2;
2029
0
            sub_sub_tree = proto_tree_add_subtree(sub_tree, tvb, offset, -1, ett_dsmcc_heading, NULL, "User Data");
2030
0
            offset += dissect_dsmcc_un_session_user_data(tvb, offset, pinfo, sub_sub_tree);
2031
0
            break;
2032
0
        case DSMCC_UN_SESS_SRV_CONT_FEED_SESS_REQ:
2033
0
            offset += dissect_dsmcc_un_session_id(tvb, offset, pinfo, sub_tree);
2034
0
            proto_tree_add_item(sub_tree, hf_dsmcc_un_sess_reserved, tvb, offset, 2, ENC_BIG_ENDIAN);
2035
0
            offset += 2;
2036
0
            sub_sub_tree = proto_tree_add_subtree(sub_tree, tvb, offset, 20, ett_dsmcc_heading, NULL, "Server ID");
2037
0
            offset += dissect_dsmcc_un_session_nsap(tvb, offset, pinfo, sub_sub_tree);
2038
0
            sub_sub_tree = proto_tree_add_subtree(sub_tree, tvb, offset, -1, ett_dsmcc_heading, NULL, "Resources");
2039
0
            offset += dissect_dsmcc_un_session_resources(tvb, offset, pinfo, sub_sub_tree);
2040
0
            break;
2041
0
        case DSMCC_UN_SESS_SRV_CONT_FEED_SESS_CNF:
2042
0
            offset += dissect_dsmcc_un_session_id(tvb, offset, pinfo, sub_tree);
2043
0
            proto_tree_add_item(sub_tree, hf_dsmcc_un_sess_response, tvb, offset, 2, ENC_BIG_ENDIAN);
2044
0
            offset += 2;
2045
0
            sub_sub_tree = proto_tree_add_subtree(sub_tree, tvb, offset, -1, ett_dsmcc_heading, NULL, "Resources");
2046
0
            offset += dissect_dsmcc_un_session_resources(tvb, offset, pinfo, sub_sub_tree);
2047
0
            break;
2048
0
        case DSMCC_UN_SESS_SRV_STATUS_REQ:
2049
0
            proto_tree_add_item(sub_tree, hf_dsmcc_un_sess_reason, tvb, offset, 2, ENC_BIG_ENDIAN);
2050
0
            offset += 2;
2051
0
            sub_sub_tree = proto_tree_add_subtree(sub_tree, tvb, offset, 20, ett_dsmcc_heading, NULL, "Server ID");
2052
0
            offset += dissect_dsmcc_un_session_nsap(tvb, offset, pinfo, sub_sub_tree);
2053
0
            proto_tree_add_item(sub_tree, hf_dsmcc_un_sess_status_type, tvb, offset, 2, ENC_BIG_ENDIAN);
2054
0
            offset += 2;
2055
0
            proto_tree_add_item_ret_uint(sub_tree, hf_dsmcc_un_sess_status_count, tvb, offset, 2, ENC_BIG_ENDIAN, &counter);
2056
0
            offset += 2;
2057
0
            for (i=0; i<counter; i++)
2058
0
            {
2059
0
                proto_tree_add_item(sub_tree, hf_dsmcc_un_sess_status_byte, tvb, offset, 1, ENC_NA);
2060
0
                offset += 1;
2061
0
            }
2062
0
            break;
2063
0
        case DSMCC_UN_SESS_SRV_STATUS_CNF:
2064
0
            proto_tree_add_item(sub_tree, hf_dsmcc_un_sess_response, tvb, offset, 2, ENC_BIG_ENDIAN);
2065
0
            offset += 2;
2066
0
            proto_tree_add_item(sub_tree, hf_dsmcc_un_sess_status_type, tvb, offset, 2, ENC_BIG_ENDIAN);
2067
0
            offset += 2;
2068
0
            proto_tree_add_item_ret_uint(sub_tree, hf_dsmcc_un_sess_status_count, tvb, offset, 2, ENC_BIG_ENDIAN, &counter);
2069
0
            offset += 2;
2070
0
            for (i=0; i<counter; i++)
2071
0
            {
2072
0
                proto_tree_add_item(sub_tree, hf_dsmcc_un_sess_status_byte, tvb, offset, 1, ENC_NA);
2073
0
                offset += 1;
2074
0
            }
2075
0
            break;
2076
0
        case DSMCC_UN_SESS_SRV_STATUS_IND:
2077
0
            proto_tree_add_item(sub_tree, hf_dsmcc_un_sess_reason, tvb, offset, 2, ENC_BIG_ENDIAN);
2078
0
            offset += 2;
2079
0
            proto_tree_add_item(sub_tree, hf_dsmcc_un_sess_status_type, tvb, offset, 2, ENC_BIG_ENDIAN);
2080
0
            offset += 2;
2081
0
            proto_tree_add_item_ret_uint(sub_tree, hf_dsmcc_un_sess_status_count, tvb, offset, 2, ENC_BIG_ENDIAN, &counter);
2082
0
            offset += 2;
2083
0
            for (i=0; i<counter; i++)
2084
0
            {
2085
0
                proto_tree_add_item(sub_tree, hf_dsmcc_un_sess_status_byte, tvb, offset, 1, ENC_NA);
2086
0
                offset += 1;
2087
0
            }
2088
0
            break;
2089
0
        case DSMCC_UN_SESS_SRV_STATUS_RES:
2090
0
            proto_tree_add_item(sub_tree, hf_dsmcc_un_sess_response, tvb, offset, 2, ENC_BIG_ENDIAN);
2091
0
            offset += 2;
2092
0
            proto_tree_add_item(sub_tree, hf_dsmcc_un_sess_status_type, tvb, offset, 2, ENC_BIG_ENDIAN);
2093
0
            offset += 2;
2094
0
            proto_tree_add_item_ret_uint(sub_tree, hf_dsmcc_un_sess_status_count, tvb, offset, 2, ENC_BIG_ENDIAN, &counter);
2095
0
            offset += 2;
2096
0
            for (i=0; i<counter; i++)
2097
0
            {
2098
0
                proto_tree_add_item(sub_tree, hf_dsmcc_un_sess_status_byte, tvb, offset, 1, ENC_NA);
2099
0
                offset += 1;
2100
0
            }
2101
0
            break;
2102
0
        case DSMCC_UN_SESS_SRV_RESET_REQ:
2103
0
            sub_sub_tree = proto_tree_add_subtree(sub_tree, tvb, offset, 20, ett_dsmcc_heading, NULL, "Server ID");
2104
0
            offset += dissect_dsmcc_un_session_nsap(tvb, offset, pinfo, sub_sub_tree);
2105
0
            proto_tree_add_item(sub_tree, hf_dsmcc_un_sess_reason, tvb, offset, 2, ENC_BIG_ENDIAN);
2106
0
            offset += 2;
2107
0
            break;
2108
0
        case DSMCC_UN_SESS_SRV_RESET_CNF:
2109
0
            sub_sub_tree = proto_tree_add_subtree(sub_tree, tvb, offset, 20, ett_dsmcc_heading, NULL, "Server ID");
2110
0
            offset += dissect_dsmcc_un_session_nsap(tvb, offset, pinfo, sub_sub_tree);
2111
0
            proto_tree_add_item(sub_tree, hf_dsmcc_un_sess_response, tvb, offset, 2, ENC_BIG_ENDIAN);
2112
0
            offset += 2;
2113
0
            break;
2114
0
        case DSMCC_UN_SESS_SRV_RESET_IND:
2115
0
            sub_sub_tree = proto_tree_add_subtree(sub_tree, tvb, offset, 20, ett_dsmcc_heading, NULL, "Server ID");
2116
0
            offset += dissect_dsmcc_un_session_nsap(tvb, offset, pinfo, sub_sub_tree);
2117
0
            proto_tree_add_item(sub_tree, hf_dsmcc_un_sess_reason, tvb, offset, 2, ENC_BIG_ENDIAN);
2118
0
            offset += 2;
2119
0
            break;
2120
0
        case DSMCC_UN_SESS_SRV_RESET_RES:
2121
0
            sub_sub_tree = proto_tree_add_subtree(sub_tree, tvb, offset, 20, ett_dsmcc_heading, NULL, "Server ID");
2122
0
            offset += dissect_dsmcc_un_session_nsap(tvb, offset, pinfo, sub_sub_tree);
2123
0
            proto_tree_add_item(sub_tree, hf_dsmcc_un_sess_response, tvb, offset, 2, ENC_BIG_ENDIAN);
2124
0
            offset += 2;
2125
0
            break;
2126
0
        case DSMCC_UN_SESS_SRV_SESS_PROC_IND:
2127
0
            offset += dissect_dsmcc_un_session_id(tvb, offset, pinfo, sub_tree);
2128
0
            proto_tree_add_item(sub_tree, hf_dsmcc_un_sess_reason, tvb, offset, 2, ENC_BIG_ENDIAN);
2129
0
            offset += 2;
2130
0
            break;
2131
0
        case DSMCC_UN_SESS_SRV_CONN_IND:
2132
0
            offset += dissect_dsmcc_un_session_id(tvb, offset, pinfo, sub_tree);
2133
0
            sub_sub_tree = proto_tree_add_subtree(sub_tree, tvb, offset, -1, ett_dsmcc_heading, NULL, "User Data");
2134
0
            offset += dissect_dsmcc_un_session_user_data(tvb, offset, pinfo, sub_sub_tree);
2135
0
            break;
2136
0
        case DSMCC_UN_SESS_SRV_SESS_TRN_REQ:
2137
0
            offset += dissect_dsmcc_un_session_id(tvb, offset, pinfo, sub_tree);
2138
0
            proto_tree_add_item(sub_tree, hf_dsmcc_reserved, tvb, offset, 2, ENC_BIG_ENDIAN);
2139
0
            offset += 2;
2140
            /* destination server */
2141
0
            sub_sub_tree = proto_tree_add_subtree(sub_tree, tvb, offset, 20, ett_dsmcc_heading, NULL, "Destination Server ID");
2142
0
            offset += dissect_dsmcc_un_session_nsap(tvb, offset, pinfo, sub_sub_tree);
2143
            /* base server */
2144
0
            sub_sub_tree = proto_tree_add_subtree(sub_tree, tvb, offset, 20, ett_dsmcc_heading, NULL, "Base Server ID");
2145
0
            offset += dissect_dsmcc_un_session_nsap(tvb, offset, pinfo, sub_sub_tree);
2146
0
            sub_sub_tree = proto_tree_add_subtree(sub_tree, tvb, offset, -1, ett_dsmcc_heading, NULL, "User Data");
2147
0
            offset += dissect_dsmcc_un_session_user_data(tvb, offset, pinfo, sub_sub_tree);
2148
0
            break;
2149
0
        case DSMCC_UN_SESS_SRV_SESS_TRN_CNF:
2150
0
            offset += dissect_dsmcc_un_session_id(tvb, offset, pinfo, sub_tree);
2151
0
            proto_tree_add_item(sub_tree, hf_dsmcc_un_sess_response, tvb, offset, 2, ENC_BIG_ENDIAN);
2152
0
            offset += 2;
2153
0
            sub_sub_tree = proto_tree_add_subtree(sub_tree, tvb, offset, -1, ett_dsmcc_heading, NULL, "User Data");
2154
0
            offset += dissect_dsmcc_un_session_user_data(tvb, offset, pinfo, sub_sub_tree);
2155
0
            break;
2156
0
        case DSMCC_UN_SESS_SRV_SESS_TRN_IND:
2157
0
            offset += dissect_dsmcc_un_session_id(tvb, offset, pinfo, sub_tree);
2158
0
            proto_tree_add_item(sub_tree, hf_dsmcc_reserved, tvb, offset, 2, ENC_BIG_ENDIAN);
2159
0
            offset += 2;
2160
            /* client */
2161
0
            sub_sub_tree = proto_tree_add_subtree(sub_tree, tvb, offset, 20, ett_dsmcc_heading, NULL, "Client ID");
2162
0
            offset += dissect_dsmcc_un_session_nsap(tvb, offset, pinfo, sub_sub_tree);
2163
            /* source server */
2164
0
            sub_sub_tree = proto_tree_add_subtree(sub_tree, tvb, offset, 20, ett_dsmcc_heading, NULL, "Source Server ID");
2165
0
            offset += dissect_dsmcc_un_session_nsap(tvb, offset, pinfo, sub_sub_tree);
2166
            /* base server */
2167
0
            sub_sub_tree = proto_tree_add_subtree(sub_tree, tvb, offset, 20, ett_dsmcc_heading, NULL, "Base Server ID");
2168
0
            offset += dissect_dsmcc_un_session_nsap(tvb, offset, pinfo, sub_sub_tree);
2169
0
            sub_sub_tree = proto_tree_add_subtree(sub_tree, tvb, offset, -1, ett_dsmcc_heading, NULL, "Resources");
2170
0
            offset += dissect_dsmcc_un_session_resources(tvb, offset, pinfo, sub_sub_tree);
2171
0
            sub_sub_tree = proto_tree_add_subtree(sub_tree, tvb, offset, -1, ett_dsmcc_heading, NULL, "User Data");
2172
0
            offset += dissect_dsmcc_un_session_user_data(tvb, offset, pinfo, sub_sub_tree);
2173
0
            break;
2174
0
        case DSMCC_UN_SESS_SRV_SESS_TRN_RES:
2175
0
            offset += dissect_dsmcc_un_session_id(tvb, offset, pinfo, sub_tree);
2176
0
            proto_tree_add_item(sub_tree, hf_dsmcc_un_sess_response, tvb, offset, 2, ENC_BIG_ENDIAN);
2177
0
            offset += 2;
2178
0
            sub_sub_tree = proto_tree_add_subtree(sub_tree, tvb, offset, -1, ett_dsmcc_heading, NULL, "Resources");
2179
0
            offset += dissect_dsmcc_un_session_resources(tvb, offset, pinfo, sub_sub_tree);
2180
0
            sub_sub_tree = proto_tree_add_subtree(sub_tree, tvb, offset, -1, ett_dsmcc_heading, NULL, "User Data");
2181
0
            offset += dissect_dsmcc_un_session_user_data(tvb, offset, pinfo, sub_sub_tree);
2182
0
            break;
2183
0
        case DSMCC_UN_SESS_SRV_SESS_INP_REQ:
2184
0
            proto_tree_add_item_ret_uint(sub_tree, hf_dsmcc_un_sess_session_count, tvb, offset, 2, ENC_BIG_ENDIAN, &counter);
2185
0
            offset += 2;
2186
0
            for (i=0; i<counter; i++)
2187
0
            {
2188
0
                offset += dissect_dsmcc_un_session_id(tvb, offset, pinfo, sub_tree);
2189
0
            }
2190
0
            break;
2191
1
        default:
2192
1
            break;
2193
1
    }
2194
1
    proto_item_set_len(pi, offset);
2195
1
}
2196
2197
2198
static void
2199
dissect_dsmcc_un(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
2200
            proto_tree *top_tree)
2201
1
{
2202
1
    uint8_t type;
2203
2204
    /* dsmccMessageHeader.dsmccType */
2205
1
    type = tvb_get_uint8(tvb, 1);
2206
2207
1
    switch (type) {
2208
0
        case 1: /* user-to-network configuration */
2209
            /* TODO: Add support */
2210
0
            break;
2211
1
        case 2: /* user-to-network session */
2212
1
            dissect_dsmcc_un_session(tvb, pinfo, tree, top_tree);
2213
1
            break;
2214
0
        case 3: /* user-to-network download */
2215
0
            dissect_dsmcc_un_download(tvb, pinfo, tree, top_tree);
2216
0
            break;
2217
0
        case 4: /* sdb channel change protocol */
2218
            /* TODO: Add support */
2219
0
            break;
2220
0
        case 5: /* user-to-network pass-thru */
2221
            /* TODO: Add support */
2222
0
            break;
2223
0
        default:
2224
0
            break;
2225
1
    }
2226
1
}
2227
2228
2229
static int
2230
dissect_dsmcc_ts(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree_in, void *data _U_)
2231
7
{
2232
7
    proto_item *pi;
2233
7
    proto_tree *tree;
2234
7
    unsigned    crc_len;
2235
7
    uint8_t     tid;
2236
7
    uint16_t    sect_len;
2237
7
    uint32_t    crc, calculated_crc;
2238
7
    const char *label;
2239
7
    tvbuff_t   *sub_tvb;
2240
7
    uint16_t    ssi;
2241
7
    unsigned    offset = 0;
2242
2243
7
    pi = proto_tree_add_item(tree_in, proto_dsmcc, tvb, 0, -1, ENC_NA);
2244
7
    tree = proto_item_add_subtree(pi, ett_dsmcc);
2245
2246
7
    col_set_str(pinfo->cinfo, COL_PROTOCOL, "DSM-CC");
2247
2248
7
    tid = tvb_get_uint8(tvb, offset);
2249
7
    proto_tree_add_item(tree, hf_dsmcc_table_id, tvb, offset, 1, ENC_BIG_ENDIAN);
2250
7
    offset +=1;
2251
7
    ssi = tvb_get_ntohs(tvb, offset);
2252
7
    ssi &= DSMCC_SSI_MASK;
2253
7
    proto_tree_add_item(tree, hf_dsmcc_section_syntax_indicator, tvb, offset, 2, ENC_BIG_ENDIAN);
2254
7
    proto_tree_add_item(tree, hf_dsmcc_private_indicator, tvb, offset, 2, ENC_BIG_ENDIAN);
2255
7
    proto_tree_add_item(tree, hf_dsmcc_reserved, tvb, offset, 2, ENC_BIG_ENDIAN);
2256
7
    proto_tree_add_item(tree, hf_dsmcc_section_length, tvb, offset, 2, ENC_BIG_ENDIAN);
2257
7
    sect_len = tvb_get_ntohs(tvb, offset);
2258
7
    sect_len &= DSMCC_LENGTH_MASK;
2259
7
    offset += 2;
2260
2261
7
    proto_tree_add_item(tree, hf_dsmcc_table_id_extension, tvb, offset, 2, ENC_BIG_ENDIAN);
2262
7
    offset += 2;
2263
7
    proto_tree_add_item(tree, hf_dsmcc_reserved2, tvb, offset, 1, ENC_BIG_ENDIAN);
2264
7
    proto_tree_add_item(tree, hf_dsmcc_version_number, tvb, offset, 1, ENC_BIG_ENDIAN);
2265
7
    proto_tree_add_item(tree, hf_dsmcc_current_next_indicator, tvb, offset, 1, ENC_BIG_ENDIAN);
2266
7
    offset +=1;
2267
7
    proto_tree_add_item(tree, hf_dsmcc_section_number, tvb, offset, 1, ENC_BIG_ENDIAN);
2268
7
    offset +=1;
2269
7
    proto_tree_add_item(tree, hf_dsmcc_last_section_number, tvb, offset, 1, ENC_BIG_ENDIAN);
2270
7
    offset +=1;
2271
2272
7
    sub_tvb = tvb_new_subset_length(tvb, offset, sect_len-9);
2273
7
    switch (tid) {
2274
0
        case DSMCC_TID_LLCSNAP:
2275
            /* TODO: Add support */
2276
0
            break;
2277
1
        case DSMCC_TID_UN_MSG:
2278
1
        case DSMCC_TID_DD_MSG:
2279
1
            dissect_dsmcc_un(sub_tvb, pinfo, tree, tree_in);
2280
1
            break;
2281
1
        case DSMCC_TID_DESC_LIST:
2282
            /* TODO: Add support */
2283
1
            break;
2284
0
        case DSMCC_TID_PRIVATE:
2285
            /* TODO: Add support */
2286
0
            break;
2287
2
        default:
2288
2
            break;
2289
7
    }
2290
2291
4
    crc_len = 3 + sect_len - 4; /* Add the header, remove the crc */
2292
4
    if (ssi) {
2293
2
        crc = tvb_get_ntohl(tvb, crc_len);
2294
2295
2
        calculated_crc = crc;
2296
2
        label = "Unverified";
2297
2
        if (dsmcc_sect_check_crc) {
2298
0
            label = "Verified";
2299
0
            calculated_crc = crc32_mpeg2_tvb_offset(tvb, 0, crc_len);
2300
0
        }
2301
2302
2
        if (calculated_crc == crc) {
2303
0
            proto_tree_add_uint_format( tree, hf_dsmcc_crc, tvb,
2304
0
                crc_len, 4, crc, "CRC: 0x%08x [%s]", crc, label);
2305
2
        } else {
2306
2
            proto_item *msg_error;
2307
2308
2
            msg_error = proto_tree_add_uint_format( tree, hf_dsmcc_crc, tvb,
2309
2
                        crc_len, 4, crc,
2310
2
                        "CRC: 0x%08x [Failed Verification (Calculated: 0x%08x)]",
2311
2
                        crc, calculated_crc );
2312
2
            proto_item_set_generated(msg_error);
2313
2
            expert_add_info( pinfo, msg_error, &ei_dsmcc_crc_invalid);
2314
2
        }
2315
2
    } else {
2316
        /* TODO: actually check the checksum */
2317
2
        proto_tree_add_checksum(tree, tvb, crc_len, hf_dsmcc_checksum,
2318
2
            -1, NULL, pinfo, 0, ENC_BIG_ENDIAN, PROTO_CHECKSUM_NO_FLAGS);
2319
2
    }
2320
2321
4
    return tvb_reported_length(tvb);
2322
7
}
2323
2324
2325
static int dissect_dsmcc_tcp(tvbuff_t *tvb, packet_info *pinfo,
2326
        proto_tree *tree, void *data _U_)
2327
1
{
2328
1
    proto_item *pi;
2329
1
    proto_tree *sub_tree;
2330
2331
1
    if (tvb_get_uint8(tvb, 0) != DSMCC_PROT_DISC)
2332
1
        return 0;
2333
2334
0
    col_set_str(pinfo->cinfo, COL_PROTOCOL, "DSM-CC");
2335
0
    col_clear(pinfo->cinfo, COL_INFO);
2336
2337
0
    pi = proto_tree_add_item(tree, proto_dsmcc, tvb, 0, -1, ENC_NA);
2338
0
    sub_tree = proto_item_add_subtree(pi, ett_dsmcc);
2339
2340
0
    dissect_dsmcc_un(tvb, pinfo, sub_tree, tree);
2341
2342
0
    return tvb_reported_length(tvb);
2343
1
}
2344
2345
2346
static int dissect_dsmcc_udp(tvbuff_t *tvb, packet_info *pinfo,
2347
        proto_tree *tree, void *data _U_)
2348
2
{
2349
2
    proto_item *pi;
2350
2
    proto_tree *sub_tree;
2351
2352
2
    if (tvb_get_uint8(tvb, 0) != DSMCC_PROT_DISC)
2353
2
        return 0;
2354
2355
0
    col_set_str(pinfo->cinfo, COL_PROTOCOL, "DSM-CC");
2356
0
    col_clear(pinfo->cinfo, COL_INFO);
2357
2358
0
    pi = proto_tree_add_item(tree, proto_dsmcc, tvb, 0, -1, ENC_NA);
2359
0
    sub_tree = proto_item_add_subtree(pi, ett_dsmcc);
2360
2361
0
    dissect_dsmcc_un(tvb, pinfo, sub_tree, tree);
2362
2363
0
    return tvb_reported_length(tvb);
2364
2
}
2365
2366
2367
void
2368
proto_register_dsmcc(void)
2369
15
{
2370
    /* NOTE: Please add tables numerically according to 13818-6 so it is
2371
     * easier to keep track of what parameters/tables are associated with
2372
     * each other.
2373
     */
2374
15
    static hf_register_info hf[] = {
2375
2376
        /* table 2-1 dsmccMessageHeader - start */
2377
15
        { &hf_dsmcc_protocol_discriminator, {
2378
15
            "Protocol Discriminator", "mpeg_dsmcc.protocol",
2379
15
            FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL
2380
15
        } },
2381
2382
15
        { &hf_dsmcc_type, {
2383
15
            "Type", "mpeg_dsmcc.type",
2384
15
            FT_UINT8, BASE_HEX|BASE_RANGE_STRING,
2385
15
            RVALS(dsmcc_header_type_vals), 0, NULL, HFILL
2386
15
        } },
2387
2388
15
        { &hf_dsmcc_message_id, {
2389
15
            "Message ID", "mpeg_dsmcc.message_id",
2390
15
            FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL
2391
15
        } },
2392
2393
15
        { &hf_dsmcc_transaction_id, {
2394
15
            "Transaction ID", "mpeg_dsmcc.transaction_id",
2395
15
            FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL
2396
15
        } },
2397
2398
15
        { &hf_dsmcc_header_reserved, {
2399
15
            "Reserved", "mpeg_dsmcc.header_reserved",
2400
15
            FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL
2401
15
        } },
2402
2403
15
        { &hf_dsmcc_adaptation_length, {
2404
15
            "Adaptation Length", "mpeg_dsmcc.adaptation_length",
2405
15
            FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL
2406
15
        } },
2407
2408
15
        { &hf_dsmcc_message_length, {
2409
15
            "Message Length", "mpeg_dsmcc.message_length",
2410
15
            FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL
2411
15
        } },
2412
        /* table 2-1 dsmccMessageHeader - end */
2413
2414
        /* table 2-3 Transaction ID originator - start */
2415
15
        { &hf_dsmcc_un_sess_flag_transaction_id_originator, {
2416
15
            "Transaction ID Originator", "mpeg_dsmcc.transaction_id_originator",
2417
15
            FT_UINT32, BASE_DEC|BASE_RANGE_STRING,
2418
15
            RVALS(dsmcc_un_sess_transaction_id_originator_vals),
2419
15
            DMSCC_FLAG_TRAN_ORIG, NULL, HFILL
2420
15
        } },
2421
2422
15
        { &hf_dsmcc_un_sess_flag_transaction_id_number, {
2423
15
            "Transaction Number", "mpeg_dsmcc.transaction_id_number",
2424
15
            FT_UINT32, BASE_DEC, NULL, DMSCC_FLAG_TRAN_NUM, NULL, HFILL
2425
15
        } },
2426
        /* table 2-3 Transaction ID originator - end */
2427
2428
        /* table 2-4 dsmccAdaptationHeader - start */
2429
15
        { &hf_dsmcc_adaptation_type, {
2430
15
            "Adaptation Type", "mpeg_dsmcc.adaptation_header.type",
2431
15
            FT_UINT8, BASE_HEX|BASE_RANGE_STRING,
2432
15
            RVALS(dsmcc_adaptation_header_vals), 0, NULL, HFILL
2433
15
        } },
2434
        /* table 2-4 dsmccAdaptationHeader - end */
2435
2436
        /* table 2-6 dsmccConditionalAccess - start */
2437
15
        { &hf_dsmcc_adaptation_ca_reserved, {
2438
15
            "Reserved", "mpeg_dsmcc.adaptation_header.ca.reserved",
2439
15
            FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL
2440
15
        } },
2441
2442
15
        { &hf_dsmcc_adaptation_ca_system_id, {
2443
15
            "CA System ID", "mpeg_dsmcc.adaptation_header.ca.system_id",
2444
15
            FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL
2445
15
        } },
2446
2447
15
        { &hf_dsmcc_adaptation_ca_length, {
2448
15
            "CA Length", "mpeg_dsmcc.adaptation_header.ca.length",
2449
15
            FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL
2450
15
        } },
2451
        /* table 2-6 dsmccConditionalAccess - end */
2452
2453
        /* table 2-7 dsmccUserId - start */
2454
15
        { &hf_dsmcc_adaptation_user_id_reserved, {
2455
15
            "Reserved", "mpeg_dsmcc.adaptation_header.uid.reserved",
2456
15
            FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL
2457
15
        } },
2458
        /* table 2-7 dsmccUserId - end */
2459
2460
        /* other tables in section 4.2 - start */
2461
15
        { &hf_dsmcc_un_sess_response, {
2462
15
            "Response", "mpeg_dsmcc.un_sess.response",
2463
15
            FT_UINT16, BASE_HEX|BASE_RANGE_STRING,
2464
15
            RVALS(dsmcc_un_sess_message_response_codes_vals), 0, NULL, HFILL
2465
15
        } },
2466
2467
15
        { &hf_dsmcc_un_sess_reason, {
2468
15
            "Reason", "mpeg_dsmcc.un_sess.reason",
2469
15
            FT_UINT16, BASE_HEX|BASE_RANGE_STRING,
2470
15
            RVALS(dsmcc_un_sess_message_reason_codes_vals), 0, NULL, HFILL
2471
15
        } },
2472
2473
15
        { &hf_dsmcc_un_sess_reserved, {
2474
15
            "Reserved", "mpeg_dsmcc.un_sess.reserved",
2475
15
            FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL
2476
15
        } },
2477
        /* other tables in section 4.2 - end */
2478
2479
        /* table 4-2 message discriminator - start */
2480
15
        { &hf_dsmcc_un_sess_flag_message_discriminator, {
2481
15
            "Message Discriminator", "mpeg_dsmcc.message_discriminator",
2482
15
            FT_UINT16, BASE_DEC|BASE_RANGE_STRING,
2483
15
            RVALS(dsmcc_un_sess_message_discriminator_vals),
2484
15
            DMSCC_FLAG_MESS_DISCRIMINATOR, NULL, HFILL
2485
15
        } },
2486
        /* table 4-2 message discriminator - end */
2487
2488
        /* table 4-3 message scenario - start */
2489
15
        { &hf_dsmcc_un_sess_flag_message_scenario, {
2490
15
            "Message Scenario", "mpeg_dsmcc.message_scenario",
2491
15
            FT_UINT16, BASE_DEC|BASE_RANGE_STRING,
2492
15
            RVALS(dsmcc_un_sess_message_scenario_vals),
2493
15
            DMSCC_FLAG_MESS_SCENARIO, NULL, HFILL
2494
15
        } },
2495
        /* table 4-3 message scenario - end */
2496
2497
        /* table 4-4 message type - start */
2498
15
        { &hf_dsmcc_un_sess_flag_message_type, {
2499
15
            "Message Type", "mpeg_dsmcc.message_type",
2500
15
            FT_UINT16, BASE_DEC|BASE_RANGE_STRING,
2501
15
            RVALS(dsmcc_un_sess_message_type_vals),
2502
15
            DMSCC_FLAG_MESS_TYPE, NULL, HFILL
2503
15
        } },
2504
        /* table 4-4 message type - end */
2505
2506
        /* table 4-5 U-N Resources - start */
2507
15
        { &hf_dsmcc_un_sess_rsrc_desc_count, {
2508
15
            "Resource Descriptor Count", "mpeg_dsmcc.un_sess.rsrc_desc_count",
2509
15
            FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL
2510
15
        } },
2511
        /* table 4-5 U-N Resources - end */
2512
2513
        /* table 4-6 U-N user data format - start */
2514
15
        { &hf_dsmcc_un_sess_uu_data_len, {
2515
15
            "User data length", "mpeg_dsmcc.un_sess.uu_data_len",
2516
15
            FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL
2517
15
        } },
2518
2519
15
        { &hf_dsmcc_un_sess_uu_data, {
2520
15
            "User data", "mpeg_dsmcc.un_sess.uu_data",
2521
15
            FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL
2522
15
        } },
2523
2524
15
        { &hf_dsmcc_un_sess_priv_data_len, {
2525
15
            "Private data length", "mpeg_dsmcc.un_sess.priv_data_len",
2526
15
            FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL
2527
15
        } },
2528
2529
15
        { &hf_dsmcc_un_sess_priv_data, {
2530
15
            "Private data", "mpeg_dsmcc.un_sess.priv_data",
2531
15
            FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL
2532
15
        } },
2533
        /* table 4-6 U-N user data format - end */
2534
2535
        /* 4-10 - Server Session Setup Indication message - start */
2536
15
        { &hf_dsmcc_un_sess_forward_count, {
2537
15
            "Forward Count", "mpeg_dsmcc.un_sess.forward_count",
2538
15
            FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL
2539
15
        } },
2540
        /* 4-10 - Server Session Setup Indication message - start */
2541
2542
        /* 4-26 - start */
2543
15
        { &hf_dsmcc_un_sess_resource_count, {
2544
15
            "Resource Count", "mpeg_dsmcc.un_sess.resource_count",
2545
15
            FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL
2546
15
        } },
2547
2548
15
        { &hf_dsmcc_un_sess_resource_num, {
2549
15
            "Resource Number", "mpeg_dsmcc.un_sess.resource_num",
2550
15
            FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL
2551
15
        } },
2552
        /* 4-26 - end */
2553
2554
        /* table 4-35 ServerStatusRequest message, 4-36 ServerStatusConfirm message - start */
2555
15
        { &hf_dsmcc_un_sess_status_type, {
2556
15
            "Status Type", "mpeg_dsmcc.un_sess.status_type",
2557
15
            FT_UINT16, BASE_DEC|BASE_RANGE_STRING,
2558
15
            RVALS(dsmcc_un_sess_status_type_vals), 0, NULL, HFILL
2559
15
        } },
2560
2561
15
        { &hf_dsmcc_un_sess_status_count, {
2562
15
            "Status Count (Bytes)", "mpeg_dsmcc.un_sess.status_count",
2563
15
            FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL
2564
15
        } },
2565
2566
15
        { &hf_dsmcc_un_sess_status_byte, {
2567
15
            "Status Byte", "mpeg_dsmcc.un_sess.status_byte",
2568
15
            FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL
2569
15
        } },
2570
        /* table 4-35 ServerStatusRequest message, 4-36 ServerStatusConfirm message - end */
2571
2572
        /* table 4-56 - start */
2573
15
        { &hf_dsmcc_un_sess_session_count, {
2574
15
            "Session Count", "mpeg_dsmcc.un_sess.session_count",
2575
15
            FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL
2576
15
        } },
2577
        /* table 4-56 - end */
2578
2579
        /* table 4-58 Message Fields data types - start */
2580
15
        { &hf_dsmcc_un_sess_session_id_device_id, {
2581
15
            "Device ID", "mpeg_dsmcc.un_sess.session_id_device_id",
2582
15
            FT_ETHER, BASE_NONE, NULL, 0, NULL, HFILL
2583
15
        } },
2584
2585
15
        { &hf_dsmcc_un_sess_session_id_session_number, {
2586
15
            "Session Number", "mpeg_dsmcc.un_sess.session_id_session_number",
2587
15
            FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL
2588
15
        } },
2589
        /* table 4-58 Message Fields data types - start */
2590
2591
        /* table 4-63 U-N common descriptor header - start */
2592
15
        { &hf_dsmcc_un_sess_rsrc_request_id, {
2593
15
            "Request ID", "mpeg_dsmcc.un_sess.rsrc_request_id",
2594
15
            FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL
2595
15
        } },
2596
2597
15
        { &hf_dsmcc_un_sess_rsrc_descriptor_type, {
2598
15
            "Descriptor Type", "mpeg_dsmcc.un_sess.rsrc_descriptor_type",
2599
15
            FT_UINT16, BASE_HEX|BASE_RANGE_STRING,
2600
15
            RVALS(dsmcc_un_sess_rsrc_descriptor_type_vals), 0, NULL, HFILL
2601
15
        } },
2602
2603
15
        { &hf_dsmcc_un_sess_rsrc_number, {
2604
15
            "Resource Num", "mpeg_dsmcc.un_sess.rsrc_number",
2605
15
            FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL
2606
15
        } },
2607
2608
15
        { &hf_dsmcc_un_sess_rsrc_association_tag, {
2609
15
            "Association Tag", "mpeg_dsmcc.un_sess.rsrc_association_tag",
2610
15
            FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL
2611
15
        } },
2612
2613
15
        { &hf_dsmcc_un_sess_rsrc_flags, {
2614
15
            "Resource Flags", "mpeg_dsmcc.un_sess.rsrc_flags",
2615
15
            FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL
2616
15
        } },
2617
2618
15
        { &hf_dsmcc_un_sess_rsrc_status, {
2619
15
            "Resource Status", "mpeg_dsmcc.un_sess.rsrc_status",
2620
15
            FT_UINT8, BASE_HEX|BASE_RANGE_STRING,
2621
15
            RVALS(dsmcc_un_sess_rsrc_status_vals), 0, NULL, HFILL
2622
15
        } },
2623
2624
15
        { &hf_dsmcc_un_sess_rsrc_desc_data_fields_length, {
2625
15
            "Data Fields Length", "mpeg_dsmcc.un_sess.rsrc_desc_data_fields_length",
2626
15
            FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL
2627
15
        } },
2628
2629
15
        { &hf_dsmcc_un_sess_rsrc_data_field_count, {
2630
15
            "Data Field Count", "mpeg_dsmcc.un_sess.rsrc_data_field_count",
2631
15
            FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL
2632
15
        } },
2633
2634
15
        { &hf_dsmcc_un_sess_rsrc_type_owner_id, {
2635
15
            "Type Owner ID", "mpeg_dsmcc.un_sess.rsrc_type_owner_id",
2636
15
            FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL
2637
15
        } },
2638
2639
15
        { &hf_dsmcc_un_sess_rsrc_type_owner_value, {
2640
15
            "Type Owner Value", "mpeg_dsmcc.un_sess.rsrc_type_owner_value",
2641
15
            FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL
2642
15
        } },
2643
        /* table 4-63 U-N common descriptor header - end */
2644
2645
        /* table 4-64 U-N resource number assignor - start */
2646
15
        { &hf_dsmcc_un_sess_rsrc_flag_num_assignor, {
2647
15
            "Resource Num Assignor", "mpeg_dsmcc.un_sess.rsrc_flag_num_assignor",
2648
15
            FT_UINT16, BASE_DEC|BASE_RANGE_STRING,
2649
15
            RVALS(dsmcc_un_sess_rsrc_number_assignor_vals),
2650
15
            DMSCC_FLAG_RSRC_NUM_ASSIGNOR, NULL, HFILL
2651
15
        } },
2652
2653
15
        { &hf_dsmcc_un_sess_rsrc_flag_num_value, {
2654
15
            "Resource Num Value", "mpeg_dsmcc.un_sess.rsrc_flag_num_value",
2655
15
            FT_UINT16, BASE_DEC, NULL, DMSCC_FLAG_RSRC_NUM_VALUE, NULL, HFILL
2656
15
        } },
2657
        /* table 4-64 U-N resource number assignor - end */
2658
2659
        /* table 4-65 U-N resource association tag assignor - start */
2660
15
        { &hf_dsmcc_un_sess_rsrc_flag_association_tag_assignor, {
2661
15
            "Association Tag Assignor", "mpeg_dsmcc.un_sess.rsrc_flag_association_tag_assignor",
2662
15
            FT_UINT16, BASE_DEC|BASE_RANGE_STRING,
2663
15
            RVALS(dsmcc_un_sess_rsrc_association_tag_vals),
2664
15
            DMSCC_FLAG_RSRC_ASSOC_TAG_ASSIGNOR, NULL, HFILL
2665
15
        } },
2666
2667
15
        { &hf_dsmcc_un_sess_rsrc_flag_association_tag_value, {
2668
15
            "Association Tag Value", "mpeg_dsmcc.un_sess.rsrc_flag_association_tag_value",
2669
15
            FT_UINT16, BASE_DEC, NULL, DMSCC_FLAG_RSRC_ASSOC_TAG_VALUE, NULL, HFILL
2670
15
        } },
2671
        /* table 4-65 U-N resource association tag assignor - end */
2672
2673
        /* table 4-66 U-N resource allocator - start */
2674
15
       { &hf_dsmcc_un_sess_rsrc_flag_allocator, {
2675
15
            "Resource Allocator", "mpeg_dsmcc.un_sess.rsrc_flag_allocator",
2676
15
            FT_UINT8, BASE_DEC|BASE_RANGE_STRING,
2677
15
            RVALS(dsmcc_un_sess_rsrc_allocator_vals),
2678
15
            DMSCC_FLAG_RSRC_ALLOCATOR, NULL, HFILL
2679
15
        } },
2680
        /* table 4-66 U-N resource allocator - end */
2681
2682
        /* table 4-67 U-N resource attribute - start */
2683
15
       { &hf_dsmcc_un_sess_rsrc_flag_attribute, {
2684
15
            "Resource Attribute", "mpeg_dsmcc.un_sess.rsrc_flag_attribute",
2685
15
            FT_UINT8, BASE_DEC|BASE_RANGE_STRING,
2686
15
            RVALS(dsmcc_un_sess_rsrc_attribute_vals),
2687
15
            DMSCC_FLAG_RSRC_ATTRIBUTE, NULL, HFILL
2688
15
        } },
2689
        /* table 4-67 U-N resource attribute - end */
2690
2691
        /* table 4-68 U-N resource view - start */
2692
15
       { &hf_dsmcc_un_sess_rsrc_flag_view, {
2693
15
            "Resource View", "mpeg_dsmcc.un_sess.rsrc_flag_view",
2694
15
            FT_UINT8, BASE_DEC|BASE_RANGE_STRING,
2695
15
            RVALS(dsmcc_un_sess_rsrc_view_vals),
2696
15
            DMSCC_FLAG_RSRC_VIEW, NULL, HFILL
2697
15
        } },
2698
        /* table 4-68 U-N resource view - end */
2699
2700
        /* table 4-71 U-N dsmccResourceDescriptorValue() field format - start */
2701
15
        { &hf_dsmcc_un_sess_rsrc_value_type, {
2702
15
            "Value Type", "mpeg_dsmcc.un_sess.rsrc_value_type",
2703
15
            FT_UINT16, BASE_DEC|BASE_RANGE_STRING,
2704
15
            RVALS(dsmcc_un_sess_rsrc_value_types_vals), 0, NULL, HFILL
2705
15
        } },
2706
2707
15
        { &hf_dsmcc_un_sess_rsrc_value_count, {
2708
15
            "Value Count", "mpeg_dsmcc.un_sess.rsrc_value_count",
2709
15
            FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL
2710
15
        } },
2711
2712
15
        { &hf_dsmcc_un_sess_rsrc_value_data, {
2713
15
            "Value Data", "mpeg_dsmcc.un_sess.rsrc_value_data",
2714
15
            FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL
2715
15
        } },
2716
2717
15
        { &hf_dsmcc_un_sess_rsrc_most_desired, {
2718
15
            "Most Desired", "mpeg_dsmcc.un_sess.rsrc_most_desired",
2719
15
            FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL
2720
15
        } },
2721
2722
15
        { &hf_dsmcc_un_sess_rsrc_least_desired, {
2723
15
            "Least Desired", "mpeg_dsmcc.un_sess.rsrc_least_desired",
2724
15
            FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL
2725
15
        } },
2726
        /* table 4-71 U-N dsmccResourceDescriptorValue() field format - end */
2727
2728
        /* table 4-74 U-N Continuous Feed Session resource descriptor - start */
2729
15
        { &hf_dsmcc_un_sess_rsrc_cfs_num_count, {
2730
15
            "Resource Num Count", "mpeg_dsmcc.un_sess.rsrc_cfs_num_count",
2731
15
            FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL
2732
15
        } },
2733
2734
15
        { &hf_dsmcc_un_sess_rsrc_cfs_num, {
2735
15
            "Resource Number", "mpeg_dsmcc.un_sess.rsrc_cfs_num",
2736
15
            FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL
2737
15
        } },
2738
        /* table 4-74 U-N Continuous Feed Session resource descriptor - end  */
2739
2740
        /* table 4-75 U-N ATM Connection resource descriptor - start */
2741
15
        { &hf_dsmcc_un_sess_rsrc_atm_vpi, {
2742
15
            "ATM VPI", "mpeg_dsmcc.un_sess.rsrc_atm_vpi",
2743
15
            FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL
2744
15
        } },
2745
2746
15
        { &hf_dsmcc_un_sess_rsrc_atm_vci, {
2747
15
            "ATM VCI", "mpeg_dsmcc.un_sess.rsrc_atm_vci",
2748
15
            FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL
2749
15
        } },
2750
        /* table 4-75 U-N ATM Connection resource descriptor - end  */
2751
2752
        /* table 4-76 MPEG Program - start */
2753
15
        { &hf_dsmcc_un_sess_rsrc_mpeg_ca_pid, {
2754
15
            "MPEG CA PID", "mpeg_dsmcc.un_sess.rsrc_mpeg_ca_pid",
2755
15
            FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL
2756
15
        } },
2757
2758
15
        { &hf_dsmcc_un_sess_rsrc_mpeg_elem_stream_count, {
2759
15
            "Elementary Stream Count", "mpeg_dsmcc.un_sess.rsrc_mpeg_elem_stream_count",
2760
15
            FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL
2761
15
        } },
2762
2763
15
        { &hf_dsmcc_un_sess_rsrc_reserved, {
2764
15
            "Reserved", "mpeg_dsmcc.un_sess.rsrc_reserved",
2765
15
            FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL
2766
15
        } },
2767
        /* table 4-76 MPEG Program - end */
2768
2769
         /* table 4-77 Physical Channel - start */
2770
15
        { &hf_dsmcc_un_sess_rsrc_phys_chan_direction, {
2771
15
            "Channel Direction", "mpeg_dsmcc.un_sess.rsrc_phys_chan_direction",
2772
15
            FT_UINT16, BASE_HEX|BASE_RANGE_STRING,
2773
15
            RVALS(dsmcc_un_sess_rsrc_phys_chan_direction_vals), 0, NULL, HFILL
2774
15
        } },
2775
        /* table 4-77 Physical Channel - end */
2776
2777
        /* table 4-84 IP  - start */
2778
15
        { &hf_dsmcc_un_sess_rsrc_src_ip_addr, {
2779
15
            "Source IP Address", "mpeg_dsmcc.un_sess.rsrc_src_ip_addr",
2780
15
            FT_IPv4, BASE_NONE, NULL, 0, NULL, HFILL
2781
15
        } },
2782
2783
15
        { &hf_dsmcc_un_sess_rsrc_src_ip_port, {
2784
15
            "Source IP Port", "mpeg_dsmcc.un_sess.rsrc_src_ip_port",
2785
15
            FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL
2786
15
        } },
2787
2788
15
        { &hf_dsmcc_un_sess_rsrc_dst_ip_addr, {
2789
15
            "Destination IP Address", "mpeg_dsmcc.un_sess.rsrc_dst_ip_addr",
2790
15
            FT_IPv4, BASE_NONE, NULL, 0, NULL, HFILL
2791
15
        } },
2792
2793
15
        { &hf_dsmcc_un_sess_rsrc_dst_ip_port, {
2794
15
            "Destination IP Port", "mpeg_dsmcc.un_sess.rsrc_dst_ip_port",
2795
15
            FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL
2796
15
        } },
2797
2798
15
        { &hf_dsmcc_un_sess_rsrc_ip_protocol, {
2799
15
            "IP Protocol", "mpeg_dsmcc.un_sess.rsrc_ip_protocol",
2800
15
            FT_UINT16, BASE_HEX|BASE_RANGE_STRING,
2801
15
            RVALS(dsmcc_un_sess_rsrc_ip_protocol_types_vals), 0, NULL, HFILL
2802
15
        } },
2803
        /* table 4-84 IP  - end */
2804
2805
        /* table 4-86 PSTN Setup - start */
2806
15
        { &hf_dsmcc_un_sess_rsrc_pstn_calling_id, {
2807
15
            "Calling ID", "mpeg_dsmcc.un_sess.rsrc_pstn_calling_id",
2808
15
            FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL
2809
15
        } },
2810
2811
15
        { &hf_dsmcc_un_sess_rsrc_pstn_called_id, {
2812
15
            "Called ID", "mpeg_dsmcc.un_sess.rsrc_pstn_called_id",
2813
15
            FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL
2814
15
        } },
2815
        /* table 4-86 PSTN Setup - end */
2816
2817
        /* table 4-89 Q.922 Connection - start */
2818
15
        { &hf_dsmcc_un_sess_rsrc_dlci_count, {
2819
15
            "DL CI Count", "mpeg_dsmcc.un_sess.rsrc_dlci_count",
2820
15
            FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL
2821
15
        } },
2822
2823
15
        { &hf_dsmcc_un_sess_rsrc_dlci, {
2824
15
            "DL CI", "mpeg_dsmcc.un_sess.rsrc_dlci",
2825
15
            FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL
2826
15
        } },
2827
2828
15
        { &hf_dsmcc_un_sess_rsrc_dl_association_tag, {
2829
15
            "Association Tag", "mpeg_dsmcc.un_sess.rsrc_dl_association_tag",
2830
15
            FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL
2831
15
        } },
2832
        /* table 4-89 Q.922 Connection - end */
2833
2834
        /* table 4-90 Shared Resource - start */
2835
15
        { &hf_dsmcc_un_sess_rsrc_shared_resource_num, {
2836
15
            "Shared Resource Num", "mpeg_dsmcc.un_sess.rsrc_shared_resource_num",
2837
15
            FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL
2838
15
        } },
2839
        /* table 4-90 Shared Resource - end */
2840
2841
        /* table 4-91 Shared Request ID - start */
2842
15
        { &hf_dsmcc_un_sess_rsrc_shared_resource_request_id, {
2843
15
            "Shared Request ID", "mpeg_dsmcc.un_sess.rsrc_shared_resource_request_id",
2844
15
            FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL
2845
15
        } },
2846
        /* table 4-91 Shared Request ID - end */
2847
2848
        /* table 4-92 Headend List - start */
2849
15
        { &hf_dsmcc_un_sess_rsrc_headend_count, {
2850
15
            "Headend Count", "mpeg_dsmcc.un_sess.rsrc_headend_count",
2851
15
            FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL
2852
15
        } },
2853
2854
15
        { &hf_dsmcc_un_sess_rsrc_headend_code, {
2855
15
            "Headend Code", "mpeg_dsmcc.un_sess.rsrc_headend_code",
2856
15
            FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL
2857
15
        } },
2858
        /* table 4-92 Headend List - end */
2859
2860
        /* table 4-94 Continuous Feed - start */
2861
15
        { &hf_dsmcc_un_sess_rsrc_sdb_id, {
2862
15
            "SDB ID", "mpeg_dsmcc.un_sess.rsrc_sdb_id",
2863
15
            FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL
2864
15
        } },
2865
2866
15
        { &hf_dsmcc_un_sess_rsrc_sdb_program_count, {
2867
15
            "Program Count", "mpeg_dsmcc.un_sess.rsrc_sdb_program_count",
2868
15
            FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL
2869
15
        } },
2870
2871
15
        { &hf_dsmcc_un_sess_rsrc_sdb_association_tag, {
2872
15
            "Association Tag", "mpeg_dsmcc.un_sess.rsrc_sdb_association_tag",
2873
15
            FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL
2874
15
        } },
2875
2876
15
        { &hf_dsmcc_un_sess_rsrc_sdb_broadcast_program_id, {
2877
15
            "Broadcast Program ID", "mpeg_dsmcc.un_sess.rsrc_sdb_broadcast_program_id",
2878
15
            FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL
2879
15
        } },
2880
        /* table 4-94 Continuous Feed - end */
2881
2882
        /* table 4-95 SDB Associations - start */
2883
15
        { &hf_dsmcc_un_sess_rsrc_sdb_control_association_tag, {
2884
15
            "Control Association Tag", "mpeg_dsmcc.un_sess.rsrc_sdb_control_association_tag",
2885
15
            FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL
2886
15
        } },
2887
2888
15
        { &hf_dsmcc_un_sess_rsrc_sdb_program_association_tag, {
2889
15
            "Program Association Tag", "mpeg_dsmcc.un_sess.rsrc_sdb_program_association_tag",
2890
15
            FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL
2891
15
        } },
2892
        /* table 4-95 SDB Associations - end */
2893
2894
        /* table 4-96 SDB Entitlement - start */
2895
15
        { &hf_dsmcc_un_sess_rsrc_sdb_exclude_count, {
2896
15
            "Exclude Count", "mpeg_dsmcc.un_sess.rsrc_sdb_exclude_count",
2897
15
            FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL
2898
15
        } },
2899
2900
15
        { &hf_dsmcc_un_sess_rsrc_sdb_include_count, {
2901
15
            "Include Count", "mpeg_dsmcc.un_sess.rsrc_sdb_include_count",
2902
15
            FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL
2903
15
        } },
2904
        /* table 4-96 SDB Entitlement - end */
2905
2906
        /* User defined 0xf001-0xf007 - start */
2907
15
        { &hf_dsmcc_un_sess_rsrc_trans_system, {
2908
15
            "Transmission System", "mpeg_dsmcc.un_sess.rsrc_trans_system",
2909
15
            FT_UINT8, BASE_HEX|BASE_RANGE_STRING,
2910
15
            RVALS(dsmcc_un_sess_rsrc_transmission_system_vals), 0, NULL, HFILL
2911
15
        } },
2912
2913
15
        { &hf_dsmcc_un_sess_rsrc_inner_coding, {
2914
15
            "Inner Coding", "mpeg_dsmcc.un_sess.rsrc_inner_coding",
2915
15
            FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL
2916
15
        } },
2917
2918
15
        { &hf_dsmcc_un_sess_rsrc_split_bitstream, {
2919
15
            "Split Bitstream", "mpeg_dsmcc.un_sess.rsrc_split_bitstream",
2920
15
            FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL
2921
15
        } },
2922
2923
15
        { &hf_dsmcc_un_sess_rsrc_mod_format, {
2924
15
            "Modulation Format", "mpeg_dsmcc.un_sess.rsrc_mod_format",
2925
15
            FT_UINT8, BASE_HEX|BASE_RANGE_STRING,
2926
15
            RVALS(dsmcc_un_sess_rsrc_modulation_format_vals), 0, NULL, HFILL
2927
15
        } },
2928
2929
15
        { &hf_dsmcc_un_sess_rsrc_symbol_rate, {
2930
15
            "Symbol Rate", "mpeg_dsmcc.un_sess.rsrc_symbol_rate",
2931
15
            FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL
2932
15
        } },
2933
2934
15
        { &hf_dsmcc_un_sess_rsrc_interleave_depth, {
2935
15
            "Interleave Depth", "mpeg_dsmcc.un_sess.rsrc_interleave_depth",
2936
15
            FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL
2937
15
        } },
2938
2939
15
        { &hf_dsmcc_un_sess_rsrc_modulation_mode, {
2940
15
            "Modulation Mode", "mpeg_dsmcc.un_sess.rsrc_modulation_mode",
2941
15
            FT_UINT8, BASE_HEX|BASE_RANGE_STRING,
2942
15
            RVALS(dsmcc_un_sess_rsrc_mod_mode_vals), 0, NULL, HFILL
2943
15
        } },
2944
2945
15
        { &hf_dsmcc_un_sess_rsrc_fec, {
2946
15
            "Forward Error Correction", "mpeg_dsmcc.un_sess.rsrc_fec",
2947
15
            FT_UINT8, BASE_HEX|BASE_RANGE_STRING,
2948
15
            RVALS(dsmcc_un_sess_rsrc_fec_vals), 0, NULL, HFILL
2949
15
        } },
2950
2951
15
        { &hf_dsmcc_un_sess_rsrc_headend_flag, {
2952
15
            "Headend Flag", "mpeg_dsmcc.un_sess.rsrc_headend_flag",
2953
15
            FT_UINT16, BASE_DEC|BASE_RANGE_STRING,
2954
15
            RVALS(dsmcc_un_sess_rsrc_headend_flag_vals), 0, NULL, HFILL
2955
15
        } },
2956
2957
15
        { &hf_dsmcc_un_sess_rsrc_headend_tsid, {
2958
15
            "Headend TSID", "mpeg_dsmcc.un_sess.rsrc_headend_tsid",
2959
15
            FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL
2960
15
        } },
2961
2962
15
        { &hf_dsmcc_un_sess_rsrc_server_ca_copyprotect, {
2963
15
            "Copy Protect", "mpeg_dsmcc.un_sess.rsrc_server_ca_copyprotect",
2964
15
            FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL
2965
15
        } },
2966
2967
15
        { &hf_dsmcc_un_sess_rsrc_server_ca_usercount, {
2968
15
            "User Count", "mpeg_dsmcc.un_sess.rsrc_server_ca_usercount",
2969
15
            FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL
2970
15
        } },
2971
2972
15
        { &hf_dsmcc_un_sess_rsrc_client_ca_info_length, {
2973
15
            "CA Info Length", "mpeg_dsmcc.un_sess.rsrc_client_ca_info_length",
2974
15
            FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL
2975
15
        } },
2976
2977
15
        { &hf_dsmcc_un_sess_rsrc_client_ca_info_data, {
2978
15
            "CA Info Data", "mpeg_dsmcc.un_sess.rsrc_client_ca_info_data",
2979
15
            FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL
2980
15
        } },
2981
2982
15
        { &hf_dsmcc_un_sess_rsrc_service_group, {
2983
15
            "Service Group", "mpeg_dsmcc.un_sess.rsrc_service_group",
2984
15
            FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL
2985
15
        } },
2986
        /* User defined 0xf001-0xf007 - end */
2987
2988
        /* table 6-1 compatibilityDescriptor - start */
2989
15
        { &hf_compat_desc_length, {
2990
15
            "Compatibility Descriptor Length", "mpeg_dsmcc.dii.compat_desc_len",
2991
15
            FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL
2992
15
        } },
2993
2994
15
        { &hf_compat_desc_count, {
2995
15
            "Descriptor Length", "mpeg_dsmcc.dii.compat_desc_count",
2996
15
            FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL
2997
15
        } },
2998
2999
15
        { &hf_desc_type, {
3000
15
            "Descriptor Type", "mpeg_dsmcc.dii.compat.type",
3001
15
            FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL
3002
15
        } },
3003
3004
15
        { &hf_desc_length, {
3005
15
            "Descriptor Length", "mpeg_dsmcc.dii.compat.length",
3006
15
            FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL
3007
15
        } },
3008
3009
15
        { &hf_desc_spec_type, {
3010
15
            "Specifier Type", "mpeg_dsmcc.dii.compat.spec_type",
3011
15
            FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL
3012
15
        } },
3013
3014
15
        { &hf_desc_spec_data, {
3015
15
            "Specifier Data", "mpeg_dsmcc.dii.compat.spec_data",
3016
15
            FT_UINT24, BASE_HEX, NULL, 0, NULL, HFILL
3017
15
        } },
3018
3019
15
        { &hf_desc_model, {
3020
15
            "Model", "mpeg_dsmcc.dii.compat.model",
3021
15
            FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL
3022
15
        } },
3023
3024
15
        { &hf_desc_version, {
3025
15
            "Version", "mpeg_dsmcc.dii.compat.version",
3026
15
            FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL
3027
15
        } },
3028
3029
15
        { &hf_desc_sub_desc_count, {
3030
15
            "Version", "mpeg_dsmcc.dii.compat.sub_count",
3031
15
            FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL
3032
15
        } },
3033
3034
15
        { &hf_desc_sub_desc_type, {
3035
15
            "Type", "mpeg_dsmcc.dii.compat.sub_type",
3036
15
            FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL
3037
15
        } },
3038
3039
15
        { &hf_desc_sub_desc_len, {
3040
15
            "Length", "mpeg_dsmcc.dii.compat.sub_len",
3041
15
            FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL
3042
15
        } },
3043
        /* table 6-1 compatibilityDescriptor - end */
3044
3045
        /* table 7-3 dsmccDownloadDataHeader - start */
3046
15
        { &hf_dsmcc_dd_download_id, {
3047
15
            "Download ID", "mpeg_dsmcc.download_id",
3048
15
            FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL
3049
15
        } },
3050
3051
15
        { &hf_dsmcc_dd_message_id, {
3052
15
            "Message ID", "mpeg_dsmcc.message_id",
3053
15
            FT_UINT16, BASE_HEX,
3054
15
            VALS(dsmcc_dd_message_id_vals), 0, NULL, HFILL
3055
15
        } },
3056
        /* table 7-3 dsmccDownloadDataHeader - end */
3057
3058
        /* table 7-6 downloadInfoIndication - start */
3059
15
        { &hf_dsmcc_dii_download_id, {
3060
15
            "Download ID", "mpeg_dsmcc.dii.download_id",
3061
15
            FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL
3062
15
        } },
3063
3064
15
        { &hf_dsmcc_dii_block_size, {
3065
15
            "Block Size", "mpeg_dsmcc.dii.block_size",
3066
15
            FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL
3067
15
        } },
3068
3069
15
        { &hf_dsmcc_dii_window_size, {
3070
15
            "Window Size", "mpeg_dsmcc.dii.window_size",
3071
15
            FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL
3072
15
        } },
3073
3074
15
        { &hf_dsmcc_dii_ack_period, {
3075
15
            "ACK Period", "mpeg_dsmcc.dii.ack_period",
3076
15
            FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL
3077
15
        } },
3078
3079
15
        { &hf_dsmcc_dii_t_c_download_window, {
3080
15
            "Carousel Download Window", "mpeg_dsmcc.dii.carousel_download_window",
3081
15
            FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL
3082
15
        } },
3083
3084
15
        { &hf_dsmcc_dii_t_c_download_scenario, {
3085
15
            "Carousel Download Scenario", "mpeg_dsmcc.dii.carousel_download_scenario",
3086
15
            FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL
3087
15
        } },
3088
3089
15
        { &hf_dsmcc_dii_number_of_modules, {
3090
15
            "Number of Modules", "mpeg_dsmcc.dii.module_count",
3091
15
            FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL
3092
15
        } },
3093
3094
15
        { &hf_dsmcc_dii_module_id, {
3095
15
            "Module ID", "mpeg_dsmcc.dii.module_id",
3096
15
            FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL
3097
15
        } },
3098
3099
15
        { &hf_dsmcc_dii_module_size, {
3100
15
            "Module Size", "mpeg_dsmcc.dii.module_size",
3101
15
            FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL
3102
15
        } },
3103
3104
15
        { &hf_dsmcc_dii_module_version, {
3105
15
            "Module Version", "mpeg_dsmcc.dii.module_version",
3106
15
            FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL
3107
15
        } },
3108
3109
15
        { &hf_dsmcc_dii_module_info_length, {
3110
15
            "Module Info Length", "mpeg_dsmcc.dii.module_info_length",
3111
15
            FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL
3112
15
        } },
3113
3114
15
        { &hf_dsmcc_dii_private_data_length, {
3115
15
            "Private Data Length", "mpeg_dsmcc.dii.private_data_length",
3116
15
            FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL
3117
15
        } },
3118
        /* table 7-6 downloadInfoIndication - end */
3119
3120
        /* table 7-7 dsmccDownloadDataBlock - start */
3121
15
        { &hf_dsmcc_ddb_module_id, {
3122
15
            "Module ID", "mpeg_dsmcc.ddb.module_id",
3123
15
            FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL
3124
15
        } },
3125
3126
15
        { &hf_dsmcc_ddb_version, {
3127
15
            "Version", "mpeg_dsmcc.ddb.version",
3128
15
            FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL
3129
15
        } },
3130
3131
15
        { &hf_dsmcc_ddb_reserved, {
3132
15
            "Reserved", "mpeg_dsmcc.ddb.reserved",
3133
15
            FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL
3134
15
        } },
3135
3136
15
        { &hf_dsmcc_ddb_block_number, {
3137
15
            "Block Number", "mpeg_dsmcc.ddb.block_num",
3138
15
            FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL
3139
15
        } },
3140
        /* table 7-7 dsmccDownloadDataBlock - end */
3141
3142
        /* table 9-2 - start */
3143
15
        { &hf_dsmcc_table_id, {
3144
15
            "Table ID", "mpeg_sect.table_id",
3145
15
            FT_UINT8, BASE_HEX, VALS(dsmcc_payload_name_vals), 0, NULL, HFILL
3146
15
        } },
3147
3148
15
        { &hf_dsmcc_section_syntax_indicator, {
3149
15
            "Session Syntax Indicator", "mpeg_sect.ssi",
3150
15
            FT_UINT16, BASE_DEC, NULL, DSMCC_SSI_MASK, NULL, HFILL
3151
15
        } },
3152
3153
15
        { &hf_dsmcc_private_indicator, {
3154
15
            "Private Indicator", "mpeg_dsmcc.private_indicator",
3155
15
            FT_UINT16, BASE_DEC, NULL, DSMCC_PRIVATE_MASK, NULL, HFILL
3156
15
        } },
3157
3158
15
        { &hf_dsmcc_reserved, {
3159
15
            "Reserved", "mpeg_sect.reserved",
3160
15
            FT_UINT16, BASE_HEX, NULL, DSMCC_RESERVED_MASK, NULL, HFILL
3161
15
        } },
3162
3163
15
        { &hf_dsmcc_section_length, {
3164
15
            "Length", "mpeg_sect.section_length",
3165
15
            FT_UINT16, BASE_DEC, NULL, DSMCC_LENGTH_MASK, NULL, HFILL
3166
15
        } },
3167
3168
15
        { &hf_dsmcc_table_id_extension, {
3169
15
            "Table ID Extension", "mpeg_dsmcc.table_id_extension",
3170
15
            FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL
3171
15
        } },
3172
3173
15
        { &hf_dsmcc_reserved2, {
3174
15
            "Reserved", "mpeg_dsmcc.reserved2",
3175
15
            FT_UINT8, BASE_HEX, NULL, DSMCC_RESERVED2_MASK, NULL, HFILL
3176
15
        } },
3177
3178
15
        { &hf_dsmcc_version_number, {
3179
15
            "Version Number", "mpeg_dsmcc.version_number",
3180
15
            FT_UINT8, BASE_DEC, NULL, DSMCC_VERSION_NUMBER_MASK, NULL, HFILL
3181
15
        } },
3182
3183
15
        { &hf_dsmcc_current_next_indicator, {
3184
15
            "Current Next Indicator", "mpeg_dsmcc.current_next_indicator",
3185
15
            FT_UINT8, BASE_DEC, NULL, DSMCC_CURRENT_NEXT_INDICATOR_MASK, NULL, HFILL
3186
15
        } },
3187
3188
15
        { &hf_dsmcc_section_number, {
3189
15
            "Section Number", "mpeg_dsmcc.section_number",
3190
15
            FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL
3191
15
        } },
3192
3193
15
        { &hf_dsmcc_last_section_number, {
3194
15
            "Last Section Number", "mpeg_dsmcc.last_section_number",
3195
15
            FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL
3196
15
        } },
3197
3198
15
        { &hf_dsmcc_crc, {
3199
15
            "CRC 32", "mpeg_sect.crc",
3200
15
            FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL
3201
15
        } },
3202
3203
15
        { &hf_dsmcc_checksum, {
3204
15
            "Checksum", "mpeg_dsmcc.checksum",
3205
15
            FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL
3206
15
        } },
3207
        /* table 9-2 - end */
3208
3209
        /* table J.3 NSAP - start */
3210
15
        { &hf_dsmcc_un_sess_nsap_afi, {
3211
15
            "Authority and Format Identifier (AFI)", "mpeg_dsmcc.un_sess.dsmcc_nsap_afi",
3212
15
            FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL
3213
15
        } },
3214
3215
15
        { &hf_dsmcc_un_sess_nsap_idi, {
3216
15
            "Initial Domain Identifier (IDI)", "mpeg_dsmcc.un_sess.dsmcc_nsap_idi",
3217
15
            FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL
3218
15
        } },
3219
3220
15
        { &hf_dsmcc_un_sess_nsap_ho_dsp, {
3221
15
            "High Order DSP (HO-DSP)", "mpeg_dsmcc.un_sess.dsmcc_nsap_ho_dsp",
3222
15
            FT_IPv4, BASE_NONE, NULL, 0, NULL, HFILL
3223
15
        } },
3224
3225
15
        { &hf_dsmcc_un_sess_nsap_esi, {
3226
15
            "End System Identifier (ESI)", "mpeg_dsmcc.un_sess.dsmcc_nsap_esi",
3227
15
            FT_ETHER, BASE_NONE, NULL, 0, NULL, HFILL
3228
15
        } },
3229
3230
15
        { &hf_dsmcc_un_sess_nsap_sel, {
3231
15
            "Selector (SEL)", "mpeg_dsmcc.un_sess.dsmcc_nsap_sel",
3232
15
            FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL
3233
15
        } },
3234
        /* table J.3 NSAP - end */
3235
3236
15
        { &hf_etv_module_abs_path, {
3237
15
            "Module Absolute Path", "etv.dsmcc.dii.module_abs_path",
3238
15
            FT_UINT_STRING, BASE_NONE, NULL, 0, NULL, HFILL
3239
15
        } },
3240
3241
15
        { &hf_etv_dii_authority, {
3242
15
            "Authority", "etv.dsmcc.dii.authority",
3243
15
            FT_UINT_STRING, BASE_NONE, NULL, 0, NULL, HFILL
3244
15
        } }
3245
        /* table J.3 NSAP - end */
3246
15
    };
3247
3248
15
    static int *ett[] = {
3249
15
        &ett_dsmcc,
3250
15
        &ett_dsmcc_payload,
3251
15
        &ett_dsmcc_adaptation_header,
3252
15
        &ett_dsmcc_header,
3253
15
        &ett_dsmcc_message_id,
3254
15
        &ett_dsmcc_transaction_id,
3255
15
        &ett_dsmcc_heading,
3256
15
        &ett_dsmcc_rsrc_number,
3257
15
        &ett_dsmcc_rsrc_association_tag,
3258
15
        &ett_dsmcc_rsrc_flags,
3259
15
        &ett_dsmcc_compat,
3260
15
        &ett_dsmcc_compat_sub_desc,
3261
15
        &ett_dsmcc_dii_module
3262
15
    };
3263
15
    static ei_register_info ei[] = {
3264
15
        { &ei_dsmcc_invalid_value, { "mpeg_dsmcc.invalid_value", PI_PROTOCOL, PI_WARN,
3265
15
                    "Invalid value", EXPFILL }},
3266
15
        { &ei_dsmcc_crc_invalid, { "mpeg_dsmcc.crc.invalid", PI_CHECKSUM, PI_WARN,
3267
15
                    "Invalid CRC", EXPFILL }},
3268
15
    };
3269
3270
15
    module_t *dsmcc_module;
3271
15
    expert_module_t* expert_dsmcc;
3272
3273
15
    proto_dsmcc = proto_register_protocol("MPEG DSM-CC", "MPEG DSM-CC", "mpeg_dsmcc");
3274
3275
15
    proto_register_field_array(proto_dsmcc, hf, array_length(hf));
3276
15
    proto_register_subtree_array(ett, array_length(ett));
3277
15
    expert_dsmcc = expert_register_protocol(proto_dsmcc);
3278
15
    expert_register_field_array(expert_dsmcc, ei, array_length(ei));
3279
15
    dsmcc_ts_handle = register_dissector("mp2t-dsmcc", dissect_dsmcc_ts, proto_dsmcc);
3280
15
    dsmcc_tcp_handle = register_dissector("mp2t-dsmcc-tcp", dissect_dsmcc_tcp, proto_dsmcc);
3281
15
    dsmcc_udp_handle = register_dissector("mp2t-dsmcc-udp", dissect_dsmcc_udp, proto_dsmcc);
3282
3283
15
    dsmcc_module = prefs_register_protocol(proto_dsmcc, NULL);
3284
3285
15
    prefs_register_bool_preference(dsmcc_module, "verify_crc",
3286
15
        "Verify the section CRC or checksum",
3287
15
        "Whether the section dissector should verify the CRC or checksum",
3288
15
        &dsmcc_sect_check_crc);
3289
15
}
3290
3291
3292
void
3293
proto_reg_handoff_dsmcc(void)
3294
15
{
3295
15
    dissector_add_uint("mpeg_sect.tid", DSMCC_TID_LLCSNAP, dsmcc_ts_handle);
3296
15
    dissector_add_uint("mpeg_sect.tid", DSMCC_TID_UN_MSG, dsmcc_ts_handle);
3297
15
    dissector_add_uint("mpeg_sect.tid", DSMCC_TID_DD_MSG, dsmcc_ts_handle);
3298
15
    dissector_add_uint("mpeg_sect.tid", DSMCC_TID_DESC_LIST, dsmcc_ts_handle);
3299
    /* TID 0x3E is used for both DSMCC_TID_PRIVATE and DVB_DATA_MPE_TID.
3300
     * MPE (ETSI EN 301 192) is conformant to the DSSMCC section format
3301
     * for private data, and is by far the most common implementation,
3302
     * so default register it to the table entry. If someone wants this
3303
     * generic DSM-CC dissector to handle it, they can use Decode As.
3304
     *
3305
     * dissector_add_uint("mpeg_sect.tid", DSMCC_TID_PRIVATE, dsmcc_ts_handle);
3306
     */
3307
3308
15
    dissector_add_uint_with_preference("tcp.port", DSMCC_TCP_PORT, dsmcc_tcp_handle);
3309
15
    dissector_add_uint_with_preference("udp.port", DSMCC_UDP_PORT, dsmcc_udp_handle);
3310
15
}
3311
3312
/*
3313
 * Editor modelines  -  https://www.wireshark.org/tools/modelines.html
3314
 *
3315
 * Local variables:
3316
 * c-basic-offset: 4
3317
 * tab-width: 8
3318
 * indent-tabs-mode: nil
3319
 * End:
3320
 *
3321
 * vi: set shiftwidth=4 tabstop=8 expandtab:
3322
 * :indentSize=4:tabSize=8:noTabs=true:
3323
 */