IPSEC: Pass the algorithm salt (used in GCM) over the API
[vpp.git] / src / vnet / ipsec / ipsec_format.c
index 6e6007e..44f064d 100644 (file)
@@ -290,17 +290,20 @@ format_ipsec_sa (u8 * s, va_list * args)
   if (!(flags & IPSEC_FORMAT_DETAIL))
     goto done;
 
+  s = format (s, "\n   salt 0x%x", clib_net_to_host_u32 (sa->salt));
   s = format (s, "\n   seq %u seq-hi %u", sa->seq, sa->seq_hi);
   s = format (s, "\n   last-seq %u last-seq-hi %u window %U",
              sa->last_seq, sa->last_seq_hi,
              format_ipsec_replay_window, sa->replay_window);
-  s = format (s, "\n   crypto alg %U%s%U",
-             format_ipsec_crypto_alg, sa->crypto_alg,
-             sa->crypto_alg ? " key " : "",
-             format_ipsec_key, &sa->crypto_key);
-  s = format (s, "\n   integrity alg %U%s%U",
-             format_ipsec_integ_alg, sa->integ_alg,
-             sa->integ_alg ? " key " : "", format_ipsec_key, &sa->integ_key);
+  s = format (s, "\n   crypto alg %U",
+             format_ipsec_crypto_alg, sa->crypto_alg);
+  if (sa->crypto_alg)
+    s = format (s, " key %U", format_ipsec_key, &sa->crypto_key);
+  s = format (s, "\n   integrity alg %U",
+             format_ipsec_integ_alg, sa->integ_alg);
+  if (sa->integ_alg)
+    s = format (s, " key %U", format_ipsec_key, &sa->integ_key);
+
   vlib_get_combined_counter (&ipsec_sa_counters, sai, &counts);
   s = format (s, "\n   packets %u bytes %u", counts.packets, counts.bytes);