/*
protocol.c -- handle the meta-protocol, basic functions
Copyright (C) 1999-2005 Ivo Timmermans,
- 2000-2013 Guus Sliepen <guus@tinc-vpn.org>
+ 2000-2022 Guus Sliepen <guus@tinc-vpn.org>
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
#include "conf.h"
#include "connection.h"
+#include "crypto.h"
#include "logger.h"
#include "meta.h"
#include "protocol.h"
+#include "utils.h"
#include "xalloc.h"
bool tunnelserver = false;
/* Request names */
-static char (*request_name[]) = {
+static const char (*request_name[]) = {
"ID", "METAKEY", "CHALLENGE", "CHAL_REPLY", "ACK",
"STATUS", "ERROR", "TERMREQ",
"PING", "PONG",
if(left)
timeout_set(&past_request_timeout, &(struct timeval) {
- 10, rand() % 100000
+ 10, jitter()
});
}
new->firstseen = now.tv_sec;
splay_insert(&past_request_tree, new);
timeout_add(&past_request_timeout, age_past_requests, NULL, &(struct timeval) {
- 10, rand() % 100000
+ 10, jitter()
});
return false;
}