SASC-NG
DVBSoftCAM

cOverrides Class Reference

#include <override.h>

Inheritance diagram for cOverrides:

List of all members.

Public Member Functions

 cOverrides (void)
int GetCat (int source, int transponder, unsigned char *buff, int len)
void UpdateEcm (cEcmInfo *ecm, bool log)
bool AddEmmPids (int caid, int source, int transponder, cPids *pids, int pid)
bool Ignore (int source, int transponder, int caid)
int GetEcmPrio (int source, int transponder, int caid, int prov)

Protected Member Functions

cOverride * Find (int type, int caid, int source, int transponder, cOverride *ov=0)
virtual cOverride * ParseLine (char *line)
virtual void PreLoad (void)
virtual void PostLoad (void)

Detailed Description

Definition at line 85 of file override.h.


Constructor & Destructor Documentation

cOverrides::cOverrides ( void  )

Definition at line 557 of file override.c.

:cStructList<cOverride>("overrides","override.conf",SL_MISSINGOK|SL_WATCH|SL_VERBOSE)
{}

Member Function Documentation

bool cOverrides::AddEmmPids ( int  caid,
int  source,
int  transponder,
cPids *  pids,
int  pid 
)

Definition at line 626 of file override.c.

References cOverrideEmmTable::AddPids(), Find(), cStructLoader::ListLock(), cStructLoader::ListUnlock(), and OV_EMMTABLE.

Referenced by cSystem::ParseCAT().

{
  bool res=false;
  ListLock(false);
  cOverrideEmmTable *ovt=dynamic_cast<cOverrideEmmTable *>(Find(OV_EMMTABLE,caid,source,transponder));
  if(ovt) {
    ovt->AddPids(pids,pid,caid);
    res=true;
    }
  ListUnlock();
  return res;
}
cOverride * cOverrides::Find ( int  type,
int  caid,
int  source,
int  transponder,
cOverride *  ov = 0 
) [protected]

Definition at line 590 of file override.c.

References cStructList< cOverride >::First(), cValidityRange::Match(), cStructList< cOverride >::Next(), and cOverride::Type().

Referenced by AddEmmPids(), GetCat(), GetEcmPrio(), Ignore(), and UpdateEcm().

{
  for(ov=ov?Next(ov):First(); ov; ov=Next(ov))
    if(ov->Type()==type && ov->Match(caid,source,transponder%100000)) break;
  return ov;
}
int cOverrides::GetCat ( int  source,
int  transponder,
unsigned char *  buff,
int  len 
)

Definition at line 597 of file override.c.

References Find(), cOverrideCat::GetCatEntry(), cStructLoader::ListLock(), cStructLoader::ListUnlock(), and OV_CAT.

Referenced by cLogger::Process().

{
  int n=0;
  ListLock(false);
  for(cOverride *ov=0; (ov=Find(OV_CAT,-1,source,transponder,ov)) && n<len-32;) {
    cOverrideCat *ovc=dynamic_cast<cOverrideCat *>(ov);
    if(ovc) n+=ovc->GetCatEntry(&buff[n]);
    }
  ListUnlock();
  return n;
}
int cOverrides::GetEcmPrio ( int  source,
int  transponder,
int  caid,
int  prov 
)

Definition at line 651 of file override.c.

References Find(), cOverrideEcmPrio::GetPrio(), cStructLoader::ListLock(), cStructLoader::ListUnlock(), and OV_ECMPRIO.

{
  int pri=0;
  ListLock(false);
  cOverrideEcmPrio *ovp=dynamic_cast<cOverrideEcmPrio *>(Find(OV_ECMPRIO,-1,source,transponder));
  if(ovp) pri=ovp->GetPrio(caid,prov);
  ListUnlock();
  return pri;
}
bool cOverrides::Ignore ( int  source,
int  transponder,
int  caid 
)

Definition at line 639 of file override.c.

References Find(), cOverrideIgnore::Ignore(), cStructLoader::ListLock(), cStructLoader::ListUnlock(), and OV_IGNORE.

Referenced by cChannelList::CheckIgnore(), and cLogChain::Parse().

{
  bool res=false;
  ListLock(false);
  for(cOverride *ov=0; (ov=Find(OV_IGNORE,-1,source,transponder,ov)) && !res;) {
    cOverrideIgnore *ovi=dynamic_cast<cOverrideIgnore *>(ov);
    if(ovi && ovi->Ignore(caid)) res=true;
    }
  ListUnlock();
  return res;
}
cOverride * cOverrides::ParseLine ( char *  line) [protected, virtual]

Implements cStructLoader.

Definition at line 571 of file override.c.

References cOverride::Parse(), and skipspace().

{
  cOverride *ov=0;
  line=skipspace(line);
  char *p=index(line,':');
  if(p) {
    *p++=0;
    if(!strncasecmp(line,"cat",3)) ov=new cOverrideCat;
    else if(!strncasecmp(line,"emmcaid",7)) ov=new cOverrideEmmCaid;
    else if(!strncasecmp(line,"ecmtable",8)) ov=new cOverrideEcmTable;
    else if(!strncasecmp(line,"emmtable",8)) ov=new cOverrideEmmTable;
    else if(!strncasecmp(line,"tunnel",6)) ov=new cOverrideTunnel;
    else if(!strncasecmp(line,"ignore",6)) { ov=new cOverrideIgnore; caidTrigger=true; }
    else if(!strncasecmp(line,"ecmprio",7)) ov=new cOverrideEcmPrio;
    if(ov && !ov->Parse(p)) { delete ov; ov=0; }
    }
  return ov;
}
void cOverrides::PostLoad ( void  ) [protected, virtual]

Reimplemented from cStructLoader.

Definition at line 566 of file override.c.

References cGlobal::CaidsChanged().

{
  if(caidTrigger) cGlobal::CaidsChanged();
}
void cOverrides::PreLoad ( void  ) [protected, virtual]

Reimplemented from cStructLoader.

Definition at line 561 of file override.c.

{
  caidTrigger=false;
}

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