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);
164 s =
format (s,
" [%d] priority %d action %U type %U protocol ",
176 if (p->
policy == IPSEC_POLICY_ACTION_PROTECT)
181 s =
format (s,
"\n local addr range %U - %U port range %u - %u",
186 s =
format (s,
"\n remote addr range %U - %U port range %u - %u",
201 u32 si = va_arg (*args,
u32);
208 s =
format (s,
"No such SPD index: %d", si);
217 s = format (s, "\n %s:", n); \ 218 vec_foreach(i, spd->policies[IPSEC_SPD_POLICY_##v]) \ 220 s = format (s, "\n %U", format_ipsec_policy, *i); \ 260 #define _(v, f, str) else if (flags & IPSEC_SA_FLAG_##f) s = format(s, "%s ", str); 269 u32 sai = va_arg (*args,
u32);
278 s =
format (s,
"No such SA index: %d", sai);
284 s =
format (s,
"[%d] sa 0x%x spi %u mode %s%s protocol %s %U",
285 sai, sa->
id, sa->
spi,
286 ipsec_sa_is_set_IS_TUNNEL (sa) ?
"tunnel" :
"transport",
287 ipsec_sa_is_set_IS_TUNNEL_V6 (sa) ?
"-ip6" :
"",
295 s =
format (s,
"\n last-seq %u last-seq-hi %u window %U",
298 s =
format (s,
"\n crypto alg %U%s%U",
302 s =
format (s,
"\n integrity alg %U%s%U",
308 if (ipsec_sa_is_set_IS_TUNNEL (sa))
312 s =
format (s,
"\n table-ID %d tunnel src %U dst %U",
316 if (!ipsec_sa_is_set_IS_INBOUND (sa))
319 format (s,
"\n resovle via fib-entry: %d",
321 s =
format (s,
"\n stacked on:");
336 u32 ti = va_arg (*args,
u32);
342 s =
format (s,
"No such tunnel index: %d", ti);
355 s =
format (s,
" out-bound sa: ");
359 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