2 * Please do not edit this file.
3 * It was generated using rpcgen.
4 * (and subsequently cleaned up by hand)
7 #include <rpcsvc/nlm_prot.h>
13 #include <rpc/pmap_clnt.h>
17 #include <sys/ttycom.h>
20 #endif /* __cplusplus */
22 #include <sys/socket.h>
23 #include <netinet/in.h>
27 #define SIG_PF void(*)(int)
35 void retry_blockingfilelocklist(netobj
*fh
);
36 extern int need_retry_blocked_locks
; /* need to call retry_blockingfilelocklist() */
38 #define _RPCSVC_CLOSEDOWN 120
40 /*static char sccsid[] = "from: @(#)nlm_prot.x 1.8 87/09/21 Copyr 1987 Sun Micro";*/
41 /*static char sccsid[] = "from: * @(#)nlm_prot.x 2.1 88/08/01 4.0 RPCSRC";*/
42 static char rcsid
[] = "$Id: nlm_prot_svc.c,v 1.5 2004/03/11 23:52:19 lindak Exp $";
44 extern int _rpcpmstart
; /* Started by a port monitor ? */
45 extern int _rpcfdtype
; /* Whether Stream or Datagram ? */
46 extern int _rpcsvcdirty
; /* Still serving ? */
48 void nlm_prog_0(struct svc_req
*rqstp
, SVCXPRT
*transp
);
51 nlm_prog_0(struct svc_req
*rqstp
, SVCXPRT
*transp
)
54 struct nlm_sm_status nlm_sm_notify_0_arg
;
57 xdrproc_t xdr_argument
, xdr_result
;
58 char *(*local
)(char *, struct svc_req
*);
61 switch (rqstp
->rq_proc
) {
63 (void) svc_sendreply(transp
, (xdrproc_t
) xdr_void
, (char *)NULL
);
68 xdr_argument
= (xdrproc_t
) xdr_nlm_sm_status
;
69 xdr_result
= (xdrproc_t
) xdr_void
;
70 local
= (char *(*)(char *, struct svc_req
*)) nlm_sm_notify_0_svc
;
74 svcerr_noproc(transp
);
78 (void) memset((char *)&argument
, 0, sizeof (argument
));
79 if (!svc_getargs(transp
, xdr_argument
, (caddr_t
) &argument
)) {
80 svcerr_decode(transp
);
84 result
= (*local
)((char *)&argument
, rqstp
);
85 if (result
!= NULL
&& !svc_sendreply(transp
, xdr_result
, result
)) {
86 svcerr_systemerr(transp
);
88 if (!svc_freeargs(transp
, xdr_argument
, (caddr_t
) &argument
)) {
89 syslog(LOG_ERR
, "unable to free arguments");
96 void nlm_prog_1(struct svc_req
*rqstp
, SVCXPRT
*transp
);
99 nlm_prog_1(struct svc_req
*rqstp
, SVCXPRT
*transp
)
102 struct nlm_testargs nlm_test_1_arg
;
103 struct nlm_lockargs nlm_lock_1_arg
;
104 struct nlm_cancargs nlm_cancel_1_arg
;
105 struct nlm_unlockargs nlm_unlock_1_arg
;
106 struct nlm_testargs nlm_granted_1_arg
;
107 struct nlm_testargs nlm_test_msg_1_arg
;
108 struct nlm_lockargs nlm_lock_msg_1_arg
;
109 struct nlm_cancargs nlm_cancel_msg_1_arg
;
110 struct nlm_unlockargs nlm_unlock_msg_1_arg
;
111 struct nlm_testargs nlm_granted_msg_1_arg
;
112 nlm_testres nlm_test_res_1_arg
;
113 nlm_res nlm_lock_res_1_arg
;
114 nlm_res nlm_cancel_res_1_arg
;
115 nlm_res nlm_unlock_res_1_arg
;
116 nlm_res nlm_granted_res_1_arg
;
119 xdrproc_t xdr_argument
, xdr_result
;
120 char *(*local
)(char *, struct svc_req
*);
123 switch (rqstp
->rq_proc
) {
125 (void) svc_sendreply(transp
, (xdrproc_t
) xdr_void
, (char *)NULL
);
130 xdr_argument
= (xdrproc_t
) xdr_nlm_testargs
;
131 xdr_result
= (xdrproc_t
) xdr_nlm_testres
;
132 local
= (char *(*)(char *, struct svc_req
*)) nlm_test_1_svc
;
136 xdr_argument
= (xdrproc_t
) xdr_nlm_lockargs
;
137 xdr_result
= (xdrproc_t
) xdr_nlm_res
;
138 local
= (char *(*)(char *, struct svc_req
*)) nlm_lock_1_svc
;
142 xdr_argument
= (xdrproc_t
) xdr_nlm_cancargs
;
143 xdr_result
= (xdrproc_t
) xdr_nlm_res
;
144 local
= (char *(*)(char *, struct svc_req
*)) nlm_cancel_1_svc
;
148 xdr_argument
= (xdrproc_t
) xdr_nlm_unlockargs
;
149 xdr_result
= (xdrproc_t
) xdr_nlm_res
;
150 local
= (char *(*)(char *, struct svc_req
*)) nlm_unlock_1_svc
;
154 xdr_argument
= (xdrproc_t
) xdr_nlm_testargs
;
155 xdr_result
= (xdrproc_t
) xdr_nlm_res
;
156 local
= (char *(*)(char *, struct svc_req
*)) nlm_granted_1_svc
;
160 xdr_argument
= (xdrproc_t
) xdr_nlm_testargs
;
161 xdr_result
= (xdrproc_t
) xdr_void
;
162 local
= (char *(*)(char *, struct svc_req
*)) nlm_test_msg_1_svc
;
166 xdr_argument
= (xdrproc_t
) xdr_nlm_lockargs
;
167 xdr_result
= (xdrproc_t
) xdr_void
;
168 local
= (char *(*)(char *, struct svc_req
*)) nlm_lock_msg_1_svc
;
172 xdr_argument
= (xdrproc_t
) xdr_nlm_cancargs
;
173 xdr_result
= (xdrproc_t
) xdr_void
;
174 local
= (char *(*)(char *, struct svc_req
*)) nlm_cancel_msg_1_svc
;
178 xdr_argument
= (xdrproc_t
) xdr_nlm_unlockargs
;
179 xdr_result
= (xdrproc_t
) xdr_void
;
180 local
= (char *(*)(char *, struct svc_req
*)) nlm_unlock_msg_1_svc
;
183 case NLM_GRANTED_MSG
:
184 xdr_argument
= (xdrproc_t
) xdr_nlm_testargs
;
185 xdr_result
= (xdrproc_t
) xdr_void
;
186 local
= (char *(*)(char *, struct svc_req
*)) nlm_granted_msg_1_svc
;
190 xdr_argument
= (xdrproc_t
) xdr_nlm_testres
;
191 xdr_result
= (xdrproc_t
) xdr_void
;
192 local
= (char *(*)(char *, struct svc_req
*)) nlm_test_res_1_svc
;
196 xdr_argument
= (xdrproc_t
) xdr_nlm_res
;
197 xdr_result
= (xdrproc_t
) xdr_void
;
198 local
= (char *(*)(char *, struct svc_req
*)) nlm_lock_res_1_svc
;
202 xdr_argument
= (xdrproc_t
) xdr_nlm_res
;
203 xdr_result
= (xdrproc_t
) xdr_void
;
204 local
= (char *(*)(char *, struct svc_req
*)) nlm_cancel_res_1_svc
;
208 xdr_argument
= (xdrproc_t
) xdr_nlm_res
;
209 xdr_result
= (xdrproc_t
) xdr_void
;
210 local
= (char *(*)(char *, struct svc_req
*)) nlm_unlock_res_1_svc
;
213 case NLM_GRANTED_RES
:
214 xdr_argument
= (xdrproc_t
) xdr_nlm_res
;
215 xdr_result
= (xdrproc_t
) xdr_void
;
216 local
= (char *(*)(char *, struct svc_req
*)) nlm_granted_res_1_svc
;
220 svcerr_noproc(transp
);
224 (void) memset((char *)&argument
, 0, sizeof (argument
));
225 if (!svc_getargs(transp
, xdr_argument
, (caddr_t
) &argument
)) {
226 svcerr_decode(transp
);
230 result
= (*local
)((char *)&argument
, rqstp
);
231 if (result
!= NULL
&& !svc_sendreply(transp
, xdr_result
, result
)) {
232 svcerr_systemerr(transp
);
234 if (need_retry_blocked_locks
) {
235 // XXX sending granted messages before unlock response
236 // XXX causes unlock response to be corrupted?
237 // XXX so do this after we send any response
239 if ((local
== (char *(*)(char *, struct svc_req
*)) nlm_unlock_1_svc
) ||
240 (local
== (char *(*)(char *, struct svc_req
*)) nlm_unlock_msg_1_svc
))
241 fh
= &argument
.nlm_unlock_1_arg
.alock
.fh
;
242 retry_blockingfilelocklist(fh
);
244 if (!svc_freeargs(transp
, xdr_argument
, (caddr_t
) &argument
)) {
245 syslog(LOG_ERR
, "unable to free arguments");
252 void nlm_prog_3(struct svc_req
*rqstp
, SVCXPRT
*transp
);
255 nlm_prog_3(struct svc_req
*rqstp
, SVCXPRT
*transp
)
258 struct nlm_testargs nlm_test_3_arg
;
259 struct nlm_lockargs nlm_lock_3_arg
;
260 struct nlm_cancargs nlm_cancel_3_arg
;
261 struct nlm_unlockargs nlm_unlock_3_arg
;
262 struct nlm_testargs nlm_granted_3_arg
;
263 struct nlm_testargs nlm_test_msg_3_arg
;
264 struct nlm_lockargs nlm_lock_msg_3_arg
;
265 struct nlm_cancargs nlm_cancel_msg_3_arg
;
266 struct nlm_unlockargs nlm_unlock_msg_3_arg
;
267 struct nlm_testargs nlm_granted_msg_3_arg
;
268 nlm_testres nlm_test_res_3_arg
;
269 nlm_res nlm_lock_res_3_arg
;
270 nlm_res nlm_cancel_res_3_arg
;
271 nlm_res nlm_unlock_res_3_arg
;
272 nlm_res nlm_granted_res_3_arg
;
273 nlm_shareargs nlm_share_3_arg
;
274 nlm_shareargs nlm_unshare_3_arg
;
275 nlm_lockargs nlm_nm_lock_3_arg
;
276 nlm_notify nlm_free_all_3_arg
;
279 xdrproc_t xdr_argument
, xdr_result
;
280 char *(*local
)(char *, struct svc_req
*);
283 switch (rqstp
->rq_proc
) {
285 (void) svc_sendreply(transp
, (xdrproc_t
) xdr_void
, (char *)NULL
);
290 xdr_argument
= (xdrproc_t
) xdr_nlm_testargs
;
291 xdr_result
= (xdrproc_t
) xdr_nlm_testres
;
292 local
= (char *(*)(char *, struct svc_req
*)) nlm_test_1_svc
;
296 xdr_argument
= (xdrproc_t
) xdr_nlm_lockargs
;
297 xdr_result
= (xdrproc_t
) xdr_nlm_res
;
298 local
= (char *(*)(char *, struct svc_req
*)) nlm_lock_1_svc
;
302 xdr_argument
= (xdrproc_t
) xdr_nlm_cancargs
;
303 xdr_result
= (xdrproc_t
) xdr_nlm_res
;
304 local
= (char *(*)(char *, struct svc_req
*)) nlm_cancel_1_svc
;
308 xdr_argument
= (xdrproc_t
) xdr_nlm_unlockargs
;
309 xdr_result
= (xdrproc_t
) xdr_nlm_res
;
310 local
= (char *(*)(char *, struct svc_req
*)) nlm_unlock_1_svc
;
314 xdr_argument
= (xdrproc_t
) xdr_nlm_testargs
;
315 xdr_result
= (xdrproc_t
) xdr_nlm_res
;
316 local
= (char *(*)(char *, struct svc_req
*)) nlm_granted_1_svc
;
320 xdr_argument
= (xdrproc_t
) xdr_nlm_testargs
;
321 xdr_result
= (xdrproc_t
) xdr_void
;
322 local
= (char *(*)(char *, struct svc_req
*)) nlm_test_msg_1_svc
;
326 xdr_argument
= (xdrproc_t
) xdr_nlm_lockargs
;
327 xdr_result
= (xdrproc_t
) xdr_void
;
328 local
= (char *(*)(char *, struct svc_req
*)) nlm_lock_msg_1_svc
;
332 xdr_argument
= (xdrproc_t
) xdr_nlm_cancargs
;
333 xdr_result
= (xdrproc_t
) xdr_void
;
334 local
= (char *(*)(char *, struct svc_req
*)) nlm_cancel_msg_1_svc
;
338 xdr_argument
= (xdrproc_t
) xdr_nlm_unlockargs
;
339 xdr_result
= (xdrproc_t
) xdr_void
;
340 local
= (char *(*)(char *, struct svc_req
*)) nlm_unlock_msg_1_svc
;
343 case NLM_GRANTED_MSG
:
344 xdr_argument
= (xdrproc_t
) xdr_nlm_testargs
;
345 xdr_result
= (xdrproc_t
) xdr_void
;
346 local
= (char *(*)(char *, struct svc_req
*)) nlm_granted_msg_1_svc
;
350 xdr_argument
= (xdrproc_t
) xdr_nlm_testres
;
351 xdr_result
= (xdrproc_t
) xdr_void
;
352 local
= (char *(*)(char *, struct svc_req
*)) nlm_test_res_1_svc
;
356 xdr_argument
= (xdrproc_t
) xdr_nlm_res
;
357 xdr_result
= (xdrproc_t
) xdr_void
;
358 local
= (char *(*)(char *, struct svc_req
*)) nlm_lock_res_1_svc
;
362 xdr_argument
= (xdrproc_t
) xdr_nlm_res
;
363 xdr_result
= (xdrproc_t
) xdr_void
;
364 local
= (char *(*)(char *, struct svc_req
*)) nlm_cancel_res_1_svc
;
368 xdr_argument
= (xdrproc_t
) xdr_nlm_res
;
369 xdr_result
= (xdrproc_t
) xdr_void
;
370 local
= (char *(*)(char *, struct svc_req
*)) nlm_unlock_res_1_svc
;
373 case NLM_GRANTED_RES
:
374 xdr_argument
= (xdrproc_t
) xdr_nlm_res
;
375 xdr_result
= (xdrproc_t
) xdr_void
;
376 local
= (char *(*)(char *, struct svc_req
*)) nlm_granted_res_1_svc
;
380 xdr_argument
= (xdrproc_t
) xdr_nlm_shareargs
;
381 xdr_result
= (xdrproc_t
) xdr_nlm_shareres
;
382 local
= (char *(*)(char *, struct svc_req
*)) nlm_share_3_svc
;
386 xdr_argument
= (xdrproc_t
) xdr_nlm_shareargs
;
387 xdr_result
= (xdrproc_t
) xdr_nlm_shareres
;
388 local
= (char *(*)(char *, struct svc_req
*)) nlm_unshare_3_svc
;
392 xdr_argument
= (xdrproc_t
) xdr_nlm_lockargs
;
393 xdr_result
= (xdrproc_t
) xdr_nlm_res
;
394 local
= (char *(*)(char *, struct svc_req
*)) nlm_nm_lock_3_svc
;
398 xdr_argument
= (xdrproc_t
) xdr_nlm_notify
;
399 xdr_result
= (xdrproc_t
) xdr_void
;
400 local
= (char *(*)(char *, struct svc_req
*)) nlm_free_all_3_svc
;
404 svcerr_noproc(transp
);
408 (void) memset((char *)&argument
, 0, sizeof (argument
));
409 if (!svc_getargs(transp
, xdr_argument
, (caddr_t
) &argument
)) {
410 svcerr_decode(transp
);
414 result
= (*local
)((char *)&argument
, rqstp
);
415 if (result
!= NULL
&& !svc_sendreply(transp
, xdr_result
, result
)) {
416 svcerr_systemerr(transp
);
418 if (need_retry_blocked_locks
) {
419 // XXX sending granted messages before unlock response
420 // XXX causes unlock response to be corrupted?
421 // XXX so do this after we send any response
423 if ((local
== (char *(*)(char *, struct svc_req
*)) nlm_unlock_1_svc
) ||
424 (local
== (char *(*)(char *, struct svc_req
*)) nlm_unlock_msg_1_svc
))
425 fh
= &argument
.nlm_unlock_3_arg
.alock
.fh
;
426 retry_blockingfilelocklist(fh
);
428 if (!svc_freeargs(transp
, xdr_argument
, (caddr_t
) &argument
)) {
429 syslog(LOG_ERR
, "unable to free arguments");
436 void nlm_prog_4(struct svc_req
*rqstp
, SVCXPRT
*transp
);
439 nlm_prog_4(struct svc_req
*rqstp
, SVCXPRT
*transp
)
442 nlm4_testargs nlm4_test_4_arg
;
443 nlm4_lockargs nlm4_lock_4_arg
;
444 nlm4_cancargs nlm4_cancel_4_arg
;
445 nlm4_unlockargs nlm4_unlock_4_arg
;
446 nlm4_testargs nlm4_granted_4_arg
;
447 nlm4_testargs nlm4_test_msg_4_arg
;
448 nlm4_lockargs nlm4_lock_msg_4_arg
;
449 nlm4_cancargs nlm4_cancel_msg_4_arg
;
450 nlm4_unlockargs nlm4_unlock_msg_4_arg
;
451 nlm4_testargs nlm4_granted_msg_4_arg
;
452 nlm4_testres nlm4_test_res_4_arg
;
453 nlm4_res nlm4_lock_res_4_arg
;
454 nlm4_res nlm4_cancel_res_4_arg
;
455 nlm4_res nlm4_unlock_res_4_arg
;
456 nlm4_res nlm4_granted_res_4_arg
;
457 nlm4_shareargs nlm4_share_4_arg
;
458 nlm4_shareargs nlm4_unshare_4_arg
;
459 nlm4_lockargs nlm4_nm_lock_4_arg
;
460 nlm4_notify nlm4_free_all_4_arg
;
463 xdrproc_t xdr_argument
, xdr_result
;
464 char *(*local
)(char *, struct svc_req
*);
467 switch (rqstp
->rq_proc
) {
469 (void) svc_sendreply(transp
, (xdrproc_t
) xdr_void
, (char *)NULL
);
474 xdr_argument
= (xdrproc_t
) xdr_nlm4_testargs
;
475 xdr_result
= (xdrproc_t
) xdr_nlm4_testres
;
476 local
= (char *(*)(char *, struct svc_req
*)) nlm4_test_4_svc
;
480 xdr_argument
= (xdrproc_t
) xdr_nlm4_lockargs
;
481 xdr_result
= (xdrproc_t
) xdr_nlm4_res
;
482 local
= (char *(*)(char *, struct svc_req
*)) nlm4_lock_4_svc
;
486 xdr_argument
= (xdrproc_t
) xdr_nlm4_cancargs
;
487 xdr_result
= (xdrproc_t
) xdr_nlm4_res
;
488 local
= (char *(*)(char *, struct svc_req
*)) nlm4_cancel_4_svc
;
492 xdr_argument
= (xdrproc_t
) xdr_nlm4_unlockargs
;
493 xdr_result
= (xdrproc_t
) xdr_nlm4_res
;
494 local
= (char *(*)(char *, struct svc_req
*)) nlm4_unlock_4_svc
;
498 xdr_argument
= (xdrproc_t
) xdr_nlm4_testargs
;
499 xdr_result
= (xdrproc_t
) xdr_nlm4_res
;
500 local
= (char *(*)(char *, struct svc_req
*)) nlm4_granted_4_svc
;
504 xdr_argument
= (xdrproc_t
) xdr_nlm4_testargs
;
505 xdr_result
= (xdrproc_t
) xdr_void
;
506 local
= (char *(*)(char *, struct svc_req
*)) nlm4_test_msg_4_svc
;
510 xdr_argument
= (xdrproc_t
) xdr_nlm4_lockargs
;
511 xdr_result
= (xdrproc_t
) xdr_void
;
512 local
= (char *(*)(char *, struct svc_req
*)) nlm4_lock_msg_4_svc
;
515 case NLM4_CANCEL_MSG
:
516 xdr_argument
= (xdrproc_t
) xdr_nlm4_cancargs
;
517 xdr_result
= (xdrproc_t
) xdr_void
;
518 local
= (char *(*)(char *, struct svc_req
*)) nlm4_cancel_msg_4_svc
;
521 case NLM4_UNLOCK_MSG
:
522 xdr_argument
= (xdrproc_t
) xdr_nlm4_unlockargs
;
523 xdr_result
= (xdrproc_t
) xdr_void
;
524 local
= (char *(*)(char *, struct svc_req
*)) nlm4_unlock_msg_4_svc
;
527 case NLM4_GRANTED_MSG
:
528 xdr_argument
= (xdrproc_t
) xdr_nlm4_testargs
;
529 xdr_result
= (xdrproc_t
) xdr_void
;
530 local
= (char *(*)(char *, struct svc_req
*)) nlm4_granted_msg_4_svc
;
534 xdr_argument
= (xdrproc_t
) xdr_nlm4_testres
;
535 xdr_result
= (xdrproc_t
) xdr_void
;
536 local
= (char *(*)(char *, struct svc_req
*)) nlm4_test_res_4_svc
;
540 xdr_argument
= (xdrproc_t
) xdr_nlm4_res
;
541 xdr_result
= (xdrproc_t
) xdr_void
;
542 local
= (char *(*)(char *, struct svc_req
*)) nlm4_lock_res_4_svc
;
545 case NLM4_CANCEL_RES
:
546 xdr_argument
= (xdrproc_t
) xdr_nlm4_res
;
547 xdr_result
= (xdrproc_t
) xdr_void
;
548 local
= (char *(*)(char *, struct svc_req
*)) nlm4_cancel_res_4_svc
;
551 case NLM4_UNLOCK_RES
:
552 xdr_argument
= (xdrproc_t
) xdr_nlm4_res
;
553 xdr_result
= (xdrproc_t
) xdr_void
;
554 local
= (char *(*)(char *, struct svc_req
*)) nlm4_unlock_res_4_svc
;
557 case NLM4_GRANTED_RES
:
558 xdr_argument
= (xdrproc_t
) xdr_nlm4_res
;
559 xdr_result
= (xdrproc_t
) xdr_void
;
560 local
= (char *(*)(char *, struct svc_req
*)) nlm4_granted_res_4_svc
;
564 xdr_argument
= (xdrproc_t
) xdr_nlm4_shareargs
;
565 xdr_result
= (xdrproc_t
) xdr_nlm4_shareres
;
566 local
= (char *(*)(char *, struct svc_req
*)) nlm4_share_4_svc
;
570 xdr_argument
= (xdrproc_t
) xdr_nlm4_shareargs
;
571 xdr_result
= (xdrproc_t
) xdr_nlm4_shareres
;
572 local
= (char *(*)(char *, struct svc_req
*)) nlm4_unshare_4_svc
;
576 xdr_argument
= (xdrproc_t
) xdr_nlm4_lockargs
;
577 xdr_result
= (xdrproc_t
) xdr_nlm4_res
;
578 local
= (char *(*)(char *, struct svc_req
*)) nlm4_nm_lock_4_svc
;
582 xdr_argument
= (xdrproc_t
) xdr_nlm4_notify
;
583 xdr_result
= (xdrproc_t
) xdr_void
;
584 local
= (char *(*)(char *, struct svc_req
*)) nlm4_free_all_4_svc
;
588 svcerr_noproc(transp
);
592 (void) memset((char *)&argument
, 0, sizeof (argument
));
593 if (!svc_getargs(transp
, xdr_argument
, (caddr_t
) &argument
)) {
594 svcerr_decode(transp
);
598 result
= (*local
)((char *)&argument
, rqstp
);
599 if (result
!= NULL
&& !svc_sendreply(transp
, xdr_result
, result
)) {
600 svcerr_systemerr(transp
);
602 if (need_retry_blocked_locks
) {
603 // XXX sending granted messages before unlock response
604 // XXX causes unlock response to be corrupted?
605 // XXX so do this after we send any response
607 if ((local
== (char *(*)(char *, struct svc_req
*)) nlm4_unlock_4_svc
) ||
608 (local
== (char *(*)(char *, struct svc_req
*)) nlm4_unlock_msg_4_svc
))
609 fh
= &argument
.nlm4_unlock_4_arg
.alock
.fh
;
610 retry_blockingfilelocklist(fh
);
612 if (!svc_freeargs(transp
, xdr_argument
, (caddr_t
) &argument
)) {
613 syslog(LOG_ERR
, "unable to free arguments");