]> www.vanbest.org Git - sasc-ng.git/commitdiff
cardclient-CCcam: configuarble camd socket path
authorleslie <unknown>
Mon, 9 Jun 2008 09:42:15 +0000 (17:42 +0800)
committerleslie <unknown>
Mon, 9 Jun 2008 09:42:15 +0000 (17:42 +0800)
README.CCcam
examples/cardclient.conf.example
systems/cardclient/cccam.c

index 0cd686acaa11ea1a8a548fdef39b67194b45e493..743b94809f1ccefc56fc74d6361ea5435e8162a5 100644 (file)
@@ -25,9 +25,10 @@ Note the patch makes a small change to vdr-sc so I can get the card number.
 
 4) Your cardclient.cfg file needs an entry like this...
 
-cccam:127.0.0.1:9000:0/0123/F000
+cccam:127.0.0.1:9000:0/0000/0000:/var/emu/chroot%d/tmp/camd.socket
 
-(note that CCcam interface will offer to serve any ECMs)
+Note: with that CCcam will offer to serve any ECMs.
+Note: socketpath might need to be adjusted to your system.
 
 5) Now it gets tricky, read some docs on the internet about chroot.
 
index f72df6ae7759425850676795b365a03a112d677e..afdc68565037f993781c642be9fba43a2fbb801f 100644 (file)
@@ -46,3 +46,11 @@ newcamd:hostname:port:emm/caid/mask:username:password:cfgKey
 # NOTE: hostname & port will be ignore. GBOX must be runnning on the local
 # machine. For convinience you should choose localhost:8004
 gbox:hostname:port:emm/caid/mask
+#
+# ccam client
+#
+# NOTE: hostname will be ignore. CCcam must be runnning on the local machine
+# 'socket' is the name of the camd socket file. For multiple cards add %d
+# into the string. This will be replaced with the number 0-3.
+# e.g. /var/emu/chroot%d/tmp/camd.socket
+cccam:hostname:port:emm/caid/mask:socket
index c490ded731ecea817675e4d02176a3c106baa0b4..81bebe9f57ac2651851456b0d2686e3bcbe44fe1 100644 (file)
@@ -31,8 +31,6 @@
 \r
 #define LIST_ONLY 0x03   /* CA application should clear the list when an 'ONLY' CAPMT object is received, and start working with the object */\r
 \r
-static char *socketPath="/var/emu/chroot%d/tmp/camd.socket";\r
-\r
 // -- cCCcamCard ---------------------------------------------------------------\r
 \r
 class cCCcamCard : public cMutex {\r
@@ -169,6 +167,7 @@ private:
   cCCcamCard card[4];\r
   int pmtversion;\r
   int failedcw;\r
+  char *socketpath;\r
 protected:\r
   virtual bool Login(void);\r
   virtual void Action(void);\r
@@ -179,28 +178,33 @@ public:
   virtual bool ProcessECM(const cEcmInfo *ecm, const unsigned char *data, unsigned char *Cw, int cardnum);\r
   };\r
 \r
-static cCardClientLinkReg<cCardClientCCcam> __ncd("CCcam");\r
+static cCardClientLinkReg<cCardClientCCcam> __ncd("cccam");\r
 \r
 cCardClientCCcam::cCardClientCCcam(const char *Name)\r
 :cCardClient(Name)\r
 ,cThread("CCcam listener")\r
 ,so(DEFAULT_CONNECT_TIMEOUT,2,3600,true)\r
 {\r
-  pmtversion=0;\r
-  for(int i=0; i<4; i++) card[i].Setup(i,socketPath);\r
+  pmtversion=0; socketpath=0;\r
 }\r
 \r
 cCardClientCCcam::~cCardClientCCcam()\r
 {\r
   Cancel(3);\r
+  free(socketpath);\r
 }\r
 \r
 bool cCardClientCCcam::Init(const char *config)\r
 {\r
   cMutexLock lock(this);\r
   int num=0;\r
-  if(!ParseStdConfig(config,&num)) return false;\r
-  return true;\r
+  char path[256];\r
+  if(!ParseStdConfig(config,&num)\r
+     || sscanf(&config[num],":%255[^:]",path)!=1) return false;\r
+  PRINTF(L_CC_CORE,"%s: socket=%s",name,path);\r
+  socketpath=strdup(path);\r
+  for(int i=0; i<4; i++) card[i].Setup(i,socketpath);\r
+  return Immediate() ? Login() : true;\r
 }\r
 \r
 bool cCardClientCCcam::Login(void)\r