Changeset 8455
- Timestamp:
- 03/02/13 22:43:11 (10 years ago)
- Location:
- trunk
- Files:
-
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/globals.h
r8454 r8455 691 691 #endif 692 692 int32_t c_port; 693 PTAB *ptab;693 PTAB ptab; 694 694 int32_t num; 695 695 }; -
trunk/module-camd33.c
r8342 r8455 166 166 { 167 167 cfg.c33_crypted = check_filled(cfg.c33_key, sizeof(cfg.c33_key)); 168 static PTAB ptab; //since there is always only 1 camd33 server running, this is threadsafe 169 ptab.ports[0].s_port = cfg.c33_port; 170 ph->ptab = &ptab; 171 ph->ptab->nports = 1; 168 ph->ptab.nports = 1; 169 ph->ptab.ports[0].s_port = cfg.c33_port; 172 170 173 171 ph->desc="camd33"; -
trunk/module-camd35.c
r8411 r8455 917 917 void module_camd35(struct s_module *ph) 918 918 { 919 static PTAB ptab; //since there is always only 1 camd35 server running, this is threadsafe 920 ptab.ports[0].s_port = cfg.c35_port; 921 ph->ptab = &ptab; 922 ph->ptab->nports = 1; 919 ph->ptab.nports = 1; 920 ph->ptab.ports[0].s_port = cfg.c35_port; 923 921 924 922 ph->desc="camd35"; … … 949 947 ph->large_ecm_support = 1; 950 948 ph->listenertype = LIS_CAMD35TCP; 951 ph->ptab=&cfg.c35_tcp_ptab; 952 if (ph->ptab->nports==0) 953 ph->ptab->nports=1; // show disabled in log 949 ph->ptab = cfg.c35_tcp_ptab; 954 950 IP_ASSIGN(ph->s_ip, cfg.c35_tcp_srvip); 955 951 ph->s_handler=camd35_server; -
trunk/module-cccam.c
r8412 r8455 3807 3807 3808 3808 #ifdef MODULE_CCCSHARE 3809 static PTAB ptab; //since there is always only 1 cccam server running, this is threadsafe3810 memset(&ptab, 0, sizeof(PTAB));3811 3809 int32_t i; 3812 3810 for (i=0;i<CS_MAXPORTS;i++) { 3813 3811 if (!cfg.cc_port[i]) break; 3814 ptab.ports[i].s_port = cfg.cc_port[i]; 3815 ptab.nports++; 3816 } 3817 3818 ph->ptab = &ptab; 3812 ph->ptab.ports[i].s_port = cfg.cc_port[i]; 3813 ph->ptab.nports++; 3814 } 3819 3815 3820 3816 if (cfg.cc_port[0]) -
trunk/module-csp.c
r8362 r8455 148 148 void module_csp(struct s_module *ph) 149 149 { 150 static PTAB ptab; //since there is always only 1 csp server running, this is threadsafe 151 ptab.ports[0].s_port = cfg.csp_port; 152 ph->ptab = &ptab; 153 ph->ptab->nports = 1; 150 ph->ptab.nports = 1; 151 ph->ptab.ports[0].s_port = cfg.csp_port; 154 152 155 153 ph->desc="csp"; -
trunk/module-ghttp.c
r8445 r8455 259 259 void module_ghttp(struct s_module *ph) 260 260 { 261 static PTAB ptab; 262 // ptab.ports[0].s_port = cfg.ghttp_port; 263 ph->ptab = &ptab; 264 ph->ptab->nports = 0; 261 ph->ptab.nports = 0; 262 // ph->ptab.ports[0].s_port = cfg.ghttp_port; 265 263 266 264 ph->desc = "ghttp"; -
trunk/module-monitor.c
r8411 r8455 867 867 868 868 void module_monitor(struct s_module *ph){ 869 static PTAB ptab; //since there is always only 1 monitor running, this is threadsafe 870 ptab.ports[0].s_port = cfg.mon_port; 871 ph->ptab = &ptab; 872 ph->ptab->nports = 1; 869 ph->ptab.nports = 1; 870 ph->ptab.ports[0].s_port = cfg.mon_port; 873 871 ph->desc = "monitor"; 874 872 ph->type=MOD_CONN_UDP; -
trunk/module-newcamd.c
r8411 r8455 1459 1459 ph->recv=newcamd_recv; 1460 1460 ph->send_dcw=newcamd_send_dcw; 1461 ph->ptab=&cfg.ncd_ptab; 1462 if( ph->ptab->nports==0 ) 1463 ph->ptab->nports=1; // show disabled in log 1461 ph->ptab=cfg.ncd_ptab; 1464 1462 ph->c_init=newcamd_client_init; 1465 1463 ph->c_recv_chk=newcamd_recv_chk; -
trunk/module-pandora.c
r8411 r8455 256 256 257 257 void module_pandora(struct s_module *ph) { 258 static PTAB ptab; 259 ptab.ports[0].s_port = cfg.pand_port; 260 ph->ptab = &ptab; 261 ph->ptab->nports = 1; 258 ph->ptab.nports = 1; 259 ph->ptab.ports[0].s_port = cfg.pand_port; 262 260 ph->num = R_PANDORA; 263 261 -
trunk/module-radegast.c
r8341 r8455 238 238 void module_radegast(struct s_module *ph) 239 239 { 240 static PTAB ptab; //since there is always only 1 radegast server running, this is threadsafe 241 ptab.ports[0].s_port = cfg.rad_port; 242 ph->ptab = &ptab; 243 ph->ptab->nports = 1; 240 ph->ptab.nports = 1; 241 ph->ptab.ports[0].s_port = cfg.rad_port; 244 242 245 243 ph->desc="radegast"; -
trunk/oscam-client.c
r8411 r8455 142 142 (unsigned long)pthread_self(), usr, cs_inet_ntoa(cl->ip), buf, uniq); 143 143 if (client->failban & BAN_DUPLICATE) { 144 cs_add_violation_by_ip(ip, get_module(client)->ptab ->ports[client->port_idx].s_port, usr);144 cs_add_violation_by_ip(ip, get_module(client)->ptab.ports[client->port_idx].s_port, usr); 145 145 } 146 146 if (cfg.dropdups){ -
trunk/oscam-ecm.c
r8411 r8455 1277 1277 case 4: 1278 1278 // invalid (sfilter) 1279 if (!chk_sfilter(er, get_module(client)->ptab))1279 if (!chk_sfilter(er, &get_module(client)->ptab)) 1280 1280 er->rc = E_INVALID; 1281 1281 break; -
trunk/oscam-failban.c
r8360 r8455 80 80 void cs_add_violation(struct s_client *cl, char *info) { 81 81 struct s_module *module = get_module(cl); 82 cs_add_violation_by_ip(cl->ip, module->ptab ? module->ptab->ports[cl->port_idx].s_port : 0, info);82 cs_add_violation_by_ip(cl->ip, module->ptab.ports[cl->port_idx].s_port, info); 83 83 } -
trunk/oscam-net.c
r8402 r8455 367 367 int32_t scad = sizeof(cad), n; 368 368 struct s_client *cl; 369 struct s_port *port = &module->ptab ->ports[port_idx];369 struct s_port *port = &module->ptab.ports[port_idx]; 370 370 371 371 if (module->type==MOD_CONN_UDP) { -
trunk/oscam.c
r8450 r8455 989 989 for (k = 0; k < CS_MAX_MOD; k++) { 990 990 struct s_module *module = &modules[k]; 991 if ((module->type & MOD_CONN_NET) && module->ptab) {992 for (j = 0; j < module->ptab ->nports; j++) {993 if (module->ptab ->ports[j].fd) {991 if ((module->type & MOD_CONN_NET)) { 992 for (j = 0; j < module->ptab.nports; j++) { 993 if (module->ptab.ports[j].fd) { 994 994 cl_size = chk_resize_cllist(&pfd, &cl_list, cl_size, pfdcount); 995 995 cl_list[pfdcount] = NULL; 996 pfd[pfdcount].fd = module->ptab ->ports[j].fd;996 pfd[pfdcount].fd = module->ptab.ports[j].fd; 997 997 pfd[pfdcount++].events = POLLIN | POLLPRI | POLLHUP; 998 998 } … … 1066 1066 for (k = 0; k < CS_MAX_MOD; k++) { 1067 1067 struct s_module *module = &modules[k]; 1068 if ((module->type & MOD_CONN_NET) && module->ptab) {1069 for (j = 0; j < module->ptab ->nports; j++) {1070 if (module->ptab ->ports[j].fd && module->ptab->ports[j].fd == pfd[i].fd) {1068 if ((module->type & MOD_CONN_NET)) { 1069 for (j = 0; j < module->ptab.nports; j++) { 1070 if (module->ptab.ports[j].fd && module->ptab.ports[j].fd == pfd[i].fd) { 1071 1071 accept_connection(module, k, j); 1072 1072 } … … 1418 1418 for (i = 0; i < CS_MAX_MOD; i++) { 1419 1419 struct s_module *module = &modules[i]; 1420 if ((module->type & MOD_CONN_NET) && module->ptab) {1421 for (j = 0; j < module->ptab ->nports; j++) {1422 start_listener(module, &module->ptab ->ports[j]);1420 if ((module->type & MOD_CONN_NET)) { 1421 for (j = 0; j < module->ptab.nports; j++) { 1422 start_listener(module, &module->ptab.ports[j]); 1423 1423 } 1424 1424 }
Note:
See TracChangeset
for help on using the changeset viewer.