Changeset 1776


Ignore:
Timestamp:
Mar 4, 2010, 10:59:05 PM (10 years ago)
Author:
_network
Message:

modular: Merge with trunk

Location:
branches/modular
Files:
16 edited

Legend:

Unmodified
Added
Removed
  • branches/modular/globals.h

    r1769 r1776  
    855855extern struct s_config *cfg;
    856856extern char cs_confdir[], *loghist;
    857 extern EMM_PACKET epg;
    858857extern struct s_module ph[CS_MAX_MOD];
    859858extern struct s_cardsystem cardsystem[CS_MAX_MOD];
  • branches/modular/module-camd33.c

    r1125 r1776  
    166166static void camd33_process_emm(uchar *buf, int l)
    167167{
     168  EMM_PACKET epg;
    168169  memset(&epg, 0, sizeof(epg));
    169170  epg.l=l-7;
  • branches/modular/module-camd35.c

    r1726 r1776  
    264264{
    265265  int au;
     266  EMM_PACKET epg;
    266267  memset(&epg, 0, sizeof(epg));
    267268  au=client[cs_idx].au;
     
    270271  memcpy(epg.caid     , buf+10              , 2);
    271272  memcpy(epg.provid   , buf+12              , 4);
    272   memcpy(epg.hexserial, reader[au].hexserial, 8);   // dummy
    273273  memcpy(epg.emm      , buf+20              , epg.l);
    274274  do_emm(&epg);
  • branches/modular/module-dvbapi.c

    r1769 r1776  
    444444{
    445445    int i;
     446    EMM_PACKET epg;
    446447    cs_debug("dvbapi: EMM Type: 0x%02x caid: %04x", buffer[0],demux[demux_index].ca_system_id);
    447448    cs_ddump(buffer, len, "emm:");
     
    454455    epg.caid[1] = (uchar)(demux[demux_index].ca_system_id);
    455456
    456     epg.provid[1] = (uchar)(demux[demux_index].provider_id>>16);
    457     epg.provid[2] = (uchar)(demux[demux_index].provider_id>>8);
    458     epg.provid[3] = (uchar)(demux[demux_index].provider_id);
     457    unsigned long provid = (buffer[10] << 8) | buffer[11];
     458    int pid=dvbapi_check_array(prioritytab.caid, CS_MAXCAIDTAB, demux[demux_index].ca_system_id);
     459    if (pid>=0) {
     460        if (prioritytab.mask[pid]>0)
     461            provid=prioritytab.mask[pid];
     462    }
     463
     464    epg.provid[1] = (uchar)(provid>>16);
     465    epg.provid[2] = (uchar)(provid>>8);
     466    epg.provid[3] = (uchar)(provid);
    459467
    460468    epg.l=len;
  • branches/modular/module-newcamd.c

    r1741 r1776  
    982982  ushort caid;
    983983
     984  EMM_PACKET epg;
    984985  memset(&epg, 0, sizeof(epg));
    985986  au=client[cs_idx].au;
     
    10131014  }
    10141015  else*/
    1015     memcpy(epg.hexserial, reader[au].hexserial, 8); // dummy
    10161016 
    10171017  memcpy(epg.emm, buf, epg.l);
  • branches/modular/oscam-log.c

    r1769 r1776  
    144144    //  memcpy(txt, sbuf, 11);
    145145
    146 
     146//Fixme: remove below if all works ok
     147/*
    147148    time(&t);
    148149    lt=localtime(&t);
     
    150151            lt->tm_year+1900, lt->tm_mon+1, lt->tm_mday,
    151152            lt->tm_hour, lt->tm_min, lt->tm_sec, txt);
    152 
     153*/
    153154    if (use_syslog && !use_ac_log)      // system-logfile
    154155        syslog(LOG_INFO, "%s", txt);
  • branches/modular/oscam.c

    r1769 r1776  
    2828uchar mbuf[1024];   // global buffer
    2929ECM_REQUEST *ecmtask;
    30 EMM_PACKET  epg;
    3130#ifdef CS_ANTICASC
    3231struct s_acasc ac_stat[CS_MAXPID];
  • branches/modular/reader-common.c

    r1769 r1776  
    343343
    344344    if (cardsystem[reader[ridx].card_system-1].get_emm_type)
    345         rc=cardsystem[reader[ridx].card_system-1].get_emm_type(ep);
     345        rc=cardsystem[reader[ridx].card_system-1].get_emm_type(ep, rdr);
    346346    else
    347347        rc=0;
  • branches/modular/reader-common.h

    r1769 r1776  
    1616int irdeto_do_ecm(ECM_REQUEST *);
    1717int irdeto_do_emm(EMM_PACKET *);
    18 int irdeto_get_emm_type(EMM_PACKET *);
     18int irdeto_get_emm_type(EMM_PACKET *, struct s_reader *);
    1919int irdeto_card_info(void);
    2020
     
    2323int viaccess_do_ecm(ECM_REQUEST *);
    2424int viaccess_do_emm(EMM_PACKET *);
    25 int viaccess_get_emm_type(EMM_PACKET *);
     25int viaccess_get_emm_type(EMM_PACKET *, struct s_reader *);
    2626int viaccess_card_info(void);
    2727
     
    3030int videoguard_do_ecm(ECM_REQUEST *);
    3131int videoguard_do_emm(EMM_PACKET *);
    32 int videoguard_get_emm_type(EMM_PACKET *);
     32int videoguard_get_emm_type(EMM_PACKET *, struct s_reader *);
    3333int videoguard_card_info(void);
    3434
     
    3737int cryptoworks_do_ecm(ECM_REQUEST *);
    3838int cryptoworks_do_emm(EMM_PACKET *);
    39 int cryptoworks_get_emm_type(EMM_PACKET *);
     39int cryptoworks_get_emm_type(EMM_PACKET *, struct s_reader *);
    4040int cryptoworks_card_info(void);
    4141int CheckSctLen(const uchar *, int);
     
    4545int seca_do_ecm(ECM_REQUEST *);
    4646int seca_do_emm(EMM_PACKET *);
    47 //FIXME int seca_get_emm_type(EMM_PACKET *);
    4847int seca_get_emm_type(EMM_PACKET *, struct s_reader *);
    4948int seca_card_info(void);
     
    5352int nds_do_ecm(ECM_REQUEST *);
    5453int nds_do_emm(EMM_PACKET *);
    55 int nds_get_emm_type(EMM_PACKET *);
     54int nds_get_emm_type(EMM_PACKET *, struct s_reader *);
    5655int nds_card_info(void);
    5756
     
    6160int nagra2_card_info(void);
    6261int nagra2_do_emm(EMM_PACKET *);
    63 int nagra2_get_emm_type(EMM_PACKET *);
     62int nagra2_get_emm_type(EMM_PACKET *, struct s_reader *);
    6463void nagra2_post_process();
    6564 
     
    6867int conax_do_ecm(ECM_REQUEST *);
    6968int conax_do_emm(EMM_PACKET *);
    70 int conax_get_emm_type(EMM_PACKET *);
     69int conax_get_emm_type(EMM_PACKET *, struct s_reader *);
    7170int conax_card_info(void);
    7271 
     
    7574int dre_do_ecm(ECM_REQUEST *);
    7675int dre_do_emm(EMM_PACKET *);
    77 int dre_get_emm_type(EMM_PACKET *);
     76int dre_get_emm_type(EMM_PACKET *, struct s_reader *);
    7877int dre_card_info(void);
    7978
  • branches/modular/reader-conax.c

    r1769 r1776  
    204204}
    205205
    206 int conax_get_emm_type(EMM_PACKET *ep) //returns TRUE if shared emm matches SA, unique emm matches serial, or global or unknown
     206int conax_get_emm_type(EMM_PACKET *ep, struct s_reader * rdr) //returns TRUE if shared emm matches SA, unique emm matches serial, or global or unknown
    207207{
    208208    ep->type=ep->emm[2]+3; //FIXME not sure how this maps onto global, unique and shared!
  • branches/modular/reader-cryptoworks.c

    r1769 r1776  
    457457}
    458458
    459 int cryptoworks_get_emm_type(EMM_PACKET *ep) //returns TRUE if shared emm matches SA, unique emm matches serial, or global or unknown
     459int cryptoworks_get_emm_type(EMM_PACKET *ep, struct s_reader * rdr) //returns TRUE if shared emm matches SA, unique emm matches serial, or global or unknown
    460460{
    461461  switch (ep->emm[0]) {
  • branches/modular/reader-dre.c

    r1769 r1776  
    302302}
    303303
    304 int dre_get_emm_type(EMM_PACKET *ep)
     304int dre_get_emm_type(EMM_PACKET *ep, struct s_reader * rdr)
    305305{
    306306  switch (ep->emm[0]) {
  • branches/modular/reader-irdeto.c

    r1769 r1776  
    366366}
    367367
    368 int irdeto_get_emm_type(EMM_PACKET *ep) //returns TRUE if shared emm matches SA, unique emm matches serial, or global or unknown
    369 {
    370   int i, l=(ep->emm[3]&0x07), ok=0;
    371   int mode=(ep->emm[3]>>3);
    372   if (mode&0x10) {      // Hex addressed
    373     ep->type = UNIQUE;
     368int irdeto_get_emm_type(EMM_PACKET *ep, struct s_reader * rdr) //returns TRUE if shared emm matches SA, unique emm matches serial, or global or unknown
     369{
     370    int i, l = (ep->emm[3]&0x07), ok=0;
     371    int mode = (ep->emm[3]>>3);
     372    if (mode&0x10) {
     373        // Hex addressed
     374        ep->type = UNIQUE;
    374375        memset(ep->hexserial,0,8);
    375         memcpy(ep->hexserial, ep->emm + 4, l);
    376     return (mode==reader[ridx].hexserial[3] &&
    377        (!l || !memcmp(ep->emm+4, reader[ridx].hexserial, l)));
    378   }
    379   else {                // Provider addressed
     376        memcpy(ep->hexserial, ep->emm + 4, l);
     377        return (mode == rdr->hexserial[3] && (!l || !memcmp(ep->emm+4, rdr->hexserial, l)));
     378    }
     379    else {
     380        // Provider addressed
     381        for(i = 0; i < rdr->nprov; i++) {
     382            ok = (mode == rdr->prid[i][0] && (!l || !memcmp(ep->emm+4, &rdr->prid[i][1], l)));
     383            if (ok) break;
     384        }
     385       
    380386        ep->type = SHARED;
    381     for(i=0; i<reader[ridx].nprov; i++) {
    382       ok=(mode==reader[ridx].prid[i][0] &&
    383          (!l || !memcmp(ep->emm+4, &reader[ridx].prid[i][1], l)));
    384       if (ok) break;
    385     }
    386387        memset(ep->hexserial,0,8);
    387         memcpy(ep->hexserial, ep->emm+4, l); //prid in hezserial instread of SA
     388        //prid in hexserial instead of SA
     389        memcpy(ep->hexserial, ep->emm+4, l);
    388390        return ok;
    389   }
     391    }
    390392}
    391393
  • branches/modular/reader-nagra.c

    r1769 r1776  
    719719}
    720720
    721 int nagra2_get_emm_type(EMM_PACKET *ep) //returns TRUE if shared emm matches SA, unique emm matches serial, or global or unknown
     721int nagra2_get_emm_type(EMM_PACKET *ep, struct s_reader * rdr) //returns TRUE if shared emm matches SA, unique emm matches serial, or global or unknown
    722722{
    723723  switch (ep->emm[0]) {
     
    732732            else
    733733                ep->type = UNIQUE;
    734             memcpy(ep->hexserial, ep->emm + 3, 6);
    735             return (!memcmp (reader[ridx].hexserial, ep->hexserial, 4));
     734            return (!memcmp (rdr->hexserial, ep->hexserial, 4));
    736735        case 0x82:
    737736            ep->type = GLOBAL;
  • branches/modular/reader-viaccess.c

    r1769 r1776  
    355355}
    356356
    357 int viaccess_get_emm_type(EMM_PACKET *ep) //returns TRUE if shared emm matches SA, unique emm matches serial, or global or unknown
     357int viaccess_get_emm_type(EMM_PACKET *ep, struct s_reader * rdr) //returns TRUE if shared emm matches SA, unique emm matches serial, or global or unknown
    358358{
    359359    ep->type=UNKNOWN; //FIXME not sure how this maps onto global, unique and shared!
  • branches/modular/reader-videoguard2.c

    r1769 r1776  
    943943}
    944944
    945 int videoguard_get_emm_type(EMM_PACKET *ep) //returns TRUE if shared emm matches SA, unique emm matches serial, or global or unknown
     945int videoguard_get_emm_type(EMM_PACKET *ep, struct s_reader * rdr) //returns TRUE if shared emm matches SA, unique emm matches serial, or global or unknown
    946946{
    947947    ep->type=UNKNOWN; //FIXME not sure how this maps onto global, unique and shared!
Note: See TracChangeset for help on using the changeset viewer.