X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=extras%2Femacs%2Fplugin-node-skel.el;h=e83075f833b8248e8211d73a405ef3b7ca7bb5c3;hb=3ae2873e568dd441a22903ab9f8c7954835b0bf1;hp=167519aa266c00941e02eba102b6f3cd2275e770;hpb=757585db71b78c4edf91ba011be419264de43d1a;p=vpp.git diff --git a/extras/emacs/plugin-node-skel.el b/extras/emacs/plugin-node-skel.el index 167519aa266..e83075f833b 100644 --- a/extras/emacs/plugin-node-skel.el +++ b/extras/emacs/plugin-node-skel.el @@ -52,8 +52,9 @@ typedef struct u8 new_dst_mac[6]; } " plugin-name "_trace_t; +#ifndef CLIB_MARCH_VARIANT static u8 * -format_mac_address (u8 * s, va_list * args) +my_format_mac_address (u8 * s, va_list * args) { u8 *a = va_arg (*args, u8 *); return format (s, \"%02x:%02x:%02x:%02x:%02x:%02x\", @@ -70,13 +71,15 @@ static u8 * format_" plugin-name "_trace (u8 * s, va_list * args) s = format (s, \"" PLUGIN-NAME ": sw_if_index %d, next index %d\\n\", t->sw_if_index, t->next_index); s = format (s, \" new src %U -> new dst %U\", - format_mac_address, t->new_src_mac, - format_mac_address, t->new_dst_mac); + my_format_mac_address, t->new_src_mac, + my_format_mac_address, t->new_dst_mac); return s; } vlib_node_registration_t " plugin-name "_node; +#endif /* CLIB_MARCH_VARIANT */ + #define foreach_" plugin-name "_error \\ _(SWAPPED, \"Mac swap packets processed\") @@ -87,11 +90,14 @@ typedef enum { " PLUGIN-NAME "_N_ERROR, } " plugin-name "_error_t; -static char * " plugin-name "_error_strings[] = { +#ifndef CLIB_MARCH_VARIANT +static char * " plugin-name "_error_strings[] = +{ #define _(sym,string) string, foreach_" plugin-name "_error #undef _ }; +#endif /* CLIB_MARCH_VARIANT */ typedef enum { @@ -107,8 +113,8 @@ _(3) \\ _(4) \\ _(5) -static uword -" plugin-name "_node_fn (vlib_main_t * vm, + +VLIB_NODE_FN (" plugin-name "_node) (vlib_main_t * vm, vlib_node_runtime_t * node, vlib_frame_t * frame) { @@ -301,9 +307,9 @@ static uword } /* *INDENT-OFF* */ +#ifndef CLIB_MARCH_VARIANT VLIB_REGISTER_NODE (" plugin-name "_node) = { - .function = " plugin-name "_node_fn, .name = \"" plugin-name "\", .vector_size = sizeof (u32), .format_trace = format_" plugin-name "_trace, @@ -319,6 +325,7 @@ VLIB_REGISTER_NODE (" plugin-name "_node) = [" PLUGIN-NAME "_NEXT_INTERFACE_OUTPUT] = \"interface-output\", }, }; +#endif /* CLIB_MARCH_VARIANT */ /* *INDENT-ON* */ /* * fd.io coding-style-patch-verification: " capital-oh-en "