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

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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);
Note: See TracChangeset for help on using the changeset viewer.