diff options
author | Uros Majstorovic <majstor@majstor.org> | 2021-08-31 11:14:41 +0200 |
---|---|---|
committer | Uros Majstorovic <majstor@majstor.org> | 2021-08-31 11:14:41 +0200 |
commit | 2a46bdf517eb5fcb8ba59c398a32859c6496475d (patch) | |
tree | d8773d60c6827cf6499b9fda98323feabc10e63f /ecp/test | |
parent | ff7ffade2f5686ae977af578cb87040cc4654994 (diff) |
transient messages added; code cleanup
Diffstat (limited to 'ecp/test')
-rw-r--r-- | ecp/test/basic.c | 8 | ||||
-rw-r--r-- | ecp/test/frag.c | 8 | ||||
-rw-r--r-- | ecp/test/stress.c | 10 |
3 files changed, 13 insertions, 13 deletions
diff --git a/ecp/test/basic.c b/ecp/test/basic.c index 8268599..eb14b0e 100644 --- a/ecp/test/basic.c +++ b/ecp/test/basic.c @@ -65,8 +65,8 @@ int main(int argc, char *argv[]) { handler_s.msg[MTYPE_MSG] = handle_msg_s; ctx_s.handler[CTYPE_TEST] = &handler_s; - rv = ecp_dhkey_generate(&ctx_s, &key_perma_s); - printf("ecp_dhkey_generate RV:%d\n", rv); + rv = ecp_dhkey_gen(&ctx_s, &key_perma_s); + printf("ecp_dhkey_gen RV:%d\n", rv); rv = ecp_sock_create(&sock_s, &ctx_s, &key_perma_s); printf("ecp_sock_create RV:%d\n", rv); @@ -85,8 +85,8 @@ int main(int argc, char *argv[]) { handler_c.msg[MTYPE_MSG] = handle_msg_c; ctx_c.handler[CTYPE_TEST] = &handler_c; - rv = ecp_dhkey_generate(&ctx_c, &key_perma_c); - printf("ecp_dhkey_generate RV:%d\n", rv); + rv = ecp_dhkey_gen(&ctx_c, &key_perma_c); + printf("ecp_dhkey_gen RV:%d\n", rv); rv = ecp_sock_create(&sock_c, &ctx_c, &key_perma_c); printf("ecp_sock_create RV:%d\n", rv); diff --git a/ecp/test/frag.c b/ecp/test/frag.c index 2bba856..bf7c1a2 100644 --- a/ecp/test/frag.c +++ b/ecp/test/frag.c @@ -71,8 +71,8 @@ int main(int argc, char *argv[]) { handler_s.msg[MTYPE_MSG] = handle_msg_s; ctx_s.handler[CTYPE_TEST] = &handler_s; - rv = ecp_dhkey_generate(&ctx_s, &key_perma_s); - printf("ecp_dhkey_generate RV:%d\n", rv); + rv = ecp_dhkey_gen(&ctx_s, &key_perma_s); + printf("ecp_dhkey_gen RV:%d\n", rv); rv = ecp_sock_create(&sock_s, &ctx_s, &key_perma_s); printf("ecp_sock_create RV:%d\n", rv); @@ -91,8 +91,8 @@ int main(int argc, char *argv[]) { handler_c.msg[MTYPE_MSG] = handle_msg_c; ctx_c.handler[CTYPE_TEST] = &handler_c; - rv = ecp_dhkey_generate(&ctx_c, &key_perma_c); - printf("ecp_dhkey_generate RV:%d\n", rv); + rv = ecp_dhkey_gen(&ctx_c, &key_perma_c); + printf("ecp_dhkey_gen RV:%d\n", rv); rv = ecp_sock_create(&sock_c, &ctx_c, &key_perma_c); printf("ecp_sock_create RV:%d\n", rv); diff --git a/ecp/test/stress.c b/ecp/test/stress.c index 73c511e..4dae990 100644 --- a/ecp/test/stress.c +++ b/ecp/test/stress.c @@ -93,7 +93,7 @@ void *sender(ECPConnection *c) { c->sock->ctx->rng(&rnd, sizeof(uint32_t)); usleep(rnd % (2000000/msg_rate)); - ecp_pld_set_type(pld_buf, MTYPE_MSG); + ecp_pld_set_type(payload.buffer, payload.size, MTYPE_MSG); ssize_t _rv = 0; // XXX refactor // _rv = ecp_pld_send(c, &packet, &payload, ECP_SIZE_PLD(1000, 0)); @@ -138,7 +138,7 @@ ssize_t handle_msg_c(ECPConnection *conn, ecp_seq_t sq, unsigned char t, unsigne pthread_mutex_unlock(&t_mtx[idx]); } - // ecp_pld_set_type(payload, MTYPE_MSG); + // ecp_pld_set_type(payload.buffer, payload.size, MTYPE_MSG); // ssize_t _rv = ecp_pld_send(c, &packet, &payload, ECP_SIZE_PLD(1000, 0)); return s; } @@ -154,7 +154,7 @@ ssize_t handle_msg_s(ECPConnection *conn, ecp_seq_t sq, unsigned char t, unsigne payload.buffer = pld_buf; payload.size = ECP_MAX_PLD; - ecp_pld_set_type(pld_buf, MTYPE_MSG); + ecp_pld_set_type(payload.buffer, payload.size, MTYPE_MSG); // XXX refactor // ssize_t _rv = ecp_pld_send(conn, &packet, &payload, ECP_SIZE_PLD(1000, 0)); return s; @@ -199,7 +199,7 @@ int main(int argc, char *argv[]) { handler_s.msg[MTYPE_MSG] = handle_msg_s; ctx_s.handler[CTYPE_TEST] = &handler_s; - if (!rv) rv = ecp_dhkey_generate(&ctx_s, &key_perma_s); + if (!rv) rv = ecp_dhkey_gen(&ctx_s, &key_perma_s); for (i=0; i<num_s; i++) { if (!rv) rv = ecp_sock_create(&sock_s[i], &ctx_s, &key_perma_s); @@ -229,7 +229,7 @@ int main(int argc, char *argv[]) { if (!rv) rv = ecp_init(&ctx_c[i]); ctx_c[i].handler[CTYPE_TEST] = &handler_c; - if (!rv) rv = ecp_dhkey_generate(&ctx_c[i], &key_perma_c[i]); + if (!rv) rv = ecp_dhkey_gen(&ctx_c[i], &key_perma_c[i]); if (!rv) rv = ecp_sock_create(&sock_c[i], &ctx_c[i], &key_perma_c[i]); if (!rv) rv = ecp_sock_open(&sock_c[i], NULL); |