47dfb8c39151cb9be4ba930e120bc9ba16278975
[shibboleth/cpp-sp.git] / shib-target / shibrpc-svc.c
1 /*
2  * Please do not edit this file.
3  * It was generated using rpcgen.
4  */
5
6 #include "shibrpc.h"
7 #include <stdio.h>
8 #include <stdlib.h>
9 #include <rpc/pmap_clnt.h>
10 #include <string.h>
11 #include <memory.h>
12
13 #ifdef WIN32
14 # include <winsock.h>
15 #else
16 # include <sys/socket.h>
17 # include <netinet/in.h>
18 #endif
19
20 #ifndef SIG_PF
21 #define SIG_PF void(*)(int)
22 #endif
23
24 void
25 shibrpc_prog_3(struct svc_req *rqstp, register SVCXPRT *transp)
26 {
27         union {
28                 shibrpc_args_3 shibrpc_call_3_arg;
29         } argument;
30         union {
31                 shibrpc_ret_3 shibrpc_call_3_res;
32         } result;
33         bool_t retval;
34         xdrproc_t _xdr_argument, _xdr_result;
35         bool_t (*local)(char *, void *, struct svc_req *);
36
37         switch (rqstp->rq_proc) {
38         case NULLPROC:
39                 (void) svc_sendreply (transp, (xdrproc_t) xdr_void, (char *)NULL);
40                 return;
41
42         case shibrpc_call:
43                 _xdr_argument = (xdrproc_t) xdr_shibrpc_args_3;
44                 _xdr_result = (xdrproc_t) xdr_shibrpc_ret_3;
45                 local = (bool_t (*) (char *, void *,  struct svc_req *))shibrpc_call_3_svc;
46                 break;
47
48         default:
49                 svcerr_noproc (transp);
50                 return;
51         }
52         memset ((char *)&argument, 0, sizeof (argument));
53         if (!svc_getargs (transp, (xdrproc_t) _xdr_argument, (caddr_t) &argument)) {
54                 svcerr_decode (transp);
55                 return;
56         }
57         retval = (bool_t) (*local)((char *)&argument, (void *)&result, rqstp);
58         if (retval > 0 && !svc_sendreply(transp, (xdrproc_t) _xdr_result, (char *)&result)) {
59                 svcerr_systemerr (transp);
60         }
61         if (!svc_freeargs (transp, (xdrproc_t) _xdr_argument, (caddr_t) &argument)) {
62                 fprintf (stderr, "%s", "unable to free arguments");
63                 exit (1);
64         }
65         if (!shibrpc_prog_3_freeresult (transp, _xdr_result, (caddr_t) &result))
66                 fprintf (stderr, "%s", "unable to free results");
67
68         return;
69 }