vpp

package
v0.0.0-...-d15df5a Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2024 License: Apache-2.0 Imports: 34 Imported by: 0

Documentation

Index

Constants

View Source
const (
	VPP_MAX_CONNECT_ATTEMPTS = 10
	VPP_RECONNECT_INTERVAL   = time.Second
	// the startup can get quite slow if too many tests are
	// run in parallel without enough CPU cores available
	VPP_STARTUP_TIMEOUT           = 30 * time.Second
	VPP_STARTUP_TIMEOUT_GDBSERVER = 600 * time.Second
	VPP_REPLY_TIMEOUT             = 5 * time.Second
	NSENTER_CMD                   = "nsenter"
	DISPATCH_TRACE_FILENAME       = "dispatch-trace.pcap"
)

Variables

View Source
var Cores []int = []int{0, 1}

Cores list the logical CPU cores that can be used for VPP. It is set in SynchronizedBeforeSuite()

Functions

This section is empty.

Types

type IPFIXExporterConfig

type IPFIXExporterConfig struct {
	GetCollectorIP func() net.IP
	GetSrcIP       func() net.IP
	Port           int
	VRF            int
}

type MemoryTrace

type MemoryTrace []MemoryTraceEntry

func ParseMemoryTrace

func ParseMemoryTrace(src string) (MemoryTrace, error)

func (MemoryTrace) FindSuspectedLeak

func (mt MemoryTrace) FindSuspectedLeak(locationSubsring string, minCount uint64) bool

type MemoryTraceEntry

type MemoryTraceEntry struct {
	Bytes    uint64
	Count    uint64
	Sample   uint64
	Location string
}

type NWIConfig

type NWIConfig struct {
	Name                   string
	Table                  int
	IPFIXPolicy            string
	IPFIXReportingInterval int
	ObservationDomainId    int
	ObservationDomainName  string
	ObservationPointId     int
	GetIPFIXCollectorIP    func() net.IP
}

type RouteConfig

type RouteConfig struct {
	Dst *net.IPNet
	Gw  net.IP
}

type VPPConfig

type VPPConfig struct {
	BaseDir        string
	Namespaces     []VPPNetworkNamespace
	IPFIXExporters []IPFIXExporterConfig
	NWIs           []NWIConfig
	SetupCommands  []string
}

func (VPPConfig) GetNamespaceAddress

func (cfg VPPConfig) GetNamespaceAddress(namespace string) *net.IPNet

func (VPPConfig) GetNamespaceLinkName

func (cfg VPPConfig) GetNamespaceLinkName(namespace string) string

func (VPPConfig) GetVPPAddress

func (cfg VPPConfig) GetVPPAddress(namespace string) *net.IPNet

type VPPInstance

type VPPInstance struct {
	ApiChannel api.Channel

	Captures map[string]*network.Capture
	// contains filtered or unexported fields
}

func NewVPPInstance

func NewVPPInstance(cfg VPPConfig) *VPPInstance

func (*VPPInstance) Configure

func (vi *VPPInstance) Configure() error

func (*VPPInstance) Context

func (vi *VPPInstance) Context(parent context.Context) context.Context

func (*VPPInstance) Ctl

func (vi *VPPInstance) Ctl(format string, args ...interface{}) (string, error)

func (*VPPInstance) DumpStats

func (vi *VPPInstance) DumpStats(stat string) (string, error)

func (*VPPInstance) GetNS

func (vi *VPPInstance) GetNS(name string) *network.NetNS

func (*VPPInstance) InterruptVPP

func (vi *VPPInstance) InterruptVPP()

func (*VPPInstance) SetupNamespaces

func (vi *VPPInstance) SetupNamespaces() error

func (*VPPInstance) SetupRoutes

func (vi *VPPInstance) SetupRoutes() error

func (*VPPInstance) StartCapture

func (vi *VPPInstance) StartCapture() error

func (*VPPInstance) StartVPP

func (vi *VPPInstance) StartVPP() error

func (*VPPInstance) TearDown

func (vi *VPPInstance) TearDown()

func (*VPPInstance) VerifyVPPAlive

func (vi *VPPInstance) VerifyVPPAlive() error

type VPPNetworkNamespace

type VPPNetworkNamespace struct {
	Name          string
	VPPMac        net.HardwareAddr
	VPPIP         *net.IPNet
	OtherIP       *net.IPNet
	VPPLinkName   string
	Table         int
	NSRoutes      []RouteConfig
	SkipVPPConfig bool
	L3Capture     bool
	MTU           int
	Placement     int
}

type VPPStartupConfig

type VPPStartupConfig struct {
	BinaryPath    string
	PluginPath    string
	CLISock       string
	APISock       string
	StatsSock     string
	VPPLog        string
	APIPrefix     string
	MainCore      int
	WorkerCore    int
	UseGDB        bool
	UseGDBServer  bool
	GDBServerPort int
	Trace         bool
	DispatchTrace bool
	Multicore     bool
	InterruptMode bool
}

func (VPPStartupConfig) DefaultMTU

func (cfg VPPStartupConfig) DefaultMTU() int

func (VPPStartupConfig) Get

func (cfg VPPStartupConfig) Get() string

func (*VPPStartupConfig) SetDefaults

func (cfg *VPPStartupConfig) SetDefaults()

func (*VPPStartupConfig) SetFromEnv

func (cfg *VPPStartupConfig) SetFromEnv()

Jump to

Keyboard shortcuts

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