MCPcopy Create free account
hub / github.com/F-Stack/f-stack / xform_init

Function xform_init

freebsd/netipsec/subr_ipsec.c:211–234  ·  view source on GitHub ↗

* Initialize transform support in an sav. */

Source from the content-addressed store, hash-verified

209 * Initialize transform support in an sav.
210 */
211int
212xform_init(struct secasvar *sav, u_short xftype)
213{
214 struct xformsw *entry;
215 int ret;
216
217 IPSEC_ASSERT(sav->tdb_xform == NULL,
218 ("tdb_xform is already initialized"));
219
220 XFORMS_LOCK();
221 LIST_FOREACH(entry, &xforms, chain) {
222 if (entry->xf_type == xftype) {
223 ret = ipsec_kmod_enter(&entry->xf_cntr);
224 XFORMS_UNLOCK();
225 if (ret != 0)
226 return (ret);
227 ret = (*entry->xf_init)(sav, entry);
228 ipsec_kmod_exit(&entry->xf_cntr);
229 return (ret);
230 }
231 }
232 XFORMS_UNLOCK();
233 return (EINVAL);
234}
235
236#ifdef IPSEC_SUPPORT
237/*

Callers 1

key_setsavalFunction · 0.85

Calls 2

ipsec_kmod_enterFunction · 0.85
ipsec_kmod_exitFunction · 0.85

Tested by

no test coverage detected