Line data Source code
1 : #ifndef HEADER_fd_src_discof_txsend_fd_txsend_tile_h 2 : #define HEADER_fd_src_discof_txsend_fd_txsend_tile_h 3 : 4 : #include "../../waltz/quic/fd_quic.h" 5 : #include "../../flamenco/types/fd_types_custom.h" 6 : #include "../../flamenco/leaders/fd_multi_epoch_leaders.h" 7 : #include "../../flamenco/gossip/fd_gossip_message.h" 8 : #include "../../disco/stem/fd_stem.h" 9 : #include "../../disco/net/fd_net_tile.h" 10 : #include "../../disco/keyguard/fd_keyguard_client.h" 11 : #include "../../disco/keyguard/fd_keyswitch.h" 12 : #include "../../util/net/fd_net_headers.h" 13 : 14 : struct fd_txsend_in { 15 : fd_wksp_t * mem; 16 : ulong chunk0; 17 : ulong wmark; 18 : ulong mtu; 19 : }; 20 : 21 : typedef struct fd_txsend_in fd_txsend_in_t; 22 : 23 : struct fd_txsend_out { 24 : ulong idx; 25 : fd_wksp_t * mem; 26 : ulong chunk0; 27 : ulong wmark; 28 : ulong chunk; 29 : }; 30 : 31 : typedef struct fd_txsend_out fd_txsend_out_t; 32 : 33 : struct peer_entry { 34 : int tombstoned; 35 : fd_pubkey_t pubkey; 36 : 37 : uint quic_ip_addrs[ 2UL ]; 38 : ushort quic_ports[ 2UL ]; 39 : 40 : fd_quic_conn_t * quic_conns[ 2UL ]; 41 : long quic_last_connected[ 2UL ]; 42 : 43 : uint udp_ip_addrs[ 2UL ]; 44 : ushort udp_ports[ 2UL ]; 45 : 46 : struct { 47 : ulong prev; 48 : ulong next; 49 : } map; 50 : }; 51 : 52 : typedef struct peer_entry peer_entry_t; 53 : 54 : #define MAP_NAME peer_map 55 : #define MAP_KEY pubkey 56 : #define MAP_ELE_T peer_entry_t 57 : #define MAP_KEY_T fd_pubkey_t 58 : #define MAP_PREV map.prev 59 : #define MAP_NEXT map.next 60 0 : #define MAP_KEY_EQ(k0,k1) fd_pubkey_eq( k0, k1 ) 61 0 : #define MAP_KEY_HASH(key,seed) (seed^fd_ulong_load_8( (key)->uc )) 62 : #define MAP_IMPL_STYLE 1 63 : #include "../../util/tmpl/fd_map_chain.c" 64 : 65 : struct quic_entry { 66 : fd_quic_conn_t * conn; 67 : fd_pubkey_t pubkey; 68 : }; 69 : 70 : typedef struct quic_entry quic_entry_t; 71 : 72 : struct fd_txsend_tile { 73 : fd_quic_t * quic; 74 : 75 : ulong leader_schedules; 76 : fd_multi_epoch_leaders_t * mleaders; 77 : 78 : ulong seed; 79 : peer_map_t * peer_map; 80 : 81 : peer_entry_t peers[ FD_CONTACT_INFO_TABLE_SIZE ]; 82 : 83 : ulong conns_len; 84 : quic_entry_t conns[ 128UL ]; 85 : 86 : ulong voted_slot; 87 : 88 : fd_stem_context_t * stem; 89 : 90 : ulong chunk; 91 : uchar quic_buf[ FD_NET_MTU ]; 92 : 93 : uint src_ip_addr; 94 : ushort src_port; 95 : fd_ip4_udp_hdrs_t packet_hdr[1]; /* template, but will be modified directly */ 96 : ushort net_id; 97 : 98 : fd_aio_t quic_tx_aio[1]; 99 : 100 : int in_kind[ 32UL ]; 101 : fd_txsend_in_t in[ 32UL ]; 102 : fd_net_rx_bounds_t net_in_bounds[ 64UL ]; 103 : 104 : fd_txsend_out_t txsend_out[1]; 105 : fd_txsend_out_t net_out[1]; 106 : 107 : fd_keyswitch_t * keyswitch; 108 : ulong tower_in_expect_seq; 109 : int halt_net_frags; 110 : 111 : fd_pubkey_t identity_key[1]; 112 : fd_keyguard_client_t keyguard_client[1]; 113 : 114 : uchar __attribute__((aligned(FD_MULTI_EPOCH_LEADERS_ALIGN))) mleaders_mem[ FD_MULTI_EPOCH_LEADERS_FOOTPRINT ]; 115 : }; 116 : 117 : typedef struct fd_txsend_tile fd_txsend_tile_t; 118 : 119 : #endif /* HEADER_fd_src_discof_txsend_fd_txsend_tile_h */