Files
activestep/Step.CmsConnectGateway/Models/GatewayConfiguration.cs
T
2020-09-12 16:11:43 +02:00

57 lines
2.6 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Net;
namespace Step.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");
}
}
}