add sysctl to select software/hardware encryption driver. can enable CRYPTO_DEBUG.

This commit is contained in:
knakahara 2017-03-06 09:59:05 +00:00
parent 5169db68cb
commit 7e207e7bba
2 changed files with 14 additions and 10 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: ipsec_netbsd.c,v 1.38 2016/07/07 06:55:43 msaitoh Exp $ */
/* $NetBSD: ipsec_netbsd.c,v 1.39 2017/03/06 09:59:05 knakahara Exp $ */
/* $KAME: esp_input.c,v 1.60 2001/09/04 08:43:19 itojun Exp $ */
/* $KAME: ah_input.c,v 1.64 2001/09/04 08:43:19 itojun Exp $ */
@ -32,7 +32,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: ipsec_netbsd.c,v 1.38 2016/07/07 06:55:43 msaitoh Exp $");
__KERNEL_RCSID(0, "$NetBSD: ipsec_netbsd.c,v 1.39 2017/03/06 09:59:05 knakahara Exp $");
#include "opt_inet.h"
#include "opt_ipsec.h"
@ -702,6 +702,12 @@ SYSCTL_SETUP(sysctl_net_inet_ipsec_setup, "sysctl net.inet.ipsec subtree setup")
NULL, 0, &ipsec_used, 0,
CTL_NET, PF_INET, ipproto_ipsec,
CTL_CREATE, CTL_EOL);
sysctl_createv(clog, 0, NULL, NULL,
CTLFLAG_PERMANENT|CTLFLAG_READWRITE,
CTLTYPE_INT, "crypto_support", NULL,
NULL, 0, &crypto_support, 0,
CTL_NET, PF_INET, ipproto_ipsec,
CTL_CREATE, CTL_EOL);
#ifdef IPSEC_DEBUG
sysctl_createv(clog, 0, NULL, NULL,
CTLFLAG_PERMANENT|CTLFLAG_READWRITE,

View File

@ -1,4 +1,4 @@
/* $NetBSD: cryptodev.h,v 1.28 2016/07/07 06:55:43 msaitoh Exp $ */
/* $NetBSD: cryptodev.h,v 1.29 2017/03/06 09:59:05 knakahara Exp $ */
/* $FreeBSD: src/sys/opencrypto/cryptodev.h,v 1.2.2.6 2003/07/02 17:04:50 sam Exp $ */
/* $OpenBSD: cryptodev.h,v 1.33 2002/07/17 23:52:39 art Exp $ */
@ -89,6 +89,10 @@
#include <sys/condvar.h>
#include <sys/time.h>
#if defined(_KERNEL_OPT)
#include "opt_ocf.h"
#endif
/* Some initial values */
#define CRYPTO_DRIVERS_INITIAL 4
#define CRYPTO_SW_SESSIONS 32
@ -641,18 +645,12 @@ extern int cuio_getptr(struct uio *, int loc, int *off);
#ifdef CRYPTO_DEBUG /* yuck, netipsec defines these differently */
#ifndef DPRINTF
#define DPRINTF(a) uprintf a
#endif
#ifndef DCPRINTF
#define DCPRINTF(a) printf a
#define DPRINTF(a) printf a
#endif
#else
#ifndef DPRINTF
#define DPRINTF(a)
#endif
#ifndef DCPRINTF
#define DCPRINTF(a)
#endif
#endif
#endif /* _KERNEL */