예제 #1
0
 public static Neighbor Create(OspfModule module, RoutingController controller, Interface ospfInterface, IPAddress source, IPAddress rid, OspfOptions options, byte priority, IPAddress dr, IPAddress bdr)
 {
     var n = new Neighbor
            {
                _controller = controller,
                Module = module,
                Interface = ospfInterface,
                RouterID = rid,
                DiscoveredOptions = options,
                //TODO: is THIS the source??
                Address = source,
                Priority = priority,
                OspfNeighborState = OspfNeighborState.Down,
                DR = dr,
                BDR = bdr,
                LastSeen = DateTime.Now
            };
     n.Init();
     return n;
 }
예제 #2
0
 public static Interface Create(OspfModule module, RoutingController controller, string deviceID, Area area, InterfaceElement config)
 {
     var interfc = new Interface
                   {
                       Module = module,
                       _controller = controller,
                       DeviceID = deviceID,
                       Area = area,
                       _config = config,
                       InterfaceState = InterfaceState.Down
                   };
     interfc.Priority = config.Priority;
     interfc.OspfNetworkType = config.Type;
     interfc.HelloInterval = config.HelloInterval;
     interfc.RouterDeadInterval = config.RouterDeadInterval;
     interfc.RxmtInterval = config.RxmtInterval;
     //interfc.NeighborSelf = Neighbor.Create(module, controller, interfc, controller.DeviceConfigurationMap[deviceID].PrimaryIPConfiguration.Address, module.RouterID,
     //                                       new OspfOptions(), config.Priority);
     return interfc;
 }