1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29 rcvdat_:
30 proc (p_mowse_mcb_ptr, p_msg_ptr, p_msg_len, p_status);
31
32
33
34
35
36
37
38
39
40
41
42 dcl p_mowse_mcb_ptr ptr parameter;
43 dcl p_msg_ptr ptr parameter;
44 dcl p_msg_len fixed bin (21) parameter;
45 dcl p_status fixed bin (35) parameter;
46
47
48
49 dcl send_msg_ entry (ptr, fixed bin, fixed bin, ptr, fixed bin,
50 fixed bin, fixed bin (35));
51 dcl capability_$pack entry (fixed bin, fixed bin, fixed bin,
52 fixed bin (35));
53 dcl ws_$put_background_message
54 entry () options (variable);
55 dcl message_parser_ entry (ptr, fixed bin, ptr, fixed bin (35));
56
57
58
59
60 dcl ws_error_$no_capability
61 fixed bin (35) ext static;
62 dcl ws_error_$invalid_capability_number
63 fixed bin (35) ext static;
64 dcl ws_error_$invalid_system_id
65 fixed bin (35) ext static;
66
67
68
69
70 dcl mowse_info_ptr ptr;
71 dcl system fixed bin;
72 dcl major fixed bin;
73 dcl minor fixed bin;
74 dcl source_system fixed bin;
75 dcl source_major fixed bin;
76 dcl ecode fixed bin (35);
77
78
79 dcl convert builtin;
80 dcl null builtin;
81 dcl rank builtin;
82 dcl addr builtin;
83 dcl byte builtin;
84
85
86
87
88
89
90
91 p_status = 0;
92 message_ptr = p_msg_ptr;
93 message_len = convert (message_len, p_msg_len);
94
95
96
97
98
99 mowse_info_ptr = p_mowse_mcb_ptr -> mcb.mowse_info_ptr;
100
101
102
103
104 system = rank (message_ptr -> input_message.header.system);
105 major = rank (message_ptr -> input_message.header.major);
106 minor = rank (message_ptr -> input_message.header.minor);
107 if minor ^= CONTINUE then do;
108 source_system =
109 rank (message_ptr -> input_message.header.source_system);
110 source_major =
111 rank (message_ptr -> input_message.header.source_major);
112 end;
113 else do;
114 source_system =
115 rank (message_ptr
116 -> more_remaining_message.header.source_system);
117 source_major =
118 rank (message_ptr
119 -> more_remaining_message.header.source_major);
120 end;
121
122
123
124 if major < INTERNAL | major > MAXIMUM_CAT_ENTRY then do;
125 call message_error (system, major, minor, source_system,
126 source_major, p_mowse_mcb_ptr,
127 ws_error_$invalid_capability_number);
128 return;
129 end;
130
131
132
133 if system ^= LOCAL_SYSTEM then do;
134 call message_error (system, major, minor, source_system,
135 source_major, p_mowse_mcb_ptr,
136 ws_error_$invalid_system_id);
137 return;
138 end;
139
140
141
142
143
144 if major ^= INTERNAL then
145 if p_mowse_mcb_ptr -> mcb.mowse_info_ptr
146 -> mowse_info.local_cat (major).mcb_ptr = null
147 then do;
148 call message_error (system, major, minor, source_system,
149 source_major, p_mowse_mcb_ptr,
150 ws_error_$no_capability);
151 return;
152 end;
153
154
155
156 call message_parser_ (p_mowse_mcb_ptr, message_len, p_msg_ptr,
157 ecode);
158
159
160
161
162 p_status = 0;
163 if ecode ^= 0 then do;
164 call message_error (system, major, minor, source_system,
165 source_major, p_mowse_mcb_ptr, ecode);
166 return;
167 end;
168
169
170
171
172
173
174
175 message_error:
176 proc (p_system, p_major, p_minor, p_source_system, p_source_major,
177 p_mowse_mcb_ptr, p_code);
178
179
180
181
182
183
184
185 dcl p_minor fixed bin parameter;
186 dcl p_mowse_mcb_ptr ptr parameter;
187 dcl p_code fixed bin (35);
188 dcl p_source_major fixed bin parameter;
189 dcl p_source_system fixed bin parameter;
190 dcl p_major fixed bin parameter;
191 dcl p_system fixed bin parameter;
192
193
194
195 dcl data_message char (32);
196 dcl source_major_cap fixed bin;
197 dcl data char (1);
198
199
200
201
202
203
204 if p_code ^= ws_error_$no_capability then
205 call ws_$put_background_message (p_mowse_mcb_ptr,
206 p_code, "MULTICS MOWSE", "From [^d:^d] to [^d:^d:^d]",
207 p_source_system, p_source_major, p_system, p_major,
208 p_minor);
209 p_code = 0;
210
211
212
213
214 if p_source_major = INTERNAL then
215 return;
216
217
218
219 call capability_$pack (p_source_system, p_source_major,
220 source_major_cap, ecode);
221 if p_code ^= 0 then
222 return;
223
224 if p_minor = REQUEST_DISCONNECT then do;
225 data = byte (REJECT);
226 call send_msg_ (p_mowse_mcb_ptr, source_major_cap,
227 RESPONSE_DISCONNECT, addr (data), 1, BG, p_code);
228 end;
229 else if p_minor = STATUS then do;
230 data_message = "Capability does not exist.";
231 call send_msg_ (p_mowse_mcb_ptr, source_major_cap,
232 STATUS_REPLY, addr (data_message), 26, FG, p_code);
233 end;
234
235 else if p_minor >= MINIMUM_USER_MINOR & p_minor <= MAXIMUM_USER_MINOR
236 then
237 call send_msg_ (p_mowse_mcb_ptr, source_major_cap,
238 FAIL_CAPABILITY, null, 0, BG, p_code);
239 else
240 call send_msg_ (p_mowse_mcb_ptr, source_major_cap,
241 SYSTEM_ERROR, null, 0, BG, ecode);
242
243 end message_error;
244
245
246
247
248 %page;
249
250
251 %include mowse;
252 %include mowse_mcb;
253 %include mowse_messages;
254 %include mowse_info;
255
256
257 end rcvdat_;