package stack
import "gvisor.dev/gvisor/pkg/sentry/socket/plugin/stack"
Package stack provides an implementation of plugin.PluginStack interface and an implementation of socket.Socket interface.
It glues sentry interfaces with plugin netstack interfaces defined in cgo.
Index ¶
- Constants
- type Notifier
- func NewNotifier() *Notifier
- func (n *Notifier) AddFD(fd uint32, eventInfo *plugin.EventInfo)
- func (n *Notifier) RemoveFD(fd uint32)
- func (n *Notifier) UpdateFD(fd uint32)
- type Stack
- func (s *Stack) AddInterfaceAddr(idx int32, addr inet.InterfaceAddr) error
- func (*Stack) Destroy()
- func (*Stack) EnableSaveRestore() error
- func (s *Stack) Init(args *plugin.InitStackArgs) error
- func (s *Stack) InterfaceAddrs() map[int32][]inet.InterfaceAddr
- func (s *Stack) Interfaces() map[int32]inet.Interface
- func (s *Stack) PreInit(args *plugin.PreInitStackArgs) (string, []int, error)
- func (s *Stack) RemoveInterfaceAddr(int32, inet.InterfaceAddr) error
- func (s *Stack) SupportsIPv6() bool
Constants ¶
const ( MaxEpollEvents = 128 SleepInMsecond = 100 )
Types ¶
type Notifier ¶
type Notifier struct {
// contains filtered or unexported fields
}
Notifier holds all the state necessary to issue notifications when IO events occur on the observed FDs in plugin stack.
func NewNotifier ¶
func NewNotifier() *Notifier
NewNotifier initialize the event notifier for plugin stack. It will allocate a eventMap with fd as key and corresponding eventInfo as value and start a goroutine waiting the arrival of events.
func (*Notifier) AddFD ¶
AddFD implements plugin.PluginNotifier.AddFD.
func (*Notifier) RemoveFD ¶
RemoveFD implements plugin.PluginNotifier.RemoveFD.
func (*Notifier) UpdateFD ¶
UpdateFD implements plugin.PluginNotifier.UpdateFD.
type Stack ¶
Stack is a struct that interacts with third-party network stack. It implements inet.Stack and plugin.PluginStack.
func (*Stack) AddInterfaceAddr ¶
func (s *Stack) AddInterfaceAddr(idx int32, addr inet.InterfaceAddr) error
AddInterfaceAddr implements inet.Stack.AddInterfaceAddr.
func (*Stack) Destroy ¶
func (*Stack) Destroy()
Destroy implements inet.Stack.Destroy.
func (*Stack) EnableSaveRestore ¶
EnableSaveRestore implements inet.Stack.EnableSaveRestore.
func (*Stack) Init ¶
func (s *Stack) Init(args *plugin.InitStackArgs) error
Init implements plugin.PluginStack.Init.
func (*Stack) InterfaceAddrs ¶
func (s *Stack) InterfaceAddrs() map[int32][]inet.InterfaceAddr
InterfaceAddrs implements inet.Stack.InterfaceAddrs.
func (*Stack) Interfaces ¶
Interfaces implements inet.Stack.Interfaces.
func (*Stack) PreInit ¶
PreInit implements plugin.PluginStack.PreInit.
func (*Stack) RemoveInterfaceAddr ¶
func (s *Stack) RemoveInterfaceAddr(int32, inet.InterfaceAddr) error
RemoveInterfaceAddr implements inet.Stack.RemoveInterfaceAddr.
func (*Stack) SupportsIPv6 ¶
SupportsIPv6 implements Stack.SupportsIPv6.
Source Files ¶
notifier.go provider.go readwriter.go socket.go stack.go util.go
- Version
- v0.0.0-20250605235530-a6711d1e1dc6 (latest)
- Published
- Jun 5, 2025
- Platform
- linux/amd64
- Imports
- 32 packages
- Last checked
- 4 hours ago –
Tools for package owners.