From 810dde21ee65653c15606917b19566cfbaaf165e Mon Sep 17 00:00:00 2001 From: Uros Majstorovic Date: Tue, 9 Aug 2022 21:54:45 +0200 Subject: ecp server added --- ecp/test/server.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'ecp/test/server.c') 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 #include -#include +#include #include +#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); -- cgit v1.2.3