vdr 2.6.6
Classes | Macros | Functions | Variables
ci.c File Reference
#include "ci.h"
#include <ctype.h>
#include <linux/dvb/ca.h>
#include <malloc.h>
#include <netinet/in.h>
#include <poll.h>
#include <stdio.h>
#include <string.h>
#include <sys/ioctl.h>
#include <time.h>
#include <unistd.h>
#include "device.h"
#include "mtd.h"
#include "pat.h"
#include "receiver.h"
#include "remux.h"
#include "libsi/si.h"
#include "skins.h"
#include "tools.h"

Go to the source code of this file.

Classes

class  cCaPidReceiver
 
class  cCaActivationReceiver
 
class  cCamResponse
 
class  cCamResponses
 
class  cTPDU
 
class  cCiTransportConnection
 
class  cCiResourceManager
 
class  cCiCaPmt
 
class  cCiConditionalAccessSupport
 
class  cCiHostControl
 
class  cCiDateTime
 
class  cCiMMI
 
class  cCiDefaultResourceHandler
 
class  cCiCaPidData
 
class  cCiCaProgramData
 
class  cChannelCamRelation
 

Macros

#define dbgprotocol(a...)   do { if (DebugProtocol) fprintf(stderr, a); } while (0)
 
#define SIZE_INDICATOR   0x80
 
#define CAT_MAXPACKETS   6
 
#define UNSCRAMBLE_TIME   5
 
#define TS_PACKET_FACTOR   1024
 
#define CRA_NONE   0
 
#define CRA_DISCARD   -1
 
#define CRA_CONFIRM   -2
 
#define CRA_SELECT   -3
 
#define MAX_TPDU_SIZE   4096
 
#define MAX_TPDU_DATA   (MAX_TPDU_SIZE - 4)
 
#define DATA_INDICATOR   0x80
 
#define T_SB   0x80
 
#define T_RCV   0x81
 
#define T_CREATE_TC   0x82
 
#define T_CTC_REPLY   0x83
 
#define T_DELETE_TC   0x84
 
#define T_DTC_REPLY   0x85
 
#define T_REQUEST_TC   0x86
 
#define T_NEW_TC   0x87
 
#define T_TC_ERROR   0x88
 
#define T_DATA_LAST   0xA0
 
#define T_DATA_MORE   0xA1
 
#define MAX_DUMP   256
 
#define MAX_SESSIONS_PER_TC   16
 
#define ST_SESSION_NUMBER   0x90
 
#define ST_OPEN_SESSION_REQUEST   0x91
 
#define ST_OPEN_SESSION_RESPONSE   0x92
 
#define ST_CREATE_SESSION   0x93
 
#define ST_CREATE_SESSION_RESPONSE   0x94
 
#define ST_CLOSE_SESSION_REQUEST   0x95
 
#define ST_CLOSE_SESSION_RESPONSE   0x96
 
#define SS_OK   0x00
 
#define SS_NOT_ALLOCATED   0xF0
 
#define RI_RESOURCE_MANAGER   0x00010041
 
#define RI_APPLICATION_INFORMATION   0x00020041
 
#define RI_CONDITIONAL_ACCESS_SUPPORT   0x00030041
 
#define RI_HOST_CONTROL   0x00200041
 
#define RI_DATE_TIME   0x00240041
 
#define RI_MMI   0x00400041
 
#define AOT_NONE   0x000000
 
#define AOT_PROFILE_ENQ   0x9F8010
 
#define AOT_PROFILE   0x9F8011
 
#define AOT_PROFILE_CHANGE   0x9F8012
 
#define AOT_APPLICATION_INFO_ENQ   0x9F8020
 
#define AOT_APPLICATION_INFO   0x9F8021
 
#define AOT_ENTER_MENU   0x9F8022
 
#define AOT_CA_INFO_ENQ   0x9F8030
 
#define AOT_CA_INFO   0x9F8031
 
#define AOT_CA_PMT   0x9F8032
 
#define AOT_CA_PMT_REPLY   0x9F8033
 
#define AOT_TUNE   0x9F8400
 
#define AOT_REPLACE   0x9F8401
 
#define AOT_CLEAR_REPLACE   0x9F8402
 
#define AOT_ASK_RELEASE   0x9F8403
 
#define AOT_DATE_TIME_ENQ   0x9F8440
 
#define AOT_DATE_TIME   0x9F8441
 
#define AOT_CLOSE_MMI   0x9F8800
 
#define AOT_DISPLAY_CONTROL   0x9F8801
 
#define AOT_DISPLAY_REPLY   0x9F8802
 
#define AOT_TEXT_LAST   0x9F8803
 
#define AOT_TEXT_MORE   0x9F8804
 
#define AOT_KEYPAD_CONTROL   0x9F8805
 
#define AOT_KEYPRESS   0x9F8806
 
#define AOT_ENQ   0x9F8807
 
#define AOT_ANSW   0x9F8808
 
#define AOT_MENU_LAST   0x9F8809
 
