- write(' vl_msg_api_set_handlers(VL_API_{ID} + msg_id_base, '
- ' "{n}",\n'
- ' vl_api_{n}_t_handler, '
- ' vl_noop_handler,\n'
- ' vl_api_{n}_t_endian, '
- ' vl_api_{n}_t_print,\n'
- ' sizeof(vl_api_{n}_t), 1,\n'
- ' vl_api_{n}_t_print_json,\n'
- ' vl_api_{n}_t_tojson,\n'
- ' vl_api_{n}_t_fromjson,\n'
- ' vl_api_{n}_t_calc_size);\n'
- .format(n=e, ID=e.upper()))
-
- write('}\n')
- write('clib_error_t * vat_plugin_register (vat_main_t *vam)\n')
- write('{\n')
- write(' {n}_test_main_t * mainp = &{n}_test_main;\n'.format(n=module))
- write(' mainp->vat_main = vam;\n')
- write(' mainp->msg_id_base = vl_client_get_first_plugin_msg_id '
- ' ("{n}_{crc:08x}");\n'
- .format(n=module, crc=file_crc))
- write(' if (mainp->msg_id_base == (u16) ~0)\n')
- write(' return clib_error_return (0, "{} plugin not loaded...");\n'
- .format(module))
- write(' setup_message_id_table (vam, mainp->msg_id_base);\n')
- write('#ifdef VL_API_LOCAL_SETUP_MESSAGE_ID_TABLE\n')
- write(' VL_API_LOCAL_SETUP_MESSAGE_ID_TABLE(vam);\n')
- write('#endif\n')
- write(' return 0;\n')
- write('}\n')
+ write(
+ " vl_msg_api_set_handlers(VL_API_{ID} + msg_id_base, "
+ ' "{n}",\n'
+ " vl_api_{n}_t_handler, "
+ " vl_noop_handler,\n"
+ " vl_api_{n}_t_endian, "
+ " vl_api_{n}_t_print,\n"
+ " sizeof(vl_api_{n}_t), 1,\n"
+ " vl_api_{n}_t_print_json,\n"
+ " vl_api_{n}_t_tojson,\n"
+ " vl_api_{n}_t_fromjson,\n"
+ " vl_api_{n}_t_calc_size);\n".format(
+ n=e, ID=e.upper()
+ )
+ )
+
+ write("}\n")
+ write("clib_error_t * vat_plugin_register (vat_main_t *vam)\n")
+ write("{\n")
+ write(" {n}_test_main_t * mainp = &{n}_test_main;\n".format(n=module))
+ write(" mainp->vat_main = vam;\n")
+ write(
+ " mainp->msg_id_base = vl_client_get_first_plugin_msg_id "
+ ' ("{n}_{crc:08x}");\n'.format(n=module, crc=file_crc)
+ )
+ write(" if (mainp->msg_id_base == (u16) ~0)\n")
+ write(
+ ' return clib_error_return (0, "{} plugin not loaded...");\n'.format(
+ module
+ )
+ )
+ write(" setup_message_id_table (vam, mainp->msg_id_base);\n")
+ write("#ifdef VL_API_LOCAL_SETUP_MESSAGE_ID_TABLE\n")
+ write(" VL_API_LOCAL_SETUP_MESSAGE_ID_TABLE(vam);\n")
+ write("#endif\n")
+ write(" return 0;\n")
+ write("}\n")