network

package
v0.0.0-...-1e8dc9b Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Overview

Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0. This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2024 Datadog, Inc.

Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0. This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2024 Datadog, Inc.

Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0. This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2024 Datadog, Inc.

Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0. This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2024 Datadog, Inc.

Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0. This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2024 Datadog, Inc.

Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0. This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2024 Datadog, Inc.

Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0. This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2024 Datadog, Inc.

Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0. This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2024 Datadog, Inc.

Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0. This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2024 Datadog, Inc.

Index

Constants

View Source
const (
	TCP protocol = "tcp"
	UDP protocol = "udp"
	ARP protocol = "arp"
	ALL protocol = "*"
)

Variables

View Source
var (
	ConnStateUndefined   connState
	ConnStateNew         connState = "+trk+new"
	ConnStateEstablished connState = "+trk+est"
)

Functions

func AllProtocols

func AllProtocols[C protocolString](p C) []protocol

func NewBPFTCFilterConfigExecutor

func NewBPFTCFilterConfigExecutor(log *zap.SugaredLogger, dryRun bool) executor

NewBPFTCFilterConfigExecutor create a new instance of an executor responsible of configure tc eBPF filter program

func NewConnState

func NewConnState(hostConnState string) connState

NewConnState returns a connection state value based on the given string, possible values are: - new: new connections - est: established connections - empty string (""): undefined

Types

type DNSClient

type DNSClient interface {
	Resolve(host string) ([]net.IP, error)
}

DNSClient is a client being able to resolve the given host

func NewDNSClient

func NewDNSClient() DNSClient

NewDNSClient creates a standard DNS client

type DNSClientMock

type DNSClientMock struct {
	mock.Mock
}

DNSClientMock is an autogenerated mock type for the DNSClient type

func NewDNSClientMock

func NewDNSClientMock(t interface {
	mock.TestingT
	Cleanup(func())
}) *DNSClientMock

NewDNSClientMock creates a new instance of DNSClientMock. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.

func (*DNSClientMock) EXPECT

func (_m *DNSClientMock) EXPECT() *DNSClientMock_Expecter

func (*DNSClientMock) Resolve

func (_m *DNSClientMock) Resolve(host string) ([]net.IP, error)

Resolve provides a mock function with given fields: host

type DNSClientMock_Expecter

type DNSClientMock_Expecter struct {
	// contains filtered or unexported fields
}

func (*DNSClientMock_Expecter) Resolve

func (_e *DNSClientMock_Expecter) Resolve(host interface{}) *DNSClientMock_Resolve_Call

Resolve is a helper method to define mock.On call

  • host string

type DNSClientMock_Resolve_Call

type DNSClientMock_Resolve_Call struct {
	*mock.Call
}

DNSClientMock_Resolve_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Resolve'

func (*DNSClientMock_Resolve_Call) Return

func (*DNSClientMock_Resolve_Call) Run

func (*DNSClientMock_Resolve_Call) RunAndReturn

func (_c *DNSClientMock_Resolve_Call) RunAndReturn(run func(string) ([]net.IP, error)) *DNSClientMock_Resolve_Call

type DNSConfig

type DNSConfig struct {
	DNSServer string
	KubeDNS   string
}

type IPTables

type IPTables interface {
	Clear() error
	LogConntrack() error
	RedirectTo(protocol string, port string, destinationIP string) error
	Intercept(protocol string, port string, cgroupPath string, cgroupClassID string, injectorPodIP string) error
	MarkCgroupPath(cgroupPath string, mark string) error
	MarkClassID(classid string, mark string) error
}

IPTables is an interface for interacting with target nat firewall/iptables rules

func NewIPTables

func NewIPTables(log *zap.SugaredLogger, dryRun bool) (IPTables, error)

NewIPTables returns an implementation of the IPTables interface that can log

type IPTablesMock

type IPTablesMock struct {
	mock.Mock
}

IPTablesMock is an autogenerated mock type for the IPTables type

func NewIPTablesMock

func NewIPTablesMock(t interface {
	mock.TestingT
	Cleanup(func())
}) *IPTablesMock

NewIPTablesMock creates a new instance of IPTablesMock. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.

