Line data Source code
1 : #ifndef HEADER_fd_src_app_fdctl_fdctl_h
2 : #define HEADER_fd_src_app_fdctl_fdctl_h
3 :
4 : #include "config.h"
5 : #include "caps.h"
6 : #include "utility.h"
7 :
8 : #include "../../disco/topo/fd_topo.h"
9 :
10 : #include <unistd.h>
11 : #include <errno.h>
12 :
13 : extern fd_topo_run_tile_t * TILES[];
14 :
15 :
16 0 : #define CONFIGURE_STAGE_COUNT 12
17 : struct configure_stage;
18 :
19 : union fdctl_args {
20 : struct {
21 : char tile_name[ 7UL ];
22 : ulong kind_id;
23 : int pipe_fd;
24 : } run1;
25 :
26 : struct {
27 : long dt_min;
28 : long dt_max;
29 : long duration;
30 : uint seed;
31 : double ns_per_tic;
32 : int drain_output_fd;
33 : int with_bench;
34 : int with_sankey;
35 : } monitor;
36 :
37 : struct {
38 : int command;
39 : struct configure_stage * stages[ CONFIGURE_STAGE_COUNT ];
40 : } configure;
41 :
42 : struct {
43 : int require_tower;
44 : int force;
45 : uchar * keypair;
46 : } set_identity;
47 :
48 : struct {
49 : int parent_pipefd;
50 : int monitor;
51 : int no_configure;
52 : int no_init_workspaces;
53 : int no_agave;
54 : char debug_tile[ 32 ];
55 : } dev;
56 :
57 : struct {
58 : char tile_name[ 7UL ];
59 : int no_configure;
60 : } dev1;
61 :
62 : struct {
63 : ulong cmd;
64 : char file_path[ 256 ];
65 : } keys;
66 :
67 : struct {
68 : const char * payload_base64;
69 : ulong count;
70 : const char * dst_ip;
71 : ushort dst_port;
72 : } txn;
73 :
74 : struct {
75 : char link_name[ 64UL ];
76 : char pcap_path[ 256UL ];
77 : } dump;
78 :
79 : struct {
80 : char name[ 13UL ];
81 : } flame;
82 :
83 : struct {
84 : char affinity[ AFFINITY_SZ ];
85 : uint tpu_ip;
86 : uint rpc_ip;
87 : ushort tpu_port;
88 : ushort rpc_port;
89 : ulong accounts;
90 : ulong connections;
91 : ulong benchg;
92 : ulong benchs;
93 : int no_quic;
94 : int transaction_mode;
95 : float contending_fraction;
96 : float cu_price_spread;
97 : } load;
98 :
99 : struct {
100 : int event;
101 : int dump; /* whether the user requested --dump */
102 : } quic_trace;
103 : };
104 :
105 : typedef union fdctl_args args_t;
106 :
107 : typedef struct fd_caps_ctx fd_caps_ctx_t;
108 :
109 : typedef struct {
110 : const char * name;
111 : const char * description;
112 : uchar is_diagnostic; /* 1 implies action should be allowed for prod debugging */
113 :
114 : void (*args)( int * pargc, char *** pargv, args_t * args );
115 : void (*perm)( args_t * args, fd_caps_ctx_t * caps, config_t const * config );
116 : void (*fn )( args_t * args, config_t * config );
117 : } action_t;
118 :
119 : ulong
120 : fdctl_obj_align( fd_topo_t const * topo,
121 : fd_topo_obj_t const * obj );
122 :
123 : ulong
124 : fdctl_obj_footprint( fd_topo_t const * topo,
125 : fd_topo_obj_t const * obj );
126 :
127 : ulong
128 : fdctl_obj_loose( fd_topo_t const * topo,
129 : fd_topo_obj_t const * obj );
130 :
131 : fd_topo_run_tile_t
132 : fdctl_tile_run( fd_topo_tile_t * tile );
133 :
134 : extern action_t ACTIONS[];
135 :
136 : void fdctl_boot( int * pargc,
137 : char *** pargv,
138 : config_t * config,
139 : char const * log_path);
140 :
141 : int
142 : main1( int argc,
143 : char ** _argv );
144 :
145 : void FD_FN_SENSITIVE
146 : generate_keypair( char const * keyfile,
147 : config_t * config,
148 : int use_grnd_random );
149 :
150 : void configure_cmd_args ( int * pargc, char *** pargv, args_t * args );
151 : void run1_cmd_args ( int * pargc, char *** pargv, args_t * args );
152 : void monitor_cmd_args ( int * pargc, char *** pargv, args_t * args );
153 : void keys_cmd_args ( int * pargc, char *** pargv, args_t * args );
154 : void set_identity_cmd_args( int * pargc, char *** pargv, args_t * args );
155 :
156 : void configure_cmd_perm ( args_t * args, fd_caps_ctx_t * caps, config_t const * config );
157 : void run_cmd_perm ( args_t * args, fd_caps_ctx_t * caps, config_t const * config );
158 : void monitor_cmd_perm ( args_t * args, fd_caps_ctx_t * caps, config_t const * config );
159 : void set_identity_cmd_perm( args_t * args, fd_caps_ctx_t * caps, config_t const * config );
160 :
161 : void configure_cmd_fn ( args_t * args, config_t * config );
162 : void run_cmd_fn ( args_t * args, config_t * config );
163 : void run1_cmd_fn ( args_t * args, config_t * config );
164 : void run_agave_cmd_fn ( args_t * args, config_t * config );
165 : void monitor_cmd_fn ( args_t * args, config_t * config );
166 : void keys_cmd_fn ( args_t * args, config_t * config );
167 : void set_identity_cmd_fn( args_t * args, config_t * config );
168 : void ready_cmd_fn ( args_t * args, config_t * config );
169 : void mem_cmd_fn ( args_t * args, config_t * config );
170 : void netconf_cmd_fn ( args_t * args, config_t * config );
171 : void help_cmd_fn ( args_t * args, config_t * config );
172 : void version_cmd_fn ( args_t * args, config_t * config );
173 :
174 : #endif /* HEADER_fd_src_app_fdctl_fdctl_h */
|