code: func validateVLANs(c *validation.Context, cfg *configPB.VLANs) {
  	// VLAN IDs must be unique.
  	// Keep records of ones we've already seen.
  	vlans := make(map[int64]struct{}, len(cfg.Vlan))
  	for _, vlan := range cfg.Vlan {
  		switch _, ok := vlans[vlan.Id]; {
  		case vlan.Id < 1:
  			c.Errorf("VLAN ID %d must be positive", vlan.Id)
  		case vlan.Id > vlanMaxId:
  			c.Errorf("VLAN ID %d must not exceed %d", vlan.Id, vlanMaxId)
  		case ok:
  			c.Errorf("duplicate VLAN %d", vlan.Id)
  		}
  		vlans[vlan.Id] = struct{}{}
  		c.Enter("VLAN %d", vlan.Id)
  		_, subnet, err := net.ParseCIDR(vlan.CidrBlock)
  		if err != nil {
  			c.Errorf("invalid CIDR block")
  		} else {
  			ones, _ := subnet.Mask.Size()
  			if ones < vlanMinCIDRBlockSuffix {
  				c.Errorf("CIDR block suffix must be at least %d", vlanMinCIDRBlockSuffix)
  			}
  		}
  		c.Exit()
  		// TODO(smut): Check that CIDR blocks are disjoint.
  	}
  }
docs: // validateVLANs validates vlans.cfg.