summaryrefslogtreecommitdiff
path: root/rpc_demo/msg_proc.c
diff options
context:
space:
mode:
Diffstat (limited to 'rpc_demo/msg_proc.c')
-rw-r--r--rpc_demo/msg_proc.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/rpc_demo/msg_proc.c b/rpc_demo/msg_proc.c
new file mode 100644
index 0000000..229fedf
--- /dev/null
+++ b/rpc_demo/msg_proc.c
@@ -0,0 +1,24 @@
+/*
+ * Server-side implementation of remote procedure calls
+ */
+#include <stdio.h>
+#include "msg.h"
+
+int *
+printmessage_1_svc(char **argp, struct svc_req *rqstp)
+{
+ static int result;
+
+ result = printf ("WOW -- RPC WORKS: `%s'\n", *argp);
+ return &result;
+}
+
+int *
+printnum_1_svc(int *argp, struct svc_req *rqstp)
+{
+ static int result;
+
+ printf ("The number you sent is %d.\n", *argp);
+ result = *argp * *argp;
+ return &result;
+}