From 06c350054d86ac916b6fd32bd406a30bf55d4a62 Mon Sep 17 00:00:00 2001 From: itojun Date: Fri, 30 Jul 1999 10:35:34 +0000 Subject: [PATCH] remove reference to in6_systm.h (file itself will be removed afterwords) --- sys/net/if_ppp.c | 75 ++++++++++++++++++++++++++++++++++-- sys/net/if_pppvar.h | 5 ++- sys/net/if_spppsubr.c | 29 +++++++++++++- sys/net/route.c | 14 +------ sys/net/route.h | 5 +-- sys/netinet/ip_ecn.c | 3 +- sys/netinet6/Makefile | 4 +- sys/netinet6/ah_core.c | 3 +- sys/netinet6/ah_input.c | 3 +- sys/netinet6/ah_output.c | 3 +- sys/netinet6/dest6.c | 3 +- sys/netinet6/frag6.c | 3 +- sys/netinet6/icmp6.c | 3 +- sys/netinet6/in6.c | 3 +- sys/netinet6/in6_gif.c | 3 +- sys/netinet6/in6_proto.c | 3 +- sys/netinet6/ip6_forward.c | 3 +- sys/netinet6/ip6_output.c | 3 +- sys/netinet6/ipcomp_input.c | 3 +- sys/netinet6/ipcomp_output.c | 3 +- sys/netinet6/ipsec.c | 3 +- sys/netinet6/nd6.c | 3 +- sys/netinet6/nd6_rtr.c | 3 +- sys/netinet6/raw_ip6.c | 3 +- sys/netinet6/udp6_usrreq.c | 3 +- 25 files changed, 126 insertions(+), 63 deletions(-) diff --git a/sys/net/if_ppp.c b/sys/net/if_ppp.c index da88943f0a0c..6810b4131ac8 100644 --- a/sys/net/if_ppp.c +++ b/sys/net/if_ppp.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_ppp.c,v 1.54 1999/07/01 08:12:48 itojun Exp $ */ +/* $NetBSD: if_ppp.c,v 1.55 1999/07/30 10:35:38 itojun Exp $ */ /* Id: if_ppp.c,v 1.6 1997/03/04 03:33:00 paulus Exp */ /* @@ -486,6 +486,9 @@ pppioctl(sc, cmd, data, flag, p) case PPP_IP: npx = NP_IP; break; + case PPP_IPV6: + npx = NP_IPV6; + break; default: return EINVAL; } @@ -601,13 +604,35 @@ pppsioctl(ifp, cmd, data) break; case SIOCSIFADDR: - if (ifa->ifa_addr->sa_family != AF_INET) + switch (ifa->ifa_addr->sa_family) { +#ifdef INET + case AF_INET: + break; +#endif +#ifdef INET6 + case AF_INET6: + break; +#endif + default: error = EAFNOSUPPORT; + break; + } break; case SIOCSIFDSTADDR: - if (ifa->ifa_addr->sa_family != AF_INET) + switch (ifa->ifa_addr->sa_family) { +#ifdef INET + case AF_INET: + break; +#endif +#ifdef INET6 + case AF_INET6: + break; +#endif + default: error = EAFNOSUPPORT; + break; + } break; case SIOCSIFMTU: @@ -630,6 +655,10 @@ pppsioctl(ifp, cmd, data) #ifdef INET case AF_INET: break; +#endif +#ifdef INET6 + case AF_INET6: + break; #endif default: error = EAFNOSUPPORT; @@ -720,6 +749,24 @@ pppoutput(ifp, m0, dst, rtp) if (ip->ip_tos & IPTOS_LOWDELAY) m0->m_flags |= M_HIGHPRI; break; +#endif +#ifdef INET6 + case AF_INET6: + address = PPP_ALLSTATIONS; /*XXX*/ + control = PPP_UI; /*XXX*/ + protocol = PPP_IPV6; + mode = sc->sc_npmode[NP_IPV6]; + +#if 0 /* XXX flowinfo/traffic class, maybe? */ + /* + * If this packet has the "low delay" bit set in the IP header, + * put it on the fastq instead. + */ + ip = mtod(m0, struct ip *); + if (ip->ip_tos & IPTOS_LOWDELAY) + m0->m_flags |= M_HIGHPRI; + break; +#endif #endif case AF_UNSPEC: address = PPP_ADDRESS(dst->sa_data); @@ -863,6 +910,9 @@ ppp_requeue(sc) case PPP_IP: mode = sc->sc_npmode[NP_IP]; break; + case PPP_IPV6: + mode = sc->sc_npmode[NP_IPV6]; + break; default: mode = NPMODE_PASS; } @@ -1470,6 +1520,25 @@ ppp_inproc(sc, m) break; #endif +#ifdef INET6 + case PPP_IPV6: + /* + * IPv6 packet - take off the ppp header and pass it up to IPv6. + */ + if ((ifp->if_flags & IFF_UP) == 0 + || sc->sc_npmode[NP_IPV6] != NPMODE_PASS) { + /* interface is down - drop the packet. */ + m_freem(m); + return; + } + m->m_pkthdr.len -= PPP_HDRLEN; + m->m_data += PPP_HDRLEN; + m->m_len -= PPP_HDRLEN; + schednetisr(NETISR_IPV6); + inq = &ip6intrq; + break; +#endif + default: /* * Some other protocol - place on input queue for read(). diff --git a/sys/net/if_pppvar.h b/sys/net/if_pppvar.h index d593092e4884..23caa43c456d 100644 --- a/sys/net/if_pppvar.h +++ b/sys/net/if_pppvar.h @@ -1,4 +1,4 @@ -/* $NetBSD: if_pppvar.h,v 1.9 1999/05/12 18:50:51 thorpej Exp $ */ +/* $NetBSD: if_pppvar.h,v 1.10 1999/07/30 10:35:38 itojun Exp $ */ /* Id: if_pppvar.h,v 1.3 1996/07/01 01:04:37 paulus Exp */ /* @@ -51,7 +51,8 @@ * indexing sc_npmode. */ #define NP_IP 0 /* Internet Protocol */ -#define NUM_NP 1 /* Number of NPs. */ +#define NP_IPV6 1 /* Internet Protocol version 6 */ +#define NUM_NP 2 /* Number of NPs. */ /* * Structure describing each ppp unit. diff --git a/sys/net/if_spppsubr.c b/sys/net/if_spppsubr.c index e74bfe93194f..145f229ad74b 100644 --- a/sys/net/if_spppsubr.c +++ b/sys/net/if_spppsubr.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_spppsubr.c,v 1.4 1999/04/04 06:57:03 explorer Exp $ */ +/* $NetBSD: if_spppsubr.c,v 1.5 1999/07/30 10:35:38 itojun Exp $ */ /* * Synchronous PPP/Cisco link level subroutines. @@ -130,6 +130,7 @@ #define PPP_ISO 0x0023 /* ISO OSI Protocol */ #define PPP_XNS 0x0025 /* Xerox NS Protocol */ #define PPP_IPX 0x002b /* Novell IPX Protocol */ +#define PPP_IPV6 0x0057 /* Internet Protocol version 6 */ #define PPP_LCP 0xc021 /* Link Control Protocol */ #define PPP_PAP 0xc023 /* Password Authentication Protocol */ #define PPP_CHAP 0xc223 /* Challenge-Handshake Auth Protocol */ @@ -680,6 +681,12 @@ sppp_output(struct ifnet *ifp, struct mbuf *m, } #endif +#ifdef INET6 + if (dst->sa_family == AF_INET6) { + /* XXX do something tricky here? */ + } +#endif + /* * Prepend general data packet PPP header. For now, IP only. */ @@ -726,6 +733,26 @@ sppp_output(struct ifnet *ifp, struct mbuf *m, } break; #endif +#ifdef INET6 + case AF_INET6: /* Internet Protocol version 6 */ + if (sp->pp_flags & PP_CISCO) + h->protocol = htons (ETHERTYPE_IPV6); + else { + /* + * Don't choke with an ENETDOWN early. It's + * possible that we just started dialing out, + * so don't drop the packet immediately. If + * we notice that we run out of buffer space + * below, we will however remember that we are + * not ready to carry IP packets, and return + * ENETDOWN, as opposed to ENOBUFS. + */ + h->protocol = htons(PPP_IPV6); + if (sp->state[IDX_IPCP] != STATE_OPENED) + rv = ENETDOWN; + } + break; +#endif #ifdef NS case AF_NS: /* Xerox NS Protocol */ h->protocol = htons ((sp->pp_flags & PP_CISCO) ? diff --git a/sys/net/route.c b/sys/net/route.c index f8c6381828db..acdef598e80c 100644 --- a/sys/net/route.c +++ b/sys/net/route.c @@ -1,4 +1,4 @@ -/* $NetBSD: route.c,v 1.25 1999/07/01 08:12:49 itojun Exp $ */ +/* $NetBSD: route.c,v 1.26 1999/07/30 10:35:39 itojun Exp $ */ /*- * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -168,18 +168,6 @@ rtalloc(ro) ro->ro_rt = rtalloc1(&ro->ro_dst, 1); } -#if 1 -/* for INET6 */ -void -rtcalloc(ro) - register struct route *ro; -{ - if (ro->ro_rt && ro->ro_rt->rt_ifp && (ro->ro_rt->rt_flags & RTF_UP)) - return; /* XXX */ - ro->ro_rt = rtalloc1(&ro->ro_dst, 0); -} -#endif - struct rtentry * rtalloc1(dst, report) register struct sockaddr *dst; diff --git a/sys/net/route.h b/sys/net/route.h index 2d722919c18e..e245fd16c4d3 100644 --- a/sys/net/route.h +++ b/sys/net/route.h @@ -1,4 +1,4 @@ -/* $NetBSD: route.h,v 1.18 1999/07/01 08:12:49 itojun Exp $ */ +/* $NetBSD: route.h,v 1.19 1999/07/30 10:35:39 itojun Exp $ */ /* * Copyright (c) 1980, 1986, 1993 @@ -297,9 +297,6 @@ void rt_timer_remove_all __P((struct rtentry *)); void rt_timer_timer __P((void *)); void rtable_init __P((void **)); void rtalloc __P((struct route *)); -#if 1 /*for INET6*/ -void rtcalloc __P((struct route *)); -#endif struct rtentry * rtalloc1 __P((struct sockaddr *, int)); void rtfree __P((struct rtentry *)); diff --git a/sys/netinet/ip_ecn.c b/sys/netinet/ip_ecn.c index 269f1df19588..58c9942aaa82 100644 --- a/sys/netinet/ip_ecn.c +++ b/sys/netinet/ip_ecn.c @@ -1,4 +1,4 @@ -/* $NetBSD: ip_ecn.c,v 1.4 1999/07/06 12:23:20 itojun Exp $ */ +/* $NetBSD: ip_ecn.c,v 1.5 1999/07/30 10:35:34 itojun Exp $ */ /* * Copyright (C) 1999 WIDE Project. @@ -55,7 +55,6 @@ #ifndef INET #include #endif -#include #include #endif diff --git a/sys/netinet6/Makefile b/sys/netinet6/Makefile index 22ad8e829917..874d852d4568 100644 --- a/sys/netinet6/Makefile +++ b/sys/netinet6/Makefile @@ -1,10 +1,10 @@ -# $NetBSD: Makefile,v 1.2 1999/07/01 08:12:52 itojun Exp $ +# $NetBSD: Makefile,v 1.3 1999/07/30 10:35:35 itojun Exp $ KDIR= /sys/netinet6 INCSDIR= /usr/include/netinet6 INCS= ah.h esp.h icmp6.h in6.h in6_gif.h in6_ifattach.h in6_pcb.h \ - in6_systm.h in6_var.h ip6.h ip6_mroute.h ip6_var.h ip6protosw.h \ + in6_var.h ip6.h ip6_mroute.h ip6_var.h ip6protosw.h \ ipcomp.h ipsec.h mld6_var.h nd6.h pim6.h pim6_var.h udp6.h udp6_var.h .include diff --git a/sys/netinet6/ah_core.c b/sys/netinet6/ah_core.c index a5eda3f228ff..19d7b87593e7 100644 --- a/sys/netinet6/ah_core.c +++ b/sys/netinet6/ah_core.c @@ -1,4 +1,4 @@ -/* $NetBSD: ah_core.c,v 1.6 1999/07/09 22:57:26 thorpej Exp $ */ +/* $NetBSD: ah_core.c,v 1.7 1999/07/30 10:35:35 itojun Exp $ */ /* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. @@ -69,7 +69,6 @@ #include #ifdef INET6 -#include #include #if !defined(__FreeBSD__) || __FreeBSD__ < 3 #include diff --git a/sys/netinet6/ah_input.c b/sys/netinet6/ah_input.c index 8c179ecd2c8c..d8cfbef49ca8 100644 --- a/sys/netinet6/ah_input.c +++ b/sys/netinet6/ah_input.c @@ -1,4 +1,4 @@ -/* $NetBSD: ah_input.c,v 1.4 1999/07/06 08:55:56 itojun Exp $ */ +/* $NetBSD: ah_input.c,v 1.5 1999/07/30 10:35:35 itojun Exp $ */ /* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. @@ -62,7 +62,6 @@ #include #ifdef INET6 -#include #include #if !defined(__FreeBSD__) || __FreeBSD__ < 3 #include diff --git a/sys/netinet6/ah_output.c b/sys/netinet6/ah_output.c index 3e1b946068fd..6f1de64aa0d6 100644 --- a/sys/netinet6/ah_output.c +++ b/sys/netinet6/ah_output.c @@ -1,4 +1,4 @@ -/* $NetBSD: ah_output.c,v 1.3 1999/07/03 21:30:17 thorpej Exp $ */ +/* $NetBSD: ah_output.c,v 1.4 1999/07/30 10:35:35 itojun Exp $ */ /* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. @@ -63,7 +63,6 @@ #include #ifdef INET6 -#include #include #if !defined(__FreeBSD__) || __FreeBSD__ < 3 #include diff --git a/sys/netinet6/dest6.c b/sys/netinet6/dest6.c index 3091f8bfc9e2..a2693e7c87b9 100644 --- a/sys/netinet6/dest6.c +++ b/sys/netinet6/dest6.c @@ -1,4 +1,4 @@ -/* $NetBSD: dest6.c,v 1.3 1999/07/03 21:30:17 thorpej Exp $ */ +/* $NetBSD: dest6.c,v 1.4 1999/07/30 10:35:35 itojun Exp $ */ /* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. @@ -45,7 +45,6 @@ #include #include -#include #include #if !defined(__FreeBSD__) || __FreeBSD__ < 3 #include diff --git a/sys/netinet6/frag6.c b/sys/netinet6/frag6.c index bc3582c4d669..006095b2a1e7 100644 --- a/sys/netinet6/frag6.c +++ b/sys/netinet6/frag6.c @@ -1,4 +1,4 @@ -/* $NetBSD: frag6.c,v 1.4 1999/07/04 02:01:15 itojun Exp $ */ +/* $NetBSD: frag6.c,v 1.5 1999/07/30 10:35:35 itojun Exp $ */ /* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. @@ -46,7 +46,6 @@ #include #include -#include #include #if !defined(__FreeBSD__) || __FreeBSD__ < 3 #include diff --git a/sys/netinet6/icmp6.c b/sys/netinet6/icmp6.c index ba8129672e66..01f8f7c5ee8e 100644 --- a/sys/netinet6/icmp6.c +++ b/sys/netinet6/icmp6.c @@ -1,4 +1,4 @@ -/* $NetBSD: icmp6.c,v 1.8 1999/07/22 12:56:57 itojun Exp $ */ +/* $NetBSD: icmp6.c,v 1.9 1999/07/30 10:35:35 itojun Exp $ */ /* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. @@ -87,7 +87,6 @@ #include #include -#include #include #include #include diff --git a/sys/netinet6/in6.c b/sys/netinet6/in6.c index 2f8ab4821c2a..d6e2c51ee276 100644 --- a/sys/netinet6/in6.c +++ b/sys/netinet6/in6.c @@ -1,4 +1,4 @@ -/* $NetBSD: in6.c,v 1.4 1999/07/04 02:01:15 itojun Exp $ */ +/* $NetBSD: in6.c,v 1.5 1999/07/30 10:35:36 itojun Exp $ */ /* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. @@ -103,7 +103,6 @@ #include #endif -#include #include #include #include diff --git a/sys/netinet6/in6_gif.c b/sys/netinet6/in6_gif.c index 09968e70a8fd..087579768852 100644 --- a/sys/netinet6/in6_gif.c +++ b/sys/netinet6/in6_gif.c @@ -1,4 +1,4 @@ -/* $NetBSD: in6_gif.c,v 1.4 1999/07/09 22:57:26 thorpej Exp $ */ +/* $NetBSD: in6_gif.c,v 1.5 1999/07/30 10:35:36 itojun Exp $ */ /* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. @@ -57,7 +57,6 @@ #ifdef INET #include #endif -#include #include #include #include diff --git a/sys/netinet6/in6_proto.c b/sys/netinet6/in6_proto.c index dd59940cda72..792ac2f16435 100644 --- a/sys/netinet6/in6_proto.c +++ b/sys/netinet6/in6_proto.c @@ -1,4 +1,4 @@ -/* $NetBSD: in6_proto.c,v 1.6 1999/07/27 06:23:57 explorer Exp $ */ +/* $NetBSD: in6_proto.c,v 1.7 1999/07/30 10:35:36 itojun Exp $ */ /* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. @@ -83,7 +83,6 @@ #include #include #include -#include #if (defined(__FreeBSD__) && __FreeBSD__ >= 3) || (defined(__NetBSD__) && !defined(TCP6)) #include #include diff --git a/sys/netinet6/ip6_forward.c b/sys/netinet6/ip6_forward.c index d6175799bf75..4cbfa7270634 100644 --- a/sys/netinet6/ip6_forward.c +++ b/sys/netinet6/ip6_forward.c @@ -1,4 +1,4 @@ -/* $NetBSD: ip6_forward.c,v 1.3 1999/07/03 21:30:18 thorpej Exp $ */ +/* $NetBSD: ip6_forward.c,v 1.4 1999/07/30 10:35:36 itojun Exp $ */ /* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. @@ -46,7 +46,6 @@ #include #include -#include #include #if !defined(__FreeBSD__) || __FreeBSD__ < 3 #include diff --git a/sys/netinet6/ip6_output.c b/sys/netinet6/ip6_output.c index b2897b5e3ef4..9fa61bb26960 100644 --- a/sys/netinet6/ip6_output.c +++ b/sys/netinet6/ip6_output.c @@ -1,4 +1,4 @@ -/* $NetBSD: ip6_output.c,v 1.6 1999/07/22 12:56:57 itojun Exp $ */ +/* $NetBSD: ip6_output.c,v 1.7 1999/07/30 10:35:36 itojun Exp $ */ /* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. @@ -87,7 +87,6 @@ #include #include -#include #include #include #if !defined(__FreeBSD__) || __FreeBSD__ < 3 diff --git a/sys/netinet6/ipcomp_input.c b/sys/netinet6/ipcomp_input.c index 45dfc4c77487..72ef4a56d9d9 100644 --- a/sys/netinet6/ipcomp_input.c +++ b/sys/netinet6/ipcomp_input.c @@ -1,4 +1,4 @@ -/* $NetBSD: ipcomp_input.c,v 1.4 1999/07/06 05:09:22 itojun Exp $ */ +/* $NetBSD: ipcomp_input.c,v 1.5 1999/07/30 10:35:37 itojun Exp $ */ /* * Copyright (C) 1999 WIDE Project. @@ -63,7 +63,6 @@ #include #ifdef INET6 -#include #include #if !defined(__FreeBSD__) || __FreeBSD__ < 3 #include diff --git a/sys/netinet6/ipcomp_output.c b/sys/netinet6/ipcomp_output.c index c533b576c589..4bbc9d4ae972 100644 --- a/sys/netinet6/ipcomp_output.c +++ b/sys/netinet6/ipcomp_output.c @@ -1,4 +1,4 @@ -/* $NetBSD: ipcomp_output.c,v 1.4 1999/07/06 05:09:22 itojun Exp $ */ +/* $NetBSD: ipcomp_output.c,v 1.5 1999/07/30 10:35:37 itojun Exp $ */ /* * Copyright (C) 1999 WIDE Project. @@ -63,7 +63,6 @@ #include #ifdef INET6 -#include #include #if !defined(__FreeBSD__) || __FreeBSD__ < 3 #include diff --git a/sys/netinet6/ipsec.c b/sys/netinet6/ipsec.c index 8ba7f6d192f9..5c66e04a6326 100644 --- a/sys/netinet6/ipsec.c +++ b/sys/netinet6/ipsec.c @@ -1,4 +1,4 @@ -/* $NetBSD: ipsec.c,v 1.7 1999/07/11 17:45:11 itojun Exp $ */ +/* $NetBSD: ipsec.c,v 1.8 1999/07/30 10:35:37 itojun Exp $ */ /* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. @@ -72,7 +72,6 @@ #include #ifdef INET6 -#include #include #include #include diff --git a/sys/netinet6/nd6.c b/sys/netinet6/nd6.c index cd1188df5618..8bc4d46d2b78 100644 --- a/sys/netinet6/nd6.c +++ b/sys/netinet6/nd6.c @@ -1,4 +1,4 @@ -/* $NetBSD: nd6.c,v 1.6 1999/07/06 12:23:22 itojun Exp $ */ +/* $NetBSD: nd6.c,v 1.7 1999/07/30 10:35:37 itojun Exp $ */ /* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. @@ -72,7 +72,6 @@ #include #include #endif /* __NetBSD__ */ -#include #include #include #include diff --git a/sys/netinet6/nd6_rtr.c b/sys/netinet6/nd6_rtr.c index 5eeab75dfad9..c8fb17ed4808 100644 --- a/sys/netinet6/nd6_rtr.c +++ b/sys/netinet6/nd6_rtr.c @@ -1,4 +1,4 @@ -/* $NetBSD: nd6_rtr.c,v 1.4 1999/07/04 02:01:15 itojun Exp $ */ +/* $NetBSD: nd6_rtr.c,v 1.5 1999/07/30 10:35:38 itojun Exp $ */ /* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. @@ -50,7 +50,6 @@ #include #include -#include #include #include #include diff --git a/sys/netinet6/raw_ip6.c b/sys/netinet6/raw_ip6.c index 983ea2ed5946..6915cb1dbd0a 100644 --- a/sys/netinet6/raw_ip6.c +++ b/sys/netinet6/raw_ip6.c @@ -1,4 +1,4 @@ -/* $NetBSD: raw_ip6.c,v 1.7 1999/07/19 18:37:19 itojun Exp $ */ +/* $NetBSD: raw_ip6.c,v 1.8 1999/07/30 10:35:38 itojun Exp $ */ /* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. @@ -84,7 +84,6 @@ #include #include -#include #include #include #include diff --git a/sys/netinet6/udp6_usrreq.c b/sys/netinet6/udp6_usrreq.c index 0bd4ca35a68a..0b4b0826c0f2 100644 --- a/sys/netinet6/udp6_usrreq.c +++ b/sys/netinet6/udp6_usrreq.c @@ -1,4 +1,4 @@ -/* $NetBSD: udp6_usrreq.c,v 1.5 1999/07/09 22:57:30 thorpej Exp $ */ +/* $NetBSD: udp6_usrreq.c,v 1.6 1999/07/30 10:35:38 itojun Exp $ */ /* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. @@ -85,7 +85,6 @@ #include #include -#include #include #include #include