RT-AC66 3.0.0.4.374.130 core
[tomato.git] / release / src / router / httpd / tomato.h
blob4e7908b3221c163d68bd3e34a17e8f7bfc908670
1 /*
3 Tomato Firmware
4 Copyright (C) 2006-2009 Jonathan Zarate
6 */
8 #ifndef __TOMATO_H_
9 #define __TOMATO_H_
11 #include <stdio.h>
12 #include <stdlib.h>
13 #include <string.h>
14 #include <unistd.h>
15 #include <typedefs.h>
16 #include <syslog.h>
17 #include <signal.h>
19 #include <bcmutils.h>
20 #include <bcmnvram.h>
21 #include <utils.h>
22 #include <shutils.h>
23 #include <shared.h>
25 #include <tomato_profile.h>
26 #include <tomato_config.h>
29 #include "httpd.h"
32 // #define BLACKHOLE // for testing
35 extern int rboot;
37 extern void exec_service(const char *action);
38 extern void wi_generic(char *url, int len, char *boundary);
39 extern void common_redirect(void);
41 extern const char *resmsg_get(void);
42 extern void resmsg_set(const char *msg);
43 extern int resmsg_fread(const char *fname);
47 // nvram.c
48 extern void asp_nvram(int argc, char **argv);
49 extern void asp_nvramseq(int argc, char **argv);
50 extern void asp_nv(int argc, char **argv);
51 extern void asp_nvstat(int argc, char **argv);
53 // misc.c
54 extern char *js_string(const char *s);
55 extern char *html_string(const char *s);
56 extern char *unix_string(const char *s);
57 extern char *reltime(char *buf, time_t t);
58 extern int get_client_info(char *mac, char *ifname);
59 extern int resolve_addr(const char *ip, char *host);
61 extern void asp_lipp(int argc, char **argv);
62 extern void asp_activeroutes(int argc, char **argv);
63 extern void asp_cgi_get(int argc, char **argv);
64 extern void asp_time(int argc, char **argv);
65 extern void asp_wanup(int argc, char **argv);
66 extern void asp_wanstatus(int argc, char **argv);
67 extern void asp_link_uptime(int argc, char **argv);
68 extern void asp_link_starttime(int argc, char **argv);
69 extern void asp_rrule(int argc, char **argv);
70 extern void asp_compmac(int argc, char **argv);
71 extern void asp_ident(int argc, char **argv);
72 extern void asp_lanip(int argc, char **argv);
73 extern void asp_psup(int argc, char **argv);
74 #ifdef TCONFIG_OPENVPN
75 extern void wo_vpn_status(char *url);
76 #endif
77 extern void asp_sysinfo(int argc, char **argv);
78 extern void asp_jiffies(int argc, char **argv);
79 extern void asp_statfs(int argc, char **argv);
80 extern void asp_notice(int argc, char **argv);
81 extern void wo_wakeup(char *url);
82 extern void asp_dns(int argc, char **argv);
83 extern void wo_resolve(char *url);
84 extern void asp_etherstates(int argc, char **argv);
86 #ifdef TCONFIG_IPV6
87 extern void asp_calc6rdlocalprefix(int argc, char **argv);
88 #endif
90 // usb.c
91 #ifdef TCONFIG_USB
92 extern void asp_usbdevices(int argc, char **argv);
93 extern void wo_usbcommand(char *url);
94 #endif
96 //pptpd.c
97 #ifdef TCONFIG_PPTPD
98 extern void asp_pptpd_userol(int argc, char **argv);
99 extern void wo_pptpdcmd(char *url);
100 #endif
102 // devlist.c
103 extern void asp_arplist(int argc, char **argv);
104 extern void asp_devlist(int argc, char **argv);
106 // ctnf.c
107 extern void asp_ctcount(int argc, char **argv);
108 extern void asp_ctdump(int argc, char **argv);
109 extern void asp_ctrate(int argc, char **argv);
110 extern void asp_qrate(int argc, char **argv);
111 extern void asp_layer7(int argc, char **argv);
112 extern void wo_expct(char *url);
114 // wl.c
115 extern void asp_wlscan(int argc, char **argv);
116 extern void wo_wlradio(char *url);
117 extern void asp_wlnoise(int argc, char **argv);
118 extern void wo_wlmnoise(char *url);
119 extern void asp_wlstats(int argc, char **argv);
120 extern void asp_wlclient(int argc, char **argv);
121 extern void asp_wlchannels(int argc, char **argv);
122 extern void asp_wlbands(int argc, char **argv);
123 extern void asp_wlifaces(int argc, char **argv);
124 extern void asp_wlcountries(int argc, char **argv);
126 // dhcp.c
127 extern void asp_dhcpc_time(int argc, char **argv);
128 extern void wo_dhcpd(char *url);
129 extern void wo_dhcpc(char *url);
131 // version.c
132 extern void asp_build_time(int argc, char **argv);
133 extern void asp_version(int argc, char **argv);
135 // traceping.c
136 extern void wo_trace(char *url);
137 extern void wo_ping(char *url);
139 // log.c
140 extern void wo_viewlog(char *url);
141 extern void wo_syslog(char *url);
142 extern void asp_webmon(int argc, char **argv);
143 extern void wo_webmon(char *url);
145 // ddns.c
146 extern void asp_ddnsx(int argc, char **argv);
147 extern void asp_ddnsx_ip(int argc, char **argv);
148 extern void asp_ddnsx_msg(int argc, char **argv);
150 // upgrade.c
151 extern void prepare_upgrade(void);
152 extern void wi_upgrade(char *url, int len, char *boundary);
153 extern void wo_flash(char *url);
155 // config.c
156 extern void wo_backup(char *url);
157 extern void wi_restore(char *url, int len, char *boundary);
158 extern void wo_restore(char *url);
159 extern void wo_defaults(char *url);
161 // parser.c
162 extern void wo_asp(char *path);
164 // blackhole.c
165 extern void wi_blackhole(char *url, int len, char *boundary);
167 // upnp.c
168 extern void asp_upnpinfo(int argc, char **argv);
169 extern void wo_upnp(char *url);
171 // bwm.c
172 extern void wo_bwmbackup(char *url);
173 extern void wi_bwmrestore(char *url, int len, char *boundary);
174 extern void wo_bwmrestore(char *url);
175 extern void asp_netdev(int argc, char **argv);
176 extern void asp_bandwidth(int argc, char **argv);
177 extern void ctvbuf(FILE *f);
179 extern void wo_iptbackup(char *url);
180 extern void wi_iptrestore(char *url, int len, char *boundary);
181 extern void wo_iptrestore(char *url);
183 extern void asp_ipt_bandwidth(int argc, char **argv);
184 extern void asp_iptmon(int argc, char **argv);
185 extern void asp_iptraffic(int argc, char **argv);
187 #ifdef TCONFIG_NOCAT
188 // nocat.c
189 extern void wi_uploadsplash(char *url, int len, char *boundary);
190 extern void wo_uploadsplash(char *url);
191 #endif
193 #if TOMATO_SL
194 // share.c
195 extern void asp_sharelist(int argc, char **argv);
196 extern void wo_umount(char *url);
197 extern void wo_usb(char *url);
198 #endif
200 // utf8.c
201 extern char *utf8_to_js_string(const char *ins);
202 extern char *utf8_to_html_string(const char *ins);
204 #endif