Index: src/cwc.c =================================================================== --- src/cwc.c (revision 5783) +++ src/cwc.c (working copy) @@ -47,7 +47,7 @@ #define CWC_KEEPALIVE_INTERVAL 30 -#define CWS_NETMSGSIZE 256 +#define CWS_NETMSGSIZE 272 #define CWS_FIRSTCMDNO 0xe0 /** @@ -55,6 +55,7 @@ */ typedef enum { CARD_IRDETO, + CARD_DRE, CARD_CONAX, CARD_SECA, CARD_UNKNOWN @@ -254,6 +255,7 @@ static void cwc_detecs_card_type(cwc_t *cwc); void cwc_emm_conax(cwc_t *cwc, uint8_t *data, int len); void cwc_emm_irdeto(cwc_t *cwc, uint8_t *data, int len); +void cwc_emm_dre(cwc_t *cwc, uint8_t *data, int len); void cwc_emm_seca(cwc_t *cwc, uint8_t *data, int len); /** @@ -643,6 +645,10 @@ cwc->cwc_card_type = CARD_SECA; tvhlog(LOG_INFO, "cwc", "%s: seca card", cwc->cwc_hostname); + case 0x4a: + cwc->cwc_card_type = CARD_DRE; + tvhlog(LOG_INFO, "cwc", "%s: dre card", + cwc->cwc_hostname); break; default: cwc->cwc_card_type = CARD_UNKNOWN; @@ -1125,6 +1131,9 @@ case CARD_SECA: cwc_emm_seca(cwc, data, len); break; + case CARD_DRE: + cwc_emm_dre(cwc, data, len); + break; case CARD_UNKNOWN: break; } @@ -1213,7 +1222,35 @@ cwc_send_msg(cwc, data, len, 0, 1); } +/** + * dre emm handler + */ +void +cwc_emm_dre(cwc_t *cwc, uint8_t *data, int len) +{ + int match = 0; + if (data[0] == 0x87) { + if (memcmp(&data[3], &cwc->cwc_ua[4], 4) == 0) { + match = 1; + } + } + else if (data[0] == 0x86) { + int i; + for (i=0; i < cwc->cwc_num_providers; i++) { + if (memcmp(&data[40], &cwc->cwc_providers[i].sa[4], 4) == 0) { +/* if (memcmp(&data[3], &cwc->cwc_providers[i].sa[4], 1) == 0) { */ + match = 1; + break; + } + } + } + + if (match) + cwc_send_msg(cwc, data, len, 0, 1); +} + + /** * */ Index: src/psi.c =================================================================== --- src/psi.c (revision 5783) +++ src/psi.c (working copy) @@ -849,7 +849,9 @@ { "Mentor", 0x2500 }, { "EBU", 0x2600 }, { "GI", 0x4700 }, - { "Telemann", 0x4800 } + { "Telemann", 0x4800 }, + { "DRECrypt", 0x4ae0 }, + { "DRECrypt2", 0x4ae1 } }; const char *