Changeset 5060 for trunk/oscam-config.c
- Timestamp:
- 04/20/11 18:58:14 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/oscam-config.c
r5059 r5060 328 328 } 329 329 330 void chk_cccam_ports(char *value) 331 { 332 int32_t i; 333 char *ptr; 334 335 memset(cfg.cc_port, 0, sizeof(cfg.cc_port)); 336 337 for (i=0, ptr=strtok(value, ","); ptr && i<CS_MAXPORTS; ptr=strtok(NULL, ",")) { 338 cfg.cc_port[i] = atoi(ptr); 339 if (cfg.cc_port[i]) i++; 340 } 341 } 342 330 343 #ifdef NOTUSED 331 344 static void chk_srvip(char *value, in_addr_t *ip) … … 1020 1033 { 1021 1034 if (!strcmp(token, "port")) { 1022 c fg.cc_port = strToIntVal(value, 0);1035 chk_cccam_ports(value); 1023 1036 return; 1024 1037 } … … 2010 2023 2011 2024 /*cccam*/ 2012 if ( cfg.cc_port > 0) {2025 if ( cfg.cc_port[0] > 0) { 2013 2026 fprintf(f,"[cccam]\n"); 2014 fprintf_conf(f, CONFVARWIDTH, "port", "%d\n", cfg.cc_port); 2027 value = mk_t_cccam_port(); 2028 fprintf_conf(f, CONFVARWIDTH, "port", "%s\n", value); 2029 free_mk_t(value); 2030 2015 2031 if(cfg.cc_reshare != 10 || cfg.http_full_cfg) 2016 2032 fprintf_conf(f, CONFVARWIDTH, "reshare", "%d\n", cfg.cc_reshare); … … 4368 4384 4369 4385 /* 4386 * Creates a string ready to write as a token into config or WebIf for the cccam tcp ports. You must free the returned value through free_mk_t(). 4387 */ 4388 char *mk_t_cccam_port(){ 4389 int32_t i, pos = 0, needed = CS_MAXPORTS*6+8; 4390 4391 char *value; 4392 if(!cs_malloc(&value, needed * sizeof(char), -1)) return ""; 4393 char *dot = ""; 4394 for(i = 0; i < CS_MAXPORTS; i++) { 4395 if (!cfg.cc_port[i]) break; 4396 4397 pos += snprintf(value + pos, needed-pos, "%s%d", dot, cfg.cc_port[i]); 4398 dot=","; 4399 } 4400 return value; 4401 } 4402 4403 4404 /* 4370 4405 * Creates a string ready to write as a token into config or WebIf for AESKeys. You must free the returned value through free_mk_t(). 4371 4406 */
Note:
See TracChangeset
for help on using the changeset viewer.