Changeset 1630
- Timestamp:
- 02/20/10 14:00:54 (14 years ago)
- Location:
- branches/monitor-improvement
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/monitor-improvement/CMakeLists.txt
r1624 r1630 146 146 147 147 include (CheckIncludeFile) 148 if(CS_ANTICASC) 149 add_definitions ("-DCS_ANTICASC") 150 endif(CS_ANTICASC) 151 152 if(CS_LOGHISTORY) 153 add_definitions ("-DCS_LOGHISTORY") 154 endif(CS_LOGHISTORY) 155 156 if(CS_WITH_GBOX) 157 add_definitions ("-DCS_WITH_GBOX") 158 endif(CS_WITH_GBOX) 159 160 if(HAVE_DVBAPI) 161 add_definitions ("-DHAVE_DVBAPI") 162 endif(HAVE_DVBAPI) 163 148 164 check_include_file ("pthread.h" HAVE_PTHREAD) 149 165 if (HAVE_PTHREAD) … … 234 250 235 251 236 237 238 252 check_include_file ("PCSC/wintypes.h" HAVE_PCSC) 239 253 if (HAVE_PCSC) … … 339 353 target_link_libraries ( ${exe_name} rt nxp ) 340 354 endif (OSCamOperatingSystem MATCHES "Linux") 341 342 if (WEBIF)343 add_definitions ("-DWEBIF")344 endif (WEBIF)345 355 346 356 #----------------------- put svnversion in the build ------------------------------ … … 477 487 message (STATUS " use system libusb functions") 478 488 endif (HAVE_LIBUSB) 479 if (WEBIF)480 message (STATUS " Web interface enabled")481 endif (WEBIF)482 489 message (STATUS "") -
branches/monitor-improvement/README
r1154 r1630 9 9 10 10 - svn repository: 11 http://streamboard.gmc.to/svn/oscam11 svn co http://streamboard.gmc.to/svn/oscam/trunk 12 12 13 13 - trac instance: … … 15 15 16 16 - wiki: 17 http://streamboard.gmc.to :8001/oscam/wiki17 http://streamboard.gmc.to/oscam 18 18 19 19 Get sources from SVN 20 20 -------------------- 21 21 22 svn co http://streamboard.gmc.to/svn/oscam/trunk oscam 22 svn co http://streamboard.gmc.to/svn/oscam/trunk oscam-svn 23 23 cd oscam 24 24 … … 33 33 HAVE_DVBAPI - enable DVB API support 34 34 35 Enable features with cmake: 36 37 -DCS_ANTICASC=1 - enable anti-cascading 38 -DCS_LOGHISTORY=1 - enable log history 39 -DCS_WITH_GBOX=1 - enable gbox support 40 -DHAVE_DVBAPI=1 - enable DVB API support 35 41 36 42 Build with CMake (new solution for building) -
branches/monitor-improvement/module-camd35.c
r1553 r1630 49 49 return(memcmp(client[cs_idx].ucrc, ucrc, 4) ? 1 : 0); 50 50 client[cs_idx].crypted=1; 51 crc=( ucrc[0]<<24) | (ucrc[1]<<16) | (ucrc[2]<<8) | ucrc[3];51 crc=(((ucrc[0]<<24) | (ucrc[1]<<16) | (ucrc[2]<<8) | ucrc[3]) & 0xffffffffL); 52 52 for (account=cfg->account; (account) && (!upwd[0]); account=account->next) 53 53 if (crc==crc32(0L, MD5((unsigned char *)account->usr, strlen(account->usr), NULL), 16)) -
branches/monitor-improvement/module-cccam.c
r1600 r1630 48 48 #include <string.h> 49 49 #include <stdlib.h> 50 int cc_cli_init(); 50 51 51 52 LLIST *llist_create(void) … … 322 323 client[cs_idx].udp_fd = 0; 323 324 cs_sleepms(100); 324 ph->c_init();325 cc_cli_init(); 325 326 } 326 327 -
branches/monitor-improvement/oscam.c
r1619 r1630 1401 1401 } 1402 1402 1403 /* 1404 * This function writes the current CW from ECM struct to a cwl file. 1405 * The filename is re-calculated and file re-opened every time. 1406 * This will consume a bit cpu time, but nothing has to be stored between 1407 * each call. If not file exists, a header is prepended 1408 */ 1403 1409 void logCWtoFile(ECM_REQUEST *er) 1404 1410 { 1405 /* This function writes the current CW from ECM struct to a cwl file. 1406 The filename is re-calculated and file re-opened every time. 1407 This will consume a bit cpu time, but nothing has to be stored between 1408 each call. If not file exists, a header is prepended */ 1409 1410 FILE *pfCWL; 1411 char srvname[23]; 1412 /* %s / %s _I %04X _ %s .cwl */ 1413 char buf[sizeof(cfg->cwlogdir)+1+6+2+4+1+sizeof(srvname)+5]; 1414 char date[7]; 1415 unsigned char i, parity, writeheader = 0; 1416 time_t t; 1417 struct tm *timeinfo; 1418 struct s_srvid *this; 1419 1420 if (cfg->cwlogdir != NULL) /* CWL logging only if cwlogdir is set in config */ 1421 { 1422 /* search service name for that id and change characters 1423 causing problems in file name */ 1424 srvname[0] = 0; 1425 for (this=cfg->srvid; this; this=this->next) { 1426 if (this->srvid==er->srvid) { 1427 cs_strncpy(srvname, this->name, sizeof(srvname)); 1428 srvname[sizeof(srvname)-1] = 0; 1429 for (i=0;srvname[i];i++) 1430 if (srvname[i]==' ') srvname[i]='_'; 1431 break; 1432 } 1433 } 1434 1435 /* calc log file name */ 1436 time(&t); 1437 timeinfo = localtime(&t); 1438 strftime(date,sizeof(date),"%y%m%d",timeinfo); 1439 sprintf(buf, "%s/%s_I%04X_%s.cwl", cfg->cwlogdir, date, er->srvid, srvname); 1440 1441 if((pfCWL=fopen(buf,"r")) == NULL) 1442 { 1443 /* open failed, assuming file does not exist, yet */ 1444 writeheader = 1; 1445 } else 1446 { 1447 /* we need to close the file if it was opened correctly */ 1448 fclose(pfCWL); 1449 } 1450 1451 if ((pfCWL=fopen(buf, "a+")) == NULL) 1452 { 1453 /* maybe this fails because the subdir does not exist. Is there a common function to create it? */ 1454 /* for the moment do not print to log on every ecm 1455 cs_log(""error opening cw logfile for writing: %s (errno %d)", buf, errno); */ 1456 return; 1457 } 1458 if (writeheader) 1459 { 1460 /* no global macro for cardserver name :( */ 1461 fprintf(pfCWL, "# OSCam cardserver v%s - http://streamboard.gmc.to:8001/oscam/wiki\n", CS_VERSION_X); 1462 fprintf(pfCWL, "# control word log file for use with tsdec offline decrypter\n"); 1463 strftime(buf,sizeof(buf),"DATE %Y-%m-%d, TIME %H:%M:%S, TZ %Z\n",timeinfo); 1464 fprintf(pfCWL, "# %s",buf); 1465 fprintf(pfCWL, "# CAID 0x%04X, SID 0x%04X, SERVICE \"%s\"\n", er->caid, er->srvid, srvname); 1466 } 1467 1468 parity = er->ecm[0]&1; 1469 fprintf(pfCWL, "%d ",parity); 1470 for (i=parity*8; i<8+parity*8; i++) 1471 fprintf(pfCWL, "%02X ",er->cw[i]); 1472 /* better use incoming time er->tps rather than current time? */ 1473 strftime(buf,sizeof(buf),"%H:%M:%S\n",timeinfo); 1474 fprintf(pfCWL, "# %s",buf); 1475 fflush(pfCWL); 1476 fclose(pfCWL); 1477 } /* if (cfg->pidfile[0]) */ 1411 FILE *pfCWL; 1412 char srvname[128]; 1413 /* %s / %s _I %04X _ %s .cwl */ 1414 char buf[256 + sizeof(srvname)]; 1415 char date[7]; 1416 unsigned char i, parity, writeheader = 0; 1417 time_t t; 1418 struct tm *timeinfo; 1419 struct s_srvid *this; 1420 1421 /* CWL logging only if cwlogdir is set in config */ 1422 if (cfg->cwlogdir != NULL) { 1423 /* search service name for that id and change characters 1424 causing problems in file name */ 1425 srvname[0] = 0; 1426 for (this=cfg->srvid; this; this = this->next) { 1427 if (this->srvid == er->srvid) { 1428 cs_strncpy(srvname, this->name, sizeof(srvname)); 1429 srvname[sizeof(srvname)-1] = 0; 1430 for (i = 0; srvname[i]; i++) 1431 if (srvname[i] == ' ') srvname[i] = '_'; 1432 break; 1433 } 1434 } 1435 1436 /* calc log file name */ 1437 time(&t); 1438 timeinfo = localtime(&t); 1439 strftime(date, sizeof(date), "%y%m%d", timeinfo); 1440 sprintf(buf, "%s/%s_I%04X_%s.cwl", cfg->cwlogdir, date, er->srvid, srvname); 1441 1442 /* open failed, assuming file does not exist, yet */ 1443 if((pfCWL = fopen(buf, "r")) == NULL) { 1444 writeheader = 1; 1445 } else { 1446 /* we need to close the file if it was opened correctly */ 1447 fclose(pfCWL); 1448 } 1449 1450 if ((pfCWL = fopen(buf, "a+")) == NULL) { 1451 /* maybe this fails because the subdir does not exist. Is there a common function to create it? 1452 for the moment do not print to log on every ecm 1453 cs_log(""error opening cw logfile for writing: %s (errno %d)", buf, errno); */ 1454 return; 1455 } 1456 if (writeheader) { 1457 /* no global macro for cardserver name :( */ 1458 fprintf(pfCWL, "# OSCam cardserver v%s - http://streamboard.gmc.to:8001/oscam/wiki\n", CS_VERSION_X); 1459 fprintf(pfCWL, "# control word log file for use with tsdec offline decrypter\n"); 1460 strftime(buf, sizeof(buf),"DATE %Y-%m-%d, TIME %H:%M:%S, TZ %Z\n", timeinfo); 1461 fprintf(pfCWL, "# %s", buf); 1462 fprintf(pfCWL, "# CAID 0x%04X, SID 0x%04X, SERVICE \"%s\"\n", er->caid, er->srvid, srvname); 1463 } 1464 1465 parity = er->ecm[0]&1; 1466 fprintf(pfCWL, "%d ", parity); 1467 for (i = parity * 8; i < 8 + parity * 8; i++) 1468 fprintf(pfCWL, "%02X ", er->cw[i]); 1469 /* better use incoming time er->tps rather than current time? */ 1470 strftime(buf,sizeof(buf),"%H:%M:%S\n", timeinfo); 1471 fprintf(pfCWL, "# %s", buf); 1472 fflush(pfCWL); 1473 fclose(pfCWL); 1474 } 1478 1475 } 1479 1476 … … 1497 1494 if (er->rc==1||(er->gbxRidx&&er->rc==0)){ 1498 1495 store_ecm(er); 1496 1497 /* CWL logging only if cwlogdir is set in config */ 1498 if (cfg->cwlogdir != NULL) 1499 1499 logCWtoFile(er); 1500 1500 } … … 2572 2572 cs_exit(1); 2573 2573 } 2574
Note:
See TracChangeset
for help on using the changeset viewer.