Changeset 11325
- Timestamp:
- 01/09/17 16:41:23 (7 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/module-webif.c
r11320 r11325 6854 6854 { 6855 6855 uint64_t node = 0x00; 6856 #if defined(MODULE_CCCAM) || defined(MODULE_CAMD35) || defined(MODULE_CAMD35_TCP) 6856 6857 struct s_module *module = (cl->reader ? &cl->reader->ph : get_module(cl)); 6858 #endif 6857 6859 #ifdef MODULE_CCCAM 6858 6860 if(module->num == R_CCCAM && cl->cc) -
trunk/oscam-conf-chk.c
r10977 r11325 470 470 } 471 471 472 473 void chk_port_camd35_tab(char *portasc, PTAB *ptab) 474 { 475 int32_t i, j, nfilts; 476 PTAB *newptab; 477 char *ptr1, *ptr2, *ptr4, *provids, *saveptr1, *saveptr2 = NULL; 478 if(!cs_malloc(&newptab, sizeof(PTAB))) 479 { return; } 480 481 for(nfilts = i = 0, ptr1 = strtok_r(portasc, ";", &saveptr1); (i < CS_MAXPORTS) && (ptr1); ptr1 = strtok_r(NULL, ";", &saveptr1), i++) 482 { 483 if(!newptab->ports[newptab->nports].ncd && !cs_malloc(&newptab->ports[i].ncd, sizeof(struct ncd_port))) 484 { break; } 485 newptab->ports[newptab->nports].s_port = atoi(ptr1); 486 if((ptr2 = strchr(trim(ptr1), '@'))) 487 { 488 *ptr2++ = '\0'; //clean up @ symbol 489 newptab->ports[newptab->nports].s_port = atoi(ptr1); 490 if((provids = strchr(trim(ptr2), ':'))) 491 { 492 *provids++ = '\0'; //clean up : symbol 493 for(j = 0, ptr4 = strtok_r(provids, ",", &saveptr2); (i < CS_MAXPORTS) && (ptr4); ptr4 = strtok_r(NULL, ",", &saveptr2), j++) 494 { 495 newptab->ports[newptab->nports].ncd->ncd_ftab.filts[0].prids[j] = a2i(ptr4, 6); 496 } 497 newptab->ports[newptab->nports].ncd->ncd_ftab.filts[0].nprids=j; 498 } 499 newptab->ports[newptab->nports].ncd->ncd_ftab.filts[0].caid = (uint16_t)a2i(ptr2, sizeof(ptr2)); 500 newptab->nports++; 501 } 502 else 503 { 504 newptab->ports[newptab->nports].s_port = atoi(ptr1); 505 if (newptab->ports[newptab->nports].s_port) { newptab->nports++; }; 506 } 507 nfilts++; 508 } 509 memcpy(ptab, newptab, sizeof(PTAB)); 510 NULLFREE(newptab); 511 } 512 472 513 void chk_ecm_whitelist(char *value, ECM_WHITELIST *ecm_whitelist) 473 514 { -
trunk/oscam-conf-chk.h
r10557 r11325 13 13 void chk_cltab(char *classasc, CLASSTAB *clstab); 14 14 void chk_port_tab(char *portasc, PTAB *ptab); 15 void chk_port_camd35_tab(char *portasc, PTAB *ptab); 15 16 void chk_ecm_whitelist(char *value, ECM_WHITELIST *ecm_whitelist); 16 17 void chk_ecm_hdr_whitelist(char *value, ECM_HDR_WHITELIST *ecm_hdr_whitelist); -
trunk/oscam-conf-mk.c
r11296 r11325 140 140 for(i = 0; i < cfg.c35_tcp_ptab.nports; ++i) 141 141 { 142 /* Port is maximally 5 chars long, plus the @caid , plus the ";" between ports */142 /* Port is maximally 5 chars long, plus the @caid (5), plus the ";" between ports */ 143 143 needed += 11; 144 if(cfg.c35_tcp_ptab.ports[i].ncd && cfg.c35_tcp_ptab.ports[i].ncd->ncd_ftab.filts[0].nprids > 1)144 if(cfg.c35_tcp_ptab.ports[i].ncd && cfg.c35_tcp_ptab.ports[i].ncd->ncd_ftab.filts[0].nprids > 0) 145 145 { 146 146 needed += cfg.c35_tcp_ptab.ports[i].ncd->ncd_ftab.filts[0].nprids * 7; … … 160 160 cfg.c35_tcp_ptab.ports[i].ncd->ncd_ftab.filts[0].caid); 161 161 162 if(cfg.c35_tcp_ptab.ports[i].ncd->ncd_ftab.filts[0].nprids > 1)162 if(cfg.c35_tcp_ptab.ports[i].ncd->ncd_ftab.filts[0].nprids > 0) 163 163 { 164 164 dot2 = ":"; 165 165 for(j = 0; j < cfg.c35_tcp_ptab.ports[i].ncd->ncd_ftab.filts[0].nprids; ++j) 166 166 { 167 pos += snprintf(value + pos, needed - (value - saveptr), "%s% X", dot2, cfg.c35_tcp_ptab.ports[i].ncd->ncd_ftab.filts[0].prids[j]);167 pos += snprintf(value + pos, needed - (value - saveptr), "%s%06X", dot2, cfg.c35_tcp_ptab.ports[i].ncd->ncd_ftab.filts[0].prids[j]); 168 168 dot2 = ","; 169 169 } … … 173 173 else 174 174 { 175 pos += snprintf(value + pos, needed - (value - saveptr), "%d", cfg.c35_tcp_ptab.ports[i].s_port); 175 pos += snprintf(value + pos, needed - (value - saveptr), "%s%d", dot1, cfg.c35_tcp_ptab.ports[i].s_port); 176 dot1 = ";"; 176 177 } 177 178 } -
trunk/oscam-config-global.c
r11303 r11325 678 678 #endif 679 679 680 #if defined(MODULE_CAMD35_TCP) || defined(MODULE_NEWCAMD) 681 #define PORTTAB_CS378X 1 682 #define PORTTAB_NEWCAMD 2 683 static void porttab_fn(const char *token, char *value, void *setting, long type, FILE *f) 680 #ifdef MODULE_NEWCAMD 681 static void porttab_fn(const char *token, char *value, void *setting, FILE *f) 684 682 { 685 683 PTAB *ptab = setting; … … 696 694 return; 697 695 } 698 value = (type == PORTTAB_CS378X) ? mk_t_camd35tcp_port() :mk_t_newcamd_port();696 value = mk_t_newcamd_port(); 699 697 fprintf_conf(f, token, "%s\n", value); 700 698 free_mk_t(value); 701 699 } 702 700 #endif 701 702 #ifdef MODULE_CAMD35_TCP 703 static void porttab_camd35_fn(const char *token, char *value, void *setting, FILE *f) 704 { 705 PTAB *ptab = setting; 706 if(value) 707 { 708 if(strlen(value) == 0) 709 { 710 clear_ptab(ptab); 711 } 712 else 713 { 714 chk_port_camd35_tab(value, ptab); 715 } 716 return; 717 } 718 value = mk_t_camd35tcp_port(); 719 fprintf_conf(f, token, "%s\n", value); 720 free_mk_t(value); 721 } 722 #endif 723 724 #if defined(MODULE_NEWCAMD) || defined(MODULE_CAMD35_TCP) 703 725 static void porttab_free_fn(void *setting) 704 726 { … … 716 738 { 717 739 DEF_OPT_SAVE_FUNC(cs378x_should_save_fn), 718 DEF_OPT_FUNC _X("port" , OFS(c35_tcp_ptab), porttab_fn, PORTTAB_CS378X, .free_value = porttab_free_fn),719 DEF_OPT_FUNC("serverip" , OFS(c35_tcp_srvip),serverip_fn),720 DEF_OPT_INT8("suppresscmd08" , OFS(c35_tcp_suppresscmd08), 740 DEF_OPT_FUNC("port" , OFS(c35_tcp_ptab) , porttab_camd35_fn , .free_value = porttab_free_fn), 741 DEF_OPT_FUNC("serverip" , OFS(c35_tcp_srvip) , serverip_fn), 742 DEF_OPT_INT8("suppresscmd08" , OFS(c35_tcp_suppresscmd08), 0), 721 743 DEF_LAST_OPT 722 744 }; … … 734 756 { 735 757 DEF_OPT_SAVE_FUNC(newcamd_should_save_fn), 736 DEF_OPT_FUNC _X("port" , OFS(ncd_ptab), porttab_fn, PORTTAB_NEWCAMD, .free_value = porttab_free_fn),737 DEF_OPT_FUNC("serverip" , OFS(ncd_srvip) ,serverip_fn),738 DEF_OPT_FUNC("allowed" , OFS(ncd_allowed) ,iprange_fn, .free_value = iprange_free_fn),739 DEF_OPT_HEX("key" , OFS(ncd_key),SIZEOF(ncd_key)),740 DEF_OPT_INT8("keepalive" , OFS(ncd_keepalive), 741 DEF_OPT_INT8("mgclient" , OFS(ncd_mgclient) ,0),758 DEF_OPT_FUNC("port" , OFS(ncd_ptab) , porttab_fn, .free_value = porttab_free_fn), 759 DEF_OPT_FUNC("serverip" , OFS(ncd_srvip) , serverip_fn), 760 DEF_OPT_FUNC("allowed" , OFS(ncd_allowed) , iprange_fn, .free_value = iprange_free_fn), 761 DEF_OPT_HEX("key" , OFS(ncd_key) , SIZEOF(ncd_key)), 762 DEF_OPT_INT8("keepalive" , OFS(ncd_keepalive), DEFAULT_NCD_KEEPALIVE), 763 DEF_OPT_INT8("mgclient" , OFS(ncd_mgclient) , 0), 742 764 DEF_LAST_OPT 743 765 }; -
trunk/webif/config/camd35tcp.html
r9799 r11325 3 3 <TABLE CLASS="config"> 4 4 <TR><TH COLSPAN="2">Edit Cs378x (Camd35 TCP) Config</TH></TR> 5 <TR><TD><A data-p="port_5">Port:</A></TD><TD> <input name="port" class="short" type="text" maxlength="5" value="##PORT##"></TD></TR>5 <TR><TD><A data-p="port_5">Port:</A></TD><TD>port[@CAID[:ident][,ident]...][;port[@CAID[:ident][,ident]...]]...<BR><textarea name="port" rows="8" class="bt" maxlength="512">##PORT##</textarea></TD></TR> 6 6 <TR><TD><A data-p="serverip_6">Serverip:</A></TD><TD><input name="serverip" class="medium" type="text" maxlength="15" value="##SERVERIP##"></TD></TR> 7 7 <TR><TD><A data-p="suppresscmd08_3">Suppress cmd08:</A></TD><TD><input name="suppresscmd08" type="checkbox" value="1" ##SUPPRESSCMD08TCP##><label></label></TD></TR>
Note:
See TracChangeset
for help on using the changeset viewer.