找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
广告投放联系QQ68610888
查看: 10517|回复: 25

分析Padavan源代码,二

[复制链接]
发表于 2017-4-21 18:10 | 显示全部楼层 |阅读模式
本帖最后由 lostlonger 于 2017-4-21 20:04 编辑

接着上回说:https://www.right.com.cn/forum/thread-212972-1-1.html
rc的init过程:
rc.c 里的main()函数里,如果是执行的程序是init,会执行到这:init_main_loop()//代码在init.c

/* Basic initialization */
init_time();//设置时间
system("dev_init.sh")//这句会执行/sbin/dev_init.sh ,dev_init.sh又会执行/sbin/mtd_storage.sh 建立各大种脚本, //,执行 启动脚本-初始化,就是自定义设置-》脚本-》[url=]在路由器初始化前执行:[/url]
init_nodes();//建立设备节点
init_mdev();//安装设备驱动,/etc/mdev.conf是从重建的,哈哈,
....
init_router(); //这是一个重要函数,启动路由的各个服务(就是各个程疗啦,代码位于rc.c) //把各种服务启动后,会执行启动后脚本,就是自定义设置-》脚本-》[url=]在路由器启动后执行:[/url]
                                                      //所以,要自己加一个新的程序能开机就启动,要在这里面加代码哦,或者写在启动后执行的脚本里。。。。。。。
下面进入信号的处理,init进程变成一个后台 通知服务,处理各种通知

还是科普下linux的信号处理机制:《深入理解linux内核》里讲的有:

特定的事件都是有定义的,具体的百度下,本RC里用的,主要是两个:SIGUSR1(这个是用户自定义的)和SIGALRM(定时信号,用于与硬件相关操作)

