metalbond

package module
v0.3.5 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2023 License: Apache-2.0 Imports: 17 Imported by: 2

README

IronCore Logo

MetalBond

REUSE status Go Report Card GitHub License PRs Welcome

Metalbond is a tool suite that manages routes for virtual private networking in datacenters. An instance of metalbond receives route updates from its connected peer, and distributes these updates to other subscribed peers. In this way, local route changes happening on a hypervisor can propagate across a cluster and get processed on other hypervisors.

Use and develop metalbond

Please see the documentation in the /docs folder for more details.

License

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Documentation

Index

Constants

View Source
const METALBOND_RT_PROTO netlink.RouteProtocol = 254

Variables

View Source
var METALBOND_VERSION string
View Source
var RetryIntervalMax = 5
View Source
var RetryIntervalMin = 5

Functions

This section is empty.

Types

type Client

type Client interface {
	AddRoute(vni VNI, dest Destination, nexthop NextHop) error
	RemoveRoute(vni VNI, dest Destination, nexthop NextHop) error
}

type Config

type Config struct {
	KeepaliveInterval uint32
}

type ConnectionDirection

type ConnectionDirection uint8
const (
	INCOMING ConnectionDirection = iota
	OUTGOING
)

type ConnectionState

type ConnectionState uint8
const (
	CONNECTING ConnectionState = iota
	HELLO_SENT
	HELLO_RECEIVED
	ESTABLISHED
	RETRY
	CLOSED
)

func (ConnectionState) String

func (cs ConnectionState) String() string

type Destination

type Destination struct {
	IPVersion IPVersion
	Prefix    netip.Prefix
}

func (Destination) String

func (d Destination) String() string

type DummyClient

type DummyClient struct{}

func NewDummyClient

func NewDummyClient() *DummyClient

func (DummyClient) AddRoute

func (c DummyClient) AddRoute(vni VNI, dest Destination, nexthop NextHop) error

func (DummyClient) RemoveRoute

func (c DummyClient) RemoveRoute(vni VNI, dest Destination, nexthop NextHop) error

type IPVersion

type IPVersion uint8
const (
	IPV4 IPVersion = 4
	IPV6 IPVersion = 6
)

type MESSAGE_TYPE

type MESSAGE_TYPE uint8
const (
	HELLO       MESSAGE_TYPE = 1
	KEEPALIVE   MESSAGE_TYPE = 2
	SUBSCRIBE   MESSAGE_TYPE = 3
	UNSUBSCRIBE MESSAGE_TYPE = 4
	UPDATE      MESSAGE_TYPE = 5
)

type MetalBond

type MetalBond struct {
	// contains filtered or unexported fields
}

func NewMetalBond

func NewMetalBond(config Config, client Client) *MetalBond

func (*MetalBond) AddPeer

func (m *MetalBond) AddPeer(addr, localIP string) error

func (*MetalBond) AnnounceRoute

func (m *MetalBond) AnnounceRoute(vni VNI, dest Destination, hop NextHop) error

func (*MetalBond) GetRoutesForVni

func (m *MetalBond) GetRoutesForVni(vni VNI) error

func (*MetalBond) GetSubscribedVnis

func (m *MetalBond) GetSubscribedVnis() []VNI

func (*MetalBond) IsRouteAnnounced

func (m *MetalBond) IsRouteAnnounced(vni VNI, dest Destination, hop NextHop) bool

func (*MetalBond) IsSubscribed

func (m *MetalBond) IsSubscribed(vni VNI) bool

func (*MetalBond) PeerState

func (m *MetalBond) PeerState(addr string) (ConnectionState, error)

func (*MetalBond) RemovePeer

func (m *MetalBond) RemovePeer(addr string) error

func (*MetalBond) Shutdown

func (m *MetalBond) Shutdown()

Shutdown stops the MetalBond server.

func (*MetalBond) StartHTTPServer

func (m *MetalBond) StartHTTPServer(listen string) error

func (*MetalBond) StartServer

func (m *MetalBond) StartServer(listenAddress string) error

StartServer starts the MetalBond server asynchronously. To stop the server again, call Shutdown().

func (*MetalBond) Subscribe

func (m *MetalBond) Subscribe(vni VNI) error

func (*MetalBond) Unsubscribe

func (m *MetalBond) Unsubscribe(vni VNI) error

func (*MetalBond) WithdrawRoute

func (m *MetalBond) WithdrawRoute(vni VNI, dest Destination, hop NextHop) error

type NetlinkClient

type NetlinkClient struct {
	// contains filtered or unexported fields
}

func NewNetlinkClient

func NewNetlinkClient(config NetlinkClientConfig) (*NetlinkClient, error)

func (*NetlinkClient) AddRoute

func (c *NetlinkClient) AddRoute(vni VNI, dest Destination, hop NextHop) error

func (*NetlinkClient) RemoveRoute

func (c *NetlinkClient) RemoveRoute(vni VNI, dest Destination, hop NextHop) error

type NetlinkClientConfig

type NetlinkClientConfig struct {
	VNITableMap map[VNI]int
	LinkName    string
	IPv4Only    bool
}

type NextHop

type NextHop struct {
	TargetAddress    netip.Addr
	TargetVNI        uint32
	Type             pb.NextHopType
	NATPortRangeFrom uint16
	NATPortRangeTo   uint16
}

func (NextHop) String

func (h NextHop) String() string

type UpdateAction

type UpdateAction uint8
const (
	ADD UpdateAction = iota
	REMOVE
)

type VNI

type VNI uint32

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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