summaryrefslogtreecommitdiff
path: root/ecp/test/server.c
diff options
context:
space:
mode:
Diffstat (limited to 'ecp/test/server.c')
-rw-r--r--ecp/test/server.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/ecp/test/server.c b/ecp/test/server.c
index 228dbea..19b2f4f 100644
--- a/ecp/test/server.c
+++ b/ecp/test/server.c
@@ -3,10 +3,12 @@
#include <unistd.h>
#include <stdio.h>
-#include <core.h>
+#include <ecp/core.h>
#include <util.h>
+#include "init.h"
+
ECPContext ctx;
ECPSocket sock;
ECPDHKey key_perma;
@@ -31,6 +33,7 @@ static void usage(char *arg) {
}
int main(int argc, char *argv[]) {
+ ecp_tr_addr_t addr;
ECPDHKey key_perma;
int rv;
@@ -41,7 +44,7 @@ int main(int argc, char *argv[]) {
printf("ecp_init RV:%d\n", rv);
ecp_conn_handler_init(&handler, handle_msg, NULL, NULL, NULL);
- ecp_ctx_set_handler(&ctx, &handler, CTYPE_TEST);
+ ecp_ctx_set_handler(&ctx, CTYPE_TEST, &handler);
rv = ecp_util_load_key(&key_perma.public, &key_perma.private, argv[2]);
printf("ecp_util_load_key RV:%d\n", rv);
@@ -50,7 +53,10 @@ int main(int argc, char *argv[]) {
rv = ecp_sock_create(&sock, &ctx, &key_perma);
printf("ecp_sock_create RV:%d\n", rv);
- rv = ecp_sock_open(&sock, argv[1]);
+ rv = ecp_addr_init(&addr, argv[1]);
+ printf("ecp_addr_init RV:%d\n", rv);
+
+ rv = ecp_sock_open(&sock, &addr);
printf("ecp_sock_open RV:%d\n", rv);
rv = ecp_start_receiver(&sock);