Documentation ¶
Overview ¶
Package hooks provides functionality for managing hooks.
Index ¶
- func IPv4ToUint32(ipStr string) (uint32, error)
- func ToIPv4MappedIPv6(ipv4 string) ([4]uint32, error)
- type Hooks
- func (h *Hooks) CleanProxyEntry(srcPort uint16) error
- func (h *Hooks) Delete(_ context.Context, srcPort uint16) error
- func (h *Hooks) Get(_ context.Context, srcPort uint16) (*core.NetworkAddress, error)
- func (h *Hooks) GetDestinationInfo(srcPort uint16) (*structs.DestInfo, error)
- func (h *Hooks) Load(ctx context.Context, id uint64, opts core.HookCfg) error
- func (h *Hooks) PassThroughPortsInKernel(_ context.Context, _ uint64, ports []uint) error
- func (h *Hooks) Record(ctx context.Context, _ uint64, opts models.IncomingOptions) (<-chan *models.TestCase, error)
- func (h *Hooks) SendAppPid(pid uint32) error
- func (h *Hooks) SendCmdType(isDocker bool) error
- func (h *Hooks) SendDNSPort(port uint32) error
- func (h *Hooks) SendInode(_ context.Context, _ uint64, inode uint64) error
- func (h *Hooks) SendKeployPid(pid uint32) error
- func (h *Hooks) SendKeployPids(key models.ModeKey, pid uint32) error
- func (h *Hooks) SendKeployPorts(key models.ModeKey, port uint32) error
- func (h *Hooks) SendNameSpaceID(key uint32, inode uint64) error
- func (h *Hooks) SendPassThroughPorts(filterPorts []uint) error
- func (h *Hooks) SendProxyInfo(ip4, port uint32, ip6 [4]uint32) error
- func (h *Hooks) SetKeployModeInKernel(mode uint32) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IPv4ToUint32 ¶
IPv4ToUint32 converts a string representation of an IPv4 address to a 32-bit integer.
func ToIPv4MappedIPv6 ¶
ToIPv4MappedIPv6 converts an IPv4 address to an IPv4-mapped IPv6 address.
Types ¶
type Hooks ¶
type Hooks struct { DockerCmdMap *ebpf.Map DNSPort *ebpf.Map // contains filtered or unexported fields }
func (*Hooks) CleanProxyEntry ¶
func (*Hooks) GetDestinationInfo ¶
GetDestinationInfo retrieves destination information associated with a source port.
func (*Hooks) PassThroughPortsInKernel ¶
func (*Hooks) SendAppPid ¶
SendAppPid sends the application's process ID (PID) to the kernel. This function is used when running Keploy tests along with unit tests of the application.
func (*Hooks) SendCmdType ¶
func (*Hooks) SendDNSPort ¶
func (*Hooks) SendInode ¶
SendInode sends the inode of the container to ebpf hooks to filter the network traffic
func (*Hooks) SendKeployPid ¶
func (*Hooks) SendKeployPids ¶
SendKeployPids is used to send keploy recordServer(key-0) or testServer(key-1) Pid to the ebpf program
func (*Hooks) SendKeployPorts ¶
SendKeployPorts is used to send keploy recordServer(key-0) or testServer(key-1) Port to the ebpf program
func (*Hooks) SendNameSpaceID ¶
SendNameSpaceID function is helpful when user application in running inside a docker container.
func (*Hooks) SendPassThroughPorts ¶
SendPassThroughPorts sends the destination ports of the server which should not be intercepted by keploy proxy.
func (*Hooks) SendProxyInfo ¶
SendProxyInfo sends the IP and Port of the running proxy in the eBPF program.