diff options
Diffstat (limited to 'vxi11_server.c')
-rw-r--r-- | vxi11_server.c | 38 |
1 files changed, 24 insertions, 14 deletions
diff --git a/vxi11_server.c b/vxi11_server.c index d6007c1..906613f 100644 --- a/vxi11_server.c +++ b/vxi11_server.c @@ -1,16 +1,17 @@ -/* - * This is sample code generated by rpcgen. - * These are only templates and you can use them - * as a guideline for developing your own functions. - */ - #include "vxi11.h" -#include "stdio.h" #include "globals.h" +#include <stdio.h> +#include <rpc/rpc.h> #include <stdbool.h> #include <sys/socket.h> #include <netinet/in.h> +#define DEBUG + +#ifdef DEBUG +#include <stdlib.h> +#endif + #define ERR_SYNTAXERROR 1 #define ERR_DEVICENOTACCESSIBLE 3 #define ERR_INVALIDLINKINDENTIFIER 4 @@ -214,8 +215,15 @@ destroy_link_1_svc(Device_Link *argp, struct svc_req *rqstp) { Device_Error * create_intr_chan_1_svc(Device_RemoteFunc *argp, struct svc_req *rqstp) { - printf("create_intr_chan_1_svc()\n"); static Device_Error result; + printf("create_intr_chan_1_svc()\n"); + +#ifdef DEBUG + char clientaddressstring[INET_ADDRSTRLEN]; + inet_ntop(AF_INET, &argp->hostAddr, clientaddressstring, sizeof(clientaddressstring)); + printf("Client %s is asking for an interrupt connection on port %u\n", clientaddressstring, ntohs(argp->hostPort)); +#endif + result.error = 0; return &result; } @@ -228,9 +236,11 @@ destroy_intr_chan_1_svc(void *argp, struct svc_req *rqstp) { return &result; } -void * -device_intr_srq_1_svc(Device_SrqParms *argp, struct svc_req *rqstp) { - printf("device_intr_srq_1_svc()\n"); - static char * result; - return (void *) &result; -} +/** + void * + device_intr_srq_1_svc(Device_SrqParms *argp, struct svc_req *rqstp) { + printf("device_intr_srq_1_svc()\n"); + static char * result; + return (void *) &result; + } + **/ |