Changeset 1743


Ignore:
Timestamp:
Feb 28, 2010, 11:00:57 AM (10 years ago)
Author:
merek
Message:

Merge from UMP r1808

Location:
trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/CMakeLists.txt

    r1710 r1743  
    101101    set (DEFAULT_CS_CONFDIR "/var/tuxbox/config")
    102102        if (${CMAKE_SYSTEM_PROCESSOR} MATCHES "mips")
    103             add_definitions ("-DOS_LINUX -DTUXBOX -DMIPSEL -DHAVE_DVBAPI")
     103            add_definitions ("-DOS_LINUX -DTUXBOX -DMIPSEL")
    104104        else (${CMAKE_SYSTEM_PROCESSOR} MATCHES "mips")
    105         add_definitions ("-DOS_LINUX -DTUXBOX -DPPC -DHAVE_DVBAPI")
     105        add_definitions ("-DOS_LINUX -DTUXBOX -DPPC")
    106106        endif (${CMAKE_SYSTEM_PROCESSOR} MATCHES "mips")
    107107elseif (OSCamOperatingSystem MATCHES "TripleDragon")
    108     add_definitions ("-DOS_LINUX -DTRIPLEDRAGON -DHAVE_DVBAPI -DSTB04SCI -DTUXBOX -DPPC")   
     108    add_definitions ("-DOS_LINUX -DTRIPLEDRAGON -DSTB04SCI -DTUXBOX -DPPC")   
    109109    set (DEFAULT_CS_CONFDIR "/var/tuxbox/config")
    110110elseif (OSCamOperatingSystem MATCHES "NeutrinoHD")
     
    124124    set (DEFAULT_CS_CONFDIR "/jffs/etc/config/oscam")
    125125elseif (OSCamOperatingSystem MATCHES "Amino")
    126     add_definitions ("-DOS_LINUX -DSH4 -DTUXBOX -DHAVE_DVBAPI")
     126    add_definitions ("-DOS_LINUX -DSH4 -DTUXBOX")
    127127    set (DEFAULT_CS_CONFDIR "/usr/local/etc")
    128128elseif (OSCamOperatingSystem MATCHES "Windows/Cygwin")
     
    157157    add_definitions ("-DCS_WITH_GBOX")
    158158endif(CS_WITH_GBOX)
    159 
    160 if(HAVE_DVBAPI)
    161     add_definitions ("-DHAVE_DVBAPI")
    162 endif(HAVE_DVBAPI)
    163159
    164160if (WEBIF)
  • trunk/Makefile

    r1723 r1743  
    276276        OS_CULI="-lncurses" \
    277277        OS_PTLI="-lpthread" \
    278         DS_OPTS="-O2 -DOS_LINUX -DTRIPLEDRAGON -DCS_LOGHISTORY -DCS_ANTICASC -DHAVE_DVBAPI_TD -DSTB04SCI -DCS_CONFDIR='\"/var/tuxbox/config\"' -D'CS_SVN_VERSION="\"$(SVN_REV)\""'" \
     278        DS_OPTS="-O2 -DOS_LINUX -DTRIPLEDRAGON -DCS_LOGHISTORY -DCS_ANTICASC -DSTB04SCI -DCS_CONFDIR='\"/var/tuxbox/config\"' -D'CS_SVN_VERSION="\"$(SVN_REV)\""'" \
    279279        DS_CFLAGS="-c" \
    280280        DS_LDFLAGS="" \
  • trunk/README

    r1710 r1743  
    2626---------------
    2727
     28DVBAPI support is automatically compiled in if the target platform supports it.
     29
    2830Enable features:
    2931
     
    3133CS_LOGHISTORY   - enable log history (default)
    3234CS_WITH_GBOX    - enable gbox support
    33 HAVE_DVBAPI     - enable DVB API support
    3435DWEBIF          - enable web interface
    3536IRDETO_GUESSING - enable irdeto guessing support
     
    4041-DCS_LOGHISTORY=1   - enable log history (default)
    4142-DCS_WITH_GBOX=1    - enable gbox support
    42 -DHAVE_DVBAPI=1     - enable DVB API support
    4343-DWEBIF=1           - enable web interface
    4444-DIRDETO_GUESSING=1 - enable irdeto guessing support
  • trunk/csctapi/protocol_t1.c

    r1588 r1743  
    260260{
    261261    int ret;
    262   ret = ICC_Async_Transmit (T1_Block_RawLen(block), T1_Block_Raw(block));
     262  ret = ICC_Async_Transmit (block->length, block->data);
    263263    T1_Block_Delete(block);
    264264  return ret;
  • trunk/csctapi/t1_block.c

    r8 r1743  
    3636 * Not exported functions declaration
    3737 */
    38 static BYTE
    39 T1_Block_LRC (BYTE * data, unsigned length);
     38static unsigned char T1_Block_LRC (unsigned char * data, unsigned length);
    4039 
    4140/*
     
    4342 */
    4443
    45 T1_Block *
    46 T1_Block_New (BYTE * buffer, unsigned length)
     44T1_Block * T1_Block_New (unsigned char * buffer, unsigned length)
    4745{
    4846  T1_Block * block;
     
    5351  block = (T1_Block *) malloc (sizeof (T1_Block));
    5452 
    55   if (block != NULL)
    56     {
    57       block->length = MIN(length, T1_BLOCK_MAX_SIZE);
    58       block->data = (BYTE *) calloc (block->length, sizeof (BYTE));
     53  if (block != NULL) {
     54      if (length > T1_BLOCK_MAX_SIZE)
     55        block->length = T1_BLOCK_MAX_SIZE;
     56      else
     57        block->length = length;
     58      block->data = (unsigned char *) calloc (block->length, sizeof (unsigned char));
    5959     
    6060      if (block->data != NULL)
    61         {
    6261          memcpy (block->data, buffer, block->length);
    63         }
    64       else
    65         {
     62      else {
    6663          free (block);
    6764          block = NULL;
    6865        }
    69     }
    70  
     66  }
    7167  return block;
    7268}
    7369
    74 T1_Block *
    75 T1_Block_NewIBlock (BYTE len, BYTE * inf, BYTE ns, bool more)
     70T1_Block * T1_Block_NewIBlock (unsigned char len, unsigned char * inf, unsigned char ns, int more)
    7671{
    7772  T1_Block * block;
    78  
    7973  block = (T1_Block *) malloc (sizeof (T1_Block));
    80  
    81   if (block != NULL)
    82     {
     74  if (block != NULL) {
    8375      block->length = len + 4;
    84       block->data = (BYTE *) calloc (block->length, sizeof (BYTE));
    85      
    86       if (block->data != NULL)
    87         {
     76      block->data = (unsigned char *) calloc (block->length, sizeof (unsigned char));
     77      if (block->data != NULL) {
    8878          block->data[0] = T1_BLOCK_NAD;
    8979          block->data[1] = T1_BLOCK_I | ((ns << 6) & 0x40);
    90          
    9180          if (more)
    9281            block->data[1] |= 0x20;
    93            
    9482          block->data[2] = len;
    95          
    9683          if (len != 0x00)
    9784            memcpy (block->data + 3, inf, len);
    98          
    9985          block->data[len+3] = T1_Block_LRC (block->data, len+3);
    10086        }
    101       else
    102         {
     87      else {
    10388          free (block);
    10489          block = NULL;
    10590        }
    106     }
    107  
     91  }
    10892  return block;
    10993}
    11094
    111 T1_Block *
    112 T1_Block_NewRBlock (BYTE type, BYTE nr)
     95T1_Block * T1_Block_NewRBlock (unsigned char type, unsigned char nr)
    11396{
    11497  T1_Block * block;
    115  
    11698  block = (T1_Block *) malloc (sizeof (T1_Block));
    117  
    118   if (block != NULL)
    119     {
     99  if (block != NULL) {
    120100      block->length = 4;
    121       block->data = (BYTE *) calloc (block->length, sizeof (BYTE));
    122      
    123       if (block->data != NULL)
    124         {
     101      block->data = (unsigned char *) calloc (block->length, sizeof (unsigned char));
     102      if (block->data != NULL) {
    125103          block->data[0] = T1_BLOCK_NAD;
    126104          block->data[1] = type | ((nr << 4) & 0x10);
    127105          block->data[2] = 0x00;
    128106          block->data[3] = T1_Block_LRC (block->data, 3);
    129         }
    130       else
    131         {
     107      }
     108      else {
    132109          free (block);
    133110          block = NULL;
    134         }
    135     }
    136  
     111      }
     112  }
    137113  return block;
    138114}
    139115
    140 T1_Block *
    141 T1_Block_NewSBlock (BYTE type, BYTE len, BYTE * inf)
     116T1_Block * T1_Block_NewSBlock (unsigned char type, unsigned char len, unsigned char * inf)
    142117{
    143118  T1_Block * block;
    144  
    145119  block = (T1_Block *) malloc (sizeof (T1_Block));
    146  
    147   if (block != NULL)
    148     {
     120  if (block != NULL) {
    149121      block->length = 4 + len;
    150       block->data = (BYTE *) calloc (block->length, sizeof (BYTE));
    151      
    152       if (block->data != NULL)
    153         {
     122      block->data = (unsigned char *) calloc (block->length, sizeof (unsigned char));
     123      if (block->data != NULL) {
    154124          block->data[0] = T1_BLOCK_NAD;
    155125          block->data[1] = type;
    156126          block->data[2] = len;
    157 
    158127          if (len != 0x00)
    159128            memcpy (block->data + 3, inf, len);
    160          
    161129          block->data[len+3] = T1_Block_LRC (block->data, len+3);
    162         }
    163       else
    164         {
     130      }
     131      else {
    165132          free (block);
    166133          block = NULL;
    167         }
    168     }
    169  
     134      }
     135  }
    170136  return block;
    171137}
    172138
    173 BYTE
    174 T1_Block_GetType (T1_Block * block)
     139unsigned char T1_Block_GetType (T1_Block * block)
    175140{
    176141  if ((block->data[1] & 0x80) == T1_BLOCK_I)
    177142    return T1_BLOCK_I;
    178    
    179143  return (block->data[1] & 0xEF);
    180144}
    181145
    182 BYTE
    183 T1_Block_GetNS (T1_Block * block)
     146unsigned char T1_Block_GetNS (T1_Block * block)
    184147{
    185148  return ((block->data[1] >> 6)& 0x01);
    186149}
    187150
    188 bool
    189 T1_Block_GetMore (T1_Block * block)
     151int T1_Block_GetMore (T1_Block * block)
    190152{
    191153  return ((block->data[1] >> 5) & 0x01);
    192154}
    193155
    194 BYTE
    195 T1_Block_GetNR (T1_Block * block)
     156unsigned char T1_Block_GetNR (T1_Block * block)
    196157{
    197158  return ((block->data[1] >> 4) & 0x01);
    198159}
    199160
    200 BYTE
    201 T1_Block_GetLen (T1_Block * block)
     161unsigned char T1_Block_GetLen (T1_Block * block)
    202162{
    203163  return block->data[2];
    204164}
    205165
    206 BYTE *
    207 T1_Block_GetInf (T1_Block * block)
     166unsigned char * T1_Block_GetInf (T1_Block * block)
    208167{
    209168  if (block->length < 5)
    210169    return NULL;
    211    
    212170  return block->data + 3;
    213171}
    214172
    215 BYTE *
    216 T1_Block_Raw (T1_Block * block)
    217 {
    218   return block->data;
    219 }
    220 
    221 unsigned
    222 T1_Block_RawLen (T1_Block * block)
    223 {
    224   return block->length;
    225 }
    226 
    227 void
    228 T1_Block_Delete (T1_Block * block)
     173void T1_Block_Delete (T1_Block * block)
    229174{
    230175  free (block->data);
     
    236181 */
    237182
    238 static BYTE
    239 T1_Block_LRC (BYTE * data, unsigned length)
     183static unsigned char T1_Block_LRC (unsigned char * data, unsigned length)
    240184{
    241   BYTE lrc;
     185  unsigned char lrc;
    242186  unsigned i;
    243 
    244187  lrc = 0x00;
    245188  for (i = 0; i < length; i++)
    246     {
    247189      lrc ^= data[i];
    248     }
    249    
    250190  return lrc;       
    251191}
  • trunk/csctapi/t1_block.h

    r1559 r1743  
    2525#ifndef _T1_BLOCK_
    2626#define _T1_BLOCK_
    27 
    28 #include "defines.h"
    2927
    3028/*
     
    5755typedef struct
    5856{
    59   BYTE * data;
     57  unsigned char * data;
    6058  unsigned length;
    6159}
     
    6664 */
    6765
    68 T1_Block * T1_Block_New (BYTE * buffer, unsigned length);
     66T1_Block * T1_Block_New (unsigned char * buffer, unsigned length);
    6967
    70 T1_Block * T1_Block_NewIBlock (BYTE len, BYTE * inf, BYTE ns, bool more);
     68T1_Block * T1_Block_NewIBlock (unsigned char len, unsigned char * inf, unsigned char ns, int more);
    7169
    72 T1_Block * T1_Block_NewRBlock (BYTE type, BYTE nr);
     70T1_Block * T1_Block_NewRBlock (unsigned char type, unsigned char nr);
    7371
    74 T1_Block * T1_Block_NewSBlock (BYTE type, BYTE len, BYTE * inf);
     72T1_Block * T1_Block_NewSBlock (unsigned char type, unsigned char len, unsigned char * inf);
    7573
    76 BYTE T1_Block_GetType (T1_Block * block);
     74unsigned char T1_Block_GetType (T1_Block * block);
    7775
    78 BYTE T1_Block_GetNS (T1_Block * block);
     76unsigned char T1_Block_GetNS (T1_Block * block);
    7977
    80 bool T1_Block_GetMore (T1_Block * block);
     78int T1_Block_GetMore (T1_Block * block);
    8179
    82 BYTE T1_Block_GetNR (T1_Block * block);
     80unsigned char T1_Block_GetNR (T1_Block * block);
    8381
    84 BYTE T1_Block_GetLen (T1_Block * block);
     82unsigned char T1_Block_GetLen (T1_Block * block);
    8583
    86 BYTE * T1_Block_GetInf (T1_Block * block);
    87 
    88 BYTE * T1_Block_Raw (T1_Block * block);
    89 
    90 unsigned T1_Block_RawLen (T1_Block * block);
     84unsigned char * T1_Block_GetInf (T1_Block * block);
    9185
    9286void T1_Block_Delete (T1_Block * block);
  • trunk/module-dvbapi.c

    r1740 r1743  
    1717 */
    1818
     19#include "globals.h"  //HAVE_DVBAPI is set here so must be included before ifdef
     20
    1921#ifdef HAVE_DVBAPI
    2022
    2123#include <sys/un.h>
    2224
    23 #include "globals.h"
    2425
    2526#define BUFSIZE 512
  • trunk/oscam-config.h

    r1284 r1743  
    2323#    define SCI_DEV 1
    2424#  endif
     25#  define HAVE_DVBAPI
    2526#endif
    2627
Note: See TracChangeset for help on using the changeset viewer.