api: binary api cleanup
[vpp.git] / src / vpp / api / custom_dump.c
index 524ad36..840889d 100644 (file)
@@ -50,7 +50,6 @@
 
 #include <vpp/api/vpe_msg_enum.h>
 #include <vpp/api/types.h>
-#include <vlibapi/api_types_inlines.h>
 
 #include <vnet/bonding/node.h>
 
@@ -139,8 +138,7 @@ __clib_unused
   FINISH;
 }
 
-__clib_unused
-  static void *vl_api_sw_interface_rx_placement_dump_t_print
+static void *vl_api_sw_interface_rx_placement_dump_t_print
   (vl_api_sw_interface_rx_placement_dump_t * mp, void *handle)
 {
   u8 *s;
@@ -667,6 +665,8 @@ static void *vl_api_bond_create_t_print
     s = format (s, "mode %U ", format_bond_mode, mp->mode);
   if (mp->lb)
     s = format (s, "lb %U ", format_bond_load_balance, mp->lb);
+  if (mp->numa_only)
+    s = format (s, "numa-only is set in lacp mode");
   if (mp->id != ~0)
     s = format (s, "id %u ", ntohl (mp->id));
   FINISH;
@@ -710,8 +710,7 @@ static void *vl_api_bond_detach_slave_t_print
   FINISH;
 }
 
-__clib_unused
-  static void *vl_api_sw_interface_bond_dump_t_print
+static void *vl_api_sw_interface_bond_dump_t_print
   (vl_api_sw_interface_bond_dump_t * mp, void *handle)
 {
   u8 *s;
@@ -721,8 +720,7 @@ __clib_unused
   FINISH;
 }
 
-__clib_unused
-  static void *vl_api_sw_interface_slave_dump_t_print
+static void *vl_api_sw_interface_slave_dump_t_print
   (vl_api_sw_interface_slave_dump_t * mp, void *handle)
 {
   u8 *s;
@@ -3249,6 +3247,156 @@ static void *vl_api_ipsec_tunnel_if_add_del_t_print
   FINISH;
 }
 
