head 1.41; access; symbols netbsd-10-0-RELEASE:1.41 netbsd-10-0-RC6:1.41 netbsd-10-0-RC5:1.41 netbsd-10-0-RC4:1.41 netbsd-10-0-RC3:1.41 netbsd-10-0-RC2:1.41 thorpej-ifq:1.41.0.34 thorpej-ifq-base:1.41 thorpej-altq-separation:1.41.0.32 thorpej-altq-separation-base:1.41 netbsd-10-0-RC1:1.41 netbsd-10:1.41.0.30 netbsd-10-base:1.41 bouyer-sunxi-drm:1.41.0.28 bouyer-sunxi-drm-base:1.41 netbsd-9-3-RELEASE:1.41 thorpej-i2c-spi-conf2:1.41.0.26 thorpej-i2c-spi-conf2-base:1.41 thorpej-futex2:1.41.0.24 thorpej-futex2-base:1.41 thorpej-cfargs2:1.41.0.22 thorpej-cfargs2-base:1.41 cjep_sun2x-base1:1.41 cjep_sun2x:1.41.0.20 cjep_sun2x-base:1.41 cjep_staticlib_x-base1:1.41 netbsd-9-2-RELEASE:1.41 cjep_staticlib_x:1.41.0.18 cjep_staticlib_x-base:1.41 thorpej-i2c-spi-conf:1.41.0.16 thorpej-i2c-spi-conf-base:1.41 thorpej-cfargs:1.41.0.14 thorpej-cfargs-base:1.41 thorpej-futex:1.41.0.12 thorpej-futex-base:1.41 netbsd-9-1-RELEASE:1.41 bouyer-xenpvh-base2:1.41 phil-wifi-20200421:1.41 bouyer-xenpvh-base1:1.41 phil-wifi-20200411:1.41 bouyer-xenpvh:1.41.0.10 bouyer-xenpvh-base:1.41 is-mlppp:1.41.0.8 is-mlppp-base:1.41 phil-wifi-20200406:1.41 netbsd-8-2-RELEASE:1.40 ad-namecache-base3:1.41 netbsd-9-0-RELEASE:1.41 netbsd-9-0-RC2:1.41 ad-namecache-base2:1.41 ad-namecache-base1:1.41 ad-namecache:1.41.0.6 ad-namecache-base:1.41 netbsd-9-0-RC1:1.41 phil-wifi-20191119:1.41 netbsd-9:1.41.0.4 netbsd-9-base:1.41 phil-wifi-20190609:1.41 netbsd-8-1-RELEASE:1.40 netbsd-8-1-RC1:1.40 isaki-audio2:1.41.0.2 isaki-audio2-base:1.41 pgoyette-compat-merge-20190127:1.40 pgoyette-compat-20190127:1.40 pgoyette-compat-20190118:1.40 pgoyette-compat-1226:1.40 pgoyette-compat-1126:1.40 pgoyette-compat-1020:1.40 pgoyette-compat-0930:1.40 pgoyette-compat-0906:1.40 netbsd-7-2-RELEASE:1.38 pgoyette-compat-0728:1.40 netbsd-8-0-RELEASE:1.40 phil-wifi:1.40.0.16 phil-wifi-base:1.40 pgoyette-compat-0625:1.40 netbsd-8-0-RC2:1.40 pgoyette-compat-0521:1.40 pgoyette-compat-0502:1.40 pgoyette-compat-0422:1.40 netbsd-8-0-RC1:1.40 pgoyette-compat-0415:1.40 pgoyette-compat-0407:1.40 pgoyette-compat-0330:1.40 pgoyette-compat-0322:1.40 pgoyette-compat-0315:1.40 netbsd-7-1-2-RELEASE:1.38 pgoyette-compat:1.40.0.14 pgoyette-compat-base:1.40 netbsd-7-1-1-RELEASE:1.38 tls-maxphys-base-20171202:1.40 matt-nb8-mediatek:1.40.0.12 matt-nb8-mediatek-base:1.40 nick-nhusb-base-20170825:1.40 perseant-stdc-iso10646:1.40.0.10 perseant-stdc-iso10646-base:1.40 netbsd-8:1.40.0.8 netbsd-8-base:1.40 prg-localcount2-base3:1.40 prg-localcount2-base2:1.40 prg-localcount2-base1:1.40 prg-localcount2:1.40.0.6 prg-localcount2-base:1.40 pgoyette-localcount-20170426:1.40 bouyer-socketcan-base1:1.40 jdolecek-ncq:1.40.0.4 jdolecek-ncq-base:1.40 pgoyette-localcount-20170320:1.40 netbsd-7-1:1.38.0.46 netbsd-7-1-RELEASE:1.38 netbsd-7-1-RC2:1.38 nick-nhusb-base-20170204:1.40 netbsd-7-nhusb-base-20170116:1.38 bouyer-socketcan:1.40.0.2 bouyer-socketcan-base:1.40 pgoyette-localcount-20170107:1.40 netbsd-7-1-RC1:1.38 nick-nhusb-base-20161204:1.40 pgoyette-localcount-20161104:1.40 netbsd-7-0-2-RELEASE:1.38 nick-nhusb-base-20161004:1.40 localcount-20160914:1.40 netbsd-7-nhusb:1.38.0.44 netbsd-7-nhusb-base:1.38 pgoyette-localcount-20160806:1.40 pgoyette-localcount-20160726:1.39 pgoyette-localcount:1.39.0.2 pgoyette-localcount-base:1.39 nick-nhusb-base-20160907:1.39 nick-nhusb-base-20160529:1.39 netbsd-7-0-1-RELEASE:1.38 nick-nhusb-base-20160422:1.39 nick-nhusb-base-20160319:1.39 nick-nhusb-base-20151226:1.39 netbsd-7-0:1.38.0.42 netbsd-7-0-RELEASE:1.38 nick-nhusb-base-20150921:1.39 netbsd-7-0-RC3:1.38 netbsd-7-0-RC2:1.38 netbsd-7-0-RC1:1.38 nick-nhusb-base-20150606:1.38 nick-nhusb-base-20150406:1.38 nick-nhusb:1.38.0.40 nick-nhusb-base:1.38 netbsd-5-2-3-RELEASE:1.34 netbsd-5-1-5-RELEASE:1.34 netbsd-6-0-6-RELEASE:1.38 netbsd-6-1-5-RELEASE:1.38 netbsd-7:1.38.0.38 netbsd-7-base:1.38 yamt-pagecache-base9:1.38 yamt-pagecache-tag8:1.38 netbsd-6-1-4-RELEASE:1.38 netbsd-6-0-5-RELEASE:1.38 tls-earlyentropy:1.38.0.36 tls-earlyentropy-base:1.38 riastradh-xf86-video-intel-2-7-1-pre-2-21-15:1.38 riastradh-drm2-base3:1.38 netbsd-6-1-3-RELEASE:1.38 netbsd-6-0-4-RELEASE:1.38 netbsd-5-2-2-RELEASE:1.34 netbsd-5-1-4-RELEASE:1.34 netbsd-6-1-2-RELEASE:1.38 netbsd-6-0-3-RELEASE:1.38 netbsd-5-2-1-RELEASE:1.34 netbsd-5-1-3-RELEASE:1.34 rmind-smpnet-nbase:1.38 netbsd-6-1-1-RELEASE:1.38 riastradh-drm2-base2:1.38 riastradh-drm2-base1:1.38 riastradh-drm2:1.38.0.34 riastradh-drm2-base:1.38 rmind-smpnet:1.38.0.26 rmind-smpnet-base:1.38 netbsd-6-1:1.38.0.32 netbsd-6-0-2-RELEASE:1.38 netbsd-6-1-RELEASE:1.38 khorben-n900:1.38.0.30 netbsd-6-1-RC4:1.38 netbsd-6-1-RC3:1.38 agc-symver:1.38.0.28 agc-symver-base:1.38 netbsd-6-1-RC2:1.38 netbsd-6-1-RC1:1.38 yamt-pagecache-base8:1.38 netbsd-5-2:1.34.0.20 netbsd-6-0-1-RELEASE:1.38 yamt-pagecache-base7:1.38 netbsd-5-2-RELEASE:1.34 netbsd-5-2-RC1:1.34 matt-nb6-plus-nbase:1.38 yamt-pagecache-base6:1.38 netbsd-6-0:1.38.0.24 netbsd-6-0-RELEASE:1.38 netbsd-6-0-RC2:1.38 tls-maxphys:1.38.0.22 tls-maxphys-base:1.38 matt-nb6-plus:1.38.0.20 matt-nb6-plus-base:1.38 netbsd-6-0-RC1:1.38 jmcneill-usbmp-base10:1.38 yamt-pagecache-base5:1.38 jmcneill-usbmp-base9:1.38 yamt-pagecache-base4:1.38 jmcneill-usbmp-base8:1.38 jmcneill-usbmp-base7:1.38 jmcneill-usbmp-base6:1.38 jmcneill-usbmp-base5:1.38 jmcneill-usbmp-base4:1.38 jmcneill-usbmp-base3:1.38 jmcneill-usbmp-pre-base2:1.38 jmcneill-usbmp-base2:1.38 netbsd-6:1.38.0.18 netbsd-6-base:1.38 netbsd-5-1-2-RELEASE:1.34 netbsd-5-1-1-RELEASE:1.34 jmcneill-usbmp:1.38.0.16 jmcneill-usbmp-base:1.38 jmcneill-audiomp3:1.38.0.14 jmcneill-audiomp3-base:1.38 yamt-pagecache-base3:1.38 yamt-pagecache-base2:1.38 yamt-pagecache:1.38.0.12 yamt-pagecache-base:1.38 rmind-uvmplock-nbase:1.38 cherry-xenmp:1.38.0.10 cherry-xenmp-base:1.38 bouyer-quota2-nbase:1.38 bouyer-quota2:1.38.0.8 bouyer-quota2-base:1.38 jruoho-x86intr:1.38.0.6 jruoho-x86intr-base:1.38 matt-mips64-premerge-20101231:1.38 matt-nb5-mips64-premerge-20101231:1.34 matt-nb5-pq3:1.34.0.18 matt-nb5-pq3-base:1.34 netbsd-5-1:1.34.0.16 netbsd-5-1-RELEASE:1.34 uebayasi-xip-base4:1.38 uebayasi-xip-base3:1.38 yamt-nfs-mp-base11:1.38 netbsd-5-1-RC4:1.34 matt-nb5-mips64-k15:1.34 uebayasi-xip-base2:1.38 yamt-nfs-mp-base10:1.38 netbsd-5-1-RC3:1.34 netbsd-5-1-RC2:1.34 uebayasi-xip-base1:1.38 netbsd-5-1-RC1:1.34 rmind-uvmplock:1.38.0.4 rmind-uvmplock-base:1.38 yamt-nfs-mp-base9:1.38 uebayasi-xip:1.38.0.2 uebayasi-xip-base:1.38 netbsd-5-0-2-RELEASE:1.34 matt-nb5-mips64-premerge-20091211:1.34 matt-premerge-20091211:1.38 yamt-nfs-mp-base8:1.38 matt-nb5-mips64-u2-k2-k4-k7-k8-k9:1.34 matt-nb4-mips64-k7-u2a-k9b:1.34 matt-nb5-mips64-u1-k1-k5:1.34 yamt-nfs-mp-base7:1.38 matt-nb5-mips64:1.34.0.14 netbsd-5-0-1-RELEASE:1.34 jymxensuspend-base:1.38 yamt-nfs-mp-base6:1.38 yamt-nfs-mp-base5:1.38 yamt-nfs-mp-base4:1.38 jym-xensuspend-nbase:1.38 yamt-nfs-mp-base3:1.38 nick-hppapmap-base4:1.38 nick-hppapmap-base3:1.38 netbsd-5-0:1.34.0.12 netbsd-5-0-RELEASE:1.34 netbsd-5-0-RC4:1.34 netbsd-5-0-RC3:1.34 nick-hppapmap-base2:1.34 netbsd-5-0-RC2:1.34 jym-xensuspend:1.34.0.10 jym-xensuspend-base:1.38 netbsd-5-0-RC1:1.34 haad-dm-base2:1.34 haad-nbase2:1.34 ad-audiomp2:1.34.0.8 ad-audiomp2-base:1.34 netbsd-5:1.34.0.6 netbsd-5-base:1.34 nick-hppapmap:1.34.0.4 nick-hppapmap-base:1.38 matt-mips64-base2:1.34 matt-mips64:1.32.0.32 haad-dm-base1:1.34 wrstuden-revivesa-base-4:1.34 netbsd-4-0-1-RELEASE:1.31 wrstuden-revivesa-base-3:1.34 wrstuden-revivesa-base-2:1.34 wrstuden-fixsa-newbase:1.31 nick-csl-alignment-base5:1.32 haad-dm:1.34.0.2 haad-dm-base:1.34 wrstuden-revivesa-base-1:1.34 simonb-wapbl-nbase:1.34 yamt-pf42-base4:1.34 simonb-wapbl:1.33.0.14 simonb-wapbl-base:1.34 yamt-pf42-base3:1.33 hpcarm-cleanup-nbase:1.33 yamt-pf42-baseX:1.33 yamt-pf42-base2:1.33 yamt-nfs-mp-base2:1.33 wrstuden-revivesa:1.33.0.12 wrstuden-revivesa-base:1.34 yamt-nfs-mp:1.33.0.10 yamt-nfs-mp-base:1.33 yamt-pf42:1.33.0.8 yamt-pf42-base:1.33 ad-socklock-base1:1.33 yamt-lazymbuf-base15:1.33 yamt-lazymbuf-base14:1.33 keiichi-mipv6-nbase:1.33 mjf-devfs2:1.33.0.6 mjf-devfs2-base:1.34 nick-net80211-sync:1.33.0.4 nick-net80211-sync-base:1.33 keiichi-mipv6:1.33.0.2 keiichi-mipv6-base:1.33 bouyer-xeni386-merge1:1.32 matt-armv6-prevmlocking:1.32 wrstuden-fixsa-base-1:1.31 vmlocking2-base3:1.32 netbsd-4-0:1.31.0.22 netbsd-4-0-RELEASE:1.31 bouyer-xeni386-nbase:1.32 yamt-kmem-base3:1.32 cube-autoconf:1.32.0.30 cube-autoconf-base:1.32 yamt-kmem-base2:1.32 bouyer-xeni386:1.32.0.28 bouyer-xeni386-base:1.32 yamt-kmem:1.32.0.26 yamt-kmem-base:1.32 vmlocking2-base2:1.32 reinoud-bufcleanup-nbase:1.32 vmlocking2:1.32.0.24 vmlocking2-base1:1.32 netbsd-4-0-RC5:1.31 matt-nb4-arm:1.31.0.20 matt-nb4-arm-base:1.31 matt-armv6-nbase:1.33 jmcneill-base:1.32 netbsd-4-0-RC4:1.31 mjf-devfs:1.32.0.22 mjf-devfs-base:1.32 bouyer-xenamd64-base2:1.32 vmlocking-nbase:1.32 yamt-x86pmap-base4:1.32 bouyer-xenamd64:1.32.0.20 bouyer-xenamd64-base:1.32 netbsd-4-0-RC3:1.31 yamt-x86pmap-base3:1.32 yamt-x86pmap-base2:1.32 netbsd-4-0-RC2:1.31 yamt-x86pmap:1.32.0.18 yamt-x86pmap-base:1.32 netbsd-4-0-RC1:1.31 matt-armv6:1.32.0.16 matt-armv6-base:1.32 matt-mips64-base:1.32 jmcneill-pm:1.32.0.14 jmcneill-pm-base:1.32 hpcarm-cleanup:1.32.0.12 hpcarm-cleanup-base:1.33 nick-csl-alignment:1.32.0.10 nick-csl-alignment-base:1.32 netbsd-3-1-1-RELEASE:1.26 netbsd-3-0-3-RELEASE:1.26 yamt-idlelwp-base8:1.32 wrstuden-fixsa:1.31.0.18 wrstuden-fixsa-base:1.31 thorpej-atomic:1.32.0.8 thorpej-atomic-base:1.32 reinoud-bufcleanup:1.32.0.6 reinoud-bufcleanup-base:1.32 mjf-ufs-trans:1.32.0.4 mjf-ufs-trans-base:1.32 vmlocking:1.32.0.2 vmlocking-base:1.32 ad-audiomp:1.31.0.16 ad-audiomp-base:1.31 yamt-idlelwp:1.31.0.14 post-newlock2-merge:1.31 newlock2-nbase:1.31 yamt-splraiseipl-base5:1.31 yamt-splraiseipl-base4:1.31 yamt-splraiseipl-base3:1.31 abandoned-netbsd-4-base:1.31 abandoned-netbsd-4:1.31.0.6 netbsd-3-1:1.26.0.22 netbsd-3-1-RELEASE:1.26 netbsd-3-0-2-RELEASE:1.26 yamt-splraiseipl-base2:1.31 netbsd-3-1-RC4:1.26 yamt-splraiseipl:1.31.0.10 yamt-splraiseipl-base:1.31 netbsd-3-1-RC3:1.26 yamt-pdpolicy-base9:1.31 newlock2:1.31.0.8 newlock2-base:1.31 yamt-pdpolicy-base8:1.31 netbsd-3-1-RC2:1.26 netbsd-3-1-RC1:1.26 yamt-pdpolicy-base7:1.31 netbsd-4:1.31.0.12 netbsd-4-base:1.31 yamt-pdpolicy-base6:1.31 chap-midi-nbase:1.31 netbsd-3-0-1-RELEASE:1.26 gdamore-uart:1.31.0.4 gdamore-uart-base:1.31 simonb-timcounters-final:1.28.6.1 yamt-pdpolicy-base5:1.31 chap-midi:1.31.0.2 chap-midi-base:1.31 yamt-pdpolicy-base4:1.28 yamt-pdpolicy-base3:1.28 peter-altq-base:1.28 peter-altq:1.28.0.12 yamt-pdpolicy-base2:1.28 elad-kernelauth-base:1.31 elad-kernelauth:1.28.0.10 yamt-pdpolicy:1.28.0.8 yamt-pdpolicy-base:1.28 yamt-uio_vmspace-base5:1.28 simonb-timecounters:1.28.0.6 simonb-timecounters-base:1.31 rpaulo-netinet-merge-pcb:1.28.0.4 rpaulo-netinet-merge-pcb-base:1.31 yamt-uio_vmspace:1.28.0.2 netbsd-3-0:1.26.0.20 netbsd-3-0-RELEASE:1.26 netbsd-3-0-RC6:1.26 yamt-readahead-base3:1.26 netbsd-3-0-RC5:1.26 netbsd-3-0-RC4:1.26 netbsd-3-0-RC3:1.26 yamt-readahead-base2:1.26 netbsd-3-0-RC2:1.26 yamt-readahead-pervnode:1.26 yamt-readahead-perfile:1.26 yamt-readahead:1.26.0.18 yamt-readahead-base:1.26 netbsd-3-0-RC1:1.26 yamt-vop-base3:1.26 netbsd-2-0-3-RELEASE:1.25 netbsd-2-1:1.25.0.6 yamt-vop-base2:1.26 thorpej-vnode-attr:1.26.0.16 thorpej-vnode-attr-base:1.26 netbsd-2-1-RELEASE:1.25 yamt-vop:1.26.0.14 yamt-vop-base:1.26 netbsd-2-1-RC6:1.25 netbsd-2-1-RC5:1.25 netbsd-2-1-RC4:1.25 netbsd-2-1-RC3:1.25 netbsd-2-1-RC2:1.25 netbsd-2-1-RC1:1.25 yamt-lazymbuf:1.26.0.12 yamt-km-base4:1.26 netbsd-2-0-2-RELEASE:1.25 yamt-km-base3:1.26 netbsd-3:1.26.0.10 netbsd-3-base:1.26 yamt-km-base2:1.26 yamt-km:1.26.0.6 yamt-km-base:1.26 kent-audio2:1.26.0.4 kent-audio2-base:1.26 netbsd-2-0-1-RELEASE:1.25 kent-audio1-beforemerge:1.26 netbsd-2:1.25.0.4 netbsd-2-base:1.25 kent-audio1:1.26.0.2 kent-audio1-base:1.26 netbsd-2-0-RELEASE:1.25 netbsd-2-0-RC5:1.25 netbsd-2-0-RC4:1.25 netbsd-2-0-RC3:1.25 netbsd-2-0-RC2:1.25 netbsd-2-0-RC1:1.25 netbsd-2-0:1.25.0.2 netbsd-2-0-base:1.25 netbsd-1-6-PATCH002-RELEASE:1.23 netbsd-1-6-PATCH002:1.23 netbsd-1-6-PATCH002-RC4:1.23 netbsd-1-6-PATCH002-RC3:1.23 netbsd-1-6-PATCH002-RC2:1.23 netbsd-1-6-PATCH002-RC1:1.23 ktrace-lwp:1.24.0.2 ktrace-lwp-base:1.26 netbsd-1-6-PATCH001:1.23 netbsd-1-6-PATCH001-RELEASE:1.23 netbsd-1-6-PATCH001-RC3:1.23 netbsd-1-6-PATCH001-RC2:1.23 netbsd-1-6-PATCH001-RC1:1.23 nathanw_sa_end:1.21.6.2 nathanw_sa_before_merge:1.23 fvdl_fs64_base:1.23 gmcgarry_ctxsw:1.23.0.14 gmcgarry_ctxsw_base:1.23 gmcgarry_ucred:1.23.0.12 gmcgarry_ucred_base:1.23 nathanw_sa_base:1.23 kqueue-aftermerge:1.23 kqueue-beforemerge:1.23 netbsd-1-6-RELEASE:1.23 netbsd-1-6-RC3:1.23 netbsd-1-6-RC2:1.23 netbsd-1-6-RC1:1.23 netbsd-1-6:1.23.0.10 netbsd-1-6-base:1.23 gehenna-devsw:1.23.0.8 gehenna-devsw-base:1.23 netbsd-1-5-PATCH003:1.21 eeh-devprop:1.23.0.6 eeh-devprop-base:1.23 newlock:1.23.0.4 newlock-base:1.23 ifpoll-base:1.23 thorpej-mips-cache:1.22.0.4 thorpej-mips-cache-base:1.22 thorpej-devvp-base3:1.22 thorpej-devvp-base2:1.22 post-chs-ubcperf:1.22 pre-chs-ubcperf:1.22 thorpej-devvp:1.22.0.2 thorpej-devvp-base:1.22 netbsd-1-5-PATCH002:1.21 kqueue:1.21.0.8 kqueue-base:1.23 netbsd-1-5-PATCH001:1.21 thorpej_scsipi_beforemerge:1.21 nathanw_sa:1.21.0.6 thorpej_scsipi_nbase:1.21 netbsd-1-5-RELEASE:1.21 netbsd-1-5-BETA2:1.21 netbsd-1-5-BETA:1.21 netbsd-1-4-PATCH003:1.20 netbsd-1-5-ALPHA2:1.21 netbsd-1-5:1.21.0.4 netbsd-1-5-base:1.21 minoura-xpg4dl-base:1.21 minoura-xpg4dl:1.21.0.2 netbsd-1-4-PATCH002:1.20 chs-ubc2-newbase:1.20 wrstuden-devbsize-19991221:1.20 wrstuden-devbsize:1.20.0.14 wrstuden-devbsize-base:1.20 kame_141_19991130:1.20 comdex-fall-1999:1.20.0.12 comdex-fall-1999-base:1.20 fvdl-softdep:1.20.0.10 fvdl-softdep-base:1.20 thorpej_scsipi:1.20.0.8 thorpej_scsipi_base:1.21 netbsd-1-4-PATCH001:1.20 kame_14_19990705:1.20 kame_14_19990628:1.20 kame:1.20.0.6 chs-ubc2:1.20.0.4 chs-ubc2-base:1.20 netbsd-1-4-RELEASE:1.20 netbsd-1-4:1.20.0.2 netbsd-1-4-base:1.20 netbsd-1-3-PATCH003:1.17 netbsd-1-3-PATCH003-CANDIDATE2:1.17 kenh-if-detach:1.17.0.14 kenh-if-detach-base:1.17 netbsd-1-3-PATCH003-CANDIDATE1:1.17 netbsd-1-3-PATCH003-CANDIDATE0:1.17 chs-ubc:1.17.0.12 chs-ubc-base:1.17 eeh-paddr_t:1.17.0.10 eeh-paddr_t-base:1.17 netbsd-1-3-PATCH002:1.17 lite-2:1.1.1.2 lite-1:1.1.1.2 CSRG:1.1.1 netbsd-1-3-PATCH001:1.17 netbsd-1-3-RELEASE:1.17 netbsd-1-3-BETA:1.17 netbsd-1-3:1.17.0.8 netbsd-1-3-base:1.17 thorpej-signal:1.17.0.6 thorpej-signal-base:1.17 marc-pcmcia:1.17.0.4 marc-pcmcia-bp:1.17 marc-pcmcia-base:1.17 bouyer-scsipi:1.17.0.2 is-newarp-before-merge:1.16 netbsd-1-2-PATCH001:1.15 mrg-vm-swap:1.15.0.8 is-newarp:1.15.0.6 is-newarp-base:1.15 thorpej-setroot:1.15.0.2 netbsd-1-2-RELEASE:1.15 netbsd-1-2-BETA:1.15 netbsd-1-2:1.15.0.4 netbsd-1-2-base:1.15 date-03-may-96:1.1.1.2 netbsd-1-1-PATCH001:1.12 netbsd-1-1-RELEASE:1.12 netbsd-1-1:1.12.0.2 netbsd-1-1-base:1.12 netbsd-1-0-PATCH06:1.9 netbsd-1-0-PATCH05:1.9 netbsd-1-0-PATCH04:1.9 netbsd-1-0-PATCH03:1.9 netbsd-1-0-PATCH02:1.9 netbsd-1-0-PATCH1:1.9 netbsd-1-0-PATCH0:1.9 netbsd-1-0-RELEASE:1.9 netbsd-1-0:1.9.0.2 netbsd-1-0-base:1.9 magnum-base:1.4 magnum:1.4.0.2 netbsd-0-9-patch-001:1.3 netbsd-0-9-RELEASE:1.3 netbsd-0-9-BETA:1.3 netbsd-0-9-ALPHA2:1.3 netbsd-0-9-ALPHA:1.3 netbsd-0-9:1.3.0.2 netbsd-0-9-base:1.3 netbsd-0-8:1.2 netbsd-alpha-1:1.2 patchkit-0-2-2:1.1.1.1 WFJ-386bsd-01:1.1.1.1 WFJ-920714:1.1.1; locks; strict; comment @ * @; 1.41 date 2019.04.06.08.38.23; author msaitoh; state Exp; branches; next 1.40; commitid e7V0pGkdnNWxxgiB; 1.40 date 2016.08.05.08.56.36; author pgoyette; state Exp; branches 1.40.16.1; next 1.39; 1.39 date 2015.08.24.22.21.26; author pooka; state Exp; branches 1.39.2.1; next 1.38; 1.38 date 2009.04.18.15.20.06; author tsutsui; state Exp; branches 1.38.22.1 1.38.40.1; next 1.37; 1.37 date 2009.04.18.14.58.05; author tsutsui; state Exp; branches; next 1.36; 1.36 date 2009.03.18.17.06.51; author cegger; state Exp; branches; next 1.35; 1.35 date 2009.03.18.15.14.31; author cegger; state Exp; branches; next 1.34; 1.34 date 2008.06.15.16.35.35; author christos; state Exp; branches 1.34.4.1 1.34.10.1; next 1.33; 1.33 date 2008.02.20.17.05.53; author matt; state Exp; branches 1.33.6.1 1.33.8.1 1.33.10.1 1.33.12.1 1.33.14.1; next 1.32; 1.32 date 2007.03.04.06.03.18; author christos; state Exp; branches 1.32.16.1; next 1.31; 1.31 date 2006.04.19.15.13.34; author christos; state Exp; branches 1.31.14.1; next 1.30; 1.30 date 2006.04.15.02.03.36; author christos; state Exp; branches; next 1.29; 1.29 date 2006.04.15.02.01.50; author christos; state Exp; branches; next 1.28; 1.28 date 2005.12.11.23.05.25; author thorpej; state Exp; branches 1.28.4.1 1.28.6.1 1.28.8.1 1.28.10.1 1.28.12.1; next 1.27; 1.27 date 2005.12.11.12.24.52; author christos; state Exp; branches; next 1.26; 1.26 date 2004.12.06.02.59.23; author christos; state Exp; branches 1.26.12.1; next 1.25; 1.25 date 2003.08.07.16.32.58; author agc; state Exp; branches; next 1.24; 1.24 date 2003.05.02.03.15.25; author itojun; state Exp; branches 1.24.2.1; next 1.23; 1.23 date 2001.11.12.23.49.49; author lukem; state Exp; branches; next 1.22; 1.22 date 2001.07.18.16.43.10; author thorpej; state Exp; branches; next 1.21; 1.21 date 2000.03.30.09.45.41; author augustss; state Exp; branches 1.21.6.1 1.21.8.1; next 1.20; 1.20 date 99.03.13.14.09.46; author drochner; state Exp; branches 1.20.8.1; next 1.19; 1.19 date 99.03.12.22.42.31; author perry; state Exp; branches; next 1.18; 1.18 date 98.12.12.18.22.39; author christos; state Exp; branches; next 1.17; 1.17 date 97.05.17.21.12.10; author christos; state Exp; branches; next 1.16; 1.16 date 97.03.12.20.27.03; author christos; state Exp; branches; next 1.15; 1.15 date 96.03.15.02.28.12; author paulus; state Exp; branches; next 1.14; 1.14 date 96.02.13.22.00.55; author christos; state Exp; branches; next 1.13; 1.13 date 95.11.20.20.43.33; author cgd; state Exp; branches; next 1.12; 1.12 date 95.07.04.06.28.28; author paulus; state Exp; branches; next 1.11; 1.11 date 95.03.28.20.01.15; author jtc; state Exp; branches; next 1.10; 1.10 date 95.03.08.02.57.17; author cgd; state Exp; branches; next 1.9; 1.9 date 94.06.29.06.36.48; author cgd; state Exp; branches; next 1.8; 1.8 date 94.05.13.06.03.25; author mycroft; state Exp; branches; next 1.7; 1.7 date 94.05.08.12.34.21; author paulus; state Exp; branches; next 1.6; 1.6 date 94.01.21.06.33.31; author glass; state Exp; branches; next 1.5; 1.5 date 93.12.18.00.41.06; author mycroft; state Exp; branches; next 1.4; 1.4 date 93.08.14.06.38.40; author deraadt; state Exp; branches 1.4.2.1; next 1.3; 1.3 date 93.05.20.03.06.12; author cgd; state Exp; branches; next 1.2; 1.2 date 93.03.25.00.28.01; author cgd; state Exp; branches; next 1.1; 1.1 date 93.03.21.09.45.37; author cgd; state Exp; branches 1.1.1.1; next ; 1.40.16.1 date 2019.06.10.22.09.45; author christos; state Exp; branches; next ; commitid jtc8rnCzWiEEHGqB; 1.39.2.1 date 2016.08.06.00.19.10; author pgoyette; state Exp; branches; next ; 1.38.22.1 date 2017.12.03.11.39.02; author jdolecek; state Exp; branches; next ; commitid XcIYRZTAh1LmerhA; 1.38.40.1 date 2015.09.22.12.06.10; author skrll; state Exp; branches; next 1.38.40.2; 1.38.40.2 date 2016.10.05.20.56.08; author skrll; state Exp; branches; next ; 1.34.4.1 date 2009.04.28.07.37.17; author skrll; state Exp; branches; next ; 1.34.10.1 date 2009.05.13.17.22.20; author jym; state Exp; branches; next ; 1.33.6.1 date 2008.06.29.09.33.19; author mjf; state Exp; branches; next ; 1.33.8.1 date 2008.06.17.09.15.13; author yamt; state Exp; branches; next ; 1.33.10.1 date 2009.05.04.08.14.15; author yamt; state Exp; branches; next ; 1.33.12.1 date 2008.06.23.04.31.58; author wrstuden; state Exp; branches; next ; 1.33.14.1 date 2008.06.18.16.33.50; author simonb; state Exp; branches; next ; 1.32.16.1 date 2008.03.23.02.05.05; author matt; state Exp; branches; next ; 1.31.14.1 date 2007.03.12.05.59.16; author rmind; state Exp; branches; next ; 1.28.4.1 date 2006.09.09.02.58.06; author rpaulo; state Exp; branches; next ; 1.28.6.1 date 2006.04.22.11.40.08; author simonb; state Exp; branches; next ; 1.28.8.1 date 2006.05.24.10.58.56; author yamt; state Exp; branches; next ; 1.28.10.1 date 2006.04.19.04.46.10; author elad; state Exp; branches; next 1.28.10.2; 1.28.10.2 date 2006.05.11.23.31.08; author elad; state Exp; branches; next ; 1.28.12.1 date 2006.05.24.15.50.44; author tron; state Exp; branches; next ; 1.26.12.1 date 2006.06.21.15.10.28; author yamt; state Exp; branches; next 1.26.12.2; 1.26.12.2 date 2007.09.03.14.42.25; author yamt; state Exp; branches; next 1.26.12.3; 1.26.12.3 date 2008.02.27.08.37.01; author yamt; state Exp; branches; next ; 1.24.2.1 date 2004.08.03.10.54.20; author skrll; state Exp; branches; next 1.24.2.2; 1.24.2.2 date 2004.09.18.14.54.16; author skrll; state Exp; branches; next 1.24.2.3; 1.24.2.3 date 2004.09.21.13.36.43; author skrll; state Exp; branches; next 1.24.2.4; 1.24.2.4 date 2004.12.18.09.32.51; author skrll; state Exp; branches; next ; 1.21.6.1 date 2001.08.24.00.12.20; author nathanw; state Exp; branches; next 1.21.6.2; 1.21.6.2 date 2001.11.14.19.17.31; author nathanw; state Exp; branches; next ; 1.21.8.1 date 2001.08.03.04.13.53; author lukem; state Exp; branches; next 1.21.8.2; 1.21.8.2 date 2002.01.10.20.02.22; author thorpej; state Exp; branches; next ; 1.20.8.1 date 2000.11.20.18.10.12; author bouyer; state Exp; branches; next ; 1.4.2.1 date 93.11.14.20.20.27; author mycroft; state Exp; branches; next ; 1.1.1.1 date 93.03.21.09.45.37; author cgd; state Exp; branches; next 1.1.1.2; 1.1.1.2 date 98.03.01.02.10.08; author fvdl; state Exp; branches; next ; desc @@ 1.41 log @KNF. No functional change. @ text @/* $NetBSD: slcompress.c,v 1.40 2016/08/05 08:56:36 pgoyette Exp $ */ /* Id: slcompress.c,v 1.3 1996/05/24 07:04:47 paulus Exp */ /* * Copyright (c) 1989, 1993, 1994 * 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. * * @@(#)slcompress.c 8.2 (Berkeley) 4/16/94 */ /* * Routines to compress and uncompess tcp packets (for transmission * over low speed serial lines. * * Van Jacobson (van@@helios.ee.lbl.gov), Dec 31, 1989: * - Initial distribution. */ #include __KERNEL_RCSID(0, "$NetBSD: slcompress.c,v 1.40 2016/08/05 08:56:36 pgoyette Exp $"); #ifdef _KERNEL_OPT #include "opt_inet.h" #endif #ifdef INET #include #include #include #include #include #include #include #include #include #ifndef SL_NO_STATS #define INCR(counter) ++comp->counter; #else #define INCR(counter) #endif void sl_compress_init(struct slcompress *comp) { u_int i; struct cstate *tstate = comp->tstate; memset(comp, 0, sizeof(*comp)); for (i = MAX_STATES - 1; i > 0; --i) { tstate[i].cs_id = i; tstate[i].cs_next = &tstate[i - 1]; } tstate[0].cs_next = &tstate[MAX_STATES - 1]; tstate[0].cs_id = 0; comp->last_cs = &tstate[0]; comp->last_recv = 255; comp->last_xmit = 255; comp->flags = SLF_TOSS; } /* * Like sl_compress_init, but we get to specify the maximum connection * ID to use on transmission. */ void sl_compress_setup(struct slcompress *comp, int max_state) { u_int i; struct cstate *tstate = comp->tstate; if (max_state == -1) { max_state = MAX_STATES - 1; memset(comp, 0, sizeof(*comp)); } else { /* Don't reset statistics */ memset(comp->tstate, 0, sizeof(comp->tstate)); memset(comp->rstate, 0, sizeof(comp->rstate)); } for (i = max_state; i > 0; --i) { tstate[i].cs_id = i; tstate[i].cs_next = &tstate[i - 1]; } tstate[0].cs_next = &tstate[max_state]; tstate[0].cs_id = 0; comp->last_cs = &tstate[0]; comp->last_recv = 255; comp->last_xmit = 255; comp->flags = SLF_TOSS; } /* * ENCODE encodes a number that is known to be non-zero. ENCODEZ checks for * zero (since zero has to be encoded in the long, 3 byte form). */ #define ENCODE(n) { \ if ((uint16_t)(n) >= 256) { \ *cp++ = 0; \ cp[1] = (n); \ cp[0] = (n) >> 8; \ cp += 2; \ } else { \ *cp++ = (n); \ } \ } #define ENCODEZ(n) { \ if ((uint16_t)(n) >= 256 || (uint16_t)(n) == 0) { \ *cp++ = 0; \ cp[1] = (n); \ cp[0] = (n) >> 8; \ cp += 2; \ } else { \ *cp++ = (n); \ } \ } #define DECODEL(f) { \ if (*cp == 0) {\ (f) = htonl(ntohl(f) + ((cp[1] << 8) | cp[2])); \ cp += 3; \ } else { \ (f) = htonl(ntohl(f) + (uint32_t)*cp++); \ } \ } #define DECODES(f) { \ if (*cp == 0) {\ (f) = htons(ntohs(f) + ((cp[1] << 8) | cp[2])); \ cp += 3; \ } else { \ (f) = htons(ntohs(f) + (uint32_t)*cp++); \ } \ } #define DECODEU(f) { \ if (*cp == 0) {\ (f) = htons((cp[1] << 8) | cp[2]); \ cp += 3; \ } else { \ (f) = htons((uint32_t)*cp++); \ } \ } u_int sl_compress_tcp(struct mbuf *m, struct ip *ip, struct slcompress *comp, int compress_cid) { struct cstate *cs = comp->last_cs->cs_next; u_int hlen = ip->ip_hl; struct tcphdr *oth; struct tcphdr *th; u_int deltaS, deltaA; u_int changes = 0; u_char new_seq[16]; u_char *cp = new_seq; /* * Bail if this is an IP fragment or if the TCP packet isn't * `compressible' (i.e., ACK isn't set or some other control bit is * set). (We assume that the caller has already made sure the * packet is IP proto TCP). */ if ((ip->ip_off & htons(0x3fff)) || m->m_len < 40) return TYPE_IP; th = (struct tcphdr *)&((int32_t *)ip)[hlen]; if ((th->th_flags & (TH_SYN|TH_FIN|TH_RST|TH_ACK)) != TH_ACK) return TYPE_IP; /* * Packet is compressible -- we're going to send either a * COMPRESSED_TCP or UNCOMPRESSED_TCP packet. Either way we need * to locate (or create) the connection state. Special case the * most recently used connection since it's most likely to be used * again & we don't have to do any reordering if it's used. */ INCR(sls_packets) if (ip->ip_src.s_addr != cs->cs_ip.ip_src.s_addr || ip->ip_dst.s_addr != cs->cs_ip.ip_dst.s_addr || *(int32_t *)th != ((int32_t *)&cs->cs_ip)[cs->cs_ip.ip_hl]) { /* * Wasn't the first -- search for it. * * States are kept in a circularly linked list with last_cs * pointing to the end of the list. The list is kept in lru * order by moving a state to the head of the list whenever it * is referenced. Since the list is short and, empirically, * the connection we want is almost always near the front, we * locate states via linear search. If we don't find a state * for the datagram, the oldest state is (re-)used. */ struct cstate *lcs; struct cstate *lastcs = comp->last_cs; do { lcs = cs; cs = cs->cs_next; INCR(sls_searches) if (ip->ip_src.s_addr == cs->cs_ip.ip_src.s_addr && ip->ip_dst.s_addr == cs->cs_ip.ip_dst.s_addr && *(int32_t *)th == ((int32_t *)&cs->cs_ip)[cs->cs_ip.ip_hl]) goto found; } while (cs != lastcs); /* * Didn't find it -- re-use oldest cstate. Send an * uncompressed packet that tells the other side what * connection number we're using for this conversation. * Note that since the state list is circular, the oldest * state points to the newest and we only need to set * last_cs to update the lru linkage. */ INCR(sls_misses) comp->last_cs = lcs; hlen += th->th_off; hlen <<= 2; if (hlen > m->m_len) return TYPE_IP; goto uncompressed; found: /* Found it -- move to the front on the connection list. */ if (cs == lastcs) comp->last_cs = lcs; else { lcs->cs_next = cs->cs_next; cs->cs_next = lastcs->cs_next; lastcs->cs_next = cs; } } /* * Make sure that only what we expect to change changed. The first * line of the `if' checks the IP protocol version, header length & * type of service. The 2nd line checks the "Don't fragment" bit. * The 3rd line checks the time-to-live and protocol (the protocol * check is unnecessary but costless). The 4th line checks the TCP * header length. The 5th line checks IP options, if any. The 6th * line checks TCP options, if any. If any of these things are * different between the previous & current datagram, we send the * current datagram `uncompressed'. */ oth = (struct tcphdr *)&((int32_t *)&cs->cs_ip)[hlen]; deltaS = hlen; hlen += th->th_off; hlen <<= 2; if (hlen > m->m_len) return TYPE_IP; if (((uint16_t *)ip)[0] != ((uint16_t *)&cs->cs_ip)[0] || ((uint16_t *)ip)[3] != ((uint16_t *)&cs->cs_ip)[3] || ((uint16_t *)ip)[4] != ((uint16_t *)&cs->cs_ip)[4] || th->th_off != oth->th_off || (deltaS > 5 && memcmp(ip + 1, &cs->cs_ip + 1, (deltaS - 5) << 2)) || (th->th_off > 5 && memcmp(th + 1, oth + 1, (th->th_off - 5) << 2))) goto uncompressed; /* * Figure out which of the changing fields changed. The receiver * expects changes in the order: urgent, window, ack, seq (the order * minimizes the number of temporaries needed in this section of code). */ if (th->th_flags & TH_URG) { deltaS = ntohs(th->th_urp); ENCODEZ(deltaS); changes |= NEW_U; } else if (th->th_urp != oth->th_urp) /* * argh! URG not set but urp changed -- a sensible * implementation should never do this but RFC793 doesn't * prohibit the change so we have to deal with it. */ goto uncompressed; deltaS = (uint16_t)(ntohs(th->th_win) - ntohs(oth->th_win)); if (deltaS) { ENCODE(deltaS); changes |= NEW_W; } deltaA = ntohl(th->th_ack) - ntohl(oth->th_ack); if (deltaA) { if (deltaA > 0xffff) goto uncompressed; ENCODE(deltaA); changes |= NEW_A; } deltaS = ntohl(th->th_seq) - ntohl(oth->th_seq); if (deltaS) { if (deltaS > 0xffff) goto uncompressed; ENCODE(deltaS); changes |= NEW_S; } switch (changes) { case 0: /* * Nothing changed. If this packet contains data and the * last one didn't, this is probably a data packet following * an ack (normal on an interactive connection) and we send * it compressed. Otherwise it's probably a retransmit, * retransmitted ack or window probe. Send it uncompressed * in case the other side missed the compressed version. */ if (ip->ip_len != cs->cs_ip.ip_len && ntohs(cs->cs_ip.ip_len) == hlen) break; /* FALLTHROUGH */ case SPECIAL_I: case SPECIAL_D: /* * actual changes match one of our special case encodings -- * send packet uncompressed. */ goto uncompressed; case NEW_S|NEW_A: if (deltaS == deltaA && deltaS == ntohs(cs->cs_ip.ip_len) - hlen) { /* special case for echoed terminal traffic */ changes = SPECIAL_I; cp = new_seq; } break; case NEW_S: if (deltaS == ntohs(cs->cs_ip.ip_len) - hlen) { /* special case for data xfer */ changes = SPECIAL_D; cp = new_seq; } break; } deltaS = ntohs(ip->ip_id) - ntohs(cs->cs_ip.ip_id); if (deltaS != 1) { ENCODEZ(deltaS); changes |= NEW_I; } if (th->th_flags & TH_PUSH) changes |= TCP_PUSH_BIT; /* * Grab the cksum before we overwrite it below. Then update our * state with this packet's header. */ deltaA = ntohs(th->th_sum); memcpy(&cs->cs_ip, ip, hlen); /* * We want to use the original packet as our compressed packet. * (cp - new_seq) is the number of bytes we need for compressed * sequence numbers. In addition we need one byte for the change * mask, one for the connection id and two for the tcp checksum. * So, (cp - new_seq) + 4 bytes of header are needed. hlen is how * many bytes of the original packet to toss so subtract the two to * get the new packet size. */ deltaS = cp - new_seq; cp = (u_char *)ip; if (compress_cid == 0 || comp->last_xmit != cs->cs_id) { comp->last_xmit = cs->cs_id; hlen -= deltaS + 4; cp += hlen; *cp++ = changes | NEW_C; *cp++ = cs->cs_id; } else { hlen -= deltaS + 3; cp += hlen; *cp++ = changes; } m->m_len -= hlen; m->m_data += hlen; *cp++ = deltaA >> 8; *cp++ = deltaA; memcpy(cp, new_seq, deltaS); INCR(sls_compressed) return TYPE_COMPRESSED_TCP; /* * Update connection state cs & send uncompressed packet * ('uncompressed' means a regular ip/tcp packet but with the * 'conversation id' we hope to use on future compressed packets in the * protocol field). */ uncompressed: memcpy(&cs->cs_ip, ip, hlen); ip->ip_p = cs->cs_id; comp->last_xmit = cs->cs_id; return TYPE_UNCOMPRESSED_TCP; } int sl_uncompress_tcp(u_char **bufp, int len, u_int type, struct slcompress *comp) { u_char *hdr, *cp; int vjlen; u_int hlen; cp = bufp ? *bufp : NULL; vjlen = sl_uncompress_tcp_core(cp, len, len, type, comp, &hdr, &hlen); if (vjlen < 0) return 0; /* error */ if (vjlen == 0) return len; /* was uncompressed already */ cp += vjlen; len -= vjlen; /* * At this point, cp points to the first byte of data in the * packet. If we're not aligned on a 4-byte boundary, copy the * data down so the ip & tcp headers will be aligned. Then back up * cp by the tcp/ip header length to make room for the reconstructed * header (we assume the packet we were handed has enough space to * prepend 128 bytes of header). */ if ((long)cp & 3) { if (len > 0) memmove((void *)((long)cp &~ 3), cp, len); cp = (u_char *)((long)cp &~ 3); } cp -= hlen; len += hlen; memcpy(cp, hdr, hlen); *bufp = cp; return len; } /* * Uncompress a packet of total length total_len. The first buflen bytes are * at buf; this must include the entire (compressed or uncompressed) TCP/IP * header. This procedure returns the length of the VJ header, with a pointer * to the uncompressed IP header in *hdrp and its length in *hlenp. */ int sl_uncompress_tcp_core(u_char *buf, int buflen, int total_len, u_int type, struct slcompress *comp, u_char **hdrp, u_int *hlenp) { u_char *cp; u_int hlen, changes; struct tcphdr *th; struct cstate *cs; struct ip *ip; uint16_t *bp; u_int vjlen; switch (type) { case TYPE_UNCOMPRESSED_TCP: if (buf == NULL) goto bad; ip = (struct ip *) buf; if (ip->ip_p >= MAX_STATES) goto bad; cs = &comp->rstate[comp->last_recv = ip->ip_p]; comp->flags &=~ SLF_TOSS; ip->ip_p = IPPROTO_TCP; /* * Calculate the size of the TCP/IP header and make sure that * we don't overflow the space we have available for it. */ hlen = ip->ip_hl << 2; if (hlen + sizeof(struct tcphdr) > buflen) goto bad; hlen += ((struct tcphdr *)&((char *)ip)[hlen])->th_off << 2; if (hlen > MAX_HDR || hlen > buflen) goto bad; memcpy(&cs->cs_ip, ip, hlen); cs->cs_hlen = hlen; INCR(sls_uncompressedin) *hdrp = (u_char *)&cs->cs_ip; *hlenp = hlen; return 0; default: goto bad; case TYPE_COMPRESSED_TCP: break; } /* We've got a compressed packet. */ INCR(sls_compressedin) if (buf == NULL) goto bad; cp = buf; changes = *cp++; if (changes & NEW_C) { /* * Make sure the state index is in range, then grab the state. * If we have a good state index, clear the 'discard' flag. */ if (*cp >= MAX_STATES) goto bad; comp->flags &=~ SLF_TOSS; comp->last_recv = *cp++; } else { /* * this packet has an implicit state index. If we've had a * line error since the last time we got an explicit state * index, we have to toss the packet. */ if (comp->flags & SLF_TOSS) { INCR(sls_tossed) return -1; } } cs = &comp->rstate[comp->last_recv]; hlen = cs->cs_ip.ip_hl << 2; th = (struct tcphdr *)&((u_char *)&cs->cs_ip)[hlen]; th->th_sum = htons((*cp << 8) | cp[1]); cp += 2; if (changes & TCP_PUSH_BIT) th->th_flags |= TH_PUSH; else th->th_flags &=~ TH_PUSH; switch (changes & SPECIALS_MASK) { case SPECIAL_I: { u_int i = ntohs(cs->cs_ip.ip_len) - cs->cs_hlen; th->th_ack = htonl(ntohl(th->th_ack) + i); th->th_seq = htonl(ntohl(th->th_seq) + i); } break; case SPECIAL_D: th->th_seq = htonl(ntohl(th->th_seq) + ntohs(cs->cs_ip.ip_len) - cs->cs_hlen); break; default: if (changes & NEW_U) { th->th_flags |= TH_URG; DECODEU(th->th_urp) } else th->th_flags &=~ TH_URG; if (changes & NEW_W) DECODES(th->th_win) if (changes & NEW_A) DECODEL(th->th_ack) if (changes & NEW_S) DECODEL(th->th_seq) break; } if (changes & NEW_I) { DECODES(cs->cs_ip.ip_id) } else cs->cs_ip.ip_id = htons(ntohs(cs->cs_ip.ip_id) + 1); /* * At this point, cp points to the first byte of data in the packet. * Fill in the IP total length and update the IP header checksum. */ vjlen = cp - buf; buflen -= vjlen; if (buflen < 0) /* * We must have dropped some characters (crc should detect * this but the old slip framing won't) */ goto bad; total_len += cs->cs_hlen - vjlen; cs->cs_ip.ip_len = htons(total_len); /* Recompute the ip header checksum */ bp = (uint16_t *)&cs->cs_ip; cs->cs_ip.ip_sum = 0; for (changes = 0; hlen > 0; hlen -= 2) changes += *bp++; changes = (changes & 0xffff) + (changes >> 16); changes = (changes & 0xffff) + (changes >> 16); cs->cs_ip.ip_sum = ~ changes; *hdrp = (u_char *)&cs->cs_ip; *hlenp = cs->cs_hlen; return vjlen; bad: comp->flags |= SLF_TOSS; INCR(sls_errorin) return -1; } #endif MODULE(MODULE_CLASS_MISC, slcompress, NULL); static int slcompress_modcmd(modcmd_t cmd, void *arg) { switch (cmd) { case MODULE_CMD_INIT: case MODULE_CMD_FINI: #ifdef INET return 0; #endif case MODULE_CMD_STAT: case MODULE_CMD_AUTOUNLOAD: default: return ENOTTY; } } @ 1.40 log @Actually commit the changes for making this into a loadable module. The module infrastructure was committed earlier, but the "guts" of the commit were somehow missed. @ text @d1 1 a1 1 /* $NetBSD: slcompress.c,v 1.39 2015/08/24 22:21:26 pooka Exp $ */ d44 1 a44 1 __KERNEL_RCSID(0, "$NetBSD: slcompress.c,v 1.39 2015/08/24 22:21:26 pooka Exp $"); d121 3 a123 3 /* ENCODE encodes a number that is known to be non-zero. ENCODEZ * checks for zero (since zero has to be encoded in the long, 3 byte * form). d193 1 a193 1 return (TYPE_IP); d197 1 a197 1 return (TYPE_IP); d212 6 a217 7 * States are kept in a circularly linked list with * last_cs pointing to the end of the list. The * list is kept in lru order by moving a state to the * head of the list whenever it is referenced. Since * the list is short and, empirically, the connection * we want is almost always near the front, we locate * states via linear search. If we don't find a state d246 1 a246 1 return (TYPE_IP); d250 1 a250 3 /* * Found it -- move to the front on the connection list. */ d276 1 a276 1 return (TYPE_IP); d289 3 a291 4 * Figure out which of the changing fields changed. The * receiver expects changes in the order: urgent, window, * ack, seq (the order minimizes the number of temporaries * needed in this section of code). d298 5 a302 4 /* argh! URG not set but urp changed -- a sensible * implementation should never do this but RFC793 * doesn't prohibit the change so we have to deal * with it. */ a327 1 d341 1 a341 1 /* (fall through) */ d411 1 a411 1 return (TYPE_COMPRESSED_TCP); d414 4 a417 3 * Update connection state cs & send uncompressed packet ('uncompressed' * means a regular ip/tcp packet but with the 'conversation id' we hope * to use on future compressed packets in the protocol field). d423 1 a423 1 return (TYPE_UNCOMPRESSED_TCP); d437 1 a437 1 return (0); /* error */ d439 1 a439 1 return (len); /* was uncompressed already */ d462 1 a462 1 return (len); d466 4 a469 5 * Uncompress a packet of total length total_len. The first buflen * bytes are at buf; this must include the entire (compressed or * uncompressed) TCP/IP header. This procedure returns the length * of the VJ header, with a pointer to the uncompressed IP header * in *hdrp and its length in *hlenp. d507 1 a507 1 *hdrp = (u_char *) &cs->cs_ip; d509 1 a509 1 return (0); d524 4 a527 2 /* Make sure the state index is in range, then grab the state. * If we have a good state index, clear the 'discard' flag. */ d534 5 a538 3 /* this packet has an implicit state index. If we've * had a line error since the last time we got an * explicit state index, we have to toss the packet. */ d541 1 a541 1 return (-1); d588 2 a589 3 * At this point, cp points to the first byte of data in the * packet. Fill in the IP total length and update the IP * header checksum. d594 4 a597 2 /* we must have dropped some characters (crc should detect * this but the old slip framing won't) */ d603 2 a604 2 /* recompute the ip header checksum */ bp = (uint16_t *) &cs->cs_ip; d612 1 a612 1 *hdrp = (u_char *) &cs->cs_ip; d619 1 a619 1 return (-1); @ 1.40.16.1 log @Sync with HEAD @ text @d1 1 a1 1 /* $NetBSD: slcompress.c,v 1.41 2019/04/06 08:38:23 msaitoh Exp $ */ d44 1 a44 1 __KERNEL_RCSID(0, "$NetBSD: slcompress.c,v 1.41 2019/04/06 08:38:23 msaitoh Exp $"); d121 3 a123 3 /* * ENCODE encodes a number that is known to be non-zero. ENCODEZ checks for * zero (since zero has to be encoded in the long, 3 byte form). d193 1 a193 1 return TYPE_IP; d197 1 a197 1 return TYPE_IP; d212 7 a218 6 * States are kept in a circularly linked list with last_cs * pointing to the end of the list. The list is kept in lru * order by moving a state to the head of the list whenever it * is referenced. Since the list is short and, empirically, * the connection we want is almost always near the front, we * locate states via linear search. If we don't find a state d247 1 a247 1 return TYPE_IP; d251 3 a253 1 /* Found it -- move to the front on the connection list. */ d279 1 a279 1 return TYPE_IP; d292 4 a295 3 * Figure out which of the changing fields changed. The receiver * expects changes in the order: urgent, window, ack, seq (the order * minimizes the number of temporaries needed in this section of code). d302 4 a305 5 /* * argh! URG not set but urp changed -- a sensible * implementation should never do this but RFC793 doesn't * prohibit the change so we have to deal with it. */ d331 1 d345 1 a345 1 /* FALLTHROUGH */ d415 1 a415 1 return TYPE_COMPRESSED_TCP; d418 3 a420 4 * Update connection state cs & send uncompressed packet * ('uncompressed' means a regular ip/tcp packet but with the * 'conversation id' we hope to use on future compressed packets in the * protocol field). d426 1 a426 1 return TYPE_UNCOMPRESSED_TCP; d440 1 a440 1 return 0; /* error */ d442 1 a442 1 return len; /* was uncompressed already */ d465 1 a465 1 return len; d469 5 a473 4 * Uncompress a packet of total length total_len. The first buflen bytes are * at buf; this must include the entire (compressed or uncompressed) TCP/IP * header. This procedure returns the length of the VJ header, with a pointer * to the uncompressed IP header in *hdrp and its length in *hlenp. d511 1 a511 1 *hdrp = (u_char *)&cs->cs_ip; d513 1 a513 1 return 0; d528 2 a529 4 /* * Make sure the state index is in range, then grab the state. * If we have a good state index, clear the 'discard' flag. */ d536 3 a538 5 /* * this packet has an implicit state index. If we've had a * line error since the last time we got an explicit state * index, we have to toss the packet. */ d541 1 a541 1 return -1; d588 3 a590 2 * At this point, cp points to the first byte of data in the packet. * Fill in the IP total length and update the IP header checksum. d595 2 a596 4 /* * We must have dropped some characters (crc should detect * this but the old slip framing won't) */ d602 2 a603 2 /* Recompute the ip header checksum */ bp = (uint16_t *)&cs->cs_ip; d611 1 a611 1 *hdrp = (u_char *)&cs->cs_ip; d618 1 a618 1 return -1; @ 1.39 log @sprinkle _KERNEL_OPT @ text @d1 1 a1 1 /* $NetBSD: slcompress.c,v 1.38 2009/04/18 15:20:06 tsutsui Exp $ */ d44 1 a44 1 __KERNEL_RCSID(0, "$NetBSD: slcompress.c,v 1.38 2009/04/18 15:20:06 tsutsui Exp $"); d54 1 d621 18 @ 1.39.2.1 log @Sync with HEAD @ text @d1 1 a1 1 /* $NetBSD: slcompress.c,v 1.40 2016/08/05 08:56:36 pgoyette Exp $ */ d44 1 a44 1 __KERNEL_RCSID(0, "$NetBSD: slcompress.c,v 1.40 2016/08/05 08:56:36 pgoyette Exp $"); a53 1 #include a619 18 MODULE(MODULE_CLASS_MISC, slcompress, NULL); static int slcompress_modcmd(modcmd_t cmd, void *arg) { switch (cmd) { case MODULE_CMD_INIT: case MODULE_CMD_FINI: #ifdef INET return 0; #endif case MODULE_CMD_STAT: case MODULE_CMD_AUTOUNLOAD: default: return ENOTTY; } } @ 1.38 log @Use memcmp(9) and memcpy(9) directly rather than via local BCMP() and BCOPY() macro. @ text @d1 1 a1 1 /* $NetBSD: slcompress.c,v 1.37 2009/04/18 14:58:05 tsutsui Exp $ */ d44 1 a44 1 __KERNEL_RCSID(0, "$NetBSD: slcompress.c,v 1.37 2009/04/18 14:58:05 tsutsui Exp $"); d46 1 d48 2 @ 1.38.22.1 log @update from HEAD @ text @d1 1 a1 1 /* $NetBSD$ */ d44 1 a44 1 __KERNEL_RCSID(0, "$NetBSD$"); a45 1 #ifdef _KERNEL_OPT a46 2 #endif a50 1 #include a616 18 MODULE(MODULE_CLASS_MISC, slcompress, NULL); static int slcompress_modcmd(modcmd_t cmd, void *arg) { switch (cmd) { case MODULE_CMD_INIT: case MODULE_CMD_FINI: #ifdef INET return 0; #endif case MODULE_CMD_STAT: case MODULE_CMD_AUTOUNLOAD: default: return ENOTTY; } } @ 1.38.40.1 log @Sync with HEAD @ text @d1 1 a1 1 /* $NetBSD: slcompress.c,v 1.39 2015/08/24 22:21:26 pooka Exp $ */ d44 1 a44 1 __KERNEL_RCSID(0, "$NetBSD: slcompress.c,v 1.39 2015/08/24 22:21:26 pooka Exp $"); a45 1 #ifdef _KERNEL_OPT a46 2 #endif @ 1.38.40.2 log @Sync with HEAD @ text @d1 1 a1 1 /* $NetBSD: slcompress.c,v 1.38.40.1 2015/09/22 12:06:10 skrll Exp $ */ d44 1 a44 1 __KERNEL_RCSID(0, "$NetBSD: slcompress.c,v 1.38.40.1 2015/09/22 12:06:10 skrll Exp $"); a53 1 #include a619 18 MODULE(MODULE_CLASS_MISC, slcompress, NULL); static int slcompress_modcmd(modcmd_t cmd, void *arg) { switch (cmd) { case MODULE_CMD_INIT: case MODULE_CMD_FINI: #ifdef INET return 0; #endif case MODULE_CMD_STAT: case MODULE_CMD_AUTOUNLOAD: default: return ENOTTY; } } @ 1.37 log @Remove extra whitespace added by a stupid tool. XXX: more in src/sys/arch @ text @d1 1 a1 1 /* $NetBSD: slcompress.c,v 1.36 2009/03/18 17:06:51 cegger Exp $ */ d44 1 a44 1 __KERNEL_RCSID(0, "$NetBSD: slcompress.c,v 1.36 2009/03/18 17:06:51 cegger Exp $"); a64 3 #define BCMP(p1, p2, n) memcmp((char *)(p1), (char *)(p2), (int)(n)) #define BCOPY(p1, p2, n) memcpy((char *)(p2), (char *)(p1), (int)(n)) d282 1 a282 1 BCMP(ip + 1, &cs->cs_ip + 1, (deltaS - 5) << 2)) || d284 1 a284 1 BCMP(th + 1, oth + 1, (th->th_off - 5) << 2))) d381 1 a381 1 BCOPY(ip, &cs->cs_ip, hlen); d409 1 a409 1 BCOPY(new_seq, cp, deltaS); d419 1 a419 1 BCOPY(ip, &cs->cs_ip, hlen); d458 1 a458 1 BCOPY(hdr, cp, hlen); d504 1 a504 1 BCOPY(ip, &cs->cs_ip, hlen); @ 1.36 log @bcopy -> memcpy @ text @d1 1 a1 1 /* $NetBSD: slcompress.c,v 1.35 2009/03/18 15:14:31 cegger Exp $ */ d44 1 a44 1 __KERNEL_RCSID(0, "$NetBSD: slcompress.c,v 1.35 2009/03/18 15:14:31 cegger Exp $"); d66 1 a66 1 #define BCOPY(p1, p2, n) memcpy( (char *)(p2), (char *)(p1), (int)(n)) @ 1.35 log @bcmp -> memcmp @ text @d1 1 a1 1 /* $NetBSD: slcompress.c,v 1.34 2008/06/15 16:35:35 christos Exp $ */ d44 1 a44 1 __KERNEL_RCSID(0, "$NetBSD: slcompress.c,v 1.34 2008/06/15 16:35:35 christos Exp $"); d66 1 a66 1 #define BCOPY(p1, p2, n) bcopy((char *)(p1), (char *)(p2), (int)(n)) @ 1.34 log @remove unnecessary casts. @ text @d1 1 a1 1 /* $NetBSD: slcompress.c,v 1.33 2008/02/20 17:05:53 matt Exp $ */ d44 1 a44 1 __KERNEL_RCSID(0, "$NetBSD: slcompress.c,v 1.33 2008/02/20 17:05:53 matt Exp $"); d65 1 a65 1 #define BCMP(p1, p2, n) bcmp((char *)(p1), (char *)(p2), (int)(n)) @ 1.34.10.1 log @Sync with HEAD. Commit is split, to avoid a "too many arguments" protocol error. @ text @d1 1 a1 1 /* $NetBSD: slcompress.c,v 1.38 2009/04/18 15:20:06 tsutsui Exp $ */ d44 1 a44 1 __KERNEL_RCSID(0, "$NetBSD: slcompress.c,v 1.38 2009/04/18 15:20:06 tsutsui Exp $"); d65 3 d285 1 a285 1 memcmp(ip + 1, &cs->cs_ip + 1, (deltaS - 5) << 2)) || d287 1 a287 1 memcmp(th + 1, oth + 1, (th->th_off - 5) << 2))) d384 1 a384 1 memcpy(&cs->cs_ip, ip, hlen); d412 1 a412 1 memcpy(cp, new_seq, deltaS); d422 1 a422 1 memcpy(&cs->cs_ip, ip, hlen); d461 1 a461 1 memcpy(cp, hdr, hlen); d507 1 a507 1 memcpy(&cs->cs_ip, ip, hlen); @ 1.34.4.1 log @Sync with HEAD. @ text @d1 1 a1 1 /* $NetBSD: slcompress.c,v 1.38 2009/04/18 15:20:06 tsutsui Exp $ */ d44 1 a44 1 __KERNEL_RCSID(0, "$NetBSD: slcompress.c,v 1.38 2009/04/18 15:20:06 tsutsui Exp $"); d65 3 d285 1 a285 1 memcmp(ip + 1, &cs->cs_ip + 1, (deltaS - 5) << 2)) || d287 1 a287 1 memcmp(th + 1, oth + 1, (th->th_off - 5) << 2))) d384 1 a384 1 memcpy(&cs->cs_ip, ip, hlen); d412 1 a412 1 memcpy(cp, new_seq, deltaS); d422 1 a422 1 memcpy(&cs->cs_ip, ip, hlen); d461 1 a461 1 memcpy(cp, hdr, hlen); d507 1 a507 1 memcpy(&cs->cs_ip, ip, hlen); @ 1.33 log @s/u_\(int[0-9]*_t\)/u\1/g (change u_int*_t to uint*_t) @ text @d1 1 a1 1 /* $NetBSD: slcompress.c,v 1.32 2007/03/04 06:03:18 christos Exp $ */ d44 1 a44 1 __KERNEL_RCSID(0, "$NetBSD: slcompress.c,v 1.32 2007/03/04 06:03:18 christos Exp $"); d75 1 a75 1 memset((char *)comp, 0, sizeof(*comp)); d101 1 a101 1 memset((char *)comp, 0, sizeof(*comp)); d104 2 a105 2 memset((char *)comp->tstate, 0, sizeof(comp->tstate)); memset((char *)comp->rstate, 0, sizeof(comp->rstate)); @ 1.33.10.1 log @sync with head. @ text @d1 1 a1 1 /* $NetBSD: slcompress.c,v 1.33 2008/02/20 17:05:53 matt Exp $ */ d44 1 a44 1 __KERNEL_RCSID(0, "$NetBSD: slcompress.c,v 1.33 2008/02/20 17:05:53 matt Exp $"); d65 3 d75 1 a75 1 memset(comp, 0, sizeof(*comp)); d101 1 a101 1 memset(comp, 0, sizeof(*comp)); d104 2 a105 2 memset(comp->tstate, 0, sizeof(comp->tstate)); memset(comp->rstate, 0, sizeof(comp->rstate)); d285 1 a285 1 memcmp(ip + 1, &cs->cs_ip + 1, (deltaS - 5) << 2)) || d287 1 a287 1 memcmp(th + 1, oth + 1, (th->th_off - 5) << 2))) d384 1 a384 1 memcpy(&cs->cs_ip, ip, hlen); d412 1 a412 1 memcpy(cp, new_seq, deltaS); d422 1 a422 1 memcpy(&cs->cs_ip, ip, hlen); d461 1 a461 1 memcpy(cp, hdr, hlen); d507 1 a507 1 memcpy(&cs->cs_ip, ip, hlen); @ 1.33.6.1 log @Sync with HEAD. @ text @d1 1 a1 1 /* $NetBSD$ */ d44 1 a44 1 __KERNEL_RCSID(0, "$NetBSD$"); d75 1 a75 1 memset(comp, 0, sizeof(*comp)); d101 1 a101 1 memset(comp, 0, sizeof(*comp)); d104 2 a105 2 memset(comp->tstate, 0, sizeof(comp->tstate)); memset(comp->rstate, 0, sizeof(comp->rstate)); @ 1.33.12.1 log @Sync w/ -current. 34 merge conflicts to follow. @ text @d1 1 a1 1 /* $NetBSD: slcompress.c,v 1.33 2008/02/20 17:05:53 matt Exp $ */ d44 1 a44 1 __KERNEL_RCSID(0, "$NetBSD: slcompress.c,v 1.33 2008/02/20 17:05:53 matt Exp $"); d75 1 a75 1 memset(comp, 0, sizeof(*comp)); d101 1 a101 1 memset(comp, 0, sizeof(*comp)); d104 2 a105 2 memset(comp->tstate, 0, sizeof(comp->tstate)); memset(comp->rstate, 0, sizeof(comp->rstate)); @ 1.33.14.1 log @Sync with head. @ text @d1 1 a1 1 /* $NetBSD: slcompress.c,v 1.34 2008/06/15 16:35:35 christos Exp $ */ d44 1 a44 1 __KERNEL_RCSID(0, "$NetBSD: slcompress.c,v 1.34 2008/06/15 16:35:35 christos Exp $"); d75 1 a75 1 memset(comp, 0, sizeof(*comp)); d101 1 a101 1 memset(comp, 0, sizeof(*comp)); d104 2 a105 2 memset(comp->tstate, 0, sizeof(comp->tstate)); memset(comp->rstate, 0, sizeof(comp->rstate)); @ 1.33.8.1 log @sync with head. @ text @d1 1 a1 1 /* $NetBSD: slcompress.c,v 1.33 2008/02/20 17:05:53 matt Exp $ */ d44 1 a44 1 __KERNEL_RCSID(0, "$NetBSD: slcompress.c,v 1.33 2008/02/20 17:05:53 matt Exp $"); d75 1 a75 1 memset(comp, 0, sizeof(*comp)); d101 1 a101 1 memset(comp, 0, sizeof(*comp)); d104 2 a105 2 memset(comp->tstate, 0, sizeof(comp->tstate)); memset(comp->rstate, 0, sizeof(comp->rstate)); @ 1.32 log @Kill caddr_t; there will be some MI fallout, but it will be fixed shortly. @ text @d1 1 a1 1 /* $NetBSD: slcompress.c,v 1.31 2006/04/19 15:13:34 christos Exp $ */ d44 1 a44 1 __KERNEL_RCSID(0, "$NetBSD: slcompress.c,v 1.31 2006/04/19 15:13:34 christos Exp $"); d125 1 a125 1 if ((u_int16_t)(n) >= 256) { \ d135 1 a135 1 if ((u_int16_t)(n) >= 256 || (u_int16_t)(n) == 0) { \ d150 1 a150 1 (f) = htonl(ntohl(f) + (u_int32_t)*cp++); \ d159 1 a159 1 (f) = htons(ntohs(f) + (u_int32_t)*cp++); \ d168 1 a168 1 (f) = htons((u_int32_t)*cp++); \ d280 3 a282 3 if (((u_int16_t *)ip)[0] != ((u_int16_t *)&cs->cs_ip)[0] || ((u_int16_t *)ip)[3] != ((u_int16_t *)&cs->cs_ip)[3] || ((u_int16_t *)ip)[4] != ((u_int16_t *)&cs->cs_ip)[4] || d307 1 a307 1 deltaS = (u_int16_t)(ntohs(th->th_win) - ntohs(oth->th_win)); d483 1 a483 1 u_int16_t *bp; d602 1 a602 1 bp = (u_int16_t *) &cs->cs_ip; @ 1.32.16.1 log @sync with HEAD @ text @d1 1 a1 1 /* slcompress.c,v 1.32 2007/03/04 06:03:18 christos Exp */ d44 1 a44 1 __KERNEL_RCSID(0, "slcompress.c,v 1.32 2007/03/04 06:03:18 christos Exp"); d125 1 a125 1 if ((uint16_t)(n) >= 256) { \ d135 1 a135 1 if ((uint16_t)(n) >= 256 || (uint16_t)(n) == 0) { \ d150 1 a150 1 (f) = htonl(ntohl(f) + (uint32_t)*cp++); \ d159 1 a159 1 (f) = htons(ntohs(f) + (uint32_t)*cp++); \ d168 1 a168 1 (f) = htons((uint32_t)*cp++); \ d280 3 a282 3 if (((uint16_t *)ip)[0] != ((uint16_t *)&cs->cs_ip)[0] || ((uint16_t *)ip)[3] != ((uint16_t *)&cs->cs_ip)[3] || ((uint16_t *)ip)[4] != ((uint16_t *)&cs->cs_ip)[4] || d307 1 a307 1 deltaS = (uint16_t)(ntohs(th->th_win) - ntohs(oth->th_win)); d483 1 a483 1 uint16_t *bp; d602 1 a602 1 bp = (uint16_t *) &cs->cs_ip; @ 1.31 log @Perry reports that buf can be NULL, so deal with it. @ text @d1 1 a1 1 /* $NetBSD: slcompress.c,v 1.30 2006/04/15 02:03:36 christos Exp $ */ d44 1 a44 1 __KERNEL_RCSID(0, "$NetBSD: slcompress.c,v 1.30 2006/04/15 02:03:36 christos Exp $"); d456 1 a456 1 memmove((caddr_t)((long)cp &~ 3), cp, len); @ 1.31.14.1 log @Sync with HEAD. @ text @d1 1 a1 1 /* $NetBSD: slcompress.c,v 1.31 2006/04/19 15:13:34 christos Exp $ */ d44 1 a44 1 __KERNEL_RCSID(0, "$NetBSD: slcompress.c,v 1.31 2006/04/19 15:13:34 christos Exp $"); d456 1 a456 1 memmove((void *)((long)cp &~ 3), cp, len); @ 1.30 log @Coverity CID 756: Remove bogus NULL checks. @ text @d1 1 a1 1 /* $NetBSD: slcompress.c,v 1.29 2006/04/15 02:01:50 christos Exp $ */ d44 1 a44 1 __KERNEL_RCSID(0, "$NetBSD: slcompress.c,v 1.29 2006/04/15 02:01:50 christos Exp $"); d436 1 a436 1 cp = *bufp; d489 2 d522 2 @ 1.29 log @Coverity CID 755: Protect against NULL deref. @ text @d1 1 a1 1 /* $NetBSD: slcompress.c,v 1.28 2005/12/11 23:05:25 thorpej Exp $ */ d44 1 a44 1 __KERNEL_RCSID(0, "$NetBSD: slcompress.c,v 1.28 2005/12/11 23:05:25 thorpej Exp $"); d436 1 a436 1 cp = bufp ? *bufp: NULL; d463 1 a463 2 if (bufp) *bufp = cp; @ 1.28 log @ANSI function decls and application of static. @ text @d1 1 a1 1 /* $NetBSD: slcompress.c,v 1.27 2005/12/11 12:24:52 christos Exp $ */ d44 1 a44 1 __KERNEL_RCSID(0, "$NetBSD: slcompress.c,v 1.27 2005/12/11 12:24:52 christos Exp $"); d436 1 a436 1 cp = bufp? *bufp: NULL; d463 2 a464 1 *bufp = cp; @ 1.28.4.1 log @sync with head @ text @d1 1 a1 1 /* $NetBSD: slcompress.c,v 1.31 2006/04/19 15:13:34 christos Exp $ */ d44 1 a44 1 __KERNEL_RCSID(0, "$NetBSD: slcompress.c,v 1.31 2006/04/19 15:13:34 christos Exp $"); d436 1 a436 1 cp = bufp ? *bufp : NULL; a488 2 if (buf == NULL) goto bad; a519 2 if (buf == NULL) goto bad; @ 1.28.12.1 log @Merge 2006-05-24 NetBSD-current into the "peter-altq" branch. @ text @d1 1 a1 1 /* $NetBSD$ */ d44 1 a44 1 __KERNEL_RCSID(0, "$NetBSD$"); d436 1 a436 1 cp = bufp ? *bufp : NULL; a488 2 if (buf == NULL) goto bad; a519 2 if (buf == NULL) goto bad; @ 1.28.8.1 log @sync with head. @ text @d1 1 a1 1 /* $NetBSD: slcompress.c,v 1.28 2005/12/11 23:05:25 thorpej Exp $ */ d44 1 a44 1 __KERNEL_RCSID(0, "$NetBSD: slcompress.c,v 1.28 2005/12/11 23:05:25 thorpej Exp $"); d436 1 a436 1 cp = bufp ? *bufp : NULL; a488 2 if (buf == NULL) goto bad; a519 2 if (buf == NULL) goto bad; @ 1.28.6.1 log @Sync with head. @ text @d1 1 a1 1 /* $NetBSD: slcompress.c,v 1.31 2006/04/19 15:13:34 christos Exp $ */ d44 1 a44 1 __KERNEL_RCSID(0, "$NetBSD: slcompress.c,v 1.31 2006/04/19 15:13:34 christos Exp $"); d436 1 a436 1 cp = bufp ? *bufp : NULL; a488 2 if (buf == NULL) goto bad; a519 2 if (buf == NULL) goto bad; @ 1.28.10.1 log @sync with head. @ text @d1 1 a1 1 /* $NetBSD: slcompress.c,v 1.30 2006/04/15 02:03:36 christos Exp $ */ d44 1 a44 1 __KERNEL_RCSID(0, "$NetBSD: slcompress.c,v 1.30 2006/04/15 02:03:36 christos Exp $"); d436 1 a436 1 cp = *bufp; @ 1.28.10.2 log @sync with head @ text @d1 1 a1 1 /* $NetBSD: slcompress.c,v 1.28.10.1 2006/04/19 04:46:10 elad Exp $ */ d44 1 a44 1 __KERNEL_RCSID(0, "$NetBSD: slcompress.c,v 1.28.10.1 2006/04/19 04:46:10 elad Exp $"); d436 1 a436 1 cp = bufp ? *bufp : NULL; a488 2 if (buf == NULL) goto bad; a519 2 if (buf == NULL) goto bad; @ 1.27 log @merge ktrace-lwp. @ text @d1 1 a1 1 /* $NetBSD: slcompress.c,v 1.24.2.4 2004/12/18 09:32:51 skrll Exp $ */ d44 1 a44 1 __KERNEL_RCSID(0, "$NetBSD: slcompress.c,v 1.24.2.4 2004/12/18 09:32:51 skrll Exp $"); d70 1 a70 2 sl_compress_init(comp) struct slcompress *comp; d94 1 a94 3 sl_compress_setup(comp, max_state) struct slcompress *comp; int max_state; d173 2 a174 5 sl_compress_tcp(m, ip, comp, compress_cid) struct mbuf *m; struct ip *ip; struct slcompress *comp; int compress_cid; d430 1 a430 5 sl_uncompress_tcp(bufp, len, type, comp) u_char **bufp; int len; u_int type; struct slcompress *comp; d475 2 a476 7 sl_uncompress_tcp_core(buf, buflen, total_len, type, comp, hdrp, hlenp) u_char *buf; int buflen, total_len; u_int type; struct slcompress *comp; u_char **hdrp; u_int *hlenp; @ 1.26 log @Sprinkle #ifdef INET to make a GENERIC kernel compile with INET undefined. @ text @d1 1 a1 1 /* $NetBSD: slcompress.c,v 1.25 2003/08/07 16:32:58 agc Exp $ */ d44 1 a44 1 __KERNEL_RCSID(0, "$NetBSD: slcompress.c,v 1.25 2003/08/07 16:32:58 agc Exp $"); @ 1.26.12.1 log @sync with head. @ text @d1 1 a1 1 /* $NetBSD: slcompress.c,v 1.26 2004/12/06 02:59:23 christos Exp $ */ d44 1 a44 1 __KERNEL_RCSID(0, "$NetBSD: slcompress.c,v 1.26 2004/12/06 02:59:23 christos Exp $"); d70 2 a71 1 sl_compress_init(struct slcompress *comp) d95 3 a97 1 sl_compress_setup(struct slcompress *comp, int max_state) d176 5 a180 2 sl_compress_tcp(struct mbuf *m, struct ip *ip, struct slcompress *comp, int compress_cid) d436 5 a440 1 sl_uncompress_tcp(u_char **bufp, int len, u_int type, struct slcompress *comp) d446 1 a446 1 cp = bufp ? *bufp : NULL; d485 7 a491 2 sl_uncompress_tcp_core(u_char *buf, int buflen, int total_len, u_int type, struct slcompress *comp, u_char **hdrp, u_int *hlenp) a503 2 if (buf == NULL) goto bad; a534 2 if (buf == NULL) goto bad; @ 1.26.12.2 log @sync with head. @ text @d1 1 a1 1 /* $NetBSD: slcompress.c,v 1.26.12.1 2006/06/21 15:10:28 yamt Exp $ */ d44 1 a44 1 __KERNEL_RCSID(0, "$NetBSD: slcompress.c,v 1.26.12.1 2006/06/21 15:10:28 yamt Exp $"); d456 1 a456 1 memmove((void *)((long)cp &~ 3), cp, len); @ 1.26.12.3 log @sync with head. @ text @d1 1 a1 1 /* $NetBSD: slcompress.c,v 1.26.12.2 2007/09/03 14:42:25 yamt Exp $ */ d44 1 a44 1 __KERNEL_RCSID(0, "$NetBSD: slcompress.c,v 1.26.12.2 2007/09/03 14:42:25 yamt Exp $"); d125 1 a125 1 if ((uint16_t)(n) >= 256) { \ d135 1 a135 1 if ((uint16_t)(n) >= 256 || (uint16_t)(n) == 0) { \ d150 1 a150 1 (f) = htonl(ntohl(f) + (uint32_t)*cp++); \ d159 1 a159 1 (f) = htons(ntohs(f) + (uint32_t)*cp++); \ d168 1 a168 1 (f) = htons((uint32_t)*cp++); \ d280 3 a282 3 if (((uint16_t *)ip)[0] != ((uint16_t *)&cs->cs_ip)[0] || ((uint16_t *)ip)[3] != ((uint16_t *)&cs->cs_ip)[3] || ((uint16_t *)ip)[4] != ((uint16_t *)&cs->cs_ip)[4] || d307 1 a307 1 deltaS = (uint16_t)(ntohs(th->th_win) - ntohs(oth->th_win)); d483 1 a483 1 uint16_t *bp; d602 1 a602 1 bp = (uint16_t *) &cs->cs_ip; @ 1.25 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: slcompress.c,v 1.24 2003/05/02 03:15:25 itojun Exp $ */ d44 1 a44 1 __KERNEL_RCSID(0, "$NetBSD: slcompress.c,v 1.24 2003/05/02 03:15:25 itojun Exp $"); d46 2 d630 1 @ 1.24 log @KNF @ text @d1 1 a1 1 /* $NetBSD: slcompress.c,v 1.23 2001/11/12 23:49:49 lukem Exp $ */ d16 1 a16 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 d44 1 a44 1 __KERNEL_RCSID(0, "$NetBSD: slcompress.c,v 1.23 2001/11/12 23:49:49 lukem Exp $"); @ 1.24.2.1 log @Sync with HEAD @ text @d1 1 a1 1 /* $NetBSD: slcompress.c,v 1.25 2003/08/07 16:32:58 agc Exp $ */ d16 5 a20 1 * 3. Neither the name of the University nor the names of its contributors d48 1 a48 1 __KERNEL_RCSID(0, "$NetBSD: slcompress.c,v 1.25 2003/08/07 16:32:58 agc Exp $"); @ 1.24.2.2 log @Sync with HEAD. @ text @@ 1.24.2.3 log @Fix the sync with head I botched. @ text @d1 1 a1 1 /* $NetBSD: slcompress.c,v 1.24.2.1 2004/08/03 10:54:20 skrll Exp $ */ d44 1 a44 1 __KERNEL_RCSID(0, "$NetBSD: slcompress.c,v 1.24.2.1 2004/08/03 10:54:20 skrll Exp $"); @ 1.24.2.4 log @Sync with HEAD. @ text @d1 1 a1 1 /* $NetBSD: slcompress.c,v 1.24.2.3 2004/09/21 13:36:43 skrll Exp $ */ d44 1 a44 1 __KERNEL_RCSID(0, "$NetBSD: slcompress.c,v 1.24.2.3 2004/09/21 13:36:43 skrll Exp $"); a45 2 #include "opt_inet.h" #ifdef INET a627 1 #endif @ 1.23 log @add RCSIDs @ text @d1 1 a1 1 /* $NetBSD: slcompress.c,v 1.22 2001/07/18 16:43:10 thorpej Exp $ */ d48 1 a48 1 __KERNEL_RCSID(0, "$NetBSD$"); d337 1 a337 1 switch(changes) { @ 1.22 log @bzero -> memset @ text @d1 1 a1 1 /* $NetBSD: slcompress.c,v 1.21 2000/03/30 09:45:41 augustss Exp $ */ d46 3 @ 1.21 log @Kill some more register declarations. @ text @d1 1 a1 1 /* $NetBSD: slcompress.c,v 1.20 1999/03/13 14:09:46 drochner Exp $ */ d75 1 a75 1 bzero((char *)comp, sizeof(*comp)); d103 1 a103 1 bzero((char *)comp, sizeof(*comp)); d106 2 a107 2 bzero((char *)comp->tstate, sizeof(comp->tstate)); bzero((char *)comp->rstate, sizeof(comp->rstate)); @ 1.21.6.1 log @Catch up with -current. @ text @d1 1 a1 1 /* $NetBSD: slcompress.c,v 1.21 2000/03/30 09:45:41 augustss Exp $ */ d75 1 a75 1 memset((char *)comp, 0, sizeof(*comp)); d103 1 a103 1 memset((char *)comp, 0, sizeof(*comp)); d106 2 a107 2 memset((char *)comp->tstate, 0, sizeof(comp->tstate)); memset((char *)comp->rstate, 0, sizeof(comp->rstate)); @ 1.21.6.2 log @Catch up to -current. @ text @d1 1 a1 1 /* $NetBSD: slcompress.c,v 1.21.6.1 2001/08/24 00:12:20 nathanw Exp $ */ a45 3 #include __KERNEL_RCSID(0, "$NetBSD$"); @ 1.21.8.1 log @update to -current @ text @d1 1 a1 1 /* $NetBSD: slcompress.c,v 1.22 2001/07/18 16:43:10 thorpej Exp $ */ d75 1 a75 1 memset((char *)comp, 0, sizeof(*comp)); d103 1 a103 1 memset((char *)comp, 0, sizeof(*comp)); d106 2 a107 2 memset((char *)comp->tstate, 0, sizeof(comp->tstate)); memset((char *)comp->rstate, 0, sizeof(comp->rstate)); @ 1.21.8.2 log @Sync kqueue branch with -current. @ text @d1 1 a1 1 /* $NetBSD: slcompress.c,v 1.21.8.1 2001/08/03 04:13:53 lukem Exp $ */ a45 3 #include __KERNEL_RCSID(0, "$NetBSD: slcompress.c,v 1.23 2001/11/12 23:49:49 lukem Exp $"); @ 1.20 log @make this compile again @ text @d1 1 a1 1 /* $NetBSD: slcompress.c,v 1.19 1999/03/12 22:42:31 perry Exp $ */ d72 2 a73 2 register u_int i; register struct cstate *tstate = comp->tstate; d98 2 a99 2 register u_int i; register struct cstate *tstate = comp->tstate; d177 1 a177 1 register struct ip *ip; d181 6 a186 6 register struct cstate *cs = comp->last_cs->cs_next; register u_int hlen = ip->ip_hl; register struct tcphdr *oth; register struct tcphdr *th; register u_int deltaS, deltaA; register u_int changes = 0; d188 1 a188 1 register u_char *cp = new_seq; d225 2 a226 2 register struct cstate *lcs; register struct cstate *lastcs = comp->last_cs; d492 7 a498 7 register u_char *cp; register u_int hlen, changes; register struct tcphdr *th; register struct cstate *cs; register struct ip *ip; register u_int16_t *bp; register u_int vjlen; d566 1 a566 1 register u_int i = ntohs(cs->cs_ip.ip_len) - cs->cs_hlen; @ 1.20.8.1 log @Update thorpej_scsipi to -current as of a month ago @ text @d1 1 a1 1 /* $NetBSD: slcompress.c,v 1.21 2000/03/30 09:45:41 augustss Exp $ */ d72 2 a73 2 u_int i; struct cstate *tstate = comp->tstate; d98 2 a99 2 u_int i; struct cstate *tstate = comp->tstate; d177 1 a177 1 struct ip *ip; d181 6 a186 6 struct cstate *cs = comp->last_cs->cs_next; u_int hlen = ip->ip_hl; struct tcphdr *oth; struct tcphdr *th; u_int deltaS, deltaA; u_int changes = 0; d188 1 a188 1 u_char *cp = new_seq; d225 2 a226 2 struct cstate *lcs; struct cstate *lastcs = comp->last_cs; d492 7 a498 7 u_char *cp; u_int hlen, changes; struct tcphdr *th; struct cstate *cs; struct ip *ip; u_int16_t *bp; u_int vjlen; d566 1 a566 1 u_int i = ntohs(cs->cs_ip.ip_len) - cs->cs_hlen; @ 1.19 log @exterminate ovbcopy. patches provided by Erik Bertelsen, pr-7145 @ text @d1 1 a1 1 /* $NetBSD: slcompress.c,v 1.18 1998/12/12 18:22:39 christos Exp $ */ d465 1 a465 1 memmove(((long)cp &~ 3), cp, len); @ 1.18 log @Synchronize with the Ultrix version of the ppp release. @ text @d1 1 a1 1 /* $NetBSD: slcompress.c,v 1.17 1997/05/17 21:12:10 christos Exp $ */ a65 3 #ifndef _KERNEL #define ovbcopy bcopy #endif d465 1 a465 1 (void) ovbcopy(cp, (caddr_t)((long)cp &~ 3), len); @ 1.17 log @Update to ppp-2.3b5 @ text @d1 1 a1 1 /* $NetBSD: slcompress.c,v 1.16 1997/03/12 20:27:03 christos Exp $ */ d253 2 d285 2 d445 2 a446 1 int hlen, vjlen; @ 1.16 log @Update to ppp-2.3b4; from Paul Mackerras @ text @d1 1 a1 1 /* $NetBSD: slcompress.c,v 1.15 1996/03/15 02:28:12 paulus Exp $ */ d70 1 d72 1 a72 1 sl_compress_init(comp, max_state) d74 26 a99 1 int max_state; @ 1.15 log @Added packet filtering, support for "PPP Deflate" packet compression, trivial multicast support, and support for xon/xoff output flow control to the PPP subsystem. Fixed several bugs, including making the accumulation and resetting of statistics more consistent. State for the VJ compressor is now dynamically allocated. @ text @d1 2 a2 1 /* $NetBSD: slcompress.c,v 1.14 1996/02/13 22:00:55 christos Exp $ */ d481 10 a490 3 hlen = ip->ip_hl; hlen += ((struct tcphdr *)&((int32_t *)ip)[hlen])->th_off; hlen <<= 2; @ 1.14 log @Net prototypes @ text @d1 1 a1 1 /* $NetBSD: slcompress.c,v 1.13 1995/11/20 20:43:33 cgd Exp $ */ d77 1 a77 1 if (max_state == -1) d79 6 a84 1 bzero((char *)comp, sizeof(*comp)); @ 1.13 log @fix casts; should cast pointers to longs, not ints. @ text @d1 1 a1 1 /* $NetBSD: slcompress.c,v 1.12 1995/07/04 06:28:28 paulus Exp $ */ d48 1 d279 2 a280 1 if (deltaS = (u_int16_t)(ntohs(th->th_win) - ntohs(oth->th_win))) { d285 2 a286 1 if (deltaA = ntohl(th->th_ack) - ntohl(oth->th_ack)) { d293 2 a294 1 if (deltaS = ntohl(th->th_seq) - ntohl(oth->th_seq)) { @ 1.12 log @Latest version of PPP stuff, with packet compression and other improvements. The PPP kernel code is now split into if_ppp.c, containing generic PPP support, and ppp_tty.c, which specifically supports PPP on async tty devices (as a line discipline). This is so that other devices can be supported without making them look like ttys. @ text @d1 1 a1 1 /* $NetBSD: slcompress.c,v 1.12 1995/07/04 03:42:30 paulus Exp $ */ d425 1 a425 1 if ((int)cp & 3) { d427 2 a428 2 (void) ovbcopy(cp, (caddr_t)((int)cp &~ 3), len); cp = (u_char *)((int)cp &~ 3); @ 1.11 log @KERNEL -> _KERNEL @ text @d1 1 a1 1 /* $NetBSD: slcompress.c,v 1.10 1995/03/08 02:57:17 cgd Exp $ */ d404 2 d407 29 a435 1 return sl_uncompress_tcp_part(bufp, len, len, type, comp); d440 4 a443 3 * bytes are at *bufp; this must include the entire (compressed or * uncompressed) TCP/IP header. In addition, there must be enough * clear space before *bufp to build a full-length TCP/IP header. d446 2 a447 2 sl_uncompress_tcp_part(bufp, buflen, total_len, type, comp) u_char **bufp; d451 2 d459 2 d465 1 a465 1 ip = (struct ip *) *bufp; a474 1 cs->cs_ip.ip_sum = 0; d477 3 a479 1 return (total_len); d489 1 a489 1 cp = *bufp; d505 1 a505 1 return (0); d553 2 a554 6 * packet. If we're not aligned on a 4-byte boundary, copy the * data down so the ip & tcp headers will be aligned. Then back up * cp by the tcp/ip header length to make room for the reconstructed * header (we assume the packet we were handed has enough space to * prepend 128 bytes of header). Adjust the length to account for * the new header & fill in the IP total length. d556 2 a557 2 buflen -= (cp - *bufp); total_len -= (cp - *bufp); d563 1 a563 7 if ((long)cp & 3) { if (buflen > 0) (void) ovbcopy(cp, (caddr_t)((long)cp &~ 3), buflen); cp = (u_char *)((long)cp &~ 3); } cp -= cs->cs_hlen; total_len += cs->cs_hlen; a564 2 BCOPY(&cs->cs_ip, cp, cs->cs_hlen); *bufp = cp; d567 12 a578 9 { register u_int16_t *bp = (u_int16_t *)cp; for (changes = 0; hlen > 0; hlen -= 2) changes += *bp++; changes = (changes & 0xffff) + (changes >> 16); changes = (changes & 0xffff) + (changes >> 16); ((struct ip *)cp)->ip_sum = ~ changes; } return (total_len); d582 1 a582 1 return (0); @ 1.10 log @fixed sized types, where appropriate. when casting pointers to integers to do math on them, cast to long. ioctl commands are u_longs. @ text @d1 1 a1 1 /* $NetBSD: slcompress.c,v 1.9 1994/06/29 06:36:48 cgd Exp $ */ d64 1 a64 1 #ifndef KERNEL @ 1.9 log @New RCS ID's, take two. they're more aesthecially pleasant, and use 'NetBSD' @ text @d1 1 a1 1 /* $NetBSD$ */ d97 1 a97 1 if ((u_short)(n) >= 256) { \ d107 1 a107 1 if ((u_short)(n) >= 256 || (u_short)(n) == 0) { \ d122 1 a122 1 (f) = htonl(ntohl(f) + (u_long)*cp++); \ d131 1 a131 1 (f) = htons(ntohs(f) + (u_long)*cp++); \ d140 1 a140 1 (f) = htons((u_long)*cp++); \ d169 1 a169 1 th = (struct tcphdr *)&((int *)ip)[hlen]; d182 1 a182 1 *(int *)th != ((int *)&cs->cs_ip)[cs->cs_ip.ip_hl]) { d203 2 a204 1 && *(int *)th == ((int *)&cs->cs_ip)[cs->cs_ip.ip_hl]) d246 1 a246 1 oth = (struct tcphdr *)&((int *)&cs->cs_ip)[hlen]; d251 3 a253 3 if (((u_short *)ip)[0] != ((u_short *)&cs->cs_ip)[0] || ((u_short *)ip)[3] != ((u_short *)&cs->cs_ip)[3] || ((u_short *)ip)[4] != ((u_short *)&cs->cs_ip)[4] || d278 1 a278 1 if (deltaS = (u_short)(ntohs(th->th_win) - ntohs(oth->th_win))) { d437 1 a437 1 hlen += ((struct tcphdr *)&((int *)ip)[hlen])->th_off; d531 1 a531 1 if ((int)cp & 3) { d533 2 a534 2 (void) ovbcopy(cp, (caddr_t)((int)cp &~ 3), buflen); cp = (u_char *)((int)cp &~ 3); d544 1 a544 1 register u_short *bp = (u_short *)cp; @ 1.8 log @Update to 4.4-Lite networking code, with a few local changes. @ text @d1 2 d35 1 a35 2 * from: @@(#)slcompress.c 8.2 (Berkeley) 4/16/94 * $Id: $ @ 1.7 log @Version from ppp-2.1 release. @ text @d1 3 a3 3 /*- * Copyright (c) 1989 The Regents of the University of California. * All rights reserved. d33 2 a34 1 * @@(#)slcompress.c 7.7 (Berkeley) 5/7/91 d42 1 a42 7 * - Initial distribution. * * Modified June 1993 by Paul Mackerras, paulus@@cs.anu.edu.au, * so that the entire packet being decompressed doesn't have * to be in contiguous memory (just the compressed header). * * $Id: slcompress.c,v 1.6 1994/01/21 06:33:31 glass Exp $ d44 1 a44 2 #include a46 1 #include a66 1 d68 1 a68 26 sl_compress_init(comp) struct slcompress *comp; { register u_int i; register struct cstate *tstate = comp->tstate; bzero((char *)comp, sizeof(*comp)); for (i = MAX_STATES - 1; i > 0; --i) { tstate[i].cs_id = i; tstate[i].cs_next = &tstate[i - 1]; } tstate[0].cs_next = &tstate[MAX_STATES - 1]; tstate[0].cs_id = 0; comp->last_cs = &tstate[0]; comp->last_recv = 255; comp->last_xmit = 255; comp->flags = SLF_TOSS; } /* * Like sl_compress_init, but we get to specify the maximum connection * ID to use on transmission. */ void sl_compress_setup(comp, max_state) d75 1 a75 1 if ((unsigned) max_state > MAX_STATES - 1) d143 1 a143 2 u_char a217 2 if (hlen > m->m_len) return (TYPE_IP); a247 2 if (hlen > m->m_len) return (TYPE_IP); d402 1 a404 1 @ 1.6 log @got rid of a warning reported by Bill Sommerfeld @ text @d47 1 a47 1 * $Id: slcompress.c,v 1.5 1993/12/18 00:41:06 mycroft Exp $ d88 28 @ 1.5 log @Canonicalize all #includes. @ text @d47 1 a47 1 * $Id: slcompress.c,v 1.4 1993/08/14 06:38:40 deraadt Exp $ d53 1 @ 1.4 log @ppp from paul mackerras @ text @d47 1 a47 1 * $Id: slcompress.c,v 1.3 1993/05/20 03:06:12 cgd Exp $ d53 1 d59 1 a59 1 #include "slcompress.h" @ 1.4.2.1 log @Canonicalize all #includes. @ text @d47 1 a47 1 * $Id: slcompress.c,v 1.4 1993/08/14 06:38:40 deraadt Exp $ a52 1 d58 1 a58 1 #include @ 1.3 log @add rcs ids to everything, and clean up headers @ text @d2 1 a2 1 * Copyright (c) 1989, 1991 Regents of the University of California. d5 15 a19 11 * Redistribution and use in source and binary forms are permitted * provided that the above copyright notice and this paragraph are * duplicated in all such forms and that any documentation, * advertising materials, and other materials related to such * distribution and use acknowledge that the software was developed * by the University of California, Berkeley. The name of the * University may not be used to endorse or promote products derived * from this software without specific prior written permission. * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. d21 20 a40 1 * Van Jacobson (van@@ee.lbl.gov), Dec 31, 1989: d43 5 a47 1 * $Id$ d410 17 d449 1 a449 1 return (len); d530 3 a532 2 len -= (cp - *bufp); if (len < 0) d538 2 a539 2 if (len > 0) (void) ovbcopy(cp, (caddr_t)((int)cp &~ 3), len); d543 2 a544 2 len += cs->cs_hlen; cs->cs_ip.ip_len = htons(len); d557 1 a557 1 return (len); @ 1.2 log @added BPF support, as provided by David Greenman (davidg@@implode.rain.com) @ text @d19 2 a21 4 #ifndef lint static char rcsid[] = "@@(#) $Header: slcompress.c,v 1.22 92/05/24 11:48:20 van Exp $ (LBL)"; #endif @ 1.1 log @Initial revision @ text @d2 1 a2 1 * Copyright (c) 1989 The Regents of the University of California. d5 11 a15 15 * 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. d17 2 a18 13 * 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. * * @@(#)slcompress.c 7.7 (Berkeley) 5/7/91 d20 6 a25 12 /* * Routines to compress and uncompess tcp packets (for transmission * over low speed serial lines. * * Van Jacobson (van@@helios.ee.lbl.gov), Dec 31, 1989: * - Initial distribution. * * static char rcsid[] = * "$Header: slcompress.c,v 1.19 89/12/31 08:52:59 van Exp $"; */ d65 1 d197 2 d229 2 @ 1.1.1.1 log @initial import of 386bsd-0.1 sources @ text @@ 1.1.1.2 log @Import 4.4BSD-Lite for reference @ text @d2 2 a3 2 * Copyright (c) 1989, 1993, 1994 * The Regents of the University of California. All rights reserved. d33 1 a33 1 * @@(#)slcompress.c 8.2 (Berkeley) 4/16/94 a48 1 d54 1 a54 1 #include d68 1 a85 1 comp->flags = SLF_TOSS; d141 2 a142 1 u_int @