public NetworkPeerService(NetworkPeerStorage p, WinDHCP.Library.DhcpServer dhcpManager) { this.storage = p; init(); if (isSetIP) { dhcpManager.addReservation(storage.MACAddress, storage.IPAddress); if (isSetHostName) updateHostName(storage.HostName); } }
public NetworkPeerService(NetworkPeerStorage p, WinDHCP.Library.DhcpServer dhcpManager) { this.storage = p; init(); if (isSetIP) { dhcpManager.addReservation(storage.MACAddress, storage.IPAddress); if (isSetHostName) { updateHostName(storage.HostName); } } }
public void SaveConfig() { Trace.TraceInformation("Getaway saving config"); var serviceState = new softGetawayServiceState(); serviceState.active = shouldStart_; var connGuid = GetSharedConnection(); if (connGuid != null) { serviceState.publicConnectionGuid = connGuid; } var connSettings = GetPrivateConnectionSettings(); serviceState.wifiSSID = connSettings.SSID; serviceState.limitClientsCount = connSettings.MaxPeerCount; serviceState.wifiPassword = connSettings.Password; serviceState.privateIP = GetIP(); objectToFile(strStateFileName + "config", serviceState); var peersState = new softGetawayPeersStorage(); foreach (var peerService in GetPeers()) { NetworkPeerStorage storage = (NetworkPeerStorage)peerService.storage.Clone(); if (!peerService.isSetHostName) { storage.HostName = null; } if (!peerService.isSetIP) { storage.IPAddress = null; } peersState.peers.Add(storage); } objectToFile(strStateFileName + "peers", peersState); Trace.TraceInformation("Getaway config saved"); }
public NetworkPeerService() { storage = new NetworkPeerStorage(); }
internal void AddPeerFromStorage(NetworkPeerStorage p) { Peers[p.MACAddress] = new NetworkPeerService(p, dhcpManager); }