-static u8 *
-format_lisp_flat_eid (u8 * s, va_list * args)
-{
- u32 type = va_arg (*args, u32);
- u8 *eid = va_arg (*args, u8 *);
- u32 eid_len = va_arg (*args, u32);
-
- switch (type)
- {
- case 0:
- return format (s, "%U/%d", format_ip4_address, eid, eid_len);
- case 1:
- return format (s, "%U/%d", format_ip6_address, eid, eid_len);
- case 3:
- return format (s, "%U", format_ethernet_address, eid);
- }
- return 0;
-}
-
-static void *vl_api_lisp_add_del_remote_mapping_t_print
- (vl_api_lisp_add_del_remote_mapping_t * mp, void *handle)
-{
- u8 *s;
- u32 rloc_num = 0;
-
- s = format (0, "SCRIPT: lisp_add_del_remote_mapping ");
-
- if (mp->del_all)
- s = format (s, "del-all ");
-
- s = format (s, "%s ", mp->is_add ? "add" : "del");
- s = format (s, "vni %d ", clib_net_to_host_u32 (mp->vni));
-
- s = format (s, "eid %U ", format_lisp_flat_eid,
- mp->eid_type, mp->eid, mp->eid_len);
-
- if (mp->is_src_dst)
- {
- s = format (s, "seid %U ", format_lisp_flat_eid,
- mp->eid_type, mp->seid, mp->seid_len);
- }
- rloc_num = clib_net_to_host_u32 (mp->rloc_num);
-
- if (0 == rloc_num)
- s = format (s, "action %d", mp->action);
-
- FINISH;
-}
-
-static void *vl_api_lisp_add_del_adjacency_t_print
- (vl_api_lisp_add_del_adjacency_t * mp, void *handle)
-{
- u8 *s;
-
- s = format (0, "SCRIPT: lisp_add_del_adjacency ");
-
- s = format (s, "%s ", mp->is_add ? "add" : "del");
- s = format (s, "vni %d ", clib_net_to_host_u32 (mp->vni));
- s = format (s, "reid %U leid %U ",
- format_lisp_flat_eid, mp->eid_type, mp->reid, mp->reid_len,
- format_lisp_flat_eid, mp->eid_type, mp->leid, mp->leid_len);
-
- FINISH;
-}
-
-static void *vl_api_lisp_add_del_map_request_itr_rlocs_t_print
- (vl_api_lisp_add_del_map_request_itr_rlocs_t * mp, void *handle)
-{
- u8 *s;
-
- s = format (0, "SCRIPT: lisp_add_del_map_request_itr_rlocs ");
-
- if (mp->is_add)
- s = format (s, "%s", mp->locator_set_name);
- else
- s = format (s, "del");
-
- FINISH;
-}
-
-static void *vl_api_lisp_eid_table_add_del_map_t_print
- (vl_api_lisp_eid_table_add_del_map_t * mp, void *handle)
-{
- u8 *s;
-
- s = format (0, "SCRIPT: lisp_eid_table_add_del_map ");
-
- if (!mp->is_add)
- s = format (s, "del ");
-
- s = format (s, "vni %d ", clib_net_to_host_u32 (mp->vni));
- s = format (s, "%s %d ",
- mp->is_l2 ? "bd_index" : "vrf",
- clib_net_to_host_u32 (mp->dp_table));
- FINISH;
-}
-
-static void *vl_api_lisp_add_del_local_eid_t_print
- (vl_api_lisp_add_del_local_eid_t * mp, void *handle)
-{
- u8 *s;
-
- s = format (0, "SCRIPT: lisp_add_del_local_eid ");
-
- if (!mp->is_add)
- s = format (s, "del ");
-
- s = format (s, "vni %d ", clib_net_to_host_u32 (mp->vni));
- s = format (s, "eid %U ", format_lisp_flat_eid, mp->eid_type, mp->eid,
- mp->prefix_len);
- s = format (s, "locator-set %s ", mp->locator_set_name);
- if (*mp->key)
- {
- u32 key_id = mp->key_id;
- s = format (s, "key-id %U", format_hmac_key_id, key_id);
- s = format (s, "secret-key %s", mp->key);
- }
- FINISH;
-}
-
-static void *vl_api_gpe_add_del_fwd_entry_t_print
- (vl_api_gpe_add_del_fwd_entry_t * mp, void *handle)
-{
- u8 *s;
-
- s = format (0, "SCRIPT: gpe_add_del_fwd_entry TODO");
-
- FINISH;
-}
-
-static void *vl_api_lisp_add_del_map_resolver_t_print
- (vl_api_lisp_add_del_map_resolver_t * mp, void *handle)
-{
- u8 *s;
-
- s = format (0, "SCRIPT: lisp_add_del_map_resolver ");
-
- if (!mp->is_add)
- s = format (s, "del ");
-
- if (mp->is_ipv6)
- s = format (s, "%U ", format_ip6_address, mp->ip_address);
+/* static u8 * */
+/* format_nsh_address_vat (u8 * s, va_list * args) */
+/* { */
+/* nsh_t *a = va_arg (*args, nsh_t *); */
+/* return format (s, "SPI:%d SI:%d", clib_net_to_host_u32 (a->spi), a->si); */
+/* } */
+
+static const char *policy_strs[] = {
+ "BYPASS",
+ "DISCARD",
+ "RESOLVE",
+ "PROTECT",
+};
+
+static const char *algo_strs[] = {
+ "NONE",
+ "AES_CBC_128",
+ "AES_CBC_192",
+ "AES_CBC_256",
+ "AES_CTR_128",
+ "AES_CTR_192",
+ "AES_CTR_256",
+ "AES_GCM_128",
+ "AES_GCM_192",
+ "AES_GCM_256",
+ "DES_CBC",
+ "3DES_CBC",
+};
+
+
+static const char *integ_strs[] = {
+ "NONE",
+ "MD5_96",
+ "SHA1_96",
+ "SHA_256_96",
+ "SHA_256_128",
+ "SHA_384_192",
+ "SHA_512_256",
+};
+
+static void *vl_api_ipsec_spd_entry_add_del_t_print
+ (vl_api_ipsec_spd_entry_add_del_t * mp, void *handle)
+{
+ u8 *s;
+ const char *str;
+ vl_api_ipsec_spd_entry_t *ep;
+ int policy_host_byte_order;
+
+ ep = (vl_api_ipsec_spd_entry_t *) & mp->entry;
+
+ s = format (0, "SCRIPT: ipsec_spd_entry ");
+ s = format (s, "is_add %d spd_id %u priority %d is_outbound %d sa_id %u\n",
+ mp->is_add,
+ (ep->spd_id), ntohl (ep->priority), ep->is_outbound,
+ (ep->sa_id));
+
+ policy_host_byte_order = (ep->policy);
+
+ if (policy_host_byte_order < ARRAY_LEN (policy_strs))
+ str = policy_strs[policy_host_byte_order];