Documentation
¶
Index ¶
- Constants
- type Flag
- type NetlinkConn
- type NetlinkFake
- func (n *NetlinkFake) Flush() error
- func (n *NetlinkFake) GetSetByName(t *nft.Table, name string) (*nft.Set, error)
- func (n *NetlinkFake) ListTableOfFamily(name string, family nft.TableFamily) (*nft.Table, error)
- func (n *NetlinkFake) SetAddElements(s *nft.Set, vals []nft.SetElement) error
- func (n *NetlinkFake) SetDestroyElements(s *nft.Set, vals []nft.SetElement) error
- func (n *NetlinkFake) String() string
- type NftSync
- type ResponseWriter
- type Tree
Constants ¶
View Source
const (
TimeoutOffset uint32 = 5
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type NetlinkConn ¶
type NetlinkConn interface {
ListTableOfFamily(name string, family nftables.TableFamily) (*nftables.Table, error)
GetSetByName(t *nftables.Table, name string) (*nftables.Set, error)
SetDestroyElements(s *nftables.Set, vals []nftables.SetElement) error
SetAddElements(s *nftables.Set, vals []nftables.SetElement) error
Flush() error
}
NetlinkConn consists of the Netlink socket operations required by nftsync.
func NewConnector ¶
func NewConnector() (NetlinkConn, error)
type NetlinkFake ¶
type NetlinkFake struct {
// contains filtered or unexported fields
}
NetlinkFake implements NetlinkConn.
func NewNetlinkFake ¶
func NewNetlinkFake() *NetlinkFake
func (*NetlinkFake) Flush ¶
func (n *NetlinkFake) Flush() error
func (*NetlinkFake) GetSetByName ¶
func (*NetlinkFake) ListTableOfFamily ¶
func (n *NetlinkFake) ListTableOfFamily(name string, family nft.TableFamily) (*nft.Table, error)
func (*NetlinkFake) SetAddElements ¶
func (n *NetlinkFake) SetAddElements(s *nft.Set, vals []nft.SetElement) error
func (*NetlinkFake) SetDestroyElements ¶
func (n *NetlinkFake) SetDestroyElements(s *nft.Set, vals []nft.SetElement) error
type NftSync ¶
NftSync is a plugin that synchronizes dns and nftables set.
func NewNftSync ¶
func NewNftSync() *NftSync
NewNftSync returns an initialized NftSync with default settings. It's up to the caller to set the Next handler.
func NftSyncParse ¶
func NftSyncParse(c *caddy.Controller) (*NftSync, error)
func (*NftSync) SetConn ¶
func (n *NftSync) SetConn(c NetlinkConn)
SetConn injects connection to NftSync.
type ResponseWriter ¶
type ResponseWriter struct {
dns.ResponseWriter
*NftSync
// contains filtered or unexported fields
}
ResponseWriter observes the RRs and adds the results to nftset via netlink conn.
func NewResponseWriter ¶
func NewResponseWriter(srv string, w dns.ResponseWriter, n *NftSync, c context.Context) *ResponseWriter
NewResponseWriter returns a pointer to a new ResponseWriter
Source Files
¶
Click to show internal directories.
Click to hide internal directories.