public void TestDelRoutingRecord()
        {
            RoutingRecord record = new RoutingRecord();

            record.SetParameters("5.5.5.5", "255.0.0.0", "2.2.2.2", 7);
            router.DeleteRoutingRecord(record);
            Assert.AreEqual(((TestRoutingTable)routingTable).table.Count, 1);
        }
        public void TestAddRoutingRecord()
        {
            RoutingRecord record = new RoutingRecord();

            record.SetParameters("192.168.1.2", "255.255.255.0", "3.3.3.3", 12);
            router.AddRoutingRecord(record);
            Assert.AreEqual(((TestRoutingTable)routingTable).table.Count, 3);
        }
示例#3
0
        public void Load()
        {
            table = new List <RoutingRecord>();
            RoutingRecord record = new RoutingRecord();

            record.SetParameters("192.168.1.1", "255.255.255.0", "1.1.2.1", 6);
            table.Add(record);
            record = new RoutingRecord();
            record.SetParameters("5.5.5.5", "255.0.0.0", "2.2.2.2", 7);
            table.Add(record);
        }
示例#4
0
        public void SetupRoutingDataGridView()
        {
            this.Controls.Add(DataView);
            DataView.ColumnCount = 4;
            DataView.Name        = "RouterTable";

            DataView.Columns[0].Name = "sessionID";
            DataView.Columns[1].Name = "inFiber";
            DataView.Columns[2].Name = "indexOfChannel";
            DataView.Columns[3].Name = "outFiber";
            for (int i = 0; i < router.PubRoutingTable.Count; i++)
            {
                RoutingRecord RoutingRow = new RoutingRecord(router.PubRoutingTable.ElementAt(i).SessionID,
                                                             router.PubRoutingTable.ElementAt(i).InFiberID,
                                                             router.PubRoutingTable.ElementAt(i).IndexOfChannel,
                                                             router.PubRoutingTable.ElementAt(i).OutFiberID);
                string[] row = { RoutingRow.SessionID.ToString(),
                                 RoutingRow.InFiberID.ToString(),
                                 RoutingRow.IndexOfChannel.ToString(),
                                 RoutingRow.OutFiberID.ToString() };
                DataView.Rows.Add(row);
            }
            DataView.Show();
        }
示例#5
0
 public void DelRecord(RoutingRecord record)
 {
     table.Remove(record);
 }
示例#6
0
 public void AddRecord(RoutingRecord record)
 {
     table.Add(record);
 }