Documentation ¶
Index ¶
- func ClearCache()
- func CloseCache(cache *NftablesCache) error
- func SetConnectionTimeout(timeout time.Duration)
- func SetNftableAsyncMode(mode bool)
- func SetSetLruMaxCount(count int)
- func SetSetLruMaxRetryTimes(times int)
- func SetSetLruTimeout(timeout time.Duration)
- type NftableCache
- type NftableIPCache
- type NftablesCache
- func (cache *NftablesCache) GetFamilyName(family nftables.TableFamily) string
- func (cache *NftablesCache) LruIgnoreIp(answer *dns.RR) bool
- func (cache *NftablesCache) LruUpdateIp(answer *dns.RR, rulesCounter int)
- func (cache *NftablesCache) MutableNftablesTable(family nftables.TableFamily, tableName string) *NftableCache
- func (cache *NftablesCache) SetAddElements(tableCache *NftableCache, set *nftables.Set, elements []nftables.SetElement) error
- type NftablesHandler
- func (m *NftablesHandler) MutableRuleSet(family nftables.TableFamily) *NftablesRuleSet
- func (m *NftablesHandler) Name() string
- func (m *NftablesHandler) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg) (int, error)
- func (m *NftablesHandler) ServeWorker(ctx context.Context, r *dns.Msg) error
- type NftablesRuleSet
- type NftablesSetAddElement
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ClearCache ¶ added in v0.2.0
func ClearCache()
func CloseCache ¶
func CloseCache(cache *NftablesCache) error
func SetConnectionTimeout ¶
func SetNftableAsyncMode ¶ added in v0.2.0
func SetNftableAsyncMode(mode bool)
func SetSetLruMaxCount ¶ added in v0.2.0
func SetSetLruMaxCount(count int)
func SetSetLruMaxRetryTimes ¶ added in v0.2.0
func SetSetLruMaxRetryTimes(times int)
func SetSetLruTimeout ¶ added in v0.2.0
Types ¶
type NftableCache ¶ added in v0.2.0
type NftableCache struct {
// contains filtered or unexported fields
}
type NftableIPCache ¶ added in v0.2.0
type NftablesCache ¶
type NftablesCache struct { CreateTimepoint time.Time NftableConnection *nftables.Conn NetworkNamespace netns.NsHandle HasNftableConnectionError bool // contains filtered or unexported fields }
func NewCache ¶
func NewCache() (*NftablesCache, error)
func (*NftablesCache) GetFamilyName ¶
func (cache *NftablesCache) GetFamilyName(family nftables.TableFamily) string
func (*NftablesCache) LruIgnoreIp ¶ added in v0.2.0
func (cache *NftablesCache) LruIgnoreIp(answer *dns.RR) bool
func (*NftablesCache) LruUpdateIp ¶ added in v0.2.0
func (cache *NftablesCache) LruUpdateIp(answer *dns.RR, rulesCounter int)
func (*NftablesCache) MutableNftablesTable ¶
func (cache *NftablesCache) MutableNftablesTable(family nftables.TableFamily, tableName string) *NftableCache
func (*NftablesCache) SetAddElements ¶ added in v0.2.0
func (cache *NftablesCache) SetAddElements(tableCache *NftableCache, set *nftables.Set, elements []nftables.SetElement) error
type NftablesHandler ¶
type NftablesHandler struct { Next plugin.Handler Rules map[nftables.TableFamily]*NftablesRuleSet }
NftablesHandler implements the plugin.Handler interface.
func NewNftablesHandler ¶
func NewNftablesHandler() NftablesHandler
func (*NftablesHandler) MutableRuleSet ¶
func (m *NftablesHandler) MutableRuleSet(family nftables.TableFamily) *NftablesRuleSet
func (*NftablesHandler) Name ¶
func (m *NftablesHandler) Name() string
func (*NftablesHandler) ServeDNS ¶
func (m *NftablesHandler) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg) (int, error)
func (*NftablesHandler) ServeWorker ¶
type NftablesRuleSet ¶
type NftablesRuleSet struct {
RuleAddElement []*NftablesSetAddElement
}
type NftablesSetAddElement ¶
type NftablesSetAddElement struct { TableName string SetName string Interval bool Timeout time.Duration KeyType nftables.SetDatatype }
func (*NftablesSetAddElement) Name ¶
func (m *NftablesSetAddElement) Name() string
func (*NftablesSetAddElement) ServeDNS ¶
func (m *NftablesSetAddElement) ServeDNS(ctx context.Context, cache *NftablesCache, answer *dns.RR, family nftables.TableFamily) (error, bool)
Click to show internal directories.
Click to hide internal directories.