00001
00002
00003
00004
00005 #include <SUM.h>
00006 #include <soi_key.h>
00007 #include <sys/time.h>
00008 #include <sys/errno.h>
00009 #include <rpc/rpc.h>
00010 #include <sum_rpc.h>
00011 #include <soi_error.h>
00012
00013 extern int errno;
00014
00015
00016
00017
00018 #define MAXSUMREQ_CNT 3
00019
00020
00021 KEY *rlist;
00022 FILE *logfp;
00023 SUM_t *sum;
00024 SUMID_t uid;
00025
00026 int soi_errno = NO_ERROR;
00027 int bytes, msgtag, petid, req_num, status, cnt, i, j, inum;
00028 char **cptr;
00029 float ftmp;
00030 uint64_t *dsixpt;
00031 uint64_t alloc_index;
00032 char alloc_wd[64];
00033 char cmd[128];
00034 char mod_name[] = "sum_rpc";
00035 char dsname[] = "hmi_lev1_fd_V";
00036 char hcomment[] = "this is a dummy history comment that is greater than 80 chars long to check out the code";
00037
00038 static struct timeval first[8], second[8];
00039
00040 void StartTimer(int n)
00041 {
00042 gettimeofday (&first[n], NULL);
00043 }
00044
00045 float StopTimer(int n)
00046 {
00047 gettimeofday (&second[n], NULL);
00048 if (first[n].tv_usec > second[n].tv_usec) {
00049 second[n].tv_usec += 1000000;
00050 second[n].tv_sec--;
00051 }
00052 return (float) (second[n].tv_sec-first[n].tv_sec) +
00053 (float) (second[n].tv_usec-first[n].tv_usec)/1000000.0;
00054 }
00055
00056
00057
00058
00059
00060 int main(int argc, char *argv[])
00061 {
00062 int status;
00063 char **srcptr;
00064 char **destptr;
00065 SUMEXP_t sumexp;
00066
00067 if((sum = SUM_open(NULL, NULL, printf)) == 0) {
00068 printf("Failed on SUM_open()\n");
00069 exit(1);
00070 }
00071
00072 sumexp.uid = sum->uid;
00073 sumexp.host = "n02";
00074 sumexp.cmd = "scp";
00075 sumexp.src = (char **)calloc(SUMARRAYSZ, sizeof(char *));
00076 sumexp.dest = (char **)calloc(SUMARRAYSZ, sizeof(char *));
00077 srcptr = sumexp.src;
00078 destptr = sumexp.dest;
00079 *srcptr++ = "/home/jim/mark.alias";
00080 *destptr++ = "/tmp/jim";
00081 *srcptr++ = "/home/jim/.aliases";
00082 *destptr++ = "/tmp/jim";
00083 sumexp.reqcnt = 2;
00084 sumexp.port = 0;
00085
00086 printf("Calling: SUM_export()\n");
00087 status = SUM_export(&sumexp, printf);
00088
00089 printf("status = %d\n", status);
00090 free(sumexp.src);
00091 free(sumexp.dest);
00092
00093 SUM_close(sum, printf);
00094 }
00095
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112
00113