Documentation
¶
Index ¶
- func CleanupTAPs(vmIDs []string) []string
- func GCModule(rootDir string) gc.Module[bridgeSnapshot]
- type Bridge
- func (b *Bridge) Config(ctx context.Context, vmID string, numNICs int, vmCfg *types.VMConfig, ...) ([]*types.NetworkConfig, error)
- func (b *Bridge) Delete(_ context.Context, vmIDs []string) ([]string, error)
- func (b *Bridge) Inspect(_ context.Context, _ string) (*types.Network, error)
- func (b *Bridge) List(_ context.Context) ([]*types.Network, error)
- func (b *Bridge) RegisterGC(orch *gc.Orchestrator)
- func (b *Bridge) Type() string
- func (b *Bridge) Verify(_ context.Context, vmID string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CleanupTAPs ¶
CleanupTAPs removes bridge TAP devices for the given VM IDs. It does not require a Bridge instance and is safe to call even when no bridge TAPs exist (no-op per VM).
Types ¶
type Bridge ¶
type Bridge struct {
// contains filtered or unexported fields
}
Bridge implements network.Network by creating TAP devices and adding them directly to an existing Linux bridge. An external DHCP server on the bridge (e.g. dnsmasq) serves VM IPs. No veth, no TC, no netns — just TAP-on-bridge, the simplest possible VM networking.
This backend is designed to work with cocoon-net's cni0 bridge or any pre-existing bridge that has DHCP + routing already set up.
func (*Bridge) Config ¶
func (b *Bridge) Config(ctx context.Context, vmID string, numNICs int, vmCfg *types.VMConfig, existing ...*types.NetworkConfig) ([]*types.NetworkConfig, error)
Config creates TAP devices and adds them to the bridge.
func (*Bridge) RegisterGC ¶
func (b *Bridge) RegisterGC(orch *gc.Orchestrator)
RegisterGC registers the bridge GC module that reclaims orphan bt* TAP devices.