forked from BOINC/boinc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathserver_types.h
76 lines (66 loc) · 2.26 KB
/
server_types.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
// The contents of this file are subject to the BOINC Public License
// Version 1.0 (the "License"); you may not use this file except in
// compliance with the License. You may obtain a copy of the License at
// http://boinc.berkeley.edu/license_1.0.txt
//
// Software distributed under the License is distributed on an "AS IS"
// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
// License for the specific language governing rights and limitations
// under the License.
//
// The Original Code is the Berkeley Open Infrastructure for Network Computing.
//
// The Initial Developer of the Original Code is the SETI@home project.
// Portions created by the SETI@home project are Copyright (C) 2002
// University of California at Berkeley. All Rights Reserved.
//
// Contributor(s):
//
#ifndef _SERVER_TYPES_
#define _SERVER_TYPES_
#include <stdio.h>
#include <vector>
#include "db.h"
//The following are the states that the client is in according to the result.
#define CLIENT_UNINITIALIZED 0
#define CLIENT_DOWNLOADING 1
#define CLIENT_COMPUTING 2
#define CLIENT_UPLOADING 3
#define CLIENT_DONE 4
struct SCHEDULER_REQUEST {
char authenticator[256];
char platform_name[256];
int hostid; // zero if first RPC
int core_client_version;
int rpc_seqno;
int work_req_seconds;
unsigned int prefs_mod_time;
char* prefs_xml;
HOST host;
vector<RESULT> results;
SCHEDULER_REQUEST();
~SCHEDULER_REQUEST();
int parse(FILE*);
};
struct SCHEDULER_REPLY {
int request_delay; // don't request again until this time elapses
char message[1024];
char message_priority[256];
int hostid; // send this only if nonzero.
// this tells client to reset rpc_seqno
bool send_prefs; // whether to send preferences
USER user;
vector<APP> apps;
vector<APP_VERSION> app_versions;
vector<WORKUNIT>wus;
vector<RESULT>results;
vector<RESULT>result_acks;
SCHEDULER_REPLY();
~SCHEDULER_REPLY();
int write(FILE*);
void insert_app_unique(APP&);
void insert_app_version_unique(APP_VERSION&);
void insert_workunit_unique(WORKUNIT&);
void insert_result(RESULT&);
};
#endif