27 in = clib_net_to_host_u32 (in);
38 return (VNET_API_ERROR_INVALID_PROTOCOL);
51 return (VNET_API_ERROR_UNIMPLEMENTED);
58 in = clib_net_to_host_u32 (in);
62 #define _(v,f,s) case IPSEC_API_CRYPTO_ALG_##f: \ 63 *out = IPSEC_CRYPTO_ALG_##f; \ 68 return (VNET_API_ERROR_INVALID_ALGORITHM);
71 vl_api_ipsec_crypto_alg_t
76 #define _(v,f,s) case IPSEC_CRYPTO_ALG_##f: \ 77 return clib_host_to_net_u32(IPSEC_API_CRYPTO_ALG_##f); 84 return (VNET_API_ERROR_UNIMPLEMENTED);
90 in = clib_net_to_host_u32 (in);
94 #define _(v,f,s) case IPSEC_API_INTEG_ALG_##f: \ 95 *out = IPSEC_INTEG_ALG_##f; \ 100 return (VNET_API_ERROR_INVALID_ALGORITHM);
103 vl_api_ipsec_integ_alg_t
108 #define _(v,f,s) case IPSEC_INTEG_ALG_##f: \ 109 return (clib_host_to_net_u32(IPSEC_API_INTEG_ALG_##f)); 116 return (VNET_API_ERROR_UNIMPLEMENTED);
128 out->length = in->
len;
136 in = clib_net_to_host_u32 (in);
139 flags |= IPSEC_SA_FLAG_USE_ESN;
141 flags |= IPSEC_SA_FLAG_USE_ANTI_REPLAY;
143 flags |= IPSEC_SA_FLAG_IS_TUNNEL;
145 flags |= IPSEC_SA_FLAG_IS_TUNNEL_V6;
147 flags |= IPSEC_SA_FLAG_UDP_ENCAP;
149 flags |= IPSEC_SA_FLAG_IS_INBOUND;
154 vl_api_ipsec_sad_flags_t
159 if (ipsec_sa_is_set_USE_ESN (sa))
161 if (ipsec_sa_is_set_USE_ANTI_REPLAY (sa))
163 if (ipsec_sa_is_set_IS_TUNNEL (sa))
165 if (ipsec_sa_is_set_IS_TUNNEL_V6 (sa))
167 if (ipsec_sa_is_set_UDP_ENCAP (sa))
169 if (ipsec_sa_is_set_IS_INBOUND (sa))
172 return clib_host_to_net_u32 (flags);
void ipsec_key_decode(const vl_api_key_t *key, ipsec_key_t *out)
#define foreach_ipsec_crypto_alg
int ipsec_integ_algo_decode(vl_api_ipsec_integ_alg_t in, ipsec_integ_alg_t *out)
#define foreach_ipsec_integ_alg
void ipsec_mk_key(ipsec_key_t *key, const u8 *data, u8 len)
#define clib_memcpy(d, s, n)
vl_api_ipsec_crypto_alg_t ipsec_crypto_algo_encode(ipsec_crypto_alg_t c)
vl_api_ipsec_proto_t ipsec_proto_encode(ipsec_protocol_t p)
sll srl srl sll sra u16x4 i
vl_api_ipsec_sad_flags_t ipsec_sad_flags_encode(const ipsec_sa_t *sa)
enum ipsec_sad_flags_t_ ipsec_sa_flags_t
u8 data[IPSEC_KEY_MAX_LEN]
vl_api_ipsec_integ_alg_t ipsec_integ_algo_encode(ipsec_integ_alg_t i)
ipsec_sa_flags_t ipsec_sa_flags_decode(vl_api_ipsec_sad_flags_t in)
int ipsec_crypto_algo_decode(vl_api_ipsec_crypto_alg_t in, ipsec_crypto_alg_t *out)
int ipsec_proto_decode(vl_api_ipsec_proto_t in, ipsec_protocol_t *out)
Encode/decode function from/to API to internal types.
void ipsec_key_encode(const ipsec_key_t *in, vl_api_key_t *out)