Changeset View
Changeset View
Standalone View
Standalone View
head/sys/netipsec/xform_ipcomp.c
Show First 20 Lines • Show All 173 Lines • ▼ Show 20 Lines | ipcomp_init(struct secasvar *sav, struct xformsw *xsp) | ||||
memset(&csp, 0, sizeof(csp)); | memset(&csp, 0, sizeof(csp)); | ||||
csp.csp_mode = CSP_MODE_COMPRESS; | csp.csp_mode = CSP_MODE_COMPRESS; | ||||
csp.csp_cipher_alg = sav->tdb_compalgxform->type; | csp.csp_cipher_alg = sav->tdb_compalgxform->type; | ||||
return crypto_newsession(&sav->tdb_cryptoid, &csp, V_crypto_support); | return crypto_newsession(&sav->tdb_cryptoid, &csp, V_crypto_support); | ||||
} | } | ||||
/* | /* | ||||
* ipcomp_zeroize() used when IPCA is deleted | * ipcomp_cleanup() used when IPCA is deleted | ||||
*/ | */ | ||||
static int | static void | ||||
ipcomp_zeroize(struct secasvar *sav) | ipcomp_cleanup(struct secasvar *sav) | ||||
{ | { | ||||
crypto_freesession(sav->tdb_cryptoid); | crypto_freesession(sav->tdb_cryptoid); | ||||
sav->tdb_cryptoid = NULL; | sav->tdb_cryptoid = NULL; | ||||
return 0; | |||||
} | } | ||||
/* | /* | ||||
* ipcomp_input() gets called to uncompress an input packet | * ipcomp_input() gets called to uncompress an input packet | ||||
*/ | */ | ||||
static int | static int | ||||
ipcomp_input(struct mbuf *m, struct secasvar *sav, int skip, int protoff) | ipcomp_input(struct mbuf *m, struct secasvar *sav, int skip, int protoff) | ||||
{ | { | ||||
▲ Show 20 Lines • Show All 535 Lines • ▼ Show 20 Lines | static const struct encap_config ipv6_encap_cfg = { | ||||
.input = ipcomp_nonexp_input | .input = ipcomp_nonexp_input | ||||
}; | }; | ||||
#endif | #endif | ||||
static struct xformsw ipcomp_xformsw = { | static struct xformsw ipcomp_xformsw = { | ||||
.xf_type = XF_IPCOMP, | .xf_type = XF_IPCOMP, | ||||
.xf_name = "IPcomp", | .xf_name = "IPcomp", | ||||
.xf_init = ipcomp_init, | .xf_init = ipcomp_init, | ||||
.xf_zeroize = ipcomp_zeroize, | .xf_cleanup = ipcomp_cleanup, | ||||
.xf_input = ipcomp_input, | .xf_input = ipcomp_input, | ||||
.xf_output = ipcomp_output, | .xf_output = ipcomp_output, | ||||
}; | }; | ||||
static void | static void | ||||
ipcomp_attach(void) | ipcomp_attach(void) | ||||
{ | { | ||||
Show All 26 Lines |