func (*IPTablesMock) Clear

func (_m *IPTablesMock) Clear() error

Clear provides a mock function with given fields:

func (*IPTablesMock) EXPECT

func (_m *IPTablesMock) EXPECT() *IPTablesMock_Expecter

func (*IPTablesMock) Intercept

func (_m *IPTablesMock) Intercept(protocol string, port string, cgroupPath string, cgroupClassID string, injectorPodIP string) error

Intercept provides a mock function with given fields: protocol, port, cgroupPath, cgroupClassID, injectorPodIP

func (*IPTablesMock) LogConntrack

func (_m *IPTablesMock) LogConntrack() error

LogConntrack provides a mock function with given fields:

func (*IPTablesMock) MarkCgroupPath

func (_m *IPTablesMock) MarkCgroupPath(cgroupPath string, mark string) error

MarkCgroupPath provides a mock function with given fields: cgroupPath, mark

func (*IPTablesMock) MarkClassID

func (_m *IPTablesMock) MarkClassID(classid string, mark string) error

MarkClassID provides a mock function with given fields: classid, mark

func (*IPTablesMock) RedirectTo

func (_m *IPTablesMock) RedirectTo(protocol string, port string, destinationIP string) error

RedirectTo provides a mock function with given fields: protocol, port, destinationIP

type IPTablesMock_Clear_Call

type IPTablesMock_Clear_Call struct {
	*mock.Call
}

IPTablesMock_Clear_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Clear'

func (*IPTablesMock_Clear_Call) Return

func (*IPTablesMock_Clear_Call) Run

func (_c *IPTablesMock_Clear_Call) Run(run func()) *IPTablesMock_Clear_Call

func (*IPTablesMock_Clear_Call) RunAndReturn

func (_c *IPTablesMock_Clear_Call) RunAndReturn(run func() error) *IPTablesMock_Clear_Call

type IPTablesMock_Expecter

type IPTablesMock_Expecter struct {
	// contains filtered or unexported fields
}

func (*IPTablesMock_Expecter) Clear

Clear is a helper method to define mock.On call

func (*IPTablesMock_Expecter) Intercept

func (_e *IPTablesMock_Expecter) Intercept(protocol interface{}, port interface{}, cgroupPath interface{}, cgroupClassID interface{}, injectorPodIP interface{}) *IPTablesMock_Intercept_Call

Intercept is a helper method to define mock.On call

  • protocol string
  • port string
  • cgroupPath string
  • cgroupClassID string
  • injectorPodIP string

func (*IPTablesMock_Expecter) LogConntrack

LogConntrack is a helper method to define mock.On call

func (*IPTablesMock_Expecter) MarkCgroupPath

func (_e *IPTablesMock_Expecter) MarkCgroupPath(cgroupPath interface{}, mark interface{}) *IPTablesMock_MarkCgroupPath_Call

MarkCgroupPath is a helper method to define mock.On call

  • cgroupPath string
  • mark string

func (*IPTablesMock_Expecter) MarkClassID

func (_e *IPTablesMock_Expecter) MarkClassID(classid interface{}, mark interface{}) *IPTablesMock_MarkClassID_Call

MarkClassID is a helper method to define mock.On call

  • classid string
  • mark string

func (*IPTablesMock_Expecter) RedirectTo

func (_e *IPTablesMock_Expecter) RedirectTo(protocol interface{}, port interface{}, destinationIP interface{}) *IPTablesMock_RedirectTo_Call

RedirectTo is a helper method to define mock.On call

  • protocol string
  • port string
  • destinationIP string

type IPTablesMock_Intercept_Call

type IPTablesMock_Intercept_Call struct {
	*mock.Call
}

IPTablesMock_Intercept_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Intercept'

func (*IPTablesMock_Intercept_Call) Return

func (*IPTablesMock_Intercept_Call) Run

func (_c *IPTablesMock_Intercept_Call) Run(run func(protocol string, port string, cgroupPath string, cgroupClassID string, injectorPodIP string)) *IPTablesMock_Intercept_Call

func (*IPTablesMock_Intercept_Call) RunAndReturn

