-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSettings.cs
53 lines (48 loc) · 1.41 KB
/
Settings.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
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using Nucs.JsonSettings;
namespace EN2NGui
{
internal class Settings : JsonSettings
{
public override string FileName { get; set; } = StringRes.conf;
public Settings() { }
public Settings(string fileName) : base(fileName)
{
if (TAPInterface == null) TAPInterface = "";
}
[JsonConverter(typeof(StringEnumConverter))]
public ConfigEnum.Compression UseCompression = ConfigEnum.Compression.Lzo1x;
[JsonConverter(typeof(StringEnumConverter))]
public ConfigEnum.Encryption UseEncryption = ConfigEnum.Encryption.Chacha20;
public string Server = "";
public string Community = "";
public int Port = 6969;
public string Password = "";
public int MTU = 1280;
public bool MTUDiscovery = false;
public bool AllowBroadcast = true;
public bool SetMetric = true;
public bool EncryptHeader = false;
public bool AllowRouting = false;
public string NickName = "";
public string TAPInterface = "";
}
internal static class ConfigEnum
{
internal enum Encryption
{
None,
TwoFish,
Aes,
Chacha20,
Speck
}
internal enum Compression
{
None,
Lzo1x,
Zstd
}
}
}