version 1.9, 2000/01/20 08:46:44 |
version 1.11, 2000/02/04 08:01:30 |
|
|
/* -*- 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.10 2000/01/20 15:38:12 ohara Exp $ */ |
|
|
/* |
/* |
This module includes functions for sending/receiveng CMO's. |
This module includes functions for sending/receiveng CMO's. |
Line 82 static char* new_string_set_cmo_int32(int integ |
|
Line 82 static char* new_string_set_cmo_int32(int integ |
|
static char* new_string_set_cmo_list(cmo_list *c); |
static char* new_string_set_cmo_list(cmo_list *c); |
static char* new_string_set_cmo_zz(cmo_zz *c); |
static char* new_string_set_cmo_zz(cmo_zz *c); |
|
|
|
int ssh_ox_server(char *, char *, char *, short, short); |
|
|
int current_fd = 0; |
int current_fd = 0; |
int set_current_fd(int fd) |
int set_current_fd(int fd) |
{ |
{ |
Line 742 static char *concat_openxm_home_bin(char *s) |
|
Line 744 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 801 ox_file_t ox_start(char* host, char* ctl_prog, char* d |
|
Line 803 ox_file_t ox_start(char* host, char* ctl_prog, char* d |
|
char *oxlog; |
char *oxlog; |
|
|
/* not overwrite */ |
/* not overwrite */ |
|
#if 0 |
setenv("OpenXM_HOME", "/usr/local/OpenXM", 0); |
setenv("OpenXM_HOME", "/usr/local/OpenXM", 0); |
|
#endif |
|
if (getenv("OpenXM_HOME") == NULL) { |
|
putenv("OpenXM_HOME=/usr/local/OpenXM"); |
|
} |
|
|
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); |
Line 843 ox_file_t ox_start(char* host, char* ctl_prog, char* d |
|
Line 850 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 871 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 900 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) |