Add [ah/esp/ipcomp]_enable sysctls, and remove the FreeBSD #ifdefs.

Discussed with ozaki-r@.
This commit is contained in:
maxv 2018-02-16 09:24:55 +00:00
parent e7ef501d6b
commit 9ceac8f0d8
4 changed files with 27 additions and 26 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: ipsec_netbsd.c,v 1.45 2017/08/03 06:32:51 ozaki-r Exp $ */
/* $NetBSD: ipsec_netbsd.c,v 1.46 2018/02/16 09:24:55 maxv 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.45 2017/08/03 06:32:51 ozaki-r Exp $");
__KERNEL_RCSID(0, "$NetBSD: ipsec_netbsd.c,v 1.46 2018/02/16 09:24:55 maxv Exp $");
#if defined(_KERNEL_OPT)
#include "opt_inet.h"
@ -696,12 +696,31 @@ sysctl_net_inet_ipsec_setup(struct sysctllog **clog)
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, "ah_enable", NULL,
NULL, 0, &ah_enable, 0,
CTL_NET, PF_INET, ipproto_ipsec,
CTL_CREATE, CTL_EOL);
sysctl_createv(clog, 0, NULL, NULL,
CTLFLAG_PERMANENT|CTLFLAG_READWRITE,
CTLTYPE_INT, "esp_enable", NULL,
NULL, 0, &esp_enable, 0,
CTL_NET, PF_INET, ipproto_ipsec,
CTL_CREATE, CTL_EOL);
sysctl_createv(clog, 0, NULL, NULL,
CTLFLAG_PERMANENT|CTLFLAG_READWRITE,
CTLTYPE_INT, "ipcomp_enable", NULL,
NULL, 0, &ipcomp_enable, 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: xform_ah.c,v 1.85 2018/02/16 09:07:50 maxv Exp $ */
/* $NetBSD: xform_ah.c,v 1.86 2018/02/16 09:24:55 maxv Exp $ */
/* $FreeBSD: src/sys/netipsec/xform_ah.c,v 1.1.4.1 2003/01/24 05:11:36 sam Exp $ */
/* $OpenBSD: ip_ah.c,v 1.63 2001/06/26 06:18:58 angelos Exp $ */
/*
@ -39,7 +39,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: xform_ah.c,v 1.85 2018/02/16 09:07:50 maxv Exp $");
__KERNEL_RCSID(0, "$NetBSD: xform_ah.c,v 1.86 2018/02/16 09:24:55 maxv Exp $");
#if defined(_KERNEL_OPT)
#include "opt_inet.h"
@ -104,12 +104,6 @@ percpu_t *ahstat_percpu;
int ah_enable = 1; /* control flow of packets with AH */
int ip4_ah_cleartos = 1; /* clear ip_tos when doing AH calc */
#ifdef __FreeBSD__
SYSCTL_DECL(_net_inet_ah);
SYSCTL_INT(_net_inet_ah, OID_AUTO,
ah_enable, CTLFLAG_RW, &ah_enable, 0, "");
#endif /* __FreeBSD__ */
static unsigned char ipseczeroes[256]; /* larger than an ip6 extension hdr */
int ah_max_authsize; /* max authsize over all algorithms */

View File

@ -1,4 +1,4 @@
/* $NetBSD: xform_esp.c,v 1.78 2018/02/16 09:07:50 maxv Exp $ */
/* $NetBSD: xform_esp.c,v 1.79 2018/02/16 09:24:55 maxv Exp $ */
/* $FreeBSD: src/sys/netipsec/xform_esp.c,v 1.2.2.1 2003/01/24 05:11:36 sam Exp $ */
/* $OpenBSD: ip_esp.c,v 1.69 2001/06/26 06:18:59 angelos Exp $ */
@ -39,7 +39,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: xform_esp.c,v 1.78 2018/02/16 09:07:50 maxv Exp $");
__KERNEL_RCSID(0, "$NetBSD: xform_esp.c,v 1.79 2018/02/16 09:24:55 maxv Exp $");
#if defined(_KERNEL_OPT)
#include "opt_inet.h"
@ -89,12 +89,6 @@ percpu_t *espstat_percpu;
int esp_enable = 1;
#ifdef __FreeBSD__
SYSCTL_DECL(_net_inet_esp);
SYSCTL_INT(_net_inet_esp, OID_AUTO,
esp_enable, CTLFLAG_RW, &esp_enable, 0, "");
#endif /* __FreeBSD__ */
static int esp_max_ivlen; /* max iv length over all algorithms */
static int esp_input_cb(struct cryptop *op);

View File

@ -1,4 +1,4 @@
/* $NetBSD: xform_ipcomp.c,v 1.58 2018/02/16 09:07:50 maxv Exp $ */
/* $NetBSD: xform_ipcomp.c,v 1.59 2018/02/16 09:24:55 maxv Exp $ */
/* $FreeBSD: src/sys/netipsec/xform_ipcomp.c,v 1.1.4.1 2003/01/24 05:11:36 sam Exp $ */
/* $OpenBSD: ip_ipcomp.c,v 1.1 2001/07/05 12:08:52 jjbg Exp $ */
@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: xform_ipcomp.c,v 1.58 2018/02/16 09:07:50 maxv Exp $");
__KERNEL_RCSID(0, "$NetBSD: xform_ipcomp.c,v 1.59 2018/02/16 09:24:55 maxv Exp $");
/* IP payload compression protocol (IPComp), see RFC 2393 */
#if defined(_KERNEL_OPT)
@ -76,12 +76,6 @@ percpu_t *ipcompstat_percpu;
int ipcomp_enable = 1;
#ifdef __FreeBSD__
SYSCTL_DECL(_net_inet_ipcomp);
SYSCTL_INT(_net_inet_ipcomp, OID_AUTO,
ipcomp_enable, CTLFLAG_RW, &ipcomp_enable, 0, "");
#endif /* __FreeBSD__ */
static int ipcomp_input_cb(struct cryptop *crp);
static int ipcomp_output_cb(struct cryptop *crp);