forked from ipruthi/sasc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
system-common.h
112 lines (96 loc) · 3.18 KB
/
system-common.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
/*
* Softcam plugin to VDR (C++)
*
* This code is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This code is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* Or, point your browser to http://www.gnu.org/copyleft/gpl.html
*/
#ifndef ___SYSTEM_COMMON_H
#define ___SYSTEM_COMMON_H
#include "data.h"
#include "system.h"
// ----------------------------------------------------------------
class cHexKey : public cPlainKey {
private:
int keylen;
unsigned char *key;
protected:
virtual bool SetKey(void *Key, int Keylen);
virtual bool SetBinKey(unsigned char *Mem, int Keylen);
virtual cString Print(void);
virtual bool Cmp(cPlainKey *k);
virtual void Get(void *mem);
virtual int Size(void) { return keylen; }
public:
cHexKey(bool Super);
virtual ~cHexKey();
virtual bool Parse(const char *line) { return false; }
};
// ----------------------------------------------------------------
class cBN;
class cBNKey : public cPlainKey {
private:
bool rotate;
int keylen;
cBN *key;
protected:
virtual bool SetKey(void *Key, int Keylen);
virtual bool SetBinKey(unsigned char *Mem, int Keylen);
virtual cString Print(void);
virtual bool Cmp(cPlainKey *k);
virtual void Get(void *mem);
virtual int Size(void) { return keylen; }
public:
cBNKey(bool Super, bool Rotate=false);
virtual ~cBNKey();
virtual bool Parse(const char *line) { return false; }
};
// ----------------------------------------------------------------
class cDualKey : public cMutableKey {
private:
bool rotate;
protected:
virtual bool IsBNKey(void) const=0;
virtual cPlainKey *Alloc(void) const;
public:
cDualKey(bool Super, bool Rotate);
};
// ----------------------------------------------------------------
class cPlainKeyStd : public cHexKey {
public:
cPlainKeyStd(bool Super);
virtual bool Parse(const char *line);
};
// ----------------------------------------------------------------
template<class T> class cCardInfos : public cStructList<T> {
public:
cCardInfos(const char *Type, const char *Filename, int fl):cStructList<T>(Type,Filename,fl|SL_MISSINGOK|SL_WATCH) {}
virtual cStructItem *ParseLine(char *line)
{
T *k=new T;
if(k && !k->Parse(line)) { delete k; k=0; }
return k;
}
};
// ----------------------------------------------------------------
class cSystemScCore : public cSystem {
private:
int scId;
const char *scName;
public:
cSystemScCore(const char *Name, int Pri, int ScId, const char *ScName);
virtual bool ProcessECM(const cEcmInfo *ecm, unsigned char *data);
virtual void ProcessEMM(int pid, int caid, const unsigned char *data);
};
#endif //___SYSTEM_COMMON_H