#define AOT_MENU_MORE   0x9F880A
 
#define AOT_MENU_ANSW   0x9F880B
 
#define AOT_LIST_LAST   0x9F880C
 
#define AOT_LIST_MORE   0x9F880D
 
#define AOT_SUBTITLE_SEGMENT_LAST   0x9F880E
 
#define AOT_SUBTITLE_SEGMENT_MORE   0x9F880F
 
#define AOT_DISPLAY_MESSAGE   0x9F8810
 
#define AOT_SCENE_END_MARK   0x9F8811
 
#define AOT_SCENE_DONE   0x9F8812
 
#define AOT_SCENE_CONTROL   0x9F8813
 
#define AOT_SUBTITLE_DOWNLOAD_LAST   0x9F8814
 
#define AOT_SUBTITLE_DOWNLOAD_MORE   0x9F8815
 
#define AOT_FLUSH_DOWNLOAD   0x9F8816
 
#define AOT_DOWNLOAD_REPLY   0x9F8817
 
#define AOT_COMMS_CMD   0x9F8C00
 
#define AOT_CONNECTION_DESCRIPTOR   0x9F8C01
 
#define AOT_COMMS_REPLY   0x9F8C02
 
#define AOT_COMMS_SEND_LAST   0x9F8C03
 
#define AOT_COMMS_SEND_MORE   0x9F8C04
 
#define AOT_COMMS_RCV_LAST   0x9F8C05
 
#define AOT_COMMS_RCV_MORE   0x9F8C06
 
#define RESOURCE_CLASS_MASK   0xFFFF0000
 
#define MAXCASYSTEMIDS   64
 
#define CPLM_MORE   0x00
 
#define CPLM_FIRST   0x01
 
#define CPLM_LAST   0x02
 
#define CPLM_ONLY   0x03
 
#define CPLM_ADD   0x04
 
#define CPLM_UPDATE   0x05
 
#define CPCI_OK_DESCRAMBLING   0x01
 
#define CPCI_OK_MMI   0x02
 
#define CPCI_QUERY   0x03
 
#define CPCI_NOT_SELECTED   0x04
 
#define CAEI_POSSIBLE   0x01
 
#define CAEI_POSSIBLE_COND_PURCHASE   0x02
 
#define CAEI_POSSIBLE_COND_TECHNICAL   0x03
 
#define CAEI_NOT_POSSIBLE_ENTITLEMENT   0x71
 
#define CAEI_NOT_POSSIBLE_TECHNICAL   0x73
 
#define CA_ENABLE_FLAG   0x80
 
#define CA_ENABLE(x)   (((x) & CA_ENABLE_FLAG) ? (x) & ~CA_ENABLE_FLAG : 0)
 
#define QUERY_WAIT_TIME   500
 
#define QUERY_REPLY_TIMEOUT   2000
 
#define QUERY_RETRIES   6
 
#define DEC2BCD(d)   uint8_t(((d / 10) << 4) + (d % 10))
 
#define DCC_SET_MMI_MODE   0x01
 
#define DCC_DISPLAY_CHARACTER_TABLE_LIST   0x02
 
#define DCC_INPUT_CHARACTER_TABLE_LIST   0x03
 
#define DCC_OVERLAY_GRAPHICS_CHARACTERISTICS   0x04
 
#define DCC_FULL_SCREEN_GRAPHICS_CHARACTERISTICS   0x05
 
#define MM_HIGH_LEVEL   0x01
 
#define MM_LOW_LEVEL_OVERLAY_GRAPHICS   0x02
 
#define MM_LOW_LEVEL_FULL_SCREEN_GRAPHICS   0x03
 
#define DRI_MMI_MODE_ACK   0x01
 
#define DRI_LIST_DISPLAY_CHARACTER_TABLES   0x02
 
#define DRI_LIST_INPUT_CHARACTER_TABLES   0x03
 
#define DRI_LIST_GRAPHIC_OVERLAY_CHARACTERISTICS   0x04
 
#define DRI_LIST_FULL_SCREEN_GRAPHIC_CHARACTERISTICS   0x05
 
#define DRI_UNKNOWN_DISPLAY_CONTROL_CMD   0xF0
 
#define DRI_UNKNOWN_MMI_MODE   0xF1
 
#define DRI_UNKNOWN_CHARACTER_TABLE   0xF2
 
#define EF_BLIND   0x01
 
#define AI_CANCEL   0x00
 
#define AI_ANSWER   0x01
 
#define TC_POLL_TIMEOUT   300
 
#define TC_ALIVE_TIMEOUT   2000
 
#define MODULE_CHECK_INTERVAL   500
 
#define MODULE_RESET_TIMEOUT   2
 
#define STREAM_TYPE_VIDEO   0x02
 
#define STREAM_TYPE_AUDIO   0x04
 
#define STREAM_TYPE_PRIVATE   0x06
 
#define QUERY_REPLY_WAIT   100
 
#define CAM_CHECKED_TIMEOUT   15
 
#define MAX_CAM_NUMBER   32
 
