linux_l3

package
v2.5.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2019 License: Apache-2.0 Imports: 6 Imported by: 108

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",
}
View Source
var Route_Scope_value = map[string]int32{
	"UNDEFINED": 0,
	"GLOBAL":    1,
	"SITE":      2,
	"LINK":      3,
	"HOST":      4,
}

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"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*ARPEntry) Descriptor

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

func (*ARPEntry) GetHwAddress

func (m *ARPEntry) GetHwAddress() string

func (*ARPEntry) GetInterface

func (m *ARPEntry) GetInterface() string

func (*ARPEntry) GetIpAddress

func (m *ARPEntry) GetIpAddress() string

func (*ARPEntry) ProtoMessage

func (*ARPEntry) ProtoMessage()

func (*ARPEntry) Reset

func (m *ARPEntry) Reset()

func (*ARPEntry) String

func (m *ARPEntry) String() string

func (*ARPEntry) XXX_DiscardUnknown

func (m *ARPEntry) XXX_DiscardUnknown()

func (*ARPEntry) XXX_Marshal

func (m *ARPEntry) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ARPEntry) XXX_Merge

func (m *ARPEntry) XXX_Merge(src proto.Message)

func (*ARPEntry) XXX_MessageName

func (*ARPEntry) XXX_MessageName() string

func (*ARPEntry) XXX_Size

func (m *ARPEntry) XXX_Size() int

func (*ARPEntry) XXX_Unmarshal

func (m *ARPEntry) XXX_Unmarshal(b []byte) error

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=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"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*Route) Descriptor

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

func (*Route) GetDstNetwork

func (m *Route) GetDstNetwork() string

func (*Route) GetGwAddr

func (m *Route) GetGwAddr() string

func (*Route) GetMetric

func (m *Route) GetMetric() uint32

func (*Route) GetOutgoingInterface

func (m *Route) GetOutgoingInterface() string

func (*Route) GetScope

func (m *Route) GetScope() Route_Scope

func (*Route) ProtoMessage

func (*Route) ProtoMessage()

func (*Route) Reset

func (m *Route) Reset()

func (*Route) String

func (m *Route) String() string

func (*Route) XXX_DiscardUnknown

func (m *Route) XXX_DiscardUnknown()

func (*Route) XXX_Marshal

func (m *Route) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Route) XXX_Merge

func (m *Route) XXX_Merge(src proto.Message)

func (*Route) XXX_MessageName

func (*Route) XXX_MessageName() string

func (*Route) XXX_Size

func (m *Route) XXX_Size() int

func (*Route) XXX_Unmarshal

func (m *Route) XXX_Unmarshal(b []byte) error

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) EnumDescriptor

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

func (Route_Scope) String

func (x Route_Scope) String() string

Jump to

Keyboard shortcuts

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