juju: github.com/juju/juju/core/network Index | Files

package network

import "github.com/juju/juju/core/network"

Index

Package Files

address.go hostport.go linklayer.go network.go port.go portrange.go space.go subnet.go

Constants

const (
    // DefaultSpaceId is the ID of the default network space.
    // Application endpoints are bound to this space by default
    // if no explicit binding is specified.
    DefaultSpaceId = "0"

    // DefaultSpaceName is the name of the default network space.
    DefaultSpaceName = ""
)

Variables

var GenerateVirtualMACAddress = func() string {
    digits := make([]interface{}, 3)
    for i := range digits {
        digits[i] = rand.Intn(256)
    }
    return fmt.Sprintf(macAddressTemplate, digits...)
}

GenerateVirtualMACAddress creates a random MAC address within the address space implied by macAddressTemplate above.

func APIHostPortsToNoProxyString Uses

func APIHostPortsToNoProxyString(ahp []SpaceHostPorts) string

APIHostPortsToNoProxyString converts list of lists of NetAddrs() to a NoProxy-like comma separated string, ignoring local addresses

func DialAddress Uses

func DialAddress(a HostPort) string

DialAddress returns a string value for the input HostPort, suitable for passing as an argument to net.Dial.

func ExactScopeMatch Uses

func ExactScopeMatch(addr Address, addrScopes ...Scope) bool

ExactScopeMatch checks if an address exactly matches any of the specified scopes.

func IsValidCidr Uses

func IsValidCidr(cidr string) bool

IsValidCidr returns whether cidr is a valid subnet CIDR.

func IsValidLinkLayerDeviceName Uses

func IsValidLinkLayerDeviceName(name string) bool

IsValidLinkLayerDeviceName returns whether the given name is a valid network link-layer device name, depending on the runtime.GOOS value.

func IsValidLinkLayerDeviceType Uses

func IsValidLinkLayerDeviceType(value string) bool

IsValidLinkLayerDeviceType returns whether the given value is a valid link-layer network device type.

func SortAddresses Uses

func SortAddresses(addrs []SpaceAddress)

SortAddresses sorts the given Address slice according to the sortOrder of each address. See Address.sortOrder() for more info.

func SortHostPorts Uses

func SortHostPorts(hps []SpaceHostPort)

SortHostPorts sorts the given SpaceHostPort slice according to the sortOrder of each SpaceHostPort's embedded Address. See Address.sortOrder() for more info.

func SortPortRanges Uses

func SortPortRanges(portRanges []PortRange)

SortPortRanges sorts the given ports, first by protocol, then by number.

type Address Uses

type Address interface {
    // Host returns the value for the host-name/IP address.
    Host() string

    // AddressType returns the type of the address.
    AddressType() AddressType

    // AddressScope returns the scope of the address.
    AddressScope() Scope
}

Address describes methods for returning details about an IP address or host name.

type AddressType Uses

type AddressType string

AddressType represents the possible ways of specifying a machine location by either a hostname resolvable by dns lookup, or IPv4 or IPv6 address.

const (
    HostName    AddressType = "hostname"
    IPv4Address AddressType = "ipv4"
    IPv6Address AddressType = "ipv6"
)

func DeriveAddressType Uses

func DeriveAddressType(value string) AddressType

DeriveAddressType attempts to detect the type of address given.

type FanCIDRs Uses

type FanCIDRs struct {
    // FanLocalUnderlay is the CIDR of the local underlying fan network.
    // It allows easy identification of the device the fan is running on.
    FanLocalUnderlay string

    // FanOverlay is the CIDR of the complete fan setup.
    FanOverlay string
}

FanCIDRs describes the subnets relevant to a fan network.

type HostPort Uses

type HostPort interface {
    Host() string
    Port() int
    AddressScope() Scope
}

HostPort describes methods on an object that represents a network connection endpoint.

type HostPorts Uses

type HostPorts []HostPort

HostPorts derives from a slice of HostPort and allows bulk operations on its members.

func CollapseToHostPorts Uses

func CollapseToHostPorts(serversHostPorts []MachineHostPorts) HostPorts

CollapseToHostPorts returns the input nested slice of MachineHostPort as a flat slice of HostPort, preserving the order.

func (HostPorts) FilterUnusable Uses

func (hps HostPorts) FilterUnusable() HostPorts

FilterUnusable returns a copy of the receiver HostPorts after removing any addresses unlikely to be usable (ScopeMachineLocal or ScopeLinkLocal).

