-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathconfig.h
843 lines (709 loc) · 20 KB
/
config.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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
#if 0
#
# Copyright (c) 2014 - 2015 Javier Sayago <admin@lonasdigital.com>
# Contact: javilonas@esp-desarrolladores.com
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
#endif
#define KEEPALIVE_NEWCAMD 80
#if TARGET == 3
#define MAX_SIDS 1024
#else
#define MAX_SIDS 4096
#endif
#define MAX_CSPORTS 512 // 200 default
struct chninfo_data
{
struct chninfo_data *next;
unsigned short sid;
unsigned short caid;
unsigned int prov;
char name[0];
};
struct sid_data
{
struct sid_data *next;
//uint8 nodeid[8]; // CCcam nodeid card real owner, each server has many cards(locals+remote) and propably each server has different locals
unsigned short sid;
//unsigned short caid;
unsigned int prov;
int val;
};
#if TARGET == 3
#define CARD_MAXPROV 16 // 16 default
#else
#define CARD_MAXPROV 32 // 32 default
#endif
struct cs_card_data
{
struct cs_card_data *next;
unsigned int shareid; // This is for CCcam
unsigned int localid; // This is for Fake CCcam Cards
#ifdef CCCAM_CLI
unsigned char uphops; // Max distance to get cards
unsigned char dnhops;
uint8_t nodeid[8]; // CCcam nodeid card real owner
#endif
struct sid_data *sids;
// ECM Statistics
int ecmerrdcw; // null DCW/failed DCW checksum (diffeent dcw)
int ecmnb; // number of ecm's requested
int ecmok; // dcw returned to client
int ecmoktime;
unsigned short caid; // Card CAID
int nbprov; // Nb providers
unsigned int prov[CARD_MAXPROV]; // Card Providers
};
struct host_data
{
struct host_data *next;
char name[256];
unsigned int ip;
unsigned int checkiptime;
unsigned int clip; // client ip
};
/*
ECM total: 0 (average rate: 0/s)
ECM forwards: 0
ECM cache hits: 0
ECM denied: 0
ECM filtered: 0
ECM failures: 0
EMM total: 0
*/
#define CACHE_091 0
#define CACHE_090 1
#define CACHE_PROG_DEFAULT 0
#define CACHE_PROG_CSP 1
#define CACHE_PROG_NEWBOX 2
#define CACHE_PROG_MULTICS 3
#define CACHE_PROG_NCAM 4
#define CACHE_PROG_OSCAM 5
struct cs_cachepeer_data
{
// Config data
struct cs_cachepeer_data *next;
struct host_data *host;
unsigned short port;
unsigned short csport[MAX_CSPORTS];
int fblock0onid;
int fsendrep;
//## Runtime Data
unsigned int id; // unique id
int outsock;
int disabled; // 0:Enable/1:Disable Client
unsigned short recvport;
unsigned int lastactivity;
int ping; // <=0 : inactive
unsigned int lastpingsent; // last ping sent to peer
unsigned int lastpingrecv; // last ping received from peer after a ping request
char program[64];
char version[64]; // cache version old:090/new:091 (by default 091 new)
int ipoll;
//Stat
/*
int sentreq;
int sentrep;
int totreq; // total received requests (+errors)
int totrep; // total received replies (+errors)
int rep_badheader; // wrong header
int rep_badfields; // badfields blocked replies
int rep_failed; // failed replies
int rep_baddcw;
*/
int reqnb; // Total Requests (Good+Bad)
int reqok; // Good Requests
int repok; // Replies without request
int hitnb; // All DCW transferred to clients
int ihitnb; // Instant Hits
int hitfwd; // Hits forwarded to peer
int ihitfwd; // Instant Hits Forwarded to peer
//Last Used Cached data
uint16 lastcaid;
uint32 lastprov;
uint16 lastsid;
uint32 lastdecodetime;
};
struct ip_hacker_data {
struct ip_hacker_data *next;
uint32 ip;
char user[256];
uint32 lastseen;
int count;
int nbconn;
};
///////////////////////////////////////////////////////////////////////////////
typedef enum
{
STAT_DCW_SENT, // no ecm found / DCW was sent to client
STAT_ECM_SENT, // ECM was sent to server
STAT_ECM, // ECM is waiting to be send
STAT_DCW // DCW is waiting to be send
} sendstatus_type;
// CLIENT FLAGS
//client is in config
#define FLAGCLI_CONFIG 1
//clietn is deleted dont receive good cw
#define FLAGCLI_DELETED 4
struct client_info_data
{
struct client_info_data *next;
char name[128];
char value[512];
};
struct cs_client_data
{
struct cs_client_data *next;
int disabled; // 0:Enable/1:Disable Client
unsigned int id; // unique id
// User/Pass
char user[128];
char pass[128];
//
unsigned char type; // Clients type: NEWCAMD
unsigned char flags;
// Card
struct cs_card_data card;
//DCW Config
unsigned int dcwtime; // minimum time interval (from Receiving ECM to sending CW) to client
int dcwtimeout; // decode timeout interval in ms
// Client Info.
struct client_info_data *info;
char *realname;
//## Runtime Data (DYNAMIC)
unsigned int ip;
int handle;
int ipoll;
uint32 chkrecvtime; // message recv time
//
unsigned short progid; // program id ex: 0x4343=>CCcam/ 0x0000=>Generic
// Connection time
unsigned int uptime;
unsigned int connected;
unsigned int ping; // ping time;
// Session Key
unsigned char sessionkey[16];
// ECM Stat
int ecmnb; // ecm number requested by client
int ecmdenied; // ecm number requested by client
int ecmok; // dcw returned to client
int ecmoktime;
unsigned int lastecmtime; // Last ecm time, if it was more than 5mn so reconnect to client
unsigned int lastdcwtime; // last good dcw time sent to client
int cachedcw; // dcw from client
// ECM
struct {
int busy; // if ecmbusy dont process anyother ecm until that current ecm was finished
sendstatus_type status; // answer was sent to client?
// Ecm Data
uint32 recvtime; // ECM Receive Time in ms
int dcwtime; //depend on last ecm time
int id;
uint32 hash; // to check for ecm
int climsgid; // MessageID for the ecm request
//Last Used Share Saved data
int lastid;
uint16 lastcaid;
uint32 lastprov;
uint16 lastsid;
int laststatus; // 1:success, 0:failed
uint32 lastdecodetime;
// DCW SOURCE
int lastdcwsrctype;
int lastdcwsrcid;
uint32 lastcardid;
} ecm;
};
#ifdef RADEGAST_SRV
struct rdgd_client_data { // Connected Client
struct rdgd_client_data *next;
int disabled; // 0:Enable/1:Disable Client
unsigned int id; // unique id
struct client_info_data *info;
char *realname;
//## Runtime Data (DYNAMIC)
unsigned int ip;
int handle;
int ipoll;
uint32 chkrecvtime; // message recv time
// Connection time
unsigned int connected;
unsigned char type;
// ECM Stat
int ecmnb; // ecm number requested by client
int ecmdenied; // ecm number requested by client
int ecmok; // dcw returned to client
int ecmoktime;
unsigned int lastecmtime; // Last ecm time, if it was more than 5mn so reconnect to client
unsigned int lastdcwtime; // last good dcw time sent to client
//
int freeze; //a freeze: is a decode failed to a channel opened last time within 3mn
struct {
int busy; // if ecmbusy dont process anyother ecm until that current ecm was finished
sendstatus_type status; // answer was sent to client?
// Ecm Data
uint32 recvtime; // ECM Receive Time in ms
int dcwtime; //depend on last ecm time
int id;
//Last Used Share Saved data
uint16 lastcaid;
uint32 lastprov;
uint16 lastsid;
int laststatus;
// DCW SOURCE
int lastdcwsrctype;
int lastdcwsrcid;
uint32 lastcardid;
uint32 lastdecodetime;
char *statmsg; // DCW Status Message
} ecm;
};
#endif
// cs : newcamd
// cc : cccam
struct cardserver_data
{
struct cardserver_data *next;
int disabled; // 0:Enable/1:Disable Client
unsigned int id; // unique id
char name[128];
//NEWCAMD SERVER
struct cs_client_data *client;
unsigned char key[16];
int port; // output port
SOCKET handle;
int ipoll;
#ifdef RADEGAST_SRV
struct {
struct rdgd_client_data *client;
int port; // output port
SOCKET handle;
int ipoll;
} rdgd;
#endif
//CARD
struct cs_card_data card;
unsigned short onid;
//DCW Config
unsigned int dcwtime; // minimum time interval to send decode answer to client
int dcwtimeout; // decode timeout in ms
#ifdef CHECK_NEXTDCW
uint16 checkdcw;
#endif
int maxfailedecm; // Max failed ecm per sid
int cachetimeout;
int usecache;
int cachehits; // total cache hits
int cacheihits; // instant cache hits
int faccept0sid;
int faccept0provider;
int faccept0caid;
int fallowcccam; // Allow cccam server protocol to decode ecm
int fallowmgcamd; // Allow mgcamd server protocol to decode ecm
int fallownewcamd; // Allow newcamd server protocol to decode ecm
int fallowradegast;
int fmaxuphops; // allowed cards distance to decode ecm
int cssendcaid; // flag send caid to servers
int cssendprovid; // flag send provid to servers
int cssendsid; // flag send sid to servers
//Servers Config
int csmax; // Maximum sevrer nb available to decode one ecm request
int csfirst; // on start request servers number
unsigned int csinterval; // interval between 2 same ecm request to diffrent server
unsigned int cstimeout; // timeout for resending ecm request to server
unsigned int cstimeperecm; // min time to senddo a request
unsigned int csvalidecmtime; // max server ecm reply time
int csretry; // Newcamd Retries
int ccretry; // CCcam Retries
#ifdef RADEGAST_CLI
int rdgdretry; // Radegast Retries
#endif
// ECM Stat
int ecmaccepted; // accepted ecm
int ecmdenied; // denied/filtred ecm
int ecmok; // good dcw
int ecmoktime;
int ttime[101]; // contains number of dcw/time (0.0s,0.1s,0.2s ... 2.9s)
int ttimecache[101]; // for cache only
int ttimecards[101]; // for cards only
int ttimeclients[101]; // for cards only
unsigned int lastecmtime; // Last ecm time, if it was more than 5mn so reconnect to client
unsigned int lastdcwtime; // last good dcw time sent to client
void *lastecm;
int isdeniedsids;
unsigned short *sids; // global Accept sids
int ecmbusysrv; // nb of ecm returned with busy srv
};
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
//server is in config
#define FLAGSRV_CONFIG 1
// Server/client type
#define TYPE_NEWCAMD 1
#define TYPE_CCCAM 2
#define TYPE_GBOX 3
#define TYPE_RADEGAST 4
#define TYPE_CLONE 5
#define TYPE_OSCAM 6
#define TYPE_NEWBOX 7
#define TYPE_MULTICS 8
#define TYPE_MGCAMD 9
#define TYPE_NCAM 10
struct cs_server_data
{
struct cs_server_data *next;
int disabled; // 0:Enable/1:Disable Client
unsigned int id; // unique id
// Config DATA
unsigned char type; // Clients type: NEWCAMD/CCcam
unsigned short csport[MAX_CSPORTS];
struct host_data *host;
int port;
char user[128];
char pass[128];
//Newcamd
unsigned char key[16];
// DYNAMIC DATA
char *progname; // Known names
char version[64];
unsigned char flags;
unsigned char sessionkey[16];
int cscached; // flag for newcamd cached servers
int error;
char *statmsg; // Connection Status Message
//CCcam additional data
#ifdef CCCAM_CLI
struct cc_crypt_block sendblock; // crypto state block
struct cc_crypt_block recvblock; // crypto state block
unsigned char nodeid[8];
char build[32];
unsigned char uphops; // share limit
#endif
//Connection Data
SOCKET handle;
int ipoll;
uint32 chkrecvtime; // message recv time
unsigned int connected;
unsigned int uptime; // in ms
struct cs_card_data *card;
// TCP Connection Keepalive
unsigned int ping; // ping time;
unsigned int keepalivetime; // CON: last Keepalive sent time / DIS: start time for trying connection
int keepalivesent; // CON: Keepalive packet was sent to server and we have no response. / DIS: Retry number of reconnection
// ECM Statistics
int ecmtimeout; // number of errors for timeout (no cw returned by server)
int ecmerrdcw; // null DCW/failed DCW checksum (diffeent dcw)
int ecmnb; // total number of ecm requests
int ecmok; // dcw returned to client
int ecmoktime;
int ecmperhr;
// CURRENT ECM DATA
int busy; // cardserver is busy (ecm was sent) / or not (no ecm sent/dcw returned)
int busyecmid; // ecm id
uint32 busyecmhash; // to check for ecm
struct cs_card_data *busycard; // card
uint32 busycardid; // card
int retry; // nb of retries of the current ecm request(for cccam, also for newcamd resend another ecm)
unsigned int lastecmoktime;
unsigned int lastecmtime; // Last ecm time, if it was more than 5mn so reconnect to client
unsigned int lastdcwtime; // last good dcw time sent to client
struct {
int csid;
int ecmnb;
int ecmok;
uint ecmoktime;
int hits; // Ecm hits got from this server
} cstat[MAX_CSPORTS];
};
#ifdef CCCAM_SRV
struct cc_client_data { // Connected Client
//### Config Data (STATIC)
struct cc_client_data *prev;
struct cc_client_data *next;
int disabled; // 0:Enable/1:Disable Client
unsigned int id; // unique id
//fline
char user[128];
char pass[128];
unsigned char dnhops; // Max Down Hops
unsigned int dcwtime;
unsigned short csport[MAX_CSPORTS]; // Max 16
unsigned char uphops; // Max distance to get cards
unsigned char shareemus; // Client use our emu
unsigned char allowemm; // Client has rights for au
// Client Info Data
struct client_info_data *info;
char *realname;
struct tm enddate;
struct host_data *host;
//## Runtime Data (DYNAMIC)
unsigned int ip;
int32_t handle; // SOCKET
int ipoll;
uint32 chkrecvtime; // message recv time
// CCcam Connection Data
struct cc_crypt_block sendblock; // crypto state block
struct cc_crypt_block recvblock; // crypto state block
// Connection time
unsigned int uptime;
unsigned int connected;
unsigned char nodeid[8];
char version[32];
char build[32];
int cardsent; // flag
// ECM Stat
int ecmnb; // ecm number requested by client
int ecmdenied; // ecm number requested by client
int ecmok; // dcw returned to client
int ecmoktime;
unsigned int lastecmtime; // Last ecm time, if it was more than 5mn so reconnect to client
unsigned int lastdcwtime; // last good dcw time sent to client
int freeze; //a freeze: is a decode failed to a channel opened last time within 3mn
struct {
int busy; // if ecmbusy dont process anyother ecm until that current ecm was finished
sendstatus_type status; // answer was sent to client?
unsigned int cardid;
// Ecm Data
uint32 recvtime; // ECM Receive Time in ms
int dcwtime; //depend on last ecm time
int id; //ecmid
uint32 hash; // to check for ecm
//Last Used Share Saved data
int lastid;
uint16 lastcaid;
uint32 lastprov;
uint16 lastsid;
int laststatus;
uint8 lastdcw[32];
int lastdcwsrctype;
int lastdcwsrcid;
uint32 lastcardid;
uint32 lastdecodetime;
char *statmsg; // DCW Status Message
} ecm;
};
#endif
#ifdef CCCAM
struct cccam_server {
#ifdef CCCAM_SRV
struct cc_client_data *client;
unsigned char key[16];
int port; // output port
SOCKET handle;
int ipoll;
unsigned short csport[MAX_CSPORTS]; // default cards
int dcwtime;
#endif
unsigned char nodeid[8];
char version[32];
char build[32];
#ifdef FREECCCAM_SRV
char user[128];
char pass[128];
int32_t maxusers;
#endif
struct cs_card_data *fakecard;
};
#endif
#ifdef MGCAMD_SRV
struct mg_client_data
{
struct mg_client_data *next;
int32_t disabled; // 0:Enable/1:Disable Client
unsigned int id; // unique id
// NEWCAMD SPECIFIC DATA
char user[128];
char pass[128];
unsigned short csport[MAX_CSPORTS];
// Client Info Data
struct client_info_data *info;
char *realname;
struct tm enddate;
struct host_data *host;
//DCW Config
unsigned int dcwtime; // minimum time interval (from Receiving ECM to sending CW) to client
int32_t dcwtimeout; // decode timeout interval in ms
//## Runtime Data (DYNAMIC)
unsigned int ip;
SOCKET handle;
int32_t ipoll;
uint32 chkrecvtime; // message recv time
unsigned short progid; // program id ex: 0x4343=>CCcam/ 0x0000=>Generic
unsigned char sessionkey[16];
// Connection time
unsigned int uptime;
unsigned int connected;
unsigned int ping; // ping time;
int32_t cardsent; // flag 0:none, 1:default, 2:all
// ECM Stat
int32_t ecmnb; // ecm number requested by client
int32_t ecmdenied; // ecm number requested by client
int32_t ecmok; // dcw returned to client
int32_t ecmoktime;
unsigned int lastecmtime; // Last ecm time, if it was more than 5mn so reconnect to client
unsigned int lastdcwtime; // last good dcw time sent to client
int32_t freeze;
int32_t cachedcw; // dcw from client
struct {
int32_t busy; // if ecmbusy dont process anyother ecm until that current ecm was finished
sendstatus_type status; // answer was sent to client?
// Ecm Data
uint32 recvtime; // ECM Receive Time in ms
int32_t dcwtime; //depend on last ecm time
int32_t id;
uint32 hash; // to check for ecm
int32_t climsgid;
//Last Used Share Saved data
int32_t lastid;
uint16 lastcaid;
uint32 lastprov;
uint16 lastsid;
int32_t laststatus;
// DCW SOURCE
int32_t lastdcwsrctype;
int32_t lastdcwsrcid;
uint32 lastcardid;
uint32 lastdecodetime;
} ecm;
};
struct mgcamd_server {
struct mg_client_data *client;
int32_t handle;
int32_t ipoll;
int32_t port; // output port
unsigned short csport[MAX_CSPORTS]; // default cards
unsigned char key[16];
int32_t dcwtime;
};
#endif
struct dcw_data {
struct dcw_data *next;
uchar dcw[32];
};
// Configurable Data
struct config_data
{
// Latest Identifiers
int32_t clientid;
int32_t serverid;
int32_t cardserverid; // Profiles
int32_t cachepeerid; //
struct dcw_data *bad_dcw;
// CACHE SERVERS
struct {
int32_t trackermode; // 0: normal mode, 1: trackermode
} cache;
struct cs_cachepeer_data *cachepeer;
int32_t cachesock;
int32_t cacheport;
int32_t cachecwtimeout;
int32_t cachehits; // Total Hits
int32_t cacheihits; // Instant Hits
int32_t cachereq; // Request sent
int32_t cacherep; // Replies
int32_t non0onid;
int32_t faccept0onid;
//SERVERS
int32_t newcamdclientid;
struct cs_server_data *server;
// Host List
struct host_data *host;
//CS PROFILES
struct cardserver_data *cardserver;
#ifdef CCCAM
int32_t cccamclientid;
struct cccam_server cccam;
#endif
#ifdef FREECCCAM_SRV
int32_t freecccamclientid;
struct cccam_server freecccam;
#endif
#ifdef MGCAMD_SRV
int32_t mgcamdclientid;
struct mgcamd_server mgcamd;
#endif
//WEBIF
#ifdef HTTP_SRV
struct {
int32_t port;
int32_t handle;
char user[128];
char pass[128];
} http;
#endif
void *lastecm;
uint msgwaittime; // in ms
uint cachewaittime; // in ms
};
// Static Data
struct program_data
{
int32_t restart;
struct timeval exectime; // last dcw time sent to client
struct chninfo_data *chninfo;
//PROCESS_ID
pid_t pid_main;
pid_t pid_cfg;
pid_t pid_dns;
pid_t pid_srv;
pid_t pid_msg;
pid_t pid_cache;
//THREAD_ID
pthread_t tid_cfg;
pthread_t tid_dns;
pthread_t tid_srv;
pthread_t tid_msg;
pthread_t tid_cache;
pthread_t tid_date;
pid_t pid_date;
pthread_mutex_t lockthreaddate;
pthread_mutex_t lockcache;
pthread_mutex_t lock; // ECM DATA(main data)
pthread_mutex_t lockcli; // CS Clients data
pthread_mutex_t locksrv; // CS Servers data
// THREADS
pthread_mutex_t locksrvth; // Servers connection thread
pthread_mutex_t locksrvcs; // Newcamd server
pthread_mutex_t lockdnsth; // DNS lookup Thread
#ifdef CCCAM_SRV
pthread_mutex_t lockcccli; // CCcam Clients data
pthread_mutex_t locksrvcc; // CCcam server
#endif
#ifdef FREECCCAM_SRV
pthread_mutex_t lockfreecccli; // FreeCCcam Clients data
pthread_mutex_t locksrvfreecc; // FreeCCcam server
#endif
pthread_mutex_t lockrdgdcli; // Radegast Clients
pthread_mutex_t lockrdgdsrv; // Radegast Server
#ifdef MGCAMD_SRV
pthread_mutex_t lockclimg; // CCcam Clients data
pthread_mutex_t locksrvmg; // CCcam server
#endif
pthread_mutex_t lockmain; // Check ECM/DCW Thread
pthread_mutex_t lockecm;
pthread_mutex_t lockhttp; // http Thread
pthread_mutex_t lockdns;
pthread_mutex_t lockdcw;
};
extern char config_file[512];
extern char config_badcw[512];
extern char config_channelinfo[512];
extern char cccam_nodeid[8];
extern char freecccam_nodeid[8];
void init_config(struct config_data *cfg);
int32_t read_config(struct config_data *cfg);
int32_t read_chinfo( struct program_data *prg );
void reread_config( struct config_data *cfg );
int32_t check_config(struct config_data *cfg);
int32_t done_config(struct config_data *cfg);