Lines Matching defs:crp
95 static int ipcomp_input_cb(struct cryptop *crp);
96 static int ipcomp_output_cb(struct cryptop *crp);
201 struct cryptop *crp;
235 crp = crypto_getreq(cryptoid, M_NOWAIT);
236 if (crp == NULL) {
246 crypto_freereq(crp);
251 crp->crp_op = CRYPTO_OP_DECOMPRESS;
252 crp->crp_payload_start = skip + hlen;
253 crp->crp_payload_length = m->m_pkthdr.len - (skip + hlen);
256 crp->crp_flags = CRYPTO_F_CBIFSYNC;
257 crypto_use_mbuf(crp, m);
258 crp->crp_callback = ipcomp_input_cb;
259 crp->crp_opaque = xd;
269 crp->crp_session = xd->cryptoid = sav->tdb_cryptoid;
272 return crypto_dispatch(crp);
283 ipcomp_input_cb(struct cryptop *crp)
296 m = crp->crp_buf.cb_mbuf;
297 xd = crp->crp_opaque;
309 if (crp->crp_etype) {
310 if (crp->crp_etype == EAGAIN) {
312 if (ipsec_updateid(sav, &crp->crp_session, &cryptoid) != 0)
314 xd->cryptoid = crp->crp_session;
316 return (crypto_dispatch(crp));
319 DPRINTF(("%s: crypto error %d\n", __func__, crp->crp_etype));
320 error = crp->crp_etype;
332 clen = crp->crp_olen; /* Length of data after processing */
336 crypto_freereq(crp), crp = NULL;
390 if (crp != NULL)
391 crypto_freereq(crp);
404 struct cryptop *crp;
481 crp = crypto_getreq(cryptoid, M_NOWAIT);
482 if (crp == NULL) {
490 crp->crp_op = CRYPTO_OP_COMPRESS;
491 crp->crp_payload_start = skip;
492 crp->crp_payload_length = ralen;
499 crypto_freereq(crp);
513 crp->crp_flags = CRYPTO_F_CBIFSYNC;
514 crypto_use_mbuf(crp, m);
515 crp->crp_callback = ipcomp_output_cb;
516 crp->crp_opaque = xd;
518 return crypto_dispatch(crp);
531 ipcomp_output_cb(struct cryptop *crp)
542 m = crp->crp_buf.cb_mbuf;
543 xd = crp->crp_opaque;
553 if (crp->crp_etype) {
554 if (crp->crp_etype == EAGAIN) {
556 if (ipsec_updateid(sav, &crp->crp_session, &cryptoid) != 0)
558 xd->cryptoid = crp->crp_session;
560 return (crypto_dispatch(crp));
563 DPRINTF(("%s: crypto error %d\n", __func__, crp->crp_etype));
564 error = crp->crp_etype;
576 if (crp->crp_payload_length > crp->crp_olen) {
644 __func__, crp->crp_payload_length, crp->crp_olen));
651 crypto_freereq(crp);
662 crypto_freereq(crp);