public static void Handle() { if (GlobalVariables.GVars.EnableUPnP) { UPnPHandler.AddPortForward(GVars.Port, Convert.ToString(GVars.IP)); } }
public UpnpLog(UpnpSetup setup) { InitializeComponent(); Setup = setup; UPnP = Setup.UPnP; RefreshView(); }
public UpnpSetup(OpCore core) { InitializeComponent(); Core = core; UPnP = core.Network.UPnPControl; UPnP.Logging = true; UPnP.Log.SafeClear(); RefreshInterface(); }
public DhtNetwork(OpCore core, bool lookup) { Core = core; IsLookup = lookup; Cache = new OpCache(this); // lookup config loads cache entries if (IsLookup) { Core.Context.LookupConfig.Load(this); Lookup = Core.Context.LookupConfig; } Local = new DhtClient(); Local.UserID = IsLookup ? Lookup.Ports.UserID : Utilities.KeytoID(Core.User.Settings.KeyPublic); Local.ClientID = (ushort)Core.RndGen.Next(1, ushort.MaxValue); OpID = Utilities.KeytoID(IsLookup ? LookupKey : Core.User.Settings.OpKey); OpCrypt = new RijndaelManaged(); // load encryption if (IsLookup) { OpCrypt.Key = LookupKey; } else { OpCrypt.Key = Core.User.Settings.OpKey; } LocalAugmentedKey = GetAugmentedKey(Local.UserID); Protocol = new G2Protocol(); TcpControl = new TcpHandler(this); UdpControl = new UdpHandler(this); LanControl = new LanHandler(this); RudpControl = new RudpHandler(this); LightComm = new LightCommHandler(this); UPnPControl = new UPnPHandler(this); Routing = new DhtRouting(this); Store = new DhtStore(this); Searches = new DhtSearchControl(this); }
public DhtNetwork(OpCore core, bool lookup) { Core = core; IsLookup = lookup; Cache = new OpCache(this); // lookup config loads cache entries if (IsLookup) { Core.Context.LookupConfig.Load(this); Lookup = Core.Context.LookupConfig; } Local = new DhtClient(); Local.UserID = IsLookup ? Lookup.Ports.UserID : Utilities.KeytoID(Core.User.Settings.KeyPublic); Local.ClientID = (ushort)Core.RndGen.Next(1, ushort.MaxValue); OpID = Utilities.KeytoID(IsLookup ? LookupKey : Core.User.Settings.OpKey); OpCrypt = new RijndaelManaged(); // load encryption if (IsLookup) OpCrypt.Key = LookupKey; else OpCrypt.Key = Core.User.Settings.OpKey; LocalAugmentedKey = GetAugmentedKey(Local.UserID); Protocol = new G2Protocol(); TcpControl = new TcpHandler(this); UdpControl = new UdpHandler(this); LanControl = new LanHandler(this); RudpControl = new RudpHandler(this); LightComm = new LightCommHandler(this); UPnPControl = new UPnPHandler(this); Routing = new DhtRouting(this); Store = new DhtStore(this); Searches = new DhtSearchControl(this); }