/* * Please do not edit this file. * It was generated using rpcgen. */ #include "fs.h" #include #include #include #include #include #include #include #ifndef SIG_PF #define SIG_PF void(*)(int) #endif #define MAX_FILENAME_SIZE 255 #define MAX_BLOCK_SIZE 8192 static void fsprog_1(struct svc_req *rqstp, register SVCXPRT *transp) { union { fs_get_param_t get_1_arg; fs_list_t list_1_arg; char *exist_1_arg; } argument; char *result; xdrproc_t _xdr_argument, _xdr_result; char *(*local)(char *, struct svc_req *); switch (rqstp->rq_proc) { case NULLPROC: (void) svc_sendreply (transp, (xdrproc_t) xdr_void, (char *)NULL); return; case CRED: _xdr_argument = (xdrproc_t) xdr_void; _xdr_result = (xdrproc_t) xdr_wrapstring; local = (char *(*)(char *, struct svc_req *)) cred_1_svc; break; case GET: _xdr_argument = (xdrproc_t) xdr_fs_get_param_t; _xdr_result = (xdrproc_t) xdr_fs_get_ret_t; local = (char *(*)(char *, struct svc_req *)) get_1_svc; break; case LIST: _xdr_argument = (xdrproc_t) xdr_fs_list_t; _xdr_result = (xdrproc_t) xdr_fs_list_t; local = (char *(*)(char *, struct svc_req *)) list_1_svc; break; case EXIST: _xdr_argument = (xdrproc_t) xdr_wrapstring; _xdr_result = (xdrproc_t) xdr_int; local = (char *(*)(char *, struct svc_req *)) exist_1_svc; break; default: svcerr_noproc (transp); return; } memset ((char *)&argument, 0, sizeof (argument)); if (!svc_getargs (transp, (xdrproc_t) _xdr_argument, (caddr_t) &argument)) { svcerr_decode (transp); return; } result = (*local)((char *)&argument, rqstp); if (result != NULL && !svc_sendreply(transp, (xdrproc_t) _xdr_result, result)) { svcerr_systemerr (transp); } if (!svc_freeargs (transp, (xdrproc_t) _xdr_argument, (caddr_t) &argument)) { fprintf (stderr, "%s", "unable to free arguments"); exit (1); } return; } int main (int argc, char **argv) { register SVCXPRT *transp; pmap_unset (FSPROG, FSVERS); transp = svcudp_create(RPC_ANYSOCK); if (transp == NULL) { fprintf (stderr, "%s", "cannot create udp service."); exit(1); } if (!svc_register(transp, FSPROG, FSVERS, fsprog_1, IPPROTO_UDP)) { fprintf (stderr, "%s", "unable to register (FSPROG, FSVERS, udp)."); exit(1); } transp = svctcp_create(RPC_ANYSOCK, 0, 0); if (transp == NULL) { fprintf (stderr, "%s", "cannot create tcp service."); exit(1); } if (!svc_register(transp, FSPROG, FSVERS, fsprog_1, IPPROTO_TCP)) { fprintf (stderr, "%s", "unable to register (FSPROG, FSVERS, tcp)."); exit(1); } svc_run (); fprintf (stderr, "%s", "svc_run returned"); exit (1); /* NOTREACHED */ } /* author: Gustavo Sverzut Barbieri (http://www.gustavobarbieri.com.br) */