diff options
Diffstat (limited to 'sys/opencrypto/cryptodev.h')
-rw-r--r-- | sys/opencrypto/cryptodev.h | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/sys/opencrypto/cryptodev.h b/sys/opencrypto/cryptodev.h index fdd86e9..f106ef5 100644 --- a/sys/opencrypto/cryptodev.h +++ b/sys/opencrypto/cryptodev.h @@ -413,5 +413,32 @@ extern void cuio_copyback(struct uio* uio, int off, int len, caddr_t cp); extern struct iovec *cuio_getptr(struct uio *uio, int loc, int *off); extern int cuio_apply(struct uio *uio, int off, int len, int (*f)(void *, void *, u_int), void *arg); +struct mbuf; +#define COPYBACK(type, buf, off, size, in) do { \ + switch (type) { \ + case CRYPTO_BUF_CONTIG: \ + bcopy(in, (u_char *)(buf) + (off), size); \ + break; \ + case CRYPTO_BUF_MBUF: \ + m_copyback((struct mbuf *)(buf), off, size, in); \ + break; \ + case CRYPTO_BUF_IOV: \ + cuio_copyback((struct uio *)(buf), off, size, in); \ + break; \ + } \ +} while (0) +#define COPYDATA(type, buf, off, size, out) do { \ + switch (type) { \ + case CRYPTO_BUF_CONTIG: \ + bcopy((u_char *)(buf) + (off), out, size); \ + break; \ + case CRYPTO_BUF_MBUF: \ + m_copydata((struct mbuf *)(buf), off, size, out); \ + break; \ + case CRYPTO_BUF_IOV: \ + cuio_copydata((struct uio *)(buf), off, size, out); \ + break; \ + } \ +} while (0) #endif /* _KERNEL */ #endif /* _CRYPTO_CRYPTO_H_ */ |