Implement sack based tcp loss recovery (RFC 6675)
[vpp.git] / src / vnet / tcp / builtin_client.c
1 /*
2  * builtin_client.c - vpp built-in tcp client/connect code
3  *
4  * Copyright (c) 2017 by Cisco and/or its affiliates.
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at:
8  *
9  *     http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17
18 #include <vnet/vnet.h>
19 #include <vnet/plugin/plugin.h>
20 #include <vnet/tcp/builtin_client.h>
21
22 #include <vlibapi/api.h>
23 #include <vlibmemory/api.h>
24 #include <vlibsocket/api.h>
25 #include <vpp/app/version.h>
26
27 /* define message IDs */
28 #include <vpp/api/vpe_msg_enum.h>
29
30 /* define message structures */
31 #define vl_typedefs
32 #include <vpp/api/vpe_all_api_h.h>
33 #undef vl_typedefs
34
35 /* define generated endian-swappers */
36 #define vl_endianfun
37 #include <vpp/api/vpe_all_api_h.h>
38 #undef vl_endianfun
39
40 /* instantiate all the print functions we know about */
41 #define vl_print(handle, ...) vlib_cli_output (handle, __VA_ARGS__)
42 #define vl_printfun
43 #include <vpp/api/vpe_all_api_h.h>
44 #undef vl_printfun
45
46 #define TCP_BUILTIN_CLIENT_DBG (1)
47
48 static void
49 send_test_chunk (tclient_main_t * tm, session_t * s)
50 {
51   u8 *test_data = tm->connect_test_data;
52   int test_buf_offset;
53   u32 bytes_this_chunk;
54   session_fifo_event_t evt;
55   static int serial_number = 0;
56   int rv;
57
58   ASSERT (vec_len (test_data) > 0);
59
60   test_buf_offset = s->bytes_sent % vec_len (test_data);
61   bytes_this_chunk = vec_len (test_data) - test_buf_offset;
62
63   bytes_this_chunk = bytes_this_chunk < s->bytes_to_send
64     ? bytes_this_chunk : s->bytes_to_send;
65
66   rv = svm_fifo_enqueue_nowait (s->server_tx_fifo, bytes_this_chunk,
67                                 test_data + test_buf_offset);
68
69   /* If we managed to enqueue data... */
70   if (rv > 0)
71     {
72       /* Account for it... */
73       s->bytes_to_send -= rv;
74       s->bytes_sent += rv;
75
76       if (TCP_BUILTIN_CLIENT_DBG)
77         {
78           /* *INDENT-OFF* */
79           ELOG_TYPE_DECLARE (e) =
80             {
81               .format = "tx-enq: xfer %d bytes, sent %u remain %u",
82               .format_args = "i4i4i4",
83             };
84           /* *INDENT-ON* */
85           struct
86           {
87             u32 data[3];
88           } *ed;
89           ed = ELOG_DATA (&vlib_global_main.elog_main, e);
90           ed->data[0] = rv;
91           ed->data[1] = s->bytes_sent;
92           ed->data[2] = s->bytes_to_send;
93         }
94
95       /* Poke the TCP state machine */
96       if (svm_fifo_set_event (s->server_tx_fifo))
97         {
98           /* Fabricate TX event, send to vpp */
99           evt.fifo = s->server_tx_fifo;
100           evt.event_type = FIFO_EVENT_APP_TX;
101           evt.event_id = serial_number++;
102
103           unix_shared_memory_queue_add (tm->vpp_event_queue, (u8 *) & evt,
104                                         0 /* do wait for mutex */ );
105         }
106     }
107 }
108
109 static void
110 receive_test_chunk (tclient_main_t * tm, session_t * s)
111 {
112   svm_fifo_t *rx_fifo = s->server_rx_fifo;
113   int n_read, test_bytes = 0;
114
115   /* Allow enqueuing of new event */
116   // svm_fifo_unset_event (rx_fifo);
117
118   if (test_bytes)
119     {
120       n_read = svm_fifo_dequeue_nowait (rx_fifo, vec_len (tm->rx_buf),
121                                         tm->rx_buf);
122     }
123   else
124     {
125       n_read = svm_fifo_max_dequeue (rx_fifo);
126       svm_fifo_dequeue_drop (rx_fifo, n_read);
127     }
128
129   if (n_read > 0)
130     {
131       if (TCP_BUILTIN_CLIENT_DBG)
132         {
133           /* *INDENT-OFF* */
134           ELOG_TYPE_DECLARE (e) =
135             {
136               .format = "rx-deq: %d bytes",
137               .format_args = "i4",
138             };
139           /* *INDENT-ON* */
140           struct
141           {
142             u32 data[1];
143           } *ed;
144           ed = ELOG_DATA (&vlib_global_main.elog_main, e);
145           ed->data[0] = n_read;
146         }
147
148       if (test_bytes)
149         {
150           int i;
151           for (i = 0; i < n_read; i++)
152             {
153               if (tm->rx_buf[i] != ((s->bytes_received + i) & 0xff))
154                 {
155                   clib_warning ("read %d error at byte %lld, 0x%x not 0x%x",
156                                 n_read, s->bytes_received + i, tm->rx_buf[i],
157                                 ((s->bytes_received + i) & 0xff));
158                 }
159             }
160         }
161       s->bytes_to_receive -= n_read;
162       s->bytes_received += n_read;
163     }
164 }
165
166 static uword
167 builtin_client_node_fn (vlib_main_t * vm, vlib_node_runtime_t * node,
168                         vlib_frame_t * frame)
169 {
170   tclient_main_t *tm = &tclient_main;
171   int my_thread_index = vlib_get_thread_index ();
172   vl_api_disconnect_session_t *dmp;
173   session_t *sp;
174   int i;
175   int delete_session;
176   u32 *connection_indices;
177   u32 tx_quota = 0;
178   u32 delta, prev_bytes_received_this_session;
179
180   connection_indices = tm->connection_index_by_thread[my_thread_index];
181
182   if (tm->run_test == 0 || vec_len (connection_indices) == 0)
183     return 0;
184
185   for (i = 0; i < vec_len (connection_indices); i++)
186     {
187       delete_session = 1;
188
189       sp = pool_elt_at_index (tm->sessions, connection_indices[i]);
190
191       if (tx_quota < 60 && sp->bytes_to_send > 0)
192         {
193           send_test_chunk (tm, sp);
194           delete_session = 0;
195           tx_quota++;
196         }
197       if (sp->bytes_to_receive > 0)
198         {
199           prev_bytes_received_this_session = sp->bytes_received;
200           receive_test_chunk (tm, sp);
201           delta = sp->bytes_received - prev_bytes_received_this_session;
202           if (delta > 0)
203             tx_quota--;
204           delete_session = 0;
205         }
206       if (PREDICT_FALSE (delete_session == 1))
207         {
208           __sync_fetch_and_add (&tm->rx_total, sp->bytes_received);
209           dmp = vl_msg_api_alloc_as_if_client (sizeof (*dmp));
210           memset (dmp, 0, sizeof (*dmp));
211           dmp->_vl_msg_id = ntohs (VL_API_DISCONNECT_SESSION);
212           dmp->client_index = tm->my_client_index;
213           dmp->handle = sp->vpp_session_handle;
214 //        vl_msg_api_send_shmem (tm->vl_input_queue, (u8 *) & dmp);
215           if (!unix_shared_memory_queue_add (tm->vl_input_queue, (u8 *) & dmp,
216                                              1))
217             {
218               vec_delete (connection_indices, 1, i);
219               tm->connection_index_by_thread[my_thread_index] =
220                 connection_indices;
221               __sync_fetch_and_add (&tm->ready_connections, -1);
222             }
223           else
224             {
225               vl_msg_api_free (dmp);
226             }
227
228           /* Kick the debug CLI process */
229           if (tm->ready_connections == 0)
230             {
231               tm->test_end_time = vlib_time_now (vm);
232               vlib_process_signal_event (vm, tm->cli_node_index,
233                                          2, 0 /* data */ );
234             }
235         }
236     }
237   return 0;
238 }
239
240 /* *INDENT-OFF* */
241 VLIB_REGISTER_NODE (builtin_client_node) =
242 {
243   .function = builtin_client_node_fn,
244   .name = "builtin-tcp-client",
245   .type = VLIB_NODE_TYPE_INPUT,
246   .state = VLIB_NODE_STATE_DISABLED,
247 };
248 /* *INDENT-ON* */
249
250
251 /* So we don't get "no handler for... " msgs */
252 static void
253 vl_api_memclnt_create_reply_t_handler (vl_api_memclnt_create_reply_t * mp)
254 {
255   vlib_main_t *vm = vlib_get_main ();
256   tclient_main_t *tm = &tclient_main;
257   tm->my_client_index = mp->index;
258   vlib_process_signal_event (vm, tm->node_index, 1 /* evt */ ,
259                              0 /* data */ );
260 }
261
262 static void
263 vl_api_connect_uri_reply_t_handler (vl_api_connect_uri_reply_t * mp)
264 {
265   tclient_main_t *tm = &tclient_main;
266   session_t *session;
267   u32 session_index;
268   i32 retval = /* clib_net_to_host_u32 ( */ mp->retval /*) */ ;
269   int i;
270
271   if (retval < 0)
272     {
273       clib_warning ("connection failed: retval %d", retval);
274       return;
275     }
276
277   tm->our_event_queue =
278     uword_to_pointer (mp->vpp_event_queue_address,
279                       unix_shared_memory_queue_t *);
280   tm->vpp_event_queue =
281     uword_to_pointer (mp->vpp_event_queue_address,
282                       unix_shared_memory_queue_t *);
283
284   /*
285    * Setup session
286    */
287   pool_get (tm->sessions, session);
288   memset (session, 0, sizeof (*session));
289   session_index = session - tm->sessions;
290   session->bytes_to_receive = session->bytes_to_send = tm->bytes_to_send;
291
292   session->server_rx_fifo =
293     uword_to_pointer (mp->server_rx_fifo, svm_fifo_t *);
294   session->server_rx_fifo->client_session_index = session_index;
295   session->server_tx_fifo =
296     uword_to_pointer (mp->server_tx_fifo, svm_fifo_t *);
297   session->server_tx_fifo->client_session_index = session_index;
298   session->vpp_session_handle = mp->handle;
299
300   /* Add it to the session lookup table */
301   hash_set (tm->session_index_by_vpp_handles, mp->handle, session_index);
302
303   if (tm->ready_connections == tm->expected_connections - 1)
304     {
305       vlib_thread_main_t *thread_main = vlib_get_thread_main ();
306       int thread_index;
307
308       thread_index = 0;
309       for (i = 0; i < pool_elts (tm->sessions); i++)
310         {
311           vec_add1 (tm->connection_index_by_thread[thread_index], i);
312           thread_index++;
313           if (thread_index == thread_main->n_vlib_mains)
314             thread_index = 0;
315         }
316     }
317   __sync_fetch_and_add (&tm->ready_connections, 1);
318   if (tm->ready_connections == tm->expected_connections)
319     {
320       tm->run_test = 1;
321       tm->test_start_time = vlib_time_now (tm->vlib_main);
322       /* Signal the CLI process that the action is starting... */
323       vlib_process_signal_event (tm->vlib_main, tm->cli_node_index,
324                                  1, 0 /* data */ );
325     }
326 }
327
328 static int
329 create_api_loopback (tclient_main_t * tm)
330 {
331   vlib_main_t *vm = vlib_get_main ();
332   vl_api_memclnt_create_t _m, *mp = &_m;
333   extern void vl_api_memclnt_create_t_handler (vl_api_memclnt_create_t *);
334   api_main_t *am = &api_main;
335   vl_shmem_hdr_t *shmem_hdr;
336   uword *event_data = 0, event_type;
337   int resolved = 0;
338
339   /*
340    * Create a "loopback" API client connection
341    * Don't do things like this unless you know what you're doing...
342    */
343
344   shmem_hdr = am->shmem_hdr;
345   tm->vl_input_queue = shmem_hdr->vl_input_queue;
346   memset (mp, 0, sizeof (*mp));
347   mp->_vl_msg_id = VL_API_MEMCLNT_CREATE;
348   mp->context = 0xFEEDFACE;
349   mp->input_queue = pointer_to_uword (tm->vl_input_queue);
350   strncpy ((char *) mp->name, "tcp_tester", sizeof (mp->name) - 1);
351
352   vl_api_memclnt_create_t_handler (mp);
353
354   /* Wait for reply */
355   tm->node_index = vlib_get_current_process (vm)->node_runtime.node_index;
356   vlib_process_wait_for_event_or_clock (vm, 1.0);
357   event_type = vlib_process_get_events (vm, &event_data);
358   switch (event_type)
359     {
360     case 1:
361       resolved = 1;
362       break;
363     case ~0:
364       /* timed out */
365       break;
366     default:
367       clib_warning ("unknown event_type %d", event_type);
368     }
369   if (!resolved)
370     return -1;
371   return 0;
372 }
373
374 #define foreach_tclient_static_api_msg          \
375 _(MEMCLNT_CREATE_REPLY, memclnt_create_reply)   \
376 _(CONNECT_URI_REPLY, connect_uri_reply)
377
378 static clib_error_t *
379 tclient_api_hookup (vlib_main_t * vm)
380 {
381   vl_msg_api_msg_config_t _c, *c = &_c;
382
383   /* Hook up client-side static APIs to our handlers */
384 #define _(N,n) do {                                             \
385     c->id = VL_API_##N;                                         \
386     c->name = #n;                                               \
387     c->handler = vl_api_##n##_t_handler;                        \
388     c->cleanup = vl_noop_handler;                               \
389     c->endian = vl_api_##n##_t_endian;                          \
390     c->print = vl_api_##n##_t_print;                            \
391     c->size = sizeof(vl_api_##n##_t);                           \
392     c->traced = 1; /* trace, so these msgs print */             \
393     c->replay = 0; /* don't replay client create/delete msgs */ \
394     c->message_bounce = 0; /* don't bounce this message */      \
395     vl_msg_api_config(c);} while (0);
396
397   foreach_tclient_static_api_msg;
398 #undef _
399
400   return 0;
401 }
402
403 static int
404 tcp_test_clients_init (vlib_main_t * vm)
405 {
406   tclient_main_t *tm = &tclient_main;
407   vlib_thread_main_t *thread_main = vlib_get_thread_main ();
408   int i;
409
410   tclient_api_hookup (vm);
411   if (create_api_loopback (tm))
412     return -1;
413
414   /* Init test data */
415   vec_validate (tm->connect_test_data, 64 * 1024 - 1);
416   for (i = 0; i < vec_len (tm->connect_test_data); i++)
417     tm->connect_test_data[i] = i & 0xff;
418
419   tm->session_index_by_vpp_handles = hash_create (0, sizeof (uword));
420   vec_validate (tm->rx_buf, vec_len (tm->connect_test_data) - 1);
421
422   tm->is_init = 1;
423   tm->vlib_main = vm;
424
425   vec_validate (tm->connection_index_by_thread, thread_main->n_vlib_mains);
426   return 0;
427 }
428
429 static int
430 builtin_session_connected_callback (u32 app_index, u32 api_context,
431                                     stream_session_t * s, u8 is_fail)
432 {
433   vl_api_connect_uri_reply_t _m, *mp = &_m;
434   unix_shared_memory_queue_t *q;
435   application_t *app;
436   unix_shared_memory_queue_t *vpp_queue;
437
438   app = application_get (app_index);
439   q = vl_api_client_index_to_input_queue (app->api_client_index);
440
441   if (!q)
442     return -1;
443
444   memset (mp, 0, sizeof (*mp));
445   mp->_vl_msg_id = clib_host_to_net_u16 (VL_API_CONNECT_URI_REPLY);
446   mp->context = api_context;
447   if (!is_fail)
448     {
449       vpp_queue = session_manager_get_vpp_event_queue (s->thread_index);
450       mp->server_rx_fifo = pointer_to_uword (s->server_rx_fifo);
451       mp->server_tx_fifo = pointer_to_uword (s->server_tx_fifo);
452       mp->handle = stream_session_handle (s);
453       mp->vpp_event_queue_address = pointer_to_uword (vpp_queue);
454       mp->retval = 0;
455       s->session_state = SESSION_STATE_READY;
456     }
457   else
458     {
459       mp->retval = clib_host_to_net_u32 (VNET_API_ERROR_SESSION_CONNECT_FAIL);
460     }
461
462   vl_api_connect_uri_reply_t_handler (mp);
463
464   return 0;
465 }
466
467 static void
468 builtin_session_reset_callback (stream_session_t * s)
469 {
470   return;
471 }
472
473 static int
474 builtin_session_create_callback (stream_session_t * s)
475 {
476   return 0;
477 }
478
479 static void
480 builtin_session_disconnect_callback (stream_session_t * s)
481 {
482   return;
483 }
484
485 static int
486 builtin_server_rx_callback (stream_session_t * s)
487 {
488   return 0;
489 }
490
491 /* *INDENT-OFF* */
492 static session_cb_vft_t builtin_clients =
493   {
494     .session_reset_callback = builtin_session_reset_callback,
495     .session_connected_callback = builtin_session_connected_callback,
496     .session_accept_callback = builtin_session_create_callback,
497     .session_disconnect_callback = builtin_session_disconnect_callback,
498     .builtin_server_rx_callback = builtin_server_rx_callback
499   };
500 /* *INDENT-ON* */
501
502 static int
503 attach_builtin_test_clients ()
504 {
505   tclient_main_t *tm = &tclient_main;
506   vnet_app_attach_args_t _a, *a = &_a;
507   u8 segment_name[128];
508   u32 segment_name_length;
509   u64 options[16];
510
511   segment_name_length = ARRAY_LEN (segment_name);
512
513   memset (a, 0, sizeof (*a));
514   memset (options, 0, sizeof (options));
515
516   a->api_client_index = tm->my_client_index;
517   a->segment_name = segment_name;
518   a->segment_name_length = segment_name_length;
519   a->session_cb_vft = &builtin_clients;
520
521   options[SESSION_OPTIONS_ACCEPT_COOKIE] = 0x12345678;
522   options[SESSION_OPTIONS_SEGMENT_SIZE] = (2 << 30);    /*$$$$ config / arg */
523   options[APP_OPTIONS_FLAGS] = APP_OPTIONS_FLAGS_BUILTIN_APP;
524
525   a->options = options;
526
527   return vnet_application_attach (a);
528 }
529
530 static clib_error_t *
531 test_tcp_clients_command_fn (vlib_main_t * vm,
532                              unformat_input_t * input,
533                              vlib_cli_command_t * cmd)
534 {
535   tclient_main_t *tm = &tclient_main;
536   vlib_thread_main_t *thread_main = vlib_get_thread_main ();
537   uword *event_data = 0;
538   uword event_type;
539   u8 *connect_uri = (u8 *) "tcp://6.0.1.1/1234";
540   u8 *uri;
541   u32 n_clients = 1;
542   int i;
543   u64 tmp;
544   f64 cli_timeout = 20.0;
545   f64 delta;
546
547   tm->bytes_to_send = 8192;
548   vec_free (tm->connect_uri);
549
550   while (unformat_check_input (input) != UNFORMAT_END_OF_INPUT)
551     {
552       if (unformat (input, "nclients %d", &n_clients))
553         ;
554       else if (unformat (input, "mbytes %lld", &tmp))
555         tm->bytes_to_send = tmp << 20;
556       else if (unformat (input, "gbytes %lld", &tmp))
557         tm->bytes_to_send = tmp << 30;
558       else if (unformat (input, "bytes %lld", &tm->bytes_to_send))
559         ;
560       else if (unformat (input, "uri %s", &tm->connect_uri))
561         ;
562       else if (unformat (input, "cli-timeout %f", &cli_timeout))
563         ;
564       else
565         return clib_error_return (0, "unknown input `%U'",
566                                   format_unformat_error, input);
567     }
568
569   if (tm->is_init == 0)
570     {
571       if (tcp_test_clients_init (vm))
572         return clib_error_return (0, "failed init");
573     }
574
575   tm->ready_connections = 0;
576   tm->expected_connections = n_clients;
577   tm->rx_total = 0;
578
579   uri = connect_uri;
580   if (tm->connect_uri)
581     uri = tm->connect_uri;
582
583 #if TCP_BUILTIN_CLIENT_PTHREAD
584   /* Start a transmit thread */
585   if (tm->client_thread_handle == 0)
586     {
587       int rv = pthread_create (&tm->client_thread_handle,
588                                NULL /*attr */ ,
589                                tclient_thread_fn, 0);
590       if (rv)
591         {
592           tm->client_thread_handle = 0;
593           return clib_error_return (0, "pthread_create returned %d", rv);
594         }
595     }
596 #endif
597   vnet_session_enable_disable (vm, 1 /* turn on TCP, etc. */ );
598   if (tm->test_client_attached == 0)
599     attach_builtin_test_clients ();
600   tm->test_client_attached = 1;
601
602   /* Turn on the builtin client input nodes */
603   for (i = 0; i < thread_main->n_vlib_mains; i++)
604     vlib_node_set_state (vlib_mains[i], builtin_client_node.index,
605                          VLIB_NODE_STATE_POLLING);
606
607   tm->cli_node_index = vlib_get_current_process (vm)->node_runtime.node_index;
608
609   /* Fire off connect requests */
610   for (i = 0; i < n_clients; i++)
611     {
612       vl_api_connect_uri_t _cmp, *cmp = &_cmp;
613       void vl_api_connect_uri_t_handler (vl_api_connect_uri_t * cmp);
614
615       memset (cmp, 0, sizeof (*cmp));
616
617       cmp->_vl_msg_id = ntohs (VL_API_CONNECT_URI);
618       cmp->client_index = tm->my_client_index;
619       cmp->context = ntohl (0xfeedface);
620       memcpy (cmp->uri, uri, strlen ((char *) uri) + 1);
621
622       vl_api_connect_uri_t_handler (cmp);
623       /* Crude pacing for call setups, 100k/sec  */
624       vlib_process_suspend (vm, 10e-6);
625     }
626
627   /* Park until the sessions come up, or ten seconds elapse... */
628   vlib_process_wait_for_event_or_clock (vm, 10.0 /* timeout, seconds */ );
629   event_type = vlib_process_get_events (vm, &event_data);
630
631   switch (event_type)
632     {
633     case ~0:
634       vlib_cli_output (vm, "Timeout with only %d sessions active...",
635                        tm->ready_connections);
636       goto cleanup;
637
638     case 1:
639       vlib_cli_output (vm, "Test started at %.6f", tm->test_start_time);
640       break;
641
642     default:
643       vlib_cli_output (vm, "unexpected event(1): %d", event_type);
644       goto cleanup;
645     }
646
647   /* Now wait for the sessions to finish... */
648   vlib_process_wait_for_event_or_clock (vm, cli_timeout);
649   event_type = vlib_process_get_events (vm, &event_data);
650
651   switch (event_type)
652     {
653     case ~0:
654       vlib_cli_output (vm, "Timeout with %d sessions still active...",
655                        tm->ready_connections);
656       goto cleanup;
657
658     case 2:
659       vlib_cli_output (vm, "Test finished at %.6f", tm->test_end_time);
660       break;
661
662     default:
663       vlib_cli_output (vm, "unexpected event(2): %d", event_type);
664       goto cleanup;
665     }
666
667   delta = tm->test_end_time - tm->test_start_time;
668
669   if (delta != 0.0)
670     {
671       vlib_cli_output (vm,
672                        "%lld bytes (%lld mbytes, %lld gbytes) in %.2f seconds",
673                        tm->rx_total, tm->rx_total / (1ULL << 20),
674                        tm->rx_total / (1ULL << 30), delta);
675       vlib_cli_output (vm, "%.2f bytes/second full-duplex",
676                        ((f64) tm->rx_total) / (delta));
677       vlib_cli_output (vm, "%.4f gbit/second full-duplex",
678                        (((f64) tm->rx_total * 8.0) / delta / 1e9));
679     }
680   else
681     vlib_cli_output (vm, "zero delta-t?");
682
683 cleanup:
684   pool_free (tm->sessions);
685   for (i = 0; i < vec_len (tm->connection_index_by_thread); i++)
686     vec_reset_length (tm->connection_index_by_thread[i]);
687
688   return 0;
689 }
690
691 /* *INDENT-OFF* */
692 VLIB_CLI_COMMAND (test_clients_command, static) =
693 {
694   .path = "test tcp clients",
695   .short_help = "test tcp clients [nclients %d]"
696   "[iterations %d] [bytes %d] [uri tcp://6.0.1.1/1234]",
697   .function = test_tcp_clients_command_fn,
698 };
699 /* *INDENT-ON* */
700
701 clib_error_t *
702 tcp_test_clients_main_init (vlib_main_t * vm)
703 {
704   tclient_main_t *tm = &tclient_main;
705   tm->is_init = 0;
706   return 0;
707 }
708
709 VLIB_INIT_FUNCTION (tcp_test_clients_main_init);
710
711 /*
712  * fd.io coding-style-patch-verification: ON
713  *
714  * Local Variables:
715  * eval: (c-set-style "gnu")
716  * End:
717  */