]> git.saurik.com Git - apple/network_cmds.git/blame - rpc_lockd.tproj/nlm_prot_svc.c
network_cmds-176.tar.gz
[apple/network_cmds.git] / rpc_lockd.tproj / nlm_prot_svc.c
CommitLineData
ac2f15b3
A
1/*
2 * Please do not edit this file.
3 * It was generated using rpcgen.
4 * (and subsequently cleaned up by hand)
5 */
6
7#include <rpcsvc/nlm_prot.h>
8#include <sys/ioctl.h>
9#include <fcntl.h>
10#include <stdio.h>
11#include <stdlib.h>
12#include <unistd.h>
13#include <rpc/pmap_clnt.h>
14#include <string.h>
15#include <netdb.h>
16#include <signal.h>
17#include <sys/ttycom.h>
18#ifdef __cplusplus
19#include <sysent.h>
20#endif /* __cplusplus */
21#include <memory.h>
22#include <sys/socket.h>
23#include <netinet/in.h>
24#include <syslog.h>
25
26#ifdef __STDC__
27#define SIG_PF void(*)(int)
28#endif
29
30#ifdef DEBUG
31#define RPC_SVC_FG
32#endif
33
34// XXX
35void retry_blockingfilelocklist(void);
36
37#define _RPCSVC_CLOSEDOWN 120
38#ifndef lint
39/*static char sccsid[] = "from: @(#)nlm_prot.x 1.8 87/09/21 Copyr 1987 Sun Micro";*/
40/*static char sccsid[] = "from: * @(#)nlm_prot.x 2.1 88/08/01 4.0 RPCSRC";*/
41static char rcsid[] = "$Id: nlm_prot_svc.c,v 1.4 2003/07/24 05:11:22 lindak Exp $";
42#endif /* not lint */
43extern int _rpcpmstart; /* Started by a port monitor ? */
44extern int _rpcfdtype; /* Whether Stream or Datagram ? */
45extern int _rpcsvcdirty; /* Still serving ? */
46
47void nlm_prog_0(struct svc_req *rqstp, SVCXPRT *transp);
48
49void
50nlm_prog_0(struct svc_req *rqstp, SVCXPRT *transp)
51{
52 union {
53 struct nlm_sm_status nlm_sm_notify_0_arg;
54 } argument;
55 char *result;
56 xdrproc_t xdr_argument, xdr_result;
57 char *(*local)(char *, struct svc_req *);
58
59 _rpcsvcdirty = 1;
60 switch (rqstp->rq_proc) {
61 case NULLPROC:
62 (void) svc_sendreply(transp, (xdrproc_t) xdr_void, (char *)NULL);
63 _rpcsvcdirty = 0;
64 return;
65
66 case NLM_SM_NOTIFY:
67 xdr_argument = (xdrproc_t) xdr_nlm_sm_status;
68 xdr_result = (xdrproc_t) xdr_void;
69 local = (char *(*)(char *, struct svc_req *)) nlm_sm_notify_0_svc;
70 break;
71
72 default:
73 svcerr_noproc(transp);
74 _rpcsvcdirty = 0;
75 return;
76 }
77 (void) memset((char *)&argument, 0, sizeof (argument));
78 if (!svc_getargs(transp, xdr_argument, (caddr_t) &argument)) {
79 svcerr_decode(transp);
80 _rpcsvcdirty = 0;
81 return;
82 }
83 result = (*local)((char *)&argument, rqstp);
84 if (result != NULL && !svc_sendreply(transp, xdr_result, result)) {
85 svcerr_systemerr(transp);
86 }
87 if (!svc_freeargs(transp, xdr_argument, (caddr_t) &argument)) {
88 syslog(LOG_ERR, "unable to free arguments");
89 exit(1);
90 }
91 _rpcsvcdirty = 0;
92 return;
93}
94
95void nlm_prog_1(struct svc_req *rqstp, SVCXPRT *transp);
96
97void
98nlm_prog_1(struct svc_req *rqstp, SVCXPRT *transp)
99{
100 union {
101 struct nlm_testargs nlm_test_1_arg;
102 struct nlm_lockargs nlm_lock_1_arg;
103 struct nlm_cancargs nlm_cancel_1_arg;
104 struct nlm_unlockargs nlm_unlock_1_arg;
105 struct nlm_testargs nlm_granted_1_arg;
106 struct nlm_testargs nlm_test_msg_1_arg;
107 struct nlm_lockargs nlm_lock_msg_1_arg;
108 struct nlm_cancargs nlm_cancel_msg_1_arg;
109 struct nlm_unlockargs nlm_unlock_msg_1_arg;
110 struct nlm_testargs nlm_granted_msg_1_arg;
111 nlm_testres nlm_test_res_1_arg;
112 nlm_res nlm_lock_res_1_arg;
113 nlm_res nlm_cancel_res_1_arg;
114 nlm_res nlm_unlock_res_1_arg;
115 nlm_res nlm_granted_res_1_arg;
116 } argument;
117 char *result;
118 xdrproc_t xdr_argument, xdr_result;
119 char *(*local)(char *, struct svc_req *);
120
121 _rpcsvcdirty = 1;
122 switch (rqstp->rq_proc) {
123 case NULLPROC:
124 (void) svc_sendreply(transp, (xdrproc_t) xdr_void, (char *)NULL);
125 _rpcsvcdirty = 0;
126 return;
127
128 case NLM_TEST:
129 xdr_argument = (xdrproc_t) xdr_nlm_testargs;
130 xdr_result = (xdrproc_t) xdr_nlm_testres;
131 local = (char *(*)(char *, struct svc_req *)) nlm_test_1_svc;
132 break;
133
134 case NLM_LOCK:
135 xdr_argument = (xdrproc_t) xdr_nlm_lockargs;
136 xdr_result = (xdrproc_t) xdr_nlm_res;
137 local = (char *(*)(char *, struct svc_req *)) nlm_lock_1_svc;
138 break;
139
140 case NLM_CANCEL:
141 xdr_argument = (xdrproc_t) xdr_nlm_cancargs;
142 xdr_result = (xdrproc_t) xdr_nlm_res;
143 local = (char *(*)(char *, struct svc_req *)) nlm_cancel_1_svc;
144 break;
145
146 case NLM_UNLOCK:
147 xdr_argument = (xdrproc_t) xdr_nlm_unlockargs;
148 xdr_result = (xdrproc_t) xdr_nlm_res;
149 local = (char *(*)(char *, struct svc_req *)) nlm_unlock_1_svc;
150 break;
151
152 case NLM_GRANTED:
153 xdr_argument = (xdrproc_t) xdr_nlm_testargs;
154 xdr_result = (xdrproc_t) xdr_nlm_res;
155 local = (char *(*)(char *, struct svc_req *)) nlm_granted_1_svc;
156 break;
157
158 case NLM_TEST_MSG:
159 xdr_argument = (xdrproc_t) xdr_nlm_testargs;
160 xdr_result = (xdrproc_t) xdr_void;
161 local = (char *(*)(char *, struct svc_req *)) nlm_test_msg_1_svc;
162 break;
163
164 case NLM_LOCK_MSG:
165 xdr_argument = (xdrproc_t) xdr_nlm_lockargs;
166 xdr_result = (xdrproc_t) xdr_void;
167 local = (char *(*)(char *, struct svc_req *)) nlm_lock_msg_1_svc;
168 break;
169
170 case NLM_CANCEL_MSG:
171 xdr_argument = (xdrproc_t) xdr_nlm_cancargs;
172 xdr_result = (xdrproc_t) xdr_void;
173 local = (char *(*)(char *, struct svc_req *)) nlm_cancel_msg_1_svc;
174 break;
175
176 case NLM_UNLOCK_MSG:
177 xdr_argument = (xdrproc_t) xdr_nlm_unlockargs;
178 xdr_result = (xdrproc_t) xdr_void;
179 local = (char *(*)(char *, struct svc_req *)) nlm_unlock_msg_1_svc;
180 break;
181
182 case NLM_GRANTED_MSG:
183 xdr_argument = (xdrproc_t) xdr_nlm_testargs;
184 xdr_result = (xdrproc_t) xdr_void;
185 local = (char *(*)(char *, struct svc_req *)) nlm_granted_msg_1_svc;
186 break;
187
188 case NLM_TEST_RES:
189 xdr_argument = (xdrproc_t) xdr_nlm_testres;
190 xdr_result = (xdrproc_t) xdr_void;
191 local = (char *(*)(char *, struct svc_req *)) nlm_test_res_1_svc;
192 break;
193
194 case NLM_LOCK_RES:
195 xdr_argument = (xdrproc_t) xdr_nlm_res;
196 xdr_result = (xdrproc_t) xdr_void;
197 local = (char *(*)(char *, struct svc_req *)) nlm_lock_res_1_svc;
198 break;
199
200 case NLM_CANCEL_RES:
201 xdr_argument = (xdrproc_t) xdr_nlm_res;
202 xdr_result = (xdrproc_t) xdr_void;
203 local = (char *(*)(char *, struct svc_req *)) nlm_cancel_res_1_svc;
204 break;
205
206 case NLM_UNLOCK_RES:
207 xdr_argument = (xdrproc_t) xdr_nlm_res;
208 xdr_result = (xdrproc_t) xdr_void;
209 local = (char *(*)(char *, struct svc_req *)) nlm_unlock_res_1_svc;
210 break;
211
212 case NLM_GRANTED_RES:
213 xdr_argument = (xdrproc_t) xdr_nlm_res;
214 xdr_result = (xdrproc_t) xdr_void;
215 local = (char *(*)(char *, struct svc_req *)) nlm_granted_res_1_svc;
216 break;
217
218 default:
219 svcerr_noproc(transp);
220 _rpcsvcdirty = 0;
221 return;
222 }
223 (void) memset((char *)&argument, 0, sizeof (argument));
224 if (!svc_getargs(transp, xdr_argument, (caddr_t) &argument)) {
225 svcerr_decode(transp);
226 _rpcsvcdirty = 0;
227 return;
228 }
229 result = (*local)((char *)&argument, rqstp);
230 if (result != NULL && !svc_sendreply(transp, xdr_result, result)) {
231 svcerr_systemerr(transp);
232 }
233 if (!svc_freeargs(transp, xdr_argument, (caddr_t) &argument)) {
234 syslog(LOG_ERR, "unable to free arguments");
235 exit(1);
236 }
237 _rpcsvcdirty = 0;
238 if ((local == (char *(*)(char *, struct svc_req *)) nlm_unlock_1_svc) ||
239 (local == (char *(*)(char *, struct svc_req *)) nlm_unlock_msg_1_svc)) {
240 // XXX sending granted messages before unlock response
241 // XXX causes unlock response to be corrupted?
242 // XXX so do this after we send any response
243 retry_blockingfilelocklist();
244 }
245 return;
246}
247
248void nlm_prog_3(struct svc_req *rqstp, SVCXPRT *transp);
249
250void
251nlm_prog_3(struct svc_req *rqstp, SVCXPRT *transp)
252{
253 union {
254 struct nlm_testargs nlm_test_3_arg;
255 struct nlm_lockargs nlm_lock_3_arg;
256 struct nlm_cancargs nlm_cancel_3_arg;
257 struct nlm_unlockargs nlm_unlock_3_arg;
258 struct nlm_testargs nlm_granted_3_arg;
259 struct nlm_testargs nlm_test_msg_3_arg;
260 struct nlm_lockargs nlm_lock_msg_3_arg;
261 struct nlm_cancargs nlm_cancel_msg_3_arg;
262 struct nlm_unlockargs nlm_unlock_msg_3_arg;
263 struct nlm_testargs nlm_granted_msg_3_arg;
264 nlm_testres nlm_test_res_3_arg;
265 nlm_res nlm_lock_res_3_arg;
266 nlm_res nlm_cancel_res_3_arg;
267 nlm_res nlm_unlock_res_3_arg;
268 nlm_res nlm_granted_res_3_arg;
269 nlm_shareargs nlm_share_3_arg;
270 nlm_shareargs nlm_unshare_3_arg;
271 nlm_lockargs nlm_nm_lock_3_arg;
272 nlm_notify nlm_free_all_3_arg;
273 } argument;
274 char *result;
275 xdrproc_t xdr_argument, xdr_result;
276 char *(*local)(char *, struct svc_req *);
277
278 _rpcsvcdirty = 1;
279 switch (rqstp->rq_proc) {
280 case NULLPROC:
281 (void) svc_sendreply(transp, (xdrproc_t) xdr_void, (char *)NULL);
282 _rpcsvcdirty = 0;
283 return;
284
285 case NLM_TEST:
286 xdr_argument = (xdrproc_t) xdr_nlm_testargs;
287 xdr_result = (xdrproc_t) xdr_nlm_testres;
288 local = (char *(*)(char *, struct svc_req *)) nlm_test_1_svc;
289 break;
290
291 case NLM_LOCK:
292 xdr_argument = (xdrproc_t) xdr_nlm_lockargs;
293 xdr_result = (xdrproc_t) xdr_nlm_res;
294 local = (char *(*)(char *, struct svc_req *)) nlm_lock_1_svc;
295 break;
296
297 case NLM_CANCEL:
298 xdr_argument = (xdrproc_t) xdr_nlm_cancargs;
299 xdr_result = (xdrproc_t) xdr_nlm_res;
300 local = (char *(*)(char *, struct svc_req *)) nlm_cancel_1_svc;
301 break;
302
303 case NLM_UNLOCK:
304 xdr_argument = (xdrproc_t) xdr_nlm_unlockargs;
305 xdr_result = (xdrproc_t) xdr_nlm_res;
306 local = (char *(*)(char *, struct svc_req *)) nlm_unlock_1_svc;
307 break;
308
309 case NLM_GRANTED:
310 xdr_argument = (xdrproc_t) xdr_nlm_testargs;
311 xdr_result = (xdrproc_t) xdr_nlm_res;
312 local = (char *(*)(char *, struct svc_req *)) nlm_granted_1_svc;
313 break;
314
315 case NLM_TEST_MSG:
316 xdr_argument = (xdrproc_t) xdr_nlm_testargs;
317 xdr_result = (xdrproc_t) xdr_void;
318 local = (char *(*)(char *, struct svc_req *)) nlm_test_msg_1_svc;
319 break;
320
321 case NLM_LOCK_MSG:
322 xdr_argument = (xdrproc_t) xdr_nlm_lockargs;
323 xdr_result = (xdrproc_t) xdr_void;
324 local = (char *(*)(char *, struct svc_req *)) nlm_lock_msg_1_svc;
325 break;
326
327 case NLM_CANCEL_MSG:
328 xdr_argument = (xdrproc_t) xdr_nlm_cancargs;
329 xdr_result = (xdrproc_t) xdr_void;
330 local = (char *(*)(char *, struct svc_req *)) nlm_cancel_msg_1_svc;
331 break;
332
333 case NLM_UNLOCK_MSG:
334 xdr_argument = (xdrproc_t) xdr_nlm_unlockargs;
335 xdr_result = (xdrproc_t) xdr_void;
336 local = (char *(*)(char *, struct svc_req *)) nlm_unlock_msg_1_svc;
337 break;
338
339 case NLM_GRANTED_MSG:
340 xdr_argument = (xdrproc_t) xdr_nlm_testargs;
341 xdr_result = (xdrproc_t) xdr_void;
342 local = (char *(*)(char *, struct svc_req *)) nlm_granted_msg_1_svc;
343 break;
344
345 case NLM_TEST_RES:
346 xdr_argument = (xdrproc_t) xdr_nlm_testres;
347 xdr_result = (xdrproc_t) xdr_void;
348 local = (char *(*)(char *, struct svc_req *)) nlm_test_res_1_svc;
349 break;
350
351 case NLM_LOCK_RES:
352 xdr_argument = (xdrproc_t) xdr_nlm_res;
353 xdr_result = (xdrproc_t) xdr_void;
354 local = (char *(*)(char *, struct svc_req *)) nlm_lock_res_1_svc;
355 break;
356
357 case NLM_CANCEL_RES:
358 xdr_argument = (xdrproc_t) xdr_nlm_res;
359 xdr_result = (xdrproc_t) xdr_void;
360 local = (char *(*)(char *, struct svc_req *)) nlm_cancel_res_1_svc;
361 break;
362
363 case NLM_UNLOCK_RES:
364 xdr_argument = (xdrproc_t) xdr_nlm_res;
365 xdr_result = (xdrproc_t) xdr_void;
366 local = (char *(*)(char *, struct svc_req *)) nlm_unlock_res_1_svc;
367 break;
368
369 case NLM_GRANTED_RES:
370 xdr_argument = (xdrproc_t) xdr_nlm_res;
371 xdr_result = (xdrproc_t) xdr_void;
372 local = (char *(*)(char *, struct svc_req *)) nlm_granted_res_1_svc;
373 break;
374
375 case NLM_SHARE:
376 xdr_argument = (xdrproc_t) xdr_nlm_shareargs;
377 xdr_result = (xdrproc_t) xdr_nlm_shareres;
378 local = (char *(*)(char *, struct svc_req *)) nlm_share_3_svc;
379 break;
380
381 case NLM_UNSHARE:
382 xdr_argument = (xdrproc_t) xdr_nlm_shareargs;
383 xdr_result = (xdrproc_t) xdr_nlm_shareres;
384 local = (char *(*)(char *, struct svc_req *)) nlm_unshare_3_svc;
385 break;
386
387 case NLM_NM_LOCK:
388 xdr_argument = (xdrproc_t) xdr_nlm_lockargs;
389 xdr_result = (xdrproc_t) xdr_nlm_res;
390 local = (char *(*)(char *, struct svc_req *)) nlm_nm_lock_3_svc;
391 break;
392
393 case NLM_FREE_ALL:
394 xdr_argument = (xdrproc_t) xdr_nlm_notify;
395 xdr_result = (xdrproc_t) xdr_void;
396 local = (char *(*)(char *, struct svc_req *)) nlm_free_all_3_svc;
397 break;
398
399 default:
400 svcerr_noproc(transp);
401 _rpcsvcdirty = 0;
402 return;
403 }
404 (void) memset((char *)&argument, 0, sizeof (argument));
405 if (!svc_getargs(transp, xdr_argument, (caddr_t) &argument)) {
406 svcerr_decode(transp);
407 _rpcsvcdirty = 0;
408 return;
409 }
410 result = (*local)((char *)&argument, rqstp);
411 if (result != NULL && !svc_sendreply(transp, xdr_result, result)) {
412 svcerr_systemerr(transp);
413 }
414 if (!svc_freeargs(transp, xdr_argument, (caddr_t) &argument)) {
415 syslog(LOG_ERR, "unable to free arguments");
416 exit(1);
417 }
418 _rpcsvcdirty = 0;
419 if ((local == (char *(*)(char *, struct svc_req *)) nlm_unlock_1_svc) ||
420 (local == (char *(*)(char *, struct svc_req *)) nlm_unlock_msg_1_svc) ||
421 (local == (char *(*)(char *, struct svc_req *)) nlm_free_all_3_svc)) {
422 // XXX sending granted messages before unlock response
423 // XXX causes unlock response to be corrupted?
424 // XXX so do this after we send any response
425 retry_blockingfilelocklist();
426 }
427 return;
428}
429
430void nlm_prog_4(struct svc_req *rqstp, SVCXPRT *transp);
431
432void
433nlm_prog_4(struct svc_req *rqstp, SVCXPRT *transp)
434{
435 union {
436 nlm4_testargs nlm4_test_4_arg;
437 nlm4_lockargs nlm4_lock_4_arg;
438 nlm4_cancargs nlm4_cancel_4_arg;
439 nlm4_unlockargs nlm4_unlock_4_arg;
440 nlm4_testargs nlm4_granted_4_arg;
441 nlm4_testargs nlm4_test_msg_4_arg;
442 nlm4_lockargs nlm4_lock_msg_4_arg;
443 nlm4_cancargs nlm4_cancel_msg_4_arg;
444 nlm4_unlockargs nlm4_unlock_msg_4_arg;
445 nlm4_testargs nlm4_granted_msg_4_arg;
446 nlm4_testres nlm4_test_res_4_arg;
447 nlm4_res nlm4_lock_res_4_arg;
448 nlm4_res nlm4_cancel_res_4_arg;
449 nlm4_res nlm4_unlock_res_4_arg;
450 nlm4_res nlm4_granted_res_4_arg;
451 nlm4_shareargs nlm4_share_4_arg;
452 nlm4_shareargs nlm4_unshare_4_arg;
453 nlm4_lockargs nlm4_nm_lock_4_arg;
454 nlm4_notify nlm4_free_all_4_arg;
455 } argument;
456 char *result;
457 xdrproc_t xdr_argument, xdr_result;
458 char *(*local)(char *, struct svc_req *);
459
460 _rpcsvcdirty = 1;
461 switch (rqstp->rq_proc) {
462 case NULLPROC:
463 (void) svc_sendreply(transp, (xdrproc_t) xdr_void, (char *)NULL);
464 _rpcsvcdirty = 0;
465 return;
466
467 case NLM4_TEST:
468 xdr_argument = (xdrproc_t) xdr_nlm4_testargs;
469 xdr_result = (xdrproc_t) xdr_nlm4_testres;
470 local = (char *(*)(char *, struct svc_req *)) nlm4_test_4_svc;
471 break;
472
473 case NLM4_LOCK:
474 xdr_argument = (xdrproc_t) xdr_nlm4_lockargs;
475 xdr_result = (xdrproc_t) xdr_nlm4_res;
476 local = (char *(*)(char *, struct svc_req *)) nlm4_lock_4_svc;
477 break;
478
479 case NLM4_CANCEL:
480 xdr_argument = (xdrproc_t) xdr_nlm4_cancargs;
481 xdr_result = (xdrproc_t) xdr_nlm4_res;
482 local = (char *(*)(char *, struct svc_req *)) nlm4_cancel_4_svc;
483 break;
484
485 case NLM4_UNLOCK:
486 xdr_argument = (xdrproc_t) xdr_nlm4_unlockargs;
487 xdr_result = (xdrproc_t) xdr_nlm4_res;
488 local = (char *(*)(char *, struct svc_req *)) nlm4_unlock_4_svc;
489 break;
490
491 case NLM4_GRANTED:
492 xdr_argument = (xdrproc_t) xdr_nlm4_testargs;
493 xdr_result = (xdrproc_t) xdr_nlm4_res;
494 local = (char *(*)(char *, struct svc_req *)) nlm4_granted_4_svc;
495 break;
496
497 case NLM4_TEST_MSG:
498 xdr_argument = (xdrproc_t) xdr_nlm4_testargs;
499 xdr_result = (xdrproc_t) xdr_void;
500 local = (char *(*)(char *, struct svc_req *)) nlm4_test_msg_4_svc;
501 break;
502
503 case NLM4_LOCK_MSG:
504 xdr_argument = (xdrproc_t) xdr_nlm4_lockargs;
505 xdr_result = (xdrproc_t) xdr_void;
506 local = (char *(*)(char *, struct svc_req *)) nlm4_lock_msg_4_svc;
507 break;
508
509 case NLM4_CANCEL_MSG:
510 xdr_argument = (xdrproc_t) xdr_nlm4_cancargs;
511 xdr_result = (xdrproc_t) xdr_void;
512 local = (char *(*)(char *, struct svc_req *)) nlm4_cancel_msg_4_svc;
513 break;
514
515 case NLM4_UNLOCK_MSG:
516 xdr_argument = (xdrproc_t) xdr_nlm4_unlockargs;
517 xdr_result = (xdrproc_t) xdr_void;
518 local = (char *(*)(char *, struct svc_req *)) nlm4_unlock_msg_4_svc;
519 break;
520
521 case NLM4_GRANTED_MSG:
522 xdr_argument = (xdrproc_t) xdr_nlm4_testargs;
523 xdr_result = (xdrproc_t) xdr_void;
524 local = (char *(*)(char *, struct svc_req *)) nlm4_granted_msg_4_svc;
525 break;
526
527 case NLM4_TEST_RES:
528 xdr_argument = (xdrproc_t) xdr_nlm4_testres;
529 xdr_result = (xdrproc_t) xdr_void;
530 local = (char *(*)(char *, struct svc_req *)) nlm4_test_res_4_svc;
531 break;
532
533 case NLM4_LOCK_RES:
534 xdr_argument = (xdrproc_t) xdr_nlm4_res;
535 xdr_result = (xdrproc_t) xdr_void;
536 local = (char *(*)(char *, struct svc_req *)) nlm4_lock_res_4_svc;
537 break;
538
539 case NLM4_CANCEL_RES:
540 xdr_argument = (xdrproc_t) xdr_nlm4_res;
541 xdr_result = (xdrproc_t) xdr_void;
542 local = (char *(*)(char *, struct svc_req *)) nlm4_cancel_res_4_svc;
543 break;
544
545 case NLM4_UNLOCK_RES:
546 xdr_argument = (xdrproc_t) xdr_nlm4_res;
547 xdr_result = (xdrproc_t) xdr_void;
548 local = (char *(*)(char *, struct svc_req *)) nlm4_unlock_res_4_svc;
549 break;
550
551 case NLM4_GRANTED_RES:
552 xdr_argument = (xdrproc_t) xdr_nlm4_res;
553 xdr_result = (xdrproc_t) xdr_void;
554 local = (char *(*)(char *, struct svc_req *)) nlm4_granted_res_4_svc;
555 break;
556
557 case NLM4_SHARE:
558 xdr_argument = (xdrproc_t) xdr_nlm4_shareargs;
559 xdr_result = (xdrproc_t) xdr_nlm4_shareres;
560 local = (char *(*)(char *, struct svc_req *)) nlm4_share_4_svc;
561 break;
562
563 case NLM4_UNSHARE:
564 xdr_argument = (xdrproc_t) xdr_nlm4_shareargs;
565 xdr_result = (xdrproc_t) xdr_nlm4_shareres;
566 local = (char *(*)(char *, struct svc_req *)) nlm4_unshare_4_svc;
567 break;
568
569 case NLM4_NM_LOCK:
570 xdr_argument = (xdrproc_t) xdr_nlm4_lockargs;
571 xdr_result = (xdrproc_t) xdr_nlm4_res;
572 local = (char *(*)(char *, struct svc_req *)) nlm4_nm_lock_4_svc;
573 break;
574
575 case NLM4_FREE_ALL:
576 xdr_argument = (xdrproc_t) xdr_nlm4_notify;
577 xdr_result = (xdrproc_t) xdr_void;
578 local = (char *(*)(char *, struct svc_req *)) nlm4_free_all_4_svc;
579 break;
580
581 default:
582 svcerr_noproc(transp);
583 _rpcsvcdirty = 0;
584 return;
585 }
586 (void) memset((char *)&argument, 0, sizeof (argument));
587 if (!svc_getargs(transp, xdr_argument, (caddr_t) &argument)) {
588 svcerr_decode(transp);
589 _rpcsvcdirty = 0;
590 return;
591 }
592 result = (*local)((char *)&argument, rqstp);
593 if (result != NULL && !svc_sendreply(transp, xdr_result, result)) {
594 svcerr_systemerr(transp);
595 }
596 if (!svc_freeargs(transp, xdr_argument, (caddr_t) &argument)) {
597 syslog(LOG_ERR, "unable to free arguments");
598 exit(1);
599 }
600 _rpcsvcdirty = 0;
601 if ((local == (char *(*)(char *, struct svc_req *)) nlm4_unlock_4_svc) ||
602 (local == (char *(*)(char *, struct svc_req *)) nlm4_unlock_msg_4_svc) ||
603 (local == (char *(*)(char *, struct svc_req *)) nlm4_free_all_4_svc)) {
604 // XXX sending granted messages before unlock response
605 // XXX causes unlock response to be corrupted?
606 // XXX so do this after we send any response
607 retry_blockingfilelocklist();
608 }
609 return;
610}