stack

package
v0.0.0-...-46bd2a0 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2024 License: Apache-2.0, MIT Imports: 32 Imported by: 0

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

View Source
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.

func (*Notifier) AddFD

func (n *Notifier) AddFD(fd uint32, eventInfo *plugin.EventInfo)

AddFD implements plugin.PluginNotifier.AddFD.

func (*Notifier) RemoveFD

func (n *Notifier) RemoveFD(fd uint32)

RemoveFD implements plugin.PluginNotifier.RemoveFD.

func (*Notifier) UpdateFD

func (n *Notifier) UpdateFD(fd uint32)

UpdateFD implements plugin.PluginNotifier.UpdateFD.

type Stack

type Stack struct {
	inet.Stack
	// contains filtered or unexported fields
}

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) 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

func (s *Stack) Interfaces() map[int32]inet.Interface

Interfaces implements inet.Stack.Interfaces.

func (*Stack) PreInit

func (s *Stack) PreInit(args *plugin.PreInitStackArgs) (string, []int, error)

PreInit implements plugin.PluginStack.PreInit.

func (*Stack) RemoveInterfaceAddr

func (s *Stack) RemoveInterfaceAddr(int32, inet.InterfaceAddr) error

RemoveInterfaceAddr implements inet.Stack.RemoveInterfaceAddr.

func (*Stack) SupportsIPv6

func (s *Stack) SupportsIPv6() bool

SupportsIPv6 implements Stack.SupportsIPv6.

Jump to

Keyboard shortcuts

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