networkroutedbridge

package
v3.0.0-rc67 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2026 License: Apache-2.0 Imports: 15 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewNetworker

func NewNetworker() network.Networker

Types

type T

type T struct {
	network.T
	// contains filtered or unexported fields
}

func New

func New() *T

func (*T) AllocatableRange

func (t *T) AllocatableRange(nodename string) (*net.IPNet, error)

AllocatableRange returns the subnet this node was assigned in the network.

A routed_bridge slices its network, one subnet per node, and routes between them, so a node draws from its own slice and two nodes never draw the same address.

func (*T) BackendDevName

func (t *T) BackendDevName() string

func (*T) CNIConfigData

func (t *T) CNIConfigData() (interface{}, error)

CNIConfigData returns a cni network configuration, like

{
   "cniVersion": "0.3.0",
   "name": "net1",
   "type": "bridge",
   "bridge": "obr_net1",
   "isGateway": true,
   "ipMasq": false,
   "ipam": {
       "type": "host-local",
       "subnet": "10.23.0.0/26",
       "routes": [
           {
               "dst": "0.0.0.0/0"
           },
           {
               "dst": "10.23.0.0/24",
               "gw": "10.23.0.1"
           }
       ]
   }
}

func (*T) NodeAddr

func (t *T) NodeAddr(nodename string) (net.IP, error)

NodeAddr returns the address of nodename in the network, the first of the subnet the node was assigned.

func (*T) Peers

func (t *T) Peers() ([]network.Peer, error)

Peers returns how this node reaches the other nodes of the network, as its setup made it: the tunnels and routes it set up.

func (*T) Setup

func (t *T) Setup() error

func (*T) Teardown

func (t *T) Teardown() error

Teardown undoes the setup of the network on this node: it deletes the routes to the subnets of the nodes, then the tunnels no route goes through anymore, as another network between the same nodes may still route through one, then the bridge, when om named it.

Jump to

Keyboard shortcuts

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