report_app_status()

svn path=/trunk/boinc/; revision=8774
This commit is contained in:
David Anderson 2005-10-30 21:28:03 +00:00
parent 72ad81d930
commit 4a5a426dac
4 changed files with 12 additions and 102 deletions

View File

@ -441,7 +441,6 @@ int boinc_write_init_data_file() {
return retval;
}
#if 0 // who uses this?
int boinc_report_app_status(
double cpu_time,
double checkpoint_cpu_time,
@ -459,7 +458,6 @@ int boinc_report_app_status(
app_client_shm->shm->app_status.send_msg(msg_buf);
return 0;
}
#endif
int boinc_get_init_data(APP_INIT_DATA& app_init_data) {
app_init_data = aid;

View File

@ -13452,3 +13452,9 @@ David 29 Oct 2005
tools/
backend_lib.C,h
David 30 Oct 2005
- restore report_app_status() to API
api/
boinc_api.C

View File

@ -70,98 +70,4 @@ int get_local_network_info(
return 0;
}
#if 0
// NEW POLICY: on UNIX, get just the hostname.
// the rest (domain name, IP address) is a can of worms,
// and doesn't really matter anyway
int get_local_network_info(
char* domain_name, int domlen, char* ip_addr, int iplen
) {
char hostname[256];
char buf[256];
int retval;
strcpy(domain_name, "unknown");
strcpy(ip_addr, "unknown");
if (!gethostname(hostname, 256)) {
safe_strncpy(domain_name, hostname, domlen);
}
return 0;
}
#if 0
// gethostbyname() is a linkage nightmare on UNIX systems (go figure)
// so use a kludge instead: run ping and parse the output.
// The output should have a line like
// "9 bytes from a.b.c.d (1.0.1.0): icmp_seq=0"
//
static int try_ping(
char* cmd, char* domain_name, int domlen, char* ip_addr, int iplen
) {
int retval,n;
char buf[256];
char *p, *q;
retval = system(cmd);
if (retval) return retval;
FILE* f = fopen(TEMP_FILE_NAME, "r");
if (!f) return ERR_FOPEN;
while (fgets(buf, 256, f)) {
p = strchr(buf, '(');
if (!p) continue;
q = strchr(p, ')');
if (!q) continue;
*q = 0;
if (!strchr(p, '.')) continue;
safe_strncpy(ip_addr, p+1, iplen);
*p = 0;
p = strrchr(buf, ' ');
if (!p) continue;
*p = 0;
p = strrchr(buf, ' ');
if (!p) continue;
p++;
if (!strchr(p, '.')) continue;
safe_strncpy(domain_name, p, domlen);
return 0;
}
return ERR_NULL;
}
int get_local_network_info(
char* domain_name, int domlen, char* ip_addr, int iplen
) {
char hostname[256];
char buf[256];
int retval;
if (gethostname(hostname, 256)) return ERR_GETHOSTBYNAME;
sprintf(buf, "ping -c 1 -w 1 %s > %s 2>/dev/null", hostname, TEMP_FILE_NAME);
retval = try_ping(buf, domain_name, domlen, ip_addr, iplen);
if (!retval) return 0;
sprintf(buf, "ping -c 1 %s > %s 2>/dev/null", hostname, TEMP_FILE_NAME);
retval = try_ping(buf, domain_name, domlen, ip_addr, iplen);
if (!retval) return 0;
sprintf(buf, "/usr/sbin/ping -s %s 1 1 > %s 2>/dev/null", hostname, TEMP_FILE_NAME);
retval = try_ping(buf, domain_name, domlen, ip_addr, iplen);
if (!retval) return 0;
msg_printf(NULL, MSG_INFO, "Couldn't get hostname and IP address");
msg_printf(NULL, MSG_INFO, "Make sure 'ping' is in your search path");
strcpy(domain_name, "unknown");
strcpy(ip_addr, "0.0.0.0");
return 0;
}
#endif
#endif
const char *BOINC_RCSID_9275b20aa5 = "$Id$";

View File

@ -76,12 +76,12 @@ list_item_array(array(
));
list_item_array(array(
"<a href=http://www.lb.shuttle.de/apastron/boincDown.shtml>Stefan Urbat</a>",
"Solaris 10 AMD64 (Opteron) and x86
<br> GNU/Linux AMD64 (Opteron)
<br> GNU/Linux PowerPC,
<br> Linux Itanium
<br> HPUX (PA RISC and Itanium/IA64),
<br> Tru64@Alpha,
"Solaris: SPARC, AMD64 (Opteron) and x86
<br> GNU/Linux: AMD64 (Opteron), PowerPC, Itanium, s390
<br> HP-UX (PA RISC and Itanium/IA64),
<br> Tru64: Alpha,
<br> AIX: Power4 and later (BOINC client only)
<br> NetBSD: x86,
<br> Mac OS X 10.3 on PowerPC 7450 and later",
"BOINC core client, SETI@home"
));