Documentation ¶
Index ¶
- type DNSProxy
- type Proxy
- func (p *Proxy) Enforce(ctx context.Context, contextID string, puInfo *policy.PUInfo) error
- func (p *Proxy) HandleDNSResponsePacket(dnsPacketData []byte, sourceIP net.IP, sourcePort uint16, destIP net.IP, ...) error
- func (p *Proxy) ShutdownDNS(contextID string)
- func (p *Proxy) StartDNSServer(contextID, port string) error
- func (p *Proxy) SyncWithPlatformCache(ctx context.Context, pctx *pucontext.PUContext) error
- func (p *Proxy) Unenforce(_ context.Context, contextID string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DNSProxy ¶
type DNSProxy interface { // StartDNSServer starts the dns server on the port provided for contextID StartDNSServer(ctx context.Context, contextID, port string) error // Enforce starts enforcing policies for the given policy.PUInfo. Enforce(ctx context.Context, contextID string, puInfo *policy.PUInfo) error // Unenforce stops enforcing policy for the given IP. Unenforce(ctx context.Context, contextID string) error // SyncWithPlatformCache is only needed in Windows SyncWithPlatformCache(ctx context.Context, pctx *pucontext.PUContext) error // HandleDNSResponsePacket is only needed in Windows HandleDNSResponsePacket(dnsPacketData []byte, sourceIP net.IP, sourcePort uint16, destIP net.IP, destPort uint16, puFromContextID func(string) (*pucontext.PUContext, error)) error }
DNSProxy defines an interface that trireme uses for Dns Proxy
type Proxy ¶
type Proxy struct { IPToTTL *cache.Cache IPToTTLLocks *mutexMap sync.Mutex // contains filtered or unexported fields }
Proxy struct represents the object for dns proxy
func New ¶
func New(puFromID cache.DataStore, conntrack flowtracking.FlowClient, c collector.EventCollector, aclmanager ipsetmanager.ACLManager) *Proxy
New creates an instance of the dns proxy
func (*Proxy) HandleDNSResponsePacket ¶
func (p *Proxy) HandleDNSResponsePacket(dnsPacketData []byte, sourceIP net.IP, sourcePort uint16, destIP net.IP, destPort uint16, puFromContextID func(string) (*pucontext.PUContext, error)) error
HandleDNSResponsePacket is only needed in Windows currently
func (*Proxy) ShutdownDNS ¶
func (p *Proxy) ShutdownDNS(contextID string)
ShutdownDNS shuts down the dns server for contextID
func (*Proxy) StartDNSServer ¶
StartDNSServer starts the dns server on the port provided for contextID
func (*Proxy) SyncWithPlatformCache ¶
SyncWithPlatformCache is only needed in Windows currently
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package mockdnsproxy is a generated GoMock package.
|
Package mockdnsproxy is a generated GoMock package. |
Click to show internal directories.
Click to hide internal directories.