Add GPE CLI/API for setting encap mode

Change-Id: Id89e23fb5d275572b2356c073dfa0f55719e1a76
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
diff --git a/src/vnet/lisp-gpe/lisp_gpe_api.c b/src/vnet/lisp-gpe/lisp_gpe_api.c
index 8d19f8c..f6bd544 100644
--- a/src/vnet/lisp-gpe/lisp_gpe_api.c
+++ b/src/vnet/lisp-gpe/lisp_gpe_api.c
@@ -56,7 +56,9 @@
 _(GPE_FWD_ENTRIES_GET, gpe_fwd_entries_get)                   \
 _(GPE_FWD_ENTRY_PATH_DUMP, gpe_fwd_entry_path_dump)           \
 _(GPE_ENABLE_DISABLE, gpe_enable_disable)                     \
-_(GPE_ADD_DEL_IFACE, gpe_add_del_iface)
+_(GPE_ADD_DEL_IFACE, gpe_add_del_iface)                       \
+_(GPE_SET_ENCAP_MODE, gpe_set_encap_mode)                     \
+_(GPE_GET_ENCAP_MODE, gpe_get_encap_mode)
 
 static locator_pair_t *
 unformat_gpe_loc_pairs (void *locs, u32 rloc_num)
@@ -373,6 +375,30 @@
   REPLY_MACRO (VL_API_GPE_ADD_DEL_IFACE_REPLY);
 }
 
+static void
+vl_api_gpe_set_encap_mode_t_handler (vl_api_gpe_set_encap_mode_t * mp)
+{
+  vl_api_gpe_set_encap_mode_reply_t *rmp;
+  int rv = 0;
+
+  rv = vnet_gpe_set_encap_mode (mp->mode);
+  REPLY_MACRO (VL_API_GPE_SET_ENCAP_MODE_REPLY);
+}
+
+static void
+vl_api_gpe_get_encap_mode_t_handler (vl_api_gpe_get_encap_mode_t * mp)
+{
+  vl_api_gpe_get_encap_mode_reply_t *rmp;
+  int rv = 0;
+
+  /* *INDENT-OFF* */
+  REPLY_MACRO2 (VL_API_GPE_GET_ENCAP_MODE_REPLY,
+  ({
+    rmp->encap_mode = vnet_gpe_get_encap_mode ();
+  }));
+  /* *INDENT-ON* */
+}
+
 /*
  * gpe_api_hookup
  * Add vpe's API message handlers to the table.