X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;ds=sidebyside;f=src%2Fconnection.h;h=c3c219be4d0ae0bce1463453f0ca11c88e3da1a8;hb=1bcadbde8302683f9803129f847ded42a4f66d27;hp=e1b270b3f0225ff71c1573588920b034fae67f8f;hpb=fb7b6e7a0c966a88a682f656ca1caeb9a0583c5b;p=meshlink diff --git a/src/connection.h b/src/connection.h index e1b270b3..c3c219be 100644 --- a/src/connection.h +++ b/src/connection.h @@ -17,12 +17,10 @@ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef __TINC_CONNECTION_H__ -#define __TINC_CONNECTION_H__ +#ifndef __MESHLINK_CONNECTION_H__ +#define __MESHLINK_CONNECTION_H__ #include "buffer.h" -#include "cipher.h" -#include "digest.h" #include "list.h" #include "sptps.h" @@ -66,10 +64,9 @@ typedef struct connection_t { int socket; /* socket used for this connection */ uint32_t options; /* options for this connection */ connection_status_t status; /* status info */ - int estimated_weight; /* estimation for the weight of the edge for this connection */ - struct timeval start; /* time this connection was started, used for above estimation */ struct outgoing_t *outgoing; /* used to keep track of outgoing connections */ + struct meshlink_handle *mesh; /* the mesh this connection belongs to */ struct node_t *node; /* node associated with the other end */ struct edge_t *edge; /* edge associated with this connection */ @@ -90,14 +87,11 @@ typedef struct connection_t { splay_tree_t *config_tree; /* Pointer to configuration tree belonging to him */ } connection_t; -extern list_t *connection_list; -extern connection_t *everyone; - -extern void init_connections(void); -extern void exit_connections(void); +extern void init_connections(struct meshlink_handle *mesh); +extern void exit_connections(struct meshlink_handle *mesh); extern connection_t *new_connection(void) __attribute__ ((__malloc__)); extern void free_connection(connection_t *); -extern void connection_add(connection_t *); -extern void connection_del(connection_t *); +extern void connection_add(struct meshlink_handle *mesh, connection_t *); +extern void connection_del(struct meshlink_handle *mesh, connection_t *); -#endif /* __TINC_CONNECTION_H__ */ +#endif /* __MESHLINK_CONNECTION_H__ */