+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,
+             ntohl (ep->spd_id), ntohl (ep->priority), ep->is_outbound,
+             ntohl (ep->sa_id));
+
+  policy_host_byte_order = ntohl (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",
+             ntohs (ep->remote_port_start), ntohs (ep->remote_port_stop));
+
+  s = format (s, "  local_port_start %d local_port_stop %d ",
+             ntohs (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)
+{
+  u8 *s;
+
+  s = format (0, "SCRIPT: ipsec_interface_add_del_spd ");
+  s = format (s, "is_add %d sw_if_index %d spd_id %u ",
+             mp->is_add, ntohl (mp->sw_if_index), ntohl (mp->spd_id));
+  FINISH;
+}
+
+static void *vl_api_ipsec_spd_add_del_t_print
+  (vl_api_ipsec_spd_add_del_t * mp, void *handle)
+{
+  u8 *s;
+
+  s = format (0, "SCRIPT: ipsec_spd_add_del ");
+  s = format (s, "spd_id %u is_add %d ", ntohl (mp->spd_id), mp->is_add);
+  FINISH;
+}
+
+static void *vl_api_ipsec_sad_entry_add_del_t_print
+  (vl_api_ipsec_sad_entry_add_del_t * mp, void *handle)
+{
+  u8 *s;
+  int tmp;
+  vl_api_ipsec_sad_entry_t *ep;
+  const char *protocol_str, *algo_str, *integ_str;
+
+  protocol_str = "BOGUS protocol!";
+  algo_str = "BOGUS crypto_algorithm!";
+  integ_str = "BOGUS integrity_algorithm!";
+
+  ep = (vl_api_ipsec_sad_entry_t *) & mp->entry;
+
+  s = format (0, "SCRIPT: ipsec_sad_entry_add_del is_add ", mp->is_add);
+
+  tmp = ntohl (ep->protocol);
+  if (tmp < ARRAY_LEN (proto_strs))
+    protocol_str = proto_strs[tmp];
+
+  tmp = ntohl (ep->crypto_algorithm);
+  if (tmp < ARRAY_LEN (algo_strs))
+    algo_str = algo_strs[tmp];
+
+  tmp = ntohl (ep->integrity_algorithm);
+  if (tmp < ARRAY_LEN (integ_strs))
+    integ_str = integ_strs[tmp];
+
+  s = format (s, "proto %s crypto alg %s integ alg %s\n",
+             protocol_str, algo_str, integ_str);
+  s = format (s, " crypto_key len %d value %U\n",
+             ep->crypto_key.length, format_hex_bytes, ep->crypto_key.data,
+             (int) (ep->crypto_key.length));
+  s = format (s, " integ_key len %d value %U\n",
+             ep->integrity_key.length, format_hex_bytes,
+             ep->integrity_key.data, (int) (ep->integrity_key.length));
+  s = format (s, " flags 0x%x ", ntohl (ep->flags));
+
+  s = format (s, "tunnel_src %U tunnel_dst %U\n",
+             format_vl_api_address,
+             &ep->tunnel_src, format_vl_api_address, &ep->tunnel_dst);
+  s = format (s, " tx_table_id %u salt %u ",
+             ntohl (ep->tx_table_id), ntohl (ep->salt));
+  FINISH;
+}
+
+
 static void *vl_api_l2_interface_pbb_tag_rewrite_t_print
   (vl_api_l2_interface_pbb_tag_rewrite_t * mp, void *handle)
 {
@@ -3627,6 +3775,18 @@ static void *vl_api_qos_record_enable_disable_t_print
   FINISH;
 }
 
+#define foreach_no_print_function               \
+_(memclnt_keepalive_reply)
+
+#define _(f)                                    \
+static void * vl_api_ ## f ## _t_print          \
+  (vl_api_ ## f ## _t * mp, void * handle)      \
+{                                               \
+  return handle;                                \
+}
+foreach_no_print_function;
+#undef _
+
 #define foreach_custom_print_no_arg_function                            \
 _(lisp_eid_table_vni_dump)                                              \
 _(lisp_map_resolver_dump)                                               \
@@ -3643,7 +3803,7 @@ static void * vl_api_ ## f ## _t_print                                  \
   s = format (0, "SCRIPT: " #f );                                       \
   FINISH;                                                               \
 }
-foreach_custom_print_no_arg_function
+foreach_custom_print_no_arg_function;
 #undef _
 #define foreach_custom_print_function                                   \
 _(CREATE_LOOPBACK, create_loopback)                                     \
@@ -3660,6 +3820,9 @@ _(BOND_CREATE, bond_create)                                             \
 _(BOND_DELETE, bond_delete)                                             \
 _(BOND_ENSLAVE, bond_enslave)                                           \
 _(BOND_DETACH_SLAVE, bond_detach_slave)                                 \
+_(SW_INTERFACE_SLAVE_DUMP, sw_interface_slave_dump)                     \
+_(SW_INTERFACE_BOND_DUMP, sw_interface_bond_dump)                       \
+_(SW_INTERFACE_RX_PLACEMENT_DUMP, sw_interface_rx_placement_dump)       \
 _(TAP_CREATE_V2, tap_create_v2)                                         \
 _(TAP_DELETE_V2, tap_delete_v2)                                         \
 _(SW_INTERFACE_TAP_V2_DUMP, sw_interface_tap_v2_dump)                   \
@@ -3812,6 +3975,10 @@ _(SHOW_LISP_RLOC_PROBE_STATE, show_lisp_rloc_probe_state)               \
 _(SHOW_LISP_MAP_REGISTER_STATE, show_lisp_map_register_state)           \
 _(LISP_RLOC_PROBE_ENABLE_DISABLE, lisp_rloc_probe_enable_disable)       \
 _(LISP_MAP_REGISTER_ENABLE_DISABLE, lisp_map_register_enable_disable)   \
+_(IPSEC_INTERFACE_ADD_DEL_SPD, ipsec_interface_add_del_spd)            \
+_(IPSEC_SAD_ENTRY_ADD_DEL, ipsec_sad_entry_add_del)                    \
+_(IPSEC_SPD_ADD_DEL, ipsec_spd_add_del)                                        \
+_(IPSEC_SPD_ENTRY_ADD_DEL, ipsec_spd_entry_add_del)                    \
 _(IPSEC_TUNNEL_IF_ADD_DEL, ipsec_tunnel_if_add_del)                     \
 _(DELETE_SUBIF, delete_subif)                                           \
 _(L2_INTERFACE_PBB_TAG_REWRITE, l2_interface_pbb_tag_rewrite)           \
@@ -3838,8 +4005,10 @@ _(DNS_RESOLVE_NAME, dns_resolve_name)                                    \
 _(DNS_RESOLVE_IP, dns_resolve_ip)                                      \
 _(SESSION_RULE_ADD_DEL, session_rule_add_del)                           \
 _(OUTPUT_ACL_SET_INTERFACE, output_acl_set_interface)                   \
-_(QOS_RECORD_ENABLE_DISABLE, qos_record_enable_disable)
-  void
+_(QOS_RECORD_ENABLE_DISABLE, qos_record_enable_disable)                        \
+_(MEMCLNT_KEEPALIVE_REPLY, memclnt_keepalive_reply)
+
+void
 vl_msg_api_custom_dump_configure (api_main_t * am)
 {
 #define _(n,f) am->msg_print_handlers[VL_API_##n]       \
@@ -3851,5 +4020,7 @@ vl_msg_api_custom_dump_configure (api_main_t * am)
 /*
  * fd.io coding-style-patch-verification: ON
  *
- * Local Variables: eval: (c-set-style "gnu") End:
+ * Local Variables:
+ * eval: (c-set-style "gnu")
+ * End:
  */