summaryrefslogtreecommitdiffstats
path: root/sys/opencrypto/xform_comp.h
diff options
context:
space:
mode:
authorallanjude <allanjude@FreeBSD.org>2015-12-30 22:43:07 +0000
committerallanjude <allanjude@FreeBSD.org>2015-12-30 22:43:07 +0000
commit2502999acda612f4678ed5461267695dd4647fb8 (patch)
tree12247b119e71bb44ed83dadc7581550fdd65e5c2 /sys/opencrypto/xform_comp.h
parentf0089fdb6f3501da95454665558d11f5ee6c699c (diff)
downloadFreeBSD-src-2502999acda612f4678ed5461267695dd4647fb8.zip
FreeBSD-src-2502999acda612f4678ed5461267695dd4647fb8.tar.gz
Break up opencrypto/xform.c so it can be reused piecemeal
Keep xform.c as a meta-file including the broken out bits existing code that includes xform.c continues to work as normal Individual algorithms can now be reused elsewhere, including outside of the kernel Reviewed by: bapt (previous version), gnn, delphij Approved by: secteam MFC after: 1 week Sponsored by: ScaleEngine Inc. Differential Revision: https://reviews.freebsd.org/D4674
Diffstat (limited to 'sys/opencrypto/xform_comp.h')
-rw-r--r--sys/opencrypto/xform_comp.h52
1 files changed, 52 insertions, 0 deletions
diff --git a/sys/opencrypto/xform_comp.h b/sys/opencrypto/xform_comp.h
new file mode 100644
index 0000000..23e4eac
--- /dev/null
+++ b/sys/opencrypto/xform_comp.h
@@ -0,0 +1,52 @@
+/* $FreeBSD$ */
+/* $OpenBSD: xform.h,v 1.8 2001/08/28 12:20:43 ben Exp $ */
+
+/*-
+ * The author of this code is Angelos D. Keromytis (angelos@cis.upenn.edu)
+ *
+ * This code was written by Angelos D. Keromytis in Athens, Greece, in
+ * February 2000. Network Security Technologies Inc. (NSTI) kindly
+ * supported the development of this code.
+ *
+ * Copyright (c) 2000 Angelos D. Keromytis
+ * Copyright (c) 2014 The FreeBSD Foundation
+ * All rights reserved.
+ *
+ * Portions of this software were developed by John-Mark Gurney
+ * under sponsorship of the FreeBSD Foundation and
+ * Rubicon Communications, LLC (Netgate).
+ *
+ * Permission to use, copy, and modify this software without fee
+ * is hereby granted, provided that this entire notice is included in
+ * all source code copies of any software which is or includes a copy or
+ * modification of this software.
+ *
+ * THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR
+ * IMPLIED WARRANTY. IN PARTICULAR, NONE OF THE AUTHORS MAKES ANY
+ * REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE
+ * MERCHANTABILITY OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR
+ * PURPOSE.
+ */
+
+#ifndef _CRYPTO_XFORM_COMP_H_
+#define _CRYPTO_XFORM_COMP_H_
+
+#include <sys/malloc.h>
+#include <sys/errno.h>
+
+#include <opencrypto/deflate.h>
+#include <opencrypto/cryptodev.h>
+#include <opencrypto/xform_userland.h>
+
+/* Declarations */
+struct comp_algo {
+ int type;
+ char *name;
+ size_t minlen;
+ u_int32_t (*compress) (u_int8_t *, u_int32_t, u_int8_t **);
+ u_int32_t (*decompress) (u_int8_t *, u_int32_t, u_int8_t **);
+};
+
+extern struct comp_algo comp_algo_deflate;
+
+#endif /* _CRYPTO_XFORM_COMP_H_ */
OpenPOWER on IntegriCloud