Exemplo n.º 1
0
 private List <string[]> addressTranslation; //IPaddress - localPort
 public ConnectionController(FIB fib, List <InPort> ports)
 {
     this.fib           = fib;
     inPorts            = ports;
     addressTranslation = new List <string[]>();
     LoadTransationTableFromFile();
 }
Exemplo n.º 2
0
        public LabelSwitchingRouter()
        {
            fib = new FIB();
            numberOfInputModules  = GetInputModulesNumber();
            numberOfOutputModules = GetOutputModulesNumber();
            inPorts  = new List <InPort>();
            outPorts = new List <OutPort>();

            CreateInPorts(numberOfInputModules);
            CreateOutPorts(numberOfOutputModules);
        }
Exemplo n.º 3
0
 public LabelSwitchingRouter()
 {
     fib = new FIB();
     numberOfInputModules  = GetInputModulesNumber();
     numberOfOutputModules = GetOutputModulesNumber();
     inPorts               = new List <InPort>();
     outPorts              = new List <OutPort>();
     sendingTimer          = new Timer();
     sendingTimer.Interval = Config.getIntegerProperty("SendingInterval");
     sendingTimer.Elapsed += new ElapsedEventHandler(OnTimedEvent);
     sendingTimer.Enabled  = true;
     //agent = new RouterAgent(fib, inPorts);          //łączność z NMSem, teraz niepotrzebna
     CC = new ConnectionController(fib, inPorts);
     CreateInPorts(numberOfInputModules);
     CreateOutPorts(numberOfOutputModules);
     LogClass.WhiteLog("Created LSR");
     ParentSubnetworkConnector.Init(CC);
 }
Exemplo n.º 4
0
        public RouterAgent(FIB fib, List <InPort> inPorts)
        {
            this.fib     = fib;
            inCommand    = new Command();
            outCommand   = new Command();
            this.inPorts = inPorts;
            _interface   = Config.getProperty("NMSInterface");
            outport      = Config.getIntegerProperty("NMSListenPort");
            init();
            LogClass.WhiteLog("Established connection with NMS");
            SendSingleCommand(_interface, outport);
            LogClass.WhiteLog("Sent hello message");

            inputSocket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
            IPAddress  ipAdd    = IPAddress.Parse("127.0.0.1");
            IPEndPoint remoteEP = new IPEndPoint(ipAdd, outport);

            inputSocket.Bind(remoteEP);

            Listen();
        }
Exemplo n.º 5
0
 public InPort(int portNumber, List <Entry> routingTable)
 {
     this.portNumber = portNumber;
     fib             = new FIB(routingTable);
 }
Exemplo n.º 6
0
 public InPort(int portNumber, FIB subMasterFIB)
 {
     this.portNumber = portNumber;
     fib             = subMasterFIB;
 }