#define CHANNEL_CAM_RELATIONS_CLEANUP_INTERVAL   3600
 

Functions

static const uint8_t * GetLength (const uint8_t *Data, int &Length)
 
static uint8_t * SetLength (uint8_t *Data, int Length)
 
static char * CopyString (int Length, const uint8_t *Data)
 
static char * GetString (int &Length, const uint8_t **Data)
 
bool CamResponsesLoad (const char *FileName, bool AllowComments, bool MustExist)
 
static int MtdMapCaDescriptor (uchar *p, cMtdMapper *MtdMapper)
 
static int MtdMapCaDescriptors (uchar *p, cMtdMapper *MtdMapper)
 
static int MtdMapStream (uchar *p, cMtdMapper *MtdMapper)
 
static int MtdMapStreams (uchar *p, cMtdMapper *MtdMapper, int Length)
 

Variables

static bool DumpTPDUDataTransfer = false
 
static bool DebugProtocol = false
 
static bool DumpPolls = false
 
static bool DumpDateTime = false
 
cCamResponses CamResponses
 
cCiResourceHandlers CiResourceHandlers
 
cCamSlots CamSlots
 
cChannelCamRelations ChannelCamRelations
 

Macro Definition Documentation

◆ AI_ANSWER

#define AI_ANSWER   0x01

Definition at line 1403 of file ci.c.

Referenced by cCiMMI::SendAnswer().

◆ AI_CANCEL

#define AI_CANCEL   0x00

Definition at line 1402 of file ci.c.

Referenced by cCiMMI::SendAnswer().

◆ AOT_ANSW

#define AOT_ANSW   0x9F8808

Definition at line 703 of file ci.c.

Referenced by cCiMMI::SendAnswer().

◆ AOT_APPLICATION_INFO

#define AOT_APPLICATION_INFO   0x9F8021

Definition at line 683 of file ci.c.

Referenced by cCiApplicationInformation::Process().

◆ AOT_APPLICATION_INFO_ENQ

#define AOT_APPLICATION_INFO_ENQ   0x9F8020

Definition at line 682 of file ci.c.

Referenced by cCiApplicationInformation::Process().

◆ AOT_ASK_RELEASE

#define AOT_ASK_RELEASE   0x9F8403

Definition at line 692 of file ci.c.

◆ AOT_CA_INFO

#define AOT_CA_INFO   0x9F8031

Definition at line 686 of file ci.c.

Referenced by cCiConditionalAccessSupport::Process().

◆ AOT_CA_INFO_ENQ

#define AOT_CA_INFO_ENQ   0x9F8030

Definition at line 685 of file ci.c.

Referenced by cCiConditionalAccessSupport::Process().

◆ AOT_CA_PMT

#define AOT_CA_PMT   0x9F8032

Definition at line 687 of file ci.c.

Referenced by cCiConditionalAccessSupport::SendPMT().

◆ AOT_CA_PMT_REPLY

#define AOT_CA_PMT_REPLY   0x9F8033

Definition at line 688 of file ci.c.

Referenced by cCiConditionalAccessSupport::Process().

◆ AOT_CLEAR_REPLACE

#define AOT_CLEAR_REPLACE   0x9F8402

Definition at line 691 of file ci.c.

Referenced by cCiHostControl::Process().

◆ AOT_CLOSE_MMI

#define AOT_CLOSE_MMI   0x9F8800

Definition at line 695 of file ci.c.

Referenced by cCiMMI::Process(), and cCiMMI::SendCloseMMI().

◆ AOT_COMMS_CMD

#define AOT_COMMS_CMD   0x9F8C00

Definition at line 719 of file ci.c.

◆ AOT_COMMS_RCV_LAST

#define AOT_COMMS_RCV_LAST   0x9F8C05

Definition at line 724 of file ci.c.

◆ AOT_COMMS_RCV_MORE

#define AOT_COMMS_RCV_MORE   0x9F8C06

Definition at line 725 of file ci.c.

◆ AOT_COMMS_REPLY

#define AOT_COMMS_REPLY   0x9F8C02

Definition at line 721 of file ci.c.

◆ AOT_COMMS_SEND_LAST

#define AOT_COMMS_SEND_LAST   0x9F8C03

Definition at line 722 of file ci.c.

◆ AOT_COMMS_SEND_MORE

#define AOT_COMMS_SEND_MORE   0x9F8C04

Definition at line 723 of file ci.c.

◆ AOT_CONNECTION_DESCRIPTOR

#define AOT_CONNECTION_DESCRIPTOR   0x9F8C01

Definition at line 720 of file ci.c.

◆ AOT_DATE_TIME

#define AOT_DATE_TIME   0x9F8441

Definition at line 694 of file ci.c.

Referenced by cCiDateTime::SendDateTime().

◆ AOT_DATE_TIME_ENQ

#define AOT_DATE_TIME_ENQ   0x9F8440

Definition at line 693 of file ci.c.

Referenced by cCiDateTime::Process().

