- Timestamp:
- 03/06/10 00:34:56 (14 years ago)
- Location:
- branches/modular
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/modular/Distribution/doc/example/oscam.srvid
r1241 r1795 357 357 1830:EF10|Astra HD+|RTL HD|TV| 358 358 1830:EF11|Astra HD+|VOX HD|TV| 359 1830:277E|Astra HD+|. (SD)|TV| 359 1830:EF74|Astra HD+|SAT.1 HD|TV| 360 1830:EF75|Astra HD+|ProSieben HD|TV| 361 1830:EF76|Astra HD+|kabel eins HD|TV| 360 362 361 363 # -
branches/modular/globals.h
r1776 r1795 548 548 DWORD dwActiveProtocol; 549 549 #endif 550 #ifdef LIBUSB 551 SR_CONFIG *sr_config; 552 #endif 550 #ifdef LIBUSB 551 SR_CONFIG *sr_config; 552 #endif 553 553 }; 554 554 -
branches/modular/module-dvbapi.c
r1776 r1795 32 32 33 33 static int listenfd = -1; 34 int global_support_pip = 0; 35 int global_merged_capmt = 0; 34 36 35 37 typedef struct ECMPIDS … … 245 247 close(dmx_fd); 246 248 249 if (ret < 0) return 0; 250 247 251 selected_box=devnum; 248 252 selected_api=apinum; … … 423 427 demux[demux_index].provider_id=provider_id; 424 428 425 int camfd=dvbapi_open_device(demux_index,1);426 if ( camfd<=0) {429 demux[demux_index].ca_fd = dvbapi_open_device(demux_index,1); 430 if (demux[demux_index].ca_fd<=0) 427 431 return; 428 }429 430 demux[demux_index].ca_fd=camfd;431 432 432 433 for (i=0;i<demux[demux_index].STREAMpidcount;i++) { … … 435 436 ca_pid2.pid = demux[demux_index].STREAMpids[i]; 436 437 ca_pid2.index = demux_index; 437 if (ioctl( camfd, CA_SET_PID, &ca_pid2)==-1)438 if (ioctl(demux[demux_index].ca_fd, CA_SET_PID, &ca_pid2)==-1) 438 439 cs_debug("dvbapi: Error Stream SET_PID"); 439 440 } … … 567 568 unsigned int program_number = (buffer[1] << 8) | buffer[2]; 568 569 int program_info_length = ((buffer[4] & 0x0F) << 8) | buffer[5]; 569 570 /* 570 571 switch (ca_pmt_list_management) 571 572 { … … 583 584 break; 584 585 } 585 586 */ 586 587 if (buffer[17]==0x82 && buffer[18]==0x02) { 587 588 //enigma2 … … 595 596 for (i=0;i<MAX_DEMUX;i++) { 596 597 if (demux[i].demux_index==demux_index2 && demux[i].program_number==((buffer[1] << 8) | buffer[2])) { // already descrambling prog on this device 598 global_support_pip=1; 597 599 if (demux[i].active==1) { 598 600 //remove any inactive program … … 693 695 return; 694 696 } 697 698 global_merged_capmt=0; 699 if (k>0) global_merged_capmt=1; 695 700 696 701 if (buffer[3+k] & 0x80) { … … 937 942 dvbapi_stop_filter(demux_index, TYPE_EMM); 938 943 if (cfg->dvbapi_au==1) { 939 if (demux[demux_index].ECMpids[n].EMM_PID>0) 940 dvbapi_start_filter(demux_index, demux[demux_index].ECMpids[n].CA_System_ID, demux[demux_index].ECMpids[n].EMM_PID, 0x80, 0xf0, TYPE_EMM); 944 for (g=0;g<demux[demux_index].ECMpidcount;g++) { 945 if (demux[demux_index].demux_fd[n].caid == demux[demux_index].ECMpids[g].CA_System_ID && demux[demux_index].ECMpids[g].EMM_PID>0) 946 dvbapi_start_filter(demux_index, demux[demux_index].ECMpids[g].CA_System_ID, demux[demux_index].ECMpids[g].EMM_PID, 0x80, 0xF0, TYPE_EMM); 947 } 941 948 } 942 949 continue; … … 956 963 int i; 957 964 unsigned char nullcw[8] = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}; 965 ca_descr_t ca_descr; 958 966 959 967 cs_debug("dvbapi: ECM rc: %d", er->rc); … … 995 1003 } 996 1004 997 ca_descr_t ca_descr;998 1005 memset(&ca_descr,0,sizeof(ca_descr)); 999 1006 1000 1007 if (demux[i].ca_fd<=0) { 1001 1008 cs_log("dvbapi: could not write cw."); 1002 return; 1009 demux[i].ca_fd = dvbapi_open_device(i,1); 1010 if (demux[i].ca_fd<=0) 1011 return; 1003 1012 } 1004 1013 -
branches/modular/oscam-log.c
r1776 r1795 144 144 // memcpy(txt, sbuf, 11); 145 145 146 //Fixme: remove below if all works ok147 /*148 time(&t);149 lt=localtime(&t);150 sprintf(buf, "[LOG000]%4d/%02d/%02d %2d:%02d:%02d %s\n",151 lt->tm_year+1900, lt->tm_mon+1, lt->tm_mday,152 lt->tm_hour, lt->tm_min, lt->tm_sec, txt);153 */154 146 if (use_syslog && !use_ac_log) // system-logfile 155 147 syslog(LOG_INFO, "%s", txt); … … 277 269 278 270 if( fmt ) 279 cs_log(fmt); 271 { 272 get_log_header(1, txt); 273 va_list params; 274 va_start(params, fmt); 275 vsprintf(txt+11, fmt, params); 276 va_end(params); 277 write_to_log(-1, txt); 278 //printf("LOG: %s\n", txt); fflush(stdout); 279 } 280 280 281 281 for( i=0; i<n; i+=16 ) -
branches/modular/oscam-reader.c
r1769 r1795 421 421 int i, no, rc, ecs; 422 422 char *rtxt[] = { "error", "written", "skipped", "blocked" }; 423 //char *typedesc[]= { "unknown", "unique", "shared", "global" }; 423 424 struct timeb tps, tpe; 424 425 … … 455 456 { 456 457 cs_ftime(&tpe); 457 // cs_log("%s type=%02x, len=%d, idx=%d, cnt=%d: %s (%d ms)", 458 // cs_inet_ntoa(client[ep->cidx].ip), emmcache[i].type, ep->emm[2], 459 // i, no, rtxt[rc], 1000*(tpe.time-tps.time)+tpe.millitm-tps.millitm); 458 459 /* 460 cs_log("%s emm: type=%s, len=%d, idx=%d, cnt=%d: %s (%d ms)", 461 username(ep->cidx), typedesc[emmcache[i].type], ep->emm[2], 462 i, no, rtxt[rc], 1000*(tpe.time-tps.time)+tpe.millitm-tps.millitm); 463 */ 460 464 cs_log("%s type=%02x, len=%d, idx=%d, cnt=%d: %s (%d ms)", 461 465 username(ep->cidx), emmcache[i].type, ep->emm[2], -
branches/modular/oscam.c
r1776 r1795 2108 2108 void do_emm(EMM_PACKET *ep) 2109 2109 { 2110 int au;//, ephs; 2111 au=client[cs_idx].au; 2110 int au; 2111 au = client[cs_idx].au; 2112 2112 2113 cs_ddump_mask(D_ATR, ep->emm, ep->l, "emm:"); 2113 2114 2114 if ((au<0) || (au>=CS_MAXREADER)) 2115 return; 2115 if ((au < 0) || (au >= CS_MAXREADER)) 2116 return; 2117 2116 2118 if (!reader_get_emm_type(ep, &reader[au])) //decodes ep->type and ep->hexserial from the EMM 2117 2119 return; 2118 cs_debug_mask(D_EMM, "Emmtype = %i. reader %s has serial %s.", ep->type, reader[au].label, cs_hexdump(0, reader[au].hexserial, 8)); 2119 cs_ddump_mask(D_EMM, ep->hexserial, 8, "emm UA/SA:"); 2120 2121 cs_ddump_mask(D_EMM, ep->hexserial, 8, "emm UA/SA:"); 2122 2120 2123 switch (ep->type) { 2121 2124 case UNKNOWN: 2125 cs_debug_mask(D_EMM, "emmtype UNKNOWN. Reader %s has serial %s.", reader[au].label, cs_hexdump(0, reader[au].hexserial, 8)); 2122 2126 if (reader[au].blockemm_unknown) return; 2127 break; 2128 2123 2129 case UNIQUE: 2130 cs_debug_mask(D_EMM, "emmtype UNIQUE. Reader %s has serial %s.", reader[au].label, cs_hexdump(0, reader[au].hexserial, 8)); 2124 2131 if (reader[au].blockemm_u) return; 2132 break; 2133 2125 2134 case SHARED: 2135 cs_debug_mask(D_EMM, "emmtype SHARED. Reader %s has serial %s.", reader[au].label, cs_hexdump(0, reader[au].hexserial, 8)); 2126 2136 if (reader[au].blockemm_s) return; 2127 //FIXME only camd33 delivers hexserial from the net, newcamd, camd35 copy cardreader hexserial in; reader_get_emm_type overwrites this with real SA value if known! 2137 break; 2138 2139 // FIXME only camd33 delivers hexserial from the net, newcamd, camd35 copy 2140 // cardreader hexserial in; reader_get_emm_type overwrites this with real SA value if known! 2128 2141 case GLOBAL: 2142 cs_debug_mask(D_EMM, "emmtype GLOBAL. Reader %s has serial %s.", reader[au].label, cs_hexdump(0, reader[au].hexserial, 8)); 2129 2143 if (reader[au].blockemm_g) return; 2144 break; 2130 2145 } 2131 client[cs_idx].lastemm=time((time_t)0); 2132 cs_ddump_mask(D_EMM, ep->emm, ep->l, "emm:"); 2133 // if ((!reader[au].fd) || (reader[au].b_nano[ep->emm[3]])) // blocknano is obsolete 2134 if ((!reader[au].fd) || // reader has no fd 2135 (reader[au].caid[0]!=b2i(2,ep->caid))) { // wrong caid 2146 2147 client[cs_idx].lastemm = time((time_t)0); 2148 cs_ddump_mask(D_EMM, ep->emm, ep->l, "emm:"); 2149 2150 if ((!reader[au].fd) || // reader has no fd 2151 (reader[au].caid[0] != b2i(2,ep->caid))) { // wrong caid 2136 2152 #ifdef WEBIF 2137 2153 client[cs_idx].emmnok++; 2138 2154 #endif 2139 2155 return; 2140 2156 } 2141 2157 #ifdef WEBIF 2142 2143 #endif 2144 ep->cidx=cs_idx;2145 cs_debug_mask(D_EMM, "EMMis being sent to reader %s.", reader[au].label);2146 2158 client[cs_idx].emmok++; 2159 #endif 2160 ep->cidx = cs_idx; 2161 cs_debug_mask(D_EMM, "emm is being sent to reader %s.", reader[au].label); 2162 write_to_pipe(reader[au].fd, PIP_ID_EMM, (uchar *) ep, sizeof(EMM_PACKET)); 2147 2163 } 2148 2164 -
branches/modular/reader-conax.c
r1776 r1795 206 206 int conax_get_emm_type(EMM_PACKET *ep, struct s_reader * rdr) //returns TRUE if shared emm matches SA, unique emm matches serial, or global or unknown 207 207 { 208 ep->type=ep->emm[2]+3; //FIXME not sure how this maps onto global, unique and shared! 209 return TRUE; //FIXME let it all pass without checking serial or SA, without filling ep->hexserial 208 int i, ok = 0; 209 210 cs_debug_mask(D_EMM, "Entered conax_get_emm_type ep->emm[2]=%02x",ep->emm[2]); 211 212 for (i = 0; i < rdr->nprov; i++) { 213 ok = (!memcmp(&ep->emm[6], rdr->sa[i], 4)); 214 if (ok) break; 215 } 216 217 if (ok) { 218 ep->type = SHARED; 219 memset(ep->hexserial, 0, 8); 220 memcpy(ep->hexserial, &ep->emm[6], 4); 221 cs_debug_mask(D_EMM, "CONAX EMM: SHARED, ep->hexserial = %s", cs_hexdump(1, ep->hexserial, 8)); 222 return TRUE; 223 } 224 else { 225 if (!memcmp(&ep->emm[4], rdr->hexserial, 6)) { 226 ep->type = UNIQUE; 227 memset(ep->hexserial, 0, 8); 228 memcpy(ep->hexserial, &ep->emm[4], 6); 229 cs_debug_mask(D_EMM, "CONAX EMM: UNIQUE, ep->hexserial = %s", cs_hexdump(1, ep->hexserial, 8)); 230 return TRUE; 231 } 232 else { 233 ep->type = GLOBAL; 234 cs_debug_mask(D_EMM, "CONAX EMM: GLOBAL"); 235 memset(ep->hexserial, 0, 8); 236 return TRUE; 237 } 238 } 239 210 240 } 211 241 -
branches/modular/reader-irdeto.c
r1776 r1795 366 366 } 367 367 368 int irdeto_get_emm_type(EMM_PACKET *ep, struct s_reader * rdr) //returns TRUE if shared emm matches SA, unique emm matches serial, or global or unknown369 { 370 int i, l = (ep->emm[3]&0x07), ok=0;368 int irdeto_get_emm_type(EMM_PACKET *ep, struct s_reader * rdr) { 369 370 int l = (ep->emm[3]&0x07); 371 371 int mode = (ep->emm[3]>>3); 372 if (mode&0x10) { 373 // Hex addressed 374 ep->type = UNIQUE; 375 memset(ep->hexserial,0,8); 376 memcpy(ep->hexserial, ep->emm + 4, l); 377 return (mode == rdr->hexserial[3] && (!l || !memcmp(ep->emm+4, rdr->hexserial, l))); 372 373 cs_debug_mask(D_EMM, "Entered irdeto_get_emm_type ep->emm[3]=%02x",ep->emm[3]); 374 375 switch (ep->emm[3]) { 376 377 case 0xd0: 378 // 0xd0 means global emm 379 ep->type = GLOBAL; 380 cs_debug_mask(D_EMM, "IRDETO EMM: GLOBAL"); 381 return TRUE; 382 case 0xd2: 383 // 0xd2 means shared emm, first 2 bytes of hexserial are transmitted in emm, seems to be the shared adr 384 ep->type = SHARED; 385 memset(ep->hexserial, 0, 8); 386 memcpy(ep->hexserial, ep->emm + 4, l); 387 cs_debug_mask(D_EMM, "IRDETO EMM: SHARED, ep = %s, rdr = %s", cs_hexdump(1, ep->hexserial, l), 388 cs_hexdump(1, rdr->hexserial, l)); 389 return (!l || !memcmp(ep->emm + 4, rdr->hexserial, l)); 390 391 case 0xd3: 392 // 0xd3 means uniqe emm 393 ep->type = UNIQUE; 394 memset(ep->hexserial, 0, 8); 395 memcpy(ep->hexserial, ep->emm + 4, l); 396 cs_debug_mask(D_EMM, "IRDETO EMM: UNIQUE, ep = %s, rdr = %s", cs_hexdump(1, ep->hexserial, l), 397 cs_hexdump(1, rdr->hexserial, l)); 398 return (mode == rdr->hexserial[3] && (!l || !memcmp(ep->emm + 4, rdr->hexserial, l))); 399 default: 400 ep->type = UNKNOWN; 401 cs_debug_mask(D_EMM, "IRDETO EMM: UNKNOWN"); 402 return TRUE; 378 403 } 379 else { 380 // Provider addressed 381 for(i = 0; i < rdr->nprov; i++) { 382 ok = (mode == rdr->prid[i][0] && (!l || !memcmp(ep->emm+4, &rdr->prid[i][1], l))); 383 if (ok) break; 384 } 385 386 ep->type = SHARED; 387 memset(ep->hexserial,0,8); 388 //prid in hexserial instead of SA 389 memcpy(ep->hexserial, ep->emm+4, l); 390 return ok; 391 } 404 392 405 } 393 406 -
branches/modular/reader-nagra.c
r1776 r1795 727 727 ep->hexserial[1] = ep->emm[4]; 728 728 ep->hexserial[2] = ep->emm[3]; 729 ep->hexserial[3] = ep->emm[6]; 730 if (ep->emm[7] == 0x10) 729 if (ep->emm[7] == 0x10) { 731 730 ep->type = SHARED; 732 else 731 return (!memcmp (rdr->hexserial+2, ep->hexserial, 3)); 732 } 733 else { 734 ep->hexserial[3] = ep->emm[6]; 733 735 ep->type = UNIQUE; 734 return (!memcmp (rdr->hexserial, ep->hexserial, 4)); 736 return (!memcmp (rdr->hexserial+2, ep->hexserial, 4)); 737 } 735 738 case 0x82: 736 739 ep->type = GLOBAL;
Note:
See TracChangeset
for help on using the changeset viewer.