dplaneopts

package
v0.4.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(*Options)

Option exposes additional configuration for the dataplane.

func WithAddrPort

func WithAddrPort(addrPort string) Option

WithAddrPort sets the address of the dataplane gRPC server Default: 127.0.0.1:0

func WithEthDevAsLane

func WithEthDevAsLane(enable bool) Option

WithEthDevAsLane enables treating ethX and hardware lane X. If a port is created with multiple lanes only the first is used. Default: false

func WithHostifNetDevPortType

func WithHostifNetDevPortType(t fwdpb.PortType) Option

WithHostifNetDevPortType sets the lucius port type for saipb hostif NETDEV. Default: fwdpb.PortType_PORT_TYPE_TAP

func WithPortConfigFile

func WithPortConfigFile(file string) Option

WithPortConfigFile sets the path of the port config file. Default: none

func WithPortMap

func WithPortMap(m map[string]string) Option

WithPortMap configure a map from port name to Linux network device to allow flexible port naming. (eg Ethernet8 -> eth1) Default: none

func WithPortType

func WithPortType(t fwdpb.PortType) Option

WithPortType sets the lucius port type for saipb ports. Default: fwdpb.PortType_PORT_TYPE_KERNEL

func WithReconcilation

func WithReconcilation(rec bool) Option

WithReconcilation enables the gNMI reconcilation. Default: true

func WithRemoteCPUPort

func WithRemoteCPUPort(enable bool) Option

WithEthDevAsLane enables sending all packets from/to the CP port over gRPC

type Options

type Options struct {
	// AddrPort is the address of the gRPC server.
	AddrPort string
	// Reconcilation enabes gNMI reconcilation.
	Reconcilation bool
	// HostifNetDevType is the fwdpb type for the saipb hostif netdev types.
	HostifNetDevType fwdpb.PortType
	// PortType is the fwdpb type for the port type.
	PortType fwdpb.PortType
	// PortConfigFile is the path of the port config.
	PortConfigFile string
	// PortMap maps the modeled port name (Ethernet1/1/1) to Linux port name (eth1).
	PortMap map[string]string
	// EthDevAsLane treats ethX and hardware lane X.
	// If a port is created with multiple lanes only the first is used.
	EthDevAsLane bool
	// RemoteCPUPort enables sending all packets for the CPU over gRPC.
	// TODO: In the future, only support this option.
	RemoteCPUPort bool
}

Options configures the dataplane

func ResolveOpts

func ResolveOpts(opts ...Option) *Options

ResolveOpts creates an option struct from the opts.

type Port

type Port struct {
	Lanes string `json:"lanes"`
}

Port contains configuration data for a single port.

type PortConfig

type PortConfig struct {
	Ports map[string]*Port `json:"PORT"`
	// SendToIngressPort is an optional field that may contain exactly on entry, the name of hostif whose linked port is the CPU port.
	SendToIngressPort map[string]any `json:"SEND_TO_INGRESS_PORT"`
}

PortConfig contains configuration data for the dataplane ports.

Jump to

Keyboard shortcuts

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