Repository navigation
Expand file tree
/
Copy pathPingInfo.cs
More file actions
95 lines (82 loc) · 2.7 KB
/
Copy pathPingInfo.cs
File metadata and controls
95 lines (82 loc) · 2.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
using System;
using System.Net;
using System.Net.NetworkInformation;
namespace NETworkManager.Models.Network
{
public class PingInfo
{
public DateTime Timestamp { get; set; }
public IPAddress IPAddress { get; set; }
public string Hostname { get; set; }
public int Bytes { get; set; }
public long Time { get; set; }
public int TTL { get; set; }
public IPStatus Status { get; set; }
public int IPAddressInt32 => IPAddress != null && IPAddress.AddressFamily == System.Net.Sockets.AddressFamily.InterNetwork ? IPv4Address.ToInt32(IPAddress) : 0;
public PingInfo()
{
}
public PingInfo(IPAddress ipAddress, IPStatus ipStatus)
{
IPAddress = ipAddress;
Status = ipStatus;
}
public PingInfo(DateTime timestamp, IPAddress ipAddress, IPStatus status)
{
Timestamp = timestamp;
IPAddress = ipAddress;
Status = status;
}
public PingInfo(DateTime timestamp, IPAddress ipAddress, int bytes, long time, IPStatus status)
{
Timestamp = timestamp;
IPAddress = ipAddress;
Bytes = bytes;
Time = time;
Status = status;
}
public PingInfo(DateTime timestamp, IPAddress ipAddress, int bytes, long time, int ttl, IPStatus status)
{
Timestamp = timestamp;
IPAddress = ipAddress;
Bytes = bytes;
Time = time;
TTL = ttl;
Status = status;
}
public PingInfo(DateTime timestamp, IPAddress ipAddress, string hostname, int bytes, long time, int ttl, IPStatus status)
{
Timestamp = timestamp;
IPAddress = ipAddress;
Hostname = hostname;
Bytes = bytes;
Time = time;
TTL = ttl;
Status = status;
}
public PingInfo(DateTime timestamp, long time)
{
Timestamp = timestamp;
Time = time;
}
public PingInfo(IPAddress ipAddress, int bytes, long time, int ttl, IPStatus status)
{
IPAddress = ipAddress;
Bytes = bytes;
Time = time;
TTL = ttl;
Status = status;
}
public PingInfo(IPAddress ipAddress, int bytes, long time, IPStatus status)
{
IPAddress = ipAddress;
Bytes = bytes;
Time = time;
Status = status;
}
public static PingInfo Parse(PingReceivedArgs e)
{
return new PingInfo(e.Timestamp, e.IPAddress, e.Hostname, e.Bytes, e.Time, e.TTL, e.Status);
}
}
}