◆ AOT_DISPLAY_CONTROL

#define AOT_DISPLAY_CONTROL   0x9F8801

Definition at line 696 of file ci.c.

Referenced by cCiMMI::Process().

◆ AOT_DISPLAY_MESSAGE

#define AOT_DISPLAY_MESSAGE   0x9F8810

Definition at line 711 of file ci.c.

◆ AOT_DISPLAY_REPLY

#define AOT_DISPLAY_REPLY   0x9F8802

Definition at line 697 of file ci.c.

Referenced by cCiMMI::Process().

◆ AOT_DOWNLOAD_REPLY

#define AOT_DOWNLOAD_REPLY   0x9F8817

Definition at line 718 of file ci.c.

◆ AOT_ENQ

#define AOT_ENQ   0x9F8807

Definition at line 702 of file ci.c.

Referenced by cCiMMI::Process().

◆ AOT_ENTER_MENU

#define AOT_ENTER_MENU   0x9F8022

Definition at line 684 of file ci.c.

Referenced by cCiApplicationInformation::EnterMenu().

◆ AOT_FLUSH_DOWNLOAD

#define AOT_FLUSH_DOWNLOAD   0x9F8816

Definition at line 717 of file ci.c.

◆ AOT_KEYPAD_CONTROL

#define AOT_KEYPAD_CONTROL   0x9F8805

Definition at line 700 of file ci.c.

◆ AOT_KEYPRESS

#define AOT_KEYPRESS   0x9F8806

Definition at line 701 of file ci.c.

◆ AOT_LIST_LAST

#define AOT_LIST_LAST   0x9F880C

Definition at line 707 of file ci.c.

Referenced by cCiMMI::Process().

◆ AOT_LIST_MORE

#define AOT_LIST_MORE   0x9F880D

Definition at line 708 of file ci.c.

◆ AOT_MENU_ANSW

#define AOT_MENU_ANSW   0x9F880B

Definition at line 706 of file ci.c.

Referenced by cCiMMI::SendMenuAnswer().

◆ AOT_MENU_LAST

#define AOT_MENU_LAST   0x9F8809

Definition at line 704 of file ci.c.

Referenced by cCiMMI::Process().

◆ AOT_MENU_MORE

#define AOT_MENU_MORE   0x9F880A

Definition at line 705 of file ci.c.

◆ AOT_NONE

#define AOT_NONE   0x000000

Definition at line 678 of file ci.c.

Referenced by cCiSession::GetTag().

◆ AOT_PROFILE

#define AOT_PROFILE   0x9F8011

Definition at line 680 of file ci.c.

Referenced by cCiResourceManager::Process().

◆ AOT_PROFILE_CHANGE

#define AOT_PROFILE_CHANGE   0x9F8012

Definition at line 681 of file ci.c.

Referenced by cCiResourceManager::Process().

◆ AOT_PROFILE_ENQ

#define AOT_PROFILE_ENQ   0x9F8010

Definition at line 679 of file ci.c.

Referenced by cCiResourceManager::Process().

◆ AOT_REPLACE

#define AOT_REPLACE   0x9F8401

Definition at line 690 of file ci.c.

Referenced by cCiHostControl::Process().

◆ AOT_SCENE_CONTROL

#define AOT_SCENE_CONTROL   0x9F8813

Definition at line 714 of file ci.c.

◆ AOT_SCENE_DONE

#define AOT_SCENE_DONE   0x9F8812

Definition at line 713 of file ci.c.

◆ AOT_SCENE_END_MARK

#define AOT_SCENE_END_MARK   0x9F8811

Definition at line 712 of file ci.c.

◆ AOT_SUBTITLE_DOWNLOAD_LAST

#define AOT_SUBTITLE_DOWNLOAD_LAST   0x9F8814

Definition at line 715 of file ci.c.

◆ AOT_SUBTITLE_DOWNLOAD_MORE

#define AOT_SUBTITLE_DOWNLOAD_MORE   0x9F8815

Definition at line 716 of file ci.c.

◆ AOT_SUBTITLE_SEGMENT_LAST

#define AOT_SUBTITLE_SEGMENT_LAST   0x9F880E

Definition at line 709 of file ci.c.

◆ AOT_SUBTITLE_SEGMENT_MORE

#define AOT_SUBTITLE_SEGMENT_MORE   0x9F880F

Definition at line 710 of file ci.c.

◆ AOT_TEXT_LAST

#define AOT_TEXT_LAST   0x9F8803

Definition at line 698 of file ci.c.

Referenced by cCiMMI::GetText().

◆ AOT_TEXT_MORE

#define AOT_TEXT_MORE   0x9F8804

Definition at line 699 of file ci.c.

◆ AOT_TUNE

#define AOT_TUNE   0x9F8400

Definition at line 689 of file ci.c.

Referenced by cCiHostControl::Process().

◆ CA_ENABLE

#define CA_ENABLE ( x)    (((x) & CA_ENABLE_FLAG) ? (x) & ~CA_ENABLE_FLAG : 0)

