Files
cms_thermo_active/Thermo.Active.CmsConnectGateway/Models/GatewayConfiguration.cs
T
2020-06-19 19:28:07 +02:00

54 lines
2.4 KiB
C#

using System;
using System.Collections.Generic;
using System.Net;
namespace Thermo.Active.CmsConnectGateway
{
public enum GatewayConnectionStatus { OK = 0, WEB_ERROR = 1, PORT_ERROR = 2 };
public class GatewayNetworkConfiguration
{
internal GatewayNetworkConfiguration() { }
public Boolean hasDhcp { get; internal set; }
public IPAddress ipAddress { get; internal set; }
public IPAddress netMaskAddress { get; internal set; }
public IPAddress defaultGatewayAddress { get; internal set; }
public IEnumerable<IPAddress> dnsAddresses { get; internal set; }
public IEnumerable<string> dnsPrefixes { get; internal set; }
public override string ToString()
{
return "hasDhcp: " + hasDhcp + Environment.NewLine +
"ipAddress: " + (ipAddress != null ? ipAddress.ToString() : "null") + Environment.NewLine +
"netMaskAddress: " + (netMaskAddress != null ? netMaskAddress.ToString() : "null") + Environment.NewLine +
"defaultGatewayAddress: " + (defaultGatewayAddress != null ? defaultGatewayAddress.ToString() : "null") + Environment.NewLine +
"dnsAddresses: " + (dnsAddresses != null ? string.Join(",", dnsAddresses) : "null") + Environment.NewLine +
"dnsPrefixes: " + (dnsPrefixes != null ? string.Join(",", dnsPrefixes) : "null");
}
}
public class GatewayProxyConfiguration
{
internal GatewayProxyConfiguration() { }
public Boolean hasProxy { get; internal set; }
public string address { get; internal set; }
public uint port { get; internal set; }
public string username { get; internal set; }
public string password { get; internal set; }
public IEnumerable<string> noproxyAddresses { get; internal set; }
public override string ToString()
{
return "hasProxy: " + hasProxy + Environment.NewLine +
"address: " + (address != null ? address.ToString() : "null") + Environment.NewLine +
"port: " + (port != 0 ? port.ToString() : "null") + Environment.NewLine +
"username: " + (username != null ? username : "null") + Environment.NewLine +
"password: " + (password != null ? password : "null") + Environment.NewLine +
"noproxyAddresses: " + (noproxyAddresses != null ? string.Join(",", noproxyAddresses) : "null");
}
}
}