Changeset 1046
- Timestamp:
- 01/03/10 15:46:29 (12 years ago)
- Location:
- branches/monitor-improvement
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/monitor-improvement/globals.h
r1044 r1046 672 672 void create_rand_str(char *dst, int size); 673 673 int file_exists(const char * filename); 674 void clear_sip(struct s_ip **sip); 674 675 675 676 // oscam variables -
branches/monitor-improvement/oscam-config.c
r1044 r1046 70 70 void chk_iprange(char *value, struct s_ip **base) 71 71 { 72 //int i;72 int i = 0; 73 73 char *ptr1, *ptr2; 74 74 struct s_ip *lip, *cip; … … 89 89 for (ptr1=strtok(value, ","); ptr1; ptr1=strtok(NULL, ",")) 90 90 { 91 if (i == 0) ++i; 92 else { 93 if (!(cip=malloc(sizeof(struct s_ip)))){ 94 fprintf(stderr, "Error allocating memory (errno=%d)\n", errno); 95 exit(1); 96 } 97 lip->next = cip; 98 memset(cip, 0, sizeof(struct s_ip)); 99 } 91 100 if( (ptr2=strchr(trim(ptr1), '-')) ) 92 101 { … … 97 106 else 98 107 cip->ip[0]=cip->ip[1]=cs_inet_addr(ptr1); 108 lip = cip; 99 109 } 100 110 } -
branches/monitor-improvement/oscam-http.c
r1044 r1046 95 95 if ((strcmp((*params).params[i], "part")) && (strcmp((*params).params[i], "action"))){ 96 96 tpl_printf(vars, 1, "MESSAGE", "Parameter: %s set to Value: %s<BR>\n", (*params).params[i], (*params).values[i]); 97 if (strcmp((*params).params[i], "nocrypt") == 0){ 98 clear_sip(&cfg->c33_plain); 99 } 97 100 //we use the same function as used for parsing the config tokens 98 101 chk_t_camd33((*params).params[i], (*params).values[i]); … … 109 112 struct s_ip *cip; 110 113 char *dot=""; 111 for (cip = cfg-> rad_allowed; cip; cip = cip->next){112 tpl_printf(vars, 1, "NOCRYPT", "%s%s", dot, inet_ntoa(*(struct in_addr *)&cip->ip[0]));113 if (cip->ip[0] == cip->ip[1]) tpl_printf(vars, 1, "NOCRYPT", "-%s", inet_ntoa(*(struct in_addr *)&cip->ip[1]));114 for (cip = cfg->c33_plain; cip; cip = cip->next){ 115 tpl_printf(vars, 1, "NOCRYPT", "%s%s", dot, cs_inet_ntoa(cip->ip[0])); 116 if (cip->ip[0] != cip->ip[1]) tpl_printf(vars, 1, "NOCRYPT", "-%s", cs_inet_ntoa(cip->ip[1])); 114 117 dot=","; 115 118 } … … 179 182 if ((strcmp((*params).params[i], "part")) && (strcmp((*params).params[i], "action"))){ 180 183 tpl_printf(vars, 1, "MESSAGE", "Parameter: %s set to Value: %s<BR>\n", (*params).params[i], (*params).values[i]); 184 if (strcmp((*params).params[i], "allowed") == 0){ 185 clear_sip(&cfg->rad_allowed); 186 } 181 187 //we use the same function as used for parsing the config tokens 182 188 chk_t_radegast((*params).params[i], (*params).values[i]); … … 193 199 char *dot=""; 194 200 for (cip=cfg->rad_allowed; cip; cip=cip->next){ 195 tpl_printf(vars, 1, "ALLOWED", "%s%s", dot, inet_ntoa(*(struct in_addr *)&cip->ip[0]));196 if (cip->ip[0] == cip->ip[1]) tpl_printf(vars, 1, "ALLOWED", "-%s", inet_ntoa(*(struct in_addr *)&cip->ip[1]));201 tpl_printf(vars, 1, "ALLOWED", "%s%s", dot, cs_inet_ntoa(cip->ip[0])); 202 if (cip->ip[0] != cip->ip[1]) tpl_printf(vars, 1, "ALLOWED", "-%s", cs_inet_ntoa(cip->ip[1])); 197 203 dot=","; 198 204 } … … 249 255 if ((strcmp((*params).params[i], "part")) && (strcmp((*params).params[i], "action"))){ 250 256 tpl_printf(vars, 1, "MESSAGE", "Parameter: %s set to Value: %s<BR>\n", (*params).params[i], (*params).values[i]); 257 if (strcmp((*params).params[i], "nocrypt") == 0){ 258 clear_sip(&cfg->mon_allowed); 259 } 251 260 //we use the same function as used for parsing the config tokens 252 261 chk_t_monitor((*params).params[i], (*params).values[i]); … … 271 280 char *dot=""; 272 281 for (cip = cfg->mon_allowed; cip; cip = cip->next){ 273 tpl_printf(vars, 1, "NOCRYPT", "%s%s", dot, inet_ntoa(*(struct in_addr *)&cip->ip[0]));274 if (cip->ip[0] == cip->ip[1]) tpl_printf(vars, 1, "NOCRYPT", "-%s", inet_ntoa(*(struct in_addr *)&cip->ip[1]));282 tpl_printf(vars, 1, "NOCRYPT", "%s%s", dot, cs_inet_ntoa(cip->ip[0])); 283 if (cip->ip[0] != cip->ip[1]) tpl_printf(vars, 1, "NOCRYPT", "-%s", cs_inet_ntoa(cip->ip[1])); 275 284 dot=","; 276 285 } -
branches/monitor-improvement/oscam-http.h
r1041 r1046 484 484 <TR><TD>Port:</TD><TD><input name=\"port\" type=\"text\" size=\"5\" maxlength=\"5\" value=\"##MONPORT##\"></TD></TR>\n\ 485 485 <TR><TD>Serverip:</TD><TD><input name=\"serverip\" type=\"text\" size=\"30\" maxlength=\"30\" value=\"##SERVERIP##\"></TD></TR>\n\ 486 <TR><TD>Nocrypt:</TD><TD><input name=\"nocrypt\" type=\"text\" size=\"50\" maxlength=\"50\" value=\"##NOCRYPT##\"> wrong, see Ticket #265</TD></TR>\n\486 <TR><TD>Nocrypt:</TD><TD><input name=\"nocrypt\" type=\"text\" size=\"50\" maxlength=\"50\" value=\"##NOCRYPT##\"></TD></TR>\n\ 487 487 <TR><TD>Aulow:</TD><TD><input name=\"aulow\" type=\"text\" size=\"5\" maxlength=\"1\" value=\"##AULOW##\"></TD></TR>\n\ 488 488 <TR>\n\ … … 522 522 <TR><TD>Port:</TD><TD><input name=\"port\" type=\"text\" size=\"5\" maxlength=\"5\" value=\"##PORT##\"></TD></TR>\n\ 523 523 <TR><TD>Serverip:</TD><TD><input name=\"serverip\" type=\"text\" size=\"30\" maxlength=\"30\" value=\"##SERVERIP##\"></TD></TR>\n\ 524 <TR><TD>Allowed:</TD><TD><input name=\"allowed\" type=\"text\" size=\"50\" maxlength=\"50\" value=\"##ALLOWED##\"> wrong, see Ticket #265</TD></TR>\n\524 <TR><TD>Allowed:</TD><TD><input name=\"allowed\" type=\"text\" size=\"50\" maxlength=\"50\" value=\"##ALLOWED##\"></TD></TR>\n\ 525 525 <TR><TD>User:</TD><TD><input name=\"user\" type=\"text\" size=\"30\" maxlength=\"30\" value=\"##USER##\"></TD></TR>\n\ 526 526 <TR><TD colspan=\"2\" align=\"right\"><input type=\"submit\" value=\"OK\">\n</TD></TR>\n\ … … 600 600 <TR><TD>Key:</TD><TD><input name=\"key\" type=\"text\" size=\"35\" maxlength=\"28\" value=\"##KEY##\"></TD></TR>\n\ 601 601 <TR><TD>Passive:</TD><TD><input name=\"passive\" type=\"text\" size=\"3\" maxlength=\"1\" value=\"##PASSIVE##\"></TD></TR>\n\ 602 <TR><TD>Nocrypt:</TD><TD><input name=\"nocrypt\" type=\"text\" size=\"50\" maxlength=\"50\" value=\"##NOCRYPT##\"> wrong, see Ticket #265</TD></TR>\n\602 <TR><TD>Nocrypt:</TD><TD><input name=\"nocrypt\" type=\"text\" size=\"50\" maxlength=\"50\" value=\"##NOCRYPT##\"></TD></TR>\n\ 603 603 <TR><TD colspan=\"2\" align=\"right\"><input type=\"submit\" value=\"OK\">\n</TD></TR>\n\ 604 604 </TABLE>\n\ -
branches/monitor-improvement/oscam-simples.c
r1024 r1046 467 467 return 0; 468 468 } 469 470 void clear_sip(struct s_ip **sip){ 471 struct s_ip *cip = *sip, *lip; 472 for (*sip = NULL; cip != NULL; cip = lip){ 473 lip = cip->next; 474 free(cip); 475 } 476 }
Note:
See TracChangeset
for help on using the changeset viewer.