-
Notifications
You must be signed in to change notification settings - Fork 92
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add files via upload Wireguard peer implementation * Wireguard interface implementation
- Loading branch information
1 parent
e286e11
commit c2d27b4
Showing
2 changed files
with
126 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
|
||
namespace tik4net.Objects.Interface | ||
{ | ||
/// <summary> | ||
/// Wireguard Interface | ||
/// </summary> | ||
[TikEntity("/interface/wireguard")] | ||
public class InterfaceWireguard | ||
{ | ||
/// <summary> | ||
/// .id: primary key of row | ||
/// </summary> | ||
[TikProperty(".id", IsReadOnly = true, IsMandatory = true)] | ||
public string Id { get; private set; } | ||
|
||
/// <summary> | ||
/// Name of the wireguard interface | ||
/// </summary> | ||
[TikProperty("name")] | ||
public string Name { get; set; } | ||
|
||
/// <summary> | ||
/// comment: Short description of the Peer. | ||
/// </summary> | ||
[TikProperty("comment")] | ||
public string Comment { get; set; } | ||
|
||
/// <summary> | ||
/// disabled: Whether peer will be used. | ||
/// </summary> | ||
[TikProperty("disabled", DefaultValue = "no")] | ||
public bool Disabled { get; set; } | ||
|
||
/// <summary> | ||
/// mtu: Layer3 Maximum transmission unit | ||
/// | ||
/// integer [0..65536] | ||
/// </summary> | ||
[TikProperty("mtu", DefaultValue = "1420")] | ||
public int /*integer [0..65536]*/ Mtu { get; set; } | ||
|
||
/// <summary> | ||
/// The private key associated with the local device | ||
/// </summary> | ||
[TikProperty("private-key")] | ||
public string PrivateKey { get; set; } | ||
|
||
/// <summary> | ||
/// Interface listen port | ||
/// </summary> | ||
[TikProperty("listen-port", DefaultValue = "13231")] | ||
public int ListenPort { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
|
||
namespace tik4net.Objects.Wireguard | ||
{ | ||
/// <summary> | ||
/// Specific remote entity or device with which the local device establishes a secure communication tunnel | ||
/// </summary> | ||
[TikEntity("/interface/wireguard/peers")] | ||
public class WireguardPeer | ||
{ | ||
/// <summary> | ||
/// .id: primary key of row | ||
/// </summary> | ||
[TikProperty(".id", IsReadOnly = true, IsMandatory = true)] | ||
public string Id { get; private set; } | ||
|
||
/// <summary> | ||
/// IP addresses or subnets that are allowed to communicate with that peer | ||
/// </summary> | ||
[TikProperty("allowed-address")] | ||
public string AllowedAddress { get; set; } | ||
|
||
/// <summary> | ||
/// comment: Short description of the Peer. | ||
/// </summary> | ||
[TikProperty("comment")] | ||
public string Comment { get; set; } | ||
|
||
/// <summary> | ||
/// disabled: Whether peer will be used. | ||
/// </summary> | ||
[TikProperty("disabled", DefaultValue = "no")] | ||
public bool Disabled { get; set; } | ||
|
||
/// <summary> | ||
/// Specifies the local network interface that the peer is associated with | ||
/// </summary> | ||
[TikProperty("interface", DefaultValue = "")] | ||
public string Interface { get; set; } | ||
|
||
/// <summary> | ||
/// shared secret cryptographic key that is preconfigured between two peers | ||
/// </summary> | ||
[TikProperty("preshared-key", DefaultValue = "")] | ||
public string PresharedKey { get; set; } | ||
|
||
/// <summary> | ||
/// The IP address and port number of the remote endpoint or server that the peer will connect to. | ||
/// </summary> | ||
[TikProperty("endpoint-address")] | ||
public string EndpointAddress { get; set; } | ||
|
||
/// <summary> | ||
/// Specifies the specific port number on the remote endpoint or server that the peer will connect to. | ||
/// </summary> | ||
[TikProperty("endpoint-port")] | ||
public int EndpointPort { get; set; } | ||
|
||
/// <summary> | ||
/// The public key associated with the remote peer | ||
/// </summary> | ||
[TikProperty("public-key" )] | ||
public string PublicKey { get; set; } | ||
} | ||
} |