27 in = clib_net_to_host_u32 (in);
38 return (VNET_API_ERROR_INVALID_PROTOCOL);
51 return (VNET_API_ERROR_UNIMPLEMENTED);
56 ipsec_crypto_alg_t * out)
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;
151 flags |= IPSEC_SA_FLAG_IS_ASYNC;
156 vl_api_ipsec_sad_flags_t
161 if (ipsec_sa_is_set_USE_ESN (sa))
163 if (ipsec_sa_is_set_USE_ANTI_REPLAY (sa))
165 if (ipsec_sa_is_set_IS_TUNNEL (sa))
167 if (ipsec_sa_is_set_IS_TUNNEL_V6 (sa))
169 if (ipsec_sa_is_set_UDP_ENCAP (sa))
171 if (ipsec_sa_is_set_IS_INBOUND (sa))
173 if (ipsec_sa_is_set_IS_ASYNC (sa))
176 return clib_host_to_net_u32 (
flags);