Changeset 2334
- Timestamp:
- 05/24/10 17:59:57 (14 years ago)
- Location:
- branches/oscam++
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/oscam++/Makefile
r2271 r2334 72 72 DS_LDFLAGS="" \ 73 73 DS_ARFLAGS="-rvsl" \ 74 DS_CC=g cc\74 DS_CC=g++ \ 75 75 DS_AR=ar \ 76 76 DS_LD=ld \ … … 93 93 DS_LDFLAGS="" \ 94 94 DS_ARFLAGS="-rvsl" \ 95 DS_CC=g cc\95 DS_CC=g++ \ 96 96 DS_AR=ar \ 97 97 DS_LD=ld \ … … 114 114 DS_LDFLAGS="" \ 115 115 DS_ARFLAGS="-rvsl" \ 116 DS_CC=g cc\116 DS_CC=g++ \ 117 117 DS_AR=ar \ 118 118 DS_LD=ld \ … … 136 136 DS_LDFLAGS="" \ 137 137 DS_ARFLAGS="-rvsl" \ 138 DS_CC=g cc\138 DS_CC=g++ \ 139 139 DS_AR=ar \ 140 140 DS_LD=ld \ … … 157 157 DS_LDFLAGS="-framework PCSC" \ 158 158 DS_ARFLAGS="-rvsl" \ 159 DS_CC=g cc\159 DS_CC=g++ \ 160 160 DS_AR=ar \ 161 161 DS_LD=ld \ … … 179 179 DS_LDFLAGS="-framework PCSC -Wl,-framework -Wl,IOKit -Wl,-framework -Wl,CoreFoundation -Wl,-prebind -no-undefined" \ 180 180 DS_ARFLAGS="-rvsl" \ 181 DS_CC=g cc\181 DS_CC=g++ \ 182 182 DS_AR=ar \ 183 183 DS_LD=ld \ … … 201 201 DS_LDFLAGS="" \ 202 202 DS_ARFLAGS="-rvsl" \ 203 DS_CC=g cc\203 DS_CC=g++ \ 204 204 DS_AR=ar \ 205 205 DS_LD=ld \ … … 222 222 DS_LDFLAGS="" \ 223 223 DS_ARFLAGS="-rvsl" \ 224 DS_CC=i386-pc-freebsd5.4-g cc\224 DS_CC=i386-pc-freebsd5.4-g++ \ 225 225 DS_AR=i386-pc-freebsd5.4-ar \ 226 226 DS_LD=i386-pc-freebsd5.4-ld \ … … 243 243 DS_LDFLAGS="" \ 244 244 DS_ARFLAGS="-rvsl" \ 245 DS_CC=powerpc-tuxbox-linux-gnu-g cc\245 DS_CC=powerpc-tuxbox-linux-gnu-g++ \ 246 246 DS_AR=powerpc-tuxbox-linux-gnu-ar \ 247 247 DS_LD=powerpc-tuxbox-linux-gnu-ld \ … … 259 259 DS_LDFLAGS="" \ 260 260 DS_ARFLAGS="-rvsl" \ 261 DS_CC=powerpc-tuxbox-linux-uclibc-g cc\261 DS_CC=powerpc-tuxbox-linux-uclibc-g++ \ 262 262 DS_AR=powerpc-tuxbox-linux-uclibc-ar \ 263 263 DS_LD=powerpc-tuxbox-linux-uclibc-ld \ … … 280 280 DS_LDFLAGS="" \ 281 281 DS_ARFLAGS="-rvsl" \ 282 DS_CC=powerpc-405-linux-gnu-g cc\282 DS_CC=powerpc-405-linux-gnu-g++ \ 283 283 DS_AR=powerpc-405-linux-gnu-ar \ 284 284 DS_LD=powerpc-405-linux-gnu-ld \ … … 301 301 DS_LDFLAGS="" \ 302 302 DS_ARFLAGS="-rvsl" \ 303 DS_CC=/opt/STM/STLinux-2. 0/devkit/sh4/bin/sh4-linux-gcc\304 DS_AR=/opt/STM/STLinux-2. 0/devkit/sh4/bin/sh4-linux-ar \305 DS_LD=/opt/STM/STLinux-2. 0/devkit/sh4/bin/sh4-linux-ld \306 DS_RL=/opt/STM/STLinux-2. 0/devkit/sh4/bin/sh4-linux-ranlib \307 DS_ST=/opt/STM/STLinux-2. 0/devkit/sh4/bin/sh4-linux-strip303 DS_CC=/opt/STM/STLinux-2.2/devkit/sh4/bin/sh4-linux-g++ \ 304 DS_AR=/opt/STM/STLinux-2.2/devkit/sh4/bin/sh4-linux-ar \ 305 DS_LD=/opt/STM/STLinux-2.2/devkit/sh4/bin/sh4-linux-ld \ 306 DS_RL=/opt/STM/STLinux-2.2/devkit/sh4/bin/sh4-linux-ranlib \ 307 DS_ST=/opt/STM/STLinux-2.2/devkit/sh4/bin/sh4-linux-strip 308 308 309 309 ###################################################################### … … 322 322 DS_LDFLAGS="" \ 323 323 DS_ARFLAGS="-rvsl" \ 324 DS_CC=i686-pc-cygwin-g cc\324 DS_CC=i686-pc-cygwin-g++ \ 325 325 DS_AR=i686-pc-cygwin-ar \ 326 326 DS_LD=i686-pc-cygwin-ld \ … … 343 343 DS_LDFLAGS="" \ 344 344 DS_ARFLAGS="-rvsl" \ 345 DS_CC=g cc\345 DS_CC=g++ \ 346 346 DS_AR=ar \ 347 347 DS_LD=ld \ … … 364 364 DS_LDFLAGS="-lsocket" \ 365 365 DS_ARFLAGS="-rvsl" \ 366 DS_CC=sparc-sun-solaris2.7-g cc\366 DS_CC=sparc-sun-solaris2.7-g++ \ 367 367 DS_AR=sparc-sun-solaris2.7-ar \ 368 368 DS_LD=sparc-sun-solaris2.7-ld \ … … 385 385 DS_LDFLAGS="-lsocket" \ 386 386 DS_ARFLAGS="-rvsl" \ 387 DS_CC=g cc\387 DS_CC=g++ \ 388 388 DS_AR=ar \ 389 389 DS_LD=ld \ … … 406 406 DS_LDFLAGS="" \ 407 407 DS_ARFLAGS="-rvsl" \ 408 DS_CC=rs6000-ibm-aix4.2-g cc\408 DS_CC=rs6000-ibm-aix4.2-g++ \ 409 409 DS_AR=rs6000-ibm-aix4.2-ar \ 410 410 DS_LD=rs6000-ibm-aix4.2-ld \ … … 427 427 DS_LDFLAGS="" \ 428 428 DS_ARFLAGS="-rvsl" \ 429 DS_CC=mips-sgi-irix6.5-g cc\429 DS_CC=mips-sgi-irix6.5-g++ \ 430 430 DS_AR=mips-sgi-irix6.5-ar \ 431 431 DS_LD=mips-sgi-irix6.5-ld \ … … 449 449 DS_LDFLAGS="" \ 450 450 DS_ARFLAGS="-rvsl" \ 451 DS_CC=mipsel-linux-uclibc-g cc\451 DS_CC=mipsel-linux-uclibc-g++ \ 452 452 DS_AR=mipsel-linux-uclibc-ar \ 453 453 DS_LD=mipsel-linux-uclibc-ld \ … … 471 471 DS_LDFLAGS="" \ 472 472 DS_ARFLAGS="-rvsl" \ 473 DS_CC=mipsel-linux-uclibc-g cc\473 DS_CC=mipsel-linux-uclibc-g++ \ 474 474 DS_AR=mipsel-linux-uclibc-ar \ 475 475 DS_LD=mipsel-linux-uclibc-ld \ … … 493 493 DS_LDFLAGS="" \ 494 494 DS_ARFLAGS="-rvsl" \ 495 DS_CC=mipsel-linux-uclibc-g cc\495 DS_CC=mipsel-linux-uclibc-g++ \ 496 496 DS_AR=mipsel-linux-uclibc-ar \ 497 497 DS_LD=mipsel-linux-uclibc-ld \ … … 515 515 DS_LDFLAGS="-static" \ 516 516 DS_ARFLAGS="-rvsl" \ 517 DS_CC=mipsel-linux-uclibc-g cc\517 DS_CC=mipsel-linux-uclibc-g++ \ 518 518 DS_AR=mipsel-linux-uclibc-ar \ 519 519 DS_LD=mipsel-linux-uclibc-ld \ … … 536 536 DS_LDFLAGS="" \ 537 537 DS_ARFLAGS="-rvsl" \ 538 DS_CC=mips-linux-g cc\538 DS_CC=mips-linux-g++ \ 539 539 DS_AR=mips-linux-ar \ 540 540 DS_LD=mips-linux-ld \ … … 557 557 DS_LDFLAGS="" \ 558 558 DS_ARFLAGS="-rvsl" \ 559 DS_CC=mipsel-linux-glibc-g cc\559 DS_CC=mipsel-linux-glibc-g++ \ 560 560 DS_AR=mipsel-linux-glibc-ar \ 561 561 DS_LD=mipsel-linux-glibc-ld \ … … 573 573 DS_LDFLAGS="" \ 574 574 DS_ARFLAGS="-rvsl" \ 575 DS_CC=mipsel-linux-g cc\575 DS_CC=mipsel-linux-g++ \ 576 576 DS_AR=mipsel-linux-ar \ 577 577 DS_LD=mipsel-linux-ld \ … … 594 594 DS_LDFLAGS="" \ 595 595 DS_ARFLAGS="-rvsl" \ 596 DS_CC=g cc\596 DS_CC=g++ \ 597 597 DS_AR=ar \ 598 598 DS_LD=ld \ … … 638 638 DS_ARFLAGS="-rvsl" \ 639 639 DS_AWK="awk" \ 640 DS_CC="armv5b-softfloat-linux-g cc" \640 DS_CC="armv5b-softfloat-linux-g++" \ 641 641 DS_AR="armv5b-softfloat-linux-ar" \ 642 642 DS_LD="armv5b-softfloat-linux-ld" \ … … 660 660 DS_ARFLAGS="-rvsl" \ 661 661 DS_AWK="awk" \ 662 DS_CC="arm-linux-g cc-mbig-endian" \662 DS_CC="arm-linux-g++ -mbig-endian" \ 663 663 DS_AR="arm-linux-ar" \ 664 664 DS_LD="arm-linux-ld -EB" \ … … 682 682 DS_ARFLAGS="-rvsl" \ 683 683 DS_AWK="awk" \ 684 DS_CC="arm-linux-g cc-mlittle-endian" \684 DS_CC="arm-linux-g++ -mlittle-endian" \ 685 685 DS_AR="arm-linux-ar" \ 686 686 DS_LD="arm-linux-ld -EL" \ -
branches/oscam++/cscrypt/crc32.c
r8 r2334 1 2 #include "cscrypt.h" 3 1 4 /* crc32.c -- compute the CRC-32 of a data stream 2 5 * Copyright (C) 1995-1996 Mark Adler … … 69 72 #define DO8(buf) DO4(buf); DO4(buf); 70 73 71 unsigned long crc32(crc, buf, len) 72 unsigned long crc; 73 const unsigned char *buf; 74 unsigned int len; 74 unsigned long crc32(unsigned long crc, const unsigned char *buf, unsigned int len) 75 75 { 76 76 if (!buf) return(0L); -
branches/oscam++/cscrypt/md5.c
r70 r2334 112 112 */ 113 113 114 static void 115 __md5_Encode (output, input, len) 116 unsigned char *output; 117 u_int32_t *input; 118 unsigned int len; 114 static void __md5_Encode (unsigned char *output, u_int32_t *input, unsigned int len) 119 115 { 120 116 unsigned int i, j; … … 133 129 */ 134 130 135 static void 136 __md5_Decode (output, input, len) 137 u_int32_t *output; 138 const unsigned char *input; 139 unsigned int len; 131 static void __md5_Decode (u_int32_t *output, const unsigned char *input, unsigned int len) 140 132 { 141 133 unsigned int i, j; … … 278 270 /* MD5 basic transformation. Transforms state based on block. */ 279 271 280 static void 281 __md5_Transform (state, block) 282 u_int32_t state[4]; 283 const unsigned char block[64]; 272 static void __md5_Transform (u_int32_t state[4], const unsigned char block[64]) 284 273 { 285 274 u_int32_t a, b, c, d, x[16]; -
branches/oscam++/csctapi/icc_async.c
r2330 r2334 78 78 79 79 reader->written = 0; 80 80 81 int pos = 0; 81 82 switch(reader->typ) { 82 83 case R_SC8in1: 83 84 pthread_mutex_init(&sc8in1, NULL); 84 intpos = strlen(reader->device)-2; //this is where : should be located; is also valid length of physical device name85 pos = strlen(reader->device)-2; //this is where : should be located; is also valid length of physical device name 85 86 if (reader->device[pos] != 0x3a) //0x3a = ":" 86 87 cs_log("ERROR: '%c' detected instead of slot separator `:` at second to last position of device %s", reader->device[pos], reader->device); … … 286 287 case ATR_PROTOCOL_TYPE_T1: 287 288 { 288 int try = 1;289 int rtry = 1; 289 290 do { 290 291 if (Protocol_T1_Command (reader, command, command_len, rsp, lr) == OK) 291 292 break; 292 try++;293 rtry++; 293 294 //try to resync 294 295 unsigned char resync[] = { 0x21, 0xC0, 0x00, 0xE1 }; 295 296 Protocol_T1_Command (reader, resync, sizeof(resync), rsp, lr); 296 297 ifsc = DEFAULT_IFSC; 297 } while ( try <= 3);298 } while (rtry <= 3); 298 299 break; 299 300 } … … 639 640 WWT = 0; 640 641 double work_etu = 1000 / (double)reader->current_baudrate;//FIXME sometimes work_etu should be used, sometimes initial etu 641 return (unsigned int) WWT * work_etu * reader->cardmhz / reader->mhz;642 return (unsigned int) (WWT * work_etu * reader->cardmhz / reader->mhz); 642 643 } 643 644 … … 695 696 double P,I; 696 697 double F; 697 698 699 698 unsigned long BGT, edc, EGT, CGT, WWT = 0; 699 unsigned int GT; 700 unsigned long gt_ms; 700 701 701 702 //set the amps and the volts according to ATR … … 718 719 if (deprecated == 0) { 719 720 if (reader->protocol_type != ATR_PROTOCOL_TYPE_T14) { //dont switch for T14 720 unsigned long baud_temp = d * ICC_Async_GetClockRate (reader->cardmhz) / F;721 unsigned long baud_temp = (unsigned long)(d * ICC_Async_GetClockRate (reader->cardmhz) / F); 721 722 if (reader->typ <= R_MOUSE) 722 723 call (Phoenix_SetBaudrate (reader, baud_temp)); … … 734 735 EGT = 0; 735 736 else 736 EGT = n;737 EGT = (unsigned long) n; 737 738 GT = EGT + 12; //Guard Time in ETU 738 739 gt_ms = ETU_to_ms(reader, GT); … … 842 843 //for Irdeto T14 cards, do not set ETU 843 844 if (!(atr->hbn >= 6 && !memcmp(atr->hb, "IRDETO", 6) && reader->protocol_type == ATR_PROTOCOL_TYPE_T14)) 844 ETU = F / d;845 ETU = (unsigned long)(F / d); 845 846 call (Sci_WriteSettings (reader, reader->protocol_type, reader->mhz / 100, ETU, WWT, reader->BWT, reader->CWT, EGT, (unsigned char)P, (unsigned char)I)); 846 847 #elif COOL -
branches/oscam++/csctapi/ifd_sci.c
r1960 r2334 14 14 #include "sci_ioctl.h" 15 15 #include "string.h" 16 #include "io_serial.h" 16 17 #ifdef SH4 17 18 #include <fcntl.h> -
branches/oscam++/csctapi/ifd_sci.h
r1960 r2334 11 11 int Sci_Activate (struct s_reader *reader); 12 12 int Sci_Deactivate (struct s_reader *reader); 13 int Sci_WriteSettings (struct s_reader * reader, BYTE T, unsigned long fs, 14 unsigned long ETU, unsigned long WWT, unsigned long BWT, 15 unsigned long CWT, unsigned long EGT, unsigned char P, unsigned char I); 16 13 17 //#endif -
branches/oscam++/csctapi/protocol_t1.h
r1951 r2334 32 32 */ 33 33 34 unsigned short ifsc; /* Information field size for the ICC */35 BYTE ns; /* Send sequence number */34 extern unsigned short ifsc; /* Information field size for the ICC */ 35 extern BYTE ns; /* Send sequence number */ 36 36 /* 37 37 * Exported functions declaration -
branches/oscam++/oscam-config.c
r2311 r2334 80 80 for (cip=lip=*base; cip; cip=cip->next) 81 81 lip = cip; 82 if (!(cip =malloc(sizeof(struct s_ip)))) {82 if (!(cip = (s_ip*)malloc(sizeof(struct s_ip)))) { 83 83 fprintf(stderr, "Error allocating memory (errno=%d)\n", errno); 84 84 exit(1); … … 94 94 ++i; 95 95 else { 96 if (!(cip =malloc(sizeof(struct s_ip)))) {96 if (!(cip = (s_ip*)malloc(sizeof(struct s_ip)))) { 97 97 fprintf(stderr, "Error allocating memory (errno=%d)\n", errno); 98 98 exit(1); … … 2337 2337 while (fgets(token, sizeof(token), fp)) { 2338 2338 int i, l; 2339 void*ptr;2339 s_auth *ptr; 2340 2340 2341 2341 if ((l=strlen(trim(token))) < 3) … … 2346 2346 tag = (!strcmp("account", strtolower(token + 1))); 2347 2347 2348 if (!(ptr =malloc(sizeof(struct s_auth)))) {2348 if (!(ptr = (s_auth*)malloc(sizeof(struct s_auth)))) { 2349 2349 cs_log("Error allocating memory (errno=%d)", errno); 2350 2350 return(1); … … 2419 2419 //if (!i) return(0); 2420 2420 if (b==sizeof(ushort)) 2421 slist =malloc(i*sizeof(ushort));2421 slist = (ushort*)malloc(i*sizeof(ushort)); 2422 2422 else 2423 llist =malloc(i*sizeof(ulong));2423 llist = (ulong*)malloc(i*sizeof(ulong)); 2424 2424 strcpy(value, buf); 2425 2425 for (i=0, ptr=strtok(value, ","); ptr; ptr=strtok(NULL, ",")) … … 2484 2484 { 2485 2485 int l; 2486 void*ptr;2486 s_sidtab *ptr; 2487 2487 if ((l=strlen(trim(token)))<3) continue; 2488 2488 if ((token[0]=='[') && (token[l-1]==']')) 2489 2489 { 2490 2490 token[l-1]=0; 2491 if (!(ptr =malloc(sizeof(struct s_sidtab))))2491 if (!(ptr = (s_sidtab*)malloc(sizeof(struct s_sidtab)))) 2492 2492 { 2493 2493 cs_log("Error allocating memory (errno=%d)", errno); … … 2534 2534 2535 2535 int l; 2536 void *ptr;2536 s_provid *ptr; 2537 2537 char *tmp; 2538 2538 tmp = trim(token); … … 2543 2543 *payload++ = '\0'; 2544 2544 2545 if (!(ptr = malloc(sizeof(struct s_provid)))) {2545 if (!(ptr = (s_provid*)malloc(sizeof(struct s_provid)))) { 2546 2546 cs_log("Error allocating memory (errno=%d)", errno); 2547 2547 return(1); … … 2605 2605 2606 2606 int l; 2607 void *ptr;2607 s_srvid *ptr; 2608 2608 char *tmp; 2609 2609 tmp = trim(token); … … 2614 2614 *payload++ = '\0'; 2615 2615 2616 if (!(ptr = malloc(sizeof(struct s_srvid)))) {2616 if (!(ptr = (s_srvid*)malloc(sizeof(struct s_srvid)))) { 2617 2617 cs_log("Error allocating memory (errno=%d)", errno); 2618 2618 return(1); -
branches/oscam++/oscam-log.c
r2289 r2334 80 80 static char *head = ">> OSCam << cardserver started version " CS_VERSION ", build #" CS_SVN_VERSION " (" CS_OSTYPE ")"; 81 81 82 log_txt = malloc(512);83 log_buf = malloc(700);82 log_txt = (char*)malloc(512); 83 log_buf = (char*)malloc(700); 84 84 85 85 if (!strcmp(file, "stdout")) { -
branches/oscam++/oscam-simples.c
r2146 r2334 32 32 } 33 33 34 char *trim(txt) 35 char *txt; 34 char *trim(char *txt) 36 35 { 37 36 register int l; … … 456 455 /* Converts a long value to a char array in bitwise representation. 457 456 Note that the result array MUST be at least 33 bit large and that 458 thisfunction assumes long values to hold only values up to 32bits and to be positive!459 the result of e.g. long 7 is 11100000000000000000000000000000 thismeans the array457 current function assumes long values to hold only values up to 32bits and to be positive! 458 the result of e.g. long 7 is 11100000000000000000000000000000 current means the array 460 459 is reversed */ 461 460 void long2bitchar(long value, char *result){ … … 552 551 } 553 552 if(rename(tmpfile, destfile) < 0){ 554 cs_log("Error renaming new conf file %s to %s (errno=%d). The config will be missing upon next startup as thisis non-recoverable!", tmpfile, destfile, errno);553 cs_log("Error renaming new conf file %s to %s (errno=%d). The config will be missing upon next startup as current is non-recoverable!", tmpfile, destfile, errno); 555 554 return(1); 556 555 } … … 582 581 } 583 582 584 /* Ordinary strncpy does not terminate the string if the source is exactly as long or longer as the specified size. Thiscan raise security issues.585 Thisfunction is a replacement which makes sure that a \0 is always added. num should be the real size of char array (do not subtract -1). */583 /* Ordinary strncpy does not terminate the string if the source is exactly as long or longer as the specified size. current can raise security issues. 584 current function is a replacement which makes sure that a \0 is always added. num should be the real size of char array (do not subtract -1). */ 586 585 void cs_strncpy(char * destination, const char * source, size_t num){ 587 586 uint32 l, size = strlen(source); … … 594 593 char *get_servicename(int srvid, int caid){ 595 594 int i; 596 struct s_srvid * this= cfg->srvid;595 struct s_srvid *current = cfg->srvid; 597 596 static char name[83]; 598 597 599 for (name[0] = 0; this && (!name[0]); this = this->next)600 if ( this->srvid == srvid)601 for (i=0; i< this->ncaid; i++)602 if ( this->caid[i] == caid)603 cs_strncpy(name, this->name, 32);598 for (name[0] = 0; current && (!name[0]); current = current->next) 599 if (current->srvid == srvid) 600 for (i=0; i<current->ncaid; i++) 601 if (current->caid[i] == caid) 602 cs_strncpy(name, current->name, 32); 604 603 605 604 if (!name[0]) sprintf(name, "%04X:%04X unknown", caid, srvid); … … 609 608 610 609 char *get_provider(int caid, ulong provid){ 611 struct s_provid * this= cfg->provid;610 struct s_provid *current = cfg->provid; 612 611 static char name[83]; 613 612 614 for (name[0] = 0; this && (!name[0]); this = this->next)615 if ( this->caid == caid && this->provid == provid)616 snprintf(name, 83, "%s / %s / %s", this->prov, this->sat, this->lang);613 for (name[0] = 0; current && (!name[0]); current = current->next) 614 if (current->caid == caid && current->provid == provid) 615 snprintf(name, 83, "%s / %s / %s", current->prov, current->sat, current->lang); 617 616 618 617 if (!name[0]) snprintf(name, 83, "%04X:%06lX unknown", caid, provid); -
branches/oscam++/oscam.c
r2333 r2334 1564 1564 time_t t; 1565 1565 struct tm *timeinfo; 1566 struct s_srvid * this;1566 struct s_srvid *current; 1567 1567 1568 1568 /* … … 1571 1571 */ 1572 1572 srvname[0] = 0; 1573 for ( this=cfg->srvid; this; this = this->next) {1574 if ( this->srvid == er->srvid) {1573 for (current=cfg->srvid; current; current = current->next) { 1574 if (current->srvid == er->srvid) { 1575 1575 cs_strncpy(srvname, this->name, sizeof(srvname)); 1576 1576 srvname[sizeof(srvname)-1] = 0;
Note:
See TracChangeset
for help on using the changeset viewer.