function PolicyRouteItem(_Domain, _Type, _VenderClassId, _WanName, _EtherType,_PhyPortName) { this.Domain = _Domain; this.Type = _Type; this.VenderClassId = _VenderClassId; this.WanName = _WanName; this.EtherType = _EtherType; this.PhyPortName = _PhyPortName; } var PolicyRouteList = new Array(new PolicyRouteItem("InternetGatewayDevice.Layer3Forwarding.X_HW_policy_route.1","SourcePhyPort","","wan1","",""),new PolicyRouteItem("InternetGatewayDevice.Layer3Forwarding.X_HW_policy_route.2","SourcePhyPort","","wan2","",""),null); function GetPolicyRouteList() { return PolicyRouteList; } /* 构造特定列表 */ var LanWanBindList = new Array(); var AnyPortAnyServiceList = new Array(); var EthRouteList = new Array(); var PortVlanBindList = new Array(); var i=0,j=0,k=0,m=0,n=0; for (; i < PolicyRouteList.length-1; i++) { /* 处理LAN & WAN绑定 */ if (PolicyRouteList[i].Type == "SourcePhyPort") { LanWanBindList[j++] = PolicyRouteList[i]; } /* 处理AnyPortAnyServiceList */ if (PolicyRouteList[i].Type == "SoureIP") { AnyPortAnyServiceList[k++] = PolicyRouteList[i]; } /* 处理EthRouteList */ if (PolicyRouteList[i].Type == "EtherType") { EthRouteList[m++] = PolicyRouteList[i]; } /* Port Vlan WAN绑定 */ if (PolicyRouteList[i].Type == "PortVlan") { PortVlanBindList[n++] = PolicyRouteList[i]; } } function GetLanWanBindList() { return LanWanBindList; } function GetLanWanBindInfo(WanName) { var BindList = GetLanWanBindList(); for (var i = 0; i < BindList.length; i++) { if (WanName == BindList[i].WanName) { return BindList[i]; } } } function IsLanBindWithWan(Lanx) { var BindList = GetLanWanBindList(); for (var i = 0; i < BindList.length; i++) { if (BindList[i].PhyPortName.toUpperCase().indexOf(Lanx.toUpperCase()) >= 0) { return true; } } return false; } function GetAnyPortAnyServiceList() { return AnyPortAnyServiceList; } function GetEthRouteList() { return EthRouteList; } function GetPortVlanRouteList() { return PortVlanBindList; } function IsPortVlanBindWithWan(Lanx) { var BindList = GetPortVlanRouteList(); for (var i = 0; i < BindList.length; i++) { if (BindList[i].PhyPortName.toUpperCase().indexOf(Lanx.toUpperCase()) >= 0) { return true; } } return false; }