type IPTablesMock_LogConntrack_Call

type IPTablesMock_LogConntrack_Call struct {
	*mock.Call
}

IPTablesMock_LogConntrack_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LogConntrack'

func (*IPTablesMock_LogConntrack_Call) Return

func (*IPTablesMock_LogConntrack_Call) Run

func (*IPTablesMock_LogConntrack_Call) RunAndReturn

type IPTablesMock_MarkCgroupPath_Call

type IPTablesMock_MarkCgroupPath_Call struct {
	*mock.Call
}

IPTablesMock_MarkCgroupPath_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'MarkCgroupPath'

func (*IPTablesMock_MarkCgroupPath_Call) Return

func (*IPTablesMock_MarkCgroupPath_Call) Run

func (*IPTablesMock_MarkCgroupPath_Call) RunAndReturn

type IPTablesMock_MarkClassID_Call

type IPTablesMock_MarkClassID_Call struct {
	*mock.Call
}

IPTablesMock_MarkClassID_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'MarkClassID'

func (*IPTablesMock_MarkClassID_Call) Return

func (*IPTablesMock_MarkClassID_Call) Run

func (*IPTablesMock_MarkClassID_Call) RunAndReturn

type IPTablesMock_RedirectTo_Call

type IPTablesMock_RedirectTo_Call struct {
	*mock.Call
}

IPTablesMock_RedirectTo_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RedirectTo'

func (*IPTablesMock_RedirectTo_Call) Return

func (*IPTablesMock_RedirectTo_Call) Run

func (_c *IPTablesMock_RedirectTo_Call) Run(run func(protocol string, port string, destinationIP string)) *IPTablesMock_RedirectTo_Call

func (*IPTablesMock_RedirectTo_Call) RunAndReturn

type NetlinkAdapter

type NetlinkAdapter interface {
	LinkList(useLocalhost bool, log *zap.SugaredLogger) ([]NetlinkLink, error)
	LinkByIndex(index int) (NetlinkLink, error)
	LinkByName(name string) (NetlinkLink, error)
	DefaultRoutes() ([]NetlinkRoute, error)
}

NetlinkAdapter is an interface being able to read the host network interfaces information

func NewNetlinkAdapter

func NewNetlinkAdapter() NetlinkAdapter

NewNetlinkAdapter returns a standard netlink adapter

type NetlinkAdapterMock

type NetlinkAdapterMock struct {
	mock.Mock
}

NetlinkAdapterMock is an autogenerated mock type for the NetlinkAdapter type

func NewNetlinkAdapterMock

func NewNetlinkAdapterMock(t interface {
	mock.TestingT
	Cleanup(func())
}) *NetlinkAdapterMock

NewNetlinkAdapterMock creates a new instance of NetlinkAdapterMock. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.

func (*NetlinkAdapterMock) DefaultRoutes

func (_m *NetlinkAdapterMock) DefaultRoutes() ([]NetlinkRoute, error)

DefaultRoutes provides a mock function with given fields:

func (*NetlinkAdapterMock) EXPECT

func (*NetlinkAdapterMock) LinkByIndex

func (_m *NetlinkAdapterMock) LinkByIndex(index int) (NetlinkLink, error)

LinkByIndex provides a mock function with given fields: index

func (*NetlinkAdapterMock) LinkByName

func (_m *NetlinkAdapterMock) LinkByName(name string) (NetlinkLink, error)

LinkByName provides a mock function with given fields: name

func (_m *NetlinkAdapterMock) LinkList(useLocalhost bool, log *zap.SugaredLogger) ([]NetlinkLink, error)

LinkList provides a mock function with given fields: useLocalhost, log

type NetlinkAdapterMock_DefaultRoutes_Call

type NetlinkAdapterMock_DefaultRoutes_Call struct {
	*mock.Call
}

NetlinkAdapterMock_DefaultRoutes_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DefaultRoutes'

func (*NetlinkAdapterMock_DefaultRoutes_Call) Return

func (*NetlinkAdapterMock_DefaultRoutes_Call) Run

func (*NetlinkAdapterMock_DefaultRoutes_Call) RunAndReturn

type NetlinkAdapterMock_Expecter

