Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys rename rfc6056 -> portalgo, requested by yamt
details: https://anonhg.NetBSD.org/src/rev/07cdfdbce70d
branches: trunk
changeset: 779887:07cdfdbce70d
user: christos <christos%NetBSD.org@localhost>
date: Mon Jun 25 15:28:38 2012 +0000
description:
rename rfc6056 -> portalgo, requested by yamt
diffstat:
sys/netinet/Makefile | 4 +-
sys/netinet/files.netinet | 4 +-
sys/netinet/in_pcb.c | 10 +-
sys/netinet/in_pcb.h | 4 +-
sys/netinet/in_pcb_hdr.h | 4 +-
sys/netinet/ip_input.c | 18 +-
sys/netinet/ip_output.c | 10 +-
sys/netinet/portalgo.c | 942 ++++++++++++++++++++++++++++++++++++++++++++++
sys/netinet/portalgo.h | 57 ++
sys/netinet/rfc6056.c | 942 ----------------------------------------------
sys/netinet/rfc6056.h | 57 --
sys/netinet6/in6_pcb.c | 8 +-
sys/netinet6/in6_pcb.h | 4 +-
sys/netinet6/in6_src.c | 8 +-
sys/netinet6/ip6_input.c | 18 +-
sys/netinet6/ip6_output.c | 10 +-
16 files changed, 1050 insertions(+), 1050 deletions(-)
diffs (truncated from 2424 to 300 lines):
diff -r c16a4ef7df4b -r 07cdfdbce70d sys/netinet/Makefile
--- a/sys/netinet/Makefile Mon Jun 25 14:47:55 2012 +0000
+++ b/sys/netinet/Makefile Mon Jun 25 15:28:38 2012 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.23 2012/02/15 17:55:24 riz Exp $
+# $NetBSD: Makefile,v 1.24 2012/06/25 15:28:38 christos Exp $
INCSDIR= /usr/include/netinet
@@ -6,7 +6,7 @@
igmp_var.h in.h in_gif.h in_pcb.h in_pcb_hdr.h \
in_selsrc.h in_systm.h \
in_var.h ip.h ip_carp.h ip6.h ip_ecn.h ip_encap.h \
- ip_icmp.h ip_mroute.h ip_var.h pim.h pim_var.h rfc6056.h \
+ ip_icmp.h ip_mroute.h ip_var.h pim.h pim_var.h portalgo.h \
tcp.h tcp_debug.h tcp_fsm.h tcp_seq.h tcp_timer.h tcp_var.h \
tcpip.h udp.h udp_var.h \
tcp_vtw.h
diff -r c16a4ef7df4b -r 07cdfdbce70d sys/netinet/files.netinet
--- a/sys/netinet/files.netinet Mon Jun 25 14:47:55 2012 +0000
+++ b/sys/netinet/files.netinet Mon Jun 25 15:28:38 2012 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: files.netinet,v 1.23 2011/09/24 17:18:17 christos Exp $
+# $NetBSD: files.netinet,v 1.24 2012/06/25 15:28:39 christos Exp $
defflag opt_tcp_debug.h TCP_DEBUG
defparam opt_tcp_debug.h TCP_NDEBUG
@@ -43,4 +43,4 @@
file netinet/tcp_vtw.c inet | inet6
file netinet/udp_usrreq.c inet | inet6
-file netinet/rfc6056.c inet | inet6
+file netinet/portalgo.c inet | inet6
diff -r c16a4ef7df4b -r 07cdfdbce70d sys/netinet/in_pcb.c
--- a/sys/netinet/in_pcb.c Mon Jun 25 14:47:55 2012 +0000
+++ b/sys/netinet/in_pcb.c Mon Jun 25 15:28:38 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: in_pcb.c,v 1.142 2012/06/21 10:31:45 yamt Exp $ */
+/* $NetBSD: in_pcb.c,v 1.143 2012/06/25 15:28:39 christos Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -93,7 +93,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: in_pcb.c,v 1.142 2012/06/21 10:31:45 yamt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: in_pcb.c,v 1.143 2012/06/25 15:28:39 christos Exp $");
#include "opt_inet.h"
#include "opt_ipsec.h"
@@ -124,7 +124,7 @@
#include <netinet/in_pcb.h>
#include <netinet/in_var.h>
#include <netinet/ip_var.h>
-#include <netinet/rfc6056.h>
+#include <netinet/portalgo.h>
#ifdef INET6
#include <netinet/ip6.h>
@@ -205,7 +205,7 @@
inp->inp_table = table;
inp->inp_socket = so;
inp->inp_errormtu = -1;
- inp->inp_rfc6056algo = RFC6056_ALGO_DEFAULT;
+ inp->inp_portalgo = PORTALGO_DEFAULT;
inp->inp_bindportonsend = false;
#if defined(FAST_IPSEC)
error = ipsec_init_pcbpolicy(so, &inp->inp_sp);
@@ -260,7 +260,7 @@
/*
* Use RFC6056 randomized port selection
*/
- error = rfc6056_randport(&lport, &inp->inp_head, cred);
+ error = portalgo_randport(&lport, &inp->inp_head, cred);
if (error)
return error;
diff -r c16a4ef7df4b -r 07cdfdbce70d sys/netinet/in_pcb.h
--- a/sys/netinet/in_pcb.h Mon Jun 25 14:47:55 2012 +0000
+++ b/sys/netinet/in_pcb.h Mon Jun 25 15:28:38 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: in_pcb.h,v 1.49 2011/09/24 17:18:17 christos Exp $ */
+/* $NetBSD: in_pcb.h,v 1.50 2012/06/25 15:28:39 christos Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -80,7 +80,7 @@
#define inp_af inp_head.inph_af
#define inp_ppcb inp_head.inph_ppcb
#define inp_state inp_head.inph_state
-#define inp_rfc6056algo inp_head.inph_rfc6056algo
+#define inp_portalgo inp_head.inph_portalgo
#define inp_socket inp_head.inph_socket
#define inp_table inp_head.inph_table
#define inp_sp inp_head.inph_sp
diff -r c16a4ef7df4b -r 07cdfdbce70d sys/netinet/in_pcb_hdr.h
--- a/sys/netinet/in_pcb_hdr.h Mon Jun 25 14:47:55 2012 +0000
+++ b/sys/netinet/in_pcb_hdr.h Mon Jun 25 15:28:38 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: in_pcb_hdr.h,v 1.7 2011/09/24 17:18:17 christos Exp $ */
+/* $NetBSD: in_pcb_hdr.h,v 1.8 2012/06/25 15:28:39 christos Exp $ */
/*
* Copyright (C) 2003 WIDE Project.
@@ -77,7 +77,7 @@
int inph_af; /* address family - AF_INET */
void * inph_ppcb; /* pointer to per-protocol pcb */
int inph_state; /* bind/connect state */
- int inph_rfc6056algo;
+ int inph_portalgo;
struct socket *inph_socket; /* back pointer to socket */
struct inpcbtable *inph_table;
#if 1 /* IPSEC */
diff -r c16a4ef7df4b -r 07cdfdbce70d sys/netinet/ip_input.c
--- a/sys/netinet/ip_input.c Mon Jun 25 14:47:55 2012 +0000
+++ b/sys/netinet/ip_input.c Mon Jun 25 15:28:38 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ip_input.c,v 1.301 2012/06/22 14:54:35 christos Exp $ */
+/* $NetBSD: ip_input.c,v 1.302 2012/06/25 15:28:39 christos Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -91,7 +91,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ip_input.c,v 1.301 2012/06/22 14:54:35 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ip_input.c,v 1.302 2012/06/25 15:28:39 christos Exp $");
#include "opt_inet.h"
#include "opt_compat_netbsd.h"
@@ -139,7 +139,7 @@
#ifdef MROUTING
#include <netinet/ip_mroute.h>
#endif
-#include <netinet/rfc6056.h>
+#include <netinet/portalgo.h>
#ifdef FAST_IPSEC
#include <netipsec/ipsec.h>
@@ -1889,24 +1889,24 @@
CTL_EOL);
/* anonportalgo RFC6056 subtree */
- const struct sysctlnode *rfc6056_node;
- sysctl_createv(clog, 0, NULL, &rfc6056_node,
+ const struct sysctlnode *portalgo_node;
+ sysctl_createv(clog, 0, NULL, &portalgo_node,
CTLFLAG_PERMANENT,
CTLTYPE_NODE, "anonportalgo",
SYSCTL_DESCR("Anonymous Port Algorithm Selection (RFC 6056)"),
NULL, 0, NULL, 0,
CTL_NET, PF_INET, IPPROTO_IP, CTL_CREATE, CTL_EOL);
- sysctl_createv(clog, 0, &rfc6056_node, NULL,
+ sysctl_createv(clog, 0, &portalgo_node, NULL,
CTLFLAG_PERMANENT,
CTLTYPE_STRING, "available",
SYSCTL_DESCR("available algorithms"),
- sysctl_rfc6056_available, 0, NULL, RFC6056_MAXLEN,
+ sysctl_portalgo_available, 0, NULL, PORTALGO_MAXLEN,
CTL_CREATE, CTL_EOL);
- sysctl_createv(clog, 0, &rfc6056_node, NULL,
+ sysctl_createv(clog, 0, &portalgo_node, NULL,
CTLFLAG_PERMANENT|CTLFLAG_READWRITE,
CTLTYPE_STRING, "selected",
SYSCTL_DESCR("selected algorithm"),
- sysctl_rfc6056_selected, 0, NULL, RFC6056_MAXLEN,
+ sysctl_portalgo_selected, 0, NULL, PORTALGO_MAXLEN,
CTL_CREATE, CTL_EOL);
}
diff -r c16a4ef7df4b -r 07cdfdbce70d sys/netinet/ip_output.c
--- a/sys/netinet/ip_output.c Mon Jun 25 14:47:55 2012 +0000
+++ b/sys/netinet/ip_output.c Mon Jun 25 15:28:38 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ip_output.c,v 1.216 2012/06/22 14:54:35 christos Exp $ */
+/* $NetBSD: ip_output.c,v 1.217 2012/06/25 15:28:39 christos Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -91,7 +91,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ip_output.c,v 1.216 2012/06/22 14:54:35 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ip_output.c,v 1.217 2012/06/25 15:28:39 christos Exp $");
#include "opt_pfil_hooks.h"
#include "opt_inet.h"
@@ -125,7 +125,7 @@
#include <netinet/ip_var.h>
#include <netinet/ip_private.h>
#include <netinet/in_offload.h>
-#include <netinet/rfc6056.h>
+#include <netinet/portalgo.h>
#ifdef MROUTING
#include <netinet/ip_mroute.h>
@@ -1148,7 +1148,7 @@
if (error)
break;
- error = rfc6056_algo_index_select(
+ error = portalgo_algo_index_select(
(struct inpcb_hdr *)inp, optval);
break;
@@ -1267,7 +1267,7 @@
break;
case IP_PORTALGO:
- optval = ((struct inpcb_hdr *)inp)->inph_rfc6056algo;
+ optval = ((struct inpcb_hdr *)inp)->inph_portalgo;
error = sockopt_setint(sopt, optval);
break;
diff -r c16a4ef7df4b -r 07cdfdbce70d sys/netinet/portalgo.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/netinet/portalgo.c Mon Jun 25 15:28:38 2012 +0000
@@ -0,0 +1,942 @@
+/* $NetBSD: portalgo.c,v 1.1 2012/06/25 15:28:39 christos Exp $ */
+
+/*
+ * Copyright 2011 Vlad Balan
+ *
+ * Written by Vlad Balan for the NetBSD Foundation.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+/*
+ * see:
+ * RFC 6056 Recommendations for Transport-Protocol Port Randomization
+ */
+
+#include <sys/cdefs.h>
+__KERNEL_RCSID(0, "$NetBSD: portalgo.c,v 1.1 2012/06/25 15:28:39 christos Exp $");
+
+#include "opt_inet.h"
+
+#include <sys/param.h>
+#include <sys/errno.h>
+#include <sys/kauth.h>
+#include <sys/uidinfo.h>
+#include <sys/domain.h>
+#include <sys/md5.h>
+#include <sys/cprng.h>
+
+#include <net/if.h>
+#include <net/route.h>
+
+#include <netinet/in.h>
+#include <netinet/in_systm.h>
+#include <netinet/ip.h>
+#include <netinet/in_pcb.h>
+#include <netinet/in_var.h>
+#include <netinet/ip_var.h>
+
+#ifdef INET6
+#include <netinet/ip6.h>
+#include <netinet6/ip6_var.h>
+#include <netinet6/in6_pcb.h>
+#endif
+
+#include <netinet/tcp_vtw.h>
+
+#include "portalgo.h"
+
+#define NPROTO 2
+#define PORTALGO_TCP 0
+#define PORTALGO_UDP 1
+
+#define NAF 2
+#define PORTALGO_IPV4 0
+#define PORTALGO_IPV6 1
+
+#define NRANGES 2
+#define PORTALGO_LOWPORT 0
+#define PORTALGO_HIGHPORT 1
Home |
Main Index |
Thread Index |
Old Index