1 | #ifndef _CSCTAPI_CARDLIST_H_
|
---|
2 | #define _CSCTAPI_CARDLIST_H_
|
---|
3 |
|
---|
4 | struct known_cards
|
---|
5 | {
|
---|
6 | char providername[32];
|
---|
7 | //max atrsize incl. spaces
|
---|
8 | char atr[80];
|
---|
9 | int atrsize;
|
---|
10 | }
|
---|
11 | mtv = { "MTV UNLIMITED","3B 24 00 30 42 30 30",20 },
|
---|
12 | srg = { "SRG v5","3F 77 18 00 00 C2 7A 44 02 68 90 00",35 },
|
---|
13 | orfice = { "ORF ICE CW-Mode","3B 78 12 00 00 54 C4 03 00 8F F1 90 00",38 },
|
---|
14 | cdnl = { "CANAL DIGITAAL (NL)","3B F7 11 00 01 40 96 70 70 0A 0E 6C B6 D6",42 },
|
---|
15 | kbw_v23 = { "Kabel-BW V23","3F FF 14 25 03 10 80 54 B0 01 69 FF 4A 50 70 00 00 4B 57 01 00 00",65 },
|
---|
16 | kdg9 = { "Kabel Deutschland G0x","3F FD 11 25 02 50 00 03 33 B0 15 69 FF 4A 50 F0 80 03 4B 4C 03",62 },
|
---|
17 | skyDEv14 = { "Sky Deutschland V14","3F FD 13 25 02 50 80 0F 41 B0 0A 69 FF 4A 50 F0 00 00 50 31 03",62 },
|
---|
18 | skyDEv13 = { "Sky Deutschland V13","3F FF 11 25 03 10 80 41 B0 07 69 FF 4A 50 70 00 00 50 31 01 00 11",65 },
|
---|
19 | tivusatd = { "Tivusat 183D","3F FF 95 00 FF 91 81 71 FF 47 00 54 49 47 45 52 30 30 33 20 52 65 76 32 35 30 64",80 },
|
---|
20 | tivusate = { "Tivusat 183E","3F FF 95 00 FF 91 81 71 FE 47 00 54 49 47 45 52 36 30 31 20 52 65 76 4D 38 37 14",80 },
|
---|
21 | rlmega = { "Redlight Mega Elite","3F 77 18 00 00 C2 EB 41 02 6C 90 00",35 },
|
---|
22 | kdg_02 = { "Kabel Deutschland D0x Ix2","3B 9F 21 0E 49 52 44 45 54 4F 20 41 43 53 03 84 55 FF 80 6D",59 },
|
---|
23 | hdplus01 = { "HD-Plus 01","3F FF 95 00 FF 91 81 71 FE 47 00 44 4E 41 53 50 31 34 32 20 52 65 76 47 43 36 61",80 },
|
---|
24 | hdplus02 = { "HD-Plus 02","3F FF 95 00 FF 91 81 71 A0 47 00 44 4E 41 53 50 31 38 30 20 4D 65 72 30 30 30 28",80 },
|
---|
25 | hdplus03 = { "HD-Plus 03","3F FF 95 00 FF 91 81 71 A0 47 00 44 4E 41 53 50 31 39 30 20 4D 65 72 51 32 35 4F",80 },
|
---|
26 | hdplus03a = { "HD-Plus 3A","3F FF 95 00 FF 91 81 71 FE 57 00 44 4E 41 53 50 34 31 30 20 52 65 76 51 32 35 17",80 },
|
---|
27 | hdplus03b = { "HD-Plus 03","3F FF 95 00 FF 91 81 71 FE 57 00 44 4E 41 53 50 34 32 30 20 52 65 76 51 32 35 17",80 },
|
---|
28 | hdplus04 = { "HD-Plus 04","3F FF 95 00 FF 91 81 71 FE 57 00 44 4E 41 53 50 34 32 30 20 52 65 76 53 36 30 17",80 },
|
---|
29 | hdplus04a = { "HD-Plus 04","3F FF 95 00 FF 91 81 71 FE 57 00 44 4E 41 53 50 34 32 30 20 52 65 76 53 36 34 13",80 },
|
---|
30 | unity_01 = { "Unity Media 01","3F FF 95 00 FF 91 81 71 FE 47 00 44 4E 41 53 50 31 31 30 20 52 65 76 41 32 32 15",80 },
|
---|
31 | unity_02 = { "Unity Media 02","3F FF 95 00 FF 91 81 71 FE 47 00 44 4E 41 53 50 31 34 32 20 52 65 76 47 30 36 12",80 };
|
---|
32 |
|
---|
33 | struct atrlist
|
---|
34 | {
|
---|
35 | int found;
|
---|
36 | int ishd03;
|
---|
37 | int badcard;
|
---|
38 | int ishd04;
|
---|
39 | char providername[32];
|
---|
40 | char atr[80];
|
---|
41 | } current = { 0, 0, 0, 0, "\0", "\0" };
|
---|
42 |
|
---|
43 | void findatr(struct s_reader *reader)
|
---|
44 | {
|
---|
45 | current.found = 0;
|
---|
46 | current.ishd03 = 0;
|
---|
47 | current.ishd04 = 0;
|
---|
48 |
|
---|
49 | memset(current.providername, 0, 32);
|
---|
50 | if ( strncmp(current.atr, hdplus01.atr, hdplus01.atrsize) == 0 )
|
---|
51 | {
|
---|
52 | memcpy(current.providername, hdplus01.providername, strlen(hdplus01.providername));
|
---|
53 | current.found = 1;
|
---|
54 | return;
|
---|
55 | }
|
---|
56 | else if ( strncmp(current.atr, hdplus02.atr, hdplus02.atrsize) == 0 )
|
---|
57 | {
|
---|
58 | memcpy(current.providername, hdplus02.providername, strlen(hdplus02.providername));
|
---|
59 | current.found = 1;
|
---|
60 | return;
|
---|
61 | }
|
---|
62 | else if ( strncmp(current.atr, hdplus03.atr, hdplus03.atrsize) == 0 )
|
---|
63 | {
|
---|
64 | current.ishd03=1;
|
---|
65 | memcpy(current.providername, hdplus03.providername, strlen(hdplus03.providername));
|
---|
66 | current.found = 1;
|
---|
67 | return;
|
---|
68 | }
|
---|
69 | else if ( strncmp(current.atr, hdplus03a.atr, hdplus03a.atrsize) == 0 )
|
---|
70 | {
|
---|
71 | current.ishd03=1;
|
---|
72 | current.badcard=1;
|
---|
73 | memcpy(current.providername, hdplus03a.providername, strlen(hdplus03a.providername));
|
---|
74 | current.found = 1;
|
---|
75 | return;
|
---|
76 | }
|
---|
77 | else if ( strncmp(current.atr, hdplus03b.atr, hdplus03b.atrsize) == 0 )
|
---|
78 | {
|
---|
79 | current.ishd03=1;
|
---|
80 | memcpy(current.providername, hdplus03b.providername, strlen(hdplus03b.providername));
|
---|
81 | current.found = 1;
|
---|
82 | return;
|
---|
83 | }
|
---|
84 | else if ( strncmp(current.atr, hdplus04.atr, hdplus04.atrsize) == 0 )
|
---|
85 | {
|
---|
86 | current.ishd04=1;
|
---|
87 | memcpy(current.providername, hdplus04.providername, strlen(hdplus04.providername));
|
---|
88 | current.found = 1;
|
---|
89 | return;
|
---|
90 | }
|
---|
91 | else if ( strncmp(current.atr, hdplus04a.atr, hdplus04a.atrsize) == 0 )
|
---|
92 | {
|
---|
93 | current.ishd04=1;
|
---|
94 | memcpy(current.providername, hdplus04a.providername, strlen(hdplus04a.providername));
|
---|
95 | current.found = 1;
|
---|
96 | return;
|
---|
97 | }
|
---|
98 | else if ( strncmp(current.atr, unity_01.atr, unity_01.atrsize) == 0 )
|
---|
99 | {
|
---|
100 | memcpy(current.providername, unity_01.providername, strlen(unity_01.providername));
|
---|
101 | current.found = 1;
|
---|
102 | return;
|
---|
103 | }
|
---|
104 | else if ( strncmp(current.atr, unity_02.atr, unity_02.atrsize) == 0 )
|
---|
105 | {
|
---|
106 | memcpy(current.providername, unity_02.providername, strlen(unity_02.providername));
|
---|
107 | current.found = 1;
|
---|
108 | return;
|
---|
109 | }
|
---|
110 | else if ( strncmp(current.atr, kdg_02.atr, kdg_02.atrsize) == 0 )
|
---|
111 | {
|
---|
112 | memcpy(current.providername, kdg_02.providername, strlen(kdg_02.providername));
|
---|
113 | current.found = 1;
|
---|
114 | return;
|
---|
115 | }
|
---|
116 | else if ( strncmp(current.atr, rlmega.atr, rlmega.atrsize) == 0 )
|
---|
117 | {
|
---|
118 | memcpy(current.providername, rlmega.providername, strlen(rlmega.providername));
|
---|
119 | current.found = 1;
|
---|
120 | return;
|
---|
121 | }
|
---|
122 | else if ( strncmp(current.atr, mtv.atr, mtv.atrsize) == 0 )
|
---|
123 | {
|
---|
124 | memcpy(current.providername, mtv.providername, strlen(mtv.providername));
|
---|
125 | current.found = 1;
|
---|
126 | return;
|
---|
127 | }
|
---|
128 | else if ( strncmp(current.atr, orfice.atr, orfice.atrsize) == 0 )
|
---|
129 | {
|
---|
130 | memcpy(current.providername, orfice.providername, strlen(orfice.providername));
|
---|
131 | current.found = 1;
|
---|
132 | return;
|
---|
133 | }
|
---|
134 | else if ( strncmp(current.atr, cdnl.atr, cdnl.atrsize) == 0 )
|
---|
135 | {
|
---|
136 | memcpy(current.providername, cdnl.providername, strlen(cdnl.providername));
|
---|
137 | current.found = 1;
|
---|
138 | return;
|
---|
139 | }
|
---|
140 | else if ( strncmp(current.atr, tivusatd.atr, tivusatd.atrsize) == 0 )
|
---|
141 | {
|
---|
142 | memcpy(current.providername, tivusatd.providername, strlen(tivusatd.providername));
|
---|
143 | current.found = 1;
|
---|
144 | return;
|
---|
145 | }
|
---|
146 | else if ( strncmp(current.atr, tivusate.atr, tivusate.atrsize) == 0 )
|
---|
147 | {
|
---|
148 | memcpy(current.providername, tivusate.providername, strlen(tivusate.providername));
|
---|
149 | current.found = 1;
|
---|
150 | return;
|
---|
151 | }
|
---|
152 | else if ( strncmp(current.atr, srg.atr, srg.atrsize) == 0 )
|
---|
153 | {
|
---|
154 | memcpy(current.providername, srg.providername, strlen(srg.providername));
|
---|
155 | reader->read_old_classes = 0;
|
---|
156 | current.found = 1;
|
---|
157 | return;
|
---|
158 | }
|
---|
159 |
|
---|
160 | /* test ATR for ins7e11 12,13,14,15 */
|
---|
161 | if ( current.found == 0 )
|
---|
162 | {
|
---|
163 | int i;
|
---|
164 | char buf[66];
|
---|
165 | for( i = 11; i < 16; i++ )
|
---|
166 | {
|
---|
167 | snprintf(buf, skyDEv13.atrsize+1, "3F FF %i 25 03 10 80 41 B0 07 69 FF 4A 50 70 00 00 50 31 01 00 %i", i, i);
|
---|
168 | if ( strncmp(current.atr, buf, skyDEv13.atrsize) == 0 )
|
---|
169 | {
|
---|
170 | memcpy(current.providername, skyDEv13.providername, strlen(skyDEv13.providername));
|
---|
171 | reader->caid = 0x09C4;
|
---|
172 | current.found = 1;
|
---|
173 | break;
|
---|
174 | }
|
---|
175 | snprintf(buf, skyDEv14.atrsize+1, "3F FD %i 25 02 50 80 0F 41 B0 0A 69 FF 4A 50 F0 00 00 50 31 03", i);
|
---|
176 | if ( strncmp(current.atr, buf, skyDEv14.atrsize) == 0 )
|
---|
177 | {
|
---|
178 | memcpy(current.providername, skyDEv14.providername, strlen(skyDEv14.providername));
|
---|
179 | reader->caid = 0x098C;
|
---|
180 | current.found = 1;
|
---|
181 | break;
|
---|
182 | }
|
---|
183 | snprintf(buf, kbw_v23.atrsize+1, "3F FF %i 25 03 10 80 54 B0 01 69 FF 4A 50 70 00 00 4B 57 01 00 00", i);
|
---|
184 | if ( strncmp(current.atr, buf, kbw_v23.atrsize) == 0 )
|
---|
185 | {
|
---|
186 | memcpy(current.providername, kbw_v23.providername, strlen(kbw_v23.providername));
|
---|
187 | current.found = 1;
|
---|
188 | break;
|
---|
189 | }
|
---|
190 | snprintf(buf, kdg9.atrsize+1, "3F FD %i 25 02 50 00 03 33 B0 15 69 FF 4A 50 F0 80 03 4B 4C 03", i);
|
---|
191 | if ( strncmp(current.atr, buf, kdg9.atrsize) == 0 )
|
---|
192 | {
|
---|
193 | memcpy(current.providername, kdg9.providername, strlen(kdg9.providername));
|
---|
194 | reader->deprecated = 1;
|
---|
195 | current.found = 1;
|
---|
196 | break;
|
---|
197 | }
|
---|
198 | }
|
---|
199 | }
|
---|
200 | }
|
---|
201 |
|
---|
202 | #endif
|
---|