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(void);
37 #define _RPCSVC_CLOSEDOWN 120
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";*/
41 static char rcsid
[] = "$Id: nlm_prot_svc.c,v 1.4 2003/07/24 05:11:22 lindak Exp $";
43 extern int _rpcpmstart
; /* Started by a port monitor ? */
44 extern int _rpcfdtype
; /* Whether Stream or Datagram ? */
45 extern int _rpcsvcdirty
; /* Still serving ? */
47 void nlm_prog_0(struct svc_req
*rqstp
, SVCXPRT
*transp
);
50 nlm_prog_0(struct svc_req
*rqstp
, SVCXPRT
*transp
)
53 struct nlm_sm_status nlm_sm_notify_0_arg
;
56 xdrproc_t xdr_argument
, xdr_result
;
57 char *(*local
)(char *, struct svc_req
*);
60 switch (rqstp
->rq_proc
) {
62 (void) svc_sendreply(transp
, (xdrproc_t
) xdr_void
, (char *)NULL
);
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
;
73 svcerr_noproc(transp
);
77 (void) memset((char *)&argument
, 0, sizeof (argument
));
78 if (!svc_getargs(transp
, xdr_argument
, (caddr_t
) &argument
)) {
79 svcerr_decode(transp
);
83 result
= (*local
)((char *)&argument
, rqstp
);
84 if (result
!= NULL
&& !svc_sendreply(transp
, xdr_result
, result
)) {
85 svcerr_systemerr(transp
);
87 if (!svc_freeargs(transp
, xdr_argument
, (caddr_t
) &argument
)) {
88 syslog(LOG_ERR
, "unable to free arguments");
95 void nlm_prog_1(struct svc_req
*rqstp
, SVCXPRT
*transp
);
98 nlm_prog_1(struct svc_req
*rqstp
, SVCXPRT
*transp
)
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
;
118 xdrproc_t xdr_argument
, xdr_result
;
119 char *(*local
)(char *, struct svc_req
*);
122 switch (rqstp
->rq_proc
) {
124 (void) svc_sendreply(transp
, (xdrproc_t
) xdr_void
, (char *)NULL
);
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
;
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
;
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
;
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
;
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
;
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
;
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
;
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
;
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
;
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
;
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
;
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
;
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
;
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
;
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
;
219 svcerr_noproc(transp
);
223 (void) memset((char *)&argument
, 0, sizeof (argument
));
224 if (!svc_getargs(transp
, xdr_argument
, (caddr_t
) &argument
)) {
225 svcerr_decode(transp
);
229 result
= (*local
)((char *)&argument
, rqstp
);
230 if (result
!= NULL
&& !svc_sendreply(transp
, xdr_result
, result
)) {
231 svcerr_systemerr(transp
);
233 if (!svc_freeargs(transp
, xdr_argument
, (caddr_t
) &argument
)) {
234 syslog(LOG_ERR
, "unable to free arguments");
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();
248 void nlm_prog_3(struct svc_req
*rqstp
, SVCXPRT
*transp
);
251 nlm_prog_3(struct svc_req
*rqstp
, SVCXPRT
*transp
)
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
;
275 xdrproc_t xdr_argument
, xdr_result
;
276 char *(*local
)(char *, struct svc_req
*);
279 switch (rqstp
->rq_proc
) {
281 (void) svc_sendreply(transp
, (xdrproc_t
) xdr_void
, (char *)NULL
);
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
;
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
;
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
;
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
;
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
;
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
;
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
;
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
;
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
;
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
;
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
;
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
;
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
;
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
;
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
;
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
;
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
;
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
;
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
;
400 svcerr_noproc(transp
);
404 (void) memset((char *)&argument
, 0, sizeof (argument
));
405 if (!svc_getargs(transp
, xdr_argument
, (caddr_t
) &argument
)) {
406 svcerr_decode(transp
);
410 result
= (*local
)((char *)&argument
, rqstp
);
411 if (result
!= NULL
&& !svc_sendreply(transp
, xdr_result
, result
)) {
412 svcerr_systemerr(transp
);
414 if (!svc_freeargs(transp
, xdr_argument
, (caddr_t
) &argument
)) {
415 syslog(LOG_ERR
, "unable to free arguments");
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();
430 void nlm_prog_4(struct svc_req
*rqstp
, SVCXPRT
*transp
);
433 nlm_prog_4(struct svc_req
*rqstp
, SVCXPRT
*transp
)
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
;
457 xdrproc_t xdr_argument
, xdr_result
;
458 char *(*local
)(char *, struct svc_req
*);
461 switch (rqstp
->rq_proc
) {
463 (void) svc_sendreply(transp
, (xdrproc_t
) xdr_void
, (char *)NULL
);
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
;
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
;
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
;
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
;
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
;
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
;
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
;
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
;
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
;
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
;
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
;
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
;
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
;
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
;
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
;
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
;
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
;
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
;
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
;
582 svcerr_noproc(transp
);
586 (void) memset((char *)&argument
, 0, sizeof (argument
));
587 if (!svc_getargs(transp
, xdr_argument
, (caddr_t
) &argument
)) {
588 svcerr_decode(transp
);
592 result
= (*local
)((char *)&argument
, rqstp
);
593 if (result
!= NULL
&& !svc_sendreply(transp
, xdr_result
, result
)) {
594 svcerr_systemerr(transp
);
596 if (!svc_freeargs(transp
, xdr_argument
, (caddr_t
) &argument
)) {
597 syslog(LOG_ERR
, "unable to free arguments");
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();