-
Notifications
You must be signed in to change notification settings - Fork 2
/
Lease.cs
59 lines (51 loc) · 1.54 KB
/
Lease.cs
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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Sockets;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace Makaretu.Nat
{
/// <summary>
/// A contract that rents a public endpoint from a NAT.
/// </summary>
public class Lease
{
/// <summary>
/// The NAT that owns the public endpoint.
/// </summary>
public NatClient Nat { get; set; }
/// <summary>
/// A random value assigned to this lease.
/// </summary>
public byte[] Nonce { get; set; }
/// <summary>
/// The supported protocol of the port.
/// </summary>
/// <value>
/// Either <see cref="ProtocolType.Tcp"/> or <see cref="ProtocolType.Udp"/>.
/// </value>
public ProtocolType Protocol { get; set; }
/// <summary>
/// The public IP address assigned by the NAT.
/// </summary>
public IPAddress PublicAddress { get; set; }
/// <summary>
/// The public port assigned by the NAT.
/// </summary>
public int PublicPort { get; set; }
/// <summary>
/// The internal port for the public endpoint.
/// </summary>
public int InternalPort { get; set; }
/// <summary>
/// The lifetime of the contract.
/// </summary>
/// <value>
/// Typically the number of seconds.
/// </value>
public TimeSpan Lifetime { get; set; }
}
}