vdr  2.4.7
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 4.14 2019/05/28 14:58:08 kls Exp $
8  */
9 
10 #ifndef __CI_H
11 #define __CI_H
12 
13 #include <stdint.h>
14 #include <stdio.h>
15 #include "channels.h"
16 #include "ringbuffer.h"
17 #include "thread.h"
18 #include "tools.h"
19 
20 #define MAX_CAM_SLOTS_PER_ADAPTER 16 // maximum possible value is 255 (same value as MAXDEVICES!)
21 #define MAX_CONNECTIONS_PER_CAM_SLOT 8 // maximum possible value is 254
22 #define CAM_READ_TIMEOUT 50 // ms
23 
25 class cCamSlot;
26 
27 // VDR's Common Interface functions implement only the features that are absolutely
28 // necessary to control a CAM. If a plugin wants to implement additional functionality
29 // (i.e. "resources"), it can do so by deriving from cCiResourceHandler, cCiSession
30 // and (if necessary) from cCiApplicationInformation.
31 
32 class cCiSession {
33 private:
34  uint16_t sessionId;
35  uint32_t resourceId;
37 protected:
38  void SetTsPostProcessor(void);
41  void SetResourceId(uint32_t Id);
45  int GetTag(int &Length, const uint8_t **Data);
46  const uint8_t *GetData(const uint8_t *Data, int &Length);
47  void SendData(int Tag, int Length = 0, const uint8_t *Data = NULL);
48  cCiTransportConnection *Tc(void) { return tc; }
49 public:
51  virtual ~cCiSession();
52  uint16_t SessionId(void) { return sessionId; }
53  uint32_t ResourceId(void) { return resourceId; }
54  cCamSlot *CamSlot(void);
55  virtual bool HasUserIO(void) { return false; }
56  virtual void Process(int Length = 0, const uint8_t *Data = NULL);
57  virtual bool TsPostProcess(uint8_t *TsPacket) { return false; }
66  };
67 
69 protected:
70  int state;
71  uint8_t applicationType;
73  uint16_t manufacturerCode;
74  char *menuString;
75 public:
78  virtual void Process(int Length = 0, const uint8_t *Data = NULL);
79  bool EnterMenu(void);
80  const char *GetMenuString(void) { return menuString; }
81  };
82 
84 public:
85  cCiResourceHandler(void);
91  virtual ~cCiResourceHandler();
92  virtual const uint32_t *ResourceIds(void) const = 0;
95  virtual cCiSession *GetNewCiSession(uint32_t ResourceId, uint16_t SessionId, cCiTransportConnection *Tc) = 0;
97  };
98 
99 class cCiResourceHandlers : public cList<cCiResourceHandler> {
100 private:
102 public:
103  cCiResourceHandlers(void);
105  void Register(cCiResourceHandler *ResourceHandler);
110  const uint32_t *Ids(void) { return &resourceIds[0]; }
111  int NumIds(void) { return resourceIds.Size(); }
112  cCiSession *GetNewCiSession(uint32_t ResourceId, uint16_t SessionId, cCiTransportConnection *Tc);
113  };
114 
116 
117 class cCiMMI;
118 
119 class cCiMenu {
120  friend class cCamSlot;
121  friend class cCiMMI;
122 private:
123  enum { MAX_CIMENU_ENTRIES = 64 };
127  char *titleText;
129  char *bottomText;
132  bool AddEntry(char *s);
133  cCiMenu(cCiMMI *MMI, bool Selectable);
134 public:
135  ~cCiMenu();
136  const char *TitleText(void) { return titleText; }
137  const char *SubTitleText(void) { return subTitleText; }
138  const char *BottomText(void) { return bottomText; }
139  const char *Entry(int n) { return n < numEntries ? entries[n] : NULL; }
140  int NumEntries(void) { return numEntries; }
141  bool Selectable(void) { return selectable; }
142  void Select(int Index);
143  void Cancel(void);
144  void Abort(void);
145  bool HasUpdate(void);
146  };
147 
148 class cCiEnquiry {
149  friend class cCamSlot;
150  friend class cCiMMI;
151 private:
154  char *text;
155  bool blind;
157  cCiEnquiry(cCiMMI *MMI);
158 public:
159  ~cCiEnquiry();
160  const char *Text(void) { return text; }
161  bool Blind(void) { return blind; }
162  int ExpectedLength(void) { return expectedLength; }
163  void Reply(const char *s);
164  void Cancel(void);
165  void Abort(void);
166  };
167 
168 class cDevice;
169 
171 
172 class cCiAdapter : public cThread {
173  friend class cCamSlot;
174 private:
176  void AddCamSlot(cCamSlot *CamSlot);
178 protected:
179  cCamSlot *ItCamSlot(int &Iter);
183  virtual void Action(void);
187  virtual int Read(uint8_t *Buffer, int MaxLength) { return 0; }
192  virtual void Write(const uint8_t *Buffer, int Length) {}
194  virtual bool Reset(int Slot) { return false; }
197  virtual eModuleStatus ModuleStatus(int Slot) { return msNone; }
199  virtual bool Assign(cDevice *Device, bool Query = false) { return false; }
208 public:
209  cCiAdapter(void);
210  virtual ~cCiAdapter();
212  };
213 
214 class cTPDU;
216 class cCiSession;
217 class cCiCaProgramData;
218 class cCaPidReceiver;
220 class cMtdHandler;
221 class cMtdMapper;
222 class cMtdCamSlot;
223 class cCiCaPmt;
224 
225 struct cCiCaPmtList {
227  ~cCiCaPmtList();
228  cCiCaPmt *Add(uint8_t CmdId, int Source, int Transponder, int ProgramNumber, const int *CaSystemIds);
229  void Del(cCiCaPmt *CaPmt);
230  };
231 
232 class cCamSlot : public cListObject {
233  friend class cCiAdapter;
236  friend class cMtdCamSlot;
237 private:
247  cCiTransportConnection *tc[MAX_CONNECTIONS_PER_CAM_SLOT + 1]; // connection numbering starts with 1
249  time_t resetTime;
251  bool resendPmt;
252  int source;
257  void KeepSharedCaPids(int ProgramNumber, const int *CaSystemIds, int *CaPids);
258  void NewConnection(void);
259  void DeleteAllConnections(void);
260  void Process(cTPDU *TPDU = NULL);
261  void Write(cTPDU *TPDU);
262  cCiSession *GetSessionByResourceId(uint32_t ResourceId);
263  void MtdActivate(bool On);
265 protected:
266  virtual const int *GetCaSystemIds(void);
267  virtual void SendCaPmt(uint8_t CmdId);
268  virtual bool RepliesToQuery(void);
271  void BuildCaPmts(uint8_t CmdId, cCiCaPmtList &CaPmtList, cMtdMapper *MtdMapper = NULL);
274  void SendCaPmts(cCiCaPmtList &CaPmtList);
276  void MtdEnable(void);
279  int MtdPutData(uchar *Data, int Count);
283 public:
284  bool McdAvailable(void) { return RepliesToQuery(); }
286  bool MtdAvailable(void) { return mtdAvailable; }
288  bool MtdActive(void) { return mtdHandler != NULL; }
290 public:
291  cCamSlot(cCiAdapter *CiAdapter, bool WantsTsData = false, cCamSlot *MasterSlot = NULL);
305  virtual ~cCamSlot();
306  bool IsMasterSlot(void) { return !masterSlot; }
309  cCamSlot *MasterSlot(void) { return masterSlot ? masterSlot : this; }
312  cCamSlot *MtdSpawn(void);
317  void TriggerResendPmt(void) { resendPmt = true; }
319  virtual bool Assign(cDevice *Device, bool Query = false);
332  cDevice *Device(void) { return assignedDevice; }
334  bool Devices(cVector<int> &DeviceNumbers);
338  bool WantsTsData(void) const { return caPidReceiver != NULL; }
341  int SlotIndex(void) { return slotIndex; }
344  int SlotNumber(void) { return slotNumber; }
350  virtual bool Reset(void);
353  virtual bool CanActivate(void);
356  virtual void StartActivation(void);
366  virtual void CancelActivation(void);
368  virtual bool IsActivating(void);
370  virtual eModuleStatus ModuleStatus(void);
372  virtual const char *GetCamName(void);
375  virtual bool Ready(void);
377  virtual bool HasMMI(void);
379  virtual bool HasUserIO(void);
382  virtual bool EnterMenu(void);
384  virtual cCiMenu *GetMenu(void);
386  virtual cCiEnquiry *GetEnquiry(void);
388  int Priority(void);
391  virtual bool ProvidesCa(const int *CaSystemIds);
398  virtual void AddPid(int ProgramNumber, int Pid, int StreamType);
401  virtual void SetPid(int Pid, bool Active);
405  virtual void AddChannel(const cChannel *Channel);
410  virtual bool CanDecrypt(const cChannel *Channel, cMtdMapper *MtdMapper = NULL);
422  virtual void StartDecrypting(void);
428  virtual void StopDecrypting(void);
433  virtual bool IsDecrypting(void);
435  virtual uchar *Decrypt(uchar *Data, int &Count);
473  virtual bool TsPostProcess(uchar *Data);
479  virtual bool Inject(uchar *Data, int Count);
485  virtual void InjectEit(int Sid);
491  };
492 
493 class cCamSlots : public cList<cCamSlot> {
494 public:
495  int NumReadyMasterSlots(void);
498  bool WaitForAllCamSlotsReady(int Timeout = 0);
504  };
505 
506 extern cCamSlots CamSlots;
507 
508 class cChannelCamRelation;
509 
510 class cChannelCamRelations : public cList<cChannelCamRelation> {
511 private:
516  time_t lastCleanup;
517  void Cleanup(void);
518 public:
519  cChannelCamRelations(void);
520  void Reset(int CamSlotNumber);
521  bool CamChecked(tChannelID ChannelID, int CamSlotNumber);
522  bool CamDecrypt(tChannelID ChannelID, int CamSlotNumber);
523  void SetChecked(tChannelID ChannelID, int CamSlotNumber);
524  void SetDecrypt(tChannelID ChannelID, int CamSlotNumber);
525  void ClrChecked(tChannelID ChannelID, int CamSlotNumber);
526  void ClrDecrypt(tChannelID ChannelID, int CamSlotNumber);
527  void Load(const char *FileName);
528  void Save(void);
529  };
530 
532 
533 bool CamResponsesLoad(const char *FileName, bool AllowComments = false, bool MustExist = false);
534 
535 #endif //__CI_H
cChannelCamRelations ChannelCamRelations
Definition: ci.c:2943
eModuleStatus
Definition: ci.h:170
@ msReady
Definition: ci.h:170
@ msPresent
Definition: ci.h:170
@ msNone
Definition: ci.h:170
@ msReset
Definition: ci.h:170
cCamSlots CamSlots
Definition: ci.c:2834
cCiResourceHandlers CiResourceHandlers
Definition: ci.c:1773
#define MAX_CAM_SLOTS_PER_ADAPTER
Definition: ci.h:20
bool CamResponsesLoad(const char *FileName, bool AllowComments=false, bool MustExist=false)
Definition: ci.c:477
#define MAX_CONNECTIONS_PER_CAM_SLOT
Definition: ci.h:21
Definition: ci.h:232
bool Devices(cVector< int > &DeviceNumbers)
Adds the numbers of any devices that currently use this CAM to the given DeviceNumbers.
Definition: ci.c:2258
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:2516
bool MtdActive(void)
Returns true if MTD is currently active.
Definition: ci.h:288
virtual bool IsDecrypting(void)
Returns true if the CAM in this slot is currently used for decrypting.
Definition: ci.c:2791
virtual bool Ready(void)
Returns 'true' if the CAM in this slot is ready to decrypt.
Definition: ci.c:2447
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:2826
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:2652
cMutex mutex
Definition: ci.h:238
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:2441
void DeleteAllConnections(void)
Definition: ci.c:2281
int source
Definition: ci.h:252
int slotIndex
Definition: ci.h:245
cCiSession * GetSessionByResourceId(uint32_t ResourceId)
Definition: ci.c:2356
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:2736
void KeepSharedCaPids(int ProgramNumber, const int *CaSystemIds, int *CaPids)
Definition: ci.c:2562
void TriggerResendPmt(void)
Tells this CAM slot to resend the list of CA_PMTs to the CAM.
Definition: ci.h:317
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:2821
void MtdEnable(void)
Enables MTD support for this CAM.
Definition: ci.c:2618
bool McdAvailable(void)
Returns true if this CAM supports MCD ("Multi Channel Decyption").
Definition: ci.h:284
virtual bool EnterMenu(void)
Requests the CAM in this slot to start its menu.
Definition: ci.c:2464
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:2809
virtual void AddPid(int ProgramNumber, int Pid, int StreamType)
Adds the given PID information to the list of PIDs.
Definition: ci.c:2675
cDevice * assignedDevice
Definition: ci.h:242
int MasterSlotNumber(void)
Returns the number of this CAM's master slot within the whole system.
Definition: ci.h:347
virtual cCiEnquiry * GetEnquiry(void)
Gets a pending enquiry, or NULL if there is no enquiry.
Definition: ci.c:2484
bool mtdAvailable
Definition: ci.h:255
void Process(cTPDU *TPDU=NULL)
Definition: ci.c:2290
cMtdHandler * mtdHandler
Definition: ci.h:256
cCaActivationReceiver * caActivationReceiver
Definition: ci.h:244
virtual eModuleStatus ModuleStatus(void)
Returns the status of the CAM in this slot.
Definition: ci.c:2427
void MtdActivate(bool On)
Activates (On == true) or deactivates (On == false) MTD.
Definition: ci.c:2623
eModuleStatus lastModuleStatus
Definition: ci.h:248
cCaPidReceiver * caPidReceiver
Definition: ci.h:243
virtual void AddChannel(const cChannel *Channel)
Adds all PIDs of the given Channel to the current list of PIDs.
Definition: ci.c:2716
void NewConnection(void)
Definition: ci.c:2268
bool resendPmt
Definition: ci.h:251
int transponder
Definition: ci.h:253
virtual bool HasUserIO(void)
Returns true if there is a pending user interaction, which shall be retrieved via GetMenu() or GetEnq...
Definition: ci.c:2458
virtual const int * GetCaSystemIds(void)
Definition: ci.c:2645
time_t resetTime
Definition: ci.h:249
bool WantsTsData(void) const
Returns true if this CAM slot wants to receive the TS data through its Decrypt() function.
Definition: ci.h:338
virtual bool Assign(cDevice *Device, bool Query=false)
Assigns this CAM slot to the given Device, if this is possible.
Definition: ci.c:2217
virtual cCiMenu * GetMenu(void)
Gets a pending menu, or NULL if there is no menu.
Definition: ci.c:2471
cTimeMs moduleCheckTimer
Definition: ci.h:250
virtual void SendCaPmt(uint8_t CmdId)
Definition: ci.c:2610
cCondVar processed
Definition: ci.h:239
virtual bool Reset(void)
Resets the CAM in this slot.
Definition: ci.c:2371
int slotNumber
Definition: ci.h:246
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:2693
virtual void StartActivation(void)
Puts the CAM in this slot into a mode where an inserted smart card can be activated.
Definition: ci.c:2394
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:2772
virtual bool IsActivating(void)
Returns true if this CAM slot is currently activating a smart card.
Definition: ci.c:2420
bool MtdAvailable(void)
Returns true if this CAM supports MTD ("Multi Transponder Decryption").
Definition: ci.h:286
cCiTransportConnection * tc[MAX_CONNECTIONS_PER_CAM_SLOT+1]
Definition: ci.h:247
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:2816
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:2640
void Write(cTPDU *TPDU)
Definition: ci.c:2362
int SlotIndex(void)
Returns the index of this CAM slot within its CI adapter.
Definition: ci.h:341
cCiAdapter * ciAdapter
Definition: ci.h:240
cList< cCiCaProgramData > caProgramList
Definition: ci.h:254
virtual void StopDecrypting(void)
Clears the list of CA_PMT entries and tells the CAM to stop decrypting.
Definition: ci.c:2777
void SendCaPmts(cCiCaPmtList &CaPmtList)
Sends the given list of CA_PMTs to the CAM.
Definition: ci.c:2599
virtual bool HasMMI(void)
Returns 'true' if the CAM in this slot has an active MMI.
Definition: ci.c:2453
virtual bool CanActivate(void)
Returns true if there is a CAM in this slot that can be put into activation mode.
Definition: ci.c:2389
cCamSlot(cCiAdapter *CiAdapter, bool WantsTsData=false, cCamSlot *MasterSlot=NULL)
Creates a new CAM slot for the given CiAdapter.
Definition: ci.c:2174
cDevice * Device(void)
Returns the device this CAM slot is currently assigned to.
Definition: ci.h:332
cCamSlot * MtdSpawn(void)
If this CAM slot can do MTD ("Multi Transponder Decryption"), a call to this function returns a cMtdC...
Definition: ci.c:2209
cCamSlot * masterSlot
Definition: ci.h:241
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:2523
virtual ~cCamSlot()
Definition: ci.c:2199
cCamSlot * MasterSlot(void)
Returns this CAM slot's master slot, or a pointer to itself if it is a master slot.
Definition: ci.h:309
int SlotNumber(void)
Returns the number of this CAM slot within the whole system.
Definition: ci.h:344
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:306
virtual void CancelActivation(void)
Cancels a previously started activation (if any).
Definition: ci.c:2409
virtual bool ProvidesCa(const int *CaSystemIds)
Returns true if the CAM in this slot provides one of the given CaSystemIds.
Definition: ci.c:2660
Definition: ci.h:493
bool WaitForAllCamSlotsReady(int Timeout=0)
Waits until all CAM slots have become ready, or the given Timeout (seconds) has expired.
Definition: ci.c:2846
int NumReadyMasterSlots(void)
Returns the number of master CAM slots in the system that are ready to decrypt.
Definition: ci.c:2836
void ClrDecrypt(tChannelID ChannelID, int CamSlotNumber)
Definition: ci.c:3031
void Load(const char *FileName)
Definition: ci.c:3039
void SetChecked(tChannelID ChannelID, int CamSlotNumber)
Definition: ci.c:3007
cMutex mutex
Definition: ci.h:512
bool CamDecrypt(tChannelID ChannelID, int CamSlotNumber)
Definition: ci.c:3000
cChannelCamRelations(void)
Definition: ci.c:2945
void Cleanup(void)
Definition: ci.c:2950
bool CamChecked(tChannelID ChannelID, int CamSlotNumber)
Definition: ci.c:2993
time_t lastCleanup
Definition: ci.h:516
cChannelCamRelation * GetEntry(tChannelID ChannelID)
Definition: ci.c:2964
cChannelCamRelation * AddEntry(tChannelID ChannelID)
Definition: ci.c:2975
void SetDecrypt(tChannelID ChannelID, int CamSlotNumber)
Definition: ci.c:3015
cString fileName
Definition: ci.h:513
void ClrChecked(tChannelID ChannelID, int CamSlotNumber)
Definition: ci.c:3023
void Save(void)
Definition: ci.c:3073
void Reset(int CamSlotNumber)
Definition: ci.c:2984
Definition: ci.h:172
virtual void Action(void)
Handles the attached CAM slots in a separate thread.
Definition: ci.c:2150
cCamSlot * camSlots[MAX_CAM_SLOTS_PER_ADAPTER]
Definition: ci.h:175
virtual bool Reset(int Slot)
Resets the CAM in the given Slot.
Definition: ci.h:194
cCiAdapter(void)
Definition: ci.c:2111
virtual eModuleStatus ModuleStatus(int Slot)
Returns the status of the CAM in the given Slot.
Definition: ci.h:197
cCamSlot * ItCamSlot(int &Iter)
Iterates over all added CAM slots of this adapter.
Definition: ci.c:2139
virtual bool Assign(cDevice *Device, bool Query=false)
Assigns this adapter to the given Device, if this is possible.
Definition: ci.h:199
virtual ~cCiAdapter()
The derived class must call Cancel(3) in its destructor.
Definition: ci.c:2118
void AddCamSlot(cCamSlot *CamSlot)
Adds the given CamSlot to this CI adapter.
Definition: ci.c:2125
virtual void Write(const uint8_t *Buffer, int Length)
Writes Length bytes of the given Buffer.
Definition: ci.h:192
virtual int Read(uint8_t *Buffer, int MaxLength)
Reads one chunk of data into the given Buffer, up to MaxLength bytes.
Definition: ci.h:187
virtual void Process(int Length=0, const uint8_t *Data=NULL)
Definition: ci.c:868
virtual ~cCiApplicationInformation()
Definition: ci.c:863
const char * GetMenuString(void)
Definition: ci.h:80
uint16_t manufacturerCode
Definition: ci.h:73
cCiApplicationInformation(uint16_t SessionId, cCiTransportConnection *Tc)
Definition: ci.c:855
bool EnterMenu(void)
Definition: ci.c:901
uint8_t applicationType
Definition: ci.h:71
uint16_t applicationManufacturer
Definition: ci.h:72
Definition: ci.c:931
Definition: ci.h:148
void Cancel(void)
Definition: ci.c:1714
const char * Text(void)
Definition: ci.h:160
int ExpectedLength(void)
Definition: ci.h:162
cCiEnquiry(cCiMMI *MMI)
Definition: ci.c:1690
~cCiEnquiry()
Definition: ci.c:1699
cCiMMI * mmi
Definition: ci.h:152
char * text
Definition: ci.h:154
bool Blind(void)
Definition: ci.h:161
cMutex * mutex
Definition: ci.h:153
void Abort(void)
Definition: ci.c:1719
void Reply(const char *s)
Definition: ci.c:1707
bool blind
Definition: ci.h:155
int expectedLength
Definition: ci.h:156
Definition: ci.c:1401
Definition: ci.h:119
const char * BottomText(void)
Definition: ci.h:138
bool selectable
Definition: ci.h:126
const char * TitleText(void)
Definition: ci.h:136
void Abort(void)
Definition: ci.c:1681
char * bottomText
Definition: ci.h:129
bool HasUpdate(void)
Definition: ci.c:1663
int NumEntries(void)
Definition: ci.h:140
char * subTitleText
Definition: ci.h:128
cMutex * mutex
Definition: ci.h:125
void Cancel(void)
Definition: ci.c:1676
bool Selectable(void)
Definition: ci.h:141
int numEntries
Definition: ci.h:131
bool AddEntry(char *s)
Definition: ci.c:1654
cCiMenu(cCiMMI *MMI, bool Selectable)
Definition: ci.c:1633
const char * Entry(int n)
Definition: ci.h:139
~cCiMenu()
Definition: ci.c:1642
void Select(int Index)
Definition: ci.c:1669
char * titleText
Definition: ci.h:127
cCiMMI * mmi
Definition: ci.h:124
@ MAX_CIMENU_ENTRIES
Definition: ci.h:123
const char * SubTitleText(void)
Definition: ci.h:137
char * entries[MAX_CIMENU_ENTRIES]
Definition: ci.h:130
virtual const uint32_t * ResourceIds(void) const =0
Returns a pointer to an array of resource identifiers, where the last value is zero.
cCiResourceHandler(void)
Creates a new resource handler, through which the available resources can be provides.
Definition: ci.c:1728
virtual cCiSession * GetNewCiSession(uint32_t ResourceId, uint16_t SessionId, cCiTransportConnection *Tc)=0
Returns a new cCiSession, according to the given ResourceId.
virtual ~cCiResourceHandler()
Definition: ci.c:1732
const uint32_t * Ids(void)
Definition: ci.h:110
cCiResourceHandlers(void)
Creates the default list of resourceIds.
Definition: ci.c:1775
int NumIds(void)
Definition: ci.h:111
cVector< uint32_t > resourceIds
Definition: ci.h:101
void Register(cCiResourceHandler *ResourceHandler)
Adds the given ResourceHandler to the list of resource handlers and appends its ResourceIds to the gl...
Definition: ci.c:1780
cCiSession * GetNewCiSession(uint32_t ResourceId, uint16_t SessionId, cCiTransportConnection *Tc)
Definition: ci.c:1793
Definition: ci.h:32
uint16_t SessionId(void)
Definition: ci.h:52
int GetTag(int &Length, const uint8_t **Data)
Definition: ci.c:746
void SendData(int Tag, int Length=0, const uint8_t *Data=NULL)
Definition: ci.c:767
cCiTransportConnection * tc
Definition: ci.h:36
uint32_t resourceId
Definition: ci.h:35
cCiSession(uint16_t SessionId, uint32_t ResourceId, cCiTransportConnection *Tc)
Definition: ci.c:725
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:736
uint32_t ResourceId(void)
Definition: ci.h:53
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:57
cCamSlot * CamSlot(void)
Definition: ci.c:789
const uint8_t * GetData(const uint8_t *Data, int &Length)
Definition: ci.c:761
virtual bool HasUserIO(void)
Definition: ci.h:55
void SetTsPostProcessor(void)
If this cCiSession implements the TsPostProcess() function, it shall call SetTsPostProcessor() to reg...
Definition: ci.c:741
uint16_t sessionId
Definition: ci.h:34
cCiTransportConnection * Tc(void)
Definition: ci.h:48
virtual void Process(int Length=0, const uint8_t *Data=NULL)
Definition: ci.c:794
virtual ~cCiSession()
Definition: ci.c:732
Definition: tools.h:598
cMtdMapper * MtdMapper(void)
Definition: mtd.h:170
Definition: thread.h:67
Definition: tools.h:174
Definition: ci.c:501
Definition: thread.h:79
Definition: tools.h:367
int Size(void) const
Definition: tools.h:721
~cCiCaPmtList()
Definition: ci.c:2497
void Del(cCiCaPmt *CaPmt)
Definition: ci.c:2510
cVector< cCiCaPmt * > caPmts
Definition: ci.h:226
cCiCaPmt * Add(uint8_t CmdId, int Source, int Transponder, int ProgramNumber, const int *CaSystemIds)
Definition: ci.c:2503
unsigned char uchar
Definition: tools.h:31