type NetlinkAdapterMock_Expecter struct {
	// contains filtered or unexported fields
}

func (*NetlinkAdapterMock_Expecter) DefaultRoutes

DefaultRoutes is a helper method to define mock.On call

func (*NetlinkAdapterMock_Expecter) LinkByIndex

func (_e *NetlinkAdapterMock_Expecter) LinkByIndex(index interface{}) *NetlinkAdapterMock_LinkByIndex_Call

LinkByIndex is a helper method to define mock.On call

  • index int

func (*NetlinkAdapterMock_Expecter) LinkByName

func (_e *NetlinkAdapterMock_Expecter) LinkByName(name interface{}) *NetlinkAdapterMock_LinkByName_Call

LinkByName is a helper method to define mock.On call

  • name string
func (_e *NetlinkAdapterMock_Expecter) LinkList(useLocalhost interface{}, log interface{}) *NetlinkAdapterMock_LinkList_Call

LinkList is a helper method to define mock.On call

  • useLocalhost bool
  • log *zap.SugaredLogger

type NetlinkAdapterMock_LinkByIndex_Call

type NetlinkAdapterMock_LinkByIndex_Call struct {
	*mock.Call
}

NetlinkAdapterMock_LinkByIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LinkByIndex'

func (*NetlinkAdapterMock_LinkByIndex_Call) Return

func (*NetlinkAdapterMock_LinkByIndex_Call) Run

func (*NetlinkAdapterMock_LinkByIndex_Call) RunAndReturn

type NetlinkAdapterMock_LinkByName_Call

type NetlinkAdapterMock_LinkByName_Call struct {
	*mock.Call
}

NetlinkAdapterMock_LinkByName_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LinkByName'

func (*NetlinkAdapterMock_LinkByName_Call) Return

func (*NetlinkAdapterMock_LinkByName_Call) Run

func (*NetlinkAdapterMock_LinkByName_Call) RunAndReturn

type NetlinkAdapterMock_LinkList_Call struct {
	*mock.Call
}

NetlinkAdapterMock_LinkList_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LinkList'

type NetlinkLink interface {
	Name() string
	SetTxQLen(qlen int) error
	TxQLen() int
}

NetlinkLink is a host interface

type NetlinkLinkMock

type NetlinkLinkMock struct {
	mock.Mock
}

NetlinkLinkMock is an autogenerated mock type for the NetlinkLink type

func NewNetlinkLinkMock

func NewNetlinkLinkMock(t interface {
	mock.TestingT
	Cleanup(func())
}) *NetlinkLinkMock

NewNetlinkLinkMock creates a new instance of NetlinkLinkMock. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.

func (*NetlinkLinkMock) EXPECT

func (*NetlinkLinkMock) Name

func (_m *NetlinkLinkMock) Name() string

Name provides a mock function with given fields:

func (*NetlinkLinkMock) SetTxQLen

func (_m *NetlinkLinkMock) SetTxQLen(qlen int) error

SetTxQLen provides a mock function with given fields: qlen

func (*NetlinkLinkMock) TxQLen

func (_m *NetlinkLinkMock) TxQLen() int

TxQLen provides a mock function with given fields:

type NetlinkLinkMock_Expecter

type NetlinkLinkMock_Expecter struct {
	// contains filtered or unexported fields
}

func (*NetlinkLinkMock_Expecter) Name

Name is a helper method to define mock.On call

func (*NetlinkLinkMock_Expecter) SetTxQLen

func (_e *NetlinkLinkMock_Expecter) SetTxQLen(qlen interface{}) *NetlinkLinkMock_SetTxQLen_Call

SetTxQLen is a helper method to define mock.On call

  • qlen int

func (*NetlinkLinkMock_Expecter) TxQLen

TxQLen is a helper method to define mock.On call

type NetlinkLinkMock_Name_Call

type NetlinkLinkMock_Name_Call struct {
	*mock.Call
}

NetlinkLinkMock_Name_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Name'

func (*NetlinkLinkMock_Name_Call) Return

func (*NetlinkLinkMock_Name_Call) Run

func (*NetlinkLinkMock_Name_Call) RunAndReturn

