Rename LISP GPE API to GPE
[vpp.git] / src / vnet / lisp-gpe / lisp_gpe.c
index 3fd78c6..1f8afda 100644 (file)
@@ -91,6 +91,7 @@ lisp_gpe_add_del_fwd_entry_command_fn (vlib_main_t * vm,
          pair.lcl_loc = lloc;
          pair.rmt_loc = rloc;
          pair.weight = w;
+         pair.priority = 0;
          vec_add1 (pairs, pair);
        }
       else
@@ -102,15 +103,15 @@ lisp_gpe_add_del_fwd_entry_command_fn (vlib_main_t * vm,
        }
     }
 
-  if (!vni_set || !dp_table_set)
+  if (!reid_set)
     {
-      vlib_cli_output (vm, "vni and vrf/bd must be set!");
+      vlib_cli_output (vm, "remote eid must be set!");
       goto done;
     }
 
-  if (!reid_set)
+  if (gid_address_type (reid) != GID_ADDR_NSH && (!vni_set || !dp_table_set))
     {
-      vlib_cli_output (vm, "remote eid must be set!");
+      vlib_cli_output (vm, "vni and vrf/bd must be set!");
       goto done;
     }
 
@@ -150,6 +151,7 @@ lisp_gpe_add_del_fwd_entry_command_fn (vlib_main_t * vm,
   gid_address_copy (&a->lcl_eid, leid);
   gid_address_copy (&a->rmt_eid, reid);
   a->locator_pairs = pairs;
+  a->action = action;
 
   rv = vnet_lisp_gpe_add_del_fwd_entry (a, 0);
   if (0 != rv)
@@ -166,8 +168,8 @@ done:
 
 /* *INDENT-OFF* */
 VLIB_CLI_COMMAND (lisp_gpe_add_del_fwd_entry_command, static) = {
-  .path = "lisp gpe entry",
-  .short_help = "lisp gpe entry add/del vni <vni> vrf/bd <id> [leid <leid>]"
+  .path = "gpe entry",
+  .short_help = "gpe entry add/del vni <vni> vrf/bd <id> [leid <leid>]"
       "reid <reid> [loc-pair <lloc> <rloc> w <weight>] "
       "[negative action <action>]",
   .function = lisp_gpe_add_del_fwd_entry_command_fn,
@@ -239,8 +241,8 @@ lisp_gpe_enable_disable_command_fn (vlib_main_t * vm,
 
 /* *INDENT-OFF* */
 VLIB_CLI_COMMAND (enable_disable_lisp_gpe_command, static) = {
-  .path = "lisp gpe",
-  .short_help = "lisp gpe [enable|disable]",
+  .path = "gpe",
+  .short_help = "gpe [enable|disable]",
   .function = lisp_gpe_enable_disable_command_fn,
 };
 /* *INDENT-ON* */
@@ -276,8 +278,8 @@ lisp_show_iface_command_fn (vlib_main_t * vm,
 
 /* *INDENT-OFF* */
 VLIB_CLI_COMMAND (lisp_show_iface_command) = {
-    .path = "show lisp gpe interface",
-    .short_help = "show lisp gpe interface",
+    .path = "show gpe interface",
+    .short_help = "show gpe interface",
     .function = lisp_show_iface_command_fn,
 };
 /* *INDENT-ON* */
@@ -290,7 +292,6 @@ format_vnet_lisp_gpe_status (u8 * s, va_list * args)
   return format (s, "%s", lgm->is_en ? "enabled" : "disabled");
 }
 
-
 /** LISP-GPE init function. */
 clib_error_t *
 lisp_gpe_init (vlib_main_t * vm)