From 9183e2dc4ec1ba1b71a7a8e7aaa3f5ea2c589d3f Mon Sep 17 00:00:00 2001 From: itojun Date: Thu, 19 Oct 2000 20:22:59 +0000 Subject: [PATCH] remove #ifdef TCP6. it is not likely for us to bring in sys/netinet6/tcp6*.c (separate TCP/IPv6 stack) into netbsd-current. --- sys/netinet/tcp_input.c | 8 ++-- sys/netinet/tcp_output.c | 8 ++-- sys/netinet/tcp_subr.c | 31 ++++--------- sys/netinet/tcp_timer.c | 6 +-- sys/netinet/tcp_var.h | 10 ++-- sys/netinet6/in6_pcb.c | 12 ++--- sys/netinet6/in6_pcb.h | 4 +- sys/netinet6/in6_proto.c | 98 +--------------------------------------- sys/netinet6/ipsec.h | 6 +-- 9 files changed, 31 insertions(+), 152 deletions(-) diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index 64ee72895d7e..f0abab2c0ff6 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -1,4 +1,4 @@ -/* $NetBSD: tcp_input.c,v 1.119 2000/10/17 03:06:42 itojun Exp $ */ +/* $NetBSD: tcp_input.c,v 1.120 2000/10/19 20:22:59 itojun Exp $ */ /* %%% portions-copyright-nrl-95 @@ -509,7 +509,7 @@ present: return (pkt_flags); } -#if defined(INET6) && !defined(TCP6) +#ifdef INET6 int tcp6_input(mp, offp, proto) struct mbuf **mp; @@ -812,7 +812,7 @@ findpcb: ++tcpstat.tcps_pcbhashmiss; inp = in_pcblookup_bind(&tcbtable, ip->ip_dst, th->th_dport); } -#if defined(INET6) && !defined(TCP6) +#ifdef INET6 if (inp == 0) { struct in6_addr s, d; @@ -883,7 +883,7 @@ findpcb: #endif /*IPSEC*/ break; #endif /*INET*/ -#if defined(INET6) && !defined(TCP6) +#ifdef INET6 case AF_INET6: { int faith; diff --git a/sys/netinet/tcp_output.c b/sys/netinet/tcp_output.c index 8860461b0ade..694572658160 100644 --- a/sys/netinet/tcp_output.c +++ b/sys/netinet/tcp_output.c @@ -1,4 +1,4 @@ -/* $NetBSD: tcp_output.c,v 1.60 2000/10/17 03:06:43 itojun Exp $ */ +/* $NetBSD: tcp_output.c,v 1.61 2000/10/19 20:23:00 itojun Exp $ */ /* %%% portions-copyright-nrl-95 @@ -210,7 +210,7 @@ tcp_segsize(tp, txsegsizep, rxsegsizep) if (inp) rt = in_pcbrtentry(inp); #endif -#if defined(INET6) && !defined(TCP6) +#ifdef INET6 if (in6p) rt = in6_pcbrtentry(in6p); #endif @@ -272,7 +272,7 @@ tcp_segsize(tp, txsegsizep, rxsegsizep) } else #endif if (in6p && tp->t_family == AF_INET6) { -#if defined(IPSEC) && !defined(TCP6) +#ifdef IPSEC size -= ipsec6_hdrsiz_tcp(tp); #endif size -= ip6_optlen(in6p); @@ -627,7 +627,7 @@ send: if (tp->t_inpcb) rt = in_pcbrtentry(tp->t_inpcb); #endif -#if defined(INET6) && !defined(TCP6) +#ifdef INET6 if (tp->t_in6pcb) rt = in6_pcbrtentry(tp->t_in6pcb); #endif diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c index 0e6dc7bd5f6f..093c6977400f 100644 --- a/sys/netinet/tcp_subr.c +++ b/sys/netinet/tcp_subr.c @@ -1,4 +1,4 @@ -/* $NetBSD: tcp_subr.c,v 1.100 2000/10/19 00:40:50 itojun Exp $ */ +/* $NetBSD: tcp_subr.c,v 1.101 2000/10/19 20:23:00 itojun Exp $ */ /* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. @@ -201,7 +201,7 @@ void tcp6_mtudisc_callback __P((struct in6_addr *)); #endif void tcp_mtudisc __P((struct inpcb *, int)); -#if defined(INET6) && !defined(TCP6) +#ifdef INET6 void tcp6_mtudisc __P((struct in6pcb *, int)); #endif @@ -1066,7 +1066,7 @@ tcp_notify(inp, error) sowwakeup(so); } -#if defined(INET6) && !defined(TCP6) +#ifdef INET6 void tcp6_notify(in6p, error) struct in6pcb *in6p; @@ -1097,7 +1097,7 @@ tcp6_notify(in6p, error) } #endif -#if defined(INET6) && !defined(TCP6) +#ifdef INET6 void tcp6_ctlinput(cmd, sa, d) int cmd; @@ -1314,7 +1314,7 @@ tcp_quench(inp, errno) } #endif -#if defined(INET6) && !defined(TCP6) +#ifdef INET6 void tcp6_quench(in6p, errno) struct in6pcb *in6p; @@ -1386,7 +1386,7 @@ tcp_mtudisc(inp, errno) } #endif -#if defined(INET6) && !defined(TCP6) +#ifdef INET6 /* * Path MTU Discovery handlers. */ @@ -1444,7 +1444,7 @@ tcp6_mtudisc(in6p, errno) tcp_output(tp); } } -#endif /* INET6 && !TCP6 */ +#endif /* INET6 */ /* * Compute the MSS to advertise to the peer. Called only during @@ -1550,11 +1550,7 @@ tcp_mss_from_peer(tp, offer) if (tp->t_in6pcb) { so = tp->t_in6pcb->in6p_socket; #if defined(RTV_SPIPE) || defined(RTV_SSTHRESH) -#ifdef TCP6 - rt = NULL; -#else rt = in6_pcbrtentry(tp->t_in6pcb); -#endif #endif } #endif @@ -1644,11 +1640,7 @@ tcp_established(tp) if (tp->t_in6pcb) { so = tp->t_in6pcb->in6p_socket; #if defined(RTV_RPIPE) -#ifdef TCP6 - rt = NULL; -#else rt = in6_pcbrtentry(tp->t_in6pcb); -#endif #endif } #endif @@ -1692,13 +1684,8 @@ tcp_rmx_rtt(tp) rt = in_pcbrtentry(tp->t_inpcb); #endif #ifdef INET6 - if (tp->t_in6pcb) { -#ifdef TCP6 - rt = NULL; -#else + if (tp->t_in6pcb) rt = in6_pcbrtentry(tp->t_in6pcb); -#endif - } #endif if (rt == NULL) return; @@ -1817,7 +1804,7 @@ ipsec4_hdrsiz_tcp(tp) return hdrsiz; } -#if defined(INET6) && !defined(TCP6) +#ifdef INET6 size_t ipsec6_hdrsiz_tcp(tp) struct tcpcb *tp; diff --git a/sys/netinet/tcp_timer.c b/sys/netinet/tcp_timer.c index bcc23872bf38..7fd39b0255fb 100644 --- a/sys/netinet/tcp_timer.c +++ b/sys/netinet/tcp_timer.c @@ -1,4 +1,4 @@ -/* $NetBSD: tcp_timer.c,v 1.47 2000/10/17 03:06:44 itojun Exp $ */ +/* $NetBSD: tcp_timer.c,v 1.48 2000/10/19 20:23:00 itojun Exp $ */ /* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. @@ -177,7 +177,7 @@ tcp_slowtimo() { struct inpcb *inp, *ninp; struct tcpcb *tp; -#if defined(INET6) && !defined(TCP6) +#ifdef INET6 struct in6pcb *in6p, *nin6p; #endif int s; @@ -224,7 +224,7 @@ tpgone: ; } dotcb6: -#if defined(INET6) && !defined(TCP6) +#ifdef INET6 mask |= 2; in6p = tcb6.in6p_next; if (in6p == (struct in6pcb *)0) { /* XXX */ diff --git a/sys/netinet/tcp_var.h b/sys/netinet/tcp_var.h index ca7b20591adc..a25c0721c068 100644 --- a/sys/netinet/tcp_var.h +++ b/sys/netinet/tcp_var.h @@ -1,4 +1,4 @@ -/* $NetBSD: tcp_var.h,v 1.76 2000/10/18 17:09:15 thorpej Exp $ */ +/* $NetBSD: tcp_var.h,v 1.77 2000/10/19 20:23:00 itojun Exp $ */ /* %%% portions-copyright-nrl-98 @@ -630,7 +630,7 @@ int tcp_attach __P((struct socket *)); void tcp_canceltimers __P((struct tcpcb *)); struct tcpcb * tcp_close __P((struct tcpcb *)); -#if defined(INET6) && !defined(TCP6) +#ifdef INET6 void tcp6_ctlinput __P((int, struct sockaddr *, void *)); #endif void *tcp_ctlinput __P((int, struct sockaddr *, void *)); @@ -645,7 +645,7 @@ void tcp_drain __P((void)); void tcp_established __P((struct tcpcb *)); void tcp_fasttimo __P((void)); void tcp_init __P((void)); -#if defined(INET6) && !defined(TCP6) +#ifdef INET6 int tcp6_input __P((struct mbuf **, int *, int)); #endif void tcp_input __P((struct mbuf *, ...)); @@ -654,7 +654,7 @@ void tcp_mss_from_peer __P((struct tcpcb *, int)); struct tcpcb * tcp_newtcpcb __P((int, void *)); void tcp_notify __P((struct inpcb *, int)); -#if defined(INET6) && !defined(TCP6) +#ifdef INET6 void tcp6_notify __P((struct in6pcb *, int)); #endif u_int tcp_optlen __P((struct tcpcb *)); @@ -662,7 +662,7 @@ int tcp_output __P((struct tcpcb *)); void tcp_pulloutofband __P((struct socket *, struct tcphdr *, struct mbuf *, int)); void tcp_quench __P((struct inpcb *, int)); -#if defined(INET6) && !defined(TCP6) +#ifdef INET6 void tcp6_quench __P((struct in6pcb *, int)); #endif int tcp_reass __P((struct tcpcb *, struct tcphdr *, struct mbuf *, int *)); diff --git a/sys/netinet6/in6_pcb.c b/sys/netinet6/in6_pcb.c index e0e19e7f66e3..b68af77fbf1d 100644 --- a/sys/netinet6/in6_pcb.c +++ b/sys/netinet6/in6_pcb.c @@ -1,4 +1,4 @@ -/* $NetBSD: in6_pcb.c,v 1.31 2000/10/02 03:55:43 itojun Exp $ */ +/* $NetBSD: in6_pcb.c,v 1.32 2000/10/19 20:23:02 itojun Exp $ */ /* $KAME: in6_pcb.c,v 1.64 2000/10/01 12:37:20 itojun Exp $ */ /* @@ -649,7 +649,6 @@ in6_pcblookup(head, faddr6, fport_arg, laddr6, lport_arg, flags) else if (!IN6_ARE_ADDR_EQUAL(&in6p->in6p_laddr, laddr6)) continue; } -#ifndef TCP6 else if (IN6_IS_ADDR_V4MAPPED(&in6p->in6p_laddr) && in6p->in6p_laddr.s6_addr32[3] == 0) { if (!IN6_IS_ADDR_V4MAPPED(laddr6)) @@ -659,10 +658,9 @@ in6_pcblookup(head, faddr6, fport_arg, laddr6, lport_arg, flags) else wildcard++; } -#endif else { if (IN6_IS_ADDR_V4MAPPED(laddr6)) { -#if !defined(TCP6) && !defined(INET6_BINDV6ONLY) +#ifndef INET6_BINDV6ONLY if (in6p->in6p_flags & IN6P_BINDV6ONLY) continue; else @@ -680,7 +678,6 @@ in6_pcblookup(head, faddr6, fport_arg, laddr6, lport_arg, flags) || in6p->in6p_fport != fport) continue; } -#ifndef TCP6 else if (IN6_IS_ADDR_V4MAPPED(&in6p->in6p_faddr) && in6p->in6p_faddr.s6_addr32[3] == 0) { if (!IN6_IS_ADDR_V4MAPPED(faddr6)) @@ -690,10 +687,9 @@ in6_pcblookup(head, faddr6, fport_arg, laddr6, lport_arg, flags) else wildcard++; } -#endif else { if (IN6_IS_ADDR_V4MAPPED(faddr6)) { -#if !defined(TCP6) && !defined(INET6_BINDV6ONLY) +#ifndef INET6_BINDV6ONLY if (in6p->in6p_flags & IN6P_BINDV6ONLY) continue; else @@ -717,7 +713,6 @@ in6_pcblookup(head, faddr6, fport_arg, laddr6, lport_arg, flags) return(match); } -#ifndef TCP6 struct rtentry * in6_pcbrtentry(in6p) struct in6pcb *in6p; @@ -818,4 +813,3 @@ in6_pcblookup_bind(head, laddr6, lport_arg, faith) } return match; } -#endif diff --git a/sys/netinet6/in6_pcb.h b/sys/netinet6/in6_pcb.h index 6db92336be4b..b394d88200e7 100644 --- a/sys/netinet6/in6_pcb.h +++ b/sys/netinet6/in6_pcb.h @@ -1,4 +1,4 @@ -/* $NetBSD: in6_pcb.h,v 1.12 2000/07/07 15:54:18 itojun Exp $ */ +/* $NetBSD: in6_pcb.h,v 1.13 2000/10/19 20:23:02 itojun Exp $ */ /* $KAME: in6_pcb.h,v 1.28 2000/06/09 01:10:12 itojun Exp $ */ /* @@ -182,14 +182,12 @@ int in6_embedscope __P((struct in6_addr *, const struct sockaddr_in6 *, int in6_recoverscope __P((struct sockaddr_in6 *, const struct in6_addr *, struct ifnet *)); -#ifndef TCP6 extern struct rtentry * in6_pcbrtentry __P((struct in6pcb *)); extern struct in6pcb *in6_pcblookup_connect __P((struct in6pcb *, struct in6_addr *, u_int, struct in6_addr *, u_int, int)); extern struct in6pcb *in6_pcblookup_bind __P((struct in6pcb *, struct in6_addr *, u_int, int)); -#endif #endif /* _KERNEL */ #endif /* !_NETINET6_IN6_PCB_H_ */ diff --git a/sys/netinet6/in6_proto.c b/sys/netinet6/in6_proto.c index ef954ce8ee4f..e7e4f74ca7b7 100644 --- a/sys/netinet6/in6_proto.c +++ b/sys/netinet6/in6_proto.c @@ -1,4 +1,4 @@ -/* $NetBSD: in6_proto.c,v 1.22 2000/10/18 21:14:15 itojun Exp $ */ +/* $NetBSD: in6_proto.c,v 1.23 2000/10/19 20:23:02 itojun Exp $ */ /* $KAME: in6_proto.c,v 1.66 2000/10/10 15:35:47 itojun Exp $ */ /* @@ -83,19 +83,14 @@ #include #include #include -#ifndef TCP6 #include #include -#endif -#ifndef TCP6 #include -#endif #include #include #include #include -#ifndef TCP6 #include #include #include @@ -103,13 +98,6 @@ #include #include #include -#else -#include -#include -#include -#include -#include -#endif #include #include @@ -158,14 +146,6 @@ struct ip6protosw inet6sw[] = { 0, 0, 0, udp6_sysctl, }, -#ifdef TCP6 -{ SOCK_STREAM, &inet6domain, IPPROTO_TCP, PR_CONNREQUIRED|PR_WANTRCVD|PR_LISTEN, - tcp6_input, 0, tcp6_ctlinput, tcp6_ctloutput, - tcp6_usrreq, - tcp6_init, tcp6_fasttimo, tcp6_slowtimo, tcp6_drain, - tcp6_sysctl, -}, -#else { SOCK_STREAM, &inet6domain, IPPROTO_TCP, PR_CONNREQUIRED|PR_WANTRCVD|PR_LISTEN, tcp6_input, 0, tcp6_ctlinput, tcp_ctloutput, tcp_usrreq, @@ -176,7 +156,6 @@ struct ip6protosw inet6sw[] = { #endif tcp_sysctl, }, -#endif /*TCP6*/ { SOCK_RAW, &inet6domain, IPPROTO_RAW, PR_ATOMIC | PR_ADDR, rip6_input, rip6_output, rip6_ctlinput, rip6_ctloutput, rip6_usrreq, @@ -338,81 +317,6 @@ int icmp6_redirtimeout = 10 * 60; /* 10 minutes */ int icmp6errppslim = 100; /* 100pps */ int icmp6_nodeinfo = 1; /* enable/disable NI response */ -#ifdef TCP6 -/* TCP on IP6 parameters */ -int tcp6_sendspace = 1024 * 8; -int tcp6_recvspace = 1024 * 8; -int tcp6_mssdflt = TCP6_MSS; -int tcp6_rttdflt = TCP6TV_SRTTDFLT / PR_SLOWHZ; -int tcp6_do_rfc1323 = 1; -int tcp6_conntimeo = TCP6TV_KEEP_INIT; /* initial connection timeout */ -int tcp6_43maxseg = 0; -int tcp6_pmtu = 0; - -/* - * Parameters for keepalive option. - * Connections for which SO_KEEPALIVE is set will be probed - * after being idle for a time of tcp6_keepidle (in units of PR_SLOWHZ). - * Starting at that time, the connection is probed at intervals - * of tcp6_keepintvl (same units) until a response is received - * or until tcp6_keepcnt probes have been made, at which time - * the connection is dropped. Note that a tcp6_keepidle value - * under 2 hours is nonconformant with RFC-1122, Internet Host Requirements. - */ -int tcp6_keepidle = TCP6TV_KEEP_IDLE; /* time before probing idle */ -int tcp6_keepintvl = TCP6TV_KEEPINTVL; /* interval betwn idle probes */ -int tcp6_keepcnt = TCP6TV_KEEPCNT; /* max idle probes */ -int tcp6_maxpersistidle = TCP6TV_KEEP_IDLE; /* max idle time in persist */ - -#ifndef INET_SERVER -#define TCP6_LISTEN_HASH_SIZE 17 -#define TCP6_CONN_HASH_SIZE 97 -#define TCP6_SYN_HASH_SIZE 293 -#define TCP6_SYN_BUCKET_SIZE 35 -#else -#define TCP6_LISTEN_HASH_SIZE 97 -#define TCP6_CONN_HASH_SIZE 9973 -#define TCP6_SYN_HASH_SIZE 997 -#define TCP6_SYN_BUCKET_SIZE 35 -#endif -int tcp6_listen_hash_size = TCP6_LISTEN_HASH_SIZE; -int tcp6_conn_hash_size = TCP6_CONN_HASH_SIZE; -struct tcp6_hash_list tcp6_listen_hash[TCP6_LISTEN_HASH_SIZE], - tcp6_conn_hash[TCP6_CONN_HASH_SIZE]; - -int tcp6_syn_cache_size = TCP6_SYN_HASH_SIZE; -int tcp6_syn_cache_limit = TCP6_SYN_HASH_SIZE*TCP6_SYN_BUCKET_SIZE; -int tcp6_syn_bucket_limit = 3*TCP6_SYN_BUCKET_SIZE; -struct syn_cache_head6 tcp6_syn_cache[TCP6_SYN_HASH_SIZE]; -struct syn_cache_head6 *tcp6_syn_cache_first; -int tcp6_syn_cache_interval = 8; /* runs timer every 4 seconds */ -int tcp6_syn_cache_timeo = TCP6TV_KEEP_INIT; - -/* - * Parameters for computing a desirable data segment size - * given an upper bound (either interface MTU, or peer's MSS option)_. - * As applications tend to use a buffer size that is a multiple - * of kilobytes, try for something that divides evenly. However, - * do not round down too much. - * - * Round segment size down to a multiple of TCP6_ROUNDSIZE if this - * does not result in lowering by more than (size/TCP6_ROUNDFRAC). - * For example, round 536 to 512. Older versions of the system - * effectively used MCLBYTES (1K or 2K) as TCP6_ROUNDSIZE, with - * a value of 1 for TCP6_ROUNDFRAC (eliminating its effect). - * We round to a multiple of 256 for SLIP. - */ -#ifndef TCP6_ROUNDSIZE -#define TCP6_ROUNDSIZE 256 /* round to multiple of 256 */ -#endif -#ifndef TCP6_ROUNDFRAC -#define TCP6_ROUNDFRAC 10 /* round down at most N/10, or 10% */ -#endif - -int tcp6_roundsize = TCP6_ROUNDSIZE; -int tcp6_roundfrac = TCP6_ROUNDFRAC; -#endif /*TCP6*/ - /* UDP on IP6 parameters */ int udp6_sendspace = 9216; /* really max datagram size */ int udp6_recvspace = 40 * (1024 + sizeof(struct sockaddr_in6)); diff --git a/sys/netinet6/ipsec.h b/sys/netinet6/ipsec.h index 57f45d3ac43e..30c648f2c26d 100644 --- a/sys/netinet6/ipsec.h +++ b/sys/netinet6/ipsec.h @@ -1,4 +1,4 @@ -/* $NetBSD: ipsec.h,v 1.16 2000/09/22 16:55:04 itojun Exp $ */ +/* $NetBSD: ipsec.h,v 1.17 2000/10/19 20:23:02 itojun Exp $ */ /* $KAME: ipsec.h,v 1.36 2000/08/02 17:58:25 sakane Exp $ */ /* @@ -337,11 +337,7 @@ extern size_t ipsec4_hdrsiz __P((struct mbuf *, u_int, struct inpcb *)); extern size_t ipsec4_hdrsiz_tcp __P((struct tcpcb *)); #ifdef INET6 extern size_t ipsec6_hdrsiz __P((struct mbuf *, u_int, struct in6pcb *)); -#ifndef TCP6 extern size_t ipsec6_hdrsiz_tcp __P((struct tcpcb *)); -#else -extern size_t ipsec6_hdrsiz_tcp __P((struct tcp6cb *)); -#endif #endif struct ip;