func (HostPorts) PrioritizedForScope Uses

func (hps HostPorts) PrioritizedForScope(getMatcher ScopeMatchFunc) []string

PrioritizedForScope orders the HostPorts by best match for the input scope matching function and returns them in NetAddr form. If there are no suitable addresses then an empty slice is returned.

func (HostPorts) Strings Uses

func (hps HostPorts) Strings() []string

Strings returns the HostPorts as a slice of strings suitable for passing to net.Dial.

func (HostPorts) Unique Uses

func (hps HostPorts) Unique() HostPorts

Unique returns a copy of the receiver HostPorts with duplicate endpoints removed. Note that this only applies to dial addresses; spaces are ignored.

type Id Uses

type Id string

Id defines a provider-specific network ID.

type LinkLayerDeviceType Uses

type LinkLayerDeviceType string

LinkLayerDeviceType defines the type of a link-layer network device.

const (
    // LoopbackDevice is used for loopback devices.
    LoopbackDevice LinkLayerDeviceType = "loopback"

    // EthernetDevice is used for Ethernet (IEEE 802.3) devices.
    EthernetDevice LinkLayerDeviceType = "ethernet"

    // VLAN8021QDevice is used for IEEE 802.1Q VLAN devices.
    VLAN8021QDevice LinkLayerDeviceType = "802.1q"

    // BondDevice is used for bonding devices.
    BondDevice LinkLayerDeviceType = "bond"

    // BridgeDevice is used for OSI layer-2 bridge devices.
    BridgeDevice LinkLayerDeviceType = "bridge"
)

type MachineAddress Uses

type MachineAddress struct {
    Value string
    Type  AddressType
    Scope Scope
}

MachineAddress represents an address without associated space or provider information. Addresses of this form will be supplied by an agent running directly on a machine or container, or returned for requests where space information is irrelevant to usage.

func NewMachineAddress Uses

func NewMachineAddress(value string) MachineAddress

NewMachineAddress creates a new MachineAddress, deriving its type from the value and using ScopeUnknown as scope. It is a shortcut to calling NewScopedMachineAddress(value, ScopeUnknown).

func NewScopedMachineAddress Uses

func NewScopedMachineAddress(value string, scope Scope) MachineAddress

NewScopedMachineAddress creates a new MachineAddress, deriving its type from the value. If the specified scope is ScopeUnknown, then NewScopedSpaceAddress will attempt to derive the scope based on reserved IP address ranges. Because passing ScopeUnknown is fairly common, NewMachineAddress() above does exactly that.

func (MachineAddress) AddressScope Uses

func (a MachineAddress) AddressScope() Scope

AddressScope returns the scope of the address.

func (MachineAddress) AddressType Uses

func (a MachineAddress) AddressType() AddressType

AddressType returns the type of the address.

func (MachineAddress) GoString Uses

func (a MachineAddress) GoString() string

GoString implements fmt.GoStringer.

func (MachineAddress) Host Uses

func (a MachineAddress) Host() string

Host returns the value for the host-name/IP address.

func (MachineAddress) String Uses

func (a MachineAddress) String() string

String returns the address value, prefixed with the scope if known.

type MachineHostPort Uses

type MachineHostPort struct {
    MachineAddress
    NetPort
}

MachineHostPort associates a space-unaware address with a port.

func ParseMachineHostPort Uses

func ParseMachineHostPort(hp string) (*MachineHostPort, error)

ParseMachineHostPort converts a string containing a single host and port value to a MachineHostPort.

func (MachineHostPort) GoString Uses

func (hp MachineHostPort) GoString() string

GoString implements fmt.GoStringer.

func (MachineHostPort) String Uses

func (hp MachineHostPort) String() string

String implements Stringer.

type MachineHostPorts Uses

type MachineHostPorts []MachineHostPort

MachineHostPorts is a slice of MachineHostPort allowing use as a receiver for bulk operations.

func NewMachineHostPorts Uses

func NewMachineHostPorts(port int, addresses ...string) MachineHostPorts

NewMachineHostPorts creates a list of MachineHostPorts from each given string address and port.

func (MachineHostPorts) HostPorts Uses

func (hp MachineHostPorts) HostPorts() HostPorts

HostPorts returns the slice as a new slice of the HostPort indirection.

type NetPort Uses

type NetPort int

NetPort represents a network port. TODO (manadart 2019-08-15): Finish deprecation of `Port` and use that name.

