1 <DEFINITIONS "L-NETDEFS">
3 ;"*****************************************************************************
5 This file defines constants and macros related to library format, local
6 library operations, and other random cruft.
8 L-NETDEFS.MUD: EDIT HISTORY Machine Dependent (For use under UNIX)
10 COMPILATION: Include when compiling.
12 JUN84 [Shane] - Created.
13 4OCT84 [Shane] - Commented, cleaned up.
14 20OCT84 [Shane] - More sensible protocols.
16 ****************************************************************************"
18 <USE "NEWSTRUC" "NETBASE" "HOSTS">
22 ;"HOST NUMBERS FOR HOSTS RECOGNIZED BY LIBRARY SERVER.
23 For some reason, calling HOST in MIMC loses, so abstract this DEFINITIONS
24 so that the abstract will be included instead."
26 <MSETG MIT-AJAX <HOST "MIT-AJAX">>
27 <MSETG MIT-LCS-HQ <HOST "MIT-LCS-HQ">>
28 <MSETG MIT-HEINEKEN <HOST "MIT-HEINEKEN">>
29 <MSETG MIT-GRAPE-NEHI <HOST "MIT-GRAPE-NEHI">>
30 <MSETG MIT-MOLSON <HOST "MIT-MOLSON">>
31 <MSETG MIT-KIRIN <HOST "MIT-KIRIN">>
32 <MSETG MIT-MACEWAN <HOST "MIT-MACEWAN">>
33 <MSETG MIT-DM <HOST "MIT-DM">>
35 ;"SERVICE DESCRIPTOR FOR OBTAINING LIBRARY SERVICE."
37 <MSETG LIB-SERVICE <PUTLHW ,SERV-MIN-NONPRIV ,PROT-TCP>>
39 ;"REQUEST TYPES RECOGNIZED BY LIBRARY SERVER."
41 <MSETG ABORT-REQUEST 0> ;"Toplevel request type codes."
42 <MSETG FILE-REQUEST 1>
43 <MSETG PACKAGE-REQUEST 2>
44 <MSETG MAP-RECORDS-REQUEST 3>
45 <MSETG RECORD-REQUEST 4>
46 <MSETG ENTRY-REQUEST 5>
47 <MSETG COUNT-REQUEST 6>
48 <MSETG UPDATE-REQUEST 7>
50 ;"*******************************************************************************
51 ABORT-REQUEST: Abort request in progress. If an update request is aborted, this
52 includes deletion of temporary files.
54 *------------------------*--------*
55 |XXXXXXXXXXXXXXXXXXXXXXXX|00000000|
56 *------------------------*--------*
58 RESPONSE: NACK (0) and the request is terminated.
60 *******************************************************************************"
66 ;"*******************************************************************************
67 FILE-REQUEST: Open and access files accessible to server.
69 *--------*-----------------*--------*
70 |XXXXXXXX| NAME LENGTH|00000001|
71 *--------*--------*--------*--------*
72 | MASK3| MASK2| MASK1| MASK0|
73 *--------*--------*--------*--------*
75 / NAME (8-BIT ASCII) /
77 *-----------------------------------*
79 NAME LENGTH = size(NAME), 0 < size(NAME) < 1025
81 RESPONSE: Either length of file in bytes or NACK (0).
83 PACKAGE-REQUEST: Open and access a library module.
85 Same picture, different type code.
87 RESPONSE: Either length of file in bytes or NACK (0).
89 The only difference between FILE-REQUEST and PACKAGE-REQUEST is that
90 PACKAGE-REQUEST looks up NAME of file in library but FILE-REQUEST
91 assumes that NAME is a file name (which may contain a directory path
92 other than server's directory). For FILE-REQUEST, DEV and SNM default
93 to server's DEV and SNM. NM2 is not defaulted unless the MASK word is
94 non-zero, in which case the implied second names will be tried in turn.
95 The MASK word must be non-zero for PACKAGE-REQUEST. The MASK word is
96 interpreted as an encoding of L-SECOND-NAMES, lower numbered bytes
97 taking precedence; a zero byte denotes the end of the list. The allowed
105 File requests honored after initial request is acknowledged.
107 FILE-CLOSE: Same as ABORT-REQUEST.
109 *-----------------------*--------*
110 FILE-READ: | AMOUNT|00000001|
111 *-----------------------*--------*
113 RESPONSE: The requested number of bytes is written from current
114 position in file (provided end of file is not seen).
115 It is the responsibility of the user to guarantee that
116 the network pipe is empty at the time of the request.
118 *-----------------------*--------*
119 FILE-ACCESS: | ADDRESS|00000010|
120 *-----------------------*--------*
122 RESPONSE: ACK (-1). The file pointer becomes ADDRESS.
123 *******************************************************************************"
125 <MSETG MAP-NEXT-RECORD 3>
126 <MSETG MAP-SHORT-RECORD *20000000000*>
128 ;"*******************************************************************************
129 MAP-RECORDS-REQUEST: Obtain every record in the library in bucket order.
131 *------------------------*--------*
132 |XXXXXXXXXXXXXXXXXXXXXXXX|00000011|
133 *------------------------*--------*
137 Once the request has been acknowledged:
139 *------------------------*--------*
140 MAP-NEXT-RECORD: |SXXXXXXXXXXXXXXXXXXXXXXX|00000011|
141 *------------------------*--------*
143 RESPONSE: NACK (0) if all the records have been seen, and
144 the request is terminated. Otherwise the record
145 itself. The length of the record (including the
146 first word) is BITS[31:16] in the first word of
147 the record. If S is set (MAP-SHORT-RECORD) a short
148 record is sent, otherwise, a long record is sent
149 (see LIBRARY.FORMAT).
151 *******************************************************************************"
153 <MSETG RECORD-SHORT *20000000000*>
155 ;"*******************************************************************************
156 RECORD-REQUEST: Obtain library record by name.
158 *--------*----------------*--------*
159 |SXXXXXXX| NAME LENGTH|00000100|
160 *--------*----------------*--------*
162 / NAME (8-BIT ASCII) /
164 *----------------------------------*
166 NAME LENGTH = mod(size(NAME), 1024), 0 < size(NAME) < 1024
168 RESPONSE: NACK (0) if record is not found, otherwise the record
169 itself. The length of the record (including the first
170 word) is BITS[31:16] in the first word of the record.
171 If S is set (RECORD-SHORT) a short record is sent,
172 otherwise, a long record is sent (see LIBRARY.FORMAT).
173 The request is terminated after response is transmitted.
174 *******************************************************************************"
176 ;"*******************************************************************************
177 ENTRY-REQUEST: Obtain library information about every entry for given name.
179 *--------*----------------*--------*
180 |XXXXXXXX| NAME LENGTH|00000101|
181 *--------*----------------*--------*
183 / NAME (8-BIT ASCII) /
185 *----------------------------------*
187 NAME LENGTH = mod(size(NAME), 1024), 0 < size(NAME) < 1024
189 RESPONSE: NACK (0) if no information is found, otherwise entry
190 data block. The length of the block (including first
191 word is in BITS[15:0] of the first word of block.
192 BITS[31:16] contain count of entry descriptors in data
193 block (see L-BASE.MUD, comment for ENTRY-DATA). The
194 request is terminated after response is transmitted.
195 *******************************************************************************"
197 ;"*******************************************************************************
198 COUNT-REQUEST: Obtain count of number of packages and entries.
200 *------------------------*--------*
201 |XXXXXXXXXXXXXXXXXXXXXXXX|00000110|
202 *------------------------*--------*
204 RESPONSE: The number of entries/rentries followed by the number of
205 packages/definitions as (32-BIT fixes). The request is
206 terminated after response is transmitted.
207 *******************************************************************************"
209 ;"*******************************************************************************
210 UPDATE-REQUEST: Lock library for update transactions.
212 *------------------------*--------*
213 |XXXXXXXXXXXXXXXXXXXXXXXX|00000111|
214 *------------------------*--------*
216 RESPONSE: ACK (-1) if the library is locked. NACK (0), otherwise,
217 and the request is terminated.
218 *******************************************************************************"
220 <MSETG UPDATE-ABORT 0> ;"Toplevel update requests."
221 <MSETG UPDATE-EXISTS? 1>
225 <MSETG UPDATE-INSTALL 5>
226 <MSETG UPDATE-UNLOCK 6>
227 <MSETG UPDATE-FILE *20000000000*> ;"Modifier for ADD, DEL, EXISTS?"
229 ;"*******************************************************************************
230 Update requests honored after REQUEST-UPDATE is acknowledged.
232 *------------------------*--------*
233 UPDATE-ABORT: |XXXXXXXXXXXXXXXXXXXXXXXX|00000000|
234 *------------------------*--------*
236 RESPONSE: NACK (0). All transactions occurring since the last
237 install operation are aborted and the request
240 *--------*----------------*--------*
241 UPDATE-EXISTS?: |FXXXXXXX| NAME LENGTH|00000001|
242 *--------*----------------*--------*
244 / NAME (8-BIT ASCII) / size(NAME) < 1025
246 *----------------------------------*
248 RESPONSE: If F = 0 then ACK (-1) if record named NAME is in
249 library, otherwise NACK (0). If F = 1 then ACK (-1)
250 if file named NAME is in library directory, else NACK.
252 *------------------------*--------*
253 UPDATE-ADD: |0XXXXXXXXXXXXXXXXXXXXXXX|00000010| F = 0
254 *------------------------*--------*
258 *---------------------------------*
259 / DATA ADDRESS (4 WORDS) /
260 *---------------------------------*
261 | FILE LENGTH| CONTROL
262 *---------------------------------*
263 / FILE (MSUBR) / DATA
264 *---------------------------------* -> ACK
265 | FILE LENGTH| CONTROL
266 *---------------------------------*
268 *---------------------------------* -> ACK
269 | FILE LENGTH| CONTROL
270 *---------------------------------*
271 / FILE (ABSTR) / DATA
272 *---------------------------------* -> ACK
273 | FILE LENGTH| CONTROL
274 *---------------------------------*
276 *---------------------------------* -> ACK
279 RESPONSE: Files are transferred in order shown, although not all
280 types need be present (names and types specified by
281 LIBRARY RECORD). The server responds with ACK (-1) after
282 each file is received. The server responds with ACK (-1)
283 when the request is serviced. Otherwise NACK (0) and the
284 update is terminated. The protocol shown if for library
285 records (F bit = 0). The protocol for file is similar
288 *--------*----------------*--------*
289 UPDATE-ADD: |1XXXXXXX| NAME LENGTH|00000010| F = 1
290 *--------*----------------*--------*
291 / NAME (8-BIT ASCII) /
292 *----------------------------------*
293 / DATA ADDRESS (4 WORDS) /
294 *----------------------------------*
295 | FILE LENGTH| CONTROL
296 *----------------------------------*
298 *----------------------------------* -> ACK
300 *--------*----------------*--------*
301 UPDATE-DEL: |FXXXXXXX| NAME LENGTH|00000011|
302 *--------*----------------*--------*
304 / NAME (8-BIT ASCII) / size(NAME) < 1025
306 *----------------------------------*
308 RESPONSE: If F = 0 then ACK (-1) if record named NAME is
309 successfully removed from library, otherwise NACK (0)
310 and update is aborted. If F = 1, then NAME is
311 interpreted as a file name instead.
313 *------------------------*--------*
314 UPDATE-GC: |XXXXXXXXXXXXXXXXXXXXXXXX|00000100|
315 *------------------------*--------*
317 RESPONSE: ACK (-1) if library is successfully garbage collected,
318 otherwise NACK (0) and update is terminated.
320 *------------------------*--------*
321 UPDATE-INSTALL: |XXXXXXXXXXXXXXXXXXXXXXXX|00000101|
322 *------------------------*--------*
324 RESPONSE: ACK (-1) if modified library is successfully installed
325 and locked, otherwise NACK (0) and update is
328 *------------------------*--------*
329 UPDATE-UNLOCK: |XXXXXXXXXXXXXXXXXXXXXXXX|00000110|
330 *------------------------*--------*
332 RESPONSE: ACK (-1) if modified library is successfully installed
333 and released, otherwise NACK (0). Update is terminated.
334 *******************************************************************************"
336 <MSETG ACK -1> ;"Acknowledge."
337 <MSETG NACK 0> ;"Negative acknowledge."
339 ;"REMOTE -- Return T if CHANNEL is NETWORK channel."
341 <DEFMAC REMOTE? ('CHANNEL)
342 <CHTYPE (==? <CHTYPE (CHANNEL-TYPE .CHANNEL) FORM> NETWORK) FORM>>
344 ;"Channel type synonym."
346 <PUT-DECL NET '<CHANNEL 'NETWORK>>
348 ;"NFDATA -- Channel data for NETFILE channel."
350 <NEWSTRUC NFDATA VECTOR
351 NF-FSIZ FIX ;"File size in bytes."
352 NF-FPTR FIX ;"Current position in file."
353 NF-NAME STRING ;"File name."
354 NF-CONN <CHANNEL 'NETWORK>> ;"Channel to network server."
356 ;"TIMEOUTS (seconds)."
358 <MSETG STANDARD-TIMEOUT 4> ;"Timeout for non-update requests."
359 <MSETG UPDATE-TIMEOUT 30> ;"Timeout for update requests."