Project

General

Profile

Feature #345 » dre_emm_update_30122010.diff

alex -, 2010-12-30 21:58

View differences:

src/cwc.c (working copy)
47 47

  
48 48
#define CWC_KEEPALIVE_INTERVAL 30
49 49

  
50
#define CWS_NETMSGSIZE 256
50
#define CWS_NETMSGSIZE 272
51 51
#define CWS_FIRSTCMDNO 0xe0
52 52

  
53 53
/**
......
55 55
 */
56 56
typedef enum {
57 57
  CARD_IRDETO,
58
  CARD_DRE,
58 59
  CARD_CONAX,
59 60
  CARD_SECA,
60 61
  CARD_UNKNOWN
......
254 255
static void cwc_detecs_card_type(cwc_t *cwc);
255 256
void cwc_emm_conax(cwc_t *cwc, uint8_t *data, int len);
256 257
void cwc_emm_irdeto(cwc_t *cwc, uint8_t *data, int len);
258
void cwc_emm_dre(cwc_t *cwc, uint8_t *data, int len);
257 259
void cwc_emm_seca(cwc_t *cwc, uint8_t *data, int len);
258 260

  
259 261
/**
......
643 645
    cwc->cwc_card_type = CARD_SECA;
644 646
    tvhlog(LOG_INFO, "cwc", "%s: seca card",
645 647
	   cwc->cwc_hostname);
648
  case 0x4a:
649
    cwc->cwc_card_type = CARD_DRE;
650
    tvhlog(LOG_INFO, "cwc", "%s: dre card",
651
	   cwc->cwc_hostname);
646 652
    break;
647 653
  default:
648 654
    cwc->cwc_card_type = CARD_UNKNOWN;
......
1125 1131
      case CARD_SECA:
1126 1132
	cwc_emm_seca(cwc, data, len);
1127 1133
	break;
1134
      case CARD_DRE:
1135
	cwc_emm_dre(cwc, data, len);
1136
	break;
1128 1137
      case CARD_UNKNOWN:
1129 1138
	break;
1130 1139
      }
......
1213 1222
    cwc_send_msg(cwc, data, len, 0, 1);
1214 1223
}
1215 1224

  
1225
/**
1226
 * dre emm handler
1227
 */
1228
void
1229
cwc_emm_dre(cwc_t *cwc, uint8_t *data, int len)
1230
{
1231
  int match = 0;
1216 1232

  
1233
  if (data[0] == 0x87) {
1234
    if (memcmp(&data[3], &cwc->cwc_ua[4], 4) == 0) {
1235
      match = 1;
1236
    }
1237
  } 
1238
  else if (data[0] == 0x86) {
1239
    int i;
1240
    for (i=0; i < cwc->cwc_num_providers; i++) {
1241
      if (memcmp(&data[40], &cwc->cwc_providers[i].sa[4], 4) == 0) {
1242
/*      if (memcmp(&data[3], &cwc->cwc_providers[i].sa[4], 1) == 0) { */
1243
        match = 1;
1244
        break;
1245
      }
1246
    }
1247
  }
1248

  
1249
  if (match)
1250
    cwc_send_msg(cwc, data, len, 0, 1);
1251
}
1252

  
1253

  
1217 1254
/**
1218 1255
 *
1219 1256
 */
src/psi.c (working copy)
849 849
  { "Mentor",           0x2500 }, 
850 850
  { "EBU",              0x2600 }, 
851 851
  { "GI",               0x4700 }, 
852
  { "Telemann",         0x4800 }
852
  { "Telemann",         0x4800 },
853
  { "DRECrypt",         0x4ae0 },
854
  { "DRECrypt2",        0x4ae1 }
853 855
};
854 856

  
855 857
const char *
(2-2/2)