WAN Mode Page to configure this page." end local maxLimitVal = db.getAttribute ("environment", "name", "IPV6_LAN_ADDR_POOL", "value") or '16' if (ButtonType and ButtonType == "config") then local inputTable = web.cgiToLuaTable(cgi) --automation part begin local tableIndex = 1 local errorFlag = "OK" validationTable = { function() return validations.ipv6AddrValidate(inputTable["ifStatic.StaticIp"],"IPv6Address error") end, function() return validations.preLenChk(inputTable["ifStatic.PrefixLength"],"Prefix Length error") end, function() return validations.checkboxValidate(inputTable["dhcpv6s.isEnabled"],"1",2) end, function() return validations.isEmpty(inputTable["dhcpv6s.domainName"],"Domain Name error") end, function() return validations.isEmpty(inputTable["dhcpv6s.serverPreference"],"Server pref error") end, function() return validations.checkboxValidate(inputTable["dhcpv6s.useDNSServersFrom"],"3",2) end, function() return validations.ipv6AddrValidate(inputTable["dhcpv6s.primaryDNSServer"],"Primanry DNS error","skip") end, function() return validations.ipv6AddrValidate(inputTable["dhcpv6s.secondaryDNSServer"],"Secondary DNS Error","skip") end, function() return validations.checkboxValidate(inputTable["dhcpv6s.isEnabled"],"1",1) end, function() return validations.v6RbnTimeChk(inputTable["dhcpv6s.leaseTime"],"Lease Time error") end } while (tableIndex <= #(validationTable)) do validationFunc = validationTable[tableIndex] errorFlag, statusCode,field,skipValidations = validationFunc() if(errorFlag==1 or errorFlag == "ERROR") then statusMessage = db.getAttribute("stringsMap", "stringId", statusCode, LANGUAGE) or statusCode statusMessage = field .. ": " .. statusMessage break end if(skipValidations ~= "") then tableIndex = tableIndex + skipValidations + 1 else tableIndex = tableIndex + 1 end end if(errorFlag == "OK" or errorFlag == 0) then local where = "LogicalIfName = 'LAN' AND AddressFamily = '10'" local rowid = db.existsRowWhere ("ifStatic", where) errorFlag, statusCode = lan.obsoleteipv6LanConfig(inputTable, rowid , "edit") -- save db if no error if (errorFlag == "OK") then db.save() end statusMessage = db.getAttribute("stringsMap", "stringId", statusCode, LANGUAGE) end web.goToPage(NextPage, true, true) elseif(ButtonType and ButtonType == "add") then configRowId= "-1" web.goToPage(NextPage, true, true) elseif(ButtonType and ButtonType == "addAddressPool") then configRowId= "-1" if (cgi["hdCount"] ~= nil) then local hdCount = cgi["hdCount"] if (tonumber(hdCount) >= tonumber (maxLimitVal)) then statusMessage = "Can't add configuration to this table. Maximum limit reached." NextPage = "lanConfigIpv6" end end web.goToPage(NextPage, true, true) elseif(ButtonType and ButtonType == "edit") then -- if not allowed to edit if (ACCESS_LEVEL ~= 0) then NextPage = "lanConfigIpv6" statusMessage = db.getAttribute("stringsMap", "stringId", "ADMIN_REQD", LANGUAGE) else configRowId = RowId end web.goToPage(NextPage, true, true) elseif(ButtonType and ButtonType == "delete") then local field, splitted, rows = web.cgiSearch(cgi, "dhcpv6sLANAddrPool") -- if any rows to delete if (rows) then errorFlag, statusCode = lan.lanPoolsDelete(rows) end -- save db if no error if (errorFlag == "OK") then db.save() end statusMessage = db.getAttribute("stringsMap", "stringId", statusCode, LANGUAGE) web.goToPage(NextPage, true, true) elseif(ButtonType and ButtonType == "deleteV6") then local field, splitted, rows = web.cgiSearch(cgi, "dhcpv6sLANPrefixPool") -- if any rows to delete if (rows) then errorFlag, statusCode = lan.lanPrefixPoolsDelete(rows) end -- save db if no error if (errorFlag == "OK") then db.save() end statusMessage = db.getAttribute("stringsMap", "stringId", statusCode, LANGUAGE) or statusCode web.goToPage(NextPage, true, true) else configRow = db.getRow("dhcpv6s", "_ROWID_", "1") if (configRow == nil) then configRow = db.getDefaults(true, "dhcpv6s") end local staticRow = {} local where = "LogicalIfName = 'LAN' AND AddressFamily = '10'" local rowid = db.existsRowWhere ("ifStatic", where) staticRow = db.getRow("ifStatic", "_ROWID_", rowid ) if(staticRow ~= nil) then configRow["ifStatic.StaticIp"] = staticRow["ifStatic.StaticIp"] configRow["ifStatic.PrefixLength"] = staticRow["ifStatic.PrefixLength"] end ?> $|COMPANY_NAME|$ $|PRODUCT_FAMILY|$ - Ipv6 LAN Config
 
LAN Setup
 
IPv6
IPv4
 
 
$| statusMessage|$
IPv6 LAN Setup
IPv6 Address:
IPv6 Prefix Length:
 
 
DHCPv6
DHCP Status:
DHCP Mode:
Prefix Delegation:
Domain Name:
Server Preference:
DNS Servers:
Primary DNS Server:
Secondary DNS Server:
Lease/Rebind Time: (Seconds)
 
 
List of IPv6 Address Pools
  Start Address End Address Prefix Action
$|row["dhcpv6sLANAddrPool.startAddress"]|$ $|row["dhcpv6sLANAddrPool.endAddress"]|$ $|row["dhcpv6sLANAddrPool.prefixLength"]|$
List of prefixes for prefix delegation
  IPv6 Prefix IPv6 Prefix Length Action
$|rowLanPrefixPool["dhcpv6sLANPrefixPool.delegationPrefix"]|$ $|rowLanPrefixPool["dhcpv6sLANPrefixPool.delegationPrefixLen"]|$