vdr
2.2.0
|
#include "ci.h"
#include <ctype.h>
#include <linux/dvb/ca.h>
#include <malloc.h>
#include <netinet/in.h>
#include <poll.h>
#include <string.h>
#include <sys/ioctl.h>
#include <time.h>
#include <unistd.h>
#include "device.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 | cTPDU |
class | cCiTransportConnection |
class | cCiSession |
class | cCiResourceManager |
class | cCiApplicationInformation |
class | cCiCaPmt |
class | cCiConditionalAccessSupport |
class | cCiDateTime |
class | cCiMMI |
class | cCiCaPidData |
class | cCiCaProgramData |
class | cChannelCamRelation |
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) |
Variables | |
static bool | DumpTPDUDataTransfer = false |
static bool | DebugProtocol = false |
static bool | DumpPolls = false |
static bool | DumpDateTime = false |
cCamSlots | CamSlots |
cChannelCamRelations | ChannelCamRelations |
#define AI_ANSWER 0x01 |
Definition at line 1107 of file ci.c.
Referenced by cCiMMI::SendAnswer().
#define AI_CANCEL 0x00 |
Definition at line 1106 of file ci.c.
Referenced by cCiMMI::SendAnswer().
#define AOT_ANSW 0x9F8808 |
Definition at line 500 of file ci.c.
Referenced by cCiMMI::SendAnswer().
#define AOT_APPLICATION_INFO 0x9F8021 |
Definition at line 480 of file ci.c.
Referenced by cCiApplicationInformation::Process().
#define AOT_APPLICATION_INFO_ENQ 0x9F8020 |
Definition at line 479 of file ci.c.
Referenced by cCiApplicationInformation::Process().
#define AOT_CA_INFO 0x9F8031 |
Definition at line 483 of file ci.c.
Referenced by cCiConditionalAccessSupport::Process().
#define AOT_CA_INFO_ENQ 0x9F8030 |
Definition at line 482 of file ci.c.
Referenced by cCiConditionalAccessSupport::Process().
#define AOT_CA_PMT 0x9F8032 |
Definition at line 484 of file ci.c.
Referenced by cCiConditionalAccessSupport::SendPMT().
#define AOT_CA_PMT_REPLY 0x9F8033 |
Definition at line 485 of file ci.c.
Referenced by cCiConditionalAccessSupport::Process().
#define AOT_CLOSE_MMI 0x9F8800 |
Definition at line 492 of file ci.c.
Referenced by cCiMMI::Process(), and cCiMMI::SendCloseMMI().
#define AOT_DATE_TIME 0x9F8441 |
Definition at line 491 of file ci.c.
Referenced by cCiDateTime::SendDateTime().
#define AOT_DATE_TIME_ENQ 0x9F8440 |
Definition at line 490 of file ci.c.
Referenced by cCiDateTime::Process().
#define AOT_DISPLAY_CONTROL 0x9F8801 |
Definition at line 493 of file ci.c.
Referenced by cCiMMI::Process().
#define AOT_DISPLAY_REPLY 0x9F8802 |
Definition at line 494 of file ci.c.
Referenced by cCiMMI::Process().
#define AOT_ENQ 0x9F8807 |
Definition at line 499 of file ci.c.
Referenced by cCiMMI::Process().
#define AOT_ENTER_MENU 0x9F8022 |
Definition at line 481 of file ci.c.
Referenced by cCiApplicationInformation::EnterMenu().
#define AOT_LIST_LAST 0x9F880C |
Definition at line 504 of file ci.c.
Referenced by cCiMMI::Process().
#define AOT_MENU_ANSW 0x9F880B |
Definition at line 503 of file ci.c.
Referenced by cCiMMI::SendMenuAnswer().
#define AOT_MENU_LAST 0x9F8809 |
Definition at line 501 of file ci.c.
Referenced by cCiMMI::Process().
#define AOT_NONE 0x000000 |
Definition at line 475 of file ci.c.
Referenced by cCiSession::GetTag().
#define AOT_PROFILE 0x9F8011 |
Definition at line 477 of file ci.c.
Referenced by cCiResourceManager::Process().
#define AOT_PROFILE_CHANGE 0x9F8012 |
Definition at line 478 of file ci.c.
Referenced by cCiResourceManager::Process().
#define AOT_PROFILE_ENQ 0x9F8010 |
Definition at line 476 of file ci.c.
Referenced by cCiResourceManager::Process().
#define AOT_TEXT_LAST 0x9F8803 |
Definition at line 495 of file ci.c.
Referenced by cCiMMI::GetText().
#define CA_ENABLE | ( | x | ) | (((x) & CA_ENABLE_FLAG) ? (x) & ~CA_ENABLE_FLAG : 0) |
Definition at line 854 of file ci.c.
Referenced by cCiConditionalAccessSupport::Process().
#define CAEI_POSSIBLE 0x01 |
Definition at line 846 of file ci.c.
Referenced by cCiConditionalAccessSupport::Process().
#define CAM_CHECKED_TIMEOUT 15 |
Definition at line 2260 of file ci.c.
Referenced by cChannelCamRelation::CamChecked(), and cChannelCamRelation::TimedOut().
#define CHANNEL_CAM_RELATIONS_CLEANUP_INTERVAL 3600 |
Definition at line 2333 of file ci.c.
Referenced by cChannelCamRelations::Cleanup().
#define CPCI_NOT_SELECTED 0x04 |
Definition at line 753 of file ci.c.
Referenced by cCamSlot::StopDecrypting().
#define CPCI_OK_DESCRAMBLING 0x01 |
Definition at line 750 of file ci.c.
Referenced by cCamSlot::Process(), and cCamSlot::StartDecrypting().
#define CPCI_QUERY 0x03 |
Definition at line 752 of file ci.c.
Referenced by cCiCaPmt::AddCaDescriptors(), cCamSlot::CanDecrypt(), and cCiConditionalAccessSupport::Process().
#define CPLM_ADD 0x04 |
Definition at line 745 of file ci.c.
Referenced by cCamSlot::CanDecrypt(), and cCamSlot::SendCaPmt().
#define CPLM_ONLY 0x03 |
Definition at line 744 of file ci.c.
Referenced by cCiCaPmt::cCiCaPmt().
#define CPLM_UPDATE 0x05 |
Definition at line 746 of file ci.c.
Referenced by cCamSlot::SendCaPmt().
#define DATA_INDICATOR 0x80 |
Definition at line 292 of file ci.c.
Referenced by cCiTransportConnection::Process().
#define dbgprotocol | ( | a... | ) | do { if (DebugProtocol) fprintf(stderr, a); } while (0) |
Definition at line 34 of file ci.c.
Referenced by cCiApplicationInformation::cCiApplicationInformation(), cCiConditionalAccessSupport::cCiConditionalAccessSupport(), cCiDateTime::cCiDateTime(), cCiMMI::cCiMMI(), cCiResourceManager::cCiResourceManager(), cCiTransportConnection::cCiTransportConnection(), cCiTransportConnection::CloseSession(), cCiApplicationInformation::EnterMenu(), cCiMMI::GetText(), cCiTransportConnection::OpenSession(), cCiTransportConnection::Poll(), cCamSlot::Process(), cCiTransportConnection::Process(), cCiResourceManager::Process(), cCiApplicationInformation::Process(), cCiConditionalAccessSupport::Process(), cCiDateTime::Process(), cCiMMI::Process(), cCamSlot::Reset(), cCiMMI::SendAnswer(), cCiMMI::SendCloseMMI(), cCiDateTime::SendDateTime(), cCiMMI::SendMenuAnswer(), and cCiConditionalAccessSupport::SendPMT().
#define DCC_SET_MMI_MODE 0x01 |
Definition at line 1077 of file ci.c.
Referenced by cCiMMI::Process().
#define DEC2BCD | ( | d | ) | uint8_t(((d / 10) << 4) + (d % 10)) |
Referenced by cCiDateTime::SendDateTime().
#define DRI_MMI_MODE_ACK 0x01 |
Definition at line 1091 of file ci.c.
Referenced by cCiMMI::Process().
#define EF_BLIND 0x01 |
Definition at line 1102 of file ci.c.
Referenced by cCiMMI::Process().
#define MAX_DUMP 256 |
Referenced by cTPDU::Dump().
#define MAX_SESSIONS_PER_TC 16 |
Definition at line 410 of file ci.c.
Referenced by cCiTransportConnection::cCiTransportConnection(), cCiTransportConnection::GetSessionByResourceId(), cCiTransportConnection::GetSessionBySessionId(), cCiTransportConnection::OpenSession(), cCiTransportConnection::Process(), and cCiTransportConnection::~cCiTransportConnection().
#define MAX_TPDU_DATA (MAX_TPDU_SIZE - 4) |
Definition at line 290 of file ci.c.
Referenced by cTPDU::cTPDU().
#define MAXCASYSTEMIDS 64 |
Definition at line 737 of file ci.c.
Referenced by cCiConditionalAccessSupport::Process().
#define MM_HIGH_LEVEL 0x01 |
Definition at line 1085 of file ci.c.
Referenced by cCiMMI::Process().
#define MODULE_CHECK_INTERVAL 500 |
Definition at line 1739 of file ci.c.
Referenced by cCamSlot::Process().
#define MODULE_RESET_TIMEOUT 2 |
Definition at line 1740 of file ci.c.
Referenced by cCamSlot::ModuleStatus().
#define QUERY_REPLY_TIMEOUT 2000 |
Definition at line 857 of file ci.c.
Referenced by cCamSlot::CanDecrypt(), and cCiConditionalAccessSupport::Process().
#define QUERY_REPLY_WAIT 100 |
Definition at line 2163 of file ci.c.
Referenced by cCamSlot::CanDecrypt().
#define QUERY_WAIT_TIME 1000 |
Definition at line 856 of file ci.c.
Referenced by cCiConditionalAccessSupport::Process().
#define RI_APPLICATION_INFORMATION 0x00020041 |
Definition at line 467 of file ci.c.
Referenced by cCamSlot::EnterMenu(), cCiTransportConnection::GetCamName(), cCiTransportConnection::OpenSession(), and cCiResourceManager::Process().
#define RI_CONDITIONAL_ACCESS_SUPPORT 0x00030041 |
Definition at line 468 of file ci.c.
Referenced by cCamSlot::CanDecrypt(), cCamSlot::GetCaSystemIds(), cCiTransportConnection::OpenSession(), cCiResourceManager::Process(), cCamSlot::ProvidesCa(), cCiTransportConnection::Ready(), and cCamSlot::SendCaPmt().
#define RI_DATE_TIME 0x00240041 |
Definition at line 470 of file ci.c.
Referenced by cCiTransportConnection::OpenSession(), and cCiResourceManager::Process().
#define RI_HOST_CONTROL 0x00200041 |
Definition at line 469 of file ci.c.
Referenced by cCiTransportConnection::OpenSession().
#define RI_MMI 0x00400041 |
Definition at line 471 of file ci.c.
Referenced by cCamSlot::GetEnquiry(), cCamSlot::GetMenu(), cCamSlot::HasMMI(), cCiTransportConnection::OpenSession(), and cCiResourceManager::Process().
#define RI_RESOURCE_MANAGER 0x00010041 |
Definition at line 466 of file ci.c.
Referenced by cCiTransportConnection::OpenSession(), and cCiResourceManager::Process().
#define SIZE_INDICATOR 0x80 |
Definition at line 38 of file ci.c.
Referenced by GetLength(), and SetLength().
#define SS_NOT_ALLOCATED 0xF0 |
Definition at line 462 of file ci.c.
Referenced by cCiTransportConnection::CloseSession().
#define SS_OK 0x00 |
Definition at line 461 of file ci.c.
Referenced by cCiTransportConnection::CloseSession(), and cCiTransportConnection::OpenSession().
#define ST_CLOSE_SESSION_REQUEST 0x95 |
Definition at line 456 of file ci.c.
Referenced by cCiTransportConnection::HandleSessions().
#define ST_CLOSE_SESSION_RESPONSE 0x96 |
Definition at line 457 of file ci.c.
Referenced by cCiTransportConnection::CloseSession(), and cCiTransportConnection::HandleSessions().
#define ST_CREATE_SESSION_RESPONSE 0x94 |
Definition at line 455 of file ci.c.
Referenced by cCiTransportConnection::HandleSessions().
#define ST_OPEN_SESSION_REQUEST 0x91 |
Definition at line 452 of file ci.c.
Referenced by cCiTransportConnection::HandleSessions().
#define ST_OPEN_SESSION_RESPONSE 0x92 |
Definition at line 453 of file ci.c.
Referenced by cCiTransportConnection::OpenSession().
#define ST_SESSION_NUMBER 0x90 |
Definition at line 451 of file ci.c.
Referenced by cCiTransportConnection::HandleSessions(), and cCiSession::SendData().
#define STREAM_TYPE_AUDIO 0x04 |
Definition at line 2140 of file ci.c.
Referenced by cCamSlot::AddChannel(), and cCamSlot::CanDecrypt().
#define STREAM_TYPE_PRIVATE 0x06 |
Definition at line 2141 of file ci.c.
Referenced by cCamSlot::AddChannel(), and cCamSlot::CanDecrypt().
#define STREAM_TYPE_VIDEO 0x02 |
Definition at line 2139 of file ci.c.
Referenced by cCamSlot::AddChannel(), and cCamSlot::CanDecrypt().
#define T_CREATE_TC 0x82 |
Definition at line 296 of file ci.c.
Referenced by cTPDU::cTPDU(), and cCiTransportConnection::Process().
#define T_CTC_REPLY 0x83 |
Definition at line 297 of file ci.c.
Referenced by cTPDU::cTPDU(), and cCiTransportConnection::Process().
#define T_DATA_LAST 0xA0 |
Definition at line 303 of file ci.c.
Referenced by cTPDU::cTPDU(), cCiTransportConnection::Poll(), cCiTransportConnection::Process(), and cCiTransportConnection::SendData().
#define T_DATA_MORE 0xA1 |
Definition at line 304 of file ci.c.
Referenced by cTPDU::cTPDU(), and cCiTransportConnection::Process().
#define T_DELETE_TC 0x84 |
Definition at line 298 of file ci.c.
Referenced by cTPDU::cTPDU(), and cCiTransportConnection::Process().
#define T_DTC_REPLY 0x85 |
Definition at line 299 of file ci.c.
Referenced by cTPDU::cTPDU(), and cCiTransportConnection::Process().
#define T_NEW_TC 0x87 |
Definition at line 301 of file ci.c.
Referenced by cTPDU::cTPDU(), and cCiTransportConnection::Process().
#define T_RCV 0x81 |
Definition at line 295 of file ci.c.
Referenced by cTPDU::cTPDU(), and cCiTransportConnection::Process().
#define T_REQUEST_TC 0x86 |
Definition at line 300 of file ci.c.
Referenced by cTPDU::cTPDU(), and cCiTransportConnection::Process().
#define T_SB 0x80 |
Definition at line 294 of file ci.c.
Referenced by cTPDU::Dump(), cCiTransportConnection::Process(), and cTPDU::Status().
#define T_TC_ERROR 0x88 |
Definition at line 302 of file ci.c.
Referenced by cTPDU::cTPDU(), and cCiTransportConnection::Process().
#define TC_ALIVE_TIMEOUT 2000 |
Definition at line 1394 of file ci.c.
Referenced by cCiTransportConnection::cCiTransportConnection(), and cCiTransportConnection::Process().
#define TC_POLL_TIMEOUT 300 |
Definition at line 1393 of file ci.c.
Referenced by cCiTransportConnection::SendTPDU().
#define TS_PACKET_FACTOR 1024 |
Definition at line 246 of file ci.c.
Referenced by cCaActivationReceiver::Receive().
#define UNSCRAMBLE_TIME 5 |
Definition at line 245 of file ci.c.
Referenced by cCaActivationReceiver::Receive().
|
static |
Data | Copies the string at Data. Returns a pointer to a newly allocated string. |
Definition at line 75 of file ci.c.
References MALLOC, and strreplace().
Referenced by GetString(), and cCiMMI::Process().
|
static |
Length | Gets 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 40 of file ci.c.
References SIZE_INDICATOR.
Referenced by cTPDU::GetData(), cCiSession::GetData(), GetString(), and cIndexFile::StoreResume().
|
static |
Data | Gets 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 93 of file ci.c.
References CopyString(), and GetLength().
Referenced by cCiMMI::GetText(), and cCiApplicationInformation::Process().
|
static |
Length | Sets the length field at the beginning of Data. Returns a pointer to the first byte after the length. |
Definition at line 55 of file ci.c.
References SIZE_INDICATOR.
Referenced by cTPDU::cTPDU(), cCiSession::SendData(), and cBitStream::~cBitStream().
cCamSlots CamSlots |
Definition at line 2240 of file ci.c.
Referenced by CamControl(), cCamSlot::cCamSlot(), cMenuSetupCAM::cMenuSetupCAM(), cDevice::GetDevice(), main(), and cCamSlot::~cCamSlot().
cChannelCamRelations ChannelCamRelations |
Definition at line 2335 of file ci.c.
Referenced by cDevice::Action(), cDevice::GetDevice(), cCamSlot::Reset(), cDvbHdFfDevice::SetChannelDevice(), and cDvbSdFfDevice::SetChannelDevice().
|
static |
Definition at line 32 of file ci.c.
Referenced by cCiDateTime::SendDateTime().
|
static |
Definition at line 31 of file ci.c.
Referenced by cTPDU::Dump(), and cCiTransportConnection::Poll().
|
static |
Definition at line 29 of file ci.c.
Referenced by cTPDU::Dump(), cCiTransportConnection::Poll(), and cCiDateTime::SendDateTime().