SASC
DVBSoftCAM

cOpenTVModule Class Reference

List of all members.

Public Member Functions

 cOpenTVModule (const unsigned char *data)
 cOpenTVModule (int Id, const unsigned char *data, int len)
 ~cOpenTVModule ()
int AddPart (const unsigned char *data, int len)
const info_header_t * InfoHdr (void) const
const code_header_t * CodeHdr (void) const
const data_header_t * DataHdr (void) const
 cOpenTVModule (const unsigned char *data)
 cOpenTVModule (int Id, const unsigned char *data, int len)
 ~cOpenTVModule ()
int AddPart (const unsigned char *data, int len)
const info_header_t * InfoHdr (void) const
const code_header_t * CodeHdr (void) const
const data_header_t * DataHdr (void) const

Static Public Member Functions

static int Id (const unsigned char *data)
static int Offset (const unsigned char *data)
static int Length (const unsigned char *data)
static int Id (const unsigned char *data)
static int Offset (const unsigned char *data)
static int Length (const unsigned char *data)

Detailed Description

Definition at line 203 of file tps.c.


Constructor & Destructor Documentation

cOpenTVModule::cOpenTVModule ( const unsigned char *  data)

Definition at line 230 of file tps.c.

References Id(), Length(), and MALLOC.

{
  id=Id(data); modlen=Length(data);
  received=0;
  mem=MALLOC(unsigned char,modlen);
}
cOpenTVModule::cOpenTVModule ( int  Id,
const unsigned char *  data,
int  len 
)

Definition at line 237 of file tps.c.

References Id(), and MALLOC.

{
  id=Id; modlen=received=len;
  mem=MALLOC(unsigned char,modlen);
  memcpy(mem,data,len);
  ParseSections();
}
cOpenTVModule::~cOpenTVModule ( )

Definition at line 245 of file tps.c.

References free.

{
  free(mem);
}
cOpenTVModule::cOpenTVModule ( const unsigned char *  data)
cOpenTVModule::cOpenTVModule ( int  Id,
const unsigned char *  data,
int  len 
)
cOpenTVModule::~cOpenTVModule ( )

Member Function Documentation

int cOpenTVModule::AddPart ( const unsigned char *  data,
int  len 
)

Definition at line 250 of file tps.c.

References Id(), L_SYS_TPSAU, Length(), Offset(), and PRINTF.

Referenced by cTpsAuHook::Process().

{
  if(Id(data)==id) {
    int off=Offset(data);
    int mlen=Length(data);
    int rec=slen-28;
    if(mlen!=modlen || (off+rec)>mlen || !mem) {
      PRINTF(L_SYS_TPSAU,"length mismatch while adding to OpenTV module");
      return -1;
      }
    memcpy(&mem[off],data+24,rec);
    received+=rec;
    if(received==mlen) {
      if(!Decompress()) {
        PRINTF(L_SYS_TPSAU,"failed to decompress OpenTV module");
        return -1;
        }
      if(!ParseSections()) {
        PRINTF(L_SYS_TPSAU,"DATA & CODE section not located in OpenTV module");
        return -1;
        }
      Dump();
      return 1;
      }
    }
  return 0;
}
int cOpenTVModule::AddPart ( const unsigned char *  data,
int  len 
)
const code_header_t* cOpenTVModule::CodeHdr ( void  ) const [inline]

Definition at line 222 of file tps.c.

{ return &code; }
const code_header_t* cOpenTVModule::CodeHdr ( void  ) const [inline]

Definition at line 222 of file tps.c.

{ return &code; }
const data_header_t* cOpenTVModule::DataHdr ( void  ) const [inline]

Definition at line 223 of file tps.c.

{ return &data; }
const data_header_t* cOpenTVModule::DataHdr ( void  ) const [inline]

Definition at line 223 of file tps.c.

{ return &data; }
static int cOpenTVModule::Id ( const unsigned char *  data) [inline, static]

Definition at line 225 of file tps.c.

References UINT16_BE.

Referenced by AddPart(), cOpenTVModule(), and cTpsAuHook::Process().

{ return UINT16_BE(&data[3]); }
static int cOpenTVModule::Id ( const unsigned char *  data) [inline, static]

Definition at line 225 of file tps.c.

References UINT16_BE.

{ return UINT16_BE(&data[3]); }
const info_header_t* cOpenTVModule::InfoHdr ( void  ) const [inline]

Definition at line 221 of file tps.c.

{ return &info; }
const info_header_t* cOpenTVModule::InfoHdr ( void  ) const [inline]

Definition at line 221 of file tps.c.

{ return &info; }
static int cOpenTVModule::Length ( const unsigned char *  data) [inline, static]

Definition at line 227 of file tps.c.

References UINT32_BE.

{ return UINT32_BE(&data[20]); }
static int cOpenTVModule::Length ( const unsigned char *  data) [inline, static]

Definition at line 227 of file tps.c.

References UINT32_BE.

Referenced by AddPart(), and cOpenTVModule().

{ return UINT32_BE(&data[20]); }
static int cOpenTVModule::Offset ( const unsigned char *  data) [inline, static]

Definition at line 226 of file tps.c.

References UINT32_BE.

{ return UINT32_BE(&data[16]); }
static int cOpenTVModule::Offset ( const unsigned char *  data) [inline, static]

Definition at line 226 of file tps.c.

References UINT32_BE.

Referenced by AddPart().

{ return UINT32_BE(&data[16]); }

The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines