vdr 2.6.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 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
25class 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
33private:
34 uint16_t sessionId;
35 uint32_t resourceId;
37protected:
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; }
49public:
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
69protected:
70 int state;
75public:
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
84public:
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
99class cCiResourceHandlers : public cList<cCiResourceHandler> {
100private:
102public:
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
117class cCiMMI;
118
119class cCiMenu {
120 friend class cCamSlot;
121 friend class cCiMMI;
122private:
123 enum { MAX_CIMENU_ENTRIES = 64 };
132 bool AddEntry(char *s);
133 cCiMenu(cCiMMI *MMI, bool Selectable);
134public:
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
149 friend class cCamSlot;
150 friend class cCiMMI;
151private:
154 char *text;
155 bool blind;
157 cCiEnquiry(cCiMMI *MMI);
158public:
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
168class cDevice;
169
171
172class cCiAdapter : public cThread {
173 friend class cCamSlot;
174private:
176 void AddCamSlot(cCamSlot *CamSlot);
178protected:
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; }
208public:
209 cCiAdapter(void);
210 virtual ~cCiAdapter();
212 };
213
214class cTPDU;
216class cCiSession;
217class cCiCaProgramData;
218class cCaPidReceiver;
220class cMtdHandler;
221class cMtdMapper;
222class cMtdCamSlot;
223class cCiCaPmt;
224
228 cCiCaPmt *Add(uint8_t CmdId, int Source, int Transponder, int ProgramNumber, const int *CaSystemIds);
229 void Del(cCiCaPmt *CaPmt);
230 };
231
232class cCamSlot : public cListObject {
233 friend class cCiAdapter;
236 friend class cMtdCamSlot;
237private:
247 cCiTransportConnection *tc[MAX_CONNECTIONS_PER_CAM_SLOT + 1]; // connection numbering starts with 1
249 time_t resetTime;
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);
265protected:
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);
283public:
284 bool McdAvailable(void) { return RepliesToQuery(); }
286 bool MtdAvailable(void) { return mtdAvailable; }
288 bool MtdActive(void) { return mtdHandler != NULL; }
290public:
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
493class cCamSlots : public cList<cCamSlot> {
494public:
495 int NumReadyMasterSlots(void);
498 bool WaitForAllCamSlotsReady(int Timeout = 0);
504 };
505
506extern cCamSlots CamSlots;
507
509
510class cChannelCamRelations : public cList<cChannelCamRelation> {
511private:
517 void Cleanup(void);
518public:
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
533bool CamResponsesLoad(const char *FileName, bool AllowComments = false, bool MustExist = false);
534
535#endif //__CI_H
cChannelCamRelations ChannelCamRelations
Definition: ci.c:2947
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:2838
cCiResourceHandlers CiResourceHandlers
Definition: ci.c:1777
#define MAX_CAM_SLOTS_PER_ADAPTER
Definition: ci.h:20
bool CamResponsesLoad(const char *FileName, bool AllowComments=false, bool MustExist=false)
Definition: ci.c:481
#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:2262
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:2520
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:2795
virtual bool Ready(void)
Returns 'true' if the CAM in this slot is ready to decrypt.
Definition: ci.c:2451
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:2830
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:2656
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
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:2445
void DeleteAllConnections(void)
Definition: ci.c:2285
int source
Definition: ci.h:252
int slotIndex
Definition: ci.h:245
cCiSession * GetSessionByResourceId(uint32_t ResourceId)
Definition: ci.c:2360
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:2740
void KeepSharedCaPids(int ProgramNumber, const int *CaSystemIds, int *CaPids)
Definition: ci.c:2566
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:2825
void MtdEnable(void)
Enables MTD support for this CAM.
Definition: ci.c:2622
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:2468
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:2813
virtual void AddPid(int ProgramNumber, int Pid, int StreamType)
Adds the given PID information to the list of PIDs.
Definition: ci.c:2679
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:2488
bool mtdAvailable
Definition: ci.h:255
void Process(cTPDU *TPDU=NULL)
Definition: ci.c:2294
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:2431
void MtdActivate(bool On)
Activates (On == true) or deactivates (On == false) MTD.
Definition: ci.c:2627
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:2720
void NewConnection(void)
Definition: ci.c:2272
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:2462
virtual const int * GetCaSystemIds(void)
Definition: ci.c:2649
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:2221
virtual cCiMenu * GetMenu(void)
Gets a pending menu, or NULL if there is no menu.
Definition: ci.c:2475
cTimeMs moduleCheckTimer
Definition: ci.h:250
virtual void SendCaPmt(uint8_t CmdId)
Definition: ci.c:2614
cDevice * Device(void)
Returns the device this CAM slot is currently assigned to.
Definition: ci.h:332
cCondVar processed
Definition: ci.h:239
virtual bool Reset(void)
Resets the CAM in this slot.
Definition: ci.c:2375
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:2697
virtual void StartActivation(void)
Puts the CAM in this slot into a mode where an inserted smart card can be activated.
Definition: ci.c:2398
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:2776
virtual bool IsActivating(void)
Returns true if this CAM slot is currently activating a smart card.
Definition: ci.c:2424
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:2820
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:2644
void Write(cTPDU *TPDU)
Definition: ci.c:2366
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:2781
void SendCaPmts(cCiCaPmtList &CaPmtList)
Sends the given list of CA_PMTs to the CAM.
Definition: ci.c:2603
virtual bool HasMMI(void)
Returns 'true' if the CAM in this slot has an active MMI.
Definition: ci.c:2457
virtual bool CanActivate(void)
Returns true if there is a CAM in this slot that can be put into activation mode.
Definition: ci.c:2393
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: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:2527
virtual ~cCamSlot()
Definition: ci.c:2203
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:2413
virtual bool ProvidesCa(const int *CaSystemIds)
Returns true if the CAM in this slot provides one of the given CaSystemIds.
Definition: ci.c:2664
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:2850
int NumReadyMasterSlots(void)
Returns the number of master CAM slots in the system that are ready to decrypt.
Definition: ci.c:2840
void ClrDecrypt(tChannelID ChannelID, int CamSlotNumber)
Definition: ci.c:3035
void Load(const char *FileName)
Definition: ci.c:3043
void SetChecked(tChannelID ChannelID, int CamSlotNumber)
Definition: ci.c:3011
cMutex mutex
Definition: ci.h:512
bool CamDecrypt(tChannelID ChannelID, int CamSlotNumber)
Definition: ci.c:3004
cChannelCamRelations(void)
Definition: ci.c:2949
void Cleanup(void)
Definition: ci.c:2954
bool CamChecked(tChannelID ChannelID, int CamSlotNumber)
Definition: ci.c:2997
time_t lastCleanup
Definition: ci.h:516
cChannelCamRelation * GetEntry(tChannelID ChannelID)
Definition: ci.c:2968
cChannelCamRelation * AddEntry(tChannelID ChannelID)
Definition: ci.c:2979
void SetDecrypt(tChannelID ChannelID, int CamSlotNumber)
Definition: ci.c:3019
cString fileName
Definition: ci.h:513
void ClrChecked(tChannelID ChannelID, int CamSlotNumber)
Definition: ci.c:3027
void Save(void)
Definition: ci.c:3077
void Reset(int CamSlotNumber)
Definition: ci.c:2988
Definition: ci.h:172
virtual void Action(void)
Handles the attached CAM slots in a separate thread.
Definition: ci.c:2154
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:2115
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:2143
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:2122
void AddCamSlot(cCamSlot *CamSlot)
Adds the given CamSlot to this CI adapter.
Definition: ci.c:2129
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:872
const char * GetMenuString(void)
Definition: ci.h:80
virtual ~cCiApplicationInformation()
Definition: ci.c:867
uint16_t manufacturerCode
Definition: ci.h:73
bool EnterMenu(void)
Definition: ci.c:905
uint8_t applicationType
Definition: ci.h:71
uint16_t applicationManufacturer
Definition: ci.h:72
Definition: ci.c:935
Definition: ci.h:148
void Cancel(void)
Definition: ci.c:1718
int ExpectedLength(void)
Definition: ci.h:162
~cCiEnquiry()
Definition: ci.c:1703
cCiMMI * mmi
Definition: ci.h:152
char * text
Definition: ci.h:154
const char * Text(void)
Definition: ci.h:160
bool Blind(void)
Definition: ci.h:161
cMutex * mutex
Definition: ci.h:153
void Abort(void)
Definition: ci.c:1723
void Reply(const char *s)
Definition: ci.c:1711
bool blind
Definition: ci.h:155
int expectedLength
Definition: ci.h:156
Definition: ci.c:1405
Definition: ci.h:119
bool selectable
Definition: ci.h:126
void Abort(void)
Definition: ci.c:1685
char * bottomText
Definition: ci.h:129
bool HasUpdate(void)
Definition: ci.c:1667
const char * TitleText(void)
Definition: ci.h:136
const char * BottomText(void)
Definition: ci.h:138
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:1680
bool Selectable(void)
Definition: ci.h:141
int numEntries
Definition: ci.h:131
bool AddEntry(char *s)
Definition: ci.c:1658
const char * SubTitleText(void)
Definition: ci.h:137
~cCiMenu()
Definition: ci.c:1646
void Select(int Index)
Definition: ci.c:1673
char * titleText
Definition: ci.h:127
const char * Entry(int n)
Definition: ci.h:139
cCiMMI * mmi
Definition: ci.h:124
@ MAX_CIMENU_ENTRIES
Definition: ci.h:123
char * entries[MAX_CIMENU_ENTRIES]
Definition: ci.h:130
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 ~cCiResourceHandler()
Definition: ci.c:1736
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:111
cVector< uint32_t > resourceIds
Definition: ci.h:101
const uint32_t * Ids(void)
Definition: ci.h:110
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
Definition: ci.h:32
uint16_t SessionId(void)
Definition: ci.h:52
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:36
uint32_t resourceId
Definition: ci.h:35
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: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:793
const uint8_t * GetData(const uint8_t *Data, int &Length)
Definition: ci.c:765
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:745
uint16_t sessionId
Definition: ci.h:34
virtual void Process(int Length=0, const uint8_t *Data=NULL)
Definition: ci.c:798
cCiTransportConnection * Tc(void)
Definition: ci.h:48
virtual ~cCiSession()
Definition: ci.c:736
Definition: tools.h:641
Definition: thread.h:67
Definition: tools.h:178
Definition: ci.c:505
Definition: thread.h:79
Definition: tools.h:401
Definition: tools.h:711
int Size(void) const
Definition: tools.h:764
~cCiCaPmtList()
Definition: ci.c:2501
void Del(cCiCaPmt *CaPmt)
Definition: ci.c:2514
cVector< cCiCaPmt * > caPmts
Definition: ci.h:226
cCiCaPmt * Add(uint8_t CmdId, int Source, int Transponder, int ProgramNumber, const int *CaSystemIds)
Definition: ci.c:2507
unsigned char uchar
Definition: tools.h:31