func (NetPort) Port Uses

func (p NetPort) Port() int

Port returns the port number.

type Port Uses

type Port struct {
    Protocol string
    Number   int
}

Port identifies a network port number for a particular protocol.

NOTE(dimitern): This is deprecated and should be removed, use PortRange instead. There are a few places which still use Port, especially in apiserver/params, so it can't be removed yet.

func (Port) GoString Uses

func (p Port) GoString() string

GoString implements fmt.GoStringer.

func (Port) String Uses

func (p Port) String() string

String implements Stringer.

type PortRange Uses

type PortRange struct {
    FromPort int
    ToPort   int
    Protocol string
}

PortRange represents a single range of ports.

func CollapsePorts Uses

func CollapsePorts(ports []Port) (result []PortRange)

CollapsePorts collapses a slice of ports into port ranges.

NOTE(dimitern): This is deprecated and should be removed when possible. It still exists, because in a few places slices of Ports are converted to PortRanges internally.

func CombinePortRanges Uses

func CombinePortRanges(ranges ...PortRange) []PortRange

CombinePortRanges groups together all port ranges according to protocol, and then combines then into contiguous port ranges. NOTE: Juju only allows its model to contain non-overlapping port ranges. This method operates on that assumption.

func MustParsePortRange Uses

func MustParsePortRange(portRange string) PortRange

MustParsePortRange converts a raw port-range string into a PortRange. If the string is invalid, the function panics.

func ParsePortRange Uses

func ParsePortRange(inPortRange string) (PortRange, error)

ParsePortRange builds a PortRange from the provided string. If the string does not include a protocol then "tcp" is used. Validate() gets called on the result before returning. If validation fails the invalid PortRange is still returned. Example strings: "80/tcp", "443", "12345-12349/udp", "icmp".

func (PortRange) ConflictsWith Uses

func (a PortRange) ConflictsWith(b PortRange) bool

ConflictsWith determines if the two port ranges conflict.

func (PortRange) GoString Uses

func (p PortRange) GoString() string

func (PortRange) String Uses

func (p PortRange) String() string

func (PortRange) Validate Uses

func (p PortRange) Validate() error

IsValid determines if the port range is valid.

type ProviderAddress Uses

type ProviderAddress struct {
    MachineAddress
    SpaceName       SpaceName
    ProviderSpaceID Id
}

ProviderAddress represents an address supplied by provider logic. It can include the provider's knowledge of the space in which the address resides.

func NewProviderAddress Uses

func NewProviderAddress(value string) ProviderAddress

NewProviderAddress creates a new ProviderAddress, deriving its type from the value and using ScopeUnknown as scope. It is a shortcut to calling NewScopedProvider(value, ScopeUnknown).

func NewProviderAddressInSpace Uses

func NewProviderAddressInSpace(spaceName string, value string) ProviderAddress

NewProviderAddressInSpace creates a new ProviderAddress, deriving its type and scope from the value, and associating it with the given space name.

func NewScopedProviderAddress Uses

func NewScopedProviderAddress(value string, scope Scope) ProviderAddress

NewScopedProviderAddress creates a new ProviderAddress by embedding the result of NewScopedMachineAddress. No space information is populated.

func (ProviderAddress) GoString Uses

func (a ProviderAddress) GoString() string

GoString implements fmt.GoStringer.

func (ProviderAddress) String Uses

func (a ProviderAddress) String() string

String returns a string representation of the address, in the form: `<scope>:<address-value>@<space-name>(id:<space-provider-id)`; for example:

public:c2-54-226-162-124.compute-1.amazonaws.com@public-api(id:42)

If the SpaceName is blank, the "@<space-name>" suffix will be omitted. Finally, if the ProviderSpaceID is empty the suffix "(id:<space-provider-id>)" part will be omitted as well.

type ProviderAddresses Uses

type ProviderAddresses []ProviderAddress

ProviderAddresses is a slice of ProviderAddress supporting conversion to SpaceAddresses.

func NewProviderAddresses Uses

func NewProviderAddresses(inAddresses ...string) (outAddresses ProviderAddresses)

NewProviderAddresses is a convenience function to create addresses from a variable number of string arguments.

func NewProviderAddressesInSpace Uses

func NewProviderAddressesInSpace(spaceName string, inAddresses ...string) (outAddresses ProviderAddresses)

NewProviderAddressesInSpace is a convenience function to create addresses in the same space, from a a variable number of string arguments.

func (ProviderAddresses) OneMatchingScope Uses

