1 | #ifndef __GLOBALS_H__
|
---|
2 | # define __GLOBALS_H__
|
---|
3 |
|
---|
4 | # include <errno.h>
|
---|
5 | # include <string.h>
|
---|
6 |
|
---|
7 | # include <sys/types.h>
|
---|
8 | # include <arpa/inet.h> // to be removed when ip is stored in a different way in structures
|
---|
9 | # include <sys/timeb.h>
|
---|
10 |
|
---|
11 | # include "os-types.h"
|
---|
12 |
|
---|
13 | /* CSCRYPT */
|
---|
14 | # include "cscrypt.h" // needed for s_client.AES_key
|
---|
15 |
|
---|
16 | # define CS_VERSION_NUMBER "0.99.4svn"
|
---|
17 |
|
---|
18 | # ifdef CS_WITH_GBOX
|
---|
19 | # include "csgbox/gbox.h"
|
---|
20 | # define CS_VERSION CS_VERSION_NUMBER "-gbx-" GBXVERSION
|
---|
21 | # else
|
---|
22 | # define CS_VERSION CS_VERSION_NUMBER
|
---|
23 | # endif
|
---|
24 |
|
---|
25 | # if defined(__GNUC__)
|
---|
26 | # define GCC_PACK __attribute__((packed))
|
---|
27 | # else
|
---|
28 | # define GCC_PACK
|
---|
29 | # endif
|
---|
30 |
|
---|
31 | # ifndef CS_CONFDIR
|
---|
32 | # define CS_CONFDIR "/usr/local/etc"
|
---|
33 | # endif
|
---|
34 | # ifndef CS_MMAPFILE
|
---|
35 | # define CS_MMAPFILE "/tmp/oscam.mem"
|
---|
36 | # endif
|
---|
37 | # ifndef CS_LOGFILE
|
---|
38 | # define CS_LOGFILE "/var/log/oscam.log"
|
---|
39 | # endif
|
---|
40 |
|
---|
41 | # define CS_QLEN 128 // size of request queue
|
---|
42 | # define CS_MAXQLEN 128 // size of request queue for cardreader
|
---|
43 | # define CS_MAXCAIDTAB 32 // max. caid-defs/user
|
---|
44 | # define CS_MAXTUNTAB 16 // max. betatunnel mappings
|
---|
45 | # define CS_MAXPROV 32
|
---|
46 | # define CS_MAXPORTS 32 // max server ports
|
---|
47 | # define CS_MAXFILTERS 16
|
---|
48 |
|
---|
49 | # define CS_MAXCARDS 4096
|
---|
50 | # define CS_MAXIGNORE 1024
|
---|
51 | # define CS_MAXLOCALS 16
|
---|
52 | # define CS_ECMSTORESIZE 16 // use MD5()
|
---|
53 | # define CS_EMMSTORESIZE 270
|
---|
54 | # define CS_CLIENT_TIMEOUT 5000
|
---|
55 | # define CS_CLIENT_MAXIDLE 120
|
---|
56 | # define CS_BIND_TIMEOUT 120
|
---|
57 | # define CS_DELAY 0
|
---|
58 | # define CS_RESOLVE_DELAY 30
|
---|
59 | # define CS_MAXLOGHIST 30
|
---|
60 | # define CS_LOGHISTSIZE 160 // 32+128: username + logline
|
---|
61 |
|
---|
62 | # ifdef OLD_DEFS
|
---|
63 | # ifdef CS_EMBEDDED
|
---|
64 | # define CS_MAXPENDING 32
|
---|
65 | # define CS_ECMCACHESIZE 32
|
---|
66 | # define CS_EMMCACHESIZE 64
|
---|
67 | # define CS_MAXPID 32
|
---|
68 | # define CS_MAXREADER 8
|
---|
69 | # else
|
---|
70 | # define CS_MAXPENDING 128
|
---|
71 | # define CS_ECMCACHESIZE 128
|
---|
72 | # define CS_EMMCACHESIZE 256
|
---|
73 | # define CS_MAXPID 128
|
---|
74 | # define CS_MAXREADER 64
|
---|
75 | # endif
|
---|
76 | # endif
|
---|
77 |
|
---|
78 | # ifdef CS_EMBEDDED
|
---|
79 | # define CS_MAXPID 32
|
---|
80 | # define CS_MAXREADER (CS_MAXPID>>1)
|
---|
81 | # define CS_MAXPENDING CS_MAXPID
|
---|
82 | # define CS_ECMCACHESIZE CS_MAXPID
|
---|
83 | # define CS_EMMCACHESIZE (CS_MAXPID<<1)
|
---|
84 | # else
|
---|
85 | # define CS_MAXPID 512
|
---|
86 | # define CS_MAXREADER (CS_MAXPID>>2)
|
---|
87 | # define CS_MAXPENDING (CS_MAXPID<<1)
|
---|
88 | # define CS_ECMCACHESIZE CS_MAXPID
|
---|
89 | # define CS_EMMCACHESIZE (CS_MAXPID<<1)
|
---|
90 | # endif
|
---|
91 |
|
---|
92 | # define D_DUMP 1 // Debug Dumps
|
---|
93 | # define D_MASTER 2 // Debug Master Process
|
---|
94 | # define D_READER 4 // Debug Reader/Proxy Process
|
---|
95 | # define D_CLIENT 8 // Debug Client Process
|
---|
96 | # define D_DEVICE 16 // Debug Reader I/O
|
---|
97 | # define D_ALL_DUMP 31
|
---|
98 |
|
---|
99 | # define R_PHOENIX 0x01 // Reader local serial : phoenix
|
---|
100 | # define R_SMARTMOUSE 0x02 // Reader local serial : smartmouse
|
---|
101 | # define R_INTERN 0x03 // Reader local serial : internal
|
---|
102 | # define R_SMARTREADER 0x04 // Reader local serial : smartreader+
|
---|
103 |
|
---|
104 | # define R_CAMD35 0x80 // Reader cascading network : camd 3.5x
|
---|
105 | # define R_CAMD33 0x81 // Reader cascading network : camd 3.3x
|
---|
106 | # define R_NEWCAMD 0x82 // Reader cascading network : newcamd
|
---|
107 | # define R_RADEGAST 0x83 // Reader cascading network : radegast
|
---|
108 | # define R_CS378X 0x84 // Reader cascading network : camd 3.5x TCP
|
---|
109 | # ifdef CS_WITH_GBOX
|
---|
110 | # define R_GBOX 0x85 // Reader cascading network : gbox
|
---|
111 | # endif
|
---|
112 | # define R_SERIAL 0xC0 // Reader cascading not network : serial
|
---|
113 |
|
---|
114 | # define R_IS_LOCAL ~0x80 // 0x00 -> 0x7F : local
|
---|
115 | # define R_IS_CASCADING 0x80 // 0x80 -> 0xFF : cascading
|
---|
116 |
|
---|
117 | # define R_IS_SERIAL ~0xC0 // 0x00 -> 0x3F : local serial
|
---|
118 | # define R_IS_NOT_SERIAL ~0x80 & 0x40 // 0x40 -> 0x7F : local not serial
|
---|
119 |
|
---|
120 | # define R_IS_NETWORK 0x80 & ~0x40 // 0x80 -> 0xBF : cascading network
|
---|
121 | # define R_IS_NOT_NETWORK 0xC0 // 0xC0 -> 0xFF : cascading not network
|
---|
122 |
|
---|
123 | # define CS_MAX_MOD 8
|
---|
124 | # define MOD_CONN_TCP 1
|
---|
125 | # define MOD_CONN_UDP 2
|
---|
126 | # define MOD_CONN_NET 3
|
---|
127 | # define MOD_CONN_SERIAL 4
|
---|
128 |
|
---|
129 | # ifdef CS_CORE
|
---|
130 | char *PIP_ID_TXT[] = { "ECM", "EMM", "LOG", "CIN", "HUP", NULL };
|
---|
131 | char *RDR_CD_TXT[] = { "CD", "DSR", "CTS", "RING", "NONE",
|
---|
132 | # ifdef USE_GPIO
|
---|
133 | "GPIO2", "GPIO3", "GPIO4", "GPIO5", "GPIO6", "GPIO7",
|
---|
134 | # endif
|
---|
135 | NULL
|
---|
136 | };
|
---|
137 | # else
|
---|
138 | extern char *PIP_ID_TXT[];
|
---|
139 | extern char *RDR_CD_TXT[];
|
---|
140 | # endif
|
---|
141 |
|
---|
142 | # define PIP_ID_ECM 0
|
---|
143 | # define PIP_ID_EMM 1
|
---|
144 | # define PIP_ID_LOG 2
|
---|
145 | # define PIP_ID_CIN 3 // CARD_INFO
|
---|
146 | # define PIP_ID_HUP 4
|
---|
147 | # define PIP_ID_MAX PIP_ID_HUP
|
---|
148 | # define PIP_ID_DCW 5
|
---|
149 |
|
---|
150 | # define PIP_ID_ERR (-1)
|
---|
151 | # define PIP_ID_DIR (-2)
|
---|
152 | # define PIP_ID_NUL (-3)
|
---|
153 |
|
---|
154 | # define cdiff *c_start
|
---|
155 |
|
---|
156 | # define NCD_AUTO 0
|
---|
157 | # define NCD_524 1
|
---|
158 | # define NCD_525 2
|
---|
159 |
|
---|
160 | # define CS_ANTICASC
|
---|
161 |
|
---|
162 | enum { E1_GLOBAL = 0, E1_USER, E1_READER, E1_SERVER, E1_LSERVER };
|
---|
163 | enum { E2_GLOBAL = 0, E2_GROUP, E2_CAID, E2_IDENT, E2_CLASS, E2_CHID, E2_QUEUE,
|
---|
164 | E2_EA_LEN, E2_F0_LEN, E2_OFFLINE, E2_SID
|
---|
165 | };
|
---|
166 |
|
---|
167 | typedef struct s_classtab {
|
---|
168 | uchar an;
|
---|
169 | uchar bn;
|
---|
170 | uchar aclass[31];
|
---|
171 | uchar bclass[31];
|
---|
172 | } GCC_PACK CLASSTAB;
|
---|
173 |
|
---|
174 | typedef struct s_caidtab {
|
---|
175 | ushort caid[CS_MAXCAIDTAB];
|
---|
176 | ushort mask[CS_MAXCAIDTAB];
|
---|
177 | ushort cmap[CS_MAXCAIDTAB];
|
---|
178 | } GCC_PACK CAIDTAB;
|
---|
179 |
|
---|
180 | typedef struct s_tuntab {
|
---|
181 | ushort bt_caidfrom[CS_MAXTUNTAB];
|
---|
182 | ushort bt_caidto[CS_MAXTUNTAB];
|
---|
183 | ushort bt_srvid[CS_MAXTUNTAB];
|
---|
184 | } GCC_PACK TUNTAB;
|
---|
185 |
|
---|
186 | typedef struct s_sidtab {
|
---|
187 | char label[33];
|
---|
188 | ushort num_caid;
|
---|
189 | ushort num_provid;
|
---|
190 | ushort num_srvid;
|
---|
191 | ushort *caid;
|
---|
192 | ulong *provid;
|
---|
193 | ushort *srvid;
|
---|
194 | struct s_sidtab *next;
|
---|
195 | } GCC_PACK SIDTAB;
|
---|
196 |
|
---|
197 | typedef struct s_filter {
|
---|
198 | ushort caid;
|
---|
199 | uchar nprids;
|
---|
200 | ulong prids[CS_MAXPROV];
|
---|
201 | } GCC_PACK FILTER;
|
---|
202 |
|
---|
203 | typedef struct s_ftab {
|
---|
204 | int nfilts;
|
---|
205 | FILTER filts[CS_MAXFILTERS];
|
---|
206 | } GCC_PACK FTAB;
|
---|
207 |
|
---|
208 | typedef struct s_port {
|
---|
209 | int fd;
|
---|
210 | int s_port;
|
---|
211 | FTAB ftab;
|
---|
212 | } GCC_PACK PORT;
|
---|
213 |
|
---|
214 | typedef struct s_ptab {
|
---|
215 | int nports;
|
---|
216 | PORT ports[CS_MAXPORTS];
|
---|
217 | } GCC_PACK PTAB;
|
---|
218 |
|
---|
219 | struct s_ecm {
|
---|
220 | uchar ecmd5[CS_ECMSTORESIZE];
|
---|
221 | uchar cw[16];
|
---|
222 | ushort caid;
|
---|
223 | ulong prid;
|
---|
224 | ulong grp;
|
---|
225 | };
|
---|
226 |
|
---|
227 | struct s_emm {
|
---|
228 | uchar emm[CS_EMMSTORESIZE];
|
---|
229 | uchar type;
|
---|
230 | int count;
|
---|
231 | };
|
---|
232 |
|
---|
233 | struct s_module {
|
---|
234 | int multi;
|
---|
235 | int type;
|
---|
236 | int watchdog;
|
---|
237 | char desc[16];
|
---|
238 | char *logtxt;
|
---|
239 | in_addr_t s_ip;
|
---|
240 | void (*s_handler) ();
|
---|
241 | int (*recv) ();
|
---|
242 | void (*send_dcw) ();
|
---|
243 | int c_multi;
|
---|
244 | int (*c_recv_chk) ();
|
---|
245 | int (*c_init) ();
|
---|
246 | int (*c_send_ecm) ();
|
---|
247 | int (*c_init_log) ();
|
---|
248 | int (*c_recv_log) ();
|
---|
249 | int c_port;
|
---|
250 | PTAB *ptab;
|
---|
251 | };
|
---|
252 |
|
---|
253 | struct s_client {
|
---|
254 | pid_t pid;
|
---|
255 | in_addr_t ip;
|
---|
256 | in_port_t port;
|
---|
257 | time_t login;
|
---|
258 | time_t last;
|
---|
259 | time_t lastswitch;
|
---|
260 | time_t lastemm;
|
---|
261 | time_t lastecm;
|
---|
262 | ulong grp;
|
---|
263 | int crypted;
|
---|
264 | int dup;
|
---|
265 | int au;
|
---|
266 | int monlvl;
|
---|
267 | int dbglvl;
|
---|
268 | CAIDTAB ctab;
|
---|
269 | TUNTAB ttab;
|
---|
270 | ulong sidtabok; // positiv services
|
---|
271 | ulong sidtabno; // negative services
|
---|
272 | int typ;
|
---|
273 | int ctyp;
|
---|
274 | int stat;
|
---|
275 | int ufd;
|
---|
276 | int last_srvid;
|
---|
277 | int last_caid;
|
---|
278 | int tosleep;
|
---|
279 | char usr[32];
|
---|
280 | int udp_fd;
|
---|
281 | int fd_m2c;
|
---|
282 | struct sockaddr_in udp_sa;
|
---|
283 | int log;
|
---|
284 | int logcounter;
|
---|
285 | int cwfound;
|
---|
286 | int cwcache;
|
---|
287 | int cwnot;
|
---|
288 | uchar ucrc[4]; // needed by monitor and used by camd35
|
---|
289 | ulong pcrc; // pwd crc
|
---|
290 | AES_KEY AES_key; // needed by monitor and used by camd33, camd35
|
---|
291 | ushort ncd_msgid;
|
---|
292 | uchar ncd_skey[16];
|
---|
293 | int port_idx; // index in server ptab
|
---|
294 | int ncd_server; // newcamd server?
|
---|
295 | # ifdef CS_ANTICASC
|
---|
296 | ushort ac_idx;
|
---|
297 | ushort ac_limit;
|
---|
298 | uchar ac_penalty;
|
---|
299 | # endif
|
---|
300 | FTAB fchid;
|
---|
301 | FTAB ftab; // user [caid] and ident filter
|
---|
302 | CLASSTAB cltab;
|
---|
303 | };
|
---|
304 |
|
---|
305 | struct s_reader {
|
---|
306 | char label[32];
|
---|
307 | char device[128];
|
---|
308 | int type;
|
---|
309 |
|
---|
310 | int card_system;
|
---|
311 | uchar card_atr[33]; // Max 33 bytes according to ISO/IEC 7816-3
|
---|
312 | ushort card_atr_size;
|
---|
313 |
|
---|
314 | int detect;
|
---|
315 | unsigned long frequency;
|
---|
316 |
|
---|
317 | int online;
|
---|
318 | int card_status;
|
---|
319 |
|
---|
320 | int cs_idx;
|
---|
321 | int fd;
|
---|
322 | ulong grp;
|
---|
323 | int fallback;
|
---|
324 | int r_port;
|
---|
325 | char r_usr[64];
|
---|
326 | char r_pwd[64];
|
---|
327 | int r_crypted;
|
---|
328 | int l_port;
|
---|
329 | int log_port;
|
---|
330 | CAIDTAB ctab;
|
---|
331 | ulong boxid;
|
---|
332 | uchar aes_key[16];
|
---|
333 | ulong sidtabok; // positiv services
|
---|
334 | ulong sidtabno; // negative services
|
---|
335 | uchar hexserial[8];
|
---|
336 | int nprov;
|
---|
337 | uchar prid[CS_MAXPROV][8];
|
---|
338 | uchar availkeys[CS_MAXPROV][16]; // viaccess; misused in seca, if availkeys[PROV][0]=0 then expired, 1 then valid.
|
---|
339 | uchar sa[CS_MAXPROV][4]; // viaccess & seca
|
---|
340 | ushort acs; // irdeto
|
---|
341 | ushort caid[16];
|
---|
342 | uchar b_nano[256];
|
---|
343 | char pincode[5];
|
---|
344 | int logemm;
|
---|
345 | int cachemm;
|
---|
346 | int rewritemm;
|
---|
347 | struct s_module ph;
|
---|
348 | uchar ncd_key[16];
|
---|
349 | uchar ncd_skey[16];
|
---|
350 | int ncd_disable_server_filt;
|
---|
351 | ushort ncd_msgid;
|
---|
352 | int ncd_proto;
|
---|
353 | uchar tcp_connected;
|
---|
354 | int tcp_ito; // inactivity timeout
|
---|
355 | int tcp_rto; // reconnect timeout
|
---|
356 | time_t last_g; // get (if last_s-last_g>tcp_rto - reconnect )
|
---|
357 | time_t last_s; // send
|
---|
358 | uchar show_cls; // number of classes subscription showed on kill -31
|
---|
359 | int maxqlen; // max queue length
|
---|
360 | int qlen; // current queue length
|
---|
361 | FTAB fchid;
|
---|
362 | FTAB ftab;
|
---|
363 | CLASSTAB cltab;
|
---|
364 | # ifdef CS_WITH_GBOX
|
---|
365 | uchar gbox_pwd[4];
|
---|
366 | uchar gbox_timecode[7];
|
---|
367 | int gbox_online;
|
---|
368 | uchar gbox_vers;
|
---|
369 | uchar gbox_prem;
|
---|
370 | int gbox_fd;
|
---|
371 | struct timeb gbox_lasthello; // incoming time stamp
|
---|
372 | # endif
|
---|
373 | };
|
---|
374 |
|
---|
375 | struct s_auth {
|
---|
376 | char usr[33];
|
---|
377 | char pwd[33];
|
---|
378 | int uniq;
|
---|
379 | int au;
|
---|
380 | int monlvl;
|
---|
381 | ulong grp;
|
---|
382 | int tosleep;
|
---|
383 | CAIDTAB ctab;
|
---|
384 | ulong sidtabok; // positiv services
|
---|
385 | ulong sidtabno; // negative services
|
---|
386 | FTAB fchid;
|
---|
387 | FTAB ftab; // user [caid] and ident filter
|
---|
388 | CLASSTAB cltab;
|
---|
389 | TUNTAB ttab;
|
---|
390 | # ifdef CS_ANTICASC
|
---|
391 | int ac_idx;
|
---|
392 | int ac_users; // 0 - unlimited
|
---|
393 | uchar ac_penalty; // 0 - log, >0 - fake dw
|
---|
394 | # endif
|
---|
395 | in_addr_t dynip;
|
---|
396 | uchar dyndns[64];
|
---|
397 | struct s_auth *next;
|
---|
398 | };
|
---|
399 |
|
---|
400 | struct s_srvid {
|
---|
401 | int srvid;
|
---|
402 | char name[33];
|
---|
403 | struct s_srvid *next;
|
---|
404 | };
|
---|
405 |
|
---|
406 | struct s_ip {
|
---|
407 | in_addr_t ip[2];
|
---|
408 | struct s_ip *next;
|
---|
409 | };
|
---|
410 |
|
---|
411 | struct s_config {
|
---|
412 | int nice;
|
---|
413 | ulong netprio;
|
---|
414 | ulong ctimeout;
|
---|
415 | ulong ftimeout;
|
---|
416 | int cmaxidle;
|
---|
417 | int ulparent;
|
---|
418 | ulong delay;
|
---|
419 | int bindwait;
|
---|
420 | int resolvedelay;
|
---|
421 | int tosleep;
|
---|
422 | in_addr_t srvip;
|
---|
423 | char pidfile[128];
|
---|
424 | char usrfile[128];
|
---|
425 | char cwlogdir[128];
|
---|
426 | struct s_auth *account;
|
---|
427 | struct s_srvid *srvid;
|
---|
428 | struct s_sidtab *sidtab;
|
---|
429 | int mon_port;
|
---|
430 | char serverip[4]; // TODO: use this from config, generalize for network protocols
|
---|
431 | in_addr_t mon_srvip;
|
---|
432 | struct s_ip *mon_allowed;
|
---|
433 | int mon_aulow;
|
---|
434 | int mon_hideclient_to;
|
---|
435 | int mon_level;
|
---|
436 | int c33_port;
|
---|
437 | in_addr_t c33_srvip;
|
---|
438 | uchar c33_key[16];
|
---|
439 | int c33_crypted;
|
---|
440 | int c33_passive;
|
---|
441 | struct s_ip *c33_plain;
|
---|
442 | int c35_port;
|
---|
443 | in_addr_t c35_srvip;
|
---|
444 | PTAB c35_tcp_ptab;
|
---|
445 | in_addr_t c35_tcp_srvip;
|
---|
446 | PTAB ncd_ptab;
|
---|
447 | in_addr_t ncd_srvip;
|
---|
448 | uchar ncd_key[16];
|
---|
449 | int rad_port;
|
---|
450 | in_addr_t rad_srvip;
|
---|
451 | struct s_ip *rad_allowed;
|
---|
452 | char rad_usr[32];
|
---|
453 | char ser_device[512];
|
---|
454 | int srtimeout; // SerialReaderTimeount in millisec
|
---|
455 | int max_log_size;
|
---|
456 | int show_ecm_dw;
|
---|
457 | int waitforcards;
|
---|
458 | int preferlocalcards;
|
---|
459 | # ifdef CS_WITH_GBOX
|
---|
460 | uchar gbox_pwd[8];
|
---|
461 | # endif
|
---|
462 | uchar ignorefile[512];
|
---|
463 | uchar cardfile[512];
|
---|
464 | uchar gbxShareOnl[512];
|
---|
465 | int maxdist;
|
---|
466 | int num_locals;
|
---|
467 | unsigned long locals[CS_MAXLOCALS];
|
---|
468 | # ifdef CS_ANTICASC
|
---|
469 | char ac_enabled;
|
---|
470 | int ac_users; // num of users for account (0 - default)
|
---|
471 | int ac_stime; // time to collect AC statistics (3 min - default)
|
---|
472 | int ac_samples; // qty of samples
|
---|
473 | int ac_penalty; // 0 - write to log
|
---|
474 | int ac_fakedelay; // 100-1000 ms
|
---|
475 | int ac_denysamples;
|
---|
476 | char ac_logfile[128];
|
---|
477 | struct s_cpmap *cpmap;
|
---|
478 | # endif
|
---|
479 | };
|
---|
480 |
|
---|
481 | typedef struct ecm_request_t {
|
---|
482 | uchar ecm[256];
|
---|
483 | uchar cw[16];
|
---|
484 | uchar ecmd5[CS_ECMSTORESIZE];
|
---|
485 | short l;
|
---|
486 | ushort caid;
|
---|
487 | ushort ocaid;
|
---|
488 | ushort srvid;
|
---|
489 | ushort chid;
|
---|
490 | ushort pid;
|
---|
491 | ushort idx;
|
---|
492 | ulong prid;
|
---|
493 | int reader[CS_MAXREADER];
|
---|
494 | int cidx; // client index
|
---|
495 | int cpti; // client pending table index
|
---|
496 | int stage; // processing stage in server module
|
---|
497 | int level; // send-level in client module
|
---|
498 | int rc;
|
---|
499 | uchar rcEx;
|
---|
500 | struct timeb tps; // incoming time stamp
|
---|
501 | uchar locals_done;
|
---|
502 | ushort gbxCWFrom;
|
---|
503 | ushort gbxFrom;
|
---|
504 | ushort gbxTo;
|
---|
505 |
|
---|
506 | uchar gbxForward[16];
|
---|
507 | int gbxRidx;
|
---|
508 | } GCC_PACK ECM_REQUEST;
|
---|
509 |
|
---|
510 | typedef struct emm_packet_t {
|
---|
511 | uchar emm[258];
|
---|
512 | uchar l;
|
---|
513 | uchar caid[2];
|
---|
514 | uchar provid[4];
|
---|
515 | uchar hexserial[8];
|
---|
516 | uchar type;
|
---|
517 | int cidx;
|
---|
518 | } GCC_PACK EMM_PACKET;
|
---|
519 |
|
---|
520 | extern int pfd, rfd, fd_c2m, fd_m2c, cs_idx, *c_start, cs_ptyp, cs_dblevel, cs_hw;
|
---|
521 | extern int *logidx, *loghistidx, *log_fd;
|
---|
522 | extern int is_server, *mcl;
|
---|
523 | extern uchar mbuf[1024];
|
---|
524 | extern ushort cam_common_len4caid[256];
|
---|
525 | extern pid_t master_pid;
|
---|
526 | extern struct s_ecm *ecmcache;
|
---|
527 | extern struct s_client *client;
|
---|
528 | extern struct s_reader *reader;
|
---|
529 |
|
---|
530 | extern struct card_struct *Cards;
|
---|
531 | extern struct idstore_struct *idstore;
|
---|
532 | extern unsigned long *IgnoreList;
|
---|
533 |
|
---|
534 | extern struct s_config *cfg;
|
---|
535 | extern char cs_confdir[], *loghist;
|
---|
536 | extern EMM_PACKET epg;
|
---|
537 | extern struct s_module ph[CS_MAX_MOD];
|
---|
538 | extern ECM_REQUEST *ecmtask;
|
---|
539 | extern char logfile[256];
|
---|
540 |
|
---|
541 | extern int ridx, logfd;
|
---|
542 |
|
---|
543 | #endif // __GLOBALS_H__
|
---|