2008-08-06 18:36:30 +00:00
|
|
|
// This file is part of BOINC.
|
2018-08-11 11:19:02 +00:00
|
|
|
// https://boinc.berkeley.edu
|
2022-07-03 19:33:47 +00:00
|
|
|
// Copyright (C) 2022 University of California
|
2004-11-14 08:29:32 +00:00
|
|
|
//
|
2008-08-06 18:36:30 +00:00
|
|
|
// BOINC is free software; you can redistribute it and/or modify it
|
|
|
|
// under the terms of the GNU Lesser General Public License
|
|
|
|
// as published by the Free Software Foundation,
|
|
|
|
// either version 3 of the License, or (at your option) any later version.
|
2004-06-01 17:02:14 +00:00
|
|
|
//
|
2008-08-06 18:36:30 +00:00
|
|
|
// BOINC is distributed in the hope that it will be useful,
|
2005-01-20 23:22:22 +00:00
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
// See the GNU Lesser General Public License for more details.
|
|
|
|
//
|
2008-08-06 18:36:30 +00:00
|
|
|
// You should have received a copy of the GNU Lesser General Public License
|
2018-08-11 11:19:02 +00:00
|
|
|
// along with BOINC. If not, see <https://www.gnu.org/licenses/>.
|
2004-06-01 17:02:14 +00:00
|
|
|
|
2004-09-30 21:55:19 +00:00
|
|
|
// a C++ interface to BOINC GUI RPC
|
|
|
|
|
2017-04-08 06:54:49 +00:00
|
|
|
#ifndef BOINC_GUI_RPC_CLIENT_H
|
|
|
|
#define BOINC_GUI_RPC_CLIENT_H
|
2011-09-27 19:45:27 +00:00
|
|
|
|
2018-03-22 15:45:48 +00:00
|
|
|
#ifdef _WIN32
|
|
|
|
#include "boinc_win.h"
|
|
|
|
#endif
|
|
|
|
|
2005-12-16 03:35:15 +00:00
|
|
|
#if !defined(_WIN32) || defined (__CYGWIN__)
|
2009-02-26 00:23:23 +00:00
|
|
|
#include <cstdio>
|
2004-01-23 21:57:47 +00:00
|
|
|
#include <string>
|
|
|
|
#include <vector>
|
2005-04-09 00:39:31 +00:00
|
|
|
#include <sys/socket.h>
|
2012-05-09 16:11:50 +00:00
|
|
|
#include <sys/param.h>
|
2005-04-09 00:39:31 +00:00
|
|
|
#include <netinet/in.h>
|
|
|
|
#include <netinet/tcp.h>
|
|
|
|
#include <arpa/inet.h>
|
|
|
|
#include <netdb.h>
|
2004-06-10 07:49:50 +00:00
|
|
|
#endif
|
2004-01-23 21:57:47 +00:00
|
|
|
|
2018-03-22 15:45:48 +00:00
|
|
|
#include <locale.h>
|
|
|
|
|
2013-02-15 12:30:54 +00:00
|
|
|
#include <deque>
|
|
|
|
|
2012-11-01 17:05:05 +00:00
|
|
|
#include "cc_config.h"
|
2006-12-11 23:42:54 +00:00
|
|
|
#include "common_defs.h"
|
2012-11-01 17:05:05 +00:00
|
|
|
#include "filesys.h"
|
|
|
|
#include "hostinfo.h"
|
2017-07-30 20:12:16 +00:00
|
|
|
#include "keyword.h"
|
2012-11-01 17:05:05 +00:00
|
|
|
#include "miofile.h"
|
2010-09-15 20:33:44 +00:00
|
|
|
#include "network.h"
|
2012-11-01 17:05:05 +00:00
|
|
|
#include "notice.h"
|
|
|
|
#include "prefs.h"
|
2004-06-12 04:45:36 +00:00
|
|
|
|
2004-09-27 23:35:21 +00:00
|
|
|
struct GUI_URL {
|
|
|
|
std::string name;
|
|
|
|
std::string description;
|
|
|
|
std::string url;
|
|
|
|
|
2011-08-09 21:44:14 +00:00
|
|
|
int parse(XML_PARSER&);
|
2004-09-27 23:35:21 +00:00
|
|
|
void print();
|
|
|
|
};
|
|
|
|
|
2005-04-04 06:02:36 +00:00
|
|
|
// statistics at a specific day
|
|
|
|
//
|
2005-08-11 04:45:16 +00:00
|
|
|
struct DAILY_STATS {
|
2005-04-04 06:02:36 +00:00
|
|
|
double user_total_credit;
|
|
|
|
double user_expavg_credit;
|
|
|
|
double host_total_credit;
|
|
|
|
double host_expavg_credit;
|
|
|
|
double day;
|
2005-08-11 04:45:16 +00:00
|
|
|
|
2011-08-09 21:44:14 +00:00
|
|
|
int parse(XML_PARSER&);
|
2005-04-04 06:02:36 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2012-02-08 01:39:01 +00:00
|
|
|
struct PROJECT_LIST_ENTRY {
|
2007-03-06 00:35:04 +00:00
|
|
|
std::string name;
|
|
|
|
std::string url;
|
2018-08-10 12:35:37 +00:00
|
|
|
std::string web_url;
|
2007-03-06 00:35:04 +00:00
|
|
|
std::string general_area;
|
|
|
|
std::string specific_area;
|
|
|
|
std::string description;
|
2009-01-15 21:46:47 +00:00
|
|
|
std::string home; // sponsoring organization
|
|
|
|
std::string image; // URL of logo
|
2009-01-13 19:34:04 +00:00
|
|
|
std::vector<std::string> platforms;
|
|
|
|
// platforms supported by project, or empty
|
2007-03-06 00:35:04 +00:00
|
|
|
|
2007-03-13 19:33:27 +00:00
|
|
|
PROJECT_LIST_ENTRY();
|
2007-03-06 00:35:04 +00:00
|
|
|
|
2007-03-06 05:36:54 +00:00
|
|
|
int parse(XML_PARSER&);
|
2007-03-06 00:35:04 +00:00
|
|
|
void clear();
|
2007-03-20 19:04:27 +00:00
|
|
|
};
|
2007-03-06 00:35:04 +00:00
|
|
|
|
2012-02-08 01:39:01 +00:00
|
|
|
struct AM_LIST_ENTRY {
|
2009-01-28 23:45:36 +00:00
|
|
|
std::string name;
|
|
|
|
std::string url;
|
|
|
|
std::string description;
|
|
|
|
std::string image;
|
2009-06-30 18:54:52 +00:00
|
|
|
|
2009-06-30 19:55:28 +00:00
|
|
|
AM_LIST_ENTRY();
|
2009-06-30 18:54:52 +00:00
|
|
|
|
2009-01-28 23:45:36 +00:00
|
|
|
int parse(XML_PARSER&);
|
2009-06-30 19:55:28 +00:00
|
|
|
void clear();
|
2009-01-28 23:45:36 +00:00
|
|
|
};
|
|
|
|
|
2012-02-08 01:39:01 +00:00
|
|
|
struct ALL_PROJECTS_LIST {
|
2009-06-30 19:55:28 +00:00
|
|
|
std::vector<PROJECT_LIST_ENTRY*> projects;
|
|
|
|
std::vector<AM_LIST_ENTRY*> account_managers;
|
|
|
|
|
|
|
|
ALL_PROJECTS_LIST();
|
|
|
|
|
|
|
|
void clear();
|
2013-01-18 04:01:38 +00:00
|
|
|
void alpha_sort();
|
2009-06-30 19:55:28 +00:00
|
|
|
};
|
|
|
|
|
2012-02-08 01:39:01 +00:00
|
|
|
struct RSC_DESC {
|
|
|
|
double backoff_time;
|
|
|
|
double backoff_interval;
|
|
|
|
bool no_rsc_ams;
|
|
|
|
bool no_rsc_apps;
|
|
|
|
bool no_rsc_pref;
|
2012-03-04 04:58:41 +00:00
|
|
|
bool no_rsc_config;
|
2012-02-08 01:39:01 +00:00
|
|
|
|
|
|
|
void clear();
|
|
|
|
};
|
|
|
|
|
|
|
|
struct PROJECT {
|
2010-03-12 17:47:17 +00:00
|
|
|
char master_url[256];
|
2004-01-23 21:57:47 +00:00
|
|
|
double resource_share;
|
2004-07-01 17:37:26 +00:00
|
|
|
std::string project_name;
|
|
|
|
std::string user_name;
|
|
|
|
std::string team_name;
|
2009-06-08 17:08:52 +00:00
|
|
|
int hostid;
|
2004-09-27 23:35:21 +00:00
|
|
|
std::vector<GUI_URL> gui_urls;
|
2013-04-18 19:43:17 +00:00
|
|
|
std::string project_dir;
|
2004-01-23 21:57:47 +00:00
|
|
|
double user_total_credit;
|
|
|
|
double user_expavg_credit;
|
|
|
|
double host_total_credit; // as reported by server
|
|
|
|
double host_expavg_credit; // as reported by server
|
2004-10-22 22:37:11 +00:00
|
|
|
double disk_usage;
|
2004-01-23 21:57:47 +00:00
|
|
|
int nrpc_failures; // # of consecutive times we've failed to
|
|
|
|
// contact all scheduling servers
|
|
|
|
int master_fetch_failures;
|
2004-11-15 19:23:58 +00:00
|
|
|
double min_rpc_time; // earliest time to contact any server
|
2009-07-16 18:36:23 +00:00
|
|
|
double download_backoff;
|
|
|
|
double upload_backoff;
|
|
|
|
|
2012-02-08 01:39:01 +00:00
|
|
|
RSC_DESC rsc_desc_cpu;
|
|
|
|
RSC_DESC rsc_desc_nvidia;
|
|
|
|
RSC_DESC rsc_desc_ati;
|
2012-12-05 13:11:20 +00:00
|
|
|
RSC_DESC rsc_desc_intel_gpu;
|
2012-02-08 01:39:01 +00:00
|
|
|
|
2011-07-11 04:57:56 +00:00
|
|
|
double sched_priority;
|
|
|
|
|
2007-03-05 00:32:26 +00:00
|
|
|
double duration_correction_factor;
|
2004-01-23 21:57:47 +00:00
|
|
|
|
2010-03-29 22:33:08 +00:00
|
|
|
bool anonymous_platform;
|
2004-01-23 21:57:47 +00:00
|
|
|
bool master_url_fetch_pending; // need to fetch and parse the master URL
|
2007-05-11 18:27:16 +00:00
|
|
|
int sched_rpc_pending; // need to contact scheduling server
|
2010-05-07 20:41:43 +00:00
|
|
|
// encodes the reason for the request
|
2005-01-25 19:21:35 +00:00
|
|
|
bool non_cpu_intensive;
|
2004-09-27 23:35:21 +00:00
|
|
|
bool suspended_via_gui;
|
2005-04-04 06:02:36 +00:00
|
|
|
bool dont_request_more_work;
|
2006-01-16 05:24:39 +00:00
|
|
|
bool scheduler_rpc_in_progress;
|
2006-01-25 21:25:33 +00:00
|
|
|
bool attached_via_acct_mgr;
|
2007-03-05 00:32:26 +00:00
|
|
|
bool detach_when_done;
|
2007-05-24 16:07:21 +00:00
|
|
|
bool ended;
|
2010-05-07 20:41:43 +00:00
|
|
|
bool trickle_up_pending;
|
2006-10-12 19:43:55 +00:00
|
|
|
double project_files_downloaded_time;
|
|
|
|
// when the last project file download was finished
|
|
|
|
// (i.e. the time when ALL project files were finished downloading)
|
|
|
|
double last_rpc_time;
|
|
|
|
// when the last successful scheduler RPC finished
|
|
|
|
std::vector<DAILY_STATS> statistics; // credit data over the last x days
|
2011-02-04 18:52:14 +00:00
|
|
|
char venue[256];
|
2014-06-04 06:37:14 +00:00
|
|
|
int njobs_success;
|
|
|
|
int njobs_error;
|
2014-09-12 20:53:21 +00:00
|
|
|
double elapsed_time;
|
2014-08-08 19:58:08 +00:00
|
|
|
char external_cpid[64];
|
2004-01-23 21:57:47 +00:00
|
|
|
|
2006-10-12 19:43:55 +00:00
|
|
|
// NOTE: if you add any data items above,
|
2009-01-28 23:45:36 +00:00
|
|
|
// update parse(), and clear() to include them!!
|
2006-01-18 21:07:04 +00:00
|
|
|
|
2004-09-14 15:52:06 +00:00
|
|
|
PROJECT();
|
|
|
|
|
2011-08-09 21:44:14 +00:00
|
|
|
int parse(XML_PARSER&);
|
2004-01-23 21:57:47 +00:00
|
|
|
void print();
|
2009-12-12 05:11:50 +00:00
|
|
|
void print_disk_usage();
|
2004-09-14 15:52:06 +00:00
|
|
|
void clear();
|
2005-04-27 06:55:28 +00:00
|
|
|
void get_name(std::string&);
|
|
|
|
|
2006-10-12 19:43:55 +00:00
|
|
|
// temp - keep track of whether or not this record needs to be deleted
|
2006-02-24 03:02:57 +00:00
|
|
|
bool flag_for_delete;
|
2004-01-23 21:57:47 +00:00
|
|
|
};
|
|
|
|
|
2012-02-08 01:39:01 +00:00
|
|
|
struct APP {
|
2010-03-13 04:40:37 +00:00
|
|
|
char name[256];
|
|
|
|
char user_friendly_name[256];
|
2004-01-23 21:57:47 +00:00
|
|
|
PROJECT* project;
|
|
|
|
|
2004-09-14 15:52:06 +00:00
|
|
|
APP();
|
|
|
|
|
2011-08-09 21:44:14 +00:00
|
|
|
int parse(XML_PARSER&);
|
2004-01-23 21:57:47 +00:00
|
|
|
void print();
|
2004-09-14 15:52:06 +00:00
|
|
|
void clear();
|
2004-01-23 21:57:47 +00:00
|
|
|
};
|
|
|
|
|
2012-02-08 01:39:01 +00:00
|
|
|
struct APP_VERSION {
|
2010-03-13 04:40:37 +00:00
|
|
|
char app_name[256];
|
2004-01-23 21:57:47 +00:00
|
|
|
int version_num;
|
2010-11-04 21:32:05 +00:00
|
|
|
char platform[64];
|
2010-03-13 04:40:37 +00:00
|
|
|
char plan_class[64];
|
2010-11-04 21:32:05 +00:00
|
|
|
double avg_ncpus;
|
2012-09-20 06:09:02 +00:00
|
|
|
int gpu_type;
|
|
|
|
// PROC_TYPE_xx
|
|
|
|
double gpu_usage;
|
2010-11-04 21:32:05 +00:00
|
|
|
double natis;
|
|
|
|
double gpu_ram;
|
|
|
|
double flops;
|
2015-07-24 00:34:12 +00:00
|
|
|
char exec_filename[256];
|
2004-01-23 21:57:47 +00:00
|
|
|
APP* app;
|
|
|
|
PROJECT* project;
|
|
|
|
|
2004-09-14 15:52:06 +00:00
|
|
|
APP_VERSION();
|
|
|
|
|
2011-08-09 21:44:14 +00:00
|
|
|
int parse(XML_PARSER&);
|
2011-12-28 14:52:03 +00:00
|
|
|
int parse_coproc(XML_PARSER&);
|
2015-07-24 00:34:12 +00:00
|
|
|
int parse_file_ref(XML_PARSER&);
|
2004-01-23 21:57:47 +00:00
|
|
|
void print();
|
2004-09-14 15:52:06 +00:00
|
|
|
void clear();
|
2004-01-23 21:57:47 +00:00
|
|
|
};
|
|
|
|
|
2012-02-08 01:39:01 +00:00
|
|
|
struct WORKUNIT {
|
2010-03-13 04:40:37 +00:00
|
|
|
char name[256];
|
|
|
|
char app_name[256];
|
2009-01-13 22:46:58 +00:00
|
|
|
int version_num; // backwards compat
|
2004-01-23 21:57:47 +00:00
|
|
|
double rsc_fpops_est;
|
|
|
|
double rsc_fpops_bound;
|
|
|
|
double rsc_memory_bound;
|
|
|
|
double rsc_disk_bound;
|
|
|
|
PROJECT* project;
|
|
|
|
APP* app;
|
2017-07-30 20:12:16 +00:00
|
|
|
JOB_KEYWORDS job_keywords;
|
2004-01-23 21:57:47 +00:00
|
|
|
|
2004-09-14 15:52:06 +00:00
|
|
|
WORKUNIT();
|
|
|
|
|
2011-08-09 21:44:14 +00:00
|
|
|
int parse(XML_PARSER&);
|
2004-01-23 21:57:47 +00:00
|
|
|
void print();
|
2004-09-14 15:52:06 +00:00
|
|
|
void clear();
|
2004-01-23 21:57:47 +00:00
|
|
|
};
|
|
|
|
|
2012-02-08 01:39:01 +00:00
|
|
|
struct RESULT {
|
2010-03-12 17:47:17 +00:00
|
|
|
char name[256];
|
|
|
|
char wu_name[256];
|
|
|
|
char project_url[256];
|
2015-12-01 22:00:03 +00:00
|
|
|
char platform[256];
|
2009-01-13 19:34:04 +00:00
|
|
|
int version_num;
|
2010-03-12 17:47:17 +00:00
|
|
|
char plan_class[64];
|
2009-06-30 20:22:54 +00:00
|
|
|
double report_deadline;
|
|
|
|
double received_time;
|
2004-01-23 21:57:47 +00:00
|
|
|
bool ready_to_report;
|
|
|
|
bool got_server_ack;
|
|
|
|
double final_cpu_time;
|
2009-03-11 22:01:38 +00:00
|
|
|
double final_elapsed_time;
|
2004-01-23 21:57:47 +00:00
|
|
|
int state;
|
2004-10-19 18:14:40 +00:00
|
|
|
int scheduler_state;
|
2004-01-23 21:57:47 +00:00
|
|
|
int exit_status;
|
|
|
|
int signal;
|
2010-03-12 17:47:17 +00:00
|
|
|
//std::string stderr_out;
|
2005-01-22 00:24:34 +00:00
|
|
|
bool suspended_via_gui;
|
2006-04-17 22:49:34 +00:00
|
|
|
bool project_suspended_via_gui;
|
2009-10-12 16:28:17 +00:00
|
|
|
bool coproc_missing;
|
2011-09-13 05:54:55 +00:00
|
|
|
bool scheduler_wait;
|
2012-02-22 22:56:05 +00:00
|
|
|
char scheduler_wait_reason[256];
|
2011-12-26 03:30:32 +00:00
|
|
|
bool network_wait;
|
2005-01-22 00:24:34 +00:00
|
|
|
|
2004-07-19 19:40:06 +00:00
|
|
|
// the following defined if active
|
2004-10-20 23:38:56 +00:00
|
|
|
bool active_task;
|
2004-10-26 20:53:24 +00:00
|
|
|
int active_task_state;
|
2004-01-31 23:21:07 +00:00
|
|
|
int app_version_num;
|
2009-04-10 19:18:44 +00:00
|
|
|
int slot;
|
2009-12-21 17:25:43 +00:00
|
|
|
int pid;
|
2004-01-31 23:21:07 +00:00
|
|
|
double checkpoint_cpu_time;
|
|
|
|
double current_cpu_time;
|
|
|
|
double fraction_done;
|
2008-12-03 17:50:44 +00:00
|
|
|
double elapsed_time;
|
2015-06-22 07:09:15 +00:00
|
|
|
double progress_rate;
|
|
|
|
// avg increase in fraction done per second
|
2006-10-03 22:50:13 +00:00
|
|
|
double swap_size;
|
|
|
|
double working_set_size_smoothed;
|
2004-10-20 21:50:28 +00:00
|
|
|
double estimated_cpu_time_remaining;
|
2009-03-11 22:01:38 +00:00
|
|
|
// actually, estimated elapsed time remaining
|
2014-04-30 07:21:29 +00:00
|
|
|
double bytes_sent;
|
|
|
|
double bytes_received;
|
2006-10-03 22:50:13 +00:00
|
|
|
bool too_large;
|
2007-06-25 11:46:15 +00:00
|
|
|
bool needs_shmem;
|
2007-03-05 00:32:26 +00:00
|
|
|
bool edf_scheduled;
|
2012-05-09 16:11:50 +00:00
|
|
|
char graphics_exec_path[MAXPATHLEN];
|
2011-12-26 03:30:32 +00:00
|
|
|
char web_graphics_url[256];
|
2012-01-13 19:00:16 +00:00
|
|
|
char remote_desktop_addr[256];
|
2012-05-09 16:11:50 +00:00
|
|
|
char slot_path[MAXPATHLEN];
|
2009-04-10 19:18:44 +00:00
|
|
|
// only present if graphics_exec_path is
|
2010-03-12 17:47:17 +00:00
|
|
|
char resources[256];
|
2004-07-14 00:53:12 +00:00
|
|
|
|
|
|
|
APP* app;
|
|
|
|
WORKUNIT* wup;
|
2004-01-31 23:21:07 +00:00
|
|
|
PROJECT* project;
|
2009-01-13 19:34:04 +00:00
|
|
|
APP_VERSION* avp;
|
2004-01-31 23:21:07 +00:00
|
|
|
|
2004-09-14 15:52:06 +00:00
|
|
|
RESULT();
|
|
|
|
|
2011-08-09 21:44:14 +00:00
|
|
|
int parse(XML_PARSER&);
|
2004-01-31 23:21:07 +00:00
|
|
|
void print();
|
2004-09-14 15:52:06 +00:00
|
|
|
void clear();
|
2004-01-31 23:21:07 +00:00
|
|
|
};
|
|
|
|
|
2012-02-08 01:39:01 +00:00
|
|
|
struct FILE_TRANSFER {
|
2004-09-14 15:52:06 +00:00
|
|
|
std::string name;
|
2004-10-19 21:48:17 +00:00
|
|
|
std::string project_url;
|
2004-10-22 20:11:38 +00:00
|
|
|
std::string project_name;
|
2012-01-26 08:39:51 +00:00
|
|
|
double nbytes; // total # of bytes to be transferred
|
2004-09-14 15:52:06 +00:00
|
|
|
bool uploaded;
|
2011-07-20 19:12:10 +00:00
|
|
|
bool is_upload;
|
|
|
|
bool generated_locally; // deprecated; for compatibility w/ old clients
|
2004-09-14 15:52:06 +00:00
|
|
|
bool sticky;
|
|
|
|
bool pers_xfer_active;
|
|
|
|
bool xfer_active;
|
|
|
|
int num_retries;
|
2012-01-23 05:03:52 +00:00
|
|
|
double first_request_time;
|
|
|
|
double next_request_time;
|
2004-10-22 18:39:21 +00:00
|
|
|
int status;
|
|
|
|
double time_so_far;
|
2022-07-03 19:33:47 +00:00
|
|
|
double estimated_xfer_time_remaining;
|
2004-09-14 15:52:06 +00:00
|
|
|
double bytes_xferred;
|
|
|
|
double file_offset;
|
|
|
|
double xfer_speed;
|
|
|
|
std::string hostname;
|
2009-07-31 19:46:47 +00:00
|
|
|
double project_backoff;
|
2004-09-14 15:52:06 +00:00
|
|
|
PROJECT* project;
|
|
|
|
|
|
|
|
FILE_TRANSFER();
|
|
|
|
|
2011-08-09 21:44:14 +00:00
|
|
|
int parse(XML_PARSER&);
|
2004-09-14 15:52:06 +00:00
|
|
|
void print();
|
|
|
|
void clear();
|
2004-04-02 00:19:22 +00:00
|
|
|
};
|
|
|
|
|
2012-02-08 01:39:01 +00:00
|
|
|
struct MESSAGE {
|
2004-07-01 17:37:26 +00:00
|
|
|
std::string project;
|
2004-04-02 00:19:22 +00:00
|
|
|
int priority;
|
2004-09-28 22:48:42 +00:00
|
|
|
int seqno;
|
2004-04-02 00:19:22 +00:00
|
|
|
int timestamp;
|
2004-07-01 17:37:26 +00:00
|
|
|
std::string body;
|
2004-09-14 15:52:06 +00:00
|
|
|
|
|
|
|
MESSAGE();
|
|
|
|
|
2011-08-09 21:44:14 +00:00
|
|
|
int parse(XML_PARSER&);
|
2004-09-14 15:52:06 +00:00
|
|
|
void print();
|
|
|
|
void clear();
|
2004-04-02 00:19:22 +00:00
|
|
|
};
|
|
|
|
|
2012-02-20 21:32:26 +00:00
|
|
|
// should match up with PROXY_INFO in proxy_info.h
|
|
|
|
//
|
2012-02-08 01:39:01 +00:00
|
|
|
struct GR_PROXY_INFO {
|
2004-09-14 15:52:06 +00:00
|
|
|
bool use_http_proxy;
|
2004-09-25 19:33:30 +00:00
|
|
|
bool use_http_authentication;
|
2004-09-14 15:52:06 +00:00
|
|
|
std::string http_server_name;
|
|
|
|
int http_server_port;
|
|
|
|
std::string http_user_name;
|
|
|
|
std::string http_user_passwd;
|
2012-02-20 21:32:26 +00:00
|
|
|
|
|
|
|
bool use_socks_proxy;
|
|
|
|
std::string socks_server_name;
|
|
|
|
int socks_server_port;
|
2004-09-14 15:52:06 +00:00
|
|
|
std::string socks5_user_name;
|
|
|
|
std::string socks5_user_passwd;
|
2017-01-06 05:34:34 +00:00
|
|
|
bool socks5_remote_dns;
|
2012-02-20 21:32:26 +00:00
|
|
|
|
2008-09-25 15:44:45 +00:00
|
|
|
std::string noproxy_hosts;
|
2004-09-14 15:52:06 +00:00
|
|
|
|
2005-08-01 22:44:40 +00:00
|
|
|
GR_PROXY_INFO();
|
2004-09-14 15:52:06 +00:00
|
|
|
|
2011-08-09 21:44:14 +00:00
|
|
|
int parse(XML_PARSER&);
|
2004-09-14 15:52:06 +00:00
|
|
|
void print();
|
|
|
|
void clear();
|
|
|
|
};
|
|
|
|
|
2012-10-29 22:44:51 +00:00
|
|
|
// Represents the entire client state.
|
|
|
|
// Call get_state() infrequently.
|
|
|
|
//
|
2012-02-08 01:39:01 +00:00
|
|
|
struct CC_STATE {
|
2004-06-30 18:17:21 +00:00
|
|
|
std::vector<PROJECT*> projects;
|
|
|
|
std::vector<APP*> apps;
|
|
|
|
std::vector<APP_VERSION*> app_versions;
|
|
|
|
std::vector<WORKUNIT*> wus;
|
|
|
|
std::vector<RESULT*> results;
|
2009-01-13 19:34:04 +00:00
|
|
|
std::vector<std::string> platforms;
|
|
|
|
// platforms supported by client
|
2007-08-01 20:26:08 +00:00
|
|
|
GLOBAL_PREFS global_prefs; // working prefs, i.e. network + override
|
2012-10-29 22:44:51 +00:00
|
|
|
VERSION_INFO version_info; // populated only if talking to pre-5.6 client
|
2011-06-20 23:18:37 +00:00
|
|
|
bool executing_as_daemon; // true if client is running as a service / daemon
|
2010-05-18 20:32:17 +00:00
|
|
|
HOST_INFO host_info;
|
2012-10-29 22:44:51 +00:00
|
|
|
TIME_STATS time_stats;
|
|
|
|
bool have_nvidia; // deprecated; include for compat (set by <have_cuda/>)
|
|
|
|
bool have_ati; // deprecated; include for compat
|
2005-06-22 10:51:34 +00:00
|
|
|
|
2004-09-14 15:52:06 +00:00
|
|
|
CC_STATE();
|
|
|
|
|
2011-12-04 19:02:36 +00:00
|
|
|
PROJECT* lookup_project(const char* url);
|
|
|
|
APP* lookup_app(PROJECT*, const char* name);
|
2015-12-01 22:00:03 +00:00
|
|
|
APP_VERSION* lookup_app_version(PROJECT*, APP*,
|
|
|
|
char* platform, int vnum, char* plan_class
|
|
|
|
);
|
2016-03-24 20:45:32 +00:00
|
|
|
APP_VERSION* lookup_app_version(PROJECT*, APP*,
|
|
|
|
int vnum, char* plan_class
|
|
|
|
);
|
|
|
|
APP_VERSION* lookup_app_version(PROJECT*, APP*, int vnum);
|
2011-12-04 19:02:36 +00:00
|
|
|
WORKUNIT* lookup_wu(PROJECT*, const char* name);
|
|
|
|
RESULT* lookup_result(PROJECT*, const char* name);
|
|
|
|
RESULT* lookup_result(const char* url, const char* name);
|
2004-09-14 15:52:06 +00:00
|
|
|
|
2004-07-13 23:51:09 +00:00
|
|
|
void print();
|
2004-09-14 15:52:06 +00:00
|
|
|
void clear();
|
2011-08-09 21:44:14 +00:00
|
|
|
int parse(XML_PARSER&);
|
2013-01-19 19:16:44 +00:00
|
|
|
inline bool have_gpu() {
|
|
|
|
return !host_info.coprocs.none()
|
|
|
|
|| have_nvidia || have_ati // for old clients
|
|
|
|
;
|
|
|
|
}
|
2004-07-13 23:51:09 +00:00
|
|
|
};
|
2004-01-23 21:57:47 +00:00
|
|
|
|
2012-02-08 01:39:01 +00:00
|
|
|
struct PROJECTS {
|
2004-09-14 15:52:06 +00:00
|
|
|
std::vector<PROJECT*> projects;
|
|
|
|
|
2006-11-03 17:08:49 +00:00
|
|
|
PROJECTS(){}
|
2004-09-14 15:52:06 +00:00
|
|
|
|
|
|
|
void print();
|
2014-04-30 23:53:01 +00:00
|
|
|
void print_urls();
|
2004-09-14 15:52:06 +00:00
|
|
|
void clear();
|
|
|
|
};
|
|
|
|
|
2006-11-03 17:08:49 +00:00
|
|
|
struct DISK_USAGE {
|
|
|
|
std::vector<PROJECT*> projects;
|
|
|
|
double d_total;
|
|
|
|
double d_free;
|
2007-05-08 23:12:40 +00:00
|
|
|
double d_boinc; // amount used by BOINC itself, not projects
|
2008-05-13 19:52:35 +00:00
|
|
|
double d_allowed; // amount BOINC is allowed to use, total
|
2006-11-03 17:08:49 +00:00
|
|
|
|
2008-02-06 00:21:10 +00:00
|
|
|
DISK_USAGE(){clear();}
|
2006-11-03 17:08:49 +00:00
|
|
|
|
|
|
|
void print();
|
|
|
|
void clear();
|
|
|
|
};
|
|
|
|
|
2012-02-08 01:39:01 +00:00
|
|
|
struct RESULTS {
|
2004-07-13 23:51:09 +00:00
|
|
|
std::vector<RESULT*> results;
|
2004-09-14 15:52:06 +00:00
|
|
|
|
2006-11-03 17:08:49 +00:00
|
|
|
RESULTS(){}
|
2004-09-14 15:52:06 +00:00
|
|
|
|
2004-07-13 23:51:09 +00:00
|
|
|
void print();
|
2004-09-14 15:52:06 +00:00
|
|
|
void clear();
|
2004-07-13 23:51:09 +00:00
|
|
|
};
|
|
|
|
|
2012-02-08 01:39:01 +00:00
|
|
|
struct FILE_TRANSFERS {
|
2004-07-13 23:51:09 +00:00
|
|
|
std::vector<FILE_TRANSFER*> file_transfers;
|
2004-09-14 15:52:06 +00:00
|
|
|
|
|
|
|
FILE_TRANSFERS();
|
|
|
|
|
2004-07-13 23:51:09 +00:00
|
|
|
void print();
|
2004-09-14 15:52:06 +00:00
|
|
|
void clear();
|
|
|
|
};
|
|
|
|
|
2012-02-08 01:39:01 +00:00
|
|
|
struct MESSAGES {
|
2013-02-15 12:30:54 +00:00
|
|
|
std::deque<MESSAGE*> messages;
|
2004-09-14 15:52:06 +00:00
|
|
|
|
|
|
|
MESSAGES();
|
|
|
|
|
|
|
|
void print();
|
|
|
|
void clear();
|
2004-07-13 23:51:09 +00:00
|
|
|
};
|
|
|
|
|
2012-02-08 01:39:01 +00:00
|
|
|
struct NOTICES {
|
2010-06-29 21:40:12 +00:00
|
|
|
bool complete;
|
2012-12-20 12:13:46 +00:00
|
|
|
bool received;
|
2010-06-29 21:40:12 +00:00
|
|
|
// whether vector contains all notices, or just new ones
|
2010-01-04 17:43:18 +00:00
|
|
|
std::vector<NOTICE*> notices;
|
|
|
|
|
|
|
|
NOTICES();
|
|
|
|
|
|
|
|
void print();
|
|
|
|
void clear();
|
|
|
|
};
|
|
|
|
|
2005-06-21 08:22:18 +00:00
|
|
|
struct ACCT_MGR_INFO {
|
|
|
|
std::string acct_mgr_name;
|
|
|
|
std::string acct_mgr_url;
|
2005-09-27 23:55:20 +00:00
|
|
|
bool have_credentials;
|
|
|
|
|
2005-09-27 09:55:54 +00:00
|
|
|
ACCT_MGR_INFO();
|
|
|
|
|
2011-08-09 21:44:14 +00:00
|
|
|
int parse(XML_PARSER&);
|
2018-01-13 08:41:49 +00:00
|
|
|
void print();
|
2005-09-27 09:55:54 +00:00
|
|
|
void clear();
|
2005-06-21 08:22:18 +00:00
|
|
|
};
|
|
|
|
|
2005-09-28 05:47:14 +00:00
|
|
|
struct PROJECT_ATTACH_REPLY {
|
|
|
|
int error_num;
|
|
|
|
std::vector<std::string>messages;
|
|
|
|
|
2005-09-28 11:59:34 +00:00
|
|
|
PROJECT_ATTACH_REPLY();
|
|
|
|
|
2011-08-09 21:44:14 +00:00
|
|
|
int parse(XML_PARSER&);
|
2005-09-28 11:59:34 +00:00
|
|
|
void clear();
|
2005-09-28 05:47:14 +00:00
|
|
|
};
|
|
|
|
|
2005-09-15 00:16:55 +00:00
|
|
|
struct ACCT_MGR_RPC_REPLY {
|
|
|
|
int error_num;
|
2005-09-28 05:47:14 +00:00
|
|
|
std::vector<std::string>messages;
|
2005-09-15 00:16:55 +00:00
|
|
|
|
2005-09-27 09:55:54 +00:00
|
|
|
ACCT_MGR_RPC_REPLY();
|
|
|
|
|
2011-08-09 21:44:14 +00:00
|
|
|
int parse(XML_PARSER&);
|
2005-09-27 09:55:54 +00:00
|
|
|
void clear();
|
|
|
|
};
|
|
|
|
|
|
|
|
struct PROJECT_INIT_STATUS {
|
|
|
|
std::string url;
|
|
|
|
std::string name;
|
2010-03-30 17:46:09 +00:00
|
|
|
std::string team_name;
|
2005-09-27 09:55:54 +00:00
|
|
|
bool has_account_key;
|
2016-02-08 20:21:11 +00:00
|
|
|
bool embedded;
|
2005-09-27 09:55:54 +00:00
|
|
|
|
|
|
|
PROJECT_INIT_STATUS();
|
|
|
|
|
2011-08-09 21:44:14 +00:00
|
|
|
int parse(XML_PARSER&);
|
2005-09-27 09:55:54 +00:00
|
|
|
void clear();
|
2005-09-15 00:16:55 +00:00
|
|
|
};
|
|
|
|
|
2005-07-31 23:33:12 +00:00
|
|
|
struct PROJECT_CONFIG {
|
2005-08-06 19:20:26 +00:00
|
|
|
int error_num;
|
2005-07-31 23:33:12 +00:00
|
|
|
std::string name;
|
2009-02-14 00:43:27 +00:00
|
|
|
std::string master_url;
|
client/manager/server: use HTTPS for web RPCs if possible
The web RPCs done by the client during project attach
(lookup_account, create_account)
have an email address and password hash in their request.
Network sniffers could potentially see these,
so we should use HTTPS for these RPCs if possible.
However, not all BOINC projects have SSL-enabled web servers.
So I did the following:
- Change get_project_config.php to return an additional
<web_rpc_url_base> element.
This is SECURE_URL_BASE (if specified in the project's
project.inc config file) or, if not, the master URL.
- This new element is parsed into the PROJECT_CONFIG structure.
- In calls to create_account and lookup_account,
the Manager uses PROJECT_CONFIG::web_rpc_url_base
if it's available, else the master URL.
So, the new Manager/client uses HTTPS for RPCs to projects
that have updated their get_project_config.php,
and specify a SECURE_URL_BASE with https:// prefix.
Android note: I added code to parse the new config element,
but didn't change the higher-level code;
Joachim will need to do this.
2014-01-28 21:25:59 +00:00
|
|
|
std::string web_rpc_url_base;
|
|
|
|
// prefix for create_account, lookup_account web RPCs
|
|
|
|
// If absent, use the master URL
|
2009-02-14 00:43:27 +00:00
|
|
|
int local_revision; // SVN changeset# of server software
|
2005-07-31 23:33:12 +00:00
|
|
|
int min_passwd_length;
|
2005-09-14 17:10:13 +00:00
|
|
|
bool account_manager;
|
2009-01-15 21:46:47 +00:00
|
|
|
bool uses_username; // true for WCG
|
2005-08-06 19:20:26 +00:00
|
|
|
bool account_creation_disabled;
|
2009-01-15 21:46:47 +00:00
|
|
|
bool client_account_creation_disabled; // must create account on web
|
|
|
|
bool sched_stopped; // scheduler disabled
|
|
|
|
bool web_stopped; // DB-driven web functions disabled
|
2009-01-13 19:34:04 +00:00
|
|
|
int min_client_version;
|
2008-11-25 17:34:29 +00:00
|
|
|
std::string error_msg;
|
2018-06-04 22:26:42 +00:00
|
|
|
bool terms_of_use_is_html;
|
2008-11-24 21:23:53 +00:00
|
|
|
std::string terms_of_use;
|
|
|
|
// if present, show this text in an "accept terms of use?" dialog
|
|
|
|
// before allowing attachment to continue.
|
2009-01-13 19:34:04 +00:00
|
|
|
std::vector<std::string> platforms;
|
|
|
|
// platforms supported by project, or empty
|
2014-10-19 06:53:27 +00:00
|
|
|
bool ldap_auth;
|
|
|
|
// project supports LDAP authentication
|
2005-08-06 19:20:26 +00:00
|
|
|
|
2005-09-27 09:55:54 +00:00
|
|
|
PROJECT_CONFIG();
|
2005-07-31 23:33:12 +00:00
|
|
|
|
2011-08-09 21:44:14 +00:00
|
|
|
int parse(XML_PARSER&);
|
2005-08-09 18:00:33 +00:00
|
|
|
void clear();
|
2005-08-07 01:33:15 +00:00
|
|
|
void print();
|
2005-07-31 23:33:12 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct ACCOUNT_IN {
|
|
|
|
std::string url;
|
client/manager/server: use HTTPS for web RPCs if possible
The web RPCs done by the client during project attach
(lookup_account, create_account)
have an email address and password hash in their request.
Network sniffers could potentially see these,
so we should use HTTPS for these RPCs if possible.
However, not all BOINC projects have SSL-enabled web servers.
So I did the following:
- Change get_project_config.php to return an additional
<web_rpc_url_base> element.
This is SECURE_URL_BASE (if specified in the project's
project.inc config file) or, if not, the master URL.
- This new element is parsed into the PROJECT_CONFIG structure.
- In calls to create_account and lookup_account,
the Manager uses PROJECT_CONFIG::web_rpc_url_base
if it's available, else the master URL.
So, the new Manager/client uses HTTPS for RPCs to projects
that have updated their get_project_config.php,
and specify a SECURE_URL_BASE with https:// prefix.
Android note: I added code to parse the new config element,
but didn't change the higher-level code;
Joachim will need to do this.
2014-01-28 21:25:59 +00:00
|
|
|
// URL prefix for web RPCs
|
2005-07-31 23:33:12 +00:00
|
|
|
std::string email_addr;
|
2014-10-19 06:53:27 +00:00
|
|
|
// the account identifier (email address, user name, or LDAP uid)
|
2005-07-31 23:33:12 +00:00
|
|
|
std::string user_name;
|
2005-08-05 23:06:48 +00:00
|
|
|
std::string passwd;
|
2010-03-30 17:46:09 +00:00
|
|
|
std::string team_name;
|
2014-11-19 05:58:38 +00:00
|
|
|
bool ldap_auth;
|
2018-10-25 20:55:26 +00:00
|
|
|
bool consented_to_terms;
|
2005-08-06 19:20:26 +00:00
|
|
|
|
2005-09-27 09:55:54 +00:00
|
|
|
ACCOUNT_IN();
|
2005-08-06 19:20:26 +00:00
|
|
|
|
|
|
|
void clear();
|
2005-07-31 23:33:12 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct ACCOUNT_OUT {
|
2005-08-05 22:54:00 +00:00
|
|
|
int error_num;
|
2006-09-08 22:28:10 +00:00
|
|
|
std::string error_msg;
|
2005-08-05 22:00:19 +00:00
|
|
|
std::string authenticator;
|
2005-07-31 23:33:12 +00:00
|
|
|
|
2005-09-27 09:55:54 +00:00
|
|
|
ACCOUNT_OUT();
|
2005-08-06 19:20:26 +00:00
|
|
|
|
2011-08-09 21:44:14 +00:00
|
|
|
int parse(XML_PARSER&);
|
2005-08-09 18:00:33 +00:00
|
|
|
void clear();
|
2005-08-07 01:33:15 +00:00
|
|
|
void print();
|
2005-08-06 19:20:26 +00:00
|
|
|
};
|
|
|
|
|
2006-06-01 05:29:37 +00:00
|
|
|
struct CC_STATUS {
|
2006-11-21 18:41:27 +00:00
|
|
|
int network_status; // values: NETWORK_STATUS_*
|
2006-06-01 05:29:37 +00:00
|
|
|
bool ams_password_error;
|
2006-12-13 00:54:27 +00:00
|
|
|
bool manager_must_quit;
|
2006-11-10 17:55:22 +00:00
|
|
|
int task_suspend_reason; // bitmap, see common_defs.h
|
|
|
|
int task_mode; // always/auto/never; see common_defs.h
|
2006-11-20 16:52:03 +00:00
|
|
|
int task_mode_perm; // same, but permanent version
|
|
|
|
double task_mode_delay; // time until perm becomes actual
|
2009-12-11 00:08:28 +00:00
|
|
|
int gpu_suspend_reason;
|
|
|
|
int gpu_mode;
|
|
|
|
int gpu_mode_perm;
|
|
|
|
double gpu_mode_delay;
|
|
|
|
int network_suspend_reason;
|
|
|
|
int network_mode;
|
|
|
|
int network_mode_perm;
|
2006-11-20 16:52:03 +00:00
|
|
|
double network_mode_delay;
|
2007-07-02 20:55:21 +00:00
|
|
|
bool disallow_attach;
|
|
|
|
bool simple_gui_only;
|
2013-05-18 10:25:44 +00:00
|
|
|
int max_event_log_lines;
|
2006-08-29 23:54:36 +00:00
|
|
|
|
|
|
|
CC_STATUS();
|
|
|
|
|
2011-08-09 21:44:14 +00:00
|
|
|
int parse(XML_PARSER&);
|
2006-08-29 23:54:36 +00:00
|
|
|
void clear();
|
|
|
|
void print();
|
2005-07-31 23:33:12 +00:00
|
|
|
};
|
|
|
|
|
2006-06-27 21:46:50 +00:00
|
|
|
struct SIMPLE_GUI_INFO {
|
|
|
|
std::vector<PROJECT*> projects;
|
|
|
|
std::vector<RESULT*> results;
|
|
|
|
void print();
|
|
|
|
};
|
|
|
|
|
2011-10-06 17:23:16 +00:00
|
|
|
struct DAILY_XFER {
|
|
|
|
int when;
|
|
|
|
double up;
|
|
|
|
double down;
|
|
|
|
|
|
|
|
int parse(XML_PARSER&);
|
|
|
|
};
|
|
|
|
|
|
|
|
struct DAILY_XFER_HISTORY {
|
|
|
|
std::vector <DAILY_XFER> daily_xfers;
|
|
|
|
int parse(XML_PARSER&);
|
|
|
|
void print();
|
|
|
|
};
|
|
|
|
|
2013-09-08 19:11:09 +00:00
|
|
|
// Keep this consistent with client/result.h
|
|
|
|
//
|
|
|
|
struct OLD_RESULT {
|
|
|
|
char project_url[256];
|
|
|
|
char result_name[256];
|
|
|
|
char app_name[256];
|
|
|
|
int exit_status;
|
|
|
|
double elapsed_time;
|
2013-10-18 07:46:48 +00:00
|
|
|
double cpu_time;
|
2013-09-08 19:11:09 +00:00
|
|
|
double completed_time;
|
|
|
|
double create_time;
|
|
|
|
|
|
|
|
int parse(XML_PARSER&);
|
|
|
|
void print();
|
|
|
|
};
|
|
|
|
|
2011-10-06 17:23:16 +00:00
|
|
|
struct RPC_CLIENT {
|
2004-11-18 01:30:37 +00:00
|
|
|
int sock;
|
2005-05-25 19:26:37 +00:00
|
|
|
double start_time;
|
|
|
|
double timeout;
|
|
|
|
bool retry;
|
2010-09-15 17:41:25 +00:00
|
|
|
sockaddr_storage addr;
|
2005-04-09 00:39:31 +00:00
|
|
|
|
2005-02-16 23:17:43 +00:00
|
|
|
int send_request(const char*);
|
2004-07-13 23:51:09 +00:00
|
|
|
int get_reply(char*&);
|
2004-09-14 15:52:06 +00:00
|
|
|
RPC_CLIENT();
|
2004-01-21 07:07:16 +00:00
|
|
|
~RPC_CLIENT();
|
2010-09-15 17:41:25 +00:00
|
|
|
int get_ip_addr(const char* host, int port);
|
2005-12-14 01:07:10 +00:00
|
|
|
int init(const char* host, int port=0);
|
2008-02-06 00:10:31 +00:00
|
|
|
int init_asynch(
|
|
|
|
const char* host, double timeout, bool retry, int port=GUI_RPC_PORT
|
|
|
|
);
|
2005-05-25 19:26:37 +00:00
|
|
|
// timeout == how long to wait until give up
|
|
|
|
// If the caller (i.e. BOINC Manager) just launched the core client,
|
|
|
|
// this should be large enough to allow the process to
|
|
|
|
// run and open its listening socket (e.g. 60 sec)
|
|
|
|
// If connecting to a remote client, it should be large enough
|
|
|
|
// for the user to deal with a "personal firewall" popup
|
|
|
|
// (e.g. 60 sec)
|
2006-11-10 17:55:22 +00:00
|
|
|
// retry: if true, keep retrying until succeed or timeout.
|
2005-05-25 19:26:37 +00:00
|
|
|
// Use this if just launched the core client.
|
2005-04-08 23:40:50 +00:00
|
|
|
int init_poll();
|
2014-01-31 06:57:44 +00:00
|
|
|
int init_unix_domain();
|
2004-09-30 21:55:19 +00:00
|
|
|
void close();
|
2005-03-30 09:24:31 +00:00
|
|
|
int authorize(const char* passwd);
|
2018-10-25 20:24:09 +00:00
|
|
|
int exchange_versions(std::string client_name, VERSION_INFO& server);
|
2004-07-13 23:51:09 +00:00
|
|
|
int get_state(CC_STATE&);
|
2009-06-04 17:59:04 +00:00
|
|
|
int get_results(RESULTS&, bool active_only = false);
|
2013-09-08 19:11:09 +00:00
|
|
|
int get_old_results(std::vector<OLD_RESULT>&);
|
2004-07-13 23:51:09 +00:00
|
|
|
int get_file_transfers(FILE_TRANSFERS&);
|
2006-06-27 21:46:50 +00:00
|
|
|
int get_simple_gui_info(SIMPLE_GUI_INFO&);
|
2004-09-14 15:52:06 +00:00
|
|
|
int get_project_status(PROJECTS&);
|
2007-03-13 19:33:27 +00:00
|
|
|
int get_all_projects_list(ALL_PROJECTS_LIST&);
|
2006-11-03 17:08:49 +00:00
|
|
|
int get_disk_usage(DISK_USAGE&);
|
2005-02-16 23:17:43 +00:00
|
|
|
int project_op(PROJECT&, const char* op);
|
2006-11-10 17:55:22 +00:00
|
|
|
int set_run_mode(int mode, double duration);
|
|
|
|
// if duration is zero, change is permanent.
|
|
|
|
// otherwise, after duration expires,
|
|
|
|
// restore last permanent mode
|
2009-12-11 00:08:28 +00:00
|
|
|
int set_gpu_mode(int mode, double duration);
|
2006-11-10 17:55:22 +00:00
|
|
|
int set_network_mode(int mode, double duration);
|
2007-09-14 01:45:00 +00:00
|
|
|
int get_screensaver_tasks(int& suspend_reason, RESULTS&);
|
2004-04-01 23:19:13 +00:00
|
|
|
int run_benchmarks();
|
2020-04-23 14:18:54 +00:00
|
|
|
int run_graphics_app(const char *operation, int& operand, const char *screensaverLoginUser);
|
2005-08-01 22:44:40 +00:00
|
|
|
int set_proxy_settings(GR_PROXY_INFO&);
|
|
|
|
int get_proxy_settings(GR_PROXY_INFO&);
|
2010-07-14 21:23:17 +00:00
|
|
|
int get_messages(int seqno, MESSAGES&, bool translatable=false);
|
2009-07-07 22:58:58 +00:00
|
|
|
int get_message_count(int& seqno);
|
2010-01-04 17:43:18 +00:00
|
|
|
int get_notices(int seqno, NOTICES&);
|
|
|
|
int get_notices_public(int seqno, NOTICES&);
|
2005-02-16 23:17:43 +00:00
|
|
|
int file_transfer_op(FILE_TRANSFER&, const char*);
|
|
|
|
int result_op(RESULT&, const char*);
|
2004-10-12 00:27:48 +00:00
|
|
|
int get_host_info(HOST_INFO&);
|
2013-05-21 20:20:56 +00:00
|
|
|
int set_host_info(HOST_INFO&);
|
2021-03-12 05:19:15 +00:00
|
|
|
int reset_host_info();
|
2004-11-23 07:45:11 +00:00
|
|
|
int quit();
|
2005-06-21 08:22:18 +00:00
|
|
|
int acct_mgr_info(ACCT_MGR_INFO&);
|
2005-02-16 23:17:43 +00:00
|
|
|
const char* mode_name(int mode);
|
2005-04-04 06:02:36 +00:00
|
|
|
int get_statistics(PROJECTS&);
|
2005-06-23 00:15:05 +00:00
|
|
|
int network_available();
|
2005-09-27 09:55:54 +00:00
|
|
|
int get_project_init_status(PROJECT_INIT_STATUS& pis);
|
2013-05-14 19:28:09 +00:00
|
|
|
int report_device_status(DEVICE_STATUS&);
|
2005-07-31 23:33:12 +00:00
|
|
|
|
|
|
|
// the following are asynch operations.
|
|
|
|
// Make the first call to start the op,
|
|
|
|
// call the second one periodically until it returns zero.
|
2005-09-22 08:46:51 +00:00
|
|
|
// TODO: do project update
|
2005-07-31 23:33:12 +00:00
|
|
|
//
|
|
|
|
int get_project_config(std::string url);
|
|
|
|
int get_project_config_poll(PROJECT_CONFIG&);
|
|
|
|
int lookup_account(ACCOUNT_IN&);
|
|
|
|
int lookup_account_poll(ACCOUNT_OUT&);
|
|
|
|
int create_account(ACCOUNT_IN&);
|
|
|
|
int create_account_poll(ACCOUNT_OUT&);
|
2006-12-26 00:37:25 +00:00
|
|
|
int project_attach(
|
2006-12-26 00:59:18 +00:00
|
|
|
const char* url, const char* auth, const char* project_name
|
2006-12-26 00:37:25 +00:00
|
|
|
);
|
|
|
|
int project_attach_from_file();
|
2005-09-28 05:47:14 +00:00
|
|
|
int project_attach_poll(PROJECT_ATTACH_REPLY&);
|
2006-06-01 05:29:37 +00:00
|
|
|
int acct_mgr_rpc(
|
|
|
|
const char* url, const char* name, const char* passwd,
|
|
|
|
bool use_config_file=false
|
|
|
|
);
|
2005-09-28 05:47:14 +00:00
|
|
|
int acct_mgr_rpc_poll(ACCT_MGR_RPC_REPLY&);
|
2006-08-31 18:31:28 +00:00
|
|
|
|
2010-05-05 18:30:22 +00:00
|
|
|
int get_newer_version(std::string&, std::string&);
|
2006-02-07 22:04:55 +00:00
|
|
|
int read_global_prefs_override();
|
2006-12-17 02:48:19 +00:00
|
|
|
int read_cc_config();
|
2006-06-01 05:29:37 +00:00
|
|
|
int get_cc_status(CC_STATUS&);
|
2007-08-02 08:12:03 +00:00
|
|
|
int get_global_prefs_file(std::string&);
|
2007-08-01 20:26:08 +00:00
|
|
|
int get_global_prefs_working(std::string&);
|
2007-08-02 08:12:03 +00:00
|
|
|
int get_global_prefs_working_struct(GLOBAL_PREFS&, GLOBAL_PREFS_MASK&);
|
2006-08-07 16:55:56 +00:00
|
|
|
int get_global_prefs_override(std::string&);
|
|
|
|
int set_global_prefs_override(std::string&);
|
2006-11-14 10:12:24 +00:00
|
|
|
int get_global_prefs_override_struct(GLOBAL_PREFS&, GLOBAL_PREFS_MASK&);
|
2006-11-03 08:50:36 +00:00
|
|
|
int set_global_prefs_override_struct(GLOBAL_PREFS&, GLOBAL_PREFS_MASK&);
|
2014-05-08 07:51:18 +00:00
|
|
|
int get_cc_config(CC_CONFIG& config, LOG_FLAGS& log_flags);
|
|
|
|
int set_cc_config(CC_CONFIG& config, LOG_FLAGS& log_flags);
|
2017-05-12 03:16:35 +00:00
|
|
|
int get_app_config(const char* url, APP_CONFIGS& conf);
|
|
|
|
int set_app_config(const char* url, APP_CONFIGS& conf);
|
2011-10-06 17:23:16 +00:00
|
|
|
int get_daily_xfer_history(DAILY_XFER_HISTORY&);
|
2013-12-03 18:47:56 +00:00
|
|
|
int set_language(const char*);
|
2004-01-21 07:07:16 +00:00
|
|
|
};
|
2004-09-25 19:33:30 +00:00
|
|
|
|
|
|
|
struct RPC {
|
|
|
|
char* mbuf;
|
|
|
|
MIOFILE fin;
|
2011-08-09 21:44:14 +00:00
|
|
|
XML_PARSER xp;
|
2004-09-25 19:33:30 +00:00
|
|
|
RPC_CLIENT* rpc_client;
|
|
|
|
|
|
|
|
RPC(RPC_CLIENT*);
|
|
|
|
~RPC();
|
2005-02-16 23:17:43 +00:00
|
|
|
int do_rpc(const char*);
|
2005-05-31 21:59:29 +00:00
|
|
|
int parse_reply();
|
2004-09-25 19:33:30 +00:00
|
|
|
};
|
2006-04-22 00:01:43 +00:00
|
|
|
|
2009-03-26 16:05:57 +00:00
|
|
|
|
2018-03-22 15:45:48 +00:00
|
|
|
#if defined(HAVE__CONFIGTHREADLOCALE) || defined(HAVE_USELOCALE)
|
|
|
|
// no-op, the calling thread is already set to use C locale
|
2011-10-06 17:23:16 +00:00
|
|
|
struct SET_LOCALE {
|
2018-03-22 15:45:48 +00:00
|
|
|
SET_LOCALE() {}
|
|
|
|
~SET_LOCALE() {}
|
2009-03-26 16:05:57 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#else
|
2010-08-14 13:48:26 +00:00
|
|
|
struct SET_LOCALE {
|
2018-03-22 15:45:48 +00:00
|
|
|
std::string old_locale;
|
|
|
|
SET_LOCALE() {
|
|
|
|
old_locale = setlocale(LC_ALL, NULL);
|
|
|
|
setlocale(LC_ALL, "C");
|
2009-03-26 01:22:35 +00:00
|
|
|
}
|
2018-03-22 15:45:48 +00:00
|
|
|
~SET_LOCALE() {
|
|
|
|
setlocale(LC_ALL, old_locale.c_str());
|
2009-03-26 01:22:35 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
#endif
|
2009-02-03 21:22:50 +00:00
|
|
|
|
2020-05-15 19:36:33 +00:00
|
|
|
extern int read_gui_rpc_password(char*, std::string&);
|
2011-09-27 19:45:27 +00:00
|
|
|
|
2017-04-08 06:54:49 +00:00
|
|
|
#endif // BOINC_GUI_RPC_CLIENT_H
|