?? setgateway.c
字號:
#include "cgilib.h"int main(){ int i; htmlinput_struct htmlinputs[10]; int htmlinputcount; char localip[20],netmask[20]; unsigned long addr; //get the CGI request htmlinputcount=get_CGI_request(htmlinputs); if (!htmlinputcount) { html_message("error","set parameters error!"); exit(1); } else { printf("Content-type:text/html\n\n"); printf("<HTML>\n"); printf("<HEAD>\n"); printf("<TITLE>%s</TITLE>\n","message"); printf("</HEAD>\n"); printf("<BODY>\n"); for(i=0;i<htmlinputcount;i++) { if (!strcmp(htmlinputs[i].name,"localip")) { strcpy(localip,htmlinputs[i].value); printf("%s<BR>",localip); } if (!strcmp(htmlinputs[i].name,"netmask")) { strcpy(netmask,htmlinputs[i].value); printf("%s<BR>",netmask); } } printf("set successfully.<BR>"); } //write the ip data to /etc/config/start write_ip_to_file("/etc/config/start",localip,netmask); //save the ip data file to 0xffef0000 addr = 0xffef0000; erase_sector(addr); sleep(3); write_file_to_flash("/etc/config/start",addr); printf("</BODY>\n"); printf("</HTML>\n");}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -