Change control_ping to nsh_control_ping 77/2177/3
authorHongjun Ni <[email protected]>
Tue, 2 Aug 2016 16:01:09 +0000 (00:01 +0800)
committerHongjun Ni <[email protected]>
Tue, 2 Aug 2016 07:26:45 +0000 (07:26 +0000)
PatchSet 3: rebuild
PatchSet 2: add msg_id_base

Change-Id: I3a52acced0f85e5799560926fa8f4eb65e674009
Signed-off-by: Hongjun Ni <[email protected]>
nsh-plugin/nsh/nsh.api
nsh-plugin/nsh/nsh.c
nsh-plugin/nsh/nsh_test.c

index 0b42b58..176dcd1 100644 (file)
@@ -109,7 +109,7 @@ define nsh_map_details {
     @param client_index - opaque cookie to identify the sender
     @param context - sender context, to match reply w/ request
 */
-define control_ping {
+define nsh_control_ping {
     u32 client_index;
     u32 context;
 };
@@ -120,7 +120,7 @@ define control_ping {
     @param retval - return code for the request
     @param vpe_pid - the pid of the vpe, returned by the server
 */
-define control_ping_reply {
+define nsh_control_ping_reply {
     u32 context;
     i32 retval;
     u32 client_index;
index 99e4ac3..f6c45e7 100644 (file)
@@ -79,7 +79,7 @@
         return;                                                 \
                                                                 \
     rmp = vl_msg_api_alloc (sizeof (*rmp));                     \
-    rmp->_vl_msg_id = ntohs((t));                               \
+    rmp->_vl_msg_id = ntohs((t)+nm->msg_id_base);               \
     rmp->context = mp->context;                                 \
     rmp->retval = ntohl(rv);                                    \
     do {body;} while (0);                                       \
@@ -99,7 +99,7 @@
   _(NSH_ENTRY_DUMP, nsh_entry_dump)             \
   _(NSH_ADD_DEL_MAP, nsh_add_del_map)           \
   _(NSH_MAP_DUMP, nsh_map_dump)                 \
-  _(CONTROL_PING, control_ping)
+  _(NSH_CONTROL_PING, nsh_control_ping)
 
 clib_error_t *
 vlib_plugin_register (vlib_main_t * vm, vnet_plugin_handoff_t * h,
@@ -119,13 +119,14 @@ typedef struct {
 } nsh_input_trace_t;
 
 
-static void vl_api_control_ping_t_handler
-(vl_api_control_ping_t *mp)
+static void vl_api_nsh_control_ping_t_handler
+(vl_api_nsh_control_ping_t *mp)
 {
-    vl_api_control_ping_reply_t * rmp;
+    nsh_main_t * nm = &nsh_main;
+    vl_api_nsh_control_ping_reply_t * rmp;
     int rv = 0;
 
-    REPLY_MACRO2(VL_API_CONTROL_PING_REPLY,
+    REPLY_MACRO2(VL_API_NSH_CONTROL_PING_REPLY,
     ({
        rmp->vpe_pid = ntohl (getpid());
     }));
index 85b48d7..c35ea46 100644 (file)
@@ -86,7 +86,7 @@ _(NSH_ADD_DEL_ENTRY_REPLY, nsh_add_del_entry_reply)                   \
 _(NSH_ENTRY_DETAILS, nsh_entry_details)                                 \
 _(NSH_ADD_DEL_MAP_REPLY, nsh_add_del_map_reply)                         \
 _(NSH_MAP_DETAILS, nsh_map_details)                                     \
-_(CONTROL_PING_REPLY, control_ping_reply)
+_(NSH_CONTROL_PING_REPLY, nsh_control_ping_reply)
 
 
 /* M: construct, but don't yet send a message */
@@ -126,8 +126,8 @@ do {                                            \
 } while(0);
 
 
-static void vl_api_control_ping_reply_t_handler
-(vl_api_control_ping_reply_t * mp)
+static void vl_api_nsh_control_ping_reply_t_handler
+(vl_api_nsh_control_ping_reply_t * mp)
 {
     vat_main_t * vam = &vat_main;
     i32 retval = ntohl(mp->retval);
@@ -139,8 +139,8 @@ static void vl_api_control_ping_reply_t_handler
     }
 }
 
-static void vl_api_control_ping_reply_t_handler_json
-(vl_api_control_ping_reply_t * mp)
+static void vl_api_nsh_control_ping_reply_t_handler_json
+(vl_api_nsh_control_ping_reply_t * mp)
 {
     vat_main_t * vam = &vat_main;
     i32 retval = ntohl(mp->retval);