]> git.meshlink.io Git - meshlink/blobdiff - src/net.h
Move the routing header out of the SPTPS payload.
[meshlink] / src / net.h
index afefa17b683e9031c443de3f9b39fda67624965d..757d15e6ef90e8ed72a034d26953fb4798ff5266 100644 (file)
--- a/src/net.h
+++ b/src/net.h
@@ -41,6 +41,9 @@ typedef struct vpn_packet_t {
                unsigned int tcp: 1;
        };
        uint16_t len;           /* the actual number of bytes in the `data' field */
+
+       uint64_t src;
+       uint64_t dst;
        uint8_t data[MAXSIZE];
 } vpn_packet_t;
 
@@ -60,12 +63,19 @@ typedef enum packet_type_t {
 
 typedef struct outgoing_t {
        char *name;
-       int timeout;
        struct splay_tree_t *config_tree;
+       int timeout;
+       enum {
+               OUTGOING_START,
+               OUTGOING_CANONICAL,
+               OUTGOING_RECENT,
+               OUTGOING_KNOWN,
+               OUTGOING_END,
+               OUTGOING_NO_KNOWN_ADDRESSES,
+       } state;
        struct config_t *cfg;
-       struct addrinfo *ai; // addresses from config files
+       struct addrinfo *ai;
        struct addrinfo *aip;
-       struct addrinfo *nai; // addresses known via other online nodes (use free_known_addresses())
        timeout_t ev;
        struct meshlink_handle *mesh;
 } outgoing_t;
@@ -110,8 +120,6 @@ extern void retry(struct meshlink_handle *mesh);
 
 #ifndef HAVE_MINGW
 #define closesocket(s) close(s)
-#else
-extern CRITICAL_SECTION mutex;
 #endif
 
 #endif