Example #1
0
        public static void Main(string[] args)
        {
            DefaultStartup <NetworkNode> defaultStartup = new DefaultStartup <NetworkNode>();

            defaultStartup.InitArgumentParse(args);

            IConfigurationParser <Configuration> configurationParser;

            if (defaultStartup.ChooseXmlParser())
            {
                configurationParser = new XmlConfigurationParser(defaultStartup.Filename);
            }
            else
            {
                configurationParser = new MockConfigurationParser();
            }

            Configuration configuration = configurationParser.ParseConfiguration();

            defaultStartup.InitLogger(configuration.RouterAlias);

            IPacketForwarder packetForwarder = new MplsPacketForwarder();
            //IPacketForwarder packetForwarder = new MockPacketForwarder(configuration);
            IPersistentClientPortFactory <EonPacket> clientPortFactory =
                new PersistentClientPortFactory <EonPacket>(configuration.CableCloudAddress, configuration.CableCloudPort);
            IManager networkNodeManager = new NetworkNodeManager(configuration, packetForwarder, clientPortFactory);

            defaultStartup.SetTitle(configuration.RouterAlias);

            networkNodeManager.Start();
        }
Example #2
0
        public static void Main(string[] args)
        {
            DefaultStartup <CableCloud> defaultStartup = new DefaultStartup <CableCloud>();

            defaultStartup.InitArgumentParse(args);

            IConfigurationParser <Configuration> configurationParser;

            if (defaultStartup.ChooseXmlParser())
            {
                configurationParser = new XmlConfigurationParser(defaultStartup.Filename);
            }
            else
            {
                configurationParser = new MockConfigurationParser();
            }

            Configuration configuration = configurationParser.ParseConfiguration();

            defaultStartup.InitLogger(null);

            IWorkerFactory <EonPacket>        clientWorkerFactory = new WorkerFactory <EonPacket>();
            IPersistentServerPort <EonPacket> serverPort          = new PersistentServerPort <EonPacket>(configuration.ListeningAddress, configuration.ListeningPort, clientWorkerFactory);
            IPacketForwarder packetForwarder = new PacketForwarder(configuration);

            ICableCloudManager cableCloudManager = new CableCloudManager(serverPort, packetForwarder);

            ICommandParser commandParser = new CommandParser(configuration);
            IUserInterface userInterface = new UserInterface(commandParser, cableCloudManager);

            defaultStartup.SetTitle("CC");

            userInterface.Start();
        }
        public static void Main(string[] args)
        {
            DefaultStartup <RoutingController> defaultStartup = new DefaultStartup <RoutingController>();

            defaultStartup.InitArgumentParse(args);
            IConfigurationParser <Configuration> configurationParser;

            if (defaultStartup.ChooseXmlParser())
            {
                configurationParser = new XmlConfigurationParser(defaultStartup.Filename);
            }
            else
            {
                configurationParser = new MockConfigurationParser();
            }

            defaultStartup.InitLogger(null);

            Configuration configuration = configurationParser.ParseConfiguration();

            IRcState rcState = new RcState(configuration.RouteTable);

            defaultStartup.SetTitle($"RC_{configuration.ComponentName}");

            IManager routingControllerManager = new RoutingControllerManager(configuration,
                                                                             rcState.OnRouteTableQuery,
                                                                             rcState.OnLocalTopology,
                                                                             rcState.OnNetworkTopology);

            routingControllerManager.Start();
        }
Example #4
0
        protected IServiceProvider BuildServices(Action <IServiceCollection> configureAction = null)
        {
            var serviceCollection = new ServiceCollection();
            var startup           = new DefaultStartup(Configuration);

            startup.ConfigureServices(serviceCollection);
            serviceCollection.AddLogging(builder => builder.AddSerilog());
            configureAction?.Invoke(serviceCollection);
            return(serviceCollection.BuildServiceProvider());
        }