func (pas ProviderAddresses) OneMatchingScope(getMatcher ScopeMatchFunc) (ProviderAddress, bool)

OneMatchingScope returns the address that best satisfies the input scope matching function. The boolean return indicates if a match was found.

func (ProviderAddresses) ToSpaceAddresses Uses

func (pas ProviderAddresses) ToSpaceAddresses(lookup SpaceLookup) (SpaceAddresses, error)

ToSpaceAddresses transforms the ProviderAddresses to SpaceAddresses by using the input lookup for conversion of space name to space ID.

type ProviderHostPort Uses

type ProviderHostPort struct {
    ProviderAddress
    NetPort
}

ProviderHostPort associates a provider/space aware address with a port.

func (ProviderHostPort) GoString Uses

func (hp ProviderHostPort) GoString() string

GoString implements fmt.GoStringer.

func (ProviderHostPort) String Uses

func (hp ProviderHostPort) String() string

String implements Stringer.

type ProviderHostPorts Uses

type ProviderHostPorts []ProviderHostPort

ProviderHostPorts is a slice of ProviderHostPort allowing use as a receiver for bulk operations.

func ParseProviderHostPorts Uses

func ParseProviderHostPorts(hostPorts ...string) (ProviderHostPorts, error)

ParseMachineHostPorts creates a slice of MachineHostPorts parsing each given string containing address:port. An error is returned if any string cannot be parsed as a MachineHostPort.

func (ProviderHostPorts) Addresses Uses

func (hp ProviderHostPorts) Addresses() ProviderAddresses

Addresses extracts the ProviderAddress from each member of the collection, then returns them as a new collection, effectively discarding the port.

func (ProviderHostPorts) HostPorts Uses

func (hp ProviderHostPorts) HostPorts() HostPorts

HostPorts returns the slice as a new slice of the HostPort indirection.

type Scope Uses

type Scope string

Scope denotes the context a location may apply to. If a name or address can be reached from the wider internet, it is considered public. A private network address is either specific to the cloud or cloud subnet a machine belongs to, or to the machine itself for containers.

const (
    ScopeUnknown      Scope = ""
    ScopePublic       Scope = "public"
    ScopeCloudLocal   Scope = "local-cloud"
    ScopeFanLocal     Scope = "local-fan"
    ScopeMachineLocal Scope = "local-machine"
    ScopeLinkLocal    Scope = "link-local"
)

type ScopeMatch Uses

type ScopeMatch int

ScopeMatch is a numeric designation of how well the requirement for satisfying a scope is met.

func ScopeMatchCloudLocal Uses

func ScopeMatchCloudLocal(addr Address) ScopeMatch

ScopeMatchCloudLocal is an address scope matching function for determining the extent to which the input address' scope satisfies a requirement for accessibility from within the local cloud. Machine-only addresses do not satisfy this matcher.

func ScopeMatchMachineOrCloudLocal Uses

func ScopeMatchMachineOrCloudLocal(addr Address) ScopeMatch

func ScopeMatchPublic Uses

func ScopeMatchPublic(addr Address) ScopeMatch

ScopeMatchPublic is an address scope matching function for determining the extent to which the input address' scope satisfies a requirement for public accessibility.

type ScopeMatchFunc Uses

type ScopeMatchFunc = func(addr Address) ScopeMatch

ScopeMatchFunc is an alias for a function that accepts an Address, and returns what kind of scope match is determined by the body.

type SpaceAddress Uses

type SpaceAddress struct {
    MachineAddress
    SpaceID string
}

SpaceAddress represents the location of a machine, including metadata about what kind of location the address describes. This is a server-side type that may include a space reference. It is used in logic for filtering addresses by space.

func MergedAddresses Uses

func MergedAddresses(machineAddresses, providerAddresses []SpaceAddress) []SpaceAddress

MergedAddresses provides a single list of addresses without duplicates suitable for returning as an address list for a machine. TODO (cherylj) Add explicit unit tests - tracked with bug #1544158

func NewScopedSpaceAddress Uses

func NewScopedSpaceAddress(value string, scope Scope) SpaceAddress

NewScopedSpaceAddress creates a new SpaceAddress, deriving its type from the input value. If the specified scope is ScopeUnknown, then NewScopedSpaceAddress will attempt to derive the scope based on reserved IP address ranges. Because passing ScopeUnknown is fairly common, NewSpaceAddress() above does exactly that.

func NewSpaceAddress Uses

