|
@@ -71,19 +71,20 @@ type Node struct {
|
|
|
RelayAddrs []string `json:"relayaddrs" bson:"relayaddrs" yaml:"relayaddrs"`
|
|
|
IngressGatewayRange string `json:"ingressgatewayrange" bson:"ingressgatewayrange" yaml:"ingressgatewayrange"`
|
|
|
// IsStatic - refers to if the Endpoint is set manually or dynamically
|
|
|
- IsStatic string `json:"isstatic" bson:"isstatic" yaml:"isstatic" validate:"checkyesorno"`
|
|
|
- UDPHolePunch string `json:"udpholepunch" bson:"udpholepunch" yaml:"udpholepunch" validate:"checkyesorno"`
|
|
|
- DNSOn string `json:"dnson" bson:"dnson" yaml:"dnson" validate:"checkyesorno"`
|
|
|
- IsServer string `json:"isserver" bson:"isserver" yaml:"isserver" validate:"checkyesorno"`
|
|
|
- Action string `json:"action" bson:"action" yaml:"action"`
|
|
|
- IsLocal string `json:"islocal" bson:"islocal" yaml:"islocal" validate:"checkyesorno"`
|
|
|
- LocalRange string `json:"localrange" bson:"localrange" yaml:"localrange"`
|
|
|
- IPForwarding string `json:"ipforwarding" bson:"ipforwarding" yaml:"ipforwarding" validate:"checkyesorno"`
|
|
|
- OS string `json:"os" bson:"os" yaml:"os"`
|
|
|
- MTU int32 `json:"mtu" bson:"mtu" yaml:"mtu"`
|
|
|
- Version string `json:"version" bson:"version" yaml:"version"`
|
|
|
- Server string `json:"server" bson:"server" yaml:"server"`
|
|
|
- TrafficKeys TrafficKeys `json:"traffickeys" bson:"traffickeys" yaml:"traffickeys"`
|
|
|
+ IsStatic string `json:"isstatic" bson:"isstatic" yaml:"isstatic" validate:"checkyesorno"`
|
|
|
+ UDPHolePunch string `json:"udpholepunch" bson:"udpholepunch" yaml:"udpholepunch" validate:"checkyesorno"`
|
|
|
+ DNSOn string `json:"dnson" bson:"dnson" yaml:"dnson" validate:"checkyesorno"`
|
|
|
+ IsServer string `json:"isserver" bson:"isserver" yaml:"isserver" validate:"checkyesorno"`
|
|
|
+ Action string `json:"action" bson:"action" yaml:"action"`
|
|
|
+ IsLocal string `json:"islocal" bson:"islocal" yaml:"islocal" validate:"checkyesorno"`
|
|
|
+ LocalRange string `json:"localrange" bson:"localrange" yaml:"localrange"`
|
|
|
+ IPForwarding string `json:"ipforwarding" bson:"ipforwarding" yaml:"ipforwarding" validate:"checkyesorno"`
|
|
|
+ OS string `json:"os" bson:"os" yaml:"os"`
|
|
|
+ MTU int32 `json:"mtu" bson:"mtu" yaml:"mtu"`
|
|
|
+ Version string `json:"version" bson:"version" yaml:"version"`
|
|
|
+ Server string `json:"server" bson:"server" yaml:"server"`
|
|
|
+ TrafficKeys TrafficKeys `json:"traffickeys" bson:"traffickeys" yaml:"traffickeys"`
|
|
|
+ IsNFTablesPresent string `json:"isnftablespresent" bson:"isnftablespresent" yaml:"isnftablespresent"`
|
|
|
}
|
|
|
|
|
|
// NodesArray - used for node sorting
|
|
@@ -119,6 +120,13 @@ func (node *Node) SetDefaultMTU() {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+// Node.SetDefaultNFTablesPresent - sets default for nftables check
|
|
|
+func (node *Node) SetDefaultNFTablesPresent() {
|
|
|
+ if node.IsNFTablesPresent == "" {
|
|
|
+ node.IsNFTablesPresent = "no"
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
// Node.SetDefaulIsPending - sets ispending default
|
|
|
func (node *Node) SetDefaulIsPending() {
|
|
|
if node.IsPending == "" {
|
|
@@ -254,7 +262,7 @@ func (node *Node) SetDefaultName() {
|
|
|
}
|
|
|
|
|
|
// Node.Fill - fills other node data into calling node data if not set on calling node
|
|
|
-func (newNode *Node) Fill(currentNode *Node) {
|
|
|
+func (newNode *Node) Fill(currentNode *Node) { // TODO add new field for nftables present
|
|
|
newNode.ID = currentNode.ID
|
|
|
|
|
|
if newNode.Address == "" {
|