diff --git a/DVMConsole/Codeplug.cs b/DVMConsole/Codeplug.cs index 8748a38..41300c3 100644 --- a/DVMConsole/Codeplug.cs +++ b/DVMConsole/Codeplug.cs @@ -30,11 +30,14 @@ namespace DVMConsole public class System { public string Name { get; set; } + public string Identity { get; set; } public string Address { get; set; } + public string Password { get; set; } + public string PresharedKey { get; set; } + public bool Encrypted { get; set; } public uint PeerId { get; set; } public int Port { get; set; } public string Rid { get; set; } - public string AuthKey { get; set; } public string AliasPath { get; set; } = "./alias.yml"; public List RidAlias { get; set; } = null; diff --git a/DVMConsole/PeerSystem.cs b/DVMConsole/PeerSystem.cs index 5f32380..dfe722f 100644 --- a/DVMConsole/PeerSystem.cs +++ b/DVMConsole/PeerSystem.cs @@ -44,7 +44,6 @@ namespace DVMConsole private static FnePeer Create(Codeplug.System system) { IPEndPoint endpoint = new IPEndPoint(IPAddress.Any, system.Port); - string presharedKey = null; if (system.Address == null) throw new NullReferenceException("address"); @@ -63,17 +62,19 @@ namespace DVMConsole endpoint = new IPEndPoint(addresses[0], system.Port); } - FnePeer peer = new FnePeer("DVMCONSOLE", system.PeerId, endpoint, presharedKey); + string key = system.Encrypted ? system.PresharedKey : null; + + FnePeer peer = new FnePeer("DVMCONSOLE", system.PeerId, endpoint, key); // set configuration parameters - peer.Passphrase = system.AuthKey; + peer.Passphrase = system.Password; peer.Information = new PeerInformation { Details = new PeerDetails { ConventionalPeer = true, Software = "DVMCONSOLE", - Identity = "CONS OP" // TODO: Add to config + Identity = system.Identity } }; diff --git a/DVMConsole/codeplugs/codeplug.yml b/DVMConsole/codeplugs/codeplug.yml index 09cb896..86e3f98 100644 --- a/DVMConsole/codeplugs/codeplug.yml +++ b/DVMConsole/codeplugs/codeplug.yml @@ -1,20 +1,42 @@ +# List of FNE master instances to connect to systems: + # Textual name for internal and external reference to this system - name: "System 1" + # Textual name to idenitify this peer in the FNE + Identity: "CONS OP1" + # FNE Address address: "localhost" + # FNE Port port: 3001 - authKey: "RPT_PASSWORD" + # Peer ID for FNE peerId: 1234567 + # Radio ID transmitted traffic will come from rid: "12345" + # FNE Password + password: "RPT_PASSWORD" + # FNE Encrypted flag + encrypted: false + # Preshared FNE encryption key + presharedKey: "123ABC1234" +# List of Zones zones: + # Textual name of the zone - name: "Zone 1" + # List of channels channels: + # Textual name of channel - name: "Channel 1" + # System name this channel is linked to system: "System 1" + # Talkgroup Id to send and receive traffic tgid: "2001" + # Encryption Key Id (If 0 or blank, will be assumed clear) keyId: 0x50 - algoId: 0xaa # 0xAA or 0x84 (RC4 or AES) - encryptionKey: null # Ignored now, we use dvmfne KMM support + # Algorithm Id 0xAA or 0x84 (RC4 or AES) (If 0 or blank, will be assumed clear) + algoId: 0xaa + # Ignored now, we use dvmfne KMM support (This will be used in the future to ovveride FNE KMM support) + encryptionKey: null - name: "Channel 2" system: "System 1" tgid: "15002"