func (s SubnetInfos) GetByUnderlayCIDR(cidr string) (SubnetInfos, error) {
	if !IsValidCIDR(cidr) {
		return nil, errors.NotValidf("CIDR %q", cidr)
	}

	var overlays SubnetInfos
	for _, sub := range s {
		if sub.FanLocalUnderlay() == cidr {
			overlays = append(overlays, sub)
		}
	}
	return overlays, nil
}
// GetByUnderlayCIDR returns any subnets in this collection that are fan
// overlays for the input CIDR.
// An error is returned if the input is not a valid CIDR.
// TODO (manadart 2020-04-15): Consider storing subnet IDs in FanInfo,
// so we can ensure uniqueness in multi-network deployments.
GetByUnderlayCIDR returns any subnets in this collection that are fan
overlays for the input CIDR.
An error is returned if the input is not a valid CIDR.
TODO (manadart 2020-04-15): Consider storing subnet IDs in FanInfo,
so we can ensure uniqueness in multi-network deployments.
// GetByUnderlayCIDR returns any subnets in this collection that are fan // overlays for the input CIDR . // An error is returned if the input is not a valid CIDR . // TODO ( manadart 2020 - 04 - 15 ) : Consider storing subnet IDs in FanInfo // so we can ensure uniqueness in multi - network deployments .
func (s SubnetInfos) GetByUnderlayCIDR(cidr string) (SubnetInfos, error) {
	if !IsValidCIDR(cidr) {
		return nil, errors.NotValidf("CIDR %q", cidr)
	}
	var overlays SubnetInfos
	for _, sub := range s {
		if sub.FanLocalUnderlay() == cidr {
			overlays = append(overlays, sub)
		}
	}
	return overlays, nil
}
func ( s SubnetInfos ) GetByUnderlayCIDR ( cidr string ) ( SubnetInfos , error ) { if ! IsValidCIDR ( cidr ) { return nil , errors . NotValidf ( " " , cidr ) } var overlays SubnetInfos for _ , sub := range s { if sub . FanLocalUnderlay ( ) == cidr { overlays = append ( overlays , sub ) } } return overlays , nil }
GetByUnderlayCIDR returns any subnets in this collection that are fan
overlays for the input CIDR.
GetByUnderlayCIDR returns any subnets in this collection that are fan overlays for the input CIDR .