vdr 2.8.3
ci.h
Go to the documentation of this file.
1/*
2 * ci.h: Common Interface
3 *
4 * See the main source file 'vdr.c' for copyright information and
5 * how to reach the author.
6 *
7 * $Id: ci.h 5.2 2026/03/02 14:03:51 kls Exp $
8 */
9
10#ifndef __CI_H
11#define __CI_H
12
13#include <atomic>
14#include <stdint.h>
15#include <stdio.h>
16#include "channels.h"
17#include "ringbuffer.h"
18#include "thread.h"
19#include "tools.h"
20
21#define MAX_CAM_SLOTS_PER_ADAPTER 32 // maximum possible value is 255 (same value as MAXDEVICES!)
22#define MAX_CONNECTIONS_PER_CAM_SLOT 8 // maximum possible value is 254
23#define CAM_READ_TIMEOUT 50 // ms
24
26class cCamSlot;
27
28// VDR's Common Interface functions implement only the features that are absolutely
29// necessary to control a CAM. If a plugin wants to implement additional functionality
30// (i.e. "resources"), it can do so by deriving from cCiResourceHandler, cCiSession
31// and (if necessary) from cCiApplicationInformation.
32
34private:
35 uint16_t sessionId;
36 uint32_t resourceId;
38protected:
39 void SetTsPostProcessor(void);
42 void SetResourceId(uint32_t Id);
46 int GetTag(int &Length, const uint8_t **Data);
47 const uint8_t *GetData(const uint8_t *Data, int &Length);
48 void SendData(int Tag, int Length = 0, const uint8_t *Data = NULL);
49 cCiTransportConnection *Tc(void) { return tc; }
50public:
52 virtual ~cCiSession();
53 uint16_t SessionId(void) { return sessionId; }
54 uint32_t ResourceId(void) { return resourceId; }
55 cCamSlot *CamSlot(void);
56 virtual bool HasUserIO(void) { return false; }
57 virtual void Process(int Length = 0, const uint8_t *Data = NULL);
58 virtual bool TsPostProcess(uint8_t *TsPacket) { return false; }
67 };
68
70protected:
71 int state;
76public:
78 virtual ~cCiApplicationInformation() override;
79 virtual void Process(int Length = 0, const uint8_t *Data = NULL) override;
80 bool EnterMenu(void);
81 const char *GetMenuString(void) { return menuString; }
82 };
83
85public:
92 virtual ~cCiResourceHandler() override;
93 virtual const uint32_t *ResourceIds(void) const = 0;
96 virtual cCiSession *GetNewCiSession(uint32_t ResourceId, uint16_t SessionId, cCiTransportConnection *Tc) = 0;
98 };
99
100class cCiResourceHandlers : public cList<cCiResourceHandler> {
101private:
103public:
106 void Register(cCiResourceHandler *ResourceHandler);
111 const uint32_t *Ids(void) { return &resourceIds[0]; }
112 int NumIds(void) { return resourceIds.Size(); }
113 cCiSession *GetNewCiSession(uint32_t ResourceId, uint16_t SessionId, cCiTransportConnection *Tc);
114 };
115
117
118class cCiMMI;
119
120class cCiMenu {
121 friend class cCamSlot;
122 friend class cCiMMI;
123private:
124 enum { MAX_CIMENU_ENTRIES = 64 };
133 bool AddEntry(char *s);
134 cCiMenu(cCiMMI *MMI, bool Selectable);
135public:
136 ~cCiMenu();
137 const char *TitleText(void) { return titleText; }
138 const char *SubTitleText(void) { return subTitleText; }
139 const char *BottomText(void) { return bottomText; }
140 const char *Entry(int n) { return n < numEntries ? entries[n] : NULL; }
141 int NumEntries(void) { return numEntries; }
142 bool Selectable(void) { return selectable; }
143 void Select(int Index);
144 void Cancel(void);
145 void Abort(void);
146 bool HasUpdate(void);
147 };
148
150 friend class cCamSlot;
151 friend class cCiMMI;
152private:
155 char *text;
156 bool blind;
158 cCiEnquiry(cCiMMI *MMI);
159public:
160 ~cCiEnquiry();
161 const char *Text(void) { return text; }
162 bool Blind(void) { return blind; }
163 int ExpectedLength(void) { return expectedLength; }
164 void Reply(const char *s);
165 void Cancel(void);
166 void Abort(void);
167 };
168
169class cDevice;
170
172
173class cCiAdapter : public cThread {
174 friend class cCamSlot;
175private:
177 void AddCamSlot(cCamSlot *CamSlot);
179protected:
180 cCamSlot *ItCamSlot(int &Iter);
184 virtual void Action(void) override;
188 virtual int Read(uint8_t *Buffer, int MaxLength) { return 0; }
193 virtual void Write(const uint8_t *Buffer, int Length) {}
195 virtual bool Reset(int Slot) { return false; }
198 virtual eModuleStatus ModuleStatus(int Slot) { return msNone; }
200 virtual bool Assign(cDevice *Device, bool Query = false) { return false; }
209public:
210 cCiAdapter(void);
211 virtual ~cCiAdapter() override;
213 };
214
215class cTPDU;
217class cCiSession;
218class cCiCaProgramData;
219class cCaPidReceiver;
221class cMtdHandler;
222class cMtdMapper;
223class cMtdCamSlot;
224class cCiCaPmt;
225
229 cCiCaPmt *Add(uint8_t CmdId, int Source, int Transponder, int ProgramNumber, const int *CaSystemIds);
230 void Del(cCiCaPmt *CaPmt);
231 };
232
233class cCamSlot : public cListObject {
234 friend class cCiAdapter;
237 friend class cMtdCamSlot;
238private:
240 cMutex assignMutex; // serializes Assign(), which can't hold 'mutex' across its cDevice calls
244 std::atomic<cDevice *> assignedDevice; // Device() reads it without the mutex
249 cCiTransportConnection *tc[MAX_CONNECTIONS_PER_CAM_SLOT + 1]; // connection numbering starts with 1
251 time_t resetTime;
259 void KeepSharedCaPids(int ProgramNumber, const int *CaSystemIds, int *CaPids);
260 void NewConnection(void);
261 void DeleteAllConnections(void);
262 void Process(cTPDU *TPDU = NULL);
263 void Write(cTPDU *TPDU);
264 cCiSession *GetSessionByResourceId(uint32_t ResourceId);
265 void MtdActivate(bool On);
267protected:
268 virtual const int *GetCaSystemIds(void);
269 virtual void SendCaPmt(uint8_t CmdId);
270 virtual bool RepliesToQuery(void);
273 void BuildCaPmts(uint8_t CmdId, cCiCaPmtList &CaPmtList, cMtdMapper *MtdMapper = NULL);
276 void SendCaPmts(cCiCaPmtList &CaPmtList);
278 void MtdEnable(void);
281 int MtdPutData(uchar *Data, int Count);
285public:
286 bool McdAvailable(void) { return RepliesToQuery(); }
288 bool MtdAvailable(void) { return mtdAvailable; }
290 bool MtdActive(void) { return mtdHandler != NULL; }
292public:
293 cCamSlot(cCiAdapter *CiAdapter, bool WantsTsData = false, cCamSlot *MasterSlot = NULL);
307 virtual ~cCamSlot() override;
308 bool IsMasterSlot(void) { return !masterSlot; }
311 cCamSlot *MasterSlot(void) { return masterSlot ? masterSlot : this; }
314 cCamSlot *MtdSpawn(void);
319 void TriggerResendPmt(void) { resendPmt = true; }
321 virtual bool Assign(cDevice *Device, bool Query = false);
334 cDevice *Device(void) { return assignedDevice; }
336 bool Devices(cVector<int> &DeviceNumbers);
340 bool WantsTsData(void) const { return caPidReceiver != NULL; }
343 int SlotIndex(void) { return slotIndex; }
346 int SlotNumber(void) { return slotNumber; }
352 virtual bool Reset(void);
355 virtual bool CanActivate(void);
358 virtual void StartActivation(void);
368 virtual void CancelActivation(void);
370 virtual bool IsActivating(void);
372 virtual eModuleStatus ModuleStatus(void);
374 virtual const char *GetCamName(void);
377 virtual bool Ready(void);
379 virtual bool HasMMI(void);
381 virtual bool HasUserIO(void);
384 virtual bool EnterMenu(void);
386 virtual cCiMenu *GetMenu(void);
388 virtual cCiEnquiry *GetEnquiry(void);
390 int Priority(void);
393 virtual bool ProvidesCa(const int *CaSystemIds);
400 virtual void AddPid(int ProgramNumber, int Pid, int StreamType);
403 virtual void SetPid(int Pid, bool Active);
407 virtual void AddChannel(const cChannel *Channel);
412 virtual bool CanDecrypt(const cChannel *Channel, cMtdMapper *MtdMapper = NULL);
424 virtual void StartDecrypting(void);
430 virtual void StopDecrypting(void);
435 virtual bool IsDecrypting(void);
437 virtual uchar *Decrypt(uchar *Data, int &Count);
475 virtual bool TsPostProcess(uchar *Data);
481 virtual bool Inject(uchar *Data, int Count);
487 virtual void InjectEit(int Sid);
493 };
494
495class cCamSlots : public cList<cCamSlot> {
496public:
497 int NumReadyMasterSlots(void);
500 bool WaitForAllCamSlotsReady(int Timeout = 0);
506 };
507
508extern cCamSlots CamSlots;
509
511
512class cChannelCamRelations : public cList<cChannelCamRelation> {
513private:
519 void Cleanup(void);
520public:
522 void Reset(int CamSlotNumber);
523 bool CamChecked(tChannelID ChannelID, int CamSlotNumber);
524 bool CamDecrypt(tChannelID ChannelID, int CamSlotNumber);
525 void SetChecked(tChannelID ChannelID, int CamSlotNumber);
526 void SetDecrypt(tChannelID ChannelID, int CamSlotNumber);
527 void ClrChecked(tChannelID ChannelID, int CamSlotNumber);
528 void ClrDecrypt(tChannelID ChannelID, int CamSlotNumber);
529 void Load(const char *FileName);
530 void Save(void);
531 };
532
534
535bool CamResponsesLoad(const char *FileName, bool AllowComments = false, bool MustExist = false);
536
537#endif //__CI_H
cChannelCamRelations ChannelCamRelations
Definition ci.c:2960
cCamSlots CamSlots
Definition ci.c:2851
cCiResourceHandlers CiResourceHandlers
Definition ci.c:1777
bool CamResponsesLoad(const char *FileName, bool AllowComments, bool MustExist)
Definition ci.c:481
eModuleStatus
Definition ci.h:171
@ msReady
Definition ci.h:171
@ msPresent
Definition ci.h:171
@ msNone
Definition ci.h:171
@ msReset
Definition ci.h:171
#define MAX_CAM_SLOTS_PER_ADAPTER
Definition ci.h:21
#define MAX_CONNECTIONS_PER_CAM_SLOT
Definition ci.h:22
Definition ci.h:233
bool Devices(cVector< int > &DeviceNumbers)
Adds the numbers of any devices that currently use this CAM to the given DeviceNumbers.
Definition ci.c:2275
virtual bool RepliesToQuery(void)
Returns true if the CAM in this slot replies to queries and thus supports MCD ("Multi Channel Decrypt...
Definition ci.c:2533
cMutex assignMutex
Definition ci.h:240
bool MtdActive(void)
Returns true if MTD is currently active.
Definition ci.h:290
virtual bool IsDecrypting(void)
Returns true if the CAM in this slot is currently used for decrypting.
Definition ci.c:2808
virtual bool Ready(void)
Returns 'true' if the CAM in this slot is ready to decrypt.
Definition ci.c:2464
virtual void InjectEit(int Sid)
Injects a generated EIT with a "present event" for the given Sid into the TS data stream sent to the ...
Definition ci.c:2843
int Priority(void)
Returns the priority of the device this slot is currently assigned to, or IDLEPRIORITY if it is not a...
Definition ci.c:2669
cCamSlot * MasterSlot(void)
Returns this CAM slot's master slot, or a pointer to itself if it is a master slot.
Definition ci.h:311
cMutex mutex
Definition ci.h:239
virtual const char * GetCamName(void)
Returns the name of the CAM in this slot, or NULL if there is no ready CAM in this slot.
Definition ci.c:2458
void DeleteAllConnections(void)
Definition ci.c:2298
friend class cCiTransportConnection
Definition ci.h:235
int source
Definition ci.h:254
friend class cMtdCamSlot
Definition ci.h:237
int slotIndex
Definition ci.h:247
cCiSession * GetSessionByResourceId(uint32_t ResourceId)
Definition ci.c:2373
virtual bool CanDecrypt(const cChannel *Channel, cMtdMapper *MtdMapper=NULL)
Returns true if there is a CAM in this slot that is able to decrypt the given Channel (or at least cl...
Definition ci.c:2753
void KeepSharedCaPids(int ProgramNumber, const int *CaSystemIds, int *CaPids)
Definition ci.c:2579
void TriggerResendPmt(void)
Tells this CAM slot to resend the list of CA_PMTs to the CAM.
Definition ci.h:319
virtual bool Inject(uchar *Data, int Count)
Sends all Count bytes of the given Data to the CAM, and returns true if this was possible.
Definition ci.c:2838
void MtdEnable(void)
Enables MTD support for this CAM.
Definition ci.c:2635
bool McdAvailable(void)
Returns true if this CAM supports MCD ("Multi Channel Decyption").
Definition ci.h:286
virtual bool EnterMenu(void)
Requests the CAM in this slot to start its menu.
Definition ci.c:2481
virtual uchar * Decrypt(uchar *Data, int &Count)
If this is a CAM slot that can be freely assigned to any device, but will not be directly inserted in...
Definition ci.c:2826
virtual void AddPid(int ProgramNumber, int Pid, int StreamType)
Adds the given PID information to the list of PIDs.
Definition ci.c:2692
int MasterSlotNumber(void)
Returns the number of this CAM's master slot within the whole system.
Definition ci.h:349
virtual cCiEnquiry * GetEnquiry(void)
Gets a pending enquiry, or NULL if there is no enquiry.
Definition ci.c:2501
bool mtdAvailable
Definition ci.h:257
void Process(cTPDU *TPDU=NULL)
Definition ci.c:2307
cMtdHandler * mtdHandler
Definition ci.h:258
cCaActivationReceiver * caActivationReceiver
Definition ci.h:246
virtual eModuleStatus ModuleStatus(void)
Returns the status of the CAM in this slot.
Definition ci.c:2444
void MtdActivate(bool On)
Activates (On == true) or deactivates (On == false) MTD.
Definition ci.c:2640
eModuleStatus lastModuleStatus
Definition ci.h:250
cCaPidReceiver * caPidReceiver
Definition ci.h:245
virtual void AddChannel(const cChannel *Channel)
Adds all PIDs of the given Channel to the current list of PIDs.
Definition ci.c:2733
void NewConnection(void)
Definition ci.c:2285
bool resendPmt
Definition ci.h:253
int transponder
Definition ci.h:255
virtual bool HasUserIO(void)
Returns true if there is a pending user interaction, which shall be retrieved via GetMenu() or GetEnq...
Definition ci.c:2475
virtual const int * GetCaSystemIds(void)
Definition ci.c:2662
time_t resetTime
Definition ci.h:251
bool WantsTsData(void) const
Returns true if this CAM slot wants to receive the TS data through its Decrypt() function.
Definition ci.h:340
std::atomic< cDevice * > assignedDevice
Definition ci.h:244
virtual bool Assign(cDevice *Device, bool Query=false)
Assigns this CAM slot to the given Device, if this is possible.
Definition ci.c:2221
virtual cCiMenu * GetMenu(void)
Gets a pending menu, or NULL if there is no menu.
Definition ci.c:2488
cTimeMs moduleCheckTimer
Definition ci.h:252
virtual void SendCaPmt(uint8_t CmdId)
Definition ci.c:2627
cDevice * Device(void)
Returns the device this CAM slot is currently assigned to.
Definition ci.h:334
cCondVar processed
Definition ci.h:241
virtual bool Reset(void)
Resets the CAM in this slot.
Definition ci.c:2388
int slotNumber
Definition ci.h:248
virtual void SetPid(int Pid, bool Active)
Sets the given Pid (which has previously been added through a call to AddPid()) to Active.
Definition ci.c:2710
virtual void StartActivation(void)
Puts the CAM in this slot into a mode where an inserted smart card can be activated.
Definition ci.c:2411
virtual void StartDecrypting(void)
Sends all CA_PMT entries to the CAM that have been modified since the last call to this function.
Definition ci.c:2789
virtual bool IsActivating(void)
Returns true if this CAM slot is currently activating a smart card.
Definition ci.c:2437
friend class cCiConditionalAccessSupport
Definition ci.h:236
bool MtdAvailable(void)
Returns true if this CAM supports MTD ("Multi Transponder Decryption").
Definition ci.h:288
cCiTransportConnection * tc[MAX_CONNECTIONS_PER_CAM_SLOT+1]
Definition ci.h:249
virtual bool TsPostProcess(uchar *Data)
If there is a cCiSession that needs to do additional processing on TS packets (after the CAM has done...
Definition ci.c:2833
int MtdPutData(uchar *Data, int Count)
Sends at most Count bytes of the given Data to the individual MTD CAM slots that are using this CAM.
Definition ci.c:2657
void Write(cTPDU *TPDU)
Definition ci.c:2379
int SlotIndex(void)
Returns the index of this CAM slot within its CI adapter.
Definition ci.h:343
cCiAdapter * ciAdapter
Definition ci.h:242
cList< cCiCaProgramData > caProgramList
Definition ci.h:256
virtual void StopDecrypting(void)
Clears the list of CA_PMT entries and tells the CAM to stop decrypting.
Definition ci.c:2794
void SendCaPmts(cCiCaPmtList &CaPmtList)
Sends the given list of CA_PMTs to the CAM.
Definition ci.c:2616
virtual bool HasMMI(void)
Returns 'true' if the CAM in this slot has an active MMI.
Definition ci.c:2470
virtual bool CanActivate(void)
Returns true if there is a CAM in this slot that can be put into activation mode.
Definition ci.c:2406
cCamSlot(cCiAdapter *CiAdapter, bool WantsTsData=false, cCamSlot *MasterSlot=NULL)
Creates a new CAM slot for the given CiAdapter.
Definition ci.c:2178
cCamSlot * MtdSpawn(void)
If this CAM slot can do MTD ("Multi Transponder Decryption"), a call to this function returns a cMtdC...
Definition ci.c:2213
cCamSlot * masterSlot
Definition ci.h:243
void BuildCaPmts(uint8_t CmdId, cCiCaPmtList &CaPmtList, cMtdMapper *MtdMapper=NULL)
Generates all CA_PMTs with the given CmdId and stores them in the given CaPmtList.
Definition ci.c:2540
int SlotNumber(void)
Returns the number of this CAM slot within the whole system.
Definition ci.h:346
friend class cCiAdapter
Definition ci.h:234
bool IsMasterSlot(void)
Returns true if this CAM slot itself is a master slot (which means that it doesn't have a pointer to ...
Definition ci.h:308
virtual void CancelActivation(void)
Cancels a previously started activation (if any).
Definition ci.c:2426
virtual bool ProvidesCa(const int *CaSystemIds)
Returns true if the CAM in this slot provides one of the given CaSystemIds.
Definition ci.c:2677
bool WaitForAllCamSlotsReady(int Timeout=0)
Waits until all CAM slots have become ready, or the given Timeout (seconds) has expired.
Definition ci.c:2863
int NumReadyMasterSlots(void)
Returns the number of master CAM slots in the system that are ready to decrypt.
Definition ci.c:2853
void ClrDecrypt(tChannelID ChannelID, int CamSlotNumber)
Definition ci.c:3048
void Load(const char *FileName)
Definition ci.c:3056
void SetChecked(tChannelID ChannelID, int CamSlotNumber)
Definition ci.c:3024
bool CamDecrypt(tChannelID ChannelID, int CamSlotNumber)
Definition ci.c:3017
cChannelCamRelations(void)
Definition ci.c:2962
void Cleanup(void)
Definition ci.c:2967
bool CamChecked(tChannelID ChannelID, int CamSlotNumber)
Definition ci.c:3010
time_t lastCleanup
Definition ci.h:518
cChannelCamRelation * GetEntry(tChannelID ChannelID)
Definition ci.c:2981
cChannelCamRelation * AddEntry(tChannelID ChannelID)
Definition ci.c:2992
void SetDecrypt(tChannelID ChannelID, int CamSlotNumber)
Definition ci.c:3032
cString fileName
Definition ci.h:515
void ClrChecked(tChannelID ChannelID, int CamSlotNumber)
Definition ci.c:3040
void Save(void)
Definition ci.c:3090
void Reset(int CamSlotNumber)
Definition ci.c:3001
cCamSlot * camSlots[MAX_CAM_SLOTS_PER_ADAPTER]
Definition ci.h:176
virtual bool Reset(int Slot)
Resets the CAM in the given Slot.
Definition ci.h:195
cCiAdapter(void)
Definition ci.c:2115
virtual eModuleStatus ModuleStatus(int Slot)
Returns the status of the CAM in the given Slot.
Definition ci.h:198
cCamSlot * ItCamSlot(int &Iter)
Iterates over all added CAM slots of this adapter.
Definition ci.c:2143
virtual bool Assign(cDevice *Device, bool Query=false)
Assigns this adapter to the given Device, if this is possible.
Definition ci.h:200
friend class cCamSlot
Definition ci.h:174
void AddCamSlot(cCamSlot *CamSlot)
Adds the given CamSlot to this CI adapter.
Definition ci.c:2129
virtual void Action(void) override
Handles the attached CAM slots in a separate thread.
Definition ci.c:2154
virtual void Write(const uint8_t *Buffer, int Length)
Writes Length bytes of the given Buffer.
Definition ci.h:193
virtual int Read(uint8_t *Buffer, int MaxLength)
Reads one chunk of data into the given Buffer, up to MaxLength bytes.
Definition ci.h:188
const char * GetMenuString(void)
Definition ci.h:81
virtual void Process(int Length=0, const uint8_t *Data=NULL) override
Definition ci.c:872
uint16_t manufacturerCode
Definition ci.h:74
cCiApplicationInformation(uint16_t SessionId, cCiTransportConnection *Tc)
Definition ci.c:859
bool EnterMenu(void)
Definition ci.c:905
uint8_t applicationType
Definition ci.h:72
uint16_t applicationManufacturer
Definition ci.h:73
Definition ci.c:935
friend class cCiMMI
Definition ci.h:151
void Cancel(void)
Definition ci.c:1718
int ExpectedLength(void)
Definition ci.h:163
cCiEnquiry(cCiMMI *MMI)
Definition ci.c:1694
cCiMMI * mmi
Definition ci.h:153
char * text
Definition ci.h:155
const char * Text(void)
Definition ci.h:161
bool Blind(void)
Definition ci.h:162
cMutex * mutex
Definition ci.h:154
void Abort(void)
Definition ci.c:1723
void Reply(const char *s)
Definition ci.c:1711
friend class cCamSlot
Definition ci.h:150
bool blind
Definition ci.h:156
int expectedLength
Definition ci.h:157
Definition ci.c:1405
Definition ci.h:120
bool selectable
Definition ci.h:127
void Abort(void)
Definition ci.c:1685
char * bottomText
Definition ci.h:130
bool HasUpdate(void)
Definition ci.c:1667
friend class cCiMMI
Definition ci.h:122
const char * TitleText(void)
Definition ci.h:137
const char * BottomText(void)
Definition ci.h:139
int NumEntries(void)
Definition ci.h:141
char * subTitleText
Definition ci.h:129
cMutex * mutex
Definition ci.h:126
void Cancel(void)
Definition ci.c:1680
bool Selectable(void)
Definition ci.h:142
int numEntries
Definition ci.h:132
bool AddEntry(char *s)
Definition ci.c:1658
const char * SubTitleText(void)
Definition ci.h:138
cCiMenu(cCiMMI *MMI, bool Selectable)
Definition ci.c:1637
friend class cCamSlot
Definition ci.h:121
void Select(int Index)
Definition ci.c:1673
char * titleText
Definition ci.h:128
@ MAX_CIMENU_ENTRIES
Definition ci.h:124
const char * Entry(int n)
Definition ci.h:140
cCiMMI * mmi
Definition ci.h:125
char * entries[MAX_CIMENU_ENTRIES]
Definition ci.h:131
cCiResourceHandler(void)
Creates a new resource handler, through which the available resources can be provides.
Definition ci.c:1732
virtual const uint32_t * ResourceIds(void) const =0
Returns a pointer to an array of resource identifiers, where the last value is zero.
virtual cCiSession * GetNewCiSession(uint32_t ResourceId, uint16_t SessionId, cCiTransportConnection *Tc)=0
Returns a new cCiSession, according to the given ResourceId.
cCiResourceHandlers(void)
Creates the default list of resourceIds.
Definition ci.c:1779
int NumIds(void)
Definition ci.h:112
cVector< uint32_t > resourceIds
Definition ci.h:102
const uint32_t * Ids(void)
Definition ci.h:111
void Register(cCiResourceHandler *ResourceHandler)
Adds the given ResourceHandler to the list of resource handlers and appends its ResourceIds to the gl...
Definition ci.c:1784
cCiSession * GetNewCiSession(uint32_t ResourceId, uint16_t SessionId, cCiTransportConnection *Tc)
Definition ci.c:1797
uint16_t SessionId(void)
Definition ci.h:53
int GetTag(int &Length, const uint8_t **Data)
Definition ci.c:750
void SendData(int Tag, int Length=0, const uint8_t *Data=NULL)
Definition ci.c:771
cCiTransportConnection * tc
Definition ci.h:37
uint32_t resourceId
Definition ci.h:36
cCiSession(uint16_t SessionId, uint32_t ResourceId, cCiTransportConnection *Tc)
Definition ci.c:729
void SetResourceId(uint32_t Id)
If this is a class that has been derived from an existing cCiSession class, but implements a differen...
Definition ci.c:740
uint32_t ResourceId(void)
Definition ci.h:54
virtual bool TsPostProcess(uint8_t *TsPacket)
If this cCiSession needs to do additional processing on TS packets (after the CAM has done the decryp...
Definition ci.h:58
cCamSlot * CamSlot(void)
Definition ci.c:793
const uint8_t * GetData(const uint8_t *Data, int &Length)
Definition ci.c:765
virtual bool HasUserIO(void)
Definition ci.h:56
void SetTsPostProcessor(void)
If this cCiSession implements the TsPostProcess() function, it shall call SetTsPostProcessor() to reg...
Definition ci.c:745
uint16_t sessionId
Definition ci.h:35
virtual void Process(int Length=0, const uint8_t *Data=NULL)
Definition ci.c:798
cCiTransportConnection * Tc(void)
Definition ci.h:49
cListObject(const cListObject &ListObject)
Definition tools.h:553
Definition tools.h:650
cList(const char *NeedsLocking=NULL)
Definition tools.h:652
Definition ci.c:505
cThread(const char *Description=NULL, bool LowPriority=false)
Creates a new thread.
Definition thread.c:264
int Size(void) const
Definition tools.h:773
void Del(cCiCaPmt *CaPmt)
Definition ci.c:2527
cVector< cCiCaPmt * > caPmts
Definition ci.h:227
cCiCaPmt * Add(uint8_t CmdId, int Source, int Transponder, int ProgramNumber, const int *CaSystemIds)
Definition ci.c:2520
unsigned char uchar
Definition tools.h:31