/*
node.c -- node tree management
- Copyright (C) 2001-2013 Guus Sliepen <guus@meshlink.io>,
- 2001-2005 Ivo Timmermans
+ Copyright (C) 2014 Guus Sliepen <guus@meshlink.io>,
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 "hash.h"
#include "logger.h"
+#include "meshlink_internal.h"
#include "net.h"
#include "netutl.h"
#include "node.h"
splay_tree_t *node_tree;
static hash_t *node_udp_cache;
-node_t *myself;
-
static int node_compare(const node_t *a, const node_t *b) {
return strcmp(a->name, b->name);
}
sockaddrfree(&n->address);
- cipher_close(n->incipher);
- digest_close(n->indigest);
- cipher_close(n->outcipher);
- digest_close(n->outdigest);
-
ecdsa_free(n->ecdsa);
sptps_stop(&n->sptps);
}
void update_node_udp(node_t *n, const sockaddr_t *sa) {
- if(n == myself) {
- logger(DEBUG_ALWAYS, LOG_WARNING, "Trying to update UDP address of myself!");
+ if(n == mesh->self) {
+ logger(DEBUG_ALWAYS, LOG_WARNING, "Trying to update UDP address of mesh->self!");
return;
}