api: use string type for strings in memclnt.api
[vpp.git] / src / vlibmemory / vlib_api.c
1 /*
2  *------------------------------------------------------------------
3  * vlib_api.c VLIB API implementation
4  *
5  * Copyright (c) 2009 Cisco and/or its affiliates.
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at:
9  *
10  *     http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  *------------------------------------------------------------------
18  */
19
20 #include <fcntl.h>
21 #include <pthread.h>
22 #include <vppinfra/vec.h>
23 #include <vppinfra/hash.h>
24 #include <vppinfra/pool.h>
25 #include <vppinfra/format.h>
26 #include <vppinfra/byte_order.h>
27 #include <vppinfra/elog.h>
28 #include <vlib/vlib.h>
29 #include <vlib/unix/unix.h>
30 #include <vlibapi/api.h>
31 #include <vlibmemory/api.h>
32
33 /**
34  * @file
35  * @brief Binary API messaging via shared memory
36  * Low-level, primary provisioning interface
37  */
38 /*? %%clicmd:group_label Binary API CLI %% ?*/
39 /*? %%syscfg:group_label Binary API configuration %% ?*/
40
41 #define TRACE_VLIB_MEMORY_QUEUE 0
42
43 #include <vlibmemory/vl_memory_msg_enum.h>      /* enumerate all vlib messages */
44
45 #define vl_typedefs             /* define message structures */
46 #include <vlibmemory/vl_memory_api_h.h>
47 #undef vl_typedefs
48
49 /* instantiate all the print functions we know about */
50 #define vl_print(handle, ...) vlib_cli_output (handle, __VA_ARGS__)
51 #define vl_printfun
52 #include <vlibmemory/vl_memory_api_h.h>
53 #undef vl_printfun
54
55 static inline void *
56 vl_api_trace_plugin_msg_ids_t_print (vl_api_trace_plugin_msg_ids_t * a,
57                                      void *handle)
58 {
59   u8 *plugin_name = vl_api_from_api_to_vec (&a->plugin_name);
60   vl_print (handle, "vl_api_trace_plugin_msg_ids: %v first %u last %u\n",
61             plugin_name,
62             clib_host_to_net_u16 (a->first_msg_id),
63             clib_host_to_net_u16 (a->last_msg_id));
64   vec_free (plugin_name);
65   return handle;
66 }
67
68 /* instantiate all the endian swap functions we know about */
69 #define vl_endianfun
70 #include <vlibmemory/vl_memory_api_h.h>
71 #undef vl_endianfun
72
73 static void
74 vl_api_get_first_msg_id_t_handler (vl_api_get_first_msg_id_t * mp)
75 {
76   vl_api_get_first_msg_id_reply_t *rmp;
77   vl_api_registration_t *regp;
78   uword *p;
79   api_main_t *am = &api_main;
80   vl_api_msg_range_t *rp;
81   u16 first_msg_id = ~0;
82   int rv = -7;                  /* VNET_API_ERROR_INVALID_VALUE */
83
84   regp = vl_api_client_index_to_registration (mp->client_index);
85   if (!regp)
86     return;
87
88   u8 *name = vl_api_from_api_to_vec (&mp->name);
89
90   if (am->msg_range_by_name == 0)
91     goto out;
92
93   p = hash_get_mem (am->msg_range_by_name, name);
94   if (p == 0)
95     goto out;
96
97   rp = vec_elt_at_index (am->msg_ranges, p[0]);
98   first_msg_id = rp->first_msg_id;
99   rv = 0;
100
101 out:
102   vec_free (name);
103   rmp = vl_msg_api_alloc (sizeof (*rmp));
104   rmp->_vl_msg_id = ntohs (VL_API_GET_FIRST_MSG_ID_REPLY);
105   rmp->context = mp->context;
106   rmp->retval = ntohl (rv);
107   rmp->first_msg_id = ntohs (first_msg_id);
108   vl_api_send_msg (regp, (u8 *) rmp);
109 }
110
111 void
112 vl_api_api_versions_t_handler (vl_api_api_versions_t * mp)
113 {
114   api_main_t *am = &api_main;
115   vl_api_api_versions_reply_t *rmp;
116   vl_api_registration_t *reg;
117   u32 nmsg = vec_len (am->api_version_list);
118   int msg_size = sizeof (*rmp) + sizeof (rmp->api_versions[0]) * nmsg;
119   int i;
120
121   reg = vl_api_client_index_to_registration (mp->client_index);
122   if (!reg)
123     return;
124
125   rmp = vl_msg_api_alloc (msg_size);
126   clib_memset (rmp, 0, msg_size);
127   rmp->_vl_msg_id = ntohs (VL_API_API_VERSIONS_REPLY);
128
129   /* fill in the message */
130   rmp->context = mp->context;
131   rmp->count = htonl (nmsg);
132
133   for (i = 0; i < nmsg; ++i)
134     {
135       api_version_t *vl = &am->api_version_list[i];
136       rmp->api_versions[i].major = htonl (vl->major);
137       rmp->api_versions[i].minor = htonl (vl->minor);
138       rmp->api_versions[i].patch = htonl (vl->patch);
139       vl_api_to_api_string (strnlen (vl->name, 64), vl->name,
140                             &rmp->api_versions[i].name);
141     }
142
143   vl_api_send_msg (reg, (u8 *) rmp);
144 }
145
146 #define foreach_vlib_api_msg                            \
147 _(GET_FIRST_MSG_ID, get_first_msg_id)                   \
148 _(API_VERSIONS, api_versions)
149
150 /*
151  * vl_api_init
152  */
153 static int
154 vlib_api_init (void)
155 {
156   vl_msg_api_msg_config_t cfg;
157   vl_msg_api_msg_config_t *c = &cfg;
158
159   clib_memset (c, 0, sizeof (*c));
160
161 #define _(N,n) do {                                             \
162     c->id = VL_API_##N;                                         \
163     c->name = #n;                                               \
164     c->handler = vl_api_##n##_t_handler;                        \
165     c->cleanup = vl_noop_handler;                               \
166     c->endian = vl_api_##n##_t_endian;                          \
167     c->print = vl_api_##n##_t_print;                            \
168     c->size = sizeof(vl_api_##n##_t);                           \
169     c->traced = 1; /* trace, so these msgs print */             \
170     c->replay = 0; /* don't replay client create/delete msgs */ \
171     c->message_bounce = 0; /* don't bounce this message */      \
172     vl_msg_api_config(c);} while (0);
173
174   foreach_vlib_api_msg;
175 #undef _
176
177   return 0;
178 }
179
180 u64 vector_rate_histogram[SLEEP_N_BUCKETS];
181
182 /*
183  * Callback to send ourselves a plugin numbering-space trace msg
184  */
185 static void
186 send_one_plugin_msg_ids_msg (u8 * name, u16 first_msg_id, u16 last_msg_id)
187 {
188   vl_api_trace_plugin_msg_ids_t *mp;
189   api_main_t *am = &api_main;
190   vl_shmem_hdr_t *shmem_hdr = am->shmem_hdr;
191   svm_queue_t *q;
192
193   mp = vl_msg_api_alloc_as_if_client (sizeof (*mp));
194   clib_memset (mp, 0, sizeof (*mp));
195
196   mp->_vl_msg_id = clib_host_to_net_u16 (VL_API_TRACE_PLUGIN_MSG_IDS);
197   vl_api_to_api_string (strnlen_s ((char *) name, 64), (char *) name,
198                         &mp->plugin_name);
199   mp->first_msg_id = clib_host_to_net_u16 (first_msg_id);
200   mp->last_msg_id = clib_host_to_net_u16 (last_msg_id);
201
202   q = shmem_hdr->vl_input_queue;
203
204   vl_msg_api_send_shmem (q, (u8 *) & mp);
205 }
206
207 void
208 vl_api_save_msg_table (void)
209 {
210   u8 *serialized_message_table;
211   api_main_t *am = &api_main;
212   u8 *chroot_file;
213   int fd, rv;
214
215   /*
216    * Snapshoot the api message table.
217    */
218   if (strstr ((char *) am->save_msg_table_filename, "..")
219       || index ((char *) am->save_msg_table_filename, '/'))
220     {
221       clib_warning ("illegal save-message-table filename '%s'",
222                     am->save_msg_table_filename);
223       return;
224     }
225
226   chroot_file = format (0, "/tmp/%s%c", am->save_msg_table_filename, 0);
227
228   fd = creat ((char *) chroot_file, 0644);
229
230   if (fd < 0)
231     {
232       clib_unix_warning ("creat");
233       return;
234     }
235
236   serialized_message_table = vl_api_serialize_message_table (am, 0);
237
238   rv = write (fd, serialized_message_table,
239               vec_len (serialized_message_table));
240
241   if (rv != vec_len (serialized_message_table))
242     clib_unix_warning ("write");
243
244   rv = close (fd);
245   if (rv < 0)
246     clib_unix_warning ("close");
247
248   vec_free (chroot_file);
249   vec_free (serialized_message_table);
250 }
251
252 static uword
253 vl_api_clnt_process (vlib_main_t * vm, vlib_node_runtime_t * node,
254                      vlib_frame_t * f)
255 {
256   int private_segment_rotor = 0, i, rv;
257   vl_socket_args_for_process_t *a;
258   vl_shmem_hdr_t *shm;
259   svm_queue_t *q;
260   clib_error_t *e;
261   api_main_t *am = &api_main;
262   f64 dead_client_scan_time;
263   f64 sleep_time, start_time;
264   f64 vector_rate;
265   clib_error_t *error;
266   uword event_type;
267   uword *event_data = 0;
268   f64 now;
269
270   if ((error = vl_sock_api_init (vm)))
271     {
272       clib_error_report (error);
273       clib_warning ("socksvr_api_init failed, quitting...");
274       return 0;
275     }
276
277   if ((rv = vlib_api_init ()) < 0)
278     {
279       clib_warning ("vlib_api_init returned %d, quitting...", rv);
280       return 0;
281     }
282
283   shm = am->shmem_hdr;
284   q = shm->vl_input_queue;
285
286   e = vlib_call_init_exit_functions
287     (vm, &vm->api_init_function_registrations, 1 /* call_once */ );
288   if (e)
289     clib_error_report (e);
290
291   sleep_time = 10.0;
292   dead_client_scan_time = vlib_time_now (vm) + 10.0;
293
294   /*
295    * Send plugin message range messages for each plugin we loaded
296    */
297   for (i = 0; i < vec_len (am->msg_ranges); i++)
298     {
299       vl_api_msg_range_t *rp = am->msg_ranges + i;
300       send_one_plugin_msg_ids_msg (rp->name, rp->first_msg_id,
301                                    rp->last_msg_id);
302     }
303
304   /*
305    * Save the api message table snapshot, if configured
306    */
307   if (am->save_msg_table_filename)
308     vl_api_save_msg_table ();
309
310   /* $$$ pay attention to frame size, control CPU usage */
311   while (1)
312     {
313       /*
314        * There's a reason for checking the queue before
315        * sleeping. If the vlib application crashes, it's entirely
316        * possible for a client to enqueue a connect request
317        * during the process restart interval.
318        *
319        * Unless some force of physics causes the new incarnation
320        * of the application to process the request, the client will
321        * sit and wait for Godot...
322        */
323       vector_rate = vlib_last_vector_length_per_node (vm);
324       start_time = vlib_time_now (vm);
325       while (1)
326         {
327           if (vl_mem_api_handle_rpc (vm, node)
328               || vl_mem_api_handle_msg_main (vm, node))
329             {
330               vm->api_queue_nonempty = 0;
331               VL_MEM_API_LOG_Q_LEN ("q-underflow: len %d", 0);
332               sleep_time = 20.0;
333               break;
334             }
335
336           /* Allow no more than 10us without a pause */
337           if (vlib_time_now (vm) > start_time + 10e-6)
338             {
339               int index = SLEEP_400_US;
340               if (vector_rate > 40.0)
341                 sleep_time = 400e-6;
342               else if (vector_rate > 20.0)
343                 {
344                   index = SLEEP_200_US;
345                   sleep_time = 200e-6;
346                 }
347               else if (vector_rate >= 1.0)
348                 {
349                   index = SLEEP_100_US;
350                   sleep_time = 100e-6;
351                 }
352               else
353                 {
354                   index = SLEEP_10_US;
355                   sleep_time = 10e-6;
356                 }
357               vector_rate_histogram[index] += 1;
358               break;
359             }
360         }
361
362       /*
363        * see if we have any private api shared-memory segments
364        * If so, push required context variables, and process
365        * a message.
366        */
367       if (PREDICT_FALSE (vec_len (am->vlib_private_rps)))
368         {
369           if (private_segment_rotor >= vec_len (am->vlib_private_rps))
370             private_segment_rotor = 0;
371           vl_mem_api_handle_msg_private (vm, node, private_segment_rotor++);
372         }
373
374       vlib_process_wait_for_event_or_clock (vm, sleep_time);
375       vec_reset_length (event_data);
376       event_type = vlib_process_get_events (vm, &event_data);
377       now = vlib_time_now (vm);
378
379       switch (event_type)
380         {
381         case QUEUE_SIGNAL_EVENT:
382           vm->queue_signal_pending = 0;
383           VL_MEM_API_LOG_Q_LEN ("q-awake: len %d", q->cursize);
384
385           break;
386         case SOCKET_READ_EVENT:
387           for (i = 0; i < vec_len (event_data); i++)
388             {
389               a = pool_elt_at_index (socket_main.process_args, event_data[i]);
390               vl_socket_process_api_msg (a->clib_file, a->regp,
391                                          (i8 *) a->data);
392               vec_free (a->data);
393               pool_put (socket_main.process_args, a);
394             }
395           break;
396
397           /* Timeout... */
398         case -1:
399           break;
400
401         default:
402           clib_warning ("unknown event type %d", event_type);
403           break;
404         }
405
406       if (now > dead_client_scan_time)
407         {
408           vl_mem_api_dead_client_scan (am, shm, now);
409           dead_client_scan_time = vlib_time_now (vm) + 10.0;
410         }
411     }
412
413   return 0;
414 }
415 /* *INDENT-OFF* */
416 VLIB_REGISTER_NODE (vl_api_clnt_node) =
417 {
418   .function = vl_api_clnt_process,
419   .type = VLIB_NODE_TYPE_PROCESS,
420   .name = "api-rx-from-ring",
421   .state = VLIB_NODE_STATE_DISABLED,
422 };
423 /* *INDENT-ON* */
424
425 void
426 vl_mem_api_enable_disable (vlib_main_t * vm, int enable)
427 {
428   vlib_node_set_state (vm, vl_api_clnt_node.index,
429                        (enable
430                         ? VLIB_NODE_STATE_POLLING
431                         : VLIB_NODE_STATE_DISABLED));
432 }
433
434 static uword
435 api_rx_from_node (vlib_main_t * vm,
436                   vlib_node_runtime_t * node, vlib_frame_t * frame)
437 {
438   uword n_packets = frame->n_vectors;
439   uword n_left_from;
440   u32 *from;
441   static u8 *long_msg;
442
443   vec_validate (long_msg, 4095);
444   n_left_from = frame->n_vectors;
445   from = vlib_frame_vector_args (frame);
446
447   while (n_left_from > 0)
448     {
449       u32 bi0;
450       vlib_buffer_t *b0;
451       void *msg;
452       uword msg_len;
453
454       bi0 = from[0];
455       b0 = vlib_get_buffer (vm, bi0);
456       from += 1;
457       n_left_from -= 1;
458
459       msg = b0->data + b0->current_data;
460       msg_len = b0->current_length;
461       if (b0->flags & VLIB_BUFFER_NEXT_PRESENT)
462         {
463           ASSERT (long_msg != 0);
464           _vec_len (long_msg) = 0;
465           vec_add (long_msg, msg, msg_len);
466           while (b0->flags & VLIB_BUFFER_NEXT_PRESENT)
467             {
468               b0 = vlib_get_buffer (vm, b0->next_buffer);
469               msg = b0->data + b0->current_data;
470               msg_len = b0->current_length;
471               vec_add (long_msg, msg, msg_len);
472             }
473           msg = long_msg;
474         }
475       vl_msg_api_handler_no_trace_no_free (msg);
476     }
477
478   /* Free what we've been given. */
479   vlib_buffer_free (vm, vlib_frame_vector_args (frame), n_packets);
480
481   return n_packets;
482 }
483
484 /* *INDENT-OFF* */
485 VLIB_REGISTER_NODE (api_rx_from_node_node,static) = {
486     .function = api_rx_from_node,
487     .type = VLIB_NODE_TYPE_INTERNAL,
488     .vector_size = 4,
489     .name = "api-rx-from-node",
490 };
491 /* *INDENT-ON* */
492
493 static void
494 vl_api_rpc_call_t_handler (vl_api_rpc_call_t * mp)
495 {
496   vl_api_rpc_call_reply_t *rmp;
497   int (*fp) (void *);
498   i32 rv = 0;
499   vlib_main_t *vm = vlib_get_main ();
500
501   if (mp->function == 0)
502     {
503       rv = -1;
504       clib_warning ("rpc NULL function pointer");
505     }
506
507   else
508     {
509       if (mp->need_barrier_sync)
510         vlib_worker_thread_barrier_sync (vm);
511
512       fp = uword_to_pointer (mp->function, int (*)(void *));
513       rv = fp (mp->data);
514
515       if (mp->need_barrier_sync)
516         vlib_worker_thread_barrier_release (vm);
517     }
518
519   if (mp->send_reply)
520     {
521       svm_queue_t *q = vl_api_client_index_to_input_queue (mp->client_index);
522       if (q)
523         {
524           rmp = vl_msg_api_alloc_as_if_client (sizeof (*rmp));
525           rmp->_vl_msg_id = ntohs (VL_API_RPC_CALL_REPLY);
526           rmp->context = mp->context;
527           rmp->retval = rv;
528           vl_msg_api_send_shmem (q, (u8 *) & rmp);
529         }
530     }
531   if (mp->multicast)
532     {
533       clib_warning ("multicast not yet implemented...");
534     }
535 }
536
537 static void
538 vl_api_rpc_call_reply_t_handler (vl_api_rpc_call_reply_t * mp)
539 {
540   clib_warning ("unimplemented");
541 }
542
543 void
544 vl_api_send_pending_rpc_requests (vlib_main_t * vm)
545 {
546   vlib_main_t *vm_global = &vlib_global_main;
547
548   ASSERT (vm != vm_global);
549
550   clib_spinlock_lock_if_init (&vm_global->pending_rpc_lock);
551   vec_append (vm_global->pending_rpc_requests, vm->pending_rpc_requests);
552   vec_reset_length (vm->pending_rpc_requests);
553   clib_spinlock_unlock_if_init (&vm_global->pending_rpc_lock);
554 }
555
556 always_inline void
557 vl_api_rpc_call_main_thread_inline (void *fp, u8 * data, u32 data_length,
558                                     u8 force_rpc)
559 {
560   vl_api_rpc_call_t *mp;
561   vlib_main_t *vm_global = &vlib_global_main;
562   vlib_main_t *vm = vlib_get_main ();
563
564   /* Main thread and not a forced RPC: call the function directly */
565   if ((force_rpc == 0) && (vlib_get_thread_index () == 0))
566     {
567       void (*call_fp) (void *);
568
569       vlib_worker_thread_barrier_sync (vm);
570
571       call_fp = fp;
572       call_fp (data);
573
574       vlib_worker_thread_barrier_release (vm);
575       return;
576     }
577
578   /* Otherwise, actually do an RPC */
579   mp = vl_msg_api_alloc_as_if_client (sizeof (*mp) + data_length);
580
581   clib_memset (mp, 0, sizeof (*mp));
582   clib_memcpy_fast (mp->data, data, data_length);
583   mp->_vl_msg_id = ntohs (VL_API_RPC_CALL);
584   mp->function = pointer_to_uword (fp);
585   mp->need_barrier_sync = 1;
586
587   /* Add to the pending vector. Thread 0 requires locking. */
588   if (vm == vm_global)
589     clib_spinlock_lock_if_init (&vm_global->pending_rpc_lock);
590   vec_add1 (vm->pending_rpc_requests, (uword) mp);
591   if (vm == vm_global)
592     clib_spinlock_unlock_if_init (&vm_global->pending_rpc_lock);
593 }
594
595 /*
596  * Check if called from worker threads.
597  * If so, make rpc call of fp through shmem.
598  * Otherwise, call fp directly
599  */
600 void
601 vl_api_rpc_call_main_thread (void *fp, u8 * data, u32 data_length)
602 {
603   vl_api_rpc_call_main_thread_inline (fp, data, data_length,    /*force_rpc */
604                                       0);
605 }
606
607 /*
608  * Always make rpc call of fp through shmem, useful for calling from threads
609  * not setup as worker threads, such as DPDK callback thread
610  */
611 void
612 vl_api_force_rpc_call_main_thread (void *fp, u8 * data, u32 data_length)
613 {
614   vl_api_rpc_call_main_thread_inline (fp, data, data_length,    /*force_rpc */
615                                       1);
616 }
617
618 static void
619 vl_api_trace_plugin_msg_ids_t_handler (vl_api_trace_plugin_msg_ids_t * mp)
620 {
621   api_main_t *am = &api_main;
622   vl_api_msg_range_t *rp;
623   uword *p;
624
625   /* Noop (except for tracing) during normal operation */
626   if (am->replay_in_progress == 0)
627     return;
628
629   u8 *plugin_name = vl_api_from_api_to_vec (&mp->plugin_name);
630   vec_add1 (plugin_name, 0);
631
632   p = hash_get_mem (am->msg_range_by_name, plugin_name);
633   if (p == 0)
634     {
635       clib_warning ("WARNING: traced plugin '%s' not in current image",
636                     plugin_name);
637       return;
638     }
639
640   rp = vec_elt_at_index (am->msg_ranges, p[0]);
641   if (rp->first_msg_id != clib_net_to_host_u16 (mp->first_msg_id))
642     {
643       clib_warning ("WARNING: traced plugin '%s' first message id %d not %d",
644                     plugin_name, clib_net_to_host_u16 (mp->first_msg_id),
645                     rp->first_msg_id);
646     }
647
648   if (rp->last_msg_id != clib_net_to_host_u16 (mp->last_msg_id))
649     {
650       clib_warning ("WARNING: traced plugin '%s' last message id %d not %d",
651                     plugin_name, clib_net_to_host_u16 (mp->last_msg_id),
652                     rp->last_msg_id);
653     }
654   vec_free (plugin_name);
655 }
656
657 #define foreach_rpc_api_msg                     \
658 _(RPC_CALL,rpc_call)                            \
659 _(RPC_CALL_REPLY,rpc_call_reply)
660
661 #define foreach_plugin_trace_msg                \
662 _(TRACE_PLUGIN_MSG_IDS,trace_plugin_msg_ids)
663
664 /*
665  * Set the rpc callback at our earliest possible convenience.
666  * This avoids ordering issues between thread_init() -> start_workers and
667  * an init function which we could define here. If we ever intend to use
668  * vlib all by itself, we can't create a link-time dependency on
669  * an init function here and a typical "call foo_init first"
670  * guitar lick.
671  */
672
673 extern void *rpc_call_main_thread_cb_fn;
674
675 static clib_error_t *
676 rpc_api_hookup (vlib_main_t * vm)
677 {
678   api_main_t *am = &api_main;
679 #define _(N,n)                                                  \
680     vl_msg_api_set_handlers(VL_API_##N, #n,                     \
681                            vl_api_##n##_t_handler,              \
682                            vl_noop_handler,                     \
683                            vl_noop_handler,                     \
684                            vl_api_##n##_t_print,                \
685                            sizeof(vl_api_##n##_t), 0 /* do not trace */);
686   foreach_rpc_api_msg;
687 #undef _
688
689 #define _(N,n)                                                  \
690     vl_msg_api_set_handlers(VL_API_##N, #n,                     \
691                            vl_api_##n##_t_handler,              \
692                            vl_noop_handler,                     \
693                            vl_noop_handler,                     \
694                            vl_api_##n##_t_print,                \
695                            sizeof(vl_api_##n##_t), 1 /* do trace */);
696   foreach_plugin_trace_msg;
697 #undef _
698
699   /* No reason to halt the parade to create a trace record... */
700   am->is_mp_safe[VL_API_TRACE_PLUGIN_MSG_IDS] = 1;
701   rpc_call_main_thread_cb_fn = vl_api_rpc_call_main_thread;
702   return 0;
703 }
704
705 VLIB_API_INIT_FUNCTION (rpc_api_hookup);
706
707 /*
708  * fd.io coding-style-patch-verification: ON
709  *
710  * Local Variables:
711  * eval: (c-set-style "gnu")
712  * End:
713  */