ndmz

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2025 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// FamilyAll get all IP address families
	FamilyAll = netlink.FAMILY_ALL
	//FamilyV4 gets all IPv4 addresses
	FamilyV4 = netlink.FAMILY_V4
	//FamilyV6 gets all IPv6 addresses
	FamilyV6 = netlink.FAMILY_V6
)
View Source
const (

	//NdmzBridge is the name of the ipv4 routing bridge in the host namespace
	NdmzBridge = "br-ndmz"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DHCPMon

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

DHCPMon monitor a network interface status and force renew of DHCP lease if needed

func NewDHCPMon

func NewDHCPMon(iface, namespace string, z *zinit.Client) *DHCPMon

NewDHCPMon create a new DHCPMon object managing interface iface namespace is then network namespace name to use. it can be empty.

func (*DHCPMon) Start

func (d *DHCPMon) Start(ctx context.Context) error

Start creates a zinit service for a DHCP client and start monitoring it this method is blocking, start is in a goroutine if needed. cancel the context to start it.

type DMZ

type DMZ interface {
	Namespace() string
	// create the ndmz network namespace and all requires network interfaces
	Create(ctx context.Context) error
	// delete the ndmz network namespace and clean up all network interfaces
	Delete() error
	// link a network resource from a user network to ndmz
	AttachNR(networkID, nr, ipamLeaseDir string) error

	DetachNR(networkID, ipamLeaseDir string) error
	// GetIP gets ndmz public ips from ndmz
	GetIP(family int) ([]net.IPNet, error)

	// Get gateway to given destination ip
	GetDefaultGateway(destination net.IP) (net.IP, error)

	// GetIPFor get the ip of an
	GetIPFor(inf string) ([]net.IPNet, error)
	//GetIP(family netlink.FAM)
	// SupportsPubIPv4 indicates if the node supports public ipv4 addresses for
	// workloads
	SupportsPubIPv4() bool

	//Interfaces information about dmz interfaces
	Interfaces() ([]types.IfaceInfo, error)
}

DMZ is an interface used to create an DMZ network namespace

func New

func New(nodeID string, public *netlink.Bridge) DMZ

New creates a new DMZ DualStack

Jump to

Keyboard shortcuts

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