2 * Routines for DVB-CI (Common Interface) dissection
3 * Copyright 2011-2015, Martin Kaiser <martin@kaiser.cx>
5 * Wireshark - Network traffic analyzer
6 * By Gerald Combs <gerald@wireshark.org>
7 * Copyright 1998 Gerald Combs
9 * SPDX-License-Identifier: GPL-2.0-or-later
12 /* This dissector supports DVB-CI as defined in EN50221 and
13 * CI+ (www.ci-plus.com).
14 * For more details, see https://gitlab.com/wireshark/wireshark/-/wikis/DVB-CI.
16 * The pcap input format for this dissector is documented at
17 * http://www.kaiser.cx/pcap-dvbci.html.
22 #include <epan/packet.h>
23 #include <epan/addr_resolv.h>
24 #include <epan/conversation.h>
25 #include <epan/dvb_chartbl.h>
26 #include <epan/exported_pdu.h>
27 #include <epan/reassemble.h>
28 #include <epan/prefs.h>
30 #include <epan/expert.h>
31 #include <epan/asn1.h>
33 #include "packet-dvbci.h"
34 #include "packet-mpeg-descriptor.h"
35 #include "packet-mpeg-sect.h"
36 #include "packet-x509af.h"
37 #include "packet-x509ce.h"
38 #include "packet-ber.h"
39 #include <wsutil/wsgcrypt.h>
40 #include <wsutil/pint.h>
42 void proto_register_dvbci(void);
43 void proto_reg_handoff_dvbci(void);
45 #define AES_BLOCK_LEN 16
46 #define AES_KEY_LEN 16
48 #define EXPORTED_SAC_MSG_PROTO "ciplus_sac_msg"
49 #define EXPORTED_SAC_MSG_DESCRIPTION "CI+ SAC message"
51 #define IS_DATA_TRANSFER(e) (e==DVBCI_EVT_DATA_CAM_TO_HOST || e==DVBCI_EVT_DATA_HOST_TO_CAM)
53 /* direction of data transfer in [as]pdu_info_t and elsewhere */
54 #define DATA_CAM_TO_HOST DVBCI_EVT_DATA_CAM_TO_HOST
55 #define DATA_HOST_TO_CAM DVBCI_EVT_DATA_HOST_TO_CAM
56 #define DIRECTION_ANY 0x0
58 /* source/destination address field */
59 #define ADDR_HOST "Host"
60 #define ADDR_CAM "CAM"
66 #define POWER_OFF 0x04
68 #define TS_BYPASS 0x06
74 /* Card Information Structure (CIS) */
77 #define CISTPL_NO_LINK 0x14
78 #define CISTPL_VERS_1 0x15
79 #define CISTPL_CONFIG 0x1A
80 #define CISTPL_CFTABLE_ENTRY 0x1B
81 #define CISTPL_DEVICE_OC 0x1C
82 #define CISTPL_DEVICE_OA 0x1D
83 #define CISTPL_MANFID 0x20
84 #define CISTPL_END 0xFF
86 #define CCSTPL_CIF 0xC0
88 #define TPCE_IF_TYPE_MEM 0
89 #define TPCE_IF_TYPE_IO_MEM 1
90 #define TPCE_IF_TYPE_CUST0 4
91 #define TPCE_IF_TYPE_CUST1 5
92 #define TPCE_IF_TYPE_CUST2 6
93 #define TPCE_IF_TYPE_CUST3 7
94 /* "voltage used" field in the device tuples */
95 #define CIS_DEV_VCC50 0
96 #define CIS_DEV_VCC33 1
102 /* base values of sequence ids for reassembly of fragmented tpdus
103 if there's two open transport connections, their tpdu fragments may be
104 interleaved, we must add the tcid to the base value in order to
105 distinguish between different transport connections
106 TPDU_SEQ_ID_BASE and SPDU_SEQ_ID_BASE can be arbitrary 32bit values, they
107 must be more than 256 apart since we add the 8bit tcid */
108 #define TPDU_SEQ_ID_BASE 123
109 /* same as above, the spdu fragments are also demultiplexed based on the
111 #define SPDU_SEQ_ID_BASE 2417
113 /* transport layer */
117 #define T_CREATE_T_C 0x82
118 #define T_C_T_C_REPLY 0x83
119 #define T_DELETE_T_C 0x84
120 #define T_D_T_C_REPLY 0x85
121 #define T_REQUEST_T_C 0x86
122 #define T_NEW_T_C 0x87
123 #define T_T_C_ERROR 0x88
124 #define T_DATA_LAST 0xA0
125 #define T_DATA_MORE 0xA1
127 #define SB_VAL_MSG_AVAILABLE 0x80
128 #define SB_VAL_NO_MSG_AVAILABLE 0x00
131 #define T_SESSION_NUMBER 0x90
132 #define T_OPEN_SESSION_REQUEST 0x91
133 #define T_OPEN_SESSION_RESPONSE 0x92
134 #define T_CREATE_SESSION 0x93
135 #define T_CREATE_SESSION_RESPONSE 0x94
136 #define T_CLOSE_SESSION_REQUEST 0x95
137 #define T_CLOSE_SESSION_RESPONSE 0x96
139 /* status for open/create session */
140 #define SESS_OPENED 0x00
141 #define SESS_NOT_OPENED_RES_NON_EXIST 0xF0
142 #define SESS_NOT_OPENED_RES_UNAVAIL 0xF1
143 #define SESS_NOT_OPENED_RES_VER_LOWER 0xF2
144 #define SESS_NOT_OPENED_RES_BUSY 0xF3
146 /* status for close session */
147 #define SESS_CLOSED 0x00
148 #define SESS_NB_NOT_ALLOC 0xF0
150 /* circuit id from session number (16bit) and transport connection id * (8bit) */
151 #define CT_ID(s,t) ((uint32_t)(s<<8|t))
154 #define RES_ID_TYPE_MASK 0xC0000000
155 #define RES_CLASS_MASK 0x3FFF0000
156 #define RES_TYPE_MASK 0x0000FFC0
157 #define RES_VER_MASK 0x0000003F
160 #define RES_CLASS_RM 0x01
161 #define RES_CLASS_AP 0x02
162 #define RES_CLASS_CA 0x03
163 #define RES_CLASS_AUT 0x10
164 #define RES_CLASS_HC 0x20
165 #define RES_CLASS_DT 0x24
166 #define RES_CLASS_MMI 0x40
167 #define RES_CLASS_AMI 0x41
168 #define RES_CLASS_LSC 0x60
169 #define RES_CLASS_CC 0x8C
170 #define RES_CLASS_HLC 0x8D
171 #define RES_CLASS_CUP 0x8E
172 #define RES_CLASS_OPP 0x8F
173 #define RES_CLASS_AFS 0x91
174 #define RES_CLASS_SAS 0x96
176 #define RES_ID_LEN 4 /* bytes */
177 #define RES_CLASS(_res_id) (_res_id & RES_CLASS_MASK) >> 16
178 #define RES_VER(_res_id) (_res_id & RES_VER_MASK)
180 /* appinfo resource */
181 #define APP_TYPE_CA 0x1
182 #define APP_TYPE_EPG 0x2
184 #define DATA_RATE_72 0x0
185 #define DATA_RATE_96 0x1
188 #define LIST_MGMT_MORE 0x0
189 #define LIST_MGMT_FIRST 0x1
190 #define LIST_MGMT_LAST 0x2
191 #define LIST_MGMT_ONLY 0x3
192 #define LIST_MGMT_ADD 0x4
193 #define LIST_MGMT_UPDATE 0x5
195 #define CMD_ID_OK_DESCR 0x1
196 #define CMD_ID_OK_MMI 0x2
197 #define CMD_ID_QUERY 0x3
198 #define CMD_ID_NOT_SELECTED 0x4
200 #define CA_DESC_TAG 0x9
202 #define CA_ENAB_DESC_OK 0x01
203 #define CA_ENAB_DESC_OK_PURCHASE 0x02
204 #define CA_ENAB_DESC_OK_TECH 0x03
205 #define CA_ENAB_DESC_NG_ENTITLEMENT 0x71
206 #define CA_ENAB_DESC_NG_TECH 0x73
208 /* host control resource */
209 #define HC_STAT_OK 0x0
210 #define HC_STAT_ERR_DLVRY 0x1
211 #define HC_STAT_ERR_LOCK 0x2
212 #define HC_STAT_ERR_BUSY 0x3
213 #define HC_STAT_ERR_PARAM 0x4
214 #define HC_STAT_ERR_NOT_FOUND 0x5
215 #define HC_STAT_ERR_UNKNOWN 0x6
217 #define HC_RELEASE_OK 0x0
218 #define HC_RELEASE_REFUSED 0x1
221 #define CLOSE_MMI_CMD_ID_IMMEDIATE 0x0
222 #define CLOSE_MMI_CMD_ID_DELAY 0x1
224 /* only commands and parameters for high-level mmi are supported */
225 #define DISP_CMD_SET_MMI_MODE 1
226 #define DISP_CMD_GET_DISP_TBL 2
227 #define DISP_CMD_GET_INP_TBL 3
229 #define MMI_MODE_HIGH 1
231 #define DISP_REP_ID_MMI_MODE_ACK 0x01
232 #define DISP_REP_ID_DISP_CHAR_TBL 0x02
233 #define DISP_REP_ID_INP_CHAR_TBL 0x03
234 #define DISP_REP_ID_UNKNOWN_CMD 0xF0
235 #define DISP_REP_ID_UNKNOWN_MMI_MODE 0xF1
236 #define DISP_REP_ID_UNKNOWN_CHAR_TBL 0xF2
238 #define VISIBLE_ANS 0
241 #define ANSW_ID_CANCEL 0x00
242 #define ANSW_ID_ANSWER 0x01
244 /* used for answer_text_length, choice_nb and item_nb */
245 #define NB_UNKNOWN 0xFF
247 /* cam upgrade resource */
248 #define CUP_DELAYED 0x0
249 #define CUP_IMMEDIATE 0x1
251 #define CUP_ANS_NO 0x0
252 #define CUP_ANS_YES 0x1
253 #define CUP_ANS_ASK 0x2
255 #define CUP_RESET_PCMCIA 0x0
256 #define CUP_RESET_CMDIF 0x1
257 #define CUP_RESET_NONE 0x2
259 /* content control resource */
260 #define CC_ID_HOST_ID 0x05
261 #define CC_ID_CICAM_ID 0x06
262 #define CC_ID_HOST_BRAND_CERT 0x07
263 #define CC_ID_CICAM_BRAND_CERT 0x08
264 #define CC_ID_KP 0x0C
265 #define CC_ID_DHPH 0x0D
266 #define CC_ID_DHPM 0x0E
267 #define CC_ID_HOST_DEV_CERT 0x0F
268 #define CC_ID_CICAM_DEV_CERT 0x10
269 #define CC_ID_SIG_A 0x11
270 #define CC_ID_SIG_B 0x12
271 #define CC_ID_AUTH_NONCE 0x13
272 #define CC_ID_NS_HOST 0x14
273 #define CC_ID_NS_MODULE 0x15
274 #define CC_ID_AKH 0x16
275 #define CC_ID_URI 0x19
276 #define CC_ID_PROG_NUM 0x1A
277 #define CC_ID_URI_CNF 0x1B
278 #define CC_ID_KEY_REGISTER 0x1C
279 #define CC_ID_URI_VERSIONS 0x1D
280 #define CC_ID_STATUS_FIELD 0x1E
281 #define CC_ID_SRM_DATA 0x1F
282 #define CC_ID_SRM_CONFIRM 0x20
283 #define CC_ID_CICAM_LICENSE 0x21
284 #define CC_ID_LICENSE_STATUS 0x22
285 #define CC_ID_LICENSE_RCV_STATUS 0x23
286 #define CC_ID_HOST_LICENSE 0x24
287 #define CC_ID_PLAY_COUNT 0x25
288 #define CC_ID_OPERATING_MODE 0x26
289 #define CC_ID_PINCODE_DATA 0x27
290 #define CC_ID_REC_START_STATUS 0x28
291 #define CC_ID_MODE_CHG_STATUS 0x29
292 #define CC_ID_REC_STOP_STATUS 0x2A
294 #define CC_EMI_FREE 0x00
295 #define CC_EMI_NO_MORE 0x01
296 #define CC_EMI_ONCE 0x02
297 #define CC_EMI_NEVER 0x03
299 #define CC_KEY_EVEN 0x0
300 #define CC_KEY_ODD 0x1
302 #define CC_STATUS_OK 0x0
303 #define CC_STATUS_NO_CC_SUPPORT 0x1
304 #define CC_STATUS_HOST_BUSY 0x2
305 #define CC_STATUS_AUTH_FAILED_OR_NO_SRM 0x3
306 #define CC_STATUS_CICAM_BUSY 0x4
307 #define CC_STATUS_REC_MODE_ERR 0x5
309 #define SAC_MSG_HDR_LEN 8
311 #define CC_SAC_AUTH_AES128_XCBC_MAC 0x0
312 #define CC_SAC_ENC_AES128_CBC 0x0
314 #define CC_CAP_NONE 0x0
315 #define CC_CAP_CAS_PIN 0x1
316 #define CC_CAP_CAS_FTA_PIN 0x2
317 #define CC_CAP_CAS_PIN_CACHED 0x3
318 #define CC_CAP_CAS_FTA_PIN_CACHED 0x4
320 /* length of DVB-SI utc time field in bytes */
321 #define UTC_TIME_LEN 5
323 #define CC_PIN_BAD 0x0
324 #define CC_PIN_CAM_BUSY 0x1
325 #define CC_PIN_OK 0x2
326 #define CC_PIN_UNCONFIRMED 0x3
327 #define CC_PIN_VB_NOT_REQ 0x4
328 #define CC_PIN_CSA 0x5
330 #define CC_OP_MODE_WATCH_BUFFER 0x0
331 #define CC_OP_MODE_TIMESHIFT 0x1
332 #define CC_OP_MODE_UNATTENDED 0x2
334 /* application mmi resource */
335 #define ACK_CODE_OK 0x1
336 #define ACK_CODE_WRONG_API 0x2
337 #define ACK_CODE_API_BUSY 0x3
339 #define REQ_TYPE_FILE 0x0
340 #define REQ_TYPE_DATA 0x1
341 #define REQ_TYPE_FILE_HASH 0x2
342 #define REQ_TYPE_REQ 0x3
345 #define COMMS_CMD_ID_CONNECT_ON_CHANNEL 1
346 #define COMMS_CMD_ID_DISCONNECT_ON_CHANNEL 2
347 #define COMMS_CMD_ID_SET_PARAMS 3
348 #define COMMS_CMD_ID_ENQUIRE_STATUS 4
349 #define COMMS_CMD_ID_GET_NEXT_BUFFER 5
351 #define CONN_DESC_TEL 1
352 #define CONN_DESC_CABLE 2
353 #define CONN_DESC_IP 3
354 #define CONN_DESC_HOSTNAME 4
356 #define LSC_DESC_IP 0xCF
357 #define LSC_DESC_HOSTNAME 0xCD
365 #define COMMS_REP_ID_CONNECT_ACK 1
366 #define COMMS_REP_ID_DISCONNECT_ACK 2
367 #define COMMS_REP_ID_SET_PARAMS_ACK 3
368 #define COMMS_REP_ID_STATUS_REPLY 4
369 #define COMMS_REP_ID_GET_NEXT_BUFFER_ACK 5
370 #define COMMS_REP_ID_SEND_ACK 6
373 #define LSC_DISCONNECTED 0
374 #define LSC_CONNECTED 1
375 #define LSC_RET_TOO_BIG 0xFE
377 /* auxiliary file system resource */
378 #define AFS_ACK_RSV 0
380 #define AFS_ACK_UNKNOWN 2
382 /* operator profile resource */
383 #define TABLE_ID_CICAM_NIT 0x40 /* CICAM NIT must be a NIT actual */
385 #define OPP_REF_REG_FLG_NONE 0
386 #define OPP_REF_REG_FLG_ADV 1
387 #define OPP_REF_REG_FLG_URG 2
388 #define OPP_REF_REG_FLG_SCHED 3
390 #define OPP_ERR_FLG_OK 0
391 #define OPP_ERR_FLG_PROF 1
392 #define OPP_ERR_FLG_UNSUPPORTED 2
393 #define OPP_ERR_FLG_CANCELLED 3
395 /* EIT p/f, EIT schedule usage */
396 #define OPP_EIT_ABSENT 0
397 #define OPP_EIT_NOT_X 1
398 #define OPP_EIT_FULL_X 2
399 #define OPP_EIT_BARKER 3
400 #define OPP_EPG_APP 4
402 #define OPP_EXT_EVT_DIFF 0
403 #define OPP_EXT_EVT_ADD 1
405 /* these values match the delivery system descriptor tags */
406 #define OPP_DLV_CAP_S 0x43
407 #define OPP_DLV_CAP_C 0x44
408 #define OPP_DLV_CAP_T 0x5A
409 #define OPP_DLV_CAP_S2 0x79
411 #define OPP_TUNE_OK 0
412 #define OPP_TUNE_UNSUPPORTED 1
413 #define OPP_TUNE_INVALID 2
414 #define OPP_TUNE_ERR 3
416 #define OPP_NO_MORE_DESC 0xFF
419 #define SAS_SESS_STATE_CONNECTED 0
420 #define SAS_SESS_STATE_NOT_FOUND 1
421 #define SAS_SESS_STATE_DENIED 2
424 /* application layer */
426 #define APDU_TAG_SIZE 3
428 /* "don't care" value for min_len_field and len_field (this can't be 0) */
429 #define LEN_FIELD_ANY UINT32_MAX
431 static GHashTable
*apdu_table
;
433 typedef struct _apdu_info_t
{
435 /* the minimum length required for this apdu */
436 uint32_t min_len_field
;
437 /* if the apdu has a well-known length, we enforce it here
438 * (otherwise, we set this to LEN_FIELD_ANY) */
443 void (*dissect_payload
)(uint32_t, int,
444 tvbuff_t
*, int, conversation_t
*, packet_info
*, proto_tree
*);
449 dissect_dvbci_payload_rm(uint32_t tag
, int len_field
,
450 tvbuff_t
*tvb
, int offset
, conversation_t
*conv _U_
,
451 packet_info
*pinfo
, proto_tree
*tree
);
453 dissect_dvbci_payload_ap(uint32_t tag
, int len_field _U_
,
454 tvbuff_t
*tvb
, int offset
, conversation_t
*conv _U_
,
455 packet_info
*pinfo
, proto_tree
*tree
);
457 dissect_dvbci_payload_ca(uint32_t tag
, int len_field
,
458 tvbuff_t
*tvb
, int offset
, conversation_t
*conv _U_
,
459 packet_info
*pinfo
, proto_tree
*tree
);
461 dissect_dvbci_payload_aut(uint32_t tag
, int len_field _U_
,
462 tvbuff_t
*tvb
, int offset
, conversation_t
*conv _U_
,
463 packet_info
*pinfo _U_
, proto_tree
*tree
);
465 dissect_dvbci_payload_hc(uint32_t tag
, int len_field _U_
,
466 tvbuff_t
*tvb
, int offset
, conversation_t
*conv _U_
,
467 packet_info
*pinfo
, proto_tree
*tree
);
469 dissect_dvbci_payload_dt(uint32_t tag
, int len_field
,
470 tvbuff_t
*tvb
, int offset
, conversation_t
*conv _U_
,
471 packet_info
*pinfo
, proto_tree
*tree
);
473 dissect_dvbci_payload_mmi(uint32_t tag
, int len_field
,
474 tvbuff_t
*tvb
, int offset
, conversation_t
*conv _U_
,
475 packet_info
*pinfo
, proto_tree
*tree
);
477 dissect_dvbci_payload_hlc(uint32_t tag
, int len_field _U_
,
478 tvbuff_t
*tvb
, int offset
, conversation_t
*conv _U_
,
479 packet_info
*pinfo
, proto_tree
*tree
);
481 dissect_dvbci_payload_cup(uint32_t tag
, int len_field _U_
,
482 tvbuff_t
*tvb
, int offset
, conversation_t
*conv _U_
,
483 packet_info
*pinfo
, proto_tree
*tree
);
485 dissect_dvbci_payload_cc(uint32_t tag
, int len_field _U_
,
486 tvbuff_t
*tvb
, int offset
, conversation_t
*conv _U_
,
487 packet_info
*pinfo
, proto_tree
*tree
);
489 dissect_dvbci_payload_ami(uint32_t tag
, int len_field _U_
,
490 tvbuff_t
*tvb
, int offset
, conversation_t
*conv _U_
,
491 packet_info
*pinfo
, proto_tree
*tree
);
493 dissect_dvbci_payload_lsc(uint32_t tag
, int len_field
,
494 tvbuff_t
*tvb
, int offset
, conversation_t
*conv
,
495 packet_info
*pinfo
, proto_tree
*tree
);
497 dissect_dvbci_payload_opp(uint32_t tag
, int len_field _U_
,
498 tvbuff_t
*tvb
, int offset
, conversation_t
*conv _U_
,
499 packet_info
*pinfo
, proto_tree
*tree
);
501 dissect_dvbci_payload_afs(uint32_t tag
, int len_field _U_
,
502 tvbuff_t
*tvb
, int offset
, conversation_t
*conv _U_
,
503 packet_info
*pinfo
, proto_tree
*tree
);
505 dissect_dvbci_payload_sas(uint32_t tag
, int len_field _U_
,
506 tvbuff_t
*tvb
, int offset
, conversation_t
*conv
,
507 packet_info
*pinfo
, proto_tree
*tree
);
511 #define T_PROFILE_ENQ 0x9F8010
512 #define T_PROFILE 0x9F8011
513 #define T_PROFILE_CHANGE 0x9F8012
514 #define T_APP_INFO_ENQ 0x9F8020
515 #define T_APP_INFO 0x9F8021
516 #define T_ENTER_MENU 0x9F8022
517 #define T_REQUEST_CICAM_RESET 0x9F8023
518 #define T_DATARATE_INFO 0x9F8024
519 #define T_CA_INFO_ENQ 0x9F8030
520 #define T_CA_INFO 0x9F8031
521 #define T_CA_PMT 0x9F8032
522 #define T_CA_PMT_REPLY 0x9F8033
523 #define T_AUTH_REQ 0x9F8200
524 #define T_AUTH_RESP 0x9F8201
525 #define T_TUNE 0x9F8400
526 #define T_REPLACE 0x9F8401
527 #define T_CLEAR_REPLACE 0x9F8402
528 #define T_ASK_RELEASE 0x9F8403
529 #define T_TUNE_BROADCAST_REQ 0x9F8404
530 #define T_TUNE_REPLY 0x9F8405
531 #define T_ASK_RELEASE_REPLY 0x9F8406
532 #define T_TUNE_LCN_REQ 0x9F8407
533 #define T_TUNE_IP_REQ 0x9F8408
534 #define T_TUNE_TRIPLET_REQ 0x9F8409
535 #define T_TUNE_STATUS_REQ 0x9F840A
536 #define T_TUNE_STATUS_REPLY 0x9F840B
537 #define T_DATE_TIME_ENQ 0x9F8440
538 #define T_DATE_TIME 0x9F8441
539 #define T_CLOSE_MMI 0x9F8800
540 #define T_DISPLAY_CONTROL 0x9F8801
541 #define T_DISPLAY_REPLY 0x9F8802
542 #define T_ENQ 0x9F8807
543 #define T_ANSW 0x9F8808
544 #define T_MENU_LAST 0x9F8809
545 #define T_MENU_MORE 0x9F880A
546 #define T_MENU_ANSW 0x9F880B
547 #define T_LIST_LAST 0x9F880C
548 #define T_LIST_MORE 0x9F880D
549 #define T_HOST_COUNTRY_ENQ 0x9F8100
550 #define T_HOST_COUNTRY 0x9F8101
551 #define T_HOST_LANGUAGE_ENQ 0x9F8110
552 #define T_HOST_LANGUAGE 0x9F8111
553 #define T_CAM_FIRMWARE_UPGRADE 0x9F9D01
554 #define T_CAM_FIRMWARE_UPGRADE_REPLY 0x9F9D02
555 #define T_CAM_FIRMWARE_UPGRADE_PROGRESS 0x9F9D03
556 #define T_CAM_FIRMWARE_UPGRADE_COMPLETE 0x9F9D04
557 #define T_CC_OPEN_REQ 0x9F9001
558 #define T_CC_OPEN_CNF 0x9F9002
559 #define T_CC_DATA_REQ 0x9F9003
560 #define T_CC_DATA_CNF 0x9F9004
561 #define T_CC_SYNC_REQ 0x9F9005
562 #define T_CC_SYNC_CNF 0x9F9006
563 #define T_CC_SAC_DATA_REQ 0x9F9007
564 #define T_CC_SAC_DATA_CNF 0x9F9008
565 #define T_CC_SAC_SYNC_REQ 0x9F9009
566 #define T_CC_SAC_SYNC_CNF 0x9F9010
567 #define T_CC_PIN_CAPABILITIES_REQ 0x9F9011
568 #define T_CC_PIN_CAPABILITIES_REPLY 0x9F9012
569 #define T_CC_PIN_CMD 0x9F9013
570 #define T_CC_PIN_REPLY 0x9F9014
571 #define T_CC_PIN_EVENT 0x9F9015
572 #define T_CC_PIN_PLAYBACK 0x9F9016
573 #define T_CC_PIN_MMI_REQ 0x9F9017
574 #define T_REQUEST_START 0x9F8000
575 #define T_REQUEST_START_ACK 0x9F8001
576 #define T_FILE_REQUEST 0x9F8002
577 #define T_FILE_ACKNOWLEDGE 0x9F8003
578 #define T_APP_ABORT_REQUEST 0x9F8004
579 #define T_APP_ABORT_ACK 0x9F8005
580 #define T_COMMS_CMD 0x9F8C00
581 #define T_COMMS_REPLY 0x9F8C02
582 #define T_COMMS_SEND_LAST 0x9F8C03
583 #define T_COMMS_SEND_MORE 0x9F8C04
584 #define T_COMMS_RCV_LAST 0x9F8C05
585 #define T_COMMS_RCV_MORE 0x9F8C06
586 #define T_COMMS_IP_CONFIG_REQ 0x9F8C09
587 #define T_COMMS_IP_CONFIG_REPLY 0x9F8C0A
588 #define T_AFS_FILE_SYSTEM_OFFER 0x9F9400
589 #define T_AFS_FILE_SYSTEM_ACK 0x9F9401
590 #define T_AFS_FILE_REQUEST 0x9F9402
591 #define T_AFS_FILE_ACKNOWLEDGE 0x9F9403
592 #define T_OPERATOR_STATUS_REQ 0x9F9C00
593 #define T_OPERATOR_STATUS 0x9F9C01
594 #define T_OPERATOR_NIT_REQ 0x9F9C02
595 #define T_OPERATOR_NIT 0x9F9C03
596 #define T_OPERATOR_INFO_REQ 0x9F9C04
597 #define T_OPERATOR_INFO 0x9F9C05
598 #define T_OPERATOR_SEARCH_START 0x9F9C06
599 #define T_OPERATOR_SEARCH_STATUS 0x9F9C07
600 #define T_OPERATOR_EXIT 0x9F9C08
601 #define T_OPERATOR_TUNE 0x9F9C09
602 #define T_OPERATOR_TUNE_STATUS 0x9F9C0A
603 #define T_OPERATOR_ENTITLEMENT_ACK 0x9F9C0B
604 #define T_OPERATOR_SEARCH_CANCEL 0x9F9C0C
605 #define T_SAS_CONNECT_RQST 0x9F9A00
606 #define T_SAS_CONNECT_CNF 0x9F9A01
607 #define T_SAS_ASYNC_MSG 0x9F9A07
609 /* these are no real apdus, they just use the same format */
610 #define T_TEXT_LAST 0x9F8803
611 #define T_TEXT_MORE 0x9F8804
612 #define T_CONNECTION_DESCRIPTOR 0x9F8C01
614 #define IS_MENU_APDU(t) (t==T_MENU_MORE || t==T_MENU_LAST)
617 static const apdu_info_t apdu_info
[] = {
618 {T_PROFILE_ENQ
, 0, 0, DIRECTION_ANY
, RES_CLASS_RM
, 1, NULL
},
619 {T_PROFILE
, 0, LEN_FIELD_ANY
, DIRECTION_ANY
, RES_CLASS_RM
, 1, dissect_dvbci_payload_rm
},
620 {T_PROFILE_CHANGE
, 0, 0, DIRECTION_ANY
, RES_CLASS_RM
, 1, NULL
},
622 {T_APP_INFO_ENQ
, 0, 0, DATA_HOST_TO_CAM
, RES_CLASS_AP
, 1, NULL
},
623 {T_APP_INFO
, 6, LEN_FIELD_ANY
, DATA_CAM_TO_HOST
, RES_CLASS_AP
, 1, dissect_dvbci_payload_ap
},
624 {T_ENTER_MENU
, 0, 0, DATA_HOST_TO_CAM
, RES_CLASS_AP
, 1, NULL
},
625 {T_REQUEST_CICAM_RESET
, 0, 0, DATA_CAM_TO_HOST
, RES_CLASS_AP
, 3, NULL
},
626 {T_DATARATE_INFO
, 0, 1, DATA_HOST_TO_CAM
, RES_CLASS_AP
, 3, dissect_dvbci_payload_ap
},
628 {T_CA_INFO_ENQ
, 0, 0, DATA_HOST_TO_CAM
, RES_CLASS_CA
, 1, NULL
},
629 {T_CA_INFO
, 0, LEN_FIELD_ANY
, DATA_CAM_TO_HOST
, RES_CLASS_CA
, 1, dissect_dvbci_payload_ca
},
630 {T_CA_PMT
, 6, LEN_FIELD_ANY
, DATA_HOST_TO_CAM
, RES_CLASS_CA
, 1, dissect_dvbci_payload_ca
},
631 {T_CA_PMT_REPLY
, 8, LEN_FIELD_ANY
, DATA_CAM_TO_HOST
, RES_CLASS_CA
, 1, dissect_dvbci_payload_ca
},
633 {T_AUTH_REQ
, 2, LEN_FIELD_ANY
, DATA_CAM_TO_HOST
, RES_CLASS_AUT
, 1, dissect_dvbci_payload_aut
},
634 {T_AUTH_RESP
, 2, LEN_FIELD_ANY
, DATA_HOST_TO_CAM
, RES_CLASS_AUT
, 1, dissect_dvbci_payload_aut
},
636 {T_TUNE
, 0, 8, DATA_CAM_TO_HOST
, RES_CLASS_HC
, 1, dissect_dvbci_payload_hc
},
637 {T_REPLACE
, 0, 5, DATA_CAM_TO_HOST
, RES_CLASS_HC
, 1, dissect_dvbci_payload_hc
},
638 {T_CLEAR_REPLACE
, 0, 1, DATA_CAM_TO_HOST
, RES_CLASS_HC
, 1, dissect_dvbci_payload_hc
},
639 {T_ASK_RELEASE
, 0, 0, DATA_HOST_TO_CAM
, RES_CLASS_HC
, 1, NULL
},
640 {T_TUNE_BROADCAST_REQ
, 5, LEN_FIELD_ANY
, DATA_CAM_TO_HOST
, RES_CLASS_HC
, 2, dissect_dvbci_payload_hc
},
641 {T_TUNE_REPLY
, 1, 1, DATA_HOST_TO_CAM
, RES_CLASS_HC
, 2, dissect_dvbci_payload_hc
},
642 {T_ASK_RELEASE_REPLY
, 1, 1, DATA_CAM_TO_HOST
, RES_CLASS_HC
, 2, dissect_dvbci_payload_hc
},
644 {T_DATE_TIME_ENQ
, 0, 1, DATA_CAM_TO_HOST
, RES_CLASS_DT
, 1, dissect_dvbci_payload_dt
},
645 {T_DATE_TIME
, 5, LEN_FIELD_ANY
, DATA_HOST_TO_CAM
, RES_CLASS_DT
, 1, dissect_dvbci_payload_dt
},
647 {T_CLOSE_MMI
, 1, LEN_FIELD_ANY
, DIRECTION_ANY
, RES_CLASS_MMI
, 1, dissect_dvbci_payload_mmi
},
648 {T_DISPLAY_CONTROL
, 1, LEN_FIELD_ANY
, DATA_CAM_TO_HOST
, RES_CLASS_MMI
, 1, dissect_dvbci_payload_mmi
},
649 {T_DISPLAY_REPLY
, 1, LEN_FIELD_ANY
, DATA_HOST_TO_CAM
, RES_CLASS_MMI
, 1, dissect_dvbci_payload_mmi
},
650 {T_ENQ
, 2, LEN_FIELD_ANY
, DATA_CAM_TO_HOST
, RES_CLASS_MMI
, 1, dissect_dvbci_payload_mmi
},
651 {T_ANSW
, 1, LEN_FIELD_ANY
, DATA_HOST_TO_CAM
, RES_CLASS_MMI
, 1, dissect_dvbci_payload_mmi
},
652 {T_MENU_LAST
, 13, LEN_FIELD_ANY
, DATA_CAM_TO_HOST
, RES_CLASS_MMI
, 1, dissect_dvbci_payload_mmi
},
653 {T_MENU_MORE
, 13, LEN_FIELD_ANY
, DATA_CAM_TO_HOST
, RES_CLASS_MMI
, 1, dissect_dvbci_payload_mmi
},
654 {T_MENU_ANSW
, 0, 1, DATA_HOST_TO_CAM
, RES_CLASS_MMI
, 1, dissect_dvbci_payload_mmi
},
655 {T_LIST_LAST
, 13, LEN_FIELD_ANY
, DATA_CAM_TO_HOST
, RES_CLASS_MMI
, 1, dissect_dvbci_payload_mmi
},
656 {T_LIST_MORE
, 13, LEN_FIELD_ANY
, DATA_CAM_TO_HOST
, RES_CLASS_MMI
, 1, dissect_dvbci_payload_mmi
},
658 {T_HOST_COUNTRY_ENQ
, 0, 0, DATA_CAM_TO_HOST
, RES_CLASS_HLC
, 1, NULL
},
659 {T_HOST_COUNTRY
, 0, 3, DATA_HOST_TO_CAM
, RES_CLASS_HLC
, 1, dissect_dvbci_payload_hlc
},
660 {T_HOST_LANGUAGE_ENQ
, 0, 0, DATA_CAM_TO_HOST
, RES_CLASS_HLC
, 1, NULL
},
661 {T_HOST_LANGUAGE
, 0, 3, DATA_HOST_TO_CAM
, RES_CLASS_HLC
, 1, dissect_dvbci_payload_hlc
},
663 {T_CAM_FIRMWARE_UPGRADE
, 0, 3, DATA_CAM_TO_HOST
, RES_CLASS_CUP
, 1, dissect_dvbci_payload_cup
},
664 {T_CAM_FIRMWARE_UPGRADE_REPLY
, 0, 1, DATA_HOST_TO_CAM
, RES_CLASS_CUP
, 1, dissect_dvbci_payload_cup
},
665 {T_CAM_FIRMWARE_UPGRADE_PROGRESS
, 0, 1, DATA_CAM_TO_HOST
, RES_CLASS_CUP
, 1, dissect_dvbci_payload_cup
},
666 {T_CAM_FIRMWARE_UPGRADE_COMPLETE
, 0, 1, DATA_CAM_TO_HOST
, RES_CLASS_CUP
, 1, dissect_dvbci_payload_cup
},
668 {T_CC_OPEN_REQ
, 0, 0, DATA_CAM_TO_HOST
, RES_CLASS_CC
, 1, NULL
},
669 {T_CC_OPEN_CNF
, 0, 1, DATA_HOST_TO_CAM
, RES_CLASS_CC
, 1, dissect_dvbci_payload_cc
},
670 {T_CC_DATA_REQ
, 3, LEN_FIELD_ANY
, DATA_CAM_TO_HOST
, RES_CLASS_CC
, 1, dissect_dvbci_payload_cc
},
671 {T_CC_DATA_CNF
, 2, LEN_FIELD_ANY
, DATA_HOST_TO_CAM
, RES_CLASS_CC
, 1, dissect_dvbci_payload_cc
},
672 {T_CC_SYNC_REQ
, 0, 0, DATA_CAM_TO_HOST
, RES_CLASS_CC
, 1, NULL
},
673 {T_CC_SYNC_CNF
, 0, 1, DATA_HOST_TO_CAM
, RES_CLASS_CC
, 1, dissect_dvbci_payload_cc
},
674 {T_CC_SAC_DATA_REQ
, 8, LEN_FIELD_ANY
, DIRECTION_ANY
, RES_CLASS_CC
, 1, dissect_dvbci_payload_cc
},
675 {T_CC_SAC_DATA_CNF
, 8, LEN_FIELD_ANY
, DIRECTION_ANY
, RES_CLASS_CC
, 1, dissect_dvbci_payload_cc
},
676 {T_CC_SAC_SYNC_REQ
, 8, LEN_FIELD_ANY
, DATA_CAM_TO_HOST
, RES_CLASS_CC
, 1, dissect_dvbci_payload_cc
},
677 {T_CC_SAC_SYNC_CNF
, 8, LEN_FIELD_ANY
, DATA_HOST_TO_CAM
, RES_CLASS_CC
, 1, dissect_dvbci_payload_cc
},
678 {T_CC_PIN_CAPABILITIES_REQ
, 0, 0, DATA_HOST_TO_CAM
, RES_CLASS_CC
, 2, NULL
},
679 {T_CC_PIN_CAPABILITIES_REPLY
, 7, 7, DATA_CAM_TO_HOST
, RES_CLASS_CC
, 2, dissect_dvbci_payload_cc
},
680 {T_CC_PIN_CMD
, 1, LEN_FIELD_ANY
, DATA_HOST_TO_CAM
, RES_CLASS_CC
, 2, dissect_dvbci_payload_cc
},
681 {T_CC_PIN_REPLY
, 1, 1, DATA_CAM_TO_HOST
, RES_CLASS_CC
, 2, dissect_dvbci_payload_cc
},
682 {T_CC_PIN_EVENT
, 25, 25, DATA_CAM_TO_HOST
, RES_CLASS_CC
, 2, dissect_dvbci_payload_cc
},
683 {T_CC_PIN_PLAYBACK
, 16, 16, DATA_HOST_TO_CAM
, RES_CLASS_CC
, 2, dissect_dvbci_payload_cc
},
684 {T_CC_PIN_MMI_REQ
, 1, LEN_FIELD_ANY
, DATA_HOST_TO_CAM
, RES_CLASS_CC
, 2, dissect_dvbci_payload_cc
},
686 {T_REQUEST_START
, 2, LEN_FIELD_ANY
, DATA_CAM_TO_HOST
, RES_CLASS_AMI
, 1, dissect_dvbci_payload_ami
},
687 {T_REQUEST_START_ACK
, 0, 1, DATA_HOST_TO_CAM
, RES_CLASS_AMI
, 1, dissect_dvbci_payload_ami
},
688 {T_FILE_REQUEST
, 1, LEN_FIELD_ANY
, DATA_HOST_TO_CAM
, RES_CLASS_AMI
, 1, dissect_dvbci_payload_ami
},
689 {T_FILE_ACKNOWLEDGE
, 2, LEN_FIELD_ANY
, DATA_CAM_TO_HOST
, RES_CLASS_AMI
, 1, dissect_dvbci_payload_ami
},
690 {T_APP_ABORT_REQUEST
, 0, LEN_FIELD_ANY
, DIRECTION_ANY
, RES_CLASS_AMI
, 1, dissect_dvbci_payload_ami
},
691 {T_APP_ABORT_ACK
, 0, LEN_FIELD_ANY
, DIRECTION_ANY
, RES_CLASS_AMI
, 1, dissect_dvbci_payload_ami
},
693 {T_COMMS_CMD
, 1, LEN_FIELD_ANY
, DATA_CAM_TO_HOST
, RES_CLASS_LSC
, 1, dissect_dvbci_payload_lsc
},
694 {T_COMMS_REPLY
, 0, 2, DATA_HOST_TO_CAM
, RES_CLASS_LSC
, 1, dissect_dvbci_payload_lsc
},
695 {T_COMMS_SEND_LAST
, 2, LEN_FIELD_ANY
, DATA_CAM_TO_HOST
, RES_CLASS_LSC
, 1, dissect_dvbci_payload_lsc
},
696 {T_COMMS_SEND_MORE
, 2, LEN_FIELD_ANY
, DATA_CAM_TO_HOST
, RES_CLASS_LSC
, 1, dissect_dvbci_payload_lsc
},
697 {T_COMMS_RCV_LAST
, 2, LEN_FIELD_ANY
, DATA_HOST_TO_CAM
, RES_CLASS_LSC
, 1, dissect_dvbci_payload_lsc
},
698 {T_COMMS_RCV_MORE
, 2, LEN_FIELD_ANY
, DATA_HOST_TO_CAM
, RES_CLASS_LSC
, 1, dissect_dvbci_payload_lsc
},
699 {T_COMMS_IP_CONFIG_REQ
, 0, 0, DATA_CAM_TO_HOST
, RES_CLASS_LSC
, 4, NULL
},
700 {T_COMMS_IP_CONFIG_REPLY
, 2, LEN_FIELD_ANY
, DATA_HOST_TO_CAM
, RES_CLASS_LSC
, 4, dissect_dvbci_payload_lsc
},
702 {T_AFS_FILE_SYSTEM_OFFER
, 1, LEN_FIELD_ANY
, DATA_CAM_TO_HOST
, RES_CLASS_AFS
, 1, dissect_dvbci_payload_afs
},
703 {T_AFS_FILE_SYSTEM_ACK
, 1, 1, DATA_HOST_TO_CAM
, RES_CLASS_AFS
, 1, dissect_dvbci_payload_afs
},
704 {T_AFS_FILE_REQUEST
, 1, LEN_FIELD_ANY
, DATA_HOST_TO_CAM
, RES_CLASS_AFS
, 1, dissect_dvbci_payload_afs
},
705 {T_AFS_FILE_ACKNOWLEDGE
, 2, LEN_FIELD_ANY
, DATA_CAM_TO_HOST
, RES_CLASS_AFS
, 1, dissect_dvbci_payload_afs
},
707 {T_OPERATOR_STATUS_REQ
, 0, 0, DATA_HOST_TO_CAM
, RES_CLASS_OPP
, 1, NULL
},
708 {T_OPERATOR_STATUS
, 0, 6, DATA_CAM_TO_HOST
, RES_CLASS_OPP
, 1, dissect_dvbci_payload_opp
},
709 {T_OPERATOR_NIT_REQ
, 0, 0, DATA_HOST_TO_CAM
, RES_CLASS_OPP
, 1, NULL
},
710 {T_OPERATOR_NIT
, 2, LEN_FIELD_ANY
, DATA_CAM_TO_HOST
, RES_CLASS_OPP
, 1, dissect_dvbci_payload_opp
},
711 {T_OPERATOR_INFO_REQ
, 0, 0, DATA_HOST_TO_CAM
, RES_CLASS_OPP
, 1, NULL
},
712 {T_OPERATOR_INFO
, 1, LEN_FIELD_ANY
, DATA_CAM_TO_HOST
, RES_CLASS_OPP
, 1, dissect_dvbci_payload_opp
},
713 {T_OPERATOR_SEARCH_START
, 3, LEN_FIELD_ANY
, DATA_HOST_TO_CAM
, RES_CLASS_OPP
, 1, dissect_dvbci_payload_opp
},
714 {T_OPERATOR_SEARCH_STATUS
, 0, 6, DATA_CAM_TO_HOST
, RES_CLASS_OPP
, 1, dissect_dvbci_payload_opp
},
715 {T_OPERATOR_EXIT
, 0, 0, DATA_HOST_TO_CAM
, RES_CLASS_OPP
, 1, NULL
},
716 {T_OPERATOR_TUNE
, 2, LEN_FIELD_ANY
, DATA_CAM_TO_HOST
, RES_CLASS_OPP
, 1, dissect_dvbci_payload_opp
},
717 {T_OPERATOR_TUNE_STATUS
, 5, LEN_FIELD_ANY
, DATA_HOST_TO_CAM
, RES_CLASS_OPP
, 1, dissect_dvbci_payload_opp
},
718 {T_OPERATOR_ENTITLEMENT_ACK
, 0, 0, DATA_HOST_TO_CAM
, RES_CLASS_OPP
, 1, NULL
},
719 {T_OPERATOR_SEARCH_CANCEL
, 0, 0, DATA_HOST_TO_CAM
, RES_CLASS_OPP
, 1, NULL
},
721 {T_SAS_CONNECT_RQST
, 0, 8, DATA_HOST_TO_CAM
, RES_CLASS_SAS
, 1, dissect_dvbci_payload_sas
},
722 {T_SAS_CONNECT_CNF
, 0, 9, DATA_CAM_TO_HOST
, RES_CLASS_SAS
, 1, dissect_dvbci_payload_sas
},
723 {T_SAS_ASYNC_MSG
, 3, LEN_FIELD_ANY
, DIRECTION_ANY
, RES_CLASS_SAS
, 1, dissect_dvbci_payload_sas
}
726 static const value_string dvbci_apdu_tag
[] = {
727 { T_PROFILE_ENQ
, "Profile enquiry" },
728 { T_PROFILE
, "Profile information" },
729 { T_PROFILE_CHANGE
, "Profile change notification" },
730 { T_APP_INFO_ENQ
, "Application info enquiry" },
731 { T_APP_INFO
, "Application info" },
732 { T_ENTER_MENU
, "Enter menu" },
733 { T_REQUEST_CICAM_RESET
, "Request CICAM reset" },
734 { T_DATARATE_INFO
, "Datarate info" },
735 { T_CA_INFO_ENQ
, "CA info enquiry" },
736 { T_CA_INFO
, "CA info" },
737 { T_CA_PMT
, "CA PMT" },
738 { T_CA_PMT_REPLY
, "CA PMT reply" },
739 { T_AUTH_REQ
, "Authentication request" },
740 { T_AUTH_RESP
, "Authentication response" },
742 { T_REPLACE
, "Replace" },
743 { T_CLEAR_REPLACE
, "Clear replace" },
744 { T_ASK_RELEASE
, "Ask release" },
745 { T_TUNE_BROADCAST_REQ
, "Tune broadcast request" },
746 { T_TUNE_REPLY
, "Tune reply" },
747 { T_ASK_RELEASE_REPLY
, "Ask release reply" },
748 { T_TUNE_LCN_REQ
, "Tune LCN request" },
749 { T_TUNE_IP_REQ
, "Tune IP request" },
750 { T_TUNE_TRIPLET_REQ
, "Tune triplet request" },
751 { T_TUNE_STATUS_REQ
, "Tune status request" },
752 { T_TUNE_STATUS_REPLY
, "Tune status reply" },
753 { T_DATE_TIME_ENQ
, "Date-Time enquiry" },
754 { T_DATE_TIME
, "Date-Time" },
755 { T_CLOSE_MMI
, "Close MMI" },
756 { T_DISPLAY_CONTROL
, "Display control" },
757 { T_DISPLAY_REPLY
, "Display reply" },
758 { T_TEXT_LAST
, "Text last" },
759 { T_TEXT_MORE
, "Text more" },
760 { T_ENQ
, "Enquiry" },
761 { T_ANSW
, "Answer" },
762 { T_MENU_LAST
, "Menu last" },
763 { T_MENU_MORE
, "Menu more" },
764 { T_MENU_ANSW
, "Menu answer" },
765 { T_LIST_LAST
, "List last" },
766 { T_LIST_MORE
, "List more" },
767 { T_HOST_COUNTRY_ENQ
, "Host country enquiry" },
768 { T_HOST_COUNTRY
, "Host country" },
769 { T_HOST_LANGUAGE_ENQ
, "Host language enquiry" },
770 { T_HOST_LANGUAGE
, "Host language" },
771 { T_CAM_FIRMWARE_UPGRADE
, "CAM firmware upgrade" },
772 { T_CAM_FIRMWARE_UPGRADE_REPLY
, "CAM firmware upgrade reply" },
773 { T_CAM_FIRMWARE_UPGRADE_PROGRESS
, "CAM firmware upgrade progress" },
774 { T_CAM_FIRMWARE_UPGRADE_COMPLETE
, "CAM firmware upgrade complete" },
775 { T_CC_OPEN_REQ
, "CC open request" },
776 { T_CC_OPEN_CNF
, "CC open confirm" },
777 { T_CC_DATA_REQ
, "CC data request" },
778 { T_CC_DATA_CNF
, "CC data confirm" },
779 { T_CC_SYNC_REQ
, "CC sync request" },
780 { T_CC_SYNC_CNF
, "CC sync confirm" },
781 { T_CC_SAC_DATA_REQ
, "CC SAC data request" },
782 { T_CC_SAC_DATA_CNF
, "CC SAC data confirm" },
783 { T_CC_SAC_SYNC_REQ
, "CC SAC sync request" },
784 { T_CC_SAC_SYNC_CNF
, "CC SAC sync confirm" },
785 { T_CC_PIN_CAPABILITIES_REQ
, "CC PIN capabilities request" },
786 { T_CC_PIN_CAPABILITIES_REPLY
, "CC PIN capabilities reply" },
787 { T_CC_PIN_CMD
, "CC PIN command" },
788 { T_CC_PIN_REPLY
, "CC PIN reply" },
789 { T_CC_PIN_EVENT
, "CC PIN event" },
790 { T_CC_PIN_PLAYBACK
, "CC PIN playback" },
791 { T_CC_PIN_MMI_REQ
, "CC PIN MMI request" },
792 { T_REQUEST_START
, "Request start" },
793 { T_REQUEST_START_ACK
, "Request start ack" },
794 { T_FILE_REQUEST
, "File request" },
795 { T_FILE_ACKNOWLEDGE
, "File acknowledge" },
796 { T_APP_ABORT_REQUEST
, "App abort request" },
797 { T_APP_ABORT_ACK
, "App abort ack" },
798 { T_COMMS_CMD
, "Comms command" },
799 { T_COMMS_REPLY
, "Comms reply" },
800 { T_CONNECTION_DESCRIPTOR
, "Connection descriptor" },
801 { T_COMMS_SEND_LAST
, "Comms send last" },
802 { T_COMMS_SEND_MORE
, "Comms send more" },
803 { T_COMMS_RCV_LAST
, "Comms receive last" },
804 { T_COMMS_RCV_MORE
, "Comms receive more" },
805 { T_COMMS_IP_CONFIG_REQ
, "Comms IP config request" },
806 { T_COMMS_IP_CONFIG_REPLY
, "Comms IP config reply" },
807 { T_AFS_FILE_SYSTEM_OFFER
, "File system offer" },
808 { T_AFS_FILE_SYSTEM_ACK
, "File system ack" },
809 { T_AFS_FILE_REQUEST
, "File request" },
810 { T_AFS_FILE_ACKNOWLEDGE
, "File acknowledge" },
811 { T_OPERATOR_STATUS_REQ
, "Operator status request" },
812 { T_OPERATOR_STATUS
, "Operator status" },
813 { T_OPERATOR_NIT_REQ
, "Operator NIT request" },
814 { T_OPERATOR_NIT
, "Operator NIT" },
815 { T_OPERATOR_INFO_REQ
, "Operator info request" },
816 { T_OPERATOR_INFO
, "Operator info" },
817 { T_OPERATOR_SEARCH_START
, "Operator search start" },
818 { T_OPERATOR_SEARCH_STATUS
, "Operator search status" },
819 { T_OPERATOR_EXIT
, "Operator exit" },
820 { T_OPERATOR_TUNE
, "Operator tune" },
821 { T_OPERATOR_TUNE_STATUS
, "Operator tune status" },
822 { T_OPERATOR_ENTITLEMENT_ACK
, "Operator entitlement acknowledge" },
823 { T_OPERATOR_SEARCH_CANCEL
, "Operator search cancel" },
824 { T_SAS_CONNECT_RQST
, "SAS connect request" },
825 { T_SAS_CONNECT_CNF
, "SAS connect confirm" },
826 { T_SAS_ASYNC_MSG
, "SAS async message" },
830 WS_DLL_PUBLIC_DEF
const value_string dvbci_event
[] = {
831 { DVBCI_EVT_DATA_HOST_TO_CAM
, "data transfer Host -> CAM" },
832 { DVBCI_EVT_DATA_CAM_TO_HOST
, "data transfer CAM -> Host" },
833 { DVBCI_EVT_CIS_READ
, "read the Card Information Structure (CIS)" },
834 { DVBCI_EVT_COR_WRITE
, "write into the Configuration Option Register (COR)" },
835 { DVBCI_EVT_HW_EVT
, "hardware event" },
839 static int proto_dvbci
;
841 static dissector_handle_t dvbci_handle
;
843 static const char *dvbci_sek
;
844 static const char *dvbci_siv
;
845 static bool dvbci_dissect_lsc_msg
;
847 /* the output of pref_key_string_to_bin() applied to dvbci_sek and _siv */
848 static unsigned char *dvbci_sek_bin
;
849 static unsigned char *dvbci_siv_bin
;
851 static dissector_handle_t data_handle
;
852 static dissector_handle_t mpeg_pmt_handle
;
853 static dissector_handle_t dvb_nit_handle
;
854 static dissector_handle_t mime_handle
;
855 static dissector_table_t tcp_dissector_table
;
856 static dissector_table_t udp_dissector_table
;
858 static int exported_pdu_tap
= -1;
860 static int ett_dvbci
;
861 static int ett_dvbci_hdr
;
862 static int ett_dvbci_cis
;
863 static int ett_dvbci_cis_tpl
;
864 static int ett_dvbci_cis_subtpl
;
865 static int ett_dvbci_link
;
866 static int ett_dvbci_link_frag
;
867 static int ett_dvbci_link_frags
;
868 static int ett_dvbci_transport
;
869 static int ett_dvbci_transport_frag
;
870 static int ett_dvbci_transport_frags
;
871 static int ett_dvbci_session
;
872 static int ett_dvbci_res
;
873 static int ett_dvbci_application
;
874 static int ett_dvbci_es
;
875 static int ett_dvbci_ca_desc
;
876 static int ett_dvbci_text
;
877 static int ett_dvbci_cc_item
;
878 static int ett_dvbci_sac_msg_body
;
879 static int ett_dvbci_ami_req_types
;
880 static int ett_dvbci_lsc_conn_desc
;
881 static int ett_dvbci_opp_cap_loop
;
882 static int ett_dvbci_dlv_sys_hint
;
885 static int hf_dvbci_hdr_ver
;
886 static int hf_dvbci_event
;
887 static int hf_dvbci_len
;
888 static int hf_dvbci_hw_event
;
889 static int hf_dvbci_cor_addr
;
890 static int hf_dvbci_cor_val
;
891 static int hf_dvbci_cis_tpl_code
;
892 static int hf_dvbci_cis_tpl_len
;
893 static int hf_dvbci_cis_tpl_data
;
894 static int hf_dvbci_cis_tpll_v1_major
;
895 static int hf_dvbci_cis_tpll_v1_minor
;
896 static int hf_dvbci_cis_tpll_v1_info_manuf
;
897 static int hf_dvbci_cis_tpll_v1_info_name
;
898 static int hf_dvbci_cis_tpll_v1_info_additional
;
899 static int hf_dvbci_cis_tpll_v1_end
;
900 static int hf_dvbci_cis_tpcc_rfsz
;
901 static int hf_dvbci_cis_tpcc_rmsz
;
902 static int hf_dvbci_cis_tpcc_rasz
;
903 static int hf_dvbci_cis_tpcc_last
;
904 static int hf_dvbci_cis_tpcc_radr
;
905 static int hf_dvbci_cis_tpcc_rmsk
;
906 static int hf_dvbci_cis_st_code
;
907 static int hf_dvbci_cis_st_len
;
908 static int hf_dvbci_cis_stci_ifn_size
;
909 static int hf_dvbci_cis_stci_ifn
;
910 static int hf_dvbci_cis_stci_str
;
911 static int hf_dvbci_cis_tpce_indx_intface
;
912 static int hf_dvbci_cis_tpce_indx_default
;
913 static int hf_dvbci_cis_tpce_indx_cnf_entry
;
914 static int hf_dvbci_cis_tpce_if_type
;
915 static int hf_dvbci_cis_tpce_fs_mem_space
;
916 static int hf_dvbci_cis_tpce_fs_irq
;
917 static int hf_dvbci_cis_tpce_fs_io
;
918 static int hf_dvbci_cis_dev_vcc_used
;
919 static int hf_dvbci_cis_dev_mwait
;
920 static int hf_dvbci_cis_dev_oth_cond_info
;
921 static int hf_dvbci_cis_tplmid_manf
;
922 static int hf_dvbci_cis_tplmid_card
;
923 static int hf_dvbci_buf_size
;
924 static int hf_dvbci_tcid
;
925 static int hf_dvbci_ml
;
926 static int hf_dvbci_l_frags
;
927 static int hf_dvbci_l_frag
;
928 static int hf_dvbci_l_frag_overlap
;
929 static int hf_dvbci_l_frag_overlap_conflicts
;
930 static int hf_dvbci_l_frag_multiple_tails
;
931 static int hf_dvbci_l_frag_too_long_frag
;
932 static int hf_dvbci_l_frag_err
;
933 static int hf_dvbci_l_frag_cnt
;
934 static int hf_dvbci_l_reass_in
;
935 static int hf_dvbci_l_reass_len
;
936 static int hf_dvbci_c_tpdu_tag
;
937 static int hf_dvbci_r_tpdu_tag
;
938 static int hf_dvbci_t_c_id
;
939 static int hf_dvbci_sb_tag
;
940 static int hf_dvbci_sb_value
;
941 static int hf_dvbci_t_frags
;
942 static int hf_dvbci_t_frag
;
943 static int hf_dvbci_t_frag_overlap
;
944 static int hf_dvbci_t_frag_overlap_conflicts
;
945 static int hf_dvbci_t_frag_multiple_tails
;
946 static int hf_dvbci_t_frag_too_long_frag
;
947 static int hf_dvbci_t_frag_err
;
948 static int hf_dvbci_t_frag_cnt
;
949 static int hf_dvbci_t_reass_in
;
950 static int hf_dvbci_t_reass_len
;
951 static int hf_dvbci_spdu_tag
;
952 static int hf_dvbci_sess_status
;
953 static int hf_dvbci_sess_nb
;
954 static int hf_dvbci_close_sess_status
;
955 static int hf_dvbci_res_id
;
956 static int hf_dvbci_res_id_type
;
957 static int hf_dvbci_res_class
;
958 static int hf_dvbci_res_type
;
959 static int hf_dvbci_res_ver
;
960 static int hf_dvbci_apdu_tag
;
961 static int hf_dvbci_app_type
;
962 static int hf_dvbci_app_manf
;
963 static int hf_dvbci_manf_code
;
964 static int hf_dvbci_menu_str_len
;
965 static int hf_dvbci_ap_char_tbl
;
966 static int hf_dvbci_menu_str
;
967 static int hf_dvbci_data_rate
;
968 static int hf_dvbci_ca_sys_id
;
969 static int hf_dvbci_ca_pmt_list_mgmt
;
970 static int hf_dvbci_prog_num
;
971 static int hf_dvbci_ca_ver
;
972 static int hf_dvbci_curr_next
;
973 static int hf_dvbci_prog_info_len
;
974 static int hf_dvbci_stream_type
;
975 static int hf_dvbci_es_pid
;
976 static int hf_dvbci_es_info_len
;
977 static int hf_dvbci_ca_pmt_cmd_id
;
978 static int hf_dvbci_descr_len
;
979 static int hf_dvbci_ca_pid
;
980 static int hf_dvbci_ca_priv_data
;
981 static int hf_dvbci_ca_enable_flag
;
982 static int hf_dvbci_ca_enable
;
983 static int hf_dvbci_auth_proto_id
;
984 static int hf_dvbci_auth_req_bytes
;
985 static int hf_dvbci_auth_resp_bytes
;
986 static int hf_dvbci_network_id
;
987 static int hf_dvbci_original_network_id
;
988 static int hf_dvbci_transport_stream_id
;
989 static int hf_dvbci_service_id
;
990 static int hf_dvbci_replacement_ref
;
991 static int hf_dvbci_replaced_pid
;
992 static int hf_dvbci_replacement_pid
;
993 static int hf_dvbci_pmt_flag
;
994 static int hf_dvbci_hc_desc_loop_len
;
995 static int hf_dvbci_hc_status
;
996 static int hf_dvbci_hc_release_reply
;
997 static int hf_dvbci_resp_intv
;
998 static int hf_dvbci_utc_time
;
999 static int hf_dvbci_local_offset
;
1000 static int hf_dvbci_close_mmi_cmd_id
;
1001 static int hf_dvbci_close_mmi_delay
;
1002 static int hf_dvbci_disp_ctl_cmd
;
1003 static int hf_dvbci_mmi_mode
;
1004 static int hf_dvbci_disp_rep_id
;
1005 static int hf_dvbci_mmi_char_tbl
;
1006 static int hf_dvbci_blind_ans
;
1007 static int hf_dvbci_ans_txt_len
;
1008 static int hf_dvbci_enq
;
1009 static int hf_dvbci_ans_id
;
1010 static int hf_dvbci_ans
;
1011 static int hf_dvbci_choice_nb
;
1012 static int hf_dvbci_choice_ref
;
1013 static int hf_dvbci_item_nb
;
1014 static int hf_dvbci_title
;
1015 static int hf_dvbci_subtitle
;
1016 static int hf_dvbci_bottom
;
1017 static int hf_dvbci_item
;
1018 static int hf_dvbci_host_country
;
1019 static int hf_dvbci_host_language
;
1020 static int hf_dvbci_cup_type
;
1021 static int hf_dvbci_cup_download_time
;
1022 static int hf_dvbci_cup_answer
;
1023 static int hf_dvbci_cup_progress
;
1024 static int hf_dvbci_cup_reset
;
1025 static int hf_dvbci_cc_sys_id_bitmask
;
1026 static int hf_dvbci_cc_snd_dat_nbr
;
1027 static int hf_dvbci_cc_req_dat_nbr
;
1028 static int hf_dvbci_cc_dat_id
;
1029 static int hf_dvbci_cc_dat_len
;
1030 static int hf_dvbci_brand_cert
;
1031 static int hf_dvbci_dev_cert
;
1032 static int hf_dvbci_uri_ver
;
1033 static int hf_dvbci_uri_aps
;
1034 static int hf_dvbci_uri_emi
;
1035 static int hf_dvbci_uri_ict
;
1036 static int hf_dvbci_uri_rct
;
1037 static int hf_dvbci_uri_dot
;
1038 static int hf_dvbci_uri_rl
;
1039 static int hf_dvbci_cc_key_register
;
1040 static int hf_dvbci_cc_status_field
;
1041 static int hf_dvbci_cc_op_mode
;
1042 static int hf_dvbci_cc_data
;
1043 static int hf_dvbci_sac_msg_ctr
;
1044 static int hf_dvbci_sac_proto_ver
;
1045 static int hf_dvbci_sac_auth_cip
;
1046 static int hf_dvbci_sac_payload_enc
;
1047 static int hf_dvbci_sac_enc_cip
;
1048 static int hf_dvbci_sac_payload_len
;
1049 static int hf_dvbci_sac_enc_body
;
1050 static int hf_dvbci_sac_padding
;
1051 static int hf_dvbci_sac_signature
;
1052 static int hf_dvbci_rating
;
1053 static int hf_dvbci_capability_field
;
1054 static int hf_dvbci_pin_chg_time
;
1055 static int hf_dvbci_pincode_status
;
1056 static int hf_dvbci_cc_prog_num
;
1057 static int hf_dvbci_pin_evt_time
;
1058 static int hf_dvbci_pin_evt_cent
;
1059 static int hf_dvbci_cc_priv_data
;
1060 static int hf_dvbci_pincode
;
1061 static int hf_dvbci_app_dom_id_len
;
1062 static int hf_dvbci_init_obj_len
;
1063 static int hf_dvbci_app_dom_id
;
1064 static int hf_dvbci_init_obj
;
1065 static int hf_dvbci_ack_code
;
1066 static int hf_dvbci_req_type
;
1067 static int hf_dvbci_file_hash
;
1068 static int hf_dvbci_file_name_len
;
1069 static int hf_dvbci_file_name
;
1070 static int hf_dvbci_file_data_len
;
1071 static int hf_dvbci_ami_priv_data
;
1072 static int hf_dvbci_req_ok
;
1073 static int hf_dvbci_file_ok
;
1074 static int hf_dvbci_abort_req_code
;
1075 static int hf_dvbci_abort_ack_code
;
1076 static int hf_dvbci_phase_id
;
1077 static int hf_dvbci_comms_rep_id
;
1078 static int hf_dvbci_lsc_buf_size
;
1079 static int hf_dvbci_lsc_ret_val
;
1080 static int hf_dvbci_comms_cmd_id
;
1081 static int hf_dvbci_conn_desc_type
;
1082 static int hf_dvbci_lsc_media_tag
;
1083 static int hf_dvbci_lsc_media_len
;
1084 static int hf_dvbci_lsc_media_data
;
1085 static int hf_dvbci_lsc_ip_ver
;
1086 static int hf_dvbci_lsc_ipv4_addr
;
1087 static int hf_dvbci_lsc_ipv6_addr
;
1088 static int hf_dvbci_lsc_dst_port
;
1089 static int hf_dvbci_lsc_proto
;
1090 static int hf_dvbci_lsc_hostname
;
1091 static int hf_dvbci_lsc_retry_count
;
1092 static int hf_dvbci_lsc_timeout
;
1093 static int hf_dvbci_lsc_conn_state
;
1094 static int hf_dvbci_lsc_phys_addr
;
1095 static int hf_dvbci_lsc_netmask
;
1096 static int hf_dvbci_lsc_gateway
;
1097 static int hf_dvbci_lsc_dhcp_srv
;
1098 static int hf_dvbci_lsc_num_dns_srv
;
1099 static int hf_dvbci_lsc_dns_srv
;
1100 static int hf_dvbci_afs_dom_id
;
1101 static int hf_dvbci_afs_ack_code
;
1102 static int hf_dvbci_info_ver_op_status
;
1103 static int hf_dvbci_nit_ver
;
1104 static int hf_dvbci_pro_typ
;
1105 static int hf_dvbci_init_flag
;
1106 static int hf_dvbci_ent_chg_flag
;
1107 static int hf_dvbci_ent_val_flag
;
1108 static int hf_dvbci_ref_req_flag
;
1109 static int hf_dvbci_err_flag
;
1110 static int hf_dvbci_dlv_sys_hint
;
1111 static int hf_dvbci_dlv_sys_hint_t
;
1112 static int hf_dvbci_dlv_sys_hint_s
;
1113 static int hf_dvbci_dlv_sys_hint_c
;
1114 static int hf_dvbci_refr_req_date
;
1115 static int hf_dvbci_refr_req_time
;
1116 static int hf_dvbci_nit_loop_len
;
1117 static int hf_dvbci_info_valid
;
1118 static int hf_dvbci_info_ver_op_info
;
1119 static int hf_dvbci_cicam_onid
;
1120 static int hf_dvbci_cicam_id
;
1121 static int hf_dvbci_opp_char_tbl
;
1122 static int hf_dvbci_sdt_rst_trusted
;
1123 static int hf_dvbci_eit_rst_trusted
;
1124 static int hf_dvbci_eit_pf_usage
;
1125 static int hf_dvbci_eit_sch_usage
;
1126 static int hf_dvbci_ext_evt_usage
;
1127 static int hf_dvbci_sdt_oth_trusted
;
1128 static int hf_dvbci_eit_evt_trigger
;
1129 static int hf_dvbci_opp_lang_code
;
1130 static int hf_dvbci_prof_name
;
1131 static int hf_dvbci_unattended
;
1132 static int hf_dvbci_opp_svc_type_loop_len
;
1133 static int hf_dvbci_opp_svc_type
;
1134 static int hf_dvbci_dlv_cap_loop_len
;
1135 static int hf_dvbci_dlv_cap_byte
;
1136 static int hf_dvbci_app_cap_loop_len
;
1137 static int hf_dvbci_app_cap_bytes
;
1138 static int hf_dvbci_desc_num
;
1139 static int hf_dvbci_sig_strength
;
1140 static int hf_dvbci_sig_qual
;
1141 static int hf_dvbci_opp_tune_status
;
1142 static int hf_dvbci_opp_desc_loop_len
;
1143 static int hf_dvbci_sas_app_id
;
1144 static int hf_dvbci_sas_sess_state
;
1145 static int hf_dvbci_sas_msg_nb
;
1146 static int hf_dvbci_sas_msg_len
;
1148 static int * const dvb_ci_res_id_fields
[] = {
1149 &hf_dvbci_res_id_type
,
1150 &hf_dvbci_res_class
,
1156 static int * const dvbci_opp_dlv_sys_hint_fields
[] = {
1157 &hf_dvbci_dlv_sys_hint_t
,
1158 &hf_dvbci_dlv_sys_hint_s
,
1159 &hf_dvbci_dlv_sys_hint_c
,
1164 static expert_field ei_dvbci_cor_addr
;
1165 static expert_field ei_dvbci_buf_size
;
1166 static expert_field ei_dvbci_ml
;
1167 static expert_field ei_dvbci_c_tpdu_tag
;
1168 static expert_field ei_dvbci_r_tpdu_status_mandatory
;
1169 static expert_field ei_dvbci_r_tpdu_tag
;
1170 static expert_field ei_dvbci_sb_value
;
1171 static expert_field ei_dvbci_t_c_id
;
1172 static expert_field ei_dvbci_tpdu_status_tag
;
1173 static expert_field ei_dvbci_spdu_tag
;
1174 static expert_field ei_dvbci_spdu_cam_to_host
;
1175 static expert_field ei_dvbci_spdu_host_to_cam
;
1176 static expert_field ei_dvbci_apdu_tag
;
1177 static expert_field ei_dvbci_apu_cam_to_host
;
1178 static expert_field ei_dvbci_apu_host_to_cam
;
1179 static expert_field ei_dvbci_apdu_not_supported
;
1180 static expert_field ei_dvbci_res_ver
;
1181 static expert_field ei_dvbci_res_class
;
1182 static expert_field ei_dvbci_bad_length
;
1183 static expert_field ei_dvbci_invalid_char_tbl
;
1184 static expert_field ei_dvbci_no_ca_desc_es
;
1185 static expert_field ei_dvbci_no_ca_desc_prog
;
1186 static expert_field ei_dvbci_ca_pmt_cmd_id
;
1187 static expert_field ei_dvbci_time_offs_unknown
;
1188 static expert_field ei_dvbci_not_text_more_or_text_last
;
1189 static expert_field ei_dvbci_network_id
;
1190 static expert_field ei_dvbci_cc_pin_nvr_chg
;
1191 static expert_field ei_dvbci_pin_evt_cent
;
1192 static expert_field ei_dvbci_sac_payload_enc
;
1193 static expert_field ei_dvbci_sig_qual
;
1194 static expert_field ei_dvbci_cicam_nit_table_id
;
1195 static expert_field ei_dvbci_cup_progress
;
1197 static dissector_table_t sas_msg_dissector_table
;
1199 static reassembly_table tpdu_reassembly_table
;
1200 static reassembly_table spdu_reassembly_table
;
1202 static const fragment_items tpdu_frag_items
= {
1203 &ett_dvbci_link_frag
,
1204 &ett_dvbci_link_frags
,
1208 &hf_dvbci_l_frag_overlap
,
1209 &hf_dvbci_l_frag_overlap_conflicts
,
1210 &hf_dvbci_l_frag_multiple_tails
,
1211 &hf_dvbci_l_frag_too_long_frag
,
1212 &hf_dvbci_l_frag_err
,
1213 &hf_dvbci_l_frag_cnt
,
1215 &hf_dvbci_l_reass_in
,
1216 &hf_dvbci_l_reass_len
,
1217 /* Reassembled data field */
1221 static const fragment_items spdu_frag_items
= {
1222 &ett_dvbci_transport_frag
,
1223 &ett_dvbci_transport_frags
,
1227 &hf_dvbci_t_frag_overlap
,
1228 &hf_dvbci_t_frag_overlap_conflicts
,
1229 &hf_dvbci_t_frag_multiple_tails
,
1230 &hf_dvbci_t_frag_too_long_frag
,
1231 &hf_dvbci_t_frag_err
,
1232 &hf_dvbci_t_frag_cnt
,
1234 &hf_dvbci_t_reass_in
,
1235 &hf_dvbci_t_reass_len
,
1236 /* Reassembled data field */
1243 typedef struct _spdu_info_t
{
1249 static const value_string dvbci_hw_event
[] = {
1250 { CAM_IN
, "CI Module is inserted" },
1251 { CAM_OUT
, "CI Module is removed" },
1252 { POWER_ON
, "CI slot power on" },
1253 { POWER_OFF
, "CI slot power off" },
1254 { TS_ROUTE
, "Transport stream routed through the CI Module" },
1255 { TS_BYPASS
, "Transport stream bypasses the CI Module" },
1256 { RESET_H
, "Reset pin is high" },
1257 { RESET_L
, "Reset pin is low" },
1258 { READY_H
, "Ready pin is high" },
1259 { READY_L
, "Ready pin is low" },
1262 static const value_string dvbci_cis_tpl_code
[] = {
1263 { CISTPL_NO_LINK
, "No-link tuple" },
1264 { CISTPL_VERS_1
, "Level 1 version/product information" },
1265 { CISTPL_CONFIG
, "Configuration for a 16bit PC-Card" },
1266 { CISTPL_CFTABLE_ENTRY
, "Configuration-table entry" },
1267 { CISTPL_DEVICE_OC
, "Device information for Common Memory" },
1268 { CISTPL_DEVICE_OA
, "Device information for Attribute Memory" },
1269 { CISTPL_MANFID
, "Manufacturer identification string" },
1270 { CISTPL_END
, "End of chain" },
1273 static const value_string dvbci_cis_subtpl_code
[] = {
1274 { CCSTPL_CIF
, "Custom interface subtuple" },
1277 static const value_string dvbci_cis_tpce_if_type
[] = {
1278 { TPCE_IF_TYPE_MEM
, "Memory" },
1279 { TPCE_IF_TYPE_IO_MEM
, "I/O and Memory" },
1280 { TPCE_IF_TYPE_CUST0
, "Custom Interface 0" },
1281 { TPCE_IF_TYPE_CUST1
, "Custom Interface 1" },
1282 { TPCE_IF_TYPE_CUST2
, "Custom Interface 2" },
1283 { TPCE_IF_TYPE_CUST3
, "Custom Interface 3" },
1286 static const value_string dvbci_cis_dev_vcc_used
[] = {
1287 { CIS_DEV_VCC50
, "5.0V" },
1288 { CIS_DEV_VCC33
, "3.3V" },
1291 static const value_string dvbci_ml
[] = {
1292 { ML_MORE
, "more TPDU fragments pending" },
1293 { ML_LAST
, "last TPDU fragment" },
1296 static const value_string dvbci_c_tpdu
[] = {
1298 { T_CREATE_T_C
, "T_create_t_c" },
1299 { T_DELETE_T_C
, "T_delete_t_c" },
1300 { T_D_T_C_REPLY
, "T_d_t_c_reply" },
1301 { T_NEW_T_C
, "T_new_t_c" },
1302 { T_T_C_ERROR
, "T_t_c_error" },
1303 { T_DATA_LAST
, "T_data_last" },
1304 { T_DATA_MORE
, "T_data_more" },
1307 static const value_string dvbci_r_tpdu
[] = {
1308 { T_C_T_C_REPLY
, "T_c_tc_reply" },
1309 { T_DELETE_T_C
, "T_delete_t_c" },
1310 { T_D_T_C_REPLY
, "T_d_t_c_reply" },
1311 { T_REQUEST_T_C
, "T_request_t_c" },
1312 { T_DATA_LAST
, "T_data_last" },
1313 { T_DATA_MORE
, "T_data_more" },
1316 static const value_string dvbci_sb_value
[] = {
1317 { SB_VAL_MSG_AVAILABLE
, "message available" },
1318 { SB_VAL_NO_MSG_AVAILABLE
, "no message available" },
1321 static const value_string dvbci_spdu_tag
[] = {
1322 { T_SESSION_NUMBER
, "Session Number (payload data)" },
1323 { T_OPEN_SESSION_REQUEST
, "Open Session Request" },
1324 { T_OPEN_SESSION_RESPONSE
, "Open Session Response" },
1325 { T_CREATE_SESSION
, "Create Session" },
1326 { T_CREATE_SESSION_RESPONSE
, "Create Session Response" },
1327 { T_CLOSE_SESSION_REQUEST
, "Close Session Request" },
1328 { T_CLOSE_SESSION_RESPONSE
, "Close Session Response" },
1331 static GHashTable
*spdu_table
;
1332 static const spdu_info_t spdu_info
[] = {
1333 { T_SESSION_NUMBER
, DIRECTION_ANY
, 2 },
1334 { T_OPEN_SESSION_REQUEST
, DATA_CAM_TO_HOST
, 4 },
1335 { T_OPEN_SESSION_RESPONSE
, DATA_HOST_TO_CAM
, 7 },
1336 { T_CREATE_SESSION
, DATA_HOST_TO_CAM
, 6 },
1337 { T_CREATE_SESSION_RESPONSE
, DATA_CAM_TO_HOST
, 7 },
1338 { T_CLOSE_SESSION_REQUEST
, DIRECTION_ANY
, 2 },
1339 { T_CLOSE_SESSION_RESPONSE
, DIRECTION_ANY
, 3 }
1341 static const value_string dvbci_sess_status
[] = {
1344 { SESS_NOT_OPENED_RES_NON_EXIST
,
1345 "Resource does not exist" },
1346 { SESS_NOT_OPENED_RES_UNAVAIL
,
1347 "Resource exists but it's unavailable" },
1348 { SESS_NOT_OPENED_RES_VER_LOWER
,
1349 "Existing resource's version is lower than requested version" },
1350 { SESS_NOT_OPENED_RES_BUSY
,
1351 "Resource is busy" },
1354 static const value_string dvbci_close_sess_status
[] = {
1355 { SESS_CLOSED
, "Session closed" },
1356 { SESS_NB_NOT_ALLOC
, "Session number not allocated" },
1359 static const value_string dvbci_res_class
[] = {
1360 { RES_CLASS_RM
, "Resource Manager" },
1361 { RES_CLASS_AP
, "Application Info" },
1362 { RES_CLASS_CA
, "Conditional Access" },
1363 { RES_CLASS_AUT
, "Authentication" },
1364 { RES_CLASS_HC
, "Host Control" },
1365 { RES_CLASS_DT
, "Date-Time" },
1366 { RES_CLASS_MMI
, "Man-machine interface (MMI)" },
1367 { RES_CLASS_AMI
, "Application MMI" },
1368 { RES_CLASS_LSC
, "Low-Speed Communication" },
1369 { RES_CLASS_CC
, "Content Control" },
1370 { RES_CLASS_HLC
, "Host Language & Country" },
1371 { RES_CLASS_CUP
, "CAM Upgrade" },
1372 { RES_CLASS_OPP
, "Operator Profile" },
1373 { RES_CLASS_AFS
, "Auxiliary File System" },
1374 { RES_CLASS_SAS
, "Specific Application Support" },
1377 static const value_string dvbci_app_type
[] = {
1378 { APP_TYPE_CA
, "Conditional Access" },
1379 { APP_TYPE_EPG
, "Electronic Program Guide" },
1382 static const value_string dvbci_data_rate
[] = {
1383 { DATA_RATE_72
, "72 Mbit/s" },
1384 { DATA_RATE_96
, "96 Mbit/s" },
1387 static const value_string dvbci_ca_pmt_list_mgmt
[] = {
1388 { LIST_MGMT_MORE
, "more" },
1389 { LIST_MGMT_FIRST
, "first" },
1390 { LIST_MGMT_LAST
, "last" },
1391 { LIST_MGMT_ONLY
, "only" },
1392 { LIST_MGMT_ADD
, "add" },
1393 { LIST_MGMT_UPDATE
, "update" },
1396 static const value_string dvbci_ca_pmt_cmd_id
[] = {
1397 { CMD_ID_OK_DESCR
, "ok descrambling" },
1398 { CMD_ID_OK_MMI
, "ok mmi" },
1399 { CMD_ID_QUERY
, "query" },
1400 { CMD_ID_NOT_SELECTED
, "not selected" },
1403 static const value_string dvbci_ca_enable
[] = {
1404 { CA_ENAB_DESC_OK
, "descrambling possible" },
1405 { CA_ENAB_DESC_OK_PURCHASE
,
1406 "descrambling possible under conditions (purchase dialogue)" },
1407 { CA_ENAB_DESC_OK_TECH
,
1408 "descrambling possible under conditions (technical dialogue)" },
1409 { CA_ENAB_DESC_NG_ENTITLEMENT
,
1410 "descrambling not possible (because no entitlement)" },
1411 { CA_ENAB_DESC_NG_TECH
,
1412 "descrambling not possible (for technical reasons)" },
1415 static const value_string dvbci_hc_status
[] = {
1416 { HC_STAT_OK
, "ok" },
1417 { HC_STAT_ERR_DLVRY
, "unsupported delivery system descriptor" },
1418 { HC_STAT_ERR_LOCK
, "tuner not locking" },
1419 { HC_STAT_ERR_BUSY
, "tuner busy" },
1420 { HC_STAT_ERR_PARAM
, "bad or missing parameters" },
1421 { HC_STAT_ERR_NOT_FOUND
, "service not found" },
1422 { HC_STAT_ERR_UNKNOWN
, "unknown error" },
1425 static const value_string dvbci_hc_release_reply
[] = {
1426 { HC_RELEASE_OK
, "Host regains control of the tuner" },
1427 { HC_RELEASE_REFUSED
, "CICAM retains control of the tuner" },
1430 static const value_string dvbci_close_mmi_cmd_id
[] = {
1431 { CLOSE_MMI_CMD_ID_IMMEDIATE
, "immediate close" },
1432 { CLOSE_MMI_CMD_ID_DELAY
, "delayed close" },
1435 static const value_string dvbci_disp_ctl_cmd
[] = {
1436 { DISP_CMD_SET_MMI_MODE
, "set MMI mode" },
1437 { DISP_CMD_GET_DISP_TBL
, "get display character tables" },
1438 { DISP_CMD_GET_INP_TBL
, "get input character tables" },
1441 static const value_string dvbci_mmi_mode
[] = {
1442 { MMI_MODE_HIGH
, "High-level MMI" },
1445 static const value_string dvbci_disp_rep_id
[] = {
1446 { DISP_REP_ID_MMI_MODE_ACK
, "MMI mode acknowledge" },
1447 { DISP_REP_ID_DISP_CHAR_TBL
, "list display character tables" },
1448 { DISP_REP_ID_INP_CHAR_TBL
, "list input character tables" },
1449 { DISP_REP_ID_UNKNOWN_CMD
, "unknown display control command" },
1450 { DISP_REP_ID_UNKNOWN_MMI_MODE
, "unknown MMI mode" },
1451 { DISP_REP_ID_UNKNOWN_CHAR_TBL
, "unknown character table" },
1454 static const value_string dvbci_blind_ans
[] = {
1455 { VISIBLE_ANS
, "visible" },
1456 { BLIND_ANS
, "blind" },
1459 static const value_string dvbci_ans_id
[] = {
1460 { ANSW_ID_CANCEL
, "cancel" },
1461 { ANSW_ID_ANSWER
, "answer" },
1464 static const value_string dvbci_cup_type
[] = {
1465 { CUP_DELAYED
, "delayed" },
1466 { CUP_IMMEDIATE
, "immediate" },
1469 static const value_string dvbci_cup_answer
[] = {
1470 { CUP_ANS_NO
, "upgrade denied" },
1471 { CUP_ANS_YES
, "upgrade allowed" },
1472 { CUP_ANS_ASK
, "ask the user for permission" },
1475 static const value_string dvbci_cup_reset
[] = {
1476 { CUP_RESET_PCMCIA
, "PCMCIA reset" },
1477 { CUP_RESET_CMDIF
, "CI command interface reset" },
1478 { CUP_RESET_NONE
, "no reset" },
1481 static const value_string dvbci_cc_dat_id
[] = {
1482 { CC_ID_HOST_ID
, "Host ID" },
1483 { CC_ID_CICAM_ID
, "Cicam ID" },
1484 { CC_ID_HOST_BRAND_CERT
, "Host brand certificate" },
1485 { CC_ID_CICAM_BRAND_CERT
, "Cicam brand certificate" },
1486 { CC_ID_KP
, "Key precursor for CCK" },
1487 { CC_ID_DHPH
, "Host Diffie-Hellman public key" },
1488 { CC_ID_DHPM
, "Cicam Diffie-Hellman public key" },
1489 { CC_ID_HOST_DEV_CERT
, "Host device certificate" },
1490 { CC_ID_CICAM_DEV_CERT
, "Cicam device certificate" },
1491 { CC_ID_SIG_A
, "Signature of host Diffie-Hellman public key" },
1492 { CC_ID_SIG_B
, "Signature of cicam Diffie-Hellman public key" },
1493 { CC_ID_NS_HOST
, "Host nonce" },
1494 { CC_ID_AUTH_NONCE
, "Nonce for authentication" },
1495 { CC_ID_NS_MODULE
, "Cicam nonce" },
1496 { CC_ID_AKH
, "Host authentication key" },
1497 { CC_ID_URI
, "URI" },
1498 { CC_ID_PROG_NUM
, "Program number" },
1499 { CC_ID_URI_CNF
, "URI confirmation" },
1500 { CC_ID_KEY_REGISTER
, "Key register" },
1501 { CC_ID_URI_VERSIONS
, "Supported URI versions" },
1502 { CC_ID_STATUS_FIELD
, "Status field" },
1503 { CC_ID_SRM_DATA
, "SRM for HDCP" },
1504 { CC_ID_SRM_CONFIRM
, "SRM confirmation hash" },
1505 { CC_ID_CICAM_LICENSE
, "License received from the cicam" },
1506 { CC_ID_LICENSE_STATUS
, "Current status of the license" },
1507 { CC_ID_LICENSE_RCV_STATUS
, "Status of the license exchange" },
1508 { CC_ID_HOST_LICENSE
,
1509 "License for which the host requests the current status" },
1510 { CC_ID_PLAY_COUNT
, "Play count" },
1511 { CC_ID_OPERATING_MODE
, "Operating mode" },
1512 { CC_ID_PINCODE_DATA
, "Pincode data" },
1513 { CC_ID_REC_START_STATUS
, "Record start status" },
1514 { CC_ID_MODE_CHG_STATUS
, "Change operating mode status" },
1515 { CC_ID_REC_STOP_STATUS
, "Record stop status" },
1518 static const value_string dvbci_cc_uri_emi
[] = {
1519 { CC_EMI_FREE
, "Copy free" },
1520 { CC_EMI_NO_MORE
, "Copy no more" },
1521 { CC_EMI_ONCE
, "Copy once" },
1522 { CC_EMI_NEVER
, "Copy never" },
1525 static const value_string dvbci_cc_key_register
[] = {
1526 { CC_KEY_EVEN
, "Even" },
1527 { CC_KEY_ODD
, "Odd" },
1530 static const value_string dvbci_cc_status
[] = {
1531 { CC_STATUS_OK
, "Ok" },
1532 { CC_STATUS_NO_CC_SUPPORT
, "No CC support" },
1533 { CC_STATUS_HOST_BUSY
, "Host busy" },
1534 { CC_STATUS_AUTH_FAILED_OR_NO_SRM
, "Authentication failed / SRM not required" },
1535 { CC_STATUS_CICAM_BUSY
, "CICAM busy" },
1536 { CC_STATUS_REC_MODE_ERR
, "Recording mode error" },
1539 static const value_string dvbci_cc_sac_auth
[] = {
1540 { CC_SAC_AUTH_AES128_XCBC_MAC
, "AES 128 XCBC MAC" },
1543 static const value_string dvbci_cc_sac_enc
[] = {
1544 { CC_SAC_ENC_AES128_CBC
, "AES 128 CBC" },
1547 static const value_string dvbci_cc_cap
[] = {
1549 "No PIN handling capability" },
1551 "CAM can do PIN handling on CAS services" },
1552 { CC_CAP_CAS_FTA_PIN
,
1553 "CAM can do PIN handling on CAS and free services" },
1554 { CC_CAP_CAS_PIN_CACHED
,
1555 "CAM can do PIN handling on CAS services and supports PIN caching" },
1556 { CC_CAP_CAS_FTA_PIN_CACHED
,
1557 "CAM can do PIN handling on CAS and free services, supports PIN caching" },
1560 static const value_string dvbci_pincode_status
[] = {
1561 { CC_PIN_BAD
, "Bad pin code" },
1562 { CC_PIN_CAM_BUSY
, "CAM busy" },
1563 { CC_PIN_OK
, "Pin code correct" },
1564 { CC_PIN_UNCONFIRMED
, "Pin code unconfirmed" },
1565 { CC_PIN_VB_NOT_REQ
, "Video blanking not required" },
1566 { CC_PIN_CSA
, "Content still CSA scrambled" },
1569 static const value_string dvbci_cc_op_mode
[] = {
1570 { CC_OP_MODE_WATCH_BUFFER
, "Watch and buffer" },
1571 { CC_OP_MODE_TIMESHIFT
, "Timeshift" },
1572 { CC_OP_MODE_UNATTENDED
, "Unattended recording" },
1575 static const value_string dvbci_ack_code
[] = {
1576 { ACK_CODE_OK
, "Ok" },
1577 { ACK_CODE_WRONG_API
, "Application Domain unsupported" },
1578 { ACK_CODE_API_BUSY
, "Application Domain currently unavailable" },
1581 static const value_string dvbci_req_type
[] = {
1582 { REQ_TYPE_FILE
, "File" },
1583 { REQ_TYPE_DATA
, "Data" },
1584 { REQ_TYPE_FILE_HASH
, "FileHash" },
1585 { REQ_TYPE_REQ
, "List supported request types" },
1588 static const value_string dvbci_comms_cmd_id
[] = {
1589 { COMMS_CMD_ID_CONNECT_ON_CHANNEL
, "connect on channel" },
1590 { COMMS_CMD_ID_DISCONNECT_ON_CHANNEL
, "disconnect on channel" },
1591 { COMMS_CMD_ID_SET_PARAMS
, "set parameters" },
1592 { COMMS_CMD_ID_ENQUIRE_STATUS
, "status enquiry" },
1593 { COMMS_CMD_ID_GET_NEXT_BUFFER
, "get next buffer" },
1596 static const value_string dvbci_conn_desc_type
[] = {
1597 { CONN_DESC_TEL
, "DVB-SI telephone descriptor" },
1598 { CONN_DESC_CABLE
, "cable return channel" },
1599 { CONN_DESC_IP
, "IP descriptor" },
1600 { CONN_DESC_HOSTNAME
, "hostname descriptor" },
1603 static const value_string dvbci_lsc_desc_tag
[] = {
1604 { LSC_DESC_IP
, "IP descriptor" },
1605 { LSC_DESC_HOSTNAME
, "hostname descriptor" },
1608 static const value_string dvbci_lsc_ip_ver
[] = {
1609 { LSC_IPV4
, "IPv4" },
1610 { LSC_IPV6
, "IPv6" },
1613 static const value_string dvbci_lsc_proto
[] = {
1618 static const value_string dvbci_comms_rep_id
[] = {
1619 { COMMS_REP_ID_CONNECT_ACK
, "connect ack" },
1620 { COMMS_REP_ID_DISCONNECT_ACK
, "disconnect ack" },
1621 { COMMS_REP_ID_SET_PARAMS_ACK
, "set parameters ack" },
1622 { COMMS_REP_ID_STATUS_REPLY
, "status reply" },
1623 { COMMS_REP_ID_GET_NEXT_BUFFER_ACK
, "get next buffer ack" },
1624 { COMMS_REP_ID_SEND_ACK
, "send ack" },
1627 static const value_string dvbci_lsc_ret_val
[] = {
1628 { LSC_RET_OK
, "ok" },
1631 static const value_string dvbci_lsc_connect
[] = {
1632 { LSC_DISCONNECTED
, "disconnected" },
1633 { LSC_CONNECTED
, "connected" },
1636 static const value_string dvbci_lsc_ret_val_params
[] = {
1637 { LSC_RET_OK
, "ok" },
1638 { LSC_RET_TOO_BIG
, "buffer size too big" },
1641 static const value_string dvbci_afs_ack_code
[] = {
1642 { AFS_ACK_RSV
, "Reserved for future use" },
1643 { AFS_ACK_OK
, "The application environment is supported by the Host" },
1644 { AFS_ACK_UNKNOWN
, "The DomainIdentifier is not supported by the Host" },
1647 static const value_string dvbci_opp_ref_req_flag
[] = {
1648 { OPP_REF_REG_FLG_NONE
, "none" },
1649 { OPP_REF_REG_FLG_ADV
, "advance warning" },
1650 { OPP_REF_REG_FLG_URG
, "urgent" },
1651 { OPP_REF_REG_FLG_SCHED
, "scheduled" },
1654 static const value_string dvbci_opp_err_flag
[] = {
1655 { OPP_ERR_FLG_OK
, "no error" },
1656 { OPP_ERR_FLG_PROF
, "CICAM can't acquire the profile" },
1657 { OPP_ERR_FLG_UNSUPPORTED
, "unsupported delivery system" },
1658 { OPP_ERR_FLG_CANCELLED
, "operator search was cancelled" },
1661 static const value_string dvbci_opp_eit_pf_usage
[] = {
1662 { OPP_EIT_ABSENT
, "no EIT present" },
1663 { OPP_EIT_NOT_X
, "EIT is not fully ross-carried" },
1664 { OPP_EIT_FULL_X
, "EIT is fully cross-carried" },
1667 static const value_string dvbci_opp_eit_sch_usage
[] = {
1668 { OPP_EIT_ABSENT
, "no EIT present" },
1669 { OPP_EIT_NOT_X
, "EIT is not fully ross-carried" },
1670 { OPP_EIT_FULL_X
, "EIT is fully cross-carried" },
1671 { OPP_EIT_BARKER
, "EIT is available from a barker channel" },
1672 { OPP_EPG_APP
, "EPG is delivered using an application" },
1675 static const value_string dvbci_opp_ext_evt
[] = {
1676 { OPP_EXT_EVT_DIFF
, "extended event info is different from short event" },
1677 { OPP_EXT_EVT_ADD
, "extended event info includes short event" },
1680 static const value_string dvbci_opp_dlv_cap
[] = {
1681 { OPP_DLV_CAP_S
, "DVB-S" },
1682 { OPP_DLV_CAP_C
, "DVB-C" },
1683 { OPP_DLV_CAP_T
, "DVB-T" },
1684 { OPP_DLV_CAP_S2
, "DVB-S2" },
1687 static const value_string dvbci_opp_tune_stat
[] = {
1688 { OPP_TUNE_OK
, "success" },
1689 { OPP_TUNE_UNSUPPORTED
, "unsupported delivery system descriptor" },
1690 { OPP_TUNE_INVALID
, "invalid delivery system descriptor" },
1691 { OPP_TUNE_ERR
, "failed" },
1694 static const value_string dvbci_sas_sess_state
[] = {
1695 { SAS_SESS_STATE_CONNECTED
, "connected" },
1696 { SAS_SESS_STATE_NOT_FOUND
, "application not found" },
1697 { SAS_SESS_STATE_DENIED
, "denied, no more connections available" },
1701 extern value_string_ext mpeg_pmt_stream_type_vals_ext
;
1703 static uint16_t buf_size_cam
; /* buffer size proposal by the CAM */
1704 /* buffer size proposal by the host == negotiated buffer size */
1705 static uint16_t buf_size_host
;
1709 dvbci_set_addrs(uint8_t event
, packet_info
*pinfo
)
1711 if (!IS_DATA_TRANSFER(event
))
1714 if (event
== DVBCI_EVT_DATA_HOST_TO_CAM
) {
1715 set_address(&pinfo
->src
, AT_STRINGZ
,
1716 (int)strlen(ADDR_HOST
)+1, ADDR_HOST
);
1717 set_address(&pinfo
->dst
, AT_STRINGZ
,
1718 (int)strlen(ADDR_CAM
)+1 , ADDR_CAM
);
1721 set_address(&pinfo
->src
, AT_STRINGZ
,
1722 (int)strlen(ADDR_CAM
)+1 , ADDR_CAM
);
1723 set_address(&pinfo
->dst
, AT_STRINGZ
,
1724 (int)strlen(ADDR_HOST
)+1, ADDR_HOST
);
1731 dvbci_get_evt_from_addrs(packet_info
*pinfo
)
1733 /* this should be working from C89 on */
1734 static const address a_cam
= ADDRESS_INIT(AT_STRINGZ
, sizeof(ADDR_CAM
), ADDR_CAM
);
1735 static const address a_host
= ADDRESS_INIT(AT_STRINGZ
, sizeof(ADDR_HOST
), ADDR_HOST
);
1737 if ( addresses_equal(&(pinfo
->src
), &a_cam
) &&
1738 addresses_equal(&(pinfo
->dst
), &a_host
) ) {
1739 return DVBCI_EVT_DATA_CAM_TO_HOST
;
1741 else if ( addresses_equal(&(pinfo
->src
), &a_host
) &&
1742 addresses_equal(&(pinfo
->dst
), &a_cam
) ) {
1743 return DVBCI_EVT_DATA_HOST_TO_CAM
;
1746 return DVBCI_EVT_INVALID_EVT
;
1750 /* this must be a function, not a macro,
1751 so that we can enforce the return type */
1752 static inline int16_t two_comp_to_int16(uint16_t x
)
1754 return (x
&0x8000) ? -~(x
-1) : x
;
1758 /* initialize/reset per capture state data */
1767 /* dissect a delivery system descriptor loop
1768 and the preceding length field
1769 (used for host control and operator profile)
1770 return the number of bytes dissected */
1772 dissect_desc_loop(int len_hf
,
1773 tvbuff_t
*tvb
, int offset
, packet_info
*pinfo _U_
, proto_tree
*tree
)
1776 uint16_t desc_loop_len
;
1779 offset_start
= offset
;
1781 desc_loop_len
= tvb_get_ntohs(tvb
, offset
) & 0x0FFF;
1782 proto_tree_add_item(tree
, len_hf
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1784 while (offset
-offset_start
< 2+desc_loop_len
) {
1785 desc_len
= proto_mpeg_descriptor_dissect(tvb
, offset
, tree
);
1791 return offset
-offset_start
;
1795 /* dissect operator profile's status body, return its length */
1797 dissect_opp_status_body(tvbuff_t
*tvb
, int offset
,
1798 packet_info
*pinfo _U_
, proto_tree
*tree
)
1802 offset_start
= offset
;
1803 proto_tree_add_item(tree
, hf_dvbci_info_ver_op_status
,
1804 tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1805 proto_tree_add_item(tree
, hf_dvbci_nit_ver
,
1806 tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1808 proto_tree_add_item(tree
, hf_dvbci_pro_typ
,
1809 tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1810 proto_tree_add_item(tree
, hf_dvbci_init_flag
,
1811 tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1812 proto_tree_add_item(tree
, hf_dvbci_ent_chg_flag
,
1813 tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1814 proto_tree_add_item(tree
, hf_dvbci_ent_val_flag
,
1815 tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1816 proto_tree_add_item(tree
, hf_dvbci_ref_req_flag
,
1817 tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1819 proto_tree_add_item(tree
, hf_dvbci_err_flag
,
1820 tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1821 proto_tree_add_bitmask(tree
, tvb
, offset
,
1822 hf_dvbci_dlv_sys_hint
, ett_dvbci_dlv_sys_hint
,
1823 dvbci_opp_dlv_sys_hint_fields
, ENC_BIG_ENDIAN
);
1825 proto_tree_add_item(tree
, hf_dvbci_refr_req_date
,
1826 tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1828 proto_tree_add_item(tree
, hf_dvbci_refr_req_time
,
1829 tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1832 return offset
-offset_start
;
1836 /* dissect a capability loop in an operator_search_start apdu */
1838 dissect_opp_cap_loop(uint8_t cap_loop_len
, const char *title
,
1839 int item_hf
, unsigned item_len
,
1840 tvbuff_t
*tvb
, int offset
,
1841 packet_info
*pinfo _U_
, proto_tree
*tree
)
1843 proto_tree
*loop_tree
= NULL
;
1851 if (tree
&& cap_loop_len
>0) {
1852 loop_tree
= proto_tree_add_subtree(tree
, tvb
, offset
, cap_loop_len
, ett_dvbci_opp_cap_loop
, NULL
, title
);
1854 for (i
=0; i
<item_len
*cap_loop_len
; i
+=item_len
) {
1855 proto_tree_add_item(loop_tree
, item_hf
,
1856 tvb
, offset
+i
, item_len
, ENC_BIG_ENDIAN
);
1859 return cap_loop_len
;
1863 /* dissect age rating byte encoded as defined in
1864 DVB-SI parental rating descriptor
1865 returns rating's length in bytes or -1 for error */
1867 dissect_rating(tvbuff_t
*tvb
, int offset
,
1868 packet_info
*pinfo _U_
, proto_tree
*tree
)
1872 rating
= tvb_get_uint8(tvb
, offset
);
1873 if (1<=rating
&& rating
<=0x0F) {
1874 proto_tree_add_uint_format(tree
, hf_dvbci_rating
,
1875 tvb
, offset
, 1, rating
,
1876 "Rating is %d years (%d+3)", rating
+3, rating
);
1878 proto_tree_add_uint_format(tree
, hf_dvbci_rating
,
1879 tvb
, offset
, 1, rating
,
1880 "Rating is unknown/undefined (%d)", rating
);
1887 /* if there's a dissector for the protocol and target port of our
1888 lsc connection, store it in the lsc session's circuit */
1890 store_lsc_msg_dissector(conversation_t
*conv
, uint8_t ip_proto
, uint16_t port
)
1892 dissector_handle_t msg_handle
= NULL
;
1897 if (ip_proto
==LSC_TCP
)
1898 msg_handle
= dissector_get_uint_handle(tcp_dissector_table
, port
);
1899 else if (ip_proto
==LSC_UDP
)
1900 msg_handle
= dissector_get_uint_handle(udp_dissector_table
, port
);
1902 conversation_set_dissector(conv
, msg_handle
);
1906 /* dissect a connection_descriptor for the lsc resource
1907 returns its length or -1 for error */
1909 dissect_conn_desc(tvbuff_t
*tvb
, int offset
, conversation_t
*conv
,
1910 packet_info
*pinfo
, proto_tree
*tree
)
1913 proto_tree
*conn_desc_tree
= NULL
;
1915 int offset_start
, offset_body
;
1917 uint8_t conn_desc_type
;
1918 uint8_t ip_ver
, ip_proto
;
1920 proto_item
*port_item
= NULL
;
1923 offset_start
= offset
;
1925 tag
= tvb_get_ntoh24(tvb
, offset
);
1926 if (tag
!= T_CONNECTION_DESCRIPTOR
)
1929 conn_desc_tree
= proto_tree_add_subtree(tree
, tvb
,
1930 offset_start
, -1, ett_dvbci_lsc_conn_desc
, &ti
, "Connection descriptor");
1932 proto_tree_add_item(conn_desc_tree
, hf_dvbci_apdu_tag
,
1933 tvb
, offset
, APDU_TAG_SIZE
, ENC_BIG_ENDIAN
);
1934 offset
+= APDU_TAG_SIZE
;
1935 offset
= dissect_ber_length(pinfo
, conn_desc_tree
,
1936 tvb
, offset
, &len_field
, NULL
);
1937 offset_body
= offset
;
1939 conn_desc_type
= tvb_get_uint8(tvb
, offset
);
1940 proto_tree_add_item(conn_desc_tree
, hf_dvbci_conn_desc_type
,
1941 tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1944 if (conn_desc_type
== CONN_DESC_IP
) {
1945 proto_tree_add_item(conn_desc_tree
, hf_dvbci_lsc_media_tag
,
1946 tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1948 proto_tree_add_item(conn_desc_tree
, hf_dvbci_lsc_media_len
,
1949 tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1951 ip_ver
= tvb_get_uint8(tvb
, offset
);
1952 proto_tree_add_item(conn_desc_tree
, hf_dvbci_lsc_ip_ver
,
1953 tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1956 if (ip_ver
== LSC_IPV4
) {
1957 offset
+= FT_IPv6_LEN
-FT_IPv4_LEN
;
1958 proto_tree_add_item(conn_desc_tree
, hf_dvbci_lsc_ipv4_addr
,
1959 tvb
, offset
, FT_IPv4_LEN
, ENC_BIG_ENDIAN
);
1960 offset
+= FT_IPv4_LEN
;
1962 else if (ip_ver
== LSC_IPV6
) {
1963 proto_tree_add_item(conn_desc_tree
, hf_dvbci_lsc_ipv6_addr
,
1964 tvb
, offset
, FT_IPv6_LEN
, ENC_NA
);
1965 offset
+= FT_IPv6_LEN
;
1968 offset
+= FT_IPv6_LEN
;
1970 port
= tvb_get_ntohs(tvb
, offset
);
1971 port_item
= proto_tree_add_item(conn_desc_tree
,
1972 hf_dvbci_lsc_dst_port
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1974 ip_proto
= tvb_get_uint8(tvb
, offset
);
1975 proto_tree_add_item(conn_desc_tree
, hf_dvbci_lsc_proto
,
1976 tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1979 if (ip_proto
==LSC_TCP
&& tcp_port_to_display(pinfo
->pool
, port
)) {
1980 proto_item_append_text(port_item
, " (%s)",
1981 tcp_port_to_display(pinfo
->pool
, port
));
1983 else if (ip_proto
==LSC_UDP
&& udp_port_to_display(pinfo
->pool
, port
)) {
1984 proto_item_append_text(port_item
, " (%s)",
1985 udp_port_to_display(pinfo
->pool
, port
));
1988 store_lsc_msg_dissector(conv
, ip_proto
, port
);
1990 } else if (conn_desc_type
== CONN_DESC_HOSTNAME
) {
1991 proto_tree_add_item(conn_desc_tree
, hf_dvbci_lsc_media_tag
,
1992 tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1994 proto_tree_add_item(conn_desc_tree
, hf_dvbci_lsc_media_len
,
1995 tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1997 ip_proto
= tvb_get_uint8(tvb
, offset
);
1998 proto_tree_add_item(conn_desc_tree
, hf_dvbci_lsc_proto
,
1999 tvb
, offset
, 1, ENC_BIG_ENDIAN
);
2001 port
= tvb_get_ntohs(tvb
, offset
);
2002 port_item
= proto_tree_add_item(conn_desc_tree
,
2003 hf_dvbci_lsc_dst_port
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
2006 if (ip_proto
==LSC_TCP
&& tcp_port_to_display(pinfo
->pool
, port
)) {
2007 proto_item_append_text(port_item
, " (%s)",
2008 tcp_port_to_display(pinfo
->pool
, port
));
2010 else if (ip_proto
==LSC_UDP
&& udp_port_to_display(pinfo
->pool
, port
)) {
2011 proto_item_append_text(port_item
, " (%s)",
2012 udp_port_to_display(pinfo
->pool
, port
));
2015 store_lsc_msg_dissector(conv
, ip_proto
, port
);
2017 /* everything from here to the descriptor's end is a hostname */
2018 hostname_len
= (offset_body
+len_field
)-offset
;
2019 proto_tree_add_item(conn_desc_tree
, hf_dvbci_lsc_hostname
,
2020 tvb
, offset
, hostname_len
, ENC_ASCII
);
2021 offset
+= hostname_len
;
2023 proto_tree_add_item(conn_desc_tree
, hf_dvbci_lsc_media_data
,
2024 tvb
, offset
, len_field
-1, ENC_NA
);
2025 offset
+= len_field
-1;
2028 proto_item_set_len(ti
, offset
-offset_start
);
2029 return offset
-offset_start
;
2033 /* check if the given CC resource item may appear in the clear
2034 as part of an exported PDU */
2036 is_cc_item_exportable(uint8_t dat_id
)
2038 /* the CCK precursor value does not contain sensitive information as such
2039 nevertheless, it is safer to prevent people from exporting this value
2041 if (dat_id
== CC_ID_KP
)
2043 /* we could add some more items here which do not appear in SAC messages
2044 normally: CC_ID_DHPH, CC_ID_DHPM */
2050 /* dissect the URI, return the number of bytes processed or -1 for error */
2052 dissect_uri(tvbuff_t
*tvb
, int offset
, packet_info
*pinfo
, proto_tree
*tree
)
2055 uint8_t uri_ver
, emi
, rl
;
2056 proto_item
*rl_item
;
2058 offset_start
= offset
;
2060 col_append_sep_str(pinfo
->cinfo
, COL_INFO
, NULL
, "URI");
2062 uri_ver
= tvb_get_uint8(tvb
, offset
);
2063 proto_tree_add_item(tree
, hf_dvbci_uri_ver
,
2064 tvb
, offset
, 1, ENC_BIG_ENDIAN
);
2067 proto_tree_add_item(tree
, hf_dvbci_uri_aps
,
2068 tvb
, offset
, 1, ENC_BIG_ENDIAN
);
2069 emi
= (tvb_get_uint8(tvb
, offset
) & 0x30) >> 4;
2070 proto_tree_add_item(tree
, hf_dvbci_uri_emi
,
2071 tvb
, offset
, 1, ENC_BIG_ENDIAN
);
2072 col_append_sep_str(pinfo
->cinfo
, COL_INFO
, NULL
,
2073 val_to_str_const(emi
, dvbci_cc_uri_emi
, "unknown"));
2074 proto_tree_add_item(tree
, hf_dvbci_uri_ict
,
2075 tvb
, offset
, 1, ENC_BIG_ENDIAN
);
2076 if (emi
==CC_EMI_FREE
) {
2077 proto_tree_add_item(tree
, hf_dvbci_uri_rct
,
2078 tvb
, offset
, 1, ENC_BIG_ENDIAN
);
2080 if (uri_ver
>=2 && emi
==CC_EMI_NEVER
) {
2081 proto_tree_add_item(tree
, hf_dvbci_uri_dot
,
2082 tvb
, offset
, 1, ENC_BIG_ENDIAN
);
2086 if (emi
==CC_EMI_NEVER
) {
2088 rl
= tvb_get_uint8(tvb
, offset
) & 0x3F;
2090 rl
= tvb_get_uint8(tvb
, offset
);
2092 rl_item
= proto_tree_add_uint(tree
, hf_dvbci_uri_rl
,
2093 tvb
, offset
, 1, rl
);
2096 proto_item_append_text(rl_item
, " (90 minutes)");
2098 proto_item_append_text(rl_item
, " (6 hours)");
2100 proto_item_append_text(rl_item
, " (12 hours)");
2101 else if (uri_ver
>=2 && rl
==0xFF)
2102 proto_item_append_text(rl_item
, " (unlimited)");
2104 /* no need for a range check, rl 0x3F mask was applied above */
2105 proto_item_append_text(rl_item
, " (%d days)", rl
-2);
2109 return offset
-offset_start
;
2113 /* dissect an item from cc_(sac_)data_req/cc_(sac_)data_cnf,
2114 returns its length or -1 for error
2115 if dat_id_ptr is not NULL, fill in the datatype id */
2117 dissect_cc_item(tvbuff_t
*tvb
, int offset
,
2118 packet_info
*pinfo
, proto_tree
*tree
, uint8_t *dat_id_ptr
)
2121 proto_tree
*cc_item_tree
= NULL
;
2125 asn1_ctx_t asn1_ctx
;
2131 offset_start
= offset
;
2132 dat_id
= tvb_get_uint8(tvb
, offset
);
2134 *dat_id_ptr
= dat_id
;
2136 cc_item_tree
= proto_tree_add_subtree_format(tree
, tvb
, offset_start
, -1, ett_dvbci_cc_item
, &ti
,
2137 "CC data item: %s", val_to_str_const(dat_id
, dvbci_cc_dat_id
, "unknown"));
2139 proto_tree_add_item(cc_item_tree
, hf_dvbci_cc_dat_id
,
2140 tvb
, offset
, 1, ENC_BIG_ENDIAN
);
2142 dat_len
= tvb_get_ntohs(tvb
, offset
);
2143 proto_tree_add_item(cc_item_tree
, hf_dvbci_cc_dat_len
,
2144 tvb
, offset
, 2, ENC_BIG_ENDIAN
);
2147 case CC_ID_HOST_BRAND_CERT
:
2148 case CC_ID_CICAM_BRAND_CERT
:
2149 case CC_ID_HOST_DEV_CERT
:
2150 case CC_ID_CICAM_DEV_CERT
:
2151 asn1_ctx_init(&asn1_ctx
, ASN1_ENC_BER
, true, pinfo
);
2152 hf_cert_index
= (dat_id
==CC_ID_HOST_BRAND_CERT
||
2153 dat_id
==CC_ID_CICAM_BRAND_CERT
) ?
2154 hf_dvbci_brand_cert
: hf_dvbci_dev_cert
;
2156 /* enable dissection of CI+ specific X.509 extensions
2157 only for our certificates */
2158 x509ce_enable_ciplus();
2159 dissect_x509af_Certificate(false, tvb
, offset
,
2160 &asn1_ctx
, cc_item_tree
, hf_cert_index
);
2161 x509ce_disable_ciplus();
2164 dissect_uri(tvb
, offset
, pinfo
, cc_item_tree
);
2166 case CC_ID_PROG_NUM
:
2167 prog_num
= tvb_get_ntohs(tvb
, offset
);
2168 col_append_sep_fstr(pinfo
->cinfo
, COL_INFO
, NULL
,
2169 "Program number 0x%x", prog_num
);
2170 proto_tree_add_item(cc_item_tree
, hf_dvbci_cc_prog_num
,
2171 tvb
, offset
, 2, ENC_BIG_ENDIAN
);
2173 case CC_ID_KEY_REGISTER
:
2174 proto_tree_add_item(cc_item_tree
, hf_dvbci_cc_key_register
,
2175 tvb
, offset
, 1, ENC_BIG_ENDIAN
);
2177 case CC_ID_STATUS_FIELD
:
2178 case CC_ID_REC_START_STATUS
:
2179 case CC_ID_MODE_CHG_STATUS
:
2180 case CC_ID_REC_STOP_STATUS
:
2181 status
= tvb_get_uint8(tvb
, offset
);
2182 col_append_sep_fstr(pinfo
->cinfo
, COL_INFO
, NULL
, "Status: %s",
2183 val_to_str_const(status
, dvbci_cc_status
, "unknown"));
2184 proto_tree_add_item(cc_item_tree
, hf_dvbci_cc_status_field
,
2185 tvb
, offset
, 1, ENC_BIG_ENDIAN
);
2187 case CC_ID_OPERATING_MODE
:
2188 proto_tree_add_item(cc_item_tree
, hf_dvbci_cc_op_mode
,
2189 tvb
, offset
, 1, ENC_BIG_ENDIAN
);
2192 proto_tree_add_item(cc_item_tree
, hf_dvbci_cc_data
,
2193 tvb
, offset
, dat_len
, ENC_NA
);
2198 proto_item_set_len(ti
, offset
-offset_start
);
2199 return offset
-offset_start
;
2203 /* add the CC protocol name and step to the info column */
2205 add_cc_protocol_name_step(packet_info
*pinfo
,
2206 uint64_t snd_dat_ids
, uint64_t req_dat_ids
)
2208 bool chk_snd_ids
= false;
2210 switch (req_dat_ids
) {
2211 case CC_ID_DHPH
<<24|CC_ID_SIG_A
<<16|CC_ID_HOST_DEV_CERT
<<8|CC_ID_HOST_BRAND_CERT
:
2212 col_append_sep_str(pinfo
->cinfo
, COL_INFO
, " ",
2213 "(Authentication Step 1)");
2215 case CC_ID_STATUS_FIELD
:
2216 col_append_sep_str(pinfo
->cinfo
, COL_INFO
, " ",
2217 "(Authentication Step 3)");
2220 col_append_sep_str(pinfo
->cinfo
, COL_INFO
, " ",
2221 "(AuthKey Step 1)");
2223 case CC_ID_HOST_ID
<<8|CC_ID_STATUS_FIELD
:
2224 col_append_sep_str(pinfo
->cinfo
, COL_INFO
, " ",
2225 "(CC key calculation Step 1)");
2227 case CC_ID_HOST_ID
<<8|CC_ID_NS_HOST
:
2228 col_append_sep_str(pinfo
->cinfo
, COL_INFO
, " ",
2229 "(SAC key calculation Step 1)");
2232 col_append_sep_str(pinfo
->cinfo
, COL_INFO
, " ",
2233 "(URI transmission Step 1)");
2235 case CC_ID_URI_VERSIONS
:
2236 col_append_sep_str(pinfo
->cinfo
, COL_INFO
, " ",
2237 "(URI version negotiation Step 1)");
2239 case CC_ID_LICENSE_RCV_STATUS
:
2240 col_append_sep_str(pinfo
->cinfo
, COL_INFO
, " ",
2241 "(CICAM to Host License Exchange Step 1)");
2243 case CC_ID_PROG_NUM
<<24|CC_ID_LICENSE_STATUS
<<16|CC_ID_URI
<<8|CC_ID_CICAM_LICENSE
:
2244 col_append_sep_str(pinfo
->cinfo
, COL_INFO
, " ",
2245 "(Playback License Exchange Step 1)");
2247 case CC_ID_LICENSE_STATUS
<<8|CC_ID_PLAY_COUNT
:
2248 col_append_sep_str(pinfo
->cinfo
, COL_INFO
, " ",
2249 "(License Check Exchange Step 1)");
2251 case CC_ID_REC_START_STATUS
:
2252 col_append_sep_str(pinfo
->cinfo
, COL_INFO
, " ",
2253 "(Record Start Step 1)");
2255 case CC_ID_MODE_CHG_STATUS
:
2256 col_append_sep_str(pinfo
->cinfo
, COL_INFO
, " ",
2257 "(Change Operating Mode Step 1)");
2259 case CC_ID_REC_STOP_STATUS
:
2260 col_append_sep_str(pinfo
->cinfo
, COL_INFO
, " ",
2261 "(Record Stop Step 1)");
2263 case CC_ID_STATUS_FIELD
<<8|CC_ID_SRM_CONFIRM
:
2264 col_append_sep_str(pinfo
->cinfo
, COL_INFO
, " ",
2265 "(SRM Transmission Step 1)");
2268 /* unable to determine the protocol from the requested ids
2269 check the sent ids as well */
2276 switch (snd_dat_ids
) {
2277 case CC_ID_DHPH
<<24|CC_ID_SIG_A
<<16|CC_ID_HOST_DEV_CERT
<<8|CC_ID_HOST_BRAND_CERT
:
2278 col_append_sep_str(pinfo
->cinfo
, COL_INFO
, " ",
2279 "(Authentication Step 2)");
2281 case CC_ID_STATUS_FIELD
:
2282 col_append_sep_str(pinfo
->cinfo
, COL_INFO
, " ",
2283 "(Authentication Step 4)");
2286 col_append_sep_str(pinfo
->cinfo
, COL_INFO
, " ",
2287 "(AuthKey Step 2)");
2289 case CC_ID_HOST_ID
<<8|CC_ID_STATUS_FIELD
:
2290 col_append_sep_str(pinfo
->cinfo
, COL_INFO
, " ",
2291 "(CC key calculation Step 2)");
2293 case CC_ID_HOST_ID
<<8|CC_ID_NS_HOST
:
2294 col_append_sep_str(pinfo
->cinfo
, COL_INFO
, " ",
2295 "(SAC key calculation Step 2)");
2298 col_append_sep_str(pinfo
->cinfo
, COL_INFO
, " ",
2299 "(URI transmission Step 2)");
2301 case CC_ID_URI_VERSIONS
:
2302 col_append_sep_str(pinfo
->cinfo
, COL_INFO
, " ",
2303 "(URI version negotiation Step 2)");
2305 case CC_ID_LICENSE_RCV_STATUS
:
2306 col_append_sep_str(pinfo
->cinfo
, COL_INFO
, " ",
2307 "(CICAM to Host License Exchange Step 2)");
2309 case CC_ID_PROG_NUM
<<24|CC_ID_LICENSE_STATUS
<<16|CC_ID_URI
<<8|CC_ID_CICAM_LICENSE
:
2310 col_append_sep_str(pinfo
->cinfo
, COL_INFO
, " ",
2311 "(Playback License Exchange Step 2)");
2313 case CC_ID_LICENSE_STATUS
<<8|CC_ID_PLAY_COUNT
:
2314 col_append_sep_str(pinfo
->cinfo
, COL_INFO
, " ",
2315 "(License Check Exchange Step 2)");
2317 case CC_ID_REC_START_STATUS
:
2318 col_append_sep_str(pinfo
->cinfo
, COL_INFO
, " ",
2319 "(Record Start Step 2)");
2321 case CC_ID_MODE_CHG_STATUS
:
2322 col_append_sep_str(pinfo
->cinfo
, COL_INFO
, " ",
2323 "(Change Operating Mode Step 2)");
2325 case CC_ID_REC_STOP_STATUS
:
2326 col_append_sep_str(pinfo
->cinfo
, COL_INFO
, " ",
2327 "(Record Stop Step 2)");
2329 case CC_ID_STATUS_FIELD
<<8|CC_ID_SRM_CONFIRM
:
2330 col_append_sep_str(pinfo
->cinfo
, COL_INFO
, " ",
2331 "(SRM Transmission Step 2)");
2337 /* dissect the payload of a cc message that contains data items
2338 if not NULL, set exportable_flag to true if the message contains no
2339 sensitive data and can be passed to the export PDU mechanism */
2341 dissect_cc_data_payload(uint32_t tag
, tvbuff_t
*tvb
, int offset
,
2342 packet_info
*pinfo
, proto_tree
*tree
, bool *exportable_flag
)
2345 uint8_t i
, snd_dat_nbr
, req_dat_nbr
;
2348 /* the last 8 sent/requested datatype ids */
2349 uint64_t snd_dat_ids
=0, req_dat_ids
=0;
2351 /* we only export cc_sac_data_req and cc_sac_data_cnf
2352 the only meta info in the exported PDU is the data transfer
2353 direction, if we only ever export cc_sac_data_req and
2354 cc_sac_data_cnf, this info is enough to recover the apdu tag from the
2356 cc_sac_sync req and cc_sac_sync_cnf contain no interesting data */
2357 if (exportable_flag
)
2358 *exportable_flag
= (tag
==T_CC_SAC_DATA_REQ
|| tag
==T_CC_SAC_DATA_CNF
);
2360 offset_start
= offset
;
2362 proto_tree_add_item(
2363 tree
, hf_dvbci_cc_sys_id_bitmask
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
2365 snd_dat_nbr
= tvb_get_uint8(tvb
, offset
);
2366 proto_tree_add_item(
2367 tree
, hf_dvbci_cc_snd_dat_nbr
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
2369 for(i
=0; i
<snd_dat_nbr
&&
2370 tvb_reported_length_remaining(tvb
, offset
)>0; i
++) {
2371 item_len
= dissect_cc_item(tvb
, offset
, pinfo
, tree
, &dat_id
);
2375 /* for more than 8 sent datatype ids, some ids might get lost by
2376 * the shift, that's ok, we're only using the last 8 ids for
2377 * protocol detection */
2378 snd_dat_ids
= snd_dat_ids
<<8|dat_id
;
2379 if (!exportable_flag
|| *exportable_flag
==false)
2381 if (!is_cc_item_exportable(dat_id
))
2382 *exportable_flag
= false;
2385 if (tag
==T_CC_DATA_REQ
|| tag
==T_CC_SAC_DATA_REQ
) {
2386 req_dat_nbr
= tvb_get_uint8(tvb
, offset
);
2387 proto_tree_add_item(
2388 tree
, hf_dvbci_cc_req_dat_nbr
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
2390 for(i
=0; i
<req_dat_nbr
&&
2391 tvb_reported_length_remaining(tvb
, offset
)>0; i
++) {
2392 dat_id
= tvb_get_uint8(tvb
, offset
);
2393 req_dat_ids
= req_dat_ids
<<8|dat_id
;
2394 proto_tree_add_item(
2395 tree
, hf_dvbci_cc_dat_id
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
2400 add_cc_protocol_name_step(pinfo
, snd_dat_ids
, req_dat_ids
);
2402 return offset
-offset_start
;
2406 /* convert a 0-terminated preference key_string that contains a hex number
2407 * into its binary representation
2408 * e.g. key_string "abcd" will be converted into two bytes 0xab, 0xcd
2409 * return the number of binary bytes or -1 for error */
2411 pref_key_string_to_bin(const char *key_string
, unsigned char **key_bin
)
2417 if (!key_string
|| !key_bin
)
2419 key_string_len
= (int)strlen(key_string
);
2420 if (key_string_len
!= 2*AES_KEY_LEN
)
2422 *key_bin
= (unsigned char*)g_malloc(key_string_len
/2);
2426 for (i
=0; i
<key_string_len
-1; i
+=2) {
2427 input
[0] = key_string
[0+i
];
2428 input
[1] = key_string
[1+i
];
2429 /* attention, brackets are required */
2430 (*key_bin
)[j
++] = (unsigned char)strtoul((const char*)&input
, NULL
, 16);
2433 return key_string_len
/2;
2438 decrypt_sac_msg_body(packet_info
*pinfo
,
2439 uint8_t enc_cip
, tvbuff_t
*encrypted_tvb
, int offset
, int len
)
2441 bool opened
= false;
2442 gcry_cipher_hd_t cipher
;
2445 unsigned char *clear_data
= NULL
;
2446 tvbuff_t
*clear_tvb
= NULL
;
2448 if (enc_cip
!= CC_SAC_ENC_AES128_CBC
)
2450 if (len
%AES_BLOCK_LEN
!= 0)
2453 if (!dvbci_sek_bin
|| !dvbci_siv_bin
)
2456 err
= gcry_cipher_open(&cipher
, GCRY_CIPHER_AES
, GCRY_CIPHER_MODE_CBC
, 0);
2457 if (gcry_err_code (err
))
2460 err
= gcry_cipher_setkey (cipher
, dvbci_sek_bin
, AES_KEY_LEN
);
2461 if (gcry_err_code (err
))
2463 err
= gcry_cipher_setiv (cipher
, dvbci_siv_bin
, AES_BLOCK_LEN
);
2464 if (gcry_err_code (err
))
2468 clear_data
= (unsigned char *)wmem_alloc(pinfo
->pool
, clear_len
);
2470 err
= gcry_cipher_decrypt (cipher
, clear_data
, clear_len
,
2471 tvb_memdup(pinfo
->pool
, encrypted_tvb
, offset
, len
), len
);
2472 if (gcry_err_code (err
))
2475 clear_tvb
= tvb_new_child_real_data(encrypted_tvb
,
2476 (const uint8_t *)clear_data
, clear_len
, clear_len
);
2480 gcry_cipher_close (cipher
);
2485 /* dissect a text string that is encoded according to DVB-SI (EN 300 468) */
2487 dissect_si_string(tvbuff_t
*tvb
, int offset
, int str_len
,
2488 packet_info
*pinfo
, proto_tree
*tree
, int hf
, const char *title
,
2492 dvb_encoding_e encoding
;
2493 uint8_t *si_str
= NULL
;
2495 if (!title
) /* we always have a title for our strings */
2497 /* str_len==-1 is not supported, we need an actual length */
2501 enc_len
= dvb_analyze_string_charset(tvb
, offset
, str_len
, &encoding
);
2502 dvb_add_chartbl(tree
, hf_dvbci_mmi_char_tbl
, tvb
, offset
, enc_len
, encoding
);
2507 si_str
= tvb_get_string_enc(pinfo
->pool
,
2508 tvb
, offset
, str_len
, dvb_enc_to_item_enc(encoding
));
2512 proto_tree_add_string_format(tree
, hf
,
2513 tvb
, offset
, str_len
, si_str
, "%s: %s", title
, si_str
);
2516 col_append_sep_str(pinfo
->cinfo
, COL_INFO
, " ", si_str
);
2520 /* dissect ca_enable_flag and ca_enable fields in the ca_pmt_reply
2521 * return true if descrambling is possible, false otherwise */
2523 dissect_ca_enable(tvbuff_t
*tvb
, int offset
, packet_info
*pinfo _U_
,
2526 bool desc_ok
= false;
2527 uint8_t byte
, ca_enab
;
2529 byte
= tvb_get_uint8(tvb
,offset
);
2530 proto_tree_add_item(tree
, hf_dvbci_ca_enable_flag
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
2532 ca_enab
= byte
& ~0x80;
2533 proto_tree_add_item(tree
, hf_dvbci_ca_enable
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
2534 if (ca_enab
==CA_ENAB_DESC_OK
||
2535 ca_enab
==CA_ENAB_DESC_OK_PURCHASE
||
2536 ca_enab
==CA_ENAB_DESC_OK_TECH
) {
2545 /* dissect a ca descriptor in the ca_pmt */
2547 dissect_ca_desc(tvbuff_t
*tvb
, int offset
, packet_info
*pinfo
,
2551 uint8_t tag
, len_byte
;
2553 proto_tree
*ca_desc_tree
= NULL
;
2555 offset_start
= offset
;
2557 tag
= tvb_get_uint8(tvb
,offset
);
2558 if (tag
!= CA_DESC_TAG
) {
2559 /* we could skip unknown descriptors and make this a warning */
2560 proto_tree_add_expert(tree
, pinfo
, &ei_dvbci_ca_pmt_cmd_id
, tvb
, offset
, 1);
2564 ca_desc_tree
= proto_tree_add_subtree(
2565 tree
, tvb
, offset_start
, -1, ett_dvbci_ca_desc
, &ti
, "Conditional Access descriptor");
2568 len_byte
= tvb_get_uint8(tvb
,offset
);
2569 proto_tree_add_item(
2570 ca_desc_tree
, hf_dvbci_descr_len
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
2573 proto_tree_add_item(
2574 ca_desc_tree
, hf_dvbci_ca_sys_id
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
2577 proto_tree_add_item(
2578 ca_desc_tree
, hf_dvbci_ca_pid
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
2581 if ((len_byte
-4) != 0) {
2582 proto_tree_add_item(ca_desc_tree
, hf_dvbci_ca_priv_data
,
2583 tvb
, offset
, len_byte
-4, ENC_NA
);
2584 offset
+= (len_byte
-4);
2587 proto_item_set_len(ti
, offset
-offset_start
);
2588 return offset
-offset_start
;
2592 /* dissect an elementary stream entry in the ca_pmt */
2594 dissect_es(tvbuff_t
*tvb
, int offset
,
2595 packet_info
*pinfo
, proto_tree
*tree
, bool *scrambled
)
2598 proto_tree
*es_tree
= NULL
;
2599 int offset_start
, ca_desc_len
;
2600 int es_info_len
, all_len
;
2602 offset_start
= offset
;
2605 /* default to free service until we found a ca descriptor
2606 (we could have es info len > 0 and no ca descriptors) */
2610 es_tree
= proto_tree_add_subtree(tree
, tvb
, offset_start
, -1, ett_dvbci_application
, &ti
, "Elementary Stream");
2612 proto_tree_add_item(
2613 es_tree
, hf_dvbci_stream_type
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
2615 proto_tree_add_item(
2616 es_tree
, hf_dvbci_es_pid
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
2618 es_info_len
= tvb_get_ntohs(tvb
, offset
) & 0x0FFF;
2619 /* the definition of hf_dvbci_es_info_len also applies the mask */
2620 proto_tree_add_item(
2621 es_tree
, hf_dvbci_es_info_len
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
2623 if (es_info_len
>0) {
2624 all_len
= offset
+ es_info_len
;
2626 proto_tree_add_item(
2627 es_tree
, hf_dvbci_ca_pmt_cmd_id
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
2629 while (offset
< all_len
) {
2630 ca_desc_len
= dissect_ca_desc(tvb
, offset
, pinfo
, es_tree
);
2631 if (ca_desc_len
<= 0)
2633 offset
+= ca_desc_len
;
2639 proto_tree_add_expert(
2640 es_tree
, pinfo
, &ei_dvbci_no_ca_desc_es
, tvb
, 0, 0);
2643 proto_item_set_len(ti
, offset
-offset_start
);
2644 return offset
-offset_start
;
2647 /* dissect a text pseudo-apdu */
2649 dissect_dvbci_text(const char *title
, tvbuff_t
*tvb
, int offset
,
2650 packet_info
*pinfo
, proto_tree
*tree
, int hf
)
2653 proto_tree
*text_tree
;
2658 offset_start
= offset
;
2663 /* check the tag before setting up the tree */
2664 tag
= tvb_get_ntoh24(tvb
, offset
);
2665 if (tag
!=T_TEXT_LAST
&& tag
!=T_TEXT_MORE
)
2668 text_tree
= proto_tree_add_subtree(tree
, tvb
, offset_start
, -1, ett_dvbci_text
, &ti
, title
);
2670 proto_tree_add_item(text_tree
, hf_dvbci_apdu_tag
,
2671 tvb
, offset
, APDU_TAG_SIZE
, ENC_BIG_ENDIAN
);
2672 offset
+= APDU_TAG_SIZE
;
2673 offset
= dissect_ber_length(pinfo
, text_tree
, tvb
, offset
, &len_field
, NULL
);
2674 dissect_si_string(tvb
, offset
, len_field
, pinfo
, text_tree
,
2676 offset
+= len_field
;
2678 proto_item_set_len(ti
, offset
-offset_start
);
2679 return (offset
-offset_start
);
2684 dissect_res_id(tvbuff_t
*tvb
, int offset
, packet_info
*pinfo
,
2685 proto_tree
*tree
, uint32_t res_id
, bool show_col_info
)
2687 /* there's two possible inputs for this function
2688 the resource id is either in a tvbuff_t (tvb!=NULL, res_id==0)
2689 or in a uint32_t (tvb==NULL, res_id!=0) */
2692 /* resource id comes in via tvbuff */
2695 res_id
= tvb_get_ntohl(tvb
, offset
);
2698 /* resource id comes in via uint32_t */
2701 /* we'll call proto_tree_add_...( tvb==NULL, offset==0, length==0 )
2702 this creates a filterable item without any reference to a tvb */
2706 if (show_col_info
) {
2707 col_append_sep_fstr(pinfo
->cinfo
, COL_INFO
, NULL
, "%s Version %d",
2708 val_to_str_const(RES_CLASS(res_id
), dvbci_res_class
,
2709 "Invalid Resource class"),
2713 return proto_tree_add_bitmask_value_with_flags(tree
, tvb
, offset
,
2714 hf_dvbci_res_id
, ett_dvbci_res
, dvb_ci_res_id_fields
, res_id
,
2718 /* dissect the body of a resource manager apdu */
2720 dissect_dvbci_payload_rm(uint32_t tag
, int len_field
,
2721 tvbuff_t
*tvb
, int offset
, conversation_t
*conv _U_
,
2722 packet_info
*pinfo
, proto_tree
*tree
)
2724 const char *tag_str
;
2726 if (tag
==T_PROFILE
) {
2727 if (len_field
% RES_ID_LEN
) {
2728 tag_str
= val_to_str(tag
, dvbci_apdu_tag
, "Unknown: %d");
2729 proto_tree_add_expert_format(tree
, pinfo
, &ei_dvbci_bad_length
, tvb
, 0, APDU_TAG_SIZE
,
2730 "Invalid APDU length field, %s must be a multiple of 4 bytes",
2735 while (tvb_reported_length_remaining(tvb
, offset
) > 0) {
2736 dissect_res_id(tvb
, offset
, pinfo
, tree
, 0, false);
2737 offset
+= RES_ID_LEN
;
2743 dissect_dvbci_payload_ap(uint32_t tag
, int len_field _U_
,
2744 tvbuff_t
*tvb
, int offset
, conversation_t
*conv _U_
,
2745 packet_info
*pinfo
, proto_tree
*tree
)
2747 uint8_t menu_str_len
;
2749 dvb_encoding_e encoding
;
2750 const uint8_t *menu_string
;
2753 if (tag
==T_APP_INFO
) {
2754 proto_tree_add_item(tree
, hf_dvbci_app_type
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
2756 proto_tree_add_item(
2757 tree
, hf_dvbci_app_manf
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
2759 proto_tree_add_item(
2760 tree
, hf_dvbci_manf_code
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
2762 menu_str_len
= tvb_get_uint8(tvb
,offset
);
2763 proto_tree_add_item(
2764 tree
, hf_dvbci_menu_str_len
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
2766 if (menu_str_len
> 0) {
2767 enc_len
= dvb_analyze_string_charset(
2768 tvb
, offset
, menu_str_len
, &encoding
);
2770 tree
, hf_dvbci_ap_char_tbl
, tvb
, offset
, enc_len
, encoding
);
2772 menu_str_len
-= enc_len
;
2773 proto_tree_add_item_ret_string(tree
, hf_dvbci_menu_str
,
2774 tvb
, offset
, menu_str_len
, dvb_enc_to_item_enc(encoding
),
2775 pinfo
->pool
, &menu_string
);
2776 col_append_sep_fstr(pinfo
->cinfo
, COL_INFO
, NULL
,
2777 "Module name %s", menu_string
);
2780 else if (tag
== T_DATARATE_INFO
) {
2781 data_rate
= tvb_get_uint8(tvb
, offset
);
2782 col_append_sep_str(pinfo
->cinfo
, COL_INFO
, ": ",
2783 val_to_str(data_rate
, dvbci_data_rate
, "unknown (0x%x)"));
2784 proto_tree_add_item(tree
, hf_dvbci_data_rate
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
2789 dissect_dvbci_payload_ca(uint32_t tag
, int len_field
,
2790 tvbuff_t
*tvb
, int offset
, conversation_t
*conv _U_
,
2791 packet_info
*pinfo
, proto_tree
*tree
)
2793 const char *tag_str
;
2795 unsigned prog_info_len
;
2796 int es_info_len
, all_len
;
2798 bool scrambled
= false;
2799 bool es_scrambled
= false;
2800 proto_tree
*es_tree
= NULL
;
2801 bool desc_ok
= false;
2804 if (tag
==T_CA_INFO
) {
2805 if (len_field
% 2) {
2806 tag_str
= val_to_str(tag
, dvbci_apdu_tag
, "Unknown: %d");
2807 proto_tree_add_expert_format(tree
, pinfo
, &ei_dvbci_bad_length
, tvb
, 0, APDU_TAG_SIZE
,
2808 "Invalid APDU length field, %s must be a multiple of 2 bytes",
2813 while (tvb_reported_length_remaining(tvb
, offset
) > 0) {
2814 proto_tree_add_item(
2815 tree
, hf_dvbci_ca_sys_id
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
2819 else if (tag
==T_CA_PMT
) {
2820 proto_tree_add_item(
2821 tree
, hf_dvbci_ca_pmt_list_mgmt
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
2823 prog_num
= tvb_get_ntohs(tvb
, offset
);
2824 col_append_sep_fstr(
2825 pinfo
->cinfo
, COL_INFO
, NULL
, "Program number %x", prog_num
);
2826 proto_tree_add_item(
2827 tree
, hf_dvbci_prog_num
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
2829 proto_tree_add_item(
2830 tree
, hf_dvbci_ca_ver
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
2831 proto_tree_add_item(
2832 tree
, hf_dvbci_curr_next
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
2834 prog_info_len
= tvb_get_ntohs(tvb
, offset
) & 0x0FFF;
2835 /* the definition of hf_dvbci_prog_info_len also applies the mask */
2836 proto_tree_add_item(
2837 tree
, hf_dvbci_prog_info_len
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
2839 if (prog_info_len
!= 0) {
2840 all_len
= offset
+ prog_info_len
;
2842 proto_tree_add_item(
2843 tree
, hf_dvbci_ca_pmt_cmd_id
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
2845 while (offset
< all_len
) {
2846 ca_desc_len
= dissect_ca_desc(tvb
, offset
, pinfo
, tree
);
2847 if (ca_desc_len
<= 0)
2849 offset
+= ca_desc_len
;
2850 /* set this only if we've seen at least one valid ca descriptor */
2855 proto_tree_add_expert(
2856 tree
, pinfo
, &ei_dvbci_no_ca_desc_prog
, tvb
, 0, 0);
2859 while (tvb_reported_length_remaining(tvb
, offset
) > 0) {
2860 es_info_len
= dissect_es(tvb
, offset
, pinfo
, tree
, &es_scrambled
);
2861 if (es_info_len
<= 0)
2863 offset
+= es_info_len
;
2868 col_append_sep_str(pinfo
->cinfo
, COL_INFO
, NULL
,
2869 scrambled
? "scrambled service" : "free service");
2871 else if (tag
==T_CA_PMT_REPLY
) {
2872 prog_num
= tvb_get_ntohs(tvb
, offset
);
2873 col_append_sep_fstr(
2874 pinfo
->cinfo
, COL_INFO
, NULL
, "Program number %x", prog_num
);
2875 proto_tree_add_item(
2876 tree
, hf_dvbci_prog_num
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
2878 proto_tree_add_item(
2879 tree
, hf_dvbci_ca_ver
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
2880 proto_tree_add_item(
2881 tree
, hf_dvbci_curr_next
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
2883 desc_ok
|= dissect_ca_enable(tvb
, offset
, pinfo
, tree
);
2885 while (tvb_reported_length_remaining(tvb
, offset
) > 0) {
2886 /* there's no need to check for tree==NULL */
2887 es_tree
= proto_tree_add_subtree(tree
, tvb
, offset
, 3, ett_dvbci_application
, NULL
, "Elementary Stream");
2889 proto_tree_add_item(es_tree
, hf_dvbci_es_pid
,
2890 tvb
, offset
, 2, ENC_BIG_ENDIAN
);
2892 desc_ok
|= dissect_ca_enable(tvb
, offset
, pinfo
, es_tree
);
2897 pinfo
->cinfo
, COL_INFO
, NULL
, "descrambling possible");
2904 dissect_dvbci_payload_aut(uint32_t tag
, int len_field _U_
,
2905 tvbuff_t
*tvb
, int offset
, conversation_t
*conv _U_
,
2906 packet_info
*pinfo _U_
, proto_tree
*tree
)
2910 proto_tree_add_item(tree
, hf_dvbci_auth_proto_id
,
2911 tvb
, offset
, 2, ENC_BIG_ENDIAN
);
2914 bytes_len
= tvb_reported_length_remaining(tvb
, offset
);
2918 if (tag
==T_AUTH_REQ
) {
2919 proto_tree_add_item(tree
, hf_dvbci_auth_req_bytes
,
2920 tvb
, offset
, bytes_len
, ENC_NA
);
2922 else if (tag
==T_AUTH_RESP
) {
2923 proto_tree_add_item(tree
, hf_dvbci_auth_resp_bytes
,
2924 tvb
, offset
, bytes_len
, ENC_NA
);
2930 dissect_dvbci_payload_hc(uint32_t tag
, int len_field _U_
,
2931 tvbuff_t
*tvb
, int offset
, conversation_t
*conv _U_
,
2932 packet_info
*pinfo
, proto_tree
*tree
)
2935 uint16_t nid
, onid
, tsid
, svcid
;
2937 uint16_t old_pid
, new_pid
;
2940 tvbuff_t
*pmt_tvb
= NULL
;
2946 nid
= tvb_get_ntohs(tvb
, offset
);
2947 pi
= proto_tree_add_item(
2948 tree
, hf_dvbci_network_id
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
2950 expert_add_info(pinfo
, pi
, &ei_dvbci_network_id
);
2953 onid
= tvb_get_ntohs(tvb
, offset
);
2954 proto_tree_add_item(tree
, hf_dvbci_original_network_id
,
2955 tvb
, offset
, 2, ENC_BIG_ENDIAN
);
2957 tsid
= tvb_get_ntohs(tvb
, offset
);
2958 proto_tree_add_item(tree
, hf_dvbci_transport_stream_id
,
2959 tvb
, offset
, 2, ENC_BIG_ENDIAN
);
2961 svcid
= tvb_get_ntohs(tvb
, offset
);
2962 proto_tree_add_item(
2963 tree
, hf_dvbci_service_id
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
2964 col_append_sep_fstr(pinfo
->cinfo
, COL_INFO
, ": ",
2965 "nid 0x%x, onid 0x%x, tsid 0x%x, svcid 0x%x",
2966 nid
, onid
, tsid
, svcid
);
2969 ref
= tvb_get_uint8(tvb
, offset
);
2970 proto_tree_add_item(tree
, hf_dvbci_replacement_ref
,
2971 tvb
, offset
, 1, ENC_BIG_ENDIAN
);
2973 old_pid
= tvb_get_ntohs(tvb
, offset
) & 0x1FFF;
2974 proto_tree_add_item(tree
, hf_dvbci_replaced_pid
,
2975 tvb
, offset
, 2, ENC_BIG_ENDIAN
);
2977 new_pid
= tvb_get_ntohs(tvb
, offset
) & 0x1FFF;
2978 proto_tree_add_item( tree
, hf_dvbci_replacement_pid
,
2979 tvb
, offset
, 2, ENC_BIG_ENDIAN
);
2980 col_append_sep_fstr(pinfo
->cinfo
, COL_INFO
, ": ",
2981 "ref 0x%x, 0x%x -> 0x%x", ref
, old_pid
, new_pid
);
2983 case T_CLEAR_REPLACE
:
2984 ref
= tvb_get_uint8(tvb
, offset
);
2985 proto_tree_add_item(tree
, hf_dvbci_replacement_ref
,
2986 tvb
, offset
, 1, ENC_BIG_ENDIAN
);
2987 col_append_sep_fstr(pinfo
->cinfo
, COL_INFO
, ": ", "ref 0x%x", ref
);
2989 case T_TUNE_BROADCAST_REQ
:
2990 pmt_flag
= ((tvb_get_uint8(tvb
, offset
) & 0x01) == 0x01);
2991 proto_tree_add_item(tree
, hf_dvbci_pmt_flag
,
2992 tvb
, offset
, 1, ENC_BIG_ENDIAN
);
2994 proto_tree_add_item(
2995 tree
, hf_dvbci_service_id
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
2997 desc_loop_len
= dissect_desc_loop(hf_dvbci_hc_desc_loop_len
,
2998 tvb
, offset
, pinfo
, tree
);
2999 if (desc_loop_len
<0)
3001 offset
+= desc_loop_len
;
3003 pmt_tvb
= tvb_new_subset_remaining(tvb
, offset
);
3004 if (mpeg_pmt_handle
) {
3005 col_append_str(pinfo
->cinfo
, COL_INFO
, ", ");
3006 /* prevent mpeg_pmt dissector from clearing col_info */
3007 col_set_fence(pinfo
->cinfo
, COL_INFO
);
3008 call_dissector(mpeg_pmt_handle
, pmt_tvb
, pinfo
, tree
);
3011 call_dissector(data_handle
, pmt_tvb
, pinfo
, tree
);
3015 status
= tvb_get_uint8(tvb
, offset
);
3016 proto_tree_add_item(tree
, hf_dvbci_hc_status
,
3017 tvb
, offset
, 1, ENC_BIG_ENDIAN
);
3018 col_append_sep_str(pinfo
->cinfo
, COL_INFO
, ": ",
3019 (status
== HC_STAT_OK
? "ok" : "error"));
3021 case T_ASK_RELEASE_REPLY
:
3022 proto_tree_add_item(tree
, hf_dvbci_hc_release_reply
,
3023 tvb
, offset
, 1, ENC_BIG_ENDIAN
);
3032 dissect_dvbci_payload_dt(uint32_t tag
, int len_field
,
3033 tvbuff_t
*tvb
, int offset
, conversation_t
*conv _U_
,
3034 packet_info
*pinfo
, proto_tree
*tree
)
3037 proto_item
*pi
= NULL
;
3038 const char *tag_str
;
3041 int16_t local_offset
; /* field in the apdu */
3044 if (tag
==T_DATE_TIME_ENQ
) {
3045 nstime_set_zero(&resp_intv
);
3046 resp_intv
.secs
= tvb_get_uint8(tvb
, offset
);
3047 pi
= proto_tree_add_time(tree
, hf_dvbci_resp_intv
,
3048 tvb
, offset
, 1, &resp_intv
);
3049 if (resp_intv
.secs
==0) {
3050 col_append_sep_str(pinfo
->cinfo
, COL_INFO
, NULL
, "individual query");
3051 proto_item_append_text(pi
, " (individual query)");
3054 col_append_sep_fstr(pinfo
->cinfo
, COL_INFO
, NULL
,
3055 "update every %s", rel_time_to_str(pinfo
->pool
, &resp_intv
));
3058 else if (tag
==T_DATE_TIME
) {
3059 if (len_field
!=5 && len_field
!=7) {
3060 tag_str
= val_to_str_const(tag
, dvbci_apdu_tag
, "unknown");
3061 proto_tree_add_expert_format(tree
, pinfo
, &ei_dvbci_bad_length
, tvb
, APDU_TAG_SIZE
, offset
-APDU_TAG_SIZE
,
3062 "Invalid APDU length field, %s must be 5 or 7 bytes", tag_str
);
3066 time_field_len
= packet_mpeg_sect_mjd_to_utc_time(tvb
, offset
, &utc_time
);
3067 if (time_field_len
<0) {
3068 proto_tree_add_expert_format(tree
, pinfo
, &ei_dvbci_bad_length
, tvb
, offset
, 5,
3069 "Invalid UTC time field, 2 bytes MJD, 3 bytes BCD time hhmmss");
3072 proto_tree_add_time(tree
, hf_dvbci_utc_time
,
3073 tvb
, offset
, time_field_len
, &utc_time
);
3074 col_append_sep_fstr(pinfo
->cinfo
, COL_INFO
, ": ", "%s UTC",
3075 abs_time_to_str(pinfo
->pool
, &utc_time
, ABSOLUTE_TIME_UTC
, false));
3076 offset
+= time_field_len
;
3079 local_offset
= two_comp_to_int16(tvb_get_ntohs(tvb
, offset
));
3080 proto_tree_add_int_format(tree
, hf_dvbci_local_offset
,
3081 tvb
, offset
, 2, local_offset
,
3082 "offset between UTC and local time is %d minutes",
3086 proto_tree_add_expert(tree
, pinfo
, &ei_dvbci_time_offs_unknown
,
3094 dissect_dvbci_payload_mmi(uint32_t tag
, int len_field
,
3095 tvbuff_t
*tvb
, int offset
, conversation_t
*conv _U_
,
3096 packet_info
*pinfo
, proto_tree
*tree
)
3100 uint8_t close_mmi_cmd_id
;
3101 uint8_t disp_ctl_cmd
, disp_rep_id
;
3102 const char *disp_ctl_cmd_str
= NULL
, *disp_rep_id_str
= NULL
;
3105 dvb_encoding_e encoding
;
3106 uint8_t ans_txt_len
;
3108 uint8_t choice_or_item_nb
;
3113 offset_start
= offset
;
3117 close_mmi_cmd_id
= tvb_get_uint8(tvb
,offset
);
3118 proto_tree_add_item(tree
, hf_dvbci_close_mmi_cmd_id
,
3119 tvb
, offset
, 1, ENC_BIG_ENDIAN
);
3121 /* apdu layer len field checks are sufficient for "immediate" */
3122 if (close_mmi_cmd_id
== CLOSE_MMI_CMD_ID_DELAY
) {
3123 if (len_field
!= 2) {
3124 proto_tree_add_expert_format(tree
, pinfo
, &ei_dvbci_bad_length
, tvb
,
3125 APDU_TAG_SIZE
, offset_start
-APDU_TAG_SIZE
,
3126 "Length field must be 2");
3129 proto_tree_add_item(tree
, hf_dvbci_close_mmi_delay
, tvb
,
3130 offset
, 1, ENC_BIG_ENDIAN
);
3133 case T_DISPLAY_CONTROL
:
3134 disp_ctl_cmd
= tvb_get_uint8(tvb
,offset
);
3135 disp_ctl_cmd_str
= val_to_str_const(disp_ctl_cmd
,
3136 dvbci_disp_ctl_cmd
, "unknown command");
3137 col_append_sep_str(pinfo
->cinfo
, COL_INFO
, ": ",
3139 proto_tree_add_item(tree
, hf_dvbci_disp_ctl_cmd
, tvb
,
3140 offset
, 1, ENC_BIG_ENDIAN
);
3142 if (disp_ctl_cmd
== DISP_CMD_SET_MMI_MODE
)
3144 proto_tree_add_item(tree
, hf_dvbci_mmi_mode
, tvb
,
3145 offset
, 1, ENC_BIG_ENDIAN
);
3146 if (len_field
!= 2) {
3147 proto_tree_add_expert_format(tree
, pinfo
, &ei_dvbci_bad_length
, tvb
,
3148 APDU_TAG_SIZE
, offset_start
-APDU_TAG_SIZE
,
3149 "Length field must be 2");
3154 case T_DISPLAY_REPLY
:
3155 disp_rep_id
= tvb_get_uint8(tvb
,offset
);
3156 disp_rep_id_str
= val_to_str_const(disp_rep_id
,
3157 dvbci_disp_rep_id
, "unknown command");
3158 col_append_sep_str(pinfo
->cinfo
, COL_INFO
, ": ",
3160 proto_tree_add_item(tree
, hf_dvbci_disp_rep_id
,
3161 tvb
, offset
, 1, ENC_BIG_ENDIAN
);
3163 if (disp_rep_id
== DISP_REP_ID_MMI_MODE_ACK
) {
3164 proto_tree_add_item(tree
, hf_dvbci_mmi_mode
,
3165 tvb
, offset
, 1, ENC_BIG_ENDIAN
);
3167 else if (disp_rep_id
== DISP_REP_ID_DISP_CHAR_TBL
||
3168 disp_rep_id
== DISP_REP_ID_INP_CHAR_TBL
) {
3169 while ((msg_len
=tvb_reported_length_remaining(tvb
, offset
)) > 0) {
3170 enc_len
= dvb_analyze_string_charset(
3171 tvb
, offset
, msg_len
, &encoding
);
3173 proto_tree_add_expert(tree
, pinfo
,
3174 &ei_dvbci_invalid_char_tbl
, tvb
, offset
, msg_len
);
3177 dvb_add_chartbl(tree
, hf_dvbci_mmi_char_tbl
,
3178 tvb
, offset
, enc_len
, encoding
);
3184 proto_tree_add_item(tree
, hf_dvbci_blind_ans
,
3185 tvb
, offset
, 1, ENC_BIG_ENDIAN
);
3187 ans_txt_len
= tvb_get_uint8(tvb
,offset
);
3188 pi
= proto_tree_add_item(tree
, hf_dvbci_ans_txt_len
,
3189 tvb
, offset
, 1, ENC_BIG_ENDIAN
);
3190 if (ans_txt_len
== NB_UNKNOWN
) {
3191 proto_item_append_text(pi
,
3192 " (Length of expected answer is unknown)");
3195 dissect_si_string(tvb
, offset
,
3196 tvb_reported_length_remaining(tvb
, offset
),
3197 pinfo
, tree
, hf_dvbci_enq
, "Enquiry string", false);
3200 ans_id
= tvb_get_uint8(tvb
,offset
);
3201 proto_tree_add_item(tree
, hf_dvbci_ans_id
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
3203 if (ans_id
== ANSW_ID_ANSWER
) {
3204 dissect_si_string(tvb
, offset
,
3205 tvb_reported_length_remaining(tvb
, offset
),
3206 pinfo
, tree
, hf_dvbci_ans
, "Answer", true);
3213 choice_or_item_nb
= tvb_get_uint8(tvb
,offset
);
3214 if (IS_MENU_APDU(tag
)) {
3215 pi
= proto_tree_add_item(
3216 tree
, hf_dvbci_choice_nb
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
3217 if (choice_or_item_nb
== NB_UNKNOWN
) {
3218 proto_item_append_text(pi
,
3219 " (Number of choices is unknown)");
3223 pi
= proto_tree_add_item(
3224 tree
, hf_dvbci_item_nb
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
3225 if (choice_or_item_nb
== NB_UNKNOWN
) {
3226 proto_item_append_text(pi
,
3227 "(Number of items is unknown)");
3231 text_len
= dissect_dvbci_text("Title", tvb
, offset
,
3232 pinfo
, tree
, hf_dvbci_title
);
3234 text_len
= dissect_dvbci_text("Sub-title", tvb
, offset
,
3235 pinfo
, tree
, hf_dvbci_subtitle
);
3237 text_len
= dissect_dvbci_text("Bottom line", tvb
, offset
,
3238 pinfo
, tree
, hf_dvbci_bottom
);
3240 while (tvb_reported_length_remaining(tvb
, offset
) > 0) {
3241 text_len
= dissect_dvbci_text("Item", tvb
, offset
, pinfo
, tree
, hf_dvbci_item
);
3242 /* minimum is apdu tag + 1 byte len field */
3243 if (text_len
<APDU_TAG_SIZE
+1) {
3244 proto_tree_add_expert(tree
, pinfo
, &ei_dvbci_not_text_more_or_text_last
, tvb
, offset
, -1);
3251 choice_ref
= tvb_get_uint8(tvb
,offset
);
3252 pi
= proto_tree_add_item(
3253 tree
, hf_dvbci_choice_ref
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
3254 if (choice_ref
== 0x0) {
3255 proto_item_append_text(pi
, " (Selection was cancelled)");
3256 col_append_sep_str(pinfo
->cinfo
, COL_INFO
, ": ",
3260 col_append_sep_fstr(pinfo
->cinfo
, COL_INFO
, ": ",
3261 "Item %d", choice_ref
);
3271 dissect_dvbci_payload_hlc(uint32_t tag
, int len_field _U_
,
3272 tvbuff_t
*tvb
, int offset
, conversation_t
*conv _U_
,
3273 packet_info
*pinfo
, proto_tree
*tree
)
3277 if (tag
==T_HOST_COUNTRY
) {
3278 proto_tree_add_item(tree
, hf_dvbci_host_country
,
3279 tvb
, offset
, tvb_reported_length_remaining(tvb
, offset
),
3280 ENC_ISO_8859_1
|ENC_NA
);
3282 else if (tag
==T_HOST_LANGUAGE
) {
3283 proto_tree_add_item(tree
, hf_dvbci_host_language
,
3284 tvb
, offset
, tvb_reported_length_remaining(tvb
, offset
),
3285 ENC_ISO_8859_1
|ENC_NA
);
3288 /* both apdus' body is only a country code, this can be shared */
3289 str
= tvb_get_string_enc(pinfo
->pool
, tvb
, offset
,
3290 tvb_reported_length_remaining(tvb
, offset
),
3291 ENC_ISO_8859_1
|ENC_NA
);
3293 col_append_sep_str(pinfo
->cinfo
, COL_INFO
, ": ", str
);
3298 dissect_dvbci_payload_cup(uint32_t tag
, int len_field _U_
,
3299 tvbuff_t
*tvb
, int offset
, conversation_t
*conv _U_
,
3300 packet_info
*pinfo
, proto_tree
*tree
)
3302 uint8_t upgrade_type
;
3303 uint16_t download_time
;
3304 uint8_t answer
, progress
;
3307 case T_CAM_FIRMWARE_UPGRADE
:
3308 upgrade_type
= tvb_get_uint8(tvb
, offset
);
3309 proto_tree_add_item(tree
, hf_dvbci_cup_type
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
3310 col_append_sep_fstr(pinfo
->cinfo
, COL_INFO
, " ", "(%s)",
3311 val_to_str_const(upgrade_type
, dvbci_cup_type
, "unknown"));
3313 download_time
= tvb_get_ntohs(tvb
, offset
);
3314 if (download_time
== 0) {
3315 proto_tree_add_uint_format(tree
, hf_dvbci_cup_download_time
,
3316 tvb
, offset
, 2, download_time
,
3317 "estimated download time is unknown");
3320 proto_tree_add_uint_format(tree
, hf_dvbci_cup_download_time
,
3321 tvb
, offset
, 2, download_time
,
3322 "estimated download time is %d seconds",
3326 case T_CAM_FIRMWARE_UPGRADE_REPLY
:
3327 answer
= tvb_get_uint8(tvb
, offset
);
3328 proto_tree_add_item(tree
, hf_dvbci_cup_answer
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
3329 col_append_sep_str(pinfo
->cinfo
, COL_INFO
, ": ",
3330 val_to_str_const(answer
, dvbci_cup_answer
, "unknown"));
3332 case T_CAM_FIRMWARE_UPGRADE_PROGRESS
:
3333 progress
= tvb_get_uint8(tvb
, offset
);
3334 if (progress
> 100) {
3335 proto_tree_add_expert(tree
, pinfo
, &ei_dvbci_cup_progress
, tvb
, offset
, 1);
3338 col_append_sep_fstr(pinfo
->cinfo
, COL_INFO
, ": ", "%d%%", progress
);
3339 proto_tree_add_uint_format(tree
, hf_dvbci_cup_progress
,
3340 tvb
, offset
, 1, progress
,
3341 "download progress %d%%", progress
);
3344 case T_CAM_FIRMWARE_UPGRADE_COMPLETE
:
3345 proto_tree_add_item(tree
, hf_dvbci_cup_reset
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
3352 static int exp_pdu_data_dvbci_size(packet_info
*pinfo _U_
, void* data _U_
)
3354 return EXP_PDU_TAG_DVBCI_EVT_LEN
+ 4;
3357 static int exp_pdu_data_dvbci_populate_data(packet_info
*pinfo
, void* data
, uint8_t *tlv_buffer
, uint32_t buffer_size _U_
)
3359 phton16(&tlv_buffer
[0], EXP_PDU_TAG_DVBCI_EVT
);
3360 phton16(&tlv_buffer
[2], EXP_PDU_TAG_DVBCI_EVT_LEN
);
3361 tlv_buffer
[4] = dvbci_get_evt_from_addrs(pinfo
);
3363 return exp_pdu_data_dvbci_size(pinfo
, data
);
3366 static exp_pdu_data_item_t exp_pdu_dvbci
= {exp_pdu_data_dvbci_size
, exp_pdu_data_dvbci_populate_data
, NULL
};
3369 dissect_sac_msg(uint32_t tag
, tvbuff_t
*tvb
, int offset
,
3370 packet_info
*pinfo
, proto_tree
*tree
, bool exported
)
3374 uint8_t enc_flag
, enc_cip
;
3375 proto_item
*enc_flag_pi
;
3376 uint16_t sac_payload_len
; /* payload data and padding */
3377 int sac_payload_data_len
= 0; /* just payload data */
3378 tvbuff_t
*clear_sac_body_tvb
;
3379 proto_tree
*sac_tree
= NULL
;
3380 bool is_exportable
= false;
3382 offset_start
= offset
;
3384 /* it's not useful to move sac header dissection to a separate
3385 function, we need enc/auth cipher etc here to handle the body */
3386 msg_ctr
= tvb_get_ntohl(tvb
, offset
);
3387 proto_tree_add_item(tree
, hf_dvbci_sac_msg_ctr
,
3388 tvb
, offset
, 4, ENC_BIG_ENDIAN
);
3389 col_append_sep_fstr(pinfo
->cinfo
, COL_INFO
, NULL
,
3390 "message #%d", msg_ctr
);
3392 proto_tree_add_item(tree
, hf_dvbci_sac_proto_ver
,
3393 tvb
, offset
, 1, ENC_BIG_ENDIAN
);
3394 proto_tree_add_item(tree
, hf_dvbci_sac_auth_cip
,
3395 tvb
, offset
, 1, ENC_BIG_ENDIAN
);
3396 enc_flag
= tvb_get_uint8(tvb
, offset
) & 0x1;
3397 enc_flag_pi
= proto_tree_add_item(tree
, hf_dvbci_sac_payload_enc
,
3398 tvb
, offset
, 1, ENC_BIG_ENDIAN
);
3399 if (exported
&& enc_flag
) {
3400 expert_add_info(pinfo
, enc_flag_pi
, &ei_dvbci_sac_payload_enc
);
3404 enc_cip
= (tvb_get_uint8(tvb
, offset
)&0xE0) >> 5;
3405 proto_tree_add_item(tree
, hf_dvbci_sac_enc_cip
,
3406 tvb
, offset
, 1, ENC_BIG_ENDIAN
);
3408 sac_payload_len
= tvb_get_ntohs(tvb
, offset
);
3409 proto_tree_add_item(tree
, hf_dvbci_sac_payload_len
,
3410 tvb
, offset
, 2, ENC_BIG_ENDIAN
);
3412 if (tvb_reported_length_remaining(tvb
, offset
) < 0)
3415 clear_sac_body_tvb
= decrypt_sac_msg_body(pinfo
, enc_cip
,
3416 tvb
, offset
, tvb_reported_length_remaining(tvb
, offset
));
3419 clear_sac_body_tvb
= tvb_new_subset_remaining(tvb
, offset
);
3421 if (!clear_sac_body_tvb
) {
3422 /* we could not decrypt (or access) the clear sac message body */
3423 proto_tree_add_item(tree
, hf_dvbci_sac_enc_body
, tvb
, offset
,
3424 tvb_reported_length_remaining(tvb
, offset
), ENC_NA
);
3428 add_new_data_source(pinfo
, clear_sac_body_tvb
, "Clear SAC message body");
3429 if (sac_payload_len
>0) {
3430 sac_tree
= proto_tree_add_subtree(tree
, clear_sac_body_tvb
, 0, sac_payload_len
,
3431 ett_dvbci_sac_msg_body
, NULL
, "SAC message payload");
3432 if (tag
==T_CC_SAC_DATA_REQ
|| tag
==T_CC_SAC_DATA_CNF
) {
3433 sac_payload_data_len
= dissect_cc_data_payload(tag
,
3434 clear_sac_body_tvb
, 0, pinfo
, sac_tree
, &is_exportable
);
3436 else if (tag
==T_CC_SAC_SYNC_REQ
) {
3437 sac_payload_data_len
= 0;
3439 else if (tag
==T_CC_SAC_SYNC_CNF
) {
3440 proto_tree_add_item(sac_tree
, hf_dvbci_cc_status_field
,
3441 clear_sac_body_tvb
, 0, 1, ENC_BIG_ENDIAN
);
3442 sac_payload_data_len
= 1;
3445 if (sac_payload_data_len
< 0)
3447 if (sac_payload_len
> sac_payload_data_len
) {
3448 proto_tree_add_item(sac_tree
, hf_dvbci_sac_padding
,
3449 clear_sac_body_tvb
, sac_payload_data_len
,
3450 sac_payload_len
-sac_payload_data_len
, ENC_NA
);
3453 proto_tree_add_item(tree
, hf_dvbci_sac_signature
,
3454 clear_sac_body_tvb
, sac_payload_len
,
3455 tvb_reported_length_remaining(clear_sac_body_tvb
,
3456 sac_payload_len
), ENC_NA
);
3458 /* we call this function also to dissect exported SAC messages,
3459 don't try to export them a second time */
3460 if (!exported
&& is_exportable
&& have_tap_listener(exported_pdu_tap
)) {
3461 static const exp_pdu_data_item_t
*dvbci_exp_pdu_items
[] = {
3466 tvbuff_t
*clear_sac_msg_tvb
;
3467 exp_pdu_data_t
*exp_pdu_data
;
3469 clear_sac_msg_tvb
= tvb_new_composite();
3470 tvb_composite_append(clear_sac_msg_tvb
,
3471 tvb_clone_offset_len(tvb
, offset_start
, SAC_MSG_HDR_LEN
));
3472 tvb_composite_append(clear_sac_msg_tvb
, clear_sac_body_tvb
);
3473 tvb_composite_finalize(clear_sac_msg_tvb
);
3475 exp_pdu_data
= export_pdu_create_tags(pinfo
, EXPORTED_SAC_MSG_PROTO
, EXP_PDU_TAG_DISSECTOR_NAME
, dvbci_exp_pdu_items
);
3477 exp_pdu_data
->tvb_captured_length
= tvb_captured_length(clear_sac_msg_tvb
);
3478 exp_pdu_data
->tvb_reported_length
= tvb_reported_length(clear_sac_msg_tvb
);
3479 exp_pdu_data
->pdu_tvb
= clear_sac_msg_tvb
;
3480 tap_queue_packet(exported_pdu_tap
, pinfo
, exp_pdu_data
);
3486 dissect_dvbci_exported_sac_msg(
3487 tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void *data _U_
)
3492 evt
= dvbci_get_evt_from_addrs(pinfo
);
3493 if (!IS_DATA_TRANSFER(evt
))
3496 col_append_sep_str(pinfo
->cinfo
, COL_PROTOCOL
, NULL
, EXPORTED_SAC_MSG_DESCRIPTION
);
3497 col_clear(pinfo
->cinfo
, COL_INFO
);
3499 /* we only export cc_sac_data_req and _cnf, therefore, the tag can be
3500 derived from the direction of the transfer */
3501 if (evt
== DVBCI_EVT_DATA_CAM_TO_HOST
)
3502 tag
= T_CC_SAC_DATA_REQ
;
3504 tag
= T_CC_SAC_DATA_CNF
;
3506 col_append_sep_str(pinfo
->cinfo
, COL_INFO
, NULL
,
3507 val_to_str_const(tag
, dvbci_apdu_tag
, "unknown"));
3509 dissect_sac_msg(tag
, tvb
, 0, pinfo
, tree
, true);
3510 return tvb_reported_length(tvb
);
3515 dissect_dvbci_payload_cc(uint32_t tag
, int len_field _U_
,
3516 tvbuff_t
*tvb
, int offset
, conversation_t
*conv _U_
,
3517 packet_info
*pinfo
, proto_tree
*tree
)
3527 proto_tree_add_item(tree
, hf_dvbci_cc_sys_id_bitmask
,
3528 tvb
, offset
, 1, ENC_BIG_ENDIAN
);
3532 dissect_cc_data_payload(tag
, tvb
, offset
, pinfo
, tree
, NULL
);
3535 status
= tvb_get_uint8(tvb
, offset
);
3536 proto_tree_add_item(
3537 tree
, hf_dvbci_cc_status_field
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
3538 col_append_sep_str(pinfo
->cinfo
, COL_INFO
, ": ",
3539 val_to_str_const(status
, dvbci_cc_status
, "unknown"));
3541 case T_CC_SAC_DATA_REQ
:
3542 case T_CC_SAC_DATA_CNF
:
3543 case T_CC_SAC_SYNC_REQ
:
3544 case T_CC_SAC_SYNC_CNF
:
3545 dissect_sac_msg(tag
, tvb
, offset
, pinfo
, tree
, false);
3547 case T_CC_PIN_CAPABILITIES_REPLY
:
3548 proto_tree_add_item(tree
, hf_dvbci_capability_field
,
3549 tvb
, offset
, 1 , ENC_BIG_ENDIAN
);
3551 /* we can't call packet_mpeg_sect_mjd_to_utc_time()
3552 and check with nstime_is_zero() */
3553 if (tvb_get_ntoh40(tvb
, offset
) == 0) {
3554 proto_tree_add_expert(tree
, pinfo
, &ei_dvbci_cc_pin_nvr_chg
,
3555 tvb
, offset
, UTC_TIME_LEN
);
3558 if (packet_mpeg_sect_mjd_to_utc_time(tvb
, offset
, &utc_time
) < 0) {
3559 proto_tree_add_expert_format(tree
, pinfo
, &ei_dvbci_bad_length
, tvb
, offset
, UTC_TIME_LEN
,
3560 "Invalid UTC time field, 2 bytes MJD, 3 bytes BCD time hhmmss");
3564 proto_tree_add_time(tree
, hf_dvbci_pin_chg_time
,
3565 tvb
, offset
, UTC_TIME_LEN
, &utc_time
);
3568 offset
+= UTC_TIME_LEN
;
3569 dissect_rating(tvb
, offset
, pinfo
, tree
);
3571 case T_CC_PIN_REPLY
:
3572 pin_stat
= tvb_get_uint8(tvb
, offset
);
3573 proto_tree_add_item(tree
, hf_dvbci_pincode_status
,
3574 tvb
, offset
, 1, ENC_BIG_ENDIAN
);
3575 col_append_sep_str(pinfo
->cinfo
, COL_INFO
, ": ",
3576 val_to_str_const(pin_stat
, dvbci_pincode_status
, "unknown"));
3578 case T_CC_PIN_EVENT
:
3579 proto_tree_add_item(tree
, hf_dvbci_cc_prog_num
,
3580 tvb
, offset
, 2, ENC_BIG_ENDIAN
);
3582 proto_tree_add_item(tree
, hf_dvbci_pincode_status
,
3583 tvb
, offset
, 1, ENC_BIG_ENDIAN
);
3585 dissect_rating(tvb
, offset
, pinfo
, tree
);
3587 if (packet_mpeg_sect_mjd_to_utc_time(tvb
, offset
, &utc_time
) < 0) {
3588 proto_tree_add_expert_format(tree
, pinfo
, &ei_dvbci_bad_length
, tvb
, offset
, UTC_TIME_LEN
,
3589 "Invalid UTC time field, 2 bytes MJD, 3 bytes BCD time hhmmss");
3593 proto_tree_add_time(tree
, hf_dvbci_pin_evt_time
,
3594 tvb
, offset
, UTC_TIME_LEN
, &utc_time
);
3596 offset
+= UTC_TIME_LEN
;
3597 evt_cent
= tvb_get_uint8(tvb
, offset
);
3598 pi
= proto_tree_add_item(tree
, hf_dvbci_pin_evt_cent
,
3599 tvb
, offset
, 1, ENC_BIG_ENDIAN
);
3600 if (evt_cent
> 100) {
3601 expert_add_info(pinfo
, pi
, &ei_dvbci_pin_evt_cent
);
3604 /* length field was already checked by the caller */
3605 proto_tree_add_item(tree
, hf_dvbci_cc_priv_data
, tvb
, offset
,
3606 tvb_reported_length_remaining(tvb
, offset
), ENC_NA
);
3608 case T_CC_PIN_PLAYBACK
:
3609 dissect_rating(tvb
, offset
, pinfo
, tree
);
3611 /* length field was already checked by the caller */
3612 proto_tree_add_item(tree
, hf_dvbci_cc_priv_data
, tvb
, offset
,
3613 tvb_reported_length_remaining(tvb
, offset
), ENC_NA
);
3616 case T_CC_PIN_MMI_REQ
:
3617 proto_tree_add_item(tree
, hf_dvbci_pincode
, tvb
, offset
,
3618 tvb_reported_length_remaining(tvb
, offset
),
3628 dissect_dvbci_ami_file_req(tvbuff_t
*tvb
, int offset
,
3629 packet_info
*pinfo
, proto_tree
*tree
)
3632 const uint8_t *req_str
;
3634 req_type
= tvb_get_uint8(tvb
, offset
);
3635 proto_tree_add_item(tree
, hf_dvbci_req_type
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
3636 col_append_sep_str(pinfo
->cinfo
, COL_INFO
, ": ",
3637 val_to_str_const(req_type
, dvbci_req_type
, "unknown"));
3639 if (req_type
==REQ_TYPE_FILE_HASH
) {
3640 proto_tree_add_item(tree
, hf_dvbci_file_hash
,
3641 tvb
, offset
, 16, ENC_NA
);
3644 if (tvb_reported_length_remaining(tvb
, offset
) <= 0) {
3647 if (req_type
==REQ_TYPE_FILE
|| req_type
==REQ_TYPE_FILE_HASH
) {
3648 proto_tree_add_item_ret_string(tree
, hf_dvbci_file_name
,
3649 tvb
, offset
, tvb_reported_length_remaining(tvb
, offset
),
3650 ENC_ASCII
, pinfo
->pool
, &req_str
);
3651 col_append_sep_str(pinfo
->cinfo
, COL_INFO
, " ", req_str
);
3653 else if (req_type
==REQ_TYPE_DATA
) {
3654 proto_tree_add_item(tree
, hf_dvbci_ami_priv_data
, tvb
, offset
,
3655 tvb_reported_length_remaining(tvb
, offset
), ENC_NA
);
3661 dissect_dvbci_ami_file_ack(tvbuff_t
*tvb
, int offset
,
3662 packet_info
*pinfo
, proto_tree
*tree
)
3665 bool req_ok
= false, file_ok
;
3666 uint8_t file_name_len
;
3667 uint8_t *file_name_str
;
3668 uint32_t file_data_len
;
3669 proto_tree
*req_tree
;
3671 req_type
= tvb_get_uint8(tvb
, offset
+1);
3672 if (req_type
==REQ_TYPE_FILE_HASH
) {
3673 req_ok
= ((tvb_get_uint8(tvb
, offset
) & 0x02) == 0x02);
3674 proto_tree_add_item(tree
, hf_dvbci_req_ok
,
3675 tvb
, offset
, 1, ENC_BIG_ENDIAN
);
3677 file_ok
= ((tvb_get_uint8(tvb
, offset
) & 0x01) == 0x01);
3678 proto_tree_add_item(tree
, hf_dvbci_file_ok
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
3680 proto_tree_add_item(tree
, hf_dvbci_req_type
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
3681 col_append_sep_str(pinfo
->cinfo
, COL_INFO
, ": ",
3682 val_to_str_const(req_type
, dvbci_req_type
, "unknown"));
3684 if (req_type
==REQ_TYPE_FILE
|| req_type
==REQ_TYPE_FILE_HASH
) {
3685 file_name_len
= tvb_get_uint8(tvb
, offset
);
3686 proto_tree_add_item(tree
, hf_dvbci_file_name_len
,
3687 tvb
, offset
, 1, ENC_BIG_ENDIAN
);
3689 file_name_str
= tvb_get_string_enc(pinfo
->pool
,
3690 tvb
, offset
, file_name_len
, ENC_ASCII
);
3693 col_append_sep_str(pinfo
->cinfo
, COL_INFO
, " ",
3695 proto_tree_add_string_format_value(tree
, hf_dvbci_file_name
,
3696 tvb
, offset
, file_name_len
, file_name_str
,
3697 "%s", file_name_str
);
3698 offset
+= file_name_len
;
3699 file_data_len
= tvb_get_ntohl(tvb
, offset
);
3700 proto_tree_add_item(tree
, hf_dvbci_file_data_len
,
3701 tvb
, offset
, 4, ENC_BIG_ENDIAN
);
3703 if (file_data_len
> 0) {
3704 col_append_str(pinfo
->cinfo
, COL_PROTOCOL
, ", ");
3705 col_set_fence(pinfo
->cinfo
, COL_PROTOCOL
);
3706 /* The mime_encap dissector may overwrite this part. */
3707 col_append_str(pinfo
->cinfo
, COL_PROTOCOL
, "Data");
3708 col_set_fence(pinfo
->cinfo
, COL_INFO
);
3709 call_dissector(mime_handle
,
3710 tvb_new_subset_length(tvb
, offset
, file_data_len
),
3714 else if (req_type
==REQ_TYPE_DATA
) {
3715 if (tvb_reported_length_remaining(tvb
, offset
) <= 0)
3717 proto_tree_add_item(tree
, hf_dvbci_ami_priv_data
, tvb
, offset
,
3718 tvb_reported_length_remaining(tvb
, offset
), ENC_NA
);
3720 else if (req_type
==REQ_TYPE_REQ
) {
3721 req_tree
= proto_tree_add_subtree(tree
, tvb
,
3722 offset
, tvb_reported_length_remaining(tvb
, offset
),
3723 ett_dvbci_ami_req_types
, NULL
, "Supported request types");
3724 while (tvb_reported_length_remaining(tvb
, offset
) > 0) {
3725 proto_tree_add_item(req_tree
, hf_dvbci_req_type
,
3726 tvb
, offset
, 1, ENC_BIG_ENDIAN
);
3731 if (req_type
==REQ_TYPE_FILE_HASH
&& req_ok
&& !file_ok
) {
3732 col_append_sep_str(pinfo
->cinfo
, COL_INFO
, NULL
,
3733 "cached copy is valid");
3739 dissect_dvbci_payload_ami(uint32_t tag
, int len_field _U_
,
3740 tvbuff_t
*tvb
, int offset
, conversation_t
*conv _U_
,
3741 packet_info
*pinfo
, proto_tree
*tree
)
3743 uint8_t app_dom_id_len
, init_obj_len
;
3744 const uint8_t *app_dom_id
;
3748 case T_REQUEST_START
:
3749 /* no filter for length items */
3750 app_dom_id_len
= tvb_get_uint8(tvb
, offset
);
3751 proto_tree_add_item(tree
, hf_dvbci_app_dom_id_len
,
3752 tvb
, offset
, 1, ENC_BIG_ENDIAN
);
3754 init_obj_len
= tvb_get_uint8(tvb
, offset
);
3755 proto_tree_add_item(tree
, hf_dvbci_init_obj_len
,
3756 tvb
, offset
, 1, ENC_BIG_ENDIAN
);
3758 proto_tree_add_item_ret_string(tree
, hf_dvbci_app_dom_id
,
3759 tvb
, offset
, app_dom_id_len
, ENC_ASCII
|ENC_NA
, pinfo
->pool
, &app_dom_id
);
3761 col_append_sep_fstr(pinfo
->cinfo
, COL_INFO
, " ",
3762 "for %s", app_dom_id
);
3764 offset
+= app_dom_id_len
;
3765 proto_tree_add_item(tree
, hf_dvbci_init_obj
,
3766 tvb
, offset
, init_obj_len
, ENC_ASCII
);
3768 case T_REQUEST_START_ACK
:
3769 ack_code
= tvb_get_uint8(tvb
, offset
);
3770 proto_tree_add_item(
3771 tree
, hf_dvbci_ack_code
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
3772 col_append_sep_str(pinfo
->cinfo
, COL_INFO
, ": ",
3773 val_to_str_const(ack_code
, dvbci_ack_code
, "unknown"));
3775 case T_FILE_REQUEST
:
3776 dissect_dvbci_ami_file_req(tvb
, offset
, pinfo
, tree
);
3778 case T_FILE_ACKNOWLEDGE
:
3779 dissect_dvbci_ami_file_ack(tvb
, offset
, pinfo
, tree
);
3781 case T_APP_ABORT_REQUEST
:
3782 if (tvb_reported_length_remaining(tvb
, offset
) > 0) {
3783 proto_tree_add_item(tree
, hf_dvbci_abort_req_code
, tvb
, offset
,
3784 tvb_reported_length_remaining(tvb
, offset
), ENC_NA
);
3787 case T_APP_ABORT_ACK
:
3788 if (tvb_reported_length_remaining(tvb
, offset
) > 0) {
3789 proto_tree_add_item(tree
, hf_dvbci_abort_ack_code
, tvb
, offset
,
3790 tvb_reported_length_remaining(tvb
, offset
), ENC_NA
);
3800 dissect_dvbci_payload_lsc(uint32_t tag
, int len_field
,
3801 tvbuff_t
*tvb
, int offset
, conversation_t
*conv
,
3802 packet_info
*pinfo
, proto_tree
*tree
)
3805 uint8_t id
, timeout
, ret_val
, phase_id
;
3806 int conn_desc_len
, param_len
;
3808 proto_item
*pi
= NULL
;
3809 const char *ret_val_str
= NULL
;
3812 dissector_handle_t msg_handle
;
3813 uint32_t conn_state
, i
, num_dns_srv
;
3815 offset_start
= offset
;
3819 proto_tree_add_item(tree
, hf_dvbci_comms_cmd_id
,
3820 tvb
, offset
, 1, ENC_BIG_ENDIAN
);
3821 id
= tvb_get_uint8(tvb
, offset
);
3822 col_append_sep_str(pinfo
->cinfo
, COL_INFO
, ": ",
3823 val_to_str(id
, dvbci_comms_cmd_id
, "Unknown: %d"));
3826 case COMMS_CMD_ID_CONNECT_ON_CHANNEL
:
3827 conn_desc_len
= dissect_conn_desc(tvb
, offset
,
3829 if (conn_desc_len
< 0)
3831 offset
+= conn_desc_len
;
3832 proto_tree_add_item(tree
, hf_dvbci_lsc_retry_count
,
3833 tvb
, offset
, 1, ENC_BIG_ENDIAN
);
3835 timeout
= tvb_get_uint8(tvb
, offset
);
3837 proto_tree_add_uint_format(tree
, hf_dvbci_lsc_timeout
,
3838 tvb
, offset
, 1, timeout
, "Infinite timeout");
3840 proto_tree_add_uint_format(tree
, hf_dvbci_lsc_timeout
,
3841 tvb
, offset
, 1, timeout
,
3842 "Timeout is %d seconds", timeout
);
3845 case COMMS_CMD_ID_DISCONNECT_ON_CHANNEL
:
3846 case COMMS_CMD_ID_ENQUIRE_STATUS
:
3847 /* len_field == 1 -> only id, no further parameters */
3848 if (len_field
!= 1) {
3849 proto_tree_add_expert_format(tree
, pinfo
, &ei_dvbci_bad_length
, tvb
,
3850 APDU_TAG_SIZE
, offset_start
-APDU_TAG_SIZE
,
3851 "Length field must be 1");
3854 case COMMS_CMD_ID_SET_PARAMS
:
3855 param_len
= tvb_reported_length_remaining(tvb
, offset
);
3857 buf_size
= (uint16_t)tvb_get_uint8(tvb
, offset
);
3858 else if (param_len
== 3)
3859 buf_size
= tvb_get_ntohs(tvb
, offset
);
3861 /* length field == 1 byte id + param_len */
3862 proto_tree_add_expert_format(tree
, pinfo
, &ei_dvbci_bad_length
, tvb
,
3863 APDU_TAG_SIZE
, offset_start
-APDU_TAG_SIZE
,
3864 "Length field must be 3 or 4");
3867 proto_tree_add_uint_format(tree
, hf_dvbci_lsc_buf_size
,
3868 tvb
, offset
, param_len
-1, buf_size
,
3869 "buffer size %d bytes", buf_size
);
3870 offset
+= param_len
-1;
3871 timeout
= tvb_get_uint8(tvb
, offset
);
3872 proto_tree_add_uint_format(tree
, hf_dvbci_lsc_timeout
,
3873 tvb
, offset
, 1, timeout
,
3874 "timeout is %d milliseconds", timeout
*10);
3876 case COMMS_CMD_ID_GET_NEXT_BUFFER
:
3877 phase_id
= tvb_get_uint8(tvb
, offset
);
3878 proto_tree_add_item(tree
, hf_dvbci_phase_id
,
3879 tvb
, offset
, 1, ENC_BIG_ENDIAN
);
3880 col_append_sep_fstr(pinfo
->cinfo
, COL_INFO
, NULL
,
3881 "received #%d", phase_id
);
3888 proto_tree_add_item(tree
, hf_dvbci_comms_rep_id
,
3889 tvb
, offset
, 1, ENC_BIG_ENDIAN
);
3890 id
= tvb_get_uint8(tvb
,offset
);
3891 col_append_sep_str(pinfo
->cinfo
, COL_INFO
, NULL
,
3892 val_to_str(id
, dvbci_comms_rep_id
, "Unknown: %d"));
3894 ret_val
= tvb_get_uint8(tvb
,offset
);
3895 pi
= proto_tree_add_item(tree
, hf_dvbci_lsc_ret_val
,
3896 tvb
, offset
, 1, ENC_BIG_ENDIAN
);
3898 case COMMS_REP_ID_SEND_ACK
:
3899 col_append_sep_fstr(pinfo
->cinfo
, COL_INFO
, ": ",
3900 "sent #%d", ret_val
);
3901 proto_item_append_text(pi
, " (sent #%d)", ret_val
);
3903 case COMMS_REP_ID_SET_PARAMS_ACK
:
3904 ret_val_str
= val_to_str_const(ret_val
,
3905 dvbci_lsc_ret_val_params
, "unknown/error");
3907 case COMMS_REP_ID_STATUS_REPLY
:
3908 ret_val_str
= val_to_str_const(ret_val
,
3909 dvbci_lsc_connect
, "unknown/error");
3912 ret_val_str
= val_to_str_const(ret_val
,
3913 dvbci_lsc_ret_val
, "unknown/error");
3917 col_append_sep_str(pinfo
->cinfo
, COL_INFO
, ": ",
3919 proto_item_append_text(pi
, " (%s)", ret_val_str
);
3922 case T_COMMS_SEND_LAST
:
3923 case T_COMMS_SEND_MORE
:
3924 case T_COMMS_RCV_LAST
:
3925 case T_COMMS_RCV_MORE
:
3926 phase_id
= tvb_get_uint8(tvb
, offset
);
3927 proto_tree_add_item(tree
, hf_dvbci_phase_id
,
3928 tvb
, offset
, 1, ENC_BIG_ENDIAN
);
3929 col_append_sep_fstr(pinfo
->cinfo
, COL_INFO
, ": ",
3930 "Phase ID %d", phase_id
);
3932 msg_len
= tvb_reported_length_remaining(tvb
, offset
);
3935 msg_tvb
= tvb_new_subset_remaining(tvb
, offset
);
3938 if (dvbci_dissect_lsc_msg
&& conv
&& conversation_get_dissector(conv
, 0)) {
3939 msg_handle
= conversation_get_dissector(conv
, 0);
3940 col_append_str(pinfo
->cinfo
, COL_INFO
, ", ");
3941 col_set_fence(pinfo
->cinfo
, COL_INFO
);
3942 col_append_str(pinfo
->cinfo
, COL_PROTOCOL
, ", ");
3943 col_set_fence(pinfo
->cinfo
, COL_PROTOCOL
);
3946 msg_handle
= data_handle
;
3949 call_dissector(msg_handle
, msg_tvb
, pinfo
, tree
);
3951 case T_COMMS_IP_CONFIG_REPLY
:
3952 proto_tree_add_item_ret_uint(tree
, hf_dvbci_lsc_conn_state
,
3953 tvb
, offset
, 1, ENC_BIG_ENDIAN
, &conn_state
);
3955 proto_tree_add_item(tree
, hf_dvbci_lsc_phys_addr
,
3956 tvb
, offset
, FT_ETHER_LEN
, ENC_NA
);
3957 offset
+= FT_ETHER_LEN
;
3958 if (conn_state
== LSC_CONNECTED
) {
3959 proto_tree_add_item(tree
, hf_dvbci_lsc_ipv6_addr
,
3960 tvb
, offset
, FT_IPv6_LEN
, ENC_NA
);
3961 offset
+= FT_IPv6_LEN
;
3962 proto_tree_add_item(tree
, hf_dvbci_lsc_netmask
,
3963 tvb
, offset
, FT_IPv6_LEN
, ENC_NA
);
3964 offset
+= FT_IPv6_LEN
;
3965 proto_tree_add_item(tree
, hf_dvbci_lsc_gateway
,
3966 tvb
, offset
, FT_IPv6_LEN
, ENC_NA
);
3967 offset
+= FT_IPv6_LEN
;
3968 proto_tree_add_item(tree
, hf_dvbci_lsc_dhcp_srv
,
3969 tvb
, offset
, FT_IPv6_LEN
, ENC_NA
);
3970 offset
+= FT_IPv6_LEN
;
3971 proto_tree_add_item_ret_uint(tree
, hf_dvbci_lsc_num_dns_srv
,
3972 tvb
, offset
, 1, ENC_BIG_ENDIAN
, &num_dns_srv
);
3974 for(i
= 0; i
< num_dns_srv
; i
++) {
3975 proto_tree_add_item(tree
, hf_dvbci_lsc_dns_srv
,
3976 tvb
, offset
, FT_IPv6_LEN
, ENC_NA
);
3977 offset
+= FT_IPv6_LEN
;
3988 dissect_dvbci_payload_opp(uint32_t tag
, int len_field _U_
,
3989 tvbuff_t
*tvb
, int offset
, conversation_t
*conv _U_
,
3990 packet_info
*pinfo
, proto_tree
*tree
)
3992 uint16_t nit_loop_len
, nit_loop_offset
;
3993 tvbuff_t
*nit_loop_tvb
, *nit_loop_partial_tvb
;
3994 unsigned dvb_nit_bytes
;
3996 uint8_t cap_loop_len
;
3999 dvb_encoding_e encoding
;
4001 uint8_t sig_strength
, sig_qual
;
4005 case T_OPERATOR_STATUS
:
4006 case T_OPERATOR_SEARCH_STATUS
:
4007 dissect_opp_status_body(tvb
, offset
, pinfo
, tree
);
4009 case T_OPERATOR_NIT
:
4010 nit_loop_len
= tvb_get_ntohs(tvb
, offset
);
4011 proto_tree_add_item(tree
, hf_dvbci_nit_loop_len
,
4012 tvb
, offset
, 2, ENC_BIG_ENDIAN
);
4013 if (nit_loop_len
==0)
4016 nit_loop_tvb
= tvb_new_subset_length(
4017 tvb
, offset
, nit_loop_len
);
4018 nit_loop_offset
= 0;
4019 if (!dvb_nit_handle
) {
4020 call_dissector(data_handle
, nit_loop_tvb
, pinfo
, tree
);
4023 /* prevent dvb_nit dissector from clearing the dvb-ci infos */
4024 col_append_str(pinfo
->cinfo
, COL_INFO
, ", ");
4025 col_set_fence(pinfo
->cinfo
, COL_INFO
);
4027 table_id
= tvb_get_uint8(nit_loop_tvb
, nit_loop_offset
);
4028 if (table_id
!= TABLE_ID_CICAM_NIT
) {
4029 proto_tree_add_expert(tree
, pinfo
, &ei_dvbci_cicam_nit_table_id
,
4030 nit_loop_tvb
, nit_loop_offset
, 1);
4032 nit_loop_partial_tvb
=
4033 tvb_new_subset_remaining(nit_loop_tvb
, nit_loop_offset
);
4034 dvb_nit_bytes
= call_dissector(
4035 dvb_nit_handle
, nit_loop_partial_tvb
, pinfo
, tree
);
4036 nit_loop_offset
+= dvb_nit_bytes
;
4037 /* offsets go from 0 to nit_loop_len-1 */
4038 } while (dvb_nit_bytes
>0 && nit_loop_offset
<nit_loop_len
-1);
4040 case T_OPERATOR_INFO
:
4041 info_valid
= ((tvb_get_uint8(tvb
, offset
) & 0x08) == 0x08);
4042 proto_tree_add_item(tree
, hf_dvbci_info_valid
,
4043 tvb
, offset
, 1, ENC_BIG_ENDIAN
);
4044 proto_tree_add_item(tree
, hf_dvbci_info_ver_op_info
,
4045 tvb
, offset
, 1, ENC_BIG_ENDIAN
);
4049 proto_tree_add_item(tree
, hf_dvbci_cicam_onid
,
4050 tvb
, offset
, 2, ENC_BIG_ENDIAN
);
4052 proto_tree_add_item(tree
, hf_dvbci_cicam_id
,
4053 tvb
, offset
, 4, ENC_BIG_ENDIAN
);
4056 enc_len
= dvb_analyze_string_charset(tvb
, offset
,
4057 tvb_reported_length_remaining(tvb
, offset
), &encoding
);
4059 proto_tree_add_expert(tree
, pinfo
,
4060 &ei_dvbci_invalid_char_tbl
, tvb
, offset
,
4061 tvb_reported_length_remaining(tvb
, offset
));
4064 dvb_add_chartbl(tree
, hf_dvbci_opp_char_tbl
,
4065 tvb
, offset
, enc_len
, encoding
);
4068 proto_tree_add_item(tree
, hf_dvbci_sdt_rst_trusted
,
4069 tvb
, offset
, 1, ENC_BIG_ENDIAN
);
4070 proto_tree_add_item(tree
, hf_dvbci_eit_rst_trusted
,
4071 tvb
, offset
, 1, ENC_BIG_ENDIAN
);
4072 proto_tree_add_item(tree
, hf_dvbci_eit_pf_usage
,
4073 tvb
, offset
, 1, ENC_BIG_ENDIAN
);
4074 proto_tree_add_item(tree
, hf_dvbci_eit_sch_usage
,
4075 tvb
, offset
, 1, ENC_BIG_ENDIAN
);
4076 proto_tree_add_item(tree
, hf_dvbci_ext_evt_usage
,
4077 tvb
, offset
, 1, ENC_BIG_ENDIAN
);
4079 proto_tree_add_item(tree
, hf_dvbci_sdt_oth_trusted
,
4080 tvb
, offset
, 1, ENC_BIG_ENDIAN
);
4081 proto_tree_add_item(tree
, hf_dvbci_eit_evt_trigger
,
4082 tvb
, offset
, 1, ENC_BIG_ENDIAN
);
4084 proto_tree_add_item(tree
, hf_dvbci_opp_lang_code
,
4085 tvb
, offset
, 3, ENC_ASCII
);
4087 /* hf_dvbci_prof_name is an FT_UINT_STRING, one leading len byte */
4088 proto_tree_add_item(tree
, hf_dvbci_prof_name
,
4089 tvb
, offset
, 1, ENC_ASCII
|ENC_BIG_ENDIAN
);
4091 case T_OPERATOR_SEARCH_START
:
4092 proto_tree_add_item(tree
, hf_dvbci_unattended
,
4093 tvb
, offset
, 1, ENC_BIG_ENDIAN
);
4095 cap_loop_len
= tvb_get_uint8(tvb
, offset
) & 0x7F;
4096 proto_tree_add_item(tree
, hf_dvbci_opp_svc_type_loop_len
,
4097 tvb
, offset
, 1, ENC_BIG_ENDIAN
);
4099 /* no need for error checking, we continue anyway */
4100 dissect_opp_cap_loop(cap_loop_len
, "Service type loop",
4101 hf_dvbci_opp_svc_type
, 1, tvb
, offset
, pinfo
, tree
);
4102 offset
+= cap_loop_len
;
4104 cap_loop_len
= tvb_get_uint8(tvb
, offset
);
4105 proto_tree_add_item(tree
, hf_dvbci_dlv_cap_loop_len
,
4106 tvb
, offset
, 1, ENC_BIG_ENDIAN
);
4108 /* XXX - handle multi-byte delivery capabilities */
4109 dissect_opp_cap_loop(cap_loop_len
,
4110 "Delivery system capabilities loop",
4111 hf_dvbci_dlv_cap_byte
, 1,
4112 tvb
, offset
, pinfo
, tree
);
4113 offset
+= cap_loop_len
;
4115 cap_loop_len
= tvb_get_uint8(tvb
, offset
);
4116 proto_tree_add_item(tree
, hf_dvbci_app_cap_loop_len
,
4117 tvb
, offset
, 1, ENC_BIG_ENDIAN
);
4119 dissect_opp_cap_loop(cap_loop_len
,
4120 "Application capabilities loop",
4121 hf_dvbci_app_cap_bytes
, 2,
4122 tvb
, offset
, pinfo
, tree
);
4124 case T_OPERATOR_TUNE_STATUS
:
4125 desc_num
= tvb_get_uint8(tvb
, offset
);
4126 pi
= proto_tree_add_item(tree
, hf_dvbci_desc_num
,
4127 tvb
, offset
, 1, ENC_BIG_ENDIAN
);
4128 if (desc_num
==OPP_NO_MORE_DESC
)
4129 proto_item_append_text(pi
, " (all descriptors were processed)");
4131 sig_strength
= tvb_get_uint8(tvb
, offset
);
4132 proto_tree_add_item(tree
, hf_dvbci_sig_strength
,
4133 tvb
, offset
, 1, ENC_BIG_ENDIAN
);
4135 sig_qual
= tvb_get_uint8(tvb
, offset
);
4136 pi
= proto_tree_add_item(tree
, hf_dvbci_sig_qual
,
4137 tvb
, offset
, 1, ENC_BIG_ENDIAN
);
4138 if (sig_strength
>100 || sig_qual
>100) {
4139 expert_add_info(pinfo
, pi
, &ei_dvbci_sig_qual
);
4142 proto_tree_add_item(tree
, hf_dvbci_opp_tune_status
,
4143 tvb
, offset
, 1, ENC_BIG_ENDIAN
);
4144 dissect_desc_loop(hf_dvbci_opp_desc_loop_len
,
4145 tvb
, offset
, pinfo
, tree
);
4147 case T_OPERATOR_TUNE
:
4148 dissect_desc_loop(hf_dvbci_opp_desc_loop_len
,
4149 tvb
, offset
, pinfo
, tree
);
4158 dissect_dvbci_payload_afs(uint32_t tag
, int len_field _U_
,
4159 tvbuff_t
*tvb
, int offset
, conversation_t
*conv _U_
,
4160 packet_info
*pinfo
, proto_tree
*tree
)
4162 const uint8_t *dom_id_str
;
4165 case T_AFS_FILE_SYSTEM_OFFER
:
4166 proto_tree_add_item_ret_string(tree
, hf_dvbci_afs_dom_id
,
4167 tvb
, offset
, 1, ENC_UTF_8
|ENC_BIG_ENDIAN
,
4168 pinfo
->pool
, &dom_id_str
);
4170 col_append_sep_fstr(pinfo
->cinfo
,
4171 COL_INFO
, ": ", "%s", dom_id_str
);
4174 case T_AFS_FILE_SYSTEM_ACK
:
4175 proto_tree_add_item(tree
, hf_dvbci_afs_ack_code
,
4176 tvb
, offset
, 1, ENC_BIG_ENDIAN
);
4178 case T_AFS_FILE_REQUEST
:
4179 dissect_dvbci_ami_file_req(tvb
, offset
, pinfo
, tree
);
4181 case T_AFS_FILE_ACKNOWLEDGE
:
4182 dissect_dvbci_ami_file_ack(tvb
, offset
, pinfo
, tree
);
4191 dissect_dvbci_payload_sas(uint32_t tag
, int len_field _U_
,
4192 tvbuff_t
*tvb
, int offset
, conversation_t
*conv
,
4193 packet_info
*pinfo
, proto_tree
*tree
)
4195 char app_id_str
[2+16+1]; /* "0x", string of 16 hex digits, trailing 0 */
4197 dissector_handle_t msg_handle
;
4203 case T_SAS_CONNECT_RQST
:
4204 case T_SAS_CONNECT_CNF
:
4205 snprintf(app_id_str
, sizeof(app_id_str
),
4206 "0x%016" PRIx64
, tvb_get_ntoh64(tvb
, offset
));
4207 col_append_sep_str(pinfo
->cinfo
, COL_INFO
, ": ", app_id_str
);
4208 proto_tree_add_item(tree
, hf_dvbci_sas_app_id
,
4209 tvb
, offset
, 8, ENC_BIG_ENDIAN
);
4211 if (tag
== T_SAS_CONNECT_CNF
) {
4212 sas_status
= tvb_get_uint8(tvb
, offset
);
4213 col_append_sep_str(pinfo
->cinfo
, COL_INFO
, NULL
,
4214 (sas_status
== SAS_SESS_STATE_CONNECTED
?
4216 proto_tree_add_item(tree
, hf_dvbci_sas_sess_state
,
4217 tvb
, offset
, 1, ENC_BIG_ENDIAN
);
4220 if (sas_status
== SAS_SESS_STATE_CONNECTED
) {
4221 msg_handle
= dissector_get_string_handle(
4222 sas_msg_dissector_table
, app_id_str
);
4223 /* this clears the dissector for msg_handle==NULL */
4224 conversation_set_dissector(conv
, msg_handle
);
4227 conversation_set_dissector(conv
, NULL
);
4230 case T_SAS_ASYNC_MSG
:
4231 msg_nb
= tvb_get_uint8(tvb
, offset
);
4232 col_append_sep_fstr(pinfo
->cinfo
, COL_INFO
, ": ",
4233 "Message #%d ", msg_nb
);
4234 proto_tree_add_item(tree
, hf_dvbci_sas_msg_nb
,
4235 tvb
, offset
, 1, ENC_BIG_ENDIAN
);
4237 msg_len
= tvb_get_ntohs(tvb
, offset
);
4238 proto_tree_add_item(tree
, hf_dvbci_sas_msg_len
,
4239 tvb
, offset
, 2, ENC_BIG_ENDIAN
);
4241 msg_tvb
= tvb_new_subset_length(tvb
, offset
, msg_len
);
4242 msg_handle
= conv
? conversation_get_dissector(conv
, 0) : NULL
;
4243 if (msg_handle
== NULL
)
4244 msg_handle
= data_handle
;
4245 call_dissector(msg_handle
, msg_tvb
, pinfo
, tree
);
4254 dissect_dvbci_apdu(tvbuff_t
*tvb
, conversation_t
*conv
,
4255 packet_info
*pinfo
, proto_tree
*tree
, uint8_t direction
)
4257 proto_tree
*app_tree
;
4258 uint32_t apdu_len
, tag
, len_field
;
4259 const char *tag_str
;
4263 uint32_t apdu_res_id
;
4264 const char *ai_res_class_str
;
4267 apdu_len
= tvb_reported_length(tvb
);
4269 app_tree
= proto_tree_add_subtree(tree
, tvb
, 0, apdu_len
, ett_dvbci_application
, NULL
, "Application Layer");
4271 tag
= tvb_get_ntoh24(tvb
, 0);
4272 tag_str
= try_val_to_str(tag
, dvbci_apdu_tag
);
4273 offset
= APDU_TAG_SIZE
;
4275 col_set_str(pinfo
->cinfo
, COL_INFO
,
4276 val_to_str_const(tag
, dvbci_apdu_tag
, "Unknown/invalid APDU"));
4277 pi
= proto_tree_add_item(
4278 app_tree
, hf_dvbci_apdu_tag
, tvb
, 0, APDU_TAG_SIZE
, ENC_BIG_ENDIAN
);
4279 if (tag_str
== NULL
) {
4280 expert_add_info(pinfo
, pi
, &ei_dvbci_apdu_tag
);
4284 offset
= dissect_ber_length(pinfo
, app_tree
, tvb
, offset
, &len_field
, NULL
);
4285 if ((offset
+len_field
) != apdu_len
) {
4286 proto_tree_add_expert_format(app_tree
, pinfo
, &ei_dvbci_bad_length
, tvb
,
4287 APDU_TAG_SIZE
, offset
-APDU_TAG_SIZE
,
4288 "Length field is different from the number of apdu payload bytes");
4289 /* we need len_field bytes of apdu payload to call
4290 ai->dissect_payload() and continue dissecting */
4291 if (apdu_len
< offset
+len_field
)
4295 ai
= (apdu_info_t
*)g_hash_table_lookup(apdu_table
,
4296 GUINT_TO_POINTER((unsigned)tag
));
4298 proto_tree_add_expert(app_tree
, pinfo
, &ei_dvbci_apdu_not_supported
, tvb
, 0, APDU_TAG_SIZE
);
4301 if (ai
->direction
!=DIRECTION_ANY
&& ai
->direction
!=direction
) {
4302 if (ai
->direction
==DATA_HOST_TO_CAM
) {
4303 proto_tree_add_expert(app_tree
, pinfo
, &ei_dvbci_apu_host_to_cam
, tvb
, 0, APDU_TAG_SIZE
);
4306 proto_tree_add_expert(app_tree
, pinfo
, &ei_dvbci_apu_cam_to_host
, tvb
, 0, APDU_TAG_SIZE
);
4308 /* don't return, we can continue dissecting the APDU */
4310 if (ai
->min_len_field
!=LEN_FIELD_ANY
&& len_field
<ai
->min_len_field
) {
4311 proto_tree_add_expert_format(app_tree
, pinfo
, &ei_dvbci_bad_length
, tvb
, 0, APDU_TAG_SIZE
,
4312 "Invalid APDU length field, minimum length field for %s is %d", tag_str
, ai
->min_len_field
);
4315 if (ai
->len_field
!=LEN_FIELD_ANY
&& len_field
!=ai
->len_field
) {
4316 proto_tree_add_expert_format(app_tree
, pinfo
, &ei_dvbci_bad_length
, tvb
, 0, APDU_TAG_SIZE
,
4317 "Invalid APDU length field, length field for %s must be %d", tag_str
, ai
->len_field
);
4321 apdu_res_id
= GPOINTER_TO_UINT(conversation_get_proto_data(conv
, proto_dvbci
));
4323 ai_res_class_str
= val_to_str_const(ai
->res_class
, dvbci_res_class
, "Unknown");
4325 if(RES_CLASS(apdu_res_id
) != ai
->res_class
) {
4326 proto_tree_add_expert_format(app_tree
, pinfo
, &ei_dvbci_res_class
, tvb
, 0, APDU_TAG_SIZE
,
4327 "Invalid resource class for this apdu, %s can only be sent on a %s session",
4328 tag_str
, ai_res_class_str
);
4330 if(RES_VER(apdu_res_id
) < ai
->res_min_ver
) {
4331 proto_tree_add_expert_format(app_tree
, pinfo
, &ei_dvbci_res_ver
, tvb
, 0, APDU_TAG_SIZE
,
4332 "Invalid resource version for this apdu, %s apdu requires at least %s version %d",
4333 tag_str
, ai_res_class_str
, ai
->res_min_ver
);
4335 /* don't return, we can continue dissecting the APDU */
4337 if (ai
->len_field
!=0) {
4338 if (!ai
->dissect_payload
) {
4339 /* don't display an error, getting here means we have illegal
4340 * data in apdu_info[] */
4343 ai
->dissect_payload(
4344 tag
, len_field
, tvb
, offset
, conv
, pinfo
, app_tree
);
4349 dissect_dvbci_spdu(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
,
4350 uint8_t direction
, uint8_t tcid
)
4354 proto_tree
*sess_tree
;
4356 const char *tag_str
;
4357 conversation_t
*conv
= NULL
;
4361 const spdu_info_t
*si
;
4362 proto_item
*res_id_it
= NULL
;
4364 uint16_t ssnb
= 0; /* session numbers start with 1, 0 is invalid */
4366 tvbuff_t
*payload_tvb
= NULL
;
4369 spdu_len
= tvb_reported_length(tvb
);
4371 sess_tree
= proto_tree_add_subtree(tree
, tvb
, 0, -1, ett_dvbci_session
, &ti
, "Session Layer");
4373 tag
= tvb_get_uint8(tvb
,0);
4374 tag_str
= try_val_to_str(tag
, dvbci_spdu_tag
);
4375 col_set_str(pinfo
->cinfo
, COL_INFO
,
4376 val_to_str_const(tag
, dvbci_spdu_tag
, "Invalid SPDU"));
4377 pi
= proto_tree_add_item(sess_tree
, hf_dvbci_spdu_tag
, tvb
, 0, 1, ENC_BIG_ENDIAN
);
4378 if (tag_str
== NULL
) {
4379 expert_add_info(pinfo
, pi
, &ei_dvbci_spdu_tag
);
4383 offset
= dissect_ber_length(pinfo
, sess_tree
, tvb
, 1, &len_field
, NULL
);
4385 si
= (spdu_info_t
*)g_hash_table_lookup(spdu_table
,
4386 GUINT_TO_POINTER((unsigned)tag
));
4389 if (si
->direction
!=0 && si
->direction
!=direction
) {
4390 if (si
->direction
==DATA_HOST_TO_CAM
) {
4391 proto_tree_add_expert(sess_tree
, pinfo
, &ei_dvbci_spdu_host_to_cam
, tvb
, 0, 1);
4394 proto_tree_add_expert(sess_tree
, pinfo
, &ei_dvbci_spdu_cam_to_host
, tvb
, 0, 1);
4397 if (si
->len_field
!= len_field
) {
4398 /* offset points to 1st byte after the length field */
4399 proto_tree_add_expert_format(sess_tree
, pinfo
, &ei_dvbci_bad_length
, tvb
, 1, offset
-1,
4400 "Invalid SPDU length field, correct length field for %s is %d", tag_str
, si
->len_field
);
4406 case T_OPEN_SESSION_REQUEST
:
4407 res_id_it
= dissect_res_id(tvb
, offset
, pinfo
, sess_tree
, 0, true);
4409 case T_CREATE_SESSION
:
4410 res_id_it
= dissect_res_id(tvb
, offset
, pinfo
, sess_tree
, 0, true);
4411 /* DVB-CI uses network byte order == big endian */
4412 ssnb
= tvb_get_ntohs(tvb
, offset
+RES_ID_LEN
);
4413 proto_tree_add_item(sess_tree
, hf_dvbci_sess_nb
,
4414 tvb
, offset
+RES_ID_LEN
, 2, ENC_BIG_ENDIAN
);
4416 case T_OPEN_SESSION_RESPONSE
:
4417 case T_CREATE_SESSION_RESPONSE
:
4418 sess_stat
= tvb_get_uint8(tvb
, offset
);
4419 proto_tree_add_item(sess_tree
, hf_dvbci_sess_status
,
4420 tvb
, offset
, 1, ENC_BIG_ENDIAN
);
4421 res_id
= tvb_get_ntohl(tvb
, offset
+1);
4422 res_id_it
= dissect_res_id(tvb
, offset
+1, pinfo
, sess_tree
, 0, true);
4423 ssnb
= tvb_get_ntohs(tvb
, offset
+1+RES_ID_LEN
);
4424 proto_tree_add_item(sess_tree
, hf_dvbci_sess_nb
, tvb
,
4425 offset
+1+RES_ID_LEN
, 2, ENC_BIG_ENDIAN
);
4426 if (sess_stat
!= SESS_OPENED
) {
4427 col_append_sep_str(pinfo
->cinfo
, COL_INFO
, NULL
, "Error");
4430 col_append_sep_str(pinfo
->cinfo
, COL_INFO
, NULL
, "Session opened");
4431 conv
= conversation_new_by_id(pinfo
->num
, CONVERSATION_DVBCI
, CT_ID(ssnb
, tcid
));
4432 /* we always add the resource id immediately after the circuit
4434 conversation_add_proto_data(conv
, proto_dvbci
, GUINT_TO_POINTER(res_id
));
4436 case T_CLOSE_SESSION_REQUEST
:
4437 ssnb
= tvb_get_ntohs(tvb
, offset
);
4438 proto_tree_add_item(
4439 sess_tree
, hf_dvbci_sess_nb
, tvb
,
4440 offset
, 2, ENC_BIG_ENDIAN
);
4442 case T_CLOSE_SESSION_RESPONSE
:
4443 sess_stat
= tvb_get_uint8(tvb
, offset
);
4444 proto_tree_add_item(
4445 sess_tree
, hf_dvbci_close_sess_status
, tvb
,
4446 offset
, 1, ENC_BIG_ENDIAN
);
4447 col_append_sep_str(pinfo
->cinfo
, COL_INFO
, NULL
,
4448 sess_stat
==SESS_CLOSED
? "Session closed" : "Error");
4449 ssnb
= tvb_get_ntohs(tvb
, offset
+1);
4450 proto_tree_add_item(sess_tree
, hf_dvbci_sess_nb
,
4451 tvb
, offset
+1, 2, ENC_BIG_ENDIAN
);
4452 conv
= find_conversation_by_id(pinfo
->num
, CONVERSATION_DVBCI
, CT_ID(ssnb
, tcid
));
4454 conv
->last_frame
= pinfo
->num
;
4456 case T_SESSION_NUMBER
:
4457 ssnb
= tvb_get_ntohs(tvb
, offset
);
4458 proto_tree_add_item(
4459 sess_tree
, hf_dvbci_sess_nb
, tvb
,
4460 offset
, 2, ENC_BIG_ENDIAN
);
4462 tvb_new_subset_remaining(tvb
, offset
+2);
4469 conv
= find_conversation_by_id(pinfo
->num
, CONVERSATION_DVBCI
, CT_ID(ssnb
, tcid
));
4471 /* if the packet contains no resource id, we add the cached id from
4472 the circuit so that each packet has a resource id that can be
4473 used for filtering */
4474 if (conv
&& !res_id_it
) {
4475 /* when a circuit is found, it always contains a valid resource id */
4476 res_id
= GPOINTER_TO_UINT(conversation_get_proto_data(conv
, proto_dvbci
));
4477 res_id_it
= dissect_res_id(NULL
, 0, pinfo
, sess_tree
, res_id
, true);
4478 proto_item_set_generated(res_id_it
);
4482 proto_item_set_len(ti
, spdu_len
-tvb_reported_length(payload_tvb
));
4483 dissect_dvbci_apdu(payload_tvb
, conv
, pinfo
, tree
, direction
);
4486 proto_item_set_len(ti
, spdu_len
);
4490 /* dissect the status of an r_tpdu, return its length or -1 for error */
4492 dissect_dvbci_tpdu_status(tvbuff_t
*tvb
, int offset
,
4493 packet_info
*pinfo
, proto_tree
*tree
,
4494 uint8_t lpdu_tcid
, uint8_t r_tpdu_tag
)
4496 int offset_new
, len_start_offset
;
4499 uint8_t t_c_id
, sb_value
;
4503 offset_new
= offset
;
4505 tag
= tvb_get_uint8(tvb
, offset_new
);
4507 proto_tree_add_expert(tree
, pinfo
, &ei_dvbci_tpdu_status_tag
, tvb
, offset_new
, 1);
4510 proto_tree_add_item(tree
, hf_dvbci_sb_tag
, tvb
,
4511 offset_new
, 1, ENC_BIG_ENDIAN
);
4512 col_append_sep_str(pinfo
->cinfo
, COL_INFO
, NULL
, "T_SB");
4515 len_start_offset
= offset_new
;
4516 offset_new
= dissect_ber_length(
4517 pinfo
, tree
, tvb
, offset_new
, &len_field
, NULL
);
4518 if (len_field
!= 2) {
4519 proto_tree_add_expert_format(tree
, pinfo
, &ei_dvbci_bad_length
, tvb
, len_start_offset
, offset_new
-len_start_offset
,
4520 "Invalid status length field, this must always be 2");
4525 t_c_id
= tvb_get_uint8(tvb
, offset_new
);
4526 pi
= proto_tree_add_item(tree
, hf_dvbci_t_c_id
, tvb
, offset_new
, 1, ENC_BIG_ENDIAN
);
4527 /* tcid in transport header and link layer must only match for data
4528 * transmission commands */
4529 if (t_c_id
!=lpdu_tcid
) {
4530 if (r_tpdu_tag
==NO_TAG
||
4531 r_tpdu_tag
==T_DATA_MORE
|| r_tpdu_tag
==T_DATA_LAST
) {
4532 expert_add_info_format(pinfo
, pi
, &ei_dvbci_t_c_id
,
4533 "Transport Connection ID mismatch, tcid is %d in the transport layer and %d in the link layer",
4540 sb_value
= tvb_get_uint8(tvb
, offset_new
);
4541 sb_str
= try_val_to_str(sb_value
, dvbci_sb_value
);
4542 pi
= proto_tree_add_item(tree
, hf_dvbci_sb_value
, tvb
,
4543 offset_new
, 1, ENC_BIG_ENDIAN
);
4545 col_append_sep_str(pinfo
->cinfo
, COL_INFO
, ": ", sb_str
);
4548 expert_add_info(pinfo
, pi
, &ei_dvbci_sb_value
);
4552 return offset_new
-offset
;
4556 /* dissect the header of a c_tpdu or r_tpdu
4557 return the length of the header (tag, len_field, t_c_id) or -1 for error */
4559 dissect_dvbci_tpdu_hdr(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
,
4560 uint8_t direction
, uint8_t lpdu_tcid
, uint32_t tpdu_len
,
4561 uint8_t *hdr_tag
, uint32_t *body_len
)
4563 uint8_t c_tpdu_tag
, r_tpdu_tag
, *tag
= NULL
;
4564 const char *c_tpdu_str
, *r_tpdu_str
;
4570 if (direction
==DATA_HOST_TO_CAM
) {
4571 c_tpdu_tag
= tvb_get_uint8(tvb
, 0);
4573 c_tpdu_str
= try_val_to_str(c_tpdu_tag
, dvbci_c_tpdu
);
4574 pi
= proto_tree_add_item(tree
, hf_dvbci_c_tpdu_tag
, tvb
, 0, 1, ENC_BIG_ENDIAN
);
4576 col_append_sep_str(pinfo
->cinfo
, COL_INFO
, NULL
, c_tpdu_str
);
4579 col_append_sep_str(pinfo
->cinfo
, COL_INFO
, NULL
,
4580 "Invalid Command-TPDU tag");
4581 expert_add_info(pinfo
, pi
, &ei_dvbci_c_tpdu_tag
);
4586 r_tpdu_tag
= tvb_get_uint8(tvb
, 0);
4587 if (r_tpdu_tag
== T_SB
) {
4588 /* we have an r_tpdu without header and body,
4589 it contains only the status part */
4598 r_tpdu_str
= try_val_to_str(r_tpdu_tag
, dvbci_r_tpdu
);
4599 pi
= proto_tree_add_item(tree
, hf_dvbci_r_tpdu_tag
, tvb
, 0, 1, ENC_BIG_ENDIAN
);
4601 col_append_sep_str(pinfo
->cinfo
, COL_INFO
, NULL
, r_tpdu_str
);
4604 col_append_sep_str(pinfo
->cinfo
, COL_INFO
, NULL
,
4605 "Invalid Response-TPDU tag");
4606 expert_add_info(pinfo
, pi
, &ei_dvbci_r_tpdu_tag
);
4611 offset
= dissect_ber_length(pinfo
, tree
, tvb
, 1, &len_field
, NULL
);
4612 /* len_field must be at least 1 for the following t_c_id
4613 c_tpdu's len_field must match tvbuff exactly
4614 r_tpdu's len_field does not include the status part after the body */
4616 ((direction
==DATA_HOST_TO_CAM
) && ((offset
+len_field
)!=tpdu_len
)) ||
4617 ((direction
==DATA_CAM_TO_HOST
) && ((offset
+len_field
)>tpdu_len
))) {
4618 /* offset points to 1st byte after the length field */
4619 proto_tree_add_expert_format(tree
, pinfo
, &ei_dvbci_bad_length
, tvb
, 1, offset
-1,
4620 len_field
==0 ? "Invalid length field, length field must be at least 1" :
4621 "Invalid length field, length field mismatch");
4625 t_c_id
= tvb_get_uint8(tvb
, offset
);
4626 pi
= proto_tree_add_item(tree
, hf_dvbci_t_c_id
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
4627 /* tcid in transport header and link layer must only match for
4628 * data transmission commands */
4629 if (t_c_id
!=lpdu_tcid
) {
4630 if (tag
&& (*tag
==T_RCV
|| *tag
==T_DATA_MORE
|| *tag
==T_DATA_LAST
)) {
4631 expert_add_info_format(pinfo
, pi
, &ei_dvbci_t_c_id
, "Transport Connection ID mismatch, tcid is %d in the transport layer and %d in the link layer",
4636 col_append_sep_fstr(pinfo
->cinfo
, COL_INFO
, ": ", "tcid %d", t_c_id
);
4643 *body_len
= len_field
-1; /* -1 for t_c_id */
4648 dissect_dvbci_tpdu(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
,
4649 uint8_t direction
, uint8_t lpdu_tcid
)
4651 uint32_t tpdu_len
, body_len
;
4653 proto_tree
*trans_tree
;
4654 int offset
, status_len
;
4655 uint8_t hdr_tag
= NO_TAG
;
4656 tvbuff_t
*body_tvb
, *payload_tvb
= NULL
;
4657 fragment_head
*frag_msg
= NULL
;
4660 tpdu_len
= tvb_reported_length(tvb
);
4662 col_clear(pinfo
->cinfo
, COL_INFO
);
4664 trans_tree
= proto_tree_add_subtree(tree
, tvb
, 0, -1, ett_dvbci_transport
, &ti
, "Transport Layer");
4666 offset
= dissect_dvbci_tpdu_hdr(tvb
, pinfo
, trans_tree
, direction
,
4667 lpdu_tcid
, tpdu_len
, &hdr_tag
, &body_len
);
4670 proto_item_set_len(ti
, offset
);
4671 if ((offset
>0) && (body_len
!=0)) {
4672 /* for unfragmented data, the reassembly api behaviour is unclear
4673 if we put the body part of the tvb into fragment_add_seq_next(),
4674 process_reassembled_data() returns the remainder of the tvb
4675 which is body|status part
4676 if there's more than one fragment, payload_tvb contains only
4677 the reassembled bodies as expected
4678 to work around this issue, we use a dedicated body_tvb as
4679 input to reassembly routines */
4680 body_tvb
= tvb_new_subset_length(tvb
, offset
, body_len
);
4681 /* dissect_dvbci_tpdu_hdr() checked that lpdu_tcid==t_c_id */
4682 frag_msg
= fragment_add_seq_next(&spdu_reassembly_table
,
4683 body_tvb
, 0, pinfo
, SPDU_SEQ_ID_BASE
+lpdu_tcid
, NULL
,
4685 hdr_tag
== T_DATA_MORE
? 1 : 0);
4686 payload_tvb
= process_reassembled_data(body_tvb
, 0, pinfo
,
4687 "Reassembled SPDU", frag_msg
, &spdu_frag_items
,
4690 if (hdr_tag
== T_DATA_MORE
) {
4691 pinfo
->fragmented
= true;
4692 col_append_str(pinfo
->cinfo
, COL_INFO
, " (Message fragment)");
4694 payload_tvb
= body_tvb
;
4700 if (direction
==DATA_CAM_TO_HOST
) {
4701 /* minimum length of an rtpdu status is 4 bytes */
4702 if (tpdu_len
-offset
< 4) {
4703 proto_tree_add_expert(trans_tree
, pinfo
, &ei_dvbci_r_tpdu_status_mandatory
, tvb
, 0, 0);
4706 status_len
= dissect_dvbci_tpdu_status(
4707 tvb
, offset
, pinfo
, trans_tree
, lpdu_tcid
, hdr_tag
);
4710 proto_tree_set_appendix(trans_tree
, tvb
, offset
, status_len
);
4714 dissect_dvbci_spdu(payload_tvb
, pinfo
, tree
, direction
, lpdu_tcid
);
4719 dissect_dvbci_lpdu(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
,
4722 proto_tree
*link_tree
;
4723 uint32_t payload_len
;
4724 uint8_t tcid
, more_last
;
4726 tvbuff_t
*payload_tvb
;
4727 fragment_head
*frag_msg
;
4730 payload_len
= tvb_reported_length(tvb
);
4732 col_set_str(pinfo
->cinfo
, COL_INFO
, "LPDU");
4734 link_tree
= proto_tree_add_subtree(tree
, tvb
, 0, 2, ett_dvbci_link
, NULL
, "Link Layer");
4736 tcid
= tvb_get_uint8(tvb
, 0);
4737 col_append_sep_fstr(pinfo
->cinfo
, COL_INFO
, ": ", "tcid %d", tcid
);
4738 proto_tree_add_item(link_tree
, hf_dvbci_tcid
, tvb
, 0, 1, ENC_BIG_ENDIAN
);
4740 more_last
= tvb_get_uint8(tvb
, 1);
4741 pi
= proto_tree_add_item(link_tree
, hf_dvbci_ml
, tvb
, 1, 1, ENC_BIG_ENDIAN
);
4742 if (try_val_to_str(more_last
, dvbci_ml
) == NULL
) {
4743 expert_add_info(pinfo
, pi
, &ei_dvbci_ml
);
4746 /* buf_size_host==0 -> we did not capture the buffer size negotiation */
4747 if (buf_size_host
!=0 && payload_len
>buf_size_host
) {
4748 proto_tree_add_expert_format(link_tree
, pinfo
, &ei_dvbci_bad_length
, tvb
, 2, payload_len
,
4749 "Payload too large, maximum payload length is the negotiated buffer size (%d bytes)", buf_size_host
);
4752 frag_msg
= fragment_add_seq_next(&tpdu_reassembly_table
,
4753 tvb
, 2, pinfo
, TPDU_SEQ_ID_BASE
+tcid
, NULL
,
4754 tvb_reported_length_remaining(tvb
, 2),
4755 more_last
== ML_MORE
? 1 : 0);
4757 payload_tvb
= process_reassembled_data(tvb
, 2, pinfo
,
4758 "Reassembled TPDU", frag_msg
, &tpdu_frag_items
,
4761 if (more_last
== ML_MORE
) {
4762 pinfo
->fragmented
= true;
4763 col_append_str(pinfo
->cinfo
, COL_INFO
, " (Message fragment)");
4765 payload_tvb
= tvb_new_subset_remaining(tvb
, 2);
4768 dissect_dvbci_tpdu(payload_tvb
, pinfo
, tree
, direction
, tcid
);
4771 /* dissect DVB-CI buffer size negotiation */
4773 dissect_dvbci_buf_neg(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
,
4779 buf_size
= tvb_get_ntohs(tvb
, 0);
4781 col_add_fstr(pinfo
->cinfo
, COL_INFO
, "%s: %u bytes",
4782 direction
== DATA_HOST_TO_CAM
?
4783 "negotiated buffer size" : "buffer size proposal",
4786 if (direction
== DATA_HOST_TO_CAM
) {
4787 buf_size_host
= buf_size
;
4788 pi
= proto_tree_add_uint_format(tree
, hf_dvbci_buf_size
, tvb
,
4790 "Negotiated buffer size: %u bytes", buf_size
);
4791 if (buf_size_host
> buf_size_cam
) {
4793 wireshark may run through each packet multiple times
4794 if we didn't check the direction, we'd get the error when
4795 wireshark runs through the initial CAM packet for the 2nd time
4797 expert_add_info_format(pinfo
, pi
, &ei_dvbci_buf_size
, "Illegal buffer size command. Host shall not request a buffer size larger than the CAM proposal");
4800 else if (direction
== DATA_CAM_TO_HOST
) {
4801 buf_size_cam
= buf_size
;
4802 proto_tree_add_uint_format(tree
, hf_dvbci_buf_size
, tvb
,
4804 "Buffer size proposal by the CAM: %u bytes", buf_size
);
4807 if (buf_size
< 16) {
4808 proto_tree_add_expert_format(tree
, pinfo
, &ei_dvbci_buf_size
, tvb
, 0, 2,
4809 "Illegal buffer size, minimum buffer size is 16 bytes");
4813 /* dissect Level 1 version/product information tuple's payload
4814 data_tvb is a separate tvb for the tuple payload (without tag and len)
4815 return the number of dissected bytes or -1 for error */
4817 dissect_dvbci_cis_payload_tpll_v1(tvbuff_t
*data_tvb
,
4818 packet_info
*pinfo _U_
, proto_tree
*tree
)
4820 int offset
=0, offset_str_end
;
4822 /* the CIS is defined by PCMCIA, all multi-byte values are little endian
4823 (the rest of DVB-CI is a big-endian protocol) */
4824 proto_tree_add_item(tree
, hf_dvbci_cis_tpll_v1_major
,
4825 data_tvb
, offset
, 1, ENC_LITTLE_ENDIAN
);
4827 proto_tree_add_item(tree
, hf_dvbci_cis_tpll_v1_minor
,
4828 data_tvb
, offset
, 1, ENC_LITTLE_ENDIAN
);
4831 /* manufacturer, name and additional infos are 0-terminated strings */
4832 offset_str_end
= tvb_find_uint8(data_tvb
, offset
, -1, 0x0);
4833 if (offset_str_end
<offset
) /* offset_str_end==offset is ok */
4835 proto_tree_add_item(tree
, hf_dvbci_cis_tpll_v1_info_manuf
,
4836 data_tvb
, offset
, offset_str_end
-offset
, ENC_ASCII
);
4837 offset
= offset_str_end
+1; /* +1 for 0 termination */
4839 offset_str_end
= tvb_find_uint8(data_tvb
, offset
, -1, 0x0);
4840 if (offset_str_end
<offset
)
4842 proto_tree_add_item(tree
, hf_dvbci_cis_tpll_v1_info_name
,
4843 data_tvb
, offset
, offset_str_end
-offset
, ENC_ASCII
);
4844 offset
= offset_str_end
+1;
4846 /* the pc-card spec mentions two additional info strings,
4847 it's unclear if both are mandatory
4848 >1 because the last byte is the tuple end marker */
4849 while (tvb_reported_length_remaining(data_tvb
, offset
)>1) {
4850 offset_str_end
= tvb_find_uint8(data_tvb
, offset
, -1, 0x0);
4851 if (offset_str_end
<offset
)
4853 proto_tree_add_item(tree
, hf_dvbci_cis_tpll_v1_info_additional
,
4854 data_tvb
, offset
, offset_str_end
-offset
, ENC_ASCII
);
4855 offset
= offset_str_end
+1;
4858 proto_tree_add_item(tree
, hf_dvbci_cis_tpll_v1_end
,
4859 data_tvb
, offset
, 1, ENC_LITTLE_ENDIAN
);
4866 dissect_dvbci_cis_payload_config(tvbuff_t
*data_tvb
,
4867 packet_info
*pinfo _U_
, proto_tree
*tree
)
4870 /* these are the actual sizes, the CIS stores rmsz-1 and rasz-1 */
4871 uint8_t rfsz
, rmsz
, rasz
;
4872 uint8_t st_code
, st_len
;
4873 const char *st_code_str
;
4874 proto_item
*st_item
= NULL
;
4875 proto_tree
*st_tree
= NULL
;
4876 uint8_t stci_ifn_size
; /* actual size, see comment above */
4878 rfsz
= (tvb_get_uint8(data_tvb
, offset
)&0xC0) >> 6;
4879 proto_tree_add_item(tree
, hf_dvbci_cis_tpcc_rfsz
,
4880 data_tvb
, offset
, 1, ENC_LITTLE_ENDIAN
);
4881 rmsz
= ((tvb_get_uint8(data_tvb
, offset
)&0x3C) >> 2) + 1;
4882 proto_tree_add_item(tree
, hf_dvbci_cis_tpcc_rmsz
,
4883 data_tvb
, offset
, 1, ENC_LITTLE_ENDIAN
);
4884 rasz
= (tvb_get_uint8(data_tvb
, offset
)&0x03) + 1;
4885 proto_tree_add_item(tree
, hf_dvbci_cis_tpcc_rasz
,
4886 data_tvb
, offset
, 1, ENC_LITTLE_ENDIAN
);
4889 proto_tree_add_item(tree
, hf_dvbci_cis_tpcc_last
,
4890 data_tvb
, offset
, 1, ENC_LITTLE_ENDIAN
);
4893 proto_tree_add_item(tree
, hf_dvbci_cis_tpcc_radr
,
4894 data_tvb
, offset
, rasz
, ENC_LITTLE_ENDIAN
);
4896 proto_tree_add_item(tree
, hf_dvbci_cis_tpcc_rmsk
,
4897 data_tvb
, offset
, rmsz
, ENC_NA
);
4899 offset
+= rfsz
; /* skip reserved bytes */
4901 while (tvb_reported_length_remaining(data_tvb
, offset
) > 0) {
4902 st_code
= tvb_get_uint8(data_tvb
, offset
);
4903 st_code_str
= val_to_str_const(st_code
, dvbci_cis_subtpl_code
, "unknown");
4904 st_tree
= proto_tree_add_subtree_format(tree
, data_tvb
, offset
, -1,
4905 ett_dvbci_cis_subtpl
, &st_item
, "Subtuple: %s (0x%x)", st_code_str
, st_code
);
4906 proto_tree_add_item(st_tree
, hf_dvbci_cis_st_code
,
4907 data_tvb
, offset
, 1, ENC_LITTLE_ENDIAN
);
4909 st_len
= tvb_get_uint8(data_tvb
, offset
);
4910 proto_item_set_len(st_item
, 2+st_len
); /* tag, len byte, body */
4911 proto_tree_add_item(st_tree
, hf_dvbci_cis_st_len
,
4912 data_tvb
, offset
, 1, ENC_LITTLE_ENDIAN
);
4914 if (st_code
== CCSTPL_CIF
) {
4915 stci_ifn_size
= ((tvb_get_uint8(data_tvb
, offset
) & 0xC0)>>6)+1;
4916 proto_tree_add_item(st_tree
, hf_dvbci_cis_stci_ifn_size
,
4917 data_tvb
, offset
, 1, ENC_LITTLE_ENDIAN
);
4918 /* don't increment offset,
4919 size and actual value's LSB share the same byte */
4920 proto_tree_add_item(st_tree
, hf_dvbci_cis_stci_ifn
,
4921 data_tvb
, offset
, stci_ifn_size
, ENC_LITTLE_ENDIAN
);
4922 offset
+= stci_ifn_size
;
4923 /* the stci_str field could consist of multiple strings,
4924 this case is not supported for now */
4925 proto_tree_add_item(st_tree
, hf_dvbci_cis_stci_str
,
4926 data_tvb
, offset
, st_len
-stci_ifn_size
, ENC_ASCII
);
4927 offset
+= st_len
-stci_ifn_size
;
4930 /* skip unknown subtuple's content */
4940 dissect_dvbci_cis_payload_cftable_entry(tvbuff_t
*data_tvb
,
4941 packet_info
*pinfo _U_
, proto_tree
*tree
)
4946 intface_flag
= ((tvb_get_uint8(data_tvb
, offset
) & 0x80) == 0x80);
4947 /* tpce_indx byte */
4948 proto_tree_add_item(tree
, hf_dvbci_cis_tpce_indx_intface
,
4949 data_tvb
, offset
, 1, ENC_LITTLE_ENDIAN
);
4950 proto_tree_add_item(tree
, hf_dvbci_cis_tpce_indx_default
,
4951 data_tvb
, offset
, 1, ENC_LITTLE_ENDIAN
);
4952 proto_tree_add_item(tree
, hf_dvbci_cis_tpce_indx_cnf_entry
,
4953 data_tvb
, offset
, 1, ENC_LITTLE_ENDIAN
);
4958 proto_tree_add_item(tree
, hf_dvbci_cis_tpce_if_type
,
4959 data_tvb
, offset
, 1, ENC_LITTLE_ENDIAN
);
4960 /* XXX parse other components of tpce_if */
4964 /* tpce_fs byte: this is present in any case */
4965 proto_tree_add_item(tree
, hf_dvbci_cis_tpce_fs_mem_space
,
4966 data_tvb
, offset
, 1, ENC_LITTLE_ENDIAN
);
4967 proto_tree_add_item(tree
, hf_dvbci_cis_tpce_fs_irq
,
4968 data_tvb
, offset
, 1, ENC_LITTLE_ENDIAN
);
4969 proto_tree_add_item(tree
, hf_dvbci_cis_tpce_fs_io
,
4970 data_tvb
, offset
, 1, ENC_LITTLE_ENDIAN
);
4971 /* XXX parse other components of tpce_fs */
4977 /* dissect the payload of a device_oc or device_oa tuple */
4979 dissect_dvbci_cis_payload_device(tvbuff_t
*data_tvb
,
4980 packet_info
*pinfo _U_
, proto_tree
*tree
)
4985 ext
= ((tvb_get_uint8(data_tvb
, offset
) & 0x80) == 0x80);
4987 proto_tree_add_item(tree
, hf_dvbci_cis_dev_vcc_used
,
4988 data_tvb
, offset
, 1, ENC_LITTLE_ENDIAN
);
4989 proto_tree_add_item(tree
, hf_dvbci_cis_dev_mwait
,
4990 data_tvb
, offset
, 1, ENC_LITTLE_ENDIAN
);
4994 ext
= ((tvb_get_uint8(data_tvb
, offset
) & 0x80) == 0x80);
4996 proto_tree_add_item(tree
, hf_dvbci_cis_dev_oth_cond_info
,
4997 data_tvb
, offset
, 1, ENC_LITTLE_ENDIAN
);
5005 dissect_dvbci_cis(tvbuff_t
*tvb
, int offset
,
5006 packet_info
*pinfo
, proto_tree
*tree
)
5009 proto_tree
*cis_tree
= NULL
, *tpl_tree
= NULL
;
5010 proto_item
*ti_main
, *ti_tpl
;
5012 const char *tpl_code_str
= NULL
;
5014 tvbuff_t
*tpl_data_tvb
;
5016 offset_start
= offset
;
5018 cis_tree
= proto_tree_add_subtree(tree
, tvb
, offset
, -1,
5019 ett_dvbci_cis
, &ti_main
, "Card Information Structure (CIS)");
5022 tpl_code
= tvb_get_uint8(tvb
, offset
);
5023 tpl_code_str
= val_to_str_const(tpl_code
, dvbci_cis_tpl_code
, "unknown");
5025 tpl_tree
= proto_tree_add_subtree_format(cis_tree
,
5026 tvb
, offset
, -1, ett_dvbci_cis_tpl
, &ti_tpl
, "CIS tuple: %s", tpl_code_str
);
5028 proto_tree_add_uint_format(tpl_tree
, hf_dvbci_cis_tpl_code
,
5029 tvb
, offset
, 1, tpl_code
, "Tuple code: %s (0x%x)",
5030 tpl_code_str
, tpl_code
);
5033 if (tpl_code
== CISTPL_END
) {
5034 proto_item_set_len(ti_tpl
, 1); /* only tag (no len and content) */
5038 len_field
= tvb_get_uint8(tvb
, offset
);
5039 proto_tree_add_item(tpl_tree
, hf_dvbci_cis_tpl_len
,
5040 tvb
, offset
, 1, ENC_LITTLE_ENDIAN
);
5043 tpl_data_tvb
= tvb_new_subset_length(tvb
, offset
, len_field
);
5046 dissect_dvbci_cis_payload_tpll_v1(
5047 tpl_data_tvb
, pinfo
, tpl_tree
);
5048 offset
+= len_field
;
5051 dissect_dvbci_cis_payload_config(tpl_data_tvb
, pinfo
, tpl_tree
);
5052 offset
+= len_field
;
5054 case CISTPL_CFTABLE_ENTRY
:
5055 dissect_dvbci_cis_payload_cftable_entry(
5056 tpl_data_tvb
, pinfo
, tpl_tree
);
5057 offset
+= len_field
;
5059 case CISTPL_DEVICE_OC
:
5060 /* fall through: those two tuples' data is identical */
5061 case CISTPL_DEVICE_OA
:
5062 dissect_dvbci_cis_payload_device(
5063 tpl_data_tvb
, pinfo
, tpl_tree
);
5064 offset
+= len_field
;
5067 proto_tree_add_item(tpl_tree
, hf_dvbci_cis_tplmid_manf
,
5068 tvb
, offset
, 2, ENC_LITTLE_ENDIAN
);
5070 proto_tree_add_item(tpl_tree
, hf_dvbci_cis_tplmid_card
,
5071 tvb
, offset
, 2, ENC_LITTLE_ENDIAN
);
5076 proto_tree_add_item(tpl_tree
, hf_dvbci_cis_tpl_data
,
5077 tvb
, offset
, len_field
, ENC_NA
);
5079 offset
+= len_field
;
5083 proto_item_set_len(ti_tpl
, 2+len_field
); /* tag, len byte, content */
5085 } while (tvb_reported_length_remaining(tvb
, offset
) > 0);
5087 proto_item_set_len(ti_main
, offset
-offset_start
);
5092 dissect_dvbci(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void *data _U_
)
5094 int packet_len
, offset
= 0, offset_ver
, offset_evt
, offset_len_field
;
5095 uint8_t version
, event
;
5096 const char *event_str
;
5099 proto_tree
*dvbci_tree
, *hdr_tree
;
5100 tvbuff_t
*payload_tvb
;
5106 if (tvb_captured_length(tvb
) < 4)
5109 offset_ver
= offset
;
5110 version
= tvb_get_uint8(tvb
, offset
++);
5114 offset_evt
= offset
;
5115 event
= tvb_get_uint8(tvb
, offset
++);
5116 event_str
= try_val_to_str(event
, dvbci_event
);
5120 packet_len
= tvb_reported_length(tvb
);
5121 offset_len_field
= offset
;
5122 len_field
= tvb_get_ntohs(tvb
, offset
);
5123 if (len_field
!= (packet_len
-4))
5127 col_set_str(pinfo
->cinfo
, COL_PROTOCOL
, "DVB-CI");
5128 col_set_str(pinfo
->cinfo
, COL_INFO
, event_str
);
5130 ti
= proto_tree_add_protocol_format(tree
, proto_dvbci
,
5131 tvb
, 0, packet_len
, "DVB Common Interface: %s", event_str
);
5132 dvbci_tree
= proto_item_add_subtree(ti
, ett_dvbci
);
5133 hdr_tree
= proto_tree_add_subtree(dvbci_tree
,
5134 tvb
, 0, offset
, ett_dvbci_hdr
, NULL
, "Pseudo header");
5135 proto_tree_add_item(hdr_tree
, hf_dvbci_hdr_ver
,
5136 tvb
, offset_ver
, 1, ENC_BIG_ENDIAN
);
5137 proto_tree_add_item(hdr_tree
, hf_dvbci_event
,
5138 tvb
, offset_evt
, 1, ENC_BIG_ENDIAN
);
5139 proto_tree_add_item(hdr_tree
, hf_dvbci_len
,
5140 tvb
, offset_len_field
, 2, ENC_BIG_ENDIAN
);
5142 if (IS_DATA_TRANSFER(event
)) {
5143 dvbci_set_addrs(event
, pinfo
);
5145 payload_tvb
= tvb_new_subset_remaining(tvb
, offset
);
5146 if (len_field
== 2) {
5147 dissect_dvbci_buf_neg(payload_tvb
, pinfo
, dvbci_tree
, event
);
5150 dissect_dvbci_lpdu(payload_tvb
, pinfo
, dvbci_tree
, event
);
5153 else if (event
==DVBCI_EVT_COR_WRITE
) {
5154 /* PCAP format for DVB-CI defines COR address as big endian */
5155 pi
= proto_tree_add_item(dvbci_tree
, hf_dvbci_cor_addr
,
5156 tvb
, offset
, 2, ENC_BIG_ENDIAN
);
5157 cor_addr
= tvb_get_ntohs(tvb
, offset
);
5158 if (cor_addr
== 0xFFFF) {
5159 proto_item_append_text(pi
, " (COR address is unknown)");
5160 col_append_sep_str(pinfo
->cinfo
, COL_INFO
, ": ", "unknown address");
5162 else if (cor_addr
> 0xFFE) {
5163 expert_add_info(pinfo
, pi
, &ei_dvbci_cor_addr
);
5166 col_append_sep_fstr(pinfo
->cinfo
, COL_INFO
, ": ",
5167 "address 0x%x", cor_addr
);
5170 cor_value
= tvb_get_uint8(tvb
, offset
);
5171 proto_tree_add_item(dvbci_tree
, hf_dvbci_cor_val
,
5172 tvb
, offset
, 1, ENC_BIG_ENDIAN
);
5173 col_append_sep_fstr(pinfo
->cinfo
, COL_INFO
, NULL
,
5174 "value 0x%x", cor_value
);
5176 else if (event
==DVBCI_EVT_CIS_READ
) {
5177 dissect_dvbci_cis(tvb
, offset
, pinfo
, dvbci_tree
);
5179 else if (event
==DVBCI_EVT_HW_EVT
) {
5180 hw_event
= tvb_get_uint8(tvb
, offset
);
5181 col_set_str(pinfo
->cinfo
, COL_INFO
,
5182 val_to_str_const(hw_event
, dvbci_hw_event
, "Invalid hardware event"));
5183 proto_tree_add_item(dvbci_tree
, hf_dvbci_hw_event
,
5184 tvb
, offset
, 1, ENC_BIG_ENDIAN
);
5191 dvbci_shutdown(void)
5194 g_hash_table_destroy(spdu_table
);
5196 g_hash_table_destroy(apdu_table
);
5200 proto_register_dvbci(void)
5203 module_t
*dvbci_module
;
5204 expert_module_t
* expert_dvbci
;
5206 static int *ett
[] = {
5211 &ett_dvbci_cis_subtpl
,
5213 &ett_dvbci_link_frag
,
5214 &ett_dvbci_link_frags
,
5215 &ett_dvbci_transport
,
5216 &ett_dvbci_transport_frag
,
5217 &ett_dvbci_transport_frags
,
5220 &ett_dvbci_application
,
5225 &ett_dvbci_sac_msg_body
,
5226 &ett_dvbci_ami_req_types
,
5227 &ett_dvbci_lsc_conn_desc
,
5228 &ett_dvbci_opp_cap_loop
,
5229 &ett_dvbci_dlv_sys_hint
5232 static hf_register_info hf
[] = {
5233 { &hf_dvbci_hdr_ver
,
5234 { "Version", "dvb-ci.hdr_version",
5235 FT_UINT8
, BASE_DEC
, NULL
, 0, NULL
, HFILL
}
5238 { "Event", "dvb-ci.event",
5239 FT_UINT8
, BASE_HEX
, VALS(dvbci_event
), 0, NULL
, HFILL
}
5242 { "Length field", "dvb-ci.length_field",
5243 FT_UINT16
, BASE_DEC
, NULL
, 0, NULL
, HFILL
}
5245 { &hf_dvbci_hw_event
,
5246 { "Hardware event", "dvb-ci.hw_event",
5247 FT_UINT8
, BASE_HEX
, VALS(dvbci_hw_event
), 0, NULL
, HFILL
}
5249 { &hf_dvbci_cor_addr
,
5250 { "COR address", "dvb-ci.cor_address",
5251 FT_UINT16
, BASE_HEX
, NULL
, 0, NULL
, HFILL
}
5253 { &hf_dvbci_cor_val
,
5254 { "COR value", "dvb-ci.cor_value",
5255 FT_UINT8
, BASE_HEX
, NULL
, 0, NULL
, HFILL
}
5257 { &hf_dvbci_cis_tpl_code
,
5258 { "CIS tuple code", "dvb-ci.cis.tpl_code",
5259 FT_UINT8
, BASE_HEX
, VALS(dvbci_cis_tpl_code
), 0, NULL
, HFILL
}
5261 { &hf_dvbci_cis_tpl_len
,
5262 { "Length field", "dvb-ci.cis.tpl_len",
5263 FT_UINT8
, BASE_DEC
, NULL
, 0, NULL
, HFILL
}
5265 { &hf_dvbci_cis_tpl_data
,
5266 { "Tuple data", "dvb-ci.cis.tpl_data",
5267 FT_BYTES
, BASE_NONE
, NULL
, 0, NULL
, HFILL
}
5269 { &hf_dvbci_cis_tpll_v1_major
,
5270 { "Major version number", "dvb-ci.cis.tpll_v1_major",
5271 FT_UINT8
, BASE_HEX
, NULL
, 0, NULL
, HFILL
}
5273 { &hf_dvbci_cis_tpll_v1_minor
,
5274 { "Minor version number", "dvb-ci.cis.tpll_v1_minor",
5275 FT_UINT8
, BASE_HEX
, NULL
, 0, NULL
, HFILL
}
5277 { &hf_dvbci_cis_tpll_v1_info_manuf
,
5278 { "Manufacturer", "dvb-ci.cis.tpll_v1_info.manufacturer",
5279 FT_STRING
, BASE_NONE
, NULL
, 0, NULL
, HFILL
}
5281 { &hf_dvbci_cis_tpll_v1_info_name
,
5282 { "Name", "dvb-ci.cis.tpll_v1_info.name",
5283 FT_STRING
, BASE_NONE
, NULL
, 0, NULL
, HFILL
}
5285 { &hf_dvbci_cis_tpll_v1_info_additional
,
5286 { "Additional info", "dvb-ci.cis.tpll_v1_info.additional",
5287 FT_STRING
, BASE_NONE
, NULL
, 0, NULL
, HFILL
}
5289 { &hf_dvbci_cis_tpll_v1_end
,
5290 { "End of chain", "dvb-ci.cis.tpll_v1_end",
5291 FT_UINT8
, BASE_HEX
, NULL
, 0, NULL
, HFILL
}
5293 { &hf_dvbci_cis_tpcc_rfsz
,
5294 { "Size of reserved area", "dvb-ci.cis.tpcc_rfsz",
5295 FT_UINT8
, BASE_HEX
, NULL
, 0xC0, NULL
, HFILL
}
5297 { &hf_dvbci_cis_tpcc_rmsz
,
5298 { "Size of TPCC_RMSK field - 1", "dvb-ci.cis.tpcc_rmsz",
5299 FT_UINT8
, BASE_HEX
, NULL
, 0x3C, NULL
, HFILL
}
5301 { &hf_dvbci_cis_tpcc_rasz
,
5302 { "Size of TPCC_RADR - 1", "dvb-ci.cis.tpcc_rasz",
5303 FT_UINT8
, BASE_HEX
, NULL
, 0x03, NULL
, HFILL
}
5305 { &hf_dvbci_cis_tpcc_last
,
5306 { "Index of the last cftable entry", "dvb-ci.cis.tpcc_last",
5307 FT_UINT8
, BASE_HEX
, NULL
, 0x3F, NULL
, HFILL
}
5309 { &hf_dvbci_cis_tpcc_radr
,
5310 { "COR base address", "dvb-ci.cis.tpcc_radr",
5311 FT_UINT32
, BASE_HEX
, NULL
, 0, NULL
, HFILL
}
5313 { &hf_dvbci_cis_tpcc_rmsk
,
5314 { "Configuration register presence mask", "dvb-ci.cis.tpcc_rmsk",
5315 FT_BYTES
, BASE_NONE
, NULL
, 0, NULL
, HFILL
}
5317 { &hf_dvbci_cis_st_code
,
5318 { "Subtuple tag", "dvb-ci.cis.st_code",
5319 FT_UINT8
, BASE_HEX
, VALS(dvbci_cis_subtpl_code
), 0, NULL
, HFILL
}
5321 { &hf_dvbci_cis_st_len
,
5322 { "Subtuple length", "dvb-ci.cis.st_len",
5323 FT_UINT8
, BASE_HEX
, NULL
, 0, NULL
, HFILL
}
5325 { &hf_dvbci_cis_stci_ifn_size
,
5326 { "Size of interface ID number - 1", "dvb-ci.cis.stci_ifn_size",
5327 FT_UINT8
, BASE_HEX
, NULL
, 0xC0, NULL
, HFILL
}
5329 { &hf_dvbci_cis_stci_ifn
,
5330 { "Interface ID number", "dvb-ci.cis.stci_ifn",
5331 FT_UINT32
, BASE_HEX
, NULL
, 0, NULL
, HFILL
}
5333 { &hf_dvbci_cis_stci_str
,
5334 { "Interface description strings", "dvb-ci.cis.stci_str",
5335 FT_STRING
, BASE_NONE
, NULL
, 0, NULL
, HFILL
}
5337 { &hf_dvbci_cis_tpce_indx_intface
,
5338 { "Intface", "dvb-ci.cis.tpce_indx.intface",
5339 FT_UINT8
, BASE_HEX
, NULL
, 0x80, NULL
, HFILL
}
5341 { &hf_dvbci_cis_tpce_indx_default
,
5342 { "Default", "dvb-ci.cis.tpce_indx.default",
5343 FT_UINT8
, BASE_HEX
, NULL
, 0x40, NULL
, HFILL
}
5345 { &hf_dvbci_cis_tpce_indx_cnf_entry
,
5346 { "Configuration entry number", "dvb-ci.cis.tpce_indx.cnf_entry",
5347 FT_UINT8
, BASE_HEX
, NULL
, 0x3F, NULL
, HFILL
}
5349 { &hf_dvbci_cis_tpce_if_type
,
5350 { "Interface type", "dvb-ci.cis.tpce_if.type", FT_UINT8
, BASE_HEX
,
5351 VALS(dvbci_cis_tpce_if_type
), 0x0F, NULL
, HFILL
}
5353 { &hf_dvbci_cis_tpce_fs_mem_space
,
5354 { "Mem space", "dvb-ci.cis.tpce_fs.mem_space",
5355 FT_UINT8
, BASE_HEX
, NULL
, 0x60, NULL
, HFILL
}
5357 { &hf_dvbci_cis_tpce_fs_irq
,
5358 { "IRQ", "dvb-ci.cis.tpce_fs.irq",
5359 FT_UINT8
, BASE_HEX
, NULL
, 0x10, NULL
, HFILL
}
5361 { &hf_dvbci_cis_tpce_fs_io
,
5362 { "IO Space", "dvb-ci.cis.tpce_fs.io",
5363 FT_UINT8
, BASE_HEX
, NULL
, 0x08, NULL
, HFILL
}
5365 { &hf_dvbci_cis_dev_vcc_used
,
5366 { "Vcc used", "dvb-ci.cis.device.vcc_used",
5367 FT_UINT8
, BASE_HEX
, VALS(dvbci_cis_dev_vcc_used
), 0x06, NULL
, HFILL
}
5369 { &hf_dvbci_cis_dev_mwait
,
5370 { "MWait", "dvb-ci.cis.device.mwait",
5371 FT_UINT8
, BASE_HEX
, NULL
, 0x01, NULL
, HFILL
}
5373 { &hf_dvbci_cis_dev_oth_cond_info
,
5374 { "Other conditions info", "dvb-ci.cis.device.other_cond",
5375 FT_UINT8
, BASE_HEX
, NULL
, 0, NULL
, HFILL
}
5377 { &hf_dvbci_cis_tplmid_manf
,
5378 { "PC Card manufacturer code", "dvb-ci.cis.tplmid_manf",
5379 FT_UINT16
, BASE_HEX
, NULL
, 0, NULL
, HFILL
}
5381 { &hf_dvbci_cis_tplmid_card
,
5382 { "Manufacturer info", "dvb-ci.cis.tplmid_card",
5383 FT_UINT16
, BASE_HEX
, NULL
, 0, NULL
, HFILL
}
5385 { &hf_dvbci_buf_size
,
5386 { "Buffer Size", "dvb-ci.buf_size",
5387 FT_UINT16
, BASE_HEX
, NULL
, 0, NULL
, HFILL
}
5390 { "Transport Connection ID", "dvb-ci.tcid",
5391 FT_UINT8
, BASE_HEX
, NULL
, 0, NULL
, HFILL
}
5394 { "More/Last indicator", "dvb-ci.more_last",
5395 FT_UINT8
, BASE_HEX
, VALS(dvbci_ml
), 0, NULL
, HFILL
}
5397 /* on the link layer, tpdus are reassembled */
5398 { &hf_dvbci_l_frags
,
5399 { "Tpdu fragments", "dvb-ci.tpdu_fragments",
5400 FT_NONE
, BASE_NONE
, NULL
, 0x00, NULL
, HFILL
}
5403 { "Tpdu fragment", "dvb-ci.tpdu_fragment",
5404 FT_FRAMENUM
, BASE_NONE
, NULL
, 0x00, NULL
, HFILL
}
5406 { &hf_dvbci_l_frag_overlap
,
5407 { "Tpdu fragment overlap", "dvb-ci.tpdu_fragment.overlap",
5408 FT_BOOLEAN
, BASE_NONE
, NULL
, 0x00, NULL
, HFILL
}
5410 { &hf_dvbci_l_frag_overlap_conflicts
,
5411 { "Tpdu fragment overlapping with conflicting data",
5412 "dvb-ci.tpdu_fragment.overlap.conflicts",
5413 FT_BOOLEAN
, BASE_NONE
, NULL
, 0x00, NULL
, HFILL
}
5415 { &hf_dvbci_l_frag_multiple_tails
,
5416 { "Tpdu has multiple tail fragments",
5417 "dvb-ci.tpdu_fragment.multiple_tails",
5418 FT_BOOLEAN
, BASE_NONE
, NULL
, 0x00, NULL
, HFILL
}
5420 { &hf_dvbci_l_frag_too_long_frag
,
5421 { "Tpdu fragment too long", "dvb-ci.tpdu_fragment.too_long_fragment",
5422 FT_BOOLEAN
, BASE_NONE
, NULL
, 0x00, NULL
, HFILL
}
5424 { &hf_dvbci_l_frag_err
,
5425 { "Tpdu defragmentation error", "dvb-ci.tpdu_fragment.error",
5426 FT_FRAMENUM
, BASE_NONE
, NULL
, 0x00, NULL
, HFILL
}
5428 { &hf_dvbci_l_frag_cnt
,
5429 { "Tpdu fragment count", "dvb-ci.tpdu_fragment.count",
5430 FT_UINT32
, BASE_DEC
, NULL
, 0x00, NULL
, HFILL
}
5432 { &hf_dvbci_l_reass_in
,
5433 { "Tpdu reassembled in", "dvb-ci.tpdu_reassembled.in",
5434 FT_FRAMENUM
, BASE_NONE
, NULL
, 0x00, NULL
, HFILL
}
5436 { &hf_dvbci_l_reass_len
,
5437 { "Reassembled tpdu length", "dvb-ci.tpdu_reassembled.length",
5438 FT_UINT32
, BASE_DEC
, NULL
, 0x00, NULL
, HFILL
}
5440 { &hf_dvbci_c_tpdu_tag
,
5441 { "Command TPDU Tag", "dvb-ci.c_tpdu_tag",
5442 FT_UINT8
, BASE_HEX
, VALS(dvbci_c_tpdu
), 0, NULL
, HFILL
}
5444 { &hf_dvbci_r_tpdu_tag
,
5445 { "Response TPDU Tag", "dvb-ci.r_tpdu_tag",
5446 FT_UINT8
, BASE_HEX
, VALS(dvbci_r_tpdu
), 0, NULL
, HFILL
}
5449 { "Transport Connection ID", "dvb-ci.t_c_id",
5450 FT_UINT8
, BASE_HEX
, NULL
, 0, NULL
, HFILL
}
5453 { "SB tag", "dvb-ci.sb_tag",
5454 FT_UINT8
, BASE_HEX
, NULL
, 0, NULL
, HFILL
}
5456 { &hf_dvbci_sb_value
,
5457 { "SB Value", "dvb-ci.sb_value", FT_UINT8
, BASE_HEX
,
5458 VALS(dvbci_sb_value
), 0, NULL
, HFILL
} },
5460 /* on the transport layer, spdus are reassembled */
5461 { &hf_dvbci_t_frags
,
5462 { "Spdu fragments", "dvb-ci.spdu_fragments",
5463 FT_NONE
, BASE_NONE
, NULL
, 0x00, NULL
, HFILL
}
5466 { "Spdu fragment", "dvb-ci.spdu_fragment",
5467 FT_FRAMENUM
, BASE_NONE
, NULL
, 0x00, NULL
, HFILL
}
5469 { &hf_dvbci_t_frag_overlap
,
5470 { "Spdu fragment overlap", "dvb-ci.spdu_fragment.overlap",
5471 FT_BOOLEAN
, BASE_NONE
, NULL
, 0x00, NULL
, HFILL
}
5473 { &hf_dvbci_t_frag_overlap_conflicts
,
5474 { "Spdu fragment overlapping with conflicting data",
5475 "dvb-ci.tpdu_fragment.overlap.conflicts",
5476 FT_BOOLEAN
, BASE_NONE
, NULL
, 0x00, NULL
, HFILL
}
5478 { &hf_dvbci_t_frag_multiple_tails
,
5479 { "Spdu has multiple tail fragments",
5480 "dvb-ci.spdu_fragment.multiple_tails",
5481 FT_BOOLEAN
, BASE_NONE
, NULL
, 0x00, NULL
, HFILL
}
5483 { &hf_dvbci_t_frag_too_long_frag
,
5484 { "Spdu fragment too long", "dvb-ci.spdu_fragment.too_long_fragment",
5485 FT_BOOLEAN
, BASE_NONE
, NULL
, 0x00, NULL
, HFILL
}
5487 { &hf_dvbci_t_frag_err
,
5488 { "Spdu defragmentation error", "dvb-ci.spdu_fragment.error",
5489 FT_FRAMENUM
, BASE_NONE
, NULL
, 0x00, NULL
, HFILL
}
5491 { &hf_dvbci_t_frag_cnt
,
5492 { "Spdu fragment count", "dvb-ci.spdu_fragment.count",
5493 FT_UINT32
, BASE_DEC
, NULL
, 0x00, NULL
, HFILL
}
5495 { &hf_dvbci_t_reass_in
,
5496 { "Spdu reassembled in", "dvb-ci.spdu_reassembled.in",
5497 FT_FRAMENUM
, BASE_NONE
, NULL
, 0x00, NULL
, HFILL
}
5499 { &hf_dvbci_t_reass_len
,
5500 { "Reassembled spdu length", "dvb-ci.spdu_reassembled.length",
5501 FT_UINT32
, BASE_DEC
, NULL
, 0x00, NULL
, HFILL
}
5503 { &hf_dvbci_spdu_tag
,
5504 { "SPDU Tag", "dvb-ci.spdu_tag",
5505 FT_UINT8
, BASE_HEX
, VALS(dvbci_spdu_tag
), 0, NULL
, HFILL
}
5507 { &hf_dvbci_sess_status
,
5508 { "Session Status", "dvb-ci.session_status",
5509 FT_UINT8
, BASE_HEX
, VALS(dvbci_sess_status
), 0, NULL
, HFILL
}
5511 { &hf_dvbci_sess_nb
,
5512 { "Session Number", "dvb-ci.session_nb",
5513 FT_UINT16
, BASE_DEC
, NULL
, 0, NULL
, HFILL
}
5515 { &hf_dvbci_close_sess_status
,
5516 { "Session Status", "dvb-ci.close_session_status",
5517 FT_UINT8
, BASE_HEX
, VALS(dvbci_close_sess_status
), 0, NULL
, HFILL
}
5520 { "Resource ID", "dvb-ci.res.id",
5521 FT_UINT32
, BASE_HEX
, NULL
, 0, NULL
, HFILL
}
5523 { &hf_dvbci_res_id_type
,
5524 { "Resource ID Type", "dvb-ci.res.id_type",
5525 FT_UINT32
, BASE_HEX
, NULL
, RES_ID_TYPE_MASK
, NULL
, HFILL
}
5527 { &hf_dvbci_res_class
,
5528 { "Resource Class", "dvb-ci.res.class",
5529 FT_UINT32
, BASE_HEX
, VALS(dvbci_res_class
), RES_CLASS_MASK
, NULL
, HFILL
}
5531 { &hf_dvbci_res_type
,
5532 { "Resource Type", "dvb-ci.res.type",
5533 FT_UINT32
, BASE_HEX
, NULL
, RES_TYPE_MASK
, NULL
, HFILL
}
5535 { &hf_dvbci_res_ver
,
5536 { "Resource Version", "dvb-ci.res.version",
5537 FT_UINT32
, BASE_HEX
, NULL
, RES_VER_MASK
, NULL
, HFILL
}
5539 { &hf_dvbci_apdu_tag
,
5540 { "APDU Tag", "dvb-ci.apdu_tag",
5541 FT_UINT24
, BASE_HEX
, VALS(dvbci_apdu_tag
), 0, NULL
, HFILL
}
5543 { &hf_dvbci_app_type
,
5544 { "Application type", "dvb-ci.ap.type",
5545 FT_UINT8
, BASE_HEX
, VALS(dvbci_app_type
), 0, NULL
, HFILL
}
5547 { &hf_dvbci_app_manf
,
5548 { "Application manufacturer", "dvb-ci.ap.manufacturer",
5549 FT_UINT16
, BASE_HEX
, NULL
, 0, NULL
, HFILL
}
5551 { &hf_dvbci_manf_code
,
5552 { "Manufacturer code", "dvb-ci.ap.manufacturer_code",
5553 FT_UINT16
, BASE_HEX
, NULL
, 0, NULL
, HFILL
}
5555 { &hf_dvbci_menu_str_len
,
5556 { "Menu string length", "dvb-ci.ap.menu_string_length",
5557 FT_UINT8
, BASE_DEC
, NULL
, 0, NULL
, HFILL
}
5559 { &hf_dvbci_ap_char_tbl
,
5560 { "Character table", "dvb-ci.ap.menu_char_tbl",
5561 FT_BYTES
, BASE_NONE
, NULL
, 0, NULL
, HFILL
}
5563 { &hf_dvbci_menu_str
,
5564 { "Menu string", "dvb-ci.ap.menu_string",
5565 FT_STRING
, BASE_NONE
, NULL
, 0, NULL
, HFILL
}
5567 { &hf_dvbci_data_rate
,
5568 { "Transport stream data rate supported by the host",
5569 "dvb-ci.ap.data_rate",
5570 FT_UINT8
, BASE_HEX
, VALS(dvbci_data_rate
), 0, NULL
, HFILL
}
5572 { &hf_dvbci_ca_sys_id
,
5573 { "CA system ID", "dvb-ci.ca.ca_system_id",
5574 FT_UINT16
, BASE_HEX
, NULL
, 0, NULL
, HFILL
}
5576 { &hf_dvbci_ca_pmt_list_mgmt
,
5577 { "CA PMT list management", "dvb-ci.ca.ca_pmt_list_management",
5578 FT_UINT8
, BASE_HEX
, VALS(dvbci_ca_pmt_list_mgmt
), 0, NULL
,
5581 { &hf_dvbci_prog_num
,
5582 { "Program number", "dvb-ci.ca.program_number",
5583 FT_UINT16
, BASE_HEX
, NULL
, 0, NULL
, HFILL
}
5586 { "Version number", "dvb-ci.ca.version_number",
5587 FT_UINT8
, BASE_HEX
, NULL
, 0x3E, NULL
, HFILL
}
5589 { &hf_dvbci_curr_next
,
5590 { "Current-next indicator", "dvb-ci.ca.current_next_indicator",
5591 FT_UINT8
, BASE_HEX
, NULL
, 0x01, NULL
, HFILL
}
5593 { &hf_dvbci_prog_info_len
,
5594 { "Program info length", "dvb-ci.ca.program_info_length",
5595 FT_UINT16
, BASE_HEX
, NULL
, 0x0FFF, NULL
, HFILL
}
5597 { &hf_dvbci_stream_type
,
5598 { "Stream type", "dvb-ci.ca.stream_type", FT_UINT8
,
5599 BASE_HEX
|BASE_EXT_STRING
, &mpeg_pmt_stream_type_vals_ext
,
5603 { "Elementary stream PID", "dvb-ci.ca.elementary_pid",
5604 FT_UINT16
, BASE_HEX
, NULL
, 0x1FFF, NULL
, HFILL
}
5606 { &hf_dvbci_es_info_len
,
5607 { "Elementary stream info length", "dvb-ci.ca.es_info_length",
5608 FT_UINT16
, BASE_HEX
, NULL
, 0x0FFF, NULL
, HFILL
}
5610 { &hf_dvbci_ca_pmt_cmd_id
,
5611 { "CA PMT command ID", "dvb-ci.ca.ca_pmt_cmd_id",
5612 FT_UINT8
, BASE_HEX
, VALS(dvbci_ca_pmt_cmd_id
), 0, NULL
, HFILL
}
5614 { &hf_dvbci_descr_len
,
5615 { "CA descriptor length", "dvb-ci.ca.ca_desc_len",
5616 FT_UINT8
, BASE_DEC
, NULL
, 0, NULL
, HFILL
}
5619 { "CA PID", "dvb-ci.ca.ca_pid",
5620 FT_UINT16
, BASE_HEX
, NULL
, 0x1FFF, NULL
, HFILL
}
5622 { &hf_dvbci_ca_priv_data
,
5623 { "Private data", "dvb-ci.ca.private_data",
5624 FT_BYTES
, BASE_NONE
, NULL
, 0, NULL
, HFILL
}
5626 { &hf_dvbci_ca_enable_flag
,
5627 { "CA enable flag", "dvb-ci.ca.ca_enable_flag",
5628 FT_UINT8
, BASE_HEX
, NULL
, 0x80, NULL
, HFILL
}
5630 { &hf_dvbci_ca_enable
,
5631 { "CA enable", "dvb-ci.ca.ca_enable",
5632 FT_UINT8
, BASE_HEX
, VALS(dvbci_ca_enable
), 0x7F, NULL
, HFILL
}
5634 { &hf_dvbci_auth_proto_id
,
5635 { "Authentication protocol ID", "dvb-ci.aut.proto_id",
5636 FT_UINT16
, BASE_HEX
, NULL
, 0, NULL
, HFILL
}
5638 { &hf_dvbci_auth_req_bytes
,
5639 { "Authentication request data", "dvb-ci.aut.req",
5640 FT_BYTES
, BASE_NONE
, NULL
, 0, NULL
, HFILL
}
5642 { &hf_dvbci_auth_resp_bytes
,
5643 { "Authentication response data", "dvb-ci.aut.resp",
5644 FT_BYTES
, BASE_NONE
, NULL
, 0, NULL
, HFILL
}
5646 { &hf_dvbci_network_id
,
5647 { "Network ID", "dvb-ci.hc.nid",
5648 FT_UINT16
, BASE_HEX
, NULL
, 0, NULL
, HFILL
}
5650 { &hf_dvbci_original_network_id
,
5651 { "Original network ID", "dvb-ci.hc.onid",
5652 FT_UINT16
, BASE_HEX
, NULL
, 0, NULL
, HFILL
}
5654 { &hf_dvbci_transport_stream_id
,
5655 { "Transport stream ID", "dvb-ci.hc.tsid",
5656 FT_UINT16
, BASE_HEX
, NULL
, 0, NULL
, HFILL
}
5658 { &hf_dvbci_service_id
,
5659 { "Service ID", "dvb-ci.hc.svcid",
5660 FT_UINT16
, BASE_HEX
, NULL
, 0, NULL
, HFILL
}
5662 { &hf_dvbci_replacement_ref
,
5663 { "Replacement reference", "dvb-ci.hc.replacement_ref",
5664 FT_UINT8
, BASE_HEX
, NULL
, 0, NULL
, HFILL
}
5666 { &hf_dvbci_replaced_pid
,
5667 { "Replaced PID", "dvb-ci.hc.replaced_pid",
5668 FT_UINT16
, BASE_HEX
, NULL
, 0x1FFF, NULL
, HFILL
}
5670 { &hf_dvbci_replacement_pid
,
5671 { "Replacement PID", "dvb-ci.hc.replacement_pid",
5672 FT_UINT16
, BASE_HEX
, NULL
, 0x1FFF, NULL
, HFILL
}
5674 { &hf_dvbci_pmt_flag
,
5675 { "PMT flag", "dvb-ci.hc.pmt_flag",
5676 FT_UINT8
, BASE_HEX
, NULL
, 0x01, NULL
, HFILL
}
5678 { &hf_dvbci_hc_desc_loop_len
,
5679 { "Descriptor loop length", "dvb-ci.hc.desc_loop_len",
5680 FT_UINT16
, BASE_DEC
, NULL
, 0x0FFF, NULL
, HFILL
}
5682 { &hf_dvbci_hc_status
,
5683 { "Status field", "dvb-ci.hc.status_field",
5684 FT_UINT8
, BASE_HEX
, VALS(dvbci_hc_status
), 0, NULL
, HFILL
}
5686 { &hf_dvbci_hc_release_reply
,
5687 { "Release reply", "dvb-ci.hc.release_reply",
5688 FT_UINT8
, BASE_HEX
, VALS(dvbci_hc_release_reply
), 0, NULL
, HFILL
}
5690 { &hf_dvbci_resp_intv
,
5691 { "Response interval", "dvb-ci.dt.resp_interval",
5692 FT_RELATIVE_TIME
, BASE_NONE
, NULL
, 0, NULL
, HFILL
}
5694 { &hf_dvbci_utc_time
,
5695 { "UTC time", "dvb-ci.dt.utc_time",
5696 FT_ABSOLUTE_TIME
, ABSOLUTE_TIME_UTC
, NULL
, 0, NULL
, HFILL
}
5699 /* we have to use FT_INT16 instead of FT_RELATIVE_TIME,
5700 local offset can be negative */
5701 { &hf_dvbci_local_offset
,
5702 { "Local time offset", "dvb-ci.dt.local_offset",
5703 FT_INT16
, BASE_DEC
, NULL
, 0, NULL
, HFILL
}
5705 { &hf_dvbci_close_mmi_cmd_id
,
5706 { "Command ID", "dvb-ci.mmi.close_mmi_cmd_id",
5707 FT_UINT8
, BASE_HEX
, VALS(dvbci_close_mmi_cmd_id
), 0, NULL
, HFILL
}
5709 { &hf_dvbci_close_mmi_delay
,
5710 { "Delay (in sec)", "dvb-ci.mmi.delay",
5711 FT_UINT8
, BASE_DEC
, NULL
, 0, NULL
, HFILL
}
5713 { &hf_dvbci_disp_ctl_cmd
,
5714 { "Command", "dvb-ci.mmi.disp_ctl_cmd",
5715 FT_UINT8
, BASE_HEX
, VALS(dvbci_disp_ctl_cmd
), 0, NULL
, HFILL
}
5717 { &hf_dvbci_mmi_mode
,
5718 { "MMI mode", "dvb-ci.mmi.mode",
5719 FT_UINT8
, BASE_HEX
, VALS(dvbci_mmi_mode
), 0, NULL
, HFILL
}
5721 { &hf_dvbci_disp_rep_id
,
5722 { "Reply ID", "dvb-ci.mmi.disp_rep_id",
5723 FT_UINT8
, BASE_HEX
, VALS(dvbci_disp_rep_id
), 0, NULL
, HFILL
}
5725 { &hf_dvbci_mmi_char_tbl
,
5726 { "Character table", "dvb-ci.mmi.char_tbl",
5727 FT_BYTES
, BASE_NONE
, NULL
, 0, NULL
, HFILL
}
5729 { &hf_dvbci_blind_ans
,
5730 { "Blind answer flag", "dvb-ci.mmi.blind_ans",
5731 FT_UINT8
, BASE_HEX
, VALS(dvbci_blind_ans
), 0x01, NULL
, HFILL
}
5733 { &hf_dvbci_ans_txt_len
,
5734 { "Answer text length", "dvb-ci.mmi.ans_txt_len",
5735 FT_UINT8
, BASE_DEC
, NULL
, 0, NULL
, HFILL
}
5738 { "Enquiry string", "dvb-ci.mmi.enq",
5739 FT_STRING
, BASE_NONE
, NULL
, 0, NULL
, HFILL
}
5742 { "Answer ID", "dvb-ci.mmi.ans_id",
5743 FT_UINT8
, BASE_HEX
, VALS(dvbci_ans_id
) , 0, NULL
, HFILL
}
5746 { "Answer", "dvb-ci.mmi.ans",
5747 FT_STRING
, BASE_NONE
, NULL
, 0, NULL
, HFILL
}
5749 { &hf_dvbci_choice_nb
,
5750 { "Number of menu items", "dvb-ci.mmi.choice_nb",
5751 FT_UINT8
, BASE_DEC
, NULL
, 0, NULL
, HFILL
}
5753 { &hf_dvbci_choice_ref
,
5754 { "Selected item", "dvb-ci.mmi.choice_ref",
5755 FT_UINT8
, BASE_DEC
, NULL
, 0, NULL
, HFILL
}
5757 { &hf_dvbci_item_nb
,
5758 { "Number of list items", "dvb-ci.mmi.item_nb",
5759 FT_UINT8
, BASE_DEC
, NULL
, 0, NULL
, HFILL
}
5762 { "Title", "dvb-ci.mmi.title",
5763 FT_STRING
, BASE_NONE
, NULL
, 0, NULL
, HFILL
}
5765 { &hf_dvbci_subtitle
,
5766 { "Sub-title", "dvb-ci.mmi.subtitle",
5767 FT_STRING
, BASE_NONE
, NULL
, 0, NULL
, HFILL
}
5770 { "Bottom line", "dvb-ci.mmi.bottom",
5771 FT_STRING
, BASE_NONE
, NULL
, 0, NULL
, HFILL
}
5774 { "Item", "dvb-ci.mmi.item",
5775 FT_STRING
, BASE_NONE
, NULL
, 0, NULL
, HFILL
}
5777 { &hf_dvbci_host_country
,
5778 { "Host country", "dvb-ci.hlc.country",
5779 FT_STRING
, BASE_NONE
, NULL
, 0, NULL
, HFILL
}
5781 { &hf_dvbci_host_language
,
5782 { "Host language", "dvb-ci.hlc.language",
5783 FT_STRING
, BASE_NONE
, NULL
, 0, NULL
, HFILL
}
5785 { &hf_dvbci_cup_type
,
5786 { "CAM upgrade type", "dvb-ci.cup.type",
5787 FT_UINT8
, BASE_HEX
, VALS(dvbci_cup_type
), 0, NULL
, HFILL
}
5789 { &hf_dvbci_cup_download_time
,
5790 { "Download time", "dvb-ci.cup.download_time",
5791 FT_UINT16
, BASE_HEX
, NULL
, 0, NULL
, HFILL
}
5793 { &hf_dvbci_cup_answer
,
5794 { "CAM upgrade answer", "dvb-ci.cup.answer",
5795 FT_UINT8
, BASE_HEX
, VALS(dvbci_cup_answer
), 0, NULL
, HFILL
}
5797 { &hf_dvbci_cup_progress
,
5798 { "CAM upgrade progress", "dvb-ci.cup.progress",
5799 FT_UINT8
, BASE_HEX
, NULL
, 0, NULL
, HFILL
}
5801 { &hf_dvbci_cup_reset
,
5802 { "requested CAM reset", "dvb-ci.cup.reset",
5803 FT_UINT8
, BASE_HEX
, VALS(dvbci_cup_reset
), 0, NULL
, HFILL
}
5805 { &hf_dvbci_cc_sys_id_bitmask
,
5806 { "CC system id bitmask", "dvb-ci.cc.sys_id_bitmask",
5807 FT_UINT8
, BASE_HEX
, NULL
, 0, NULL
, HFILL
}
5809 { &hf_dvbci_cc_snd_dat_nbr
,
5810 { "Number of sent data items", "dvb-ci.cc.snd_dat_nbr",
5811 FT_UINT8
, BASE_DEC
, NULL
, 0, NULL
, HFILL
}
5813 { &hf_dvbci_cc_req_dat_nbr
,
5814 { "Number of requested data items", "dvb-ci.cc.req_dat_nbr",
5815 FT_UINT8
, BASE_DEC
, NULL
, 0, NULL
, HFILL
}
5817 { &hf_dvbci_cc_dat_id
,
5818 { "CC datatype id", "dvb-ci.cc.datatype_id",
5819 FT_UINT8
, BASE_HEX
, VALS(dvbci_cc_dat_id
), 0, NULL
, HFILL
}
5821 { &hf_dvbci_cc_dat_len
,
5822 { "Length", "dvb-ci.cc.datatype_length",
5823 FT_UINT16
, BASE_DEC
, NULL
, 0, NULL
, HFILL
}
5825 { &hf_dvbci_brand_cert
,
5826 { "Brand certificate", "dvb-ci.cc.brand_cert",
5827 FT_NONE
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}
5829 { &hf_dvbci_dev_cert
,
5830 { "Device certificate", "dvb-ci.cc.dev_cert",
5831 FT_NONE
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}
5833 { &hf_dvbci_uri_ver
,
5834 { "URI version", "dvb-ci.cc.uri.version",
5835 FT_UINT8
, BASE_HEX
, NULL
, 0, NULL
, HFILL
}
5837 { &hf_dvbci_uri_aps
,
5838 { "APS", "dvb-ci.cc.uri.aps",
5839 FT_UINT8
, BASE_HEX
, NULL
, 0xC0, NULL
, HFILL
}
5841 { &hf_dvbci_uri_emi
,
5842 { "EMI", "dvb-ci.cc.uri.emi",
5843 FT_UINT8
, BASE_HEX
, VALS(dvbci_cc_uri_emi
), 0x30, NULL
, HFILL
}
5845 { &hf_dvbci_uri_ict
,
5846 { "Image constraint token", "dvb-ci.cc.uri.ict",
5847 FT_UINT8
, BASE_HEX
, NULL
, 0x08, NULL
, HFILL
}
5849 { &hf_dvbci_uri_rct
,
5850 { "Redistribution control trigger (RCT)", "dvb-ci.cc.uri.rct",
5851 FT_UINT8
, BASE_HEX
, NULL
, 0x04, NULL
, HFILL
}
5853 { &hf_dvbci_uri_dot
,
5854 { "Digital only token (DOT)", "dvb-ci.cc.uri.dot",
5855 FT_UINT8
, BASE_HEX
, NULL
, 0x01, NULL
, HFILL
}
5857 /* retention limit is 6bit in URIv1 and 8bit in URIv2 and later
5858 the position depends on the version, we can't define a mask here */
5860 { "Retention limit", "dvb-ci.cc.uri.rl",
5861 FT_UINT8
, BASE_HEX
, NULL
, 0, NULL
, HFILL
}
5863 { &hf_dvbci_cc_key_register
,
5864 { "Key register", "dvb-ci.cc.key_register",
5865 FT_UINT8
, BASE_HEX
, VALS(dvbci_cc_key_register
), 0, NULL
, HFILL
}
5867 { &hf_dvbci_cc_status_field
,
5868 { "Status field", "dvb-ci.cc.status_field",
5869 FT_UINT8
, BASE_HEX
, VALS(dvbci_cc_status
), 0, NULL
, HFILL
}
5871 { &hf_dvbci_cc_op_mode
,
5872 { "Operating mode", "dvb-ci.cc.op_mode",
5873 FT_UINT8
, BASE_HEX
, VALS(dvbci_cc_op_mode
), 0, NULL
, HFILL
}
5875 { &hf_dvbci_cc_data
,
5876 { "Data", "dvb-ci.cc.data",
5877 FT_BYTES
, BASE_NONE
, NULL
, 0, NULL
, HFILL
}
5879 { &hf_dvbci_sac_msg_ctr
,
5880 { "Message counter", "dvb-ci.cc.sac.msg_ctr",
5881 FT_UINT32
, BASE_HEX
, NULL
, 0, NULL
, HFILL
}
5883 { &hf_dvbci_sac_proto_ver
,
5884 { "Protocol version", "dvb-ci.cc.sac.proto_ver",
5885 FT_UINT8
, BASE_HEX
, NULL
, 0xF0, NULL
, HFILL
}
5887 { &hf_dvbci_sac_auth_cip
,
5888 { "Authentication cipher", "dvb-ci.cc.sac.auth_cip",
5889 FT_UINT8
, BASE_HEX
, VALS(dvbci_cc_sac_auth
), 0x0E, NULL
, HFILL
}
5891 { &hf_dvbci_sac_payload_enc
,
5892 { "Payload encryption flag", "dvb-ci.cc.sac.payload_enc",
5893 FT_UINT8
, BASE_HEX
, NULL
, 0x01, NULL
, HFILL
}
5895 { &hf_dvbci_sac_enc_cip
,
5896 { "Encryption cipher", "dvb-ci.cc.sac.enc_cip",
5897 FT_UINT8
, BASE_HEX
, VALS(dvbci_cc_sac_enc
), 0xE0, NULL
, HFILL
}
5899 { &hf_dvbci_sac_payload_len
,
5900 { "Payload length", "dvb-ci.cc.sac.payload_len",
5901 FT_UINT16
, BASE_DEC
, NULL
, 0, NULL
, HFILL
}
5903 { &hf_dvbci_sac_enc_body
,
5904 { "Encrypted SAC body", "dvb-ci.cc.sac.enc_body",
5905 FT_BYTES
, BASE_NONE
, NULL
, 0, NULL
, HFILL
}
5907 { &hf_dvbci_sac_padding
,
5908 { "Padding", "dvb-ci.cc.sac.padding",
5909 FT_BYTES
, BASE_NONE
, NULL
, 0, NULL
, HFILL
}
5911 { &hf_dvbci_sac_signature
,
5912 { "Signature", "dvb-ci.cc.sac.signature",
5913 FT_BYTES
, BASE_NONE
, NULL
, 0, NULL
, HFILL
}
5916 { "Rating", "dvb-ci.cc.rating",
5917 FT_UINT8
, BASE_DEC
, NULL
, 0, NULL
, HFILL
}
5919 { &hf_dvbci_capability_field
,
5920 { "Capability field", "dvb-ci.cc.capability_field",
5921 FT_UINT8
, BASE_HEX
, VALS(dvbci_cc_cap
), 0, NULL
, HFILL
}
5923 { &hf_dvbci_pin_chg_time
,
5924 { "PIN change time (UTC)", "dvb-ci.cc.pin_change_time",
5925 FT_ABSOLUTE_TIME
, ABSOLUTE_TIME_UTC
, NULL
, 0, NULL
, HFILL
}
5927 { &hf_dvbci_pincode_status
,
5928 { "Pincode status field", "dvb-ci.cc.pincode_status_field",
5929 FT_UINT8
, BASE_HEX
, VALS(dvbci_pincode_status
), 0, NULL
, HFILL
}
5931 { &hf_dvbci_cc_prog_num
,
5932 { "Program number", "dvb-ci.cc.program_number",
5933 FT_UINT16
, BASE_HEX
, NULL
, 0, NULL
, HFILL
}
5935 { &hf_dvbci_pin_evt_time
,
5936 { "PIN event time (UTC)", "dvb-ci.cc.pin_event_time",
5937 FT_ABSOLUTE_TIME
, ABSOLUTE_TIME_UTC
, NULL
, 0, NULL
, HFILL
}
5939 { &hf_dvbci_pin_evt_cent
,
5940 { "PIN event time centiseconds", "dvb-ci.cc.pin_event_time_centi",
5941 FT_UINT8
, BASE_DEC
, NULL
, 0, NULL
, HFILL
}
5943 { &hf_dvbci_cc_priv_data
,
5944 { "Private data", "dvb-ci.cc.private_data",
5945 FT_BYTES
, BASE_NONE
, NULL
, 0, NULL
, HFILL
}
5947 { &hf_dvbci_pincode
,
5948 { "PIN code", "dvb-ci.cc.pincode",
5949 FT_STRING
, BASE_NONE
, NULL
, 0, NULL
, HFILL
}
5951 { &hf_dvbci_app_dom_id_len
,
5952 { "Application Domain Identifier length", "dvb-ci.ami.app_dom_id_len",
5953 FT_UINT8
, BASE_DEC
, NULL
, 0, NULL
, HFILL
}
5955 { &hf_dvbci_init_obj_len
,
5956 { "Initial Object length", "dvb-ci.ami.init_obj_len",
5957 FT_UINT8
, BASE_DEC
, NULL
, 0, NULL
, HFILL
}
5959 { &hf_dvbci_app_dom_id
,
5960 { "Application Domain Identifier", "dvb-ci.ami.app_dom_id",
5961 FT_STRING
, BASE_NONE
, NULL
, 0, NULL
, HFILL
}
5963 { &hf_dvbci_init_obj
,
5964 { "Initial Object", "dvb-ci.ami.init_obj",
5965 FT_STRING
, BASE_NONE
, NULL
, 0, NULL
, HFILL
}
5967 { &hf_dvbci_ack_code
,
5968 { "Acknowledgement", "dvb-ci.ami.ack_code",
5969 FT_UINT8
, BASE_HEX
, VALS(dvbci_ack_code
), 0, NULL
, HFILL
}
5971 { &hf_dvbci_req_type
,
5972 { "Request type", "dvb-ci.ami.req_type",
5973 FT_UINT8
, BASE_HEX
, VALS(dvbci_req_type
), 0, NULL
, HFILL
}
5975 { &hf_dvbci_file_hash
,
5976 { "File hash", "dvb-ci.ami.file_hash",
5977 FT_BYTES
, BASE_NONE
, NULL
, 0, NULL
, HFILL
}
5979 { &hf_dvbci_file_name_len
,
5980 { "File name length", "dvb-ci.ami.file_name_len",
5981 FT_UINT8
, BASE_DEC
, NULL
, 0, NULL
, HFILL
}
5983 { &hf_dvbci_file_name
,
5984 { "File name", "dvb-ci.ami.file_name",
5985 FT_STRING
, BASE_NONE
, NULL
, 0, NULL
, HFILL
}
5987 { &hf_dvbci_file_data_len
,
5988 { "File data length", "dvb-ci.ami.file_data_len",
5989 FT_UINT32
, BASE_DEC
, NULL
, 0, NULL
, HFILL
}
5991 { &hf_dvbci_ami_priv_data
,
5992 { "Private data", "dvb-ci.ami.private_data",
5993 FT_BYTES
, BASE_NONE
, NULL
, 0, NULL
, HFILL
}
5996 { "RequestOK", "dvb-ci.ami.request_ok",
5997 FT_UINT8
, BASE_HEX
, NULL
, 0x02, NULL
, HFILL
}
5999 { &hf_dvbci_file_ok
,
6000 { "FileOK", "dvb-ci.ami.file_ok",
6001 FT_UINT8
, BASE_HEX
, NULL
, 0x01, NULL
, HFILL
}
6003 { &hf_dvbci_abort_req_code
,
6004 { "Abort request code", "dvb-ci.ami.abort_req_code",
6005 FT_BYTES
, BASE_NONE
, NULL
, 0, NULL
, HFILL
}
6007 { &hf_dvbci_abort_ack_code
,
6008 { "Abort acknowledgement code", "dvb-ci.ami.abort_ack_code",
6009 FT_BYTES
, BASE_NONE
, NULL
, 0, NULL
, HFILL
}
6011 { &hf_dvbci_phase_id
,
6012 { "Phase ID", "dvb-ci.lsc.comms_phase_id",
6013 FT_UINT8
, BASE_DEC
, NULL
, 0, NULL
, HFILL
}
6015 { &hf_dvbci_comms_rep_id
,
6016 { "Comms reply ID", "dvb-ci.lsc.comms_reply_id",
6017 FT_UINT8
, BASE_HEX
, VALS(dvbci_comms_rep_id
), 0, NULL
, HFILL
}
6019 { &hf_dvbci_lsc_buf_size
,
6020 { "Buffer size", "dvb-ci.lsc.buf_size",
6021 FT_UINT16
, BASE_DEC
, NULL
, 0, NULL
, HFILL
}
6023 { &hf_dvbci_lsc_ret_val
,
6024 { "Return value", "dvb-ci.lsc.return_value",
6025 FT_UINT8
, BASE_HEX
, NULL
, 0, NULL
, HFILL
}
6027 { &hf_dvbci_comms_cmd_id
,
6028 { "Comms command ID", "dvb-ci.lsc.comms_cmd_id",
6029 FT_UINT8
, BASE_HEX
, VALS(dvbci_comms_cmd_id
), 0, NULL
, HFILL
}
6031 { &hf_dvbci_conn_desc_type
,
6032 { "Type", "dvb-ci.lsc.conn_desc_type",
6033 FT_UINT8
, BASE_HEX
, VALS(dvbci_conn_desc_type
), 0, NULL
, HFILL
}
6035 { &hf_dvbci_lsc_media_tag
,
6036 { "Tag", "dvb-ci.lsc.media_tag",
6037 FT_UINT8
, BASE_HEX
, VALS(dvbci_lsc_desc_tag
), 0, NULL
, HFILL
}
6039 { &hf_dvbci_lsc_media_len
,
6040 { "Length", "dvb-ci.lsc.media_len",
6041 FT_UINT8
, BASE_DEC
, NULL
, 0, NULL
, HFILL
}
6043 { &hf_dvbci_lsc_media_data
,
6044 { "Media-specific data", "dvb-ci.lsc.media_data",
6045 FT_BYTES
, BASE_NONE
, NULL
, 0, NULL
, HFILL
}
6047 { &hf_dvbci_lsc_ip_ver
,
6048 { "IP version", "dvb-ci.lsc.ip_version",
6049 FT_UINT8
, BASE_DEC
, VALS(dvbci_lsc_ip_ver
), 0, NULL
, HFILL
}
6051 { &hf_dvbci_lsc_ipv4_addr
,
6052 { "IP address", "dvb-ci.lsc.ipv4_addr",
6053 FT_IPv4
, BASE_NONE
, NULL
, 0, NULL
, HFILL
}
6055 { &hf_dvbci_lsc_ipv6_addr
,
6056 { "IPv6 address", "dvb-ci.lsc.ipv6_addr",
6057 FT_IPv6
, BASE_NONE
, NULL
, 0, NULL
, HFILL
}
6059 { &hf_dvbci_lsc_dst_port
,
6060 { "Destination port", "dvb-ci.lsc.dst_port",
6061 FT_UINT16
, BASE_DEC
, NULL
, 0, NULL
, HFILL
}
6063 { &hf_dvbci_lsc_proto
,
6064 { "Protocol", "dvb-ci.lsc.protocol",
6065 FT_UINT8
, BASE_HEX
, VALS(dvbci_lsc_proto
), 0, NULL
, HFILL
}
6067 { &hf_dvbci_lsc_hostname
,
6068 { "Hostname", "dvb-ci.lsc.hostname",
6069 FT_STRING
, BASE_NONE
, NULL
, 0, NULL
, HFILL
}
6071 { &hf_dvbci_lsc_retry_count
,
6072 { "Retry count", "dvb-ci.lsc.retry_count",
6073 FT_UINT8
, BASE_DEC
, NULL
, 0, NULL
, HFILL
}
6075 { &hf_dvbci_lsc_timeout
,
6076 { "Timeout", "dvb-ci.lsc.timeout",
6077 FT_UINT8
, BASE_DEC
, NULL
, 0, NULL
, HFILL
}
6079 { &hf_dvbci_lsc_conn_state
,
6080 { "Connection state", "dvb-ci.lsc.connection_state",
6081 FT_UINT8
, BASE_HEX
, VALS(dvbci_lsc_connect
), 0xC0, NULL
, HFILL
}
6083 { &hf_dvbci_lsc_phys_addr
,
6084 { "Physical address", "dvb-ci.lsc.physical_address",
6085 FT_ETHER
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}
6087 { &hf_dvbci_lsc_netmask
,
6088 { "Network mask", "dvb-ci.lsc.netmask",
6089 FT_IPv6
, BASE_NONE
, NULL
, 0, NULL
, HFILL
}
6091 { &hf_dvbci_lsc_gateway
,
6092 { "Default gateway", "dvb-ci.lsc.gateway",
6093 FT_IPv6
, BASE_NONE
, NULL
, 0, NULL
, HFILL
}
6095 { &hf_dvbci_lsc_dhcp_srv
,
6096 { "DHCP server", "dvb-ci.lsc.dhcp_server",
6097 FT_IPv6
, BASE_NONE
, NULL
, 0, NULL
, HFILL
}
6099 { &hf_dvbci_lsc_num_dns_srv
,
6100 { "Number of DNS servers", "dvb-ci.lsc.num_dns_srv",
6101 FT_UINT8
, BASE_DEC
, NULL
, 0, NULL
, HFILL
}
6103 { &hf_dvbci_lsc_dns_srv
,
6104 { "DNS server", "dvb-ci.lsc.dns_server",
6105 FT_IPv6
, BASE_NONE
, NULL
, 0, NULL
, HFILL
}
6107 { &hf_dvbci_afs_dom_id
,
6108 { "Domain identifier", "dvb-ci.afs.domain_identifier",
6109 FT_UINT_STRING
, BASE_NONE
, NULL
, 0, NULL
, HFILL
}
6111 { &hf_dvbci_afs_ack_code
,
6112 { "Ack code", "dvb-ci.afs.ack_code",
6113 FT_UINT8
, BASE_HEX
, VALS(dvbci_afs_ack_code
), 0, NULL
, HFILL
}
6115 /* filter string for hf_dvbci_info_ver_op_status and
6116 * hf_dvbci_info_ver_op_info below is the same, it seems this is ok */
6117 { &hf_dvbci_info_ver_op_status
,
6118 { "Info version", "dvb-ci.opp.info_ver",
6119 FT_UINT8
, BASE_HEX
, NULL
, 0xE0, NULL
, HFILL
}
6121 { &hf_dvbci_nit_ver
,
6122 { "NIT version", "dvb-ci.opp.nit_ver",
6123 FT_UINT8
, BASE_HEX
, NULL
, 0x1F, NULL
, HFILL
}
6125 { &hf_dvbci_pro_typ
,
6126 { "Profile type", "dvb-ci.opp.profile_type",
6127 FT_UINT8
, BASE_HEX
, NULL
, 0xC0, NULL
, HFILL
}
6129 { &hf_dvbci_init_flag
,
6130 { "Initialized flag", "dvb-ci.opp.init_flag",
6131 FT_UINT8
, BASE_HEX
, NULL
, 0x20, NULL
, HFILL
}
6133 { &hf_dvbci_ent_chg_flag
,
6134 { "Entitlement change flag", "dvb-ci.opp.ent_chg_flag",
6135 FT_UINT8
, BASE_HEX
, NULL
, 0x10, NULL
, HFILL
}
6137 { &hf_dvbci_ent_val_flag
,
6138 { "Entitlement valid flag", "dvb-ci.opp.ent_val_flag",
6139 FT_UINT8
, BASE_HEX
, NULL
, 0x08, NULL
, HFILL
}
6141 { &hf_dvbci_ref_req_flag
,
6142 { "Refresh request flag", "dvb-ci.opp.refresh_req_flag",
6143 FT_UINT8
, BASE_HEX
, VALS(dvbci_opp_ref_req_flag
), 0x03, NULL
, HFILL
}
6145 { &hf_dvbci_err_flag
,
6146 { "Error flag", "dvb-ci.opp.err_flag",
6147 FT_UINT8
, BASE_HEX
, VALS(dvbci_opp_err_flag
), 0xF0, NULL
, HFILL
}
6149 { &hf_dvbci_dlv_sys_hint
,
6150 { "Delivery system hint", "dvb-ci.opp.dlv_sys_hint",
6151 FT_UINT8
, BASE_HEX
, NULL
, 0x0F, NULL
, HFILL
}
6153 { &hf_dvbci_dlv_sys_hint_t
,
6154 { "terrestrial network (DVB-T/T2)", "dvb-ci.opp.dlv_sys_hint.t",
6155 FT_BOOLEAN
, 4, TFS(&tfs_set_notset
), 0x4, NULL
, HFILL
}
6157 { &hf_dvbci_dlv_sys_hint_s
,
6158 { "satellite network (DVB-S/S2)", "dvb-ci.opp.dlv_sys_hint.s",
6159 FT_BOOLEAN
, 4, TFS(&tfs_set_notset
), 0x2, NULL
, HFILL
}
6161 { &hf_dvbci_dlv_sys_hint_c
,
6162 { "cable network (DVB-C/C2)", "dvb-ci.opp.dlv_sys_hint.c",
6163 FT_BOOLEAN
, 4, TFS(&tfs_set_notset
), 0x1, NULL
, HFILL
}
6165 { &hf_dvbci_refr_req_date
,
6166 { "Refresh request date", "dvb-ci.opp.refresh_req_date",
6167 FT_UINT16
, BASE_HEX
, NULL
, 0, NULL
, HFILL
}
6169 { &hf_dvbci_refr_req_time
,
6170 { "Refresh request time", "dvb-ci.opp.refresh_req_time",
6171 FT_UINT8
, BASE_HEX
, NULL
, 0, NULL
, HFILL
}
6173 { &hf_dvbci_nit_loop_len
,
6174 { "NIT loop length", "dvb-ci.opp.nit_loop_len",
6175 FT_UINT16
, BASE_DEC
, NULL
, 0, NULL
, HFILL
}
6177 { &hf_dvbci_info_valid
,
6178 { "Info valid", "dvb-ci.opp.info_valid",
6179 FT_UINT8
, BASE_HEX
, NULL
, 0x08, NULL
, HFILL
}
6181 { &hf_dvbci_info_ver_op_info
,
6182 { "Info version", "dvb-ci.opp.info_ver",
6183 FT_UINT8
, BASE_HEX
, NULL
, 0x07, NULL
, HFILL
}
6185 { &hf_dvbci_cicam_onid
,
6186 { "CICAM original network id", "dvb-ci.opp.cicam_onid",
6187 FT_UINT16
, BASE_HEX
, NULL
, 0, NULL
, HFILL
}
6189 { &hf_dvbci_cicam_id
,
6190 { "CICAM ID", "dvb-ci.opp.cicam_id",
6191 FT_UINT32
, BASE_HEX
, NULL
, 0, NULL
, HFILL
}
6193 { &hf_dvbci_opp_char_tbl
,
6194 { "Character table", "dvb-ci.opp.char_tbl",
6195 FT_BYTES
, BASE_NONE
, NULL
, 0, NULL
, HFILL
}
6197 { &hf_dvbci_sdt_rst_trusted
,
6198 { "SDT running status trusted", "dvb-ci.opp.sdt_rst_trusted",
6199 FT_UINT8
, BASE_HEX
, NULL
, 0x80, NULL
, HFILL
}
6201 { &hf_dvbci_eit_rst_trusted
,
6202 { "EIT running status trusted", "dvb-ci.opp.eit_rst_trusted",
6203 FT_UINT8
, BASE_HEX
, NULL
, 0x40, NULL
, HFILL
}
6205 { &hf_dvbci_eit_pf_usage
,
6206 { "EIT present/following usage", "dvb-ci.opp.eit_pf_usage",
6207 FT_UINT8
, BASE_HEX
, VALS(dvbci_opp_eit_pf_usage
), 0x30, NULL
, HFILL
}
6209 { &hf_dvbci_eit_sch_usage
,
6210 { "EIT schedule usage", "dvb-ci.opp.eit_sch_usage",
6211 FT_UINT8
, BASE_HEX
, VALS(dvbci_opp_eit_sch_usage
), 0x0E, NULL
, HFILL
}
6213 { &hf_dvbci_ext_evt_usage
,
6214 { "Extended event usage", "dvb-ci.opp.ext_evt_usage",
6215 FT_UINT8
, BASE_HEX
, VALS(dvbci_opp_ext_evt
), 0x01, NULL
, HFILL
}
6217 { &hf_dvbci_sdt_oth_trusted
,
6218 { "SDT_other trusted", "dvb-ci.opp.sdt_oth_trusted",
6219 FT_UINT8
, BASE_HEX
, NULL
, 0x80, NULL
, HFILL
}
6221 { &hf_dvbci_eit_evt_trigger
,
6222 { "EIT event trigger", "dvb-ci.opp.eit_evt_trigger",
6223 FT_UINT8
, BASE_HEX
, NULL
, 0x40, NULL
, HFILL
}
6225 { &hf_dvbci_opp_lang_code
,
6226 { "Language code", "dvb-ci.opp.lang_code",
6227 FT_STRING
, BASE_NONE
, NULL
, 0, NULL
, HFILL
}
6229 { &hf_dvbci_prof_name
,
6230 { "Profile name", "dvb-ci.opp.profile_name",
6231 FT_UINT_STRING
, BASE_NONE
, NULL
, 0, NULL
, HFILL
}
6233 { &hf_dvbci_unattended
,
6234 { "Unattended flag", "dvb-ci.opp.unattended_flag",
6235 FT_UINT8
, BASE_HEX
, NULL
, 0x80, NULL
, HFILL
}
6237 { &hf_dvbci_opp_svc_type_loop_len
,
6238 { "Service type loop length", "dvb-ci.opp.svc_type_loop_len",
6239 FT_UINT8
, BASE_DEC
, NULL
, 0x7F, NULL
, HFILL
}
6241 { &hf_dvbci_opp_svc_type
,
6242 { "Service type", "dvb-ci.opp.service_type", FT_UINT8
,
6243 BASE_HEX
|BASE_EXT_STRING
, &mpeg_descr_service_type_vals_ext
,
6246 { &hf_dvbci_dlv_cap_loop_len
,
6247 { "Delivery capability loop length", "dvb-ci.opp.dlv_cap_loop_len",
6248 FT_UINT8
, BASE_DEC
, NULL
, 0, NULL
, HFILL
}
6250 { &hf_dvbci_dlv_cap_byte
,
6251 { "Delivery capability byte", "dvb-ci.opp.dlv_cap_byte",
6252 FT_UINT8
, BASE_HEX
, VALS(dvbci_opp_dlv_cap
), 0, NULL
, HFILL
}
6254 { &hf_dvbci_app_cap_loop_len
,
6255 { "Application capability loop length", "dvb-ci.opp.app_cap_loop_len",
6256 FT_UINT8
, BASE_DEC
, NULL
, 0, NULL
, HFILL
}
6258 /* the CI+ spec is not particularly clear about this but an
6259 * application id in the capability loop must always be 2 bytes */
6260 { &hf_dvbci_app_cap_bytes
,
6261 { "Application capability bytes", "dvb-ci.opp.app_cap_bytes",
6262 FT_UINT16
, BASE_HEX
|BASE_EXT_STRING
,
6263 &mpeg_descr_data_bcast_id_vals_ext
, 0, NULL
, HFILL
}
6265 { &hf_dvbci_desc_num
,
6266 { "Next unprocessed descriptor number", "dvb-ci.opp.desc_num",
6267 FT_UINT8
, BASE_HEX
, NULL
, 0, NULL
, HFILL
}
6269 { &hf_dvbci_sig_strength
,
6270 { "Signal strength", "dvb-ci.opp.sig_strength",
6271 FT_UINT8
, BASE_DEC
, NULL
, 0, NULL
, HFILL
}
6273 { &hf_dvbci_sig_qual
,
6274 { "Signal quality", "dvb-ci.opp.sig_qual",
6275 FT_UINT8
, BASE_DEC
, NULL
, 0, NULL
, HFILL
}
6277 { &hf_dvbci_opp_tune_status
,
6278 { "Tuning status", "dvb-ci.opp.tune_status",
6279 FT_UINT8
, BASE_HEX
, VALS(dvbci_opp_tune_stat
), 0xF0, NULL
, HFILL
}
6281 { &hf_dvbci_opp_desc_loop_len
,
6282 { "Descriptor loop length", "dvb-ci.opp.desc_loop_len",
6283 FT_UINT16
, BASE_DEC
, NULL
, 0x0FFF, NULL
, HFILL
}
6285 { &hf_dvbci_sas_app_id
,
6286 { "Application ID", "dvb-ci.sas.app_id",
6287 FT_UINT64
, BASE_HEX
, NULL
, 0, NULL
, HFILL
}
6289 { &hf_dvbci_sas_sess_state
,
6290 { "Connection state", "dvb-ci.sas.sess_state",
6291 FT_UINT8
, BASE_DEC
, VALS(dvbci_sas_sess_state
), 0, NULL
, HFILL
}
6293 { &hf_dvbci_sas_msg_nb
,
6294 { "Message number", "dvb-ci.sas.msg_nb",
6295 FT_UINT8
, BASE_DEC
, NULL
, 0, NULL
, HFILL
}
6297 { &hf_dvbci_sas_msg_len
,
6298 { "Message length", "dvb-ci.sas.msg_len",
6299 FT_UINT16
, BASE_DEC
, NULL
, 0, NULL
, HFILL
}
6303 static ei_register_info ei
[] = {
6304 { &ei_dvbci_cor_addr
,
6305 { "dvb-ci.cor_address.invalid", PI_PROTOCOL
, PI_WARN
,
6306 "COR address must not be greater than 0xFFE (DVB-CI spec, A.5.6)",
6308 { &ei_dvbci_buf_size
,
6309 { "dvb-ci.buf_size.invalid", PI_PROTOCOL
, PI_WARN
,
6310 "Illegal buffer size command", EXPFILL
}},
6312 { "dvb-ci.more_last.invalid", PI_PROTOCOL
, PI_WARN
,
6313 "Invalid More/Last indicator, second byte of an LPDU must be 0x80 or 0x00", EXPFILL
}},
6314 { &ei_dvbci_c_tpdu_tag
,
6315 { "dvb-ci.c_tpdu_tag.invalid", PI_MALFORMED
, PI_ERROR
,
6316 "Invalid Command-TPDU tag, see DVB-CI specification, table A.16 for valid values", EXPFILL
}},
6317 { &ei_dvbci_r_tpdu_status_mandatory
,
6318 { "dvb-ci.r_tpdu_status.mandatory", PI_MALFORMED
, PI_ERROR
,
6319 "Response TPDU's status part is missing, RTPDU status is mandatory", EXPFILL
}},
6320 { &ei_dvbci_r_tpdu_tag
,
6321 { "dvb-ci.r_tpdu_tag.invalid", PI_MALFORMED
, PI_ERROR
,
6322 "Invalid Response-TPDU tag, see DVB-CI specification, table A.16 for valid values", EXPFILL
}},
6323 { &ei_dvbci_sb_value
,
6324 { "dvb-ci.sb_value.invalid", PI_PROTOCOL
, PI_WARN
,
6325 "Invalid SB_value, must be 0x00 or 0x80", EXPFILL
}},
6327 { "dvb-ci.t_c_id.invalid", PI_PROTOCOL
, PI_WARN
,
6328 "Transport Connection ID mismatch the transport layer link layer", EXPFILL
}},
6329 { &ei_dvbci_tpdu_status_tag
,
6330 { "dvb-ci.tpdu.status_tag.invalid", PI_MALFORMED
, PI_ERROR
,
6331 "Invalid status tag, this must always be T_SB (0x80)", EXPFILL
}},
6332 { &ei_dvbci_spdu_tag
,
6333 { "dvb-ci.spdu.invalid_tag", PI_MALFORMED
, PI_ERROR
,
6334 "Invalid SPDU tag, See table 14 in the DVB-CI specification",
6336 { &ei_dvbci_spdu_cam_to_host
,
6337 { "dvb-ci.spdu.cam_to_host", PI_PROTOCOL
, PI_WARN
,
6338 "Invalid SPDU direction, this SPDU must be sent from CAM to host",
6340 { &ei_dvbci_spdu_host_to_cam
,
6341 { "dvb-ci.spdu.host_to_cam", PI_PROTOCOL
, PI_WARN
,
6342 "Invalid SPDU direction, this SPDU must be sent from host to CAM",
6344 { &ei_dvbci_apdu_tag
,
6345 { "dvb-ci.apdu.invalid_tag", PI_MALFORMED
, PI_ERROR
,
6346 "Invalid or unsupported APDU tag", EXPFILL
}},
6347 { &ei_dvbci_apu_cam_to_host
,
6348 { "dvb-ci.apu.cam_to_host", PI_PROTOCOL
, PI_WARN
,
6349 "Invalid APDU direction, this APDU must be sent from CAM to host",
6351 { &ei_dvbci_apu_host_to_cam
,
6352 { "dvb-ci.apu.host_to_cam", PI_PROTOCOL
, PI_WARN
,
6353 "Invalid APDU direction, this APDU must be sent from host to CAM",
6355 { &ei_dvbci_apdu_not_supported
,
6356 { "dvb-ci.apdu.not_supported", PI_PROTOCOL
, PI_WARN
,
6357 "Dissection of this APDU is not supported", EXPFILL
}},
6358 { &ei_dvbci_res_ver
,
6359 { "dvb-ci.apdu.res_ver_old", PI_PROTOCOL
, PI_WARN
,
6360 "Invalid resource version for this apdu", EXPFILL
}},
6361 { &ei_dvbci_res_class
,
6362 { "dvb-ci.apdu.res_class_invalid", PI_PROTOCOL
, PI_WARN
,
6363 "Invalid resource class for this apdu", EXPFILL
}},
6364 { &ei_dvbci_bad_length
,
6365 { "dvb-ci.apdu.bad_length", PI_MALFORMED
, PI_ERROR
,
6366 "Invalid length field",
6368 /* this is used for both MMI and operator profile */
6369 { &ei_dvbci_invalid_char_tbl
,
6370 { "dvb-ci.apdu.invalid_char_tbl", PI_MALFORMED
, PI_ERROR
,
6371 "Invalid character table", EXPFILL
}},
6372 { &ei_dvbci_no_ca_desc_es
,
6373 { "dvb-ci.ca.no_ca_desc_es", PI_PROTOCOL
, PI_CHAT
,
6374 "No CA descriptors for this elementary stream", EXPFILL
}},
6375 { &ei_dvbci_no_ca_desc_prog
,
6376 { "dvb-ci.ca.no_ca_desc_prog", PI_PROTOCOL
, PI_CHAT
,
6377 "No CA descriptors at program level", EXPFILL
}},
6378 { &ei_dvbci_ca_pmt_cmd_id
,
6379 { "dvb-ci.ca.ca_pmt_cmd_id.ca_pmt", PI_MALFORMED
, PI_ERROR
,
6380 "The ca_pmt shall only contain ca descriptors (tag 0x9)",
6382 { &ei_dvbci_time_offs_unknown
,
6383 { "dvb-ci.dt.local_offset_unknown", PI_PROTOCOL
, PI_CHAT
,
6384 "Offset between UTC and local time is unknown", EXPFILL
}},
6385 { &ei_dvbci_not_text_more_or_text_last
,
6386 { "dvb-ci.mmi.not_text_more_or_text_last", PI_MALFORMED
, PI_ERROR
,
6387 "Items must be text_more() or text_last() objects", EXPFILL
}},
6388 { &ei_dvbci_network_id
,
6389 { "dvb-ci.hc.nid.ignored", PI_PROTOCOL
, PI_NOTE
,
6390 "Network ID is usually ignored by hosts", EXPFILL
}},
6391 { &ei_dvbci_cc_pin_nvr_chg
,
6392 { "dvb-ci.cc.pin_never_changed", PI_PROTOCOL
, PI_CHAT
,
6393 "CICAM PIN has never been changed", EXPFILL
}},
6394 { &ei_dvbci_pin_evt_cent
,
6395 { "dvb-ci.cc.pin_event_time_centi.invalid", PI_PROTOCOL
, PI_WARN
,
6396 "Invalid value for event time centiseconds, Value must be between 0 and 100",
6398 { &ei_dvbci_sac_payload_enc
,
6399 { "dvb-ci.cc.sac.payload_enc.clear", PI_PROTOCOL
, PI_NOTE
,
6400 "The original PDU was encrypted, this exported PDU is in the clear",
6402 { &ei_dvbci_sig_qual
,
6403 { "dvb-ci.opp.sig_qual.invalid", PI_PROTOCOL
, PI_WARN
,
6404 "Invalid value for signal strength / signal quality, values are in percent (0 to 100)",
6406 { &ei_dvbci_cicam_nit_table_id
,
6407 { "dvb-ci.opp.cicam_nit_table_id_invalid", PI_PROTOCOL
, PI_WARN
,
6408 "CICAM NIT must have table id 0x40 (NIT actual)", EXPFILL
}},
6409 { &ei_dvbci_cup_progress
,
6410 { "dvb-ci.cup.progress_invalid", PI_PROTOCOL
, PI_WARN
,
6411 "progress is in percent, value must be between 0 and 100",
6415 spdu_table
= g_hash_table_new(g_direct_hash
, g_direct_equal
);
6416 for(i
=0; i
<array_length(spdu_info
); i
++) {
6417 g_hash_table_insert(spdu_table
,
6418 GUINT_TO_POINTER((unsigned)spdu_info
[i
].tag
),
6419 (void *)(&spdu_info
[i
]));
6422 apdu_table
= g_hash_table_new(g_direct_hash
, g_direct_equal
);
6423 for(i
=0; i
<array_length(apdu_info
); i
++) {
6424 g_hash_table_insert(apdu_table
,
6425 GUINT_TO_POINTER((unsigned)apdu_info
[i
].tag
),
6426 (void *)(&apdu_info
[i
]));
6429 proto_dvbci
= proto_register_protocol("DVB Common Interface", "DVB-CI", "dvb-ci");
6430 proto_register_field_array(proto_dvbci
, hf
, array_length(hf
));
6431 proto_register_subtree_array(ett
, array_length(ett
));
6432 expert_dvbci
= expert_register_protocol(proto_dvbci
);
6433 expert_register_field_array(expert_dvbci
, ei
, array_length(ei
));
6435 dvbci_module
= prefs_register_protocol(proto_dvbci
, proto_reg_handoff_dvbci
);
6436 prefs_register_string_preference(dvbci_module
,
6437 "sek", "SAC Encryption Key", "SAC Encryption Key (16 hex bytes)",
6439 prefs_register_string_preference(dvbci_module
,
6440 "siv", "SAC Init Vector", "SAC Init Vector (16 hex bytes)",
6442 prefs_register_bool_preference(dvbci_module
,
6444 "Dissect LSC messages",
6445 "Dissect the content of messages transmitted "
6446 "on the Low-Speed Communication resource. "
6447 "This requires a dissector for the protocol and target port "
6448 "contained in the connection descriptor.",
6449 &dvbci_dissect_lsc_msg
);
6451 sas_msg_dissector_table
= register_dissector_table("dvb-ci.sas.app_id_str",
6452 "SAS application id", proto_dvbci
, FT_STRING
, STRING_CASE_SENSITIVE
);
6454 register_init_routine(dvbci_init
);
6455 reassembly_table_register(&tpdu_reassembly_table
,
6456 &addresses_reassembly_table_functions
);
6457 reassembly_table_register(&spdu_reassembly_table
,
6458 &addresses_reassembly_table_functions
);
6461 /* the dissector for decrypted CI+ SAC messages which we can export */
6462 register_dissector_with_description(EXPORTED_SAC_MSG_PROTO
,
6463 EXPORTED_SAC_MSG_DESCRIPTION
,
6464 dissect_dvbci_exported_sac_msg
, proto_dvbci
);
6466 exported_pdu_tap
= register_export_pdu_tap("DVB-CI");
6468 register_shutdown_routine(dvbci_shutdown
);
6470 dvbci_handle
= register_dissector("dvb-ci", dissect_dvbci
, proto_dvbci
);
6475 proto_reg_handoff_dvbci(void)
6477 static bool initialized
= false;
6480 dissector_add_uint("wtap_encap", WTAP_ENCAP_DVBCI
, dvbci_handle
);
6482 data_handle
= find_dissector("data");
6483 mpeg_pmt_handle
= find_dissector_add_dependency("mpeg_pmt", proto_dvbci
);
6484 dvb_nit_handle
= find_dissector_add_dependency("dvb_nit", proto_dvbci
);
6485 mime_handle
= find_dissector_add_dependency("mime_dlt", proto_dvbci
);
6486 tcp_dissector_table
= find_dissector_table("tcp.port");
6487 udp_dissector_table
= find_dissector_table("udp.port");
6491 g_free(dvbci_sek_bin
);
6492 g_free(dvbci_siv_bin
);
6493 pref_key_string_to_bin(dvbci_sek
, &dvbci_sek_bin
);
6494 pref_key_string_to_bin(dvbci_siv
, &dvbci_siv_bin
);
6498 * Editor modelines - https://www.wireshark.org/tools/modelines.html
6503 * indent-tabs-mode: nil
6506 * vi: set shiftwidth=4 tabstop=8 expandtab:
6507 * :indentSize=4:tabSize=8:noTabs=true: