Changeset 8467


Ignore:
Timestamp:
03/03/13 21:12:39 (8 years ago)
Author:
gf
Message:

ird-guess: Move everything related to irdeto guessing in the module.

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/globals.h

    r8466 r8467  
    772772    void            (*get_emm_filter)(struct s_reader * rdr, uchar *filter);
    773773    uint16_t        caids[2];
    774 };
    775 
    776 struct s_irdeto_quess {
    777     int32_t         b47;
    778     uint16_t        caid;
    779     uint16_t        sid;
    780     struct s_irdeto_quess *next;
    781774};
    782775
     
    17361729    CAIDTAB         double_check_caid;          // do not store loadbalancer stats with providers for this caid
    17371730
    1738 #ifdef IRDETO_GUESSING
    1739     struct s_irdeto_quess *itab[0xff];
    1740 #endif
    1741 
    17421731#ifdef HAVE_DVBAPI
    17431732    int8_t      dvbapi_enabled;
  • trunk/module-ird-guess.c

    r7600 r8467  
    11#include "globals.h"
     2
     3#ifdef IRDETO_GUESSING
    24#include "module-ird-guess.h"
    35#include "oscam-string.h"
    4 
    5 #ifdef IRDETO_GUESSING
    6 
    76#include "oscam-conf.h"
    87
    9 #define cs_ird "oscam.ird"
     8struct s_irdeto_quess {
     9    int32_t         b47;
     10    uint16_t        caid;
     11    uint16_t        sid;
     12    struct s_irdeto_quess *next;
     13};
     14
     15static struct s_irdeto_quess *itab[0xff];
    1016
    1117int32_t init_irdeto_guess_tab(void)
    1218{
    13   FILE *fp = open_config_file(cs_ird);
     19  FILE *fp = open_config_file("oscam.ird");
    1420  if (!fp)
    1521    return 1;
     
    2228  uint16_t caid, sid;
    2329  struct s_irdeto_quess *ird_row, *head;
    24 
    25   memset(cfg.itab, 0, sizeof(cfg.itab));
    2630
    2731  while (fgets(token, sizeof(token), fp))
     
    5761      ird_row->caid = caid;
    5862      ird_row->sid  = sid;
    59       ird_row->next = 0;
    6063
    61       head = cfg.itab[b3];
     64      head = itab[b3];
    6265      if( head ) {
    6366        while( head->next )
     
    6669      }
    6770      else
    68         cfg.itab[b3]=ird_row;
     71        itab[b3]=ird_row;
    6972        //cs_debug_mask(D_CLIENT, "%02X:%08X:%04X:%04X", b3, b47, caid, sid);
    7073    }
     
    7477  for( i=0; i<0xff; i++ )
    7578  {
    76     head=cfg.itab[i];
     79    head=itab[i];
    7780    while(head)
    7881    {
     
    8588}
    8689
     90void free_irdeto_guess_tab(void)
     91{
     92  uint8_t i;
     93  for (i = 0; i < 0xff; i++)
     94  {
     95    struct s_irdeto_quess *head = itab[i];
     96    while(head)
     97    {
     98      void *next = head->next;
     99      free(head);
     100      head = next;
     101    }
     102  }
     103}
     104
    87105void guess_irdeto(ECM_REQUEST *er)
    88106{
     
    93111
    94112  b3  = er->ecm[3];
    95   ptr = cfg.itab[b3];
     113  ptr = itab[b3];
    96114  if( !ptr ) {
    97115    cs_debug_mask(D_TRACE, "unknown irdeto byte 3: %02X", b3);
  • trunk/module-ird-guess.h

    r7504 r8467  
    55int32_t init_irdeto_guess_tab(void);
    66void guess_irdeto(ECM_REQUEST *er);
     7void free_irdeto_guess_tab(void);
    78#else
    89static inline int32_t init_irdeto_guess_tab(void) { return 0; }
    910static inline void guess_irdeto(ECM_REQUEST *UNUSED(er)) { }
     11static inline void free_irdeto_guess_tab(void) { }
    1012#endif
    1113
  • trunk/oscam.c

    r8460 r8467  
    14791479    init_free_sidtab();
    14801480    free_readerdb();
     1481    free_irdeto_guess_tab();
    14811482    config_free();
    14821483
Note: See TracChangeset for help on using the changeset viewer.