Documentation
¶
Index ¶
- Constants
- func Delete(name string) error
- func SetupMycelium(netNS ns.NetNS, mycelium string, seed []byte) error
- type MyceliumInspection
- type Resource
- func (r *Resource) AttachMycelium(id string, seed []byte) (device localPkg.TapDevice, err error)
- func (r *Resource) AttachMyceliumZDB(id string, zdbNS ns.NetNS) (err error)
- func (r *Resource) AttachPrivate(id string, vmIp net.IP) (device localPkg.TapDevice, err error)
- func (r *Resource) Seed() (seed []byte, err error)
Constants ¶
const ( MyceliumSeedDir = "/tmp/network/mycelium" HostMyceliumBr = "br-hmy" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type MyceliumInspection ¶
type MyceliumInspection struct { PublicKey string `json:"publicKey"` Address net.IP `json:"address"` }
func InspectMycelium ¶
func InspectMycelium(seed []byte) (inspection MyceliumInspection, err error)
func (*MyceliumInspection) Gateway ¶
func (m *MyceliumInspection) Gateway() (gw net.IPNet, err error)
Gateway derive the gateway IP from the mycelium IP in the /64 range.
func (*MyceliumInspection) IP ¶
func (m *MyceliumInspection) IP() net.IP
IP return the address in the 400::/7 subnet allocated by mycelium
type Resource ¶
type Resource struct {
// contains filtered or unexported fields
}
func Create ¶
func Create(name string, master *netlink.Bridge, ndmzIP *net.IPNet, ndmzGwIP *net.IPNet, privateNet *net.IPNet, seed []byte) (*Resource, error)
Create creates a network resource (please check docs) name: is the name of the network resource. The Create function is idempotent which means if the same name is used the function will not recreate the resource. master: Normally the br-ndmz bridge, this is the resource "way out" to the public internet. A `public` interface is created and wired to the master bridge ndmzIP: the IP assigned to the `public` interface. ndmzGwIP: the gw Ip for the resource. Normally this is the ip assigned to the master bridge. privateNet: optional private network range seed: mycelium seed