Exemplo n.º 1
0
        } //AddService

        public void AddTunnel(Tunnel _t)
        {
            if (_t == null)
            {
                return;
            }
            NE       tmpNE = null;
            SlotPort tmpSP = null;

            if ((_t.SnkInterface != null) && (_t.SnkInterface.NEName != ""))
            {
                tmpNE = AddNE(_t.SnkInterface.NEName);
                if (tmpNE != null)
                {
                    if (_t.SnkInterface.SlotPort != null)
                    {
                        tmpSP = tmpNE.AddSlotPort(_t.SnkInterface.SlotPort);
                    }
                    if (tmpSP != null)
                    {
                        tmpSP.AddTunnel(_t);
                    }
                }
            }
            if ((_t.SrcInterface != null) && (_t.SrcInterface.NEName != ""))
            {
                tmpNE = AddNE(_t.SrcInterface.NEName);
                if (tmpNE != null)
                {
                    if (_t.SrcInterface.SlotPort != null)
                    {
                        tmpSP = tmpNE.AddSlotPort(_t.SrcInterface.SlotPort);
                    }
                    if (tmpSP != null)
                    {
                        tmpSP.AddTunnel(_t);
                    }
                }
            }
            if (_t.TransitNE != null)
            {
                foreach (TransitNE tmpTrNE in _t.TransitNE)
                {
                    if ((tmpTrNE.NEName != null) && (tmpTrNE.NEName != ""))
                    {
                        tmpNE = AddNE(tmpTrNE.NEName);
                        if (tmpNE != null)
                        {
                            if (tmpTrNE.InSlotPort != null)
                            {
                                tmpSP = tmpNE.AddSlotPort(tmpTrNE.InSlotPort);
                            }
                            if (tmpSP != null)
                            {
                                tmpSP.AddTunnel(_t);
                            }
                            if (tmpTrNE.OutSlotPort != null)
                            {
                                tmpSP = tmpNE.AddSlotPort(tmpTrNE.OutSlotPort);
                            }
                            if (tmpSP != null)
                            {
                                tmpSP.AddTunnel(_t);
                            }
                        }
                    }
                } //forech
            }
        }
Exemplo n.º 2
0
        public void AddService(Service _s)
        {
            if (_s == null)
            {
                return;
            }
            NE       tmpNE = null;
            SlotPort tmpSP = null;

            if ((_s.SrcInterfaceWork != null) && (_s.SrcInterfaceWork.NEName != ""))
            {
                tmpNE = AddNE(_s.SrcInterfaceWork.NEName);
                if (tmpNE != null)
                {
                    if (_s.SrcInterfaceWork.SlotPort != null)
                    {
                        tmpSP = tmpNE.AddSlotPort(_s.SrcInterfaceWork.SlotPort);
                    }
                    if (tmpSP != null)
                    {
                        tmpSP.AddService(_s);
                    }
                }
            }
            if ((_s.SrcInterfaceProt != null) && (_s.SrcInterfaceProt.NEName != ""))
            {
                tmpNE = AddNE(_s.SrcInterfaceProt.NEName);
                if (tmpNE != null)
                {
                    if (_s.SrcInterfaceProt.SlotPort != null)
                    {
                        tmpSP = tmpNE.AddSlotPort(_s.SrcInterfaceProt.SlotPort);
                    }
                    if (tmpSP != null)
                    {
                        tmpSP.AddService(_s);
                    }
                }
            }
            if ((_s.SnkInterfaceWork != null) && (_s.SnkInterfaceWork.NEName != ""))
            {
                tmpNE = AddNE(_s.SnkInterfaceWork.NEName);
                if (tmpNE != null)
                {
                    if (_s.SnkInterfaceWork.SlotPort != null)
                    {
                        tmpSP = tmpNE.AddSlotPort(_s.SnkInterfaceWork.SlotPort);
                    }
                    if (tmpSP != null)
                    {
                        tmpSP.AddService(_s);
                    }
                }
            }
            if ((_s.SnkInterfaceProt != null) && (_s.SnkInterfaceProt.NEName != ""))
            {
                tmpNE = AddNE(_s.SnkInterfaceProt.NEName);
                if (tmpNE != null)
                {
                    if (_s.SnkInterfaceProt.SlotPort != null)
                    {
                        tmpSP = tmpNE.AddSlotPort(_s.SnkInterfaceProt.SlotPort);
                    }
                    if (tmpSP != null)
                    {
                        tmpSP.AddService(_s);
                    }
                }
            }
        } //AddService