]> www.vanbest.org Git - sasc-ng.git/commitdiff
cardclient: add bunghole's disable EMM caching option patch
authorleslie <unknown>
Mon, 5 Sep 2011 22:58:34 +0000 (06:58 +0800)
committerleslie <unknown>
Mon, 5 Sep 2011 22:58:34 +0000 (06:58 +0800)
examples/cardclient.conf.example
systems/cardclient/aroureos.c
systems/cardclient/camd.c
systems/cardclient/cc.c
systems/cardclient/cc.h
systems/cardclient/cccam2.c
systems/cardclient/newcamd.c
systems/cardclient/radegast.c

index 1bc98d479ed5dd0db734b6b5d9ee5216d3288591..9de35e0572087c0564011ed473849e1b00e4e344 100644 (file)
@@ -5,7 +5,7 @@
 # 'hostname' is the name of the server
 # 'port'     is the port on the server
 # 'emm'      is a flag to allow EMM transfers to the server
-#            (0=disabled 1=enabled)
+#            (0=disabled 1=enabled 2=enabled without caching)
 # 'caid'     (optional) caid on which this client should work
 # 'mask'     (optional) mask for caid e.g. caid=1700 mask=FF00 would allow
 #            anything between 1700 & 17FF.
index 75b16f4e2573dc0a8dadfe8b60c416902da5a5ec..d47aecee5f76d20b2392eca81f49a777408e2f64 100644 (file)
@@ -86,7 +86,7 @@ bool cCardClientAroureos::ProcessEMM(int caSys, const unsigned char *source)
     if(MatchEMM(source)) {
       const int length=SCT_LEN(source);
       int id=msEMM.Get(source,length,0);
-      if(id>0) {
+      if(id>0 || emmAllowed>1) {
         unsigned char *buff=AUTOMEM(length+8);
         memcpy(buff,"EMM",3);
         memcpy(&buff[3],source,length);
index 1182aa9156f274aeb20ff47f573604af8e45a907..49219e0c80f802c0f793901fa50d6e7296a38d91 100644 (file)
@@ -182,7 +182,7 @@ bool cCardClientCommon::ProcessEMM(int caSys, const unsigned char *source)
     if(MatchEMM(source)) {
       const int length=SCT_LEN(source);
       int id=msEMM.Get(source,length,0);
-      if(id>0) {
+      if(id>0 || emmAllowed>1) {
         unsigned char *buff=AUTOMEM(length+32);
         buff[0]=0x03;
         buff[1]=(caSys>>8);
@@ -654,7 +654,7 @@ bool cCardClientCamd35::ProcessEMM(int caSys, const unsigned char *data)
             if(len+off<=255) {
               memcpy(&cb->data[off],data,len);
               int id=msEMM.Get(&cb->data[0],len+off,0);
-              if(id>0) {
+              if(id>0 || emmAllowed>1) {
                 SendBlock(cb,len+off);
                 msEMM.Cache(id,true,0);
                 }
index 2fb4f46eb804dcb482af91b519cd481edc7f0f63..557737b6771600096c195aa2c734fb42b74a8544 100644 (file)
@@ -56,7 +56,7 @@ cCardClient::cCardClient(const char *Name)
 ,msEMM(32,0)
 {
   name=Name;
-  emmAllowed=false; emmCaid[0]=0x1700; emmMask[0]=0xFF00; numCaid=1;
+  emmAllowed=0; emmCaid[0]=0x1700; emmMask[0]=0xFF00; numCaid=1;
 }
 
 bool cCardClient::Immediate(void)
@@ -74,7 +74,8 @@ bool cCardClient::ParseStdConfig(const char *config, int *num)
   int n, emm=0;
   if(!num) num=&n;
   if(sscanf(config,"%63[^:]:%d:%d%n",hostname,&port,&emm,num)<3) return false;
-  if(emm>0) emmAllowed=true;
+  if(emm>0) emmAllowed=1;
+  if(emm==2) emmAllowed=2; // EMM caching disabled
   if(config[*num]=='/') {
     numCaid=0;
     do {
index de968e03092b2c17974b8db39141c7172222bee6..aa97b7d142e1fb1584adce201089df77879ea823 100644 (file)
@@ -63,7 +63,7 @@ protected:
   const char *name;
   char hostname[64];
   int port;
-  bool emmAllowed;
+  int emmAllowed;
   int emmCaid[MAX_CC_CAID], emmMask[MAX_CC_CAID], numCaid;
   cMsgCache msECM, msEMM;
   //
index c6d5401982923708add1bf7d335e4afd8b67aae1..c676f6007b341a3cef8dcf3f112b9b771708b8ee 100644 (file)
@@ -1236,7 +1236,7 @@ bool cCardClientCCcam2::ProcessEMM(int caSys, const unsigned char *data)
           while((d=ad.Assembled())) {
             int len=SCT_LEN(d);
             int id=s->Cache()->Get(d,len,0);
-            if(id>0) {
+            if(id>0 || emmAllowed>1) {
               if(len<256) {
                 unsigned char bb[sizeof(struct EmmRequest)+256];
                 struct EmmRequest *req=(struct EmmRequest *)bb;
index 5a084193090440b5c8d024f69120b24e3bea3b75..d9ea1738c54b4172882106d62ae7e032d7e65e87 100644 (file)
@@ -508,7 +508,7 @@ bool cCardClientNewCamd::ProcessEMM(int caSys, const unsigned char *data)
       while((data=ad.Assembled())) {
         int len=SCT_LEN(data);
         int id=msEMM.Get(data,len,0);
-        if(id>0) {
+        if(id>0 || emmAllowed>1) {
           if(SendMessage(data,len,true,0)) {
             unsigned char buffer[CWS_NETMSGSIZE];
             len=ReceiveMessage(buffer,true);
index 4b80078000090b1305193f1acd190dc029dd3b33..9c43e581049984e0a420184367425763369ba45b 100644 (file)
@@ -284,7 +284,7 @@ bool cCardClientRadegast::ProcessEMM(int caSys, const unsigned char *data)
       while((data=ad.Assembled())) {
         int len=SCT_LEN(data);
         int id=msEMM.Get(data,len,0);
-        if(id>0) {
+        if(id>0 || emmAllowed>1) {
           unsigned char buff[512];
           StartMsg(buff,0x41);                 //
           AddNano(buff,0x42,2,caSys);          // EMM_CAID