34 #define _(v,f,str) case IPSEC_POLICY_ACTION_##f: t = str; break; 52 #define _(f,str) case IPSEC_SPD_POLICY_##f: t = str; break; 65 u32 *r = va_arg (*args,
u32 *);
68 #define _(v,f,s) else if (unformat (input, s)) *r = IPSEC_POLICY_ACTION_##f; 84 #define _(v,f,str) case IPSEC_CRYPTO_ALG_##f: t = (u8 *) str; break; 97 u32 *r = va_arg (*args,
u32 *);
100 #define _(v,f,s) else if (unformat (input, s)) *r = IPSEC_CRYPTO_ALG_##f; 116 #define _(v,f,str) case IPSEC_INTEG_ALG_##f: t = (u8 *) str; break; 120 s =
format (s,
"unknown");
129 u32 *r = va_arg (*args,
u32 *);
132 #define _(v,f,s) else if (unformat (input, s)) *r = IPSEC_INTEG_ALG_##f; 143 u64 w = va_arg (*args,
u64);
146 for (i = 0; i < 64; i++)
148 s =
format (s,
"%u", w & (1ULL << i) ? 1 : 0);
157 u32 pi = va_arg (*args,
u32);
165 s =
format (s,
" [%d] priority %d action %U type %U protocol ",
177 if (p->
policy == IPSEC_POLICY_ACTION_PROTECT)
186 s =
format (s,
"\n local addr range %U - %U port range %u - %u",
190 s =
format (s,
"\n remote addr range %U - %U port range %u - %u",
204 u32 si = va_arg (*args,
u32);
211 s =
format (s,
"No such SPD index: %d", si);
220 s = format (s, "\n %s:", n); \ 221 vec_foreach(i, spd->policies[IPSEC_SPD_POLICY_##v]) \ 223 s = format (s, "\n %U", format_ipsec_policy, *i); \ 263 #define _(v, f, str) else if (flags & IPSEC_SA_FLAG_##f) s = format(s, "%s ", str); 272 u32 sai = va_arg (*args,
u32);
281 s =
format (s,
"No such SA index: %d", sai);
287 s =
format (s,
"[%d] sa 0x%x spi %u mode %s%s protocol %s %U",
288 sai, sa->
id, sa->
spi,
289 ipsec_sa_is_set_IS_TUNNEL (sa) ?
"tunnel" :
"transport",
290 ipsec_sa_is_set_IS_TUNNEL_V6 (sa) ?
"-ip6" :
"",
298 s =
format (s,
"\n last-seq %u last-seq-hi %u window %U",
301 s =
format (s,
"\n crypto alg %U%s%U",
305 s =
format (s,
"\n integrity alg %U%s%U",
311 if (ipsec_sa_is_set_IS_TUNNEL (sa))
315 s =
format (s,
"\n table-ID %d tunnel src %U dst %U",
319 if (!ipsec_sa_is_set_IS_INBOUND (sa))
322 format (s,
"\n resovle via fib-entry: %d",
324 s =
format (s,
"\n stacked on:");
339 u32 ti = va_arg (*args,
u32);
345 s =
format (s,
"No such tunnel index: %d", ti);
358 s =
format (s,
" out-bound sa: ");
362 s =
format (s,
" in-bound sa: ");
ipsec_tunnel_if_t * tunnel_interfaces
ip46_address_t tunnel_src_addr
ip46_address_range_t laddr
#define foreach_ipsec_crypto_alg
enum ipsec_format_flags_t_ ipsec_format_flags_t
ipsec_integ_alg_t integ_alg
static vnet_hw_interface_t * vnet_get_hw_interface(vnet_main_t *vnm, u32 hw_if_index)
Combined counter to hold both packets and byte differences.
#define foreach_ipsec_integ_alg
A Secruity Policy Database.
void ipsec_mk_key(ipsec_key_t *key, const u8 *data, u8 len)
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
vlib_combined_counter_main_t ipsec_spd_policy_counters
Policy packet & bytes counters.
counter_t packets
packet counter
fib_node_index_t fib_entry_index
ipsec_spd_policy_type_t type
ip46_address_t tunnel_dst_addr
static void vlib_get_combined_counter(const vlib_combined_counter_main_t *cm, u32 index, vlib_counter_t *result)
Get the value of a combined counter, never called in the speed path Scrapes the entire set of per-thr...
#define vec_free(V)
Free vector's memory (no header).
ipsec_policy_action_t policy
enum ipsec_sad_flags_t_ ipsec_sa_flags_t
#define pool_is_free_index(P, I)
Use free bitmap to query whether given index is free.
vlib_combined_counter_main_t ipsec_sa_counters
SA packet & bytes counters.
u8 data[IPSEC_KEY_MAX_LEN]
ipsec_policy_t * policies
u32 fib_table_get_table_id(u32 fib_index, fib_protocol_t proto)
Get the Table-ID of the FIB from protocol and index.
dpo_id_t dpo[IPSEC_N_PROTOCOLS]
ipsec_protocol_t protocol
u8 * format_dpo_id(u8 *s, va_list *args)
Format a DPO_id_t oject
counter_t bytes
byte counter
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
ip46_address_range_t raddr
u32 id
the User's ID for this policy
ipsec_crypto_alg_t crypto_alg
#define foreach_ipsec_spd_policy_type