diff --git a/app/src/main/java/io/github/chronosx88/yggdrasil/models/config/Config.kt b/app/src/main/java/io/github/chronosx88/yggdrasil/models/config/Config.kt new file mode 100644 index 0000000..7467861 --- /dev/null +++ b/app/src/main/java/io/github/chronosx88/yggdrasil/models/config/Config.kt @@ -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, + @SerializedName("interfacePeers") val interfacePeers : Map>, + @SerializedName("listen") val listen : List, + @SerializedName("adminListen") val adminListen : String, + @SerializedName("multicastInterfaces") val multicastInterfaces : List, + @SerializedName("allowedEncryptionPublicKeys") val allowedEncryptionPublicKeys : List, + @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 +) \ No newline at end of file diff --git a/app/src/main/java/io/github/chronosx88/yggdrasil/models/config/SessionFirewall.kt b/app/src/main/java/io/github/chronosx88/yggdrasil/models/config/SessionFirewall.kt new file mode 100644 index 0000000..58f9572 --- /dev/null +++ b/app/src/main/java/io/github/chronosx88/yggdrasil/models/config/SessionFirewall.kt @@ -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, // List of public keys from which network traffic is always accepted, regardless of AllowFromDirect or AllowFromRemote. + @SerializedName("blacklistEncryptionPublicKeys") val blacklistEncryptionPublicKeys : List // List of public keys from which network traffic is always rejected, regardless of the whitelist, AllowFromDirect or AllowFromRemote. +) \ No newline at end of file diff --git a/app/src/main/java/io/github/chronosx88/yggdrasil/models/config/SwitchOptions.kt b/app/src/main/java/io/github/chronosx88/yggdrasil/models/config/SwitchOptions.kt new file mode 100644 index 0000000..e757c86 --- /dev/null +++ b/app/src/main/java/io/github/chronosx88/yggdrasil/models/config/SwitchOptions.kt @@ -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). +) \ No newline at end of file diff --git a/app/src/main/java/io/github/chronosx88/yggdrasil/models/config/TunnelRouting.kt b/app/src/main/java/io/github/chronosx88/yggdrasil/models/config/TunnelRouting.kt new file mode 100644 index 0000000..9075ec4 --- /dev/null +++ b/app/src/main/java/io/github/chronosx88/yggdrasil/models/config/TunnelRouting.kt @@ -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, // 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, // 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, // 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 // 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. +) \ No newline at end of file