Example #5
0
        public static void Main(string[] args)
        {
            DefaultStartup <ConnectionController> defaultStartup = new DefaultStartup <ConnectionController>();

            defaultStartup.InitArgumentParse(args);
            IConfigurationParser <Configuration> configurationParser;

            if (defaultStartup.ChooseXmlParser())
            {
                configurationParser = new XmlConfigurationParser(defaultStartup.Filename);
            }
            else
            {
                configurationParser = new MockConfigurationParser();
            }

            defaultStartup.InitLogger(null);

            Configuration configuration = configurationParser.ParseConfiguration();

            IConnectionControllerState connectionControllerState = configuration.ConnectionControllerType switch
            {
                "node" => new ConnectionControllerStateNode(configuration.ServerAddress,
                                                            configuration.CcPeerCoordinationRemotePorts,
                                                            configuration.LrmRemotePorts,
                                                            configuration.CcNames,
                                                            configuration.NnFibInsertRemotePort,
                                                            configuration.RcRouteTableQueryRemotePort),
                "domain" => new ConnectionControllerStateDomain(configuration.ServerAddress,
                                                                configuration.CcConnectionRequestRemotePorts,
                                                                configuration.CcNames),
                "subnetwork" => new ConnectionControllerStateSubnetwork(configuration.ServerAddress,
                                                                        configuration.CcPeerCoordinationRemotePorts,
                                                                        configuration.CcConnectionRequestRemotePorts,
                                                                        configuration.LrmRemotePorts,
                                                                        configuration.CcNames,
                                                                        configuration.RcRouteTableQueryRemotePort),
                _ => throw new Exception("Not a known ConnectionController type")
            };
            IManager connectionControllerManager = new ConnectionControllerManager(configuration,
                                                                                   connectionControllerState.OnConnectionRequest,
                                                                                   connectionControllerState.OnPeerCoordination);

            defaultStartup.SetTitle($"CC_{configuration.ComponentName}");
            connectionControllerManager.Start();
        }
    }
Example #6
0
        public static void Main(string[] args)
        {
            DefaultStartup <ClientNode> defaultStartup = new DefaultStartup <ClientNode>();

            defaultStartup.InitArgumentParse(args);

            IConfigurationParser <Configuration> configurationParser;

            if (defaultStartup.ChooseXmlParser())
            {
                configurationParser = new XmlConfigurationParser(defaultStartup.Filename);
            }
            else
            {
                configurationParser = new MockConfigurationParser();
            }

            Configuration configuration = configurationParser.ParseConfiguration();

            defaultStartup.InitLogger(configuration.ClientAlias);

            CpccState cpccState = new CpccState(configuration.NccConnectionRequestRemoteAddress,
                                                configuration.NccConnectionRequestRemotePort,
                                                configuration.NccCallTeardownRemoteAddress,
                                                configuration.NccCallTeardownRemotePort);

            ICommandParser commandParser = new CommandParser(configuration);
            IPersistentClientPort <EonPacket> clientPort = new PersistentClientPort <EonPacket>(configuration.ClientPortAlias,
                                                                                                configuration.CableCloudAddress, configuration.CableCloudPort);
            IClientNodeManager clientNodeManager = new ClientNodeManager(configuration,
                                                                         clientPort,
                                                                         cpccState.OnCallAccept);

            IUserInterface userInterface = new UserInterface(commandParser, clientNodeManager, cpccState, configuration.ClientAlias);

            defaultStartup.SetTitle(configuration.ClientAlias);

            userInterface.Start();
        }
Example #7
0
        public static void Main(string[] args)
        {
            DefaultStartup <NetworkCallController> defaultStartup = new DefaultStartup <NetworkCallController>();

            defaultStartup.InitArgumentParse(args);
            IConfigurationParser <Configuration> configurationParser;

            if (defaultStartup.ChooseXmlParser())
            {
                configurationParser = new XmlConfigurationParser(defaultStartup.Filename);
            }
            else
            {
                configurationParser = new MockConfigurationParser();
            }

            defaultStartup.InitLogger(null); // TODO: Set log suffix from configuration

            Configuration configuration = configurationParser.ParseConfiguration();

            NccState nccState = new NccState(configuration.ClientPortAliases,
                                             configuration.PortDomains,
                                             configuration.Domain,
                                             configuration.ServerAddress,
                                             configuration.ConnectionRequestRemotePort,
                                             configuration.CallCoordinationRemotePort);

            IManager networkCallControllerManager = new NetworkCallControllerManager(configuration,
                                                                                     nccState.OnCallCoordinationReceived,
                                                                                     nccState.OnCallTeardownReceived,
                                                                                     nccState.OnCallRequestReceived);

            // TODO: Those are only empty delegates, make proper ones: 2 left

            defaultStartup.SetTitle($"NCC_{configuration.Domain}");

            networkCallControllerManager.Start();
        }