Line data Source code
1 : #ifndef HEADER_fd_src_flamenco_gossip_fd_gossip_out_h 2 : #define HEADER_fd_src_flamenco_gossip_fd_gossip_out_h 3 : #include "../../util/fd_util.h" 4 : #include "../../disco/stem/fd_stem.h" 5 : #include "fd_gossip_message.h" 6 : 7 : struct fd_gossip_out_ctx { 8 : fd_wksp_t * mem; 9 : ulong chunk0; 10 : ulong wmark; 11 : ulong chunk; 12 : ulong idx; 13 : }; 14 : 15 : typedef struct fd_gossip_out_ctx fd_gossip_out_ctx_t; 16 : 17 0 : #define FD_GOSSIP_UPDATE_LINK_CI_ADDR (0UL) 18 0 : #define FD_GOSSIP_UPDATE_LINK_CI_SEEN (1UL) 19 0 : #define FD_GOSSIP_UPDATE_LINK_MISC (2UL) 20 0 : #define FD_GOSSIP_UPDATE_LINK_CNT (3UL) 21 : 22 : FD_FN_CONST static inline ulong 23 0 : fd_gossip_update_link( ulong tag ) { 24 0 : switch( tag ) { 25 0 : case FD_GOSSIP_UPDATE_TAG_DUPLICATE_SHRED: 26 0 : case FD_GOSSIP_UPDATE_TAG_WFS_DONE: return FD_GOSSIP_UPDATE_LINK_MISC; 27 0 : default: return FD_GOSSIP_UPDATE_LINK_CI_ADDR; 28 0 : } 29 0 : } 30 : 31 : 32 : FD_PROTOTYPES_BEGIN 33 : /* returns a pointer to the next available chunk in the dcache line. 34 : Writes to this line must never exceed the link's MTU. 35 : 36 : Call must be followed by a call to fd_gossip_tx_publish_chunk before 37 : a subsequent call to fd_gossip_out_get_chunk for the same ctx */ 38 : void * 39 : fd_gossip_out_get_chunk( fd_gossip_out_ctx_t * ctx ); 40 : 41 : /* publish a chunk previously acquired with fd_gossip_out_get_chunk */ 42 : void 43 : fd_gossip_tx_publish_chunk( fd_gossip_out_ctx_t * ctx, 44 : fd_stem_context_t * stem, 45 : ulong sig, 46 : ulong sz, 47 : long now ); 48 : 49 : FD_PROTOTYPES_END 50 : 51 : #endif /* HEADER_fd_src_flamenco_gossip_fd_gossip_out_h */