resolver

package
v0.0.0-...-f93202d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 24, 2024 License: Apache-2.0 Imports: 11 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LocalResolver

type LocalResolver struct {
	Clock             clock.Clock
	ContainerProvider proccontainers.ContainerProvider
	// contains filtered or unexported fields
}

LocalResolver is responsible resolving the raddr of connections when they are local containers

func NewLocalResolver

func NewLocalResolver(containerProvider proccontainers.ContainerProvider, clock clock.Clock, maxAddrCacheSize, maxPidCacheSize int) *LocalResolver

func (*LocalResolver) LoadAddrs

func (l *LocalResolver) LoadAddrs(containers []*model.Container, pidToCid map[int]string)

LoadAddrs generates a map of network addresses to container IDs

func (*LocalResolver) Resolve

func (l *LocalResolver) Resolve(c *model.Connections)

Resolve binds container IDs to the Raddr of connections

An attempt is made to resolve as many local containers as possible.

First, we go over all connections resolving the laddr container using the pid to container map that we have. We also index connections by (laddr, raddr, proto, netns), inserting a non-loopback saddr with netns = 0 as well. Translated laddr and raddr are used throughout.

Second, we go over the connections again, this time resolving the raddr container id using the lookup table we built previously. Translated addresses are used throughout.

Only connections that are local are resolved, i.e., for which conn.IntrHost is set to true.

If lookup by table fails above, we fall back to using the l.addrToCtrID map

func (*LocalResolver) Run

func (l *LocalResolver) Run()

func (*LocalResolver) Stop

func (l *LocalResolver) Stop()

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL