24 using Newtonsoft.Json;
30 namespace Ntp.Analyzer.Objects
38 public string Url {
get;
set; }
44 public string Iso {
get;
set; }
46 public override string Country => Iso;
51 [JsonProperty(
"location")]
52 public string LocationRaw {
get;
set; }
54 public override string Location => LocationRaw;
56 public override string DisplayLocation => Location.Substring(0, 60);
61 [JsonProperty(
"sponsor")]
62 public string Sponsor {
get;
set; }
64 public override string Organization => Sponsor;
71 [JsonProperty(
"service_area")]
72 public string ServiceAreaRaw {
get;
set; }
74 public override string ServiceArea => ServiceAreaRaw;
76 [JsonProperty(
"access")]
77 public string Access {
get;
set; }
79 public override string AccessPolicy => Access;
86 [JsonProperty(
"notify")]
87 public string NotifyRaw {
get;
set; }
89 public override bool ShouldNotify => NotifyRaw.Trim() ==
"1";
95 [JsonProperty(
"modified")]
96 public long ModifiedRaw {
get;
set; }
101 public DateTime Modified =>
new DateTime(1970, 1, 1, 0, 0, 0, 0).AddSeconds(ModifiedRaw);
103 public override DateTime Updated => Modified;
109 [JsonProperty(
"hostname")]
110 public string Hostname {
get;
set; }
112 public override string Name => Hostname;
118 [JsonProperty(
"ipv4")]
119 public string Ipv4 {
get;
set; }
121 public override IPAddress Address
126 return IPAddress.TryParse(Ipv4, out ip) ? ip : null;
133 [JsonProperty(
"ipv6")]
134 public string Ipv6 {
get;
set; }
136 public override string V6Address => Ipv6;
141 [JsonProperty(
"usedns")]
142 public string UseDns {
get;
set; }
144 public override bool ShouldUseDns => UseDns.Trim() ==
"1";
146 public override bool IsPoolMember =>
false;
151 [JsonProperty(
"access_details")]
152 public string AccessDetailsRaw {
get;
set; }
154 public override string AccessDetails => AccessDetailsRaw;
160 [JsonProperty(
"contact")]
161 public string ContactRaw {
get;
set; }
163 public override string Contact => ContactRaw;
170 [JsonProperty(
"dns_a")]
171 public string[] DnsA {
get;
set; }
177 [JsonProperty(
"dns_aaaa")]
178 public string[] DnsAaaa {
get;
set; }
185 [JsonProperty(
"status")]
186 public string[] Status {
get;
set; }
192 [JsonProperty(
"success")]
199 public int IdRaw {
get;
set; }
204 [JsonProperty(
"successes")]
205 public int Successes {
get;
set; }
210 [JsonProperty(
"failures")]
211 public int Failures {
get;
set; }
217 public int UpRaw {
get;
set; }
222 public bool IsUp => UpRaw == 1;
228 [JsonProperty(
"contacted")]
229 public long ContactedRaw {
get;
set; }
234 public DateTime Contacted =>
new DateTime(1970, 1, 1, 0, 0, 0, 0).AddSeconds(ContactedRaw);
236 public override int Stratum => 0;
238 public override string Geo =>
string.Empty;
240 public override string Server =>
string.Empty;
242 public override string AutoKey =>
string.Empty;
244 public override string SymKey =>
string.Empty;
246 public override string SymUrl =>
string.Empty;
248 public override string ProviderPage =>
string.Empty;
250 public override string ProviderUrl =>
string.Empty;