bypass4netns

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2022 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SeccompAddFdFlagSetFd        = 1
	SeccompUserNotifFlagContinue = 1
	SeccompIocMagic              = '!'
)
View Source
const (
	// Bypassed means that the socket is replaced by one created on the host
	Bypassed socketState = iota

	// SwitchBacked means that the socket was bypassed but now rereplaced to the socket in netns.
	// This state can be hannpend in connect(2), sendto(2) and sendmsg(2)
	// when connecting to a host outside of netns and then connecting to a host inside of netns with same fd.
	SwitchBacked
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ForwardPortMapping

type ForwardPortMapping struct {
	HostPort  int
	ChildPort int
}

type Handler

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

func NewHandler

func NewHandler(socketPath string) *Handler

NewHandler creates new seccomp notif handler

func (*Handler) SetForwardingPort

func (h *Handler) SetForwardingPort(mapping ForwardPortMapping) error

SetForwardingPort checks and configures port forwarding

func (*Handler) SetIgnoredSubnets

func (h *Handler) SetIgnoredSubnets(subnets []net.IPNet)

SetIgnoreSubnets configures subnets to ignore in bypass4netns.

func (*Handler) SetReadyFd

func (h *Handler) SetReadyFd(fd int) error

SetReadyFd configure ready notification file descriptor

func (*Handler) StartHandle

func (h *Handler) StartHandle()

StartHandle starts seccomp notif handler

Jump to

Keyboard shortcuts

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