Changeset 388
- Timestamp:
- 09/04/09 10:49:52 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/merlin/src/sharing/camd33.c
r350 r388 13 13 static uchar *req; 14 14 15 static int camd33_send(uchar * buf, int ml)15 static int sharing_camd33_send(uchar * buf, int ml) 16 16 { 17 17 int l; … … 27 27 } 28 28 29 static int camd33_recv(uchar * buf, int l)29 static int sharing_camd33_recv(uchar * buf, int l) 30 30 { 31 31 int n; … … 42 42 } 43 43 44 static void camd33_request_emm()44 static void sharing_camd33_request_emm() 45 45 { 46 46 int au; … … 57 57 memcpy(mbuf + 7, &reader[au].prid[0][1], 3); 58 58 memcpy(mbuf + 10, &reader[au].prid[2][1], 3); 59 camd33_send(mbuf, 13);60 } 61 } 62 63 static void camd33_auth_client(in_addr_t ip)59 sharing_camd33_send(mbuf, 13); 60 } 61 } 62 63 static void sharing_camd33_auth_client(in_addr_t ip) 64 64 { 65 65 int i, rc; … … 78 78 79 79 mbuf[0] = 0; 80 camd33_send(mbuf, 1); // send login-request80 sharing_camd33_send(mbuf, 1); // send login-request 81 81 82 82 for (rc = 0, camdbug[0] = 0, mbuf[0] = 1; (rc < 2) && (mbuf[0]); rc++) { … … 92 92 rc = cs_auth_client(account, NULL); 93 93 if (!rc) 94 camd33_request_emm();94 sharing_camd33_request_emm(); 95 95 else { 96 96 if (rc < 0) … … 100 100 } 101 101 102 static int get_request(uchar * buf, int n)102 static int sharing_camd33_get_request(uchar * buf, int n) 103 103 { 104 104 int rc, w; … … 118 118 else { 119 119 buf[0] = 0; 120 camd33_send(buf, 1);120 sharing_camd33_send(buf, 1); 121 121 w++; 122 122 } … … 147 147 } 148 148 149 static void camd33_send_dcw(ECM_REQUEST * er)149 static void sharing_camd33_send_dcw(ECM_REQUEST * er) 150 150 { 151 151 mbuf[0] = 2; 152 152 memcpy(mbuf + 1, req + (er->cpti * REQ_SIZE), 4); // get pin 153 153 memcpy(mbuf + 5, er->cw, 16); 154 camd33_send(mbuf, 21);154 sharing_camd33_send(mbuf, 21); 155 155 if (!cfg->c33_passive) 156 camd33_request_emm();157 } 158 159 static void camd33_process_ecm(uchar * buf, int l)156 sharing_camd33_request_emm(); 157 } 158 159 static void sharing_camd33_process_ecm(uchar * buf, int l) 160 160 { 161 161 ECM_REQUEST *er; … … 170 170 } 171 171 172 static void camd33_process_emm(uchar * buf, int l)172 static void sharing_camd33_process_emm(uchar * buf, int l) 173 173 { 174 174 memset(&epg, 0, sizeof (epg)); … … 180 180 } 181 181 182 static void camd33_server()182 static void sharing_camd33_server() 183 183 { 184 184 int n; … … 191 191 memset(req, 0, CS_MAXPENDING * REQ_SIZE); 192 192 193 camd33_auth_client(client[cs_idx].ip);194 195 while ((n = get_request(mbuf, sizeof (mbuf))) > 0) {193 sharing_camd33_auth_client(client[cs_idx].ip); 194 195 while ((n = sharing_camd33_get_request(mbuf, sizeof (mbuf))) > 0) { 196 196 switch (mbuf[0]) { 197 197 case 2: 198 camd33_process_ecm(mbuf, n);198 sharing_camd33_process_ecm(mbuf, n); 199 199 break; 200 200 case 3: 201 camd33_process_emm(mbuf, n);201 sharing_camd33_process_emm(mbuf, n); 202 202 break; 203 203 default: … … 222 222 ph->watchdog = 1; 223 223 ph->s_ip = cfg->c33_srvip; 224 ph->s_handler = camd33_server;225 ph->recv = camd33_recv;226 ph->send_dcw = camd33_send_dcw;227 } 224 ph->s_handler = sharing_camd33_server; 225 ph->recv = sharing_camd33_recv; 226 ph->send_dcw = sharing_camd33_send_dcw; 227 }
Note:
See TracChangeset
for help on using the changeset viewer.