network

package
v0.0.0-...-8d377ce Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2024 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

type Service struct {
	// If set, use the given static network configuration instead of relying on
	// autoconfiguration.
	StaticConfig *netpb.Net

	// List of IPs which get configured onto the loopback interface and the
	// integrated DNS server is serving on. Cannot be changed at runtime.
	// This is a hack to work around CoreDNS not being able to change listeners
	// on-the-fly without breaking everything. This will go away once its
	// frontend got replaced by something which can do that.
	ExtraDNSListenerIPs []net.IP

	// Vendor Class identifier of the system
	DHCPVendorClassID string

	// Status is the current status of the network as seen by the service.
	Status memory.Value[*Status]
	// contains filtered or unexported fields
}

Service is the network service for this node. It maintains all networking-related functionality, but is generally not aware of the inner workings of Metropolis, instead functioning in a generic manner. Once created via New, it can be started and restarted arbitrarily, but the service object itself must be long-lived.

func New

func New(staticConfig *netpb.Net) *Service

New instantiates a new network service. If autoconfiguration is desired, staticConfig must be set to nil. If staticConfig is set to a non-nil value, it will be used instead of autoconfiguration.

func (*Service) ConfigureDNS

func (s *Service) ConfigureDNS(d *dns.ExtraDirective)

ConfigureDNS sets a DNS ExtraDirective on the built-in DNS server of the network Service. See //metropolis/node/core/network/dns for more information.

func (*Service) Run

func (s *Service) Run(ctx context.Context) error

type Status

type Status struct {
	ExternalAddress net.IP
	DNSServers      dhcp4c.DNSServers
}

Status is the current network status of the host. It will be updated by the network Service whenever the node's network configuration changes. Spurious changes might occur, consumers should ensure that the change that occured is meaningful to them.

Directories

Path Synopsis
Package dhcp4c implements a DHCPv4 Client as specified in RFC2131 (with some notable deviations).
Package dhcp4c implements a DHCPv4 Client as specified in RFC2131 (with some notable deviations).
callback
Package callback contains minimal callbacks for configuring the kernel with options received over DHCP.
Package callback contains minimal callbacks for configuring the kernel with options received over DHCP.
transport
Package transport contains Linux-based transports for the DHCP broadcast and unicast specifications.
Package transport contains Linux-based transports for the DHCP broadcast and unicast specifications.
Package DNS provides a DNS server using CoreDNS.
Package DNS provides a DNS server using CoreDNS.
Package hostsfile implements a service which owns and writes all node-local files/interfaces used by the system to resolve the local node's name and the names of other nodes in the cluster:
Package hostsfile implements a service which owns and writes all node-local files/interfaces used by the system to resolve the local node's name and the names of other nodes in the cluster:

Jump to

Keyboard shortcuts

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