- Timestamp:
- 07/03/10 20:56:23 (14 years ago)
- Location:
- branches/modular
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/modular/Distribution/doc/man/oscam.server.5
r2614 r2628 331 331 .RE 332 332 .PP 333 \fBcccforceresendecm\fP = \fB0\fP|\fB1\fP 334 .RS 3n 335 1 = activates ECM resending when fallback reader timeout occurs, default: 0 336 .RE 337 338 .PP 333 339 \fBcccwantemu\fP = \fB0\fP|\fB1\fP 334 340 .RS 3n 335 341 1 = request to provide emu from CCCam server, too, default: 0 336 342 .RE 343 344 345 346 337 347 .SH OVERCLOCKING 338 348 .TP 3n -
branches/modular/Distribution/doc/txt/oscam.server.txt
r2614 r2628 1 oscam.server(5) 1 oscam.server(5) oscam.server(5) 2 2 3 3 … … 7 7 8 8 SYNOPSIS 9 The server configuration file for OSCam contains reader parameters. sections in oscam.server are recurring10 (morethan one reader possible). At least one [reader] section is required.9 The server configuration file for OSCam contains reader parameters. sections in oscam.server are recurring (more 10 than one reader possible). At least one [reader] section is required. 11 11 12 12 DESCRIPTIONS … … 24 24 constantcw: constant CW file name 25 25 26 constant CW file format: CA (4 digits):ID (6 digits):SID (4 digits):PMT PID (4 digits):ECM PID (4 dig‐27 its):key(16 Bytes seperated by spaces)26 constant CW file format: CA (4 digits):ID (6 digits):SID (4 digits):PMT PID (4 digits):ECM PID (4 digits):key 27 (16 Bytes seperated by spaces) 28 28 29 29 expample: 1234:123456:1234:1234:1234:00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F … … 66 66 67 67 logport = 0|port 68 camd3 reader logport, camd3 UDP must beactivated, only works if there's no camd3 cascading, 0=disabled,68 camd3 reader logport, camd3 UDP must be activated, only works if there's no camd3 cascading, 0=disabled, 69 69 default=0 70 70 … … 87 87 88 88 mhz = frequency 89 set reader frequency in units of 10 kHz, if mhz > cardmhz you are in overclocking mode, refer to OVERCLOCK‐90 ING,default:35789 set reader frequency in units of 10 kHz, if mhz > cardmhz you are in overclocking mode, refer to OVERCLOCKING, 90 default:357 91 91 92 92 deprecated = 0|1 93 Frist the SC will be initialized in normal mode. If it fails, the SC will be automatically reverted to dep‐94 recated mode, so that the SC speed will not be changed and the communication will remain on normal ATR95 speed of9600 baud.93 Frist the SC will be initialized in normal mode. If it fails, the SC will be automatically reverted to depre‐ 94 cated mode, so that the SC speed will not be changed and the communication will remain on normal ATR speed of 95 9600 baud. 96 96 97 97 1 = use deprecated SC mode only, default:0 … … 202 202 203 203 readnano = [path]filename 204 write file (usually a copy of a file saved by savenano) to your smartcard, if no path is specified, the 205 specified file is searched for in the configuration directory, only valid for physical readers, 206 default:none 204 write file (usually a copy of a file saved by savenano) to your smartcard, if no path is specified, the speci‐ 205 fied file is searched for in the configuration directory, only valid for physical readers, default:none 207 206 208 207 example: readnano = write.emm … … 230 229 231 230 cccdisableretryecm = 0|1 232 0 = enables ECM retrying: When an ECM request is denied from an CCCam server, OSCam immediatelly sends a233 new ECM request, 1= disables ECM retrying: When an ECM request is denied from an CCCam server, OSCam sends234 no newECM request, default:0231 0 = enables ECM retrying: When an ECM request is denied from an CCCam server, OSCam immediatelly sends a new 232 ECM request, 1= disables ECM retrying: When an ECM request is denied from an CCCam server, OSCam sends no new 233 ECM request, default:0 235 234 236 235 cccdisableautoblock = 0|1 237 0 = enables auto block: When an ECM request is send to an CCCam server, it tries the SC with the lowest 238 hop. If it is denied, the SID is blocked on this SC. When all SC are blocked, the CAID:PROV:SID information 239 is stored in a auto block list and is newer send again, 1= disabled auto block, default: 1 236 0 = enables auto block: When an ECM request is send to an CCCam server, it tries the SC with the lowest hop. If 237 it is denied, the SID is blocked on this SC. When all SC are blocked, the CAID:PROV:SID information is stored 238 in a auto block list and is newer send again, 1= disabled auto block, default: 1 239 240 cccforceresendecm = 0|1 241 1 = activates ECM resending when fallback reader timeout occurs, default: 0 242 240 243 241 244 cccwantemu = 0|1 242 245 1 = request to provide emu from CCCam server, too, default: 0 243 246 247 248 249 250 244 251 OVERCLOCKING 245 252 · Dreambox and other internal readers 246 253 247 For Dreambox and other internal readers the highest possible clockrate will be auto detected. The mhz248 parameter lets you override the values chosen by OSCam, if it differs from 357 and 358, but usually you249 will not set anyvalue for mhz.250 251 For certain Dreamboxes (especially PPC clones) the default mhz parameter leads to slow ECM times and/or252 "not found" ECMs. By setting mhz to values like 200, 300, 400, ... 1600 you can find a value that works for253 yourreceiver and your card. The higher the mhz value, the slower the ECM time (strange enough).254 255 If you choose the value too low, your card is not recognized (no ATR or "card not supported"). If you256 choose the value too high, you get slow ECM times. Our experience is that either no mhz line, or a line mhz257 = 1000works best.254 For Dreambox and other internal readers the highest possible clockrate will be auto detected. The mhz parameter 255 lets you override the values chosen by OSCam, if it differs from 357 and 358, but usually you will not set any 256 value for mhz. 257 258 For certain Dreamboxes (especially PPC clones) the default mhz parameter leads to slow ECM times and/or "not 259 found" ECMs. By setting mhz to values like 200, 300, 400, ... 1600 you can find a value that works for your 260 receiver and your card. The higher the mhz value, the slower the ECM time (strange enough). 261 262 If you choose the value too low, your card is not recognized (no ATR or "card not supported"). If you choose 263 the value too high, you get slow ECM times. Our experience is that either no mhz line, or a line mhz = 1000 264 works best. 258 265 259 266 · Phoenix / Smartmouse reader 260 267 261 Overclocking does not work with Windows and Mac OS X. Set mhz equivalent to the frequency of thereader.268 Overclocking does not work with Windows and Mac OS X. Set mhz equivalent to the frequency of the reader. 262 269 OSCam can not set the frequency of the reader. 263 270 … … 266 273 Set the reader frequency with the native Smargo Smartreader+ tool (srp_tools). Do not set mhz and cardmhz. 267 274 268 OSCam tries to set the baudrate automatically. A standard serial port has limited baudrate settings, so SC269 overclocking might not work. When using a serial reader the best way for overclocking is connecting it to a270 FTDIbased USB to serial port adapter.271 272 If overclocking does notwork, verify the effective baudrate in the logfile. If it deviates too much from the273 requested baudrate, the SC will not be recognized (no ATR) and the value for mhz should be adjusted again.274 Thehigher the baudrate, the more accurate the effective baudrate can be.275 OSCam tries to set the baudrate automatically. A standard serial port has limited baudrate settings, so SC over‐ 276 clocking might not work. When using a serial reader the best way for overclocking is connecting it to a FTDI 277 based USB to serial port adapter. 278 279 If overclocking does not work, verify the effective baudrate in the logfile. If it deviates too much from the 280 requested baudrate, the SC will not be recognized (no ATR) and the value for mhz should be adjusted again. The 281 higher the baudrate, the more accurate the effective baudrate can be. 275 282 276 283 EXAMPLES … … 365 372 366 373 SEE ALSO 367 list_smargo(1), oscam(1), oscam.ac(5), oscam.cert(5), oscam.conf(5), oscam.guess(5),oscam.ird(5),374 list_smargo(1), oscam(1), oscam.ac(5), oscam.cert(5), oscam.conf(5), oscam.guess(5), oscam.ird(5), 368 375 oscam.provid(5), oscam.services(5), oscam.srvid(5), oscam.user(5) 369 376 370 377 371 378 372 379 oscam.server(5) -
branches/modular/globals.h
r2614 r2628 574 574 char cc_build[5]; // cccam build number 575 575 int cc_maxhop; // cccam max distance 576 int 576 int cc_currenthops; // number of hops for CCCam 577 577 void *cc; // ptr to cccam internal data struct 578 578 int cc_disable_retry_ecm; //Schlocke 579 579 int cc_disable_auto_block; //Schlocke 580 int cc_force_resend_ecm; //Schlocke 580 581 int cc_want_emu; //Schlocke: Client want to have EMUs, 0 - NO; 1 - YES 581 582 uint cc_id; -
branches/modular/module-camd35.c
r2614 r2628 453 453 454 454 reader[ridx].tcp_connected = 1; 455 reader[ridx].card_status = CARD_INSERTED; 455 456 reader[ridx].last_s = reader[ridx].last_g = time((time_t *)0); 456 457 pfd = client[cs_idx].udp_fd = handle; … … 474 475 } 475 476 } 476 477 477 478 lastsrvid = er->srvid; 478 479 lastcaid = er->caid; … … 484 485 if (!is_udp && !tcp_connect()) return(-1); 485 486 487 reader[ridx].card_status = CARD_INSERTED; //for udp 488 486 489 memset(buf, 0, 20); 487 490 memset(buf + 20, 0xff, er->l+15); … … 561 564 if(buf[21] == 0xFF) { 562 565 stopped = 2; // server says sleep 566 reader[ridx].card_status = NO_CARD; 563 567 } else { 564 568 stopped = 1; // server says invalid 569 reader[ridx].card_status = CARD_FAILURE; 565 570 } 566 571 cs_log("%s CMD08 stop request by server (%s)", -
branches/modular/module-cccam.c
r2614 r2628 48 48 } 49 49 50 static int comp_timeb(struct timeb *tpa, struct timeb *tpb) 51 { 52 if (tpa->time>tpb->time) return(1); 53 if (tpa->time<tpb->time) return(-1); 54 if (tpa->millitm>tpb->millitm) return(1); 55 if (tpa->millitm<tpb->millitm) return(-1); 56 return(0); 57 } 58 50 59 static void cc_init_crypt(struct cc_crypt_block *block, uint8 *key, int len) { 51 60 int i = 0; … … 619 628 LLIST_ITR itr; 620 629 ECM_REQUEST *cur_er; 630 struct timeb cur_time; 631 cs_ftime(&cur_time); 621 632 622 633 if (!cc || (pfd < 1) || !reader[ridx].tcp_connected) { … … 624 635 er->rc = 0; 625 636 er->rcEx = 0x27; 626 cs_ log("%s server not init! ccinit=%d pfd=%d", getprefix(), cc ? 1637 cs_debug_mask(D_TRACE, "%s server not init! ccinit=%d pfd=%d", getprefix(), cc ? 1 627 638 : 0, pfd); 628 639 write_ecm_answer(&reader[ridx], fd_c2m, er); 629 630 if (cc) { cc->proxy_init_errors++; if631 (cc->proxy_init_errors > 20 ||632 ((cc->ecm_time+(time_t)(cfg->ctimeout/500))633 < time(NULL))) //TODO: Configuration?634 cc_cycle_connection();635 }636 640 } 637 641 return -1; … … 643 647 cc->just_logged_in = 0; 644 648 649 int force_resend_ecm = 0; 650 645 651 if (pthread_mutex_trylock(&cc->ecm_busy) == EBUSY) { //Unlock by NOK or ECM ACK 646 652 cs_debug_mask(D_TRACE, "%s ecm trylock: ecm busy, retrying later after msg-receive", 647 getprefix()); 648 cc->proxy_init_errors++; 649 650 if ((cc->proxy_init_errors > 20) || ((cc->ecm_time+(time_t)(cfg->ctimeout/250)) < time(NULL))) { //TODO: Configuration? 651 cs_debug_mask(D_TRACE, "%s unlocked-cycleconnection! ecm time %d timeout %ds time %d", getprefix(), 652 cc->ecm_time, cfg->ctimeout/250, time(NULL)); 653 cc_cycle_connection(); 654 } 655 return 0; //pending send... 653 getprefix()); 654 655 //force resend ecm and break lock when fallbacktimeout occured 656 struct timeb timeout = cur_time; 657 timeout.millitm += cfg->ftimeout; 658 timeout.time += timeout.millitm / 1000; 659 timeout.millitm = timeout.millitm % 1000; 660 force_resend_ecm = reader[ridx].cc_force_resend_ecm && comp_timeb(&cur_time, &timeout) > 0; 661 662 if (force_resend_ecm) { 663 cs_debug_mask(D_TRACE, "%s force_resend"); 664 } 665 else { 666 timeout = cur_time; 667 timeout.millitm += cfg->ctimeout*4; 668 timeout.time += timeout.millitm / 1000; 669 timeout.millitm = timeout.millitm % 1000; 670 671 if (comp_timeb(&cur_time, &timeout) > 0) { //TODO: Configuration? 672 cs_debug_mask(D_TRACE, "%s unlocked-cycleconnection! timeout %ds", getprefix(), 673 cfg->ctimeout*4/1000); 674 cc_cycle_connection(); 675 } 676 return 0; //pending send... 677 } 656 678 } 657 679 cs_debug("cccam: ecm trylock: got lock"); 658 cc->ecm_time = time(NULL); 659 cc->proxy_init_errors = 0; 680 cc->ecm_time = cur_time; 660 681 reader[ridx].available = 0; 661 682 … … 675 696 cur_er = &ecmtask[n]; 676 697 677 if ( crc32(0, cur_er->ecm, cur_er->l) == cc->crc) {698 if (!force_resend_ecm && crc32(0, cur_er->ecm, cur_er->l) == cc->crc) { 678 699 //cs_log("%s cur_er->rc=%d", getprefix(), cur_er->rc); 679 700 cur_er->rc = 99; //ECM already send … … 797 818 //reader[ridx].last_s = reader[ridx].last_g; 798 819 799 card = llist_itr_init(cc->cards, &itr);800 while (card) {801 if (card->caid == cur_er->caid) { // caid matches802 LLIST_ITR sitr;803 struct cc_srvid *srvid = llist_itr_init(card->badsids, &sitr);804 while (srvid) {805 if (sid_eq(srvid, &cur_srvid)) {806 free(srvid);807 srvid = llist_itr_remove(&sitr);808 }809 else810 srvid = llist_itr_next(&sitr);811 }812 }813 card = llist_itr_next(&itr);814 }820 //card = llist_itr_init(cc->cards, &itr); 821 //while (card) { 822 // if (card->caid == cur_er->caid) { // caid matches 823 // LLIST_ITR sitr; 824 // struct cc_srvid *srvid = llist_itr_init(card->badsids, &sitr); 825 // while (srvid) { 826 // if (sid_eq(srvid, &cur_srvid)) { 827 // free(srvid); 828 // srvid = llist_itr_remove(&sitr); 829 // } 830 // else 831 // srvid = llist_itr_next(&sitr); 832 // } 833 // } 834 // card = llist_itr_next(&itr); 835 //} 815 836 816 837 if (!reader[ridx].cc_disable_auto_block) { … … 867 888 reader[ridx].available = 0; 868 889 cc->current_ecm_cidx = 0; 869 cc->proxy_init_errors = 0;870 890 cc->just_logged_in = 0; 871 c c->ecm_time = time(NULL);891 cs_ftime(&cc->ecm_time); 872 892 873 893 cs_debug_mask(D_EMM, "%s emm send for card %08X", getprefix(), b2i(4, emmbuf+7)); … … 891 911 cs_log("%s server not init! ccinit=%d pfd=%d", getprefix(), cc ? 1 : 0, 892 912 pfd); 893 cc->proxy_init_errors++;894 if (cc->proxy_init_errors > 20) //TODO: Configuration?895 cc_cycle_connection();896 913 return 0; 897 914 } … … 1869 1886 cc->ecm_counter = 0; 1870 1887 cc->max_ecms = 0; 1871 cc->proxy_init_errors = 0;1872 1888 //cc->current_ecm_cidx = 0; 1873 1889 cc->cmd05_mode = MODE_UNKNOWN; … … 1985 2001 } 1986 2002 1987 int min(int a, int b) {1988 if (a < b)1989 return a;1990 else1991 return b;1992 }1993 1994 2003 /** 1995 2004 * Server: … … 2000 2009 int j; 2001 2010 uint id, r, k; 2002 uint8 hop = 0, reshare, usr_reshare, reader_reshare, maxhops, flt = 0; 2011 uint8 hop = 0; 2012 int reshare, usr_reshare, reader_reshare, maxhops, flt = 0; 2003 2013 uint8 buf[CC_MAXMSGSIZE]; 2004 2014 struct cc_data *cc = client[cs_idx].cc; … … 2013 2023 } 2014 2024 2015 if (!usr_reshare)2016 return 0;2017 2018 2025 if (!cc->report_carddata_id) 2019 2026 id = 0x64; … … 2026 2033 if (!(reader[r].grp & client[cs_idx].grp)) continue; 2027 2034 reader_reshare = reader[r].cc_reshare; 2028 if (!reader_reshare) continue; 2029 2030 reshare = min(reader_reshare-1, usr_reshare-1); 2035 2036 reshare = (reader_reshare < usr_reshare) ? reader_reshare : usr_reshare; 2037 if (reshare < 0) 2038 continue; 2039 2031 2040 flt = 0; 2032 2041 if (/*!reader[r].caid[0] && */reader[r].ftab.filts) { -
branches/modular/module-cccam.h
r2614 r2628 132 132 uint32 send_ecmtask; 133 133 uint32 recv_ecmtask; 134 int proxy_init_errors;135 134 136 135 int current_ecm_cidx; //index to last current_card (reader) … … 140 139 pthread_mutex_t lock; 141 140 pthread_mutex_t ecm_busy; 142 time_tecm_time;141 struct timeb ecm_time; 143 142 time_t answer_on_keepalive; 144 143 }; -
branches/modular/module-dvbapi.c
r2614 r2628 26 26 unsigned short EMM_PID; 27 27 int checked; 28 int notfound;28 int status; 29 29 unsigned char table; 30 30 } ECMPIDSTYPE; … … 53 53 ECMPIDSTYPE ECMpids[ECM_PIDS]; 54 54 int pidindex; 55 int tries; 55 56 unsigned short program_number; 56 57 unsigned short STREAMpidcount; … … 172 173 int dvbapi_stop_filter(int demux_index, int type); 173 174 175 #define cs_log(x...) cs_log("dvbapi: "x) 176 #define cs_debug(x...) cs_debug("dvbapi: "x) 177 174 178 int dvbapi_set_filter(int demux_id, int api, unsigned short pid, uchar *filt, uchar *mask, int timeout, int pidindex, int count, int type) { 175 179 int ret=-1,n=-1,i,dmx_fd; … … 178 182 179 183 if (i>=MAX_FILTER) { 180 cs_log(" dvbapi:no free filter");184 cs_log("no free filter"); 181 185 return -1; 182 186 } … … 231 235 232 236 if (ret < 0) 233 cs_debug(" dvbapi:could not start demux filter (Errno: %d)", errno);237 cs_debug("could not start demux filter (Errno: %d)", errno); 234 238 235 239 return ret; … … 293 297 if (ret < 0) return 0; 294 298 295 cs_debug(" dvbapi:Detected %s Api: %d", device_path, selected_api);299 cs_debug("Detected %s Api: %d", device_path, selected_api); 296 300 297 301 return 1; … … 312 316 313 317 if (len==-1) 314 cs_log(" dvbapi:read error %d on fd %d", errno, dmx_fd);318 cs_log("read error %d on fd %d", errno, dmx_fd); 315 319 316 320 return len; … … 343 347 344 348 if (dmx_fd<=0) 345 cs_debug(" dvbapi:error opening device %s (Errno: %d)", device_path, errno);346 } 347 348 cs_debug(" dvbapi:DEVICE open (%s) fd %d", device_path, dmx_fd);349 cs_debug("error opening device %s (Errno: %d)", device_path, errno); 350 } 351 352 cs_debug("DEVICE open (%s) fd %d", device_path, dmx_fd); 349 353 return dmx_fd; 350 354 } … … 378 382 uchar filter[32]; 379 383 380 cs_debug(" dvbapi:set filter pid: %04x", pid);384 cs_debug("set filter pid: %04x", pid); 381 385 382 386 memset(filter,0,32); … … 401 405 402 406 if (!memcmp(demux[demux_index].rdr->hexserial, nullserial, 8)) { 403 //cs_debug(" dvbapi:hexserial not set %s", cs_hexdump(1, demux[demux_index].rdr->hexserial, 8));407 //cs_debug("hexserial not set %s", cs_hexdump(1, demux[demux_index].rdr->hexserial, 8)); 404 408 return; 405 409 } … … 476 480 ca_pid2.index = index; 477 481 if (ioctl(demux[demux_id].ca_fd, CA_SET_PID, &ca_pid2)==-1) 478 cs_debug(" dvbapi:Error Stream SET_PID");482 cs_debug("Error Stream SET_PID"); 479 483 } 480 484 break; … … 486 490 int i; 487 491 488 cs_debug(" dvbapi:stop descrambling (demux_id: %d)", demux_id);492 cs_debug("stop descrambling (demux_id: %d)", demux_id); 489 493 490 494 dvbapi_stop_filter(demux_id, TYPE_ECM); … … 503 507 if (needed==0) { 504 508 close(demux[demux_id].ca_fd); 505 cs_debug(" dvbapi:closing ca device");509 cs_debug("closing ca device"); 506 510 } 507 511 … … 517 521 int i; 518 522 519 cs_log(" dvbapi:Start descrambling CAID: %04x", caid);523 cs_log("Start descrambling CAID: %04x", caid); 520 524 521 525 for (i=0; i<demux[demux_index].ECMpidcount && demux[demux_index].ECMpids[i].CAID != caid && demux[demux_index].ECMpids[i].ECM_PID != pid; i++); 522 526 523 527 if (i>=demux[demux_index].ECMpidcount) { 524 cs_log(" dvbapi:could not find pid %04X", pid);528 cs_log("could not find pid %04X", pid); 525 529 return; 526 530 } … … 567 571 568 572 void dvbapi_resort_ecmpids(int demux_index) { 569 ECMPIDSTYPE tmppids[ECM_PIDS],tmppids2[ECM_PIDS]; 570 int tmppidcount=0,tmppid2count=0,n,i,k=0,j; 571 572 for (i=0;i<MAX_CAID;i++) 573 global_caid_list[i]=0; 573 int n,i,k=0,j; 574 575 memset(global_caid_list, 0, sizeof global_caid_list); 574 576 575 577 for (i=0;i<CS_MAXREADER;i++) { 576 for (j=0;j<CS_MAXREADER ;j++) {577 if (reader[i].caid[j] != 0 && reader[i].card_status > NO_CARD) {578 for (j=0;j<CS_MAXREADERCAID;j++) { 579 if (reader[i].caid[j] != 0 && !(reader[i].typ & R_IS_NETWORK)) { 578 580 if (k+1>=MAX_CAID) break; 579 581 global_caid_list[k++]=reader[i].caid[j]; … … 581 583 } 582 584 } 585 583 586 for (n=0; n<demux[demux_index].ECMpidcount; n++) { 584 if ((i=dvbapi_check_array(cfg->dvbapi_ignoretab.caid, CS_MAXCAIDTAB, demux[demux_index].ECMpids[n].CAID))>=0 && cfg->dvbapi_ignoretab.mask[i] == 0) { 585 cs_debug("-> ignore %04x", demux[demux_index].ECMpids[n].CAID); 586 } else if (dvbapi_check_array(global_caid_list, MAX_CAID, demux[demux_index].ECMpids[n].CAID)>=0) { 587 cs_debug("-> caid list %04x", demux[demux_index].ECMpids[n].CAID); 588 tmppids[tmppidcount++]=demux[demux_index].ECMpids[n]; 589 } else if (dvbapi_check_array(cfg->dvbapi_prioritytab.caid, CS_MAXCAIDTAB, demux[demux_index].ECMpids[n].CAID)>=0) { 590 cs_debug("-> priority %04x", demux[demux_index].ECMpids[n].CAID); 591 tmppids[tmppidcount++]=demux[demux_index].ECMpids[n]; 592 } else { 593 tmppids2[tmppid2count++]=demux[demux_index].ECMpids[n]; 594 } 595 } 596 597 for (n=0;n<tmppid2count;n++) 598 tmppids[tmppidcount++]=tmppids2[n]; 599 600 for (n=0; n<tmppidcount; n++) 601 demux[demux_index].ECMpids[n]=tmppids[n]; 602 603 demux[demux_index].ECMpidcount=tmppidcount; 604 cs_debug("dvbapi: ECMpidscount is now %d", demux[demux_index].ECMpidcount); 587 demux[demux_index].ECMpids[n].status=2; 588 for (i=0;i<CS_MAXCAIDTAB;i++) { 589 ulong provid = (cfg->dvbapi_ignoretab.cmap[i] << 8 | cfg->dvbapi_ignoretab.mask[i]); 590 if (cfg->dvbapi_ignoretab.caid[i] == demux[demux_index].ECMpids[n].CAID && (provid == demux[demux_index].ECMpids[n].PROVID || provid == 0)) { 591 demux[demux_index].ECMpids[n].status=0; //ignore 592 cs_debug("[IGNORE PID %d] %04X:%06X", n, demux[demux_index].ECMpids[n].CAID, demux[demux_index].ECMpids[n].PROVID); 593 } 594 } 595 596 for (i=0;i<CS_MAXCAIDTAB;i++) { 597 ulong provid = (cfg->dvbapi_prioritytab.cmap[i] << 8 | cfg->dvbapi_prioritytab.mask[i]); 598 if (cfg->dvbapi_prioritytab.caid[i] == demux[demux_index].ECMpids[n].CAID && (provid == demux[demux_index].ECMpids[n].PROVID || provid == 0 || demux[demux_index].ECMpids[n].PROVID == 0)) { 599 demux[demux_index].ECMpids[n].status=1; //priority 600 cs_debug("[PRIORITIZE PID %d] %04X:%06X", n, demux[demux_index].ECMpids[n].CAID, demux[demux_index].ECMpids[n].PROVID); 601 } 602 } 603 } 605 604 606 605 return; 606 } 607 608 void dvbapi_add_ecmpid(int demux_id, ushort caid, ushort ecmpid, ulong provid) { 609 int n,added=0; 610 611 for (n=0;n<demux[demux_id].ECMpidcount;n++) { 612 if (demux[demux_id].ECMpids[n].CAID == caid && demux[demux_id].ECMpids[n].ECM_PID == ecmpid) 613 added=1; 614 } 615 616 if (added==0) { 617 demux[demux_id].ECMpids[demux[demux_id].ECMpidcount].ECM_PID = ecmpid; 618 demux[demux_id].ECMpids[demux[demux_id].ECMpidcount].CAID = caid; 619 demux[demux_id].ECMpids[demux[demux_id].ECMpidcount].PROVID = provid; 620 cs_log("[ADD PID %d] CAID: %04X\tECM_PID: %04X\tPROVID: %06X", demux[demux_id].ECMpidcount, caid, ecmpid, provid); 621 demux[demux_id].ECMpidcount++; 622 } 607 623 } 608 624 609 625 void dvbapi_parse_descriptor(int demux_id, int i, unsigned int info_length, unsigned char *buffer) { 610 626 //int ca_pmt_cmd_id = buffer[i + 5]; 611 unsigned int descriptor_length=0 ;612 unsigned int added,j,n;627 unsigned int descriptor_length=0,index=0; 628 unsigned int j,u; 613 629 614 630 if (info_length<1) … … 616 632 617 633 for (j = 0; j < info_length - 1; j += descriptor_length + 2) { 618 descriptor_length = buffer[i + j + 7];619 int descriptor_ca_system_id = (buffer[i + j + 8] << 8) | buffer[i + j + 9];620 int descriptor_ca_ pid = ((buffer[i + j + 10] & 0x1F) << 8) | buffer[i + j + 11];621 622 cs_debug("type: %02x\tcaid: %04x\tca_pid: %04x\tlength: %d", buffer[i + j + 6], descriptor_ca_system_id, descriptor_ca_pid, descriptor_length);634 index = i + j + 6; 635 descriptor_length = buffer[index + 1]; 636 int descriptor_ca_system_id = (buffer[index + 2] << 8) | buffer[index + 3]; 637 int descriptor_ca_pid = ((buffer[index + 4] & 0x1F) << 8) | buffer[index + 5]; 638 int descriptor_ca_provider = 0; 623 639 624 640 if (demux[demux_id].ECMpidcount>=ECM_PIDS) 625 641 break; 626 642 627 if (buffer[i + j + 6] == 0x09) { 628 //Seca workaround 629 if (descriptor_ca_system_id >> 8 == 0x01) { 630 uint u, index = i + j + 6; 631 int ecm_pid, ecm_id; 632 for ( u=2; u<descriptor_length; u+=15 ) { 633 ecm_pid = ((buffer[index+2+u] & 0x1F) << 8) | buffer[index+2+u+1]; 634 added=0; 635 for (n=0;n<demux[demux_id].ECMpidcount;n++) { 636 if (demux[demux_id].ECMpids[n].CAID==descriptor_ca_system_id && demux[demux_id].ECMpids[n].ECM_PID==ecm_pid) 637 added=1; 638 } 639 if (added==0) { 640 demux[demux_id].ECMpids[demux[demux_id].ECMpidcount].ECM_PID=ecm_pid; 641 demux[demux_id].ECMpids[demux[demux_id].ECMpidcount++].CAID=descriptor_ca_system_id; 642 ecm_id = (buffer[index+2+u+2] << 8) | buffer[index+2+u+3]; 643 cs_debug("typ: %02x ca_system_id: %04x ca_pid: %04x ecm_id: %04x", buffer[index], descriptor_ca_system_id, ecm_pid, ecm_id); 644 } 645 } 646 } else { 647 added=0; 648 for (n=0;n<demux[demux_id].ECMpidcount;n++) { 649 if (demux[demux_id].ECMpids[n].CAID==descriptor_ca_system_id && demux[demux_id].ECMpids[n].ECM_PID==descriptor_ca_pid) 650 added=1; 651 } 652 if (added==0) { 653 demux[demux_id].ECMpids[demux[demux_id].ECMpidcount].ECM_PID=descriptor_ca_pid; 654 demux[demux_id].ECMpids[demux[demux_id].ECMpidcount++].CAID=descriptor_ca_system_id; 655 } 656 } 657 } 658 } 659 } 660 661 void dvbapi_try_caid(int demux_index, int num) { 662 //stop all ecm filter on demux 663 dvbapi_stop_filter(demux_index, TYPE_ECM); 664 665 if (demux[demux_index].ECMpids[num].notfound>2) { 666 cs_log("dvbapi: can't decode channel"); 643 cs_debug("[pmt] type: %02x\tlength: %d", buffer[i + j + 6], descriptor_length); 644 645 if (buffer[index] != 0x09) continue; 646 647 if (descriptor_ca_system_id >> 8 == 0x01) { 648 for (u=2; u<descriptor_length; u+=15) { 649 descriptor_ca_pid = ((buffer[index+2+u] & 0x1F) << 8) | buffer[index+2+u+1]; 650 descriptor_ca_provider = (buffer[index+2+u+2] << 8) | buffer[index+2+u+3]; 651 dvbapi_add_ecmpid(demux_id, descriptor_ca_system_id, descriptor_ca_pid, descriptor_ca_provider); 652 } 653 } else { 654 if (descriptor_ca_system_id >> 8 == 0x05 && descriptor_length == 0x0F && buffer[index + 12] == 0x14) 655 descriptor_ca_provider = buffer[index + 14] << 16 | (buffer[index + 15] << 8| (buffer[index + 16] & 0xF0)); 656 657 dvbapi_add_ecmpid(demux_id, descriptor_ca_system_id, descriptor_ca_pid, descriptor_ca_provider); 658 } 659 } 660 } 661 662 void dvbapi_try_next_caid(int demux_id) { 663 int num=-1, n, j; 664 665 if (demux[demux_id].tries > 2) { 666 cs_log("can't decode channel"); 667 667 return; 668 668 } 669 669 670 cs_debug("dvbapi: trying CAID: %04x CA_PID: %04x", demux[demux_index].ECMpids[num].CAID, demux[demux_index].ECMpids[num].ECM_PID); 670 for (j=1; j<3 && num == -1; j++) { 671 for (n=0; n<demux[demux_id].ECMpidcount; n++) { 672 if (demux[demux_id].ECMpids[n].checked == 0 && demux[demux_id].ECMpids[n].status == j) { 673 num=n; 674 break; 675 } 676 } 677 } 678 679 if (num==-1) { 680 demux[demux_id].tries++; 681 cs_log("try pids again #%d", demux[demux_id].tries); 682 for (n=0; n<demux[demux_id].ECMpidcount; n++) { 683 demux[demux_id].ECMpids[n].checked=0; 684 } 685 dvbapi_try_next_caid(demux_id); 686 return; 687 } 688 689 dvbapi_stop_filter(demux_id, TYPE_ECM); 690 691 cs_debug("[TRY PID %d] CAID: %04X PROVID: %06X CA_PID: %04X", num, demux[demux_id].ECMpids[num].CAID, demux[demux_id].ECMpids[num].PROVID, demux[demux_id].ECMpids[num].ECM_PID); 671 692 672 693 //grep ecm 673 dvbapi_start_filter(demux_i ndex, num, demux[demux_index].ECMpids[num].ECM_PID, 0x80, 0xF0, TYPE_ECM); //ECM674 demux[demux_i ndex].ECMpids[num].checked=1;694 dvbapi_start_filter(demux_id, num, demux[demux_id].ECMpids[num].ECM_PID, 0x80, 0xF0, TYPE_ECM); //ECM 695 demux[demux_id].ECMpids[num].checked=1; 675 696 } 676 697 … … 698 719 699 720 if (demux_id>=MAX_DEMUX) { 700 cs_log(" dvbapi:error no free id (MAX_DEMUX)");721 cs_log("error no free id (MAX_DEMUX)"); 701 722 return -1; 702 723 } … … 718 739 } 719 740 } 720 cs_debug(" dvbapi: id: %d demux_index: %d ca_index: %dprogram_info_length: %d", demux_id, demux[demux_id].demux_index, demux[demux_id].cadev_index, program_info_length);741 cs_debug("id: %d\tdemux_index: %d\tca_index: %d\tprogram_info_length: %d", demux_id, demux[demux_id].demux_index, demux[demux_id].cadev_index, program_info_length); 721 742 722 743 if (cfg->dvbapi_boxtype == BOXTYPE_IPBOX_PMT) { … … 734 755 es_info_length = ((buffer[i + 3] & 0x0F) << 8) | buffer[i + 4]; 735 756 736 cs_debug(" stream_type: %02x\telementary_pid: %04x\tes_info_length: %04x", stream_type, elementary_pid, es_info_length);757 cs_debug("[pmt] stream_type: %02x\tpid: %04x\tlength: %d", stream_type, elementary_pid, es_info_length); 737 758 738 759 if (demux[demux_id].STREAMpidcount >= ECM_PIDS) … … 746 767 } 747 768 } 748 cs_debug(" dvbapi:Found %d ECMpids and %d STREAMpids in PMT", demux[demux_id].ECMpidcount, demux[demux_id].STREAMpidcount);769 cs_debug("Found %d ECMpids and %d STREAMpids in PMT", demux[demux_id].ECMpidcount, demux[demux_id].STREAMpidcount); 749 770 750 771 char *name = get_servicename(demux[demux_id].program_number, demux[demux_id].ECMpidcount>0 ? demux[demux_id].ECMpids[0].CAID : 0); 751 cs_log(" dvbapi:new program number: %04X (%s)", program_number, name);772 cs_log("new program number: %04X (%s)", program_number, name); 752 773 753 774 if (demux[demux_id].ECMpidcount>0) { … … 758 779 #endif 759 780 if (demux[demux_id].ECMpidcount>0) 760 dvbapi_try_ caid(demux_id, 0);781 dvbapi_try_next_caid(demux_id); 761 782 } else { 762 783 // set channel srvid+caid … … 777 798 for (k = 0; k < len; k += 3 + size + val) { 778 799 if (buffer[0+k] != 0x9F || buffer[1+k] != 0x80) { 779 cs_log(" dvbapi:unknown socket command: %02x", buffer[0+k]);800 cs_log("unknown socket command: %02x", buffer[0+k]); 780 801 return; 781 802 } 782 803 783 804 if (k>0) { 784 cs_log(" dvbapi:Unsupported capmt. Please report");805 cs_log("Unsupported capmt. Please report"); 785 806 cs_dump(buffer, len, "capmt:"); 786 807 } … … 826 847 break; 827 848 default: 828 cs_log(" dvbapi:handlesockmsg() unknown command");849 cs_log("handlesockmsg() unknown command"); 829 850 cs_dump(buffer, len, "unknown command:"); 830 851 break; … … 897 918 continue; 898 919 } else { 899 cs_log(" dvbapi:stoping demux for pmt file %s", dest);920 cs_log("stoping demux for pmt file %s", dest); 900 921 dvbapi_stop_descrambling(i); 901 922 } … … 908 929 dirp = opendir(TMPDIR); 909 930 if (!dirp) { 910 cs_log(" dvbapi:opendir errno %d", errno);931 cs_log("opendir errno %d", errno); 911 932 return; 912 933 } … … 941 962 { close(pmt_fd); continue; } 942 963 943 cs_log(" dvbapi:found pmt file %s", dest);964 cs_log("found pmt file %s", dest); 944 965 cs_sleepms(100); 945 966 … … 948 969 949 970 if (len < 1) { 950 cs_log(" dvbapi:pmt file %s have invalid len!", dest);971 cs_log("pmt file %s have invalid len!", dest); 951 972 continue; 952 973 } … … 958 979 // pmt.tmp must be longer than 3 bytes (6 hex chars) and even length 959 980 if ((len<6) || ((len%2) != 0) || ((len/2)>sizeof(dest))) { 960 cs_log(" dvbapi:error parsing QboxHD pmt.tmp, incorrect length");981 cs_log("error parsing QboxHD pmt.tmp, incorrect length"); 961 982 continue; 962 983 } … … 964 985 for(j2=0,j1=0;j2<len;j2+=2,j1++) { 965 986 if (sscanf((char*)mbuf+j2, "%02X", dest+j1) != 1) { 966 cs_log(" dvbapi:error parsing QboxHD pmt.tmp, data not valid in position %d",j2);987 cs_log("error parsing QboxHD pmt.tmp, data not valid in position %d",j2); 967 988 return; 968 989 } … … 974 995 #else 975 996 if (len>sizeof(dest)) { 976 cs_log(" dvbapi:event_handler() dest buffer is to small for pmt data!");997 cs_log("event_handler() dest buffer is to small for pmt data!"); 977 998 continue; 978 999 } … … 1013 1034 1014 1035 unsigned short caid = demux[demux_id].ECMpids[demux[demux_id].demux_fd[filter_num].pidindex].CAID; 1015 unsigned long provid=0; 1036 unsigned long provid = demux[demux_id].ECMpids[demux[demux_id].demux_fd[filter_num].pidindex].PROVID; 1037 1016 1038 int pid = dvbapi_check_array(cfg->dvbapi_prioritytab.caid, CS_MAXCAIDTAB, caid); 1017 if (pid>=0 ) {1039 if (pid>=0 && provid == 0) { 1018 1040 if (cfg->dvbapi_prioritytab.mask[pid]>0) 1019 1041 provid = (cfg->dvbapi_prioritytab.cmap[pid] << 8 | cfg->dvbapi_prioritytab.mask[pid]); 1020 1042 } 1021 1043 1022 //Schlocke: Ignore caid:provid1023 1044 if (!provid) 1024 1045 provid = chk_provid(buffer, caid); 1025 1026 if (provid && demux[demux_id].pidindex == -1) {1027 cs_debug("dvbapi: checking ignore %04X:%06X", caid, provid);1028 int i,n;1029 for (i = 0; i < CS_MAXCAIDTAB; i++) {1030 if (cfg->dvbapi_ignoretab.caid[i] == caid && cfg->dvbapi_ignoretab.mask[i]>0) {1031 ulong provid_ignore = (ulong)(cfg->dvbapi_ignoretab.cmap[i] << 8 | cfg->dvbapi_ignoretab.mask[i]);1032 if (provid == provid_ignore) {1033 cs_debug("dvbapi: ignoring %04X:%06X !", caid, provid);1034 1035 for (n=1; n<demux[demux_id].ECMpidcount; n++) {1036 if (demux[demux_id].ECMpids[n].checked==0) {1037 demux[demux_id].ECMpids[n-1].notfound++;1038 dvbapi_try_caid(demux_id, n);1039 return;1040 }1041 }1042 for (n=0; n<demux[demux_id].ECMpidcount; n++)1043 demux[demux_id].ECMpids[n].checked=0;1044 1045 dvbapi_try_caid(demux_id, 0);1046 return;1047 }1048 }1049 }1050 }1051 1046 1052 1047 if (cfg->dvbapi_au==1) … … 1066 1061 1067 1062 get_cw(er); 1068 cs_debug(" dvbapi: request cw for caid %04X provid %04X srvid %04X pid %04X", er->caid, er->prid, er->srvid, er->pid);1063 cs_debug("request cw for caid %04X provid %06X srvid %04X pid %04X", er->caid, er->prid, er->srvid, er->pid); 1069 1064 } 1070 1065 1071 1066 if (demux[demux_id].demux_fd[filter_num].type==TYPE_EMM) { 1072 1067 if (buffer[0]==0x01) { //CAT 1073 cs_debug(" dvbapi:receiving cat");1068 cs_debug("receiving cat"); 1074 1069 dvbapi_parse_cat(demux_id, buffer, len); 1075 1070 if (demux[demux_id].pidindex < 0) … … 1110 1105 1111 1106 if (selected_box == -1 || selected_api==-1) { 1112 cs_log(" dvbapi:could not detect api version");1107 cs_log("could not detect api version"); 1113 1108 return; 1114 1109 } … … 1121 1116 listenfd = dvbapi_init_listenfd(); 1122 1117 if (listenfd < 1) { 1123 cs_log(" dvbapi:could not init camd.socket.");1118 cs_log("could not init camd.socket."); 1124 1119 return; 1125 1120 } … … 1197 1192 for (i = 0; i < pfdcount; i++) { 1198 1193 if (pfd2[i].revents > 3) 1199 cs_debug(" dvbapi:event %d on fd %d", pfd2[i].revents, pfd2[i].fd);1194 cs_debug("event %d on fd %d", pfd2[i].revents, pfd2[i].fd); 1200 1195 1201 1196 if (pfd2[i].revents & (POLLHUP | POLLNVAL)) { … … 1222 1217 if (pfd2[i].fd==listenfd) { 1223 1218 connfd = accept(listenfd, (struct sockaddr *)&servaddr, (socklen_t *)&clilen); 1224 cs_debug(" dvbapi:new socket connection fd: %d", connfd);1219 cs_debug("new socket connection fd: %d", connfd); 1225 1220 1226 1221 disable_pmt_files=1; 1227 1222 1228 1223 if (connfd <= 0) { 1229 cs_log(" dvbapi:accept() returns error %d, fd event %d", errno, pfd2[i].revents);1224 cs_log("accept() returns error %d, fd event %d", errno, pfd2[i].revents); 1230 1225 continue; 1231 1226 } 1232 1227 } else { 1233 cs_debug(" dvbapi:New capmt on old socket. Please report.");1228 cs_debug("New capmt on old socket. Please report."); 1234 1229 connfd = pfd2[i].fd; 1235 1230 } … … 1238 1233 1239 1234 if (len < 3) { 1240 cs_debug(" dvbapi:camd.socket: too short message received");1235 cs_debug("camd.socket: too short message received"); 1241 1236 continue; 1242 1237 } … … 1263 1258 void dvbapi_send_dcw(ECM_REQUEST *er) { 1264 1259 int i,n; 1265 unsigned char nullcw[8] = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};1266 ca_descr_t ca_descr;1267 1260 1268 1261 for (i=0;i<MAX_DEMUX;i++) { … … 1280 1273 1281 1274 if (er->rc>3 && demux[i].pidindex==-1) { 1282 for (n=1; n<demux[i].ECMpidcount; n++) { 1283 if (demux[i].ECMpids[n].checked==0) { 1284 demux[i].ECMpids[n-1].notfound++; 1285 dvbapi_try_caid(i, n); 1286 return; 1287 } 1288 } 1289 1290 for (n=0; n<demux[i].ECMpidcount; n++) 1291 demux[i].ECMpids[n].checked=0; 1292 1293 dvbapi_try_caid(i, 0); 1275 dvbapi_try_next_caid(i); 1294 1276 return; 1295 1277 } 1296 1278 1297 1279 if (er->rc>3) { 1298 cs_debug(" dvbapi:cw not found");1280 cs_debug("cw not found"); 1299 1281 return; 1300 1282 } 1301 1283 1302 1284 if (demux[i].ca_fd<=0) { 1303 cs_log(" dvbapi:could not write cw.");1285 cs_log("could not write cw."); 1304 1286 demux[i].ca_fd = dvbapi_open_device(i,1); 1305 1287 if (demux[i].ca_fd<=0) … … 1313 1295 int cw_delay = strtol(tmp1, '\0', 10); 1314 1296 if (cw_delay<1000) { 1315 cs_debug(" dvbapi:wait %d ms", cw_delay);1297 cs_debug("wait %d ms", cw_delay); 1316 1298 cs_sleepms(cw_delay); 1317 1299 } … … 1320 1302 stapi_write_cw(i, er->cw); 1321 1303 #else 1304 unsigned char nullcw[8]; 1305 memset(nullcw, 0, 8); 1306 ca_descr_t ca_descr; 1322 1307 memset(&ca_descr,0,sizeof(ca_descr)); 1308 1323 1309 for (n=0;n<2;n++) { 1324 1310 if (memcmp(er->cw+(n*8),demux[i].lastcw[n],8)!=0 && memcmp(er->cw+(n*8),nullcw,8)!=0) { … … 1327 1313 memcpy(demux[i].lastcw[n],er->cw+(n*8),8); 1328 1314 memcpy(ca_descr.cw,er->cw+(n*8),8); 1329 cs_debug(" dvbapi:write cw%d index: %d", n, i);1315 cs_debug("write cw%d index: %d", n, i); 1330 1316 if (ioctl(demux[i].ca_fd, CA_SET_DESCR, &ca_descr) < 0) 1331 cs_debug(" dvbapi:Error CA_SET_DESCR");1317 cs_debug("Error CA_SET_DESCR"); 1332 1318 } 1333 1319 } -
branches/modular/module-stat.c
r2614 r2628 23 23 i = fscanf(file, "rc %d caid %04hX prid %04lX srvid %04hX time avg %dms ecms %d\n", 24 24 &stat->rc, &stat->caid, &stat->prid, &stat->srvid, &stat->time_avg, &stat->ecm_count); 25 if (i > 4) 25 if (i > 4) { 26 stat->ecm_count = 0; //resetting ecm-count because some readers maybe offline or new readers exists 26 27 llist_append(reader_stat[ridx], stat); 28 } 27 29 else 28 30 free(stat); … … 201 203 for (i = 0; i < CS_MAXREADER; i++) { 202 204 if (reader_stat[i] && reader[i].pid && reader[i].cs_idx) { 203 int weight = reader[i].lb_weight <= 0?100:reader[i].lb_weight; 204 stat = get_stat(i, caid, prid, srvid); 205 if (!stat) { 206 add_stat(i, caid, prid, srvid, 1, 0); 207 return -1; //this reader is active (now) but we need statistics first! 208 } 205 if (reader[i].tcp_connected || reader[i].card_status == CARD_INSERTED) { 206 int weight = reader[i].lb_weight <= 0?100:reader[i].lb_weight; 207 stat = get_stat(i, caid, prid, srvid); 208 if (!stat) { 209 add_stat(i, caid, prid, srvid, 1, 0); 210 return -1; //this reader is active (now) but we need statistics first! 211 } 212 213 //if (stat->rc == 0 && stat->ecm_count < MIN_ECM_COUNT) 214 // return -1; //first get full statistics before deciding which reader is the best 209 215 210 current = stat->time_avg*100/weight; 211 if (stat->rc == 0 && stat->ecm_count >= MIN_ECM_COUNT && (!best_stat || current < best)) { 212 if (!reader[i].ph.c_available || reader[i].ph.c_available(i, stat)) { 213 best_stat = stat; 214 best_ridx = i; 215 best = current; 216 current = stat->time_avg*100/weight; 217 if (stat->rc == 0 && stat->ecm_count >= MIN_ECM_COUNT && (!best_stat || current < best)) { 218 if (!reader[i].ph.c_available || reader[i].ph.c_available(i, stat)) { 219 best_stat = stat; 220 best_ridx = i; 221 best = current; 222 } 216 223 } 217 224 } -
branches/modular/oscam-config.c
r2614 r2628 2368 2368 if (reader[i].cc_want_emu) 2369 2369 fprintf_conf(f, CONFVARWIDTH, "cccwantemu", "%d\n", reader[i].cc_want_emu); 2370 2371 if (reader[i].cc_want_emu) 2372 fprintf_conf(f, CONFVARWIDTH, "cccforceresendecm", "%d\n", reader[i].cc_force_resend_ecm); 2370 2373 } 2371 2374 … … 3363 3366 } 3364 3367 3368 if (!strcmp(token, "cccforceresendecm")) { 3369 if (strlen(value) == 0) { 3370 rdr->cc_force_resend_ecm = 0; 3371 return; 3372 } else { 3373 rdr->cc_force_resend_ecm = atoi(value); 3374 return; 3375 } 3376 } 3377 3365 3378 3366 3379 if (!strcmp(token, "deprecated")) { -
branches/modular/oscam-http.c
r2614 r2628 1734 1734 case CARD_NEED_INIT: txt = "NEEDINIT"; break; 1735 1735 case CARD_INSERTED: 1736 if ( reader[ridx].tcp_connected)1736 if (client[i].typ=='p') 1737 1737 txt = "CONNECTED"; 1738 1738 else -
branches/modular/oscam.c
r2614 r2628 339 339 cs_log("cannot remove pid file %s errno=(%d)", cfg->pidfile, errno); 340 340 } 341 #ifndef OS_CYGWIN32 341 342 if (unlink("/tmp/oscam.version") < 0) 342 343 cs_log("cannot remove /tmp/oscam.version errno=(%d)", errno); 343 344 #endif 344 345 cs_log("cardserver down"); 345 346 #ifndef CS_NOSHM … … 2432 2433 2433 2434 cs_debug_mask(D_EMM, "emmtype %s. Reader %s has serial %s.", typtext[ep->type], reader[au].label, cs_hexdump(0, reader[au].hexserial, 8)); 2435 cs_ddump_mask(D_EMM, ep->hexserial, 8, "emm UA/SA:"); 2436 cs_ddump_mask(D_EMM, ep->emm, ep->l, "emm:"); 2434 2437 2435 2438 switch (ep->type) { … … 2473 2476 } 2474 2477 2475 cs_ddump_mask(D_EMM, ep->hexserial, 8, "emm UA/SA:");2476 2478 client[cs_idx].lastemm = time((time_t)0); 2477 cs_ddump_mask(D_EMM, ep->emm, ep->l, "emm:");2478 2479 2479 2480 if (reader[au].card_system > 0) { -
branches/modular/reader-common.c
r2614 r2628 323 323 // To save ECM/CW time we added this function after writing ecm answer 324 324 325 if (cardsystem[reader [ridx].card_system-1].post_process) {326 cardsystem[reader [ridx].card_system-1].post_process(reader);325 if (cardsystem[reader->card_system-1].post_process) { 326 cardsystem[reader->card_system-1].post_process(reader); 327 327 } 328 328 } … … 339 339 client[cs_idx].last=time((time_t)0); 340 340 341 if (cardsystem[reader [ridx].card_system-1].do_ecm)342 rc=cardsystem[reader [ridx].card_system-1].do_ecm(reader, er);341 if (cardsystem[reader->card_system-1].do_ecm) 342 rc=cardsystem[reader->card_system-1].do_ecm(reader, er); 343 343 else 344 344 rc=0; … … 448 448 return 3; 449 449 450 if (cardsystem[reader [ridx].card_system-1].do_emm)451 rc=cardsystem[reader [ridx].card_system-1].do_emm(reader, ep);450 if (cardsystem[reader->card_system-1].do_emm) 451 rc=cardsystem[reader->card_system-1].do_emm(reader, ep); 452 452 else 453 453 rc=0;
Note:
See TracChangeset
for help on using the changeset viewer.