ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/Development/ray/src/common/clntrpc.h
Revision: 1.1
Committed: Thu Feb 2 10:34:13 1989 UTC (36 years, 9 months ago) by greg
Content type: text/plain
Branch: MAIN
Log Message:
Initial revision

File Contents

# Content
1 /* clntrpc.h Distribution 1.0 88/9/19 Scry */
2
3 /* SCCSid "$SunId$ LBL" */
4
5 /* The Scry system is copyright (C) 1988, Regents of the
6 University of California. Anyone may reproduce ``Scry'',
7 the software in this distribution, in whole or in part, pro-
8 vided that:
9
10 (1) Any copy or redistribution of Scry must show the
11 Regents of the University of California, through its
12 Lawrence Berkeley Laboratory, as the source, and must
13 include this notice;
14
15 (2) Any use of this software must reference this distribu-
16 tion, state that the software copyright is held by the
17 Regents of the University of California, and that the
18 software is used by their permission.
19
20 It is acknowledged that the U.S. Government has rights
21 in Scry under Contract DE-AC03-765F00098 between the U.S.
22 Department of Energy and the University of California.
23
24 Scry is provided as a professional academic contribu-
25 tion for joint exchange. Thus it is experimental, is pro-
26 vided ``as is'', with no warranties of any kind whatsoever,
27 no support, promise of updates, or printed documentation.
28 The Regents of the University of California shall have no
29 liability with respect to the infringement of copyrights by
30 Scry, or any part thereof. */
31
32
33 #include <netdb.h>
34 #ifdef CRAY
35 #include <rpc/types.h>
36 #include "in.h" /* YUCK */
37 #include <sys/socket.h>
38 #include <rpc/xdr.h>
39 #include <rpc/auth.h>
40 #include <rpc/clnt.h>
41 #include <rpc/rpc_msg.h>
42 #include <rpc/auth_unix.h>
43 #include <rpc/svc.h>
44 #include <rpc/svc_auth.h>
45 #else
46 #include <rpc/rpc.h>
47 #include <sys/socket.h>
48 #endif
49 #include <sys/time.h>
50
51 #define SUNFRONT /* Sun is client */
52
53 #define PCPROGRAM 300000
54 #define PCPORT 2000
55 #define TESTVERS 1 /* version */
56
57 /* remote procedure numbers */
58
59 #define AUTHPROC 1 /* authorization procedure */
60 #define INITPROC 2 /* initialize VTR or videodisk */
61 #define RECORDPROC 3 /* record frame */
62 #define CLOSEPROC 4 /* relinquish control */
63 #define NOCOMPRESS 5 /* send uncompressed image data */
64 #define COLORSEND 6 /* send and display colormap-compressed scan lines */
65 #define SENDUDP 7 /* send BTC and colormap-compressed scan lines */
66 #define DISPLAY 8 /* display BTC and colormap-compressed scan lines */
67 #define MAPPROC 9 /* send color map */
68
69 /* give up after certain amount of time */
70 extern struct timeval s_total_timeout ;
71 /* client handle */
72 extern CLIENT *s_client ;
73
74 #define UDP 0 /* UDP protocol */
75 #define TCP 1 /* TCP protocol */
76
77 extern short s_protocol ; /* which protocol */
78
79 #define PREVIEW 0 /* preview mode */
80
81 extern int s_curr_frame ; /* current frame number */
82 extern int s_copy_num ; /* number of frames to record image on */
83 extern int s_record ; /* preview or record */
84 extern bool_t s_optflag ; /* video workstation has optical disk */
85 extern bool_t s_lempel_ziv ; /* use Lempel-Ziv compression or not */
86
87 struct netuser /* user description structure */
88 {
89 int nu_uid ; /* effective user id */
90 unsigned int nu_glen ; /* number of groups user in */
91 int *nu_gids ; /* groups user is in */
92 } ;
93
94 struct record
95 {
96 int in_at ; /* start recording image at */
97 int out_at ; /* finish recording image at */
98 } ;
99
100 struct recinfo
101 {
102 bool_t optflag ;
103 int start_frame ;
104 int total ;
105 } ;
106
107 #define NONE 0 /* no compression */
108 #define BTC 1 /* BTC compression */
109 #define COLORMAP 2 /* color map compression */
110 #define LEMPEL_ZIV 4 /* Lempel-Ziv compression */
111 #define FRAME_FRAME 8 /* frame-to-frame differencing */
112
113 extern short s_compression ; /* type of compression */
114
115 struct mapstore
116 {
117 short mapnum ; /* number of entries in color map */
118 unsigned short map[256] ; /* entries in color map */
119 } ;
120
121
122 struct scan_packet
123 {
124 bool_t first ; /* first frame - no frame-frame differencing */
125 int record ; /* preview or record */
126 short compression ; /* type of compression */
127 int lempel_ziv ; /* Lempel-Ziv used or not */
128 short linenum ; /* scan line number (0 to 399) */
129 int index ; /* used by server as index into piece of
130 incoming buffer */
131 int total1, total2 ; /* server uses in building up compressed
132 frame buffer from incoming pieces */
133 /* number of bytes in compressed frame (Lempel-Ziv only) */
134 int total_lz ;
135 int in_at, out_at ; /* starting, ending numbers to
136 record image on */
137 short mapnum ; /* number of entries in color map */
138 unsigned short map[256] ; /* color map */
139 short num_bytes[100] ; /* number of bytes in each group of
140 4 compressed scan lines */
141 unsigned char pack[76800] ; /* compressed frame buffer or piece thereof */
142 /* 2 scan lines stored here when compression
143 not used */
144 } ;