]>
Commit | Line | Data |
---|---|---|
ac2f15b3 A |
1 | /* |
2 | * Please do not edit this file. | |
3 | * It was generated using rpcgen. | |
4 | */ | |
5 | ||
6 | #include <rpcsvc/sm_inter.h> | |
7 | #include <sys/ioctl.h> | |
8 | #include <fcntl.h> | |
9 | #include <stdio.h> | |
10 | #include <stdlib.h> | |
11 | #include <unistd.h> | |
12 | #include <rpc/pmap_clnt.h> | |
13 | #include <string.h> | |
14 | #include <netdb.h> | |
15 | #include <signal.h> | |
16 | #include <sys/ttycom.h> | |
17 | #ifdef __cplusplus | |
18 | #include <sysent.h> | |
19 | #endif /* __cplusplus */ | |
20 | #include <memory.h> | |
21 | #include <sys/socket.h> | |
22 | #include <netinet/in.h> | |
23 | #include <syslog.h> | |
24 | ||
25 | #ifdef __STDC__ | |
26 | #define SIG_PF void(*)(int) | |
27 | #endif | |
28 | ||
29 | #ifdef DEBUG | |
30 | #define RPC_SVC_FG | |
31 | #endif | |
32 | ||
33 | #define _RPCSVC_CLOSEDOWN 120 | |
34 | #ifndef lint | |
35 | /*static char sccsid[] = "from: @(#)sm_inter.x 1.7 87/06/24 Copyr 1987 Sun Micro";*/ | |
36 | /*static char sccsid[] = "from: @(#)sm_inter.x 2.2 88/08/01 4.0 RPCSRC";*/ | |
37 | static char rcsid[] = "$Id: sm_inter_svc.c,v 1.2 2002/09/27 05:04:10 lindak Exp $"; | |
38 | #endif /* not lint */ | |
39 | ||
40 | void sm_prog_1(struct svc_req *rqstp, SVCXPRT *transp); | |
41 | ||
42 | void | |
43 | sm_prog_1(struct svc_req *rqstp, SVCXPRT *transp) | |
44 | { | |
45 | union { | |
46 | struct sm_name sm_stat_1_arg; | |
47 | struct mon sm_mon_1_arg; | |
48 | struct mon_id sm_unmon_1_arg; | |
49 | struct my_id sm_unmon_all_1_arg; | |
50 | struct stat_chge sm_notify_1_arg; | |
51 | } argument; | |
52 | char *result; | |
53 | xdrproc_t xdr_argument, xdr_result; | |
54 | char *(*local)(char *, struct svc_req *); | |
55 | ||
56 | switch (rqstp->rq_proc) { | |
57 | case NULLPROC: | |
58 | (void) svc_sendreply(transp, (xdrproc_t) xdr_void, (char *)NULL); | |
59 | return; | |
60 | ||
61 | case SM_STAT: | |
62 | xdr_argument = (xdrproc_t) xdr_sm_name; | |
63 | xdr_result = (xdrproc_t) xdr_sm_stat_res; | |
64 | local = (char *(*)(char *, struct svc_req *)) sm_stat_1_svc; | |
65 | break; | |
66 | ||
67 | case SM_MON: | |
68 | xdr_argument = (xdrproc_t) xdr_mon; | |
69 | xdr_result = (xdrproc_t) xdr_sm_stat_res; | |
70 | local = (char *(*)(char *, struct svc_req *)) sm_mon_1_svc; | |
71 | break; | |
72 | ||
73 | case SM_UNMON: | |
74 | xdr_argument = (xdrproc_t) xdr_mon_id; | |
75 | xdr_result = (xdrproc_t) xdr_sm_stat; | |
76 | local = (char *(*)(char *, struct svc_req *)) sm_unmon_1_svc; | |
77 | break; | |
78 | ||
79 | case SM_UNMON_ALL: | |
80 | xdr_argument = (xdrproc_t) xdr_my_id; | |
81 | xdr_result = (xdrproc_t) xdr_sm_stat; | |
82 | local = (char *(*)(char *, struct svc_req *)) sm_unmon_all_1_svc; | |
83 | break; | |
84 | ||
85 | case SM_SIMU_CRASH: | |
86 | xdr_argument = (xdrproc_t) xdr_void; | |
87 | xdr_result = (xdrproc_t) xdr_void; | |
88 | local = (char *(*)(char *, struct svc_req *)) sm_simu_crash_1_svc; | |
89 | break; | |
90 | ||
91 | case SM_NOTIFY: | |
92 | xdr_argument = (xdrproc_t) xdr_stat_chge; | |
93 | xdr_result = (xdrproc_t) xdr_void; | |
94 | local = (char *(*)(char *, struct svc_req *)) sm_notify_1_svc; | |
95 | break; | |
96 | ||
97 | default: | |
98 | svcerr_noproc(transp); | |
99 | return; | |
100 | } | |
101 | (void) memset((char *)&argument, 0, sizeof (argument)); | |
102 | if (!svc_getargs(transp, xdr_argument, (caddr_t) &argument)) { | |
103 | svcerr_decode(transp); | |
104 | return; | |
105 | } | |
106 | result = (*local)((char *)&argument, rqstp); | |
107 | if (result != NULL && !svc_sendreply(transp, xdr_result, result)) { | |
108 | svcerr_systemerr(transp); | |
109 | } | |
110 | if (!svc_freeargs(transp, xdr_argument, (caddr_t) &argument)) { | |
111 | syslog(LOG_ERR, "unable to free arguments"); | |
112 | exit(1); | |
113 | } | |
114 | return; | |
115 | } |