X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;f=src%2Fsptps_speed.c;h=e91fba6299b8b80f89c8a8fb83775035341043f6;hb=76c7550c8ab0e9c0ee14a9c396baa008cfb9bc42;hp=d662779b76cee304daee6eeab6df59031e7ffb7f;hpb=fb7b6e7a0c966a88a682f656ca1caeb9a0583c5b;p=meshlink diff --git a/src/sptps_speed.c b/src/sptps_speed.c index d662779b..e91fba62 100644 --- a/src/sptps_speed.c +++ b/src/sptps_speed.c @@ -28,26 +28,32 @@ #include "sptps.h" // Symbols necessary to link with logger.o -bool send_request(void *c, const char *msg, ...) { return false; } -struct list_t *connection_list = NULL; -bool send_meta(void *c, const char *msg , int len) { return false; } +bool send_request(void *c, const char *msg, ...) { + return false; +} +void *mesh; +void *global_log_cb; +int global_log_level; +bool send_meta(void *c, const char *msg, int len) { + return false; +} char *logfilename = NULL; struct timeval now; -static bool send_data(void *handle, uint8_t type, const char *data, size_t len) { +static bool send_data(void *handle, uint8_t type, const void *data, size_t len) { int fd = *(int *)handle; send(fd, data, len, 0); return true; } -static bool receive_record(void *handle, uint8_t type, const char *data, uint16_t len) { +static bool receive_record(void *handle, uint8_t type, const void *data, uint16_t len) { return true; } static void receive_data(sptps_t *sptps) { char buf[4096]; int fd = *(int *)sptps->handle; - size_t len = recv(fd, buf, sizeof buf, 0); + size_t len = recv(fd, buf, sizeof(buf), 0); if(!sptps_receive_data(sptps, buf, len)) abort(); } @@ -82,6 +88,10 @@ int main(int argc, char *argv[]) { crypto_init(); + randomize(buf1, sizeof(buf1)); + randomize(buf2, sizeof(buf2)); + randomize(buf3, sizeof(buf3)); + // Key generation fprintf(stderr, "Generating keys for %lg seconds: ", duration);