Documentation ¶
Overview ¶
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
- type Stack
- func (s *Stack) AddInterfaceAddr(idx int32, addr inet.InterfaceAddr) error
- func (*Stack) Destroy()
- 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 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
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.
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) 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) RemoveInterfaceAddr ¶
func (s *Stack) RemoveInterfaceAddr(int32, inet.InterfaceAddr) error
RemoveInterfaceAddr implements inet.Stack.RemoveInterfaceAddr.
func (*Stack) SupportsIPv6 ¶
SupportsIPv6 implements Stack.SupportsIPv6.