http://downloads.netgear.com/files/GPL/DM111PSP_v3.61d_GPL.tar.gz
[bcm963xx.git] / userapps / broadcom / cfm / html / dnscfg.html
1 <html>
2    <head>
3       <meta HTTP-EQUIV='Pragma' CONTENT='no-cache'>
4       <link rel="stylesheet" href='stylemain.css' type='text/css'>
5          <link rel="stylesheet" href='colors.css' type='text/css'>
6             <script language="javascript" src="util.js"></script>
7             <script language="javascript">
8 <!-- hide
9 var state = '<%ejGet(dnsRefresh)%>';
10 if ( state == '1' ) {
11    var code = 'location="dnscfg.cgi?dnsRefresh=0"';
12    eval(code);
13 }
14
15 function hideDnsInfo(hide) {
16    var status = 'visible';
17
18    if ( hide == 1 )
19       status = 'hidden';
20    if (document.getElementById)  // DOM3 = IE5, NS6
21       document.getElementById('dnsInfo').style.visibility = status;
22    else {
23       if (document.layers == false) // IE4
24          document.all.dnsInfo.style.visibility = status;
25    }
26 }
27
28
29 function dnsClick(cb) {
30    if (cb.checked == true)
31       hideDnsInfo(1);
32    else
33       hideDnsInfo(0);
34 }
35
36 function btnApply() {
37    var loc = 'dnscfg.cgi?';
38
39    with ( document.forms[0] ) {
40       if (enableAuto.checked == false) {
41          if ( isValidIpAddress(dnsPrimary.value) == false ) {
42             alert('Primary DNS "' + dnsPrimary.value + '" has invalid IP address.');
43             return;
44          }
45          loc += 'dnsPrimary=' + dnsPrimary.value;
46          if (dnsSecondary.value != '') {
47             if ( isValidIpAddress(dnsSecondary.value) == false ) {
48                alert('Secondary DNS "' + dnsSecondary.value + '" has invalid IP address.');
49                return;
50             }
51             loc += '&dnsSecondary=' + dnsSecondary.value;
52          }
53          else
54             loc += '&dnsSecondary=' + '0.0.0.0';
55          loc += '&dnsDynamic=0';
56          loc += '&dnsRefresh=1';
57       }
58       else {
59          loc += 'dnsPrimary=' + '0.0.0.0';
60          loc += '&dnsSecondary=' + '0.0.0.0';
61          loc += '&dnsDynamic=1';
62          loc += '&dnsRefresh=0';
63       }
64    }
65    var code = 'location="' + loc + '"';
66    eval(code);
67 }
68
69
70 function frmLoad() {
71    with ( document.forms[0] ) {
72       var auto = '<%ejGetOther(sysInfo, dnsAuto)%>';
73       var dns1 = '<%ejGetOther(sysInfo, dns)%>';
74       if ( dns1 == '&nbsp' ) dns1 = '';
75
76       var dns2 = '<%ejGetOther(sysInfo, dns2)%>';
77       if ( dns2 == '&nbsp' ) dns2 = '';
78
79       if ( auto == '1' ) {
80          enableAuto.checked = true;
81          dnsPrimary.value = '';
82          dnsSecondary.value = '';
83          hideDnsInfo(1);
84       } else {
85          enableAuto.checked = false;
86          dnsPrimary.value = dns1;
87          dnsSecondary.value = dns2;
88          hideDnsInfo(0);
89       }
90    }
91 }
92
93 // done hiding -->
94 </script>
95    </head>
96    <body onLoad='frmLoad()'>
97       <blockquote>
98          <form>
99             <P>
100                <b>DNS Server Configuration</b><br><br>
101                If 'Enable Automatic Assigned DNS' checkbox is selected, this router will accept
102                the first received DNS assignment from one of the PPPoA, PPPoE or MER/DHCP
103                enabled PVC(s) during the connection establishment. If the checkbox is
104                not selected, enter the primary and optional secondary DNS server IP addresses.
105                Click 'Save' button to save the new configuration. You must reboot the
106                router to make the new configuration effective.<br><br>
107             </P>
108             <table border="0" cellpadding="0" cellspacing="0">
109                <tr>
110                   <td valign="center" align="middle" colspan="2" width="30" height="30">
111                      <input type='checkbox' name='enableAuto' onclick='dnsClick(this)'></td>
112                   <td colspan="2">
113                      Enable Automatic Assigned DNS</td>
114                </tr>
115             </table>
116             <br>
117             <br>
118             <div id='dnsInfo'>
119                <table border="0" cellpadding="0" cellspacing="0">
120                   <tr>
121                      <td>Primary DNS server:
122                      </td>
123                      <td><input type='text' name='dnsPrimary'></td>
124                   </tr>
125                   <tr>
126                      <td>Secondary DNS server:
127                      </td>
128                      <td><input type='text' name='dnsSecondary'></td>
129                   </tr>
130                </table>
131                <br>
132             </div>
133             <br>
134             <center>
135                <input type='button' onClick='btnApply()' value='Save'>
136             </center>
137          </form>
138       </blockquote>
139    </body>
140 </html>