Includes cleanups
[invirt/third/libt4.git] / rsmtest_client.cc
index c61194e..f4238db 100644 (file)
@@ -1,39 +1,23 @@
 // RPC stubs for clients to talk to rsmtest_server
 
 #include "rsmtest_client.h"
-#include "rpc/rpc.h"
 #include <arpa/inet.h>
 
-#include <sstream>
-#include <iostream>
-#include <stdio.h>
-
-rsmtest_client::rsmtest_client(std::string dst)
-{
-    sockaddr_in dstsock;
-    make_sockaddr(dst.c_str(), &dstsock);
-    cl = new rpcc(dstsock);
-    if (cl->bind() < 0) {
-        printf("rsmtest_client: call bind\n");
-    }
+rsmtest_client::rsmtest_client(string dst) : cl(dst) {
+    if (cl.bind() < 0)
+        cout << "rsmtest_client: call bind" << endl;
 }
 
-int
-rsmtest_client::net_repair(int heal)
-{
-    int r;
-    int ret = cl->call(rsm_test_protocol::net_repair, r, heal);
+rsm_test_protocol::status rsmtest_client::net_repair(int heal) {
+    rsm_test_protocol::status r;
+    auto ret = (rsm_test_protocol::status)cl.call(rsm_test_protocol::net_repair, r, heal);
     VERIFY (ret == rsm_test_protocol::OK);
     return r;
 }
 
-int
-rsmtest_client::breakpoint(int b)
-{
-    int r;
-    int ret = cl->call(rsm_test_protocol::breakpoint, r, b);
+rsm_test_protocol::status rsmtest_client::breakpoint(int b) {
+    rsm_test_protocol::status r;
+    auto ret = (rsm_test_protocol::status)cl.call(rsm_test_protocol::breakpoint, r, b);
     VERIFY (ret == rsm_test_protocol::OK);
     return r;
 }
-
-