func (_c *NetlinkLinkMock_Name_Call) RunAndReturn(run func() string) *NetlinkLinkMock_Name_Call

type NetlinkLinkMock_SetTxQLen_Call

type NetlinkLinkMock_SetTxQLen_Call struct {
	*mock.Call
}

NetlinkLinkMock_SetTxQLen_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetTxQLen'

func (*NetlinkLinkMock_SetTxQLen_Call) Return

func (*NetlinkLinkMock_SetTxQLen_Call) Run

func (*NetlinkLinkMock_SetTxQLen_Call) RunAndReturn

type NetlinkLinkMock_TxQLen_Call

type NetlinkLinkMock_TxQLen_Call struct {
	*mock.Call
}

NetlinkLinkMock_TxQLen_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'TxQLen'

func (*NetlinkLinkMock_TxQLen_Call) Return

func (*NetlinkLinkMock_TxQLen_Call) Run

func (*NetlinkLinkMock_TxQLen_Call) RunAndReturn

func (_c *NetlinkLinkMock_TxQLen_Call) RunAndReturn(run func() int) *NetlinkLinkMock_TxQLen_Call

type NetlinkRoute

type NetlinkRoute interface {
	Link() NetlinkLink
	Gateway() net.IP
}

NetlinkRoute is a route attached to a host interface

type NetlinkRouteMock

type NetlinkRouteMock struct {
	mock.Mock
}

NetlinkRouteMock is an autogenerated mock type for the NetlinkRoute type

func NewNetlinkRouteMock

func NewNetlinkRouteMock(t interface {
	mock.TestingT
	Cleanup(func())
}) *NetlinkRouteMock

NewNetlinkRouteMock creates a new instance of NetlinkRouteMock. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.

func (*NetlinkRouteMock) EXPECT

func (*NetlinkRouteMock) Gateway

func (_m *NetlinkRouteMock) Gateway() net.IP

Gateway provides a mock function with given fields:

func (_m *NetlinkRouteMock) Link() NetlinkLink

Link provides a mock function with given fields:

type NetlinkRouteMock_Expecter

type NetlinkRouteMock_Expecter struct {
	// contains filtered or unexported fields
}

func (*NetlinkRouteMock_Expecter) Gateway

Gateway is a helper method to define mock.On call

Link is a helper method to define mock.On call

type NetlinkRouteMock_Gateway_Call

type NetlinkRouteMock_Gateway_Call struct {
	*mock.Call
}

NetlinkRouteMock_Gateway_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Gateway'

func (*NetlinkRouteMock_Gateway_Call) Return

func (*NetlinkRouteMock_Gateway_Call) Run

func (*NetlinkRouteMock_Gateway_Call) RunAndReturn

func (_c *NetlinkRouteMock_Gateway_Call) RunAndReturn(run func() net.IP) *NetlinkRouteMock_Gateway_Call
type NetlinkRouteMock_Link_Call struct {
	*mock.Call
}

NetlinkRouteMock_Link_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Link'

type TrafficController

type TrafficController interface {
	AddNetem(ifaces []string, parent string, handle string, delay time.Duration, delayJitter time.Duration, drop int, corrupt int, duplicate int) error
	AddPrio(ifaces []string, parent string, handle string, bands uint32, priomap [16]uint32) error
	AddFilter(ifaces []string, parent string, handle string, srcIP, dstIP *net.IPNet, srcPort, dstPort int, prot protocol, state connState, flowid string) (uint32, error)
	DeleteFilter(iface string, priority uint32) error
	AddFwFilter(ifaces []string, parent string, handle string, flowid string) error
	AddBPFFilter(ifaces []string, parent string, obj string, flowid string, section string) error
	ConfigBPFFilter(cmd executor, args ...string) error
	AddOutputLimit(ifaces []string, parent string, handle string, bytesPerSec uint) error
	ClearQdisc(ifaces []string) error
}

TrafficController is an interface being able to interact with the host queueing discipline

func NewTrafficController

func NewTrafficController(log *zap.SugaredLogger, dryRun bool) TrafficController

NewTrafficController creates a standard traffic controller using tc and being able to log

