diff options
-rw-r--r-- | src/plugins/nsh/CMakeLists.txt | 8 | ||||
-rw-r--r-- | src/plugins/nsh/nsh.c | 2299 | ||||
-rw-r--r-- | src/plugins/nsh/nsh.h | 28 | ||||
-rw-r--r-- | src/plugins/nsh/nsh_api.c | 724 | ||||
-rw-r--r-- | src/plugins/nsh/nsh_cli.c | 645 | ||||
-rw-r--r-- | src/plugins/nsh/nsh_node.c | 982 | ||||
-rw-r--r-- | src/plugins/nsh/nsh_output.c | 18 | ||||
-rw-r--r-- | src/plugins/nsh/nsh_pop.c | 23 |
8 files changed, 2438 insertions, 2289 deletions
diff --git a/src/plugins/nsh/CMakeLists.txt b/src/plugins/nsh/CMakeLists.txt index 1200754c7e5..b5cbcf0cb0c 100644 --- a/src/plugins/nsh/CMakeLists.txt +++ b/src/plugins/nsh/CMakeLists.txt @@ -14,8 +14,11 @@ add_vpp_plugin(nsh SOURCES nsh.c + nsh_node.c nsh_output.c nsh_pop.c + nsh_cli.c + nsh_api.c nsh-md2-ioam/nsh_md2_ioam.c nsh-md2-ioam/nsh_md2_ioam_api.c nsh-md2-ioam/md2_ioam_transit.c @@ -24,6 +27,11 @@ add_vpp_plugin(nsh nsh-md2-ioam/export-nsh-md2-ioam/nsh_md2_ioam_export_thread.c nsh-md2-ioam/export-nsh-md2-ioam/nsh_md2_ioam_node.c + MULTIARCH_SOURCES + nsh_node.c + nsh_output.c + nsh_pop.c + API_FILES nsh.api diff --git a/src/plugins/nsh/nsh.c b/src/plugins/nsh/nsh.c index b293b85db8a..446314c839f 100644 --- a/src/plugins/nsh/nsh.c +++ b/src/plugins/nsh/nsh.c @@ -23,104 +23,11 @@ #include <vnet/vxlan-gpe/vxlan_gpe.h> #include <vnet/l2/l2_classify.h> #include <vnet/adj/adj.h> - -#include <vlibapi/api.h> -#include <vlibmemory/api.h> #include <vpp/app/version.h> -/* define message IDs */ -#define vl_msg_id(n,h) n, -typedef enum -{ -#include <nsh/nsh.api.h> - /* We'll want to know how many messages IDs we need... */ - VL_MSG_FIRST_AVAILABLE, -} vl_msg_id_t; -#undef vl_msg_id - -/* define message structures */ -#define vl_typedefs -#include <nsh/nsh.api.h> -#undef vl_typedefs - -/* define generated endian-swappers */ -#define vl_endianfun -#include <nsh/nsh.api.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 <nsh/nsh.api.h> -#undef vl_printfun - -/* Get the API version number */ -#define vl_api_version(n,v) static u32 api_version=(v); -#include <nsh/nsh.api.h> -#undef vl_api_version - -#define vl_msg_name_crc_list -#include <nsh/nsh.api.h> -#undef vl_msg_name_crc_list - -/* Dummy Eth header */ -const char dummy_dst_address[6] = { 0x11, 0x22, 0x33, 0x44, 0x55, 0x66 }; -const char dummy_src_address[6] = { 0x77, 0x88, 0x99, 0xaa, 0xbb, 0xcc }; - -/* - * A handy macro to set up a message reply. - * Assumes that the following variables are available: - * mp - pointer to request message - * rmp - pointer to reply message type - * rv - return value - */ - -#define REPLY_MACRO(t) \ - do { \ - unix_shared_memory_queue_t * q = \ - vl_api_client_index_to_input_queue (mp->client_index); \ - if (!q) \ - return; \ - \ - rmp = vl_msg_api_alloc |