X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fvnet%2Fipsec%2Fipsec_spd_policy.h;h=d4472e68d89547eea5397fdbe394796bf6bc6096;hb=80f6fd53feaa10b4a798582100724075897c0944;hp=fee059e0e560a827a180ca7d4758ad618e3bd46f;hpb=999c8ee6d6f1c07ba7877fb3f9aa66a90774aacc;p=vpp.git diff --git a/src/vnet/ipsec/ipsec_spd_policy.h b/src/vnet/ipsec/ipsec_spd_policy.h index fee059e0e56..d4472e68d89 100644 --- a/src/vnet/ipsec/ipsec_spd_policy.h +++ b/src/vnet/ipsec/ipsec_spd_policy.h @@ -15,7 +15,7 @@ #ifndef __IPSEC_SPD_POLICY_H__ #define __IPSEC_SPD_POLICY_H__ -#include +#include #define foreach_ipsec_policy_action \ _ (0, BYPASS, "bypass") \ @@ -39,9 +39,16 @@ typedef struct typedef struct { + /* Ports stored in network byte order */ u16 start, stop; } port_range_t; +/** + * @brief + * Policy packet & bytes counters + */ +extern vlib_combined_counter_main_t ipsec_spd_policy_counters; + /** * @brief A Secruity Policy. An entry in an SPD */ @@ -49,7 +56,9 @@ typedef struct ipsec_policy_t_ { u32 id; i32 priority; - u8 is_outbound; + + // the type of policy + ipsec_spd_policy_type_t type; // Selector u8 is_ipv6; @@ -63,22 +72,26 @@ typedef struct ipsec_policy_t_ ipsec_policy_action_t policy; u32 sa_id; u32 sa_index; - - // Counter - vlib_counter_t counter; } ipsec_policy_t; /** * @brief Add/Delete a SPD */ extern int ipsec_add_del_policy (vlib_main_t * vm, - ipsec_policy_t * policy, int is_add); + ipsec_policy_t * policy, + int is_add, u32 * stat_index); +extern u8 *format_ipsec_policy (u8 * s, va_list * args); extern u8 *format_ipsec_policy_action (u8 * s, va_list * args); extern uword unformat_ipsec_policy_action (unformat_input_t * input, va_list * args); +extern int ipsec_policy_mk_type (bool is_outbound, + bool is_ipv6, + ipsec_policy_action_t action, + ipsec_spd_policy_type_t * type); + #endif /* __IPSEC_SPD_POLICY_H__ */ /*