在shared/notify_rc.c里,是所有产生通知的地方,会在"/tmp/rc_notification" "/tmp/rc_action_incomplete" 这两个文件夹,建立通知名称,然后用kill(1, SIGUSR1);通知/init 程序执行信号处理(init的pid=1,内核启动后启动的第一个程序)
看init.c里信号处理主循环的代码:
                if (sig_usr1_received) {
                        sig_usr1_received = 0;
                        handle_notifications();
                }
                if (sig_alrm_received) {
                        sig_alrm_received = 0;
#if defined (USE_USB_SUPPORT) || defined (USE_STORAGE)
                        on_deferred_hotplug_dev();
#endif

如果是一些通知,发送kill(1, SIGUSR1)过来的,会执行handle_notifications();//一个超长超多if...elseif...else,里面就是各个通知怎么处理啦
如果支持USB,有定时信号(像由handle_notifications()也会产生些,看代码nvram_set_int_temp("usb_hotplug_md", 1);alarm(5);)alarm()这个函数,会触发SIGALRM信号。
所以,绕来绕去,又到了rc里了。


很多人想加功能么,首先要这个程序本身能运行,对吧,都不能运行肯定就不行啦,我们想要的,是要能更方便的修改这个程疗的参数。这就是网页端存在的理由。
这个网页端的每个页面,都是表单与提交表单,
响应的页面start_apply.htm吧。最行,都执行了这三个函数:
<% update_variables(); %>//更新参数,会执行user\httpd\web_ex.c里的update_variables_ex()
<% asus_nvram_commit(); %>//更新nvram
<% notify_services(); %>//通知相应服务重启,这里也绕到rc的init的信号处理啦。
如果要自己新增功能,要在参数里加你程序需 要的参数,最后,加相应的通知,和通知相关的处理函数。
也有另一种做法,新增的程序,功能是执行一个脚本,然后从脚本时启动你想要的功能和程序。。。。。你以后想改,只需要改这个脚本就行,更有扩展性,对不对,感觉有点像宏内核与微内核的关系。

有时间,我来增加迅雷下载演示一下怎么加一个全新的功能。还有设置页面,

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

×

评分

参与人数 1恩山币 +1 收起 理由
q623928815 + 1 感谢你的分享,无论怎样,你都是最无私的人!来,说说,你E盘上还有啥一起给我吧!

查看全部评分

我的恩山、我的无线 The best wifi forum is right here.
发表于 2017-4-21 18:29 | 显示全部楼层
楼主,请教你一下,我在防火墙 - 通用设置(Advanced_BasicFirewall_Content.asp)添加了2个开关,用脚本触发,功能正常,但是我想把这2个开关添加到自定义设置 - 按钮/LED(Advanced_Tweaks_Content.asp)这个页面里,2个开关都不能用,这个是啥原因呢?

注——同样的代码添加的


本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

×
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

 楼主| 发表于 2017-4-21 19:02 | 显示全部楼层
nns 发表于 2017-4-21 18:29
楼主,请教你一下,我在防火墙 - 通用设置(Advanced_BasicFirewall_Content.asp)添加了2个开关,用脚本触 ...

你是指网页前端没反应,还是不能更新值?
如果是前端,注意看看改这里没?
var $j = jQuery.noConflict();

$j(document).ready(function() {
        init_itoggle('fw_enable_x', firewall_changed);
        init_itoggle('fw_dos_x');
        init_itoggle('fw_syn_cook');
        init_itoggle('misc_ping_x');
        init_itoggle('misc_http_x', http_wopen_changed);
        init_itoggle('https_wopen', https_wopen_changed);
        init_itoggle('sshd_wopen', sshd_wopen_changed);
        init_itoggle('ftpd_wopen', ftpd_wopen_changed);
        init_itoggle('udpxy_wopen', udpxy_wopen_changed);
        init_itoggle('trmd_ropen');
        init_itoggle('aria_ropen');
});

如果后端,有相应的执行函数没?
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2017-4-21 19:17 | 显示全部楼层
lostlonger 发表于 2017-4-21 19:02
你是指网页前端没反应,还是不能更新值?
如果是前端,注意看看改这里没?
var $j = jQuery.noConflict ...

init_itoggle我定义了的。
代码添加在Advanced_BasicFirewall_Content.asp里面,功能完全正常,但是同样的代码(包括 init_itoggle等),添加到Advanced_Tweaks_Content.asp里面,就不行,找不到原因啊,楼主请帮忙!!


添加到Advanced_Tweaks_Content.asp里,有这个开关图标,但是根本打不开它




本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

×
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2017-4-21 19:22 | 显示全部楼层


图截大些

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

×
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

 楼主| 发表于 2017-4-21 20:07 | 显示全部楼层

没有定 id 属性
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

 楼主| 发表于 2017-4-21 20:13 | 显示全部楼层
nns 发表于 2017-4-21 19:17
init_itoggle我定义了的。
代码添加在Advanced_BasicFirewall_Content.asp里面,功能完全正常,但是同 ...

https://www.right.com.cn/forum/f ... 3D&noupdate=yes
定义这两个函数没哦:
mproxy_wopen_changer
kms_wopen_changed
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2017-4-21 20:20 | 显示全部楼层
lostlonger 发表于 2017-4-21 20:13
https://www.right.com.cn/forum/forum.php?mod=attachment&aid=MTYwMzAxfDgyOTg4ZjY0fDE0OTI3NzY2NzB8MjI ...

都定义了啊,上述所有代码全部添加到Advanced_Tweaks_Content.asp里面,打死不能用,简直找不到原因





本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

×
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

 楼主| 发表于 2017-4-21 20:23 | 显示全部楼层
nns 发表于 2017-4-21 20:20
都定义了啊,上述所有代码全部添加到Advanced_Tweaks_Content.asp里面,打死不能用,简直找不到原因


...

整个页面代码丢过来看看吧,
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2017-4-21 20:24 | 显示全部楼层
lostlonger 发表于 2017-4-21 20:23
整个页面代码丢过来看看吧,

我只有复制了哈,可能格式很乱
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2017-4-21 20:25 | 显示全部楼层
本帖最后由 nns 于 2017-4-21 20:37 编辑

<!DOCTYPE html>
<html>
<head>
<title><#Web_Title#> - <#menu5_5_1#></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Expires" content="-1">
<link rel="shortcut icon" href="images/favicon.ico">
<link rel="icon" href="images/favicon.png">
<link rel="stylesheet" type="text/css" href="/bootstrap/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="/bootstrap/css/main.css">
<link rel="stylesheet" type="text/css" href="/bootstrap/css/engage.itoggle.css">
<script type="text/javascript" src="/jquery.js"></script>
<script type="text/javascript" src="/bootstrap/js/bootstrap.min.js"></script>
<script type="text/javascript" src="/bootstrap/js/engage.itoggle.min.js"></script>
<script type="text/javascript" src="/state.js"></script>
<script type="text/javascript" src="/general.js"></script>
<script type="text/javascript" src="/itoggle.js"></script>
<script type="text/javascript" src="/popup.js"></script>
<script type="text/javascript" src="/help.js"></script>
<script>
var $j = jQuery.noConflict();
$j(document).ready(function() {
init_itoggle('fw_enable_x', firewall_changed);
init_itoggle('fw_dos_x');
init_itoggle('fw_syn_cook');
init_itoggle('misc_ping_x');
init_itoggle('misc_http_x', http_wopen_changed);
init_itoggle('https_wopen', https_wopen_changed);
init_itoggle('sshd_wopen', sshd_wopen_changed);
init_itoggle('ftpd_wopen', ftpd_wopen_changed);
init_itoggle('udpxy_wopen', udpxy_wopen_changed);
init_itoggle('mproxy_wopen', mproxy_wopen_changed);
init_itoggle('kms_wopen', kms_wopen_changed);
init_itoggle('trmd_ropen');
init_itoggle('aria_ropen');
});
</script>
<script>
var http_proto = '<% nvram_get_x("", "http_proto"); %>';
function initial(){
show_banner(1);
show_menu(5,5,1);
show_footer();
load_body();
firewall_changed();
if(found_app_sshd()){
  $("row_sshd").style.display = "";
  sshd_wopen_changed();
}
if(found_app_ftpd()){
  $("row_ftpd_wopen").style.display = "";
  if (sw_mode != "4")
   ftpd_wopen_changed();
}
if (sw_mode != "4")
  udpxy_wopen_changed();
  
if (sw_mode != "4")
  mproxy_wopen_changed();
  
if (sw_mode != "4")
  kms_wopen_changed();
if(found_app_torr())
  $("row_torrent").style.display = "";
if(found_app_aria())
  $("row_aria").style.display = "";
if (support_http_ssl()){
  if (http_proto == "0" || http_proto == "2"){
   if (sw_mode != "4")
    http_wopen_changed();
  }else{
   $("row_http_wopen").style.display = "none";
  }
  if (http_proto == "1" || http_proto == "2"){
   $("row_https_wopen").style.display = "";
   if (sw_mode != "4")
    https_wopen_changed();
  }
}else{
  if (sw_mode != "4")
   http_wopen_changed();
}
}
function applyRule(){
if(validForm()){
  showLoading();
  
  document.form.action_mode.value = " Apply ";
  document.form.current_page.value = "/Advanced_BasicFirewall_Content.asp";
  document.form.next_page.value = "";
  
  document.form.submit();
}
}
function validForm(){
if (sw_mode == '4')
  return true;
if (support_http_ssl()){
  if (http_proto == "0" || http_proto == "2"){
   if(!validate_range(document.form.misc_httpport_x, 80, 65535))
    return false;
  }
  if (http_proto == "1" || http_proto == "2"){
   if(!validate_range(document.form.https_wport, 81, 65535))
    return false;
  }
  if (http_proto == "2"){
   if (document.form.misc_httpport_x.value == document.form.https_wport.value){
    alert("HTTP and HTTPS ports is equal!");
    document.form.https_wport.focus();
    document.form.https_wport.select();
    return false;
   }
  }
}else{
  if(!validate_range(document.form.misc_httpport_x, 80, 65535))
   return false;
}
if(!validate_range(document.form.udpxy_wport, 1024, 65535))
  return false;
  
if(!validate_range(document.form.mproxy_wport, 1, 65535))
  return false;
  
if(!validate_range(document.form.kms_wport, 1, 65535))
  return false;
if(found_app_sshd()){
  if(!validate_range(document.form.sshd_wport, 22, 65535))
   return false;
}
if(found_app_ftpd()){
  if(!validate_range(document.form.ftpd_wport, 21, 65535))
   return false;
}
return true;
}
function firewall_changed(){
var v = document.form.fw_enable_x[0].checked;
inputCtrl(document.form.misc_httpport_x, v);
inputCtrl(document.form.https_wport, v);
inputCtrl(document.form.sshd_wport, v);
inputRCtrl1(document.form.misc_ping_x, v);
inputRCtrl1(document.form.misc_http_x, v);
inputRCtrl1(document.form.https_wopen, v);
inputRCtrl1(document.form.sshd_wopen, v);
inputRCtrl1(document.form.ftpd_wopen, v);
inputRCtrl1(document.form.trmd_ropen, v);
if (!v){
  inputRCtrl2(document.form.misc_ping_x, 1);
  inputRCtrl2(document.form.misc_http_x, 1);
  inputRCtrl2(document.form.https_wopen, 1);
  inputRCtrl2(document.form.sshd_wopen, 1);
  inputRCtrl2(document.form.ftpd_wopen, 1);
  inputRCtrl2(document.form.trmd_ropen, 1);
}
showhide_div('row_misc_ping', v);
showhide_div('access_section', v);
}
function http_wopen_changed(){
if (sw_mode == '4')
  return;
var v = document.form.misc_http_x[0].checked;
showhide_div('row_http_wport', v);
}
function https_wopen_changed(){
if (sw_mode == '4')
  return;
var v = document.form.https_wopen[0].checked;
showhide_div('row_https_wport', v);
}
function sshd_wopen_changed(){
var v = document.form.sshd_wopen[0].checked;
showhide_div('row_sshd_wport', v);
showhide_div('row_sshd_wbfp', v);
}
function ftpd_wopen_changed(){
if (sw_mode == '4')
  return;
var v = document.form.ftpd_wopen[0].checked;
showhide_div('row_ftpd_wport', v);
}
function udpxy_wopen_changed(){
if (sw_mode == '4')
  return;
var v = document.form.udpxy_wopen[0].checked;
showhide_div('row_udpxy_wport', v);
}
function mproxy_wopen_changed(){
if (sw_mode == '4')
  return;
var v = document.form.mproxy_wopen[0].checked;
showhide_div('row_mproxy_wport', v);
}
function kms_wopen_changed(){
if (sw_mode == '4')
  return;
var v = document.form.kms_wopen[0].checked;
showhide_div('row_kms_wport', v);
}
function done_validating(action){
refreshpage();
}
</script>
<style>
    .nav-tabs > li > a {
          padding-right: 6px;
          padding-left: 6px;
    }
</style>
</head>
<body>
<div class="wrapper">
    <div class="container-fluid" style="padding-right: 0px">
        <div class="row-fluid">
            <div class="span3"><center><div id="logo"></div></center></div>
            <div class="span9" >
                <div id="TopBanner"></div>
            </div>
        </div>
    </div>
    <div id="Loading" class="popup_bg"></div>
    <iframe name="hidden_frame" id="hidden_frame" src="" width="0" height="0" frameborder="0"></iframe>
    <form method="post" name="form" id="ruleForm" action="/start_apply.htm" target="hidden_frame">
    <input type="hidden" name="current_page" value="Advanced_BasicFirewall_Content.asp">
    <input type="hidden" name="next_page" value="">
    <input type="hidden" name="next_host" value="">
    <input type="hidden" name="sid_list" value="FirewallConfig;">
    <input type="hidden" name="group_id" value="">
    <input type="hidden" name="action_mode" value="">
    <input type="hidden" name="action_script" value="">
    <div class="container-fluid">
        <div class="row-fluid">
            <div class="span3">
                <!--Sidebar content-->
                <!--=====Beginning of Main Menu=====-->
                <div class="well sidebar-nav side_nav" style="padding: 0px;">
                    <ul id="mainMenu" class="clearfix"></ul>
                    <ul class="clearfix">
                        <li>
                            <div id="subMenu" class="accordion"></div>
                        </li>
                    </ul>
                </div>
            </div>
            <div class="span9">
                <!--Body content-->
                <div class="row-fluid">
                    <div class="span12">
                        <div class="box well grad_colour_dark_blue">
                            <h2 class="box_head round_top"><#menu5_5#> - <#menu5_5_1#></h2>
                            <div class="round_bottom">
                                <div class="row-fluid">
                                    <div id="tabMenu" class="submenuBlock"></div>
                                    <div class="alert alert-info" style="margin: 10px;"><#FirewallConfig_display2_sectiondesc#></div>
                                    <table width="100%" cellpadding="4" cellspacing="0" class="table">
                                        <tr>
                                            <th colspan="2" style="background-color: #E3E3E3;"><#Custom_function#></th>
                                        </tr>
                                        <tr>
                                            <th><#RunMproxy#></th>
                                            <td>
                                                <div class="main_itoggle">
                                                    <div id="mproxy_wopen_on_of">
                                                        <input type="checkbox" id="mproxy_wopen_fake" <% nvram_match_x("", "mproxy_wopen", "1", "value=1 checked"); %><% nvram_match_x("", "mproxy_wopen", "0", "value=0"); %>>
                                                    </div>
                                                </div>
                                                <div style="position: absolute; margin-left: -10000px;">
                                                    <input type="radio" name="mproxy_wopen" id="mproxy_wopen_1" class="input" value="1" <% nvram_match_x("", "mproxy_wopen", "1", "checked"); %>/><#checkbox_Yes#>
                                                    <input type="radio" name="mproxy_wopen" id="mproxy_wopen_0" class="input" value="0" <% nvram_match_x("", "mproxy_wopen", "0", "checked"); %>/><#checkbox_No#>
                                                </div>
                                            </td>
                                        </tr>
                                        <tr id="row_mproxy_wport" style="display:none;">
                                            <th style="border-top: 0 none;"><#Mproxy_port#></th>
                                            <td style="border-top: 0 none;">
                                                <input type="text" maxlength="5" size="5" name="mproxy_wport" class="input" value="<% nvram_get_x("","mproxy_wport"); %>"/>
                                                <span style="color:#888;"></span>
                                            </td>
                                        </tr>
                                        <tr>
                                            <th><#RunKMS#></th>
                                            <td>
                                                <div class="main_itoggle">
                                                    <div id="kms_wopen_on_of">
                                                        <input type="checkbox" id="kms_wopen_fake" <% nvram_match_x("", "kms_wopen", "1", "value=1 checked"); %><% nvram_match_x("", "kms_wopen", "0", "value=0"); %>>
                                                    </div>
                                                </div>
                                                <div style="position: absolute; margin-left: -10000px;">
                                                    <input type="radio" name="kms_wopen" id="kms_wopen_1" class="input" value="1" <% nvram_match_x("", "kms_wopen", "1", "checked"); %>/><#checkbox_Yes#>
                                                    <input type="radio" name="kms_wopen" id="kms_wopen_0" class="input" value="0" <% nvram_match_x("", "kms_wopen", "0", "checked"); %>/><#checkbox_No#>
                                                </div>
                                            </td>
                                        </tr>
                                        <tr id="row_kms_wport" style="display:none;">
                                            <th style="border-top: 0 none;"><#KMS_port#></th>
                                            <td style="border-top: 0 none;">
                                                <input type="text" maxlength="5" size="5" name="kms_wport" class="input" value="<% nvram_get_x("","kms_wport"); %>"/>
                                                <span style="color:#888;"></span>
                                            </td>
                                        </tr>
                                        <tr>
                                            <th colspan="2" style="background-color: #E3E3E3;"><#menu5_5#></th>
                                        </tr>
                                        <tr>
                                            <th width="50%"><a class="help_tooltip" href="javascript:void(0);"><#FirewallConfig_FirewallEnable_itemname#></a></th>
                                            <td>
                                                <div class="main_itoggle">
                                                    <div id="fw_enable_x_on_of">
                                                        <input type="checkbox" id="fw_enable_x_fake" <% nvram_match_x("", "fw_enable_x", "1", "value=1 checked"); %><% nvram_match_x("", "fw_enable_x", "0", "value=0"); %>>
                                                    </div>
                                                </div>
                                                <div style="position: absolute; margin-left: -10000px;">
                                                    <input type="radio" value="1" name="fw_enable_x" id="fw_enable_x_1" <% nvram_match_x("","fw_enable_x", "1", "checked"); %>/><#checkbox_Yes#>
                                                    <input type="radio" value="0" name="fw_enable_x" id="fw_enable_x_0" <% nvram_match_x("","fw_enable_x", "0", "checked"); %>/><#checkbox_No#>
                                                </div>
                                            </td>
                                        </tr>
                                        <tr>
                                            <th><a class="help_tooltip" href="javascript:void(0);"><#FirewallConfig_DoSEnable_itemname#></a></th>
                                            <td>
                                                <div class="main_itoggle">
                                                    <div id="fw_dos_x_on_of">
                                                        <input type="checkbox" id="fw_dos_x_fake" <% nvram_match_x("", "fw_dos_x", "1", "value=1 checked"); %><% nvram_match_x("", "fw_dos_x", "0", "value=0"); %>>
                                                    </div>
                                                </div>
                                                <div style="position: absolute; margin-left: -10000px;">
                                                    <input type="radio" value="1" name="fw_dos_x" id="fw_dos_x_1" class="input" <% nvram_match_x("", "fw_dos_x", "1", "checked"); %>/><#checkbox_Yes#>
                                                    <input type="radio" value="0" name="fw_dos_x" id="fw_dos_x_0" class="input" <% nvram_match_x("", "fw_dos_x", "0", "checked"); %>/><#checkbox_No#>
                                                </div>
                                            </td>
                                        </tr>
                                        <tr>
                                            <th><a class="help_tooltip" href="javascript:void(0);"><#FirewallConfigSynFlood#></a></th>
                                            <td>
                                                <div class="main_itoggle">
                                                    <div id="fw_syn_cook_on_of">
                                                        <input type="checkbox" id="fw_syn_cook_fake" <% nvram_match_x("", "fw_syn_cook", "1", "value=1 checked"); %><% nvram_match_x("", "fw_syn_cook", "0", "value=0"); %>>
                                                    </div>
                                                </div>
                                                <div style="position: absolute; margin-left: -10000px;">
                                                    <input type="radio" value="1" name="fw_syn_cook" id="fw_syn_cook_1" class="input" <% nvram_match_x("", "fw_syn_cook", "1", "checked"); %>/><#checkbox_Yes#>
                                                    <input type="radio" value="0" name="fw_syn_cook" id="fw_syn_cook_0" class="input" <% nvram_match_x("", "fw_syn_cook", "0", "checked"); %>/><#checkbox_No#>
                                                </div>
                                            </td>
                                        </tr>
                                        <tr>
                                            <th><a class="help_tooltip" href="javascript:void(0);"><#FirewallConfig_WanLanLog_itemname#></a></th>
                                            <td>
                                                <select name="fw_log_x" class="input">
                                                    <option value="none" <% nvram_match_x("","fw_log_x", "none","selected"); %>><#checkbox_No#></option>
                                                    <option value="drop" <% nvram_match_x("","fw_log_x", "drop","selected"); %>>Dropped</option>
                                                    <option value="accept" <% nvram_match_x("","fw_log_x", "accept","selected"); %>>Accepted</option>
                                                    <option value="both" <% nvram_match_x("","fw_log_x", "both","selected"); %>>Both</option>
                                                </select>
                                            </td>
                                        </tr>
                                        <tr id="row_misc_ping">
                                            <th><a class="help_tooltip" href="javascript:void(0);"><#FirewallConfig_x_WanPingEnable_itemname#></a></th>
                                            <td>
                                                <div class="main_itoggle">
                                                    <div id="misc_ping_x_on_of">
                                                        <input type="checkbox" id="misc_ping_x_fake" <% nvram_match_x("", "misc_ping_x", "1", "value=1 checked"); %><% nvram_match_x("", "misc_ping_x", "0", "value=0"); %>>
                                                    </div>
                                                </div>
                                                <div style="position: absolute; margin-left: -10000px;">
                                                    <input type="radio" value="1" name="misc_ping_x" id="misc_ping_x_1" class="input" <% nvram_match_x("","misc_ping_x", "1", "checked"); %>/><#checkbox_Yes#>
                                                    <input type="radio" value="0" name="misc_ping_x" id="misc_ping_x_0" class="input" <% nvram_match_x("","misc_ping_x", "0", "checked"); %>/><#checkbox_No#>
                                                </div>
                                            </td>
                                        </tr>
                                    </table>
                                    <table width="100%" cellpadding="4" cellspacing="0" class="table" id="access_section">
                                        <tr>
                                            <th colspan="2" style="background-color: #E3E3E3;"><#Adm_Access_WAN#></th>
                                        </tr>
                                        <tr id="row_http_wopen">
                                            <th width="50%"><a class="help_tooltip" href="javascript:void(0);"><#FirewallConfig_x_WanWebEnable_itemname#></a></th>
                                            <td>
                                                <div class="main_itoggle">
                                                    <div id="misc_http_x_on_of">
                                                        <input type="checkbox" id="misc_http_x_fake" <% nvram_match_x("", "misc_http_x", "1", "value=1 checked"); %><% nvram_match_x("", "misc_http_x", "0", "value=0"); %>>
                                                    </div>
                                                </div>
                                                <div style="position: absolute; margin-left: -10000px;">
                                                    <input type="radio" value="1" name="misc_http_x" id="misc_http_x_1" class="input" <% nvram_match_x("","misc_http_x", "1", "checked"); %>/><#checkbox_Yes#>
                                                    <input type="radio" value="0" name="misc_http_x" id="misc_http_x_0" class="input" <% nvram_match_x("","misc_http_x", "0", "checked"); %>/><#checkbox_No#>
                                                </div>
                                            </td>
                                        </tr>
                                        <tr id="row_http_wport" style="display:none;">
                                            <th style="border-top: 0 none;"><a class="help_tooltip" href="javascript:void(0);"><#FirewallConfig_x_WanWebPort_itemname#></a></th>
                                            <td style="border-top: 0 none;">
                                                <input type="text" maxlength="5" size="5" name="misc_httpport_x" class="input" value="<% nvram_get_x("", "misc_httpport_x"); %>"/>
                                                 <span style="color:#888;">[80..65535]</span>
                                            </td>
                                        </tr>
                                        <tr id="row_https_wopen" style="display:none;">
                                            <th width="50%"><#Adm_System_https_wopen#></th>
                                            <td>
                                                <div class="main_itoggle">
                                                    <div id="https_wopen_on_of">
                                                        <input type="checkbox" id="https_wopen_fake" <% nvram_match_x("", "https_wopen", "1", "value=1 checked"); %><% nvram_match_x("", "https_wopen", "0", "value=0"); %>>
                                                    </div>
                                                </div>
                                                <div style="position: absolute; margin-left: -10000px;">
                                                    <input type="radio" value="1" name="https_wopen" id="https_wopen_1" class="input" <% nvram_match_x("","https_wopen", "1", "checked"); %>/><#checkbox_Yes#>
                                                    <input type="radio" value="0" name="https_wopen" id="https_wopen_0" class="input" <% nvram_match_x("","https_wopen", "0", "checked"); %>/><#checkbox_No#>
                                                </div>
                                            </td>
                                        </tr>
                                        <tr id="row_https_wport" style="display:none;">
                                            <th style="border-top: 0 none;"><#Adm_System_https_wport#></th>
                                            <td style="border-top: 0 none;">
                                                <input type="text" maxlength="5" size="5" name="https_wport" class="input" value="<% nvram_get_x("", "https_wport"); %>"/>
                                                 <span style="color:#888;">[81..65535]</span>
                                            </td>
                                        </tr>
                                        <tr id="row_sshd" style="display:none;">
                                            <th><#Adm_System_sshd_wopen#></th>
                                            <td>
                                                <div class="main_itoggle">
                                                    <div id="sshd_wopen_on_of">
                                                        <input type="checkbox" id="sshd_wopen_fake" <% nvram_match_x("", "sshd_wopen", "1", "value=1 checked"); %><% nvram_match_x("", "sshd_wopen", "0", "value=0"); %>>
                                                    </div>
                                                </div>
                                                <div style="position: absolute; margin-left: -10000px;">
                                                    <input type="radio" name="sshd_wopen" id="sshd_wopen_1" class="input" value="1" <% nvram_match_x("", "sshd_wopen", "1", "checked"); %>/><#checkbox_Yes#>
                                                    <input type="radio" name="sshd_wopen" id="sshd_wopen_0" class="input" value="0" <% nvram_match_x("", "sshd_wopen", "0", "checked"); %>/><#checkbox_No#>
                                                </div>
                                            </td>
                                        </tr>
                                        <tr id="row_sshd_wport" style="display:none;">
                                            <th style="border-top: 0 none;"><#Adm_System_sshd_wport#></th>
                                            <td style="border-top: 0 none;">
                                                <input type="text" maxlength="5" size="5" name="sshd_wport" class="input" value="<% nvram_get_x("","sshd_wport"); %>"/>
                                                 <span style="color:#888;">[22..65535]</span>
                                            </td>
                                        </tr>
                                        <tr id="row_sshd_wbfp" style="display:none;">
                                            <th style="border-top: 0 none;"><#Adm_System_sshd_wbfp#></th>
                                            <td style="border-top: 0 none;">
                                                <select name="sshd_wbfp" class="input">
                                                    <option value="0" <% nvram_match_x("","sshd_wbfp", "0","selected"); %>><#checkbox_No#></option>
                                                    <option value="1" <% nvram_match_x("","sshd_wbfp", "1","selected"); %>>Max 3 tries / 1 min</option>
                                                    <option value="2" <% nvram_match_x("","sshd_wbfp", "2","selected"); %>>Max 3 tries / 5 min (*)</option>
                                                    <option value="3" <% nvram_match_x("","sshd_wbfp", "3","selected"); %>>Max 3 tries / 10 min</option>
                                                    <option value="4" <% nvram_match_x("","sshd_wbfp", "4","selected"); %>>Max 3 tries / 30 min</option>
                                                    <option value="5" <% nvram_match_x("","sshd_wbfp", "5","selected"); %>>Max 3 tries / 60 min</option>
                                                </select>
                                            </td>
                                        </tr>
                                        <tr id="row_ftpd_wopen" style="display:none;">
                                            <th><#Adm_System_ftpd_wopen#></th>
                                            <td>
                                                <div class="main_itoggle">
                                                    <div id="ftpd_wopen_on_of">
                                                        <input type="checkbox" id="ftpd_wopen_fake" <% nvram_match_x("", "ftpd_wopen", "1", "value=1 checked"); %><% nvram_match_x("", "ftpd_wopen", "0", "value=0"); %>>
                                                    </div>
                                                </div>
                                                <div style="position: absolute; margin-left: -10000px;">
                                                    <input type="radio" name="ftpd_wopen" id="ftpd_wopen_1" class="input" value="1" <% nvram_match_x("", "ftpd_wopen", "1", "checked"); %>/><#checkbox_Yes#>
                                                    <input type="radio" name="ftpd_wopen" id="ftpd_wopen_0" class="input" value="0" <% nvram_match_x("", "ftpd_wopen", "0", "checked"); %>/><#checkbox_No#>
                                                </div>
                                            </td>
                                        </tr>
                                        <tr id="row_ftpd_wport" style="display:none;">
                                            <th style="border-top: 0 none;"><#Adm_System_ftpd_wport#></th>
                                            <td style="border-top: 0 none;">
                                                <input type="text" maxlength="5" size="5" name="ftpd_wport" class="input" value="<% nvram_get_x("","ftpd_wport"); %>"/>
                                                 <span style="color:#888;">[21..65535]</span>
                                            </td>
                                        </tr>
                                        <tr>
                                            <th><#Adm_System_udpxy_wopen#></th>
                                            <td>
                                                <div class="main_itoggle">
                                                    <div id="udpxy_wopen_on_of">
                                                        <input type="checkbox" id="udpxy_wopen_fake" <% nvram_match_x("", "udpxy_wopen", "1", "value=1 checked"); %><% nvram_match_x("", "udpxy_wopen", "0", "value=0"); %>>
                                                    </div>
                                                </div>
                                                <div style="position: absolute; margin-left: -10000px;">
                                                    <input type="radio" name="udpxy_wopen" id="udpxy_wopen_1" class="input" value="1" <% nvram_match_x("", "udpxy_wopen", "1", "checked"); %>/><#checkbox_Yes#>
                                                    <input type="radio" name="udpxy_wopen" id="udpxy_wopen_0" class="input" value="0" <% nvram_match_x("", "udpxy_wopen", "0", "checked"); %>/><#checkbox_No#>
                                                </div>
                                            </td>
                                        </tr>
                                        <tr id="row_udpxy_wport" style="display:none;">
                                            <th style="border-top: 0 none;"><#Adm_System_udpxy_wport#></th>
                                            <td style="border-top: 0 none;">
                                                <input type="text" maxlength="5" size="5" name="udpxy_wport" class="input" value="<% nvram_get_x("","udpxy_wport"); %>"/>
                                                 <span style="color:#888;">[1024..65535]</span>
                                            </td>
                                        </tr>
                                       
                                        <tr id="row_torrent" style="display:none;">
                                            <th><#Adm_System_trmd_ropen#></th>
                                            <td>
                                                <div class="main_itoggle">
                                                    <div id="trmd_ropen_on_of">
                                                        <input type="checkbox" id="trmd_ropen_fake" <% nvram_match_x("", "trmd_ropen", "1", "value=1 checked"); %><% nvram_match_x("", "trmd_ropen", "0", "value=0"); %>>
                                                    </div>
                                                </div>
                                                <div style="position: absolute; margin-left: -10000px;">
                                                    <input type="radio" name="trmd_ropen" id="trmd_ropen_1" class="input" value="1" <% nvram_match_x("", "trmd_ropen", "1", "checked"); %>/><#checkbox_Yes#>
                                                    <input type="radio" name="trmd_ropen" id="trmd_ropen_0" class="input" value="0" <% nvram_match_x("", "trmd_ropen", "0", "checked"); %>/><#checkbox_No#>
                                                </div>
                                            </td>
                                        </tr>
                                        <tr id="row_aria" style="display:none;">
                                            <th><#Adm_System_aria_ropen#></th>
                                            <td>
                                                <div class="main_itoggle">
                                                    <div id="aria_ropen_on_of">
                                                        <input type="checkbox" id="aria_ropen_fake" <% nvram_match_x("", "aria_ropen", "1", "value=1 checked"); %><% nvram_match_x("", "aria_ropen", "0", "value=0"); %>>
                                                    </div>
                                                </div>
                                                <div style="position: absolute; margin-left: -10000px;">
                                                    <input type="radio" name="aria_ropen" id="aria_ropen_1" class="input" value="1" <% nvram_match_x("", "aria_ropen", "1", "checked"); %>/><#checkbox_Yes#>
                                                    <input type="radio" name="aria_ropen" id="aria_ropen_0" class="input" value="0" <% nvram_match_x("", "aria_ropen", "0", "checked"); %>/><#checkbox_No#>
                                                </div>
                                            </td>
                                        </tr>
                                    </table>
                                    <table class="table">
                                        <tr>
                                            <td style="border: 0 none;"><center><input name="button" type="button" class="btn btn-primary" style="width: 219px" value="<#CTL_apply#>"/></center></td>
                                        </tr>
                                    </table>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    </form>
    <div id="footer"></div>
</div>
</body>
</html>

Advanced_BasicFirewall_Content.asp的全部代码,可以正常使用,但是把其中kms和mp相关的代码(红色部分)移植到 Advanced_Tweaks_Content.asp里,就不能用啊!
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

 楼主| 发表于 2017-4-21 20:39 | 显示全部楼层



可以运行啊?前端是好的,你说的是哪不能用,没反应?

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

×
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2017-4-21 20:43 | 显示全部楼层
lostlonger 发表于 2017-4-21 20:39
可以运行啊?前端是好的,你说的是哪不能用,没反应?

红色部分代码移植到Advanced_Tweaks_Content.asp 这个页面里不能运行。

自定义设置 - 按钮/LED
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2017-4-21 20:47 | 显示全部楼层
我想把代码放在这个页面,但是移植过来就是不能运行


本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

×
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

 楼主| 发表于 2017-4-21 21:11 | 显示全部楼层
本帖最后由 lostlonger 于 2017-4-21 21:12 编辑
nns 发表于 2017-4-21 20:47
我想把代码放在这个页面,但是移植过来就是不能运行

看了下,也没看懂,不知道这个参数sw_mode,从哪来的,不过可以换个写法啊。

function mproxy_wopen_changed(){
        var v = document.form.mproxy_wopen[0].checked;
        inputCtrl(document.form.mproxy_wopen, v);
        showhide_div("row_mproxy_wport", v);
}

function kms_wopen_changed(){
        var v = document.form.kms_wopen[0].checked;
        inputCtrl(document.form.kms_wopen, v);
        showhide_div("row_kms_wport", v);
}

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

×
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

有疑问请添加管理员QQ86788181|手机版|小黑屋|Archiver|恩山无线论坛(常州市恩山计算机开发有限公司版权所有) ( 苏ICP备05084872号 )

GMT+8, 2024-4-25 03:26

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

| 江苏省互联网有害信息举报中心 举报信箱:js12377 | @jischina.com.cn 举报电话:025-88802724 本站不良内容举报信箱:68610888@qq.com 举报电话:0519-86695797

快速回复 返回顶部 返回列表