X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=src%2Fcadet%2Fgnunet-service-cadet-new.h;h=dff0d3c8c0c9368e735abb8d97d78000731e6aa8;hb=ad22adb15a0c895ac9c25d4c289abf86355a4737;hp=862a0f08846c0c0661d8a79fe422aed640da48a9;hpb=dfde8ea01a08a32340a47df29ffc2571c031488b;p=oweals%2Fgnunet.git diff --git a/src/cadet/gnunet-service-cadet-new.h b/src/cadet/gnunet-service-cadet-new.h index 862a0f088..dff0d3c8c 100644 --- a/src/cadet/gnunet-service-cadet-new.h +++ b/src/cadet/gnunet-service-cadet-new.h @@ -30,6 +30,7 @@ #include "gnunet_util_lib.h" #define NEW_CADET 1 +#include "cadet_protocol.h" /** * A client to the CADET service. Each client gets a unique handle. @@ -105,7 +106,44 @@ struct CadetPeerPathEntry /** * Entry in list of connections used by tunnel, with metadata. */ -struct CadetTConnection; +struct CadetTConnection +{ + /** + * Next in DLL. + */ + struct CadetTConnection *next; + + /** + * Prev in DLL. + */ + struct CadetTConnection *prev; + + /** + * Connection handle. + */ + struct CadetConnection *cc; + + /** + * Tunnel this connection belongs to. + */ + struct CadetTunnel *t; + + /** + * Creation time, to keep oldest connection alive. + */ + struct GNUNET_TIME_Absolute created; + + /** + * Connection throughput, to keep fastest connection alive. + */ + uint32_t throughput; + + /** + * Is the connection currently ready for transmission? + */ + int is_ready; +}; + /** * Active path through the network (used by a tunnel). There may @@ -129,6 +167,11 @@ struct CadetRoute; */ struct CadetChannel; +/** + * Handle to our configuration. + */ +extern const struct GNUNET_CONFIGURATION_Handle *cfg; + /** * Handle to the statistics service. */ @@ -182,6 +225,20 @@ extern unsigned long long ratchet_messages; */ extern struct GNUNET_TIME_Relative ratchet_time; +/** + * How frequently do we send KEEPALIVE messages on idle connections? + */ +extern struct GNUNET_TIME_Relative keepalive_period; + +/** + * Signal that shutdown is happening: prevent recovery measures. + */ +extern int shutting_down; + +/** + * Set to non-zero values to create random drops to test retransmissions. + */ +extern unsigned long long drop_percent; /** @@ -195,6 +252,19 @@ GSC_send_to_client (struct CadetClient *c, struct GNUNET_MQ_Envelope *env); +/** + * A channel was destroyed by the other peer. Tell our client. + * + * @param c client that lost a channel + * @param ccn channel identification number for the client + * @param ch the channel object + */ +void +GSC_handle_remote_channel_destroy (struct CadetClient *c, + struct GNUNET_CADET_ClientChannelNumber ccn, + struct CadetChannel *ch); + + /** * Bind incoming channel to this client, and notify client * about incoming connection.