metadata

package
v0.26.0 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2024 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	HostMntNs int64
	HostPidNs int64
	HostNetNs int64
)

Functions

func NewDummyNgInterface added in v0.25.0

func NewDummyNgInterface(index int, filter string) pcapgo.NgInterface

func NewNgInterface added in v0.25.0

func NewNgInterface(dev types.Device, filter string, index int) pcapgo.NgInterface

Types

type Connection added in v0.5.2

type Connection struct {
	LocalIP   netip.Addr
	LocalPort int
	Pid       int
	MntNs     int64
	NetNs     int64
}

func GetCurrentConnects added in v0.5.2

func GetCurrentConnects(ctx context.Context, pids []int, all bool) ([]Connection, error)

type ContainerCache added in v0.10.0

type ContainerCache struct {
	// contains filtered or unexported fields
}

func NewContainerCache added in v0.10.0

func NewContainerCache(ctx context.Context,
	dockerEndpoint, containerdEndpoint, criRuntimeEndpoint string) (*ContainerCache, error)

func (*ContainerCache) GetById added in v0.10.0

func (c *ContainerCache) GetById(containerId string) types.Container

func (*ContainerCache) GetByMntNs added in v0.10.0

func (c *ContainerCache) GetByMntNs(mntNs int64) types.Container

func (*ContainerCache) GetByName added in v0.13.0

func (c *ContainerCache) GetByName(containerName string) []types.Container

func (*ContainerCache) GetByNetNs added in v0.10.0

func (c *ContainerCache) GetByNetNs(ns int64) types.Container

func (*ContainerCache) GetByPid added in v0.10.0

func (c *ContainerCache) GetByPid(pid int) types.Container

func (*ContainerCache) GetByPodName added in v0.15.0

func (c *ContainerCache) GetByPodName(name, namespace string) []types.Container

func (*ContainerCache) GetPodByContainer added in v0.11.0

func (c *ContainerCache) GetPodByContainer(cr types.Container) types.Pod

type DeviceCache added in v0.25.0

type DeviceCache struct {
	// contains filtered or unexported fields
}

func NewDeviceCache added in v0.25.0

func NewDeviceCache(nscache *NetNsCache) *DeviceCache

func (*DeviceCache) Add added in v0.25.0

func (d *DeviceCache) Add(netNsInode uint32, ifindex uint32, name string)

func (*DeviceCache) GetByIfindex added in v0.25.0

func (d *DeviceCache) GetByIfindex(ifindex int, netNsInode uint32) (types.Device, bool)

func (*DeviceCache) GetDevices added in v0.25.0

func (d *DeviceCache) GetDevices(devNames []string, netNsPaths []string) (*types.Interfaces, error)

func (*DeviceCache) Start added in v0.25.0

func (d *DeviceCache) Start(ctx context.Context) error

type NetNsCache added in v0.25.0

type NetNsCache struct {
	// contains filtered or unexported fields
}

func NewNetNsCache added in v0.25.0

func NewNetNsCache() *NetNsCache

func (*NetNsCache) Get added in v0.25.0

func (n *NetNsCache) Get(inodeId uint32) (*types.NetNs, error)

func (*NetNsCache) GetCurrentNs added in v0.25.0

func (n *NetNsCache) GetCurrentNs() *types.NetNs

func (*NetNsCache) GetOrFetchByPath added in v0.25.0

func (n *NetNsCache) GetOrFetchByPath(p string) (*types.NetNs, error)

func (*NetNsCache) Start added in v0.25.0

func (n *NetNsCache) Start(ctx context.Context) error

type ProcessCache

type ProcessCache struct {
	// contains filtered or unexported fields
}

func NewProcessCache

func NewProcessCache() *ProcessCache

func (*ProcessCache) AddItem

func (c *ProcessCache) AddItem(exec types.ProcessExec)

func (*ProcessCache) AddItemWithContext added in v0.10.0

func (c *ProcessCache) AddItemWithContext(exec types.ProcessExec, rawCtx types.PacketContext)

func (*ProcessCache) Get

func (c *ProcessCache) Get(pid int, mntNs, netNs int, cgroupName string) types.PacketContext

func (*ProcessCache) GetPidsByComm added in v0.5.2

func (c *ProcessCache) GetPidsByComm(name string) []int

func (*ProcessCache) GetPidsByMntNsId added in v0.13.0

func (c *ProcessCache) GetPidsByMntNsId(nsid int64) []int

func (*ProcessCache) GetPidsByNetNsId added in v0.13.0

func (c *ProcessCache) GetPidsByNetNsId(nsid int64) []int

func (*ProcessCache) GetPidsByPidNsId added in v0.13.0

func (c *ProcessCache) GetPidsByPidNsId(nsid int64) []int

func (*ProcessCache) MarkDead added in v0.15.0

func (c *ProcessCache) MarkDead(pid int)

func (*ProcessCache) Start

func (c *ProcessCache) Start(ctx context.Context)

func (*ProcessCache) WithContainerCache added in v0.10.0

func (c *ProcessCache) WithContainerCache(cc *ContainerCache) *ProcessCache

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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