TSP: The Transport Sample Protocol



Main Page | Modules | Alphabetical List | Data Structures | File List | Data Fields | Globals | Related Pages

tsp_rpc_svc.c

00001 #ifdef VXWORKS
00002 #define static extern
00003 #endif /* !VXWORKS */
00004 /*
00005  * Please do not edit this file.
00006  * It was generated using rpcgen.
00007  */
00008 
00009 #include "tsp_rpc.h"
00010 #include <stdio.h>
00011 #include <stdlib.h>
00012 #include <rpc/pmap_clnt.h>
00013 #include <string.h>
00014 #include <memory.h>
00015 #include <sys/socket.h>
00016 #include <netinet/in.h>
00017 
00018 #ifndef SIG_PF
00019 #define SIG_PF void(*)(int)
00020 #endif
00021 #define TSP_STRACE_RPC_ERROR(cl, pResult) if(!pResult) { STRACE_ERROR(("%s", clnt_sperror(cl, ""))); }
00022 
00023 static TSP_provider_info_t *
00024 _tsp_provider_information_1 (void  *argp, struct svc_req *rqstp)
00025 {
00026         return (tsp_provider_information_1_svc(rqstp));
00027 }
00028 
00029 static TSP_answer_open_t *
00030 _tsp_request_open_1 (TSP_request_open_t  *argp, struct svc_req *rqstp)
00031 {
00032         return (tsp_request_open_1_svc(*argp, rqstp));
00033 }
00034 
00035 static void *
00036 _tsp_request_close_1 (TSP_request_close_t  *argp, struct svc_req *rqstp)
00037 {
00038         return (tsp_request_close_1_svc(*argp, rqstp));
00039 }
00040 
00041 static TSP_answer_sample_t *
00042 _tsp_request_information_1 (TSP_request_information_t  *argp, struct svc_req *rqstp)
00043 {
00044         return (tsp_request_information_1_svc(*argp, rqstp));
00045 }
00046 
00047 static TSP_answer_feature_t *
00048 _tsp_request_feature_1 (TSP_request_feature_t  *argp, struct svc_req *rqstp)
00049 {
00050         return (tsp_request_feature_1_svc(*argp, rqstp));
00051 }
00052 
00053 static TSP_answer_sample_t *
00054 _tsp_request_sample_1 (TSP_request_sample_t  *argp, struct svc_req *rqstp)
00055 {
00056         return (tsp_request_sample_1_svc(*argp, rqstp));
00057 }
00058 
00059 static TSP_answer_sample_init_t *
00060 _tsp_request_sample_init_1 (TSP_request_sample_init_t  *argp, struct svc_req *rqstp)
00061 {
00062         return (tsp_request_sample_init_1_svc(*argp, rqstp));
00063 }
00064 
00065 static TSP_answer_sample_destroy_t *
00066 _tsp_request_sample_destroy_1 (TSP_request_sample_destroy_t  *argp, struct svc_req *rqstp)
00067 {
00068         return (tsp_request_sample_destroy_1_svc(*argp, rqstp));
00069 }
00070 
00071 static void *
00072 _tsp_exec_feature_1 (TSP_exec_feature_t  *argp, struct svc_req *rqstp)
00073 {
00074         return (tsp_exec_feature_1_svc(*argp, rqstp));
00075 }
00076 
00077 void
00078 tsp_rpc_1(struct svc_req *rqstp, register SVCXPRT *transp)
00079 {
00080         union {
00081                 TSP_request_open_t tsp_request_open_1_arg;
00082                 TSP_request_close_t tsp_request_close_1_arg;
00083                 TSP_request_information_t tsp_request_information_1_arg;
00084                 TSP_request_feature_t tsp_request_feature_1_arg;
00085                 TSP_request_sample_t tsp_request_sample_1_arg;
00086                 TSP_request_sample_init_t tsp_request_sample_init_1_arg;
00087                 TSP_request_sample_destroy_t tsp_request_sample_destroy_1_arg;
00088                 TSP_exec_feature_t tsp_exec_feature_1_arg;
00089         } argument;
00090         char *result;
00091         xdrproc_t _xdr_argument, _xdr_result;
00092         char *(*local)(char *, struct svc_req *);
00093 
00094         switch (rqstp->rq_proc) {
00095         case NULLPROC:
00096                 (void) svc_sendreply (transp, (xdrproc_t) xdr_void, (char *)NULL);
00097                 return;
00098 
00099         case TSP_PROVIDER_INFORMATION:
00100                 _xdr_argument = (xdrproc_t) xdr_void;
00101                 _xdr_result = (xdrproc_t) xdr_TSP_provider_info_t;
00102                 local = (char *(*)(char *, struct svc_req *)) _tsp_provider_information_1;
00103                 break;
00104 
00105         case TSP_REQUEST_OPEN:
00106                 _xdr_argument = (xdrproc_t) xdr_TSP_request_open_t;
00107                 _xdr_result = (xdrproc_t) xdr_TSP_answer_open_t;
00108                 local = (char *(*)(char *, struct svc_req *)) _tsp_request_open_1;
00109                 break;
00110 
00111         case TSP_REQUEST_CLOSE:
00112                 _xdr_argument = (xdrproc_t) xdr_TSP_request_close_t;
00113                 _xdr_result = (xdrproc_t) xdr_void;
00114                 local = (char *(*)(char *, struct svc_req *)) _tsp_request_close_1;
00115                 break;
00116 
00117         case TSP_REQUEST_INFORMATION:
00118                 _xdr_argument = (xdrproc_t) xdr_TSP_request_information_t;
00119                 _xdr_result = (xdrproc_t) xdr_TSP_answer_sample_t;
00120                 local = (char *(*)(char *, struct svc_req *)) _tsp_request_information_1;
00121                 break;
00122 
00123         case TSP_REQUEST_FEATURE:
00124                 _xdr_argument = (xdrproc_t) xdr_TSP_request_feature_t;
00125                 _xdr_result = (xdrproc_t) xdr_TSP_answer_feature_t;
00126                 local = (char *(*)(char *, struct svc_req *)) _tsp_request_feature_1;
00127                 break;
00128 
00129         case TSP_REQUEST_SAMPLE:
00130                 _xdr_argument = (xdrproc_t) xdr_TSP_request_sample_t;
00131                 _xdr_result = (xdrproc_t) xdr_TSP_answer_sample_t;
00132                 local = (char *(*)(char *, struct svc_req *)) _tsp_request_sample_1;
00133                 break;
00134 
00135         case TSP_REQUEST_SAMPLE_INIT:
00136                 _xdr_argument = (xdrproc_t) xdr_TSP_request_sample_init_t;
00137                 _xdr_result = (xdrproc_t) xdr_TSP_answer_sample_init_t;
00138                 local = (char *(*)(char *, struct svc_req *)) _tsp_request_sample_init_1;
00139                 break;
00140 
00141         case TSP_REQUEST_SAMPLE_DESTROY:
00142                 _xdr_argument = (xdrproc_t) xdr_TSP_request_sample_destroy_t;
00143                 _xdr_result = (xdrproc_t) xdr_TSP_answer_sample_destroy_t;
00144                 local = (char *(*)(char *, struct svc_req *)) _tsp_request_sample_destroy_1;
00145                 break;
00146 
00147         case TSP_EXEC_FEATURE:
00148                 _xdr_argument = (xdrproc_t) xdr_TSP_exec_feature_t;
00149                 _xdr_result = (xdrproc_t) xdr_void;
00150                 local = (char *(*)(char *, struct svc_req *)) _tsp_exec_feature_1;
00151                 break;
00152 
00153         default:
00154                 svcerr_noproc (transp);
00155                 return;
00156         }
00157         memset ((char *)&argument, 0, sizeof (argument));
00158         if (!svc_getargs (transp, (xdrproc_t) _xdr_argument, (caddr_t) &argument)) {
00159                 svcerr_decode (transp);
00160                 return;
00161         }
00162         result = (*local)((char *)&argument, rqstp);
00163         if (result != NULL && !svc_sendreply(transp, (xdrproc_t) _xdr_result, result)) {
00164                 svcerr_systemerr (transp);
00165         }
00166         if (!svc_freeargs (transp, (xdrproc_t) _xdr_argument, (caddr_t) &argument)) {
00167                 fprintf (stderr, "%s", "unable to free arguments");
00168                 exit (1);
00169         }
00170         return;
00171 }
Framework Home Page.

Beware !! TSP wave is coming...