type TrafficControllerMock

type TrafficControllerMock struct {
	mock.Mock
}

TrafficControllerMock is an autogenerated mock type for the TrafficController type

func NewTrafficControllerMock

func NewTrafficControllerMock(t interface {
	mock.TestingT
	Cleanup(func())
}) *TrafficControllerMock

NewTrafficControllerMock creates a new instance of TrafficControllerMock. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.

func (*TrafficControllerMock) AddBPFFilter

func (_m *TrafficControllerMock) AddBPFFilter(ifaces []string, parent string, obj string, flowid string, section string) error

AddBPFFilter provides a mock function with given fields: ifaces, parent, obj, flowid, section

func (*TrafficControllerMock) AddFilter

func (_m *TrafficControllerMock) AddFilter(ifaces []string, parent string, handle string, srcIP *net.IPNet, dstIP *net.IPNet, srcPort int, dstPort int, prot protocol, state connState, flowid string) (uint32, error)

AddFilter provides a mock function with given fields: ifaces, parent, handle, srcIP, dstIP, srcPort, dstPort, prot, state, flowid

func (*TrafficControllerMock) AddFwFilter

func (_m *TrafficControllerMock) AddFwFilter(ifaces []string, parent string, handle string, flowid string) error

AddFwFilter provides a mock function with given fields: ifaces, parent, handle, flowid

func (*TrafficControllerMock) AddNetem

func (_m *TrafficControllerMock) AddNetem(ifaces []string, parent string, handle string, delay time.Duration, delayJitter time.Duration, drop int, corrupt int, duplicate int) error

AddNetem provides a mock function with given fields: ifaces, parent, handle, delay, delayJitter, drop, corrupt, duplicate

func (*TrafficControllerMock) AddOutputLimit

func (_m *TrafficControllerMock) AddOutputLimit(ifaces []string, parent string, handle string, bytesPerSec uint) error

AddOutputLimit provides a mock function with given fields: ifaces, parent, handle, bytesPerSec

func (*TrafficControllerMock) AddPrio

func (_m *TrafficControllerMock) AddPrio(ifaces []string, parent string, handle string, bands uint32, priomap [16]uint32) error

AddPrio provides a mock function with given fields: ifaces, parent, handle, bands, priomap

func (*TrafficControllerMock) ClearQdisc

func (_m *TrafficControllerMock) ClearQdisc(ifaces []string) error

ClearQdisc provides a mock function with given fields: ifaces

func (*TrafficControllerMock) ConfigBPFFilter

func (_m *TrafficControllerMock) ConfigBPFFilter(cmd executor, args ...string) error

ConfigBPFFilter provides a mock function with given fields: cmd, args

func (*TrafficControllerMock) DeleteFilter

func (_m *TrafficControllerMock) DeleteFilter(iface string, priority uint32) error

DeleteFilter provides a mock function with given fields: iface, priority

func (*TrafficControllerMock) EXPECT

type TrafficControllerMock_AddBPFFilter_Call

type TrafficControllerMock_AddBPFFilter_Call struct {
	*mock.Call
}

TrafficControllerMock_AddBPFFilter_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddBPFFilter'

func (*TrafficControllerMock_AddBPFFilter_Call) Return

func (*TrafficControllerMock_AddBPFFilter_Call) Run

func (_c *TrafficControllerMock_AddBPFFilter_Call) Run(run func(ifaces []string, parent string, obj string, flowid string, section string)) *TrafficControllerMock_AddBPFFilter_Call

func (*TrafficControllerMock_AddBPFFilter_Call) RunAndReturn

type TrafficControllerMock_AddFilter_Call

type TrafficControllerMock_AddFilter_Call struct {
	*mock.Call
}

TrafficControllerMock_AddFilter_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddFilter'

func (*TrafficControllerMock_AddFilter_Call) Return

func (*TrafficControllerMock_AddFilter_Call) Run

func (_c *TrafficControllerMock_AddFilter_Call) Run(run func(ifaces []string, parent string, handle string, srcIP *net.IPNet, dstIP *net.IPNet, srcPort int, dstPort int, prot protocol, state connState, flowid string)) *TrafficControllerMock_AddFilter_Call

