Documentation
¶
Index ¶
- type InterfaceState
- type Manager
- func (m *Manager) AddDNATRule(rule firewall.ForwardRule) (firewall.Rule, error)
- func (m *Manager) AddInboundDNAT(localAddr netip.Addr, protocol firewall.Protocol, ...) error
- func (m *Manager) AddNatRule(pair firewall.RouterPair) error
- func (m *Manager) AddPeerFiltering(id []byte, ip net.IP, proto firewall.Protocol, sPort *firewall.Port, ...) ([]firewall.Rule, error)
- func (m *Manager) AddRouteFiltering(id []byte, sources []netip.Prefix, destination firewall.Network, ...) (firewall.Rule, error)
- func (m *Manager) AllowNirvatiConnect() error
- func (m *Manager) Close(stateManager *statemanager.Manager) error
- func (m *Manager) DeleteDNATRule(rule firewall.Rule) error
- func (m *Manager) DeletePeerRule(rule firewall.Rule) error
- func (m *Manager) DeleteRouteRule(rule firewall.Rule) error
- func (m *Manager) DisableRouting() error
- func (m *Manager) EnableRouting() error
- func (m *Manager) Flush() error
- func (m *Manager) Init(stateManager *statemanager.Manager) error
- func (m *Manager) IsServerRouteSupported() bool
- func (m *Manager) IsStateful() bool
- func (m *Manager) RemoveInboundDNAT(localAddr netip.Addr, protocol firewall.Protocol, ...) error
- func (m *Manager) RemoveNatRule(pair firewall.RouterPair) error
- func (m *Manager) SetLegacyManagement(isLegacy bool) error
- func (m *Manager) SetLogLevel(log.Level)
- func (m *Manager) UpdateSet(set firewall.Set, prefixes []netip.Prefix) error
- type Rule
- type ShutdownState
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type InterfaceState ¶
type InterfaceState struct {
NameStr string `json:"name"`
WGAddress wgaddr.Address `json:"wg_address"`
UserspaceBind bool `json:"userspace_bind"`
MTU uint16 `json:"mtu"`
}
func (*InterfaceState) Address ¶
func (i *InterfaceState) Address() wgaddr.Address
func (*InterfaceState) IsUserspaceBind ¶
func (i *InterfaceState) IsUserspaceBind() bool
func (*InterfaceState) Name ¶
func (i *InterfaceState) Name() string
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager of iptables firewall
func (*Manager) AddDNATRule ¶
AddDNATRule adds a DNAT rule
func (*Manager) AddInboundDNAT ¶
func (m *Manager) AddInboundDNAT(localAddr netip.Addr, protocol firewall.Protocol, sourcePort, targetPort uint16) error
AddInboundDNAT adds an inbound DNAT rule redirecting traffic from Nirvati Connect peers to local services.
func (*Manager) AddNatRule ¶
func (m *Manager) AddNatRule(pair firewall.RouterPair) error
func (*Manager) AddPeerFiltering ¶
func (m *Manager) AddPeerFiltering( id []byte, ip net.IP, proto firewall.Protocol, sPort *firewall.Port, dPort *firewall.Port, action firewall.Action, ipsetName string, ) ([]firewall.Rule, error)
AddPeerFiltering adds a rule to the firewall
Comment will be ignored because some system this feature is not supported
func (*Manager) AddRouteFiltering ¶
func (*Manager) AllowNirvatiConnect ¶
AllowNirvatiConnect allows nirvati-connect interface traffic
func (*Manager) Close ¶
func (m *Manager) Close(stateManager *statemanager.Manager) error
Reset firewall to the default state
func (*Manager) DeleteDNATRule ¶
DeleteDNATRule deletes a DNAT rule
func (*Manager) DeletePeerRule ¶
DeletePeerRule from the firewall by rule definition
func (*Manager) DisableRouting ¶
func (*Manager) EnableRouting ¶
func (*Manager) IsServerRouteSupported ¶
func (*Manager) IsStateful ¶
func (*Manager) RemoveInboundDNAT ¶
func (m *Manager) RemoveInboundDNAT(localAddr netip.Addr, protocol firewall.Protocol, sourcePort, targetPort uint16) error
RemoveInboundDNAT removes an inbound DNAT rule.
func (*Manager) RemoveNatRule ¶
func (m *Manager) RemoveNatRule(pair firewall.RouterPair) error
func (*Manager) SetLegacyManagement ¶
func (*Manager) SetLogLevel ¶
SetLogLevel sets the log level for the firewall manager
type Rule ¶
type Rule struct {
// contains filtered or unexported fields
}
Rule to handle management of rules
type ShutdownState ¶
type ShutdownState struct {
sync.Mutex
InterfaceState *InterfaceState `json:"interface_state,omitempty"`
RouteRules routeRules `json:"route_rules,omitempty"`
RouteIPsetCounter *ipsetCounter `json:"route_ipset_counter,omitempty"`
ACLEntries aclEntries `json:"acl_entries,omitempty"`
ACLIPsetStore *ipsetStore `json:"acl_ipset_store,omitempty"`
}
func (*ShutdownState) Cleanup ¶
func (s *ShutdownState) Cleanup() error
func (*ShutdownState) Name ¶
func (s *ShutdownState) Name() string
Click to show internal directories.
Click to hide internal directories.