#include "system.h"
-#include "cipher.h"
#include "conf.h"
#include "connection.h"
-#include "digest.h"
#include "ecdsa.h"
#include "graph.h"
#include "logger.h"
FILE *fp;
char *fname;
- if(invitation_key) {
- ecdsa_free(invitation_key);
- invitation_key = NULL;
+ if(mesh->invitation_key) {
+ ecdsa_free(mesh->invitation_key);
+ mesh->invitation_key = NULL;
}
xasprintf(&fname, "%s" SLASH "invitations" SLASH "ecdsa_key.priv", mesh->confbase);
fp = fopen(fname, "r");
if(fp) {
- invitation_key = ecdsa_read_pem_private_key(fp);
+ mesh->invitation_key = ecdsa_read_pem_private_key(fp);
fclose(fp);
- if(!invitation_key)
+ if(!mesh->invitation_key)
logger(DEBUG_ALWAYS, LOG_ERR, "Reading ECDSA private key file `%s' failed: %s", fname, strerror(errno));
}
free(fname);
- return invitation_key;
+ return mesh->invitation_key;
}
void load_all_nodes(void) {
io_add(&mesh->listen_socket[mesh->listen_sockets].tcp, handle_new_meta_connection, &mesh->listen_socket[mesh->listen_sockets], tcp_fd, IO_READ);
io_add(&mesh->listen_socket[mesh->listen_sockets].udp, handle_incoming_vpn_data, &mesh->listen_socket[mesh->listen_sockets], udp_fd, IO_READ);
- if(debug_level >= DEBUG_CONNECTIONS) {
+ if(mesh->debug_level >= DEBUG_CONNECTIONS) {
char *hostname = sockaddr2hostname((sockaddr_t *) aip->ai_addr);
logger(DEBUG_CONNECTIONS, LOG_NOTICE, "Listening on %s", hostname);
free(hostname);