summaryrefslogtreecommitdiffstats
path: root/sys/opencrypto
diff options
context:
space:
mode:
authorpjd <pjd@FreeBSD.org>2006-06-04 15:10:12 +0000
committerpjd <pjd@FreeBSD.org>2006-06-04 15:10:12 +0000
commitb966da31ff8ab205add7db90f1ae0aa3f12df58f (patch)
tree9cbdec64533625bc761ecdc10a9f8d75db43eb2a /sys/opencrypto
parentab72bdd9e661c23fb54ca5e3dd45285e269f7c2f (diff)
downloadFreeBSD-src-b966da31ff8ab205add7db90f1ae0aa3f12df58f.zip
FreeBSD-src-b966da31ff8ab205add7db90f1ae0aa3f12df58f.tar.gz
Move COPYDATA() and COPYBACK() macros to cryptodev.h, they will be used
in padlock(4) as well.
Diffstat (limited to 'sys/opencrypto')
-rw-r--r--sys/opencrypto/cryptodev.h27
-rw-r--r--sys/opencrypto/cryptosoft.c27
2 files changed, 27 insertions, 27 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_ */
diff --git a/sys/opencrypto/cryptosoft.c b/sys/opencrypto/cryptosoft.c
index 2dfcf76..4a9640a 100644
--- a/sys/opencrypto/cryptosoft.c
+++ b/sys/opencrypto/cryptosoft.c
@@ -52,33 +52,6 @@ struct swcr_data **swcr_sessions = NULL;
u_int32_t swcr_sesnum = 0;
int32_t swcr_id = -1;
-#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)
-
static int swcr_encdec(struct cryptodesc *, struct swcr_data *, caddr_t, int);
static int swcr_authcompute(struct cryptodesc *crd, struct swcr_data *sw,
caddr_t buf, int outtype);
OpenPOWER on IntegriCloud