#include "xalloc.h"
#include "submesh.h"
-extern bool node_write_devclass(meshlink_handle_t *mesh, node_t *n);
-extern bool node_write_submesh(meshlink_handle_t *mesh, node_t *n);
-
bool send_add_edge(meshlink_handle_t *mesh, connection_t *c, const edge_t *e, int contradictions) {
bool x;
char *address, *port;
if(!from) {
from = new_node();
+ from->status.dirty = true;
from->status.blacklisted = mesh->default_blacklist;
from->name = xstrdup(from_name);
+ from->devclass = from_devclass;
from->submesh = NULL;
}
from->devclass = from_devclass;
- node_write_devclass(mesh, from);
-
- if(from->submesh) {
- node_write_submesh(mesh, from);
- }
if(!to) {
to = new_node();
+ to->status.dirty = true;
to->status.blacklisted = mesh->default_blacklist;
to->name = xstrdup(to_name);
+ to->devclass = to_devclass;
to->submesh = NULL;
node_add(mesh, to);
}
- to->devclass = to_devclass;
- node_write_devclass(mesh, to);
-
- if(to->submesh) {
- node_write_submesh(mesh, to);
- }
-
/* Convert addresses */
address = str2sockaddr(to_address, to_port);