• Home
  • History
  • Annotate
  • Line#
  • Navigate
  • Raw
  • Download
  • only in /asuswrt-rt-n18u-9.0.0.4.380.2695/release/src-rt/router/www/sysdep/DSL-N55U-B/www/qis/
1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2<html xmlns="http://www.w3.org/1999/xhtml">
3<head>
4<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5<meta HTTP-EQUIV="Pragma" CONTENT="no-cache">
6<meta HTTP-EQUIV="Expires" CONTENT="-1">
7<link rel="stylesheet" type="text/css" href="/form_style.css">
8<link rel="stylesheet" type="text/css" href="qis_style.css">
9<script type="text/JavaScript" src="/state.js"></script>
10<script type="text/JavaScript" src="/general.js"></script>
11<script type="text/JavaScript" src="/help.js"></script>
12<script type="text/JavaScript" src="/validator.js"></script>
13<script language="JavaScript" type="text/javascript" src="/js/jquery.js"></script>
14<style>
15span{
16	border:0px solid #FFFFFF;
17	color:#FFFFFF;
18	font-size:14px;
19	font-family:Arial, Helvetica, sans-serif;
20	/*width:27px;*/
21	text-align:right;
22	margin:0px auto;
23	ime-mode:disabled;
24}
25</style>
26<script>
27var w_Setting = "<% nvram_get("w_Setting"); %>";
28var vpi_val = "<% nvram_get("dsltmp_cfg_vpi"); %>";
29var vci_val = "<% nvram_get("dsltmp_cfg_vci"); %>";
30var encap_val = "<% nvram_get("dsltmp_cfg_encap"); %>";
31var vlanid_val = "<% nvram_get("dsltmp_cfg_vid"); %>";
32var ispname_str = "<% nvram_get("dsltmp_cfg_ispname"); %>";
33var country_str = "<% nvram_get("dsltmp_cfg_country"); %>";
34var transfer_mode = "<% nvram_get("dsltmp_transmode"); %>";
35var iptv_atm_pvc_str = "";
36var iptv_ptm_pvc_str = "";
37var dsltmp_cfg_iptv_pvclist = decodeURIComponent('<%nvram_char_to_ascii("","dsltmp_cfg_iptv_pvclist");%>');
38
39var encap_str = "LLC";
40if (encap_val == "1") encap_str = "VC-Mux";
41
42var iptv_num_pvc_val = "<% nvram_get("dsltmp_cfg_iptv_num_pvc"); %>";
43
44//udpate iptv information
45if (iptv_num_pvc_val != "0" && iptv_num_pvc_val != "") {
46	var dsltmp_cfg_iptv_pvclist_row;
47	var dsltmp_cfg_iptv_pvclist_col;
48	var i, j;
49
50	iptv_atm_pvc_str = iptv_num_pvc_val + " IPTV PVC(s)";
51	iptv_ptm_pvc_str = iptv_num_pvc_val + " IPTV service(s)";
52
53	//<vpi>vci>proto>encap>vlanid
54	if(dsltmp_cfg_iptv_pvclist.charAt(0) == "<")	//rempve the 1st "<"
55		dsltmp_cfg_iptv_pvclist = dsltmp_cfg_iptv_pvclist.substr(1,dsltmp_cfg_iptv_pvclist.length);
56	dsltmp_cfg_iptv_pvclist_row = dsltmp_cfg_iptv_pvclist.split('<');
57
58	iptv_atm_pvc_str += ": ";
59	iptv_ptm_pvc_str += ": ";
60	for(i=0; i<dsltmp_cfg_iptv_pvclist_row.length; i++) {
61		if(i > 0) {
62			iptv_atm_pvc_str += " + ";
63			iptv_ptm_pvc_str += " + ";
64		}
65		dsltmp_cfg_iptv_pvclist_col = dsltmp_cfg_iptv_pvclist_row[i].split('>');
66		for(j=0; j<dsltmp_cfg_iptv_pvclist_col.length; j++){
67			switch(j) {
68				case 0:	//vpi
69					iptv_atm_pvc_str += "<span class='cfg_val'>" + dsltmp_cfg_iptv_pvclist_col[j] + "/";
70					break;
71				case 1:	//vci
72					iptv_atm_pvc_str += dsltmp_cfg_iptv_pvclist_col[j] + ",";
73					break;
74				case 2:	//proto
75					iptv_ptm_pvc_str += "<span class='cfg_val'>";
76					if(dsltmp_cfg_iptv_pvclist_col[j] == 3) {
77						iptv_atm_pvc_str += "Bridged, ";
78						iptv_ptm_pvc_str += "Bridged, ";
79					}
80					else {
81						iptv_atm_pvc_str += ", ";
82						iptv_ptm_pvc_str += "Bridged, ";
83					}
84					break;
85				case 3:	//encap
86					if(dsltmp_cfg_iptv_pvclist_col[j] == 1)
87						iptv_atm_pvc_str += "VC-Mux";
88					else
89						iptv_atm_pvc_str += "LLC";
90					break;
91				case 4:	//vlan id
92					if(dsltmp_cfg_iptv_pvclist_col[j] != "") {
93						iptv_atm_pvc_str += "VLAN ID " + dsltmp_cfg_iptv_pvclist_col[j];
94						iptv_ptm_pvc_str += "VLAN ID " + dsltmp_cfg_iptv_pvclist_col[j];
95					}
96					iptv_atm_pvc_str += "</span>";
97					iptv_ptm_pvc_str += "</span>";
98					break;
99			}
100		}
101	}
102}
103
104function QKfinish_load_body(){
105	parent.document.title = "<#Web_Title#> - <#QKSet_all_title#>";
106	parent.set_step("t2");
107
108	if(transfer_mode == "atm"){
109		document.getElementById("atm_info").style.display = "";		
110		document.form.prev_page.value = "/qis/QIS_manual_setting.htm";
111	}
112	else{ //transmode "ptm"
113		document.getElementById("ptm_info").style.display = "";
114		document.form.prev_page.value = "/qis/QIS_PTM_manual_setting.htm";
115	}	
116
117	if (country_str == "France" && ispname_str == "Free Degroupe"){		
118			document.form.dsl_dns1_x.value = "212.27.40.240";			
119			document.form.dsl_dns2_x.value = "212.27.40.241";
120	}
121}
122
123function validate_ip(){
124	if(document.form.dsl_gateway.value == document.form.dsl_ipaddr.value){
125		alert("<#IPConnection_warning_WANIPEQUALGatewayIP#>");
126		return false;
127	}
128	return true;
129}
130
131
132function submitForm(){	
133	if(validForm()){
134		
135	document.getElementById("dsltmp_qis_DHCPClient").value = "0";
136	document.getElementById("dsltmp_qis_ipaddr").value = document.getElementById("dsl_ipaddr").value;
137	document.getElementById("dsltmp_qis_netmask").value = document.getElementById("dsl_netmask").value;
138	document.getElementById("dsltmp_qis_gateway").value = document.getElementById("dsl_gateway").value;	
139
140	document.getElementById("dsltmp_qis_dnsenable").value = "0";
141	document.getElementById("dsltmp_qis_dns1").value = document.getElementById("dsl_dns1_x").value;
142	document.getElementById("dsltmp_qis_dns2").value = document.getElementById("dsl_dns2_x").value;	
143
144	if(transfer_mode == "ptm")
145		document.form.dsltmp_qis_proto.value = "static";
146	else
147		document.form.dsltmp_qis_proto.value = "ipoa";
148
149	document.form.next_page.value = "/qis/QIS_wireless.htm";
150	document.form.submit();
151	
152	}
153	
154}
155
156function validForm(){
157	// test if LAN IP is a private IP.
158	var A_class_start = inet_network("10.0.0.0");
159	var A_class_end = inet_network("10.255.255.255");
160	var B_class_start = inet_network("172.16.0.0");
161	var B_class_end = inet_network("172.31.255.255");
162	var C_class_start = inet_network("192.168.0.0");
163	var C_class_end = inet_network("192.168.255.255");
164	
165	var ip_obj = document.form.dsl_ipaddr;
166	var ip_num = inet_network(ip_obj.value);
167	var ip_class = "";	
168	
169	if(ip_num > A_class_start && ip_num < A_class_end)
170		ip_class = 'A';
171	else if(ip_num > B_class_start && ip_num < B_class_end)
172		ip_class = 'B';
173	else if(ip_num > C_class_start && ip_num < C_class_end)
174		ip_class = 'C';
175	else{
176		alert(ip_obj.value+" <#JS_validip#>");
177		ip_obj.value = "";
178		ip_obj.focus();
179		ip_obj.select();
180		return false;
181	}
182	
183	// test if netmask is valid.
184	var netmask_obj = document.form.dsl_netmask;
185	var netmask_num = inet_network(netmask_obj.value);
186	var netmask_reverse_num = ~netmask_num;
187	var default_netmask = "";
188	var wrong_netmask = 0;
189
190	if(netmask_num < 0) wrong_netmask = 1;	
191
192	if(ip_class == 'A')
193		default_netmask = "255.0.0.0";
194	else if(ip_class == 'B')
195		default_netmask = "255.255.0.0";
196	else
197		default_netmask = "255.255.255.0";
198	
199	var test_num = netmask_reverse_num;
200	while(test_num != 0){
201		if((test_num+1)%2 == 0)
202			test_num = (test_num+1)/2-1;
203		else{
204			wrong_netmask = 1;
205			break;
206		}
207	}
208	if(wrong_netmask == 1){
209		alert(netmask_obj.value+" <#JS_validip#>");
210		netmask_obj.value = default_netmask;
211		netmask_obj.focus();
212		netmask_obj.select();
213		return false;
214	}
215	
216	if(!validate_ip())
217			return false;
218	
219	var subnet_head = getSubnet(ip_obj.value, netmask_obj.value, "head");
220	var subnet_end = getSubnet(ip_obj.value, netmask_obj.value, "end");
221	
222	if(ip_num == subnet_head || ip_num == subnet_end){
223		alert(ip_obj.value+" <#JS_validip#>");
224		ip_obj.value = "";
225		ip_obj.focus();
226		ip_obj.select();
227		return false;
228	}
229	return true;
230}
231
232function gotoHome() {
233	if (w_Setting == "0") {
234		alert("<#QIS_recommand_encryption#>");	
235		location.href = '/qis/QIS_wireless.htm';
236	}
237	else {
238		parent.location.href = '/index.asp';
239	}
240}
241
242</script>
243</head>
244
245<body onLoad="QKfinish_load_body();" >
246<form method="post" name="form" action="/start_apply.htm" target="">
247<input type="hidden" name="prev_page" value="/qis/QIS_manual_setting.htm">
248<input type="hidden" name="current_page" value="/qis/QIS_ipoa_cfg_tmp.htm">
249<input type="hidden" name="next_page" value="">
250<input type="hidden" name="action_mode" value="apply">
251<input type="hidden" name="action_script" value="">
252<input type="hidden" name="action_wait" value="">
253<input type="hidden" name="dsltmp_qis_vpi" id="dsltmp_qis_vpi" value="<% nvram_get("dsltmp_cfg_vpi"); %>">
254<input type="hidden" name="dsltmp_qis_vci" id="dsltmp_qis_vci" value="<% nvram_get("dsltmp_cfg_vci"); %>">
255<input type="hidden" name="dsltmp_qis_proto" id="dsltmp_qis_proto" value="">
256<input type="hidden" name="dsltmp_qis_encap" id="dsltmp_qis_encap" value="<% nvram_get("dsltmp_cfg_encap"); %>">
257<!--<input type="hidden" name="dsltmp_qis_pppoe_username" id="dsltmp_qis_pppoe_username" value="">
258<input type="hidden" name="dsltmp_qis_pppoe_passwd" id="dsltmp_qis_pppoe_passwd" value="">
259<input type="hidden" name="dsltmp_qis_pppoe_dial_on_demand" id="dsltmp_qis_pppoe_dial_on_demand" value="0">
260<input type="hidden" name="dsltmp_qis_pppoe_idletime" id="dsltmp_qis_pppoe_idletime" value="0">
261<input type="hidden" name="dsltmp_qis_pppoe_mtu" id="dsltmp_qis_pppoe_mtu" value="1492">
262<input type="hidden" name="dsltmp_qis_pppoe_mru" id="dsltmp_qis_pppoe_mru" value="1492">
263<input type="hidden" name="dsltmp_qis_pppoe_service" id="dsltmp_qis_pppoe_service" value="">
264<input type="hidden" name="dsltmp_qis_pppoe_options" id="dsltmp_qis_pppoe_options" value="">-->
265<input type="hidden" name="dsltmp_qis_DHCPClient" id="dsltmp_qis_DHCPClient" value="1">
266<input type="hidden" name="dsltmp_qis_ipaddr" id="dsltmp_qis_ipaddr" value="0.0.0.0">
267<input type="hidden" name="dsltmp_qis_netmask" id="dsltmp_qis_netmask" value="0.0.0.0">
268<input type="hidden" name="dsltmp_qis_gateway" id="dsltmp_qis_gateway" value="0.0.0.0">
269<input type="hidden" name="dsltmp_qis_dnsenable" id="dsltmp_qis_dnsenable" value="1">
270<input type="hidden" name="dsltmp_qis_dns1" id="dsltmp_qis_dns1" value="">
271<input type="hidden" name="dsltmp_qis_dns2" id="dsltmp_qis_dns2" value="">
272<input type="hidden" name="dsltmp_qis_svc_cat" id="dsltmp_qis_svc_cat" value="0">
273<input type="hidden" name="dsltmp_qis_pcr" id="dsltmp_qis_pcr" value="0">
274<input type="hidden" name="dsltmp_qis_scr" id="dsltmp_qis_scr" value="0">
275<input type="hidden" name="dsltmp_qis_mbs" id="dsltmp_qis_mbs" value="0">
276<input type="hidden" name="dsltmp_qis_dsl_pvc_set" value="1">
277<input type="hidden" name="dsltmp_qis_pppoe_relay" value="0">
278
279<div class="QISmain">
280	<table width="730px">
281		<tr>
282			<td align="left">
283					<span class="description_down"><#Manual_Setting_Title#></span>
284			</td>
285		</tr>
286	</table>		
287	<div style="margin-left:5px;margin-top:10px;margin-bottom:10px"><img style="width: 700px; height: 2px;" src="/images/New_ui/export/line_export.png"></div>
288	<br/>
289
290<table id="tblsetting_1" class="QISform" width="400" border=0 align="center" cellpadding="5" cellspacing="0">
291  <tr>
292  	<td>	
293			<div id="atm_info" style="display:none;">
294			<#Transfer_Mode#>: <span class="cfg_val">ADSL WAN (ATM)</span>,&nbsp;<#Layer3Forwarding_x_ConnectionType_itemname#>: <span class="cfg_val">IPoA</span>, VPI/VCI: <span class="cfg_val"><% nvram_get("dsltmp_cfg_vpi"); %>/<% nvram_get("dsltmp_cfg_vci"); %>, <script>document.write(encap_str);</script></span><script>if(vlanid_val.length > 0){document.write(", <#WANVLANIDText#>: <span class=\"cfg_val\">" + vlanid_val + "</span>")}</script><br>
295				<b><script>document.write("<br>"+iptv_atm_pvc_str);</script></b>
296			</div>
297  		
298			<div id="ptm_info" style="display:none;">
299				<#Transfer_Mode#>: <span class="cfg_val">VDSL WAN (PTM)</span>,&nbsp;<#Layer3Forwarding_x_ConnectionType_itemname#>: <span class="cfg_val"><#BOP_ctype_title5#></span>, <#WANVLANIDText#>: <span class="cfg_val"><script>document.write(vlanid_val);</script></span><br>
300				<b><script>document.write("<br>"+iptv_ptm_pvc_str);</script></b><br>
301			</div>
302  		   <br><br>
303    </td> 
304  </tr>
305</table>
306
307<div id="showip">
308<fieldset>
309<legend>
310	<#Layer3Forwarding_x_UseStaticIP_itemname#>
311</legend>
312	<table id="tblsetting_2" class="QISform" width="400" border="0" align="center" cellpadding="3" cellspacing="0">
313		<tr>
314			<th width="180">
315				<#IPConnection_ExternalIPAddress_itemname#>
316			</th>
317			<td class="QISformtd">				
318				<input type="text" id="dsl_ipaddr" name="dsl_ipaddr" tabindex="1" class="input_15_table" value="" maxlength="15" onkeypress="return validator.isIPAddr(this, event);" title="WAN IP" autocorrect="off" autocapitalize="off">
319			</td>
320		</tr>
321
322		<tr>
323			<th width="180">
324				<#IPConnection_x_ExternalSubnetMask_itemname#>
325			</th>
326			<td class="QISformtd">				
327				<input type="text" id="dsl_netmask" name="dsl_netmask" tabindex="2" class="input_15_table" value="" onkeypress="return validator.isIPAddr(this, event);" maxlength="15"  title="WAN Subnet Mask" autocorrect="off" autocapitalize="off">
328			</td>
329		</tr>
330
331		<tr>
332			<th>
333				<#IPConnection_x_ExternalGateway_itemname#>
334			</th>
335			<td class="QISformtd">			
336				<input type="text" id="dsl_gateway" name="dsl_gateway" tabindex="3" class="input_15_table" value="" maxlength="15" onkeypress="return validator.isIPAddr(this, event);" class="input" autocorrect="off" autocapitalize="off">
337			</td>
338		</tr>
339	</table>
340</fieldset>
341</div>
342
343<div id="dns_sec">
344  <fieldset>
345  <legend>
346	  <span id="dns_info_title"><#qis_dns#>:</span>
347  </legend>
348  <table id="tblsetting_4" class="QISform" width="400" border=0 align="center" cellpadding="5" cellspacing="0">
349  <tr>
350	  <th width="180">
351	  	<#IPConnection_x_DNSServer1_itemname#>
352	  </th>
353	  <td class="QISformtd">	  	
354			<input type="text" id="dsl_dns1_x" name="dsl_dns1_x" tabindex="4" class="input_15_table" value="" maxlength="15" onkeypress="return validator.isIPAddr(this, event);" autocorrect="off" autocapitalize="off">
355	  </td>
356	</tr>
357
358	<tr>
359	  <th width="180">
360	  	<#IPConnection_x_DNSServer2_itemname#>
361	  </th>
362	  <td class="QISformtd">
363			<input type="text" id="dsl_dns2_x" name="dsl_dns2_x" tabindex="5" class="input_15_table" value="" maxlength="15" onkeypress="return validator.isIPAddr(this, event);" autocorrect="off" autocapitalize="off">
364	  </td>
365	</tr>
366  </table>
367  </fieldset>
368</div>
369
370<div class="test_css" style="margin-top:20px;margin-left:20px;">Note:  If you are not sure about the IP/DNS address setting, then please contact with your ISP.</div>
371
372	<div class="apply_gen" style="margin-top:30px">
373		<input type="button" id="prevButton" value="<#Manual_Setting_btn#>" tabindex="7" onclick="gotoprev(document.form);" class="button_gen_long" >
374<!--
375		<input type="button" id="nextButton" value="Ethernet WAN" onclick="redirect_page('internet_type');" class="button_gen" >
376-->
377		<input type="button" id="nextButton" value="<#CTL_next#>" tabindex="6" onclick="submitForm();" class="button_gen_long">
378	</div>
379
380</div>
381</form>
382</body>
383</html>
384