Documentation
¶
Overview ¶
line below avoids linter errors on Mac
Index ¶
- Constants
- Variables
- func EnsureCiliumCompatibility(backend config.TCBackend) error
- type AttachmentType
- type IMIfaceMap
- type InterfaceFilter
- type InterfaceManager
- func (im *InterfaceManager) AddErrorCallback(cb InterfaceManagerErrorCB) uint64
- func (im *InterfaceManager) AddInterfaceAddedCallback(cb InterfaceManagerCB) uint64
- func (im *InterfaceManager) AddInterfaceRemovedCallback(cb InterfaceManagerCB) uint64
- func (im *InterfaceManager) InterfaceName(ifaceIndex int) (string, bool)
- func (im *InterfaceManager) Interfaces() IMIfaceMap
- func (im *InterfaceManager) RemoveCallback(id uint64)
- func (im *InterfaceManager) SetChannelBufferLen(channelBufferLen int)
- func (im *InterfaceManager) SetInterfaceFilter(filter *InterfaceFilter)
- func (im *InterfaceManager) SetMonitorMode(mode MonitorMode)
- func (im *InterfaceManager) SetPollPeriod(period time.Duration)
- func (im *InterfaceManager) Start(ctx context.Context)
- func (im *InterfaceManager) Stop()
- func (im *InterfaceManager) Wait()
- type InterfaceManagerCB
- type InterfaceManagerErrorCB
- type MonitorMode
- type TCManager
Constants ¶
View Source
const ( AttachmentEgress = AttachmentType(iota) AttachmentIngress )
View Source
const ( MonitorPoll = MonitorMode(iota) MonitorWatch )
View Source
const ( DefaultMonitorMode = MonitorWatch DefaultChannelBufferLen = 10 DefaultPollPeriod = 10 * time.Second )
Variables ¶
View Source
var IsTCXSupported = sync.OnceValue(func() bool { prog, err := ebpf.NewProgram(&ebpf.ProgramSpec{ Type: ebpf.SchedCLS, Instructions: asm.Instructions{ asm.Mov.Imm(asm.R0, 0), asm.Return(), }, License: "Apache-2.0", }) if err != nil { return false } defer func() { _ = prog.Close() }() l, err := link.AttachTCX(link.TCXOptions{ Program: prog, Attach: ebpf.AttachTCXIngress, Interface: 1, Anchor: link.Tail(), }) if err != nil { return false } if err := l.Close(); err != nil { return false } return true })
Functions ¶
Types ¶
type AttachmentType ¶
type AttachmentType uint8
type IMIfaceMap ¶
type InterfaceFilter ¶
type InterfaceFilter struct {
// contains filtered or unexported fields
}
func NewInterfaceFilter ¶
func NewInterfaceFilter(allowed []string, excluded []string) (*InterfaceFilter, error)
func (*InterfaceFilter) Allow ¶
func (itf *InterfaceFilter) Allow(pattern string) error
func (*InterfaceFilter) Deny ¶
func (itf *InterfaceFilter) Deny(pattern string) error
func (*InterfaceFilter) IsAllowed ¶
func (itf *InterfaceFilter) IsAllowed(name string) bool
type InterfaceManager ¶
type InterfaceManager struct {
// contains filtered or unexported fields
}
func NewInterfaceManager ¶
func NewInterfaceManager() *InterfaceManager
func (*InterfaceManager) AddErrorCallback ¶
func (im *InterfaceManager) AddErrorCallback(cb InterfaceManagerErrorCB) uint64
func (*InterfaceManager) AddInterfaceAddedCallback ¶
func (im *InterfaceManager) AddInterfaceAddedCallback(cb InterfaceManagerCB) uint64
func (*InterfaceManager) AddInterfaceRemovedCallback ¶
func (im *InterfaceManager) AddInterfaceRemovedCallback(cb InterfaceManagerCB) uint64
func (*InterfaceManager) InterfaceName ¶
func (im *InterfaceManager) InterfaceName(ifaceIndex int) (string, bool)
func (*InterfaceManager) Interfaces ¶
func (im *InterfaceManager) Interfaces() IMIfaceMap
func (*InterfaceManager) RemoveCallback ¶
func (im *InterfaceManager) RemoveCallback(id uint64)
func (*InterfaceManager) SetChannelBufferLen ¶
func (im *InterfaceManager) SetChannelBufferLen(channelBufferLen int)
func (*InterfaceManager) SetInterfaceFilter ¶
func (im *InterfaceManager) SetInterfaceFilter(filter *InterfaceFilter)
func (*InterfaceManager) SetMonitorMode ¶
func (im *InterfaceManager) SetMonitorMode(mode MonitorMode)
func (*InterfaceManager) SetPollPeriod ¶
func (im *InterfaceManager) SetPollPeriod(period time.Duration)
func (*InterfaceManager) Start ¶
func (im *InterfaceManager) Start(ctx context.Context)
func (*InterfaceManager) Stop ¶
func (im *InterfaceManager) Stop()
func (*InterfaceManager) Wait ¶
func (im *InterfaceManager) Wait()
type InterfaceManagerCB ¶
type InterfaceManagerErrorCB ¶
type InterfaceManagerErrorCB func(error)
type MonitorMode ¶
type MonitorMode uint8
type TCManager ¶
type TCManager interface {
Shutdown()
AddProgram(name string, prog *ebpf.Program, attachment AttachmentType)
RemoveProgram(name string)
SetInterfaceManager(im *InterfaceManager)
Errors() chan error
}
func NewNetlinkManager ¶
func NewNetlinkManager() TCManager
func NewTCManager ¶
func NewTCXManager ¶
func NewTCXManager() TCManager
Click to show internal directories.
Click to hide internal directories.