linux_l3

package
v3.3.0-beta Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2022 License: Apache-2.0 Imports: 7 Imported by: 9

Documentation

Index

Constants

View Source
const (

	// StaticLinkLocalRouteKeyPrefix is a prefix for keys derived from link-local routes.
	LinkLocalRouteKeyPrefix = "linux/link-local-route/"
)
View Source
const ModuleName = "linux.l3"

ModuleName is the module name used for models.

Variables

View Source
var (
	ModelARPEntry = models.Register(&ARPEntry{}, models.Spec{
		Module:  ModuleName,
		Version: "v2",
		Type:    "arp",
	}, models.WithNameTemplate("{{.Interface}}/{{.IpAddress}}"))

	ModelRoute = models.Register(&Route{}, models.Spec{
		Module:  ModuleName,
		Version: "v2",
		Type:    "route",
	}, models.WithNameTemplate(
		`{{with ipnet .DstNetwork}}{{printf "%s/%d" .IP .MaskSize}}`+
			`{{else}}{{.DstNetwork}}{{end}}/{{.OutgoingInterface}}`,
	))
)
View Source
var (
	Route_Scope_name = map[int32]string{
		0: "UNDEFINED",
		1: "GLOBAL",
		2: "SITE",
		3: "LINK",
		4: "HOST",
	}
	Route_Scope_value = map[string]int32{
		"UNDEFINED": 0,
		"GLOBAL":    1,
		"SITE":      2,
		"LINK":      3,
		"HOST":      4,
	}
)

Enum value maps for Route_Scope.

View Source
var File_ligato_linux_l3_arp_proto protoreflect.FileDescriptor
View Source
var File_ligato_linux_l3_route_proto protoreflect.FileDescriptor

Functions

func ArpKey

func ArpKey(iface, ipAddr string) string

ArpKey returns the key used in ETCD to store configuration of a particular Linux ARP entry.

func ParseStaticLinkLocalRouteKey

func ParseStaticLinkLocalRouteKey(key string) (dstAddr string, outgoingInterface string, isRouteKey bool)

ParseStaticLinkLocalRouteKey parses route attributes from a key derived from link-local route.

func RouteKey

func RouteKey(dstNetwork, outgoingInterface string) string

RouteKey returns the key used in ETCD to store configuration of a particular Linux route.

func StaticLinkLocalRouteKey

func StaticLinkLocalRouteKey(dstAddr, outgoingInterface string) string

StaticLinkLocalRouteKey returns a derived key used to represent link-local route.

func StaticLinkLocalRoutePrefix

func StaticLinkLocalRoutePrefix(outgoingInterface string) string

StaticLinkLocalRoutePrefix returns longest-common prefix of keys representing link-local routes that have the given outgoing Linux interface.

Types

type ARPEntry

type ARPEntry struct {
	Interface string `protobuf:"bytes,1,opt,name=interface,proto3" json:"interface,omitempty"`
	IpAddress string `protobuf:"bytes,2,opt,name=ip_address,json=ipAddress,proto3" json:"ip_address,omitempty"`
	HwAddress string `protobuf:"bytes,3,opt,name=hw_address,json=hwAddress,proto3" json:"hw_address,omitempty"`
	// contains filtered or unexported fields
}

func (*ARPEntry) Descriptor deprecated

func (*ARPEntry) Descriptor() ([]byte, []int)

Deprecated: Use ARPEntry.ProtoReflect.Descriptor instead.

func (*ARPEntry) GetHwAddress

func (x *ARPEntry) GetHwAddress() string

func (*ARPEntry) GetInterface

func (x *ARPEntry) GetInterface() string

func (*ARPEntry) GetIpAddress

func (x *ARPEntry) GetIpAddress() string

func (*ARPEntry) ProtoMessage

func (*ARPEntry) ProtoMessage()

func (*ARPEntry) ProtoReflect added in v3.2.0

func (x *ARPEntry) ProtoReflect() protoreflect.Message

func (*ARPEntry) Reset

func (x *ARPEntry) Reset()

func (*ARPEntry) String

func (x *ARPEntry) String() string

type Route

type Route struct {

	// Outgoing interface logical name (mandatory).
	OutgoingInterface string `protobuf:"bytes,1,opt,name=outgoing_interface,json=outgoingInterface,proto3" json:"outgoing_interface,omitempty"`
	// The scope of the area where the link is valid.
	Scope Route_Scope `protobuf:"varint,2,opt,name=scope,proto3,enum=ligato.linux.l3.Route_Scope" json:"scope,omitempty"`
	// Destination network address in the format <address>/<prefix> (mandatory)
	// Address can be also allocated via netalloc plugin and referenced here,
	// see: api/models/netalloc/netalloc.proto
	DstNetwork string `protobuf:"bytes,3,opt,name=dst_network,json=dstNetwork,proto3" json:"dst_network,omitempty"`
	// Gateway IP address (without mask, optional).
	// Address can be also allocated via netalloc plugin and referenced here,
	// see: api/models/netalloc/netalloc.proto
	GwAddr string `protobuf:"bytes,4,opt,name=gw_addr,json=gwAddr,proto3" json:"gw_addr,omitempty"`
	// routing metric (weight)
	Metric uint32 `protobuf:"varint,5,opt,name=metric,proto3" json:"metric,omitempty"`
	// contains filtered or unexported fields
}

func (*Route) Descriptor deprecated

func (*Route) Descriptor() ([]byte, []int)

Deprecated: Use Route.ProtoReflect.Descriptor instead.

func (*Route) GetDstNetwork

func (x *Route) GetDstNetwork() string

func (*Route) GetGwAddr

func (x *Route) GetGwAddr() string

func (*Route) GetMetric

func (x *Route) GetMetric() uint32

func (*Route) GetOutgoingInterface

func (x *Route) GetOutgoingInterface() string

func (*Route) GetScope

func (x *Route) GetScope() Route_Scope

func (*Route) ProtoMessage

func (*Route) ProtoMessage()

func (*Route) ProtoReflect added in v3.2.0

func (x *Route) ProtoReflect() protoreflect.Message

func (*Route) Reset

func (x *Route) Reset()

func (*Route) String

func (x *Route) String() string

type Route_Scope

type Route_Scope int32
const (
	Route_UNDEFINED Route_Scope = 0
	Route_GLOBAL    Route_Scope = 1
	Route_SITE      Route_Scope = 2
	Route_LINK      Route_Scope = 3
	Route_HOST      Route_Scope = 4
)

func (Route_Scope) Descriptor added in v3.2.0

func (Route_Scope) Enum added in v3.2.0

func (x Route_Scope) Enum() *Route_Scope

func (Route_Scope) EnumDescriptor deprecated

func (Route_Scope) EnumDescriptor() ([]byte, []int)

Deprecated: Use Route_Scope.Descriptor instead.

func (Route_Scope) Number added in v3.2.0

func (x Route_Scope) Number() protoreflect.EnumNumber

func (Route_Scope) String

func (x Route_Scope) String() string

func (Route_Scope) Type added in v3.2.0

Jump to

Keyboard shortcuts

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