func (s *SubnetInfo) Validate() error {
	if s.CIDR == "" {
		return errors.Errorf("missing CIDR")
	} else if _, err := s.ParsedCIDRNetwork(); err != nil {
		return errors.Trace(err)
	}

	if s.VLANTag < 0 || s.VLANTag > 4094 {
		return errors.Errorf("invalid VLAN tag %d: must be between 0 and 4094", s.VLANTag)
	}

	return nil
}
// Validate validates the subnet, checking the CIDR, and VLANTag, if present.
Validate validates the subnet, checking the CIDR, and VLANTag, if present.
// Validate validates the subnet checking the CIDR and VLANTag if present .
func (s *SubnetInfo) Validate() error {
	if s.CIDR == "" {
		return errors.Errorf("missing CIDR")
	} else if _, err := s.ParsedCIDRNetwork(); err != nil {
		return errors.Trace(err)
	}
	if s.VLANTag < 0 || s.VLANTag > 4094 {
		return errors.Errorf("invalid VLAN tag %d: must be between 0 and 4094", s.VLANTag)
	}
	return nil
}
func ( s * SubnetInfo ) Validate ( ) error { if s . CIDR == " " { return errors . Errorf ( " " ) } else if _ , err := s . ParsedCIDRNetwork ( ) ; err != nil { return errors . Trace ( err ) } if s . VLANTag < 0 || s . VLANTag > 4094 { return errors . Errorf ( " " , s . VLANTag ) } return nil }
Validate validates the subnet, checking the CIDR, and VLANTag, if present.
Validate validates the subnet checking the CIDR and VLANTag if present .