public ReloadDialog(ReloadConfig reloadConfig, IForwardLinkManagement transport, Node nexthopnode) { this.m_NextHopNode = nexthopnode; this.m_Transport = transport; this.m_fDone = new Port<bool>(); this.m_DispatcherQueue = reloadConfig.DispatcherQueue; this.m_ReloadConfig = reloadConfig; m_Transport.ReloadFLMEventHandler += new ReloadFLMEvent(OVL_ReloadForwardLinkManagementEventHandler); if(nexthopnode.IceCandidates == null) throw new System.Exception(String.Format("ReloadDialog: no ice candidates for {0} ", nexthopnode.Id)); }
public ForwardingLayer(Machine machine) { m_transport = machine.Transport; m_topology = machine.Topology; m_flm = machine.Interface_flm; m_ReloadConfig = machine.ReloadConfig; }
public void Init(Machine machine) { m_machine = machine; m_topology = machine.Topology; m_forwarding = machine.Forwarding; m_flm = machine.Interface_flm; m_DispatcherQueue = machine.ReloadConfig.DispatcherQueue; m_ReloadConfig = machine.ReloadConfig; m_statistics = m_ReloadConfig.Statistics; }
public RoutingTable(Node local_node, Machine machine) { m_ReloadConfig = machine.ReloadConfig; m_flm = machine.Interface_flm; m_DispatcherQueue = machine.ReloadConfig.DispatcherQueue; m_transport = machine.Transport; m_local_node = local_node; m_successors = new List<NodeId>(); m_predecessors = new List<NodeId>(); m_fingerSuccessors = new List<NodeId>(); for (int i = 0; i < 128; i++) m_FingerTable.Add(new FTableEntry() { Finger = new ResourceId(local_node.Id + ReloadGlobals.BigIntPow2Array[i]), dtLastSuccessfullFinger = DateTime.MinValue, nodestate = NodeState.unknown }); /* A peer MUST NOT enter itself in its successor or predecessor table and instead should leave the entries empty. */ }
public bool Init() { try { if (ReloadGlobals.IgnoreSSLErrors) IgnoreSSLErrors(); m_transport = new MessageTransport(); if (ReloadGlobals.TLS) m_interface_flm = new ReloadFLM(ReloadConfig); else m_interface_flm = new SimpleFLM(ReloadConfig); ReloadConfig.Statistics.SetParams(m_interface_flm); m_interface_flm.ReloadFLMEventHandler += new ReloadFLMEvent(m_transport.rfm_ReloadFLMEventHandler); ReloadConfig.State = ReloadConfig.RELOAD_State.Init; stateUpdates(ReloadConfig.RELOAD_State.Init); ReloadConfigResolve resolve = new ReloadConfigResolve(ReloadConfig); resolve.ReadConfig(); if (ReloadGlobals.TLS) resolve.EnrollmentProcedure(); else resolve.SimpleNodeIdRequest(); m_interface_flm.Init(); m_ReloadConfig.AccessController = new AccessController(m_ReloadConfig); m_topology = new TopologyPlugin(this); if (!m_topology.Init(this)) return false; m_forwarding = new ForwardingLayer(this); m_transport.Init(this); //ReloadConfig.State = ReloadConfig.RELOAD_State.Configured; //stateUpdates(ReloadConfig.RELOAD_State.Configured); BootStrapConfig(); m_ReloadConfig.StartJoining = DateTime.Now; if (m_ReloadConfig.IamClient) m_ReloadConfig.StartJoinMobile = DateTime2.Now; if (!ReloadConfig.IsBootstrap) Arbiter.Activate(ReloadConfig.DispatcherQueue, new IterativeTask<List<BootstrapServer>>(m_BootstrapServerList, m_transport.PreJoinProdecure)); // m_worker_thread.ReportProgress(100); --joscha InitUsageManager(); ReloadConfig.State = ReloadConfig.RELOAD_State.Configured; stateUpdates(ReloadConfig.RELOAD_State.Configured); /* reporting service */ Arbiter.Activate(ReloadConfig.DispatcherQueue, new IterativeTask(Reporting)); /* chord-ping-interval */ Arbiter.Activate(ReloadConfig.DispatcherQueue, new IterativeTask(Maintenance)); /* chord-update-interval */ Arbiter.Activate(ReloadConfig.DispatcherQueue, new IterativeTask(UpdateCycle)); Arbiter.Activate(ReloadConfig.DispatcherQueue, new IterativeTask(CommandCheckTask)); } catch (Exception ex) { ReloadConfig.Logger(ReloadGlobals.TRACEFLAGS.T_ERROR, "Init: " + ex.Message); } return true; }
public void Finish() { ReloadConfig.Logger(ReloadGlobals.TRACEFLAGS.T_INFO, "Shutdown..."); // delete local certificate X509Store store = new X509Store(StoreName.My, StoreLocation.CurrentUser); store.Open(OpenFlags.ReadWrite); store.Remove(m_ReloadConfig.MyCertificate); store.Close(); ReloadConfig.Logger(ReloadGlobals.TRACEFLAGS.T_INFO, "Deleted Local Certificate"); ReloadConfig.State = ReloadConfig.RELOAD_State.Exit; stateUpdates(ReloadConfig.RELOAD_State.Exit); try { if (m_interface_flm != null) { m_interface_flm.ShutDown(); m_interface_flm = null; } } catch (Exception ex) { ReloadConfig.Logger(ReloadGlobals.TRACEFLAGS.T_ERROR, "Link Shutdown: " + ex.Message); } try { ReloadConfig.State = 0; /* if (ReloadConfig.DispatcherQueue != null) ReloadConfig.DispatcherQueue.Dispose(); */ if (ReloadConfig.Dispatcher != null) ReloadConfig.Dispatcher.Dispose(); ReloadConfig.State = ReloadConfig.RELOAD_State.Exit; // ReloadConfig.DispatcherQueue = null; ReloadConfig.Dispatcher = null; } catch (Exception ex) { ReloadConfig.Logger(ReloadGlobals.TRACEFLAGS.T_ERROR, "Dispatcher Dispose: " + ex.Message); } }
public void SetParams(IForwardLinkManagement ifc) { m_interface_flm = ifc; }