Beruflich Dokumente
Kultur Dokumente
<head>
<meta HTTP-EQUIV='Pragma' CONTENT='no-cache'>
<link rel="stylesheet" href='stylemain.css' type='text/css'>
<script language="javascript" src="util.js"></script>
<script language="javascript">
<!-- hide
var prtcl = 'PPPoE';
var eMode = '0';
var wanifnName = 'ppp_0_38_1';
var pppsrvrname = '';
var atmvpi = '0';
var atmvci = '38';
var timeOut = '0';
var onDemand = '0';
//pppUserName.value = '';
//pppPassword.value = '';
var dhcpClnt = '0';
var addr = '';
var mask = '';
var enblAuto = '1';
var gtwyIfc = ' ';
if ( gtwyIfc == ' ' ) gtwyIfc = '';
var gtwy = '41.100.128.1';
if ( gtwy == ' ' ) gtwy = '';
var dnsAuto = '1';
var dns1Mem = '41.221.20.4';
var dns1 = '41.221.20.4';
if ( dns1 == ' ' )
dns1 = '';
var dns2Mem = '66.28.0.45';
var dns2 = '66.28.0.45';
if ( dns2 == ' ' )
dns2 = '';
var qs = '0';
var srvId = parseInt('1');
var srvcName = 'wizard_pvc';
var pppStatus = 'UP';
var mtusize= '1492';
var hostname= '';
var wanTmpChgCfg = '';
var protocolState ='';
var encapsType = 0;
var pppUsername = '046437600';
var pppPassword = '41202';
function btnChngStat(){
with (document.forms[0]) {
status.disabled = true;
if(wanTmpChgCfg =='1')
{
status.disabled = true;
status.value="Connect";
}
else
{
if (pppStatus == "DOWN"){
status.value="Connect";
status.disabled = false;
}else if (pppStatus == "UP"){
status.value="Disconnect";
status.disabled = false;
}else if (pppStatus == "DOD"){
status.value="DoD";
status.disabled = false;
} else {
status.disabled = true;
status.value="Connect";
}
}
}
}
function act(ifn){
var loc = 'wanpvc.cmd?ifname='+ifn;
with (document.forms[0]) {
savebutton.disabled= true;
cancelbutton.disabled= true;
status.disabled = true;
if (pppStatus == "UP"){
loc += '0';
} else {
loc += '1';
}
}
var code = 'location=\"' + loc + '\"';
eval(code);
}
function frmLoad(){
with (document.forms[0]) {
prtcltype[0].checked= true;
vpi.value = atmvpi;
vci.value = atmvci;
if ((prtcl == 'PPPoE')||(prtcl == 'PPPoA')){
prtcltype[0].checked= true;
protocolState = 'PPP';
if (prtcl == 'PPPoE'){
if (eMode == 0){
contype.selectedIndex = 1;
encapsType = 1;
} else{
contype.selectedIndex = 0;
encapsType = 0;
}
servicename.value = pppsrvrname;
} else if (prtcl == 'PPPoA'){
if (eMode == 0){
contype.selectedIndex = 2;
encapsType = 2;
} else{
contype.selectedIndex = 3;
encapsType = 3;
}
}
}else if (prtcl == 'MER'){
if (( dhcpClnt == '1' )&&( enblAuto == '1' )) {
prtcltype[1].checked= true;
protocolState = 'Dynamic';
if (eMode == 0){
dynConType.selectedIndex = 0;
encapsType = 0;
} else{
dynConType.selectedIndex = 1;
encapsType = 1;
}
} else{
prtcltype[2].checked= true;
protocolState = 'Static';
if (eMode == 0){
statConType.selectedIndex = 0;
encapsType = 0;
} else{
statConType.selectedIndex = 1;
encapsType = 1;
}
}
}else if (prtcl == 'IPoA'){
prtcltype[2].checked= true;
protocolState = 'Static';
if (eMode == 0){
statConType.selectedIndex = 2;
encapsType = 2;
} else{
statConType.selectedIndex = 3;
encapsType = 3;
}
} else if (prtcl == 'Bridge') {
prtcltype[3].checked= true;
protocolState = 'Bridge';
if (eMode == 0){
bridgeType.selectedIndex = 0;
encapsType = 0;
} else{
bridgeType.selectedIndex = 1;
encapsType = 1;
}
}
if (srvcName == "wizard_pvc"){
manualsetup.checked = true;
}
//disableServiceName();
//hideConnection();
btnChngStat();
vpi.value = atmvpi;
vci.value = atmvci;
username.value = pppUsername;
password.value = pppPassword;
servicename.value = pppsrvrname;
if(mtusize > 1492)
pppmtu.value = '1492';
else
pppmtu.value = mtusize;
timeout.value = timeOut;
dynmtu.value = mtusize;
dynhost.value = hostname;
statip.value = addr;
statmask.value = mask;
statgw.value = gtwy;
statdns.value = dns1;
statdns2.value = dns2;
statmtu.value = mtusize;
btnManualSetup();
}
}
function disableServiceName(){
with (document.forms[0]) {
switch (contype.selectedIndex) {
case 0:
case 1:
servicename.disabled = false;
break;
case 2:
case 3:
servicename.disabled = true;
break;
}
}
}
function hideConnection(){
var value;
with (document.forms[0]) {
document.getElementById("ppp").style.display="none";
document.getElementById("staticip").style.display="none";
document.getElementById("dynamicip").style.display="none";
document.getElementById("bridge").style.display="none";
if (prtcltype[0].checked == true){
value = 0;
} else if (prtcltype[1].checked == true) {
value = 1;
} else if (prtcltype[2].checked == true) {
value = 2;
} else if (prtcltype[3].checked == true)
value = 3;
if (manualsetup.checked == true){
switch (value){
case 0:
document.getElementById("ppp").style.dis
play="block";
if (protocolState == 'PPP'){
username.value = pppUsername;
password.value = pppPassword;
servicename.value = pppsrvrname;
if(mtusize > 1492)
pppmtu.value = '1492';
else
pppmtu.value = mtusize;
timeout.value = timeOut;
if (encapsType < contype.length)
{
contype.selectedIndex =
encapsType;
} else{
contype.selectedIndex =
0;
}
} else{
username.value = "";
password.value = "";
servicename.value = "";
pppmtu.value = '1492';
timeout.value = timeOut;
contype.selectedIndex = 0;
}
btnChngStat();
break;
case 1:
document.getElementById("dynamicip").sty
le.display="block";
status.disabled = true;
status.value="Connect";
if (protocolState == 'Dynamic'){
dynmtu.value = mtusize;
dynhost.value = hostname;
if (encapsType < dynConType.leng
th){
dynConType.selectedIndex
= encapsType;
} else{
dynConType.selectedIndex
= 0;
}
} else{
dynmtu.value = "1492";
dynhost.value = "";
dynConType.selectedIndex = 0;
}
break;
case 2:
document.getElementById("staticip").styl
e.display="block";
status.disabled = true;
status.value="Connect";
if (protocolState == 'Static'){
statip.value = addr;
statmask.value = mask;
statgw.value = gtwy;
statdns.value = dns1;
statdns2.value = dns2;
statmtu.value = mtusize;
if (encapsType < statConType.len
gth){
statConType.selectedInde
x = encapsType;
} else{
statConType.selectedInde
x = 0;
}
} else{
statip.value = "";
statmask.value = "";
statgw.value = "";
statdns.value = "";
statdns2.value = "";
statmtu.value = "1492";
statConType.selectedIndex = 0;
}
break;
case 3:
document.getElementById("bridge").style.
display="block";
status.disabled = true;
status.value="Connect";
if (protocolState == 'Brideg'){
if (encapsType < bridgeType.leng
th){
bridgeType.selectedIndex
= encapsType;
} else{
bridgeType.selectedIndex
= 0;
}
}
break;
}
} else {
switch (value){
case 0:
document.getElementById("ppp").style.dis
play="block";
break;
case 1:
document.getElementById("dynamicip").sty
le.display="block";
break;
case 2:
document.getElementById("staticip").styl
e.display="block";
break;
case 3:
document.getElementById("bridge").style.
display="block";
break;
}
}
}
}
function btnCancel(){
var code = 'location="wan.html"';
eval(code);
}
function btnManualSetup(){
var i;
with (document.forms[0]) {
if (manualsetup.checked == true){
changeBlockState("prot_content",ENABLED);
changeBlockState("ppp_content",ENABLED);
changeBlockState("dynamicip_content",ENABLED);
changeBlockState("staticip_content",ENABLED);
changeBlockState("pvc_content",ENABLED);
changeBlockState("bridge_content",ENABLED);
savebutton.disabled = false;
cancelbutton.disabled = false;
status.disabled = false;
} else {
changeBlockState("prot_content",DISABLED);
changeBlockState("ppp_content",DISABLED);
changeBlockState("dynamicip_content",DISABLED);
changeBlockState("staticip_content",DISABLED);
changeBlockState("pvc_content",DISABLED);
changeBlockState("bridge_content",DISABLED);
savebutton.disabled = true;
cancelbutton.disabled = true;
status.disabled = true;
}
hideConnection();
disableServiceName();
}
}
function btnWizard(){
var code = 'location="wizardintro.cgi"';
eval(code);
}
function btnSave(){
var prtSecType;
var loc='';
var mtu;
with ( document.forms[0] ) {
if (prtcltype[0].checked == true){
prtSecType = 0;
if(contype.selectedIndex <= 1) //pppoe
{
if (!isInValidRange(pppmtu.value,512,1492,"MTU")) re
turn;
}
else
{
if (!isInValidRange(pppmtu.value,512,1500,"MTU")) re
turn;
}
mtu=pppmtu.value;
} else if (prtcltype[1].checked == true) {
prtSecType = 1;
if (!isInValidRange(dynmtu.value,512,1500,"MTU")) return;
mtu=dynmtu.value;
} else if (prtcltype[2].checked == true) {
prtSecType = 2;
if (!isInValidRange(statmtu.value,512,1500,"MTU")) return;
mtu=statmtu.value;
} else if (prtcltype[3].checked == true) {
prtSecType = 3;
}
if (!isInValidRange(vpi.value,0,255,"VPI")) return;
if (!isInValidRange(vci.value,32,65535,"VCI")) return;
tempvpi = parseInt(vpi.value,10);
tempvci = parseInt(vci.value,10);
loc += 'atmVpi=' + tempvpi;
loc += '&atmVci=' + tempvci;
loc += '&atmServiceCategory=UBR';
loc += '&quickSetup=0';
loc += '&enblQos=1';
loc += '&sysMtuSize=' + mtu;
switch (prtSecType){
case 0:
if(username.value != "")
if (encodeUrl(username.value,"Username")
==ERROR_ENCODE_URL) return;
if(password.value != "")
if (encodeUrl(password.value,"Password")
==ERROR_ENCODE_URL) return;
if(!isInValidRange(timeout.value,0,4320,"Inactiv
ity Timeout")) return;
timeOutNum = parseInt(timeout.value);
if (servicename.value.charAt(0) == " "){
alert("Service Name can not start with a <space>
.");
return;
}
if(servicename.value != ""){
if (encodeUrl(servicename.value,"Service Name")
== ERROR_ENCODE_URL) return;
if ( isValidName( servicename.value, "Service Na
me", BLANK_INVALID, SPACE_VALID, SLASH_INVALID) == false ) return;
}
loc += '&pppUserName=' + encodeUrl(username.valu
e);
loc += '&pppPassword=' + encodeUrl(password.value);
if ( timeOutNum == 0 ) {
loc += '&enblOnDemand=0';
loc += '&pppTimeOut=0';
} else {
loc += '&enblOnDemand=1';
loc += '&pppTimeOut=' + timeOutNum;
}
loc += '&pppServerName=' + encodeUrl(servicename.value);
loc += '&pppAuthMethod=0';
loc += '&defaultGateway=0.0.0.0';
loc += '&wanIfName=';
loc += '&enblAuto=1';
loc += '&dnsDynamic=1';
loc += '&cloneMacNum=00:00:00:00:00:00';
switch (contype.selectedIndex){
case 0:
loc += '&ntwkPrtcl=0';
loc += '&encapMode=1';
break;
case 1:
loc += '&ntwkPrtcl=0';
loc += '&encapMode=0';
break;
case 2:
loc += '&ntwkPrtcl=1';
loc += '&encapMode=0';
break;
case 3:
loc += '&ntwkPrtcl=1';
loc += '&encapMode=1';
break;
}
break;
case 1:
if(dynhost.value != "") {
if (encodeUrl(dynhost.value,"Host Name")
== ERROR_ENCODE_URL){
return;}
for (i=0; i<dynhost.value.length; i++){
if (dynhost.value.substring(i, i
+1) == ' '){
alertInvalid("Host Name"
, dynhost.value);
return;}
}}
loc += '&sysHostname=' + encodeUrl(dynhost.value
);
loc += '&ntwkPrtcl=2';
switch (dynConType.selectedIndex){
case 0:
loc += '&encapMode=0';
break;
case 1:
loc += '&encapMode=1';
break;
}
loc += '&dnsPrimary=0.0.0.0'
loc += '&dnsSecondary=0.0.0.0';
loc += '&dnsDynamic=1';
loc += '&defaultGateway=0.0.0.0';
loc += '&wanIfName=';
loc += '&enblAuto=1';
loc += '&enblDhcpClnt=1'
loc += '&cloneMacNum=00:00:00:00:00:00';
break;
case 2:
switch (statConType.selectedIndex){
case 0:
loc += '&ntwkPrtcl=2';
loc += '&encapMode=0';
loc += '&cloneMacNum=00:00:00:00
:00:00';
tempdns1 = statdns.value;
tempdns2 = statdns2.value;
break;
case 1:
loc += '&ntwkPrtcl=2';
loc += '&encapMode=1';
tempdns1 = statdns.value;
loc += '&cloneMacNum=00:00:00:00
:00:00';
tempdns2 = statdns2.value;
break;
case 2:
loc += '&ntwkPrtcl=5';
loc += '&encapMode=0';
tempdns1 = statdns.value;
tempdns2 = statdns2.value;
break;
case 3:
loc += '&ntwkPrtcl=5';
loc += '&encapMode=1';
tempdns1 = statdns.value;
tempdns2 = statdns2.value;
break;
}
if ( isValidIpAddress(tempdns1,"Preferred DNS Se
rver") == false ) return;
loc += '&dnsPrimary=' + tempdns1;
// secondary DNS
//if ( dns2 != '' && dns2 != '0.0.0.0' ) {
if ( dns2 != '') {
if ( isValidIpAddress(tempdns2,"Alternate DNS Se
rver") == false )return;
}
loc += '&dnsSecondary=' + tempdns2;
loc += '&dnsDynamic=0';
if ( isValidIpAddress(statgw.value,"Default gate
way") == false ) return;
loc += '&defaultGateway=' + statgw.value + '&wanIfName='
;
//loc += '&wanIfName=';
loc += '&enblAuto=0';
loc += '&enblDhcpClnt=0'; // static WAN addres
s
if ( isValidIpAddress(statip.value,"WAN IP addre
ss") == false ) return;
if ( isValidSubnetMask(statmask.value) == false
&& statmask.value != '255.255.255.255') {
alert('WAN subnet mask "' + statmask.val
ue + '" is invalid.');
return;
}
var reIP, reSubnetMask;
reIP = reencodeIP(statip.value);
reSubnetMask = reencodeIP(statmask.value);
if (statip.value != "" && statmask.value != ""){
if (!DoValidateNetworkIP(reIP, reSubnetM
ask)) return;
if (!DoValidateIpRange(reIP,reSubnetMask
)) return;
}
loc += '&wanIpAddress=' + reIP;
loc += '&wanSubnetMask=' + reSubnetMask;
break;
case 3:
loc += '&ntwkPrtcl=3';
switch (bridgeType.selectedIndex){
case 0:
loc += '&encapMode=0';
break;
case 1:
loc += '&encapMode=1';
break;
}
loc += '&enblFirewall=0&enblNat=0';
break;
}
if (prtSecType == 3)
loc += '&enblFirewall=0&enblNat=0';
else {
loc += '&enblNat=1';
loc += '&enblFirewall=1';}
loc += '&wanTmpChgCfg=1';
}
var response = confirm('These settings will only take effect after reboo
ting the router.\nPress "OK" to reboot now or "Cancel" to reboot later');
var locLink = 'wansave.cgi?';
if(response)
locLink = 'wansave_reboot.cgi?';