Maint: firewall package interface rework
- return concrete struct type - split interface is sub-interfaces
This commit is contained in:
@@ -6,7 +6,11 @@ import (
|
||||
"net"
|
||||
)
|
||||
|
||||
func (c *configurator) SetOutboundSubnets(ctx context.Context, subnets []net.IPNet) (err error) {
|
||||
type OutboundSubnetsSetter interface {
|
||||
SetOutboundSubnets(ctx context.Context, subnets []net.IPNet) (err error)
|
||||
}
|
||||
|
||||
func (c *Config) SetOutboundSubnets(ctx context.Context, subnets []net.IPNet) (err error) {
|
||||
c.stateMutex.Lock()
|
||||
defer c.stateMutex.Unlock()
|
||||
|
||||
@@ -33,7 +37,7 @@ func (c *configurator) SetOutboundSubnets(ctx context.Context, subnets []net.IPN
|
||||
return nil
|
||||
}
|
||||
|
||||
func (c *configurator) removeOutboundSubnets(ctx context.Context, subnets []net.IPNet) {
|
||||
func (c *Config) removeOutboundSubnets(ctx context.Context, subnets []net.IPNet) {
|
||||
const remove = true
|
||||
for _, subnet := range subnets {
|
||||
if err := c.acceptOutputFromIPToSubnet(ctx, c.defaultInterface, c.localIP, subnet, remove); err != nil {
|
||||
@@ -44,7 +48,7 @@ func (c *configurator) removeOutboundSubnets(ctx context.Context, subnets []net.
|
||||
}
|
||||
}
|
||||
|
||||
func (c *configurator) addOutboundSubnets(ctx context.Context, subnets []net.IPNet) error {
|
||||
func (c *Config) addOutboundSubnets(ctx context.Context, subnets []net.IPNet) error {
|
||||
const remove = false
|
||||
for _, subnet := range subnets {
|
||||
if err := c.acceptOutputFromIPToSubnet(ctx, c.defaultInterface, c.localIP, subnet, remove); err != nil {
|
||||
|
||||
Reference in New Issue
Block a user