func NewSpaceAddress(value string) SpaceAddress

NewSpaceAddress creates a new SpaceAddress, deriving its type from the input value and using ScopeUnknown as scope.

func (SpaceAddress) GoString Uses

func (a SpaceAddress) GoString() string

GoString implements fmt.GoStringer.

func (SpaceAddress) String Uses

func (a SpaceAddress) String() string

String returns a string representation of the address, in the form: `<scope>:<address-value>@space:<space-id>`; for example:

public:c2-54-226-162-124.compute-1.amazonaws.com@space:1

If the Space ID is empty, the @space:<space-id> suffix will be omitted.

type SpaceAddresses Uses

type SpaceAddresses []SpaceAddress

SpaceAddresses is a slice of SpaceAddress supporting conversion to ProviderAddresses.

func NewSpaceAddresses Uses

func NewSpaceAddresses(inAddresses ...string) (outAddresses SpaceAddresses)

NewSpaceAddresses is a convenience function to create addresses from a variable number of string arguments.

func (SpaceAddresses) AllMatchingScope Uses

func (sas SpaceAddresses) AllMatchingScope(getMatcher ScopeMatchFunc) SpaceAddresses

AllMatchingScope returns the addresses that best satisfy the input scope matching function.

func (SpaceAddresses) InSpaces Uses

func (sas SpaceAddresses) InSpaces(spaces ...SpaceInfo) (SpaceAddresses, bool)

InSpaces returns the SpaceAddresses that are in the input spaces.

func (SpaceAddresses) OneMatchingScope Uses

func (sas SpaceAddresses) OneMatchingScope(getMatcher ScopeMatchFunc) (SpaceAddress, bool)

OneMatchingScope returns the address that best satisfies the input scope matching function. The boolean return indicates if a match was found.

func (SpaceAddresses) ToProviderAddresses Uses

func (sas SpaceAddresses) ToProviderAddresses(lookup SpaceLookup) (ProviderAddresses, error)

ToProviderAddresses transforms the SpaceAddresses to ProviderAddresses by using the input lookup for conversion of space ID to space info.

type SpaceHostPort Uses

type SpaceHostPort struct {
    SpaceAddress
    NetPort
}

SpaceHostPort associates a space ID decorated address with a port.

func (SpaceHostPort) GoString Uses

func (hp SpaceHostPort) GoString() string

GoString implements fmt.GoStringer.

func (SpaceHostPort) Less Uses

func (hp SpaceHostPort) Less(hp2 SpaceHostPort) bool

Less reports whether hp is ordered before hp2 according to the criteria used by SortHostPorts.

func (SpaceHostPort) String Uses

func (hp SpaceHostPort) String() string

String implements Stringer.

type SpaceHostPorts Uses

type SpaceHostPorts []SpaceHostPort

SpaceHostPorts is a slice of SpaceHostPort allowing use as a receiver for bulk operations.

func EnsureFirstHostPort Uses

func EnsureFirstHostPort(first SpaceHostPort, hps SpaceHostPorts) SpaceHostPorts

EnsureFirstHostPort scans the given list of SpaceHostPorts and if "first" is found, it moved to index 0. Otherwise, if "first" is not in the list, it's inserted at index 0.

func NewSpaceHostPorts Uses

func NewSpaceHostPorts(port int, addresses ...string) SpaceHostPorts

NewSpaceHostPorts creates a list of SpaceHostPorts from each input string address and port.

func SpaceAddressesWithPort Uses

func SpaceAddressesWithPort(addrs SpaceAddresses, port int) SpaceHostPorts

SpaceAddressesWithPort returns the input SpaceAddresses all associated with the given port.

func (SpaceHostPorts) AllMatchingScope Uses

func (hps SpaceHostPorts) AllMatchingScope(getMatcher ScopeMatchFunc) []string

AllMatchingScope returns the HostPorts that best satisfy the input scope matching function, as strings usable as arguments to net.Dial.

func (SpaceHostPorts) HostPorts Uses

func (hps SpaceHostPorts) HostPorts() HostPorts

HostPorts returns the slice as a new slice of the HostPort indirection.

func (SpaceHostPorts) InSpaces Uses

func (hps SpaceHostPorts) InSpaces(spaces ...SpaceInfo) (SpaceHostPorts, bool)

InSpaces returns the SpaceHostPorts that are in the input spaces.

func (SpaceHostPorts) ToProviderHostPorts Uses

