Changeset 1611 for branches/monitor-improvement/oscam-http.c
- Timestamp:
- 02/18/10 22:11:09 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/monitor-improvement/oscam-http.c
r1605 r1611 67 67 tpl_printf(vars, 1, "MESSAGE", "Parameter: %s set to Value: %s<BR>\n", (*params).params[i], (*params).values[i]); 68 68 //we use the same function as used for parsing the config tokens 69 69 70 chk_t_global((*params).params[i], (*params).values[i]); 70 71 } … … 74 75 else tpl_addVar(vars, 1, "MESSAGE", "<B>Write Config failed</B><BR><BR>"); 75 76 } 76 tpl_addVar(vars, 0, "SERVERIP", inet_ntoa(*(struct in_addr *)&cfg->srvip)); 77 if (cfg->srvip != 0) 78 tpl_addVar(vars, 0, "SERVERIP", inet_ntoa(*(struct in_addr *)&cfg->srvip)); 77 79 if (cfg->pidfile != NULL) tpl_addVar(vars, 0, "PIDFILE", cfg->pidfile); 78 80 if (cfg->usrfile != NULL) tpl_addVar(vars, 0, "USERFILE", cfg->usrfile); … … 117 119 } 118 120 tpl_printf(vars, 0, "PORT", "%d", cfg->c33_port); 119 tpl_addVar(vars, 0, "SERVERIP", inet_ntoa(*(struct in_addr *)&cfg->c33_srvip)); 121 if (cfg->c33_srvip != 0) 122 tpl_addVar(vars, 0, "SERVERIP", inet_ntoa(*(struct in_addr *)&cfg->c33_srvip)); 120 123 tpl_printf(vars, 0, "PASSIVE", "%d", cfg->c33_passive); 121 124 … … 147 150 } 148 151 tpl_printf(vars, 0, "PORT", "%d", cfg->c35_port); 149 tpl_addVar(vars, 1, "SERVERIP", inet_ntoa(*(struct in_addr *)&cfg->c35_tcp_srvip)); 152 if (cfg->c35_tcp_srvip != 0) 153 tpl_addVar(vars, 1, "SERVERIP", inet_ntoa(*(struct in_addr *)&cfg->c35_tcp_srvip)); 150 154 151 155 if (cfg->c35_suppresscmd08) … … 188 192 } 189 193 } 190 tpl_addVar(vars, 1, "SERVERIP", inet_ntoa(*(struct in_addr *)&cfg->c35_tcp_srvip)); 194 if (cfg->c35_tcp_srvip != 0) 195 tpl_addVar(vars, 1, "SERVERIP", inet_ntoa(*(struct in_addr *)&cfg->c35_tcp_srvip)); 191 196 192 197 fputs(tpl_getTpl(vars, "CONFIGCAMD35TCP"), f); … … 211 216 else tpl_addVar(vars, 1, "MESSAGE", "<B>Write Config failed</B><BR><BR>"); 212 217 } 213 int j; 214 char *dot1, *dot2; 215 if ((cfg->ncd_ptab.nports > 0) && (cfg->ncd_ptab.ports[0].s_port > 0)){ 216 dot1 = ""; 217 for(i = 0; i < cfg->ncd_ptab.nports; ++i){ 218 tpl_printf(vars, 1, "PORT", "%s%d@%04X", dot1, cfg->ncd_ptab.ports[i].s_port, cfg->ncd_ptab.ports[i].ftab.filts[0].caid); 219 if (cfg->ncd_ptab.ports[i].ftab.filts[0].nprids > 0){ 220 tpl_printf(vars, 1, "PORT", ":"); 221 dot2 = ""; 222 for (j = 0; j < cfg->ncd_ptab.ports[i].ftab.filts[0].nprids; ++j){ 223 tpl_printf(vars, 1, "PORT", "%s%06X", dot2, cfg->ncd_ptab.ports[i].ftab.filts[0].prids[j]); 224 dot2 = ","; 225 } 218 int j; 219 char *dot1, *dot2; 220 if ((cfg->ncd_ptab.nports > 0) && (cfg->ncd_ptab.ports[0].s_port > 0)){ 221 dot1 = ""; 222 for(i = 0; i < cfg->ncd_ptab.nports; ++i){ 223 tpl_printf(vars, 1, "PORT", "%s%d@%04X", dot1, cfg->ncd_ptab.ports[i].s_port, cfg->ncd_ptab.ports[i].ftab.filts[0].caid); 224 if (cfg->ncd_ptab.ports[i].ftab.filts[0].nprids > 0){ 225 tpl_printf(vars, 1, "PORT", ":"); 226 dot2 = ""; 227 for (j = 0; j < cfg->ncd_ptab.ports[i].ftab.filts[0].nprids; ++j){ 228 tpl_printf(vars, 1, "PORT", "%s%06X", dot2, cfg->ncd_ptab.ports[i].ftab.filts[0].prids[j]); 229 dot2 = ","; 226 230 } 227 dot1=";"; 228 } 229 } 230 231 tpl_addVar(vars, 0, "SERVERIP", inet_ntoa(*(struct in_addr *)&cfg->ncd_srvip)); 231 } 232 dot1=";"; 233 } 234 } 235 236 if (cfg->ncd_srvip != 0) 237 tpl_addVar(vars, 0, "SERVERIP", inet_ntoa(*(struct in_addr *)&cfg->ncd_srvip)); 232 238 for (i=0;i<14;i++) tpl_printf(vars, 1, "KEY", "%02X", cfg->ncd_key[i]); 233 239 … … 235 241 char *dot=""; 236 242 for (cip = cfg->ncd_allowed; cip; cip = cip->next){ 237 238 243 tpl_printf(vars, 1, "ALLOWED", "%s%s", dot, cs_inet_ntoa(cip->ip[0])); 244 if (cip->ip[0] != cip->ip[1]) tpl_printf(vars, 1, "ALLOWED", "-%s", cs_inet_ntoa(cip->ip[1])); 239 245 dot=","; 240 246 } … … 264 270 } 265 271 tpl_printf(vars, 0, "PORT", "%d", cfg->rad_port); 266 tpl_addVar(vars, 0, "SERVERIP", inet_ntoa(*(struct in_addr *)&cfg->rad_srvip)); 272 if (cfg->rad_srvip != 0) 273 tpl_addVar(vars, 0, "SERVERIP", inet_ntoa(*(struct in_addr *)&cfg->rad_srvip)); 267 274 tpl_addVar(vars, 0, "USER", cfg->rad_usr); 268 275 … … 347 354 } 348 355 tpl_printf(vars, 0, "MONPORT", "%d", cfg->mon_port); 349 tpl_addVar(vars, 0, "SERVERIP", inet_ntoa(*(struct in_addr *)&cfg->mon_srvip)); 356 if (cfg->mon_srvip != 0) 357 tpl_addVar(vars, 0, "SERVERIP", inet_ntoa(*(struct in_addr *)&cfg->mon_srvip)); 350 358 tpl_printf(vars, 0, "AULOW", "%d", cfg->mon_aulow); 351 359 tpl_printf(vars, 0, "HIDECLIENTTO", "%d", cfg->mon_hideclient_to);
Note:
See TracChangeset
for help on using the changeset viewer.