]> git.meshlink.io Git - meshlink/blobdiff - src/protocol.h
Never automatically try to bind to ports >= 32768.
[meshlink] / src / protocol.h
index f72d42d8999869c8f2baa27daf2dbad868a3660a..94f760f1e2cb0cf51b5d786b93eedb4de994e314 100644 (file)
@@ -48,6 +48,7 @@ typedef enum request_t {
        CONTROL,
        REQ_PUBKEY, ANS_PUBKEY,
        REQ_SPTPS,
+       REQ_CANONICAL,
        NUM_REQUESTS
 } request_t;
 
@@ -61,6 +62,10 @@ typedef struct past_request_t {
        time_t firstseen;
 } past_request_t;
 
+/* Protocol support flags */
+
+static const uint32_t PROTOCOL_TINY = 1; // Peer is using meshlink-tiny
+
 /* Maximum size of strings in a request.
  * scanf terminates %2048s with a NUL character,
  * but the NUL character can be written after the 2048th non-NUL character.
@@ -94,6 +99,8 @@ bool send_pong(struct meshlink_handle *mesh, struct connection_t *);
 bool send_add_edge(struct meshlink_handle *mesh, struct connection_t *, const struct edge_t *, int contradictions);
 bool send_del_edge(struct meshlink_handle *mesh, struct connection_t *, const struct edge_t *, int contradictions);
 bool send_req_key(struct meshlink_handle *mesh, struct node_t *);
+bool send_canonical_address(struct meshlink_handle *mesh, struct node_t *);
+bool send_raw_packet(struct meshlink_handle *mesh, struct connection_t *, const vpn_packet_t *);
 
 /* Request handlers  */
 
@@ -110,5 +117,6 @@ bool key_changed_h(struct meshlink_handle *mesh, struct connection_t *, const ch
 bool req_key_h(struct meshlink_handle *mesh, struct connection_t *, const char *);
 bool ans_key_h(struct meshlink_handle *mesh, struct connection_t *, const char *);
 bool tcppacket_h(struct meshlink_handle *mesh, struct connection_t *, const char *);
+bool raw_packet_h(struct meshlink_handle *mesh, struct connection_t *, const char *);
 
 #endif