예제 #1
0
        public NE AddNE(string neName)
        {
            if (neName == "")
            {
                return(null);
            }
            NE cursor = head;

            while (cursor != null)
            {
                if (cursor.NEName == neName)
                {
                    return(cursor);
                }
                cursor = cursor.Next;
            }

            NE newNE = new NE();

            newNE.NEName = neName;
            if (head == null)
            {
                head = newNE;
                tail = newNE;
            }
            else
            {
                tail.Next = newNE;
                tail      = newNE;
            }
            return(newNE);
        }
예제 #2
0
        public void RemoveNE(string remNE)
        {
            if (remNE == "")
            {
                return;
            }
            NE cursor = head;

            while (cursor.Next.NEName != remNE)
            {
                cursor = cursor.Next;
            }
            if (cursor == null)
            {
                return;
            }
            cursor.Next = cursor.Next.Next;
        }
예제 #3
0
        public void RemoveSlotPort(string remNE, string sp)
        {
            if ((remNE == "") || (sp == ""))
            {
                return;
            }
            NE cursor = head;

            while ((cursor.NEName != remNE) && (cursor != null))
            {
                cursor = cursor.Next;
            }
            if (cursor == null)
            {
                return;
            }
            cursor.RemoveSlotPort(sp);
            if (cursor.SlotPorts == null)
            {
                RemoveNE(remNE);
            }
        }
예제 #4
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
            }
        }
예제 #5
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
예제 #6
0
 public NEList()
 {
     count = 0;
     head  = null;
     tail  = null;
 }
예제 #7
0
 public NE()
 {
     neName    = "";
     slotPorts = null;
     next      = null;
 }