summaryrefslogtreecommitdiff
path: root/code/test/init_proxy.c
diff options
context:
space:
mode:
authorUros Majstorovic <majstor@majstor.org>2017-08-13 00:22:37 +0200
committerUros Majstorovic <majstor@majstor.org>2017-08-13 00:22:37 +0200
commitd830d95720e41b3374dd1edda04ef1ea4272967d (patch)
treeb45b601cecdcf8dfa33351c3b2170eac13d13116 /code/test/init_proxy.c
parentcdb555810c1fc9c94dd02a66a96876923d78a650 (diff)
proxy renamed to vconn
Diffstat (limited to 'code/test/init_proxy.c')
-rw-r--r--code/test/init_proxy.c42
1 files changed, 0 insertions, 42 deletions
diff --git a/code/test/init_proxy.c b/code/test/init_proxy.c
deleted file mode 100644
index c7f560d..0000000
--- a/code/test/init_proxy.c
+++ /dev/null
@@ -1,42 +0,0 @@
-#include <stdlib.h>
-#include <fcntl.h>
-#include <unistd.h>
-
-#include "core.h"
-#include "proxy.h"
-
-static int v_rng(void *buf, size_t bufsize) {
- int fd;
-
- if((fd = open("/dev/urandom", O_RDONLY)) < 0) return -1;
- size_t nb = read(fd, buf, bufsize);
- close(fd);
- if (nb != bufsize) return -1;
- return 0;
-}
-
-static ECPConnection *conn_alloc(unsigned char type) {
- switch (type) {
- case ECP_CTYPE_PROXYF:
- return malloc(sizeof(ECPConnProxyF));
- default:
- return malloc(sizeof(ECPConnection));
- }
-}
-
-static void conn_free(ECPConnection *conn) {
- free(conn);
-}
-
-int ecp_init(ECPContext *ctx) {
- int rv;
-
- rv = ecp_ctx_create(ctx);
- if (rv) return rv;
-
- ctx->rng = v_rng;
- ctx->conn_alloc = conn_alloc;
- ctx->conn_free = conn_free;
-
- return ecp_proxy_init(ctx);
-} \ No newline at end of file