+ connection_t *other;
+ node_t *n;
+ char name[MAX_STRING_SIZE];
+ ipv4_t address;
+ port_t port;
+ avl_node_t *node;
+cp
+ if(sscanf(c->buffer, "%*d "MAX_STRING" %lx:%hd", name, &address, &port) != 3)
+ {
+ syslog(LOG_ERR, _("Got bad %s from %s (%s)"), "ADD_NODE", c->name, c->hostname);
+ return -1;
+ }
+
+ /* Check if identity is a valid name */
+
+ if(check_id(name))
+ {
+ syslog(LOG_ERR, _("Got bad %s from %s (%s): %s"), "ADD_NODE", c->name, c->hostname, _("invalid name"));
+ return -1;
+ }
+
+ /* Check if node already exists */
+
+ n = lookup_node(name);
+
+ if(n)
+ {
+ /* Check if it matches */
+ }
+ else
+ {
+ n = new_node();
+ n->name = xstrdup(name);
+ n->address = address;
+ n->port = port;
+ node_add(n);
+ }