X-Git-Url: https://tinc-vpn.org/git/browse?a=blobdiff_plain;f=src%2Fsptps_speed.c;h=cc05b8656352e8bcc0000c9abfc29c597e959533;hb=28b7a53b6;hp=8e6f5bed688f41547f8e3e02c4004d6aebd45f3a;hpb=0912276c6467aa3ee6f570b31245367319da572a;p=tinc diff --git a/src/sptps_speed.c b/src/sptps_speed.c index 8e6f5bed..cc05b865 100644 --- a/src/sptps_speed.c +++ b/src/sptps_speed.c @@ -1,6 +1,6 @@ /* sptps_speed.c -- SPTPS benchmark - Copyright (C) 2013-2014 Guus Sliepen + Copyright (C) 2013-2022 Guus Sliepen This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -26,14 +26,23 @@ #include "ecdh.h" #include "ecdsa.h" #include "ecdsagen.h" +#include "meta.h" +#include "protocol.h" #include "sptps.h" // Symbols necessary to link with logger.o -bool send_request(void *c, const char *msg, ...) { +bool send_request(struct connection_t *c, const char *msg, ...) { + (void)c; + (void)msg; return false; } -struct list_t *connection_list = NULL; -bool send_meta(void *c, const char *msg, int len) { + +list_t connection_list; + +bool send_meta(struct connection_t *c, const void *msg, size_t len) { + (void)c; + (void)msg; + (void)len; return false; } char *logfilename = NULL; @@ -41,12 +50,17 @@ bool do_detach = false; struct timeval now; static bool send_data(void *handle, uint8_t type, const void *data, size_t len) { + (void)type; int fd = *(int *)handle; send(fd, data, len, 0); return true; } static bool receive_record(void *handle, uint8_t type, const void *data, uint16_t len) { + (void)handle; + (void)type; + (void)data; + (void)len; return true; } @@ -73,7 +87,7 @@ double elapsed; double rate; unsigned int count; -static void clock_start() { +static void clock_start(void) { count = 0; clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &start); } @@ -165,7 +179,7 @@ int main(int argc, char *argv[]) { return 1; } - struct pollfd pfd[2] = {{fd[0], POLLIN}, {fd[1], POLLIN}}; + struct pollfd pfd[2] = {{fd[0], POLLIN, 0}, {fd[1], POLLIN, 0}}; fprintf(stderr, "SPTPS/TCP authenticate for %lg seconds: ", duration);