Changeset 2813
- Timestamp:
- 07/22/10 18:29:53 (14 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/globals.h
r2811 r2813 172 172 #define BOXTYPE_DBOX2 4 173 173 #define BOXTYPE_IPBOX 5 174 #define BOXTYPE_IPBOX_PMT 6 175 #define BOXTYPE_AZBOX 7 176 #define BOXTYPES 7 174 #define BOXTYPE_IPBOX_PMT 6 175 #define BOXTYPES 6 177 176 extern char *boxdesc[]; 178 177 #endif -
trunk/module-dvbapi.c
r2811 r2813 1 1 #include "globals.h" 2 2 3 #ifdef AZBOX4 #include "openxcas/openxcas_api.h"5 #include "openxcas/openxcas_message.h"6 #endif7 8 3 #ifdef HAVE_DVBAPI 9 4 … … 12 7 extern struct s_reader * reader; 13 8 14 char *boxdesc[] = { "none", "dreambox", "duckbox", "ufs910", "dbox2", "ipbox", "ipbox-pmt" , "azbox"};9 char *boxdesc[] = { "none", "dreambox", "duckbox", "ufs910", "dbox2", "ipbox", "ipbox-pmt" }; 15 10 16 11 struct box_devices devices[BOX_COUNT] = { … … 24 19 int selected_api=-1; 25 20 int disable_pmt_files=0; 26 int openxcas_provid, openxcas_seq, openxcas_filter_idx, openxcas_stream_id, openxcas_cipher_idx;27 unsigned char openxcas_cw[16];28 29 unsigned short openxcas_sid, openxcas_caid, openxcas_ecm_pid, openxcas_video_pid, openxcas_audio_pid, openxcas_data_pid;30 21 int dir_fd=-1, pausecam=0; 31 22 unsigned short global_caid_list[MAX_CAID]; 32 23 DEMUXTYPE demux[MAX_DEMUX]; 33 24 34 void dvbapi_openxcas_ecm_callback(int stream_id, unsigned int sequence, int cipher_index, 35 unsigned int caid, unsigned char *ecm_data, int l, unsigned short pid) { 36 cs_debug("openxcas: ecm callback received"); 37 38 openxcas_caid; 39 openxcas_ecm_pid = pid; 40 41 ECM_REQUEST *er; 42 if (!(er=get_ecmtask())) 43 return; 44 45 er->srvid = openxcas_sid; 46 er->caid = openxcas_caid; 47 er->pid = openxcas_ecm_pid; 48 er->prid = openxcas_provid; 49 50 er->l=l; 51 memcpy(er->ecm, ecm_data, er->l); 52 53 cs_debug("request cw for caid %04X provid %06X srvid %04X pid %04X", er->caid, er->prid, er->srvid, er->pid); 54 get_cw(er); 55 56 //openxcas_stop_filter(openxcas_stream_id, OPENXCAS_FILTER_ECM); 57 //openxcas_remove_filter(openxcas_stream_id, OPENXCAS_FILTER_ECM); 58 59 openxcas_cipher_idx = cipher_index; 60 61 struct timeb tp; 62 cs_ftime(&tp); 63 tp.time+=500; 64 65 chk_pending(tp); 66 //chk_dcw(client[cs_idx].fd_m2c_c); 67 68 struct pollfd pfd; 69 pfd.fd = client[cs_idx].fd_m2c_c; 70 pfd.events = POLLIN | POLLPRI; 71 72 while(1) { 73 chk_pending(tp); 74 75 if (poll(&pfd, 1, 10) < 0) 76 continue; 77 78 if (pfd.revents & (POLLHUP | POLLNVAL)) { 79 cs_debug("openxcas: ecm/cw error"); 80 break; 81 } 82 83 if (pfd.revents & (POLLIN | POLLPRI)) { 84 chk_dcw(client[cs_idx].fd_m2c_c); 85 break; 86 } 87 } 88 /* 89 unsigned char mask[12]; 90 unsigned char comp[12]; 91 memset(&mask, 0x00, sizeof(mask)); 92 memset(&comp, 0x00, sizeof(comp)); 93 94 mask[0] = 0xff; 95 comp[0] = ecm_data[0] ^ 1; 96 97 if (openxcas_add_filter(openxcas_stream_id, OPENXCAS_FILTER_ECM, 0, 0xffff, openxcas_ecm_pid, mask, comp, (void *)dvbapi_openxcas_ecm_callback) < 0) 98 { 99 cs_log("openxcas: unable to add ecm filter (0)"); 100 if (openxcas_add_filter(openxcas_stream_id, OPENXCAS_FILTER_ECM, openxcas_caid, 0xffff, openxcas_ecm_pid, mask, comp, (void *)dvbapi_openxcas_ecm_callback) < 0) 101 cs_log("openxcas: unable to add ecm filter (%04x)", openxcas_caid); 102 else 103 cs_debug("openxcas: ecm filter added, pid = %x, caid = %x", openxcas_ecm_pid, openxcas_caid); 104 } else 105 cs_debug("openxcas: ecm filter added, pid = %x, caid = %x", openxcas_ecm_pid, openxcas_caid); 106 107 if (openxcas_start_filter(openxcas_stream_id, openxcas_seq, OPENXCAS_FILTER_ECM) < 0) 108 cs_log("openxcas: unable to start ecm filter"); 109 else 110 cs_debug("openxcas: ecm filter started");*/ 111 } 112 113 void dvbapi_openxcas_ex_callback(int stream_id, unsigned int seq, int idx, unsigned int pid, unsigned char *ecm_data, int l) { 114 cs_debug("openxcas: ex callback received"); 115 116 openxcas_caid; 117 openxcas_ecm_pid = pid; 118 119 ECM_REQUEST *er; 120 if (!(er=get_ecmtask())) 121 return; 122 123 er->srvid = openxcas_sid; 124 er->caid = openxcas_caid; 125 er->pid = openxcas_ecm_pid; 126 er->prid = openxcas_provid; 127 128 er->l=l; 129 memcpy(er->ecm, ecm_data, er->l); 130 131 cs_debug("request cw for caid %04X provid %06X srvid %04X pid %04X", er->caid, er->prid, er->srvid, er->pid); 132 get_cw(er); 133 134 if (openxcas_stop_filter_ex(openxcas_stream_id, openxcas_seq, openxcas_filter_idx) < 0) 135 cs_log("openxcas: unable to stop ex filter"); 136 else 137 cs_debug("openxcas: ex filter stopped"); 138 139 struct timeb tp; 140 cs_ftime(&tp); 141 tp.time+=500; 142 143 chk_pending(tp); 144 chk_dcw(client[cs_idx].fd_m2c_c); 145 146 /* 147 struct pollfd pfd; 148 pfd.fd = client[cs_idx].fd_m2c_c; 149 pfd.events = (POLLIN | POLLPRI); 150 151 while(1) { 152 chk_pending(tp); 153 154 poll(&pfd, 1, 10); 155 156 if (pfd.revents & (POLLIN | POLLPRI)) 157 chk_dcw(client[cs_idx].fd_m2c_c); 158 break; 159 }*/ 160 161 unsigned char mask[12]; 162 unsigned char comp[12]; 163 memset(&mask, 0x00, sizeof(mask)); 164 memset(&comp, 0x00, sizeof(comp)); 165 166 mask[0] = 0xff; 167 comp[0] = ecm_data[0] ^ 1; 168 169 if ((openxcas_filter_idx = openxcas_start_filter_ex(openxcas_stream_id, openxcas_seq, openxcas_ecm_pid, 170 mask, comp, (void *)dvbapi_openxcas_ex_callback)) < 0) 171 cs_log("openxcas: unable to start ex filter"); 172 else 173 cs_debug("openxcas: ex filter started, pid = %x", openxcas_ecm_pid); 174 } 175 176 int dvbapi_set_filter(int demux_id, int api, unsigned short pid, uchar *filt, uchar *mask, int timeout, int pidindex, int count, int type, unsigned caid) { 177 int ret=-1; 178 if (cfg->dvbapi_boxtype == BOXTYPE_AZBOX) { 179 openxcas_caid = caid; 180 openxcas_ecm_pid = pid; 181 /* 182 openxcas_destory_cipher_ex(openxcas_stream_id, openxcas_seq); 183 184 if (!openxcas_create_cipher_ex(openxcas_stream_id, openxcas_seq, 0, openxcas_ecm_pid, 185 openxcas_video_pid, 0xffff, openxcas_audio_pid, 0xffff, 186 0xffff, 0xffff)) 187 cs_log("openxcas: failed to create cipher ex"); 188 else 189 cs_debug("openxcas: cipher created");*/ 190 191 ret = 1; 192 } else { 193 int n=-1,i,dmx_fd; 194 195 for (i=0; i<MAX_FILTER && demux[demux_id].demux_fd[i].fd>0; i++); 196 197 if (i>=MAX_FILTER) { 198 cs_log("no free filter"); 199 return -1; 200 } 201 n=i; 202 203 dmx_fd = dvbapi_open_device(demux_id, 0); 204 205 demux[demux_id].demux_fd[n].fd = dmx_fd; 206 demux[demux_id].demux_fd[n].pidindex = pidindex; 207 demux[demux_id].demux_fd[n].pid = pid; 208 demux[demux_id].demux_fd[n].type = type; 209 demux[demux_id].demux_fd[n].count = count; 210 211 switch(api) { 212 case DVBAPI_3: 213 api=api; 214 struct dmx_sct_filter_params sFP2; 215 216 memset(&sFP2,0,sizeof(sFP2)); 217 218 sFP2.pid = pid; 219 sFP2.timeout = timeout; 220 sFP2.flags = DMX_IMMEDIATE_START; 221 memcpy(sFP2.filter.filter,filt,16); 222 memcpy(sFP2.filter.mask,mask,16); 223 ret=ioctl(dmx_fd, DMX_SET_FILTER, &sFP2); 224 225 break; 226 case DVBAPI_1: 227 api=api; 228 struct dmxSctFilterParams sFP1; 229 230 memset(&sFP1,0,sizeof(sFP1)); 231 232 sFP1.pid = pid; 233 sFP1.timeout = timeout; 234 sFP1.flags = DMX_IMMEDIATE_START; 235 memcpy(sFP1.filter.filter,filt,16); 236 memcpy(sFP1.filter.mask,mask,16); 237 ret=ioctl(dmx_fd, DMX_SET_FILTER1, &sFP1); 238 239 break; 240 #ifdef WITH_STAPI 241 case STAPI: 242 ret=stapi_set_filter(demux_id, pid, filt, mask, n); 243 244 break; 245 #endif 246 default: 247 break; 248 } 249 250 if (ret < 0) 251 cs_debug("could not start demux filter (Errno: %d)", errno); 252 } 25 int dvbapi_set_filter(int demux_id, int api, unsigned short pid, uchar *filt, uchar *mask, int timeout, int pidindex, int count, int type) { 26 int ret=-1,n=-1,i,dmx_fd; 27 28 for (i=0; i<MAX_FILTER && demux[demux_id].demux_fd[i].fd>0; i++); 29 30 if (i>=MAX_FILTER) { 31 cs_log("no free filter"); 32 return -1; 33 } 34 n=i; 35 36 dmx_fd = dvbapi_open_device(demux_id, 0); 37 38 demux[demux_id].demux_fd[n].fd = dmx_fd; 39 demux[demux_id].demux_fd[n].pidindex = pidindex; 40 demux[demux_id].demux_fd[n].pid = pid; 41 demux[demux_id].demux_fd[n].type = type; 42 demux[demux_id].demux_fd[n].count = count; 43 44 switch(api) { 45 case DVBAPI_3: 46 api=api; 47 struct dmx_sct_filter_params sFP2; 48 49 memset(&sFP2,0,sizeof(sFP2)); 50 51 sFP2.pid = pid; 52 sFP2.timeout = timeout; 53 sFP2.flags = DMX_IMMEDIATE_START; 54 memcpy(sFP2.filter.filter,filt,16); 55 memcpy(sFP2.filter.mask,mask,16); 56 ret=ioctl(dmx_fd, DMX_SET_FILTER, &sFP2); 57 58 break; 59 case DVBAPI_1: 60 api=api; 61 struct dmxSctFilterParams sFP1; 62 63 memset(&sFP1,0,sizeof(sFP1)); 64 65 sFP1.pid = pid; 66 sFP1.timeout = timeout; 67 sFP1.flags = DMX_IMMEDIATE_START; 68 memcpy(sFP1.filter.filter,filt,16); 69 memcpy(sFP1.filter.mask,mask,16); 70 ret=ioctl(dmx_fd, DMX_SET_FILTER1, &sFP1); 71 72 break; 73 #ifdef WITH_STAPI 74 case STAPI: 75 ret=stapi_set_filter(demux_id, pid, filt, mask, n); 76 77 break; 78 #endif 79 default: 80 break; 81 } 82 83 if (ret < 0) 84 cs_debug("could not start demux filter (Errno: %d)", errno); 253 85 254 86 return ret; … … 301 133 302 134 for (i=0;i<num_apis;i++) { 303 ret = dvbapi_set_filter(0, i, 0x0001, filter, filter+16, 1, 0, 0, TYPE_ECM , 0);135 ret = dvbapi_set_filter(0, i, 0x0001, filter, filter+16, 1, 0, 0, TYPE_ECM); 304 136 305 137 if (ret >= 0) { … … 372 204 373 205 int dvbapi_stop_filter(int demux_index, int type) { 374 375 376 377 if (demux[demux_index].demux_fd[g].type==type) { 378 379 380 206 int g; 207 208 for (g=0;g<MAX_FILTER;g++) { 209 if (demux[demux_index].demux_fd[g].type==type) { 210 dvbapi_stop_filternum(demux_index, g); 211 } 212 } 381 213 382 214 return 1; … … 384 216 385 217 int dvbapi_stop_filternum(int demux_index, int num) { 218 int ret=-1; 386 219 if (demux[demux_index].demux_fd[num].fd>0) { 387 220 #ifdef WITH_STAPI 388 stapi_remove_filter(demux_index, num);221 ret=stapi_remove_filter(demux_index, num); 389 222 #else 390 ioctl(demux[demux_index].demux_fd[num].fd,DMX_STOP);223 ret=ioctl(demux[demux_index].demux_fd[num].fd,DMX_STOP); 391 224 close(demux[demux_index].demux_fd[num].fd); 392 225 #endif 393 226 demux[demux_index].demux_fd[num].fd=0; 394 227 } 395 return 1;396 } 397 398 void dvbapi_start_filter(int demux_id, int pidindex, unsigned short pid, uchar table, uchar mask, int timeout, int type , unsigned short caid) {228 return ret; 229 } 230 231 void dvbapi_start_filter(int demux_id, int pidindex, unsigned short pid, uchar table, uchar mask, int timeout, int type) { 399 232 uchar filter[32]; 400 233 … … 406 239 filter[16]=mask; 407 240 408 dvbapi_set_filter(demux_id, selected_api, pid, filter, filter+16, timeout, pidindex, 0, type , caid);241 dvbapi_set_filter(demux_id, selected_api, pid, filter, filter+16, timeout, pidindex, 0, type); 409 242 } 410 243 … … 457 290 cs_debug_mask(D_EMM, "dvbapi: starting emm filter %s, pid: 0x%04X", typtext[emmtype], demux[demux_index].ECMpids[demux[demux_index].pidindex].EMM_PID); 458 291 cs_ddump_mask(D_EMM, filter, 32, "demux filter:"); 459 dvbapi_set_filter(demux_index, selected_api, demux[demux_index].ECMpids[demux[demux_index].pidindex].EMM_PID, filter, filter+16, 0, demux[demux_index].pidindex, count, TYPE_EMM , 0);292 dvbapi_set_filter(demux_index, selected_api, demux[demux_index].ECMpids[demux[demux_index].pidindex].EMM_PID, filter, filter+16, 0, demux[demux_index].pidindex, count, TYPE_EMM); 460 293 } 461 294 … … 611 444 612 445 if (cfg->dvbapi_au==1) 613 dvbapi_start_filter(demux_index, demux[demux_index].pidindex, 0x001, 0x01, 0xFF, 0, TYPE_EMM , 0); //CAT446 dvbapi_start_filter(demux_index, demux[demux_index].pidindex, 0x001, 0x01, 0xFF, 0, TYPE_EMM); //CAT 614 447 } 615 448 … … 909 742 910 743 cs_debug("[TRY PID %d] CAID: %04X PROVID: %06X CA_PID: %04X", num, demux[demux_id].ECMpids[num].CAID, demux[demux_id].ECMpids[num].PROVID, demux[demux_id].ECMpids[num].ECM_PID); 911 openxcas_provid = demux[demux_id].ECMpids[num].PROVID;912 openxcas_caid = demux[demux_id].ECMpids[num].CAID;913 openxcas_ecm_pid = demux[demux_id].ECMpids[num].ECM_PID;914 744 915 745 //grep ecm 916 dvbapi_start_filter(demux_id, num, demux[demux_id].ECMpids[num].ECM_PID, 0x80, 0xF0, 3000, TYPE_ECM , demux[demux_id].ECMpids[num].CAID); //ECM746 dvbapi_start_filter(demux_id, num, demux[demux_id].ECMpids[num].ECM_PID, 0x80, 0xF0, 3000, TYPE_ECM); //ECM 917 747 demux[demux_id].ECMpids[num].checked=1; 918 748 } … … 997 827 char *name = get_servicename(demux[demux_id].program_number, demux[demux_id].ECMpidcount>0 ? demux[demux_id].ECMpids[0].CAID : 0); 998 828 cs_log("new program number: %04X (%s)", program_number, name); 999 1000 openxcas_sid = program_number;1001 829 1002 830 if (demux[demux_id].ECMpidcount>0) { … … 1333 1161 1334 1162 void dvbapi_main_local() { 1335 if (cfg->dvbapi_boxtype == BOXTYPE_AZBOX) { 1336 char buf[OPENXCAS_MSG_MAX_LEN]; 1337 1338 openxcas_debug_message_onoff(1); // debug 1339 1340 if (openxcas_open("oscamCAS") < 0) { 1341 cs_log("openxcas: could not init"); 1342 return; 1343 } 1344 1345 struct timeb tp; 1346 cs_ftime(&tp); 1347 tp.time+=500; 1348 1349 openxcas_msg_t msg; 1350 int ret; 1351 while ((ret = openxcas_get_message(&msg, 0)) >= 0) { 1352 cs_sleepms(10); 1353 /* 1354 struct pollfd pfd; 1355 1356 pfd.fd = client[cs_idx].fd_m2c_c; 1357 pfd.events = (POLLIN | POLLPRI); 1358 poll(&pfd, 1, 10); 1359 if (pfd.revents & (POLLIN | POLLPRI)) 1360 chk_dcw(client[cs_idx].fd_m2c_c);*/ 1361 1362 if (ret) { 1363 openxcas_stream_id = msg.stream_id; 1364 openxcas_seq = msg.sequence; 1365 1366 switch(msg.cmd) { 1367 case OPENXCAS_SELECT_CHANNEL: 1368 cs_debug("openxcas: msg: OPENXCAS_SELECT_CHANNEL"); 1369 1370 // parse channel info 1371 struct stOpenXCASChannel chan; 1372 memcpy(&chan, msg.buf, msg.buf_len); 1373 1374 cs_log("openxcas: channel change: sid = %x, vpid = %x. apid = %x", chan.service_id, chan.v_pid, chan.a_pid); 1375 1376 openxcas_video_pid = chan.v_pid; 1377 openxcas_audio_pid = chan.a_pid; 1378 openxcas_data_pid = chan.d_pid; 1379 1380 break; 1381 case OPENXCAS_START_PMT_ECM: 1382 cs_debug("openxcas: msg: OPENXCAS_START_PMT_ECM"); 1383 1384 // parse pmt 1385 1386 uchar *dest = malloc(msg.buf_len + 7 - 12 - 4); 1387 1388 memcpy(dest, "\x00\xFF\xFF\x00\x00\x13\x00", 7); 1389 1390 dest[1] = msg.buf[3]; 1391 dest[2] = msg.buf[4]; 1392 dest[5] = msg.buf[11]+1; 1393 1394 memcpy(dest + 7, msg.buf + 12, msg.buf_len - 12 - 4); 1395 1396 int pmt_id = dvbapi_parse_capmt(dest, 7 + msg.buf_len - 12 - 4, -1); 1397 free(dest); 1398 1399 unsigned char mask[12]; 1400 unsigned char comp[12]; 1401 memset(&mask, 0x00, sizeof(mask)); 1402 memset(&comp, 0x00, sizeof(comp)); 1403 1404 mask[0] = 0xfe; 1405 comp[0] = 0x80; 1406 1407 /* 1408 if ((openxcas_filter_idx = openxcas_start_filter_ex(msg.stream_id, msg.sequence, openxcas_ecm_pid, 1409 mask, comp, (void *)dvbapi_openxcas_ex_callback)) < 0) 1410 cs_log("openxcas: unable to start ex filter"); 1411 else 1412 cs_debug("openxcas: ex filter started, pid = %x", openxcas_ecm_pid); 1413 */ 1414 1415 if ((ret = openxcas_add_filter(msg.stream_id, OPENXCAS_FILTER_ECM, 0, 0xffff, openxcas_ecm_pid, mask, comp, (void *)dvbapi_openxcas_ecm_callback)) < 0) 1416 cs_log("openxcas: unable to add ecm filter"); 1417 else 1418 cs_debug("openxcas: ecm filter added, pid = %x, caid = %x", openxcas_ecm_pid, openxcas_caid); 1419 1420 if (openxcas_start_filter(msg.stream_id, msg.sequence, OPENXCAS_FILTER_ECM) < 0) 1421 cs_log("openxcas: unable to start ecm filter"); 1422 else 1423 cs_debug("openxcas: ecm filter started"); 1424 1425 /* 1426 unsigned char mask[12]; 1427 unsigned char comp[12]; 1428 memset(&mask, 0x00, sizeof(mask)); 1429 memset(&comp, 0x00, sizeof(comp)); 1430 1431 mask[0] = 0xfe; 1432 comp[0] = 0x80; 1433 1434 openxcas_stop_filter_ex(openxcas_stream_id, openxcas_seq, openxcas_filter_idx); 1435 if ((openxcas_filter_idx = openxcas_start_filter_ex(openxcas_stream_id, openxcas_seq, openxcas_ecm_pid, mask, comp,(void*)dvbapi_openxcas_ex_callback)) < 0) 1436 cs_log("openxcas: unable to start ex filter on ecm pid"); 1437 else 1438 cs_debug("openxcas: ex filter on ecm pid started"); 1439 */ 1440 1441 if (!openxcas_create_cipher_ex(openxcas_stream_id, openxcas_seq, 0, openxcas_ecm_pid, 1442 openxcas_video_pid, 0xffff, openxcas_audio_pid, 0xffff, 1443 0xffff, 0xffff)) 1444 cs_log("openxcas: failed to create cipher ex"); 1445 else 1446 cs_debug("openxcas: cipher created"); 1447 1448 break; 1449 case OPENXCAS_STOP_PMT_ECM: 1450 cs_debug("openxcas: msg: OPENXCAS_STOP_PMT_ECM"); 1451 openxcas_stop_filter(msg.stream_id, OPENXCAS_FILTER_ECM); 1452 openxcas_remove_filter(msg.stream_id, OPENXCAS_FILTER_ECM); 1453 openxcas_stop_filter_ex(msg.stream_id, msg.sequence, openxcas_filter_idx); 1454 openxcas_destory_cipher_ex(msg.stream_id, msg.sequence); 1455 memset(&demux, 0, sizeof(demux)); 1456 break; 1457 case OPENXCAS_ECM_CALLBACK: 1458 cs_debug("openxcas: msg: OPENXCAS_ECM_CALLBACK"); 1459 1460 struct stOpenXCAS_Data data; 1461 memcpy(&data, msg.buf, msg.buf_len); 1462 openxcas_filter_callback(msg.stream_id, msg.sequence, OPENXCAS_FILTER_ECM, &data); 1463 1464 break; 1465 case OPENXCAS_PID_FILTER_CALLBACK: 1466 cs_debug("openxcas: msg: OPENXCAS_PID_FILTER_CALLBACK"); 1467 openxcas_filter_callback_ex(msg.stream_id, msg.sequence, (struct stOpenXCAS_Data *)msg.buf); 1468 break; 1469 case OPENXCAS_QUIT: 1470 cs_debug("openxcas: msg: OPENXCAS_QUIT"); 1471 openxcas_close(); 1472 cs_log("openxcas: exited"); 1473 return; 1474 break; 1475 case OPENXCAS_UKNOWN_MSG: 1476 default: 1477 cs_debug("openxcas: msg: OPENXCAS_UKNOWN_MSG (%d)", msg.cmd); 1478 //cs_ddump(&msg, sizeof(msg), "msg dump:"); 1479 break; 1480 } 1481 } 1482 } 1483 openxcas_close(); 1484 cs_log("openxcas: invalid message"); 1485 return; 1486 } else { 1487 int maxpfdsize=(MAX_DEMUX*MAX_FILTER)+MAX_DEMUX+2; 1488 struct pollfd pfd2[maxpfdsize]; 1489 int i,rc,pfdcount,g,connfd,clilen,j; 1490 int ids[maxpfdsize], fdn[maxpfdsize], type[maxpfdsize]; 1491 struct timeb tp; 1492 struct sockaddr_un servaddr; 1493 ssize_t len=0; 1494 1495 for (i=0;i<MAX_DEMUX;i++) { 1496 memset(&demux[i], 0, sizeof(demux[i])); 1497 demux[i].pidindex=-1; 1498 demux[i].rdr=NULL; 1499 } 1500 1501 dvbapi_detect_api(); 1502 1503 if (selected_box == -1 || selected_api==-1) { 1504 cs_log("could not detect api version"); 1505 return; 1506 } 1507 1508 if (cfg->dvbapi_pmtmode == 1) 1509 disable_pmt_files=1; 1510 1511 int listenfd = -1; 1512 if (cfg->dvbapi_boxtype != BOXTYPE_IPBOX_PMT && cfg->dvbapi_pmtmode != 2) { 1513 listenfd = dvbapi_init_listenfd(); 1514 if (listenfd < 1) { 1515 cs_log("could not init camd.socket"); 1516 return; 1517 } 1518 } 1519 1520 struct sigaction signal_action; 1521 signal_action.sa_handler = event_handler; 1522 sigemptyset(&signal_action.sa_mask); 1523 signal_action.sa_flags = SA_RESTART; 1524 sigaction(SIGRTMIN + 1, &signal_action, NULL); 1525 1526 pthread_mutexattr_t attr; 1527 pthread_mutexattr_init(&attr); 1528 pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_ERRORCHECK); 1529 pthread_mutex_init(&event_handler_lock, &attr); 1530 1531 dir_fd = open(TMPDIR, O_RDONLY); 1532 if (dir_fd >= 0) { 1533 fcntl(dir_fd, F_SETSIG, SIGRTMIN + 1); 1534 fcntl(dir_fd, F_NOTIFY, DN_MODIFY | DN_CREATE | DN_DELETE | DN_MULTISHOT); 1535 event_handler(SIGRTMIN + 1); 1536 } 1537 1538 cs_ftime(&tp); 1539 tp.time+=500; 1540 1541 pfd2[0].fd = client[cs_idx].fd_m2c_c; 1542 pfd2[0].events = (POLLIN | POLLPRI); 1543 type[0]=0; 1544 1545 pfd2[1].fd = listenfd; 1546 pfd2[1].events = (POLLIN | POLLPRI); 1547 type[1]=1; 1548 1549 while (1) { 1550 if (master_pid!=getppid()) 1551 cs_exit(0); 1552 1553 pfdcount = (listenfd > -1) ? 2 : 1; 1554 1555 chk_pending(tp); 1556 1557 if (pausecam==1) { 1558 cs_sleepms(500); 1559 continue; 1560 } 1561 1562 for (i=0;i<MAX_DEMUX;i++) { 1563 for (g=0;g<MAX_FILTER;g++) { 1564 if (demux[i].demux_fd[g].fd>0 && selected_api != STAPI) { 1565 pfd2[pfdcount].fd = demux[i].demux_fd[g].fd; 1566 pfd2[pfdcount].events = (POLLIN | POLLPRI); 1567 ids[pfdcount]=i; 1568 fdn[pfdcount]=g; 1569 type[pfdcount++]=0; 1570 } 1571 } 1572 1573 if (demux[i].socket_fd>0) { 1574 rc=0; 1575 if (cfg->dvbapi_boxtype==BOXTYPE_IPBOX) { 1576 for (j = 0; j < pfdcount; j++) { 1577 if (pfd2[j].fd == demux[i].socket_fd) { 1578 rc=1; 1579 break; 1580 } 1581 } 1582 if (rc==1) continue; 1583 } 1584 1585 pfd2[pfdcount].fd=demux[i].socket_fd; 1586 pfd2[pfdcount].events = (POLLIN | POLLPRI | POLLHUP); 1587 type[pfdcount++]=1; 1588 } 1589 } 1590 1591 rc = poll(pfd2, pfdcount, 500); 1592 if (rc<1) continue; 1593 1594 for (i = 0; i < pfdcount; i++) { 1595 if (pfd2[i].revents > 3) 1596 cs_debug("event %d on fd %d", pfd2[i].revents, pfd2[i].fd); 1597 1598 if (pfd2[i].revents & (POLLHUP | POLLNVAL)) { 1599 if (type[i]==1) { 1600 for (j=0;j<MAX_DEMUX;j++) { 1601 if (demux[j].socket_fd==pfd2[i].fd) { 1602 dvbapi_stop_descrambling(j); 1603 } 1604 } 1605 close(pfd2[i].fd); 1606 continue; 1607 } 1608 if (pfd2[i].fd==client[cs_idx].fd_m2c_c) { 1609 cs_exit(0); 1610 } 1611 } 1612 if (pfd2[i].revents & (POLLIN | POLLPRI)) { 1613 if (pfd2[i].fd==client[cs_idx].fd_m2c_c) { 1614 chk_dcw(client[cs_idx].fd_m2c_c); 1615 continue; 1616 } 1617 1618 if (type[i]==1) { 1619 if (pfd2[i].fd==listenfd) { 1620 connfd = accept(listenfd, (struct sockaddr *)&servaddr, (socklen_t *)&clilen); 1621 cs_debug("new socket connection fd: %d", connfd); 1622 1623 disable_pmt_files=1; 1624 1625 if (connfd <= 0) { 1626 cs_log("accept() returns error %d, fd event %d", errno, pfd2[i].revents); 1627 continue; 1628 } 1629 } else { 1630 cs_debug("New capmt on old socket. Please report."); 1631 connfd = pfd2[i].fd; 1632 } 1633 1634 len = read(connfd, mbuf, sizeof(mbuf)); 1635 1636 if (len < 3) { 1637 cs_debug("camd.socket: too short message received"); 1638 continue; 1639 } 1640 1641 dvbapi_handlesockmsg(mbuf, len, connfd); 1642 1643 } else { // type==0 1644 int demux_index=ids[i]; 1645 int n=fdn[i]; 1646 1647 if ((len=dvbapi_read_device(pfd2[i].fd, mbuf, sizeof(mbuf))) <= 0) { 1648 if (demux[demux_index].pidindex==-1) { 1649 dvbapi_try_next_caid(demux_index); 1650 } 1651 continue; 1652 } 1653 1654 if (pfd2[i].fd==(int)demux[demux_index].demux_fd[n].fd) { 1655 dvbapi_process_input(demux_index,n,mbuf,len); 1656 } 1657 } 1658 } 1659 } 1660 } 1661 } 1163 int maxpfdsize=(MAX_DEMUX*MAX_FILTER)+MAX_DEMUX+2; 1164 struct pollfd pfd2[maxpfdsize]; 1165 int i,rc,pfdcount,g,connfd,clilen,j; 1166 int ids[maxpfdsize], fdn[maxpfdsize], type[maxpfdsize]; 1167 struct timeb tp; 1168 struct sockaddr_un servaddr; 1169 ssize_t len=0; 1170 1171 for (i=0;i<MAX_DEMUX;i++) { 1172 memset(&demux[i], 0, sizeof(demux[i])); 1173 demux[i].pidindex=-1; 1174 demux[i].rdr=NULL; 1175 } 1176 1177 dvbapi_detect_api(); 1178 1179 if (selected_box == -1 || selected_api==-1) { 1180 cs_log("could not detect api version"); 1181 return; 1182 } 1183 1184 if (cfg->dvbapi_pmtmode == 1) 1185 disable_pmt_files=1; 1186 1187 int listenfd = -1; 1188 if (cfg->dvbapi_boxtype != BOXTYPE_IPBOX_PMT && cfg->dvbapi_pmtmode != 2) { 1189 listenfd = dvbapi_init_listenfd(); 1190 if (listenfd < 1) { 1191 cs_log("could not init camd.socket."); 1192 return; 1193 } 1194 } 1195 1196 struct sigaction signal_action; 1197 signal_action.sa_handler = event_handler; 1198 sigemptyset(&signal_action.sa_mask); 1199 signal_action.sa_flags = SA_RESTART; 1200 sigaction(SIGRTMIN + 1, &signal_action, NULL); 1201 1202 pthread_mutexattr_t attr; 1203 pthread_mutexattr_init(&attr); 1204 pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_ERRORCHECK); 1205 pthread_mutex_init(&event_handler_lock, &attr); 1206 1207 dir_fd = open(TMPDIR, O_RDONLY); 1208 if (dir_fd >= 0) { 1209 fcntl(dir_fd, F_SETSIG, SIGRTMIN + 1); 1210 fcntl(dir_fd, F_NOTIFY, DN_MODIFY | DN_CREATE | DN_DELETE | DN_MULTISHOT); 1211 event_handler(SIGRTMIN + 1); 1212 } 1213 1214 cs_ftime(&tp); 1215 tp.time+=500; 1216 1217 pfd2[0].fd = client[cs_idx].fd_m2c_c; 1218 pfd2[0].events = (POLLIN | POLLPRI); 1219 type[0]=0; 1220 1221 pfd2[1].fd = listenfd; 1222 pfd2[1].events = (POLLIN | POLLPRI); 1223 type[1]=1; 1224 1225 while (1) { 1226 if (master_pid!=getppid()) 1227 cs_exit(0); 1228 1229 pfdcount = (listenfd > -1) ? 2 : 1; 1230 1231 chk_pending(tp); 1232 1233 if (pausecam==1) { 1234 cs_sleepms(500); 1235 continue; 1236 } 1237 1238 for (i=0;i<MAX_DEMUX;i++) { 1239 for (g=0;g<MAX_FILTER;g++) { 1240 if (demux[i].demux_fd[g].fd>0 && selected_api != STAPI) { 1241 pfd2[pfdcount].fd = demux[i].demux_fd[g].fd; 1242 pfd2[pfdcount].events = (POLLIN | POLLPRI); 1243 ids[pfdcount]=i; 1244 fdn[pfdcount]=g; 1245 type[pfdcount++]=0; 1246 } 1247 } 1248 1249 if (demux[i].socket_fd>0) { 1250 rc=0; 1251 if (cfg->dvbapi_boxtype==BOXTYPE_IPBOX) { 1252 for (j = 0; j < pfdcount; j++) { 1253 if (pfd2[j].fd == demux[i].socket_fd) { 1254 rc=1; 1255 break; 1256 } 1257 } 1258 if (rc==1) continue; 1259 } 1260 1261 pfd2[pfdcount].fd=demux[i].socket_fd; 1262 pfd2[pfdcount].events = (POLLIN | POLLPRI | POLLHUP); 1263 type[pfdcount++]=1; 1264 } 1265 } 1266 1267 rc = poll(pfd2, pfdcount, 500); 1268 if (rc<1) continue; 1269 1270 for (i = 0; i < pfdcount; i++) { 1271 if (pfd2[i].revents > 3) 1272 cs_debug("event %d on fd %d", pfd2[i].revents, pfd2[i].fd); 1273 1274 if (pfd2[i].revents & (POLLHUP | POLLNVAL)) { 1275 if (type[i]==1) { 1276 for (j=0;j<MAX_DEMUX;j++) { 1277 if (demux[j].socket_fd==pfd2[i].fd) { 1278 dvbapi_stop_descrambling(j); 1279 } 1280 } 1281 close(pfd2[i].fd); 1282 continue; 1283 } 1284 if (pfd2[i].fd==client[cs_idx].fd_m2c_c) { 1285 cs_exit(0); 1286 } 1287 } 1288 if (pfd2[i].revents & (POLLIN | POLLPRI)) { 1289 if (pfd2[i].fd==client[cs_idx].fd_m2c_c) { 1290 chk_dcw(client[cs_idx].fd_m2c_c); 1291 continue; 1292 } 1293 1294 if (type[i]==1) { 1295 if (pfd2[i].fd==listenfd) { 1296 connfd = accept(listenfd, (struct sockaddr *)&servaddr, (socklen_t *)&clilen); 1297 cs_debug("new socket connection fd: %d", connfd); 1298 1299 disable_pmt_files=1; 1300 1301 if (connfd <= 0) { 1302 cs_log("accept() returns error %d, fd event %d", errno, pfd2[i].revents); 1303 continue; 1304 } 1305 } else { 1306 cs_debug("New capmt on old socket. Please report."); 1307 connfd = pfd2[i].fd; 1308 } 1309 1310 len = read(connfd, mbuf, sizeof(mbuf)); 1311 1312 if (len < 3) { 1313 cs_debug("camd.socket: too short message received"); 1314 continue; 1315 } 1316 1317 dvbapi_handlesockmsg(mbuf, len, connfd); 1318 1319 } else { // type==0 1320 int demux_index=ids[i]; 1321 int n=fdn[i]; 1322 1323 if ((len=dvbapi_read_device(pfd2[i].fd, mbuf, sizeof(mbuf))) <= 0) { 1324 if (demux[demux_index].pidindex==-1) { 1325 dvbapi_try_next_caid(demux_index); 1326 } 1327 continue; 1328 } 1329 1330 if (pfd2[i].fd==(int)demux[demux_index].demux_fd[n].fd) { 1331 dvbapi_process_input(demux_index,n,mbuf,len); 1332 } 1333 } 1334 } 1335 } 1336 } 1662 1337 return; 1663 1338 } 1664 1339 1665 1340 void dvbapi_send_dcw(ECM_REQUEST *er) { 1666 if (cfg->dvbapi_boxtype == BOXTYPE_AZBOX) { 1667 cs_debug("openxcas: send_dcw"); 1668 1669 int i; 1670 for (i=0;i<MAX_DEMUX;i++) { 1671 if (er->rc>3 && demux[i].pidindex==-1) { 1672 dvbapi_try_next_caid(i); 1673 } 1674 1675 if (er->rc>3) { 1676 cs_debug("cw not found"); 1677 1678 openxcas_stop_filter(openxcas_stream_id, OPENXCAS_FILTER_ECM); 1679 openxcas_remove_filter(openxcas_stream_id, OPENXCAS_FILTER_ECM); 1680 1681 unsigned char mask[12]; 1682 unsigned char comp[12]; 1683 memset(&mask, 0x00, sizeof(mask)); 1684 memset(&comp, 0x00, sizeof(comp)); 1685 1686 mask[0] = 0xfe; 1687 comp[0] = 0x80; 1688 1689 if (openxcas_add_filter(openxcas_stream_id, OPENXCAS_FILTER_ECM, 0, 0xffff, openxcas_ecm_pid, mask, comp, (void *)dvbapi_openxcas_ecm_callback) < 0) 1690 { 1691 cs_log("openxcas: unable to add ecm filter (0)"); 1692 if (openxcas_add_filter(openxcas_stream_id, OPENXCAS_FILTER_ECM, openxcas_caid, 0xffff, openxcas_ecm_pid, mask, comp, (void *)dvbapi_openxcas_ecm_callback) < 0) 1693 cs_log("openxcas: unable to add ecm filter (%04x)", openxcas_caid); 1694 else 1695 cs_debug("openxcas: ecm filter added, pid = %x, caid = %x", openxcas_ecm_pid, openxcas_caid); 1696 } else 1697 cs_debug("openxcas: ecm filter added, pid = %x, caid = %x", openxcas_ecm_pid, openxcas_caid); 1698 1699 if (openxcas_start_filter(openxcas_stream_id, openxcas_seq, OPENXCAS_FILTER_ECM) < 0) 1700 cs_log("openxcas: unable to start ecm filter"); 1701 else 1702 cs_debug("openxcas: ecm filter started"); 1703 return; 1704 } 1705 } 1706 1707 memcpy(openxcas_cw + (8 * (er->ecm[0] & 1)), er->cw + (8 * (er->ecm[0] & 1)), 8); 1708 1709 if (openxcas_set_key(openxcas_stream_id, openxcas_seq, 0, openxcas_cipher_idx, openxcas_cw, openxcas_cw + 8) != 1) 1710 cs_log("openxcas: set cw failed"); 1711 /*if (openxcas_set_key_ex(openxcas_stream_id, openxcas_seq, 0, openxcas_ecm_pid, openxcas_cw, openxcas_cw + 8) != 1) 1712 cs_log("openxcas: set cw failed");*/ 1713 else 1714 cs_ddump(openxcas_cw, 16, "openxcas: write cws to descrambler"); 1715 } else { 1716 int i,n; 1717 1718 for (i=0;i<MAX_DEMUX;i++) { 1719 if (demux[i].program_number==er->srvid) { 1720 demux[i].rdr=&reader[er->reader[0]]; 1721 1722 if (er->rc<=3 && demux[i].pidindex==-1 && er->caid!=0) { 1723 dvbapi_start_descrambling(i, er->caid, er->pid); 1724 } 1725 1726 if (er->rc==4 && cfg->dvbapi_au==1 && dvbapi_check_array(global_caid_list, MAX_CAID, er->caid)>=0 && er->caid!=0x0500 && er->caid!=0x0100) { 1727 //local card and not found -> maybe card need emm 1728 dvbapi_start_descrambling(i, er->caid, er->pid); 1729 } 1730 1731 if (er->rc>3 && demux[i].pidindex==-1) { 1732 dvbapi_try_next_caid(i); 1733 return; 1734 } 1735 1736 if (er->rc>3) { 1737 cs_debug("cw not found"); 1738 return; 1739 } 1740 1741 if (demux[i].ca_fd<=0) { 1742 cs_log("could not write cw."); 1743 demux[i].ca_fd = dvbapi_open_device(i,1); 1744 if (demux[i].ca_fd<=0) 1745 return; 1746 } 1747 1748 int dindex = dvbapi_check_array(cfg->dvbapi_delaytab.caid, CS_MAXCAIDTAB, er->caid); 1749 if (dindex>=0) { 1750 char tmp1[5]; 1751 sprintf(tmp1, "%04X", cfg->dvbapi_delaytab.mask[dindex]); 1752 int cw_delay = strtol(tmp1, '\0', 10); 1753 if (cw_delay<1000) { 1754 cs_debug("wait %d ms", cw_delay); 1755 cs_sleepms(cw_delay); 1756 } 1757 } 1758 #ifdef WITH_STAPI 1759 stapi_write_cw(i, er->cw); 1760 #else 1761 unsigned char nullcw[8]; 1762 memset(nullcw, 0, 8); 1763 ca_descr_t ca_descr; 1764 memset(&ca_descr,0,sizeof(ca_descr)); 1765 1766 for (n=0;n<2;n++) { 1767 if (memcmp(er->cw+(n*8),demux[i].lastcw[n],8)!=0 && memcmp(er->cw+(n*8),nullcw,8)!=0) { 1768 ca_descr.index = i; 1769 ca_descr.parity = n; 1770 memcpy(demux[i].lastcw[n],er->cw+(n*8),8); 1771 memcpy(ca_descr.cw,er->cw+(n*8),8); 1772 cs_debug("write cw%d index: %d", n, i); 1773 if (ioctl(demux[i].ca_fd, CA_SET_DESCR, &ca_descr) < 0) 1774 cs_debug("Error CA_SET_DESCR"); 1775 } 1776 } 1777 #endif 1778 // reset idle-Time 1779 client[cs_idx].last=time((time_t)0); 1780 1781 FILE *ecmtxt; 1782 ecmtxt = fopen(ECMINFO_FILE, "w"); 1783 if(ecmtxt != NULL) { 1784 fprintf(ecmtxt, "caid: 0x%04X\npid: 0x%04X\nprov: 0x%06X\n", er->caid, er->pid, (uint) er->prid); 1785 fprintf(ecmtxt, "reader: %s\n", reader[er->reader[0]].label); 1786 if (reader[er->reader[0]].typ & R_IS_CASCADING) 1787 fprintf(ecmtxt, "from: %s\n", reader[er->reader[0]].device); 1788 else 1789 fprintf(ecmtxt, "from: local\n"); 1790 fprintf(ecmtxt, "protocol: %s\n", reader[er->reader[0]].ph.desc); 1791 fprintf(ecmtxt, "hops: %d\n", reader[er->reader[0]].cc_currenthops); 1792 fprintf(ecmtxt, "ecm time: %.3f\n", (float) client[cs_idx].cwlastresptime/1000); 1793 fprintf(ecmtxt, "cw0: %s\n", cs_hexdump(1,demux[i].lastcw[0],8)); 1794 fprintf(ecmtxt, "cw1: %s\n", cs_hexdump(1,demux[i].lastcw[1],8)); 1795 fclose(ecmtxt); 1796 ecmtxt = NULL; 1797 } 1798 } 1799 } 1800 } 1341 int i; 1342 1343 for (i=0;i<MAX_DEMUX;i++) { 1344 if (demux[i].program_number==er->srvid) { 1345 demux[i].rdr=&reader[er->reader[0]]; 1346 1347 if (er->rc<=3 && demux[i].pidindex==-1 && er->caid!=0) { 1348 dvbapi_start_descrambling(i, er->caid, er->pid); 1349 } 1350 1351 if (er->rc==4 && cfg->dvbapi_au==1 && dvbapi_check_array(global_caid_list, MAX_CAID, er->caid)>=0 && er->caid!=0x0500 && er->caid!=0x0100) { 1352 //local card and not found -> maybe card need emm 1353 dvbapi_start_descrambling(i, er->caid, er->pid); 1354 } 1355 1356 if (er->rc>3 && demux[i].pidindex==-1) { 1357 dvbapi_try_next_caid(i); 1358 return; 1359 } 1360 1361 if (er->rc>3) { 1362 cs_debug("cw not found"); 1363 return; 1364 } 1365 1366 if (demux[i].ca_fd<=0) { 1367 cs_log("could not write cw."); 1368 demux[i].ca_fd = dvbapi_open_device(i,1); 1369 if (demux[i].ca_fd<=0) 1370 return; 1371 } 1372 1373 int dindex = dvbapi_check_array(cfg->dvbapi_delaytab.caid, CS_MAXCAIDTAB, er->caid); 1374 if (dindex>=0) { 1375 char tmp1[5]; 1376 sprintf(tmp1, "%04X", cfg->dvbapi_delaytab.mask[dindex]); 1377 int cw_delay = strtol(tmp1, '\0', 10); 1378 if (cw_delay<1000) { 1379 cs_debug("wait %d ms", cw_delay); 1380 cs_sleepms(cw_delay); 1381 } 1382 } 1383 1384 1385 #ifdef WITH_STAPI 1386 stapi_write_cw(i, er->cw); 1387 #else 1388 int n; 1389 unsigned char nullcw[8]; 1390 memset(nullcw, 0, 8); 1391 ca_descr_t ca_descr; 1392 memset(&ca_descr,0,sizeof(ca_descr)); 1393 1394 for (n=0;n<2;n++) { 1395 if (memcmp(er->cw+(n*8),demux[i].lastcw[n],8)!=0 && memcmp(er->cw+(n*8),nullcw,8)!=0) { 1396 ca_descr.index = i; 1397 ca_descr.parity = n; 1398 memcpy(demux[i].lastcw[n],er->cw+(n*8),8); 1399 memcpy(ca_descr.cw,er->cw+(n*8),8); 1400 cs_debug("write cw%d index: %d", n, i); 1401 if (ioctl(demux[i].ca_fd, CA_SET_DESCR, &ca_descr) < 0) 1402 cs_debug("Error CA_SET_DESCR"); 1403 } 1404 } 1405 #endif 1406 // reset idle-Time 1407 client[cs_idx].last=time((time_t)0); 1408 1409 FILE *ecmtxt; 1410 ecmtxt = fopen(ECMINFO_FILE, "w"); 1411 if(ecmtxt != NULL) { 1412 fprintf(ecmtxt, "caid: 0x%04X\npid: 0x%04X\nprov: 0x%06X\n", er->caid, er->pid, (uint) er->prid); 1413 fprintf(ecmtxt, "reader: %s\n", reader[er->reader[0]].label); 1414 if (reader[er->reader[0]].typ & R_IS_CASCADING) 1415 fprintf(ecmtxt, "from: %s\n", reader[er->reader[0]].device); 1416 else 1417 fprintf(ecmtxt, "from: local\n"); 1418 fprintf(ecmtxt, "protocol: %s\n", reader[er->reader[0]].ph.desc); 1419 fprintf(ecmtxt, "hops: %d\n", reader[er->reader[0]].cc_currenthops); 1420 fprintf(ecmtxt, "ecm time: %.3f\n", (float) client[cs_idx].cwlastresptime/1000); 1421 fprintf(ecmtxt, "cw0: %s\n", cs_hexdump(1,demux[i].lastcw[0],8)); 1422 fprintf(ecmtxt, "cw1: %s\n", cs_hexdump(1,demux[i].lastcw[1],8)); 1423 fclose(ecmtxt); 1424 ecmtxt = NULL; 1425 } 1426 } 1427 } 1801 1428 } 1802 1429 -
trunk/oscam-config.c
r2812 r2813 1180 1180 1181 1181 cfg->dvbapi_boxtype=0; 1182 1183 #ifdef AZBOX1184 cfg->dvbapi_boxtype = BOXTYPE_AZBOX;1185 #endif1186 1182 return; 1187 1183 } -
trunk/oscam-config.h
r2811 r2813 20 20 # define SCI_DEV 1 21 21 # endif 22 # define HAVE_DVBAPI23 #endif24 25 #ifdef AZBOX26 22 # define HAVE_DVBAPI 27 23 #endif
Note:
See TracChangeset
for help on using the changeset viewer.