Definition at line 1104 of file ci.c.

Referenced by cCiConditionalAccessSupport::Process().

◆ CA_ENABLE_FLAG

#define CA_ENABLE_FLAG   0x80

Definition at line 1102 of file ci.c.

◆ CAEI_NOT_POSSIBLE_ENTITLEMENT

#define CAEI_NOT_POSSIBLE_ENTITLEMENT   0x71

Definition at line 1099 of file ci.c.

◆ CAEI_NOT_POSSIBLE_TECHNICAL

#define CAEI_NOT_POSSIBLE_TECHNICAL   0x73

Definition at line 1100 of file ci.c.

◆ CAEI_POSSIBLE

#define CAEI_POSSIBLE   0x01

Definition at line 1096 of file ci.c.

Referenced by cCiConditionalAccessSupport::Process().

◆ CAEI_POSSIBLE_COND_PURCHASE

#define CAEI_POSSIBLE_COND_PURCHASE   0x02

Definition at line 1097 of file ci.c.

◆ CAEI_POSSIBLE_COND_TECHNICAL

#define CAEI_POSSIBLE_COND_TECHNICAL   0x03

Definition at line 1098 of file ci.c.

◆ CAM_CHECKED_TIMEOUT

#define CAM_CHECKED_TIMEOUT   15

Definition at line 2871 of file ci.c.

Referenced by cChannelCamRelation::CamChecked(), and cChannelCamRelation::TimedOut().

◆ CAT_MAXPACKETS

#define CAT_MAXPACKETS   6

Definition at line 123 of file ci.c.

◆ CHANNEL_CAM_RELATIONS_CLEANUP_INTERVAL

#define CHANNEL_CAM_RELATIONS_CLEANUP_INTERVAL   3600

Definition at line 2945 of file ci.c.

Referenced by cChannelCamRelations::Cleanup().

◆ CPCI_NOT_SELECTED

#define CPCI_NOT_SELECTED   0x04

Definition at line 933 of file ci.c.

Referenced by cCamSlot::BuildCaPmts(), and cCamSlot::StopDecrypting().

◆ CPCI_OK_DESCRAMBLING

#define CPCI_OK_DESCRAMBLING   0x01

Definition at line 930 of file ci.c.

Referenced by cCamSlot::StartDecrypting().

◆ CPCI_OK_MMI

#define CPCI_OK_MMI   0x02

Definition at line 931 of file ci.c.

◆ CPCI_QUERY

#define CPCI_QUERY   0x03

◆ CPLM_ADD

#define CPLM_ADD   0x04

Definition at line 925 of file ci.c.

Referenced by cCamSlot::BuildCaPmts(), and cCamSlot::CanDecrypt().

◆ CPLM_FIRST

#define CPLM_FIRST   0x01

Definition at line 922 of file ci.c.

◆ CPLM_LAST

#define CPLM_LAST   0x02

Definition at line 923 of file ci.c.

◆ CPLM_MORE

#define CPLM_MORE   0x00

Definition at line 921 of file ci.c.

◆ CPLM_ONLY

#define CPLM_ONLY   0x03

Definition at line 924 of file ci.c.

Referenced by cCiCaPmt::cCiCaPmt().

◆ CPLM_UPDATE

#define CPLM_UPDATE   0x05

Definition at line 926 of file ci.c.

Referenced by cCamSlot::BuildCaPmts().

◆ CRA_CONFIRM

#define CRA_CONFIRM   -2

Definition at line 361 of file ci.c.

Referenced by cCamResponse::Parse(), and cCiMMI::Process().

◆ CRA_DISCARD

#define CRA_DISCARD   -1

Definition at line 360 of file ci.c.

Referenced by cCamResponse::Parse(), and cCiMMI::Process().

◆ CRA_NONE

#define CRA_NONE   0

◆ CRA_SELECT

#define CRA_SELECT   -3

Definition at line 362 of file ci.c.

Referenced by cCamResponse::Parse(), and cCiMMI::Process().

◆ DATA_INDICATOR

#define DATA_INDICATOR   0x80

Definition at line 491 of file ci.c.

Referenced by cCiTransportConnection::Process().

◆ dbgprotocol

#define dbgprotocol ( a...)    do { if (DebugProtocol) fprintf(stderr, a); } while (0)

◆ DCC_DISPLAY_CHARACTER_TABLE_LIST

#define DCC_DISPLAY_CHARACTER_TABLE_LIST   0x02

Definition at line 1374 of file ci.c.

◆ DCC_FULL_SCREEN_GRAPHICS_CHARACTERISTICS

#define DCC_FULL_SCREEN_GRAPHICS_CHARACTERISTICS   0x05

Definition at line 1377 of file ci.c.

◆ DCC_INPUT_CHARACTER_TABLE_LIST

#define DCC_INPUT_CHARACTER_TABLE_LIST   0x03

Definition at line 1375 of file ci.c.

◆ DCC_OVERLAY_GRAPHICS_CHARACTERISTICS

