controller

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2025 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ISISAreaID          = "49"
	ISISAreaNumber      = "0000"
	ISISSystemIDPadding = "0000"
	ISISNSelector       = "00"
)

Variables

View Source
var (
	BuildInfo = prometheus.NewGaugeVec(prometheus.GaugeOpts{
		Name: "controller_build_info",
		Help: "Build information of the agent",
	},
		[]string{"version", "commit", "date"},
	)
)
View Source
var (
	ErrServiceabilityRequired = errors.New("serviceability program client is required")
)

Functions

This section is empty.

Types

type BgpPeer added in v0.5.3

type BgpPeer struct {
	PeerIP   net.IP
	PeerName string
}

type Controller

type Controller struct {
	pb.UnimplementedControllerServer
	// contains filtered or unexported fields
}

func NewController

func NewController(options ...Option) (*Controller, error)

func (*Controller) GetConfig

func (c *Controller) GetConfig(ctx context.Context, req *pb.ConfigRequest) (*pb.ConfigResponse, error)

GetConfig renders the latest device configuration based on cached device data

func (*Controller) Run

func (c *Controller) Run(ctx context.Context) error

Run starts a goroutine for updating the local state cache with on-chain data and another for a gRPC server to service devices.

type Device

type Device struct {
	PubKey                string
	PublicIP              net.IP
	Vpn4vLoopbackIP       net.IP
	Ipv4LoopbackIP        net.IP
	Tunnels               []*Tunnel
	TunnelSlots           int
	Vpn4vLoopbackIntfName string
	Ipv4LoopbackIntfName  string
	Interfaces            []Interface
	MgmtVrf               string
	IsisNet               string
}

func NewDevice

func NewDevice(ip net.IP, publicKey string) *Device

type Interface added in v0.5.3

type Interface struct {
	Name                 string
	VlanId               uint16
	Ip                   netip.Prefix
	NodeSegmentIdx       uint16
	IsSubInterface       bool
	IsSubInterfaceParent bool
	InterfaceType        InterfaceType
	LoopbackType         LoopbackType
	Metric               uint32
	IsLink               bool
}

func NewInterface added in v0.5.3

func NewInterface(
	name string,
	vlanId uint16,
	ip netip.Prefix,
	nodeSegmentIdx uint16,
	isSubInterface bool,
	isSubInterfaceParent bool,
	interfaceType InterfaceType,
	loopbackType LoopbackType,
) Interface

func (Interface) GetParent added in v0.5.3

func (i Interface) GetParent() (Interface, error)

func (Interface) IsIpv4Loopback added in v0.5.3

func (i Interface) IsIpv4Loopback() bool

func (Interface) IsLoopback added in v0.5.3

func (i Interface) IsLoopback() bool

func (Interface) IsPhysical added in v0.5.3

func (i Interface) IsPhysical() bool

func (Interface) IsVlanInterface added in v0.5.3

func (i Interface) IsVlanInterface() bool

func (Interface) IsVpnv4Loopback added in v0.5.3

func (i Interface) IsVpnv4Loopback() bool

type InterfaceType added in v0.5.3

type InterfaceType uint8
const (
	InterfaceTypeUnknown InterfaceType = iota
	InterfaceTypeLoopback
	InterfaceTypePhysical
)

type LoopbackType added in v0.5.3

type LoopbackType uint8
const (
	LoopbackTypeUnknown LoopbackType = iota
	LoopbackTypeVpnv4
	LoopbackTypeIpv4
	LoopbackTypePimRpAddr
	LoopbackTypeReserved
)

type Option

type Option func(*Controller)

func WithEnableInterfacesAndPeers added in v0.5.3

func WithEnableInterfacesAndPeers() Option

WithEnableInterfacesAndPeers provides a way to enable processing of device interfaces and BGP peers.

func WithListener

func WithListener(listener net.Listener) Option

WithListener provides a way to assign a custom listener for the gRPC server. If no listener is passed, the controller will listen on localhost.

func WithNoHardware

func WithNoHardware() Option

WithNoHardware provides a way to exclude rendering config commands that will fail when not running on the real hardware.

func WithServiceabilityProgramClient added in v0.5.3

func WithServiceabilityProgramClient(s ServiceabilityProgramClient) Option

func WithSignalChan

func WithSignalChan(ch chan struct{}) Option

WithSignalChan provides a way to be signaled when the local state cache has been updated. This is used for testing.

func WithTLSConfig added in v0.6.1

func WithTLSConfig(tlsConfig *tls.Config) Option

WithTLSConfig provides a way to assign a custom tls config for the gRPC server.

type ServiceabilityProgramClient added in v0.5.3

type ServiceabilityProgramClient interface {
	GetProgramData(context.Context) (*serviceability.ProgramData, error)
	ProgramID() solana.PublicKey
}

type Tunnel

type Tunnel struct {
	Id                    int
	UnderlaySrcIP         net.IP
	UnderlayDstIP         net.IP
	OverlaySrcIP          net.IP // This needs to be derived based on the tunnel net
	OverlayDstIP          net.IP // This needs to be derived based on the tunnel net
	DzIp                  net.IP
	PubKey                string
	Allocated             bool
	IsMulticast           bool
	MulticastBoundaryList []net.IP
	MulticastSubscribers  []net.IP
	MulticastPublishers   []net.IP
}

Jump to

Keyboard shortcuts

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