Fix #273 (#277), adding FIREWALL_OUTBOUND_SUBNETS

This commit is contained in:
Quentin McGaw
2020-10-29 19:23:44 -04:00
committed by GitHub
parent f7bff247aa
commit db64dea664
16 changed files with 341 additions and 16 deletions

View File

@@ -2,25 +2,35 @@ package routing
import (
"net"
"sync"
"github.com/qdm12/golibs/logging"
)
type Routing interface {
// Mutations
Setup() (err error)
TearDown() error
SetOutboundRoutes(outboundSubnets []net.IPNet) error
// Read only
DefaultRoute() (defaultInterface string, defaultGateway net.IP, err error)
LocalSubnet() (defaultSubnet net.IPNet, err error)
DefaultIP() (defaultIP net.IP, err error)
VPNDestinationIP() (ip net.IP, err error)
VPNLocalGatewayIP() (ip net.IP, err error)
// Internal state
SetVerbose(verbose bool)
SetDebug()
}
type routing struct {
logger logging.Logger
verbose bool
debug bool
logger logging.Logger
verbose bool
debug bool
outboundSubnets []net.IPNet
stateMutex sync.RWMutex
}
// NewConfigurator creates a new Configurator instance.