#include <vnet/interface.h>
#include <vnet/api_errno.h>
-#include <vnet/lisp-cp/control.h>
-#include <vnet/lisp-gpe/lisp_gpe.h>
+#include <lisp/lisp-cp/control.h>
+#include <lisp/lisp-gpe/lisp_gpe.h>
#include <vnet/ip/ip_types_api.h>
#include <vnet/ethernet/ethernet_types_api.h>
-#include <vnet/vnet_msg_enum.h>
+/* define message IDs */
+#include <vnet/format_fns.h>
+#include <lisp/lisp-cp/one.api_enum.h>
+#include <lisp/lisp-cp/one.api_types.h>
-#define vl_api_one_add_del_locator_set_t_endian vl_noop_handler
-#define vl_api_one_add_del_locator_set_t_print vl_noop_handler
-#define vl_api_one_add_del_remote_mapping_t_endian vl_noop_handler
-#define vl_api_one_add_del_remote_mapping_t_print vl_noop_handler
-
-#define vl_api_one_add_del_locator_set_t_endian vl_noop_handler
-#define vl_api_one_add_del_locator_set_t_print vl_noop_handler
-#define vl_api_one_add_del_remote_mapping_t_endian vl_noop_handler
-#define vl_api_one_add_del_remote_mapping_t_print vl_noop_handler
-
-#define vl_api_one_add_del_l2_arp_entry vl_noop_handler
-#define vl_api_one_l2_arp_bd_get vl_noop_handler
-
-#define vl_api_one_ndp_entries_get_reply_t_endian vl_noop_handler
-#define vl_api_one_ndp_entries_get_reply_t_print vl_noop_handler
-
-#define vl_typedefs /* define message structures */
-#include <vnet/vnet_all_api_h.h>
-#undef vl_typedefs
-
-#define vl_endianfun /* define message structures */
-#include <vnet/vnet_all_api_h.h>
-#undef vl_endianfun
-
-/* instantiate all the print functions we know about */
-#define vl_print(handle, ...) vlib_cli_output (handle, __VA_ARGS__)
-#define vl_printfun
-#include <vnet/vnet_all_api_h.h>
-#undef vl_printfun
+/**
+ * Base message ID fot the plugin
+ */
+static u32 one_base_msg_id;
+#define REPLY_MSG_ID_BASE one_base_msg_id
#include <vlibapi/api_helper_macros.h>
* added the client registration handlers.
* See .../vlib-api/vlibmemory/memclnt_vlib.c:memclnt_process()
*/
-#define vl_msg_name_crc_list
-#include <vnet/vnet_all_api_h.h>
-#undef vl_msg_name_crc_list
-
-static void
-setup_message_id_table (api_main_t * am)
-{
-#define _(id,n,crc) vl_msg_api_add_msg_name_crc (am, #n "_" #crc, id);
- foreach_vl_msg_name_crc_one;
-#undef _
-}
+#include <lisp/lisp-cp/one.api.c>
static clib_error_t *
one_api_hookup (vlib_main_t * vm)
{
- api_main_t *am = vlibapi_get_main ();
-
-#define _(N,n) \
- vl_msg_api_set_handlers(VL_API_##N, #n, \
- vl_api_##n##_t_handler, \
- vl_noop_handler, \
- vl_api_##n##_t_endian, \
- vl_api_##n##_t_print, \
- sizeof(vl_api_##n##_t), 1);
- foreach_vpe_api_msg;
-#undef _
-
- /*
- * Set up the (msg_name, crc, message-id) table
- */
- setup_message_id_table (am);
+ one_base_msg_id = setup_message_id_table ();
return 0;
}
VLIB_API_INIT_FUNCTION (one_api_hookup);
+#include <vlib/unix/plugin.h>
+#include <vpp/app/version.h>
+
+/* *INDENT-OFF* */
+VLIB_PLUGIN_REGISTER () = {
+ .version = VPP_BUILD_VER,
+ .description = "Locator ID Separation Protocol (LISP)",
+};
+/* *INDENT-ON* */
+
/*
* fd.io coding-style-patch-verification: ON
*