func (*TrafficControllerMock_AddFilter_Call) RunAndReturn

func (_c *TrafficControllerMock_AddFilter_Call) RunAndReturn(run func([]string, string, string, *net.IPNet, *net.IPNet, int, int, protocol, connState, string) (uint32, error)) *TrafficControllerMock_AddFilter_Call

type TrafficControllerMock_AddFwFilter_Call

type TrafficControllerMock_AddFwFilter_Call struct {
	*mock.Call
}

TrafficControllerMock_AddFwFilter_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddFwFilter'

func (*TrafficControllerMock_AddFwFilter_Call) Return

func (*TrafficControllerMock_AddFwFilter_Call) Run

func (_c *TrafficControllerMock_AddFwFilter_Call) Run(run func(ifaces []string, parent string, handle string, flowid string)) *TrafficControllerMock_AddFwFilter_Call

func (*TrafficControllerMock_AddFwFilter_Call) RunAndReturn

type TrafficControllerMock_AddNetem_Call

type TrafficControllerMock_AddNetem_Call struct {
	*mock.Call
}

TrafficControllerMock_AddNetem_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddNetem'

func (*TrafficControllerMock_AddNetem_Call) Return

func (*TrafficControllerMock_AddNetem_Call) Run

func (_c *TrafficControllerMock_AddNetem_Call) Run(run func(ifaces []string, parent string, handle string, delay time.Duration, delayJitter time.Duration, drop int, corrupt int, duplicate int)) *TrafficControllerMock_AddNetem_Call

func (*TrafficControllerMock_AddNetem_Call) RunAndReturn

type TrafficControllerMock_AddOutputLimit_Call

type TrafficControllerMock_AddOutputLimit_Call struct {
	*mock.Call
}

TrafficControllerMock_AddOutputLimit_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddOutputLimit'

func (*TrafficControllerMock_AddOutputLimit_Call) Return

func (*TrafficControllerMock_AddOutputLimit_Call) Run

func (_c *TrafficControllerMock_AddOutputLimit_Call) Run(run func(ifaces []string, parent string, handle string, bytesPerSec uint)) *TrafficControllerMock_AddOutputLimit_Call

func (*TrafficControllerMock_AddOutputLimit_Call) RunAndReturn

type TrafficControllerMock_AddPrio_Call

type TrafficControllerMock_AddPrio_Call struct {
	*mock.Call
}

TrafficControllerMock_AddPrio_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddPrio'

func (*TrafficControllerMock_AddPrio_Call) Return

func (*TrafficControllerMock_AddPrio_Call) Run

func (_c *TrafficControllerMock_AddPrio_Call) Run(run func(ifaces []string, parent string, handle string, bands uint32, priomap [16]uint32)) *TrafficControllerMock_AddPrio_Call

func (*TrafficControllerMock_AddPrio_Call) RunAndReturn

type TrafficControllerMock_ClearQdisc_Call

type TrafficControllerMock_ClearQdisc_Call struct {
	*mock.Call
}

TrafficControllerMock_ClearQdisc_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ClearQdisc'

func (*TrafficControllerMock_ClearQdisc_Call) Return

func (*TrafficControllerMock_ClearQdisc_Call) Run

func (*TrafficControllerMock_ClearQdisc_Call) RunAndReturn

type TrafficControllerMock_ConfigBPFFilter_Call

type TrafficControllerMock_ConfigBPFFilter_Call struct {
	*mock.Call
}

TrafficControllerMock_ConfigBPFFilter_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ConfigBPFFilter'

func (*TrafficControllerMock_ConfigBPFFilter_Call) Return

func (*TrafficControllerMock_ConfigBPFFilter_Call) Run

func (*TrafficControllerMock_ConfigBPFFilter_Call) RunAndReturn

type TrafficControllerMock_DeleteFilter_Call

type TrafficControllerMock_DeleteFilter_Call struct {
	*mock.Call
}

TrafficControllerMock_DeleteFilter_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteFilter'

func (*TrafficControllerMock_DeleteFilter_Call) Return

