Line data Source code
1 : #ifndef HEADER_fd_src_disco_events_fd_event_client_h 2 : #define HEADER_fd_src_disco_events_fd_event_client_h 3 : 4 : #include "fd_circq.h" 5 : #include "../keyguard/fd_keyguard_client.h" 6 : #include "../../discof/genesis/fd_genesi_tile.h" 7 : 8 : #if FD_HAS_OPENSSL 9 : #include <openssl/ssl.h> 10 : #endif 11 : 12 0 : #define FD_EVENT_CLIENT_STATE_DISCONNECTED (0) 13 0 : #define FD_EVENT_CLIENT_STATE_CONNECTING (1) 14 0 : #define FD_EVENT_CLIENT_STATE_AUTHENTICATING (2) 15 0 : #define FD_EVENT_CLIENT_STATE_CONFIRMING_AUTH (3) 16 0 : #define FD_EVENT_CLIENT_STATE_CONNECTED (4) 17 : 18 : struct fd_event_client; 19 : typedef struct fd_event_client fd_event_client_t; 20 : 21 : struct fd_event_client_metrics { 22 : ulong transport_fail_cnt; 23 : ulong transport_success_cnt; 24 : ulong events_sent; 25 : ulong events_acked; 26 : ulong bytes_written; 27 : ulong bytes_read; 28 : }; 29 : 30 : typedef struct fd_event_client_metrics fd_event_client_metrics_t; 31 : 32 : FD_PROTOTYPES_BEGIN 33 : 34 : FD_FN_CONST ulong 35 : fd_event_client_align( void ); 36 : 37 : FD_FN_CONST ulong 38 : fd_event_client_footprint( ulong buf_max ); 39 : 40 : void * 41 : fd_event_client_new( void * shmem, 42 : fd_keyguard_client_t * keyguard_client, 43 : fd_rng_t * rng, 44 : fd_circq_t * circq, 45 : int so_sndbuf, 46 : char const * endpoint, 47 : uchar const * identity_pubkey, 48 : char const * client_version, 49 : ulong instance_id, 50 : ulong boot_id, 51 : ulong machine_id, 52 : ulong buf_max ); 53 : 54 : fd_event_client_t * 55 : fd_event_client_join( void * shec ); 56 : 57 : fd_event_client_metrics_t const * 58 : fd_event_client_metrics( fd_event_client_t const * client ); 59 : 60 : ulong 61 : fd_event_client_state( fd_event_client_t const * client ); 62 : 63 : ulong 64 : fd_event_client_id_reserve( fd_event_client_t * client ); 65 : 66 : void 67 : fd_event_client_init_genesis( fd_event_client_t * client, 68 : fd_genesis_meta_t const * genesis_meta ); 69 : 70 : void 71 : fd_event_client_init_shred_version( fd_event_client_t * client, 72 : ushort shred_version ); 73 : 74 : void 75 : fd_event_client_set_identity( fd_event_client_t * client, 76 : uchar const * identity_pubkey ); 77 : 78 : void 79 : fd_event_client_poll( fd_event_client_t * client, 80 : int * charge_busy ); 81 : 82 : FD_PROTOTYPES_END 83 : 84 : #endif /* HEADER_fd_src_disco_events_fd_event_client_h */