Lines Matching defs:crp
539 struct cryptop *crp;
609 crp = crypto_getreq(cryptoid, M_NOWAIT);
610 if (crp == NULL) {
618 crp->crp_payload_start = 0;
619 crp->crp_payload_length = m->m_pkthdr.len;
620 crp->crp_digest_start = skip + rplen;
628 crypto_freereq(crp);
652 crypto_freereq(crp);
658 crp->crp_op = CRYPTO_OP_COMPUTE_DIGEST;
659 crp->crp_flags = CRYPTO_F_CBIFSYNC;
660 crypto_use_mbuf(crp, m);
661 crp->crp_callback = ah_input_cb;
662 crp->crp_opaque = xd;
667 memcpy(crp->crp_esn, &seqh, sizeof(seqh));
678 return (crypto_dispatch_async(crp, CRYPTO_ASYNC_ORDERED));
680 return (crypto_dispatch(crp));
691 ah_input_cb(struct cryptop *crp)
706 m = crp->crp_buf.cb_mbuf;
707 xd = crp->crp_opaque;
720 if (crp->crp_etype) {
721 if (crp->crp_etype == EAGAIN) {
723 if (ipsec_updateid(sav, &crp->crp_session, &cryptoid) != 0)
725 xd->cryptoid = crp->crp_session;
727 return (crypto_dispatch(crp));
730 DPRINTF(("%s: crypto error %d\n", __func__, crp->crp_etype));
731 error = crp->crp_etype;
735 crypto_freereq(crp); /* No longer needed. */
736 crp = NULL;
833 if (crp != NULL)
834 crypto_freereq(crp);
849 struct cryptop *crp;
976 crp = crypto_getreq(cryptoid, M_NOWAIT);
977 if (crp == NULL) {
985 crp->crp_payload_start = 0;
986 crp->crp_payload_length = m->m_pkthdr.len;
987 crp->crp_digest_start = skip + rplen;
993 crypto_freereq(crp);
1045 crypto_freereq(crp);
1050 crp->crp_op = CRYPTO_OP_COMPUTE_DIGEST;
1051 crp->crp_flags = CRYPTO_F_CBIFSYNC;
1052 crypto_use_mbuf(crp, m);
1053 crp->crp_callback = ah_output_cb;
1054 crp->crp_opaque = xd;
1059 memcpy(crp->crp_esn, &seqh, sizeof(seqh));
1072 return (crypto_dispatch_async(crp, CRYPTO_ASYNC_ORDERED));
1074 return (crypto_dispatch(crp));
1087 ah_output_cb(struct cryptop *crp)
1098 m = crp->crp_buf.cb_mbuf;
1099 xd = (struct xform_data *) crp->crp_opaque;
1109 if (crp->crp_etype) {
1110 if (crp->crp_etype == EAGAIN) {
1112 if (ipsec_updateid(sav, &crp->crp_session, &cryptoid) != 0)
1114 xd->cryptoid = crp->crp_session;
1116 return (crypto_dispatch(crp));
1119 DPRINTF(("%s: crypto error %d\n", __func__, crp->crp_etype));
1120 error = crp->crp_etype;
1139 crypto_freereq(crp);
1162 crypto_freereq(crp);