func (*TrafficControllerMock_DeleteFilter_Call) Run

func (*TrafficControllerMock_DeleteFilter_Call) RunAndReturn

type TrafficControllerMock_Expecter

type TrafficControllerMock_Expecter struct {
	// contains filtered or unexported fields
}

func (*TrafficControllerMock_Expecter) AddBPFFilter

func (_e *TrafficControllerMock_Expecter) AddBPFFilter(ifaces interface{}, parent interface{}, obj interface{}, flowid interface{}, section interface{}) *TrafficControllerMock_AddBPFFilter_Call

AddBPFFilter is a helper method to define mock.On call

  • ifaces []string
  • parent string
  • obj string
  • flowid string
  • section string

func (*TrafficControllerMock_Expecter) AddFilter

func (_e *TrafficControllerMock_Expecter) AddFilter(ifaces interface{}, parent interface{}, handle interface{}, srcIP interface{}, dstIP interface{}, srcPort interface{}, dstPort interface{}, prot interface{}, state interface{}, flowid interface{}) *TrafficControllerMock_AddFilter_Call

AddFilter is a helper method to define mock.On call

  • ifaces []string
  • parent string
  • handle string
  • srcIP *net.IPNet
  • dstIP *net.IPNet
  • srcPort int
  • dstPort int
  • prot protocol
  • state connState
  • flowid string

func (*TrafficControllerMock_Expecter) AddFwFilter

func (_e *TrafficControllerMock_Expecter) AddFwFilter(ifaces interface{}, parent interface{}, handle interface{}, flowid interface{}) *TrafficControllerMock_AddFwFilter_Call

AddFwFilter is a helper method to define mock.On call

  • ifaces []string
  • parent string
  • handle string
  • flowid string

func (*TrafficControllerMock_Expecter) AddNetem

func (_e *TrafficControllerMock_Expecter) AddNetem(ifaces interface{}, parent interface{}, handle interface{}, delay interface{}, delayJitter interface{}, drop interface{}, corrupt interface{}, duplicate interface{}) *TrafficControllerMock_AddNetem_Call

AddNetem is a helper method to define mock.On call

  • ifaces []string
  • parent string
  • handle string
  • delay time.Duration
  • delayJitter time.Duration
  • drop int
  • corrupt int
  • duplicate int

func (*TrafficControllerMock_Expecter) AddOutputLimit

func (_e *TrafficControllerMock_Expecter) AddOutputLimit(ifaces interface{}, parent interface{}, handle interface{}, bytesPerSec interface{}) *TrafficControllerMock_AddOutputLimit_Call

AddOutputLimit is a helper method to define mock.On call

  • ifaces []string
  • parent string
  • handle string
  • bytesPerSec uint

func (*TrafficControllerMock_Expecter) AddPrio

func (_e *TrafficControllerMock_Expecter) AddPrio(ifaces interface{}, parent interface{}, handle interface{}, bands interface{}, priomap interface{}) *TrafficControllerMock_AddPrio_Call

AddPrio is a helper method to define mock.On call

  • ifaces []string
  • parent string
  • handle string
  • bands uint32
  • priomap [16]uint32

func (*TrafficControllerMock_Expecter) ClearQdisc

func (_e *TrafficControllerMock_Expecter) ClearQdisc(ifaces interface{}) *TrafficControllerMock_ClearQdisc_Call

ClearQdisc is a helper method to define mock.On call

  • ifaces []string

func (*TrafficControllerMock_Expecter) ConfigBPFFilter

func (_e *TrafficControllerMock_Expecter) ConfigBPFFilter(cmd interface{}, args ...interface{}) *TrafficControllerMock_ConfigBPFFilter_Call

ConfigBPFFilter is a helper method to define mock.On call

  • cmd executor
  • args ...string

func (*TrafficControllerMock_Expecter) DeleteFilter

func (_e *TrafficControllerMock_Expecter) DeleteFilter(iface interface{}, priority interface{}) *TrafficControllerMock_DeleteFilter_Call

DeleteFilter is a helper method to define mock.On call

  • iface string
  • priority uint32

Jump to

Keyboard shortcuts

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