#define DCC_OVERLAY_GRAPHICS_CHARACTERISTICS   0x04

Definition at line 1376 of file ci.c.

◆ DCC_SET_MMI_MODE

#define DCC_SET_MMI_MODE   0x01

Definition at line 1373 of file ci.c.

Referenced by cCiMMI::Process().

◆ DEC2BCD

#define DEC2BCD ( d)    uint8_t(((d / 10) << 4) + (d % 10))

◆ DRI_LIST_DISPLAY_CHARACTER_TABLES

#define DRI_LIST_DISPLAY_CHARACTER_TABLES   0x02

Definition at line 1388 of file ci.c.

◆ DRI_LIST_FULL_SCREEN_GRAPHIC_CHARACTERISTICS

#define DRI_LIST_FULL_SCREEN_GRAPHIC_CHARACTERISTICS   0x05

Definition at line 1391 of file ci.c.

◆ DRI_LIST_GRAPHIC_OVERLAY_CHARACTERISTICS

#define DRI_LIST_GRAPHIC_OVERLAY_CHARACTERISTICS   0x04

Definition at line 1390 of file ci.c.

◆ DRI_LIST_INPUT_CHARACTER_TABLES

#define DRI_LIST_INPUT_CHARACTER_TABLES   0x03

Definition at line 1389 of file ci.c.

◆ DRI_MMI_MODE_ACK

#define DRI_MMI_MODE_ACK   0x01

Definition at line 1387 of file ci.c.

Referenced by cCiMMI::Process().

◆ DRI_UNKNOWN_CHARACTER_TABLE

#define DRI_UNKNOWN_CHARACTER_TABLE   0xF2

Definition at line 1394 of file ci.c.

◆ DRI_UNKNOWN_DISPLAY_CONTROL_CMD

#define DRI_UNKNOWN_DISPLAY_CONTROL_CMD   0xF0

Definition at line 1392 of file ci.c.

◆ DRI_UNKNOWN_MMI_MODE

#define DRI_UNKNOWN_MMI_MODE   0xF1

Definition at line 1393 of file ci.c.

◆ EF_BLIND

#define EF_BLIND   0x01

Definition at line 1398 of file ci.c.

Referenced by cCiMMI::Process().

◆ MAX_CAM_NUMBER

#define MAX_CAM_NUMBER   32

Definition at line 2944 of file ci.c.

Referenced by cChannelCamRelations::Load(), and cChannelCamRelations::Save().

◆ MAX_DUMP

#define MAX_DUMP   256

◆ MAX_SESSIONS_PER_TC

#define MAX_SESSIONS_PER_TC   16

◆ MAX_TPDU_DATA

#define MAX_TPDU_DATA   (MAX_TPDU_SIZE - 4)

Definition at line 489 of file ci.c.

Referenced by cTPDU::cTPDU().

◆ MAX_TPDU_SIZE

#define MAX_TPDU_SIZE   4096

Definition at line 488 of file ci.c.

Referenced by cCiSession::SendData().

◆ MAXCASYSTEMIDS

#define MAXCASYSTEMIDS   64

Definition at line 917 of file ci.c.

Referenced by cCiConditionalAccessSupport::Process().

◆ MM_HIGH_LEVEL

#define MM_HIGH_LEVEL   0x01

Definition at line 1381 of file ci.c.

Referenced by cCiMMI::Process().

◆ MM_LOW_LEVEL_FULL_SCREEN_GRAPHICS

#define MM_LOW_LEVEL_FULL_SCREEN_GRAPHICS   0x03

Definition at line 1383 of file ci.c.

◆ MM_LOW_LEVEL_OVERLAY_GRAPHICS

#define MM_LOW_LEVEL_OVERLAY_GRAPHICS   0x02

Definition at line 1382 of file ci.c.

◆ MODULE_CHECK_INTERVAL

#define MODULE_CHECK_INTERVAL   500

Definition at line 2175 of file ci.c.

Referenced by cCamSlot::Process().

◆ MODULE_RESET_TIMEOUT

#define MODULE_RESET_TIMEOUT   2

Definition at line 2176 of file ci.c.

Referenced by cCamSlot::ModuleStatus().

◆ QUERY_REPLY_TIMEOUT

#define QUERY_REPLY_TIMEOUT   2000

Definition at line 1107 of file ci.c.

Referenced by cCamSlot::CanDecrypt().

◆ QUERY_REPLY_WAIT

#define QUERY_REPLY_WAIT   100

Definition at line 2738 of file ci.c.

Referenced by cCamSlot::CanDecrypt().

◆ QUERY_RETRIES

#define QUERY_RETRIES   6

Definition at line 1108 of file ci.c.

Referenced by cCiConditionalAccessSupport::Process().

◆ QUERY_WAIT_TIME

#define QUERY_WAIT_TIME   500

Definition at line 1106 of file ci.c.

Referenced by cCiConditionalAccessSupport::Process().

◆ RESOURCE_CLASS_MASK

#define RESOURCE_CLASS_MASK   0xFFFF0000

