vppinit

package
v1.11.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2023 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Overview

Package vppinit contains initialization code for vpp

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitLinks(ctx context.Context, vppConn api.Connection, deviceNames map[string]string, tunnelIP net.IP) error

InitLinks creates AF_PACKET interface if needed and put the given interfaces in promisc mode

func LinkToSocket added in v1.9.0

func LinkToSocket(ctx context.Context, vppConn api.Connection, tunnelIP net.IP, family AfType) (net.IP, error)

LinkToSocket - will link vpp via af_packet or af_xdp to the interface having the tunnelIP if tunnelIP is nil, it will find the interface for the default route and use that instead. It returns the resulting tunnelIP

func Must

func Must(tunnelIP net.IP, err error) net.IP

Must - simple wrapper to panic in the event of an error

func None

func None(_ context.Context, _ api.Connection, tunnelIP net.IP) (net.IP, error)

None - will perform no VPP initialization

Types

type AfType added in v1.9.0

type AfType uint32

AfType represents socket address family

const (
	// AfPacket - AF_PACKET
	AfPacket AfType = 0
	// AfXDP - AF_XDP
	AfXDP AfType = 1
)

type Func

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

Func - vpp initialization function

func (*Func) Decode

func (f *Func) Decode(value string) error

Decode for envconfig to select correct vpp initialization function

func (*Func) Execute

func (f *Func) Execute(ctx context.Context, vppConn api.Connection, tunnelIP net.IP) (net.IP, error)

Execute vpp initialization function

Jump to

Keyboard shortcuts

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