netmaker/logic/relay.go

35 lines
703 B
Go
Raw Normal View History

2021-12-08 01:46:55 +08:00
package logic
import (
"net"
NET-940: Inet Gws (#2828) * internet gws apis * add validate check for inet request * add default gw changes to peer update * update json tag * add OS checks for inet gws * add set defaul gw pro func * allow disable and enable inet gw * add inet handlers to pro * add fields to api node * add inet allowed ips * add default gw to pull * unset node inet details on deletion * unset internet gw on network nodes * unset inet gw fix * unset inet gw fix * send default gw ip * fix inet node endpoint * add default gw endpoint ip to pull resp * validate after unset gws * add inet client peer allowedips to inet node * validate after unset gws * fix allowed ips for inet peer and gw node * fix allowed ips for inet peer and gw node * fix allowed ips for inet peer and gw node * fix allowed ips for inet peer and gw node * fix inet gw and relayed conflict * fix inet gw and relayed conflict * fix update req * fix update inet gw api * when inet gw is peer ignore other allowedIps * test relay * revert test relay * revert inet peer update changes * channel internet traffic of relayed node to relay's inetgw * channel internet traffic of relayed node to relay's inetgw * channel internet traffic of relayed node to relay's inetgw * add check for relayed node * add inet info to peer update * add inet info to peer update * fix update node to persist inet info * fix go tests * egress ranges with inet gw fix * egress ranges with inet gw fix * disallow node acting using inet gw to act as inet gw * add check to validate inet gw * fix typos * add firewall check * set inetgw on ingress req on community * set inetgw to false on community on ingress del
2024-02-28 09:46:51 +08:00
"github.com/gravitl/netmaker/models"
2021-12-08 01:46:55 +08:00
)
var GetRelays = func() ([]models.Node, error) {
return []models.Node{}, nil
}
var RelayedAllowedIPs = func(peer, node *models.Node) []net.IPNet {
return []net.IPNet{}
2023-01-09 14:12:57 +08:00
}
var GetAllowedIpsForRelayed = func(relayed, relay *models.Node) []net.IPNet {
return []net.IPNet{}
}
var UpdateRelayed = func(currentNode, newNode *models.Node) {
2021-12-08 01:46:55 +08:00
}
var SetRelayedNodes = func(setRelayed bool, relay string, relayed []string) []models.Node {
return []models.Node{}
2021-12-08 01:46:55 +08:00
}
2023-01-09 14:12:57 +08:00
var RelayUpdates = func(currentNode, newNode *models.Node) bool {
return false
}
2024-03-02 13:42:04 +08:00
2024-03-04 14:39:33 +08:00
var ValidateRelay = func(relay models.RelayRequest, update bool) error {
2024-03-02 13:42:04 +08:00
return nil
}