23 in = clib_net_to_host_u32 (in);
34 return (VNET_API_ERROR_INVALID_PROTOCOL);
47 return (VNET_API_ERROR_UNIMPLEMENTED);
52 ipsec_crypto_alg_t * out)
54 in = clib_net_to_host_u32 (in);
58 #define _(v,f,s) case IPSEC_API_CRYPTO_ALG_##f: \
59 *out = IPSEC_CRYPTO_ALG_##f; \
64 return (VNET_API_ERROR_INVALID_ALGORITHM);
67 vl_api_ipsec_crypto_alg_t
72 #define _(v,f,s) case IPSEC_CRYPTO_ALG_##f: \
73 return clib_host_to_net_u32(IPSEC_API_CRYPTO_ALG_##f);
80 return (VNET_API_ERROR_UNIMPLEMENTED);
86 in = clib_net_to_host_u32 (in);
90 #define _(v,f,s) case IPSEC_API_INTEG_ALG_##f: \
91 *out = IPSEC_INTEG_ALG_##f; \
96 return (VNET_API_ERROR_INVALID_ALGORITHM);
99 vl_api_ipsec_integ_alg_t
104 #define _(v,f,s) case IPSEC_INTEG_ALG_##f: \
105 return (clib_host_to_net_u32(IPSEC_API_INTEG_ALG_##f));
112 return (VNET_API_ERROR_UNIMPLEMENTED);
124 out->length = in->
len;
132 in = clib_net_to_host_u32 (in);
135 flags |= IPSEC_SA_FLAG_USE_ESN;
137 flags |= IPSEC_SA_FLAG_USE_ANTI_REPLAY;
139 flags |= IPSEC_SA_FLAG_IS_TUNNEL;
141 flags |= IPSEC_SA_FLAG_IS_TUNNEL_V6;
143 flags |= IPSEC_SA_FLAG_UDP_ENCAP;
145 flags |= IPSEC_SA_FLAG_IS_INBOUND;
147 flags |= IPSEC_SA_FLAG_IS_ASYNC;
152 vl_api_ipsec_sad_flags_t
157 if (ipsec_sa_is_set_USE_ESN (sa))
159 if (ipsec_sa_is_set_USE_ANTI_REPLAY (sa))
161 if (ipsec_sa_is_set_IS_TUNNEL (sa))
163 if (ipsec_sa_is_set_IS_TUNNEL_V6 (sa))
165 if (ipsec_sa_is_set_UDP_ENCAP (sa))
167 if (ipsec_sa_is_set_IS_INBOUND (sa))
169 if (ipsec_sa_is_set_IS_ASYNC (sa))
172 return clib_host_to_net_u32 (
flags);