+static const char *policy_strs[] = {
+ "BYPASS",
+ "DISCARD",
+ "RESOLVE",
+ "PROTECT",
+};
+
+static const char *proto_strs[] = {
+ "ESP",
+ "AH",
+};
+
+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];
+ else
+ str = "BOGUS!";
+
+ s = format (s, " policy: %s protocol %d\n", str, ep->protocol);
+
+ s = format (s, " remote_address_start %U remote_address_stop %U\n",
+ format_vl_api_address,
+ &ep->remote_address_start,
+ format_vl_api_address, &ep->remote_address_stop);
+
+ s = format (s, " local_address_start %U local_address_stop %U\n",
+ format_vl_api_address,
+ &ep->local_address_start,
+ format_vl_api_address, &ep->local_address_stop);
+
+ s = format (s, " remote_port_start %d remote_port_stop %d\n",
+ (ep->remote_port_start), ntohs (ep->remote_port_stop));
+
+ s = format (s, " local_port_start %d local_port_stop %d ",
+ (ep->local_port_start), ntohs (ep->local_port_stop));
+
+ FINISH;
+}
+
+static void *vl_api_ipsec_interface_add_del_spd_t_print
+ (vl_api_ipsec_interface_add_del_spd_t * mp, void *handle)