hooks

package
v2.3.0-beta29 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2024 License: Apache-2.0 Imports: 26 Imported by: 0

README

Hooks Package Documentation

The hooks package contains the user-space Go code responsible for loading eBPF hooks and eBPF maps, which are used to instrument the user API. This package is utilized by the CLI commands. Additionally, it launches proxy on a defined port to capture egress calls.

Documentation

Overview

Package hooks provides functionality for managing hooks.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetPortToSendToKernel

func GetPortToSendToKernel(_ context.Context, rules []config.BypassRule) []uint

func IPv4ToUint32

func IPv4ToUint32(ipStr string) (uint32, error)

IPv4ToUint32 converts a string representation of an IPv4 address to a 32-bit integer.

func ToIPv4MappedIPv6

func ToIPv4MappedIPv6(ipv4 string) ([4]uint32, error)

ToIPv4MappedIPv6 converts an IPv4 address to an IPv4-mapped IPv6 address.

Types

type Hooks

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

func NewHooks

func NewHooks(logger *zap.Logger, cfg *config.Config) *Hooks

func (*Hooks) CleanProxyEntry

func (h *Hooks) CleanProxyEntry(srcPort uint16) error

func (*Hooks) Delete

func (h *Hooks) Delete(_ context.Context, srcPort uint16) error

func (*Hooks) Get

func (h *Hooks) Get(_ context.Context, srcPort uint16) (*core.NetworkAddress, error)

Get Used by proxy

func (*Hooks) GetDestinationInfo

func (h *Hooks) GetDestinationInfo(srcPort uint16) (*structs.DestInfo, error)

GetDestinationInfo retrieves destination information associated with a source port.

func (*Hooks) Load

func (h *Hooks) Load(ctx context.Context, id uint64, opts core.HookCfg) error

func (*Hooks) Record

func (h *Hooks) Record(ctx context.Context, _ uint64, opts models.IncomingOptions) (<-chan *models.TestCase, error)

func (*Hooks) SendAgentInfo

func (h *Hooks) SendAgentInfo(agentInfo structs.AgentInfo) error

func (*Hooks) SendClientInfo

func (h *Hooks) SendClientInfo(id uint64, appInfo structs.ClientInfo) error

func (*Hooks) SendDockerAppInfo

func (h *Hooks) SendDockerAppInfo(_ uint64, dockerAppInfo structs.DockerAppInfo) error

Directories

Path Synopsis
Package conn provides functionality for handling connections.
Package conn provides functionality for handling connections.
Package structs provides data structures for hooks.
Package structs provides data structures for hooks.

Jump to

Keyboard shortcuts

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