Updates to Tomato RAF including NGINX && PHP
[tomato.git] / release / src / router / httpd / upnp.c
blob40902c587173a598d577cb8053ad6657d26c5a07
1 /*
3 Tomato Firmware
4 Copyright (C) 2006-2009 Jonathan Zarate
6 */
8 #include "tomato.h"
10 void asp_upnpinfo(int argc, char **argv)
12 if (nvram_get_int("upnp_enable")) {
13 f_write_string("/etc/upnp/info", "", 0, 0);
14 if (killall("miniupnpd", SIGUSR2) == 0) {
15 f_wait_notexists("/etc/upnp/info", 5);
18 web_puts("\nmupnp_data = '");
19 web_putfile("/etc/upnp/data.info", WOF_JAVASCRIPT);
20 web_puts("';\n");
24 void wo_upnp(char *url)
26 char s[256];
27 const char *proto;
28 const char *eport;
30 if (nvram_get_int("upnp_enable")) {
31 if (((proto = webcgi_get("remove_proto")) != NULL) && (*proto) &&
32 ((eport = webcgi_get("remove_eport")) != NULL) && (*eport)) {
33 sprintf(s, "%3s %6s\n", proto, eport);
34 f_write_string("/etc/upnp/delete", s, 0, 0);
35 if (killall("miniupnpd", SIGUSR2) == 0) {
36 f_wait_notexists("/etc/upnp/delete", 5);
40 common_redirect();