mockcalls

package
v2.2.0-beta+incompatible Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2019 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var SimulateFailedTapCreation bool

SimulateFailedTapCreation allows to simulate failure of the next Create operation for a TAP interface.

Functions

This section is empty.

Types

type MockIfaceAPI

type MockIfaceAPI interface {
	MockIfaceWrite
	MockIfaceRead
}

MockIfaceAPI provides methods for creating and managing interfaces in the mock SB

func NewMockIfaceHandler

func NewMockIfaceHandler(log logging.Logger) MockIfaceAPI

NewMockIfHandler creates new instance of interface handler for mock SB.

type MockIfaceHandler

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

MockIfaceHandler is accessor for calls into mock SB.

func (*MockIfaceHandler) CreateLoopbackInterface

func (h *MockIfaceHandler) CreateLoopbackInterface(ifaceName string) (sbIfaceHandle uint32, err error)

CreateLoopbackInterface creates loopback in the mock SB.

func (*MockIfaceHandler) CreateTapInterface

func (h *MockIfaceHandler) CreateTapInterface(ifaceName string) (sbIfaceHandle uint32, err error)

CreateTapInterface creates TAP interface in the mock SB.

func (*MockIfaceHandler) DeleteLoopbackInterface

func (h *MockIfaceHandler) DeleteLoopbackInterface(sbIfaceHandle uint32) error

DeleteLoopbackInterface deletes loopback in the mock SB.

func (*MockIfaceHandler) DeleteTapInterface

func (h *MockIfaceHandler) DeleteTapInterface(sbIfaceHandle uint32) error

CreateTapInterface deletes TAP interface in the mock SB.

func (*MockIfaceHandler) DumpInterfaces

func (h *MockIfaceHandler) DumpInterfaces() (mockIfaces, error)

DumpInterfaces returns interfaces "configured" in the mock SB.

func (*MockIfaceHandler) InterfaceAdminDown

func (h *MockIfaceHandler) InterfaceAdminDown(sbIfaceHandle uint32) error

InterfaceAdminDown puts the given interface DOWN.

func (*MockIfaceHandler) InterfaceAdminUp

func (h *MockIfaceHandler) InterfaceAdminUp(sbIfaceHandle uint32) error

InterfaceAdminUp puts the given interface UP.

func (*MockIfaceHandler) SetInterfaceMac

func (h *MockIfaceHandler) SetInterfaceMac(sbIfaceHandle uint32, macAddress string) error

SetInterfaceMac changes MAC address of the given interface.

type MockIfaceRead

type MockIfaceRead interface {
	// DumpInterfaces returns interfaces configured in the mock SB.
	DumpInterfaces() (mockIfaces, error)
}

MockIfaceRead provides read methods for interface plugin

type MockIfaceWrite

type MockIfaceWrite interface {
	// CreateLoopbackInterface creates loopback in the mock SB.
	CreateLoopbackInterface(ifaceName string) (sbIfaceHandle uint32, err error)
	// DeleteLoopbackInterface deletes loopback in the mock SB.
	DeleteLoopbackInterface(sbIfaceHandle uint32) error

	// CreateTapInterface creates TAP interface in the mock SB.
	CreateTapInterface(ifaceName string) (sbIfaceHandle uint32, err error)
	// CreateTapInterface deletes TAP interface in the mock SB.
	DeleteTapInterface(sbIfaceHandle uint32) error

	// InterfaceAdminDown puts the given mock interface DOWN.
	InterfaceAdminDown(sbIfaceHandle uint32) error
	// InterfaceAdminUp puts the given interface UP.
	InterfaceAdminUp(sbIfaceHandle uint32) error

	// SetInterfaceMac changes MAC address of the given interface.
	SetInterfaceMac(sbIfaceHandle uint32, macAddress string) error
}

MockIfaceWrite provides write methods for interface plugin

Jump to

Keyboard shortcuts

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