Definition at line 727 of file ci.c.

Referenced by cCiTransportConnection::GetSessionByResourceId().

◆ RI_APPLICATION_INFORMATION

#define RI_APPLICATION_INFORMATION   0x00020041

◆ RI_CONDITIONAL_ACCESS_SUPPORT

#define RI_CONDITIONAL_ACCESS_SUPPORT   0x00030041

◆ RI_DATE_TIME

#define RI_DATE_TIME   0x00240041

◆ RI_HOST_CONTROL

#define RI_HOST_CONTROL   0x00200041

◆ RI_MMI

#define RI_MMI   0x00400041

◆ RI_RESOURCE_MANAGER

#define RI_RESOURCE_MANAGER   0x00010041

◆ SIZE_INDICATOR

#define SIZE_INDICATOR   0x80

Definition at line 40 of file ci.c.

Referenced by GetLength(), and SetLength().

◆ SS_NOT_ALLOCATED

#define SS_NOT_ALLOCATED   0xF0

Definition at line 665 of file ci.c.

Referenced by cCiTransportConnection::CloseSession().

◆ SS_OK

#define SS_OK   0x00

◆ ST_CLOSE_SESSION_REQUEST

#define ST_CLOSE_SESSION_REQUEST   0x95

Definition at line 659 of file ci.c.

Referenced by cCiTransportConnection::HandleSessions().

◆ ST_CLOSE_SESSION_RESPONSE

#define ST_CLOSE_SESSION_RESPONSE   0x96

◆ ST_CREATE_SESSION

#define ST_CREATE_SESSION   0x93

Definition at line 657 of file ci.c.

◆ ST_CREATE_SESSION_RESPONSE

#define ST_CREATE_SESSION_RESPONSE   0x94

Definition at line 658 of file ci.c.

Referenced by cCiTransportConnection::HandleSessions().

◆ ST_OPEN_SESSION_REQUEST

#define ST_OPEN_SESSION_REQUEST   0x91

Definition at line 655 of file ci.c.

Referenced by cCiTransportConnection::HandleSessions().

◆ ST_OPEN_SESSION_RESPONSE

#define ST_OPEN_SESSION_RESPONSE   0x92

Definition at line 656 of file ci.c.

Referenced by cCiTransportConnection::OpenSession().

◆ ST_SESSION_NUMBER

#define ST_SESSION_NUMBER   0x90

Definition at line 654 of file ci.c.

Referenced by cCiTransportConnection::HandleSessions(), and cCiSession::SendData().

◆ STREAM_TYPE_AUDIO

#define STREAM_TYPE_AUDIO   0x04

Definition at line 2717 of file ci.c.

Referenced by cCamSlot::AddChannel(), and cCamSlot::CanDecrypt().

◆ STREAM_TYPE_PRIVATE

#define STREAM_TYPE_PRIVATE   0x06

Definition at line 2718 of file ci.c.

Referenced by cCamSlot::AddChannel(), and cCamSlot::CanDecrypt().

◆ STREAM_TYPE_VIDEO

#define STREAM_TYPE_VIDEO   0x02

Definition at line 2716 of file ci.c.

Referenced by cCamSlot::AddChannel(), and cCamSlot::CanDecrypt().

◆ T_CREATE_TC

#define T_CREATE_TC   0x82

Definition at line 495 of file ci.c.

Referenced by cTPDU::cTPDU(), and cCiTransportConnection::Process().

◆ T_CTC_REPLY

#define T_CTC_REPLY   0x83

Definition at line 496 of file ci.c.

Referenced by cTPDU::cTPDU(), and cCiTransportConnection::Process().

◆ T_DATA_LAST

#define T_DATA_LAST   0xA0

◆ T_DATA_MORE

#define T_DATA_MORE   0xA1

Definition at line 503 of file ci.c.

Referenced by cTPDU::cTPDU(), and cCiTransportConnection::Process().

◆ T_DELETE_TC

#define T_DELETE_TC   0x84

Definition at line 497 of file ci.c.

Referenced by cTPDU::cTPDU(), and cCiTransportConnection::Process().

◆ T_DTC_REPLY

#define T_DTC_REPLY   0x85

Definition at line 498 of file ci.c.

Referenced by cTPDU::cTPDU(), and cCiTransportConnection::Process().

◆ T_NEW_TC

#define T_NEW_TC   0x87

Definition at line 500 of file ci.c.

Referenced by cTPDU::cTPDU(), and cCiTransportConnection::Process().

◆ T_RCV

#define T_RCV   0x81

Definition at line 494 of file ci.c.

Referenced by cTPDU::cTPDU(), and cCiTransportConnection::Process().

◆ T_REQUEST_TC

#define T_REQUEST_TC   0x86

Definition at line 499 of file ci.c.

Referenced by cTPDU::cTPDU(), and cCiTransportConnection::Process().

◆ T_SB

#define T_SB   0x80

Definition at line 493 of file ci.c.

