]> git.decadent.org.uk Git - nfs-utils.git/blob - tests/nsm_client/nlm_sm_inter_svc.c
Imported Upstream version 1.2.8
[nfs-utils.git] / tests / nsm_client / nlm_sm_inter_svc.c
1 /*
2  * Please do not edit this file.
3  * It was generated using rpcgen.
4  */
5
6 #include "nlm_sm_inter.h"
7 #include <stdio.h>
8 #include <stdlib.h>
9 #include <rpc/pmap_clnt.h>
10 #include <string.h>
11 #include <memory.h>
12 #include <sys/socket.h>
13 #include <netinet/in.h>
14
15 #ifndef SIG_PF
16 #define SIG_PF void(*)(int)
17 #endif
18
19 void
20 nlm_sm_prog_3(struct svc_req *rqstp, register SVCXPRT *transp)
21 {
22         union {
23                 struct nlm_sm_notify nlm_sm_notify_3_arg;
24         } argument;
25         char *result;
26         xdrproc_t _xdr_argument, _xdr_result;
27         char *(*local)(char *, struct svc_req *);
28
29         switch (rqstp->rq_proc) {
30         case NULLPROC:
31                 (void) svc_sendreply (transp, (xdrproc_t) xdr_void, (char *)NULL);
32                 return;
33
34         case NLM_SM_NOTIFY:
35                 _xdr_argument = (xdrproc_t) xdr_nlm_sm_notify;
36                 _xdr_result = (xdrproc_t) xdr_void;
37                 local = (char *(*)(char *, struct svc_req *)) nlm_sm_notify_3_svc;
38                 break;
39
40         default:
41                 svcerr_noproc (transp);
42                 return;
43         }
44         memset ((char *)&argument, 0, sizeof (argument));
45         if (!svc_getargs (transp, (xdrproc_t) _xdr_argument, (caddr_t) &argument)) {
46                 svcerr_decode (transp);
47                 return;
48         }
49         result = (*local)((char *)&argument, rqstp);
50         if (result != NULL && !svc_sendreply(transp, (xdrproc_t) _xdr_result, result)) {
51                 svcerr_systemerr (transp);
52         }
53         if (!svc_freeargs (transp, (xdrproc_t) _xdr_argument, (caddr_t) &argument)) {
54                 fprintf (stderr, "%s", "unable to free arguments");
55                 exit (1);
56         }
57         return;
58 }
59
60 void
61 nlm_sm_prog_4(struct svc_req *rqstp, register SVCXPRT *transp)
62 {
63         union {
64                 struct nlm_sm_notify nlm_sm_notify_4_arg;
65         } argument;
66         char *result;
67         xdrproc_t _xdr_argument, _xdr_result;
68         char *(*local)(char *, struct svc_req *);
69
70         switch (rqstp->rq_proc) {
71         case NULLPROC:
72                 (void) svc_sendreply (transp, (xdrproc_t) xdr_void, (char *)NULL);
73                 return;
74
75         case NLM_SM_NOTIFY:
76                 _xdr_argument = (xdrproc_t) xdr_nlm_sm_notify;
77                 _xdr_result = (xdrproc_t) xdr_void;
78                 local = (char *(*)(char *, struct svc_req *)) nlm_sm_notify_4_svc;
79                 break;
80
81         default:
82                 svcerr_noproc (transp);
83                 return;
84         }
85         memset ((char *)&argument, 0, sizeof (argument));
86         if (!svc_getargs (transp, (xdrproc_t) _xdr_argument, (caddr_t) &argument)) {
87                 svcerr_decode (transp);
88                 return;
89         }
90         result = (*local)((char *)&argument, rqstp);
91         if (result != NULL && !svc_sendreply(transp, (xdrproc_t) _xdr_result, result)) {
92                 svcerr_systemerr (transp);
93         }
94         if (!svc_freeargs (transp, (xdrproc_t) _xdr_argument, (caddr_t) &argument)) {
95                 fprintf (stderr, "%s", "unable to free arguments");
96                 exit (1);
97         }
98         return;
99 }