Documentation
¶
Index ¶
- Variables
- func AddrCompress(pfx *netip.Prefix) (s string)
- func AddrExpand(ip netip.Addr) (s string)
- func AddrFmt(ip netip.Addr, f, sep, segSep string, every, everySeg uint) (s string)
- func AddrInvert(ip netip.Addr) (inverted netip.Addr)
- func CacheReserved() (err error)
- func CheckReserved(nets []*netip.Prefix, revRecursive, recursive, excludePrivate bool) (reservations map[netip.Prefix]*IANAAddrNetResRecord, err error)
- func CleanCache() (err error)
- func EnableCache(enable bool) (err error)
- func GetCacheConfig() (enabled bool, cacheDirPath string)
- func LastSubnetNet(pfx *net.IPNet, pfxLen uint8) (lastSubnet *net.IPNet, err error)
- func LastSubnetPfx(pfx netip.Prefix, pfxLen uint8) (lastSubnet netip.Prefix, err error)
- func MaskExpand(mask net.IPMask, isIpv6 bool) (s string)
- func MaskFmt(mask net.IPMask, f, sep, segSep string, every, everySeg uint) (s string)
- func MaskInvert(mask net.IPMask) (inverted net.IPMask)
- func NumAddrsIn(pfxLen uint8, isIpv6, inclNet, inclBcast bool) (numAddrs *big.Int, err error)
- func NumAddrsNet(pfx *net.IPNet, inclNet, inclBcast bool) (numAddrs *big.Int)
- func NumAddrsPfx(pfx netip.Prefix, inclNet, inclBcast bool) (numAddrs *big.Int)
- func NumNets(subnet, network uint8) (numNets uint, ipv6Only bool, err error)
- func SetCachePath(cacheDirPath string) (err error)
- func ValidateSizes(pfx *net.IPNet, sizes ...uint8) (err error)
- type BaseSplitter
- type CIDRSplitter
- type ContainedResult
- type HostSplitter
- type IANAAddrNetResRecord
- type IANABool
- type IANADate
- type IANAPrefix
- type IANARef
- type IANARegistry
- type IANARegistryData
- type IANARegistryFootnote
- type IANAString
- type NetSplitter
- type PrefixGetter
- type SplitErr
- type SplitOpts
- type StructuredResults
- type SubnetSplitter
- type VLSMSplitter
Constants ¶
This section is empty.
Variables ¶
var ( ErrBadBoundary error = errors.New("subnet does not align on bit boundary") ErrBadNumHosts error = errors.New("bad number of hosts; cannot split into prefix exactly") ErrBadNumNets error = errors.New("bad number of nets; cannot split into prefix exactly") ErrBadPrefix error = errors.New("prefix is invalid") ErrBadPrefixLen error = errors.New("prefix length exceeds maximum possible for prefix's inet family") ErrBadSplitter error = errors.New("invalid or unknown splitter when containing") ErrBigPrefix error = errors.New("prefix length exceeds remaining network space") ErrNoNetSpace error = errors.New("reached end of network space before splitting finished") ErrUnknownPos error = errors.New("unknown subnet position") )
Functions ¶
func AddrCompress ¶
AddrCompress returns the shortest possible CIDR representation as a string from a netip.Prefix. Note that IPv6 netip.Prefix.String() already does this automatically, as IPv6 has special condensing rules.
func AddrExpand ¶
AddrExpand expands a netip.Addr's string format. Like netip.Addr.StringExpanded() but for IPv4 too.
func AddrFmt ¶
AddrFmt provides a string representation for an IP (as a netip.Addr).
`f` is the string formatter to use (without the %). For IPv4, you generally want `d`, for IPv6, you generally want `x`.
`sep` indicates a character to insert every `every` bytes of the mask. For IPv4, you probably want `.`, for IPv6 there isn't really a standard representation; CIDR notation is preferred. Thus for IPv6 you probably want to set sep as blank and/or set `every` to 0.
`segSep` indicates a character sequence to use for segmenting the string. Specify as an empty string and/or set `everySeg` to 0 to disable.
`every` indicates how many bytes should pass before sep is inserted. For IPv4, this should be 1. For IPv6, there isn't really a standard indication but it's recommended to do 2. Set as 0 or `sep` to an empty string to do no separation characters.
`everySeg` indicates how many *seperations* should pass before segSep is inserted. Set as 0 or `segSep` to an empty string to do no string segmentation.
func AddrInvert ¶
AddrInvert returns an inverted form of netip.Addr as another netip.Addr.
Note that it doesn't really make sense to use this for IPv6.
func CacheReserved ¶
func CacheReserved() (err error)
CacheReserved caches the IANA address/network reservations to disk (and updates ianaReserved4, ianaReserved6, and reservedNets).
It is up to the caller to schedule periodic CacheReserved calls according to their needs for long-lived processes. It *shouldn't* cause any memory leaks, but this has not been tested/confirmed.
If caching is not enabled, CacheReserved exits withouth any retrieval, parsing, etc.
func CheckReserved ¶
func CheckReserved(nets []*netip.Prefix, revRecursive, recursive, excludePrivate bool) (reservations map[netip.Prefix]*IANAAddrNetResRecord, err error)
CheckReserved checks nets for any reserved prefixes; either directly/explicitly, included *within* a reserved prefix (revRecursive), or *including* a reserved prefix (recursive). excludePrivate indicates if LAN networks should be considered as "reserved" or not. If a network is found via revRecursive/recursive, the matching prefix - not the specified one - will be in reservations.
Any found will be returned in reservations.
If no reserved networks are found, reservations will be nil.
Note that prefix-specific broadcasts (e.g. x.255.255.255/8, x.x.x.255/24, ::/64, x:ffff:ffff:ffff:ffff/64, etc.) will *not* be considered as "reserved" as they are considered normal addresses expected for functionality. This primarily focuses on prefixes/subnets for this reason. Additionally, all of nets will be aligned to their proper boundary range/CIDR/subnet.
func EnableCache ¶
EnableCache enables or disables subnetter's caching.
func GetCacheConfig ¶
GetCacheConfig returns the current state and path of subnetter's cache.
func LastSubnetNet ¶ added in v0.2.5
LastSubnetNet returns the last subnet of prefix length pfxLen from network pfx.
lastSubnet will be nil if pfx is nil or invalid.
func LastSubnetPfx ¶ added in v0.2.5
LastSubnetPfx is exactly like LastSubnetNet but using netip.Prefix instead.
func MaskExpand ¶
MaskExpand expands a net.IPMask's string format. Like AddrExpand but for netmasks.
func MaskFmt ¶
MaskFmt provides a string representation for a netmask (as a net.IPMask).
Its parameters hold the same significance as in AddrFmt.
func MaskInvert ¶
MaskInvert returns an inverted form of net.IPMask as another net.IPMask.
Note that it doesn't really make sense to use this for IPv6.
func NumAddrsIn ¶ added in v0.2.1
NumAddrsIn returns the number of addresses in a given prefix length and inet family.
If isIpv6 is false, it is assumed to be IPv4 (...duh).
inclNet and inclBcast have the same meanings as in NumAddrsNet and NumAddrsPfx.
Note that for the single-host prefix (/32 for IPv4, /128 for IPv6), numAddrs will *always* be 1. For point-to-point prefix (IPv4 /31, IPv6 /127), numAddrs will *ALWAYS* be 2.
func NumAddrsNet ¶ added in v0.2.1
NumAddrsNet returns the number of IP addresses in a net.IPNet.
The network address is included in the count if inclNet is true, otherwise it is excluded.
The broadcast (or reserved broadcast, in the case of IPv6) address will be included in the count if inclBcast is true, otherwise it is excluded.
numAddrs will be nil if pfx is nil or invalid.
func NumAddrsPfx ¶ added in v0.2.1
NumAddrsPfx is the exact same as NumAddrsNet but for a net/netip.Prefix instead.
func NumNets ¶ added in v0.2.0
NumNets returns the number of times prefix size subnet fits into prefix size network.
It will error if network is larger than 128 or if subnet is smaller than network.
This is MUCH more performant than splitting out an actual network into explicit subnets, and does not require an actual network.
func SetCachePath ¶
SetCachePath sets the cache path. Use an empty cacheDirPath to use the default path.
If the cache dir was changed from its previous value, subnetter will attempt to create it.
func ValidateSizes ¶
ValidateSizes ensures that none of the prefix lengths in sizes exceeds the maximum possible in pfx. No-ops with nil error if pfx is nil, sizes is nil, or sizes is empty.
err is also nil if validation succeeds. If validation fails on a prefix length size, the error will be a SplitErr with only Wrapped and RequestedPrefixLen fields populated *for the first failing size only*.
Types ¶
type BaseSplitter ¶
type BaseSplitter struct {
// contains filtered or unexported fields
}
BaseSplitter is used to encapsulate the "parent" network to be split.
func (*BaseSplitter) MarshalText ¶
func (b *BaseSplitter) MarshalText() (text []byte, err error)
MarshalText lets a BaseSplitter conform to an encoding.TextMarshaler.
func (*BaseSplitter) SetParent ¶
func (b *BaseSplitter) SetParent(pfx net.IPNet)
SetParent sets the net.IPNet for a Splitter.
func (*BaseSplitter) UnmarshalText ¶
func (b *BaseSplitter) UnmarshalText(text []byte) (err error)
UnmarshalText lets a BaseSplitter conform to an encoding.TextUnmarshaler.
This is a potentially lossy operation! Any host bits set in the prefix's address will be lost. They will not be set if the output was originally generated by `subnetter`.
type CIDRSplitter ¶
type CIDRSplitter struct { // PrefixLength specifies the CIDR/prefix length of the subnets to split out. PrefixLength uint8 `json:"prefix" xml:"prefix,attr" yaml:"network Prefix Length" validate:"required,lte=128"` // TODO: See CIDRSplitter.Split for future optimization using this. // LenSwitch specifies the threshold bit offset after which (inclusive) it switches from a repeated prefix removal to manual recursive binary split. // If 0, 12 is the default. // LenSwitch uint8 `json:"switch_at" xml:"switchAt,attr" yaml:"Switch Offset Threshold"` *BaseSplitter `json:"net" xml:"net,omitempty" yaml:"network,omitempty"` }
CIDRSplitter is used to split a network based on a fixed prefix size. It attemps to split the network into as many networks of size PrefixLength as cleanly as possible.
func (*CIDRSplitter) Split ¶
Split splits the network defined in a CIDRSplitter alongside its configuration and performs the subnetting. This strategy attempts to split a network into subnets of a single uniform explicit size.
type ContainedResult ¶
type ContainedResult struct { XMLName xml.Name `json:"-" yaml:"-" xml:"subnet"` Network *netip.Prefix `json:"net" xml:"net,attr,omitempty" yaml:"network,omitempty"` }
ContainedResult is a single Network (either an allocated subnet or a remaining block).
type HostSplitter ¶
type HostSplitter struct { // NumberHosts is the number of hosts to be placed in each subnet to split out. NumberHosts uint `json:"hosts" xml:"hosts,attr" yaml:"Number of Hosts Per Subnet" validate:"required"` // InclNetAddr, if true, specifies that NumberHosts includes the network address. InclNetAddr bool `json:"net_addr" xml:"netAddr,attr,omitempty" yaml:"Network Address Included,omitempty"` // InclBcastAddr, if true, specifies that NumberHosts includes the broadcast address. InclBcastAddr bool `json:"bcast_addr" xml:"bcast,attr,omitempty" yaml:"Broadcast Address Included,omitempty"` // Strict, if true, will return an error from Split if the network cannot split into subnets of NumberHosts-addressable networks exactly. Strict bool `json:"strict" xml:"strict,attr,omitempty" yaml:"Strictly Equal Hosts Per Subnet"` *BaseSplitter `json:"net" xml:"net,omitempty" yaml:"network,omitempty"` }
HostSplitter is used to split a network based on total number of hosts. It attempts to evenly distribute addresses amoungs subnets.
func (*HostSplitter) Split ¶
Split splits the network defined in a HostSplitter alongside its configuration and performs the subnetting. This strategy attempts to split the network into subnets of equal number of hosts.
remaining may or may not be nil depending on if the number of hosts can fit cleanly within equal network sizes on boundaries.
An ErrBadNumHosts will be returned if the number of hosts does not match the *exact* number of addresses per spec in a prefix.
type IANAAddrNetResRecord ¶
type IANAAddrNetResRecord struct { XMLName xml.Name `json:"-" yaml:"-" xml:"record"` Updated *IANADate `json:"updated,omitempty" xml:"updated,omitempty"` Networks *IANAPrefix `json:"net,omitempty" yaml:"Address/Network,omitempty" xml:"address,omitempty"` Name string `json:"name" yaml:"Name" xml:"name"` // TODO: This has inner XML. Spec *IANAString `json:"spec" yaml:"Spec" xml:"spec"` Allocation IANADate `json:"alloc" yaml:"Allocation Month" xml:"allocation"` Termination *IANADate `json:"term,omitempty" yaml:"Termination,omitempty" xml:"termination,omitempty"` Source *IANABool `json:"source,omitempty" yaml:"Is Source,omitempty" xml:"source,omitempty"` Dest *IANABool `json:"dest,omitempty" yaml:"Is Destination,omitempty" xml:"dest,omitempty"` Forwardable *IANABool `json:"forwardable,omitempty" yaml:"Is Forwardable,omitempty" xml:"forwardable,omitempty"` GlobalReach *IANABool `json:"global,omitempty" yaml:"Is Globally Reachable,omitempty" xml:"global,omitempty"` ProtoReserved *IANABool `json:"reserved,omitempty" yaml:"Is Reserved by Protocol,omitempty" xml:"reserved,omitempty"` }
type IANABool ¶
type IANADate ¶
func (*IANADate) MarshalText ¶
MarshalText lets an IANADate conform to an encoding.TextMarshaler.
type IANAPrefix ¶
type IANAPrefix struct { // IANA may include multiple prefixes in the same record. Prefixes []*netip.Prefix `json:"prefix" yaml:"prefix" xml:"prefixes>prefix,attr"` References []*IANARef `json:"refs,omitempty" yaml:"References,omitempty" xml:"refs,omitempty"` }
func (*IANAPrefix) UnmarshalXML ¶
func (i *IANAPrefix) UnmarshalXML(d *xml.Decoder, start xml.StartElement) (err error)
UnmarshalXML conforms an IANAPrefix to (encoding/xml).Unmarshaler.
type IANARef ¶
type IANARef struct { XMLName xml.Name `json:"-" yaml:"-" xml:"xref"` Type string `json:"type" yaml:"Type" xml:"type,attr"` // TODO: This may have inner XML. Reference string `json:"ref" yaml:"Reference ID" xml:"data,attr"` }
IANARef is used to hold references to RFCs etc.
type IANARegistry ¶
type IANARegistry struct { XMLName xml.Name `json:"-" yaml:"-" xml:"registry"` Title string `json:"title" yaml:"Title" xml:"title"` Category string `json:"category,omitempty" yaml:"Category,omitempty" xml:"category,omitempty"` Created IANADate `json:"created" yaml:"Created" xml:"created"` Updated *IANADate `json:"updated,omitempty" yaml:"Updated,omitempty" xml:"updated,omitempty"` Notice *IANARegistryData `json:"notice" yaml:"Notice" xml:"registry"` Footnotes []*IANARegistryFootnote `json:"footnotes,omitempty" yaml:"Footnotes,omitempty" xml:"footnote,omitempty"` }
WHAT a PITA. IANA publishes their reservations in XML (YAY!) ... except they use inner XML all over the place in their text. So.
func RetrieveReserved ¶
func RetrieveReserved() (ipv4, ipv6 IANARegistry, reserved map[netip.Prefix]*IANAAddrNetResRecord, err error)
RetrieveReserved returns the current reservations and (re-)populates reservedNets.
It returns a copy of reservedNets and the current reservations that are safe to use concurrently/separately from subnetter.
If caching is enabled, then:
1.) First the local cache will be checked. 2.) If no cache exists, subnetter will attempt to populate it (CacheReserved()); otherwise the data there will be used. 2.b.) If an error occurs while parsing the cached data, the cache will be invalidated and attempt to be updated. 3.) If no cache exists and the live resource is unavailable, an error will be returned.
If not:
1.) The live resource will be fetched. If it is unavailable, an error will be returned.
type IANARegistryData ¶
type IANARegistryData struct { XMLName xml.Name `json:"-" yaml:"-" xml:"registry"` ID string `json:"id" yaml:"ID" xml:"id,attr"` Title string `json:"title" yaml:"Title" xml:"title"` Refs []*IANARef `json:"refs" yaml:"Referencess" xml:"xref"` Rule string `json:"rule" yaml:"Registration Rule" xml:"registration_rule"` Note *IANAString `json:"note,omitempty" yaml:"Note,omitempty" xml:"note,omitempty"` Records []*IANAAddrNetResRecord `json:"records,omitempty" yaml:"Records,omitempty" xml:"record,omitempty"` }
type IANARegistryFootnote ¶
type IANARegistryFootnote struct { XMLName xml.Name `json:"-" yaml:"-" xml:"footnote"` ReferenceIdx uint `json:"ref" yaml:"Reference Index/ID" xml:"anchor,attr"` Note *IANAString `json:"note" yaml:"Note" xml:"node"` }
func (*IANARegistryFootnote) UnmarshalXML ¶
func (i *IANARegistryFootnote) UnmarshalXML(d *xml.Decoder, start xml.StartElement) (err error)
type IANAString ¶
type IANAString struct { Text string `json:"text" yaml:"Text" xml:"text"` References []*IANARef `json:"refs" yaml:"References" xml:"references"` }
func (*IANAString) UnmarshalXML ¶
func (i *IANAString) UnmarshalXML(d *xml.Decoder, start xml.StartElement) (err error)
type NetSplitter ¶
type NetSplitter interface { SetParent(pfx net.IPNet) Split() (nets []*netip.Prefix, remaining *netipx.IPSet, err error) }
NetSplitter is used to split a network into multiple nets (and any remaining prefixes/addresses that didn't fit).
type PrefixGetter ¶ added in v0.2.5
type PrefixGetter struct { // Pos is the position in BaseSplitter.network for the selected PrefixLength. Pos string `json:"pos" xml:"pos,attr" yaml:"Position" validate:"required,oneof=first last"` // PrefixLength specifies the CIDR/prefix length of the subnet. PrefixLength uint8 `json:"prefix" xml:"prefix,attr" yaml:"network Prefix Length" validate:"required,lte=128"` *BaseSplitter }
PrefixGetter is a "pseudo-splitter"; it splits according to a given prefix but only returns a specfic subnet (either the first or the last).
type SplitErr ¶
type SplitErr struct { // Wrapped is the originating error during a split (or other parsing operation). Wrapped error // Nets are the subnets parsed out/collected so far. Nets []*netip.Prefix // Remaining is an IPSet of subnets/addresses that haven't been, or were unable to be, split out. Remaining *netipx.IPSet // LastSubnet is the most recently split out subnet. LastSubnet *netip.Prefix // RequestedPrefixLen is the network prefix length size, if relevant, that was attempted to be split out of Remaining. RequestedPrefixLen uint8 }
SplitErr is used to wrap an error with context surrounding when/how that error was encountered.
type SplitOpts ¶
type SplitOpts struct { XMLName xml.Name `json:"-" xml:"splitter" yaml:"-"` CIDR *CIDRSplitter `json:"cidr,omitempty" xml:"cidr,omitempty" yaml:"CIDR Splitter,omitempty"` Host *HostSplitter `json:"host,omitempty" xml:"host,omitempty" yaml:"Host Splitter,omitempty"` Subnet *SubnetSplitter `json:"subnet,omitempty" xml:"subnet,omitempty" yaml:"Subnet Splitter,omitempty"` VLSM *VLSMSplitter `json:"vlsm,omitempty" xml:"vlsm,omitempty" yaml:"VLSM Splitter,omitempty"` }
type StructuredResults ¶
type StructuredResults struct { XMLName xml.Name `json:"-" xml:"results" yaml:"-"` // Original is the provided parent network/prefix. Original *netip.Prefix `json:"orig" xml:"orig,attr,omitempty" yaml:"Original/Parent network"` // HostAddr is nil if Original falls on a network prefix boundary, otherwise it is the specified host address. HostAddr *netip.Addr `json:"host" xml:"host,attr,omitempty" yaml:"Host Address,omitempty"` // Canonical is the canonical network of Original (e.g. with host bits masked out). It is nil if Original.Addr() falls on the (lower) boundary. Canonical *netip.Prefix `json:"masked" xml:"masked,attr,omitempty" yaml:"Bound Original/Parent network"` // Splitter contains the spplitter and its options used to split the network. Splitter *SplitOpts `json:"splitter" xml:"splitter,omitempty" yaml:"Splitter,omitempty"` // Allocated contains valid subnet(s) in Original per the user-specified subnetting rules. Allocated []*ContainedResult `json:"subnets" xml:"subnets>subnet,omitempty" yaml:"Subnets"` // Unallocated contains subnets from Original that did not meet the splitting criteria or were left over from the split operation. Unallocated []*ContainedResult `json:"remaining" xml:"remaining>subnet,omitempty" yaml:"Remaining/Unallocated/Left Over,omitempty"` // Reservations contains any reserved addresses/prefixes within this set that are considered "special usage" and thus are likely to not be usable. Reservations []*IANAAddrNetResRecord `json:"reserved,omitempty" xml:"reserved>reservation,omitempty" yaml:"Matching Reserved Subnets,omitempty"` }
StructuredResults is used for serializing prefixes into a structured/defined data format.
func Contain ¶
func Contain(origPfx *netip.Prefix, nets []*netip.Prefix, remaining *netipx.IPSet, splitter NetSplitter) (s *StructuredResults, err error)
Contain takes the results of a NetSplitter and returns a StructuredResults. The reservations are only checked against nets.
func Parse ¶
func Parse(b []byte) (s *StructuredResults, err error)
Parse parses b for JSON/XML/YAML and tries to return a StructuredResults from it.
func (*StructuredResults) GetSplitter ¶
func (s *StructuredResults) GetSplitter() (splitter NetSplitter)
GetSplitter returns the first (should be *only*) non-nill NetSplitter on a StructuredResults.
If none is found, splitter will be nil but no panic/error will occur.
func (*StructuredResults) Uncontain ¶
func (s *StructuredResults) Uncontain() (origPfx *netip.Prefix, nets []*netip.Prefix, remaining *netipx.IPSet, splitter NetSplitter, err error)
Uncontain returns a set of values that "unstructure" a StructuredResults.
(Essentially the opposite procedure of Contain().)
type SubnetSplitter ¶
type SubnetSplitter struct { // NumberSubnets indicates the number of subnets to split the network into. NumberSubnets uint `json:"nets" xml:"nets,attr" yaml:"Number of Target Subnets" validate:"required"` // Strict, if true, will return an error from Split if the network sizes cannot split into equally-sized networks. Strict bool `json:"strict" xml:"strict,attr,omitempty" yaml:"Strictly Equal Subnet Sizes"` *BaseSplitter `json:"net" xml:"net,omitempty" yaml:"network,omitempty"` }
SubnetSplitter is used to split a network into a specific number of subnets of equal prefix lengths as cleanly as poossible.
func (*SubnetSplitter) Split ¶
Split splits the network defined in a SubnetSplitter alongside its configuration and performs the subnetting. This strategy allows for splitting a network into exactly evenly sized specified number of subnets.
remaining may or may not be nil depending on if the specified number of subnets fit cleanly into the network boundaries.
An ErrNoNetSpace error will be returned if subnetting size exhaustion occurs before the specified number of subnets is reached (but nets will be populated and remaining will contain any left over subnets).
type VLSMSplitter ¶
type VLSMSplitter struct { /* Ascending, if true, will subnet smaller networks/larger prefixes near the beginning (ascending order) instead of larger networks/smaller prefixes (descending order). You almost assuredly do not want to do this. */ Ascending bool `json:"asc,omitempty" xml:"asc,attr,omitempty" yaml:"Ascending Order,omitempty"` /* Explicit, if true, will ignore Ascending completely and split in the explicit order of PrefixLengths. This has the potential to be *extremely* wasteful of addressing space as the resulting blocks are VERY unoptimized. */ Explicit bool `json:"explicit,omitempty" xml:"explicit,attr,omitempty" yaml:"Explicit Ordering,omitempty"` // PrefixLengths contains the prefix lengths of each subnet to split out from the network. PrefixLengths []uint8 `json:"prefixes" xml:"prefixes>prefix" yaml:"Prefix Lengths" validate:"required,dive,lte=128"` *BaseSplitter `json:"net" xml:"net,omitempty" yaml:"network,omitempty"` }
VLSMSplitter is used to split a network via VLSM (Variable-Length Subnet Masks) into multiple PrefixLengths, in which there are multiple desired subnets of varying lengths.
func (*VLSMSplitter) Split ¶
Split splits the network defined in a VLSMSplitter alongside its configuration and performs the subnetting. This strategy allows for multiple subnets of differing sizes to be specified.
remaining may or may not be nil depending on if all desired subnet sizes fit cleanly into the network boundaries.
Source Files
¶
- conts.go
- errs.go
- funcs.go
- funcs_basesplitter.go
- funcs_cache.go
- funcs_cidrsplitter.go
- funcs_hostsplitter.go
- funcs_ianabool.go
- funcs_ianadate.go
- funcs_ianaprefix.go
- funcs_ianaregistryfootnote.go
- funcs_ianastring.go
- funcs_prefixgetter.go
- funcs_spliterr.go
- funcs_structuredresults.go
- funcs_subnetsplitter.go
- funcs_vlsmsplitter.go
- types.go