X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;f=src%2Fconnection.h;h=d9e04f8c9942724e768e106281328ceea96ebd4a;hb=HEAD;hp=ef688549062689e6b66cac2006ee4e9b03147188;hpb=bab00223b01190f844e5af5348efe508c2753833;p=meshlink diff --git a/src/connection.h b/src/connection.h index ef688549..5e3a7ac7 100644 --- a/src/connection.h +++ b/src/connection.h @@ -34,13 +34,14 @@ typedef struct connection_status_t { uint16_t pinged: 1; /* sent ping */ uint16_t active: 1; /* 1 if active.. */ uint16_t connecting: 1; /* 1 if we are waiting for a non-blocking connect() to finish */ - uint16_t mst: 1; /* 1 if this connection is part of a minimum spanning tree */ + uint16_t unused: 1; uint16_t control: 1; /* 1 if this is a control connection */ uint16_t pcap: 1; /* 1 if this is a control connection requesting packet capture */ uint16_t log: 1; /* 1 if this is a control connection requesting log dump */ uint16_t invitation: 1; /* 1 if this is an invitation */ uint16_t invitation_used: 1; /* 1 if the invitation has been consumed */ uint16_t initiator: 1; /* 1 if we initiated this connection */ + uint16_t raw_packet: 1; /* 1 if we are expecting a raw packet next */ } connection_status_t; #include "ecdsa.h" @@ -67,6 +68,7 @@ typedef struct connection_t { int tcplen; /* length of incoming TCPpacket */ int allow_request; /* defined if there's only one request possible */ time_t last_ping_time; /* last time we saw some activity from the other end or pinged them */ + time_t last_key_renewal; /* last time we renewed the SPTPS key */ struct outgoing_t *outgoing; /* used to keep track of outgoing connections */ @@ -77,13 +79,14 @@ typedef struct connection_t { ecdsa_t *ecdsa; /* his public ECDSA key */ int protocol_major; /* used protocol */ int protocol_minor; /* used protocol */ + uint32_t flags; /* used protocol flags */ } connection_t; -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(struct meshlink_handle *mesh, connection_t *); -extern void connection_del(struct meshlink_handle *mesh, connection_t *); +void init_connections(struct meshlink_handle *mesh); +void exit_connections(struct meshlink_handle *mesh); +connection_t *new_connection(void) __attribute__((__malloc__)); +void free_connection(connection_t *); +void connection_add(struct meshlink_handle *mesh, connection_t *); +void connection_del(struct meshlink_handle *mesh, connection_t *); #endif