head 1.9; access; symbols netbsd-10-0-RELEASE:1.9 netbsd-10-0-RC6:1.9 netbsd-10-0-RC5:1.9 netbsd-10-0-RC4:1.9 netbsd-10-0-RC3:1.9 netbsd-10-0-RC2:1.9 thorpej-ifq:1.9.0.90 thorpej-ifq-base:1.9 thorpej-altq-separation:1.9.0.88 thorpej-altq-separation-base:1.9 netbsd-10-0-RC1:1.9 netbsd-10:1.9.0.86 netbsd-10-base:1.9 bouyer-sunxi-drm:1.9.0.84 bouyer-sunxi-drm-base:1.9 netbsd-9-3-RELEASE:1.9 thorpej-i2c-spi-conf2:1.9.0.82 thorpej-i2c-spi-conf2-base:1.9 thorpej-futex2:1.9.0.80 thorpej-futex2-base:1.9 thorpej-cfargs2:1.9.0.78 thorpej-cfargs2-base:1.9 cjep_sun2x-base1:1.9 cjep_sun2x:1.9.0.76 cjep_sun2x-base:1.9 cjep_staticlib_x-base1:1.9 netbsd-9-2-RELEASE:1.9 cjep_staticlib_x:1.9.0.74 cjep_staticlib_x-base:1.9 thorpej-i2c-spi-conf:1.9.0.72 thorpej-i2c-spi-conf-base:1.9 thorpej-cfargs:1.9.0.70 thorpej-cfargs-base:1.9 thorpej-futex:1.9.0.68 thorpej-futex-base:1.9 netbsd-9-1-RELEASE:1.9 bouyer-xenpvh-base2:1.9 phil-wifi-20200421:1.9 bouyer-xenpvh-base1:1.9 phil-wifi-20200411:1.9 bouyer-xenpvh:1.9.0.66 bouyer-xenpvh-base:1.9 is-mlppp:1.9.0.64 is-mlppp-base:1.9 phil-wifi-20200406:1.9 netbsd-8-2-RELEASE:1.9 ad-namecache-base3:1.9 netbsd-9-0-RELEASE:1.9 netbsd-9-0-RC2:1.9 ad-namecache-base2:1.9 ad-namecache-base1:1.9 ad-namecache:1.9.0.62 ad-namecache-base:1.9 netbsd-9-0-RC1:1.9 phil-wifi-20191119:1.9 netbsd-9:1.9.0.60 netbsd-9-base:1.9 phil-wifi-20190609:1.9 netbsd-8-1-RELEASE:1.9 netbsd-8-1-RC1:1.9 isaki-audio2:1.9.0.58 isaki-audio2-base:1.9 pgoyette-compat-merge-20190127:1.9 pgoyette-compat-20190127:1.9 pgoyette-compat-20190118:1.9 pgoyette-compat-1226:1.9 pgoyette-compat-1126:1.9 pgoyette-compat-1020:1.9 pgoyette-compat-0930:1.9 pgoyette-compat-0906:1.9 netbsd-7-2-RELEASE:1.9 pgoyette-compat-0728:1.9 netbsd-8-0-RELEASE:1.9 phil-wifi:1.9.0.56 phil-wifi-base:1.9 pgoyette-compat-0625:1.9 netbsd-8-0-RC2:1.9 pgoyette-compat-0521:1.9 pgoyette-compat-0502:1.9 pgoyette-compat-0422:1.9 netbsd-8-0-RC1:1.9 pgoyette-compat-0415:1.9 pgoyette-compat-0407:1.9 pgoyette-compat-0330:1.9 pgoyette-compat-0322:1.9 pgoyette-compat-0315:1.9 netbsd-7-1-2-RELEASE:1.9 pgoyette-compat:1.9.0.54 pgoyette-compat-base:1.9 netbsd-7-1-1-RELEASE:1.9 tls-maxphys-base-20171202:1.9 matt-nb8-mediatek:1.9.0.52 matt-nb8-mediatek-base:1.9 nick-nhusb-base-20170825:1.9 perseant-stdc-iso10646:1.9.0.50 perseant-stdc-iso10646-base:1.9 netbsd-8:1.9.0.48 netbsd-8-base:1.9 prg-localcount2-base3:1.9 prg-localcount2-base2:1.9 prg-localcount2-base1:1.9 prg-localcount2:1.9.0.46 prg-localcount2-base:1.9 pgoyette-localcount-20170426:1.9 bouyer-socketcan-base1:1.9 jdolecek-ncq:1.9.0.44 jdolecek-ncq-base:1.9 pgoyette-localcount-20170320:1.9 netbsd-7-1:1.9.0.42 netbsd-7-1-RELEASE:1.9 netbsd-7-1-RC2:1.9 nick-nhusb-base-20170204:1.9 netbsd-7-nhusb-base-20170116:1.9 bouyer-socketcan:1.9.0.40 bouyer-socketcan-base:1.9 pgoyette-localcount-20170107:1.9 netbsd-7-1-RC1:1.9 nick-nhusb-base-20161204:1.9 pgoyette-localcount-20161104:1.9 netbsd-7-0-2-RELEASE:1.9 nick-nhusb-base-20161004:1.9 localcount-20160914:1.9 netbsd-7-nhusb:1.9.0.38 netbsd-7-nhusb-base:1.9 pgoyette-localcount-20160806:1.9 pgoyette-localcount-20160726:1.9 pgoyette-localcount:1.9.0.36 pgoyette-localcount-base:1.9 nick-nhusb-base-20160907:1.9 nick-nhusb-base-20160529:1.9 netbsd-7-0-1-RELEASE:1.9 nick-nhusb-base-20160422:1.9 nick-nhusb-base-20160319:1.9 nick-nhusb-base-20151226:1.9 netbsd-7-0:1.9.0.34 netbsd-7-0-RELEASE:1.9 nick-nhusb-base-20150921:1.9 netbsd-7-0-RC3:1.9 netbsd-7-0-RC2:1.9 netbsd-7-0-RC1:1.9 nick-nhusb-base-20150606:1.9 nick-nhusb-base-20150406:1.9 nick-nhusb:1.9.0.32 nick-nhusb-base:1.9 netbsd-5-2-3-RELEASE:1.5.10.1 netbsd-5-1-5-RELEASE:1.5.10.1 netbsd-6-0-6-RELEASE:1.9 netbsd-6-1-5-RELEASE:1.9 netbsd-7:1.9.0.30 netbsd-7-base:1.9 yamt-pagecache-base9:1.9 yamt-pagecache-tag8:1.9 netbsd-6-1-4-RELEASE:1.9 netbsd-6-0-5-RELEASE:1.9 tls-earlyentropy:1.9.0.28 tls-earlyentropy-base:1.9 riastradh-xf86-video-intel-2-7-1-pre-2-21-15:1.9 riastradh-drm2-base3:1.9 netbsd-6-1-3-RELEASE:1.9 netbsd-6-0-4-RELEASE:1.9 netbsd-5-2-2-RELEASE:1.5.10.1 netbsd-5-1-4-RELEASE:1.5.10.1 netbsd-6-1-2-RELEASE:1.9 netbsd-6-0-3-RELEASE:1.9 netbsd-5-2-1-RELEASE:1.5.10.1 netbsd-5-1-3-RELEASE:1.5.10.1 rmind-smpnet-nbase:1.9 netbsd-6-1-1-RELEASE:1.9 riastradh-drm2-base2:1.9 riastradh-drm2-base1:1.9 riastradh-drm2:1.9.0.26 riastradh-drm2-base:1.9 rmind-smpnet:1.9.0.18 rmind-smpnet-base:1.9 netbsd-6-1:1.9.0.24 netbsd-6-0-2-RELEASE:1.9 netbsd-6-1-RELEASE:1.9 khorben-n900:1.9.0.22 netbsd-6-1-RC4:1.9 netbsd-6-1-RC3:1.9 agc-symver:1.9.0.20 agc-symver-base:1.9 netbsd-6-1-RC2:1.9 netbsd-6-1-RC1:1.9 yamt-pagecache-base8:1.9 netbsd-5-2:1.5.10.1.0.6 netbsd-6-0-1-RELEASE:1.9 yamt-pagecache-base7:1.9 netbsd-5-2-RELEASE:1.5.10.1 netbsd-5-2-RC1:1.5.10.1 matt-nb6-plus-nbase:1.9 yamt-pagecache-base6:1.9 netbsd-6-0:1.9.0.16 netbsd-6-0-RELEASE:1.9 netbsd-6-0-RC2:1.9 tls-maxphys:1.9.0.14 tls-maxphys-base:1.9 matt-nb6-plus:1.9.0.12 matt-nb6-plus-base:1.9 netbsd-6-0-RC1:1.9 jmcneill-usbmp-base10:1.9 yamt-pagecache-base5:1.9 jmcneill-usbmp-base9:1.9 yamt-pagecache-base4:1.9 jmcneill-usbmp-base8:1.9 jmcneill-usbmp-base7:1.9 jmcneill-usbmp-base6:1.9 jmcneill-usbmp-base5:1.9 jmcneill-usbmp-base4:1.9 jmcneill-usbmp-base3:1.9 jmcneill-usbmp-pre-base2:1.9 jmcneill-usbmp-base2:1.9 netbsd-6:1.9.0.10 netbsd-6-base:1.9 netbsd-5-1-2-RELEASE:1.5.10.1 netbsd-5-1-1-RELEASE:1.5.10.1 jmcneill-usbmp:1.9.0.8 jmcneill-usbmp-base:1.9 jmcneill-audiomp3:1.9.0.6 jmcneill-audiomp3-base:1.9 yamt-pagecache-base3:1.9 yamt-pagecache-base2:1.9 yamt-pagecache:1.9.0.4 yamt-pagecache-base:1.9 rmind-uvmplock-nbase:1.9 cherry-xenmp:1.9.0.2 cherry-xenmp-base:1.9 bouyer-quota2-nbase:1.8 bouyer-quota2:1.6.0.8 bouyer-quota2-base:1.7 jruoho-x86intr:1.6.0.6 jruoho-x86intr-base:1.6 matt-mips64-premerge-20101231:1.6 matt-nb5-mips64-premerge-20101231:1.5 matt-nb5-pq3:1.5.10.1.0.4 matt-nb5-pq3-base:1.5.10.1 netbsd-5-1:1.5.10.1.0.2 netbsd-5-1-RELEASE:1.5.10.1 uebayasi-xip-base4:1.6 uebayasi-xip-base3:1.6 yamt-nfs-mp-base11:1.6 netbsd-5-1-RC4:1.5.10.1 matt-nb5-mips64-k15:1.5 uebayasi-xip-base2:1.6 yamt-nfs-mp-base10:1.6 netbsd-5-1-RC3:1.5.10.1 netbsd-5-1-RC2:1.5.10.1 uebayasi-xip-base1:1.6 netbsd-5-1-RC1:1.5.10.1 rmind-uvmplock:1.6.0.4 rmind-uvmplock-base:1.9 yamt-nfs-mp-base9:1.6 uebayasi-xip:1.6.0.2 uebayasi-xip-base:1.6 netbsd-5-0-2-RELEASE:1.5 matt-nb5-mips64-premerge-20091211:1.5 matt-premerge-20091211:1.6 yamt-nfs-mp-base8:1.6 matt-nb5-mips64-u2-k2-k4-k7-k8-k9:1.5 matt-nb4-mips64-k7-u2a-k9b:1.5 matt-nb5-mips64-u1-k1-k5:1.5 yamt-nfs-mp-base7:1.6 matt-nb5-mips64:1.5.0.18 netbsd-5-0-1-RELEASE:1.5 jymxensuspend-base:1.6 yamt-nfs-mp-base6:1.6 yamt-nfs-mp-base5:1.6 yamt-nfs-mp-base4:1.6 jym-xensuspend-nbase:1.6 yamt-nfs-mp-base3:1.6 nick-hppapmap-base4:1.6 nick-hppapmap-base3:1.6 netbsd-5-0:1.5.0.16 netbsd-5-0-RELEASE:1.5 netbsd-5-0-RC4:1.5 netbsd-5-0-RC3:1.5 nick-hppapmap-base2:1.5 netbsd-5-0-RC2:1.5 jym-xensuspend:1.5.0.14 jym-xensuspend-base:1.6 netbsd-5-0-RC1:1.5 haad-dm-base2:1.5 haad-nbase2:1.5 ad-audiomp2:1.5.0.12 ad-audiomp2-base:1.5 netbsd-5:1.5.0.10 netbsd-5-base:1.5 nick-hppapmap:1.5.0.8 nick-hppapmap-base:1.6 matt-mips64-base2:1.5 matt-mips64:1.3.0.76 haad-dm-base1:1.5 wrstuden-revivesa-base-4:1.5 netbsd-4-0-1-RELEASE:1.3 wrstuden-revivesa-base-3:1.5 wrstuden-revivesa-base-2:1.5 wrstuden-fixsa-newbase:1.3 nick-csl-alignment-base5:1.3 haad-dm:1.5.0.6 haad-dm-base:1.5 wrstuden-revivesa-base-1:1.5 simonb-wapbl-nbase:1.5 yamt-pf42-base4:1.5 simonb-wapbl:1.5.0.4 simonb-wapbl-base:1.5 yamt-pf42-base3:1.5 hpcarm-cleanup-nbase:1.5 yamt-pf42-baseX:1.3 yamt-pf42-base2:1.5 yamt-nfs-mp-base2:1.5 wrstuden-revivesa:1.5.0.2 wrstuden-revivesa-base:1.5 yamt-nfs-mp:1.3.0.74 yamt-nfs-mp-base:1.3 yamt-pf42:1.3.0.72 yamt-pf42-base:1.3 ad-socklock-base1:1.3 yamt-lazymbuf-base15:1.3 yamt-lazymbuf-base14:1.3 keiichi-mipv6-nbase:1.3 mjf-devfs2:1.3.0.70 mjf-devfs2-base:1.5 nick-net80211-sync:1.3.0.68 nick-net80211-sync-base:1.3 keiichi-mipv6:1.3.0.66 keiichi-mipv6-base:1.3 bouyer-xeni386-merge1:1.3 matt-armv6-prevmlocking:1.3 wrstuden-fixsa-base-1:1.3 vmlocking2-base3:1.3 netbsd-4-0:1.3.0.64 netbsd-4-0-RELEASE:1.3 bouyer-xeni386-nbase:1.3 yamt-kmem-base3:1.3 cube-autoconf:1.3.0.62 cube-autoconf-base:1.3 yamt-kmem-base2:1.3 bouyer-xeni386:1.3.0.60 bouyer-xeni386-base:1.3 yamt-kmem:1.3.0.58 yamt-kmem-base:1.3 vmlocking2-base2:1.3 reinoud-bufcleanup-nbase:1.3 vmlocking2:1.3.0.56 vmlocking2-base1:1.3 netbsd-4-0-RC5:1.3 matt-nb4-arm:1.3.0.54 matt-nb4-arm-base:1.3 matt-armv6-nbase:1.3 jmcneill-base:1.3 netbsd-4-0-RC4:1.3 mjf-devfs:1.3.0.52 mjf-devfs-base:1.3 bouyer-xenamd64-base2:1.3 vmlocking-nbase:1.3 yamt-x86pmap-base4:1.3 bouyer-xenamd64:1.3.0.50 bouyer-xenamd64-base:1.3 netbsd-4-0-RC3:1.3 yamt-x86pmap-base3:1.3 yamt-x86pmap-base2:1.3 netbsd-4-0-RC2:1.3 yamt-x86pmap:1.3.0.48 yamt-x86pmap-base:1.3 netbsd-4-0-RC1:1.3 matt-armv6:1.3.0.46 matt-armv6-base:1.3 matt-mips64-base:1.3 jmcneill-pm:1.3.0.44 jmcneill-pm-base:1.3 hpcarm-cleanup:1.3.0.42 hpcarm-cleanup-base:1.3 nick-csl-alignment:1.3.0.40 nick-csl-alignment-base:1.3 netbsd-3-1-1-RELEASE:1.2 netbsd-3-0-3-RELEASE:1.2 yamt-idlelwp-base8:1.3 wrstuden-fixsa:1.3.0.38 wrstuden-fixsa-base:1.3 thorpej-atomic:1.3.0.36 thorpej-atomic-base:1.3 reinoud-bufcleanup:1.3.0.34 reinoud-bufcleanup-base:1.3 mjf-ufs-trans:1.3.0.32 mjf-ufs-trans-base:1.3 vmlocking:1.3.0.30 vmlocking-base:1.3 ad-audiomp:1.3.0.28 ad-audiomp-base:1.3 yamt-idlelwp:1.3.0.26 post-newlock2-merge:1.3 newlock2-nbase:1.3 yamt-splraiseipl-base5:1.3 yamt-splraiseipl-base4:1.3 yamt-splraiseipl-base3:1.3 abandoned-netbsd-4-base:1.3 abandoned-netbsd-4:1.3.0.18 netbsd-3-1:1.2.0.14 netbsd-3-1-RELEASE:1.2 netbsd-3-0-2-RELEASE:1.2 yamt-splraiseipl-base2:1.3 netbsd-3-1-RC4:1.2 yamt-splraiseipl:1.3.0.22 yamt-splraiseipl-base:1.3 netbsd-3-1-RC3:1.2 yamt-pdpolicy-base9:1.3 newlock2:1.3.0.20 newlock2-base:1.3 yamt-pdpolicy-base8:1.3 netbsd-3-1-RC2:1.2 netbsd-3-1-RC1:1.2 yamt-pdpolicy-base7:1.3 netbsd-4:1.3.0.24 netbsd-4-base:1.3 yamt-pdpolicy-base6:1.3 chap-midi-nbase:1.3 netbsd-3-0-1-RELEASE:1.2 gdamore-uart:1.3.0.16 gdamore-uart-base:1.3 simonb-timcounters-final:1.3 yamt-pdpolicy-base5:1.3 chap-midi:1.3.0.14 chap-midi-base:1.3 yamt-pdpolicy-base4:1.3 yamt-pdpolicy-base3:1.3 peter-altq-base:1.3 peter-altq:1.3.0.12 yamt-pdpolicy-base2:1.3 elad-kernelauth-base:1.3 elad-kernelauth:1.3.0.10 yamt-pdpolicy:1.3.0.8 yamt-pdpolicy-base:1.3 yamt-uio_vmspace-base5:1.3 simonb-timecounters:1.3.0.6 simonb-timecounters-base:1.3 rpaulo-netinet-merge-pcb:1.3.0.4 rpaulo-netinet-merge-pcb-base:1.3 yamt-uio_vmspace:1.3.0.2 netbsd-3-0:1.2.0.12 netbsd-3-0-RELEASE:1.2 netbsd-3-0-RC6:1.2 yamt-readahead-base3:1.2 netbsd-3-0-RC5:1.2 netbsd-3-0-RC4:1.2 netbsd-3-0-RC3:1.2 yamt-readahead-base2:1.2 netbsd-3-0-RC2:1.2 yamt-readahead-pervnode:1.2 yamt-readahead-perfile:1.2 yamt-readahead:1.2.0.10 yamt-readahead-base:1.2 netbsd-3-0-RC1:1.2 yamt-vop-base3:1.2 netbsd-2-0-3-RELEASE:1.1 netbsd-2-1:1.1.0.16 yamt-vop-base2:1.2 thorpej-vnode-attr:1.2.0.8 thorpej-vnode-attr-base:1.2 netbsd-2-1-RELEASE:1.1 yamt-vop:1.2.0.6 yamt-vop-base:1.2 netbsd-2-1-RC6:1.1 netbsd-2-1-RC5:1.1 netbsd-2-1-RC4:1.1 netbsd-2-1-RC3:1.1 netbsd-2-1-RC2:1.1 netbsd-2-1-RC1:1.1 yamt-lazymbuf:1.2.0.4 yamt-km-base4:1.2 netbsd-2-0-2-RELEASE:1.1 yamt-km-base3:1.2 netbsd-3:1.2.0.2 netbsd-3-base:1.2 yamt-km-base2:1.1 yamt-km:1.1.0.12 yamt-km-base:1.1 kent-audio2:1.1.0.10 kent-audio2-base:1.2 netbsd-2-0-1-RELEASE:1.1 kent-audio1-beforemerge:1.1 netbsd-2:1.1.0.8 netbsd-2-base:1.1 kent-audio1:1.1.0.6 kent-audio1-base:1.1 netbsd-2-0-RELEASE:1.1 netbsd-2-0-RC5:1.1 netbsd-2-0-RC4:1.1 netbsd-2-0-RC3:1.1 netbsd-2-0-RC2:1.1 netbsd-2-0-RC1:1.1 ktrace-lwp-base:1.2 ktrace-lwp:1.1.0.4 netbsd-2-0:1.1.0.2 netbsd-2-0-base:1.1; locks; strict; comment @ * @; 1.9 date 2011.03.09.11.36.43; author drochner; state Exp; branches; next 1.8; 1.8 date 2011.02.24.20.03.41; author drochner; state Exp; branches; next 1.7; 1.7 date 2011.02.16.19.08.58; author drochner; state Exp; branches; next 1.6; 1.6 date 2009.03.25.01.26.13; author darran; state Exp; branches 1.6.4.1 1.6.6.1 1.6.8.1; next 1.5; 1.5 date 2008.05.05.13.41.30; author ad; state Exp; branches 1.5.8.1 1.5.10.1 1.5.14.1 1.5.18.1; next 1.4; 1.4 date 2008.05.04.23.07.09; author ad; state Exp; branches; next 1.3; 1.3 date 2005.12.11.12.25.20; author christos; state Exp; branches 1.3.74.1; next 1.2; 1.2 date 2005.02.26.22.39.52; author perry; state Exp; branches; next 1.1; 1.1 date 2003.07.25.21.12.46; author jonathan; state Exp; branches 1.1.4.1 1.1.10.1 1.1.12.1; next ; 1.6.4.1 date 2011.03.05.20.56.05; author rmind; state Exp; branches; next 1.6.4.2; 1.6.4.2 date 2011.04.21.01.42.16; author rmind; state Exp; branches; next ; 1.6.6.1 date 2011.06.06.09.10.04; author jruoho; state Exp; branches; next ; 1.6.8.1 date 2011.02.17.12.00.50; author bouyer; state Exp; branches; next 1.6.8.2; 1.6.8.2 date 2011.03.05.15.10.48; author bouyer; state Exp; branches; next ; 1.5.8.1 date 2009.04.28.07.37.50; author skrll; state Exp; branches; next ; 1.5.10.1 date 2009.05.03.17.24.45; author snj; state Exp; branches; next ; 1.5.14.1 date 2009.05.13.17.22.56; author jym; state Exp; branches; next ; 1.5.18.1 date 2011.05.20.08.11.32; author matt; state Exp; branches; next ; 1.3.74.1 date 2009.05.04.08.14.24; author yamt; state Exp; branches; next ; 1.1.4.1 date 2003.07.25.21.12.46; author skrll; state dead; branches; next 1.1.4.2; 1.1.4.2 date 2004.08.03.10.56.25; author skrll; state Exp; branches; next 1.1.4.3; 1.1.4.3 date 2004.09.18.14.56.20; author skrll; state Exp; branches; next 1.1.4.4; 1.1.4.4 date 2004.09.21.13.38.44; author skrll; state Exp; branches; next 1.1.4.5; 1.1.4.5 date 2005.03.04.16.54.22; author skrll; state Exp; branches; next ; 1.1.10.1 date 2005.04.29.11.29.37; author kent; state Exp; branches; next ; 1.1.12.1 date 2005.03.19.08.36.52; author yamt; state Exp; branches; next ; desc @@ 1.9 log @-start to make the GZIP code similar to DEFLATE: make error handling work the same way, grow output buffer exponentially and kill reallocation of metadata -minor cleanup, make definitions private which are implementation details of deflate.gzip @ text @/* $NetBSD: deflate.h,v 1.8 2011/02/24 20:03:41 drochner Exp $ */ /* $FreeBSD: src/sys/opencrypto/deflate.h,v 1.1.2.1 2002/11/21 23:34:23 sam Exp $ */ /* $OpenBSD: deflate.h,v 1.3 2002/03/14 01:26:51 millert Exp $ */ /* * Copyright (c) 2001 Jean-Jacques Bernard-Gundol (jj@@wabbitt.org) * * 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. The name of the author may not be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. */ /* * Definition for the wrapper around the deflate compression * algorithm used in /sys/crypto */ #ifndef _CRYPTO_DEFLATE_H_ #define _CRYPTO_DEFLATE_H_ #include #define Z_METHOD 8 #define Z_MEMLEVEL 8 #define MINCOMP 2 /* won't be used, but must be defined */ u_int32_t deflate_global(u_int8_t *, u_int32_t, int, u_int8_t **, int); u_int32_t gzip_global(u_int8_t *, u_int32_t, int, u_int8_t **, int); #endif /* _CRYPTO_DEFLATE_H_ */ @ 1.8 log @small modifications in dealing with the unknown result size of compression/ decompression: -seperate the IPCOMP specific rule that compression must not grow the data from general compression semantics: Introduce a special name CRYPTO_DEFLATE_COMP_NOGROW/comp_algo_deflate_nogrow to describe the IPCOMP semantics and use it there. (being here, fix the check so that equal size is considered failure as well as required by RFC2393) Customers of CRYPTO_DEFLATE_COMP/comp_algo_deflate now always get deflated data back, even if they are not smaller than the original. -allow to pass a "size hint" to the DEFLATE decompression function which is used for the initial buffer allocation. Due to the changes done there, additional allocations and extra copies are avoided if the initial allocation is sufficient. Set the size hint to MCLBYTES (=2k) in IPCOMP which should be good for many use cases. @ text @d1 1 a1 1 /* $NetBSD: deflate.h,v 1.7 2011/02/16 19:08:58 drochner Exp $ */ a44 1 #define ZBUF 10 a47 7 void *z_alloc(void *, u_int, u_int); void z_free(void *, void *); struct deflate_buf { u_int8_t *out; u_int32_t size; }; @ 1.7 log @-avoid allocation of an extra result buffer and data copy in case the DEFLATE complssion/decompression result is within a single buffer already -simplify bookkeeping of allocated buffers (and don't waste the last member of the metadata array) from Wolfgang Stukenbrock per PR kern/36865 (with some cleanup of error handling by me) The Gzip compression case can be improved too, but for now I've applied the buffer bookkeeping changes. tested with IP4 IPCOMP @ text @d1 1 a1 1 /* $NetBSD: deflate.h,v 1.6 2009/03/25 01:26:13 darran Exp $ */ d47 2 a48 2 u_int32_t deflate_global(u_int8_t *, u_int32_t, int, u_int8_t **); u_int32_t gzip_global(u_int8_t *, u_int32_t, int, u_int8_t **); @ 1.6 log @Fixes PR kern/41069 and PR kern/41070. Extends the Opencrypto API to allow the destination buffer size to be specified when its not the same size as the input buffer (i.e. for operations like compress and decompress). The crypto_op and crypt_n_op structures gain a u_int dst_len field. The session_op structure gains a comp_alg field to specify a compression algorithm. Moved four ioctls to new ids; CIOCGSESSION, CIOCNGSESSION, CIOCCRYPT, and CIOCNCRYPTM. Added four backward compatible ioctls; OCIOCGSESSION, OCIOCNGSESSION, OCIOCCRYPT, and OCIOCNCRYPTM. Backward compatibility is maintained in ocryptodev.h and ocryptodev.c which implement the original ioctls and set dst_len and comp_alg to 0. Adds user-space access to compression features. Adds software gzip support (CRYPTO_GZIP_COMP). Adds the fast version of crc32 from zlib to libkern. This should be generally useful and provide a place to start normalizing the various crc32 routines in the kernel. The crc32 routine is used in this patch to support GZIP. With input and support from tls@@NetBSD.org. @ text @d1 1 a1 1 /* $NetBSD: deflate.h,v 1.5 2008/05/05 13:41:30 ad Exp $ */ a54 1 int flag; @ 1.6.6.1 log @Sync with HEAD. @ text @d1 1 a1 1 /* $NetBSD: deflate.h,v 1.9 2011/03/09 11:36:43 drochner Exp $ */ d45 1 d47 10 a56 2 u_int32_t deflate_global(u_int8_t *, u_int32_t, int, u_int8_t **, int); u_int32_t gzip_global(u_int8_t *, u_int32_t, int, u_int8_t **, int); @ 1.6.4.1 log @sync with head @ text @d1 1 a1 1 /* $NetBSD$ */ d47 2 a48 2 u_int32_t deflate_global(u_int8_t *, u_int32_t, int, u_int8_t **, int); u_int32_t gzip_global(u_int8_t *, u_int32_t, int, u_int8_t **, int); d55 1 @ 1.6.4.2 log @sync with head @ text @d45 1 d49 7 @ 1.6.8.1 log @Sync with HEAD @ text @d1 1 a1 1 /* $NetBSD: deflate.h,v 1.7 2011/02/16 19:08:58 drochner Exp $ */ d55 1 @ 1.6.8.2 log @Sync with HEAD @ text @d1 1 a1 1 /* $NetBSD$ */ d47 2 a48 2 u_int32_t deflate_global(u_int8_t *, u_int32_t, int, u_int8_t **, int); u_int32_t gzip_global(u_int8_t *, u_int32_t, int, u_int8_t **, int); @ 1.5 log @Back out previous. It broke the build. @ text @d1 1 a1 1 /* $NetBSD: deflate.h,v 1.4 2008/05/04 23:07:09 ad Exp $ */ d48 1 @ 1.5.18.1 log @bring matt-nb5-mips64 up to date with netbsd-5-1-RELEASE (except compat). @ text @d1 1 a1 1 /* $NetBSD$ */ a47 1 u_int32_t gzip_global(u_int8_t *, u_int32_t, int, u_int8_t **); @ 1.5.14.1 log @Sync with HEAD. Commit is split, to avoid a "too many arguments" protocol error. @ text @d1 1 a1 1 /* $NetBSD: deflate.h,v 1.6 2009/03/25 01:26:13 darran Exp $ */ a47 1 u_int32_t gzip_global(u_int8_t *, u_int32_t, int, u_int8_t **); @ 1.5.10.1 log @Pull up following revision(s) (requested by tls in ticket #611): sys/lib/libkern/Makefile: patch sys/lib/libkern/crc32.c: revision 1.1 sys/lib/libkern/crc32.h: revision 1.1 sys/lib/libkern/libkern.h: revision 1.89 sys/lib/libkern/arch/i386/Makefile.inc: revision 1.28 sys/net/zlib.h: revision 1.14 via patch sys/opencrypto/crypto.c: revision 1.33 sys/opencrypto/cryptodev.c: revision 1.46 sys/opencrypto/cryptodev.h: revision 1.16 sys/opencrypto/cryptosoft.c: revision 1.24 sys/opencrypto/cryptosoft.h: revision 1.6 sys/opencrypto/deflate.h: revision 1.6 sys/opencrypto/cryptosoft_xform.c: revision 1.12 sys/opencrypto/deflate.c: revision 1.13 sys/opencrypto/files.opencrypto: revision 1.20 sys/opencrypto/ocryptodev.c: revision 1.1 sys/opencrypto/ocryptodev.h: revision 1.1 sys/opencrypto/xform.c: revision 1.18 sys/opencrypto/xform.h: revision 1.10 Fixes PR kern/41069 and PR kern/41070. Extends the Opencrypto API to allow the destination buffer size to be specified when its not the same size as the input buffer (i.e. for operations like compress and decompress). The crypto_op and crypt_n_op structures gain a u_int dst_len field. The session_op structure gains a comp_alg field to specify a compression algorithm. Moved four ioctls to new ids; CIOCGSESSION, CIOCNGSESSION, CIOCCRYPT, and CIOCNCRYPTM. Added four backward compatible ioctls; OCIOCGSESSION, OCIOCNGSESSION, OCIOCCRYPT, and OCIOCNCRYPTM. Backward compatibility is maintained in ocryptodev.h and ocryptodev.c which implement the original ioctls and set dst_len and comp_alg to 0. Adds user-space access to compression features. Adds software gzip support (CRYPTO_GZIP_COMP). Adds the fast version of crc32 from zlib to libkern. This should be generally useful and provide a place to start normalizing the various crc32 routines in the kernel. The crc32 routine is used in this patch to support GZIP. With input and support from tls@@NetBSD.org. @ text @d1 1 a1 1 /* $NetBSD: deflate.h,v 1.5 2008/05/05 13:41:30 ad Exp $ */ a47 1 u_int32_t gzip_global(u_int8_t *, u_int32_t, int, u_int8_t **); @ 1.5.8.1 log @Sync with HEAD. @ text @d1 1 a1 1 /* $NetBSD: deflate.h,v 1.6 2009/03/25 01:26:13 darran Exp $ */ a47 1 u_int32_t gzip_global(u_int8_t *, u_int32_t, int, u_int8_t **); @ 1.4 log @Move zlib out of net/ and into kern/. It would probably be better to use the reachover Makefiles and libz, but this is already here and it works. @ text @d1 1 a1 1 /* $NetBSD: deflate.h,v 1.3 2005/12/11 12:25:20 christos Exp $ */ d40 1 a40 1 #include @ 1.3 log @merge ktrace-lwp. @ text @d1 1 a1 1 /* $NetBSD: deflate.h,v 1.1.4.4 2005/03/04 16:54:22 skrll Exp $ */ d40 1 a40 1 #include @ 1.3.74.1 log @sync with head. @ text @d1 1 a1 1 /* $NetBSD: deflate.h,v 1.3 2005/12/11 12:25:20 christos Exp $ */ a47 1 u_int32_t gzip_global(u_int8_t *, u_int32_t, int, u_int8_t **); @ 1.2 log @nuke trailing whitespace @ text @d1 1 a1 1 /* $NetBSD: deflate.h,v 1.1 2003/07/25 21:12:46 jonathan Exp $ */ @ 1.1 log @Commit initial NetBSD port of the OpenCrypto Framework (OCF). This code is derived from Sam Leffler's FreeBSD port of OCF, which is in turn a port of Angelos Keromytis's OpenBSD work. Credit to Sam and Angelos, any blame for the NetBSD port to me. @ text @d1 1 a1 1 /* $NetBSD:$ */ d33 1 a33 1 * Definition for the wrapper around the deflate compression @ 1.1.4.1 log @file deflate.h was added on branch ktrace-lwp on 2004-08-03 10:56:25 +0000 @ text @d1 57 @ 1.1.4.2 log @Sync with HEAD @ text @a0 57 /* $NetBSD: deflate.h,v 1.1.4.1 2004/08/03 10:56:25 skrll Exp $ */ /* $FreeBSD: src/sys/opencrypto/deflate.h,v 1.1.2.1 2002/11/21 23:34:23 sam Exp $ */ /* $OpenBSD: deflate.h,v 1.3 2002/03/14 01:26:51 millert Exp $ */ /* * Copyright (c) 2001 Jean-Jacques Bernard-Gundol (jj@@wabbitt.org) * * 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. The name of the author may not be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. */ /* * Definition for the wrapper around the deflate compression * algorithm used in /sys/crypto */ #ifndef _CRYPTO_DEFLATE_H_ #define _CRYPTO_DEFLATE_H_ #include #define Z_METHOD 8 #define Z_MEMLEVEL 8 #define MINCOMP 2 /* won't be used, but must be defined */ #define ZBUF 10 u_int32_t deflate_global(u_int8_t *, u_int32_t, int, u_int8_t **); void *z_alloc(void *, u_int, u_int); void z_free(void *, void *); struct deflate_buf { u_int8_t *out; u_int32_t size; int flag; }; #endif /* _CRYPTO_DEFLATE_H_ */ @ 1.1.4.3 log @Sync with HEAD. @ text @d1 1 a1 1 /* $NetBSD: deflate.h,v 1.1.4.2 2004/09/18 14:56:20 skrll Exp $ */ @ 1.1.4.4 log @Fix the sync with head I botched. @ text @d1 1 a1 1 /* $NetBSD: deflate.h,v 1.1.4.3 2004/09/21 13:38:44 skrll Exp $ */ @ 1.1.4.5 log @Sync with HEAD. Hi Perry! @ text @d1 1 a1 1 /* $NetBSD: deflate.h,v 1.1.4.4 2005/03/04 16:54:22 skrll Exp $ */ d33 1 a33 1 * Definition for the wrapper around the deflate compression @ 1.1.10.1 log @sync with -current @ text @d1 1 a1 1 /* $NetBSD: deflate.h,v 1.2 2005/02/26 22:39:52 perry Exp $ */ d33 1 a33 1 * Definition for the wrapper around the deflate compression @ 1.1.12.1 log @sync with head. xen and whitespace. xen part is not finished. @ text @d1 1 a1 1 /* $NetBSD: deflate.h,v 1.1 2003/07/25 21:12:46 jonathan Exp $ */ d33 1 a33 1 * Definition for the wrapper around the deflate compression @