Referenced by cTPDU::Dump(), cCiTransportConnection::Process(), and cTPDU::Status().

◆ T_TC_ERROR

#define T_TC_ERROR   0x88

Definition at line 501 of file ci.c.

Referenced by cTPDU::cTPDU(), and cCiTransportConnection::Process().

◆ TC_ALIVE_TIMEOUT

#define TC_ALIVE_TIMEOUT   2000

◆ TC_POLL_TIMEOUT

#define TC_POLL_TIMEOUT   300

Definition at line 1808 of file ci.c.

Referenced by cCiTransportConnection::SendTPDU().

◆ TS_PACKET_FACTOR

#define TS_PACKET_FACTOR   1024

Definition at line 309 of file ci.c.

Referenced by cCaActivationReceiver::Receive().

◆ UNSCRAMBLE_TIME

#define UNSCRAMBLE_TIME   5

Definition at line 308 of file ci.c.

Referenced by cCaActivationReceiver::Receive().

Function Documentation

◆ CamResponsesLoad()

bool CamResponsesLoad ( const char * FileName,
bool AllowComments,
bool MustExist )

Definition at line 481 of file ci.c.

References CamResponses, and cConfig< T >::Load().

Referenced by main().

◆ CopyString()

static char * CopyString ( int Length,
const uint8_t * Data )
static
Parameters
DataCopies the string at Data. Returns a pointer to a newly allocated string.

Definition at line 77 of file ci.c.

References MALLOC.

Referenced by GetString(), and cCiMMI::Process().

◆ GetLength()

static const uint8_t * GetLength ( const uint8_t * Data,
int & Length )
static
Parameters
LengthGets the length field from the beginning of Data. Returns a pointer to the first byte after the length and stores the length value in Length.

Definition at line 42 of file ci.c.

References SIZE_INDICATOR.

Referenced by cTPDU::GetData(), cCiSession::GetData(), and GetString().

◆ GetString()

static char * GetString ( int & Length,
const uint8_t ** Data )
static
Parameters
DataGets the string at Data. Returns a pointer to a newly allocated string, or NULL in case of error. Upon return Length and Data represent the remaining data after the string has been skipped.

Definition at line 96 of file ci.c.

References CopyString(), and GetLength().

Referenced by cCiMMI::GetText(), and cCiApplicationInformation::Process().

◆ MtdMapCaDescriptor()

static int MtdMapCaDescriptor ( uchar * p,
cMtdMapper * MtdMapper )
static

Definition at line 1014 of file ci.c.

References SI::CaDescriptorTag, esyslog, and MtdMapPid().

Referenced by MtdMapCaDescriptors().

◆ MtdMapCaDescriptors()

static int MtdMapCaDescriptors ( uchar * p,
cMtdMapper * MtdMapper )
static

Definition at line 1031 of file ci.c.

References MtdMapCaDescriptor().

Referenced by cCiCaPmt::MtdMapPids(), and MtdMapStream().

◆ MtdMapStream()

static int MtdMapStream ( uchar * p,
cMtdMapper * MtdMapper )
static

Definition at line 1048 of file ci.c.

References MtdMapCaDescriptors(), and MtdMapPid().

Referenced by MtdMapStreams().

◆ MtdMapStreams()

static int MtdMapStreams ( uchar * p,
cMtdMapper * MtdMapper,
int Length )
static

Definition at line 1058 of file ci.c.

References MtdMapStream().

Referenced by cCiCaPmt::MtdMapPids().

◆ SetLength()

static uint8_t * SetLength ( uint8_t * Data,
int Length )
static
Parameters
LengthSets the length field at the beginning of Data. Returns a pointer to the first byte after the length.

Definition at line 57 of file ci.c.

References SIZE_INDICATOR.

Referenced by cTPDU::cTPDU(), and cCiSession::SendData().

Variable Documentation

◆ CamResponses

cCamResponses CamResponses

Definition at line 479 of file ci.c.

Referenced by CamResponsesLoad(), and cCiMMI::Process().

◆ CamSlots

cCamSlots CamSlots

◆ ChannelCamRelations

cChannelCamRelations ChannelCamRelations

◆ CiResourceHandlers

cCiResourceHandlers CiResourceHandlers

Definition at line 1777 of file ci.c.

Referenced by main(), cCiTransportConnection::OpenSession(), and cCiResourceManager::Process().

◆ DebugProtocol

bool DebugProtocol = false
static

Definition at line 32 of file ci.c.

◆ DumpDateTime

bool DumpDateTime = false
static

Definition at line 34 of file ci.c.

Referenced by cCiDateTime::SendDateTime().

◆ DumpPolls

bool DumpPolls = false
static

Definition at line 33 of file ci.c.

Referenced by cTPDU::Dump(), and cCiTransportConnection::Poll().

◆ DumpTPDUDataTransfer

bool DumpTPDUDataTransfer = false
static

Definition at line 31 of file ci.c.

Referenced by cTPDU::Dump(), cCiTransportConnection::Poll(), and cCiDateTime::SendDateTime().