Changeset 3592
- Timestamp:
- 10/17/10 14:30:31 (13 years ago)
- Location:
- trunk
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/globals.h
r3589 r3592 1007 1007 #endif 1008 1008 int failbantime; 1009 LLIST *v_list; //failban list1009 LLIST_D_ *v_list; //failban list 1010 1010 int c33_port; 1011 1011 in_addr_t c33_srvip; -
trunk/module-cccam.c
r3583 r3592 146 146 147 147 int is_sid_blocked(struct cc_card *card, struct cc_srvid *srvid_blocked) { 148 LLIST_ ITR sitr;148 LLIST_D__ITR sitr; 149 149 struct cc_srvid *srvid = llist_itr_init(card->badsids, &sitr); 150 150 while (srvid) { … … 158 158 159 159 int is_good_sid(struct cc_card *card, struct cc_srvid *srvid_good) { 160 LLIST_ ITR sitr;160 LLIST_D__ITR sitr; 161 161 struct cc_srvid *srvid = llist_itr_init(card->goodsids, &sitr); 162 162 while (srvid) { … … 185 185 void remove_sid_block(struct cc_card *card, 186 186 struct cc_srvid *srvid_blocked) { 187 LLIST_ ITR sitr;187 LLIST_D__ITR sitr; 188 188 struct cc_srvid *srvid = llist_itr_init(card->badsids, &sitr); 189 189 while (srvid) { … … 197 197 198 198 void remove_good_sid(struct cc_card *card, struct cc_srvid *srvid_good) { 199 LLIST_ ITR sitr;199 LLIST_D__ITR sitr; 200 200 struct cc_srvid *srvid = llist_itr_init(card->goodsids, &sitr); 201 201 while (srvid) { … … 222 222 } 223 223 224 void free_current_cards(LLIST *current_cards) {225 LLIST_ ITR itr;224 void free_current_cards(LLIST_D_ *current_cards) { 225 LLIST_D__ITR itr; 226 226 struct cc_current_card *c = llist_itr_init(current_cards, &itr); 227 227 while (c) { … … 278 278 struct cc_data *cc = cl->cc; 279 279 struct cc_extended_ecm_idx *eei; 280 LLIST_ ITR itr;280 LLIST_D__ITR itr; 281 281 eei = llist_itr_init(cc->extended_ecm_idx, &itr); 282 282 while (eei) { … … 299 299 struct cc_data *cc = cl->cc; 300 300 struct cc_extended_ecm_idx *eei; 301 LLIST_ ITR itr;301 LLIST_D__ITR itr; 302 302 eei = llist_itr_init(cc->extended_ecm_idx, &itr); 303 303 while (eei) { … … 319 319 struct cc_data *cc = cl->cc; 320 320 struct cc_extended_ecm_idx *eei; 321 LLIST_ ITR itr;321 LLIST_D__ITR itr; 322 322 323 323 eei = llist_itr_init(cc->extended_ecm_idx, &itr); … … 333 333 void free_extended_ecm_idx(struct cc_data *cc) { 334 334 struct cc_extended_ecm_idx *eei; 335 LLIST_ ITR itr;335 LLIST_D__ITR itr; 336 336 eei = llist_itr_init(cc->extended_ecm_idx, &itr); 337 337 while (eei) { … … 650 650 struct cc_current_card *cc_find_current_card(struct cc_data *cc, 651 651 struct cc_card *card) { 652 LLIST_ ITR itr;652 LLIST_D__ITR itr; 653 653 struct cc_current_card *c = llist_itr_init(cc->current_cards, &itr); 654 654 while (c) { … … 662 662 struct cc_current_card *cc_find_current_card_by_srvid( 663 663 struct cc_data *cc, ushort caid, ulong prov, struct cc_srvid *srvid) { 664 LLIST_ ITR itr;664 LLIST_D__ITR itr; 665 665 struct cc_current_card *c = llist_itr_init(cc->current_cards, &itr); 666 666 while (c) { … … 675 675 void cc_remove_current_card(struct cc_data *cc, 676 676 struct cc_current_card *current_card) { 677 LLIST_ ITR itr;677 LLIST_D__ITR itr; 678 678 struct cc_current_card *c = llist_itr_init(cc->current_cards, &itr); 679 679 while (c) { … … 774 774 struct cc_card *card; 775 775 struct cc_current_card *current_card; 776 LLIST_ ITR itr;776 LLIST_D__ITR itr; 777 777 ECM_REQUEST *cur_er; 778 778 struct timeb cur_time; … … 885 885 int s = is_sid_blocked(ncard, &cur_srvid); 886 886 887 LLIST_ ITR pitr;887 LLIST_D__ITR pitr; 888 888 struct cc_provider *provider = llist_itr_init( 889 889 ncard->providers, &pitr); … … 959 959 960 960 rdr->nprov = 0; 961 LLIST_ ITR pitr;961 LLIST_D__ITR pitr; 962 962 struct cc_provider *provider = llist_itr_init(card->providers, 963 963 &pitr); … … 1004 1004 while (card) { 1005 1005 if (card->caid == cur_er->caid) { // caid matches 1006 LLIST_ ITR sitr;1006 LLIST_D__ITR sitr; 1007 1007 struct cc_srvid *srvid = llist_itr_init(card->badsids, 1008 1008 &sitr); … … 1060 1060 struct cc_data *cc = cl->cc; 1061 1061 1062 LLIST_ ITR itr;1062 LLIST_D__ITR itr; 1063 1063 uint8 *emmbuf = llist_itr_init(cc->pending_emms, &itr); 1064 1064 if (emmbuf) { … … 1092 1092 struct cc_card *get_card_by_hexserial(struct s_client *cl, uint8 *hexserial, uint16 caid) { 1093 1093 struct cc_data *cc = cl->cc; 1094 LLIST_ ITR itr;1094 LLIST_D__ITR itr; 1095 1095 struct cc_card *card = llist_itr_init(cc->cards, &itr); 1096 1096 while (card) { … … 1131 1131 //Last used card is first card of current_cards: 1132 1132 pthread_mutex_lock(&cc->cards_busy); 1133 LLIST_ ITR itr;1133 LLIST_D__ITR itr; 1134 1134 struct cc_current_card *current_card = llist_itr_init(cc->current_cards, 1135 1135 &itr); … … 1190 1190 1191 1191 if (card->providers) { 1192 LLIST_ ITR bitr;1192 LLIST_D__ITR bitr; 1193 1193 struct cc_provider *provider = llist_itr_init(card->providers, &bitr); 1194 1194 while (provider) { … … 1211 1211 * Adds a cccam-carddata buffer to the list of reported carddatas 1212 1212 */ 1213 void cc_add_reported_carddata(struct s_client *cl, LLIST *reported_carddatas, uint8 *buf,1213 void cc_add_reported_carddata(struct s_client *cl, LLIST_D_ *reported_carddatas, uint8 *buf, 1214 1214 int len, struct s_reader *D_USE(rdr)) { 1215 1215 struct cc_reported_carddata *carddata = malloc( … … 1240 1240 } 1241 1241 1242 void cc_clear_reported_carddata(struct s_client *cl, LLIST *reported_carddatas,1242 void cc_clear_reported_carddata(struct s_client *cl, LLIST_D_ *reported_carddatas, 1243 1243 int send_removed) { 1244 LLIST_ ITR itr;1244 LLIST_D__ITR itr; 1245 1245 struct cc_reported_carddata *carddata = llist_itr_init(reported_carddatas, 1246 1246 &itr); … … 1255 1255 } 1256 1256 1257 void cc_free_reported_carddata(struct s_client *cl, LLIST *reported_carddatas,1257 void cc_free_reported_carddata(struct s_client *cl, LLIST_D_ *reported_carddatas, 1258 1258 int send_removed) { 1259 1259 if (reported_carddatas) { … … 1263 1263 } 1264 1264 1265 void cc_free_cardlist(LLIST *card_list) {1265 void cc_free_cardlist(LLIST_D_ *card_list) { 1266 1266 if (card_list) { 1267 LLIST_ ITR itr;1267 LLIST_D__ITR itr; 1268 1268 struct cc_card *card = llist_itr_init(card_list, &itr); 1269 1269 while (card) { … … 1286 1286 cc_free_reported_carddata(cl, cc->reported_carddatas, 0); 1287 1287 if (cc->pending_emms) { 1288 LLIST_ ITR itr;1288 LLIST_D__ITR itr; 1289 1289 uint8 *ep = llist_itr_init(cc->pending_emms, &itr); 1290 1290 while (ep) { … … 1439 1439 memcpy(buf + 12, card->hexserial, 8); 1440 1440 int j = 0; 1441 LLIST_ ITR itr_prov;1441 LLIST_D__ITR itr_prov; 1442 1442 struct cc_provider *prov = llist_itr_init(card->providers, &itr_prov); 1443 1443 while (prov) { … … 1461 1461 struct cc_data *cc = cl->cc; 1462 1462 struct cc_card *card; 1463 LLIST_ ITR itr;1463 LLIST_D__ITR itr; 1464 1464 1465 1465 pthread_mutex_lock(&cc->cards_busy); … … 1614 1614 //SS: Hack: 1615 1615 //Check if we already have this card: 1616 LLIST_ ITR itr;1616 LLIST_D__ITR itr; 1617 1617 struct cc_card *old_card = llist_itr_init(cc->cards, &itr); 1618 1618 while (old_card) { … … 2114 2114 //1. Copy nonexisting providers, ignore double: 2115 2115 struct cc_provider *prov_info; 2116 LLIST_ ITR itr_dest;2117 LLIST_ ITR itr_src;2116 LLIST_D__ITR itr_dest; 2117 LLIST_D__ITR itr_src; 2118 2118 struct cc_provider *provider = llist_itr_init(card->providers, &itr_src); 2119 2119 while (provider) { … … 2180 2180 * Adds a new card to a cardlist. 2181 2181 */ 2182 int add_card_to_serverlist(LLIST *cardlist, struct cc_card *card, int reshare) {2182 int add_card_to_serverlist(LLIST_D_ *cardlist, struct cc_card *card, int reshare) { 2183 2183 int modified = 0; 2184 LLIST_ ITR itr;2184 LLIST_D__ITR itr; 2185 2185 struct cc_card *card2 = llist_itr_init(cardlist, &itr); 2186 2186 … … 2286 2286 id = cc->report_carddata_id; 2287 2287 2288 LLIST *server_cards = llist_create();2289 LLIST *reported_carddatas = llist_create();2288 LLIST_D_ *server_cards = llist_create(); 2289 LLIST_D_ *reported_carddatas = llist_create(); 2290 2290 2291 2291 int isau = is_au(cl); … … 2471 2471 pthread_mutex_lock(&rcc->cards_busy); 2472 2472 2473 LLIST_ ITR itr;2473 LLIST_D__ITR itr; 2474 2474 card = llist_itr_init(rcc->cards, &itr); 2475 2475 while (card) { … … 2481 2481 int ignore = 0; 2482 2482 2483 LLIST_ ITR itr_prov;2483 LLIST_D__ITR itr_prov; 2484 2484 struct cc_provider *prov = llist_itr_init( 2485 2485 card->providers, &itr_prov); … … 2514 2514 //report reshare cards: 2515 2515 //cs_debug_mask(D_TRACE, "%s reporting %d cards", getprefix(), llist_count(server_cards)); 2516 LLIST_ ITR itr;2516 LLIST_D__ITR itr; 2517 2517 struct cc_card *card = llist_itr_init(server_cards, &itr); 2518 2518 while (card) { … … 2534 2534 memcpy(buf + 12, card->hexserial, 8); 2535 2535 int j = 0; 2536 LLIST_ ITR itr_prov;2536 LLIST_D__ITR itr_prov; 2537 2537 struct cc_provider *prov = llist_itr_init(card->providers, &itr_prov); 2538 2538 while (prov) { … … 2554 2554 2555 2555 //Add all the others node id: 2556 LLIST_ ITR itr_node;2556 LLIST_D__ITR itr_node; 2557 2557 uint8 *remote_node = llist_itr_init(card->remote_nodes, &itr_node); 2558 2558 while (remote_node) { … … 2897 2897 if (cc->cards) 2898 2898 { 2899 LLIST_ ITR itr;2899 LLIST_D__ITR itr; 2900 2900 struct cc_card *card = llist_itr_init(cc->cards, &itr); 2901 2901 while (card) -
trunk/module-cccam.h
r3546 r3592 67 67 uint8 maxdown; 68 68 uint8 hexserial[8]; // card serial (for au) 69 LLIST *providers; // providers (struct cc_provider)70 LLIST *badsids; // sids that have failed to decode (struct cc_srvid)69 LLIST_D_ *providers; // providers (struct cc_provider) 70 LLIST_D_ *badsids; // sids that have failed to decode (struct cc_srvid) 71 71 time_t time; 72 LLIST *goodsids; //sids that could decoded (struct cc_srvid)73 LLIST *remote_nodes; //remote note id, 8 bytes72 LLIST_D_ *goodsids; //sids that could decoded (struct cc_srvid) 73 LLIST_D_ *remote_nodes; //remote note id, 8 bytes 74 74 }; 75 75 … … 130 130 uint8 receive_buffer[CC_MAXMSGSIZE]; 131 131 132 LLIST *cards; // cards list132 LLIST_D_ *cards; // cards list 133 133 int cards_modified; 134 134 … … 136 136 int ecm_counter; 137 137 uint32 report_carddata_id; //Server only 138 LLIST *reported_carddatas; //struct cc_reported_carddata //struct cc_reported_carddata138 LLIST_D_ *reported_carddatas; //struct cc_reported_carddata //struct cc_reported_carddata 139 139 int just_logged_in; //true for checking NOK direct after login 140 140 uint8 key_table; //key for CMD 0B 141 141 142 LLIST *pending_emms; //pending emm list142 LLIST_D_ *pending_emms; //pending emm list 143 143 144 144 uint32 recv_ecmtask; 145 145 146 LLIST *current_cards; //reader: current card cache146 LLIST_D_ *current_cards; //reader: current card cache 147 147 int server_ecm_pending; //initialized by server 148 LLIST *server_caid_infos[CS_MAXREADER];148 LLIST_D_ *server_caid_infos[CS_MAXREADER]; 149 149 long server_caid_size[CS_MAXREADER]; 150 150 ushort server_ecm_idx; … … 159 159 //Extended Mode for SPECIAL clients: 160 160 int extended_mode; 161 LLIST *extended_ecm_idx;161 LLIST_D_ *extended_ecm_idx; 162 162 }; 163 163 -
trunk/module-obj-llist.c
r3555 r3592 11 11 #include "globals.h" 12 12 13 LLIST *llist_create(void)13 LLIST_D_ *llist_create(void) 14 14 { 15 LLIST *l = malloc(sizeof(LLIST));15 LLIST_D_ *l = malloc(sizeof(LLIST_D_)); 16 16 if (!l) 17 17 return NULL; 18 memset(l, 0, sizeof(LLIST ));18 memset(l, 0, sizeof(LLIST_D_)); 19 19 20 20 pthread_mutex_init(&l->lock, NULL); … … 25 25 } 26 26 27 void llist_destroy(LLIST *l)27 void llist_destroy(LLIST_D_ *l) 28 28 { 29 LLIST_ ITR itr;29 LLIST_D__ITR itr; 30 30 if (!l) 31 31 return; … … 39 39 } 40 40 41 void llist_clear(LLIST *l)41 void llist_clear(LLIST_D_ *l) 42 42 { 43 LLIST_ ITR itr;43 LLIST_D__ITR itr; 44 44 if (!l) 45 45 return; … … 52 52 } 53 53 54 void *llist_append(LLIST *l, void *o)54 void *llist_append(LLIST_D_ *l, void *o) 55 55 { 56 56 if (!l) … … 82 82 } 83 83 84 void *llist_insert_first(LLIST *l, void *o)84 void *llist_insert_first(LLIST_D_ *l, void *o) 85 85 { 86 86 if (!l) … … 112 112 } 113 113 114 void *llist_itr_init(LLIST *l, LLIST_ITR *itr)114 void *llist_itr_init(LLIST_D_ *l, LLIST_D__ITR *itr) 115 115 { 116 116 if (!l || !itr) … … 119 119 if (l->first) { 120 120 121 memset(itr, 0, sizeof(LLIST_ ITR));121 memset(itr, 0, sizeof(LLIST_D__ITR)); 122 122 itr->cur = l->first; 123 123 itr->l = l; … … 129 129 } 130 130 /* 131 void llist_itr_release(LLIST_ ITR *itr)131 void llist_itr_release(LLIST_D__ITR *itr) 132 132 { 133 133 // pthread_mutex_unlock(&itr->l->lock); 134 134 } 135 135 */ 136 void *llist_itr_next(LLIST_ ITR *itr)136 void *llist_itr_next(LLIST_D__ITR *itr) 137 137 { 138 138 if (itr->cur->nxt) { … … 144 144 } 145 145 146 void *llist_itr_remove(LLIST_ ITR *itr) // this needs cleaning - I was lazy146 void *llist_itr_remove(LLIST_D__ITR *itr) // this needs cleaning - I was lazy 147 147 { 148 148 if (!itr || !itr->l || itr->l->items == 0) … … 176 176 } 177 177 178 int llist_count(LLIST *l)178 int llist_count(LLIST_D_ *l) 179 179 { 180 180 return l->items; -
trunk/module-obj-llist.h
r3555 r3592 6 6 */ 7 7 8 #ifndef OSCAMLLIST_ H_9 #define OSCAMLLIST_ H_8 #ifndef OSCAMLLIST_D__H_ 9 #define OSCAMLLIST_D__H_ 10 10 11 11 /******************************** */ … … 29 29 int items; 30 30 pthread_mutex_t lock; 31 } LLIST ;31 } LLIST_D_; 32 32 33 33 typedef struct llist_itr { 34 LLIST *l;34 LLIST_D_ *l; 35 35 struct llist_node *cur; 36 } LLIST_ ITR;36 } LLIST_D__ITR; 37 37 38 LLIST *llist_create(void); // init linked list39 void llist_destroy(LLIST *l); // de-init linked list - frees all objects on the list40 void llist_clear(LLIST *l); // frees all objects on the list38 LLIST_D_ *llist_create(void); // init linked list 39 void llist_destroy(LLIST_D_ *l); // de-init linked list - frees all objects on the list 40 void llist_clear(LLIST_D_ *l); // frees all objects on the list 41 41 42 void *llist_append(LLIST *l, void *o); // append object onto bottom of list, returns ptr to obj43 void *llist_insert_first(LLIST *l, void *o); // append object onto bottom of list, returns ptr to obj42 void *llist_append(LLIST_D_ *l, void *o); // append object onto bottom of list, returns ptr to obj 43 void *llist_insert_first(LLIST_D_ *l, void *o); // append object onto bottom of list, returns ptr to obj 44 44 45 void *llist_itr_init(LLIST *l, LLIST_ITR *itr); // linked list iterator, returns ptr to first obj46 //void llist_itr_release(LLIST_ ITR *itr); // release iterator47 void *llist_itr_next(LLIST_ ITR *itr); // iterates, returns ptr to next obj45 void *llist_itr_init(LLIST_D_ *l, LLIST_D__ITR *itr); // linked list iterator, returns ptr to first obj 46 //void llist_itr_release(LLIST_D__ITR *itr); // release iterator 47 void *llist_itr_next(LLIST_D__ITR *itr); // iterates, returns ptr to next obj 48 48 49 void *llist_itr_insert(LLIST_ ITR *itr, void *o); // insert object at itr point, iterates to and returns ptr to new obj50 void *llist_itr_remove(LLIST_ ITR *itr); // remove obj at itr, iterates to and returns ptr to next obj49 void *llist_itr_insert(LLIST_D__ITR *itr, void *o); // insert object at itr point, iterates to and returns ptr to new obj 50 void *llist_itr_remove(LLIST_D__ITR *itr); // remove obj at itr, iterates to and returns ptr to next obj 51 51 52 int llist_count(LLIST *l); // returns number of obj in list52 int llist_count(LLIST_D_ *l); // returns number of obj in list 53 53 54 #endif /* OSCAMLLIST_ H_ */54 #endif /* OSCAMLLIST_D__H_ */ -
trunk/module-stat.c
r3589 r3592 116 116 } 117 117 118 LLIST_ ITR itr;118 LLIST_D__ITR itr; 119 119 READER_STAT *stat = llist_itr_init(reader_stat[ridx], &itr); 120 120 while (stat) { … … 140 140 pthread_mutex_lock(&stat_busy); 141 141 int c = 0; 142 LLIST_ ITR itr;142 LLIST_D__ITR itr; 143 143 READER_STAT *stat = llist_itr_init(reader_stat[ridx], &itr); 144 144 while (stat) { … … 190 190 } 191 191 192 LLIST_ ITR itr;192 LLIST_D__ITR itr; 193 193 READER_STAT *stat = llist_itr_init(reader_stat[ridx], &itr); 194 194 … … 536 536 pthread_mutex_lock(&stat_busy); 537 537 538 LLIST_ ITR itr;538 LLIST_D__ITR itr; 539 539 READER_STAT *stat = llist_itr_init(reader_stat[ridx], &itr); 540 540 while (stat) { -
trunk/module-stat.h
r3483 r3592 2 2 #include "module-obj-llist.h" 3 3 4 LLIST *reader_stat[CS_MAXREADER];4 LLIST_D_ *reader_stat[CS_MAXREADER]; 5 5 static pthread_mutex_t stat_busy; 6 6 -
trunk/oscam-ac.c
r3564 r3592 7 7 static uchar ac_ecmd5[CS_ECMSTORESIZE]; 8 8 9 LLIST *ac_stat_list = NULL; //struct s_acasc10 LLIST *acasc_list = NULL; //struct s_acasc_shm9 LLIST_D_ *ac_stat_list = NULL; //struct s_acasc 10 LLIST_D_ *acasc_list = NULL; //struct s_acasc_shm 11 11 12 12 int ac_init_log(void) … … 69 69 struct s_client *cl_idx; 70 70 71 LLIST_ ITR itr1, itr2;71 LLIST_D__ITR itr1, itr2; 72 72 i = 1; 73 73 struct s_acasc *ac_stat = llist_itr_init(ac_stat_list, &itr1); … … 187 187 struct s_acasc_shm *get_acasc(ushort ac_idx) { 188 188 int i=1; 189 LLIST_ ITR itr;189 LLIST_D__ITR itr; 190 190 191 191 struct s_acasc_shm *acasc = llist_itr_init(acasc_list, &itr); -
trunk/oscam-http.c
r3582 r3592 1156 1156 rc2hide = atoi(getParam(params, "hide")); 1157 1157 1158 LLIST_ ITR itr;1158 LLIST_D__ITR itr; 1159 1159 READER_STAT *stat = llist_itr_init(reader_stat[readeridx], &itr); 1160 1160 … … 1605 1605 pthread_mutex_lock(&rcc->cards_busy); 1606 1606 1607 LLIST_ ITR itr;1607 LLIST_D__ITR itr; 1608 1608 card = llist_itr_init(rcc->cards, &itr); 1609 1609 while (card) { 1610 1610 char *node_str = malloc(llist_count(card->remote_nodes)*(16+2)); 1611 1611 char *node_ptr = node_str; 1612 LLIST_ ITR nitr;1612 LLIST_D__ITR nitr; 1613 1613 uint8 *node = llist_itr_init(card->remote_nodes, &nitr); 1614 1614 while (node) { … … 1629 1629 1630 1630 int provcount = 0; 1631 LLIST_ ITR pitr;1631 LLIST_D__ITR pitr; 1632 1632 struct cc_provider *prov = llist_itr_init(card->providers, 1633 1633 &pitr); … … 2230 2230 2231 2231 uint ip2delete = 0; 2232 LLIST_ ITR itr;2232 LLIST_D__ITR itr; 2233 2233 V_BAN *v_ban_entry = llist_itr_init(cfg->v_list, &itr); 2234 2234 -
trunk/oscam.c
r3590 r3592 83 83 84 84 time_t now = time((time_t)0); 85 LLIST_ ITR itr;85 LLIST_D__ITR itr; 86 86 V_BAN *v_ban_entry = llist_itr_init(cfg->v_list, &itr); 87 87 … … 111 111 cfg->v_list = llist_create(); 112 112 113 LLIST_ ITR itr;113 LLIST_D__ITR itr; 114 114 V_BAN *v_ban_entry = llist_itr_init(cfg->v_list, &itr); 115 115 while (v_ban_entry) {
Note:
See TracChangeset
for help on using the changeset viewer.