Upgrade to GPLv3
[its.git] / sysdoc / mldev.protoc
1 Copyright (c) 1999 Massachusetts Institute of Technology
2
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License as published by
5 the Free Software Foundation; either version 3 of the License, or (at
6 your option) any later version.
7
8 This program is distributed in the hope that it will be useful, but
9 WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 General Public License for more details.
12
13 You should have received a copy of the GNU General Public License
14 along with this program; if not, write to the Free Software
15 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
16 ------------------------------
17
18 MLDEV/MLSLV protocol
19
20 The MLDEV protocol is a binary file transfer protocol used between ITS
21 systems for the transfer of files.  It depends heavily upon the ITS job
22 device feature and the ITS system calls and error codes.  For a more
23 detailed description of the ITS system calls, read the ITS UUO and
24 symbolic system call manuals.
25
26 The name MLDEV is historical, dating back to the days when this protocol
27 was used mostly to reference ML's file system from AI (and vice versa).
28 The MLDEV server is called MLSLV, for "ML slave".
29
30 ICP is to socket 305 if doing mostly input, 307 if mostly output.
31 \fUser commands:
32
33 Command format: to slave
34 AOBJN pointer (RH = command code)
35 Block of arguments
36
37 Command codes:
38 COPENI==1       OPEN for input
39                 arg1:   Device
40                 arg2:   FN1
41                 arg3:   FN2
42                 arg4:   SNAME
43                 arg5:   OPEN mode
44
45 COPENO==2       OPEN for output
46                 arg1:   Device
47                 arg2:   FN1
48                 arg3:   FN2
49                 arg4:   SNAME
50                 arg5:   OPEN mode
51
52 CDATA==3        Write data (Word count includes data words and byte count word)
53                 arg1:   # of bytes of data
54                 args:   Data, packed ILDB-style into at most 200 words
55
56 CALLOC==4       Read allocate
57                 Allocation in bytes
58
59 CICLOS==5       Input CLOSE
60                 Ignored argument
61
62 COCLOS==6       Output CLOSE
63                 Ignored argument
64
65 CFDELE==7       DELETE or RENAME
66                 arg1:  Device
67                 arg2:   FN1
68                 arg3:   FN2
69                 arg4:   0 or new FN1
70                 arg5:   0 or new FN2
71                 arg6:   SNAME
72
73 CRNMWO==10      RENAME while open
74                 arg1:   new FN1
75                 arg2:   new FN2
76
77 CNOOP=11        No-op
78                 arg:    Echoed by the no-op reply
79
80 CACCES==12      ACCESS
81                 arg1:   Transaction number
82                 arg2:   Access pointer
83                 arg3:   New allocation
84
85 CSYSCL==13      Random system call.  11 (decimal) arguments
86                 arg1:   System call name in sixbit
87                 arg2:   Flags (control-bit argument)
88                 arg3:   Number of following arguments that have significance
89                 arg4:   1st argument to system call
90                 ...
91                 arg11:  8th argument to system call
92
93 CREUSE==14      Reinitialize yourself, because we are about to be reused
94                 by a new creator for a new file
95 \fServer replies
96
97 Reply format:   from slave
98 AOBJN pointer (RH = reply code)
99 Block of arguments
100
101 R==,,-1         Reply codes:
102
103 RDATA==1        Input data (word count includes data words and byte count word)
104                 arg1:   # of bytes of data
105                 args:   Data, packed ILDB-style into words.
106                 Note:  Slave must always send fully populated words except when
107                 EOF is reached.
108
109 ROPENI==2       Input OPEN status; 1 or 11 arguments
110                 arg1: -1 \19 succeeded >0 \19 OPEN loss number
111                 arg2\19arg11 are present only if arg1 is -1
112                  arg2:  Real device name (usually SIXBIT/DSK/)
113                  arg3:   Real FN1
114                  arg4:  Real FN2
115                  arg5:  Real SNAME
116                  arg6:  File length
117                  arg7:  Byte size open in
118                  arg8:  File length in byte size written in
119                  arg9:  Byte size written in
120                  arg10: FILDTP - -1 if RFDATE wins on this file
121                  arg11: Creation data (if RFDATE wins)
122
123 ROPENO==3       Output OPEN status.  1 or 11 arguments
124                 arg1:   -1 \19 succeeded >0 \19 OPEN loss number
125                 arg2-arg11 present only if arg1 is -1
126                  arg2:  Real device name
127                  arg3:  Real FN1
128                  arg4:  Real FN2
129                  arg5:  Real SNAME
130                  arg6:  File length (-1 \19 FILLEN fails on this device)
131                  arg7:  Byte size open in
132                  arg8:  File length in byte size written in
133                  arg9:  Byte size written in
134                  arg10: FILDTP - -1 if RFDATE wins on this file
135                  arg11: Creation data (if RFDATE wins)
136
137 REOF==4         EOF on input
138                 Ignored argument
139
140 RFDELE==5       DELETE/RENAME status.  1st argument:
141                 RH:     -1 \19 succeeded
142                         \1d\19 failure code
143                 LH:     -1 \19 DELETE or RENAME
144                          0 \19 RENAME while open
145                 If RENAME while open call succeeded, there are 4 more arguments:
146                  arg2:  Real device name
147                  arg3:  Real FN1 (as renamed)
148                  arg4:  Real FN2
149                  arg5:  Real SNAME
150
151 RNOOP==6        No-op reply
152                 arg:    Echo argument send by no-op command
153
154 RACCES==7       Acknowledge access
155                 arg:    Transaction number from CACCES
156
157 RSYSCL==10      Respond to system call.  9 arguments
158                 arg1:   <error code or 0>,,<# of times call skipped>
159                 arg2:   1st value from system call
160                 ...
161                 arg9:   8th value from system call
162
163 RICLOS==11      Respond to input CLOSE
164
165 ROCLOS==12      Respond to output CLOSE
166
167 RIOC==13        Reflect an IOC error
168                 arg:    IOC error code, right-justified in word
169
170 RREUSE==14      Acknowledge a CREUSE
171                 Ignored argument