head 1.101; access; symbols netbsd-10-0-RELEASE:1.101 netbsd-10-0-RC6:1.101 netbsd-10-0-RC5:1.101 netbsd-10-0-RC4:1.101 netbsd-10-0-RC3:1.101 netbsd-10-0-RC2:1.101 thorpej-ifq:1.101.0.14 thorpej-ifq-base:1.101 thorpej-altq-separation:1.101.0.12 thorpej-altq-separation-base:1.101 netbsd-10-0-RC1:1.101 netbsd-10:1.101.0.10 netbsd-10-base:1.101 bouyer-sunxi-drm:1.101.0.8 bouyer-sunxi-drm-base:1.101 netbsd-9-3-RELEASE:1.95.2.1 thorpej-i2c-spi-conf2:1.101.0.6 thorpej-i2c-spi-conf2-base:1.101 thorpej-futex2:1.101.0.4 thorpej-futex2-base:1.101 thorpej-cfargs2:1.101.0.2 thorpej-cfargs2-base:1.101 cjep_sun2x-base1:1.100 cjep_sun2x:1.100.0.10 cjep_sun2x-base:1.100 cjep_staticlib_x-base1:1.100 netbsd-9-2-RELEASE:1.95.2.1 cjep_staticlib_x:1.100.0.8 cjep_staticlib_x-base:1.100 thorpej-i2c-spi-conf:1.100.0.6 thorpej-i2c-spi-conf-base:1.101 thorpej-cfargs:1.100.0.4 thorpej-cfargs-base:1.100 thorpej-futex:1.100.0.2 thorpej-futex-base:1.100 netbsd-9-1-RELEASE:1.95.2.1 bouyer-xenpvh-base2:1.98 phil-wifi-20200421:1.98 bouyer-xenpvh-base1:1.98 phil-wifi-20200411:1.98 bouyer-xenpvh:1.98.0.6 bouyer-xenpvh-base:1.98 is-mlppp:1.98.0.4 is-mlppp-base:1.98 phil-wifi-20200406:1.98 netbsd-8-2-RELEASE:1.87.10.1 ad-namecache-base3:1.98 netbsd-9-0-RELEASE:1.95.2.1 netbsd-9-0-RC2:1.95.2.1 ad-namecache-base2:1.98 ad-namecache-base1:1.98 ad-namecache:1.98.0.2 ad-namecache-base:1.98 netbsd-9-0-RC1:1.95.2.1 phil-wifi-20191119:1.98 netbsd-9:1.95.0.2 netbsd-9-base:1.95 phil-wifi-20190609:1.95 netbsd-8-1-RELEASE:1.87.10.1 netbsd-8-1-RC1:1.87.10.1 isaki-audio2:1.94.0.2 isaki-audio2-base:1.94 pgoyette-compat-merge-20190127:1.90.2.3 pgoyette-compat-20190127:1.94 pgoyette-compat-20190118:1.94 pgoyette-compat-1226:1.94 pgoyette-compat-1126:1.93 pgoyette-compat-1020:1.93 pgoyette-compat-0930:1.93 pgoyette-compat-0906:1.93 netbsd-7-2-RELEASE:1.78.2.1 pgoyette-compat-0728:1.91 netbsd-8-0-RELEASE:1.87.10.1 phil-wifi:1.91.0.2 phil-wifi-base:1.91 pgoyette-compat-0625:1.91 netbsd-8-0-RC2:1.87.10.1 pgoyette-compat-0521:1.91 pgoyette-compat-0502:1.91 pgoyette-compat-0422:1.91 netbsd-8-0-RC1:1.87.10.1 pgoyette-compat-0415:1.90 pgoyette-compat-0407:1.90 pgoyette-compat-0330:1.90 pgoyette-compat-0322:1.90 pgoyette-compat-0315:1.90 netbsd-7-1-2-RELEASE:1.78.2.1 pgoyette-compat:1.90.0.2 pgoyette-compat-base:1.90 netbsd-7-1-1-RELEASE:1.78.2.1 tls-maxphys-base-20171202:1.87 matt-nb8-mediatek:1.87.0.14 matt-nb8-mediatek-base:1.87 nick-nhusb-base-20170825:1.87 perseant-stdc-iso10646:1.87.0.12 perseant-stdc-iso10646-base:1.87 netbsd-8:1.87.0.10 netbsd-8-base:1.87 prg-localcount2-base3:1.87 prg-localcount2-base2:1.87 prg-localcount2-base1:1.87 prg-localcount2:1.87.0.8 prg-localcount2-base:1.87 pgoyette-localcount-20170426:1.87 bouyer-socketcan-base1:1.87 jdolecek-ncq:1.87.0.6 jdolecek-ncq-base:1.87 pgoyette-localcount-20170320:1.87 netbsd-7-1:1.78.2.1.0.6 netbsd-7-1-RELEASE:1.78.2.1 netbsd-7-1-RC2:1.78.2.1 nick-nhusb-base-20170204:1.87 netbsd-7-nhusb-base-20170116:1.78.2.1 bouyer-socketcan:1.87.0.4 bouyer-socketcan-base:1.87 pgoyette-localcount-20170107:1.87 netbsd-7-1-RC1:1.78.2.1 nick-nhusb-base-20161204:1.87 pgoyette-localcount-20161104:1.87 netbsd-7-0-2-RELEASE:1.78.2.1 nick-nhusb-base-20161004:1.87 localcount-20160914:1.87 netbsd-7-nhusb:1.78.2.1.0.4 netbsd-7-nhusb-base:1.78.2.1 pgoyette-localcount-20160806:1.87 pgoyette-localcount-20160726:1.87 pgoyette-localcount:1.87.0.2 pgoyette-localcount-base:1.87 nick-nhusb-base-20160907:1.87 nick-nhusb-base-20160529:1.87 netbsd-7-0-1-RELEASE:1.78.2.1 nick-nhusb-base-20160422:1.87 nick-nhusb-base-20160319:1.87 nick-nhusb-base-20151226:1.86 netbsd-7-0:1.78.2.1.0.2 netbsd-7-0-RELEASE:1.78.2.1 nick-nhusb-base-20150921:1.85 netbsd-7-0-RC3:1.78.2.1 netbsd-7-0-RC2:1.78.2.1 netbsd-7-0-RC1:1.78.2.1 nick-nhusb-base-20150606:1.84 nick-nhusb-base-20150406:1.83 nick-nhusb:1.79.0.2 nick-nhusb-base:1.79 netbsd-5-2-3-RELEASE:1.66 netbsd-5-1-5-RELEASE:1.66 netbsd-6-0-6-RELEASE:1.69 netbsd-6-1-5-RELEASE:1.69 netbsd-7:1.78.0.2 netbsd-7-base:1.78 yamt-pagecache-base9:1.75 yamt-pagecache-tag8:1.69.4.1 netbsd-6-1-4-RELEASE:1.69 netbsd-6-0-5-RELEASE:1.69 tls-earlyentropy:1.75.0.2 tls-earlyentropy-base:1.78 riastradh-xf86-video-intel-2-7-1-pre-2-21-15:1.75 riastradh-drm2-base3:1.75 netbsd-6-1-3-RELEASE:1.69 netbsd-6-0-4-RELEASE:1.69 netbsd-5-2-2-RELEASE:1.66 netbsd-5-1-4-RELEASE:1.66 netbsd-6-1-2-RELEASE:1.69 netbsd-6-0-3-RELEASE:1.69 netbsd-5-2-1-RELEASE:1.66 netbsd-5-1-3-RELEASE:1.66 rmind-smpnet-nbase:1.75 netbsd-6-1-1-RELEASE:1.69 riastradh-drm2-base2:1.73 riastradh-drm2-base1:1.73 riastradh-drm2:1.73.0.4 riastradh-drm2-base:1.73 rmind-smpnet:1.73.0.2 rmind-smpnet-base:1.75 netbsd-6-1:1.69.0.16 netbsd-6-0-2-RELEASE:1.69 netbsd-6-1-RELEASE:1.69 khorben-n900:1.71.0.2 netbsd-6-1-RC4:1.69 netbsd-6-1-RC3:1.69 agc-symver:1.70.0.6 agc-symver-base:1.70 netbsd-6-1-RC2:1.69 netbsd-6-1-RC1:1.69 yamt-pagecache-base8:1.70 netbsd-5-2:1.66.0.34 netbsd-6-0-1-RELEASE:1.69 yamt-pagecache-base7:1.70 netbsd-5-2-RELEASE:1.66 netbsd-5-2-RC1:1.66 matt-nb6-plus-nbase:1.69 yamt-pagecache-base6:1.70 netbsd-6-0:1.69.0.14 netbsd-6-0-RELEASE:1.69 netbsd-6-0-RC2:1.69 tls-maxphys:1.70.0.2 tls-maxphys-base:1.78 matt-nb6-plus:1.69.0.12 matt-nb6-plus-base:1.69 netbsd-6-0-RC1:1.69 jmcneill-usbmp-base10:1.69 yamt-pagecache-base5:1.69 jmcneill-usbmp-base9:1.69 yamt-pagecache-base4:1.69 jmcneill-usbmp-base8:1.69 jmcneill-usbmp-base7:1.69 jmcneill-usbmp-base6:1.69 jmcneill-usbmp-base5:1.69 jmcneill-usbmp-base4:1.69 jmcneill-usbmp-base3:1.69 jmcneill-usbmp-pre-base2:1.69 jmcneill-usbmp-base2:1.69 netbsd-6:1.69.0.10 netbsd-6-base:1.69 netbsd-5-1-2-RELEASE:1.66 netbsd-5-1-1-RELEASE:1.66 jmcneill-usbmp:1.69.0.8 jmcneill-usbmp-base:1.69 jmcneill-audiomp3:1.69.0.6 jmcneill-audiomp3-base:1.69 yamt-pagecache-base3:1.69 yamt-pagecache-base2:1.69 yamt-pagecache:1.69.0.4 yamt-pagecache-base:1.69 rmind-uvmplock-nbase:1.69 cherry-xenmp:1.69.0.2 cherry-xenmp-base:1.69 bouyer-quota2-nbase:1.68 bouyer-quota2:1.68.0.8 bouyer-quota2-base:1.68 jruoho-x86intr:1.68.0.6 jruoho-x86intr-base:1.68 matt-mips64-premerge-20101231:1.68 matt-nb5-mips64-premerge-20101231:1.66 matt-nb5-pq3:1.66.0.32 matt-nb5-pq3-base:1.66 netbsd-5-1:1.66.0.30 netbsd-5-1-RELEASE:1.66 uebayasi-xip-base4:1.68 uebayasi-xip-base3:1.68 yamt-nfs-mp-base11:1.68 netbsd-5-1-RC4:1.66 matt-nb5-mips64-k15:1.66 uebayasi-xip-base2:1.68 yamt-nfs-mp-base10:1.68 netbsd-5-1-RC3:1.66 netbsd-5-1-RC2:1.66 uebayasi-xip-base1:1.68 netbsd-5-1-RC1:1.66 rmind-uvmplock:1.68.0.4 rmind-uvmplock-base:1.69 yamt-nfs-mp-base9:1.68 uebayasi-xip:1.68.0.2 uebayasi-xip-base:1.68 netbsd-5-0-2-RELEASE:1.66 matt-nb5-mips64-premerge-20091211:1.66 matt-premerge-20091211:1.68 yamt-nfs-mp-base8:1.68 matt-nb5-mips64-u2-k2-k4-k7-k8-k9:1.66 matt-nb4-mips64-k7-u2a-k9b:1.66 matt-nb5-mips64-u1-k1-k5:1.66 yamt-nfs-mp-base7:1.66 matt-nb5-mips64:1.66.0.28 netbsd-5-0-1-RELEASE:1.66 jymxensuspend-base:1.66 yamt-nfs-mp-base6:1.66 yamt-nfs-mp-base5:1.66 yamt-nfs-mp-base4:1.66 jym-xensuspend-nbase:1.68 yamt-nfs-mp-base3:1.66 nick-hppapmap-base4:1.66 nick-hppapmap-base3:1.66 netbsd-5-0:1.66.0.26 netbsd-5-0-RELEASE:1.66 netbsd-5-0-RC4:1.66 netbsd-5-0-RC3:1.66 nick-hppapmap-base2:1.66 netbsd-5-0-RC2:1.66 jym-xensuspend:1.66.0.24 jym-xensuspend-base:1.66 netbsd-5-0-RC1:1.66 haad-dm-base2:1.66 haad-nbase2:1.66 ad-audiomp2:1.66.0.22 ad-audiomp2-base:1.66 netbsd-5:1.66.0.20 netbsd-5-base:1.66 nick-hppapmap:1.66.0.18 nick-hppapmap-base:1.66 matt-mips64-base2:1.66 matt-mips64:1.61.0.10 haad-dm-base1:1.66 wrstuden-revivesa-base-4:1.66 netbsd-4-0-1-RELEASE:1.57 wrstuden-revivesa-base-3:1.66 wrstuden-revivesa-base-2:1.66 wrstuden-fixsa-newbase:1.57 nick-csl-alignment-base5:1.62 haad-dm:1.66.0.16 haad-dm-base:1.66 wrstuden-revivesa-base-1:1.66 simonb-wapbl-nbase:1.66 yamt-pf42-base4:1.66 simonb-wapbl:1.66.0.14 simonb-wapbl-base:1.66 yamt-pf42-base3:1.66 hpcarm-cleanup-nbase:1.66 yamt-pf42-baseX:1.66 yamt-pf42-base2:1.66 yamt-nfs-mp-base2:1.66 wrstuden-revivesa:1.66.0.12 wrstuden-revivesa-base:1.66 yamt-nfs-mp:1.66.0.10 yamt-nfs-mp-base:1.66 yamt-pf42:1.66.0.8 yamt-pf42-base:1.66 ad-socklock-base1:1.66 yamt-lazymbuf-base15:1.66 yamt-lazymbuf-base14:1.66 keiichi-mipv6-nbase:1.66 mjf-devfs2:1.66.0.6 mjf-devfs2-base:1.66 nick-net80211-sync:1.66.0.4 nick-net80211-sync-base:1.66 keiichi-mipv6:1.66.0.2 keiichi-mipv6-base:1.66 bouyer-xeni386-merge1:1.65.8.1 matt-armv6-prevmlocking:1.61.8.1 wrstuden-fixsa-base-1:1.57 vmlocking2-base3:1.66 netbsd-4-0:1.57.0.8 netbsd-4-0-RELEASE:1.57 bouyer-xeni386-nbase:1.66 yamt-kmem-base3:1.65 cube-autoconf:1.65.0.10 cube-autoconf-base:1.65 yamt-kmem-base2:1.65 bouyer-xeni386:1.65.0.8 bouyer-xeni386-base:1.66 yamt-kmem:1.65.0.6 yamt-kmem-base:1.65 vmlocking2-base2:1.65 reinoud-bufcleanup-nbase:1.65 vmlocking2:1.65.0.4 vmlocking2-base1:1.65 netbsd-4-0-RC5:1.57 matt-nb4-arm:1.57.0.6 matt-nb4-arm-base:1.57 matt-armv6-nbase:1.66 jmcneill-base:1.65 netbsd-4-0-RC4:1.57 mjf-devfs:1.65.0.2 mjf-devfs-base:1.66 bouyer-xenamd64-base2:1.65 vmlocking-nbase:1.65 yamt-x86pmap-base4:1.63 bouyer-xenamd64:1.63.0.2 bouyer-xenamd64-base:1.65 netbsd-4-0-RC3:1.57 yamt-x86pmap-base3:1.63 yamt-x86pmap-base2:1.62 netbsd-4-0-RC2:1.57 yamt-x86pmap:1.62.0.2 yamt-x86pmap-base:1.62 netbsd-4-0-RC1:1.57 matt-armv6:1.61.0.8 matt-armv6-base:1.66 matt-mips64-base:1.61 jmcneill-pm:1.61.0.6 jmcneill-pm-base:1.65 hpcarm-cleanup:1.61.0.4 hpcarm-cleanup-base:1.66 nick-csl-alignment:1.61.0.2 nick-csl-alignment-base:1.61 netbsd-3-1-1-RELEASE:1.45 netbsd-3-0-3-RELEASE:1.45 yamt-idlelwp-base8:1.60 wrstuden-fixsa:1.57.0.4 wrstuden-fixsa-base:1.57 thorpej-atomic:1.59.0.10 thorpej-atomic-base:1.59 reinoud-bufcleanup:1.59.0.8 reinoud-bufcleanup-base:1.65 mjf-ufs-trans:1.59.0.6 mjf-ufs-trans-base:1.61 vmlocking:1.59.0.4 vmlocking-base:1.63 ad-audiomp:1.59.0.2 ad-audiomp-base:1.59 yamt-idlelwp:1.58.0.2 post-newlock2-merge:1.57 newlock2-nbase:1.57 yamt-splraiseipl-base5:1.57 yamt-splraiseipl-base4:1.57 yamt-splraiseipl-base3:1.57 abandoned-netbsd-4-base:1.56 abandoned-netbsd-4:1.56.0.4 netbsd-3-1:1.45.0.16 netbsd-3-1-RELEASE:1.45 netbsd-3-0-2-RELEASE:1.45 yamt-splraiseipl-base2:1.56 netbsd-3-1-RC4:1.45 yamt-splraiseipl:1.56.0.8 yamt-splraiseipl-base:1.56 netbsd-3-1-RC3:1.45 yamt-pdpolicy-base9:1.56 newlock2:1.56.0.6 newlock2-base:1.57 yamt-pdpolicy-base8:1.56 netbsd-3-1-RC2:1.45 netbsd-3-1-RC1:1.45 yamt-pdpolicy-base7:1.56 netbsd-4:1.57.0.2 netbsd-4-base:1.57 yamt-pdpolicy-base6:1.56 chap-midi-nbase:1.56 netbsd-3-0-1-RELEASE:1.45 gdamore-uart:1.56.0.2 gdamore-uart-base:1.56 simonb-timcounters-final:1.51.4.3 yamt-pdpolicy-base5:1.55 chap-midi:1.55.0.2 chap-midi-base:1.56 yamt-pdpolicy-base4:1.53 yamt-pdpolicy-base3:1.53 peter-altq-base:1.52 peter-altq:1.52.0.6 yamt-pdpolicy-base2:1.52 elad-kernelauth-base:1.55 elad-kernelauth:1.52.0.4 yamt-pdpolicy:1.52.0.2 yamt-pdpolicy-base:1.52 yamt-uio_vmspace-base5:1.52 simonb-timecounters:1.51.0.4 simonb-timecounters-base:1.55 rpaulo-netinet-merge-pcb:1.51.0.2 rpaulo-netinet-merge-pcb-base:1.56 yamt-uio_vmspace:1.50.0.2 netbsd-3-0:1.45.0.14 netbsd-3-0-RELEASE:1.45 netbsd-3-0-RC6:1.45 yamt-readahead-base3:1.47 netbsd-3-0-RC5:1.45 netbsd-3-0-RC4:1.45 netbsd-3-0-RC3:1.45 yamt-readahead-base2:1.47 netbsd-3-0-RC2:1.45 yamt-readahead-pervnode:1.47 yamt-readahead-perfile:1.47 yamt-readahead:1.47.0.6 yamt-readahead-base:1.47 netbsd-3-0-RC1:1.45 yamt-vop-base3:1.47 netbsd-2-0-3-RELEASE:1.44.2.1 netbsd-2-1:1.44.2.1.0.4 yamt-vop-base2:1.47 thorpej-vnode-attr:1.47.0.4 thorpej-vnode-attr-base:1.47 netbsd-2-1-RELEASE:1.44.2.1 yamt-vop:1.47.0.2 yamt-vop-base:1.47 netbsd-2-1-RC6:1.44.2.1 netbsd-2-1-RC5:1.44.2.1 netbsd-2-1-RC4:1.44.2.1 netbsd-2-1-RC3:1.44.2.1 netbsd-2-1-RC2:1.44.2.1 netbsd-2-1-RC1:1.44.2.1 yamt-lazymbuf:1.45.0.12 yamt-km-base4:1.45 netbsd-2-0-2-RELEASE:1.44.2.1 yamt-km-base3:1.45 netbsd-3:1.45.0.10 netbsd-3-base:1.45 yamt-km-base2:1.45 yamt-km:1.45.0.6 yamt-km-base:1.45 kent-audio2:1.45.0.4 kent-audio2-base:1.45 netbsd-2-0-1-RELEASE:1.44.2.1 kent-audio1-beforemerge:1.45 netbsd-2:1.44.2.1.0.2 netbsd-2-base:1.44.2.1 kent-audio1:1.45.0.2 kent-audio1-base:1.45 netbsd-2-0-RELEASE:1.44.2.1 netbsd-2-0-RC5:1.44.2.1 netbsd-2-0-RC4:1.44.2.1 netbsd-2-0-RC3:1.44.2.1 netbsd-2-0-RC2:1.44.2.1 netbsd-2-0-RC1:1.44.2.1 netbsd-2-0:1.44.0.2 netbsd-2-0-base:1.44 netbsd-1-6-PATCH002-RELEASE:1.39 netbsd-1-6-PATCH002:1.39 netbsd-1-6-PATCH002-RC4:1.39 netbsd-1-6-PATCH002-RC3:1.39 netbsd-1-6-PATCH002-RC2:1.39 netbsd-1-6-PATCH002-RC1:1.39 ktrace-lwp:1.42.0.2 ktrace-lwp-base:1.48 netbsd-1-6-PATCH001:1.39 netbsd-1-6-PATCH001-RELEASE:1.39 netbsd-1-6-PATCH001-RC3:1.39 netbsd-1-6-PATCH001-RC2:1.39 netbsd-1-6-PATCH001-RC1:1.39 nathanw_sa_end:1.24.2.7 nathanw_sa_before_merge:1.41 fvdl_fs64_base:1.41 gmcgarry_ctxsw:1.41.0.4 gmcgarry_ctxsw_base:1.41 gmcgarry_ucred:1.41.0.2 gmcgarry_ucred_base:1.41 nathanw_sa_base:1.41 kqueue-aftermerge:1.41 kqueue-beforemerge:1.41 netbsd-1-6-RELEASE:1.39 netbsd-1-6-RC3:1.39 netbsd-1-6-RC2:1.39 netbsd-1-6-RC1:1.39 netbsd-1-6:1.39.0.4 netbsd-1-6-base:1.39 gehenna-devsw:1.39.0.2 gehenna-devsw-base:1.41 netbsd-1-5-PATCH003:1.15.2.4 eeh-devprop:1.33.0.6 eeh-devprop-base:1.33 newlock:1.33.0.4 newlock-base:1.33 ifpoll-base:1.33 thorpej-mips-cache:1.30.0.2 thorpej-mips-cache-base:1.31 thorpej-devvp-base3:1.27 thorpej-devvp-base2:1.27 post-chs-ubcperf:1.27 pre-chs-ubcperf:1.27 thorpej-devvp:1.27.0.2 thorpej-devvp-base:1.27 netbsd-1-5-PATCH002:1.15.2.4 kqueue:1.26.0.2 kqueue-base:1.41 netbsd-1-5-PATCH001:1.15.2.4 thorpej_scsipi_beforemerge:1.25 nathanw_sa:1.24.0.2 thorpej_scsipi_nbase:1.25 netbsd-1-5-RELEASE:1.15.2.4 netbsd-1-5-BETA2:1.15.2.4 netbsd-1-5-BETA:1.15.2.4 netbsd-1-5-ALPHA2:1.15.2.1 netbsd-1-5:1.15.0.2 netbsd-1-5-base:1.15 minoura-xpg4dl-base:1.14 minoura-xpg4dl:1.14.0.2 chs-ubc2-newbase:1.10 wrstuden-devbsize-19991221:1.7 wrstuden-devbsize:1.6.0.8 wrstuden-devbsize-base:1.7 kame_141_19991130:1.1.2.3 comdex-fall-1999:1.6.0.6 comdex-fall-1999-base:1.6 fvdl-softdep:1.6.0.4 fvdl-softdep-base:1.6 thorpej_scsipi:1.6.0.2 thorpej_scsipi_base:1.25 kame_14_19990705:1.1.2.2 chs-ubc2-base:1.6 chs-ubc2:1.2.0.2 kame_14_19990628:1.1.2.1 kame:1.1.0.2; locks; strict; comment @ * @; 1.101 date 2021.07.31.10.12.04; author andvar; state Exp; branches; next 1.100; commitid SgP28Sr41S1HP73D; 1.100 date 2020.09.08.14.12.57; author christos; state Exp; branches 1.100.6.1; next 1.99; commitid WOZhEYjywKgEDfnC; 1.99 date 2020.06.12.11.04.45; author roy; state Exp; branches; next 1.98; commitid OaWPbwiyPUMQnVbC; 1.98 date 2019.11.01.04.28.14; author knakahara; state Exp; branches; next 1.97; commitid jItQdrXcOfN8r6JB; 1.97 date 2019.10.30.03.45.59; author knakahara; state Exp; branches; next 1.96; commitid WnDVgWd7NHbVfQIB; 1.96 date 2019.09.05.20.17.27; author kamil; state Exp; branches; next 1.95; commitid Ig3xnLurtx2HtRBB; 1.95 date 2019.05.28.03.56.46; author kamil; state Exp; branches 1.95.2.1; next 1.94; commitid YrUzDYl5zfcjiVoB; 1.94 date 2018.12.10.16.28.52; author christos; state Exp; branches; next 1.93; commitid cNtN6uaeBkk4Ug3B; 1.93 date 2018.08.22.01.05.24; author msaitoh; state Exp; branches; next 1.92; commitid m0ckT5Lro3Ypk3PA; 1.92 date 2018.08.10.06.46.09; author maxv; state Exp; branches; next 1.91; commitid 2Hk30Ju0agPeBxNA; 1.91 date 2018.04.19.21.22.02; author christos; state Exp; branches 1.91.2.1; next 1.90; commitid pX6pMfhovs0356zA; 1.90 date 2018.02.09.18.31.52; author maxv; state Exp; branches 1.90.2.1; next 1.89; commitid wexhsn2lkw4amdqA; 1.89 date 2018.01.30.15.54.02; author maxv; state Exp; branches; next 1.88; commitid 3lxTnqYKC4bTNUoA; 1.88 date 2018.01.10.10.56.30; author knakahara; state Exp; branches; next 1.87; commitid yPVdtArNvCmzNjmA; 1.87 date 2016.02.15.14.59.03; author rtr; state Exp; branches 1.87.10.1; next 1.86; 1.86 date 2015.12.12.23.34.25; author christos; state Exp; branches; next 1.85; 1.85 date 2015.08.07.08.11.33; author ozaki-r; state Exp; branches; next 1.84; 1.84 date 2015.04.22.19.46.08; author roy; state Exp; branches; next 1.83; 1.83 date 2015.02.20.22.13.48; author rjs; state Exp; branches; next 1.82; 1.82 date 2015.01.20.21.27.36; author roy; state Exp; branches; next 1.81; 1.81 date 2014.12.02.20.25.48; author christos; state Exp; branches; next 1.80; 1.80 date 2014.12.02.19.36.58; author christos; state Exp; branches; next 1.79; 1.79 date 2014.10.12.19.02.18; author christos; state Exp; branches 1.79.2.1; next 1.78; 1.78 date 2014.06.05.23.48.16; author rmind; state Exp; branches 1.78.2.1; next 1.77; 1.77 date 2014.06.05.16.06.49; author roy; state Exp; branches; next 1.76; 1.76 date 2014.05.30.01.39.03; author christos; state Exp; branches; next 1.75; 1.75 date 2013.10.19.15.44.29; author christos; state Exp; branches 1.75.2.1; next 1.74; 1.74 date 2013.10.19.00.09.03; author christos; state Exp; branches; next 1.73; 1.73 date 2013.06.20.13.56.29; author roy; state Exp; branches 1.73.2.1; next 1.72; 1.72 date 2013.06.11.12.08.29; author roy; state Exp; branches; next 1.71; 1.71 date 2013.04.27.21.35.24; author joerg; state Exp; branches; next 1.70; 1.70 date 2012.06.22.14.54.35; author christos; state Exp; branches 1.70.2.1; next 1.69; 1.69 date 2011.05.24.18.07.11; author spz; state Exp; branches 1.69.4.1; next 1.68; 1.68 date 2009.09.11.22.06.29; author dyoung; state Exp; branches 1.68.4.1 1.68.6.1; next 1.67; 1.67 date 2009.08.19.18.52.48; author seanb; state Exp; branches; next 1.66; 1.66 date 2007.12.25.18.33.47; author perry; state Exp; branches 1.66.2.1 1.66.10.1; next 1.65; 1.65 date 2007.11.01.20.33.56; author dyoung; state Exp; branches 1.65.2.1 1.65.4.1 1.65.8.1; next 1.64; 1.64 date 2007.10.24.06.37.21; author dyoung; state Exp; branches; next 1.63; 1.63 date 2007.10.07.12.43.19; author joerg; state Exp; branches 1.63.2.1; next 1.62; 1.62 date 2007.08.30.02.17.37; author dyoung; state Exp; branches 1.62.2.1; next 1.61; 1.61 date 2007.06.28.21.03.47; author christos; state Exp; branches 1.61.2.1 1.61.6.1 1.61.8.1; next 1.60; 1.60 date 2007.05.02.20.40.26; author dyoung; state Exp; branches; next 1.59; 1.59 date 2007.02.17.22.34.13; author dyoung; state Exp; branches 1.59.4.1 1.59.6.1; next 1.58; 1.58 date 2007.02.15.16.28.37; author seanb; state Exp; branches 1.58.2.1; next 1.57; 1.57 date 2006.10.31.00.29.30; author cbiere; state Exp; branches; next 1.56; 1.56 date 2006.06.07.22.34.03; author kardel; state Exp; branches 1.56.6.1 1.56.8.1; next 1.55; 1.55 date 2006.05.07.23.41.17; author rpaulo; state Exp; branches 1.55.2.1; next 1.54; 1.54 date 2006.05.05.00.03.22; author rpaulo; state Exp; branches; next 1.53; 1.53 date 2006.03.29.21.29.59; author dyoung; state Exp; branches; next 1.52; 1.52 date 2006.02.16.20.17.20; author perry; state Exp; branches 1.52.2.1 1.52.4.1 1.52.6.1; next 1.51; 1.51 date 2006.01.21.00.15.36; author rpaulo; state Exp; branches 1.51.2.1 1.51.4.1; next 1.50; 1.50 date 2005.12.24.20.45.09; author perry; state Exp; branches 1.50.2.1; next 1.49; 1.49 date 2005.12.20.19.32.58; author christos; state Exp; branches; next 1.48; 1.48 date 2005.12.10.23.39.56; author elad; state Exp; branches; next 1.47; 1.47 date 2005.08.28.21.01.53; author rpaulo; state Exp; branches; next 1.46; 1.46 date 2005.08.10.12.58.37; author yamt; state Exp; branches; next 1.45; 1.45 date 2004.06.11.04.10.10; author itojun; state Exp; branches 1.45.12.1; next 1.44; 1.44 date 2003.11.12.15.25.19; author itojun; state Exp; branches 1.44.2.1; next 1.43; 1.43 date 2003.08.07.16.33.24; author agc; state Exp; branches; next 1.42; 1.42 date 2003.04.28.23.16.27; author bjh21; state Exp; branches 1.42.2.1; next 1.41; 1.41 date 2002.06.08.21.22.31; author itojun; state Exp; branches; next 1.40; 1.40 date 2002.05.28.03.04.06; author itojun; state Exp; branches; next 1.39; 1.39 date 2002.05.14.10.27.28; author itojun; state Exp; branches 1.39.2.1 1.39.4.1; next 1.38; 1.38 date 2002.05.13.15.20.30; author kleink; state Exp; branches; next 1.37; 1.37 date 2002.05.13.14.25.13; author kleink; state Exp; branches; next 1.36; 1.36 date 2002.05.13.14.15.34; author kleink; state Exp; branches; next 1.35; 1.35 date 2002.05.13.13.52.31; author kleink; state Exp; branches; next 1.34; 1.34 date 2002.05.12.23.04.15; author kleink; state Exp; branches; next 1.33; 1.33 date 2001.12.21.08.54.54; author itojun; state Exp; branches; next 1.32; 1.32 date 2001.11.17.18.55.11; author perry; state Exp; branches; next 1.31; 1.31 date 2001.10.24.06.36.38; author itojun; state Exp; branches; next 1.30; 1.30 date 2001.10.18.07.44.34; author itojun; state Exp; branches 1.30.2.1; next 1.29; 1.29 date 2001.10.16.04.17.54; author itojun; state Exp; branches; next 1.28; 1.28 date 2001.10.15.09.51.16; author itojun; state Exp; branches; next 1.27; 1.27 date 2001.07.24.00.44.36; author itojun; state Exp; branches; next 1.26; 1.26 date 2001.06.02.16.17.11; author thorpej; state Exp; branches 1.26.2.1; next 1.25; 1.25 date 2001.03.30.05.53.52; author itojun; state Exp; branches; next 1.24; 1.24 date 2001.03.02.04.55.40; author itojun; state Exp; branches 1.24.2.1; next 1.23; 1.23 date 2001.03.02.04.52.54; author itojun; state Exp; branches; next 1.22; 1.22 date 2001.02.11.06.49.52; author itojun; state Exp; branches; next 1.21; 1.21 date 2000.10.17.21.46.42; author itojun; state Exp; branches; next 1.20; 1.20 date 2000.08.27.01.02.48; author itojun; state Exp; branches; next 1.19; 1.19 date 2000.08.26.11.03.46; author itojun; state Exp; branches; next 1.18; 1.18 date 2000.07.16.01.10.34; author itojun; state Exp; branches; next 1.17; 1.17 date 2000.07.06.17.42.55; author christos; state Exp; branches; next 1.16; 1.16 date 2000.06.26.15.48.20; author kleink; state Exp; branches; next 1.15; 1.15 date 2000.06.08.19.01.44; author danw; state Exp; branches 1.15.2.1; next 1.14; 1.14 date 2000.05.24.14.40.09; author itojun; state Exp; branches 1.14.2.1; next 1.13; 1.13 date 2000.02.28.12.08.22; author itojun; state Exp; branches; next 1.12; 1.12 date 2000.02.19.17.32.07; author itojun; state Exp; branches; next 1.11; 1.11 date 2000.02.17.10.59.39; author darrenr; state Exp; branches; next 1.10; 1.10 date 2000.02.09.00.54.56; author itojun; state Exp; branches; next 1.9; 1.9 date 2000.01.06.15.46.09; author itojun; state Exp; branches; next 1.8; 1.8 date 2000.01.06.06.41.19; author itojun; state Exp; branches; next 1.7; 1.7 date 99.12.13.15.17.22; author itojun; state Exp; branches; next 1.6; 1.6 date 99.07.06.12.23.22; author itojun; state Exp; branches 1.6.2.1 1.6.8.1; next 1.5; 1.5 date 99.07.03.21.30.18; author thorpej; state Exp; branches; next 1.4; 1.4 date 99.07.03.14.04.57; author kleink; state Exp; branches; next 1.3; 1.3 date 99.07.02.08.46.48; author itojun; state Exp; branches; next 1.2; 1.2 date 99.07.01.08.12.53; author itojun; state Exp; branches 1.2.2.1; next 1.1; 1.1 date 99.06.28.06.37.03; author itojun; state dead; branches 1.1.2.1; next ; 1.100.6.1 date 2021.08.01.22.42.42; author thorpej; state Exp; branches; next ; commitid NihqK3haIgTUWj3D; 1.95.2.1 date 2019.09.06.19.43.00; author martin; state Exp; branches; next ; commitid Gu0UMJ8as3wFiZBB; 1.91.2.1 date 2019.06.10.22.09.48; author christos; state Exp; branches; next 1.91.2.2; commitid jtc8rnCzWiEEHGqB; 1.91.2.2 date 2020.04.13.08.05.17; author martin; state Exp; branches; next ; commitid X01YhRUPVUDaec4C; 1.90.2.1 date 2018.04.22.07.20.28; author pgoyette; state Exp; branches; next 1.90.2.2; commitid W6xykws0Zbl4kpzA; 1.90.2.2 date 2018.09.06.06.56.45; author pgoyette; state Exp; branches; next 1.90.2.3; commitid HCi1bXD317XIK0RA; 1.90.2.3 date 2018.12.26.14.02.05; author pgoyette; state Exp; branches; next ; commitid xUhK8IAeBM1azj5B; 1.87.10.1 date 2018.02.11.21.17.34; author snj; state Exp; branches; next ; commitid 1Pg5KdsmcZWRbuqA; 1.79.2.1 date 2015.04.06.15.18.23; author skrll; state Exp; branches; next 1.79.2.2; 1.79.2.2 date 2015.06.06.14.40.25; author skrll; state Exp; branches; next 1.79.2.3; 1.79.2.3 date 2015.09.22.12.06.11; author skrll; state Exp; branches; next 1.79.2.4; 1.79.2.4 date 2015.12.27.12.10.07; author skrll; state Exp; branches; next 1.79.2.5; 1.79.2.5 date 2016.03.19.11.30.33; author skrll; state Exp; branches; next ; 1.78.2.1 date 2015.01.23.09.27.15; author martin; state Exp; branches; next ; 1.75.2.1 date 2014.08.10.06.56.30; author tls; state Exp; branches; next ; 1.73.2.1 date 2014.05.18.17.46.13; author rmind; state Exp; branches; next ; 1.70.2.1 date 2013.06.23.06.20.25; author tls; state Exp; branches; next 1.70.2.2; 1.70.2.2 date 2014.08.20.00.04.36; author tls; state Exp; branches; next 1.70.2.3; 1.70.2.3 date 2017.12.03.11.39.04; author jdolecek; state Exp; branches; next ; commitid XcIYRZTAh1LmerhA; 1.69.4.1 date 2012.10.30.17.22.48; author yamt; state Exp; branches; next 1.69.4.2; 1.69.4.2 date 2014.05.22.11.41.10; author yamt; state Exp; branches; next ; 1.68.4.1 date 2011.05.31.03.05.08; author rmind; state Exp; branches; next ; 1.68.6.1 date 2011.06.06.09.09.58; author jruoho; state Exp; branches; next ; 1.66.2.1 date 2008.02.22.02.53.33; author keiichi; state Exp; branches; next ; 1.66.10.1 date 2009.09.16.13.38.02; author yamt; state Exp; branches; next ; 1.65.2.1 date 2008.02.18.21.07.13; author mjf; state Exp; branches; next ; 1.65.4.1 date 2007.12.26.19.57.44; author ad; state Exp; branches; next ; 1.65.8.1 date 2008.01.02.21.57.28; author bouyer; state Exp; branches; next ; 1.63.2.1 date 2007.11.13.16.02.54; author bouyer; state Exp; branches; next ; 1.62.2.1 date 2007.10.14.11.49.02; author yamt; state Exp; branches; next ; 1.61.2.1 date 2007.09.03.10.23.47; author skrll; state Exp; branches; next ; 1.61.6.1 date 2007.09.03.16.49.07; author jmcneill; state Exp; branches; next 1.61.6.2; 1.61.6.2 date 2007.10.26.15.49.07; author joerg; state Exp; branches; next 1.61.6.3; 1.61.6.3 date 2007.11.04.21.03.41; author jmcneill; state Exp; branches; next ; 1.61.8.1 date 2007.11.06.23.33.59; author matt; state Exp; branches; next 1.61.8.2; 1.61.8.2 date 2008.01.09.01.57.34; author matt; state Exp; branches; next ; 1.59.4.1 date 2007.06.08.14.17.52; author ad; state Exp; branches; next 1.59.4.2; 1.59.4.2 date 2007.07.15.13.28.00; author ad; state Exp; branches; next 1.59.4.3; 1.59.4.3 date 2007.10.09.13.44.54; author ad; state Exp; branches; next ; 1.59.6.1 date 2007.07.11.20.11.36; author mjf; state Exp; branches; next ; 1.58.2.1 date 2007.02.27.16.54.59; author yamt; state Exp; branches; next 1.58.2.2; 1.58.2.2 date 2007.05.07.10.56.02; author yamt; state Exp; branches; next ; 1.56.6.1 date 2006.11.18.21.39.37; author ad; state Exp; branches; next ; 1.56.8.1 date 2006.12.10.07.19.15; author yamt; state Exp; branches; next ; 1.55.2.1 date 2006.06.19.04.09.49; author chap; state Exp; branches; next ; 1.52.2.1 date 2006.04.01.12.07.49; author yamt; state Exp; branches; next 1.52.2.2; 1.52.2.2 date 2006.05.24.10.59.09; author yamt; state Exp; branches; next 1.52.2.3; 1.52.2.3 date 2006.06.26.12.54.13; author yamt; state Exp; branches; next ; 1.52.4.1 date 2006.04.19.04.46.11; author elad; state Exp; branches; next 1.52.4.2; 1.52.4.2 date 2006.05.11.23.31.35; author elad; state Exp; branches; next ; 1.52.6.1 date 2006.03.31.09.45.29; author tron; state Exp; branches; next 1.52.6.2; 1.52.6.2 date 2006.05.24.15.50.45; author tron; state Exp; branches; next ; 1.51.2.1 date 2006.09.09.02.58.55; author rpaulo; state Exp; branches; next ; 1.51.4.1 date 2006.02.04.14.18.52; author simonb; state Exp; branches; next 1.51.4.2; 1.51.4.2 date 2006.04.22.11.40.12; author simonb; state Exp; branches; next 1.51.4.3; 1.51.4.3 date 2006.06.01.22.39.02; author kardel; state Exp; branches; next ; 1.50.2.1 date 2006.02.01.14.52.41; author yamt; state Exp; branches; next 1.50.2.2; 1.50.2.2 date 2006.02.18.15.39.23; author yamt; state Exp; branches; next ; 1.45.12.1 date 2006.06.21.15.11.08; author yamt; state Exp; branches; next 1.45.12.2; 1.45.12.2 date 2006.12.30.20.50.38; author yamt; state Exp; branches; next 1.45.12.3; 1.45.12.3 date 2007.02.26.09.11.48; author yamt; state Exp; branches; next 1.45.12.4; 1.45.12.4 date 2007.09.03.14.43.19; author yamt; state Exp; branches; next 1.45.12.5; 1.45.12.5 date 2007.10.27.11.36.11; author yamt; state Exp; branches; next 1.45.12.6; 1.45.12.6 date 2007.11.15.11.45.10; author yamt; state Exp; branches; next 1.45.12.7; 1.45.12.7 date 2008.01.21.09.47.21; author yamt; state Exp; branches; next ; 1.44.2.1 date 2004.06.14.18.00.54; author tron; state Exp; branches; next ; 1.42.2.1 date 2004.08.03.10.55.11; author skrll; state Exp; branches; next 1.42.2.2; 1.42.2.2 date 2004.09.18.14.55.14; author skrll; state Exp; branches; next 1.42.2.3; 1.42.2.3 date 2004.09.21.13.37.32; author skrll; state Exp; branches; next 1.42.2.4; 1.42.2.4 date 2005.11.10.14.11.25; author skrll; state Exp; branches; next 1.42.2.5; 1.42.2.5 date 2005.12.11.10.29.32; author christos; state Exp; branches; next ; 1.39.2.1 date 2002.05.30.13.52.31; author gehenna; state Exp; branches; next 1.39.2.2; 1.39.2.2 date 2002.06.20.15.52.39; author gehenna; state Exp; branches; next ; 1.39.4.1 date 2004.06.14.02.47.50; author jmc; state Exp; branches; next ; 1.30.2.1 date 2001.11.12.21.19.30; author thorpej; state Exp; branches; next ; 1.26.2.1 date 2001.08.03.04.13.58; author lukem; state Exp; branches; next 1.26.2.2; 1.26.2.2 date 2002.01.10.20.03.13; author thorpej; state Exp; branches; next 1.26.2.3; 1.26.2.3 date 2002.06.23.17.51.10; author jdolecek; state Exp; branches; next ; 1.24.2.1 date 2001.04.09.01.58.36; author nathanw; state Exp; branches; next 1.24.2.2; 1.24.2.2 date 2001.06.21.20.08.52; author nathanw; state Exp; branches; next 1.24.2.3; 1.24.2.3 date 2001.08.24.00.12.37; author nathanw; state Exp; branches; next 1.24.2.4; 1.24.2.4 date 2001.10.22.20.42.00; author nathanw; state Exp; branches; next 1.24.2.5; 1.24.2.5 date 2001.11.14.19.18.05; author nathanw; state Exp; branches; next 1.24.2.6; 1.24.2.6 date 2002.01.08.00.34.16; author nathanw; state Exp; branches; next 1.24.2.7; 1.24.2.7 date 2002.06.20.03.49.12; author nathanw; state Exp; branches; next ; 1.15.2.1 date 2000.07.16.05.56.27; author itojun; state Exp; branches; next 1.15.2.2; 1.15.2.2 date 2000.08.27.01.25.07; author itojun; state Exp; branches; next 1.15.2.3; 1.15.2.3 date 2000.08.27.01.38.54; author itojun; state Exp; branches; next 1.15.2.4; 1.15.2.4 date 2000.10.18.03.14.45; author tv; state Exp; branches; next ; 1.14.2.1 date 2000.06.22.17.09.56; author minoura; state Exp; branches; next ; 1.6.2.1 date 2000.11.20.18.10.46; author bouyer; state Exp; branches; next 1.6.2.2; 1.6.2.2 date 2001.02.11.19.17.22; author bouyer; state Exp; branches; next 1.6.2.3; 1.6.2.3 date 2001.03.12.13.31.54; author bouyer; state Exp; branches; next 1.6.2.4; 1.6.2.4 date 2001.04.21.17.46.55; author bouyer; state Exp; branches; next ; 1.6.8.1 date 99.12.27.18.36.23; author wrstuden; state Exp; branches; next ; 1.2.2.1 date 99.07.01.08.12.53; author thorpej; state dead; branches; next 1.2.2.2; 1.2.2.2 date 99.07.01.23.48.27; author thorpej; state Exp; branches; next 1.2.2.3; 1.2.2.3 date 99.08.02.22.36.03; author thorpej; state Exp; branches; next ; 1.1.2.1 date 99.06.28.06.37.04; author itojun; state Exp; branches; next 1.1.2.2; 1.1.2.2 date 99.07.06.11.03.00; author itojun; state Exp; branches; next 1.1.2.3; 1.1.2.3 date 99.11.30.13.35.49; author itojun; state Exp; branches; next ; desc @@ 1.101 log @fix typos in comments @ text @/* $NetBSD: in6.h,v 1.100 2020/09/08 14:12:57 christos Exp $ */ /* $KAME: in6.h,v 1.83 2001/03/29 02:55:07 jinmei Exp $ */ /* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. * All rights reserved. * * 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. * 3. Neither the name of the project nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE PROJECT 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 PROJECT 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. */ /* * Copyright (c) 1982, 1986, 1990, 1993 * The Regents of the University of California. All rights reserved. * * 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. * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * 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. * * @@(#)in.h 8.3 (Berkeley) 1/3/94 */ #ifndef _NETINET6_IN6_H_ #define _NETINET6_IN6_H_ #include #ifndef __KAME_NETINET_IN_H_INCLUDED_ #error "do not include netinet6/in6.h directly, include netinet/in.h. see RFC2553" #endif #include #include /* ntohl */ /* * Identification of the network protocol stack * for *BSD-current/release: http://www.kame.net/dev/cvsweb.cgi/kame/COVERAGE * has the table of implementation/integration differences. */ #define __KAME__ #define __KAME_VERSION "NetBSD-current" /* * Local port number conventions: * * Ports < IPPORT_RESERVED are reserved for privileged processes (e.g. root), * unless a kernel is compiled with IPNOPRIVPORTS defined. * * When a user does a bind(2) or connect(2) with a port number of zero, * a non-conflicting local port address is chosen. * * The default range is IPPORT_ANONMIN to IPPORT_ANONMAX, although * that is settable by sysctl(3); net.inet.ip.anonportmin and * net.inet.ip.anonportmax respectively. * * A user may set the IPPROTO_IP option IP_PORTRANGE to change this * default assignment range. * * The value IP_PORTRANGE_DEFAULT causes the default behavior. * * The value IP_PORTRANGE_HIGH is the same as IP_PORTRANGE_DEFAULT, * and exists only for FreeBSD compatibility purposes. * * The value IP_PORTRANGE_LOW changes the range to the "low" are * that is (by convention) restricted to privileged processes. * This convention is based on "vouchsafe" principles only. * It is only secure if you trust the remote host to restrict these ports. * The range is IPPORT_RESERVEDMIN to IPPORT_RESERVEDMAX. */ #if defined(_NETBSD_SOURCE) #define IPV6PORT_RESERVED 1024 #define IPV6PORT_ANONMIN 49152 #define IPV6PORT_ANONMAX 65535 #define IPV6PORT_RESERVEDMIN 600 #define IPV6PORT_RESERVEDMAX (IPV6PORT_RESERVED-1) #endif /* * IPv6 address */ struct in6_addr { union { __uint8_t __u6_addr8[16]; __uint16_t __u6_addr16[8]; uint32_t __u6_addr32[4]; } __u6_addr; /* 128-bit IP6 address */ }; #define s6_addr __u6_addr.__u6_addr8 #ifdef _KERNEL /* XXX nonstandard */ #define s6_addr8 __u6_addr.__u6_addr8 #define s6_addr16 __u6_addr.__u6_addr16 #define s6_addr32 __u6_addr.__u6_addr32 #endif #define INET6_ADDRSTRLEN 46 /* * Socket address for IPv6 */ #if defined(_NETBSD_SOURCE) #define SIN6_LEN #endif struct sockaddr_in6 { uint8_t sin6_len; /* length of this struct(socklen_t)*/ sa_family_t sin6_family; /* AF_INET6 (sa_family_t) */ in_port_t sin6_port; /* Transport layer port */ uint32_t sin6_flowinfo; /* IP6 flow information */ struct in6_addr sin6_addr; /* IP6 address */ uint32_t sin6_scope_id; /* scope zone index */ }; /* * Local definition for masks */ #ifdef _KERNEL /* XXX nonstandard */ #define IN6MASK0 {{{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }}} #define IN6MASK32 {{{ 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }}} #define IN6MASK64 {{{ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }}} #define IN6MASK96 {{{ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \ 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00 }}} #define IN6MASK128 {{{ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }}} #endif #ifdef _KERNEL extern const struct sockaddr_in6 sa6_any; extern const struct in6_addr in6mask0; extern const struct in6_addr in6mask32; extern const struct in6_addr in6mask64; extern const struct in6_addr in6mask96; extern const struct in6_addr in6mask128; #endif /* _KERNEL */ /* * Macros started with IPV6_ADDR is KAME local */ #ifdef _KERNEL /* XXX nonstandard */ #if BYTE_ORDER == BIG_ENDIAN #define IPV6_ADDR_INT32_ONE 1 #define IPV6_ADDR_INT32_TWO 2 #define IPV6_ADDR_INT32_MNL 0xff010000 #define IPV6_ADDR_INT32_MLL 0xff020000 #define IPV6_ADDR_INT32_SMP 0x0000ffff #define IPV6_ADDR_INT16_ULL 0xfe80 #define IPV6_ADDR_INT16_USL 0xfec0 #define IPV6_ADDR_INT16_MLL 0xff02 #elif BYTE_ORDER == LITTLE_ENDIAN #define IPV6_ADDR_INT32_ONE 0x01000000 #define IPV6_ADDR_INT32_TWO 0x02000000 #define IPV6_ADDR_INT32_MNL 0x000001ff #define IPV6_ADDR_INT32_MLL 0x000002ff #define IPV6_ADDR_INT32_SMP 0xffff0000 #define IPV6_ADDR_INT16_ULL 0x80fe #define IPV6_ADDR_INT16_USL 0xc0fe #define IPV6_ADDR_INT16_MLL 0x02ff #endif #endif /* * Definition of some useful macros to handle IP6 addresses */ #define IN6ADDR_ANY_INIT \ {{{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }}} #define IN6ADDR_LOOPBACK_INIT \ {{{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 }}} #define IN6ADDR_NODELOCAL_ALLNODES_INIT \ {{{ 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 }}} #define IN6ADDR_LINKLOCAL_ALLNODES_INIT \ {{{ 0xff, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 }}} #define IN6ADDR_LINKLOCAL_ALLROUTERS_INIT \ {{{ 0xff, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02 }}} extern const struct in6_addr in6addr_any; extern const struct in6_addr in6addr_loopback; extern const struct in6_addr in6addr_nodelocal_allnodes; extern const struct in6_addr in6addr_linklocal_allnodes; extern const struct in6_addr in6addr_linklocal_allrouters; #define IN6_ARE_ADDR_EQUAL(a, b) \ (memcmp(&(a)->s6_addr[0], &(b)->s6_addr[0], sizeof(struct in6_addr)) == 0) /* * Unspecified */ #define IN6_IS_ADDR_UNSPECIFIED(a) \ ((a)->__u6_addr.__u6_addr32[0] == 0 && \ (a)->__u6_addr.__u6_addr32[1] == 0 && \ (a)->__u6_addr.__u6_addr32[2] == 0 && \ (a)->__u6_addr.__u6_addr32[3] == 0) /* * Loopback */ #define IN6_IS_ADDR_LOOPBACK(a) \ ((a)->__u6_addr.__u6_addr32[0] == 0 && \ (a)->__u6_addr.__u6_addr32[1] == 0 && \ (a)->__u6_addr.__u6_addr32[2] == 0 && \ (a)->__u6_addr.__u6_addr32[3] == ntohl(1)) /* * IPv4 compatible */ #define IN6_IS_ADDR_V4COMPAT(a) \ ((a)->__u6_addr.__u6_addr32[0] == 0 && \ (a)->__u6_addr.__u6_addr32[1] == 0 && \ (a)->__u6_addr.__u6_addr32[2] == 0 && \ (a)->__u6_addr.__u6_addr32[3] != 0 && \ (a)->__u6_addr.__u6_addr32[3] != ntohl(1)) /* * Mapped */ #define IN6_IS_ADDR_V4MAPPED(a) \ ((a)->__u6_addr.__u6_addr32[0] == 0 && \ (a)->__u6_addr.__u6_addr32[1] == 0 && \ (a)->__u6_addr.__u6_addr32[2] == ntohl(0x0000ffff)) /* * KAME Scope Values */ #ifdef _KERNEL /* XXX nonstandard */ #define IPV6_ADDR_SCOPE_NODELOCAL 0x01 #define IPV6_ADDR_SCOPE_INTFACELOCAL 0x01 #define IPV6_ADDR_SCOPE_LINKLOCAL 0x02 #define IPV6_ADDR_SCOPE_SITELOCAL 0x05 #define IPV6_ADDR_SCOPE_ORGLOCAL 0x08 /* just used in this file */ #define IPV6_ADDR_SCOPE_GLOBAL 0x0e #else #define __IPV6_ADDR_SCOPE_NODELOCAL 0x01 #define __IPV6_ADDR_SCOPE_LINKLOCAL 0x02 #define __IPV6_ADDR_SCOPE_SITELOCAL 0x05 #define __IPV6_ADDR_SCOPE_ORGLOCAL 0x08 /* just used in this file */ #define __IPV6_ADDR_SCOPE_GLOBAL 0x0e #endif /* * Unicast Scope * Note that we must check topmost 10 bits only, not 16 bits (see RFC2373). */ #define IN6_IS_ADDR_LINKLOCAL(a) \ (((a)->s6_addr[0] == 0xfe) && (((a)->s6_addr[1] & 0xc0) == 0x80)) #define IN6_IS_ADDR_SITELOCAL(a) \ (((a)->s6_addr[0] == 0xfe) && (((a)->s6_addr[1] & 0xc0) == 0xc0)) /* * Multicast */ #define IN6_IS_ADDR_MULTICAST(a) ((a)->s6_addr[0] == 0xff) #ifdef _KERNEL /* XXX nonstandard */ #define IPV6_ADDR_MC_SCOPE(a) ((a)->s6_addr[1] & 0x0f) #else #define __IPV6_ADDR_MC_SCOPE(a) ((a)->s6_addr[1] & 0x0f) #endif /* * Multicast Scope */ #ifdef _KERNEL /* refers nonstandard items */ #define IN6_IS_ADDR_MC_NODELOCAL(a) \ (IN6_IS_ADDR_MULTICAST(a) && \ (IPV6_ADDR_MC_SCOPE(a) == IPV6_ADDR_SCOPE_NODELOCAL)) #define IN6_IS_ADDR_MC_INTFACELOCAL(a) \ (IN6_IS_ADDR_MULTICAST(a) && \ (IPV6_ADDR_MC_SCOPE(a) == IPV6_ADDR_SCOPE_INTFACELOCAL)) #define IN6_IS_ADDR_MC_LINKLOCAL(a) \ (IN6_IS_ADDR_MULTICAST(a) && \ (IPV6_ADDR_MC_SCOPE(a) == IPV6_ADDR_SCOPE_LINKLOCAL)) #define IN6_IS_ADDR_MC_SITELOCAL(a) \ (IN6_IS_ADDR_MULTICAST(a) && \ (IPV6_ADDR_MC_SCOPE(a) == IPV6_ADDR_SCOPE_SITELOCAL)) #define IN6_IS_ADDR_MC_ORGLOCAL(a) \ (IN6_IS_ADDR_MULTICAST(a) && \ (IPV6_ADDR_MC_SCOPE(a) == IPV6_ADDR_SCOPE_ORGLOCAL)) #define IN6_IS_ADDR_MC_GLOBAL(a) \ (IN6_IS_ADDR_MULTICAST(a) && \ (IPV6_ADDR_MC_SCOPE(a) == IPV6_ADDR_SCOPE_GLOBAL)) #else #define IN6_IS_ADDR_MC_NODELOCAL(a) \ (IN6_IS_ADDR_MULTICAST(a) && \ (__IPV6_ADDR_MC_SCOPE(a) == __IPV6_ADDR_SCOPE_NODELOCAL)) #define IN6_IS_ADDR_MC_LINKLOCAL(a) \ (IN6_IS_ADDR_MULTICAST(a) && \ (__IPV6_ADDR_MC_SCOPE(a) == __IPV6_ADDR_SCOPE_LINKLOCAL)) #define IN6_IS_ADDR_MC_SITELOCAL(a) \ (IN6_IS_ADDR_MULTICAST(a) && \ (__IPV6_ADDR_MC_SCOPE(a) == __IPV6_ADDR_SCOPE_SITELOCAL)) #define IN6_IS_ADDR_MC_ORGLOCAL(a) \ (IN6_IS_ADDR_MULTICAST(a) && \ (__IPV6_ADDR_MC_SCOPE(a) == __IPV6_ADDR_SCOPE_ORGLOCAL)) #define IN6_IS_ADDR_MC_GLOBAL(a) \ (IN6_IS_ADDR_MULTICAST(a) && \ (__IPV6_ADDR_MC_SCOPE(a) == __IPV6_ADDR_SCOPE_GLOBAL)) #endif #ifdef _KERNEL /* nonstandard */ /* * KAME Scope */ #define IN6_IS_SCOPE_LINKLOCAL(a) \ ((IN6_IS_ADDR_LINKLOCAL(a)) || \ (IN6_IS_ADDR_MC_LINKLOCAL(a))) #define IN6_IS_SCOPE_EMBEDDABLE(__a) \ (IN6_IS_SCOPE_LINKLOCAL(__a) || IN6_IS_ADDR_MC_INTFACELOCAL(__a)) #define IFA6_IS_DEPRECATED(a) \ ((a)->ia6_lifetime.ia6t_pltime != ND6_INFINITE_LIFETIME && \ (u_int32_t)((time_uptime - (a)->ia6_updatetime)) > \ (a)->ia6_lifetime.ia6t_pltime) #define IFA6_IS_INVALID(a) \ ((a)->ia6_lifetime.ia6t_vltime != ND6_INFINITE_LIFETIME && \ (u_int32_t)((time_uptime - (a)->ia6_updatetime)) > \ (a)->ia6_lifetime.ia6t_vltime) #endif /* * Options for use with [gs]etsockopt at the IPV6 level. * First word of comment is data type; bool is stored in int. */ /* no hdrincl */ #if 0 /* These are deprecated non-standard options which are no longer supported. */ #define IPV6_OPTIONS 1 /* buf/ip6_opts; set/get IP6 options */ #define IPV6_RECVOPTS 5 /* bool; receive all IP6 opts w/dgram */ #define IPV6_RECVRETOPTS 6 /* bool; receive IP6 opts for response */ #define IPV6_RECVDSTADDR 7 /* bool; receive IP6 dst addr w/dgram */ #define IPV6_RETOPTS 8 /* ip6_opts; set/get IP6 options */ #endif #define IPV6_SOCKOPT_RESERVED1 3 /* reserved for future use */ #define IPV6_UNICAST_HOPS 4 /* int; IP6 hops */ #define IPV6_MULTICAST_IF 9 /* u_int; set/get IP6 multicast i/f */ #define IPV6_MULTICAST_HOPS 10 /* int; set/get IP6 multicast hops */ #define IPV6_MULTICAST_LOOP 11 /* u_int; set/get IP6 multicast loopback */ /* The join and leave membership option numbers need to match with the v4 ones */ #define IPV6_JOIN_GROUP 12 /* ip6_mreq; join a group membership */ #define IPV6_LEAVE_GROUP 13 /* ip6_mreq; leave a group membership */ #define IPV6_PORTRANGE 14 /* int; range to choose for unspec port */ #if defined(_NETBSD_SOURCE) #define IPV6_PORTALGO 17 /* int; port selection algo (rfc6056) */ #define ICMP6_FILTER 18 /* icmp6_filter; icmp6 filter */ #endif /* RFC2292 options */ #ifdef _KERNEL #define IPV6_2292PKTINFO 19 /* bool; send/recv if, src/dst addr */ #define IPV6_2292HOPLIMIT 20 /* bool; hop limit */ #define IPV6_2292NEXTHOP 21 /* bool; next hop addr */ #define IPV6_2292HOPOPTS 22 /* bool; hop-by-hop option */ #define IPV6_2292DSTOPTS 23 /* bool; destination option */ #define IPV6_2292RTHDR 24 /* bool; routing header */ #define IPV6_2292PKTOPTIONS 25 /* buf/cmsghdr; set/get IPv6 options */ #endif #define IPV6_CHECKSUM 26 /* int; checksum offset for raw socket */ #define IPV6_V6ONLY 27 /* bool; make AF_INET6 sockets v6 only */ #define IPV6_IPSEC_POLICY 28 /* struct; get/set security policy */ #define IPV6_FAITH 29 /* bool; accept FAITH'ed connections */ /* new socket options introduced in RFC3542 */ #define IPV6_RTHDRDSTOPTS 35 /* ip6_dest; send dst option before rthdr */ #define IPV6_RECVPKTINFO 36 /* bool; recv if, dst addr */ #define IPV6_RECVHOPLIMIT 37 /* bool; recv hop limit */ #define IPV6_RECVRTHDR 38 /* bool; recv routing header */ #define IPV6_RECVHOPOPTS 39 /* bool; recv hop-by-hop option */ #define IPV6_RECVDSTOPTS 40 /* bool; recv dst option after rthdr */ #ifdef _KERNEL #define IPV6_RECVRTHDRDSTOPTS 41 /* bool; recv dst option before rthdr */ #endif #define IPV6_USE_MIN_MTU 42 /* bool; send packets at the minimum MTU */ #define IPV6_RECVPATHMTU 43 /* bool; notify an according MTU */ #define IPV6_PATHMTU 44 /* mtuinfo; get the current path MTU (sopt), 4 bytes int; MTU notification (cmsg) */ /* more new socket options introduced in RFC3542 */ #define IPV6_PKTINFO 46 /* in6_pktinfo; send if, src addr */ #define IPV6_HOPLIMIT 47 /* int; send hop limit */ #define IPV6_NEXTHOP 48 /* sockaddr; next hop addr */ #define IPV6_HOPOPTS 49 /* ip6_hbh; send hop-by-hop option */ #define IPV6_DSTOPTS 50 /* ip6_dest; send dst option before rthdr */ #define IPV6_RTHDR 51 /* ip6_rthdr; send routing header */ #define IPV6_RECVTCLASS 57 /* bool; recv traffic class values */ #ifdef _KERNEL #define IPV6_OTCLASS 58 /* u_int8_t; send traffic class value */ #endif #define IPV6_TCLASS 61 /* int; send traffic class value */ #define IPV6_DONTFRAG 62 /* bool; disable IPv6 fragmentation */ #define IPV6_PREFER_TEMPADDR 63 /* int; prefer temporary address as * the source address */ #define IPV6_BINDANY 64 /* bool: allow bind to any address */ /* to define items, should talk with KAME guys first, for *BSD compatibility */ #define IPV6_RTHDR_LOOSE 0 /* this hop need not be a neighbor. XXX old spec */ #define IPV6_RTHDR_STRICT 1 /* this hop must be a neighbor. XXX old spec */ #define IPV6_RTHDR_TYPE_0 0 /* IPv6 routing header type 0 */ /* * Defaults and limits for options */ #define IPV6_DEFAULT_MULTICAST_HOPS 1 /* normally limit m'casts to 1 hop */ #define IPV6_DEFAULT_MULTICAST_LOOP 1 /* normally hear sends if a member */ /* * Argument structure for IPV6_JOIN_GROUP and IPV6_LEAVE_GROUP. */ struct ipv6_mreq { struct in6_addr ipv6mr_multiaddr; unsigned int ipv6mr_interface; }; /* * IPV6_PKTINFO: Packet information(RFC2292 sec 5) */ struct in6_pktinfo { struct in6_addr ipi6_addr; /* src/dst IPv6 address */ unsigned int ipi6_ifindex; /* send/recv interface index */ }; /* * Control structure for IPV6_RECVPATHMTU socket option. */ struct ip6_mtuinfo { struct sockaddr_in6 ip6m_addr; /* or sockaddr_storage? */ uint32_t ip6m_mtu; }; /* * Argument for IPV6_PORTRANGE: * - which range to search when port is unspecified at bind() or connect() */ #define IPV6_PORTRANGE_DEFAULT 0 /* default range */ #define IPV6_PORTRANGE_HIGH 1 /* "high" - request firewall bypass */ #define IPV6_PORTRANGE_LOW 2 /* "low" - vouchsafe security */ #if defined(_NETBSD_SOURCE) /* * Definitions for inet6 sysctl operations. * * Third level is protocol number. * Fourth level is desired variable within that protocol. */ /* * Names for IP sysctl objects */ #define IPV6CTL_FORWARDING 1 /* act as router */ #define IPV6CTL_SENDREDIRECTS 2 /* may send redirects when forwarding*/ #define IPV6CTL_DEFHLIM 3 /* default Hop-Limit */ /* IPV6CTL_DEFMTU=4, never implemented */ #define IPV6CTL_FORWSRCRT 5 /* forward source-routed dgrams */ #define IPV6CTL_STATS 6 /* stats */ #define IPV6CTL_MRTSTATS 7 /* multicast forwarding stats */ #define IPV6CTL_MRTPROTO 8 /* multicast routing protocol */ #define IPV6CTL_MAXFRAGPACKETS 9 /* max packets reassembly queue */ #define IPV6CTL_SOURCECHECK 10 /* verify source route and intf */ #define IPV6CTL_SOURCECHECK_LOGINT 11 /* minimum logging interval */ /* 12 was IPV6CTL_ACCEPT_RTADV */ #define IPV6CTL_KEEPFAITH 13 #define IPV6CTL_LOG_INTERVAL 14 #define IPV6CTL_HDRNESTLIMIT 15 #define IPV6CTL_DAD_COUNT 16 #define IPV6CTL_AUTO_FLOWLABEL 17 #define IPV6CTL_DEFMCASTHLIM 18 #define IPV6CTL_GIF_HLIM 19 /* default HLIM for gif encap packet */ #define IPV6CTL_KAME_VERSION 20 #define IPV6CTL_USE_DEPRECATED 21 /* use deprecated addr (RFC2462 5.5.4) */ /* 22 was IPV6CTL_RR_PRUNE */ /* 23: reserved */ #define IPV6CTL_V6ONLY 24 /* 25 to 27: reserved */ #define IPV6CTL_ANONPORTMIN 28 /* minimum ephemeral port */ #define IPV6CTL_ANONPORTMAX 29 /* maximum ephemeral port */ #define IPV6CTL_LOWPORTMIN 30 /* minimum reserved port */ #define IPV6CTL_LOWPORTMAX 31 /* maximum reserved port */ /* 32 to 34: reserved */ #define IPV6CTL_AUTO_LINKLOCAL 35 /* automatic link-local addr assign */ /* 36 to 37: reserved */ #define IPV6CTL_ADDRCTLPOLICY 38 /* get/set address selection policy */ #define IPV6CTL_USE_DEFAULTZONE 39 /* use default scope zone */ /* 40: reserved */ #define IPV6CTL_MAXFRAGS 41 /* max fragments */ #define IPV6CTL_IFQ 42 /* IPv6 packet input queue */ /* 43 was IPV6CTL_RTADV_MAXROUTES */ /* 44 was IPV6CTL_RTADV_NUMROUTES */ #define IPV6CTL_GIF_PMTU 45 /* gif(4) Path MTU setting */ #define IPV6CTL_IPSEC_HLIM 46 /* default HLIM for ipsecif encap packet */ #define IPV6CTL_IPSEC_PMTU 47 /* ipsecif(4) Path MTU setting */ #endif /* _NETBSD_SOURCE */ #ifdef _KERNEL struct cmsghdr; /* * in6_cksum_phdr: * * Compute significant parts of the IPv6 checksum pseudo-header * for use in a delayed TCP/UDP checksum calculation. * * Args: * * src Source IPv6 address * dst Destination IPv6 address * len htonl(proto-hdr-len) * nxt htonl(next-proto-number) * * NOTE: We expect the src and dst addresses to be 16-bit * aligned! */ static __inline u_int16_t __unused in6_cksum_phdr(const struct in6_addr *src, const struct in6_addr *dst, u_int32_t len, u_int32_t nxt) { u_int32_t sum = 0; const u_int16_t *w; /*LINTED*/ w = (const u_int16_t *) src; sum += w[0]; if (!IN6_IS_SCOPE_LINKLOCAL(src)) sum += w[1]; sum += w[2]; sum += w[3]; sum += w[4]; sum += w[5]; sum += w[6]; sum += w[7]; /*LINTED*/ w = (const u_int16_t *) dst; sum += w[0]; if (!IN6_IS_SCOPE_LINKLOCAL(dst)) sum += w[1]; sum += w[2]; sum += w[3]; sum += w[4]; sum += w[5]; sum += w[6]; sum += w[7]; sum += (u_int16_t)(len >> 16) + (u_int16_t)(len /*& 0xffff*/); sum += (u_int16_t)(nxt >> 16) + (u_int16_t)(nxt /*& 0xffff*/); sum = (u_int16_t)(sum >> 16) + (u_int16_t)(sum /*& 0xffff*/); if (sum > 0xffff) sum -= 0xffff; return (sum); } struct mbuf; struct ifnet; int sockaddr_in6_cmp(const struct sockaddr *, const struct sockaddr *); struct sockaddr *sockaddr_in6_externalize(struct sockaddr *, socklen_t, const struct sockaddr *); int in6_cksum(struct mbuf *, u_int8_t, u_int32_t, u_int32_t); int in6_localaddr(const struct in6_addr *); int in6_addrscope(const struct in6_addr *); struct in6_ifaddr *in6_ifawithifp(struct ifnet *, struct in6_addr *); extern void in6_if_link_up(struct ifnet *); extern void in6_if_link_down(struct ifnet *); extern void in6_if_link_state_change(struct ifnet *, int); extern void in6_if_up(struct ifnet *); extern void in6_if_down(struct ifnet *); extern void addrsel_policy_init(void); extern u_char ip6_protox[]; struct ip6_hdr; int in6_tunnel_validate(const struct ip6_hdr *, const struct in6_addr *, const struct in6_addr *); #define satosin6(sa) ((struct sockaddr_in6 *)(sa)) #define satocsin6(sa) ((const struct sockaddr_in6 *)(sa)) #define sin6tosa(sin6) ((struct sockaddr *)(sin6)) #define sin6tocsa(sin6) ((const struct sockaddr *)(sin6)) #define ifatoia6(ifa) ((struct in6_ifaddr *)(ifa)) static __inline void sockaddr_in6_init1(struct sockaddr_in6 *sin6, const struct in6_addr *addr, in_port_t port, uint32_t flowinfo, uint32_t scope_id) { sin6->sin6_port = port; sin6->sin6_flowinfo = flowinfo; sin6->sin6_addr = *addr; sin6->sin6_scope_id = scope_id; } static __inline void sockaddr_in6_init(struct sockaddr_in6 *sin6, const struct in6_addr *addr, in_port_t port, uint32_t flowinfo, uint32_t scope_id) { sin6->sin6_family = AF_INET6; sin6->sin6_len = sizeof(*sin6); sockaddr_in6_init1(sin6, addr, port, flowinfo, scope_id); } static __inline struct sockaddr * sockaddr_in6_alloc(const struct in6_addr *addr, in_port_t port, uint32_t flowinfo, uint32_t scope_id, int flags) { struct sockaddr *sa; if ((sa = sockaddr_alloc(AF_INET6, sizeof(struct sockaddr_in6), flags)) == NULL) return NULL; sockaddr_in6_init1(satosin6(sa), addr, port, flowinfo, scope_id); return sa; } #endif /* _KERNEL */ #if defined(_NETBSD_SOURCE) #include #ifdef _BSD_SIZE_T_ typedef _BSD_SIZE_T_ size_t; #define _SIZE_T #undef _BSD_SIZE_T_ #endif #include __BEGIN_DECLS struct cmsghdr; void in6_in_2_v4mapin6(const struct in_addr *, struct in6_addr *); void in6_sin6_2_sin(struct sockaddr_in *, struct sockaddr_in6 *); void in6_sin_2_v4mapsin6(const struct sockaddr_in *, struct sockaddr_in6 *); void in6_sin6_2_sin_in_sock(struct sockaddr *); void in6_sin_2_v4mapsin6_in_sock(struct sockaddr **); #define INET6_IS_ADDR_LINKLOCAL 1 #define INET6_IS_ADDR_MC_LINKLOCAL 2 #define INET6_IS_ADDR_SITELOCAL 4 void inet6_getscopeid(struct sockaddr_in6 *, int); void inet6_putscopeid(struct sockaddr_in6 *, int); extern int inet6_option_space(int); extern int inet6_option_init(void *, struct cmsghdr **, int); extern int inet6_option_append(struct cmsghdr *, const uint8_t *, int, int); extern uint8_t *inet6_option_alloc(struct cmsghdr *, int, int, int); extern int inet6_option_next(const struct cmsghdr *, uint8_t **); extern int inet6_option_find(const struct cmsghdr *, uint8_t **, int); extern size_t inet6_rthdr_space(int, int); extern struct cmsghdr *inet6_rthdr_init(void *, int); extern int inet6_rthdr_add(struct cmsghdr *, const struct in6_addr *, unsigned int); extern int inet6_rthdr_lasthop(struct cmsghdr *, unsigned int); #if 0 /* not implemented yet */ extern int inet6_rthdr_reverse(const struct cmsghdr *, struct cmsghdr *); #endif extern int inet6_rthdr_segments(const struct cmsghdr *); extern struct in6_addr *inet6_rthdr_getaddr(struct cmsghdr *, int); extern int inet6_rthdr_getflags(const struct cmsghdr *, int); extern int inet6_opt_init(void *, socklen_t); extern int inet6_opt_append(void *, socklen_t, int, uint8_t, socklen_t, uint8_t, void **); extern int inet6_opt_finish(void *, socklen_t, int); extern int inet6_opt_set_val(void *, int, void *, socklen_t); extern int inet6_opt_next(void *, socklen_t, int, uint8_t *, socklen_t *, void **); extern int inet6_opt_find(void *, socklen_t, int, uint8_t, socklen_t *, void **); extern int inet6_opt_get_val(void *, int, void *, socklen_t); extern socklen_t inet6_rth_space(int, int); extern void *inet6_rth_init(void *, socklen_t, int, int); extern int inet6_rth_add(void *, const struct in6_addr *); extern int inet6_rth_reverse(const void *, void *); extern int inet6_rth_segments(const void *); extern struct in6_addr *inet6_rth_getaddr(const void *, int); __END_DECLS #endif /* _NETBSD_SOURCE */ #if defined(_KERNEL) || defined(_TEST) int in6_print(char *, size_t, const struct in6_addr *); #define IN6_PRINT(b, a) (in6_print((b), sizeof(b), (a)), (b)) int sin6_print(char *, size_t, const void *); #endif #endif /* !_NETINET6_IN6_H_ */ @ 1.100 log @Add IP_BINDANY, IPV6_BINDANY which can be used to bind to any address in order to implement transparent proxies. @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.99 2020/06/12 11:04:45 roy Exp $ */ d432 1 a432 1 #define IPV6_DSTOPTS 50 /* ip6_dest; send dst option befor rthdr */ d443 1 a443 1 * the sorce address */ @ 1.100.6.1 log @Sync with HEAD. @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.101 2021/07/31 10:12:04 andvar Exp $ */ d432 1 a432 1 #define IPV6_DSTOPTS 50 /* ip6_dest; send dst option before rthdr */ d443 1 a443 1 * the source address */ @ 1.99 log @Remove in-kernel handling of Router Advertisements This is much better handled by a user-land tool. Proposed on tech-net here: https://mail-index.netbsd.org/tech-net/2020/04/22/msg007766.html Note that the ioctl SIOCGIFINFO_IN6 no longer sets flags. That now needs to be done using the pre-existing SIOCSIFINFO_FLAGS ioctl. Compat is fully provided where it makes sense, but trying to turn on RA handling will obviously throw an error as it no longer exists. Note that if you use IPv6 temporary addresses, this now needs to be turned on in dhcpcd.conf(5) rather than in sysctl.conf(5). @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.98 2019/11/01 04:28:14 knakahara Exp $ */ d444 1 @ 1.98 log @Make global and per-interface ipsecif(4) pmtu tunable like gif(4). And make hop limit tunable same as gif(4). See http://mail-index.netbsd.org/source-changes/2019/10/30/msg110426.html @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.97 2019/10/30 03:45:59 knakahara Exp $ */ d509 1 a509 1 #define IPV6CTL_ACCEPT_RTADV 12 d519 1 a519 1 #define IPV6CTL_RR_PRUNE 22 /* walk timer for router renumbering */ d535 2 a536 4 #define IPV6CTL_RTADV_MAXROUTES 43 /* maximum number of routes */ /* via router advertisement */ #define IPV6CTL_RTADV_NUMROUTES 44 /* current number of routes */ /* via router advertisement */ @ 1.97 log @Add sysctl nodes to control fragmentation with IPv[46] over IPv6 gif(4). New sysctl node "net.inet6.ip6.gifpmtu" means - 0 (default) Fragment by IPV6_MMTU. All packets reach the destination certainly, however the long packet performance is poor. This is same behavior as before. - 1 Fragment by outer interface's MTU. The long packet performance would be good, however the packets may be dropped in some network paths whose path MTU less than the interface's MTU. - others undefined yet New sysctl node "net.interfaces.gif*.pmtu" means - -1 (default) Use system default value (net.inet6.ip6.gifpmtu). - 0 Fragment by IPV6_MMTU for this gif(4) tunnel. - 1 Fragment by outer interface's MTU for this gif(4) tunnel. - others undefined yet See RFC4459 for more information and other solutions. @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.96 2019/09/05 20:17:27 kamil Exp $ */ d540 2 @ 1.96 log @Revert regression introduced in in6.h r. 1.95 ---------------------------- revision 1.95 date: 2019-05-28 05:56:46 +0200; author: kamil; state: Exp; lines: +2 -2; commitid: YrUzDYl5zfcjiVoB; Decorate struct in6_addr with the __packed attribute This avoids undefined behavior when accessing misaligned pointers. Detected by kUBSan. Patch by Akul Pillai. ---------------------------- This change caused regression in at least qemu and addresses potential binary ABI breakage. Fixes PR/54523 by @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.95 2019/05/28 03:56:46 kamil Exp $ */ d539 1 @ 1.95 log @Decorate struct in6_addr with the __packed attribute This avoids undefined behavior when accessing misaligned pointers. Detected by kUBSan. Patch by Akul Pillai. @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.94 2018/12/10 16:28:52 christos Exp $ */ d129 1 a129 1 } __packed; @ 1.95.2.1 log @Pull up following revision(s) (requested by kamil in ticket #183): sys/netinet6/in6.h: revision 1.96 Revert regression introduced in in6.h r. 1.95 ---------------------------- revision 1.95 date: 2019-05-28 05:56:46 +0200; author: kamil; state: Exp; lines: +2 -2; commitid: YrUzDYl5zfcjiVoB; Decorate struct in6_addr with the __packed attribute This avoids undefined behavior when accessing misaligned pointers. Detected by kUBSan. Patch by Akul Pillai. ---------------------------- This change caused regression in at least qemu and addresses potential binary ABI breakage. Fixes PR/54523 by @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.95 2019/05/28 03:56:46 kamil Exp $ */ d129 1 a129 1 }; @ 1.94 log @need (or arpa/inet.h) for ntohl() used in macros. @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.93 2018/08/22 01:05:24 msaitoh Exp $ */ d129 1 a129 1 }; @ 1.93 log @- Cleanup for dynamic sysctl: - Remove unused *_NAMES macros for sysctl. - Remove unused *_MAXID for sysctls. - Move CTL_MACHDEP sysctl definitions for m68k into m68k/include/cpu.h and use them on all m68k machines. @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.92 2018/08/10 06:46:09 maxv Exp $ */ d74 1 @ 1.92 log @Rename ip6_undefer_csum -> in6_undefer_cksum in6_delayed_cksum -> in6_undefer_cksum_tcpudp The two previous names were inconsistent and misleading. Put the two functions into in6_offload.c. Add comments to explain what we're doing. Same as IPv4. @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.91 2018/04/19 21:22:02 christos Exp $ */ a493 49 #define IPV6PROTO_MAXID (IPPROTO_PIM + 1) /* don't list to IPV6PROTO_MAX */ #define CTL_IPV6PROTO_NAMES { \ { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, \ { 0, 0 }, \ { "tcp6", CTLTYPE_NODE }, \ { 0, 0 }, \ { 0, 0 }, \ { 0, 0 }, \ { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, \ { 0, 0 }, \ { 0, 0 }, \ { "udp6", CTLTYPE_NODE }, \ { 0, 0 }, \ { 0, 0 }, \ { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, \ { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, \ { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, \ { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, \ { 0, 0 }, \ { "ip6", CTLTYPE_NODE }, \ { 0, 0 }, \ { 0, 0 }, \ { 0, 0 }, \ { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, \ { 0, 0 }, \ { "ipsec6", CTLTYPE_NODE }, \ { 0, 0 }, \ { 0, 0 }, \ { 0, 0 }, \ { 0, 0 }, \ { 0, 0 }, \ { 0, 0 }, \ { "icmp6", CTLTYPE_NODE }, \ { 0, 0 }, \ { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, \ { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, \ { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, \ { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, \ { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, \ { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, \ { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, \ { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, \ { 0, 0 }, \ { 0, 0 }, \ { 0, 0 }, \ { "pim6", CTLTYPE_NODE }, \ } a537 52 /* New entries should be added here from current IPV6CTL_MAXID value. */ /* to define items, should talk with KAME guys first, for *BSD compatibility */ #define IPV6CTL_MAXID 45 #define IPV6CTL_NAMES { \ { 0, 0 }, \ { "forwarding", CTLTYPE_INT }, \ { "redirect", CTLTYPE_INT }, \ { "hlim", CTLTYPE_INT }, \ { "mtu", CTLTYPE_INT }, \ { "forwsrcrt", CTLTYPE_INT }, \ { "stats", CTLTYPE_STRUCT }, \ { 0, 0 }, \ { "mrtproto", CTLTYPE_INT }, \ { "maxfragpackets", CTLTYPE_INT }, \ { "sourcecheck", CTLTYPE_INT }, \ { "sourcecheck_logint", CTLTYPE_INT }, \ { "accept_rtadv", CTLTYPE_INT }, \ { "keepfaith", CTLTYPE_INT }, \ { "log_interval", CTLTYPE_INT }, \ { "hdrnestlimit", CTLTYPE_INT }, \ { "dad_count", CTLTYPE_INT }, \ { "auto_flowlabel", CTLTYPE_INT }, \ { "defmcasthlim", CTLTYPE_INT }, \ { "gifhlim", CTLTYPE_INT }, \ { "kame_version", CTLTYPE_STRING }, \ { "use_deprecated", CTLTYPE_INT }, \ { "rr_prune", CTLTYPE_INT }, \ { 0, 0 }, \ { "v6only", CTLTYPE_INT }, \ { 0, 0 }, \ { 0, 0 }, \ { 0, 0 }, \ { "anonportmin", CTLTYPE_INT }, \ { "anonportmax", CTLTYPE_INT }, \ { "lowportmin", CTLTYPE_INT }, \ { "lowportmax", CTLTYPE_INT }, \ { 0, 0 }, \ { 0, 0 }, \ { 0, 0 }, \ { 0, 0 }, \ { 0, 0 }, \ { 0, 0 }, \ { 0, 0 }, \ { 0, 0 }, \ { 0, 0 }, \ { "maxfrags", CTLTYPE_INT }, \ { "ifq", CTLTYPE_NODE }, \ { "rtadv_maxroutes", CTLTYPE_INT }, \ { "rtadv_numroutes", CTLTYPE_INT }, \ } @ 1.91 log @s/static inline/static __inline/g for consistency. @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.90 2018/02/09 18:31:52 maxv Exp $ */ a700 1 void in6_delayed_cksum(struct mbuf *); @ 1.91.2.1 log @Sync with HEAD @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.95 2019/05/28 03:56:46 kamil Exp $ */ a73 1 #include /* ntohl */ d128 1 a128 1 } __packed; d494 49 d587 52 d701 1 @ 1.91.2.2 log @Mostly merge changes from HEAD upto 20200411 @ text @d1 1 a1 1 /* $NetBSD$ */ d129 1 a129 1 }; a538 3 #define IPV6CTL_GIF_PMTU 45 /* gif(4) Path MTU setting */ #define IPV6CTL_IPSEC_HLIM 46 /* default HLIM for ipsecif encap packet */ #define IPV6CTL_IPSEC_PMTU 47 /* ipsecif(4) Path MTU setting */ @ 1.90 log @Remove dead code. @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.89 2018/01/30 15:54:02 maxv Exp $ */ d723 1 a723 1 static inline void d733 1 a733 1 static inline void d742 1 a742 1 static inline struct sockaddr * @ 1.90.2.1 log @Sync with HEAD @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.91 2018/04/19 21:22:02 christos Exp $ */ d723 1 a723 1 static __inline void d733 1 a733 1 static __inline void d742 1 a742 1 static __inline struct sockaddr * @ 1.90.2.2 log @Sync with HEAD Resolve a couple of conflicts (result of the uimin/uimax changes) @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.93 2018/08/22 01:05:24 msaitoh Exp $ */ d494 49 d587 52 d701 1 @ 1.90.2.3 log @Sync with HEAD, resolve a few conflicts @ text @d1 1 a1 1 /* $NetBSD$ */ a73 1 #include /* ntohl */ @ 1.89 log @Style, localify, remove dead code, and fix typos. No functional change. @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.88 2018/01/10 10:56:30 knakahara Exp $ */ d549 1 a549 3 #ifdef notyet #define IPV6CTL_DEFMTU 4 /* default MTU */ #endif @ 1.88 log @add ipsec(4) interface, which is used for route-based VPN. man and ATF are added later, please see man for details. reviewed by christos@@n.o, joerg@@n.o and ozaki-r@@n.o, thanks. https://mail-index.netbsd.org/tech-net/2017/12/18/msg006557.html @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.87 2016/02/15 14:59:03 rtr Exp $ */ d558 1 a558 1 #define IPV6CTL_SOURCECHECK_LOGINT 11 /* minimume logging interval */ @ 1.87 log @Reduce code duplication. Split creation of IPv4-Mapped IPv6 addresses into its own function and use it. No functional change intended. As posted to tech-net@@ @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.86 2015/12/12 23:34:25 christos Exp $ */ d715 4 @ 1.87.10.1 log @Pull up following revision(s) (requested by ozaki-r in ticket #536): distrib/sets/lists/base/shl.mi: 1.825 distrib/sets/lists/comp/mi: 1.2168-1.2169 distrib/sets/lists/comp/shl.mi: 1.310 distrib/sets/lists/debug/mi: 1.234 distrib/sets/lists/debug/shl.mi: 1.188 distrib/sets/lists/man/mi: 1.1570 distrib/sets/lists/tests/mi: 1.772 etc/mtree/NetBSD.dist.tests: 1.150 share/man/man4/Makefile: 1.650 share/man/man4/ipsec.4: 1.42-1.43 share/man/man4/ipsecif.4: 1.1-1.5 sys/arch/amd64/conf/ALL: 1.77 sys/arch/amd64/conf/GENERIC: 1.480 sys/conf/files: 1.1191 sys/net/Makefile: 1.34 sys/net/files.net: 1.14 sys/net/if.c: 1.404 sys/net/if.h: 1.248 sys/net/if_gif.c: 1.135 sys/net/if_ipsec.c: 1.1-1.3 sys/net/if_ipsec.h: 1.1 sys/net/if_l2tp.c: 1.16 sys/net/if_types.h: 1.28 sys/netinet/in.c: 1.214 sys/netinet/in.h: 1.103 sys/netinet/in_gif.c: 1.92 sys/netinet/ip_var.h: 1.122 sys/netinet6/in6.c: 1.257 sys/netinet6/in6.h: 1.88 sys/netinet6/in6_gif.c: 1.90 sys/netinet6/ip6_var.h: 1.75 sys/netipsec/Makefile: 1.6 sys/netipsec/files.netipsec: 1.13 sys/netipsec/ipsec.h: 1.62 sys/netipsec/ipsecif.c: 1.1 sys/netipsec/ipsecif.h: 1.1 sys/netipsec/key.c: 1.246-1.247 sys/netipsec/key.h: 1.34 sys/rump/net/Makefile.rumpnetcomp: 1.20 sys/rump/net/lib/libipsec/IPSEC.ioconf: 1.1 sys/rump/net/lib/libipsec/Makefile: 1.1 sys/rump/net/lib/libipsec/ipsec_component.c: 1.1 tests/net/Makefile: 1.34 tests/net/if_ipsec/Makefile: 1.1 tests/net/if_ipsec/t_ipsec.sh: 1.1-1.2 Don't touch an SP without a reference to it unify processing to check nesting count for some tunnel protocols. add ipsec(4) interface, which is used for route-based VPN. man and ATF are added later, please see man for details. reviewed by christos@@n.o, joerg@@n.o and ozaki-r@@n.o, thanks. https://mail-index.netbsd.org/tech-net/2017/12/18/msg006557.html ipsec(4) interface supports rump now. add ipsec(4) interface ATF. add ipsec(4) interface man as ipsecif.4. add ipsec(4) interface to amd64/GENERIC and amd64/ALL configs. apply in{,6}_tunnel_validate() to gif(4). Spell IPsec that way. Simplify macro usage. Sort SEE ALSO. Bump date for previous. Improve wording and macro use. Some parts are not clear to me, so someone with knowledge of ipsecif(4) should improve this some more. Improve ipsecif.4. Default port ipsec(4) NAT-T is tested now. pointed out by wiz@@n.o and suggested by ozaki-r@@n.o, thanks. Change the prefix of test names to ipsecif_ to distinguish from tests for ipsec(4) New sentence, new line. Remove empty macro. Fix PR kern/52920. Pointed out by David Binderman, thanks. Improve wording, and put a new drawing, from me and Kengo Nakahara. apply a little more #ifdef INET/INET6. fixes !INET6 builds. @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.87 2016/02/15 14:59:03 rtr Exp $ */ a714 4 struct ip6_hdr; int in6_tunnel_validate(const struct ip6_hdr *, const struct in6_addr *, const struct in6_addr *); @ 1.86 log @Hook up the addrctl stuff that's already there. @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.85 2015/08/07 08:11:33 ozaki-r Exp $ */ d771 1 @ 1.85 log @Use time_uptime instead of time_second to avoid time leaps Some codes in sys/net* use time_second to manage time periods such as cache expirations. However, time_second doesn't increase monotonically and can leap by say settimeofday(2) according to time_second(9). We should use time_uptime instead of it to avoid such time leaps. This change replaces time_second with time_uptime. Additionally it converts a time based on time_uptime to a time based on time_second when the kernel passes the time to userland programs that expect the latter, and vice versa. Note that we shouldn't leak time_uptime to other hosts over the netowrk. My investigation shows there is no such leak: http://mail-index.netbsd.org/tech-net/2015/08/06/msg005332.html Discussed on tech-kern and tech-net. @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.84 2015/04/22 19:46:08 roy Exp $ */ d579 2 a580 1 /* 36 to 38: reserved */ a711 3 #ifndef __FreeBSD__ extern int in6_src_sysctl(void *, size_t *, void *, size_t); #endif @ 1.84 log @Move INET6 specific in6_if_{up,down}() and in6_if_link_{up,down}() into agnostic domain functions. @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.83 2015/02/20 22:13:48 rjs Exp $ */ d360 1 a360 1 (u_int32_t)((time_second - (a)->ia6_updatetime)) > \ d364 1 a364 1 (u_int32_t)((time_second - (a)->ia6_updatetime)) > \ @ 1.83 log @Declare input argument to in6_sin_2_v4mapsin6 to be const, allows an address from the route cache to be used as the input. ok christos@@. @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.82 2015/01/20 21:27:36 roy Exp $ */ d708 1 @ 1.82 log @Add net.inet6.ip6.prefer_tempaddr sysctl knob so that we can prefer IPv6 temporary addresses as the source address. Fixes PR kern/47100 based on a patch by Dieter Roelants. @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.81 2014/12/02 20:25:48 christos Exp $ */ d773 1 a773 1 void in6_sin_2_v4mapsin6(struct sockaddr_in *, struct sockaddr_in6 *); @ 1.81 log @use the new printing code. @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.80 2014/12/02 19:36:58 christos Exp $ */ d441 2 @ 1.80 log @add routines to print in6_addr and sockaddr_in6 (in6_print, sin6_print) @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.79 2014/10/12 19:02:18 christos Exp $ */ d823 1 @ 1.79 log @document that we depend on the option numbers matching. @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.78 2014/06/05 23:48:16 rmind Exp $ */ d821 5 @ 1.79.2.1 log @Sync with HEAD @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.83 2015/02/20 22:13:48 rjs Exp $ */ a440 2 #define IPV6_PREFER_TEMPADDR 63 /* int; prefer temporary address as * the sorce address */ d771 1 a771 1 void in6_sin_2_v4mapsin6(const struct sockaddr_in *, struct sockaddr_in6 *); a820 6 #if defined(_KERNEL) || defined(_TEST) int in6_print(char *, size_t, const struct in6_addr *); #define IN6_PRINT(b, a) (in6_print((b), sizeof(b), (a)), (b)) int sin6_print(char *, size_t, const void *); #endif @ 1.79.2.2 log @Sync with HEAD @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.79.2.1 2015/04/06 15:18:23 skrll Exp $ */ a707 1 extern void in6_if_link_state_change(struct ifnet *, int); @ 1.79.2.3 log @Sync with HEAD @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.79.2.2 2015/06/06 14:40:25 skrll Exp $ */ d360 1 a360 1 (u_int32_t)((time_uptime - (a)->ia6_updatetime)) > \ d364 1 a364 1 (u_int32_t)((time_uptime - (a)->ia6_updatetime)) > \ @ 1.79.2.4 log @Sync with HEAD (as of 26th Dec) @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.79.2.3 2015/09/22 12:06:11 skrll Exp $ */ d579 1 a579 2 /* 36 to 37: reserved */ #define IPV6CTL_ADDRCTLPOLICY 38 /* get/set address selection policy */ d711 3 @ 1.79.2.5 log @Sync with HEAD @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.79.2.4 2015/12/27 12:10:07 skrll Exp $ */ a770 1 void in6_in_2_v4mapin6(const struct in_addr *, struct in6_addr *); @ 1.78 log @- Implement pktqueue interface for lockless IP input queue. - Replace ipintrq and ip6intrq with the pktqueue mechanism. - Eliminate kernel-lock from ipintr() and ip6intr(). - Some preparation work to push softnet_lock out of ipintr(). Discussed on tech-net. @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.77 2014/06/05 16:06:49 roy Exp $ */ d386 1 @ 1.78.2.1 log @Pull up following revision(s) (requested by pettai in ticket #441): sys/netinet6/ip6_var.h: revision 1.64 sys/netinet6/in6.h: revision 1.82 sys/netinet6/in6_src.c: revision 1.56 sys/netinet6/mld6.c: revision 1.62 sys/netinet6/ip6_input.c: revision 1.150 sys/netinet6/ip6_output.c: revision 1.161 Add net.inet6.ip6.prefer_tempaddr sysctl knob so that we can prefer IPv6 temporary addresses as the source address. Fixes PR kern/47100 based on a patch by Dieter Roelants. @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.78 2014/06/05 23:48:16 rmind Exp $ */ a439 2 #define IPV6_PREFER_TEMPADDR 63 /* int; prefer temporary address as * the sorce address */ @ 1.77 log @Add IPV6CTL_AUTO_LINKLOCAL and ND6_IFF_AUTO_LINKLOCAL toggles which control the automatic creation of IPv6 link-local addresses when an interface is brought up. Taken from FreeBSD. @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.76 2014/05/30 01:39:03 christos Exp $ */ d580 1 a580 1 #define IPV6CTL_IFQ 42 /* ip6intrq node */ @ 1.76 log @Introduce 2 new variables: ipsec_enabled and ipsec_used. Ipsec enabled is controlled by sysctl and determines if is allowed. ipsec_used is set automatically based on ipsec being enabled, and rules existing. @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.75 2013/10/19 15:44:29 christos Exp $ */ d574 3 a576 1 /* 32 to 38: reserved */ @ 1.75 log @define constants for scopeid function flags. @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.74 2013/10/19 00:09:03 christos Exp $ */ a405 1 #if 1 /* IPSEC */ a406 1 #endif @ 1.75.2.1 log @Rebase. @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.78 2014/06/05 23:48:16 rmind Exp $ */ d406 1 d408 1 d576 1 a576 3 /* 32 to 34: reserved */ #define IPV6CTL_AUTO_LINKLOCAL 35 /* automatic link-local addr assign */ /* 36 to 38: reserved */ d580 1 a580 1 #define IPV6CTL_IFQ 42 /* IPv6 packet input queue */ @ 1.74 log @add scopeid functions @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.73 2013/06/20 13:56:29 roy Exp $ */ d774 3 @ 1.73 log @Move the detaching and making tentative addresses out if in6_if_up and into in6_if_link_up. This fixes a possible panic where link is up but not the interface. Note that a better solution would be to listen to the routing socket in the kernel, but I don't know how to do that. Reachable Router tests for IFF_UP as well. @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.72 2013/06/11 12:08:29 roy Exp $ */ d774 3 @ 1.73.2.1 log @sync with head @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.73 2013/06/20 13:56:29 roy Exp $ */ a773 6 #define INET6_IS_ADDR_LINKLOCAL 1 #define INET6_IS_ADDR_MC_LINKLOCAL 2 #define INET6_IS_ADDR_SITELOCAL 4 void inet6_getscopeid(struct sockaddr_in6 *, int); void inet6_putscopeid(struct sockaddr_in6 *, int); @ 1.72 log @When an interface link state changes to down, mark all attached IPv6 addresses as detached. Likewise, when the link state changes to up, mark all detached IPv6 as tentative and start DAD on them. Advertised router reachability now checks that link state is not down. This means that when an interface link state changes, the default IPv6 router may change as well. @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.71 2013/04/27 21:35:24 joerg Exp $ */ d703 2 @ 1.71 log @Systematically include sys/featuretest.h when _NETBSD_SOURCE is used. Some are redundant, but make verification with grep much easier. @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.70 2012/06/22 14:54:35 christos Exp $ */ d704 1 @ 1.70 log @PR/46602: Move the rfc6056 port randomization to the IP layer. @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.69 2011/05/24 18:07:11 spz Exp $ */ d67 2 @ 1.70.2.1 log @resync from head @ text @d1 1 a1 1 /* $NetBSD$ */ a66 2 #include a700 2 extern void in6_if_link_up(struct ifnet *); extern void in6_if_link_down(struct ifnet *); a701 1 extern void in6_if_down(struct ifnet *); @ 1.70.2.2 log @Rebase to HEAD as of a few days ago. @ text @d406 1 d408 1 d576 1 a576 3 /* 32 to 34: reserved */ #define IPV6CTL_AUTO_LINKLOCAL 35 /* automatic link-local addr assign */ /* 36 to 38: reserved */ d580 1 a580 1 #define IPV6CTL_IFQ 42 /* IPv6 packet input queue */ a773 6 #define INET6_IS_ADDR_LINKLOCAL 1 #define INET6_IS_ADDR_MC_LINKLOCAL 2 #define INET6_IS_ADDR_SITELOCAL 4 void inet6_getscopeid(struct sockaddr_in6 *, int); void inet6_putscopeid(struct sockaddr_in6 *, int); @ 1.70.2.3 log @update from HEAD @ text @d360 1 a360 1 (u_int32_t)((time_uptime - (a)->ia6_updatetime)) > \ d364 1 a364 1 (u_int32_t)((time_uptime - (a)->ia6_updatetime)) > \ a385 1 /* The join and leave membership option numbers need to match with the v4 ones */ a439 2 #define IPV6_PREFER_TEMPADDR 63 /* int; prefer temporary address as * the sorce address */ d576 1 a576 2 /* 36 to 37: reserved */ #define IPV6CTL_ADDRCTLPOLICY 38 /* get/set address selection policy */ a704 1 extern void in6_if_link_state_change(struct ifnet *, int); d707 3 a768 1 void in6_in_2_v4mapin6(const struct in_addr *, struct in6_addr *); d770 1 a770 1 void in6_sin_2_v4mapsin6(const struct sockaddr_in *, struct sockaddr_in6 *); a819 6 #if defined(_KERNEL) || defined(_TEST) int in6_print(char *, size_t, const struct in6_addr *); #define IN6_PRINT(b, a) (in6_print((b), sizeof(b), (a)), (b)) int sin6_print(char *, size_t, const void *); #endif @ 1.69 log @RA flood mitigation via a limit on accepted routes: - introduce a limit for the routes accepted via IPv6 Router Advertisement: a common 2 interface client will have 6, the default limit is 100 and can be adjusted via sysctl - report the current number of routes installed via RA via sysctl - count discarded route additions. Note that one RA message is two routes. This is at present only across all interfaces even though per-interface would be more useful, since the per-interface structure complies to RFC2466 - bump kernel version due to the previous change - adjust netstat to use the new value (with netstat -p icmp6) @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.68 2009/09/11 22:06:29 dyoung Exp $ */ d388 1 @ 1.69.4.1 log @sync with head @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.69 2011/05/24 18:07:11 spz Exp $ */ a387 1 #define IPV6_PORTALGO 17 /* int; port selection algo (rfc6056) */ @ 1.69.4.2 log @sync with head. for a reference, the tree before this commit was tagged as yamt-pagecache-tag8. this commit was splitted into small chunks to avoid a limitation of cvs. ("Protocol error: too many arguments") @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.69.4.1 2012/10/30 17:22:48 yamt Exp $ */ a66 2 #include a700 2 extern void in6_if_link_up(struct ifnet *); extern void in6_if_link_down(struct ifnet *); a701 1 extern void in6_if_down(struct ifnet *); a768 6 #define INET6_IS_ADDR_LINKLOCAL 1 #define INET6_IS_ADDR_MC_LINKLOCAL 2 #define INET6_IS_ADDR_SITELOCAL 4 void inet6_getscopeid(struct sockaddr_in6 *, int); void inet6_putscopeid(struct sockaddr_in6 *, int); @ 1.68 log @Make ifconfig(8) set and display preference numbers for IPv6 addresses. Make the kernel support SIOC[SG]IFADDRPREF for IPv6 interface addresses. In in6ifa_ifpforlinklocal(), consult preference numbers before making an otherwise arbitrary choice of in6_ifaddr. Otherwise, preference numbers are *not* consulted by the kernel, but that will be rather easy for somebody with a little bit of free time to fix. Please note that setting the preference number for a link-local IPv6 address does not work right, yet, but that ought to be fixed soon. In support of the changes above, 1 Add a method to struct domain for "externalizing" a sockaddr, and provide an implementation for IPv6. Expect more work in this area: it may be more proper to say that the IPv6 implementation "internalizes" a sockaddr. Add sockaddr_externalize(). 2 Add a subroutine, sofamily(), that returns a struct socket's address family or AF_UNSPEC. 3 Make a lot of IPv4-specific code generic, and move it from sys/netinet/ to sys/net/ for re-use by IPv6 parts of the kernel and ifconfig(8). @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.67 2009/08/19 18:52:48 seanb Exp $ */ d578 4 d584 1 a584 1 #define IPV6CTL_MAXID 43 d630 2 @ 1.68.6.1 log @Sync with HEAD. @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.69 2011/05/24 18:07:11 spz Exp $ */ a577 4 #define IPV6CTL_RTADV_MAXROUTES 43 /* maximum number of routes */ /* via router advertisement */ #define IPV6CTL_RTADV_NUMROUTES 44 /* current number of routes */ /* via router advertisement */ d580 1 a580 1 #define IPV6CTL_MAXID 45 a625 2 { "rtadv_maxroutes", CTLTYPE_INT }, \ { "rtadv_numroutes", CTLTYPE_INT }, \ @ 1.68.4.1 log @sync with head @ text @d1 1 a1 1 /* $NetBSD$ */ a577 4 #define IPV6CTL_RTADV_MAXROUTES 43 /* maximum number of routes */ /* via router advertisement */ #define IPV6CTL_RTADV_NUMROUTES 44 /* current number of routes */ /* via router advertisement */ d580 1 a580 1 #define IPV6CTL_MAXID 45 a625 2 { "rtadv_maxroutes", CTLTYPE_INT }, \ { "rtadv_numroutes", CTLTYPE_INT }, \ @ 1.67 log @- Newer gcc was throwning a 'dereferencing type-punned pointer will break strict-aliasing rules' warning against IN6_IS_ADDR_* macros at -O2 -Wall. @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.66 2007/12/25 18:33:47 perry Exp $ */ d687 2 @ 1.66 log @Convert many of the uses of __attribute__ to equivalent __packed, __unused and __dead macros from cdefs.h @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.65 2007/11/01 20:33:56 dyoung Exp $ */ d234 4 a237 4 ((*(const uint32_t *)(const void *)(&(a)->s6_addr[0]) == 0) && \ (*(const uint32_t *)(const void *)(&(a)->s6_addr[4]) == 0) && \ (*(const uint32_t *)(const void *)(&(a)->s6_addr[8]) == 0) && \ (*(const uint32_t *)(const void *)(&(a)->s6_addr[12]) == 0)) d243 4 a246 4 ((*(const uint32_t *)(const void *)(&(a)->s6_addr[0]) == 0) && \ (*(const uint32_t *)(const void *)(&(a)->s6_addr[4]) == 0) && \ (*(const uint32_t *)(const void *)(&(a)->s6_addr[8]) == 0) && \ (*(const uint32_t *)(const void *)(&(a)->s6_addr[12]) == ntohl(1))) d252 5 a256 5 ((*(const uint32_t *)(const void *)(&(a)->s6_addr[0]) == 0) && \ (*(const uint32_t *)(const void *)(&(a)->s6_addr[4]) == 0) && \ (*(const uint32_t *)(const void *)(&(a)->s6_addr[8]) == 0) && \ (*(const uint32_t *)(const void *)(&(a)->s6_addr[12]) != 0) && \ (*(const uint32_t *)(const void *)(&(a)->s6_addr[12]) != ntohl(1))) d262 3 a264 3 ((*(const uint32_t *)(const void *)(&(a)->s6_addr[0]) == 0) && \ (*(const uint32_t *)(const void *)(&(a)->s6_addr[4]) == 0) && \ (*(const uint32_t *)(const void *)(&(a)->s6_addr[8]) == ntohl(0x0000ffff))) @ 1.66.10.1 log @sync with head @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.66 2007/12/25 18:33:47 perry Exp $ */ d234 4 a237 4 ((a)->__u6_addr.__u6_addr32[0] == 0 && \ (a)->__u6_addr.__u6_addr32[1] == 0 && \ (a)->__u6_addr.__u6_addr32[2] == 0 && \ (a)->__u6_addr.__u6_addr32[3] == 0) d243 4 a246 4 ((a)->__u6_addr.__u6_addr32[0] == 0 && \ (a)->__u6_addr.__u6_addr32[1] == 0 && \ (a)->__u6_addr.__u6_addr32[2] == 0 && \ (a)->__u6_addr.__u6_addr32[3] == ntohl(1)) d252 5 a256 5 ((a)->__u6_addr.__u6_addr32[0] == 0 && \ (a)->__u6_addr.__u6_addr32[1] == 0 && \ (a)->__u6_addr.__u6_addr32[2] == 0 && \ (a)->__u6_addr.__u6_addr32[3] != 0 && \ (a)->__u6_addr.__u6_addr32[3] != ntohl(1)) d262 3 a264 3 ((a)->__u6_addr.__u6_addr32[0] == 0 && \ (a)->__u6_addr.__u6_addr32[1] == 0 && \ (a)->__u6_addr.__u6_addr32[2] == ntohl(0x0000ffff)) a686 2 struct sockaddr *sockaddr_in6_externalize(struct sockaddr *, socklen_t, const struct sockaddr *); @ 1.66.2.1 log @imported Mobile IPv6 code developed by the SHISA project (http://www.mobileip.jp/). @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.66 2007/12/25 18:33:47 perry Exp $ */ a278 1 #define __IPV6_ADDR_SCOPE_INTFACELOCAL 0x01 a443 1 #define IPV6_RTHDR_TYPE_2 2 /* IPv6 routing header type 2 for Mobile IPv6 */ @ 1.65 log @De-__P(). @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.64 2007/10/24 06:37:21 dyoung Exp $ */ d649 1 a649 1 static __inline u_int16_t __attribute__((__unused__)) @ 1.65.2.1 log @Sync with HEAD. @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.66 2007/12/25 18:33:47 perry Exp $ */ d649 1 a649 1 static __inline u_int16_t __unused @ 1.65.8.1 log @Sync with HEAD @ text @d1 1 a1 1 /* $NetBSD$ */ d649 1 a649 1 static __inline u_int16_t __unused @ 1.65.4.1 log @Sync with head. @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.66 2007/12/25 18:33:47 perry Exp $ */ d649 1 a649 1 static __inline u_int16_t __unused @ 1.64 log @Replace rote sockaddr_in6 initializations (memset(), set sa6_family, sa6_len, and sa6_add) with sockaddr_in6_init() calls. De-__P(). Constify. KNF. Shorten a staircase. Change bcmp() to memcmp(). Extract subroutine in6_setzoneid() from in6_setscope(), for re-use soon. @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.63 2007/10/07 12:43:19 joerg Exp $ */ d755 18 a772 18 void in6_sin6_2_sin __P((struct sockaddr_in *, struct sockaddr_in6 *)); void in6_sin_2_v4mapsin6 __P((struct sockaddr_in *, struct sockaddr_in6 *)); void in6_sin6_2_sin_in_sock __P((struct sockaddr *)); void in6_sin_2_v4mapsin6_in_sock __P((struct sockaddr **)); extern int inet6_option_space __P((int)); extern int inet6_option_init __P((void *, struct cmsghdr **, int)); extern int inet6_option_append __P((struct cmsghdr *, const uint8_t *, int, int)); extern uint8_t *inet6_option_alloc __P((struct cmsghdr *, int, int, int)); extern int inet6_option_next __P((const struct cmsghdr *, uint8_t **)); extern int inet6_option_find __P((const struct cmsghdr *, uint8_t **, int)); extern size_t inet6_rthdr_space __P((int, int)); extern struct cmsghdr *inet6_rthdr_init __P((void *, int)); extern int inet6_rthdr_add __P((struct cmsghdr *, const struct in6_addr *, unsigned int)); extern int inet6_rthdr_lasthop __P((struct cmsghdr *, unsigned int)); d774 1 a774 1 extern int inet6_rthdr_reverse __P((const struct cmsghdr *, struct cmsghdr *)); d776 21 a796 21 extern int inet6_rthdr_segments __P((const struct cmsghdr *)); extern struct in6_addr *inet6_rthdr_getaddr __P((struct cmsghdr *, int)); extern int inet6_rthdr_getflags __P((const struct cmsghdr *, int)); extern int inet6_opt_init __P((void *, socklen_t)); extern int inet6_opt_append __P((void *, socklen_t, int, uint8_t, socklen_t, uint8_t, void **)); extern int inet6_opt_finish __P((void *, socklen_t, int)); extern int inet6_opt_set_val __P((void *, int, void *, socklen_t)); extern int inet6_opt_next __P((void *, socklen_t, int, uint8_t *, socklen_t *, void **)); extern int inet6_opt_find __P((void *, socklen_t, int, uint8_t, socklen_t *, void **)); extern int inet6_opt_get_val __P((void *, int, void *, socklen_t)); extern socklen_t inet6_rth_space __P((int, int)); extern void *inet6_rth_init __P((void *, socklen_t, int, int)); extern int inet6_rth_add __P((void *, const struct in6_addr *)); extern int inet6_rth_reverse __P((const void *, void *)); extern int inet6_rth_segments __P((const void *)); extern struct in6_addr *inet6_rth_getaddr __P((const void *, int)); @ 1.63 log @NetBSD doesn't have to care about missing bcmp on OpenBSD/SPARC, just use memcmp in both kernel and userland. @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.62 2007/08/30 02:17:37 dyoung Exp $ */ d687 6 a692 6 int in6_cksum __P((struct mbuf *, u_int8_t, u_int32_t, u_int32_t)); void in6_delayed_cksum __P((struct mbuf *)); int in6_localaddr __P((struct in6_addr *)); int in6_addrscope __P((struct in6_addr *)); struct in6_ifaddr *in6_ifawithifp __P((struct ifnet *, struct in6_addr *)); extern void in6_if_up __P((struct ifnet *)); d694 1 a694 1 extern int in6_src_sysctl __P((void *, size_t *, void *, size_t)); d696 1 a696 1 extern void addrsel_policy_init __P((void)); @ 1.63.2.1 log @Sync with HEAD @ text @d1 1 a1 1 /* $NetBSD$ */ d687 6 a692 6 int in6_cksum(struct mbuf *, u_int8_t, u_int32_t, u_int32_t); void in6_delayed_cksum(struct mbuf *); int in6_localaddr(const struct in6_addr *); int in6_addrscope(const struct in6_addr *); struct in6_ifaddr *in6_ifawithifp(struct ifnet *, struct in6_addr *); extern void in6_if_up(struct ifnet *); d694 1 a694 1 extern int in6_src_sysctl(void *, size_t *, void *, size_t); d696 1 a696 1 extern void addrsel_policy_init(void); d755 18 a772 18 void in6_sin6_2_sin(struct sockaddr_in *, struct sockaddr_in6 *); void in6_sin_2_v4mapsin6(struct sockaddr_in *, struct sockaddr_in6 *); void in6_sin6_2_sin_in_sock(struct sockaddr *); void in6_sin_2_v4mapsin6_in_sock(struct sockaddr **); extern int inet6_option_space(int); extern int inet6_option_init(void *, struct cmsghdr **, int); extern int inet6_option_append(struct cmsghdr *, const uint8_t *, int, int); extern uint8_t *inet6_option_alloc(struct cmsghdr *, int, int, int); extern int inet6_option_next(const struct cmsghdr *, uint8_t **); extern int inet6_option_find(const struct cmsghdr *, uint8_t **, int); extern size_t inet6_rthdr_space(int, int); extern struct cmsghdr *inet6_rthdr_init(void *, int); extern int inet6_rthdr_add(struct cmsghdr *, const struct in6_addr *, unsigned int); extern int inet6_rthdr_lasthop(struct cmsghdr *, unsigned int); d774 1 a774 1 extern int inet6_rthdr_reverse(const struct cmsghdr *, struct cmsghdr *); d776 21 a796 21 extern int inet6_rthdr_segments(const struct cmsghdr *); extern struct in6_addr *inet6_rthdr_getaddr(struct cmsghdr *, int); extern int inet6_rthdr_getflags(const struct cmsghdr *, int); extern int inet6_opt_init(void *, socklen_t); extern int inet6_opt_append(void *, socklen_t, int, uint8_t, socklen_t, uint8_t, void **); extern int inet6_opt_finish(void *, socklen_t, int); extern int inet6_opt_set_val(void *, int, void *, socklen_t); extern int inet6_opt_next(void *, socklen_t, int, uint8_t *, socklen_t *, void **); extern int inet6_opt_find(void *, socklen_t, int, uint8_t, socklen_t *, void **); extern int inet6_opt_get_val(void *, int, void *, socklen_t); extern socklen_t inet6_rth_space(int, int); extern void *inet6_rth_init(void *, socklen_t, int, int); extern int inet6_rth_add(void *, const struct in6_addr *); extern int inet6_rth_reverse(const void *, void *); extern int inet6_rth_segments(const void *); extern struct in6_addr *inet6_rth_getaddr(const void *, int); @ 1.62 log @Use malloc(9) for sockaddrs instead of pool(9), and remove dom_sa_pool and dom_sa_len members from struct domain. Pools of fixed-size objects are too rigid for sockaddr_dls, whose size can vary over a wide range. Return sockaddr_dl to its "historical" size. Now that I'm using malloc(9) instead of pool(9) to allocate sockaddr_dl, I can create a sockaddr_dl of any size in the kernel, so expanding sockaddr_dl is useless. Avoid using sizeof(struct sockaddr_dl) in the kernel. Introduce sockaddr_dl_alloc() for allocating & initializing an arbitrary sockaddr_dl on the heap. Add an argument, the sockaddr length, to sockaddr_alloc(), sockaddr_copy(), and sockaddr_dl_setaddr(). Constify: LLADDR() -> CLLADDR(). Where the kernel overwrites LLADDR(), use sockaddr_dl_setaddr(), instead. Used properly, sockaddr_dl_setaddr() will not overrun the end of the sockaddr. @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.61 2007/06/28 21:03:47 christos Exp $ */ a226 10 /* * Equality * NOTE: Some of kernel programming environment (for example, openbsd/sparc) * does not supply memcmp(). For userland memcmp() is preferred as it is * in ANSI standard. */ #ifdef _KERNEL #define IN6_ARE_ADDR_EQUAL(a, b) \ (bcmp(&(a)->s6_addr[0], &(b)->s6_addr[0], sizeof(struct in6_addr)) == 0) #else a228 1 #endif @ 1.62.2.1 log @sync with head. @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.62 2007/08/30 02:17:37 dyoung Exp $ */ d227 10 d239 1 @ 1.61 log @Add functions to do mapped address conversions from FreeBSD. @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.60 2007/05/02 20:40:26 dyoung Exp $ */ d741 2 a742 1 if ((sa = sockaddr_alloc(AF_INET6, flags)) == NULL) @ 1.61.8.1 log @sync with HEAD @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.65 2007/11/01 20:33:56 dyoung Exp $ */ d227 10 d239 1 d698 6 a703 6 int in6_cksum(struct mbuf *, u_int8_t, u_int32_t, u_int32_t); void in6_delayed_cksum(struct mbuf *); int in6_localaddr(const struct in6_addr *); int in6_addrscope(const struct in6_addr *); struct in6_ifaddr *in6_ifawithifp(struct ifnet *, struct in6_addr *); extern void in6_if_up(struct ifnet *); d705 1 a705 1 extern int in6_src_sysctl(void *, size_t *, void *, size_t); d707 1 a707 1 extern void addrsel_policy_init(void); d741 1 a741 2 if ((sa = sockaddr_alloc(AF_INET6, sizeof(struct sockaddr_in6), flags)) == NULL) d765 18 a782 18 void in6_sin6_2_sin(struct sockaddr_in *, struct sockaddr_in6 *); void in6_sin_2_v4mapsin6(struct sockaddr_in *, struct sockaddr_in6 *); void in6_sin6_2_sin_in_sock(struct sockaddr *); void in6_sin_2_v4mapsin6_in_sock(struct sockaddr **); extern int inet6_option_space(int); extern int inet6_option_init(void *, struct cmsghdr **, int); extern int inet6_option_append(struct cmsghdr *, const uint8_t *, int, int); extern uint8_t *inet6_option_alloc(struct cmsghdr *, int, int, int); extern int inet6_option_next(const struct cmsghdr *, uint8_t **); extern int inet6_option_find(const struct cmsghdr *, uint8_t **, int); extern size_t inet6_rthdr_space(int, int); extern struct cmsghdr *inet6_rthdr_init(void *, int); extern int inet6_rthdr_add(struct cmsghdr *, const struct in6_addr *, unsigned int); extern int inet6_rthdr_lasthop(struct cmsghdr *, unsigned int); d784 1 a784 1 extern int inet6_rthdr_reverse(const struct cmsghdr *, struct cmsghdr *); d786 21 a806 21 extern int inet6_rthdr_segments(const struct cmsghdr *); extern struct in6_addr *inet6_rthdr_getaddr(struct cmsghdr *, int); extern int inet6_rthdr_getflags(const struct cmsghdr *, int); extern int inet6_opt_init(void *, socklen_t); extern int inet6_opt_append(void *, socklen_t, int, uint8_t, socklen_t, uint8_t, void **); extern int inet6_opt_finish(void *, socklen_t, int); extern int inet6_opt_set_val(void *, int, void *, socklen_t); extern int inet6_opt_next(void *, socklen_t, int, uint8_t *, socklen_t *, void **); extern int inet6_opt_find(void *, socklen_t, int, uint8_t, socklen_t *, void **); extern int inet6_opt_get_val(void *, int, void *, socklen_t); extern socklen_t inet6_rth_space(int, int); extern void *inet6_rth_init(void *, socklen_t, int, int); extern int inet6_rth_add(void *, const struct in6_addr *); extern int inet6_rth_reverse(const void *, void *); extern int inet6_rth_segments(const void *); extern struct in6_addr *inet6_rth_getaddr(const void *, int); @ 1.61.8.2 log @sync with HEAD @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.61.8.1 2007/11/06 23:33:59 matt Exp $ */ d649 1 a649 1 static __inline u_int16_t __unused @ 1.61.6.1 log @Sync with HEAD. @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.62 2007/08/30 02:17:37 dyoung Exp $ */ d741 1 a741 2 if ((sa = sockaddr_alloc(AF_INET6, sizeof(struct sockaddr_in6), flags)) == NULL) @ 1.61.6.2 log @Sync with HEAD. Follow the merge of pmap.c on i386 and amd64 and move pmap_init_tmp_pgtbl into arch/x86/x86/pmap.c. Modify the ACPI wakeup code to restore CR4 before jumping back into kernel space as the large page option might cover that. @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.61.6.1 2007/09/03 16:49:07 jmcneill Exp $ */ d227 10 d239 1 d698 6 a703 6 int in6_cksum(struct mbuf *, u_int8_t, u_int32_t, u_int32_t); void in6_delayed_cksum(struct mbuf *); int in6_localaddr(const struct in6_addr *); int in6_addrscope(const struct in6_addr *); struct in6_ifaddr *in6_ifawithifp(struct ifnet *, struct in6_addr *); extern void in6_if_up(struct ifnet *); d705 1 a705 1 extern int in6_src_sysctl(void *, size_t *, void *, size_t); d707 1 a707 1 extern void addrsel_policy_init(void); @ 1.61.6.3 log @Sync with HEAD. @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.65 2007/11/01 20:33:56 dyoung Exp $ */ d755 18 a772 18 void in6_sin6_2_sin(struct sockaddr_in *, struct sockaddr_in6 *); void in6_sin_2_v4mapsin6(struct sockaddr_in *, struct sockaddr_in6 *); void in6_sin6_2_sin_in_sock(struct sockaddr *); void in6_sin_2_v4mapsin6_in_sock(struct sockaddr **); extern int inet6_option_space(int); extern int inet6_option_init(void *, struct cmsghdr **, int); extern int inet6_option_append(struct cmsghdr *, const uint8_t *, int, int); extern uint8_t *inet6_option_alloc(struct cmsghdr *, int, int, int); extern int inet6_option_next(const struct cmsghdr *, uint8_t **); extern int inet6_option_find(const struct cmsghdr *, uint8_t **, int); extern size_t inet6_rthdr_space(int, int); extern struct cmsghdr *inet6_rthdr_init(void *, int); extern int inet6_rthdr_add(struct cmsghdr *, const struct in6_addr *, unsigned int); extern int inet6_rthdr_lasthop(struct cmsghdr *, unsigned int); d774 1 a774 1 extern int inet6_rthdr_reverse(const struct cmsghdr *, struct cmsghdr *); d776 21 a796 21 extern int inet6_rthdr_segments(const struct cmsghdr *); extern struct in6_addr *inet6_rthdr_getaddr(struct cmsghdr *, int); extern int inet6_rthdr_getflags(const struct cmsghdr *, int); extern int inet6_opt_init(void *, socklen_t); extern int inet6_opt_append(void *, socklen_t, int, uint8_t, socklen_t, uint8_t, void **); extern int inet6_opt_finish(void *, socklen_t, int); extern int inet6_opt_set_val(void *, int, void *, socklen_t); extern int inet6_opt_next(void *, socklen_t, int, uint8_t *, socklen_t *, void **); extern int inet6_opt_find(void *, socklen_t, int, uint8_t, socklen_t *, void **); extern int inet6_opt_get_val(void *, int, void *, socklen_t); extern socklen_t inet6_rth_space(int, int); extern void *inet6_rth_init(void *, socklen_t, int, int); extern int inet6_rth_add(void *, const struct in6_addr *); extern int inet6_rth_reverse(const void *, void *); extern int inet6_rth_segments(const void *); extern struct in6_addr *inet6_rth_getaddr(const void *, int); @ 1.61.2.1 log @Sync with HEAD. @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.62 2007/08/30 02:17:37 dyoung Exp $ */ d741 1 a741 2 if ((sa = sockaddr_alloc(AF_INET6, sizeof(struct sockaddr_in6), flags)) == NULL) @ 1.60 log @Eliminate address family-specific route caches (struct route, struct route_in6, struct route_iso), replacing all caches with a struct route. The principle benefit of this change is that all of the protocol families can benefit from route cache-invalidation, which is necessary for correct routing. Route-cache invalidation fixes an ancient PR, kern/3508, at long last; it fixes various other PRs, also. Discussions with and ideas from Joerg Sonnenberger influenced this work tremendously. Of course, all design oversights and bugs are mine. DETAILS 1 I added to each address family a pool of sockaddrs. I have introduced routines for allocating, copying, and duplicating, and freeing sockaddrs: struct sockaddr *sockaddr_alloc(sa_family_t af, int flags); struct sockaddr *sockaddr_copy(struct sockaddr *dst, const struct sockaddr *src); struct sockaddr *sockaddr_dup(const struct sockaddr *src, int flags); void sockaddr_free(struct sockaddr *sa); sockaddr_alloc() returns either a sockaddr from the pool belonging to the specified family, or NULL if the pool is exhausted. The returned sockaddr has the right size for that family; sa_family and sa_len fields are initialized to the family and sockaddr length---e.g., sa_family = AF_INET and sa_len = sizeof(struct sockaddr_in). sockaddr_free() puts the given sockaddr back into its family's pool. sockaddr_dup() and sockaddr_copy() work analogously to strdup() and strcpy(), respectively. sockaddr_copy() KASSERTs that the family of the destination and source sockaddrs are alike. The 'flags' argumet for sockaddr_alloc() and sockaddr_dup() is passed directly to pool_get(9). 2 I added routines for initializing sockaddrs in each address family, sockaddr_in_init(), sockaddr_in6_init(), sockaddr_iso_init(), etc. They are fairly self-explanatory. 3 structs route_in6 and route_iso are no more. All protocol families use struct route. I have changed the route cache, 'struct route', so that it does not contain storage space for a sockaddr. Instead, struct route points to a sockaddr coming from the pool the sockaddr belongs to. I added a new method to struct route, rtcache_setdst(), for setting the cache destination: int rtcache_setdst(struct route *, const struct sockaddr *); rtcache_setdst() returns 0 on success, or ENOMEM if no memory is available to create the sockaddr storage. It is now possible for rtcache_getdst() to return NULL if, say, rtcache_setdst() failed. I check the return value for NULL everywhere in the kernel. 4 Each routing domain (struct domain) has a list of live route caches, dom_rtcache. rtflushall(sa_family_t af) looks up the domain indicated by 'af', walks the domain's list of route caches and invalidates each one. @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.59 2007/02/17 22:34:13 dyoung Exp $ */ d765 5 @ 1.59 log @KNF: de-__P, bzero -> memset, bcmp -> memcmp. Remove extraneous parentheses in return statements. Cosmetic: don't open-code TAILQ_FOREACH(). Cosmetic: change types of variables to avoid oodles of casts: in in6_src.c, avoid casts by changing several route_in6 pointers to struct route pointers. Remove unnecessary casts to caddr_t elsewhere. Pave the way for eliminating address family-specific route caches: soon, struct route will not embed a sockaddr, but it will hold a reference to an external sockaddr, instead. We will set the destination sockaddr using rtcache_setdst(). (I created a stub for it, but it isn't used anywhere, yet.) rtcache_free() will free the sockaddr. I have extracted from rtcache_free() a helper subroutine, rtcache_clear(). rtcache_clear() will "forget" a cached route, but it will not forget the destination by releasing the sockaddr. I use rtcache_clear() instead of rtcache_free() in rtcache_update(), because rtcache_update() is not supposed to forget the destination. Constify: 1 Introduce const accessor for route->ro_dst, rtcache_getdst(). 2 Constify the 'dst' argument to ifnet->if_output(). This led me to constify a lot of code called by output routines. 3 Constify the sockaddr argument to protosw->pr_ctlinput. This led me to constify a lot of code called by ctlinput routines. 4 Introduce const macros for converting from a generic sockaddr to family-specific sockaddrs, e.g., sockaddr_in: satocsin6, satocsin, et cetera. @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.58 2007/02/15 16:28:37 seanb Exp $ */ a377 10 * IP6 route structure */ #if defined(_NETBSD_SOURCE) struct route_in6 { struct rtentry *ro_rt; struct sockaddr_in6 ro_dst; }; #endif /* d697 1 d713 1 d715 33 @ 1.59.6.1 log @Sync with head. @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.61 2007/06/28 21:03:47 christos Exp $ */ d378 10 a706 1 int sockaddr_in6_cmp(const struct sockaddr *, const struct sockaddr *); a721 1 #define sin6tocsa(sin6) ((const struct sockaddr *)(sin6)) a722 33 static inline void sockaddr_in6_init1(struct sockaddr_in6 *sin6, const struct in6_addr *addr, in_port_t port, uint32_t flowinfo, uint32_t scope_id) { sin6->sin6_port = port; sin6->sin6_flowinfo = flowinfo; sin6->sin6_addr = *addr; sin6->sin6_scope_id = scope_id; } static inline void sockaddr_in6_init(struct sockaddr_in6 *sin6, const struct in6_addr *addr, in_port_t port, uint32_t flowinfo, uint32_t scope_id) { sin6->sin6_family = AF_INET6; sin6->sin6_len = sizeof(*sin6); sockaddr_in6_init1(sin6, addr, port, flowinfo, scope_id); } static inline struct sockaddr * sockaddr_in6_alloc(const struct in6_addr *addr, in_port_t port, uint32_t flowinfo, uint32_t scope_id, int flags) { struct sockaddr *sa; if ((sa = sockaddr_alloc(AF_INET6, flags)) == NULL) return NULL; sockaddr_in6_init1(satosin6(sa), addr, port, flowinfo, scope_id); return sa; } a739 5 void in6_sin6_2_sin __P((struct sockaddr_in *, struct sockaddr_in6 *)); void in6_sin_2_v4mapsin6 __P((struct sockaddr_in *, struct sockaddr_in6 *)); void in6_sin6_2_sin_in_sock __P((struct sockaddr *)); void in6_sin_2_v4mapsin6_in_sock __P((struct sockaddr **)); @ 1.59.4.1 log @Sync with head. @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.59 2007/02/17 22:34:13 dyoung Exp $ */ d378 10 a706 1 int sockaddr_in6_cmp(const struct sockaddr *, const struct sockaddr *); a721 1 #define sin6tocsa(sin6) ((const struct sockaddr *)(sin6)) a722 33 static inline void sockaddr_in6_init1(struct sockaddr_in6 *sin6, const struct in6_addr *addr, in_port_t port, uint32_t flowinfo, uint32_t scope_id) { sin6->sin6_port = port; sin6->sin6_flowinfo = flowinfo; sin6->sin6_addr = *addr; sin6->sin6_scope_id = scope_id; } static inline void sockaddr_in6_init(struct sockaddr_in6 *sin6, const struct in6_addr *addr, in_port_t port, uint32_t flowinfo, uint32_t scope_id) { sin6->sin6_family = AF_INET6; sin6->sin6_len = sizeof(*sin6); sockaddr_in6_init1(sin6, addr, port, flowinfo, scope_id); } static inline struct sockaddr * sockaddr_in6_alloc(const struct in6_addr *addr, in_port_t port, uint32_t flowinfo, uint32_t scope_id, int flags) { struct sockaddr *sa; if ((sa = sockaddr_alloc(AF_INET6, flags)) == NULL) return NULL; sockaddr_in6_init1(satosin6(sa), addr, port, flowinfo, scope_id); return sa; } @ 1.59.4.2 log @Sync with head. @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.59.4.1 2007/06/08 14:17:52 ad Exp $ */ a764 5 void in6_sin6_2_sin __P((struct sockaddr_in *, struct sockaddr_in6 *)); void in6_sin_2_v4mapsin6 __P((struct sockaddr_in *, struct sockaddr_in6 *)); void in6_sin6_2_sin_in_sock __P((struct sockaddr *)); void in6_sin_2_v4mapsin6_in_sock __P((struct sockaddr **)); @ 1.59.4.3 log @Sync with head. @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.59.4.2 2007/07/15 13:28:00 ad Exp $ */ d227 10 d239 1 d741 1 a741 2 if ((sa = sockaddr_alloc(AF_INET6, sizeof(struct sockaddr_in6), flags)) == NULL) @ 1.58 log @Typo in comment. @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.57 2006/10/31 00:29:30 cbiere Exp $ */ d720 1 @ 1.58.2.1 log @- sync with head. - move sched_changepri back to kern_synch.c as it doesn't know PPQ anymore. @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.58 2007/02/15 16:28:37 seanb Exp $ */ a719 1 #define satocsin6(sa) ((const struct sockaddr_in6 *)(sa)) @ 1.58.2.2 log @sync with head. @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.58.2.1 2007/02/27 16:54:59 yamt Exp $ */ d378 10 a706 1 int sockaddr_in6_cmp(const struct sockaddr *, const struct sockaddr *); a721 1 #define sin6tocsa(sin6) ((const struct sockaddr *)(sin6)) a722 33 static inline void sockaddr_in6_init1(struct sockaddr_in6 *sin6, const struct in6_addr *addr, in_port_t port, uint32_t flowinfo, uint32_t scope_id) { sin6->sin6_port = port; sin6->sin6_flowinfo = flowinfo; sin6->sin6_addr = *addr; sin6->sin6_scope_id = scope_id; } static inline void sockaddr_in6_init(struct sockaddr_in6 *sin6, const struct in6_addr *addr, in_port_t port, uint32_t flowinfo, uint32_t scope_id) { sin6->sin6_family = AF_INET6; sin6->sin6_len = sizeof(*sin6); sockaddr_in6_init1(sin6, addr, port, flowinfo, scope_id); } static inline struct sockaddr * sockaddr_in6_alloc(const struct in6_addr *addr, in_port_t port, uint32_t flowinfo, uint32_t scope_id, int flags) { struct sockaddr *sa; if ((sa = sockaddr_alloc(AF_INET6, flags)) == NULL) return NULL; sockaddr_in6_init1(satosin6(sa), addr, port, flowinfo, scope_id); return sa; } @ 1.57 log @Commented out IPv6 socket options which are no longer supported. @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.56 2006/06/07 22:34:03 kardel Exp $ */ d417 1 a417 1 #define IPV6_2292DSTOPTS 23 /* bool; destinaion option */ @ 1.56 log @merge FreeBSD timecounters from branch simonb-timecounters - struct timeval time is gone time.tv_sec -> time_second - struct timeval mono_time is gone mono_time.tv_sec -> time_uptime - access to time via {get,}{micro,nano,bin}time() get* versions are fast but less precise - support NTP nanokernel implementation (NTP API 4) - further reading: Timecounter Paper: http://phk.freebsd.dk/pubs/timecounter.pdf NTP Nanokernel: http://www.eecis.udel.edu/~mills/ntp/html/kern.html @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.55 2006/05/07 23:41:17 rpaulo Exp $ */ d391 3 a394 3 /* no hdrincl */ #define IPV6_SOCKOPT_RESERVED1 3 /* reserved for future use */ #define IPV6_UNICAST_HOPS 4 /* int; IP6 hops */ d399 3 @ 1.56.8.1 log @sync with head. @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.56 2006/06/07 22:34:03 kardel Exp $ */ d391 1 d393 2 a394 3 #if 0 /* These are deprecated non-standard options which are no longer supported. */ #define IPV6_OPTIONS 1 /* buf/ip6_opts; set/get IP6 options */ a398 3 #endif #define IPV6_SOCKOPT_RESERVED1 3 /* reserved for future use */ #define IPV6_UNICAST_HOPS 4 /* int; IP6 hops */ @ 1.56.6.1 log @Sync with head. @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.57 2006/10/31 00:29:30 cbiere Exp $ */ d391 1 d393 2 a394 3 #if 0 /* These are deprecated non-standard options which are no longer supported. */ #define IPV6_OPTIONS 1 /* buf/ip6_opts; set/get IP6 options */ a398 3 #endif #define IPV6_SOCKOPT_RESERVED1 3 /* reserved for future use */ #define IPV6_UNICAST_HOPS 4 /* int; IP6 hops */ @ 1.55 log @Use C99 uintXX_t types so that applications don't need to include sys/types.h directly (as in the past). @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.54 2006/05/05 00:03:22 rpaulo Exp $ */ d369 1 a369 1 (u_int32_t)((time.tv_sec - (a)->ia6_updatetime)) > \ d373 1 a373 1 (u_int32_t)((time.tv_sec - (a)->ia6_updatetime)) > \ @ 1.55.2.1 log @Sync with head. @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.56 2006/06/07 22:34:03 kardel Exp $ */ d369 1 a369 1 (u_int32_t)((time_second - (a)->ia6_updatetime)) > \ d373 1 a373 1 (u_int32_t)((time_second - (a)->ia6_updatetime)) > \ @ 1.54 log @Add support for RFC 3542 Adv. Socket API for IPv6 (which obsoletes 2292). * RFC 3542 isn't binary compatible with RFC 2292. * RFC 2292 support is on by default but can be disabled. * update ping6, telnet and traceroute6 to the new API. From the KAME project (www.kame.net). Reviewed by core. @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.53 2006/03/29 21:29:59 dyoung Exp $ */ d490 1 a490 1 u_int32_t ip6m_mtu; d757 2 a758 2 extern int inet6_opt_append __P((void *, socklen_t, int, u_int8_t, socklen_t, u_int8_t, void **)); d762 1 a762 1 extern int inet6_opt_next __P((void *, socklen_t, int, u_int8_t *, d764 1 a764 1 extern int inet6_opt_find __P((void *, socklen_t, int, u_int8_t, @ 1.53 log @Add predicate IN6_IS_SCOPE_EMBEDDABLE(__a), which is true if and only if the address __a is the type in which the IPv6 stack embeds scope information. @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.52 2006/02/16 20:17:20 perry Exp $ */ d71 2 d408 10 a417 7 #define IPV6_PKTINFO 19 /* bool; send/rcv if, src/dst addr */ #define IPV6_HOPLIMIT 20 /* bool; hop limit */ #define IPV6_NEXTHOP 21 /* bool; next hop addr */ #define IPV6_HOPOPTS 22 /* bool; hop-by-hop option */ #define IPV6_DSTOPTS 23 /* bool; destination option */ #define IPV6_RTHDR 24 /* bool; routing header */ #define IPV6_PKTOPTIONS 25 /* buf/cmsghdr; set/get IPv6 options */ d425 12 d438 19 d486 8 d755 18 @ 1.52 log @Change "inline" back to "__inline" in .h files -- C99 is still too new, and some apps compile things in C89 mode. C89 keywords stay. As per core@@. @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.51 2006/01/21 00:15:36 rpaulo Exp $ */ d362 3 @ 1.52.4.1 log @sync with head. @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.53 2006/03/29 21:29:59 dyoung Exp $ */ a361 3 #define IN6_IS_SCOPE_EMBEDDABLE(__a) \ (IN6_IS_SCOPE_LINKLOCAL(__a) || IN6_IS_ADDR_MC_INTFACELOCAL(__a)) @ 1.52.4.2 log @sync with head @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.52.4.1 2006/04/19 04:46:11 elad Exp $ */ a70 2 #include d406 7 a412 10 /* RFC2292 options */ #ifdef _KERNEL #define IPV6_2292PKTINFO 19 /* bool; send/recv if, src/dst addr */ #define IPV6_2292HOPLIMIT 20 /* bool; hop limit */ #define IPV6_2292NEXTHOP 21 /* bool; next hop addr */ #define IPV6_2292HOPOPTS 22 /* bool; hop-by-hop option */ #define IPV6_2292DSTOPTS 23 /* bool; destinaion option */ #define IPV6_2292RTHDR 24 /* bool; routing header */ #define IPV6_2292PKTOPTIONS 25 /* buf/cmsghdr; set/get IPv6 options */ #endif a419 12 /* new socket options introduced in RFC3542 */ #define IPV6_RTHDRDSTOPTS 35 /* ip6_dest; send dst option before rthdr */ #define IPV6_RECVPKTINFO 36 /* bool; recv if, dst addr */ #define IPV6_RECVHOPLIMIT 37 /* bool; recv hop limit */ #define IPV6_RECVRTHDR 38 /* bool; recv routing header */ #define IPV6_RECVHOPOPTS 39 /* bool; recv hop-by-hop option */ #define IPV6_RECVDSTOPTS 40 /* bool; recv dst option after rthdr */ #ifdef _KERNEL #define IPV6_RECVRTHDRDSTOPTS 41 /* bool; recv dst option before rthdr */ #endif a420 19 #define IPV6_RECVPATHMTU 43 /* bool; notify an according MTU */ #define IPV6_PATHMTU 44 /* mtuinfo; get the current path MTU (sopt), 4 bytes int; MTU notification (cmsg) */ /* more new socket options introduced in RFC3542 */ #define IPV6_PKTINFO 46 /* in6_pktinfo; send if, src addr */ #define IPV6_HOPLIMIT 47 /* int; send hop limit */ #define IPV6_NEXTHOP 48 /* sockaddr; next hop addr */ #define IPV6_HOPOPTS 49 /* ip6_hbh; send hop-by-hop option */ #define IPV6_DSTOPTS 50 /* ip6_dest; send dst option befor rthdr */ #define IPV6_RTHDR 51 /* ip6_rthdr; send routing header */ #define IPV6_RECVTCLASS 57 /* bool; recv traffic class values */ #ifdef _KERNEL #define IPV6_OTCLASS 58 /* u_int8_t; send traffic class value */ #endif #define IPV6_TCLASS 61 /* int; send traffic class value */ #define IPV6_DONTFRAG 62 /* bool; disable IPv6 fragmentation */ a449 8 * Control structure for IPV6_RECVPATHMTU socket option. */ struct ip6_mtuinfo { struct sockaddr_in6 ip6m_addr; /* or sockaddr_storage? */ uint32_t ip6m_mtu; }; /* a710 18 extern int inet6_opt_init __P((void *, socklen_t)); extern int inet6_opt_append __P((void *, socklen_t, int, uint8_t, socklen_t, uint8_t, void **)); extern int inet6_opt_finish __P((void *, socklen_t, int)); extern int inet6_opt_set_val __P((void *, int, void *, socklen_t)); extern int inet6_opt_next __P((void *, socklen_t, int, uint8_t *, socklen_t *, void **)); extern int inet6_opt_find __P((void *, socklen_t, int, uint8_t, socklen_t *, void **)); extern int inet6_opt_get_val __P((void *, int, void *, socklen_t)); extern socklen_t inet6_rth_space __P((int, int)); extern void *inet6_rth_init __P((void *, socklen_t, int, int)); extern int inet6_rth_add __P((void *, const struct in6_addr *)); extern int inet6_rth_reverse __P((const void *, void *)); extern int inet6_rth_segments __P((const void *)); extern struct in6_addr *inet6_rth_getaddr __P((const void *, int)); @ 1.52.2.1 log @sync with head. @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.52 2006/02/16 20:17:20 perry Exp $ */ a361 3 #define IN6_IS_SCOPE_EMBEDDABLE(__a) \ (IN6_IS_SCOPE_LINKLOCAL(__a) || IN6_IS_ADDR_MC_INTFACELOCAL(__a)) @ 1.52.2.2 log @sync with head. @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.52.2.1 2006/04/01 12:07:49 yamt Exp $ */ a70 2 #include d406 7 a412 10 /* RFC2292 options */ #ifdef _KERNEL #define IPV6_2292PKTINFO 19 /* bool; send/recv if, src/dst addr */ #define IPV6_2292HOPLIMIT 20 /* bool; hop limit */ #define IPV6_2292NEXTHOP 21 /* bool; next hop addr */ #define IPV6_2292HOPOPTS 22 /* bool; hop-by-hop option */ #define IPV6_2292DSTOPTS 23 /* bool; destinaion option */ #define IPV6_2292RTHDR 24 /* bool; routing header */ #define IPV6_2292PKTOPTIONS 25 /* buf/cmsghdr; set/get IPv6 options */ #endif a419 12 /* new socket options introduced in RFC3542 */ #define IPV6_RTHDRDSTOPTS 35 /* ip6_dest; send dst option before rthdr */ #define IPV6_RECVPKTINFO 36 /* bool; recv if, dst addr */ #define IPV6_RECVHOPLIMIT 37 /* bool; recv hop limit */ #define IPV6_RECVRTHDR 38 /* bool; recv routing header */ #define IPV6_RECVHOPOPTS 39 /* bool; recv hop-by-hop option */ #define IPV6_RECVDSTOPTS 40 /* bool; recv dst option after rthdr */ #ifdef _KERNEL #define IPV6_RECVRTHDRDSTOPTS 41 /* bool; recv dst option before rthdr */ #endif a420 19 #define IPV6_RECVPATHMTU 43 /* bool; notify an according MTU */ #define IPV6_PATHMTU 44 /* mtuinfo; get the current path MTU (sopt), 4 bytes int; MTU notification (cmsg) */ /* more new socket options introduced in RFC3542 */ #define IPV6_PKTINFO 46 /* in6_pktinfo; send if, src addr */ #define IPV6_HOPLIMIT 47 /* int; send hop limit */ #define IPV6_NEXTHOP 48 /* sockaddr; next hop addr */ #define IPV6_HOPOPTS 49 /* ip6_hbh; send hop-by-hop option */ #define IPV6_DSTOPTS 50 /* ip6_dest; send dst option befor rthdr */ #define IPV6_RTHDR 51 /* ip6_rthdr; send routing header */ #define IPV6_RECVTCLASS 57 /* bool; recv traffic class values */ #ifdef _KERNEL #define IPV6_OTCLASS 58 /* u_int8_t; send traffic class value */ #endif #define IPV6_TCLASS 61 /* int; send traffic class value */ #define IPV6_DONTFRAG 62 /* bool; disable IPv6 fragmentation */ a449 8 * Control structure for IPV6_RECVPATHMTU socket option. */ struct ip6_mtuinfo { struct sockaddr_in6 ip6m_addr; /* or sockaddr_storage? */ uint32_t ip6m_mtu; }; /* a710 18 extern int inet6_opt_init __P((void *, socklen_t)); extern int inet6_opt_append __P((void *, socklen_t, int, uint8_t, socklen_t, uint8_t, void **)); extern int inet6_opt_finish __P((void *, socklen_t, int)); extern int inet6_opt_set_val __P((void *, int, void *, socklen_t)); extern int inet6_opt_next __P((void *, socklen_t, int, uint8_t *, socklen_t *, void **)); extern int inet6_opt_find __P((void *, socklen_t, int, uint8_t, socklen_t *, void **)); extern int inet6_opt_get_val __P((void *, int, void *, socklen_t)); extern socklen_t inet6_rth_space __P((int, int)); extern void *inet6_rth_init __P((void *, socklen_t, int, int)); extern int inet6_rth_add __P((void *, const struct in6_addr *)); extern int inet6_rth_reverse __P((const void *, void *)); extern int inet6_rth_segments __P((const void *)); extern struct in6_addr *inet6_rth_getaddr __P((const void *, int)); @ 1.52.2.3 log @sync with head. @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.52.2.2 2006/05/24 10:59:09 yamt Exp $ */ d369 1 a369 1 (u_int32_t)((time_second - (a)->ia6_updatetime)) > \ d373 1 a373 1 (u_int32_t)((time_second - (a)->ia6_updatetime)) > \ @ 1.52.6.1 log @Merge 2006-03-31 NetBSD-current into the "peter-altq" branch. @ text @d1 1 a1 1 /* $NetBSD$ */ a361 3 #define IN6_IS_SCOPE_EMBEDDABLE(__a) \ (IN6_IS_SCOPE_LINKLOCAL(__a) || IN6_IS_ADDR_MC_INTFACELOCAL(__a)) @ 1.52.6.2 log @Merge 2006-05-24 NetBSD-current into the "peter-altq" branch. @ text @a70 2 #include d406 7 a412 10 /* RFC2292 options */ #ifdef _KERNEL #define IPV6_2292PKTINFO 19 /* bool; send/recv if, src/dst addr */ #define IPV6_2292HOPLIMIT 20 /* bool; hop limit */ #define IPV6_2292NEXTHOP 21 /* bool; next hop addr */ #define IPV6_2292HOPOPTS 22 /* bool; hop-by-hop option */ #define IPV6_2292DSTOPTS 23 /* bool; destinaion option */ #define IPV6_2292RTHDR 24 /* bool; routing header */ #define IPV6_2292PKTOPTIONS 25 /* buf/cmsghdr; set/get IPv6 options */ #endif a419 12 /* new socket options introduced in RFC3542 */ #define IPV6_RTHDRDSTOPTS 35 /* ip6_dest; send dst option before rthdr */ #define IPV6_RECVPKTINFO 36 /* bool; recv if, dst addr */ #define IPV6_RECVHOPLIMIT 37 /* bool; recv hop limit */ #define IPV6_RECVRTHDR 38 /* bool; recv routing header */ #define IPV6_RECVHOPOPTS 39 /* bool; recv hop-by-hop option */ #define IPV6_RECVDSTOPTS 40 /* bool; recv dst option after rthdr */ #ifdef _KERNEL #define IPV6_RECVRTHDRDSTOPTS 41 /* bool; recv dst option before rthdr */ #endif a420 19 #define IPV6_RECVPATHMTU 43 /* bool; notify an according MTU */ #define IPV6_PATHMTU 44 /* mtuinfo; get the current path MTU (sopt), 4 bytes int; MTU notification (cmsg) */ /* more new socket options introduced in RFC3542 */ #define IPV6_PKTINFO 46 /* in6_pktinfo; send if, src addr */ #define IPV6_HOPLIMIT 47 /* int; send hop limit */ #define IPV6_NEXTHOP 48 /* sockaddr; next hop addr */ #define IPV6_HOPOPTS 49 /* ip6_hbh; send hop-by-hop option */ #define IPV6_DSTOPTS 50 /* ip6_dest; send dst option befor rthdr */ #define IPV6_RTHDR 51 /* ip6_rthdr; send routing header */ #define IPV6_RECVTCLASS 57 /* bool; recv traffic class values */ #ifdef _KERNEL #define IPV6_OTCLASS 58 /* u_int8_t; send traffic class value */ #endif #define IPV6_TCLASS 61 /* int; send traffic class value */ #define IPV6_DONTFRAG 62 /* bool; disable IPv6 fragmentation */ a449 8 * Control structure for IPV6_RECVPATHMTU socket option. */ struct ip6_mtuinfo { struct sockaddr_in6 ip6m_addr; /* or sockaddr_storage? */ uint32_t ip6m_mtu; }; /* a710 18 extern int inet6_opt_init __P((void *, socklen_t)); extern int inet6_opt_append __P((void *, socklen_t, int, uint8_t, socklen_t, uint8_t, void **)); extern int inet6_opt_finish __P((void *, socklen_t, int)); extern int inet6_opt_set_val __P((void *, int, void *, socklen_t)); extern int inet6_opt_next __P((void *, socklen_t, int, uint8_t *, socklen_t *, void **)); extern int inet6_opt_find __P((void *, socklen_t, int, uint8_t, socklen_t *, void **)); extern int inet6_opt_get_val __P((void *, int, void *, socklen_t)); extern socklen_t inet6_rth_space __P((int, int)); extern void *inet6_rth_init __P((void *, socklen_t, int, int)); extern int inet6_rth_add __P((void *, const struct in6_addr *)); extern int inet6_rth_reverse __P((const void *, void *)); extern int inet6_rth_segments __P((const void *)); extern struct in6_addr *inet6_rth_getaddr __P((const void *, int)); @ 1.51 log @Better support of IPv6 scoped addresses. - most of the kernel code will not care about the actual encoding of scope zone IDs and won't touch "s6_addr16[1]" directly. - similarly, most of the kernel code will not care about link-local scoped addresses as a special case. - scope boundary check will be stricter. For example, the current *BSD code allows a packet with src=::1 and dst=(some global IPv6 address) to be sent outside of the node, if the application do: s = socket(AF_INET6); bind(s, "::1"); sendto(s, some_global_IPv6_addr); This is clearly wrong, since ::1 is only meaningful within a single node, but the current implementation of the *BSD kernel cannot reject this attempt. - and, while there, don't try to remove the ff02::/32 interface route entry in in6_ifdetach() as it's already gone. This also includes some level of support for the standard source address selection algorithm defined in RFC3484, which will be completed on in the future. From the KAME project via JINMEI Tatuya. Approved by core@@. @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.50 2005/12/24 20:45:09 perry Exp $ */ d620 1 a620 1 static inline u_int16_t __attribute__((__unused__)) @ 1.51.2.1 log @sync with head @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.56 2006/06/07 22:34:03 kardel Exp $ */ a70 2 #include a361 3 #define IN6_IS_SCOPE_EMBEDDABLE(__a) \ (IN6_IS_SCOPE_LINKLOCAL(__a) || IN6_IS_ADDR_MC_INTFACELOCAL(__a)) d364 1 a364 1 (u_int32_t)((time_second - (a)->ia6_updatetime)) > \ d368 1 a368 1 (u_int32_t)((time_second - (a)->ia6_updatetime)) > \ d403 7 a409 10 /* RFC2292 options */ #ifdef _KERNEL #define IPV6_2292PKTINFO 19 /* bool; send/recv if, src/dst addr */ #define IPV6_2292HOPLIMIT 20 /* bool; hop limit */ #define IPV6_2292NEXTHOP 21 /* bool; next hop addr */ #define IPV6_2292HOPOPTS 22 /* bool; hop-by-hop option */ #define IPV6_2292DSTOPTS 23 /* bool; destinaion option */ #define IPV6_2292RTHDR 24 /* bool; routing header */ #define IPV6_2292PKTOPTIONS 25 /* buf/cmsghdr; set/get IPv6 options */ #endif a416 12 /* new socket options introduced in RFC3542 */ #define IPV6_RTHDRDSTOPTS 35 /* ip6_dest; send dst option before rthdr */ #define IPV6_RECVPKTINFO 36 /* bool; recv if, dst addr */ #define IPV6_RECVHOPLIMIT 37 /* bool; recv hop limit */ #define IPV6_RECVRTHDR 38 /* bool; recv routing header */ #define IPV6_RECVHOPOPTS 39 /* bool; recv hop-by-hop option */ #define IPV6_RECVDSTOPTS 40 /* bool; recv dst option after rthdr */ #ifdef _KERNEL #define IPV6_RECVRTHDRDSTOPTS 41 /* bool; recv dst option before rthdr */ #endif a417 19 #define IPV6_RECVPATHMTU 43 /* bool; notify an according MTU */ #define IPV6_PATHMTU 44 /* mtuinfo; get the current path MTU (sopt), 4 bytes int; MTU notification (cmsg) */ /* more new socket options introduced in RFC3542 */ #define IPV6_PKTINFO 46 /* in6_pktinfo; send if, src addr */ #define IPV6_HOPLIMIT 47 /* int; send hop limit */ #define IPV6_NEXTHOP 48 /* sockaddr; next hop addr */ #define IPV6_HOPOPTS 49 /* ip6_hbh; send hop-by-hop option */ #define IPV6_DSTOPTS 50 /* ip6_dest; send dst option befor rthdr */ #define IPV6_RTHDR 51 /* ip6_rthdr; send routing header */ #define IPV6_RECVTCLASS 57 /* bool; recv traffic class values */ #ifdef _KERNEL #define IPV6_OTCLASS 58 /* u_int8_t; send traffic class value */ #endif #define IPV6_TCLASS 61 /* int; send traffic class value */ #define IPV6_DONTFRAG 62 /* bool; disable IPv6 fragmentation */ a446 8 * Control structure for IPV6_RECVPATHMTU socket option. */ struct ip6_mtuinfo { struct sockaddr_in6 ip6m_addr; /* or sockaddr_storage? */ uint32_t ip6m_mtu; }; /* d620 1 a620 1 static __inline u_int16_t __attribute__((__unused__)) a707 18 extern int inet6_opt_init __P((void *, socklen_t)); extern int inet6_opt_append __P((void *, socklen_t, int, uint8_t, socklen_t, uint8_t, void **)); extern int inet6_opt_finish __P((void *, socklen_t, int)); extern int inet6_opt_set_val __P((void *, int, void *, socklen_t)); extern int inet6_opt_next __P((void *, socklen_t, int, uint8_t *, socklen_t *, void **)); extern int inet6_opt_find __P((void *, socklen_t, int, uint8_t, socklen_t *, void **)); extern int inet6_opt_get_val __P((void *, int, void *, socklen_t)); extern socklen_t inet6_rth_space __P((int, int)); extern void *inet6_rth_init __P((void *, socklen_t, int, int)); extern int inet6_rth_add __P((void *, const struct in6_addr *)); extern int inet6_rth_reverse __P((const void *, void *)); extern int inet6_rth_segments __P((const void *)); extern struct in6_addr *inet6_rth_getaddr __P((const void *, int)); @ 1.51.4.1 log @Adapt for timecounters: mostly use get*time(), use bintime's for timeout calculations and use "time_second" instead of "time.tv_sec". @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.51 2006/01/21 00:15:36 rpaulo Exp $ */ d364 1 a364 1 (u_int32_t)((time_second - (a)->ia6_updatetime)) > \ d368 1 a368 1 (u_int32_t)((time_second - (a)->ia6_updatetime)) > \ @ 1.51.4.2 log @Sync with head. @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.53 2006/03/29 21:29:59 dyoung Exp $ */ a361 3 #define IN6_IS_SCOPE_EMBEDDABLE(__a) \ (IN6_IS_SCOPE_LINKLOCAL(__a) || IN6_IS_ADDR_MC_INTFACELOCAL(__a)) d620 1 a620 1 static __inline u_int16_t __attribute__((__unused__)) @ 1.51.4.3 log @Sync with head. @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.51.4.2 2006/04/22 11:40:12 simonb Exp $ */ a70 2 #include d406 7 a412 10 /* RFC2292 options */ #ifdef _KERNEL #define IPV6_2292PKTINFO 19 /* bool; send/recv if, src/dst addr */ #define IPV6_2292HOPLIMIT 20 /* bool; hop limit */ #define IPV6_2292NEXTHOP 21 /* bool; next hop addr */ #define IPV6_2292HOPOPTS 22 /* bool; hop-by-hop option */ #define IPV6_2292DSTOPTS 23 /* bool; destinaion option */ #define IPV6_2292RTHDR 24 /* bool; routing header */ #define IPV6_2292PKTOPTIONS 25 /* buf/cmsghdr; set/get IPv6 options */ #endif a419 12 /* new socket options introduced in RFC3542 */ #define IPV6_RTHDRDSTOPTS 35 /* ip6_dest; send dst option before rthdr */ #define IPV6_RECVPKTINFO 36 /* bool; recv if, dst addr */ #define IPV6_RECVHOPLIMIT 37 /* bool; recv hop limit */ #define IPV6_RECVRTHDR 38 /* bool; recv routing header */ #define IPV6_RECVHOPOPTS 39 /* bool; recv hop-by-hop option */ #define IPV6_RECVDSTOPTS 40 /* bool; recv dst option after rthdr */ #ifdef _KERNEL #define IPV6_RECVRTHDRDSTOPTS 41 /* bool; recv dst option before rthdr */ #endif a420 19 #define IPV6_RECVPATHMTU 43 /* bool; notify an according MTU */ #define IPV6_PATHMTU 44 /* mtuinfo; get the current path MTU (sopt), 4 bytes int; MTU notification (cmsg) */ /* more new socket options introduced in RFC3542 */ #define IPV6_PKTINFO 46 /* in6_pktinfo; send if, src addr */ #define IPV6_HOPLIMIT 47 /* int; send hop limit */ #define IPV6_NEXTHOP 48 /* sockaddr; next hop addr */ #define IPV6_HOPOPTS 49 /* ip6_hbh; send hop-by-hop option */ #define IPV6_DSTOPTS 50 /* ip6_dest; send dst option befor rthdr */ #define IPV6_RTHDR 51 /* ip6_rthdr; send routing header */ #define IPV6_RECVTCLASS 57 /* bool; recv traffic class values */ #ifdef _KERNEL #define IPV6_OTCLASS 58 /* u_int8_t; send traffic class value */ #endif #define IPV6_TCLASS 61 /* int; send traffic class value */ #define IPV6_DONTFRAG 62 /* bool; disable IPv6 fragmentation */ a449 8 * Control structure for IPV6_RECVPATHMTU socket option. */ struct ip6_mtuinfo { struct sockaddr_in6 ip6m_addr; /* or sockaddr_storage? */ uint32_t ip6m_mtu; }; /* a710 18 extern int inet6_opt_init __P((void *, socklen_t)); extern int inet6_opt_append __P((void *, socklen_t, int, uint8_t, socklen_t, uint8_t, void **)); extern int inet6_opt_finish __P((void *, socklen_t, int)); extern int inet6_opt_set_val __P((void *, int, void *, socklen_t)); extern int inet6_opt_next __P((void *, socklen_t, int, uint8_t *, socklen_t *, void **)); extern int inet6_opt_find __P((void *, socklen_t, int, uint8_t, socklen_t *, void **)); extern int inet6_opt_get_val __P((void *, int, void *, socklen_t)); extern socklen_t inet6_rth_space __P((int, int)); extern void *inet6_rth_init __P((void *, socklen_t, int, int)); extern int inet6_rth_add __P((void *, const struct in6_addr *)); extern int inet6_rth_reverse __P((const void *, void *)); extern int inet6_rth_segments __P((const void *)); extern struct in6_addr *inet6_rth_getaddr __P((const void *, int)); @ 1.50 log @Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete. @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.49 2005/12/20 19:32:58 christos Exp $ */ d281 1 d321 3 d544 3 a546 1 /* 32 to 40: resrved */ a660 1 struct in6_ifaddr *in6_ifawithscope __P((struct ifnet *, struct in6_addr *)); d663 4 @ 1.50.2.1 log @sync with head. @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.50 2005/12/24 20:45:09 perry Exp $ */ a280 1 #define IPV6_ADDR_SCOPE_INTFACELOCAL 0x01 a319 3 #define IN6_IS_ADDR_MC_INTFACELOCAL(a) \ (IN6_IS_ADDR_MULTICAST(a) && \ (IPV6_ADDR_MC_SCOPE(a) == IPV6_ADDR_SCOPE_INTFACELOCAL)) d540 1 a540 3 /* 32 to 38: reserved */ #define IPV6CTL_USE_DEFAULTZONE 39 /* use default scope zone */ /* 40: reserved */ d655 1 a657 4 #ifndef __FreeBSD__ extern int in6_src_sysctl __P((void *, size_t *, void *, size_t)); #endif extern void addrsel_policy_init __P((void)); @ 1.50.2.2 log @sync with head. @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.50.2.1 2006/02/01 14:52:41 yamt Exp $ */ d620 1 a620 1 static __inline u_int16_t __attribute__((__unused__)) @ 1.49 log @Forward declarations for structs. @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.48 2005/12/10 23:39:56 elad Exp $ */ d614 1 a614 1 static __inline u_int16_t __attribute__((__unused__)) @ 1.48 log @Multiple inclusion protection, as suggested by christos@@ on tech-kern@@ few days ago. @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.47 2005/08/28 21:01:53 rpaulo Exp $ */ d649 2 @ 1.47 log @Implement net.inet6.ip6.stats sysctl. Reviewed by Elad Efrat. @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.46 2005/08/10 12:58:37 yamt Exp $ */ d64 3 a70 3 #ifndef _NETINET6_IN6_H_ #define _NETINET6_IN6_H_ @ 1.46 log @ipv6 tx checksum offloading. reviewed by Jason Thorpe. @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.45 2004/06/11 04:10:10 itojun Exp $ */ d554 1 a554 1 { 0, 0 }, \ @ 1.45 log @implement IPV6_USE_MIN_MTU sockopt. needed by bind9 + EDNS0 + big receive buffer. @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.44 2003/11/12 15:25:19 itojun Exp $ */ d650 1 @ 1.45.12.1 log @sync with head. @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.45 2004/06/11 04:10:10 itojun Exp $ */ a63 3 #ifndef _NETINET6_IN6_H_ #define _NETINET6_IN6_H_ d68 2 a69 1 #include a280 1 #define IPV6_ADDR_SCOPE_INTFACELOCAL 0x01 a319 3 #define IN6_IS_ADDR_MC_INTFACELOCAL(a) \ (IN6_IS_ADDR_MULTICAST(a) && \ (IPV6_ADDR_MC_SCOPE(a) == IPV6_ADDR_SCOPE_INTFACELOCAL)) a357 3 #define IN6_IS_SCOPE_EMBEDDABLE(__a) \ (IN6_IS_SCOPE_LINKLOCAL(__a) || IN6_IS_ADDR_MC_INTFACELOCAL(__a)) d360 1 a360 1 (u_int32_t)((time_second - (a)->ia6_updatetime)) > \ d364 1 a364 1 (u_int32_t)((time_second - (a)->ia6_updatetime)) > \ d399 7 a405 10 /* RFC2292 options */ #ifdef _KERNEL #define IPV6_2292PKTINFO 19 /* bool; send/recv if, src/dst addr */ #define IPV6_2292HOPLIMIT 20 /* bool; hop limit */ #define IPV6_2292NEXTHOP 21 /* bool; next hop addr */ #define IPV6_2292HOPOPTS 22 /* bool; hop-by-hop option */ #define IPV6_2292DSTOPTS 23 /* bool; destinaion option */ #define IPV6_2292RTHDR 24 /* bool; routing header */ #define IPV6_2292PKTOPTIONS 25 /* buf/cmsghdr; set/get IPv6 options */ #endif a412 12 /* new socket options introduced in RFC3542 */ #define IPV6_RTHDRDSTOPTS 35 /* ip6_dest; send dst option before rthdr */ #define IPV6_RECVPKTINFO 36 /* bool; recv if, dst addr */ #define IPV6_RECVHOPLIMIT 37 /* bool; recv hop limit */ #define IPV6_RECVRTHDR 38 /* bool; recv routing header */ #define IPV6_RECVHOPOPTS 39 /* bool; recv hop-by-hop option */ #define IPV6_RECVDSTOPTS 40 /* bool; recv dst option after rthdr */ #ifdef _KERNEL #define IPV6_RECVRTHDRDSTOPTS 41 /* bool; recv dst option before rthdr */ #endif a413 19 #define IPV6_RECVPATHMTU 43 /* bool; notify an according MTU */ #define IPV6_PATHMTU 44 /* mtuinfo; get the current path MTU (sopt), 4 bytes int; MTU notification (cmsg) */ /* more new socket options introduced in RFC3542 */ #define IPV6_PKTINFO 46 /* in6_pktinfo; send if, src addr */ #define IPV6_HOPLIMIT 47 /* int; send hop limit */ #define IPV6_NEXTHOP 48 /* sockaddr; next hop addr */ #define IPV6_HOPOPTS 49 /* ip6_hbh; send hop-by-hop option */ #define IPV6_DSTOPTS 50 /* ip6_dest; send dst option befor rthdr */ #define IPV6_RTHDR 51 /* ip6_rthdr; send routing header */ #define IPV6_RECVTCLASS 57 /* bool; recv traffic class values */ #ifdef _KERNEL #define IPV6_OTCLASS 58 /* u_int8_t; send traffic class value */ #endif #define IPV6_TCLASS 61 /* int; send traffic class value */ #define IPV6_DONTFRAG 62 /* bool; disable IPv6 fragmentation */ a442 8 * Control structure for IPV6_RECVPATHMTU socket option. */ struct ip6_mtuinfo { struct sockaddr_in6 ip6m_addr; /* or sockaddr_storage? */ uint32_t ip6m_mtu; }; /* d540 1 a540 3 /* 32 to 38: reserved */ #define IPV6CTL_USE_DEFAULTZONE 39 /* use default scope zone */ /* 40: reserved */ d554 1 a554 1 { "stats", CTLTYPE_STRUCT }, \ a648 2 struct mbuf; struct ifnet; a649 1 void in6_delayed_cksum __P((struct mbuf *)); d652 1 a654 4 #ifndef __FreeBSD__ extern int in6_src_sysctl __P((void *, size_t *, void *, size_t)); #endif extern void addrsel_policy_init __P((void)); a695 18 extern int inet6_opt_init __P((void *, socklen_t)); extern int inet6_opt_append __P((void *, socklen_t, int, uint8_t, socklen_t, uint8_t, void **)); extern int inet6_opt_finish __P((void *, socklen_t, int)); extern int inet6_opt_set_val __P((void *, int, void *, socklen_t)); extern int inet6_opt_next __P((void *, socklen_t, int, uint8_t *, socklen_t *, void **)); extern int inet6_opt_find __P((void *, socklen_t, int, uint8_t, socklen_t *, void **)); extern int inet6_opt_get_val __P((void *, int, void *, socklen_t)); extern socklen_t inet6_rth_space __P((int, int)); extern void *inet6_rth_init __P((void *, socklen_t, int, int)); extern int inet6_rth_add __P((void *, const struct in6_addr *)); extern int inet6_rth_reverse __P((const void *, void *)); extern int inet6_rth_segments __P((const void *)); extern struct in6_addr *inet6_rth_getaddr __P((const void *, int)); @ 1.45.12.2 log @sync with head. @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.45.12.1 2006/06/21 15:11:08 yamt Exp $ */ d391 1 d393 2 a394 3 #if 0 /* These are deprecated non-standard options which are no longer supported. */ #define IPV6_OPTIONS 1 /* buf/ip6_opts; set/get IP6 options */ a398 3 #endif #define IPV6_SOCKOPT_RESERVED1 3 /* reserved for future use */ #define IPV6_UNICAST_HOPS 4 /* int; IP6 hops */ @ 1.45.12.3 log @sync with head. @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.45.12.2 2006/12/30 20:50:38 yamt Exp $ */ d417 1 a417 1 #define IPV6_2292DSTOPTS 23 /* bool; destination option */ a719 1 #define satocsin6(sa) ((const struct sockaddr_in6 *)(sa)) @ 1.45.12.4 log @sync with head. @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.45.12.3 2007/02/26 09:11:48 yamt Exp $ */ d378 10 a706 1 int sockaddr_in6_cmp(const struct sockaddr *, const struct sockaddr *); a721 1 #define sin6tocsa(sin6) ((const struct sockaddr *)(sin6)) a722 34 static inline void sockaddr_in6_init1(struct sockaddr_in6 *sin6, const struct in6_addr *addr, in_port_t port, uint32_t flowinfo, uint32_t scope_id) { sin6->sin6_port = port; sin6->sin6_flowinfo = flowinfo; sin6->sin6_addr = *addr; sin6->sin6_scope_id = scope_id; } static inline void sockaddr_in6_init(struct sockaddr_in6 *sin6, const struct in6_addr *addr, in_port_t port, uint32_t flowinfo, uint32_t scope_id) { sin6->sin6_family = AF_INET6; sin6->sin6_len = sizeof(*sin6); sockaddr_in6_init1(sin6, addr, port, flowinfo, scope_id); } static inline struct sockaddr * sockaddr_in6_alloc(const struct in6_addr *addr, in_port_t port, uint32_t flowinfo, uint32_t scope_id, int flags) { struct sockaddr *sa; if ((sa = sockaddr_alloc(AF_INET6, sizeof(struct sockaddr_in6), flags)) == NULL) return NULL; sockaddr_in6_init1(satosin6(sa), addr, port, flowinfo, scope_id); return sa; } a739 5 void in6_sin6_2_sin __P((struct sockaddr_in *, struct sockaddr_in6 *)); void in6_sin_2_v4mapsin6 __P((struct sockaddr_in *, struct sockaddr_in6 *)); void in6_sin6_2_sin_in_sock __P((struct sockaddr *)); void in6_sin_2_v4mapsin6_in_sock __P((struct sockaddr **)); @ 1.45.12.5 log @sync with head. @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.45.12.4 2007/09/03 14:43:19 yamt Exp $ */ d227 10 d239 1 d698 6 a703 6 int in6_cksum(struct mbuf *, u_int8_t, u_int32_t, u_int32_t); void in6_delayed_cksum(struct mbuf *); int in6_localaddr(const struct in6_addr *); int in6_addrscope(const struct in6_addr *); struct in6_ifaddr *in6_ifawithifp(struct ifnet *, struct in6_addr *); extern void in6_if_up(struct ifnet *); d705 1 a705 1 extern int in6_src_sysctl(void *, size_t *, void *, size_t); d707 1 a707 1 extern void addrsel_policy_init(void); @ 1.45.12.6 log @sync with head. @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.45.12.5 2007/10/27 11:36:11 yamt Exp $ */ d755 18 a772 18 void in6_sin6_2_sin(struct sockaddr_in *, struct sockaddr_in6 *); void in6_sin_2_v4mapsin6(struct sockaddr_in *, struct sockaddr_in6 *); void in6_sin6_2_sin_in_sock(struct sockaddr *); void in6_sin_2_v4mapsin6_in_sock(struct sockaddr **); extern int inet6_option_space(int); extern int inet6_option_init(void *, struct cmsghdr **, int); extern int inet6_option_append(struct cmsghdr *, const uint8_t *, int, int); extern uint8_t *inet6_option_alloc(struct cmsghdr *, int, int, int); extern int inet6_option_next(const struct cmsghdr *, uint8_t **); extern int inet6_option_find(const struct cmsghdr *, uint8_t **, int); extern size_t inet6_rthdr_space(int, int); extern struct cmsghdr *inet6_rthdr_init(void *, int); extern int inet6_rthdr_add(struct cmsghdr *, const struct in6_addr *, unsigned int); extern int inet6_rthdr_lasthop(struct cmsghdr *, unsigned int); d774 1 a774 1 extern int inet6_rthdr_reverse(const struct cmsghdr *, struct cmsghdr *); d776 21 a796 21 extern int inet6_rthdr_segments(const struct cmsghdr *); extern struct in6_addr *inet6_rthdr_getaddr(struct cmsghdr *, int); extern int inet6_rthdr_getflags(const struct cmsghdr *, int); extern int inet6_opt_init(void *, socklen_t); extern int inet6_opt_append(void *, socklen_t, int, uint8_t, socklen_t, uint8_t, void **); extern int inet6_opt_finish(void *, socklen_t, int); extern int inet6_opt_set_val(void *, int, void *, socklen_t); extern int inet6_opt_next(void *, socklen_t, int, uint8_t *, socklen_t *, void **); extern int inet6_opt_find(void *, socklen_t, int, uint8_t, socklen_t *, void **); extern int inet6_opt_get_val(void *, int, void *, socklen_t); extern socklen_t inet6_rth_space(int, int); extern void *inet6_rth_init(void *, socklen_t, int, int); extern int inet6_rth_add(void *, const struct in6_addr *); extern int inet6_rth_reverse(const void *, void *); extern int inet6_rth_segments(const void *); extern struct in6_addr *inet6_rth_getaddr(const void *, int); @ 1.45.12.7 log @sync with head @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.45.12.6 2007/11/15 11:45:10 yamt Exp $ */ d649 1 a649 1 static __inline u_int16_t __unused @ 1.44 log @implement net.inet6.ifq @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.43 2003/08/07 16:33:24 agc Exp $ */ d413 1 @ 1.44.2.1 log @Pull up revision 1.45 (requested by itojun in ticket #468): implement IPV6_USE_MIN_MTU sockopt. needed by bind9 + EDNS0 + big receive buffer. @ text @d1 1 a1 1 /* $NetBSD$ */ a412 1 #define IPV6_USE_MIN_MTU 42 /* bool; send packets at the minimum MTU */ @ 1.43 log @Move UCB-licensed code from 4-clause to 3-clause licence. Patches provided by Joel Baker in PR 22364, verified by myself. @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.42 2003/04/28 23:16:27 bjh21 Exp $ */ d541 1 d544 1 a544 1 #define IPV6CTL_MAXID 42 d589 1 @ 1.42 log @Add a new feature-test macro, _NETBSD_SOURCE. If this is defined by the application, all NetBSD interfaces are made visible, even if some other feature-test macro (like _POSIX_C_SOURCE) is defined. defined _NETBSD_SOURCE if none of _ANSI_SOURCE, _POSIX_C_SOURCE and _XOPEN_SOURCE is defined, so as to preserve existing behaviour. This has two major advantages: + Programs that require non-POSIX facilities but define _POSIX_C_SOURCE can trivially be overruled by putting -D_NETBSD_SOURCE in their CFLAGS. + It makes most of the #ifs simpler, in that they're all now ORs of the various macros, rather than having checks for (!defined(_ANSI_SOURCE) || !defined(_POSIX_C_SOURCE) || !defined(_XOPEN_SOURCE)) all over the place. I've tried not to change the semantics of the headers in any case where _NETBSD_SOURCE wasn't defined, but there were some places where the current semantics were clearly mad, and retaining them was harder than correcting them. In particular, I've mostly normalised things so that _ANSI_SOURCE gets you the smallest set of stuff, then _POSIX_C_SOURCE, _XOPEN_SOURCE and _NETBSD_SOURCE in that order. Tested by building for vax, encouraged by thorpej, and uncontested in tech-userlevel for a week. @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.41 2002/06/08 21:22:31 itojun Exp $ */ d45 1 a45 5 * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by the University of * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors @ 1.42.2.1 log @Sync with HEAD @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.45 2004/06/11 04:10:10 itojun Exp $ */ d45 5 a49 1 * 3. Neither the name of the University nor the names of its contributors a416 1 #define IPV6_USE_MIN_MTU 42 /* bool; send packets at the minimum MTU */ a544 1 #define IPV6CTL_IFQ 42 /* ip6intrq node */ d547 1 a547 1 #define IPV6CTL_MAXID 43 a591 1 { "ifq", CTLTYPE_NODE }, \ @ 1.42.2.2 log @Sync with HEAD. @ text @@ 1.42.2.3 log @Fix the sync with head I botched. @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.42.2.1 2004/08/03 10:55:11 skrll Exp $ */ @ 1.42.2.4 log @Sync with HEAD. Here we go again... @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.42.2.3 2004/09/21 13:37:32 skrll Exp $ */ d554 1 a554 1 { "stats", CTLTYPE_STRUCT }, \ a649 1 void in6_delayed_cksum __P((struct mbuf *)); @ 1.42.2.5 log @Sync with head. @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.48 2005/12/10 23:39:56 elad Exp $ */ a63 3 #ifndef _NETINET6_IN6_H_ #define _NETINET6_IN6_H_ d68 3 @ 1.41 log @sync with latest KAME in6_ifaddr/prefix/default router manipulation. behavior changes: - two iocts used by ndp(8) are now obsolete (backward compat provided). use sysctl path instead. - lo0 does not get ::1 automatically. it will get ::1 when lo0 comes up. @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.40 2002/05/28 03:04:06 itojun Exp $ */ d111 1 a111 1 #if !defined(_POSIX_C_SOURCE) && !defined(_XOPEN_SOURCE) d142 1 a142 1 #if !defined(_POSIX_C_SOURCE) && !defined(_XOPEN_SOURCE) d375 1 a375 1 #if !defined(_POSIX_C_SOURCE) && !defined(_XOPEN_SOURCE) d400 1 a400 1 #if !defined(_POSIX_C_SOURCE) && !defined(_XOPEN_SOURCE) d453 1 a453 1 #if !defined(_POSIX_C_SOURCE) && !defined(_XOPEN_SOURCE) d594 1 a594 1 #endif /* !_POSIX_C_SOURCE && !_XOPEN_SOURCE */ d663 1 a663 1 #if !defined(_POSIX_C_SOURCE) && !defined(_XOPEN_SOURCE) d698 1 a698 1 #endif /* !_POSIX_C_SOURCE && !_XOPEN_SOURCE */ @ 1.40 log @limit number of IPv6 fragments (not the fragment queue size) to fight against lots-of-frags DoS attacks. sync w/kame @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.39 2002/05/14 10:27:28 itojun Exp $ */ d361 9 d628 1 a628 1 sum += w[6]; sum += w[7]; @ 1.39 log @rename: net.inet6.ip6.bindv6only -> net.inet6.ip6.v6only sync w/kame. @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.38 2002/05/13 15:20:30 kleink Exp $ */ d534 2 d538 1 a538 1 #define IPV6CTL_MAXID 32 d573 10 @ 1.39.4.1 log @Pullup rev 1.45 (requested by itojun in ticket #1709) Implement IPV6_USE_MIN_MTU sockopt. @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.39 2002/05/14 10:27:28 itojun Exp $ */ a407 1 #define IPV6_USE_MIN_MTU 42 /* bool; send packets at the minimum MTU */ @ 1.39.2.1 log @Catch up with -current. @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.40 2002/05/28 03:04:06 itojun Exp $ */ a533 2 /* 32 to 40: resrved */ #define IPV6CTL_MAXFRAGS 41 /* max fragments */ d536 1 a536 1 #define IPV6CTL_MAXID 42 a570 10 { 0, 0 }, \ { 0, 0 }, \ { 0, 0 }, \ { 0, 0 }, \ { 0, 0 }, \ { 0, 0 }, \ { 0, 0 }, \ { 0, 0 }, \ { 0, 0 }, \ { "maxfrags", CTLTYPE_INT }, \ @ 1.39.2.2 log @catch up with -current. @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.41 2002/06/08 21:22:31 itojun Exp $ */ a360 9 #define IFA6_IS_DEPRECATED(a) \ ((a)->ia6_lifetime.ia6t_pltime != ND6_INFINITE_LIFETIME && \ (u_int32_t)((time.tv_sec - (a)->ia6_updatetime)) > \ (a)->ia6_lifetime.ia6t_pltime) #define IFA6_IS_INVALID(a) \ ((a)->ia6_lifetime.ia6t_vltime != ND6_INFINITE_LIFETIME && \ (u_int32_t)((time.tv_sec - (a)->ia6_updatetime)) > \ (a)->ia6_lifetime.ia6t_vltime) d619 1 a619 1 sum += w[6]; sum += w[7]; @ 1.38 log @* Use uint{8,32}_t from where applicable; use private fixed-width integer types otherwise. * Protect RFC 2292 prototypes, which are not XNS5.2/POSIX-2001; also, define size_t for inet6_rthdr_space(). @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.37 2002/05/13 14:25:13 kleink Exp $ */ d563 1 a563 1 { "bindv6only", CTLTYPE_INT }, \ @ 1.37 log @IPV6PORT_* aren't in the reserved namespace either. @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.36 2002/05/13 14:15:34 kleink Exp $ */ d124 3 a126 3 u_int8_t __u6_addr8[16]; u_int16_t __u6_addr16[8]; u_int32_t __u6_addr32[4]; d146 1 a146 1 u_int8_t sin6_len; /* length of this struct(socklen_t)*/ d149 1 a149 1 u_int32_t sin6_flowinfo; /* IP6 flow information */ d151 1 a151 1 u_int32_t sin6_scope_id; /* scope zone index */ d247 4 a250 4 ((*(const u_int32_t *)(const void *)(&(a)->s6_addr[0]) == 0) && \ (*(const u_int32_t *)(const void *)(&(a)->s6_addr[4]) == 0) && \ (*(const u_int32_t *)(const void *)(&(a)->s6_addr[8]) == 0) && \ (*(const u_int32_t *)(const void *)(&(a)->s6_addr[12]) == 0)) d256 4 a259 4 ((*(const u_int32_t *)(const void *)(&(a)->s6_addr[0]) == 0) && \ (*(const u_int32_t *)(const void *)(&(a)->s6_addr[4]) == 0) && \ (*(const u_int32_t *)(const void *)(&(a)->s6_addr[8]) == 0) && \ (*(const u_int32_t *)(const void *)(&(a)->s6_addr[12]) == ntohl(1))) d265 5 a269 5 ((*(const u_int32_t *)(const void *)(&(a)->s6_addr[0]) == 0) && \ (*(const u_int32_t *)(const void *)(&(a)->s6_addr[4]) == 0) && \ (*(const u_int32_t *)(const void *)(&(a)->s6_addr[8]) == 0) && \ (*(const u_int32_t *)(const void *)(&(a)->s6_addr[12]) != 0) && \ (*(const u_int32_t *)(const void *)(&(a)->s6_addr[12]) != ntohl(1))) d275 3 a277 3 ((*(const u_int32_t *)(const void *)(&(a)->s6_addr[0]) == 0) && \ (*(const u_int32_t *)(const void *)(&(a)->s6_addr[4]) == 0) && \ (*(const u_int32_t *)(const void *)(&(a)->s6_addr[8]) == ntohl(0x0000ffff))) d642 12 d659 1 a659 1 extern int inet6_option_append __P((struct cmsghdr *, const u_int8_t *, d661 3 a663 3 extern u_int8_t *inet6_option_alloc __P((struct cmsghdr *, int, int, int)); extern int inet6_option_next __P((const struct cmsghdr *, u_int8_t **)); extern int inet6_option_find __P((const struct cmsghdr *, u_int8_t **, int)); d677 1 @ 1.36 log @Check _POSIX_C_SOURCE as well. @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.35 2002/05/13 13:52:31 kleink Exp $ */ d111 1 d117 1 @ 1.35 log @Update two comments. @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.34 2002/05/12 23:04:15 kleink Exp $ */ d140 1 a140 1 #ifndef _XOPEN_SOURCE d364 1 a364 1 #ifndef _XOPEN_SOURCE d389 1 d391 1 d442 1 a442 1 #ifndef _XOPEN_SOURCE d571 1 a571 1 #endif /* !_XOPEN_SOURCE */ @ 1.34 log @Provide local definitions of in_{addr,port}_t in and use them where deemed appropriate by XNS5.2/POSIX-2001. @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.33 2001/12/21 08:54:54 itojun Exp $ */ d144 1 a144 1 u_int8_t sin6_len; /* length of this struct(sa_family_t)*/ d146 1 a146 1 in_port_t sin6_port; /* Transport layer port # (in_port_t)*/ @ 1.33 log @whitespace/costmetic sync w/kame @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.32 2001/11/17 18:55:11 perry Exp $ */ d146 1 a146 1 u_int16_t sin6_port; /* Transport layer port # (in_port_t)*/ @ 1.32 log @(minor) delint @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.31 2001/10/24 06:36:38 itojun Exp $ */ d523 1 @ 1.31 log @more whitespace sync with kame @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.30 2001/10/18 07:44:34 itojun Exp $ */ d596 2 a597 1 w = (u_int16_t *) src; d604 2 a605 1 w = (u_int16_t *) dst; @ 1.30 log @reduce diffs with kame (mostly cosmetic). move IPV6_CHECKSUM processing to sys/netinet6/raw_ip6.c. constify a couple of places. @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.29 2001/10/16 04:17:54 itojun Exp $ */ d400 1 a400 1 #if 1 /*IPSEC*/ @ 1.30.2.1 log @Sync the thorpej-mips-cache branch with -current. @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.31 2001/10/24 06:36:38 itojun Exp $ */ d400 1 a400 1 #if 1 /* IPSEC */ @ 1.29 log @reduce diff with kame. whitespace only @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.28 2001/10/15 09:51:16 itojun Exp $ */ d398 1 a398 1 #define IPV6_V6ONLY 27 /* bool; only bind INET6 at null bind */ @ 1.28 log @implement IPV6_V6ONLY socket option from draft-ietf-ipngwg-rfc2553bis-03.txt. IPV6_BINDV6ONLY (netbsd only) is deprecated, but still work just like before. @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.27 2001/07/24 00:44:36 itojun Exp $ */ d129 1 a129 1 #ifdef _KERNEL /*XXX nonstandard*/ d149 1 a149 1 u_int32_t sin6_scope_id; /* intface scope id */ d155 1 a155 1 #ifdef _KERNEL /*XXX nonstandard*/ d180 1 a180 1 #ifdef _KERNEL /*XXX nonstandard*/ d281 1 a281 1 #ifdef _KERNEL /*XXX nonstandard*/ d309 1 a309 1 #ifdef _KERNEL /*XXX nonstandard*/ d318 1 a318 1 #ifdef _KERNEL /*refers nonstandard items */ d352 1 a352 7 /* * Wildcard Socket */ #if 0 /*pre-RFC2553*/ #define IN6_IS_ADDR_ANY(a) IN6_IS_ADDR_UNSPECIFIED(a) #endif a355 1 #ifdef _KERNEL /*nonstandard*/ @ 1.27 log @fix comment on setsockopt arg size. KAME PR 369 @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.26 2001/06/02 16:17:11 thorpej Exp $ */ d405 1 a405 1 #define IPV6_BINDV6ONLY 27 /* bool; only bind INET6 at null bind */ d530 1 a530 1 #define IPV6CTL_BINDV6ONLY 24 @ 1.26 log @Implement support for IP/TCP/UDP checksum offloading provided by network interfaces. This works by pre-computing the pseudo-header checksum and caching it, delaying the actual checksum to ip_output() if the hardware cannot perform the sum for us. In-bound checksums can either be fully-checked by hardware, or summed up for final verification by software. This method was modeled after how this is done in FreeBSD, although the code is significantly different in most places. We don't delay checksums for IPv6/TCP, but we do take advantage of the cached pseudo-header checksum. Note: hardware-assisted checksumming defaults to "off". It is enabled with ifconfig(8). See the manual page for details. Implement hardware-assisted checksumming on the DP83820 Gigabit Ethernet, 3c90xB/3c90xC 10/100 Ethernet, and Alteon Tigon/Tigon2 Gigabit Ethernet. @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.25 2001/03/30 05:53:52 itojun Exp $ */ d390 3 a392 3 #define IPV6_MULTICAST_IF 9 /* u_char; set/get IP6 multicast i/f */ #define IPV6_MULTICAST_HOPS 10 /* u_char; set/get IP6 multicast hops */ #define IPV6_MULTICAST_LOOP 11 /* u_char; set/get IP6 multicast loopback */ @ 1.26.2.1 log @update to -current @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.27 2001/07/24 00:44:36 itojun Exp $ */ d390 3 a392 3 #define IPV6_MULTICAST_IF 9 /* u_int; set/get IP6 multicast i/f */ #define IPV6_MULTICAST_HOPS 10 /* int; set/get IP6 multicast hops */ #define IPV6_MULTICAST_LOOP 11 /* u_int; set/get IP6 multicast loopback */ @ 1.26.2.2 log @Sync kqueue branch with -current. @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.26.2.1 2001/08/03 04:13:58 lukem Exp $ */ d129 1 a129 1 #ifdef _KERNEL /* XXX nonstandard */ d149 1 a149 1 u_int32_t sin6_scope_id; /* scope zone index */ d155 1 a155 1 #ifdef _KERNEL /* XXX nonstandard */ d180 1 a180 1 #ifdef _KERNEL /* XXX nonstandard */ d281 1 a281 1 #ifdef _KERNEL /* XXX nonstandard */ d309 1 a309 1 #ifdef _KERNEL /* XXX nonstandard */ d318 1 a318 1 #ifdef _KERNEL /* refers nonstandard items */ d352 7 a358 1 #ifdef _KERNEL /* nonstandard */ d362 1 d405 1 a405 1 #define IPV6_V6ONLY 27 /* bool; make AF_INET6 sockets v6 only */ d407 1 a407 1 #if 1 /* IPSEC */ d530 1 a530 2 /* 23: reserved */ #define IPV6CTL_V6ONLY 24 d603 1 a603 2 /*LINTED*/ w = (const u_int16_t *) src; d610 1 a610 2 /*LINTED*/ w = (const u_int16_t *) dst; @ 1.26.2.3 log @catch up with -current on kqueue branch @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.26.2.2 2002/01/10 20:03:13 thorpej Exp $ */ a110 1 #if !defined(_POSIX_C_SOURCE) && !defined(_XOPEN_SOURCE) a115 1 #endif d122 3 a124 3 __uint8_t __u6_addr8[16]; __uint16_t __u6_addr16[8]; uint32_t __u6_addr32[4]; d140 1 a140 1 #if !defined(_POSIX_C_SOURCE) && !defined(_XOPEN_SOURCE) d144 1 a144 1 uint8_t sin6_len; /* length of this struct(socklen_t)*/ d146 2 a147 2 in_port_t sin6_port; /* Transport layer port */ uint32_t sin6_flowinfo; /* IP6 flow information */ d149 1 a149 1 uint32_t sin6_scope_id; /* scope zone index */ d245 4 a248 4 ((*(const uint32_t *)(const void *)(&(a)->s6_addr[0]) == 0) && \ (*(const uint32_t *)(const void *)(&(a)->s6_addr[4]) == 0) && \ (*(const uint32_t *)(const void *)(&(a)->s6_addr[8]) == 0) && \ (*(const uint32_t *)(const void *)(&(a)->s6_addr[12]) == 0)) d254 4 a257 4 ((*(const uint32_t *)(const void *)(&(a)->s6_addr[0]) == 0) && \ (*(const uint32_t *)(const void *)(&(a)->s6_addr[4]) == 0) && \ (*(const uint32_t *)(const void *)(&(a)->s6_addr[8]) == 0) && \ (*(const uint32_t *)(const void *)(&(a)->s6_addr[12]) == ntohl(1))) d263 5 a267 5 ((*(const uint32_t *)(const void *)(&(a)->s6_addr[0]) == 0) && \ (*(const uint32_t *)(const void *)(&(a)->s6_addr[4]) == 0) && \ (*(const uint32_t *)(const void *)(&(a)->s6_addr[8]) == 0) && \ (*(const uint32_t *)(const void *)(&(a)->s6_addr[12]) != 0) && \ (*(const uint32_t *)(const void *)(&(a)->s6_addr[12]) != ntohl(1))) d273 3 a275 3 ((*(const uint32_t *)(const void *)(&(a)->s6_addr[0]) == 0) && \ (*(const uint32_t *)(const void *)(&(a)->s6_addr[4]) == 0) && \ (*(const uint32_t *)(const void *)(&(a)->s6_addr[8]) == ntohl(0x0000ffff))) a358 9 #define IFA6_IS_DEPRECATED(a) \ ((a)->ia6_lifetime.ia6t_pltime != ND6_INFINITE_LIFETIME && \ (u_int32_t)((time.tv_sec - (a)->ia6_updatetime)) > \ (a)->ia6_lifetime.ia6t_pltime) #define IFA6_IS_INVALID(a) \ ((a)->ia6_lifetime.ia6t_vltime != ND6_INFINITE_LIFETIME && \ (u_int32_t)((time.tv_sec - (a)->ia6_updatetime)) > \ (a)->ia6_lifetime.ia6t_vltime) d364 1 a364 1 #if !defined(_POSIX_C_SOURCE) && !defined(_XOPEN_SOURCE) a388 1 #if !defined(_POSIX_C_SOURCE) && !defined(_XOPEN_SOURCE) a389 1 #endif d440 1 a440 1 #if !defined(_POSIX_C_SOURCE) && !defined(_XOPEN_SOURCE) a529 2 /* 32 to 40: resrved */ #define IPV6CTL_MAXFRAGS 41 /* max fragments */ d532 1 a532 1 #define IPV6CTL_MAXID 42 d559 1 a559 1 { "v6only", CTLTYPE_INT }, \ a566 10 { 0, 0 }, \ { 0, 0 }, \ { 0, 0 }, \ { 0, 0 }, \ { 0, 0 }, \ { 0, 0 }, \ { 0, 0 }, \ { 0, 0 }, \ { 0, 0 }, \ { "maxfrags", CTLTYPE_INT }, \ d569 1 a569 1 #endif /* !_POSIX_C_SOURCE && !_XOPEN_SOURCE */ d603 1 a603 1 sum += w[6]; sum += w[7]; a637 12 #if !defined(_POSIX_C_SOURCE) && !defined(_XOPEN_SOURCE) #include #ifdef _BSD_SIZE_T_ typedef _BSD_SIZE_T_ size_t; #define _SIZE_T #undef _BSD_SIZE_T_ #endif #include d643 1 a643 1 extern int inet6_option_append __P((struct cmsghdr *, const uint8_t *, d645 3 a647 3 extern uint8_t *inet6_option_alloc __P((struct cmsghdr *, int, int, int)); extern int inet6_option_next __P((const struct cmsghdr *, uint8_t **)); extern int inet6_option_find __P((const struct cmsghdr *, uint8_t **, int)); a660 1 #endif /* !_POSIX_C_SOURCE && !_XOPEN_SOURCE */ @ 1.25 log @fix constness of IN6_{IS,ARE}_xx with RFC2553. sync with kame. @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.24 2001/03/02 04:55:40 itojun Exp $ */ d579 49 @ 1.24 log @have comment that refers to kame COVERAGE document. sync with kame @ text @d1 2 a2 2 /* $NetBSD: in6.h,v 1.23 2001/03/02 04:52:54 itojun Exp $ */ /* $KAME: in6.h,v 1.81 2001/03/02 04:54:45 itojun Exp $ */ d69 1 a69 1 #error "do not include netinet6/in6.h directly, include netinet/in.h" d245 4 a248 4 ((*(u_int32_t *)(void *)(&(a)->s6_addr[0]) == 0) && \ (*(u_int32_t *)(void *)(&(a)->s6_addr[4]) == 0) && \ (*(u_int32_t *)(void *)(&(a)->s6_addr[8]) == 0) && \ (*(u_int32_t *)(void *)(&(a)->s6_addr[12]) == 0)) d254 4 a257 4 ((*(u_int32_t *)(void *)(&(a)->s6_addr[0]) == 0) && \ (*(u_int32_t *)(void *)(&(a)->s6_addr[4]) == 0) && \ (*(u_int32_t *)(void *)(&(a)->s6_addr[8]) == 0) && \ (*(u_int32_t *)(void *)(&(a)->s6_addr[12]) == ntohl(1))) d263 5 a267 5 ((*(u_int32_t *)(void *)(&(a)->s6_addr[0]) == 0) && \ (*(u_int32_t *)(void *)(&(a)->s6_addr[4]) == 0) && \ (*(u_int32_t *)(void *)(&(a)->s6_addr[8]) == 0) && \ (*(u_int32_t *)(void *)(&(a)->s6_addr[12]) != 0) && \ (*(u_int32_t *)(void *)(&(a)->s6_addr[12]) != ntohl(1))) d273 3 a275 3 ((*(u_int32_t *)(void *)(&(a)->s6_addr[0]) == 0) && \ (*(u_int32_t *)(void *)(&(a)->s6_addr[4]) == 0) && \ (*(u_int32_t *)(void *)(&(a)->s6_addr[8]) == ntohl(0x0000ffff))) @ 1.24.2.1 log @Catch up with -current. @ text @d1 2 a2 2 /* $NetBSD: in6.h,v 1.25 2001/03/30 05:53:52 itojun Exp $ */ /* $KAME: in6.h,v 1.83 2001/03/29 02:55:07 jinmei Exp $ */ d69 1 a69 1 #error "do not include netinet6/in6.h directly, include netinet/in.h. see RFC2553" d245 4 a248 4 ((*(const u_int32_t *)(const void *)(&(a)->s6_addr[0]) == 0) && \ (*(const u_int32_t *)(const void *)(&(a)->s6_addr[4]) == 0) && \ (*(const u_int32_t *)(const void *)(&(a)->s6_addr[8]) == 0) && \ (*(const u_int32_t *)(const void *)(&(a)->s6_addr[12]) == 0)) d254 4 a257 4 ((*(const u_int32_t *)(const void *)(&(a)->s6_addr[0]) == 0) && \ (*(const u_int32_t *)(const void *)(&(a)->s6_addr[4]) == 0) && \ (*(const u_int32_t *)(const void *)(&(a)->s6_addr[8]) == 0) && \ (*(const u_int32_t *)(const void *)(&(a)->s6_addr[12]) == ntohl(1))) d263 5 a267 5 ((*(const u_int32_t *)(const void *)(&(a)->s6_addr[0]) == 0) && \ (*(const u_int32_t *)(const void *)(&(a)->s6_addr[4]) == 0) && \ (*(const u_int32_t *)(const void *)(&(a)->s6_addr[8]) == 0) && \ (*(const u_int32_t *)(const void *)(&(a)->s6_addr[12]) != 0) && \ (*(const u_int32_t *)(const void *)(&(a)->s6_addr[12]) != ntohl(1))) d273 3 a275 3 ((*(const u_int32_t *)(const void *)(&(a)->s6_addr[0]) == 0) && \ (*(const u_int32_t *)(const void *)(&(a)->s6_addr[4]) == 0) && \ (*(const u_int32_t *)(const void *)(&(a)->s6_addr[8]) == ntohl(0x0000ffff))) @ 1.24.2.2 log @Catch up to -current. @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.24.2.1 2001/04/09 01:58:36 nathanw Exp $ */ a578 49 /* * in6_cksum_phdr: * * Compute significant parts of the IPv6 checksum pseudo-header * for use in a delayed TCP/UDP checksum calculation. * * Args: * * src Source IPv6 address * dst Destination IPv6 address * len htonl(proto-hdr-len) * nxt htonl(next-proto-number) * * NOTE: We expect the src and dst addresses to be 16-bit * aligned! */ static __inline u_int16_t __attribute__((__unused__)) in6_cksum_phdr(const struct in6_addr *src, const struct in6_addr *dst, u_int32_t len, u_int32_t nxt) { u_int32_t sum = 0; const u_int16_t *w; w = (u_int16_t *) src; sum += w[0]; if (!IN6_IS_SCOPE_LINKLOCAL(src)) sum += w[1]; sum += w[2]; sum += w[3]; sum += w[4]; sum += w[5]; sum += w[6]; sum += w[7]; w = (u_int16_t *) dst; sum += w[0]; if (!IN6_IS_SCOPE_LINKLOCAL(dst)) sum += w[1]; sum += w[2]; sum += w[3]; sum += w[4]; sum += w[5]; sum += w[6]; sum += w[7]; sum += (u_int16_t)(len >> 16) + (u_int16_t)(len /*& 0xffff*/); sum += (u_int16_t)(nxt >> 16) + (u_int16_t)(nxt /*& 0xffff*/); sum = (u_int16_t)(sum >> 16) + (u_int16_t)(sum /*& 0xffff*/); if (sum > 0xffff) sum -= 0xffff; return (sum); } @ 1.24.2.3 log @Catch up with -current. @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.24.2.2 2001/06/21 20:08:52 nathanw Exp $ */ d390 3 a392 3 #define IPV6_MULTICAST_IF 9 /* u_int; set/get IP6 multicast i/f */ #define IPV6_MULTICAST_HOPS 10 /* int; set/get IP6 multicast hops */ #define IPV6_MULTICAST_LOOP 11 /* u_int; set/get IP6 multicast loopback */ @ 1.24.2.4 log @Catch up to -current. @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.24.2.3 2001/08/24 00:12:37 nathanw Exp $ */ d129 1 a129 1 #ifdef _KERNEL /* XXX nonstandard */ d149 1 a149 1 u_int32_t sin6_scope_id; /* scope zone index */ d155 1 a155 1 #ifdef _KERNEL /* XXX nonstandard */ d180 1 a180 1 #ifdef _KERNEL /* XXX nonstandard */ d281 1 a281 1 #ifdef _KERNEL /* XXX nonstandard */ d309 1 a309 1 #ifdef _KERNEL /* XXX nonstandard */ d318 1 a318 1 #ifdef _KERNEL /* refers nonstandard items */ d352 7 a358 1 #ifdef _KERNEL /* nonstandard */ d362 1 d405 1 a405 1 #define IPV6_V6ONLY 27 /* bool; make AF_INET6 sockets v6 only */ d530 1 a530 1 #define IPV6CTL_V6ONLY 24 @ 1.24.2.5 log @Catch up to -current. @ text @d1 1 a1 1 /* $NetBSD$ */ d400 1 a400 1 #if 1 /* IPSEC */ @ 1.24.2.6 log @Catch up to -current. @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.24.2.5 2001/11/14 19:18:05 nathanw Exp $ */ a522 1 /* 23: reserved */ d596 1 a596 2 /*LINTED*/ w = (const u_int16_t *) src; d603 1 a603 2 /*LINTED*/ w = (const u_int16_t *) dst; @ 1.24.2.7 log @Catch up to -current. @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.24.2.6 2002/01/08 00:34:16 nathanw Exp $ */ a110 1 #if !defined(_POSIX_C_SOURCE) && !defined(_XOPEN_SOURCE) a115 1 #endif d122 3 a124 3 __uint8_t __u6_addr8[16]; __uint16_t __u6_addr16[8]; uint32_t __u6_addr32[4]; d140 1 a140 1 #if !defined(_POSIX_C_SOURCE) && !defined(_XOPEN_SOURCE) d144 1 a144 1 uint8_t sin6_len; /* length of this struct(socklen_t)*/ d146 2 a147 2 in_port_t sin6_port; /* Transport layer port */ uint32_t sin6_flowinfo; /* IP6 flow information */ d149 1 a149 1 uint32_t sin6_scope_id; /* scope zone index */ d245 4 a248 4 ((*(const uint32_t *)(const void *)(&(a)->s6_addr[0]) == 0) && \ (*(const uint32_t *)(const void *)(&(a)->s6_addr[4]) == 0) && \ (*(const uint32_t *)(const void *)(&(a)->s6_addr[8]) == 0) && \ (*(const uint32_t *)(const void *)(&(a)->s6_addr[12]) == 0)) d254 4 a257 4 ((*(const uint32_t *)(const void *)(&(a)->s6_addr[0]) == 0) && \ (*(const uint32_t *)(const void *)(&(a)->s6_addr[4]) == 0) && \ (*(const uint32_t *)(const void *)(&(a)->s6_addr[8]) == 0) && \ (*(const uint32_t *)(const void *)(&(a)->s6_addr[12]) == ntohl(1))) d263 5 a267 5 ((*(const uint32_t *)(const void *)(&(a)->s6_addr[0]) == 0) && \ (*(const uint32_t *)(const void *)(&(a)->s6_addr[4]) == 0) && \ (*(const uint32_t *)(const void *)(&(a)->s6_addr[8]) == 0) && \ (*(const uint32_t *)(const void *)(&(a)->s6_addr[12]) != 0) && \ (*(const uint32_t *)(const void *)(&(a)->s6_addr[12]) != ntohl(1))) d273 3 a275 3 ((*(const uint32_t *)(const void *)(&(a)->s6_addr[0]) == 0) && \ (*(const uint32_t *)(const void *)(&(a)->s6_addr[4]) == 0) && \ (*(const uint32_t *)(const void *)(&(a)->s6_addr[8]) == ntohl(0x0000ffff))) a358 9 #define IFA6_IS_DEPRECATED(a) \ ((a)->ia6_lifetime.ia6t_pltime != ND6_INFINITE_LIFETIME && \ (u_int32_t)((time.tv_sec - (a)->ia6_updatetime)) > \ (a)->ia6_lifetime.ia6t_pltime) #define IFA6_IS_INVALID(a) \ ((a)->ia6_lifetime.ia6t_vltime != ND6_INFINITE_LIFETIME && \ (u_int32_t)((time.tv_sec - (a)->ia6_updatetime)) > \ (a)->ia6_lifetime.ia6t_vltime) d364 1 a364 1 #if !defined(_POSIX_C_SOURCE) && !defined(_XOPEN_SOURCE) a388 1 #if !defined(_POSIX_C_SOURCE) && !defined(_XOPEN_SOURCE) a389 1 #endif d440 1 a440 1 #if !defined(_POSIX_C_SOURCE) && !defined(_XOPEN_SOURCE) a529 2 /* 32 to 40: resrved */ #define IPV6CTL_MAXFRAGS 41 /* max fragments */ d532 1 a532 1 #define IPV6CTL_MAXID 42 d559 1 a559 1 { "v6only", CTLTYPE_INT }, \ a566 10 { 0, 0 }, \ { 0, 0 }, \ { 0, 0 }, \ { 0, 0 }, \ { 0, 0 }, \ { 0, 0 }, \ { 0, 0 }, \ { 0, 0 }, \ { 0, 0 }, \ { "maxfrags", CTLTYPE_INT }, \ d569 1 a569 1 #endif /* !_POSIX_C_SOURCE && !_XOPEN_SOURCE */ d603 1 a603 1 sum += w[6]; sum += w[7]; a637 12 #if !defined(_POSIX_C_SOURCE) && !defined(_XOPEN_SOURCE) #include #ifdef _BSD_SIZE_T_ typedef _BSD_SIZE_T_ size_t; #define _SIZE_T #undef _BSD_SIZE_T_ #endif #include d643 1 a643 1 extern int inet6_option_append __P((struct cmsghdr *, const uint8_t *, d645 3 a647 3 extern uint8_t *inet6_option_alloc __P((struct cmsghdr *, int, int, int)); extern int inet6_option_next __P((const struct cmsghdr *, uint8_t **)); extern int inet6_option_find __P((const struct cmsghdr *, uint8_t **, int)); a660 1 #endif /* !_POSIX_C_SOURCE && !_XOPEN_SOURCE */ @ 1.23 log @the date string in KAME version is getting very meaningless, remove. @ text @d1 2 a2 2 /* $NetBSD: in6.h,v 1.22 2001/02/11 06:49:52 itojun Exp $ */ /* $KAME: in6.h,v 1.57 2000/08/26 10:00:45 itojun Exp $ */ d77 2 @ 1.22 log @pull latest kame pcbnotify code. synchronizes ICMPv6 path mtu discovery behavior with other protocols (i.e. validation, use of hiwat/lowat). @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.21 2000/10/17 21:46:42 itojun Exp $ */ d79 1 a79 1 #define __KAME_VERSION "19991213/NetBSD-current" @ 1.21 log @use __P() in prototype for non-ansi compilers. From: Michael Shalayeff (we don't ansify it for kame code sharing) @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.20 2000/08/27 01:02:48 itojun Exp $ */ d166 2 @ 1.20 log @add a warning on IPv6 setsockopt number space (*BSD shares the number space so consult KAME for number allocation) @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.19 2000/08/26 11:03:46 itojun Exp $ */ d592 7 a598 6 extern int inet6_option_space(int); extern int inet6_option_init(void *, struct cmsghdr **, int); extern int inet6_option_append(struct cmsghdr *, const u_int8_t *, int, int); extern u_int8_t *inet6_option_alloc(struct cmsghdr *, int, int, int); extern int inet6_option_next(const struct cmsghdr *, u_int8_t **); extern int inet6_option_find(const struct cmsghdr *, u_int8_t **, int); @ 1.19 log @implement net.inet6.ip6.{anon,low}port{min,max} sysctl variable. @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.18 2000/07/16 01:10:34 itojun Exp $ */ d407 1 @ 1.18 log @do not pull sys/queue.h from netinet6/in6.h. PR10597. some sync with kame. @ text @d1 2 a2 2 /* $NetBSD: in6.h,v 1.17 2000/07/06 17:42:55 christos Exp $ */ /* $KAME: in6.h,v 1.52 2000/07/15 15:28:02 itojun Exp $ */ d526 5 d532 2 a533 1 #define IPV6CTL_MAXID 25 d561 7 @ 1.17 log @elide lint cast type conversion warnings. @ text @d1 2 a2 2 /* $NetBSD: in6.h,v 1.16 2000/06/26 15:48:20 kleink Exp $ */ /* $KAME: in6.h,v 1.44 2000/05/24 08:50:17 itojun Exp $ */ a74 4 #ifndef _XOPEN_SOURCE #include #endif d90 1 a90 1 * The default range is IPPORT_ANONMIX to IPPORT_ANONMAX, although a561 1 int in6_canforward __P((struct in6_addr *, struct in6_addr *)); @ 1.16 log @XNS5.2: define sa_family_t and use it where specified by the standard. @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.15 2000/06/08 19:01:44 danw Exp $ */ d245 4 a248 4 ((*(u_int32_t *)(&(a)->s6_addr[0]) == 0) && \ (*(u_int32_t *)(&(a)->s6_addr[4]) == 0) && \ (*(u_int32_t *)(&(a)->s6_addr[8]) == 0) && \ (*(u_int32_t *)(&(a)->s6_addr[12]) == 0)) d254 4 a257 4 ((*(u_int32_t *)(&(a)->s6_addr[0]) == 0) && \ (*(u_int32_t *)(&(a)->s6_addr[4]) == 0) && \ (*(u_int32_t *)(&(a)->s6_addr[8]) == 0) && \ (*(u_int32_t *)(&(a)->s6_addr[12]) == ntohl(1))) d263 5 a267 5 ((*(u_int32_t *)(&(a)->s6_addr[0]) == 0) && \ (*(u_int32_t *)(&(a)->s6_addr[4]) == 0) && \ (*(u_int32_t *)(&(a)->s6_addr[8]) == 0) && \ (*(u_int32_t *)(&(a)->s6_addr[12]) != 0) && \ (*(u_int32_t *)(&(a)->s6_addr[12]) != ntohl(1))) d273 3 a275 3 ((*(u_int32_t *)(&(a)->s6_addr[0]) == 0) && \ (*(u_int32_t *)(&(a)->s6_addr[4]) == 0) && \ (*(u_int32_t *)(&(a)->s6_addr[8]) == ntohl(0x0000ffff))) @ 1.15 log @Use _POSIX_SOURCE-safe type names @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.14 2000/05/24 14:40:09 itojun Exp $ */ d147 1 a147 1 u_int8_t sin6_family; /* AF_INET6 (sa_family_t) */ @ 1.15.2.1 log @pullup 1.17 -> 1.18 (approved by releng-1-5) do not pull sys/queue.h from netinet6/in6.h. PR10597. some sync with kame. @ text @d1 2 a2 2 /* $NetBSD: in6.h,v 1.15 2000/06/08 19:01:44 danw Exp $ */ /* $KAME: in6.h,v 1.52 2000/07/15 15:28:02 itojun Exp $ */ d75 4 d94 1 a94 1 * The default range is IPPORT_ANONMIN to IPPORT_ANONMAX, although d566 1 @ 1.15.2.2 log @pullup (approved by releng-1-5) > implement net.inet6.ip6.{anon,low}port{min,max} sysctl variable. > cvs rdiff -r1.67 -r1.68 basesrc/lib/libc/gen/sysctl.3 > cvs rdiff -r1.53 -r1.54 basesrc/sbin/sysctl/sysctl.8 > cvs rdiff -r1.18 -r1.19 syssrc/sys/netinet6/in6.h > cvs rdiff -r1.29 -r1.30 syssrc/sys/netinet6/in6_pcb.c > cvs rdiff -r1.3 -r1.4 syssrc/sys/netinet6/in6_src.c > cvs rdiff -r1.25 -r1.26 syssrc/sys/netinet6/ip6_input.c > cvs rdiff -r1.14 -r1.15 syssrc/sys/netinet6/ip6_var.h @ text @d1 2 a2 2 /* $NetBSD: in6.h,v 1.15.2.1 2000/07/16 05:56:27 itojun Exp $ */ /* $KAME: in6.h,v 1.57 2000/08/26 10:00:45 itojun Exp $ */ a525 5 /* 25 to 27: reserved */ #define IPV6CTL_ANONPORTMIN 28 /* minimum ephemeral port */ #define IPV6CTL_ANONPORTMAX 29 /* maximum ephemeral port */ #define IPV6CTL_LOWPORTMIN 30 /* minimum reserved port */ #define IPV6CTL_LOWPORTMAX 31 /* maximum reserved port */ d527 1 a527 2 /* to define items, should talk with KAME guys first, for *BSD compatibility */ #define IPV6CTL_MAXID 32 a554 7 { 0, 0 }, \ { 0, 0 }, \ { 0, 0 }, \ { "anonportmin", CTLTYPE_INT }, \ { "anonportmax", CTLTYPE_INT }, \ { "lowportmin", CTLTYPE_INT }, \ { "lowportmax", CTLTYPE_INT }, \ @ 1.15.2.3 log @pullup 1.19 -> 1.20 (approved by releng-1-5) > add a warning on IPv6 setsockopt number space (*BSD shares the number space > so consult KAME for number allocation) @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.15.2.2 2000/08/27 01:25:07 itojun Exp $ */ a406 1 /* to define items, should talk with KAME guys first, for *BSD compatibility */ @ 1.15.2.4 log @Pullup 1.21 [itojun]: use __P() in prototype for non-ansi compilers. From: Michael Shalayeff (we don't ansify it for kame code sharing) @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.21 2000/10/17 21:46:42 itojun Exp $ */ d592 6 a597 7 extern int inet6_option_space __P((int)); extern int inet6_option_init __P((void *, struct cmsghdr **, int)); extern int inet6_option_append __P((struct cmsghdr *, const u_int8_t *, int, int)); extern u_int8_t *inet6_option_alloc __P((struct cmsghdr *, int, int, int)); extern int inet6_option_next __P((const struct cmsghdr *, u_int8_t **)); extern int inet6_option_find __P((const struct cmsghdr *, u_int8_t **, int)); @ 1.14 log @enforce parameter type check for IN6_ARE_ADDR_EQUAL(). (sync with kame) @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.13 2000/02/28 12:08:22 itojun Exp $ */ d427 1 a427 1 u_int ipv6mr_interface; d434 2 a435 2 struct in6_addr ipi6_addr; /* src/dst IPv6 address */ u_int ipi6_ifindex; /* send/recv interface index */ @ 1.14.2.1 log @Sync w/ netbsd-1-5-base. @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.15 2000/06/08 19:01:44 danw Exp $ */ d427 1 a427 1 unsigned int ipv6mr_interface; d434 2 a435 2 struct in6_addr ipi6_addr; /* src/dst IPv6 address */ unsigned int ipi6_ifindex; /* send/recv interface index */ @ 1.13 log @remove some of cross-BSD portability #ifdef. remove xxCTL_VARS, which is BSDI specific. @ text @d1 2 a2 1 /* $NetBSD: in6.h,v 1.12 2000/02/19 17:32:07 itojun Exp $ */ d7 1 a7 1 * d19 1 a19 1 * d235 1 a235 1 (bcmp((a), (b), sizeof(struct in6_addr)) == 0) d238 1 a238 1 (memcmp((a), (b), sizeof(struct in6_addr)) == 0) @ 1.12 log @s/u_char/u_int8_t/ for sin6_{family,len} @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.11 2000/02/17 10:59:39 darrenr Exp $ */ a559 27 #define IPV6CTL_VARS { \ 0, \ &ip6_forwarding, \ &ip6_sendredirects, \ &ip6_defhlim, \ 0, \ &ip6_forward_srcrt, \ 0, \ 0, \ 0, \ &ip6_maxfragpackets, \ &ip6_sourcecheck, \ &ip6_sourcecheck_interval, \ &ip6_accept_rtadv, \ &ip6_keepfaith, \ &ip6_log_interval, \ &ip6_hdrnestlimit, \ &ip6_dad_count, \ &ip6_auto_flowlabel, \ &ip6_defmcasthlim, \ &ip6_gif_hlim, \ 0, \ &ip6_use_deprecated, \ &ip6_rr_prune, \ 0, \ &ip6_bindv6only, \ } @ 1.11 log @Change the use of pfil hooks. There is no longer a single list of all pfil information, instead, struct protosw now contains a structure which caontains list heads, etc. The per-protosw pfil struct is passed to pfil_hook_get(), along with an in/out flag to get the head of the relevant filter list. This has been done for only IPv4 and IPv6, at present, with these patches only enabling filtering for IPPROTO_IP and IPPROTO_IPV6, although it is possible to have tcp/udp, etc, dedicated filters now also. The ipfilter code has been updated to only filter IPv4 packets - next major release of ipfilter is required for ipv6. @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.10 2000/02/09 00:54:56 itojun Exp $ */ d145 2 a146 2 u_char sin6_len; /* length of this struct(sa_family_t)*/ u_char sin6_family; /* AF_INET6 (sa_family_t) */ @ 1.10 log @to improve RFC2553/2292 compliance, and promote use of RFC2553/2292-compliant header file path, now the following headers are forbidden: netinet6/ip6.h netinet6/icmp6.h netinet6/in6.h if you want netinet6/{ip6,icmp6}.h, use netinet/{ip6,icmp6}.h. if you want netinet6/in6.h, you just need to include netinet/in.h. it pulls it in. (we may need to integrate them into netinet/in.h, but for cross-BSD code sharing i'd like to keep it like this for now) @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.9 2000/01/06 15:46:09 itojun Exp $ */ d599 1 @ 1.9 log @remove extra portability #ifdef (like #ifdef __FreeBSD__) in KAME IPv6/IPsec code, from netbsd-current repository. #ifdef'ed version is always available from ftp.kame.net. XXX please do not make too many diff-unfriendly changes, we'll need to take bunch of diffs on upgrade... @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.8 2000/01/06 06:41:19 itojun Exp $ */ d66 4 @ 1.8 log @make IPV6_BINDV6ONLY setsockopt available. it controls behavior of AF_INET6 wildcard listening socket. heavily documented in ip6(4). net.inet6.ip6.bindv6only defines default value. default is 1. "options INET6_BINDV6ONLY" removes any code fragment that supports IPV6_BINDV6ONLY == 0 case (not defopt'ed as use of this is rare). @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.7 1999/12/13 15:17:22 itojun Exp $ */ d70 1 a70 1 #if !defined(_XOPEN_SOURCE) d137 1 a137 1 #if !defined(_XOPEN_SOURCE) d366 1 a366 1 #if !defined(_XOPEN_SOURCE) d441 1 a441 1 #if !defined(_XOPEN_SOURCE) a523 4 #if (defined(__FreeBSD__) && __FreeBSD__ >= 3) #define IPV6CTL_MAPPED_ADDR 23 #endif #if defined(__NetBSD__) a524 1 #endif a527 20 #ifdef IPV6CTL_MAPPED_ADDR #define IPV6CTL_NAMES_MAPPED_ADDR "mapped_addr" #define IPV6CTL_TYPE_MAPPED_ADDR CTLTYPE_INT #define IPV6CTL_VARS_MAPPED_ADDR &ip6_mapped_addr_on #else #define IPV6CTL_NAMES_MAPPED_ADDR 0 #define IPV6CTL_TYPE_MAPPED_ADDR 0 #define IPV6CTL_VARS_MAPPED_ADDR 0 #endif #ifdef IPV6CTL_BINDV6ONLY #define IPV6CTL_NAMES_BINDV6ONLY "bindv6only" #define IPV6CTL_TYPE_BINDV6ONLY CTLTYPE_INT #define IPV6CTL_VARS_BINDV6ONLY &ip6_bindv6only #else #define IPV6CTL_NAMES_BINDV6ONLY 0 #define IPV6CTL_TYPE_BINDV6ONLY 0 #define IPV6CTL_VARS_BINDV6ONLY 0 #endif d552 2 a553 2 { IPV6CTL_NAMES_MAPPED_ADDR, IPV6CTL_TYPE_MAPPED_ADDR }, \ { IPV6CTL_NAMES_BINDV6ONLY, IPV6CTL_TYPE_BINDV6ONLY }, \ d580 2 a581 2 IPV6CTL_VARS_MAPPED_ADDR, \ IPV6CTL_VARS_BINDV6ONLY, \ a594 10 #ifdef MAPPED_ADDR_ENABLED struct sockaddr; void in6_sin6_2_sin __P((struct sockaddr_in *sin, struct sockaddr_in6 *sin6)); void in6_sin_2_v4mapsin6 __P((struct sockaddr_in *sin, struct sockaddr_in6 *sin6)); void in6_sin6_2_sin_in_sock __P((struct sockaddr *nam)); void in6_sin_2_v4mapsin6_in_sock __P((struct sockaddr **nam)); #endif /* MAPPED_ADDR_ENABLED */ @ 1.7 log @sync IPv6 part with latest KAME tree. IPsec part is left unmodified due to massive changes in KAME side. - IPv6 output goes through nd6_output - faith can capture IPv4 packets as well - you can run IPv4-to-IPv6 translator using heavily modified DNS servers - per-interface statistics (required for IPv6 MIB) - interface autoconfig is revisited - udp input handling has a big change for mapped address support. - introduce in4_cksum() for non-overwriting checksumming - introduce m_pulldown() - neighbor discovery cleanups/improvements - netinet/in.h strictly conforms to RFC2553 (no extra defs visible to userland) - IFA_STATS is fixed a bit (not tested) - and more more more. TODO: - cleanup os-independency #ifdef - avoid rcvif dual use (for IPsec) to help ifdetach (sorry for jumbo commit, I can't separate this any more...) @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.6 1999/07/06 12:23:22 itojun Exp $ */ d524 1 a524 1 #ifdef MAPPED_ADDR_ENABLED d526 4 a529 1 #endif /* MAPPED_ADDR_ENABLED */ d531 1 a531 1 #define IPV6CTL_MAXID 24 d533 1 a533 1 #ifdef MAPPED_ADDR_ENABLED d537 1 a537 1 #else /* MAPPED_ADDR_ENABLED */ d541 11 a551 1 #endif /* MAPPED_ADDR_ENABLED */ d578 1 d606 1 @ 1.6 log @sync with KAME/NetBSD 1.4, SNAP kit 19990705. key changes are: - icmp6 redirect fix (dst check) - revised ip6 multicast check for loopback i/f - several RCS ID cleanups @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.5 1999/07/03 21:30:18 thorpej Exp $ */ d78 1 a78 1 #define __KAME_VERSION "SNAP 19990705/NetBSD-current" d119 2 a121 2 u_int16_t __u6_addr16[8]; u_int8_t __u6_addr8[16]; d125 4 d130 1 a130 3 #define s6_addr16 __u6_addr.__u6_addr16 #define s6_addr8 __u6_addr.__u6_addr8 #define s6_addr __u6_addr.__u6_addr8 d152 11 a162 5 #define IN6MASK0 {{{ 0, 0, 0, 0 }}} #define IN6MASK32 {{{ 0xffffffff, 0, 0, 0 }}} #define IN6MASK64 {{{ 0xffffffff, 0xffffffff, 0, 0 }}} #define IN6MASK96 {{{ 0xffffffff, 0xffffffff, 0xffffffff, 0 }}} #define IN6MASK128 {{{ 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff }}} d175 1 a175 1 d195 1 d200 12 a211 6 #define IN6ADDR_ANY_INIT {{{ 0, 0, 0, 0 }}} #define IN6ADDR_LOOPBACK_INIT {{{ 0, 0, 0, IPV6_ADDR_INT32_ONE }}} #define IN6ADDR_NODELOCAL_ALLNODES_INIT \ {{{ IPV6_ADDR_INT32_MNL, 0, 0, IPV6_ADDR_INT32_ONE }}} #define IN6ADDR_LINKLOCAL_ALLNODES_INIT \ {{{ IPV6_ADDR_INT32_MLL, 0, 0, IPV6_ADDR_INT32_ONE }}} d213 2 a214 1 {{{ IPV6_ADDR_INT32_MLL, 0, 0, IPV6_ADDR_INT32_TWO }}} d224 3 d228 1 d230 5 a234 4 (((a)->s6_addr32[0] == (b)->s6_addr32[0]) && \ ((a)->s6_addr32[1] == (b)->s6_addr32[1]) && \ ((a)->s6_addr32[2] == (b)->s6_addr32[2]) && \ ((a)->s6_addr32[3] == (b)->s6_addr32[3])) d240 4 a243 4 (((a)->s6_addr32[0] == 0) && \ ((a)->s6_addr32[1] == 0) && \ ((a)->s6_addr32[2] == 0) && \ ((a)->s6_addr32[3] == 0)) d249 4 a252 4 (((a)->s6_addr32[0] == 0) && \ ((a)->s6_addr32[1] == 0) && \ ((a)->s6_addr32[2] == 0) && \ ((a)->s6_addr32[3] == IPV6_ADDR_INT32_ONE)) d258 5 a262 5 (((a)->s6_addr32[0] == 0) && \ ((a)->s6_addr32[1] == 0) && \ ((a)->s6_addr32[2] == 0) && \ ((a)->s6_addr32[3] != 0) && \ ((a)->s6_addr32[3] != IPV6_ADDR_INT32_ONE)) d268 3 a270 3 (((a)->s6_addr32[0] == 0) && \ ((a)->s6_addr32[1] == 0) && \ ((a)->s6_addr32[2] == IPV6_ADDR_INT32_SMP)) d276 1 d282 7 d292 1 d295 1 a295 1 ((a)->s6_addr16[0] == IPV6_ADDR_INT16_ULL) d297 1 a297 1 ((a)->s6_addr16[0] == IPV6_ADDR_INT16_USL) d302 1 a302 1 #define IN6_IS_ADDR_MULTICAST(a) ((a)->s6_addr8[0] == 0xff) d304 5 a308 1 #define IPV6_ADDR_MC_SCOPE(a) ((a)->s6_addr8[1] & 0x0f) d313 1 d329 17 d350 1 d352 1 d357 1 d361 1 d405 1 a405 1 #define IPV6_FAITH 32 /* bool; accept FAITH'ed connections */ d522 5 d528 11 a538 1 #define IPV6CTL_MAXID 21 d562 3 d585 1 a585 1 &auto_flowlabel, \ d589 3 d599 1 a599 1 int in6_cksum __P((struct mbuf *, u_int8_t, int, int)); d605 10 @ 1.6.2.1 log @Update thorpej_scsipi to -current as of a month ago @ text @d1 1 a1 2 /* $NetBSD: in6.h,v 1.21 2000/10/17 21:46:42 itojun Exp $ */ /* $KAME: in6.h,v 1.57 2000/08/26 10:00:45 itojun Exp $ */ d6 1 a6 1 * d18 1 a18 1 * a66 4 #ifndef __KAME_NETINET_IN_H_INCLUDED_ #error "do not include netinet6/in6.h directly, include netinet/in.h" #endif d70 4 d78 1 a78 1 #define __KAME_VERSION "19991213/NetBSD-current" d89 1 a89 1 * The default range is IPPORT_ANONMIN to IPPORT_ANONMAX, although d119 2 a121 2 u_int16_t __u6_addr16[8]; u_int32_t __u6_addr32[4]; d125 3 a128 5 #ifdef _KERNEL /*XXX nonstandard*/ #define s6_addr8 __u6_addr.__u6_addr8 #define s6_addr16 __u6_addr.__u6_addr16 #define s6_addr32 __u6_addr.__u6_addr32 #endif d135 1 a135 1 #ifndef _XOPEN_SOURCE d139 2 a140 2 u_int8_t sin6_len; /* length of this struct(sa_family_t)*/ sa_family_t sin6_family; /* AF_INET6 (sa_family_t) */ d150 5 a154 11 #ifdef _KERNEL /*XXX nonstandard*/ #define IN6MASK0 {{{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }}} #define IN6MASK32 {{{ 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }}} #define IN6MASK64 {{{ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }}} #define IN6MASK96 {{{ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \ 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00 }}} #define IN6MASK128 {{{ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }}} #endif d167 1 a167 1 #ifdef _KERNEL /*XXX nonstandard*/ a186 1 #endif d191 6 a196 12 #define IN6ADDR_ANY_INIT \ {{{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }}} #define IN6ADDR_LOOPBACK_INIT \ {{{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 }}} #define IN6ADDR_NODELOCAL_ALLNODES_INIT \ {{{ 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 }}} #define IN6ADDR_LINKLOCAL_ALLNODES_INIT \ {{{ 0xff, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 }}} d198 1 a198 2 {{{ 0xff, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02 }}} a207 3 * NOTE: Some of kernel programming environment (for example, openbsd/sparc) * does not supply memcmp(). For userland memcmp() is preferred as it is * in ANSI standard. a208 4 #ifdef _KERNEL #define IN6_ARE_ADDR_EQUAL(a, b) \ (bcmp(&(a)->s6_addr[0], &(b)->s6_addr[0], sizeof(struct in6_addr)) == 0) #else d210 4 a213 2 (memcmp(&(a)->s6_addr[0], &(b)->s6_addr[0], sizeof(struct in6_addr)) == 0) #endif d219 4 a222 4 ((*(u_int32_t *)(void *)(&(a)->s6_addr[0]) == 0) && \ (*(u_int32_t *)(void *)(&(a)->s6_addr[4]) == 0) && \ (*(u_int32_t *)(void *)(&(a)->s6_addr[8]) == 0) && \ (*(u_int32_t *)(void *)(&(a)->s6_addr[12]) == 0)) d228 4 a231 4 ((*(u_int32_t *)(void *)(&(a)->s6_addr[0]) == 0) && \ (*(u_int32_t *)(void *)(&(a)->s6_addr[4]) == 0) && \ (*(u_int32_t *)(void *)(&(a)->s6_addr[8]) == 0) && \ (*(u_int32_t *)(void *)(&(a)->s6_addr[12]) == ntohl(1))) d237 5 a241 5 ((*(u_int32_t *)(void *)(&(a)->s6_addr[0]) == 0) && \ (*(u_int32_t *)(void *)(&(a)->s6_addr[4]) == 0) && \ (*(u_int32_t *)(void *)(&(a)->s6_addr[8]) == 0) && \ (*(u_int32_t *)(void *)(&(a)->s6_addr[12]) != 0) && \ (*(u_int32_t *)(void *)(&(a)->s6_addr[12]) != ntohl(1))) d247 3 a249 3 ((*(u_int32_t *)(void *)(&(a)->s6_addr[0]) == 0) && \ (*(u_int32_t *)(void *)(&(a)->s6_addr[4]) == 0) && \ (*(u_int32_t *)(void *)(&(a)->s6_addr[8]) == ntohl(0x0000ffff))) a254 1 #ifdef _KERNEL /*XXX nonstandard*/ a259 7 #else #define __IPV6_ADDR_SCOPE_NODELOCAL 0x01 #define __IPV6_ADDR_SCOPE_LINKLOCAL 0x02 #define __IPV6_ADDR_SCOPE_SITELOCAL 0x05 #define __IPV6_ADDR_SCOPE_ORGLOCAL 0x08 /* just used in this file */ #define __IPV6_ADDR_SCOPE_GLOBAL 0x0e #endif a262 1 * Note that we must check topmost 10 bits only, not 16 bits (see RFC2373). d265 1 a265 1 (((a)->s6_addr[0] == 0xfe) && (((a)->s6_addr[1] & 0xc0) == 0x80)) d267 1 a267 1 (((a)->s6_addr[0] == 0xfe) && (((a)->s6_addr[1] & 0xc0) == 0xc0)) d272 1 a272 1 #define IN6_IS_ADDR_MULTICAST(a) ((a)->s6_addr[0] == 0xff) d274 1 a274 5 #ifdef _KERNEL /*XXX nonstandard*/ #define IPV6_ADDR_MC_SCOPE(a) ((a)->s6_addr[1] & 0x0f) #else #define __IPV6_ADDR_MC_SCOPE(a) ((a)->s6_addr[1] & 0x0f) #endif a278 1 #ifdef _KERNEL /*refers nonstandard items */ a293 17 #else #define IN6_IS_ADDR_MC_NODELOCAL(a) \ (IN6_IS_ADDR_MULTICAST(a) && \ (__IPV6_ADDR_MC_SCOPE(a) == __IPV6_ADDR_SCOPE_NODELOCAL)) #define IN6_IS_ADDR_MC_LINKLOCAL(a) \ (IN6_IS_ADDR_MULTICAST(a) && \ (__IPV6_ADDR_MC_SCOPE(a) == __IPV6_ADDR_SCOPE_LINKLOCAL)) #define IN6_IS_ADDR_MC_SITELOCAL(a) \ (IN6_IS_ADDR_MULTICAST(a) && \ (__IPV6_ADDR_MC_SCOPE(a) == __IPV6_ADDR_SCOPE_SITELOCAL)) #define IN6_IS_ADDR_MC_ORGLOCAL(a) \ (IN6_IS_ADDR_MULTICAST(a) && \ (__IPV6_ADDR_MC_SCOPE(a) == __IPV6_ADDR_SCOPE_ORGLOCAL)) #define IN6_IS_ADDR_MC_GLOBAL(a) \ (IN6_IS_ADDR_MULTICAST(a) && \ (__IPV6_ADDR_MC_SCOPE(a) == __IPV6_ADDR_SCOPE_GLOBAL)) #endif a297 1 #if 0 /*pre-RFC2553*/ a298 1 #endif a302 1 #ifdef _KERNEL /*nonstandard*/ a305 1 #endif d310 1 a310 1 #ifndef _XOPEN_SOURCE d349 1 a349 2 #define IPV6_FAITH 29 /* bool; accept FAITH'ed connections */ /* to define items, should talk with KAME guys first, for *BSD compatibility */ d366 1 a366 1 unsigned int ipv6mr_interface; d373 2 a374 2 struct in6_addr ipi6_addr; /* src/dst IPv6 address */ unsigned int ipi6_ifindex; /* send/recv interface index */ d385 1 a385 1 #ifndef _XOPEN_SOURCE a465 8 #define IPV6CTL_USE_DEPRECATED 21 /* use deprecated addr (RFC2462 5.5.4) */ #define IPV6CTL_RR_PRUNE 22 /* walk timer for router renumbering */ #define IPV6CTL_BINDV6ONLY 24 /* 25 to 27: reserved */ #define IPV6CTL_ANONPORTMIN 28 /* minimum ephemeral port */ #define IPV6CTL_ANONPORTMAX 29 /* maximum ephemeral port */ #define IPV6CTL_LOWPORTMIN 30 /* minimum reserved port */ #define IPV6CTL_LOWPORTMAX 31 /* maximum reserved port */ d467 1 a467 2 /* to define items, should talk with KAME guys first, for *BSD compatibility */ #define IPV6CTL_MAXID 32 a490 11 { "use_deprecated", CTLTYPE_INT }, \ { "rr_prune", CTLTYPE_INT }, \ { 0, 0 }, \ { "bindv6only", CTLTYPE_INT }, \ { 0, 0 }, \ { 0, 0 }, \ { 0, 0 }, \ { "anonportmin", CTLTYPE_INT }, \ { "anonportmax", CTLTYPE_INT }, \ { "lowportmin", CTLTYPE_INT }, \ { "lowportmax", CTLTYPE_INT }, \ d493 23 d521 2 a522 1 int in6_cksum __P((struct mbuf *, u_int8_t, u_int32_t, u_int32_t)); a527 1 extern u_char ip6_protox[]; d537 6 a542 7 extern int inet6_option_space __P((int)); extern int inet6_option_init __P((void *, struct cmsghdr **, int)); extern int inet6_option_append __P((struct cmsghdr *, const u_int8_t *, int, int)); extern u_int8_t *inet6_option_alloc __P((struct cmsghdr *, int, int, int)); extern int inet6_option_next __P((const struct cmsghdr *, u_int8_t **)); extern int inet6_option_find __P((const struct cmsghdr *, u_int8_t **, int)); @ 1.6.2.2 log @Sync with HEAD. @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.6.2.1 2000/11/20 18:10:46 bouyer Exp $ */ a165 2 extern const struct sockaddr_in6 sa6_any; @ 1.6.2.3 log @Sync with HEAD. @ text @d1 2 a2 2 /* $NetBSD$ */ /* $KAME: in6.h,v 1.81 2001/03/02 04:54:45 itojun Exp $ */ a76 2 * for *BSD-current/release: http://www.kame.net/dev/cvsweb.cgi/kame/COVERAGE * has the table of implementation/integration differences. d79 1 a79 1 #define __KAME_VERSION "NetBSD-current" @ 1.6.2.4 log @Sync with HEAD @ text @d1 2 a2 2 /* $NetBSD: in6.h,v 1.25 2001/03/30 05:53:52 itojun Exp $ */ /* $KAME: in6.h,v 1.83 2001/03/29 02:55:07 jinmei Exp $ */ d69 1 a69 1 #error "do not include netinet6/in6.h directly, include netinet/in.h. see RFC2553" d245 4 a248 4 ((*(const u_int32_t *)(const void *)(&(a)->s6_addr[0]) == 0) && \ (*(const u_int32_t *)(const void *)(&(a)->s6_addr[4]) == 0) && \ (*(const u_int32_t *)(const void *)(&(a)->s6_addr[8]) == 0) && \ (*(const u_int32_t *)(const void *)(&(a)->s6_addr[12]) == 0)) d254 4 a257 4 ((*(const u_int32_t *)(const void *)(&(a)->s6_addr[0]) == 0) && \ (*(const u_int32_t *)(const void *)(&(a)->s6_addr[4]) == 0) && \ (*(const u_int32_t *)(const void *)(&(a)->s6_addr[8]) == 0) && \ (*(const u_int32_t *)(const void *)(&(a)->s6_addr[12]) == ntohl(1))) d263 5 a267 5 ((*(const u_int32_t *)(const void *)(&(a)->s6_addr[0]) == 0) && \ (*(const u_int32_t *)(const void *)(&(a)->s6_addr[4]) == 0) && \ (*(const u_int32_t *)(const void *)(&(a)->s6_addr[8]) == 0) && \ (*(const u_int32_t *)(const void *)(&(a)->s6_addr[12]) != 0) && \ (*(const u_int32_t *)(const void *)(&(a)->s6_addr[12]) != ntohl(1))) d273 3 a275 3 ((*(const u_int32_t *)(const void *)(&(a)->s6_addr[0]) == 0) && \ (*(const u_int32_t *)(const void *)(&(a)->s6_addr[4]) == 0) && \ (*(const u_int32_t *)(const void *)(&(a)->s6_addr[8]) == ntohl(0x0000ffff))) @ 1.6.8.1 log @Pull up to last week's -current. @ text @d1 1 a1 1 /* $NetBSD: in6.h,v 1.7 1999/12/13 15:17:22 itojun Exp $ */ d78 1 a78 1 #define __KAME_VERSION "19991213/NetBSD-current" d119 2 a121 2 u_int16_t __u6_addr16[8]; u_int32_t __u6_addr32[4]; d125 3 a128 5 #ifdef _KERNEL /*XXX nonstandard*/ #define s6_addr8 __u6_addr.__u6_addr8 #define s6_addr16 __u6_addr.__u6_addr16 #define s6_addr32 __u6_addr.__u6_addr32 #endif d150 5 a154 11 #ifdef _KERNEL /*XXX nonstandard*/ #define IN6MASK0 {{{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }}} #define IN6MASK32 {{{ 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }}} #define IN6MASK64 {{{ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }}} #define IN6MASK96 {{{ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \ 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00 }}} #define IN6MASK128 {{{ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }}} #endif d167 1 a167 1 #ifdef _KERNEL /*XXX nonstandard*/ a186 1 #endif d191 6 a196 12 #define IN6ADDR_ANY_INIT \ {{{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }}} #define IN6ADDR_LOOPBACK_INIT \ {{{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 }}} #define IN6ADDR_NODELOCAL_ALLNODES_INIT \ {{{ 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 }}} #define IN6ADDR_LINKLOCAL_ALLNODES_INIT \ {{{ 0xff, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 }}} d198 1 a198 2 {{{ 0xff, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02 }}} a207 3 * NOTE: Some of kernel programming environment (for example, openbsd/sparc) * does not supply memcmp(). For userland memcmp() is preferred as it is * in ANSI standard. a208 1 #ifdef _KERNEL d210 4 a213 5 (bcmp((a), (b), sizeof(struct in6_addr)) == 0) #else #define IN6_ARE_ADDR_EQUAL(a, b) \ (memcmp((a), (b), sizeof(struct in6_addr)) == 0) #endif d219 4 a222 4 ((*(u_int32_t *)(&(a)->s6_addr[0]) == 0) && \ (*(u_int32_t *)(&(a)->s6_addr[4]) == 0) && \ (*(u_int32_t *)(&(a)->s6_addr[8]) == 0) && \ (*(u_int32_t *)(&(a)->s6_addr[12]) == 0)) d228 4 a231 4 ((*(u_int32_t *)(&(a)->s6_addr[0]) == 0) && \ (*(u_int32_t *)(&(a)->s6_addr[4]) == 0) && \ (*(u_int32_t *)(&(a)->s6_addr[8]) == 0) && \ (*(u_int32_t *)(&(a)->s6_addr[12]) == ntohl(1))) d237 5 a241 5 ((*(u_int32_t *)(&(a)->s6_addr[0]) == 0) && \ (*(u_int32_t *)(&(a)->s6_addr[4]) == 0) && \ (*(u_int32_t *)(&(a)->s6_addr[8]) == 0) && \ (*(u_int32_t *)(&(a)->s6_addr[12]) != 0) && \ (*(u_int32_t *)(&(a)->s6_addr[12]) != ntohl(1))) d247 3 a249 3 ((*(u_int32_t *)(&(a)->s6_addr[0]) == 0) && \ (*(u_int32_t *)(&(a)->s6_addr[4]) == 0) && \ (*(u_int32_t *)(&(a)->s6_addr[8]) == ntohl(0x0000ffff))) a254 1 #ifdef _KERNEL /*XXX nonstandard*/ a259 7 #else #define __IPV6_ADDR_SCOPE_NODELOCAL 0x01 #define __IPV6_ADDR_SCOPE_LINKLOCAL 0x02 #define __IPV6_ADDR_SCOPE_SITELOCAL 0x05 #define __IPV6_ADDR_SCOPE_ORGLOCAL 0x08 /* just used in this file */ #define __IPV6_ADDR_SCOPE_GLOBAL 0x0e #endif a262 1 * Note that we must check topmost 10 bits only, not 16 bits (see RFC2373). d265 1 a265 1 (((a)->s6_addr[0] == 0xfe) && (((a)->s6_addr[1] & 0xc0) == 0x80)) d267 1 a267 1 (((a)->s6_addr[0] == 0xfe) && (((a)->s6_addr[1] & 0xc0) == 0xc0)) d272 1 a272 1 #define IN6_IS_ADDR_MULTICAST(a) ((a)->s6_addr[0] == 0xff) d274 1 a274 5 #ifdef _KERNEL /*XXX nonstandard*/ #define IPV6_ADDR_MC_SCOPE(a) ((a)->s6_addr[1] & 0x0f) #else #define __IPV6_ADDR_MC_SCOPE(a) ((a)->s6_addr[1] & 0x0f) #endif a278 1 #ifdef _KERNEL /*refers nonstandard items */ a293 17 #else #define IN6_IS_ADDR_MC_NODELOCAL(a) \ (IN6_IS_ADDR_MULTICAST(a) && \ (__IPV6_ADDR_MC_SCOPE(a) == __IPV6_ADDR_SCOPE_NODELOCAL)) #define IN6_IS_ADDR_MC_LINKLOCAL(a) \ (IN6_IS_ADDR_MULTICAST(a) && \ (__IPV6_ADDR_MC_SCOPE(a) == __IPV6_ADDR_SCOPE_LINKLOCAL)) #define IN6_IS_ADDR_MC_SITELOCAL(a) \ (IN6_IS_ADDR_MULTICAST(a) && \ (__IPV6_ADDR_MC_SCOPE(a) == __IPV6_ADDR_SCOPE_SITELOCAL)) #define IN6_IS_ADDR_MC_ORGLOCAL(a) \ (IN6_IS_ADDR_MULTICAST(a) && \ (__IPV6_ADDR_MC_SCOPE(a) == __IPV6_ADDR_SCOPE_ORGLOCAL)) #define IN6_IS_ADDR_MC_GLOBAL(a) \ (IN6_IS_ADDR_MULTICAST(a) && \ (__IPV6_ADDR_MC_SCOPE(a) == __IPV6_ADDR_SCOPE_GLOBAL)) #endif a297 1 #if 0 /*pre-RFC2553*/ a298 1 #endif a302 1 #ifdef _KERNEL /*nonstandard*/ a305 1 #endif d349 1 a349 1 #define IPV6_FAITH 29 /* bool; accept FAITH'ed connections */ a465 5 #define IPV6CTL_USE_DEPRECATED 21 /* use deprecated addr (RFC2462 5.5.4) */ #define IPV6CTL_RR_PRUNE 22 /* walk timer for router renumbering */ #ifdef MAPPED_ADDR_ENABLED #define IPV6CTL_MAPPED_ADDR 23 #endif /* MAPPED_ADDR_ENABLED */ d467 1 a467 11 #define IPV6CTL_MAXID 24 #ifdef MAPPED_ADDR_ENABLED #define IPV6CTL_NAMES_MAPPED_ADDR "mapped_addr" #define IPV6CTL_TYPE_MAPPED_ADDR CTLTYPE_INT #define IPV6CTL_VARS_MAPPED_ADDR &ip6_mapped_addr_on #else /* MAPPED_ADDR_ENABLED */ #define IPV6CTL_NAMES_MAPPED_ADDR 0 #define IPV6CTL_TYPE_MAPPED_ADDR 0 #define IPV6CTL_VARS_MAPPED_ADDR 0 #endif /* MAPPED_ADDR_ENABLED */ a490 3 { "use_deprecated", CTLTYPE_INT }, \ { "rr_prune", CTLTYPE_INT }, \ { IPV6CTL_NAMES_MAPPED_ADDR, IPV6CTL_TYPE_MAPPED_ADDR }, \ d511 1 a511 1 &ip6_auto_flowlabel, \ a514 3 &ip6_use_deprecated, \ &ip6_rr_prune, \ IPV6CTL_VARS_MAPPED_ADDR, \ d522 1 a522 1 int in6_cksum __P((struct mbuf *, u_int8_t, u_int32_t, u_int32_t)); a527 10 #ifdef MAPPED_ADDR_ENABLED struct sockaddr; void in6_sin6_2_sin __P((struct sockaddr_in *sin, struct sockaddr_in6 *sin6)); void in6_sin_2_v4mapsin6 __P((struct sockaddr_in *sin, struct sockaddr_in6 *sin6)); void in6_sin6_2_sin_in_sock __P((struct sockaddr *nam)); void in6_sin_2_v4mapsin6_in_sock __P((struct sockaddr **nam)); #endif /* MAPPED_ADDR_ENABLED */ @ 1.5 log @RCS ID police. @ text @d1 1 a1 1 /* $NetBSD$ */ d78 1 a78 1 #define __KAME_VERSION "SNAP 19990628/NetBSD-current" @ 1.4 log @Take a stab at namespace protection. For now, only the obvious problems are addressed, the culprit being the lack of a namespace definition for an IPv6- extended in XNS5.2 D2.0; I'll try to work something out and submit it to the review WG. @ text @d1 2 @ 1.3 log @move ipsec sysctl index to IPPROTO_AH (instead of IPPROTO_ESP), so that you can perform sysctl operation when ESP is not compiled in. @ text @d68 1 d70 1 d115 1 a115 1 struct in6_addr { d117 4 a120 4 u_int32_t u6_addr32[4]; u_int16_t u6_addr16[8]; u_int8_t u6_addr8[16]; } u6_addr; /* 128 bit IP6 address */ d123 4 a126 4 #define s6_addr32 u6_addr.u6_addr32 #define s6_addr16 u6_addr.u6_addr16 #define s6_addr8 u6_addr.u6_addr8 #define s6_addr u6_addr.u6_addr8 d133 1 d135 1 d308 2 a309 1 struct route_in6 { d313 1 d383 1 d514 1 @ 1.2 log @IPv6 kernel code, based on KAME/NetBSD 1.4, SNAP kit 19990628. (Sorry for a big commit, I can't separate this into several pieces...) Pls check sys/netinet6/TODO and sys/netinet6/IMPLEMENTATION for details. - sys/kern: do not assume single mbuf, accept chained mbuf on passing data from userland to kernel (or other way round). - "midway" ATM card: ATM PVC pseudo device support, like those done in ALTQ package (ftp://ftp.csl.sony.co.jp/pub/kjc/). - sys/netinet/tcp*: IPv4/v6 dual stack tcp support. - sys/netinet/{ip6,icmp6}.h, sys/net/pfkeyv2.h: IETF document assumes those file to be there so we patch it up. - sys/netinet: IPsec additions are here and there. - sys/netinet6/*: most of IPv6 code sits here. - sys/netkey: IPsec key management code - dev/pci/pcidevs: regen In my understanding no code here is subject to export control so it should be safe. @ text @d408 1 a409 1 { 0, 0 }, \ @ 1.2.2.1 log @file in6.h was added on branch chs-ubc2 on 1999-07-01 23:48:27 +0000 @ text @d1 547 @ 1.2.2.2 log @Sync w/ -current. @ text @a0 547 /* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. * All rights reserved. * * 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. * 3. Neither the name of the project nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE PROJECT 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 PROJECT 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. */ /* * Copyright (c) 1982, 1986, 1990, 1993 * The Regents of the University of California. All rights reserved. * * 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. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by the University of * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * 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. * * @@(#)in.h 8.3 (Berkeley) 1/3/94 */ #ifndef _NETINET6_IN6_H_ #define _NETINET6_IN6_H_ #include /* * Identification of the network protocol stack */ #define __KAME__ #define __KAME_VERSION "SNAP 19990628/NetBSD-current" /* * Local port number conventions: * * Ports < IPPORT_RESERVED are reserved for privileged processes (e.g. root), * unless a kernel is compiled with IPNOPRIVPORTS defined. * * When a user does a bind(2) or connect(2) with a port number of zero, * a non-conflicting local port address is chosen. * * The default range is IPPORT_ANONMIX to IPPORT_ANONMAX, although * that is settable by sysctl(3); net.inet.ip.anonportmin and * net.inet.ip.anonportmax respectively. * * A user may set the IPPROTO_IP option IP_PORTRANGE to change this * default assignment range. * * The value IP_PORTRANGE_DEFAULT causes the default behavior. * * The value IP_PORTRANGE_HIGH is the same as IP_PORTRANGE_DEFAULT, * and exists only for FreeBSD compatibility purposes. * * The value IP_PORTRANGE_LOW changes the range to the "low" are * that is (by convention) restricted to privileged processes. * This convention is based on "vouchsafe" principles only. * It is only secure if you trust the remote host to restrict these ports. * The range is IPPORT_RESERVEDMIN to IPPORT_RESERVEDMAX. */ #define IPV6PORT_RESERVED 1024 #define IPV6PORT_ANONMIN 49152 #define IPV6PORT_ANONMAX 65535 #define IPV6PORT_RESERVEDMIN 600 #define IPV6PORT_RESERVEDMAX (IPV6PORT_RESERVED-1) /* * IPv6 address */ struct in6_addr { union { u_int32_t u6_addr32[4]; u_int16_t u6_addr16[8]; u_int8_t u6_addr8[16]; } u6_addr; /* 128 bit IP6 address */ }; #define s6_addr32 u6_addr.u6_addr32 #define s6_addr16 u6_addr.u6_addr16 #define s6_addr8 u6_addr.u6_addr8 #define s6_addr u6_addr.u6_addr8 #define INET6_ADDRSTRLEN 46 /* * Socket address for IPv6 */ #define SIN6_LEN struct sockaddr_in6 { u_char sin6_len; /* length of this struct(sa_family_t)*/ u_char sin6_family; /* AF_INET6 (sa_family_t) */ u_int16_t sin6_port; /* Transport layer port # (in_port_t)*/ u_int32_t sin6_flowinfo; /* IP6 flow information */ struct in6_addr sin6_addr; /* IP6 address */ u_int32_t sin6_scope_id; /* intface scope id */ }; /* * Local definition for masks */ #define IN6MASK0 {{{ 0, 0, 0, 0 }}} #define IN6MASK32 {{{ 0xffffffff, 0, 0, 0 }}} #define IN6MASK64 {{{ 0xffffffff, 0xffffffff, 0, 0 }}} #define IN6MASK96 {{{ 0xffffffff, 0xffffffff, 0xffffffff, 0 }}} #define IN6MASK128 {{{ 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff }}} #ifdef _KERNEL extern const struct in6_addr in6mask0; extern const struct in6_addr in6mask32; extern const struct in6_addr in6mask64; extern const struct in6_addr in6mask96; extern const struct in6_addr in6mask128; #endif /* _KERNEL */ /* * Macros started with IPV6_ADDR is KAME local */ #if BYTE_ORDER == BIG_ENDIAN #define IPV6_ADDR_INT32_ONE 1 #define IPV6_ADDR_INT32_TWO 2 #define IPV6_ADDR_INT32_MNL 0xff010000 #define IPV6_ADDR_INT32_MLL 0xff020000 #define IPV6_ADDR_INT32_SMP 0x0000ffff #define IPV6_ADDR_INT16_ULL 0xfe80 #define IPV6_ADDR_INT16_USL 0xfec0 #define IPV6_ADDR_INT16_MLL 0xff02 #elif BYTE_ORDER == LITTLE_ENDIAN #define IPV6_ADDR_INT32_ONE 0x01000000 #define IPV6_ADDR_INT32_TWO 0x02000000 #define IPV6_ADDR_INT32_MNL 0x000001ff #define IPV6_ADDR_INT32_MLL 0x000002ff #define IPV6_ADDR_INT32_SMP 0xffff0000 #define IPV6_ADDR_INT16_ULL 0x80fe #define IPV6_ADDR_INT16_USL 0xc0fe #define IPV6_ADDR_INT16_MLL 0x02ff #endif /* * Definition of some useful macros to handle IP6 addresses */ #define IN6ADDR_ANY_INIT {{{ 0, 0, 0, 0 }}} #define IN6ADDR_LOOPBACK_INIT {{{ 0, 0, 0, IPV6_ADDR_INT32_ONE }}} #define IN6ADDR_NODELOCAL_ALLNODES_INIT \ {{{ IPV6_ADDR_INT32_MNL, 0, 0, IPV6_ADDR_INT32_ONE }}} #define IN6ADDR_LINKLOCAL_ALLNODES_INIT \ {{{ IPV6_ADDR_INT32_MLL, 0, 0, IPV6_ADDR_INT32_ONE }}} #define IN6ADDR_LINKLOCAL_ALLROUTERS_INIT \ {{{ IPV6_ADDR_INT32_MLL, 0, 0, IPV6_ADDR_INT32_TWO }}} extern const struct in6_addr in6addr_any; extern const struct in6_addr in6addr_loopback; extern const struct in6_addr in6addr_nodelocal_allnodes; extern const struct in6_addr in6addr_linklocal_allnodes; extern const struct in6_addr in6addr_linklocal_allrouters; /* * Equality */ #define IN6_ARE_ADDR_EQUAL(a, b) \ (((a)->s6_addr32[0] == (b)->s6_addr32[0]) && \ ((a)->s6_addr32[1] == (b)->s6_addr32[1]) && \ ((a)->s6_addr32[2] == (b)->s6_addr32[2]) && \ ((a)->s6_addr32[3] == (b)->s6_addr32[3])) /* * Unspecified */ #define IN6_IS_ADDR_UNSPECIFIED(a) \ (((a)->s6_addr32[0] == 0) && \ ((a)->s6_addr32[1] == 0) && \ ((a)->s6_addr32[2] == 0) && \ ((a)->s6_addr32[3] == 0)) /* * Loopback */ #define IN6_IS_ADDR_LOOPBACK(a) \ (((a)->s6_addr32[0] == 0) && \ ((a)->s6_addr32[1] == 0) && \ ((a)->s6_addr32[2] == 0) && \ ((a)->s6_addr32[3] == IPV6_ADDR_INT32_ONE)) /* * IPv4 compatible */ #define IN6_IS_ADDR_V4COMPAT(a) \ (((a)->s6_addr32[0] == 0) && \ ((a)->s6_addr32[1] == 0) && \ ((a)->s6_addr32[2] == 0) && \ ((a)->s6_addr32[3] != 0) && \ ((a)->s6_addr32[3] != IPV6_ADDR_INT32_ONE)) /* * Mapped */ #define IN6_IS_ADDR_V4MAPPED(a) \ (((a)->s6_addr32[0] == 0) && \ ((a)->s6_addr32[1] == 0) && \ ((a)->s6_addr32[2] == IPV6_ADDR_INT32_SMP)) /* * KAME Scope Values */ #define IPV6_ADDR_SCOPE_NODELOCAL 0x01 #define IPV6_ADDR_SCOPE_LINKLOCAL 0x02 #define IPV6_ADDR_SCOPE_SITELOCAL 0x05 #define IPV6_ADDR_SCOPE_ORGLOCAL 0x08 /* just used in this file */ #define IPV6_ADDR_SCOPE_GLOBAL 0x0e /* * Unicast Scope */ #define IN6_IS_ADDR_LINKLOCAL(a) \ ((a)->s6_addr16[0] == IPV6_ADDR_INT16_ULL) #define IN6_IS_ADDR_SITELOCAL(a) \ ((a)->s6_addr16[0] == IPV6_ADDR_INT16_USL) /* * Multicast */ #define IN6_IS_ADDR_MULTICAST(a) ((a)->s6_addr8[0] == 0xff) #define IPV6_ADDR_MC_SCOPE(a) ((a)->s6_addr8[1] & 0x0f) /* * Multicast Scope */ #define IN6_IS_ADDR_MC_NODELOCAL(a) \ (IN6_IS_ADDR_MULTICAST(a) && \ (IPV6_ADDR_MC_SCOPE(a) == IPV6_ADDR_SCOPE_NODELOCAL)) #define IN6_IS_ADDR_MC_LINKLOCAL(a) \ (IN6_IS_ADDR_MULTICAST(a) && \ (IPV6_ADDR_MC_SCOPE(a) == IPV6_ADDR_SCOPE_LINKLOCAL)) #define IN6_IS_ADDR_MC_SITELOCAL(a) \ (IN6_IS_ADDR_MULTICAST(a) && \ (IPV6_ADDR_MC_SCOPE(a) == IPV6_ADDR_SCOPE_SITELOCAL)) #define IN6_IS_ADDR_MC_ORGLOCAL(a) \ (IN6_IS_ADDR_MULTICAST(a) && \ (IPV6_ADDR_MC_SCOPE(a) == IPV6_ADDR_SCOPE_ORGLOCAL)) #define IN6_IS_ADDR_MC_GLOBAL(a) \ (IN6_IS_ADDR_MULTICAST(a) && \ (IPV6_ADDR_MC_SCOPE(a) == IPV6_ADDR_SCOPE_GLOBAL)) /* * Wildcard Socket */ #define IN6_IS_ADDR_ANY(a) IN6_IS_ADDR_UNSPECIFIED(a) /* * KAME Scope */ #define IN6_IS_SCOPE_LINKLOCAL(a) \ ((IN6_IS_ADDR_LINKLOCAL(a)) || \ (IN6_IS_ADDR_MC_LINKLOCAL(a))) /* * IP6 route structure */ struct route_in6 { struct rtentry *ro_rt; struct sockaddr_in6 ro_dst; }; /* * Options for use with [gs]etsockopt at the IPV6 level. * First word of comment is data type; bool is stored in int. */ #define IPV6_OPTIONS 1 /* buf/ip6_opts; set/get IP6 options */ /* no hdrincl */ #define IPV6_SOCKOPT_RESERVED1 3 /* reserved for future use */ #define IPV6_UNICAST_HOPS 4 /* int; IP6 hops */ #define IPV6_RECVOPTS 5 /* bool; receive all IP6 opts w/dgram */ #define IPV6_RECVRETOPTS 6 /* bool; receive IP6 opts for response */ #define IPV6_RECVDSTADDR 7 /* bool; receive IP6 dst addr w/dgram */ #define IPV6_RETOPTS 8 /* ip6_opts; set/get IP6 options */ #define IPV6_MULTICAST_IF 9 /* u_char; set/get IP6 multicast i/f */ #define IPV6_MULTICAST_HOPS 10 /* u_char; set/get IP6 multicast hops */ #define IPV6_MULTICAST_LOOP 11 /* u_char; set/get IP6 multicast loopback */ #define IPV6_JOIN_GROUP 12 /* ip6_mreq; join a group membership */ #define IPV6_LEAVE_GROUP 13 /* ip6_mreq; leave a group membership */ #define IPV6_PORTRANGE 14 /* int; range to choose for unspec port */ #define ICMP6_FILTER 18 /* icmp6_filter; icmp6 filter */ #define IPV6_PKTINFO 19 /* bool; send/rcv if, src/dst addr */ #define IPV6_HOPLIMIT 20 /* bool; hop limit */ #define IPV6_NEXTHOP 21 /* bool; next hop addr */ #define IPV6_HOPOPTS 22 /* bool; hop-by-hop option */ #define IPV6_DSTOPTS 23 /* bool; destination option */ #define IPV6_RTHDR 24 /* bool; routing header */ #define IPV6_PKTOPTIONS 25 /* buf/cmsghdr; set/get IPv6 options */ #define IPV6_CHECKSUM 26 /* int; checksum offset for raw socket */ #define IPV6_BINDV6ONLY 27 /* bool; only bind INET6 at null bind */ #if 1 /*IPSEC*/ #define IPV6_IPSEC_POLICY 28 /* struct; get/set security policy */ #endif #define IPV6_FAITH 32 /* bool; accept FAITH'ed connections */ #define IPV6_RTHDR_LOOSE 0 /* this hop need not be a neighbor. XXX old spec */ #define IPV6_RTHDR_STRICT 1 /* this hop must be a neighbor. XXX old spec */ #define IPV6_RTHDR_TYPE_0 0 /* IPv6 routing header type 0 */ /* * Defaults and limits for options */ #define IPV6_DEFAULT_MULTICAST_HOPS 1 /* normally limit m'casts to 1 hop */ #define IPV6_DEFAULT_MULTICAST_LOOP 1 /* normally hear sends if a member */ /* * Argument structure for IPV6_JOIN_GROUP and IPV6_LEAVE_GROUP. */ struct ipv6_mreq { struct in6_addr ipv6mr_multiaddr; u_int ipv6mr_interface; }; /* * IPV6_PKTINFO: Packet information(RFC2292 sec 5) */ struct in6_pktinfo { struct in6_addr ipi6_addr; /* src/dst IPv6 address */ u_int ipi6_ifindex; /* send/recv interface index */ }; /* * Argument for IPV6_PORTRANGE: * - which range to search when port is unspecified at bind() or connect() */ #define IPV6_PORTRANGE_DEFAULT 0 /* default range */ #define IPV6_PORTRANGE_HIGH 1 /* "high" - request firewall bypass */ #define IPV6_PORTRANGE_LOW 2 /* "low" - vouchsafe security */ /* * Definitions for inet6 sysctl operations. * * Third level is protocol number. * Fourth level is desired variable within that protocol. */ #define IPV6PROTO_MAXID (IPPROTO_PIM + 1) /* don't list to IPV6PROTO_MAX */ #define CTL_IPV6PROTO_NAMES { \ { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, \ { 0, 0 }, \ { "tcp6", CTLTYPE_NODE }, \ { 0, 0 }, \ { 0, 0 }, \ { 0, 0 }, \ { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, \ { 0, 0 }, \ { 0, 0 }, \ { "udp6", CTLTYPE_NODE }, \ { 0, 0 }, \ { 0, 0 }, \ { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, \ { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, \ { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, \ { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, \ { 0, 0 }, \ { "ip6", CTLTYPE_NODE }, \ { 0, 0 }, \ { 0, 0 }, \ { 0, 0 }, \ { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, \ { "ipsec6", CTLTYPE_NODE }, \ { 0, 0 }, \ { 0, 0 }, \ { 0, 0 }, \ { 0, 0 }, \ { 0, 0 }, \ { 0, 0 }, \ { 0, 0 }, \ { "icmp6", CTLTYPE_NODE }, \ { 0, 0 }, \ { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, \ { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, \ { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, \ { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, \ { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, \ { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, \ { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, \ { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, \ { 0, 0 }, \ { 0, 0 }, \ { 0, 0 }, \ { "pim6", CTLTYPE_NODE }, \ } /* * Names for IP sysctl objects */ #define IPV6CTL_FORWARDING 1 /* act as router */ #define IPV6CTL_SENDREDIRECTS 2 /* may send redirects when forwarding*/ #define IPV6CTL_DEFHLIM 3 /* default Hop-Limit */ #ifdef notyet #define IPV6CTL_DEFMTU 4 /* default MTU */ #endif #define IPV6CTL_FORWSRCRT 5 /* forward source-routed dgrams */ #define IPV6CTL_STATS 6 /* stats */ #define IPV6CTL_MRTSTATS 7 /* multicast forwarding stats */ #define IPV6CTL_MRTPROTO 8 /* multicast routing protocol */ #define IPV6CTL_MAXFRAGPACKETS 9 /* max packets reassembly queue */ #define IPV6CTL_SOURCECHECK 10 /* verify source route and intf */ #define IPV6CTL_SOURCECHECK_LOGINT 11 /* minimume logging interval */ #define IPV6CTL_ACCEPT_RTADV 12 #define IPV6CTL_KEEPFAITH 13 #define IPV6CTL_LOG_INTERVAL 14 #define IPV6CTL_HDRNESTLIMIT 15 #define IPV6CTL_DAD_COUNT 16 #define IPV6CTL_AUTO_FLOWLABEL 17 #define IPV6CTL_DEFMCASTHLIM 18 #define IPV6CTL_GIF_HLIM 19 /* default HLIM for gif encap packet */ #define IPV6CTL_KAME_VERSION 20 /* New entries should be added here from current IPV6CTL_MAXID value. */ #define IPV6CTL_MAXID 21 #define IPV6CTL_NAMES { \ { 0, 0 }, \ { "forwarding", CTLTYPE_INT }, \ { "redirect", CTLTYPE_INT }, \ { "hlim", CTLTYPE_INT }, \ { "mtu", CTLTYPE_INT }, \ { "forwsrcrt", CTLTYPE_INT }, \ { 0, 0 }, \ { 0, 0 }, \ { "mrtproto", CTLTYPE_INT }, \ { "maxfragpackets", CTLTYPE_INT }, \ { "sourcecheck", CTLTYPE_INT }, \ { "sourcecheck_logint", CTLTYPE_INT }, \ { "accept_rtadv", CTLTYPE_INT }, \ { "keepfaith", CTLTYPE_INT }, \ { "log_interval", CTLTYPE_INT }, \ { "hdrnestlimit", CTLTYPE_INT }, \ { "dad_count", CTLTYPE_INT }, \ { "auto_flowlabel", CTLTYPE_INT }, \ { "defmcasthlim", CTLTYPE_INT }, \ { "gifhlim", CTLTYPE_INT }, \ { "kame_version", CTLTYPE_STRING }, \ } #define IPV6CTL_VARS { \ 0, \ &ip6_forwarding, \ &ip6_sendredirects, \ &ip6_defhlim, \ 0, \ &ip6_forward_srcrt, \ 0, \ 0, \ 0, \ &ip6_maxfragpackets, \ &ip6_sourcecheck, \ &ip6_sourcecheck_interval, \ &ip6_accept_rtadv, \ &ip6_keepfaith, \ &ip6_log_interval, \ &ip6_hdrnestlimit, \ &ip6_dad_count, \ &auto_flowlabel, \ &ip6_defmcasthlim, \ &ip6_gif_hlim, \ 0, \ } #ifdef _KERNEL struct cmsghdr; int in6_canforward __P((struct in6_addr *, struct in6_addr *)); int in6_cksum __P((struct mbuf *, u_int8_t, int, int)); int in6_localaddr __P((struct in6_addr *)); int in6_addrscope __P((struct in6_addr *)); struct in6_ifaddr *in6_ifawithscope __P((struct ifnet *, struct in6_addr *)); struct in6_ifaddr *in6_ifawithifp __P((struct ifnet *, struct in6_addr *)); extern void in6_if_up __P((struct ifnet *)); #define satosin6(sa) ((struct sockaddr_in6 *)(sa)) #define sin6tosa(sin6) ((struct sockaddr *)(sin6)) #define ifatoia6(ifa) ((struct in6_ifaddr *)(ifa)) #endif /* _KERNEL */ __BEGIN_DECLS struct cmsghdr; extern int inet6_option_space(int); extern int inet6_option_init(void *, struct cmsghdr **, int); extern int inet6_option_append(struct cmsghdr *, const u_int8_t *, int, int); extern u_int8_t *inet6_option_alloc(struct cmsghdr *, int, int, int); extern int inet6_option_next(const struct cmsghdr *, u_int8_t **); extern int inet6_option_find(const struct cmsghdr *, u_int8_t **, int); extern size_t inet6_rthdr_space __P((int, int)); extern struct cmsghdr *inet6_rthdr_init __P((void *, int)); extern int inet6_rthdr_add __P((struct cmsghdr *, const struct in6_addr *, unsigned int)); extern int inet6_rthdr_lasthop __P((struct cmsghdr *, unsigned int)); #if 0 /* not implemented yet */ extern int inet6_rthdr_reverse __P((const struct cmsghdr *, struct cmsghdr *)); #endif extern int inet6_rthdr_segments __P((const struct cmsghdr *)); extern struct in6_addr *inet6_rthdr_getaddr __P((struct cmsghdr *, int)); extern int inet6_rthdr_getflags __P((const struct cmsghdr *, int)); __END_DECLS #endif /* !_NETINET6_IN6_H_ */ @ 1.2.2.3 log @Update from trunk. @ text @a0 2 /* $NetBSD: in6.h,v 1.2.2.2 1999/08/02 22:36:03 thorpej Exp $ */ a67 1 #if !defined(_XOPEN_SOURCE) a68 1 #endif d74 1 a74 1 #define __KAME_VERSION "SNAP 19990705/NetBSD-current" d113 1 a113 1 struct in6_addr { d115 4 a118 4 u_int32_t __u6_addr32[4]; u_int16_t __u6_addr16[8]; u_int8_t __u6_addr8[16]; } __u6_addr; /* 128-bit IP6 address */ d121 4 a124 4 #define s6_addr32 __u6_addr.__u6_addr32 #define s6_addr16 __u6_addr.__u6_addr16 #define s6_addr8 __u6_addr.__u6_addr8 #define s6_addr __u6_addr.__u6_addr8 a130 1 #if !defined(_XOPEN_SOURCE) a131 1 #endif d304 1 a304 2 #if !defined(_XOPEN_SOURCE) struct route_in6 { a307 1 #endif a376 1 #if !defined(_XOPEN_SOURCE) d408 1 a409 1 { "ipsec6", CTLTYPE_NODE }, \ a506 1 #endif /* !_XOPEN_SOURCE */ @ 1.1 log @file in6.h was initially added on branch kame. @ text @d1 547 @ 1.1.2.1 log @KAME/NetBSD 1.4 SNAP kit, dated 19990628. NOTE: this branch (kame) is used just for refernce. this may not compile due to multiple reasons. @ text @a0 582 /* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. * All rights reserved. * * 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. * 3. Neither the name of the project nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE PROJECT 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 PROJECT 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. */ /* * Copyright (c) 1982, 1986, 1990, 1993 * The Regents of the University of California. All rights reserved. * * 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. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by the University of * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * 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. * * @@(#)in.h 8.3 (Berkeley) 1/3/94 */ #ifndef _NETINET6_IN6_H_ #define _NETINET6_IN6_H_ #include /* * Identification of the network protocol stack */ #define __KAME__ #define __KAME_VERSION "SNAP 19990628" /* * Local port number conventions: * * Ports < IPPORT_RESERVED are reserved for privileged processes (e.g. root), * unless a kernel is compiled with IPNOPRIVPORTS defined. * * When a user does a bind(2) or connect(2) with a port number of zero, * a non-conflicting local port address is chosen. * * The default range is IPPORT_ANONMIX to IPPORT_ANONMAX, although * that is settable by sysctl(3); net.inet.ip.anonportmin and * net.inet.ip.anonportmax respectively. * * A user may set the IPPROTO_IP option IP_PORTRANGE to change this * default assignment range. * * The value IP_PORTRANGE_DEFAULT causes the default behavior. * * The value IP_PORTRANGE_HIGH is the same as IP_PORTRANGE_DEFAULT, * and exists only for FreeBSD compatibility purposes. * * The value IP_PORTRANGE_LOW changes the range to the "low" are * that is (by convention) restricted to privileged processes. * This convention is based on "vouchsafe" principles only. * It is only secure if you trust the remote host to restrict these ports. * The range is IPPORT_RESERVEDMIN to IPPORT_RESERVEDMAX. */ #define IPV6PORT_RESERVED 1024 #define IPV6PORT_ANONMIN 49152 #define IPV6PORT_ANONMAX 65535 #define IPV6PORT_RESERVEDMIN 600 #define IPV6PORT_RESERVEDMAX (IPV6PORT_RESERVED-1) /* * IPv6 address */ struct in6_addr { union { u_int32_t u6_addr32[4]; u_int16_t u6_addr16[8]; u_int8_t u6_addr8[16]; } u6_addr; /* 128 bit IP6 address */ }; #define s6_addr32 u6_addr.u6_addr32 #define s6_addr16 u6_addr.u6_addr16 #define s6_addr8 u6_addr.u6_addr8 #define s6_addr u6_addr.u6_addr8 #define INET6_ADDRSTRLEN 46 /* * Socket address for IPv6 */ #define SIN6_LEN struct sockaddr_in6 { u_char sin6_len; /* length of this struct(sa_family_t)*/ u_char sin6_family; /* AF_INET6 (sa_family_t) */ u_int16_t sin6_port; /* Transport layer port # (in_port_t)*/ u_int32_t sin6_flowinfo; /* IP6 flow information */ struct in6_addr sin6_addr; /* IP6 address */ u_int32_t sin6_scope_id; /* intface scope id */ }; /* * Local definition for masks */ #define IN6MASK0 {{{ 0, 0, 0, 0 }}} #define IN6MASK32 {{{ 0xffffffff, 0, 0, 0 }}} #define IN6MASK64 {{{ 0xffffffff, 0xffffffff, 0, 0 }}} #define IN6MASK96 {{{ 0xffffffff, 0xffffffff, 0xffffffff, 0 }}} #define IN6MASK128 {{{ 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff }}} #ifdef _KERNEL extern const struct in6_addr in6mask0; extern const struct in6_addr in6mask32; extern const struct in6_addr in6mask64; extern const struct in6_addr in6mask96; extern const struct in6_addr in6mask128; #endif /* _KERNEL */ /* * Macros started with IPV6_ADDR is KAME local */ #if BYTE_ORDER == BIG_ENDIAN #define IPV6_ADDR_INT32_ONE 1 #define IPV6_ADDR_INT32_TWO 2 #define IPV6_ADDR_INT32_MNL 0xff010000 #define IPV6_ADDR_INT32_MLL 0xff020000 #define IPV6_ADDR_INT32_SMP 0x0000ffff #define IPV6_ADDR_INT16_ULL 0xfe80 #define IPV6_ADDR_INT16_USL 0xfec0 #define IPV6_ADDR_INT16_MLL 0xff02 #elif BYTE_ORDER == LITTLE_ENDIAN #define IPV6_ADDR_INT32_ONE 0x01000000 #define IPV6_ADDR_INT32_TWO 0x02000000 #define IPV6_ADDR_INT32_MNL 0x000001ff #define IPV6_ADDR_INT32_MLL 0x000002ff #define IPV6_ADDR_INT32_SMP 0xffff0000 #define IPV6_ADDR_INT16_ULL 0x80fe #define IPV6_ADDR_INT16_USL 0xc0fe #define IPV6_ADDR_INT16_MLL 0x02ff #endif /* * Definition of some useful macros to handle IP6 addresses */ #define IN6ADDR_ANY_INIT {{{ 0, 0, 0, 0 }}} #define IN6ADDR_LOOPBACK_INIT {{{ 0, 0, 0, IPV6_ADDR_INT32_ONE }}} #define IN6ADDR_NODELOCAL_ALLNODES_INIT \ {{{ IPV6_ADDR_INT32_MNL, 0, 0, IPV6_ADDR_INT32_ONE }}} #define IN6ADDR_LINKLOCAL_ALLNODES_INIT \ {{{ IPV6_ADDR_INT32_MLL, 0, 0, IPV6_ADDR_INT32_ONE }}} #define IN6ADDR_LINKLOCAL_ALLROUTERS_INIT \ {{{ IPV6_ADDR_INT32_MLL, 0, 0, IPV6_ADDR_INT32_TWO }}} extern const struct in6_addr in6addr_any; extern const struct in6_addr in6addr_loopback; extern const struct in6_addr in6addr_nodelocal_allnodes; extern const struct in6_addr in6addr_linklocal_allnodes; extern const struct in6_addr in6addr_linklocal_allrouters; /* * Equality */ #define IN6_ARE_ADDR_EQUAL(a, b) \ (((a)->s6_addr32[0] == (b)->s6_addr32[0]) && \ ((a)->s6_addr32[1] == (b)->s6_addr32[1]) && \ ((a)->s6_addr32[2] == (b)->s6_addr32[2]) && \ ((a)->s6_addr32[3] == (b)->s6_addr32[3])) /* * Unspecified */ #define IN6_IS_ADDR_UNSPECIFIED(a) \ (((a)->s6_addr32[0] == 0) && \ ((a)->s6_addr32[1] == 0) && \ ((a)->s6_addr32[2] == 0) && \ ((a)->s6_addr32[3] == 0)) /* * Loopback */ #define IN6_IS_ADDR_LOOPBACK(a) \ (((a)->s6_addr32[0] == 0) && \ ((a)->s6_addr32[1] == 0) && \ ((a)->s6_addr32[2] == 0) && \ ((a)->s6_addr32[3] == IPV6_ADDR_INT32_ONE)) /* * IPv4 compatible */ #define IN6_IS_ADDR_V4COMPAT(a) \ (((a)->s6_addr32[0] == 0) && \ ((a)->s6_addr32[1] == 0) && \ ((a)->s6_addr32[2] == 0) && \ ((a)->s6_addr32[3] != 0) && \ ((a)->s6_addr32[3] != IPV6_ADDR_INT32_ONE)) /* * Mapped */ #define IN6_IS_ADDR_V4MAPPED(a) \ (((a)->s6_addr32[0] == 0) && \ ((a)->s6_addr32[1] == 0) && \ ((a)->s6_addr32[2] == IPV6_ADDR_INT32_SMP)) /* * KAME Scope Values */ #define IPV6_ADDR_SCOPE_NODELOCAL 0x01 #define IPV6_ADDR_SCOPE_LINKLOCAL 0x02 #define IPV6_ADDR_SCOPE_SITELOCAL 0x05 #define IPV6_ADDR_SCOPE_ORGLOCAL 0x08 /* just used in this file */ #define IPV6_ADDR_SCOPE_GLOBAL 0x0e /* * Unicast Scope */ #define IN6_IS_ADDR_LINKLOCAL(a) \ ((a)->s6_addr16[0] == IPV6_ADDR_INT16_ULL) #define IN6_IS_ADDR_SITELOCAL(a) \ ((a)->s6_addr16[0] == IPV6_ADDR_INT16_USL) /* * Multicast */ #define IN6_IS_ADDR_MULTICAST(a) ((a)->s6_addr8[0] == 0xff) #define IPV6_ADDR_MC_SCOPE(a) ((a)->s6_addr8[1] & 0x0f) /* * Multicast Scope */ #define IN6_IS_ADDR_MC_NODELOCAL(a) \ (IN6_IS_ADDR_MULTICAST(a) && \ (IPV6_ADDR_MC_SCOPE(a) == IPV6_ADDR_SCOPE_NODELOCAL)) #define IN6_IS_ADDR_MC_LINKLOCAL(a) \ (IN6_IS_ADDR_MULTICAST(a) && \ (IPV6_ADDR_MC_SCOPE(a) == IPV6_ADDR_SCOPE_LINKLOCAL)) #define IN6_IS_ADDR_MC_SITELOCAL(a) \ (IN6_IS_ADDR_MULTICAST(a) && \ (IPV6_ADDR_MC_SCOPE(a) == IPV6_ADDR_SCOPE_SITELOCAL)) #define IN6_IS_ADDR_MC_ORGLOCAL(a) \ (IN6_IS_ADDR_MULTICAST(a) && \ (IPV6_ADDR_MC_SCOPE(a) == IPV6_ADDR_SCOPE_ORGLOCAL)) #define IN6_IS_ADDR_MC_GLOBAL(a) \ (IN6_IS_ADDR_MULTICAST(a) && \ (IPV6_ADDR_MC_SCOPE(a) == IPV6_ADDR_SCOPE_GLOBAL)) /* * Wildcard Socket */ #define IN6_IS_ADDR_ANY(a) IN6_IS_ADDR_UNSPECIFIED(a) /* * KAME Scope */ #define IN6_IS_SCOPE_LINKLOCAL(a) \ ((IN6_IS_ADDR_LINKLOCAL(a)) || \ (IN6_IS_ADDR_MC_LINKLOCAL(a))) /* * IP6 route structure */ struct route_in6 { struct rtentry *ro_rt; struct sockaddr_in6 ro_dst; }; /* * Options for use with [gs]etsockopt at the IPV6 level. * First word of comment is data type; bool is stored in int. */ #define IPV6_OPTIONS 1 /* buf/ip6_opts; set/get IP6 options */ /* no hdrincl */ #define IPV6_SOCKOPT_RESERVED1 3 /* reserved for future use */ #define IPV6_UNICAST_HOPS 4 /* int; IP6 hops */ #define IPV6_RECVOPTS 5 /* bool; receive all IP6 opts w/dgram */ #define IPV6_RECVRETOPTS 6 /* bool; receive IP6 opts for response */ #define IPV6_RECVDSTADDR 7 /* bool; receive IP6 dst addr w/dgram */ #define IPV6_RETOPTS 8 /* ip6_opts; set/get IP6 options */ #define IPV6_MULTICAST_IF 9 /* u_char; set/get IP6 multicast i/f */ #define IPV6_MULTICAST_HOPS 10 /* u_char; set/get IP6 multicast hops */ #define IPV6_MULTICAST_LOOP 11 /* u_char; set/get IP6 multicast loopback */ #define IPV6_JOIN_GROUP 12 /* ip6_mreq; join a group membership */ #define IPV6_LEAVE_GROUP 13 /* ip6_mreq; leave a group membership */ #define IPV6_PORTRANGE 14 /* int; range to choose for unspec port */ #define ICMP6_FILTER 18 /* icmp6_filter; icmp6 filter */ #define IPV6_PKTINFO 19 /* bool; send/rcv if, src/dst addr */ #define IPV6_HOPLIMIT 20 /* bool; hop limit */ #define IPV6_NEXTHOP 21 /* bool; next hop addr */ #define IPV6_HOPOPTS 22 /* bool; hop-by-hop option */ #define IPV6_DSTOPTS 23 /* bool; destination option */ #define IPV6_RTHDR 24 /* bool; routing header */ #define IPV6_PKTOPTIONS 25 /* buf/cmsghdr; set/get IPv6 options */ #define IPV6_CHECKSUM 26 /* int; checksum offset for raw socket */ #define IPV6_BINDV6ONLY 27 /* bool; only bind INET6 at null bind */ #if 1 /*IPSEC*/ #define IPV6_IPSEC_POLICY 28 /* struct; get/set security policy */ #endif #define IPV6_FAITH 32 /* bool; accept FAITH'ed connections */ #define IPV6_RTHDR_LOOSE 0 /* this hop need not be a neighbor. XXX old spec */ #define IPV6_RTHDR_STRICT 1 /* this hop must be a neighbor. XXX old spec */ #define IPV6_RTHDR_TYPE_0 0 /* IPv6 routing header type 0 */ /* * Defaults and limits for options */ #define IPV6_DEFAULT_MULTICAST_HOPS 1 /* normally limit m'casts to 1 hop */ #define IPV6_DEFAULT_MULTICAST_LOOP 1 /* normally hear sends if a member */ /* * Argument structure for IPV6_JOIN_GROUP and IPV6_LEAVE_GROUP. */ struct ipv6_mreq { struct in6_addr ipv6mr_multiaddr; u_int ipv6mr_interface; }; /* * IPV6_PKTINFO: Packet information(RFC2292 sec 5) */ struct in6_pktinfo { struct in6_addr ipi6_addr; /* src/dst IPv6 address */ u_int ipi6_ifindex; /* send/recv interface index */ }; /* * Argument for IPV6_PORTRANGE: * - which range to search when port is unspecified at bind() or connect() */ #define IPV6_PORTRANGE_DEFAULT 0 /* default range */ #define IPV6_PORTRANGE_HIGH 1 /* "high" - request firewall bypass */ #define IPV6_PORTRANGE_LOW 2 /* "low" - vouchsafe security */ /* * Definitions for inet6 sysctl operations. * * Third level is protocol number. * Fourth level is desired variable within that protocol. */ #define IPV6PROTO_MAXID (IPPROTO_PIM + 1) /* don't list to IPV6PROTO_MAX */ #define CTL_IPV6PROTO_NAMES { \ { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, \ { 0, 0 }, \ { "tcp6", CTLTYPE_NODE }, \ { 0, 0 }, \ { 0, 0 }, \ { 0, 0 }, \ { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, \ { 0, 0 }, \ { 0, 0 }, \ { "udp6", CTLTYPE_NODE }, \ { 0, 0 }, \ { 0, 0 }, \ { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, \ { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, \ { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, \ { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, \ { 0, 0 }, \ { "ip6", CTLTYPE_NODE }, \ { 0, 0 }, \ { 0, 0 }, \ { 0, 0 }, \ { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, \ { "ipsec6", CTLTYPE_NODE }, \ { 0, 0 }, \ { 0, 0 }, \ { 0, 0 }, \ { 0, 0 }, \ { 0, 0 }, \ { 0, 0 }, \ { 0, 0 }, \ { "icmp6", CTLTYPE_NODE }, \ { 0, 0 }, \ { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, \ { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, \ { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, \ { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, \ { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, \ { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, \ { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, \ { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, \ { 0, 0 }, \ { 0, 0 }, \ { 0, 0 }, \ { "pim6", CTLTYPE_NODE }, \ } /* * Names for IP sysctl objects */ #define IPV6CTL_FORWARDING 1 /* act as router */ #define IPV6CTL_SENDREDIRECTS 2 /* may send redirects when forwarding*/ #define IPV6CTL_DEFHLIM 3 /* default Hop-Limit */ #ifdef notyet #define IPV6CTL_DEFMTU 4 /* default MTU */ #endif #define IPV6CTL_FORWSRCRT 5 /* forward source-routed dgrams */ #define IPV6CTL_STATS 6 /* stats */ #define IPV6CTL_MRTSTATS 7 /* multicast forwarding stats */ #define IPV6CTL_MRTPROTO 8 /* multicast routing protocol */ #define IPV6CTL_MAXFRAGPACKETS 9 /* max packets reassembly queue */ #define IPV6CTL_SOURCECHECK 10 /* verify source route and intf */ #define IPV6CTL_SOURCECHECK_LOGINT 11 /* minimume logging interval */ #define IPV6CTL_ACCEPT_RTADV 12 #define IPV6CTL_KEEPFAITH 13 #define IPV6CTL_LOG_INTERVAL 14 #define IPV6CTL_HDRNESTLIMIT 15 #define IPV6CTL_DAD_COUNT 16 #ifdef MAPPED_ADDR_ENABLED #define IPV6CTL_MAPPED_ADDR 18 #endif /* MAPPED_ADDR_ENABLED */ #define IPV6CTL_AUTO_FLOWLABEL 19 #define IPV6CTL_DEFMCASTHLIM 20 #define IPV6CTL_GIF_HLIM 21 /* default HLIM for gif encap packet */ #define IPV6CTL_KAME_VERSION 22 /* New entries should be added here from current IPV6CTL_MAXID value. */ #define IPV6CTL_MAXID 23 #ifdef MAPPED_ADDR_ENABLED #define IPV6CTL_NAMES_MAPPED_ADDR "mapped_addr" #define IPV6CTL_TYPE_MAPPED_ADDR CTLTYPE_INT #define IPV6CTL_VARS_MAPPED_ADDR &ip6_mapped_addr_on #else /* MAPPED_ADDR_ENABLED */ #define IPV6CTL_NAMES_MAPPED_ADDR 0 #define IPV6CTL_TYPE_MAPPED_ADDR 0 #define IPV6CTL_VARS_MAPPED_ADDR 0 #endif /* MAPPED_ADDR_ENABLED */ #define IPV6CTL_NAMES { \ { 0, 0 }, \ { "forwarding", CTLTYPE_INT }, \ { "redirect", CTLTYPE_INT }, \ { "hlim", CTLTYPE_INT }, \ { "mtu", CTLTYPE_INT }, \ { "forwsrcrt", CTLTYPE_INT }, \ { 0, 0 }, \ { 0, 0 }, \ { "mrtproto", CTLTYPE_INT }, \ { "maxfragpackets", CTLTYPE_INT }, \ { "sourcecheck", CTLTYPE_INT }, \ { "sourcecheck_logint", CTLTYPE_INT }, \ { "accept_rtadv", CTLTYPE_INT }, \ { "keepfaith", CTLTYPE_INT }, \ { "log_interval", CTLTYPE_INT }, \ { "hdrnestlimit", CTLTYPE_INT }, \ { "dad_count", CTLTYPE_INT }, \ { 0, 0 }, \ { IPV6CTL_NAMES_MAPPED_ADDR, IPV6CTL_TYPE_MAPPED_ADDR }, \ { "auto_flowlabel", CTLTYPE_INT }, \ { "defmcasthlim", CTLTYPE_INT }, \ { "gifhlim", CTLTYPE_INT }, \ { "kame_version", CTLTYPE_STRING }, \ } #define IPV6CTL_VARS { \ 0, \ &ip6_forwarding, \ &ip6_sendredirects, \ &ip6_defhlim, \ 0, \ &ip6_forward_srcrt, \ 0, \ 0, \ 0, \ &ip6_maxfragpackets, \ &ip6_sourcecheck, \ &ip6_sourcecheck_interval, \ &ip6_accept_rtadv, \ &ip6_keepfaith, \ &ip6_log_interval, \ &ip6_hdrnestlimit, \ &ip6_dad_count, \ &0, \ IPV6CTL_VARS_MAPPED_ADDR, \ &auto_flowlabel, \ &ip6_defmcasthlim, \ &ip6_gif_hlim, \ 0, \ } #ifdef _KERNEL struct cmsghdr; int in6_canforward __P((struct in6_addr *, struct in6_addr *)); int in6_cksum __P((struct mbuf *, u_int8_t, int, int)); int in6_localaddr __P((struct in6_addr *)); int in6_addrscope __P((struct in6_addr *)); struct in6_ifaddr *in6_ifawithscope __P((struct ifnet *, struct in6_addr *)); struct in6_ifaddr *in6_ifawithifp __P((struct ifnet *, struct in6_addr *)); #ifdef MAPPED_ADDR_ENABLED void in6_sin6_2_sin __P((struct sockaddr_in *sin, struct sockaddr_in6 *sin6)); void in6_sin6_2_sin_in_m __P((struct mbuf *addr6)); void in6_sin_2_v4mapsin6 __P((struct sockaddr_in *sin, struct sockaddr_in6 *sin6)); void in6_sin_2_v4mapsin6_in_m __P((struct mbuf *addr6)); void in6_sin6_2_sin_in_sock __P((struct sockaddr *nam)); void in6_sin_2_v4mapsin6_in_sock __P((struct sockaddr **nam)); #endif /* MAPPED_ADDR_ENABLED */ #ifdef RADISH struct radish; struct radish_head; int in6_rd_match __P((struct sockaddr *, struct radish_head *, struct radish **)); #endif /* RADISH */ extern void in6_if_up __P((struct ifnet *)); #define satosin6(sa) ((struct sockaddr_in6 *)(sa)) #define sin6tosa(sin6) ((struct sockaddr *)(sin6)) #define ifatoia6(ifa) ((struct in6_ifaddr *)(ifa)) #endif /* _KERNEL */ __BEGIN_DECLS struct cmsghdr; extern int inet6_option_space(int); extern int inet6_option_init(void *, struct cmsghdr **, int); extern int inet6_option_append(struct cmsghdr *, const u_int8_t *, int, int); #if 0 /* not implemented yet */ extern u_int8_t *inet6_option_alloc(struct cmsghdr *, int, int, int); extern int inet6_option_next(const struct cmsghdr *, u_int8_t **); extern int inet6_option_find(const struct cmsghdr *, u_int8_t *, int); #endif extern size_t inet6_rthdr_space __P((int, int)); extern struct cmsghdr *inet6_rthdr_init __P((void *, int)); extern int inet6_rthdr_add __P((struct cmsghdr *, const struct in6_addr *, unsigned int)); extern int inet6_rthdr_lasthop __P((struct cmsghdr *, unsigned int)); #if 0 /* not implemented yet */ extern int inet6_rthdr_reverse __P((const struct cmsghdr *, struct cmsghdr *)); #endif extern int inet6_rthdr_segments __P((const struct cmsghdr *)); extern struct in6_addr *inet6_rthdr_getaddr __P((struct cmsghdr *, int)); extern int inet6_rthdr_getflags __P((const struct cmsghdr *, int)); __END_DECLS #endif /* !_NETINET6_IN6_H_ */ @ 1.1.2.2 log @KAME/NetBSD 1.4, SNAP kit 1999/07/05. NOTE: this branch is just for reference purposes (i.e. for taking cvs diff). do not touch anything on the branch. actual work must be done on HEAD branch. @ text @d408 1 a409 1 { "ipsec6", CTLTYPE_NODE }, \ d453 7 a459 4 #define IPV6CTL_AUTO_FLOWLABEL 17 #define IPV6CTL_DEFMCASTHLIM 18 #define IPV6CTL_GIF_HLIM 19 /* default HLIM for gif encap packet */ #define IPV6CTL_KAME_VERSION 20 d461 11 a471 1 #define IPV6CTL_MAXID 21 d491 2 d517 2 d534 16 d563 1 d566 2 a567 1 extern int inet6_option_find(const struct cmsghdr *, u_int8_t **, int); @ 1.1.2.3 log @bring in latest KAME (as of 19991130, KAME/NetBSD141) into kame branch just for reference purposes. This commit includes 1.4 -> 1.4.1 sync for kame branch. The branch does not compile at all (due to the lack of ALTQ and some other source code). Please do not try to modify the branch, this is just for referenre purposes. synchronization to latest KAME will take place on HEAD branch soon. @ text @a67 1 #if !defined(_XOPEN_SOURCE) a68 1 #endif d74 1 a74 1 #define __KAME_VERSION "19991130" d113 1 a113 1 struct in6_addr { d115 4 a118 4 u_int8_t __u6_addr8[16]; u_int16_t __u6_addr16[8]; u_int32_t __u6_addr32[4]; } __u6_addr; /* 128-bit IP6 address */ d121 4 a124 6 #define s6_addr __u6_addr.__u6_addr8 #ifdef _KERNEL /*XXX nonstandard*/ #define s6_addr8 __u6_addr.__u6_addr8 #define s6_addr16 __u6_addr.__u6_addr16 #define s6_addr32 __u6_addr.__u6_addr32 #endif a130 1 #if !defined(_XOPEN_SOURCE) a131 1 #endif d144 5 a148 11 #ifdef _KERNEL /*XXX nonstandard*/ #define IN6MASK0 {{{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }}} #define IN6MASK32 {{{ 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }}} #define IN6MASK64 {{{ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }}} #define IN6MASK96 {{{ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \ 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00 }}} #define IN6MASK128 {{{ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }}} #endif d161 1 a161 1 #ifdef _KERNEL /*XXX nonstandard*/ a180 1 #endif d185 6 a190 12 #define IN6ADDR_ANY_INIT \ {{{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }}} #define IN6ADDR_LOOPBACK_INIT \ {{{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 }}} #define IN6ADDR_NODELOCAL_ALLNODES_INIT \ {{{ 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 }}} #define IN6ADDR_LINKLOCAL_ALLNODES_INIT \ {{{ 0xff, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 }}} d192 1 a192 2 {{{ 0xff, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02 }}} a201 3 * NOTE: Some of kernel programming environment (for example, openbsd/sparc) * does not supply memcmp(). For userland memcmp() is preferred as it is * in ANSI standard. a202 4 #ifdef _KERNEL #define IN6_ARE_ADDR_EQUAL(a, b) \ (bcmp((a), (b), sizeof(struct in6_addr)) == 0) #else d204 4 a207 2 (memcmp((a), (b), sizeof(struct in6_addr)) == 0) #endif d213 4 a216 4 ((*(u_int32_t *)(&(a)->s6_addr[0]) == 0) && \ (*(u_int32_t *)(&(a)->s6_addr[4]) == 0) && \ (*(u_int32_t *)(&(a)->s6_addr[8]) == 0) && \ (*(u_int32_t *)(&(a)->s6_addr[12]) == 0)) d222 4 a225 4 ((*(u_int32_t *)(&(a)->s6_addr[0]) == 0) && \ (*(u_int32_t *)(&(a)->s6_addr[4]) == 0) && \ (*(u_int32_t *)(&(a)->s6_addr[8]) == 0) && \ (*(u_int32_t *)(&(a)->s6_addr[12]) == ntohl(1))) d231 5 a235 5 ((*(u_int32_t *)(&(a)->s6_addr[0]) == 0) && \ (*(u_int32_t *)(&(a)->s6_addr[4]) == 0) && \ (*(u_int32_t *)(&(a)->s6_addr[8]) == 0) && \ (*(u_int32_t *)(&(a)->s6_addr[12]) != 0) && \ (*(u_int32_t *)(&(a)->s6_addr[12]) != ntohl(1))) d241 3 a243 3 ((*(u_int32_t *)(&(a)->s6_addr[0]) == 0) && \ (*(u_int32_t *)(&(a)->s6_addr[4]) == 0) && \ (*(u_int32_t *)(&(a)->s6_addr[8]) == ntohl(0x0000ffff))) a248 1 #ifdef _KERNEL /*XXX nonstandard*/ a253 7 #else #define __IPV6_ADDR_SCOPE_NODELOCAL 0x01 #define __IPV6_ADDR_SCOPE_LINKLOCAL 0x02 #define __IPV6_ADDR_SCOPE_SITELOCAL 0x05 #define __IPV6_ADDR_SCOPE_ORGLOCAL 0x08 /* just used in this file */ #define __IPV6_ADDR_SCOPE_GLOBAL 0x0e #endif a256 1 * Note that we must check topmost 10 bits only, not 16 bits (see RFC2373). d259 1 a259 1 (((a)->s6_addr[0] == 0xfe) && (((a)->s6_addr[1] & 0xc0) == 0x80)) d261 1 a261 1 (((a)->s6_addr[0] == 0xfe) && (((a)->s6_addr[1] & 0xc0) == 0xc0)) d266 1 a266 1 #define IN6_IS_ADDR_MULTICAST(a) ((a)->s6_addr[0] == 0xff) d268 1 a268 5 #ifdef _KERNEL /*XXX nonstandard*/ #define IPV6_ADDR_MC_SCOPE(a) ((a)->s6_addr[1] & 0x0f) #else #define __IPV6_ADDR_MC_SCOPE(a) ((a)->s6_addr[1] & 0x0f) #endif a272 1 #ifdef _KERNEL /*refers nonstandard items */ a287 17 #else #define IN6_IS_ADDR_MC_NODELOCAL(a) \ (IN6_IS_ADDR_MULTICAST(a) && \ (__IPV6_ADDR_MC_SCOPE(a) == __IPV6_ADDR_SCOPE_NODELOCAL)) #define IN6_IS_ADDR_MC_LINKLOCAL(a) \ (IN6_IS_ADDR_MULTICAST(a) && \ (__IPV6_ADDR_MC_SCOPE(a) == __IPV6_ADDR_SCOPE_LINKLOCAL)) #define IN6_IS_ADDR_MC_SITELOCAL(a) \ (IN6_IS_ADDR_MULTICAST(a) && \ (__IPV6_ADDR_MC_SCOPE(a) == __IPV6_ADDR_SCOPE_SITELOCAL)) #define IN6_IS_ADDR_MC_ORGLOCAL(a) \ (IN6_IS_ADDR_MULTICAST(a) && \ (__IPV6_ADDR_MC_SCOPE(a) == __IPV6_ADDR_SCOPE_ORGLOCAL)) #define IN6_IS_ADDR_MC_GLOBAL(a) \ (IN6_IS_ADDR_MULTICAST(a) && \ (__IPV6_ADDR_MC_SCOPE(a) == __IPV6_ADDR_SCOPE_GLOBAL)) #endif a291 1 #if 0 /*pre-RFC2553*/ a292 1 #endif a296 1 #ifdef _KERNEL /*nonstandard*/ a299 1 #endif d304 1 a304 2 #if !defined(_XOPEN_SOURCE) struct route_in6 { a307 1 #endif d341 1 a341 9 #define IPV6_FAITH 29 /* bool; accept FAITH'ed connections */ #if 1 /*IPV6FIREWALL*/ #define IPV6_FW_ADD 30 /* add a firewall rule to chain */ #define IPV6_FW_DEL 31 /* delete a firewall rule from chain */ #define IPV6_FW_FLUSH 32 /* flush firewall rule chain */ #define IPV6_FW_ZERO 33 /* clear single/all firewall counter(s) */ #define IPV6_FW_GET 34 /* get entire firewall rule chain */ #endif a376 1 #if !defined(_XOPEN_SOURCE) a456 5 #define IPV6CTL_USE_DEPRECATED 21 /* use deprecated addr (RFC2462 5.5.4) */ #define IPV6CTL_RR_PRUNE 22 /* walk timer for router renumbering */ #ifdef MAPPED_ADDR_ENABLED #define IPV6CTL_MAPPED_ADDR 23 #endif /* MAPPED_ADDR_ENABLED */ d458 1 a458 11 #define IPV6CTL_MAXID 24 #ifdef MAPPED_ADDR_ENABLED #define IPV6CTL_NAMES_MAPPED_ADDR "mapped_addr" #define IPV6CTL_TYPE_MAPPED_ADDR CTLTYPE_INT #define IPV6CTL_VARS_MAPPED_ADDR &ip6_mapped_addr_on #else /* MAPPED_ADDR_ENABLED */ #define IPV6CTL_NAMES_MAPPED_ADDR 0 #define IPV6CTL_TYPE_MAPPED_ADDR 0 #define IPV6CTL_VARS_MAPPED_ADDR 0 #endif /* MAPPED_ADDR_ENABLED */ a481 3 { "use_deprecated", CTLTYPE_INT }, \ { "rr_prune", CTLTYPE_INT }, \ { IPV6CTL_NAMES_MAPPED_ADDR, IPV6CTL_TYPE_MAPPED_ADDR }, \ d502 1 a502 1 &ip6_auto_flowlabel, \ a505 3 &ip6_use_deprecated, \ &ip6_rr_prune, \ IPV6CTL_VARS_MAPPED_ADDR, \ a506 1 #endif /* !_XOPEN_SOURCE */ d512 1 a512 1 int in6_cksum __P((struct mbuf *, u_int8_t, u_int32_t, u_int32_t)); a517 10 #ifdef MAPPED_ADDR_ENABLED struct sockaddr; void in6_sin6_2_sin __P((struct sockaddr_in *sin, struct sockaddr_in6 *sin6)); void in6_sin_2_v4mapsin6 __P((struct sockaddr_in *sin, struct sockaddr_in6 *sin6)); void in6_sin6_2_sin_in_sock __P((struct sockaddr *nam)); void in6_sin_2_v4mapsin6_in_sock __P((struct sockaddr **nam)); #endif /* MAPPED_ADDR_ENABLED */ @