diff options
author | daniel <danieruru@gmail.com> | 2013-01-10 17:29:54 +0900 |
---|---|---|
committer | daniel <danieruru@gmail.com> | 2013-01-10 17:29:54 +0900 |
commit | 54329a7c7f740171d1594c6c6195277c2924f31f (patch) | |
tree | 8089149ac2898a8224b69135028c50ca79969b2e /vxi11_server.c | |
parent | a7f61f8769d7c704e409e511687d450608c220d1 (diff) |
Interrupt channel work
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; + } + **/ |