version 1.9, 2000/01/20 08:46:44 |
version 1.10, 2000/01/20 15:38:12 |
|
|
/* -*- mode: C; coding: euc-japan -*- */ |
/* -*- mode: C; coding: euc-japan -*- */ |
/* $OpenXM: OpenXM/src/ox_toolkit/ox.c,v 1.8 2000/01/19 19:46:42 ohara Exp $ */ |
/* $OpenXM: OpenXM/src/ox_toolkit/ox.c,v 1.9 2000/01/20 08:46:44 ohara Exp $ */ |
|
|
/* |
/* |
This module includes functions for sending/receiveng CMO's. |
This module includes functions for sending/receiveng CMO's. |
Line 742 static char *concat_openxm_home_bin(char *s) |
|
Line 742 static char *concat_openxm_home_bin(char *s) |
|
} |
} |
|
|
base = getenv("OpenXM_HOME"); |
base = getenv("OpenXM_HOME"); |
path = malloc(strlen(base)+5+strlen(s)); |
path = malloc(strlen(base)+6+strlen(s)); |
sprintf(path, "%s/bin/%s", base, s); |
sprintf(path, "%s/bin/%s", base, s); |
return path; |
return path; |
} |
} |
Line 843 ox_file_t ox_start(char* host, char* ctl_prog, char* d |
|
Line 843 ox_file_t ox_start(char* host, char* ctl_prog, char* d |
|
return sv; |
return sv; |
} |
} |
|
|
|
ox_file_t ox_start_remote_with_ssh(char *dat_prog, char* host) |
|
{ |
|
ssh_ox_server(host, "ox", dat_prog, 1200, 1300); |
|
return ox_start_insecure_nonreverse(host, 1200, 1300); |
|
} |
|
|
/* ssh -f host oxlog xterm -e ox -ox ox_asir ... */ |
/* ssh -f host oxlog xterm -e ox -ox ox_asir ... */ |
int ssh_ox_server(char *host, char *ctl_prog, char *dat_prog, short portControl, short portStream) |
int ssh_ox_server(char *host, char *ctl_prog, char *dat_prog, short portControl, short portStream) |
{ |
{ |
char *oxlog; |
char *oxlog; |
char *ssh; |
char *ssh; |
|
|
oxlog = concat_openxm_home_bin("oxlog"); |
oxlog = concat_openxm_home_bin("oxlog"); |
ctl_prog = concat_openxm_home_bin(ctl_prog); |
ctl_prog = concat_openxm_home_bin(ctl_prog); |
dat_prog = concat_openxm_home_bin(dat_prog); |
dat_prog = concat_openxm_home_bin(dat_prog); |
Line 857 int ssh_ox_server(char *host, char *ctl_prog, char *da |
|
Line 864 int ssh_ox_server(char *host, char *ctl_prog, char *da |
|
if (fork() == 0) { |
if (fork() == 0) { |
execl(ssh, ssh, "-f", host, oxlog, "xterm", "-icon", |
execl(ssh, ssh, "-f", host, oxlog, "xterm", "-icon", |
"-e", ctl_prog, "-insecure", "-ox", dat_prog, |
"-e", ctl_prog, "-insecure", "-ox", dat_prog, |
"-data", portStream, "-control", portControl, "-host", host, NULL); |
"-data", portStream, "-control", portControl, |
|
"-host", host, NULL); |
exit(1); |
exit(1); |
} |
} |
} |
} |
Line 885 ox_file_t ox_start_insecure_nonreverse(char* host, sho |
|
Line 893 ox_file_t ox_start_insecure_nonreverse(char* host, sho |
|
sv->stream = mysocketOpen(host, portStream); |
sv->stream = mysocketOpen(host, portStream); |
decideByteOrderClient(sv->stream, 0); |
decideByteOrderClient(sv->stream, 0); |
return sv; |
return sv; |
} |
|
|
|
ox_file_t ox_start_insecure_nonreverse2(char* host, char *ctl_prog, char *dat_prog) |
|
{ |
|
short portControl= 1200; /* 自動生成させよう... */ |
|
short portStream = 1300; |
|
|
|
ssh_ox_server(host, ctl_prog, dat_prog, portControl, portStream); |
|
return ox_start_insecure_nonreverse(host, portControl, portStream); |
|
} |
} |
|
|
void ox_reset(ox_file_t sv) |
void ox_reset(ox_file_t sv) |