From 54329a7c7f740171d1594c6c6195277c2924f31f Mon Sep 17 00:00:00 2001 From: daniel Date: Thu, 10 Jan 2013 17:29:54 +0900 Subject: Interrupt channel work --- vxi11_server.c | 38 ++++++++++++++++++++++++-------------- 1 file changed, 24 insertions(+), 14 deletions(-) (limited to 'vxi11_server.c') 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 +#include #include #include #include +#define DEBUG + +#ifdef DEBUG +#include +#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; + } + **/ -- cgit