Movatterモバイル変換


[0]ホーム

URL:


ippool

package
v1.92.3Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2025 License:BSD-3-ClauseImports:22Imported by:0

Details

Repository

github.com/tailscale/tailscale

Links

Documentation

Overview

ippool implements IP address storage, creation, and retrieval for cmd/natc

Index

Constants

This section is empty.

Variables

View Source
var ErrNoIPsAvailable =errors.New("no IPs available")

Functions

This section is empty.

Types

typeClusterOptsadded inv1.88.0

type ClusterOpts struct {TagstringStateDirstringFollowOnlybool}

typeConsensusIPPooladded inv1.86.0

type ConsensusIPPool struct {IPSet *netipx.IPSet// contains filtered or unexported fields}

ConsensusIPPool implements anIPPool that is distributed among members of a cluster for high availability.Writes are directed to a leader among the cluster and are slower than reads, reads are performed locallyusing information replicated from the leader.The cluster maintains consistency, reads can be stale and writes can be unavailable if sufficient clusterpeers are unavailable.

funcNewConsensusIPPooladded inv1.86.0

func NewConsensusIPPool(ipSet *netipx.IPSet) *ConsensusIPPool

func (*ConsensusIPPool)Applyadded inv1.86.0

func (ipp *ConsensusIPPool) Apply(lg *raft.Log)any

Apply is part of the raft.FSM interface. It takes an incoming log entry and applies it to the state.

func (*ConsensusIPPool)DeleteClusterServeradded inv1.88.0

func (ipp *ConsensusIPPool) DeleteClusterServer(idraft.ServerID) (uint64,error)

DeleteClusterServer removes a server from the consensus implementation's cluster configuration

func (*ConsensusIPPool)DomainForIPadded inv1.86.0

func (ipp *ConsensusIPPool) DomainForIP(fromtailcfg.NodeID, addrnetip.Addr, updatedAttime.Time) (string,bool)

DomainForIP looks up the domain associated with a tailcfg.NodeID and netip.Addr pair.If there is no association, the result is empty and ok is false.

func (*ConsensusIPPool)GetClusterConfigurationadded inv1.88.0

func (ipp *ConsensusIPPool) GetClusterConfiguration() (raft.Configuration,error)

GetClusterConfiguration gets the consensus implementation's cluster configuration

func (*ConsensusIPPool)IPForDomainadded inv1.86.0

func (ipp *ConsensusIPPool) IPForDomain(nidtailcfg.NodeID, domainstring) (netip.Addr,error)

IPForDomain looks up or creates an IP address allocation for the tailcfg.NodeID and domain pair.If no address association is found, one is allocated from the range of free addresses for this tailcfg.NodeID.If no more address are available, an error is returned.

func (*ConsensusIPPool)Restoreadded inv1.86.0

func (ipp *ConsensusIPPool) Restore(rcio.ReadCloser)error

Restore is part of the raft.FSM interface.According to the docs it:

  • will not be called concurrently with any other command
  • the FSM must discard all previous state before restoring

func (*ConsensusIPPool)Snapshotadded inv1.86.0

func (ipp *ConsensusIPPool) Snapshot() (raft.FSMSnapshot,error)

Snapshot is part of the raft.FSM interface.According to the docs it:

  • should return quickly
  • will not be called concurrently with Apply
  • the snapshot returned will have Persist called on it concurrently with Apply(so it should not contain pointers to the original data that's being mutated)

func (*ConsensusIPPool)StartConsensusadded inv1.86.0

func (ipp *ConsensusIPPool) StartConsensus(ctxcontext.Context, ts *tsnet.Server, optsClusterOpts)error

StartConsensus is part of the IPPool interface. It starts the raft background routines that handle consensus.

func (*ConsensusIPPool)StopConsensusadded inv1.86.0

func (ipp *ConsensusIPPool) StopConsensus(ctxcontext.Context)error

StopConsensus is part of the IPPool interface. It stops the raft background routines that handle consensus.

typeIPPool

type IPPool interface {// DomainForIP looks up the domain associated with a tailcfg.NodeID and netip.Addr pair.// If there is no association, the result is empty and ok is false.DomainForIP(tailcfg.NodeID,netip.Addr,time.Time) (string,bool)// IPForDomain looks up or creates an IP address allocation for the tailcfg.NodeID and domain pair.// If no address association is found, one is allocated from the range of free addresses for this tailcfg.NodeID.// If no more address are available, an error is returned.IPForDomain(tailcfg.NodeID,string) (netip.Addr,error)}

IPPool allocates IPv4 addresses from a pool to DNS domains, on a per tailcfg.NodeID basis.For each tailcfg.NodeID, IPv4 addresses are associated with at most one DNS domain.Addresses may be reused across other tailcfg.NodeID's for the same or other domains.

typeSingleMachineIPPooladded inv1.86.0

type SingleMachineIPPool struct {IPSet *netipx.IPSet// contains filtered or unexported fields}

func (*SingleMachineIPPool)DomainForIPadded inv1.86.0

func (ipp *SingleMachineIPPool) DomainForIP(fromtailcfg.NodeID, addrnetip.Addr, _time.Time) (string,bool)

func (*SingleMachineIPPool)IPForDomainadded inv1.86.0

func (ipp *SingleMachineIPPool) IPForDomain(fromtailcfg.NodeID, domainstring) (netip.Addr,error)

Source Files

View all Source files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f orF : Jump to
y orY : Canonical URL
go.dev uses cookies from Google to deliver and enhance the quality of its services and to analyze traffic.Learn more.

[8]ページ先頭

©2009-2025 Movatter.jp