-
-#include "system.h"
-
-int send_id(connection_t *c)
-{
- cp();
-
- return send_request(c, "%d %s %d", ID, myself->connection->name,
- myself->connection->protocol_version);
-}
-
-int id_h(connection_t *c)
-{
- char name[MAX_STRING_SIZE];
- int bla;
-
- cp();
-
- if(sscanf(c->buffer, "%*d " MAX_STRING " %d", name, &c->protocol_version) != 2) {
- logger(LOG_ERR, _("Got bad %s from %s (%s)"), "ID", c->name,
- c->hostname);
- return -1;
- }
-
- /* Check if identity is a valid name */
-
- if(check_id(name)) {
- logger(LOG_ERR, _("Got bad %s from %s (%s): %s"), "ID", c->name,
- c->hostname, "invalid name");
- return -1;
+#include "meshlink_internal.h"
+#include "meta.h"
+#include "net.h"
+#include "netutl.h"
+#include "node.h"
+#include "packmsg.h"
+#include "prf.h"
+#include "protocol.h"
+#include "sptps.h"
+#include "utils.h"
+#include "xalloc.h"
+#include "ed25519/sha512.h"
+
+#include <assert.h>
+
+extern bool node_write_devclass(meshlink_handle_t *mesh, node_t *n);
+
+static bool send_proxyrequest(meshlink_handle_t *mesh, connection_t *c) {
+ switch(mesh->proxytype) {
+ case PROXY_HTTP: {
+ char *host;
+ char *port;
+
+ sockaddr2str(&c->address, &host, &port);
+ send_request(mesh, c, NULL, "CONNECT %s:%s HTTP/1.1\r\n\r", host, port);
+ free(host);
+ free(port);
+ return true;