Ejemplo n.º 1
0
 public Wezel(int id, string ip, EONTable table) : this()
 {
     this.identyfikatorWezla = id;
     this.ip   = ip;
     this.SNPP = new SubNetworkPointPool(new SubNetworkPoint(IPAddress.Parse(this.ip)));
     this.SNPP.snps[0].eonTable = table;
 }
Ejemplo n.º 2
0
        public void testCheckAvailability2()
        {
            EONTable ET = new EONTable();

            short frequencyIn  = 1;
            short bandIN       = 63;
            short frequencyOut = 0;
            short bandOut      = 64;

            EONTableRowIN  rowIn  = new EONTableRowIN(frequencyIn, bandIN);
            EONTableRowOut rowOut = new EONTableRowOut(frequencyOut, bandOut);

            //Pasma powinny byc teraz wolne
            Assert.IsTrue(ET.CheckAvailability(frequencyIn, bandIN, "in"));
            Assert.IsTrue(ET.CheckAvailability(frequencyOut, bandOut, "out"));
            Assert.IsTrue(ET.CheckAvailability(rowIn));
            Assert.IsTrue(ET.CheckAvailability(rowOut));

            ET.addRow(rowIn);
            ET.addRow(rowOut);

            //Po dodaniu pasma powinny byc zajete
            Assert.IsFalse(ET.CheckAvailability(frequencyIn, bandIN, "in"));
            Assert.IsFalse(ET.CheckAvailability(frequencyOut, bandOut, "out"));
            Assert.IsFalse(ET.CheckAvailability(rowIn));
            Assert.IsFalse(ET.CheckAvailability(rowOut));
        }
Ejemplo n.º 3
0
 public SubNetworkPoint()
 {
     this.ipaddress = IPAddress.Parse("127.0.0.1");
     this.state     = STATE.AVAILABLE;
     this.portIN    = -1;
     this.portOUT   = -1;
     this.eonTable  = new EONTable();
 }
Ejemplo n.º 4
0
        public void testFindFrequency()
        {
            EONTable ET = new EONTable();

            //zapychamy łącze od 0 do 31
            ET.addRow(new EONTableRowIN(0, 32));
            ET.addRow(new EONTableRowIN(35, 29));

            Assert.IsTrue(ET.CheckAvailability(new EONTableRowIN(32, 3)));

            Assert.AreEqual(32, ET.FindFreeFrequency(3, "in"));
            Assert.AreEqual(-1, ET.FindFreeFrequency(4, "in"));

            //zapychamy łącze od 0 do 31
            ET.addRow(new EONTableRowOut(0, 32));
            ET.addRow(new EONTableRowOut(35, 29));

            Assert.IsTrue(ET.CheckAvailability(new EONTableRowOut(32, 3)));

            Assert.AreEqual(32, ET.FindFreeFrequency(3, "out"));
            Assert.AreEqual(-1, ET.FindFreeFrequency(4, "out"));
        }
Ejemplo n.º 5
0
 public void addLink(Lacze l)
 {
     network.krawedzie.Add(l);
     network.aktualizujLiczniki();
     EONTable e = new EONTable();
 }