package plugin
import "gvisor.dev/gvisor/pkg/sentry/socket/plugin"
Package plugin provides a set of interfaces to interact with third-party netstack. It will be used during sandbox network setup when NetworkType is set as NetworkPlugin.
Index ¶
- func RegisterPluginStack(stack PluginStack)
- func SeccompFilters() seccomp.SyscallRules
- type EventInfo
- type InitStackArgs
- type PluginNotifier
- type PluginStack
- type PreInitStackArgs
Functions ¶
func RegisterPluginStack ¶
func RegisterPluginStack(stack PluginStack)
RegisterPluginStack registers given stack as plugin stack.
func SeccompFilters ¶
func SeccompFilters() seccomp.SyscallRules
SeccompFilters defines seccomp allowed rules that are needed by cgo.
Types ¶
type EventInfo ¶
type EventInfo struct { // Queue is the socket corresponding event queue. Wq *waiter.Queue // Mask represents events this socket registered. Mask waiter.EventMask // Ready represents events has been currently reported. Ready waiter.EventMask // Waiting represents whether there is any waiting event. Waiting bool }
EventInfo is a struct that holds information necessary to a socket notification mechanisms.
type InitStackArgs ¶
type InitStackArgs struct { // InitStr represents arguments needed to initialize plugin stack. InitStr string // FDs represents files opened during stack pre-init stage, which will // be used in stack initialization. FDs []int }
InitStackArgs is a struct that holds arguments needed by PluginStack.Init.
type PluginNotifier ¶
type PluginNotifier interface { // AddFD registers a new socket fd and its corresponding // event notification info into the global fdMap. AddFD(fd uint32, eventinfo *EventInfo) error // RemoveFD unregisters a socket fd and its corresponding // event notification info from the global fdMap. RemoveFD(fd uint32) // UpdateFD updates the set of events the socket fd needs // to be notified on. UpdateFD(fd uint32) error }
PluginNotifier represents a set of operations to handle plugin network stack's event notification mechanisms.
type PluginStack ¶
type PluginStack interface { inet.Stack // Init initializes plugin stack. Init(args *InitStackArgs) error // PreInit handles prepare steps before initializing plugin stack. // It may include joining namespace, mounting NIC, etc. PreInit(args *PreInitStackArgs) (string, []int, error) }
PluginStack defines a set of stack operations to work with a third-party plugin stack.
func GetPluginStack ¶
func GetPluginStack() PluginStack
GetPluginStack fetches the current registered plugin stack.
type PreInitStackArgs ¶
type PreInitStackArgs struct { // Pid represents current process that invokes plugin stack // pre-init. Pid int }
PreInitStackArgs is a struct that holds arguments needed by PluginStack.PreInit.
Source Files ¶
config.go plugin.go
Directories ¶
Path | Synopsis |
---|---|
pkg/sentry/socket/plugin/cgo | Package cgo provides interfaces definition to interact with third-party network stack. |
pkg/sentry/socket/plugin/stack | Package stack provides an implementation of plugin.PluginStack interface and an implementation of socket.Socket interface. |
- Version
- v0.0.0-20250605235530-a6711d1e1dc6 (latest)
- Published
- Jun 5, 2025
- Platform
- linux/amd64
- Imports
- 4 packages
- Last checked
- 4 hours ago –
Tools for package owners.