]> git.meshlink.io Git - meshlink/blobdiff - src/net.h
Make retry outgoing logic instantaneously connect when a change is discovered on...
[meshlink] / src / net.h
index 0ff313d0bdafd1d7f120082e46413629aad62ab0..cc84ce96035379b9d723ee63173502db4e9ca908 100644 (file)
--- a/src/net.h
+++ b/src/net.h
 #define MAXBUFSIZE ((MAXSIZE > 2048 ? MAXSIZE : 2048) + 128)
 
 typedef struct vpn_packet_t {
-       struct {
-               unsigned int probe: 1;
-               unsigned int tcp: 1;
-       };
+       unsigned int probe: 1;
+       unsigned int tcp: 1;
        uint16_t len;           /* the actual number of bytes in the `data' field */
        uint8_t data[MAXSIZE];
 } vpn_packet_t;
@@ -60,12 +58,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;