Documentation
¶
Index ¶
- type Option
- func WithAddrPort(addrPort string) Option
- func WithEthDevAsLane(enable bool) Option
- func WithHostifNetDevPortType(t fwdpb.PortType) Option
- func WithPortConfigFile(file string) Option
- func WithPortMap(m map[string]string) Option
- func WithPortType(t fwdpb.PortType) Option
- func WithReconcilation(rec bool) Option
- func WithRemoteCPUPort(enable bool) Option
- type Options
- type Port
- type PortConfig
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 ¶
WithAddrPort sets the address of the dataplane gRPC server Default: 127.0.0.1:0
func WithEthDevAsLane ¶
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 ¶
WithHostifNetDevPortType sets the lucius port type for saipb hostif NETDEV. Default: fwdpb.PortType_PORT_TYPE_TAP
func WithPortConfigFile ¶
WithPortConfigFile sets the path of the port config file. Default: none
func WithPortMap ¶
WithPortMap configure a map from port name to Linux network device to allow flexible port naming. (eg Ethernet8 -> eth1) Default: none
func WithPortType ¶
WithPortType sets the lucius port type for saipb ports. Default: fwdpb.PortType_PORT_TYPE_KERNEL
func WithReconcilation ¶
WithReconcilation enables the gNMI reconcilation. Default: true
func WithRemoteCPUPort ¶
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 ¶
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.