feat: Add Yggdrasil config model

This commit is contained in:
ChronosX88 2019-08-21 13:53:35 +04:00
parent 9dafcd44c9
commit 907341a955
Signed by: ChronosXYZ
GPG Key ID: 085A69A82C8C511A
4 changed files with 55 additions and 0 deletions

View File

@ -0,0 +1,25 @@
package io.github.chronosx88.yggdrasil.models.config
import com.google.gson.annotations.SerializedName
data class Config (
@SerializedName("peers") val peers : List<String>,
@SerializedName("interfacePeers") val interfacePeers : Map<String, List<String>>,
@SerializedName("listen") val listen : List<String>,
@SerializedName("adminListen") val adminListen : String,
@SerializedName("multicastInterfaces") val multicastInterfaces : List<String>,
@SerializedName("allowedEncryptionPublicKeys") val allowedEncryptionPublicKeys : List<String>,
@SerializedName("encryptionPublicKey") val encryptionPublicKey : String,
@SerializedName("encryptionPrivateKey") val encryptionPrivateKey : String,
@SerializedName("signingPublicKey") val signingPublicKey : String,
@SerializedName("signingPrivateKey") val signingPrivateKey : String,
@SerializedName("linkLocalTCPPort") val linkLocalTCPPort : Int,
@SerializedName("ifName") val ifName : String,
@SerializedName("ifTAPMode") val ifTAPMode : Boolean,
@SerializedName("ifMTU") val ifMTU : Int,
@SerializedName("sessionFirewall") val sessionFirewall : SessionFirewall,
@SerializedName("tunnelRouting") val tunnelRouting : TunnelRouting,
@SerializedName("switchOptions") val switchOptions : SwitchOptions,
@SerializedName("nodeInfoPrivacy") val nodeInfoPrivacy : Boolean,
@SerializedName("nodeInfo") val nodeInfo : Map<String, Any>
)

View File

@ -0,0 +1,12 @@
package io.github.chronosx88.yggdrasil.models.config
import com.google.gson.annotations.SerializedName
data class SessionFirewall (
@SerializedName("enable") val enable : Boolean, // Enable or disable the session firewall. If disabled, network traffic from any node will be allowed. If enabled, the below rules apply.
@SerializedName("allowFromDirect") val allowFromDirect : Boolean, // Allow network traffic from directly connected peers.
@SerializedName("allowFromRemote") val allowFromRemote : Boolean, // Allow network traffic from remote nodes on the network that you are not directly peered with.
@SerializedName("alwaysAllowOutbound") val alwaysAllowOutbound : Boolean, // Allow outbound network traffic regardless of AllowFromDirect or AllowFromRemote. This does allow a remote node to send unsolicited traffic back to you for the length of the session.
@SerializedName("whitelistEncryptionPublicKeys") val whitelistEncryptionPublicKeys : List<String>, // List of public keys from which network traffic is always accepted, regardless of AllowFromDirect or AllowFromRemote.
@SerializedName("blacklistEncryptionPublicKeys") val blacklistEncryptionPublicKeys : List<String> // List of public keys from which network traffic is always rejected, regardless of the whitelist, AllowFromDirect or AllowFromRemote.
)

View File

@ -0,0 +1,7 @@
package io.github.chronosx88.yggdrasil.models.config
import com.google.gson.annotations.SerializedName
data class SwitchOptions (
@SerializedName("maxTotalQueueSize") val maxTotalQueueSize : Int // Maximum size of all switch queues combined (in bytes).
)

View File

@ -0,0 +1,11 @@
package io.github.chronosx88.yggdrasil.models.config
import com.google.gson.annotations.SerializedName
data class TunnelRouting (
@SerializedName("enable") val enable : Boolean, // Enable or disable tunnel routing.
@SerializedName("iPv6Destinations") val iPv6Destinations : Map<String, String>, // IPv6 CIDR subnets, mapped to the EncryptionPublicKey to which they should be routed, e.g. { "aaaa:bbbb:cccc::/e": "boxpubkey", ... }"
@SerializedName("iPv6Sources") val iPv6Sources : List<String>, // Optional IPv6 source subnets which are allowed to be tunnelled in addition to this node's Yggdrasil address/subnet. If not specified, only traffic originating from this node's Yggdrasil address or subnet will be tunnelled.
@SerializedName("iPv4Destinations") val iPv4Destinations : Map<String, String>, // IPv4 CIDR subnets, mapped to the EncryptionPublicKey to which they should be routed, e.g. { "a.b.c.d/e": "boxpubkey", ... }
@SerializedName("iPv4Sources") val iPv4Sources : List<String> // IPv4 source subnets which are allowed to be tunnelled. Unlike for IPv6, this option is required for bridging IPv4 traffic. Only traffic with a source matching these subnets will be tunnelled.
)