func (hps SpaceHostPorts) ToProviderHostPorts(lookup SpaceLookup) (ProviderHostPorts, error)

ToProviderHostPorts transforms the SpaceHostPorts to ProviderHostPorts by using the input lookup for conversion of space ID to space info.

type SpaceInfo Uses

type SpaceInfo struct {
    // ID is the unique identifier for the space.
    ID  string

    // Name is the name of the space.
    // It is used by operators for identifying a space and should be unique.
    Name SpaceName

    // ProviderId is the provider's unique identifier for the space,
    // such as used by MAAS.
    ProviderId Id

    // Subnets are the subnets that have been grouped into this network space.
    Subnets []SubnetInfo
}

SpaceInfo defines a network space.

type SpaceInfos Uses

type SpaceInfos []SpaceInfo

SpaceInfos is a collection of spaces.

func (SpaceInfos) GetByID Uses

func (s SpaceInfos) GetByID(id string) *SpaceInfo

GetByID returns a reference to the space with the input ID if it exists in the collection. Otherwise nil is returned.

func (SpaceInfos) GetByName Uses

func (s SpaceInfos) GetByName(name string) *SpaceInfo

GetByName returns a reference to the space with the input name if it exists in the collection. Otherwise nil is returned.

func (SpaceInfos) Names Uses

func (s SpaceInfos) Names() []string

Names returns a string slice with each of the space names in the collection.

func (SpaceInfos) String Uses

func (s SpaceInfos) String() string

String returns the comma-delimited names of the spaces in the collection.

type SpaceLookup Uses

type SpaceLookup interface {
    SpaceIDsByName() (map[string]string, error)
    SpaceInfosByID() (map[string]SpaceInfo, error)
}

SpaceLookup describes methods for acquiring lookups that will translate space IDs to space names and vice versa.

type SpaceName Uses

type SpaceName string

SpaceName is the name of a network space.

type SubnetInfo Uses

type SubnetInfo struct {
    // CIDR of the network, in 123.45.67.89/24 format.
    CIDR string

    // ProviderId is a provider-specific subnet ID.
    ProviderId Id

    // ProviderSpaceId holds the provider ID of the space associated
    // with this subnet. Can be empty if not supported.
    ProviderSpaceId Id

    // ProviderNetworkId holds the provider ID of the network
    // containing this subnet, for example VPC id for EC2.
    ProviderNetworkId Id

    // VLANTag needs to be between 1 and 4094 for VLANs and 0 for
    // normal networks. It's defined by IEEE 802.1Q standard, and used
    // to define a VLAN network. For more information, see:
    // http://en.wikipedia.org/wiki/IEEE_802.1Q.
    VLANTag int

    // AvailabilityZones describes which availability zones this
    // subnet is in. It can be empty if the provider does not support
    // availability zones.
    AvailabilityZones []string

    // SpaceID is the id of the space the subnet is associated with.
    // Default value should be DefaultSpaceId. It can be empty if
    // the subnet is returned from an networkingEnviron. SpaceID is
    // preferred over SpaceName in state and non networkingEnviron use.
    SpaceID string

    // SpaceName is the name of the space the subnet is associated with.
    // An empty string indicates it is part of the DefaultSpaceName OR
    // if the SpaceID is set. Should primarily be used in an networkingEnviron.
    SpaceName string

    // FanInfo describes the fan networking setup for the subnet.
    // It may be empty if this is not a fan subnet,
    // or if this subnet information comes from a provider.
    FanInfo *FanCIDRs

    // IsPublic describes whether a subnet is public or not.
    IsPublic bool
}

SubnetInfo is a source-agnostic representation of a subnet. It may originate from state, or from a provider.

func (*SubnetInfo) FanLocalUnderlay Uses

func (s *SubnetInfo) FanLocalUnderlay() string

FanLocalUnderlay returns the fan underlay CIDR if known.

func (*SubnetInfo) FanOverlay Uses

func (s *SubnetInfo) FanOverlay() string

FanOverlay returns the fan overlay CIDR if known.

func (*SubnetInfo) SetFan Uses

func (s *SubnetInfo) SetFan(underlay, overlay string)

SetFan sets the fan networking information for the subnet.

func (*SubnetInfo) Validate Uses

func (s *SubnetInfo) Validate() error

Validate validates the subnet, checking the CIDR, and VLANTag, if present.

Package network imports 11 packages (graph) and is imported by 184 packages. Updated 2019-10-04. Refresh now. Tools for package owners.