Changeset 1630


Ignore:
Timestamp:
02/20/10 14:00:54 (11 years ago)
Author:
alno
Message:

Webif:

  • Merging revisions 1624-1629 of trunk (Thanx @ dingo as a precaution)
  • fix warning: implicit declaration of function `cc_cli_init'
Location:
branches/monitor-improvement
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • branches/monitor-improvement/CMakeLists.txt

    r1624 r1630  
    146146
    147147include (CheckIncludeFile)
     148if(CS_ANTICASC)
     149    add_definitions ("-DCS_ANTICASC")
     150endif(CS_ANTICASC)
     151
     152if(CS_LOGHISTORY)
     153    add_definitions ("-DCS_LOGHISTORY")
     154endif(CS_LOGHISTORY)
     155
     156if(CS_WITH_GBOX)
     157    add_definitions ("-DCS_WITH_GBOX")
     158endif(CS_WITH_GBOX)
     159
     160if(HAVE_DVBAPI)
     161    add_definitions ("-DHAVE_DVBAPI")
     162endif(HAVE_DVBAPI)
     163
    148164check_include_file ("pthread.h" HAVE_PTHREAD)
    149165if (HAVE_PTHREAD)
     
    234250
    235251
    236 
    237 
    238252check_include_file ("PCSC/wintypes.h" HAVE_PCSC)
    239253if (HAVE_PCSC)
     
    339353    target_link_libraries ( ${exe_name} rt nxp )
    340354endif (OSCamOperatingSystem MATCHES "Linux")
    341 
    342 if (WEBIF)
    343     add_definitions ("-DWEBIF")
    344 endif (WEBIF)
    345355
    346356#----------------------- put svnversion in the build ------------------------------
     
    477487    message (STATUS "  use system libusb functions")
    478488endif (HAVE_LIBUSB)
    479 if (WEBIF)
    480     message (STATUS "  Web interface enabled")
    481 endif (WEBIF)
    482489message (STATUS "")
  • branches/monitor-improvement/README

    r1154 r1630  
    99
    1010- svn repository:
    11     http://streamboard.gmc.to/svn/oscam
     11    svn co http://streamboard.gmc.to/svn/oscam/trunk
    1212
    1313- trac instance:
     
    1515
    1616- wiki:
    17     http://streamboard.gmc.to:8001/oscam/wiki
     17    http://streamboard.gmc.to/oscam
    1818
    1919Get sources from SVN
    2020--------------------
    2121
    22     svn co http://streamboard.gmc.to/svn/oscam/trunk oscam
     22    svn co http://streamboard.gmc.to/svn/oscam/trunk oscam-svn
    2323    cd oscam
    2424
     
    3333HAVE_DVBAPI   - enable DVB API support
    3434
     35Enable 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
    3541
    3642Build with CMake (new solution for building)
  • branches/monitor-improvement/module-camd35.c

    r1553 r1630  
    4949    return(memcmp(client[cs_idx].ucrc, ucrc, 4) ? 1 : 0);
    5050  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);
    5252  for (account=cfg->account; (account) && (!upwd[0]); account=account->next)
    5353    if (crc==crc32(0L, MD5((unsigned char *)account->usr, strlen(account->usr), NULL), 16))
  • branches/monitor-improvement/module-cccam.c

    r1600 r1630  
    4848#include <string.h>
    4949#include <stdlib.h>
     50int cc_cli_init();
    5051
    5152LLIST *llist_create(void)
     
    322323  client[cs_idx].udp_fd = 0;
    323324  cs_sleepms(100);
    324   ph->c_init();
     325  cc_cli_init();
    325326}
    326327
  • branches/monitor-improvement/oscam.c

    r1619 r1630  
    14011401}
    14021402
     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 */
    14031409void logCWtoFile(ECM_REQUEST *er)
    14041410{
    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    }
    14781475}
    14791476
     
    14971494  if (er->rc==1||(er->gbxRidx&&er->rc==0)){
    14981495    store_ecm(er);
     1496
     1497  /* CWL logging only if cwlogdir is set in config */
     1498  if (cfg->cwlogdir != NULL)
    14991499    logCWtoFile(er);
    15001500  }
     
    25722572  cs_exit(1);
    25732573}
    2574 
Note: See TracChangeset for help on using the changeset viewer.