예제 #1
0
        /// <summary>
        /// Configures the router to use blueprint-based routing protocol.
        /// </summary>
        public static T UseMapBasedRoutingProtocol <T>(this RouterConfiguration config)
            where T : BlueprintAccessConfiguration, new()
        {
            var mapConfig = new T();
            var protocol  = new BlueprintBasedRouting(mapConfig);

            config.UseRoutingProtocol(protocol);
            return(mapConfig);
        }
예제 #2
0
        /// <summary>
        /// Configures the router to use static routing.
        /// </summary>
        /// <returns></returns>
        public static RouteTable UseStaticRoutingProtocol(this RouterConfiguration config)
        {
            if (config.RoutingProtocol is StaticRoutingProtocol existing)
            {
                return(existing.RouteTable);
            }
            var protocol = new StaticRoutingProtocol();

            config.UseRoutingProtocol(protocol);
            return(protocol.RouteTable);
        }