2424
2525#include "congure_impl.h"
2626
27- static int _json_statham (int argc , char * * argv );
28- static int _set_cwnd (int argc , char * * argv );
29- static int _set_ssthresh (int argc , char * * argv );
30- static int _set_limited (int argc , char * * argv );
31- static int _set_max_ack_delay (int argc , char * * argv );
32- static int _set_recovery_start (int argc , char * * argv );
33- static int _get_event_cb (int argc , char * * argv );
34-
3527static congure_quic_snd_t _congure_state ;
36- static const shell_command_t shell_commands [] = {
37- { "state" , "Prints current CongURE state object as JSON" , _json_statham },
38- { "set_cwnd" , "Set cwnd member for CongURE state object" , _set_cwnd },
39- { "set_ssthresh" , "Set ssthresh member for CongURE state object" ,
40- _set_ssthresh },
41- { "set_limited" , "Set limited member for CongURE state object" ,
42- _set_limited },
43- { "set_max_ack_delay" , "Set max_ack_delay member for CongURE state object" ,
44- _set_max_ack_delay },
45- { "set_recovery_start" , "Set recovery_start member for CongURE state object" ,
46- _set_recovery_start },
47- { "get_event_cb" ,
48- "Get state of cong_event_cb mock of CongURE state object" ,
49- _get_event_cb },
50- { NULL , NULL , NULL }
51- };
5228
5329int main (void )
5430{
5531 char line_buf [SHELL_DEFAULT_BUFSIZE ];
56- shell_run (shell_commands , line_buf , SHELL_DEFAULT_BUFSIZE );
32+ shell_run (NULL , line_buf , SHELL_DEFAULT_BUFSIZE );
5733 return 0 ;
5834}
5935
@@ -124,6 +100,8 @@ static int _json_statham(int argc, char **argv)
124100 return 0 ;
125101}
126102
103+ SHELL_COMMAND (state , "Prints current CongURE state object as JSON" , _json_statham );
104+
127105static int _set_cwnd (int argc , char * * argv )
128106{
129107 uint32_t tmp ;
@@ -140,6 +118,8 @@ static int _set_cwnd(int argc, char **argv)
140118 return 0 ;
141119}
142120
121+ SHELL_COMMAND (set_cwnd , "Set cwnd member for CongURE state object" , _set_cwnd );
122+
143123static int _set_ssthresh (int argc , char * * argv )
144124{
145125 uint32_t tmp ;
@@ -156,6 +136,8 @@ static int _set_ssthresh(int argc, char **argv)
156136 return 0 ;
157137}
158138
139+ SHELL_COMMAND (set_ssthresh , "Set ssthresh member for CongURE state object" , _set_ssthresh );
140+
159141static int _set_limited (int argc , char * * argv )
160142{
161143 uint32_t tmp ;
@@ -172,6 +154,8 @@ static int _set_limited(int argc, char **argv)
172154 return 0 ;
173155}
174156
157+ SHELL_COMMAND (set_limited , "Set limited member for CongURE state object" , _set_limited );
158+
175159static int _set_max_ack_delay (int argc , char * * argv )
176160{
177161 uint32_t tmp ;
@@ -188,6 +172,9 @@ static int _set_max_ack_delay(int argc, char **argv)
188172 return 0 ;
189173}
190174
175+ SHELL_COMMAND (set_max_ack_delay ,
176+ "Set max_ack_delay member for CongURE state object" , _set_max_ack_delay );
177+
191178static int _set_recovery_start (int argc , char * * argv )
192179{
193180 if (argc < 2 ) {
@@ -198,6 +185,9 @@ static int _set_recovery_start(int argc, char **argv)
198185 return 0 ;
199186}
200187
188+ SHELL_COMMAND (set_recovery_start ,
189+ "Set recovery_start member for CongURE state object" , _set_recovery_start );
190+
201191static int _get_event_cb (int argc , char * * argv )
202192{
203193 (void )argc ;
@@ -215,4 +205,7 @@ static int _get_event_cb(int argc, char **argv)
215205 return 0 ;
216206}
217207
208+ SHELL_COMMAND (get_event_cb ,
209+ "Get state of cong_event_cb mock of CongURE state object" , _get_event_cb );
210+
218211/** @} */
0 commit comments