dockernet

package
v2.5.0 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package dockernet implements a Gostwire decorator that discovers Docker-managed networks and then decorates their corresponding Linux-kernel network interfaces. Supported types of Docker networks are “bridge” and “macvlan”.

In case of “bridge” networks this decorator assigns Docker network names as alias names to the corresponding Linux-kernel bridges and also as a Gostwire-specific label.

For “MACVLAN” networks this decorator assigns the Docker network names as alias names to the “parent” network interface (or “master” in Linux parlance).

This decorator also copies any network labels it finds into the corresponding network.Interface instances in a Gostwire discovery information model.

Index

Constants

View Source
const BridgeNameOptionName = "com.docker.network.bridge.name"

BridgeNameOptionName optionally specifies the name of the Linux-kernel bridge for a Docker "bridge" network. If missing, then the default naming scheme applies, taking the first 12 hex digits of the network's ID and prepending them with "br-".

View Source
const DefaultBridgeOptionName = "com.docker.network.bridge.default_bridge"

DefaultBridgeOptionName optionally identifies a Docker network as the default network.

View Source
const GhostwireNetworkDefaultBridge = "gostwire/network/default-bridge"

GhostwireNetworkDefaultBridge defines the label key for signalling that a particular network is Docker's "default bridge". For instance, service and container DNS name resolution is disabled on the default bridge. Allowed values are "true" and "false". A non-existing key means "false".

View Source
const GostwireNetworkNameKey = "gostwire/network/name"

GostwireNetworkNameKey defines the label key for storing the Docker network name of bridge networks.

View Source
const PassthroughHostIfnameOptionName = "ifname"

PassthroughHostIfnameOptionName specifies the name of a host network interface to be passed through into a single network namespace (sandbox).

Variables

This section is empty.

Functions

func Decorate

func Decorate(
	ctx context.Context,
	allnetns network.NetworkNamespaces,
	allprocs model.ProcessTable,
	engines []*model.ContainerEngine,
)

Decorate decorates bridge and macvlan master network interfaces with alias names that are the names of their corresponding Docker “bridge” or “macvlan” networks, where applicable (a copy is stored also in the labels in Gostwire's key namespace). Additionally, it copies over any user-defined network labels.

Types

type PassedThrough

type PassedThrough struct {
	Alias     string
	HwAddress string
}

Jump to

Keyboard shortcuts

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