ldns-1.7.0/0000755000175000017500000000000013026206202012014 5ustar willemwillemldns-1.7.0/config.sub0000755000175000017500000010647713026206167014030 0ustar willemwillem#! /bin/sh # Configuration validation subroutine script. # Copyright 1992-2016 Free Software Foundation, Inc. timestamp='2016-03-30' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that # program. This Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # Please send patches to . # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS Canonicalize a configuration name. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.sub ($timestamp) Copyright 1992-2016 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" exit 1 ;; *local*) # First pass through any local machine types. echo $1 exit ;; * ) break ;; esac done case $# in 0) echo "$me: missing argument$help" >&2 exit 1;; 1) ;; *) echo "$me: too many arguments$help" >&2 exit 1;; esac # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \ kopensolaris*-gnu* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; android-linux) os=-linux-android basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown ;; *) basic_machine=`echo $1 | sed 's/-[^-]*$//'` if [ $basic_machine != $1 ] then os=`echo $1 | sed 's/.*-/-/'` else os=; fi ;; esac ### Let's recognize common machines as not being operating systems so ### that things like config.sub decstation-3100 work. We also ### recognize some manufacturers as not being operating systems, so we ### can provide default operating systems below. case $os in -sun*os*) # Prevent following clause from handling this invalid input. ;; -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ -apple | -axis | -knuth | -cray | -microblaze*) os= basic_machine=$1 ;; -bluegene*) os=-cnk ;; -sim | -cisco | -oki | -wec | -winbond) os= basic_machine=$1 ;; -scout) ;; -wrs) os=-vxworks basic_machine=$1 ;; -chorusos*) os=-chorusos basic_machine=$1 ;; -chorusrdb) os=-chorusrdb basic_machine=$1 ;; -hiux*) os=-hiuxwe2 ;; -sco6) os=-sco5v6 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5) os=-sco3.2v5 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco4) os=-sco3.2v4 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2.[4-9]*) os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2v[4-9]*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5v6*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco*) os=-sco3.2v2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -udk*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -isc) os=-isc2.2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -clix*) basic_machine=clipper-intergraph ;; -isc*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -lynx*178) os=-lynxos178 ;; -lynx*5) os=-lynxos5 ;; -lynx*) os=-lynxos ;; -ptx*) basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` ;; -windowsnt*) os=`echo $os | sed -e 's/windowsnt/winnt/'` ;; -psos*) os=-psos ;; -mint | -mint[0-9]*) basic_machine=m68k-atari os=-mint ;; esac # Decode aliases for certain CPU-COMPANY combinations. case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. 1750a | 580 \ | a29k \ | aarch64 | aarch64_be \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ | arc | arceb \ | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \ | avr | avr32 \ | ba \ | be32 | be64 \ | bfin \ | c4x | c8051 | clipper \ | d10v | d30v | dlx | dsp16xx \ | e2k | epiphany \ | fido | fr30 | frv | ft32 \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | hexagon \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ | k1om \ | le32 | le64 \ | lm32 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ | maxq | mb | microblaze | microblazeel | mcore | mep | metag \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ | mips64octeon | mips64octeonel \ | mips64orion | mips64orionel \ | mips64r5900 | mips64r5900el \ | mips64vr | mips64vrel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa32r6 | mipsisa32r6el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ | mipsisa64r6 | mipsisa64r6el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipsr5900 | mipsr5900el \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | moxie \ | mt \ | msp430 \ | nds32 | nds32le | nds32be \ | nios | nios2 | nios2eb | nios2el \ | ns16k | ns32k \ | open8 | or1k | or1knd | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle \ | pyramid \ | riscv32 | riscv64 \ | rl78 | rx \ | score \ | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[234]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ | spu \ | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ | ubicom32 \ | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ | visium \ | we32k \ | x86 | xc16x | xstormy16 | xtensa \ | z8k | z80) basic_machine=$basic_machine-unknown ;; c54x) basic_machine=tic54x-unknown ;; c55x) basic_machine=tic55x-unknown ;; c6x) basic_machine=tic6x-unknown ;; leon|leon[3-9]) basic_machine=sparc-$basic_machine ;; m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip) basic_machine=$basic_machine-unknown os=-none ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; ms1) basic_machine=mt-unknown ;; strongarm | thumb | xscale) basic_machine=arm-unknown ;; xgate) basic_machine=$basic_machine-unknown os=-none ;; xscaleeb) basic_machine=armeb-unknown ;; xscaleel) basic_machine=armel-unknown ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. i*86 | x86_64) basic_machine=$basic_machine-pc ;; # Object if more than one company name word. *-*-*) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ | aarch64-* | aarch64_be-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ | ba-* \ | be32-* | be64-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* \ | c8051-* | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | e2k-* | elxsi-* \ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | hexagon-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ | k1om-* \ | le32-* | le64-* \ | lm32-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ | microblaze-* | microblazeel-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ | mips64octeon-* | mips64octeonel-* \ | mips64orion-* | mips64orionel-* \ | mips64r5900-* | mips64r5900el-* \ | mips64vr-* | mips64vrel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ | mips64vr5900-* | mips64vr5900el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa32r6-* | mipsisa32r6el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64r6-* | mipsisa64r6el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipsr5900-* | mipsr5900el-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ | mt-* \ | msp430-* \ | nds32-* | nds32le-* | nds32be-* \ | nios-* | nios2-* | nios2eb-* | nios2el-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | open8-* \ | or1k*-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ | pyramid-* \ | riscv32-* | riscv64-* \ | rl78-* | romp-* | rs6000-* | rx-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx*-* \ | tahoe-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tile*-* \ | tron-* \ | ubicom32-* \ | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ | vax-* \ | visium-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* \ | xstormy16-* | xtensa*-* \ | ymp-* \ | z8k-* | z80-*) ;; # Recognize the basic CPU types without company name, with glob match. xtensa*) basic_machine=$basic_machine-unknown ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) basic_machine=i386-unknown os=-bsd ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) basic_machine=m68000-att ;; 3b*) basic_machine=we32k-att ;; a29khif) basic_machine=a29k-amd os=-udi ;; abacus) basic_machine=abacus-unknown ;; adobe68k) basic_machine=m68010-adobe os=-scout ;; alliant | fx80) basic_machine=fx80-alliant ;; altos | altos3068) basic_machine=m68k-altos ;; am29k) basic_machine=a29k-none os=-bsd ;; amd64) basic_machine=x86_64-pc ;; amd64-*) basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; amdahl) basic_machine=580-amdahl os=-sysv ;; amiga | amiga-*) basic_machine=m68k-unknown ;; amigaos | amigados) basic_machine=m68k-unknown os=-amigaos ;; amigaunix | amix) basic_machine=m68k-unknown os=-sysv4 ;; apollo68) basic_machine=m68k-apollo os=-sysv ;; apollo68bsd) basic_machine=m68k-apollo os=-bsd ;; aros) basic_machine=i386-pc os=-aros ;; asmjs) basic_machine=asmjs-unknown ;; aux) basic_machine=m68k-apple os=-aux ;; balance) basic_machine=ns32k-sequent os=-dynix ;; blackfin) basic_machine=bfin-unknown os=-linux ;; blackfin-*) basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; bluegene*) basic_machine=powerpc-ibm os=-cnk ;; c54x-*) basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c55x-*) basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c6x-*) basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c90) basic_machine=c90-cray os=-unicos ;; cegcc) basic_machine=arm-unknown os=-cegcc ;; convex-c1) basic_machine=c1-convex os=-bsd ;; convex-c2) basic_machine=c2-convex os=-bsd ;; convex-c32) basic_machine=c32-convex os=-bsd ;; convex-c34) basic_machine=c34-convex os=-bsd ;; convex-c38) basic_machine=c38-convex os=-bsd ;; cray | j90) basic_machine=j90-cray os=-unicos ;; craynv) basic_machine=craynv-cray os=-unicosmp ;; cr16 | cr16-*) basic_machine=cr16-unknown os=-elf ;; crds | unos) basic_machine=m68k-crds ;; crisv32 | crisv32-* | etraxfs*) basic_machine=crisv32-axis ;; cris | cris-* | etrax*) basic_machine=cris-axis ;; crx) basic_machine=crx-unknown os=-elf ;; da30 | da30-*) basic_machine=m68k-da30 ;; decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) basic_machine=mips-dec ;; decsystem10* | dec10*) basic_machine=pdp10-dec os=-tops10 ;; decsystem20* | dec20*) basic_machine=pdp10-dec os=-tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) basic_machine=m68k-motorola ;; delta88) basic_machine=m88k-motorola os=-sysv3 ;; dicos) basic_machine=i686-pc os=-dicos ;; djgpp) basic_machine=i586-pc os=-msdosdjgpp ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=-bosx ;; dpx2* | dpx2*-bull) basic_machine=m68k-bull os=-sysv3 ;; ebmon29k) basic_machine=a29k-amd os=-ebmon ;; elxsi) basic_machine=elxsi-elxsi os=-bsd ;; encore | umax | mmax) basic_machine=ns32k-encore ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson os=-ose ;; fx2800) basic_machine=i860-alliant ;; genix) basic_machine=ns32k-ns ;; gmicro) basic_machine=tron-gmicro os=-sysv ;; go32) basic_machine=i386-pc os=-go32 ;; h3050r* | hiux*) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; h8300hms) basic_machine=h8300-hitachi os=-hms ;; h8300xray) basic_machine=h8300-hitachi os=-xray ;; h8500hms) basic_machine=h8500-hitachi os=-hms ;; harris) basic_machine=m88k-harris os=-sysv3 ;; hp300-*) basic_machine=m68k-hp ;; hp300bsd) basic_machine=m68k-hp os=-bsd ;; hp300hpux) basic_machine=m68k-hp os=-hpux ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) basic_machine=m68000-hp ;; hp9k3[2-9][0-9]) basic_machine=m68k-hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) basic_machine=hppa1.1-hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) basic_machine=hppa1.1-hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) basic_machine=hppa1.0-hp ;; hppa-next) os=-nextstep3 ;; hppaosf) basic_machine=hppa1.1-hp os=-osf ;; hppro) basic_machine=hppa1.1-hp os=-proelf ;; i370-ibm* | ibm*) basic_machine=i370-ibm ;; i*86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; i*86v4*) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; i*86v) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv ;; i*86sol2) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; i386mach) basic_machine=i386-mach os=-mach ;; i386-vsta | vsta) basic_machine=i386-unknown os=-vsta ;; iris | iris4d) basic_machine=mips-sgi case $os in -irix*) ;; *) os=-irix4 ;; esac ;; isi68 | isi) basic_machine=m68k-isi os=-sysv ;; leon-*|leon[3-9]-*) basic_machine=sparc-`echo $basic_machine | sed 's/-.*//'` ;; m68knommu) basic_machine=m68k-unknown os=-linux ;; m68knommu-*) basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; m88k-omron*) basic_machine=m88k-omron ;; magnum | m3230) basic_machine=mips-mips os=-sysv ;; merlin) basic_machine=ns32k-utek os=-sysv ;; microblaze*) basic_machine=microblaze-xilinx ;; mingw64) basic_machine=x86_64-pc os=-mingw64 ;; mingw32) basic_machine=i686-pc os=-mingw32 ;; mingw32ce) basic_machine=arm-unknown os=-mingw32ce ;; miniframe) basic_machine=m68000-convergent ;; *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) basic_machine=m68k-atari os=-mint ;; mips3*-*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` ;; mips3*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown ;; monitor) basic_machine=m68k-rom68k os=-coff ;; morphos) basic_machine=powerpc-unknown os=-morphos ;; moxiebox) basic_machine=moxie-unknown os=-moxiebox ;; msdos) basic_machine=i386-pc os=-msdos ;; ms1-*) basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` ;; msys) basic_machine=i686-pc os=-msys ;; mvs) basic_machine=i370-ibm os=-mvs ;; nacl) basic_machine=le32-unknown os=-nacl ;; ncr3000) basic_machine=i486-ncr os=-sysv4 ;; netbsd386) basic_machine=i386-unknown os=-netbsd ;; netwinder) basic_machine=armv4l-rebel os=-linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony os=-newsos ;; news1000) basic_machine=m68030-sony os=-newsos ;; news-3600 | risc-news) basic_machine=mips-sony os=-newsos ;; necv70) basic_machine=v70-nec os=-sysv ;; next | m*-next ) basic_machine=m68k-next case $os in -nextstep* ) ;; -ns2*) os=-nextstep2 ;; *) os=-nextstep3 ;; esac ;; nh3000) basic_machine=m68k-harris os=-cxux ;; nh[45]000) basic_machine=m88k-harris os=-cxux ;; nindy960) basic_machine=i960-intel os=-nindy ;; mon960) basic_machine=i960-intel os=-mon960 ;; nonstopux) basic_machine=mips-compaq os=-nonstopux ;; np1) basic_machine=np1-gould ;; neo-tandem) basic_machine=neo-tandem ;; nse-tandem) basic_machine=nse-tandem ;; nsr-tandem) basic_machine=nsr-tandem ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf ;; openrisc | openrisc-*) basic_machine=or32-unknown ;; os400) basic_machine=powerpc-ibm os=-os400 ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=-ose ;; os68k) basic_machine=m68k-none os=-os68k ;; pa-hitachi) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; paragon) basic_machine=i860-intel os=-osf ;; parisc) basic_machine=hppa-unknown os=-linux ;; parisc-*) basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; pbd) basic_machine=sparc-tti ;; pbb) basic_machine=m68k-tti ;; pc532 | pc532-*) basic_machine=ns32k-pc532 ;; pc98) basic_machine=i386-pc ;; pc98-*) basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc ;; pentiumpro | p6 | 6x86 | athlon | athlon_*) basic_machine=i686-pc ;; pentiumii | pentium2 | pentiumiii | pentium3) basic_machine=i686-pc ;; pentium4) basic_machine=i786-pc ;; pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium4-*) basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould ;; power) basic_machine=power-ibm ;; ppc | ppcbe) basic_machine=powerpc-unknown ;; ppc-* | ppcbe-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle | ppc-le | powerpc-little) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64) basic_machine=powerpc64-unknown ;; ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64le | powerpc64little | ppc64-le | powerpc64-little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm ;; pw32) basic_machine=i586-unknown os=-pw32 ;; rdos | rdos64) basic_machine=x86_64-pc os=-rdos ;; rdos32) basic_machine=i386-pc os=-rdos ;; rom68k) basic_machine=m68k-rom68k os=-coff ;; rm[46]00) basic_machine=mips-siemens ;; rtpc | rtpc-*) basic_machine=romp-ibm ;; s390 | s390-*) basic_machine=s390-ibm ;; s390x | s390x-*) basic_machine=s390x-ibm ;; sa29200) basic_machine=a29k-amd os=-udi ;; sb1) basic_machine=mipsisa64sb1-unknown ;; sb1el) basic_machine=mipsisa64sb1el-unknown ;; sde) basic_machine=mipsisa32-sde os=-elf ;; sei) basic_machine=mips-sei os=-seiux ;; sequent) basic_machine=i386-sequent ;; sh) basic_machine=sh-hitachi os=-hms ;; sh5el) basic_machine=sh5le-unknown ;; sh64) basic_machine=sh64-unknown ;; sparclite-wrs | simso-wrs) basic_machine=sparclite-wrs os=-vxworks ;; sps7) basic_machine=m68k-bull os=-sysv2 ;; spur) basic_machine=spur-unknown ;; st2000) basic_machine=m68k-tandem ;; stratus) basic_machine=i860-stratus os=-sysv4 ;; strongarm-* | thumb-*) basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'` ;; sun2) basic_machine=m68000-sun ;; sun2os3) basic_machine=m68000-sun os=-sunos3 ;; sun2os4) basic_machine=m68000-sun os=-sunos4 ;; sun3os3) basic_machine=m68k-sun os=-sunos3 ;; sun3os4) basic_machine=m68k-sun os=-sunos4 ;; sun4os3) basic_machine=sparc-sun os=-sunos3 ;; sun4os4) basic_machine=sparc-sun os=-sunos4 ;; sun4sol2) basic_machine=sparc-sun os=-solaris2 ;; sun3 | sun3-*) basic_machine=m68k-sun ;; sun4) basic_machine=sparc-sun ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; sv1) basic_machine=sv1-cray os=-unicos ;; symmetry) basic_machine=i386-sequent os=-dynix ;; t3e) basic_machine=alphaev5-cray os=-unicos ;; t90) basic_machine=t90-cray os=-unicos ;; tile*) basic_machine=$basic_machine-unknown os=-linux-gnu ;; tx39) basic_machine=mipstx39-unknown ;; tx39el) basic_machine=mipstx39el-unknown ;; toad1) basic_machine=pdp10-xkl os=-tops20 ;; tower | tower-32) basic_machine=m68k-ncr ;; tpf) basic_machine=s390x-ibm os=-tpf ;; udi29k) basic_machine=a29k-amd os=-udi ;; ultra3) basic_machine=a29k-nyu os=-sym1 ;; v810 | necv810) basic_machine=v810-nec os=-none ;; vaxv) basic_machine=vax-dec os=-sysv ;; vms) basic_machine=vax-dec os=-vms ;; vpp*|vx|vx-*) basic_machine=f301-fujitsu ;; vxworks960) basic_machine=i960-wrs os=-vxworks ;; vxworks68) basic_machine=m68k-wrs os=-vxworks ;; vxworks29k) basic_machine=a29k-wrs os=-vxworks ;; w65*) basic_machine=w65-wdc os=-none ;; w89k-*) basic_machine=hppa1.1-winbond os=-proelf ;; xbox) basic_machine=i686-pc os=-mingw32 ;; xps | xps100) basic_machine=xps100-honeywell ;; xscale-* | xscalee[bl]-*) basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'` ;; ymp) basic_machine=ymp-cray os=-unicos ;; z8k-*-coff) basic_machine=z8k-unknown os=-sim ;; z80-*-coff) basic_machine=z80-unknown os=-sim ;; none) basic_machine=none-none os=-none ;; # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. w89k) basic_machine=hppa1.1-winbond ;; op50n) basic_machine=hppa1.1-oki ;; op60c) basic_machine=hppa1.1-oki ;; romp) basic_machine=romp-ibm ;; mmix) basic_machine=mmix-knuth ;; rs6000) basic_machine=rs6000-ibm ;; vax) basic_machine=vax-dec ;; pdp10) # there are many clones, so DEC is not a safe bet basic_machine=pdp10-unknown ;; pdp11) basic_machine=pdp11-dec ;; we32k) basic_machine=we32k-att ;; sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) basic_machine=sparc-sun ;; cydra) basic_machine=cydra-cydrome ;; orion) basic_machine=orion-highlevel ;; orion105) basic_machine=clipper-highlevel ;; mac | mpw | mac-mpw) basic_machine=m68k-apple ;; pmac | pmac-mpw) basic_machine=powerpc-apple ;; *-unknown) # Make sure to match an already-canonicalized machine name. ;; *) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; esac # Here we canonicalize certain aliases for manufacturers. case $basic_machine in *-digital*) basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` ;; *-commodore*) basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if [ x"$os" != x"" ] then case $os in # First match some system type aliases # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. -auroraux) os=-auroraux ;; -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; -solaris) os=-solaris2 ;; -svr4*) os=-sysv4 ;; -unixware*) os=-sysv4.2uw ;; -gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; # First accept the basic system types. # The portable systems comes first. # Each alternative MUST END IN A *, to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ | -sym* | -kopensolaris* | -plan9* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* | -aros* | -cloudabi* | -sortix* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ | -bitrig* | -openbsd* | -solidbsd* | -libertybsd* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* | -cegcc* \ | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ | -linux-newlib* | -linux-musl* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* \ | -onefs* | -tirtos*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) case $basic_machine in x86-* | i*86-*) ;; *) os=-nto$os ;; esac ;; -nto-qnx*) ;; -nto*) os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) os=`echo $os | sed -e 's|mac|macos|'` ;; -linux-dietlibc) os=-linux-dietlibc ;; -linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; -sunos5*) os=`echo $os | sed -e 's|sunos5|solaris2|'` ;; -sunos6*) os=`echo $os | sed -e 's|sunos6|solaris3|'` ;; -opened*) os=-openedition ;; -os400*) os=-os400 ;; -wince*) os=-wince ;; -osfrose*) os=-osfrose ;; -osf*) os=-osf ;; -utek*) os=-bsd ;; -dynix*) os=-bsd ;; -acis*) os=-aos ;; -atheos*) os=-atheos ;; -syllable*) os=-syllable ;; -386bsd) os=-bsd ;; -ctix* | -uts*) os=-sysv ;; -nova*) os=-rtmk-nova ;; -ns2 ) os=-nextstep2 ;; -nsk*) os=-nsk ;; # Preserve the version number of sinix5. -sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` ;; -sinix*) os=-sysv4 ;; -tpf*) os=-tpf ;; -triton*) os=-sysv3 ;; -oss*) os=-sysv3 ;; -svr4) os=-sysv4 ;; -svr3) os=-sysv3 ;; -sysvr4) os=-sysv4 ;; # This must come after -sysvr4. -sysv*) ;; -ose*) os=-ose ;; -es1800*) os=-ose ;; -xenix) os=-xenix ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) os=-mint ;; -aros*) os=-aros ;; -zvmoe) os=-zvmoe ;; -dicos*) os=-dicos ;; -nacl*) ;; -ios) ;; -none) ;; *) # Get rid of the `-' at the beginning of $os. os=`echo $os | sed 's/[^-]*-//'` echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 exit 1 ;; esac else # Here we handle the default operating systems that come with various machines. # The value should be what the vendor currently ships out the door with their # machine or put another way, the most popular os provided with the machine. # Note that if you're going to try to match "-MANUFACTURER" here (say, # "-sun"), then you have to tell the case statement up towards the top # that MANUFACTURER isn't an operating system. Otherwise, code above # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. case $basic_machine in score-*) os=-elf ;; spu-*) os=-elf ;; *-acorn) os=-riscix1.2 ;; arm*-rebel) os=-linux ;; arm*-semi) os=-aout ;; c4x-* | tic4x-*) os=-coff ;; c8051-*) os=-elf ;; hexagon-*) os=-elf ;; tic54x-*) os=-coff ;; tic55x-*) os=-coff ;; tic6x-*) os=-coff ;; # This must come before the *-dec entry. pdp10-*) os=-tops20 ;; pdp11-*) os=-none ;; *-dec | vax-*) os=-ultrix4.2 ;; m68*-apollo) os=-domain ;; i386-sun) os=-sunos4.0.2 ;; m68000-sun) os=-sunos3 ;; m68*-cisco) os=-aout ;; mep-*) os=-elf ;; mips*-cisco) os=-elf ;; mips*-*) os=-elf ;; or32-*) os=-coff ;; *-tti) # must be before sparc entry or we get the wrong os. os=-sysv3 ;; sparc-* | *-sun) os=-sunos4.1.1 ;; *-be) os=-beos ;; *-haiku) os=-haiku ;; *-ibm) os=-aix ;; *-knuth) os=-mmixware ;; *-wec) os=-proelf ;; *-winbond) os=-proelf ;; *-oki) os=-proelf ;; *-hp) os=-hpux ;; *-hitachi) os=-hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) os=-sysv ;; *-cbm) os=-amigaos ;; *-dg) os=-dgux ;; *-dolphin) os=-sysv3 ;; m68k-ccur) os=-rtu ;; m88k-omron*) os=-luna ;; *-next ) os=-nextstep ;; *-sequent) os=-ptx ;; *-crds) os=-unos ;; *-ns) os=-genix ;; i370-*) os=-mvs ;; *-next) os=-nextstep3 ;; *-gould) os=-sysv ;; *-highlevel) os=-bsd ;; *-encore) os=-bsd ;; *-sgi) os=-irix ;; *-siemens) os=-sysv4 ;; *-masscomp) os=-rtu ;; f30[01]-fujitsu | f700-fujitsu) os=-uxpv ;; *-rom68k) os=-coff ;; *-*bug) os=-coff ;; *-apple) os=-macos ;; *-atari*) os=-mint ;; *) os=-none ;; esac fi # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. vendor=unknown case $basic_machine in *-unknown) case $os in -riscix*) vendor=acorn ;; -sunos*) vendor=sun ;; -cnk*|-aix*) vendor=ibm ;; -beos*) vendor=be ;; -hpux*) vendor=hp ;; -mpeix*) vendor=hp ;; -hiux*) vendor=hitachi ;; -unos*) vendor=crds ;; -dgux*) vendor=dg ;; -luna*) vendor=omron ;; -genix*) vendor=ns ;; -mvs* | -opened*) vendor=ibm ;; -os400*) vendor=ibm ;; -ptx*) vendor=sequent ;; -tpf*) vendor=ibm ;; -vxsim* | -vxworks* | -windiss*) vendor=wrs ;; -aux*) vendor=apple ;; -hms*) vendor=hitachi ;; -mpw* | -macos*) vendor=apple ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) vendor=atari ;; -vos*) vendor=stratus ;; esac basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; esac echo $basic_machine$os exit # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: ldns-1.7.0/net.c0000644000175000017500000005631213026206166012766 0ustar willemwillem/* * net.c * * Network implementation * All network related functions are grouped here * * a Net::DNS like library for C * * (c) NLnet Labs, 2004-2006 * * See the file LICENSE for the license */ #include #include #ifdef HAVE_NETINET_IN_H #include #endif #ifdef HAVE_SYS_SOCKET_H #include #endif #ifdef HAVE_NETDB_H #include #endif #ifdef HAVE_ARPA_INET_H #include #endif #include #include #include #ifdef HAVE_POLL #include #endif ldns_status ldns_send(ldns_pkt **result_packet, ldns_resolver *r, const ldns_pkt *query_pkt) { ldns_buffer *qb; ldns_status result; ldns_rdf *tsig_mac = NULL; qb = ldns_buffer_new(LDNS_MIN_BUFLEN); if (query_pkt && ldns_pkt_tsig(query_pkt)) { tsig_mac = ldns_rr_rdf(ldns_pkt_tsig(query_pkt), 3); } if (!query_pkt || ldns_pkt2buffer_wire(qb, query_pkt) != LDNS_STATUS_OK) { result = LDNS_STATUS_ERR; } else { result = ldns_send_buffer(result_packet, r, qb, tsig_mac); } ldns_buffer_free(qb); return result; } /* code from rdata.c */ static struct sockaddr_storage * ldns_rdf2native_sockaddr_storage_port( const ldns_rdf *rd, uint16_t port, size_t *size) { struct sockaddr_storage *data; struct sockaddr_in *data_in; struct sockaddr_in6 *data_in6; data = LDNS_MALLOC(struct sockaddr_storage); if (!data) { return NULL; } /* zero the structure for portability */ memset(data, 0, sizeof(struct sockaddr_storage)); switch(ldns_rdf_get_type(rd)) { case LDNS_RDF_TYPE_A: #ifndef S_SPLINT_S data->ss_family = AF_INET; #endif data_in = (struct sockaddr_in*) data; data_in->sin_port = (in_port_t)htons(port); memcpy(&(data_in->sin_addr), ldns_rdf_data(rd), ldns_rdf_size(rd)); *size = sizeof(struct sockaddr_in); return data; case LDNS_RDF_TYPE_AAAA: #ifndef S_SPLINT_S data->ss_family = AF_INET6; #endif data_in6 = (struct sockaddr_in6*) data; data_in6->sin6_port = (in_port_t)htons(port); memcpy(&data_in6->sin6_addr, ldns_rdf_data(rd), ldns_rdf_size(rd)); *size = sizeof(struct sockaddr_in6); return data; default: LDNS_FREE(data); return NULL; } } struct sockaddr_storage * ldns_rdf2native_sockaddr_storage( const ldns_rdf *rd, uint16_t port, size_t *size) { return ldns_rdf2native_sockaddr_storage_port( rd, (port == 0 ? (uint16_t)LDNS_PORT : port), size); } /** best effort to set nonblocking */ static void ldns_sock_nonblock(int sockfd) { #ifdef HAVE_FCNTL int flag; if((flag = fcntl(sockfd, F_GETFL)) != -1) { flag |= O_NONBLOCK; if(fcntl(sockfd, F_SETFL, flag) == -1) { /* ignore error, continue blockingly */ } } #elif defined(HAVE_IOCTLSOCKET) unsigned long on = 1; if(ioctlsocket(sockfd, FIONBIO, &on) != 0) { /* ignore error, continue blockingly */ } #endif } /** best effort to set blocking */ static void ldns_sock_block(int sockfd) { #ifdef HAVE_FCNTL int flag; if((flag = fcntl(sockfd, F_GETFL)) != -1) { flag &= ~O_NONBLOCK; if(fcntl(sockfd, F_SETFL, flag) == -1) { /* ignore error, continue */ } } #elif defined(HAVE_IOCTLSOCKET) unsigned long off = 0; if(ioctlsocket(sockfd, FIONBIO, &off) != 0) { /* ignore error, continue */ } #endif } /** wait for a socket to become ready */ static int ldns_sock_wait(int sockfd, struct timeval timeout, int write) { int ret; #ifndef HAVE_POLL #ifndef S_SPLINT_S fd_set fds; FD_ZERO(&fds); FD_SET(FD_SET_T sockfd, &fds); if(write) ret = select(sockfd+1, NULL, &fds, NULL, &timeout); else ret = select(sockfd+1, &fds, NULL, NULL, &timeout); #endif #else struct pollfd pfds[2]; memset(&pfds[0], 0, sizeof(pfds[0]) * 2); pfds[0].fd = sockfd; pfds[0].events = POLLIN|POLLERR; if (write) { pfds[0].events |= POLLOUT; } ret = poll(pfds, 1, (int)(timeout.tv_sec * 1000 + timeout.tv_usec / 1000)); #endif if(ret == 0) /* timeout expired */ return 0; else if(ret == -1) /* error */ return 0; return 1; } static int ldns_tcp_connect_from(const struct sockaddr_storage *to, socklen_t tolen, const struct sockaddr_storage *from, socklen_t fromlen, struct timeval timeout) { int sockfd; #ifndef S_SPLINT_S if ((sockfd = socket((int)((struct sockaddr*)to)->sa_family, SOCK_STREAM, IPPROTO_TCP)) == SOCK_INVALID) { return 0; } #endif if (from && bind(sockfd, (const struct sockaddr*)from, fromlen) == SOCK_INVALID){ return 0; } /* perform nonblocking connect, to be able to wait with select() */ ldns_sock_nonblock(sockfd); if (connect(sockfd, (struct sockaddr*)to, tolen) == SOCK_INVALID) { #ifndef USE_WINSOCK #ifdef EINPROGRESS if(errno != EINPROGRESS) { #else if(1) { #endif close_socket(sockfd); return 0; } #else /* USE_WINSOCK */ if(WSAGetLastError() != WSAEINPROGRESS && WSAGetLastError() != WSAEWOULDBLOCK) { close_socket(sockfd); return 0; } #endif /* error was only telling us that it would block */ } /* wait(write) until connected or error */ while(1) { int error = 0; socklen_t len = (socklen_t)sizeof(error); if(!ldns_sock_wait(sockfd, timeout, 1)) { close_socket(sockfd); return 0; } /* check if there is a pending error for nonblocking connect */ if(getsockopt(sockfd, SOL_SOCKET, SO_ERROR, (void*)&error, &len) < 0) { #ifndef USE_WINSOCK error = errno; /* on solaris errno is error */ #else error = WSAGetLastError(); #endif } #ifndef USE_WINSOCK #if defined(EINPROGRESS) && defined(EWOULDBLOCK) if(error == EINPROGRESS || error == EWOULDBLOCK) continue; /* try again */ #endif else if(error != 0) { close_socket(sockfd); /* error in errno for our user */ errno = error; return 0; } #else /* USE_WINSOCK */ if(error == WSAEINPROGRESS) continue; else if(error == WSAEWOULDBLOCK) continue; else if(error != 0) { close_socket(sockfd); errno = error; return 0; } #endif /* USE_WINSOCK */ /* connected */ break; } /* set the socket blocking again */ ldns_sock_block(sockfd); return sockfd; } int ldns_tcp_connect(const struct sockaddr_storage *to, socklen_t tolen, struct timeval timeout) { return ldns_tcp_connect_from(to, tolen, NULL, 0, timeout); } static int ldns_tcp_bgsend_from(ldns_buffer *qbin, const struct sockaddr_storage *to, socklen_t tolen, const struct sockaddr_storage *from, socklen_t fromlen, struct timeval timeout) { int sockfd; sockfd = ldns_tcp_connect_from(to, tolen, from, fromlen, timeout); if (sockfd == 0) { return 0; } if (ldns_tcp_send_query(qbin, sockfd, to, tolen) == 0) { close_socket(sockfd); return 0; } return sockfd; } int ldns_tcp_bgsend(ldns_buffer *qbin, const struct sockaddr_storage *to, socklen_t tolen, struct timeval timeout) { return ldns_tcp_bgsend_from(qbin, to, tolen, NULL, 0, timeout); } /* keep in mind that in DNS tcp messages the first 2 bytes signal the * amount data to expect */ static ldns_status ldns_tcp_send_from(uint8_t **result, ldns_buffer *qbin, const struct sockaddr_storage *to, socklen_t tolen, const struct sockaddr_storage *from, socklen_t fromlen, struct timeval timeout, size_t *answer_size) { int sockfd; uint8_t *answer; sockfd = ldns_tcp_bgsend_from(qbin, to, tolen, from, fromlen, timeout); if (sockfd == 0) { return LDNS_STATUS_ERR; } answer = ldns_tcp_read_wire_timeout(sockfd, answer_size, timeout); close_socket(sockfd); if (*answer_size == 0) { /* oops */ return LDNS_STATUS_NETWORK_ERR; } /* resize accordingly */ *result = LDNS_XREALLOC(answer, uint8_t, (size_t)*answer_size); if(!*result) { LDNS_FREE(answer); return LDNS_STATUS_MEM_ERR; } return LDNS_STATUS_OK; } ldns_status ldns_tcp_send(uint8_t **result, ldns_buffer *qbin, const struct sockaddr_storage *to, socklen_t tolen, struct timeval timeout, size_t *answer_size) { return ldns_tcp_send_from(result, qbin, to, tolen, NULL, 0, timeout, answer_size); } int ldns_udp_connect(const struct sockaddr_storage *to, struct timeval ATTR_UNUSED(timeout)) { int sockfd; #ifndef S_SPLINT_S if ((sockfd = socket((int)((struct sockaddr*)to)->sa_family, SOCK_DGRAM, IPPROTO_UDP)) == -1) { return 0; } #endif return sockfd; } static int ldns_udp_bgsend_from(ldns_buffer *qbin, const struct sockaddr_storage *to , socklen_t tolen, const struct sockaddr_storage *from, socklen_t fromlen, struct timeval timeout) { int sockfd; sockfd = ldns_udp_connect(to, timeout); if (sockfd == 0) { return 0; } if (from && bind(sockfd, (const struct sockaddr*)from, fromlen) == -1){ return 0; } if (ldns_udp_send_query(qbin, sockfd, to, tolen) == 0) { close_socket(sockfd); return 0; } return sockfd; } int ldns_udp_bgsend(ldns_buffer *qbin, const struct sockaddr_storage *to , socklen_t tolen, struct timeval timeout) { return ldns_udp_bgsend_from(qbin, to, tolen, NULL, 0, timeout); } static ldns_status ldns_udp_send_from(uint8_t **result, ldns_buffer *qbin, const struct sockaddr_storage *to , socklen_t tolen, const struct sockaddr_storage *from, socklen_t fromlen, struct timeval timeout, size_t *answer_size) { int sockfd; uint8_t *answer; sockfd = ldns_udp_bgsend_from(qbin, to, tolen, from, fromlen, timeout); if (sockfd == 0) { return LDNS_STATUS_SOCKET_ERROR; } /* wait for an response*/ if(!ldns_sock_wait(sockfd, timeout, 0)) { close_socket(sockfd); return LDNS_STATUS_NETWORK_ERR; } /* set to nonblocking, so if the checksum is bad, it becomes * an EGAIN error and the ldns_udp_send function does not block, * but returns a 'NETWORK_ERROR' much like a timeout. */ ldns_sock_nonblock(sockfd); answer = ldns_udp_read_wire(sockfd, answer_size, NULL, NULL); close_socket(sockfd); if (*answer_size == 0) { /* oops */ return LDNS_STATUS_NETWORK_ERR; } *result = answer; return LDNS_STATUS_OK; } ldns_status ldns_udp_send(uint8_t **result, ldns_buffer *qbin, const struct sockaddr_storage *to , socklen_t tolen, struct timeval timeout, size_t *answer_size) { return ldns_udp_send_from(result, qbin, to, tolen, NULL, 0, timeout, answer_size); } ldns_status ldns_send_buffer(ldns_pkt **result, ldns_resolver *r, ldns_buffer *qb, ldns_rdf *tsig_mac) { uint8_t i; struct sockaddr_storage *src = NULL; size_t src_len; struct sockaddr_storage *ns; size_t ns_len; struct timeval tv_s; struct timeval tv_e; ldns_rdf **ns_array; size_t *rtt; ldns_pkt *reply; bool all_servers_rtt_inf; uint8_t retries; uint8_t *reply_bytes = NULL; size_t reply_size = 0; ldns_status status, send_status; assert(r != NULL); status = LDNS_STATUS_OK; rtt = ldns_resolver_rtt(r); ns_array = ldns_resolver_nameservers(r); reply = NULL; ns_len = 0; all_servers_rtt_inf = true; if (ldns_resolver_random(r)) { ldns_resolver_nameservers_randomize(r); } if(ldns_resolver_source(r)) { src = ldns_rdf2native_sockaddr_storage_port( ldns_resolver_source(r), 0, &src_len); } /* loop through all defined nameservers */ for (i = 0; i < ldns_resolver_nameserver_count(r); i++) { if (rtt[i] == LDNS_RESOLV_RTT_INF) { /* not reachable nameserver! */ continue; } /* maybe verbosity setting? printf("Sending to "); ldns_rdf_print(stdout, ns_array[i]); printf("\n"); */ ns = ldns_rdf2native_sockaddr_storage(ns_array[i], ldns_resolver_port(r), &ns_len); #ifndef S_SPLINT_S if ((ns->ss_family == AF_INET) && (ldns_resolver_ip6(r) == LDNS_RESOLV_INET6)) { /* not reachable */ LDNS_FREE(ns); continue; } if ((ns->ss_family == AF_INET6) && (ldns_resolver_ip6(r) == LDNS_RESOLV_INET)) { /* not reachable */ LDNS_FREE(ns); continue; } #endif all_servers_rtt_inf = false; gettimeofday(&tv_s, NULL); send_status = LDNS_STATUS_ERR; /* reply_bytes implicitly handles our error */ if (ldns_resolver_usevc(r)) { for (retries = ldns_resolver_retry(r); retries > 0; retries--) { send_status = ldns_tcp_send_from(&reply_bytes, qb, ns, (socklen_t)ns_len, src, (socklen_t)src_len, ldns_resolver_timeout(r), &reply_size); if (send_status == LDNS_STATUS_OK) { break; } } } else { for (retries = ldns_resolver_retry(r); retries > 0; retries--) { /* ldns_rdf_print(stdout, ns_array[i]); */ send_status = ldns_udp_send_from(&reply_bytes, qb, ns, (socklen_t)ns_len, src, (socklen_t)src_len, ldns_resolver_timeout(r), &reply_size); if (send_status == LDNS_STATUS_OK) { break; } } } if (send_status != LDNS_STATUS_OK) { ldns_resolver_set_nameserver_rtt(r, i, LDNS_RESOLV_RTT_INF); status = send_status; } /* obey the fail directive */ if (!reply_bytes) { /* the current nameserver seems to have a problem, blacklist it */ if (ldns_resolver_fail(r)) { LDNS_FREE(ns); return LDNS_STATUS_ERR; } else { LDNS_FREE(ns); continue; } } status = ldns_wire2pkt(&reply, reply_bytes, reply_size); if (status != LDNS_STATUS_OK) { LDNS_FREE(reply_bytes); LDNS_FREE(ns); return status; } LDNS_FREE(ns); gettimeofday(&tv_e, NULL); if (reply) { ldns_pkt_set_querytime(reply, (uint32_t) ((tv_e.tv_sec - tv_s.tv_sec) * 1000) + (tv_e.tv_usec - tv_s.tv_usec) / 1000); ldns_pkt_set_answerfrom(reply, ldns_rdf_clone(ns_array[i])); ldns_pkt_set_timestamp(reply, tv_s); ldns_pkt_set_size(reply, reply_size); break; } else { if (ldns_resolver_fail(r)) { /* if fail is set bail out, after the first * one */ break; } } /* wait retrans seconds... */ sleep((unsigned int) ldns_resolver_retrans(r)); } if(src) { LDNS_FREE(src); } if (all_servers_rtt_inf) { LDNS_FREE(reply_bytes); return LDNS_STATUS_RES_NO_NS; } #ifdef HAVE_SSL if (tsig_mac && reply && reply_bytes) { if (!ldns_pkt_tsig_verify(reply, reply_bytes, reply_size, ldns_resolver_tsig_keyname(r), ldns_resolver_tsig_keydata(r), tsig_mac)) { status = LDNS_STATUS_CRYPTO_TSIG_BOGUS; } } #else (void)tsig_mac; #endif /* HAVE_SSL */ LDNS_FREE(reply_bytes); if (result) { *result = reply; } return status; } ssize_t ldns_tcp_send_query(ldns_buffer *qbin, int sockfd, const struct sockaddr_storage *to, socklen_t tolen) { uint8_t *sendbuf; ssize_t bytes; /* add length of packet */ sendbuf = LDNS_XMALLOC(uint8_t, ldns_buffer_position(qbin) + 2); if(!sendbuf) return 0; ldns_write_uint16(sendbuf, ldns_buffer_position(qbin)); memcpy(sendbuf + 2, ldns_buffer_begin(qbin), ldns_buffer_position(qbin)); bytes = sendto(sockfd, (void*)sendbuf, ldns_buffer_position(qbin) + 2, 0, (struct sockaddr *)to, tolen); LDNS_FREE(sendbuf); if (bytes == -1 || (size_t) bytes != ldns_buffer_position(qbin) + 2 ) { return 0; } return bytes; } /* don't wait for an answer */ ssize_t ldns_udp_send_query(ldns_buffer *qbin, int sockfd, const struct sockaddr_storage *to, socklen_t tolen) { ssize_t bytes; bytes = sendto(sockfd, (void*)ldns_buffer_begin(qbin), ldns_buffer_position(qbin), 0, (struct sockaddr *)to, tolen); if (bytes == -1 || (size_t)bytes != ldns_buffer_position(qbin)) { return 0; } if ((size_t) bytes != ldns_buffer_position(qbin)) { return 0; } return bytes; } uint8_t * ldns_udp_read_wire(int sockfd, size_t *size, struct sockaddr_storage *from, socklen_t *fromlen) { uint8_t *wire, *wireout; ssize_t wire_size; wire = LDNS_XMALLOC(uint8_t, LDNS_MAX_PACKETLEN); if (!wire) { *size = 0; return NULL; } wire_size = recvfrom(sockfd, (void*)wire, LDNS_MAX_PACKETLEN, 0, (struct sockaddr *)from, fromlen); /* recvfrom can also return 0 */ if (wire_size == -1 || wire_size == 0) { *size = 0; LDNS_FREE(wire); return NULL; } *size = (size_t)wire_size; wireout = LDNS_XREALLOC(wire, uint8_t, (size_t)wire_size); if(!wireout) LDNS_FREE(wire); return wireout; } uint8_t * ldns_tcp_read_wire_timeout(int sockfd, size_t *size, struct timeval timeout) { uint8_t *wire; uint16_t wire_size; ssize_t bytes = 0, rc = 0; wire = LDNS_XMALLOC(uint8_t, 2); if (!wire) { *size = 0; return NULL; } while (bytes < 2) { if(!ldns_sock_wait(sockfd, timeout, 0)) { *size = 0; LDNS_FREE(wire); return NULL; } rc = recv(sockfd, (void*) (wire + bytes), (size_t) (2 - bytes), 0); if (rc == -1 || rc == 0) { *size = 0; LDNS_FREE(wire); return NULL; } bytes += rc; } wire_size = ldns_read_uint16(wire); LDNS_FREE(wire); wire = LDNS_XMALLOC(uint8_t, wire_size); if (!wire) { *size = 0; return NULL; } bytes = 0; while (bytes < (ssize_t) wire_size) { if(!ldns_sock_wait(sockfd, timeout, 0)) { *size = 0; LDNS_FREE(wire); return NULL; } rc = recv(sockfd, (void*) (wire + bytes), (size_t) (wire_size - bytes), 0); if (rc == -1 || rc == 0) { LDNS_FREE(wire); *size = 0; return NULL; } bytes += rc; } *size = (size_t) bytes; return wire; } uint8_t * ldns_tcp_read_wire(int sockfd, size_t *size) { uint8_t *wire; uint16_t wire_size; ssize_t bytes = 0, rc = 0; wire = LDNS_XMALLOC(uint8_t, 2); if (!wire) { *size = 0; return NULL; } while (bytes < 2) { rc = recv(sockfd, (void*) (wire + bytes), (size_t) (2 - bytes), 0); if (rc == -1 || rc == 0) { *size = 0; LDNS_FREE(wire); return NULL; } bytes += rc; } wire_size = ldns_read_uint16(wire); LDNS_FREE(wire); wire = LDNS_XMALLOC(uint8_t, wire_size); if (!wire) { *size = 0; return NULL; } bytes = 0; while (bytes < (ssize_t) wire_size) { rc = recv(sockfd, (void*) (wire + bytes), (size_t) (wire_size - bytes), 0); if (rc == -1 || rc == 0) { LDNS_FREE(wire); *size = 0; return NULL; } bytes += rc; } *size = (size_t) bytes; return wire; } #ifndef S_SPLINT_S ldns_rdf * ldns_sockaddr_storage2rdf(const struct sockaddr_storage *sock, uint16_t *port) { ldns_rdf *addr; struct sockaddr_in *data_in; struct sockaddr_in6 *data_in6; switch(sock->ss_family) { case AF_INET: data_in = (struct sockaddr_in*)sock; if (port) { *port = ntohs((uint16_t)data_in->sin_port); } addr = ldns_rdf_new_frm_data(LDNS_RDF_TYPE_A, LDNS_IP4ADDRLEN, &data_in->sin_addr); break; case AF_INET6: data_in6 = (struct sockaddr_in6*)sock; if (port) { *port = ntohs((uint16_t)data_in6->sin6_port); } addr = ldns_rdf_new_frm_data(LDNS_RDF_TYPE_AAAA, LDNS_IP6ADDRLEN, &data_in6->sin6_addr); break; default: if (port) { *port = 0; } return NULL; } return addr; } #endif /* code from resolver.c */ ldns_status ldns_axfr_start(ldns_resolver *resolver, const ldns_rdf *domain, ldns_rr_class class) { ldns_pkt *query; ldns_buffer *query_wire; struct sockaddr_storage *src = NULL; size_t src_len = 0; struct sockaddr_storage *ns = NULL; size_t ns_len = 0; size_t ns_i; ldns_status status; if (!resolver || ldns_resolver_nameserver_count(resolver) < 1) { return LDNS_STATUS_ERR; } query = ldns_pkt_query_new(ldns_rdf_clone(domain), LDNS_RR_TYPE_AXFR, class, 0); if (!query) { return LDNS_STATUS_ADDRESS_ERR; } if(ldns_resolver_source(resolver)) { src = ldns_rdf2native_sockaddr_storage_port( ldns_resolver_source(resolver), 0, &src_len); } /* For AXFR, we have to make the connection ourselves */ /* try all nameservers (which usually would mean v4 fallback if * @hostname is used */ for (ns_i = 0; ns_i < ldns_resolver_nameserver_count(resolver) && resolver->_socket == SOCK_INVALID; ns_i++) { if (ns != NULL) { LDNS_FREE(ns); } ns = ldns_rdf2native_sockaddr_storage( resolver->_nameservers[ns_i], ldns_resolver_port(resolver), &ns_len); #ifndef S_SPLINT_S if ((ns->ss_family == AF_INET) && (ldns_resolver_ip6(resolver) == LDNS_RESOLV_INET6)) { /* not reachable */ LDNS_FREE(ns); ns = NULL; continue; } if ((ns->ss_family == AF_INET6) && (ldns_resolver_ip6(resolver) == LDNS_RESOLV_INET)) { /* not reachable */ LDNS_FREE(ns); ns = NULL; continue; } #endif resolver->_socket = ldns_tcp_connect_from( ns, (socklen_t)ns_len, src, (socklen_t)src_len, ldns_resolver_timeout(resolver)); } if (resolver->_socket == SOCK_INVALID) { ldns_pkt_free(query); LDNS_FREE(ns); return LDNS_STATUS_NETWORK_ERR; } #ifdef HAVE_SSL if (ldns_resolver_tsig_keyname(resolver) && ldns_resolver_tsig_keydata(resolver)) { status = ldns_pkt_tsig_sign(query, ldns_resolver_tsig_keyname(resolver), ldns_resolver_tsig_keydata(resolver), 300, ldns_resolver_tsig_algorithm(resolver), NULL); if (status != LDNS_STATUS_OK) { /* to prevent problems on subsequent calls to * ldns_axfr_start we have to close the socket here! */ close_socket(resolver->_socket); resolver->_socket = 0; ldns_pkt_free(query); LDNS_FREE(ns); return LDNS_STATUS_CRYPTO_TSIG_ERR; } } #endif /* HAVE_SSL */ /* Convert the query to a buffer * Is this necessary? */ query_wire = ldns_buffer_new(LDNS_MAX_PACKETLEN); if(!query_wire) { ldns_pkt_free(query); LDNS_FREE(ns); close_socket(resolver->_socket); return LDNS_STATUS_MEM_ERR; } status = ldns_pkt2buffer_wire(query_wire, query); if (status != LDNS_STATUS_OK) { ldns_pkt_free(query); ldns_buffer_free(query_wire); LDNS_FREE(ns); /* to prevent problems on subsequent calls to ldns_axfr_start * we have to close the socket here! */ close_socket(resolver->_socket); resolver->_socket = 0; return status; } /* Send the query */ if (ldns_tcp_send_query(query_wire, resolver->_socket, ns, (socklen_t)ns_len) == 0) { ldns_pkt_free(query); ldns_buffer_free(query_wire); LDNS_FREE(ns); /* to prevent problems on subsequent calls to ldns_axfr_start * we have to close the socket here! */ close_socket(resolver->_socket); return LDNS_STATUS_NETWORK_ERR; } ldns_pkt_free(query); ldns_buffer_free(query_wire); LDNS_FREE(ns); /* * The AXFR is done once the second SOA record is sent */ resolver->_axfr_soa_count = 0; return LDNS_STATUS_OK; } ldns-1.7.0/install-sh0000755000175000017500000003546313026206167014045 0ustar willemwillem#!/bin/sh # install - install a program, script, or datafile scriptversion=2014-09-12.12; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. # # Copyright (C) 1994 X Consortium # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the X Consortium shall not # be used in advertising or otherwise to promote the sale, use or other deal- # ings in this Software without prior written authorization from the X Consor- # tium. # # # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent # 'make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. tab=' ' nl=' ' IFS=" $tab$nl" # Set DOITPROG to "echo" to test this script. doit=${DOITPROG-} doit_exec=${doit:-exec} # Put in absolute file names if you don't have them in your path; # or use environment vars. chgrpprog=${CHGRPPROG-chgrp} chmodprog=${CHMODPROG-chmod} chownprog=${CHOWNPROG-chown} cmpprog=${CMPPROG-cmp} cpprog=${CPPROG-cp} mkdirprog=${MKDIRPROG-mkdir} mvprog=${MVPROG-mv} rmprog=${RMPROG-rm} stripprog=${STRIPPROG-strip} posix_mkdir= # Desired mode of installed file. mode=0755 chgrpcmd= chmodcmd=$chmodprog chowncmd= mvcmd=$mvprog rmcmd="$rmprog -f" stripcmd= src= dst= dir_arg= dst_arg= copy_on_change=false is_target_a_directory=possibly usage="\ Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE or: $0 [OPTION]... SRCFILES... DIRECTORY or: $0 [OPTION]... -t DIRECTORY SRCFILES... or: $0 [OPTION]... -d DIRECTORIES... In the 1st form, copy SRCFILE to DSTFILE. In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. In the 4th, create DIRECTORIES. Options: --help display this help and exit. --version display version info and exit. -c (ignored) -C install only if different (preserve the last data modification time) -d create directories instead of installing files. -g GROUP $chgrpprog installed files to GROUP. -m MODE $chmodprog installed files to MODE. -o USER $chownprog installed files to USER. -s $stripprog installed files. -t DIRECTORY install into DIRECTORY. -T report an error if DSTFILE is a directory. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG " while test $# -ne 0; do case $1 in -c) ;; -C) copy_on_change=true;; -d) dir_arg=true;; -g) chgrpcmd="$chgrpprog $2" shift;; --help) echo "$usage"; exit $?;; -m) mode=$2 case $mode in *' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*) echo "$0: invalid mode: $mode" >&2 exit 1;; esac shift;; -o) chowncmd="$chownprog $2" shift;; -s) stripcmd=$stripprog;; -t) is_target_a_directory=always dst_arg=$2 # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac shift;; -T) is_target_a_directory=never;; --version) echo "$0 $scriptversion"; exit $?;; --) shift break;; -*) echo "$0: invalid option: $1" >&2 exit 1;; *) break;; esac shift done # We allow the use of options -d and -T together, by making -d # take the precedence; this is for compatibility with GNU install. if test -n "$dir_arg"; then if test -n "$dst_arg"; then echo "$0: target directory not allowed when installing a directory." >&2 exit 1 fi fi if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. # Otherwise, the last argument is the destination. Remove it from $@. for arg do if test -n "$dst_arg"; then # $@ is not empty: it contains at least $arg. set fnord "$@" "$dst_arg" shift # fnord fi shift # arg dst_arg=$arg # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac done fi if test $# -eq 0; then if test -z "$dir_arg"; then echo "$0: no input file specified." >&2 exit 1 fi # It's OK to call 'install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi if test -z "$dir_arg"; then if test $# -gt 1 || test "$is_target_a_directory" = always; then if test ! -d "$dst_arg"; then echo "$0: $dst_arg: Is not a directory." >&2 exit 1 fi fi fi if test -z "$dir_arg"; then do_exit='(exit $ret); exit $ret' trap "ret=129; $do_exit" 1 trap "ret=130; $do_exit" 2 trap "ret=141; $do_exit" 13 trap "ret=143; $do_exit" 15 # Set umask so as not to create temps with too-generous modes. # However, 'strip' requires both read and write access to temps. case $mode in # Optimize common cases. *644) cp_umask=133;; *755) cp_umask=22;; *[0-7]) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw='% 200' fi cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; *) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw=,u+rw fi cp_umask=$mode$u_plus_rw;; esac fi for src do # Protect names problematic for 'test' and other utilities. case $src in -* | [=\(\)!]) src=./$src;; esac if test -n "$dir_arg"; then dst=$src dstdir=$dst test -d "$dstdir" dstdir_status=$? else # Waiting for this to be detected by the "$cpprog $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if test ! -f "$src" && test ! -d "$src"; then echo "$0: $src does not exist." >&2 exit 1 fi if test -z "$dst_arg"; then echo "$0: no destination specified." >&2 exit 1 fi dst=$dst_arg # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. if test -d "$dst"; then if test "$is_target_a_directory" = never; then echo "$0: $dst_arg: Is a directory" >&2 exit 1 fi dstdir=$dst dst=$dstdir/`basename "$src"` dstdir_status=0 else dstdir=`dirname "$dst"` test -d "$dstdir" dstdir_status=$? fi fi obsolete_mkdir_used=false if test $dstdir_status != 0; then case $posix_mkdir in '') # Create intermediate dirs using mode 755 as modified by the umask. # This is like FreeBSD 'install' as of 1997-10-28. umask=`umask` case $stripcmd.$umask in # Optimize common cases. *[2367][2367]) mkdir_umask=$umask;; .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; *[0-7]) mkdir_umask=`expr $umask + 22 \ - $umask % 100 % 40 + $umask % 20 \ - $umask % 10 % 4 + $umask % 2 `;; *) mkdir_umask=$umask,go-w;; esac # With -d, create the new directory with the user-specified mode. # Otherwise, rely on $mkdir_umask. if test -n "$dir_arg"; then mkdir_mode=-m$mode else mkdir_mode= fi posix_mkdir=false case $umask in *[123567][0-7][0-7]) # POSIX mkdir -p sets u+wx bits regardless of umask, which # is incompatible with FreeBSD 'install' when (umask & 300) != 0. ;; *) # $RANDOM is not portable (e.g. dash); use it when possible to # lower collision chance tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ trap 'ret=$?; rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null; exit $ret' 0 # As "mkdir -p" follows symlinks and we work in /tmp possibly; so # create the $tmpdir first (and fail if unsuccessful) to make sure # that nobody tries to guess the $tmpdir name. if (umask $mkdir_umask && $mkdirprog $mkdir_mode "$tmpdir" && exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1 then if test -z "$dir_arg" || { # Check for POSIX incompatibilities with -m. # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or # other-writable bit of parent directory when it shouldn't. # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. test_tmpdir="$tmpdir/a" ls_ld_tmpdir=`ls -ld "$test_tmpdir"` case $ls_ld_tmpdir in d????-?r-*) different_mode=700;; d????-?--*) different_mode=755;; *) false;; esac && $mkdirprog -m$different_mode -p -- "$test_tmpdir" && { ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"` test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" } } then posix_mkdir=: fi rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" else # Remove any dirs left behind by ancient mkdir implementations. rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null fi trap '' 0;; esac;; esac if $posix_mkdir && ( umask $mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" ) then : else # The umask is ridiculous, or mkdir does not conform to POSIX, # or it failed possibly due to a race condition. Create the # directory the slow way, step by step, checking for races as we go. case $dstdir in /*) prefix='/';; [-=\(\)!]*) prefix='./';; *) prefix='';; esac oIFS=$IFS IFS=/ set -f set fnord $dstdir shift set +f IFS=$oIFS prefixes= for d do test X"$d" = X && continue prefix=$prefix$d if test -d "$prefix"; then prefixes= else if $posix_mkdir; then (umask=$mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break # Don't fail if two instances are running concurrently. test -d "$prefix" || exit 1 else case $prefix in *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; *) qprefix=$prefix;; esac prefixes="$prefixes '$qprefix'" fi fi prefix=$prefix/ done if test -n "$prefixes"; then # Don't fail if two instances are running concurrently. (umask $mkdir_umask && eval "\$doit_exec \$mkdirprog $prefixes") || test -d "$dstdir" || exit 1 obsolete_mkdir_used=true fi fi fi if test -n "$dir_arg"; then { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 else # Make a couple of temp file names in the proper directory. dsttmp=$dstdir/_inst.$$_ rmtmp=$dstdir/_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 # Copy the file name to the temp name. (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && # and set any options; do chmod last to preserve setuid bits. # # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $cpprog $src $dsttmp" command. # { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && # If -C, don't bother to copy if it wouldn't change the file. if $copy_on_change && old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && set -f && set X $old && old=:$2:$4:$5:$6 && set X $new && new=:$2:$4:$5:$6 && set +f && test "$old" = "$new" && $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 then rm -f "$dsttmp" else # Rename the file to the real destination. $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || # The rename failed, perhaps because mv can't rename something else # to itself, or perhaps because mv is so ancient that it does not # support -f. { # Now remove or move aside any old file at destination location. # We try this two ways since rm can't unlink itself on some # systems and the destination file might be busy for other # reasons. In this case, the final cleanup might fail but the new # file should still install successfully. { test ! -f "$dst" || $doit $rmcmd -f "$dst" 2>/dev/null || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } } || { echo "$0: cannot unlink or rename $dst" >&2 (exit 1); exit 1 } } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dst" } fi || exit 1 trap '' 0 fi done # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: ldns-1.7.0/doc/0000755000175000017500000000000013026206166012572 5ustar willemwillemldns-1.7.0/doc/API-header.xml0000644000175000017500000000620113026206166015152 0ustar willemwillem LibDNS API NLnet Labs
Kruislaan 419 Amsterdam 1098 VA The Netherlands miek@nlnetlabs.nl http://www.nlnetlabs.nl
NLnet Labs
Kruislaan 419 Amsterdam 1098 VA The Netherlands jelte@nlnetlabs.nl http://www.nlnetlabs.nl
NLnet Labs
Kruislaan 419 Amsterdam 1098 VA The Netherlands erik@nlnetlabs.nl http://www.nlnetlabs.nl
DNS Elite Hacking A small abstract will come here, TBD.
LibDNS (or lDNS) is modelled after the Net::DNS perl library. It has been shown that Net::DNS can be used vefficiently for programming DNS aware applications. We want to bring the same level of efficiency to C programmers. The lDNS API consist of two layers. The top-layer, this is what is actually exported to the application via the library. And the bottom-layer, this is what lDNS needs to compile and function.
Short intermezzo detailing differences with other libraries. Most important ones are the libc resolver interface (from BIND8) and the lwres_ interface from BIND9.
At its lowest level lDNS is only dependent on libc. It uses a few networking systems calls; socket, bind, send/recv and friends. Further more it is to be expected that lDNS will depend on OpenSSL for its cryptography. As said, lDNS is modelled after Net::DNS, therefor its application API looks very much like the one used for Net::DNS. Some modification are made ofcourse, because not all functionality of Perl can be caught in C. This API document was written by carefully looking at the documentation contained in the Net::DNS Perl module.
ldns-1.7.0/doc/libdns.css0000644000175000017500000002157013026206166014564 0ustar willemwillemBODY,H1,H2,H3,H4,H5,H6,P,CENTER,TD,TH,UL,DL,DIV { font-family: Geneva, Arial, Helvetica, sans-serif; } BODY,TD { font-size: 90%; } H1 { text-align: center; font-size: 160%; } H2 { font-size: 120%; } H3 { font-size: 100%; } CAPTION { font-weight: bold } DIV.qindex { width: 100%; background-color: #e8eef2; border: 1px solid #84c7b0; text-align: center; margin: 2px; padding: 2px; line-height: 140%; } DIV.nav { width: 100%; background-color: #e8eef2; border: 1px solid #84c7b0; text-align: center; margin: 2px; padding: 2px; line-height: 140%; } DIV.navtab { background-color: #e8eef2; border: 1px solid #84c7b0; text-align: center; margin: 2px; margin-right: 15px; padding: 2px; } TD.navtab { font-size: 70%; } A { text-decoration: none; font-weight: bold; color: #1ba159; } A.qindex { text-decoration: none; font-weight: bold; color: #1ba159; } A.qindex:visited { text-decoration: none; font-weight: bold; color: #1b7159; } A.qindex:hover { text-decoration: none; background-color: #ddffdd; } A.qindexHL { text-decoration: none; font-weight: bold; background-color: #6666cc; color: #ffffff; border: 1px double #9295C2; } A.qindexHL:hover { text-decoration: none; background-color: #6666cc; color: #ffffff; } A.qindexHL:visited { text-decoration: none; background-color: #6666cc; color: #ffffff } A.el { text-decoration: none; font-weight: bold } A.elRef { font-weight: bold } A.code:link { text-decoration: none; font-weight: normal; color: #1ba159} A.code:visited { text-decoration: none; font-weight: normal; color: #1b7159} A.codeRef:link { font-weight: normal; color: #1ba159} A.codeRef:visited { font-weight: normal; color: #1b7159} A:hover { text-decoration: none; background-color: #c0c0c0 } DL.el { margin-left: -1cm } .fragment { font-family: monospace; font-size: 100%; } PRE.fragment { border: 1px solid #CCCCCC; background-color: #f5f5f5; margin-top: 4px; margin-bottom: 4px; margin-left: 2px; margin-right: 8px; padding-left: 6px; padding-right: 6px; padding-top: 4px; padding-bottom: 4px; } DIV.ah { background-color: black; font-weight: bold; color: #ffffff; margin-bottom: 3px; margin-top: 3px } TD.md { background-color: #F4F4FB; font-weight: bold; } TD.mdPrefix { background-color: #F4F4FB; color: #606060; font-size: 80%; } TD.mdname1 { background-color: #F4FBF4; font-weight: bold; color: #602020; } TD.mdname { background-color: #F4FBF4; font-weight: bold; color: #602020; width: 600px; } DIV.groupHeader { margin-left: 16px; margin-top: 12px; margin-bottom: 6px; font-weight: bold; } DIV.groupText { margin-left: 16px; font-style: italic; font-size: 90% } BODY { background: white; color: black; margin-right: 20px; margin-left: 20px; } TD.indexkey { background-color: #e8eef2; font-weight: bold; padding-right : 10px; padding-top : 2px; padding-left : 10px; padding-bottom : 2px; margin-left : 0px; margin-right : 0px; margin-top : 2px; margin-bottom : 2px; border: 1px solid #CCCCCC; } TD.indexvalue { background-color: #e8eef2; font-style: italic; padding-right : 10px; padding-top : 2px; padding-left : 10px; padding-bottom : 2px; margin-left : 0px; margin-right : 0px; margin-top : 2px; margin-bottom : 2px; border: 1px solid #CCCCCC; } TR.memlist { background-color: #f0f0f0; } P.formulaDsp { text-align: center; } IMG.formulaDsp { } IMG.formulaInl { vertical-align: middle; } SPAN.keyword { color: #008000 } SPAN.keywordtype { color: #604020 } SPAN.keywordflow { color: #e08000 } SPAN.comment { color: #800000 } SPAN.preprocessor { color: #806020 } SPAN.stringliteral { color: #002080 } SPAN.charliteral { color: #008080 } .mdTable { border: 1px solid #868686; background-color: #F4F4FB; } .mdRow { padding: 8px 10px; } .mdescLeft { padding: 0px 8px 4px 8px; font-size: 80%; font-style: italic; background-color: #FAFAFA; border-top: 1px none #E0E0E0; border-right: 1px none #E0E0E0; border-bottom: 1px none #E0E0E0; border-left: 1px none #E0E0E0; margin: 0px; } .mdescRight { padding: 0px 8px 4px 8px; font-size: 80%; font-style: italic; background-color: #FAFAFA; border-top: 1px none #E0E0E0; border-right: 1px none #E0E0E0; border-bottom: 1px none #E0E0E0; border-left: 1px none #E0E0E0; margin: 0px; } .memItemLeft { padding: 1px 0px 0px 8px; margin: 4px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-color: #E0E0E0; border-right-color: #E0E0E0; border-bottom-color: #E0E0E0; border-left-color: #E0E0E0; border-top-style: solid; border-right-style: none; border-bottom-style: none; border-left-style: none; background-color: #FAFAFA; font-size: 80%; } .memItemRight { padding: 1px 8px 0px 8px; margin: 4px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-color: #E0E0E0; border-right-color: #E0E0E0; border-bottom-color: #E0E0E0; border-left-color: #E0E0E0; border-top-style: solid; border-right-style: none; border-bottom-style: none; border-left-style: none; background-color: #FAFAFA; font-size: 80%; } .memTemplItemLeft { padding: 1px 0px 0px 8px; margin: 4px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-color: #E0E0E0; border-right-color: #E0E0E0; border-bottom-color: #E0E0E0; border-left-color: #E0E0E0; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; background-color: #FAFAFA; font-size: 80%; } .memTemplItemRight { padding: 1px 8px 0px 8px; margin: 4px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-color: #E0E0E0; border-right-color: #E0E0E0; border-bottom-color: #E0E0E0; border-left-color: #E0E0E0; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; background-color: #FAFAFA; font-size: 80%; } .memTemplParams { padding: 1px 0px 0px 8px; margin: 4px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-color: #E0E0E0; border-right-color: #E0E0E0; border-bottom-color: #E0E0E0; border-left-color: #E0E0E0; border-top-style: solid; border-right-style: none; border-bottom-style: none; border-left-style: none; color: #606060; background-color: #FAFAFA; font-size: 80%; } .search { color: #009933; font-weight: bold; } FORM.search { margin-bottom: 0px; margin-top: 0px; } INPUT.search { font-size: 75%; color: #008000; font-weight: normal; background-color: #e8eef2; } TD.tiny { font-size: 75%; } a { color: #1ba159; } a:visited { color: #1b7159; } .dirtab { padding: 4px; border-collapse: collapse; border: 1px solid #84b0c7; } TH.dirtab { background: #e8eef2; font-weight: bold; } HR { height: 1px; border: none; border-top: 1px solid black; } /* tabs styles, based on http://www.alistapart.com/articles/slidingdoors */ DIV.tabs { float : left; width : 100%; background : url("tab_b.gif") repeat-x bottom; margin-bottom : 4px; } DIV.tabs UL { margin : 0px; padding-left : 10px; list-style : none; } DIV.tabs LI, DIV.tabs FORM { display : inline; margin : 0px; padding : 0px; } DIV.tabs FORM { float : right; } DIV.tabs A { float : left; background : url("tab_r.gif") no-repeat right top; border-bottom : 1px solid #84C7B0; font-size : x-small; font-weight : bold; text-decoration : none; } DIV.tabs A:hover { background-position: 100% -150px; } DIV.tabs A:link, DIV.tabs A:visited, DIV.tabs A:active, DIV.tabs A:hover { color: #1b7159; } DIV.tabs SPAN { float : left; display : block; background : url("tab_l.gif") no-repeat left top; padding : 5px 9px; white-space : nowrap; } DIV.tabs INPUT { float : right; display : inline; font-size : 1em; } DIV.tabs TD { font-size : x-small; font-weight : bold; text-decoration : none; } /* Commented Backslash Hack hides rule from IE5-Mac \*/ DIV.tabs SPAN {float : none;} /* End IE5-Mac hack */ DIV.tabs A:hover SPAN { background-position: 0% -150px; } DIV.tabs LI#current A { background-position: 100% -150px; border-width : 0px; } DIV.tabs LI#current SPAN { background-position: 0% -150px; padding-bottom : 6px; } DIV.nav { background : none; border : none; border-bottom : 1px solid #84C7B0; } .logo { text-align: right; } ldns-1.7.0/doc/images/0000755000175000017500000000000013026206166014037 5ustar willemwillemldns-1.7.0/doc/images/libdnsoverview.svg0000644000175000017500000004675313026206166017641 0ustar willemwillem image/svg+xml - CLIENT - any program making use of ldns - WIRE module - from_wire to_wire- convert to and from wireformat- all name encoding and decoding is contained in these functions - central structures - pkt structurerdf structuredname structurerr structurerrlist structurerrset structurepkt structurezone structure - resolver module - stub resolversendquerybgsendaxfr - net module - all network interfacing code - OS/libc layer - str module from_str to_str- convert from and to string- dig-style formatted output DNSSEC module signverify ldns-1.7.0/doc/images/LogoInGradientBar2-y100.png0000644000175000017500000016654513026206166020631 0ustar willemwillem‰PNG  IHDRFd-Ê·ï pHYs\F\F”CA€IDATxÚìýw˜nÙUïpÒ›CåpëÆîÛÝ’ZYBÂL –#d`óaÀŸ†Ï ² ã1ÑX4ÂI’i!»[êtûæX9W½9‡“Ïßë=§Þª[·ûªÕmIþÞõÔÓ]÷Ôk¯½Ï>k¯½~ka)%шF4¢hD#Ñ×2‘¯4#шF4¢hD#úri¤ÒhD#шF4¢}ÍÓH¥шF4¢hD#úš§‘J7¢hD#шFô5O#•nD#шF4¢èkžF*݈F4¢hD#Ñ×´º½l’a„@g»—œGVºhD#шFôb D×±®î¬SBLl !bšþÖÓç’H¢ÑêB“›¼´µâøn!‰$Áømg2T툕n³VÚ®W4E¶AaŒ|ÎÎOŸ8‘ŸR’ÿ©õÈûÔ›G*݈F4¢hD#z1RRŒWËûßökÿ&¦éÃ÷{!?óßÿ¯¾å»ç”·ÕqÎøC¿¾Q-‡ÛRhT½ò3896]Ñr!JÿÙÏþÂã<–ÊpqpíK iö»ÿù}ÿâ_~ãw!¥_i!½Z4¬Ïq!Á“‘•nD#шF4¢½L¢„¤¸¡i‡]¶pÉŸýË?J±þ·¿=à\!…ŠÈ1­`”ÔT,Ö¸è©BS”±íp=]QS±DʈsÁ‡˜¡>cš¢~¥¥òꈑq®Pz§°ýÃð}ÿ¿þÄP²©t#шF4¢è¥IJÄ¥BÊ¡S)Á8OüŸþ»I#þ}ïø;ç*¥RJyT7R)¤Ré$<¼G¿’K ‰è!ÛøJKåU¤a}n©´ûÝ¿õ [õrÀٽʂ˜ŒhD#шF4¢—Ià‡NêÆ¿üã<~ý‚J)ãcŒ^\ß’/ñï—üãÿÔêÜ!}n¹´÷~óçêýn>‘z‘*#•nD#шF4¢½|‚8#„CQÿ?úµ§–o(¡V÷5mE“‡éiä>Ûès‚+”î4ªÿä·±Þï$ #àüEjTºhD#шFôeøï+”b„¿ÿ¿þ§K[«_…Zp"¥dœßýØ (#¤€'p;,¤àBpÁ£î§!py¨&¸ËÛÔ>GèN£ú¿ù3ûÍZʈ1ÎFÀ'Ç0?RéF4¢hD#Ñ—K€ÇÔÕcþ{?ø–Š» ¥L|iu×À+”ÞýÈ ‰œ`¢PJ ¡„B(ß©D’ q¯E™àRJB%D¡T!t¸…P‚1(ˆw7¹à ¡»ê?úÍŸÝiTS±xÀ9F#¤Š¢äó”4‚GŒhD#шF4¢W„@‰izÇ6¿û±_øÄOüÜéñi.8%ô«A«m©çØŸ¸ñ‚c .zcç&gÞuþQ)%´Òm=µ|óÆþf¥Óv/‹/ä'ßuþu_ÿÀkTªp!(9F$ 5"C­k·Q½²³¾RÞ+¶=×ö‚ O,ä'ßtêwž}$ŸL )¡)4”ZdH ÝmT¿ó7v»QÉ€>‡1dËøôíË›µ’Ë‚ªø¯?qæ-§©t#шF4¢è•!ðèOèF©ÝøîüûOüÄÏMgò‘ô•å ¦Z¿ócþÏB!JHÏìÏ;þî»Î?Úuì_ùô_|äâSµ^… Çlû+Ÿù‹·ž>ÿËßóÃoX8{D« U1A0Æ}öÎÕÿúÅ¿¾¸µÒ¶M!$Áƒ„iB .$%d67öî7|ÝOü½ïœËÃë>'(¡µ^ûŸüö/nÕËÙx2à,2æ)”þ?ŸúsÆYļBh·×þ?ÿÁûF*݈F4¢hD#z% ´ºt,¾^-~Ïc¿ð—?þ³Ùx"å~¥YC!ŠÉX"Í'˜@4JBx"•ÙoÕ¿ó7f±¸›‹'Ç’i4ÕJŒ0„c¹²½öî_ÿ·û—ÿσ‡†ô9JH©Ýü?þôw>qóŠIB7ŽTY½P×6ë‰Ç?våÙßø¾ûö׿=Òê„”j¯ýžÿòsË¥½HŸCá­±”2K R!TH™Ð 4ò¥шF4¢hD_Eæ·èŒqÀy6ž¼¾»ñÞþ’í{„ñ•¶ÒEÄ„`B0Á¹\ˆ€1ÒÅâÎ?øŸ^¯§39Bü ìs` œgIËsÿå}Àñ½á SÐç–Š»ßô+?õø ùD*K€j Ÿ1ˆ''¤d‚SB'RYÓsß÷Á_úè•gBŠA©õ:ÿø?§°3¬Ï SˆÕþà-F*݈F4¢hD#úréˆò18Ë'ÒO¯ÞúÁÿ÷?1ο:ŒtÇÒPµ;ÅÝr§•‰'A?#SBð=•±t,q»°óg—ŸFh>RRBj½Î{?øKÅvc"•aœúÒsí¾ëÄ5]WÔ¶ÝwnlÎtE‰kú¿øð¹±· }¹ÿ]¿õó×vÖSFÜgÁ0xB"©Lpþ0Á™Bޝ#шF4¢èË ("®ëûGæ@«Of>yóâ?ÿƒß€Ì¤_qº» ¢%늢R!Ùsì–Ù7]§Ñïùœ‘!½ üáTJÿêÆ ¡èâ!ôÓÿƒõj!Oøl`Z£„ôû›_ó–Oü¯?÷Ìûõ™ŸúÕÿðÿ}f|Úò\°ðq!TEqÿß~ì ñj·]î´æóq]×u /¡#‘2âð“6â™XÜP54B¼ŽhD#шF4¢—M„ÓuþÎÃo@}úö•‰Tføº´º‰Tö#ŸJÆo¼÷Ç„<”O쫇$B Ï}ë£oû'oû[ùdj¹´÷_žx¼ÒmëŠ:@È"$¥ÔUu¥²ßs¬t,np7ö6?~í¹|"„¡øBÛ¶ù}ïø;}ÿ"Õ!4ŸŸxëé¿õWÿu©ÓÒU"É8OÇϬß~béúß}ä³¹± ÿæ7ÀºùSñ»¿ó…¿Î'S` Da„|ÎþàþÏwœ}Øô‚ <RÆ5¬t#шF4¢èeF˜ žŽÅÿè‡ÿ¯7,œiÛ¦J•#¦8&øD*ó;_øë÷ñ?4T-Ôp¾ŠcŒ1î»öÏ}Ç|äGÞÿî7¾ãç^óÃëÛ>øƒ?1’èÀZ1JÚ–YíuB—ö/®ÓtCÕ¾Z:„(!¦ç|ý¹×ü›w¿°à?Ç‘@=4sâÙõEl`t ¤".„øP·ÞïZ MQ†¡ ¥M³÷{Ï|Æñ½!àˆTˆÒ0»U¹àÑM®J•J§Uëw¦3y0¾·‘HÉ]ÅF*݈F4¢hD#zÈgÁSsùÑ÷çoþŒéº†ªò0]J7¦ê"Ì©õU©#ìs¶06 yiLŒ!„&R™cÍfïM³ß=Û€„qM¿´µúÔÊM‚ñAmŒ”„´–%ÄòܶmNgò_|d¤ÒhD#шF4¢W€(¡Œóן8óG?ü×~ÞçL£Ê­ ›_=úP¬ã07Wø§a]m˜¢Œs.„JéAk ) MKÇâÇVä‚w0ö…p|ï¾x½·Ê7RéF4¢hD#Ñ+C ¥çï<÷Èïý³ÿý}¿ó”1¤ÕA±W\Ÿû2c£È»ãêÝw]UQ”Ã)_ä8/›½ûhcŒ¼ `\ÜOwG$%‡E#•nD#шF4¢½R$¥T) 8ÿæ×¾å·¿ÿÇè÷-¡cñ*˜åÀ¢†R`ù¢þg¯‚ÑX"•2bÇR0 ÃŒóñTú§¾ý{ùÄ^\hqÁÆ&PdË<^§ÄRJŸñHÔ0(.B’:RéF4¢hD#Ñ+F¡VÇÞó–¿ÙwÿãdâI<¤‚¼r nE &€<}IÆ^ñÁ2ÁÇS™ùÉÚ+QØJHÛ2ßõàë^¿pÒQÜgƒc0ÖÝm²ÃûŒµ¬>BˆqF E‚!³”r¤ÒhD#шF4¢W˜Bç?ø7¾©çØïÿèïåiÄ+¨Õq!’†ñGžxncÑgì^­b„¹ ÍøÕïýçÙxò&B!ô8=7ë!…cªöW7.~üêó MQâšžO¤1Æ#•nD#шF4¢½Ât Õ!Â…øßõC}ÇùÐsŸLe‡“À~¹] (×Â=üä$âRp)^½d0–ŸùŽï~ci¯YKÇA¤Õqž2b^ààÉÇû ŸŒkÄÀóX „Ô%¦icÉ FaxaŒP6å-§\ÈOVz-ªD*JÇ‘ü¤D\pˆŠ2J6¢hD#ш^yŠ´:ˆÓö_Þ÷/Þóæ¿QïwîNû5Mc.Äd:ûG?üMer-³§R… ÝÀBÆ’éL,N %„ÄT=O§Ò)#®ŠòX`CPºP*Lð”ÿ¿ñ÷:¶©* ÝÕ"„„\ ~„ãTâ+-ŠhD#шFô5@c…P……þ(”(”Þ Ñ ZÁ!‰1þÿ—Ÿü¦×¾¹avuU£Ãª{6BQè À—ú-+„ßÌ*ô GJ¥T!”ܳw|WïT¡” €!¸¯?ýéÿýÿöÃo¨÷;–çb„)! ¥$ŒKB0†¨*¤°<·ÚkgãÉ7Ÿz EZºùÿð¾ñ…V!¤RJ1‰Z 3!Ós[VOH1ºxшF4¢hD/Mgõ~7¦iÃ66Jhßêwë^µB­Ž!tUýƒúWïùÀÏ?¹t#®éBF‘:°BST!BG]ã,Ïéõ:HJ6”tá> cppõÅ¥hô»ŒsŒ ˜Å(¡}«×sltÜí¬å¹Gz'˜˜®íœ%Æ$Òêò“ûÿþ»¿¸üô¿ø×·÷·mß#+”` )…€‹`”6âo÷y!ÆzÇ»ÿÈÜÉoýÛ…‘g›‚òÜúâ³ëw†{Çû,øî·}àXIbŃJJaœß*l=¿±¼TÜ-v`´“HŠšK¤æóãÌž|ëéóN͈*‡Ê“å„RRB6kåOݾtmw£Üiœa„Ó±ø©ñ©GOœyÛéóNÏQB¥”#•nD#шF4¢½ê4PzÂ+ȯ¶4¯/{PÃÿ= üç^|Œ‘ÒÆ… L†½åÐ]ZÝ‘¿ÞÝ%d¤ÒhD#шF4¢£aÕᘿ"®]/©¥EZÇç3¥p±xØX%„`œ©BÃÛÌû$hÚ¼{Ç!²,‚õñÒÆ9ÂÑI) !”Ò0M™”R"Œ&·»PE‹ô³ÁMë=äÀÃPyhçh#‡Bž %#‹’¡!ᢻå½ÈÃ#$’‘‘óøw=Da„_¢Ùã¾43w÷õJ4û2$s?ý¾JÜŽ˜ù’šè+>„¯6f^ ÿ¬õê1ó*Éók}š^¥1¾J’yyý~µm•_UÍ‚«ØËafÈÅîîOíËœ;„З·ìÑÝUàÞ1¿t å±ûÿ¡Þ]âeÛB#-þ^¼¸k‚ÑÝ_Æbº»ß{8ÂíðB9¶–Dr \†tw­c†:9¾øµáeøEEwðäð p¤ÌAïCÍûðîŽî.pw;/¾BîgS¸f¾”¥z_ô ŽñE¸½W³/9M/ÎÌËxqî>qËÌ—9M÷³€‡‡ó"kæeÌÝË”ÌKMô‹ AJ‰0F÷ØÓ¾œf_ö^z¬^r¥½¸d¾ÌÙÿ’ð½j½¸d^röïÅíKJæØ¯À½^ŠWüÝÿò§éþçñË_À/oBJé3Ï<óû¿ÿûÉdluBˆ÷¿ÿýóóóàî}jïSž÷âù~”è90öøãüãO¥R¡~¿ÿîw¿ûý£Ä9§àqxD>¡ÕìU"v3ø¯Dº“RÂdH/ñPª»káð«PøP*€¡ÖÐC!†»¸ûadÒCøáð;BFM ÕÇÕ¿HŒ±2Z‡j Ms4p&?n–q5Ë8‡0( ‡ !š•ýacB’ÄÅÃ4sBprÈå€fø‡QøG.¸ŽJ„|Æ¢¾ØP-ÖŠ œidà k ¨å±j1ÁyhµöXqè³ š…¨Y/8¨p>¡à°B„gÐ/㜇¢‹rÁ×`k"`µ"nÎEÈŒøcŒ±øLðP\üøZB@-Ç÷[Ÿ·g"¬ Üñ}£ƒ!`Œ}Æ ù –0pÇ÷€Ç÷¡Y14Æáfmßã!3ôš…U'‘´<ÆÈ8bcÚ¾cäBølÀŒÇ°$,ÏåR@-Ûs#y²ËsÂ! :)¥Ï˃ ny.0ãþ Y)M׉˜ ¡dÈg,bÆtÁgÜ |˜hƹøƒZœE’é»64pæƒEeºpËï»0ã± ÞwlcÀ¬U„ø0Ѱ$`ŒnàÃŒH„zŽ Ü2ÎÝ`°˜-×1 )zŽ%†&†àø^Ø,šµ}Ï E×u,]Ä Æ¸ïØÐ,¢k[Q-;d¦k[ÀŒÏYϱ –ø°¨„ÛáLϾœÀH†óŽmÝ=MÛf|Æ"»a³\ˆŽmF̘ž µl߃f}Æ:¶9‚ë8í{ð{,y"„:¶ ýœ·­>̾é9ÖP³0û>cN¸Â;¶«Ž Þ²úâð4!„ÚVßç f¼mõ¡VϵAt\Ësáu³}¯ëXÑÛoVÀYËìI$1ÆŽï¹¾¬é:!3Aôºµ-Ó4ËMÏ…wß |;d¦iö@tg–ç‚躎cB˜žÃCfÚ– µZfÆèsÖèw¡–ã{ƒ¥(e£ßn}XáKjy.È“ ^ïw`…»ï>,EÓs‚P2 ³7Œc˜‘²eöïž} ¼N¸€À,`„ú®.`MÁp /!¥í¹ ÏáíË ühŸAݾ}û÷ÿ÷ë·~ëøÀ>ðÇ{¬X.â"„‚GŸ!1ä‚6ôýø°† ïv¨ „ŸõêËÍ$ú;‘.\øÐ‡>ôØc=öØcúЇž{î¹H'¹[eÂIt—¦üÊý™Ÿù™F…$BŒPGÔ,PZqxŽÒ·0L˜‚"†4„œ`2Ð0¤|/¨c&8ã#Œ0 8çBŒ9|\‘$˜ø,`æù,à‚BÎ|ƤD ¥gLpøÅ “B¥ lµ*U`¥r)J½ ð˜Ï¥T©âsæ3_STðEԨ…°|OWTŒ±x皢¸oû>\WTŸ1;ð UóX`z®Ï˜F‰dϱ5E%Û¾ç±@WU„P×±! ¡>c}׉ëºÏ‚®c{¯QÅñ½¾k3)TJ;¶å>ÁX¥JÛî„UªtlÓt]!¥®ª=×vYS5)e³ß…¾šVßrJ—¢iõÀ3­çØ]ÛR(„6Ì®é¹ ¡ª¢T{…P•*nà7Í^:w¿ÞïÙ¾«+Á¸ÜmÅu!Tíµû®C1ѵÒmL4E­õ:Û”HRB*½vßu4EUZh7 U£„”»­ŽmRB¹à•nËôݸ¦K‰ ­zBQB:¶Ù±Ít,Ž*´ë*Q4E-µ›-³/¥ŒëF¥ÓòXÐZ¿Sëu|Æ M+µ›-«O 1Tm¯UÃÇT­ØnÖûpÝoÖ;Ž©«š®¨[õ²¡hš¢ö]§Ønä)Œñ^«Î8OèFÀÙV£’2b ¥µ^§e™¹y³^¢„Ä4ÝòÜF5ŸLLö[u'ðÒ±8b½VL1‚ñV­\ïwUªxÌßnTºŽ‰'9çkµb.ž¤„ÛŽmåI‰äJe?¦iš¢nT‹•^–ýFµØ¶Ìt,Ž^,ïeb •*ån«Úm§2Õ^g»QéØÖX2íÞzµ8É÷{­Rl˜Ý¤ÓåVa+K(„.—÷Ê–¦(n¬V m«—O¤¹à‹¥Ýñd†²Û¬ÕûÝñT¦ÐnlÖJ}×ÎÄkÕB¡Ý@¥c‰Õò¾í{¹Dr£ZÚiV-ß›He íF¡Õ˜ÊäJíæje¿iõ'ÓYÓuî”væó]ÛºSÜ©tÚ™x¢Òm¯U ¦çfbñÛ¥ýVbšŽÅoíoœgãÉ¥âîV½Ì×UíÆÞf±ÝŒkzB7®î¬Åu#®é7ö6¶J‰òúÞf¥ÛK¦wš•Õò¾å9S™Ü^«¾]/ÏåÆBWwÖJSFüúÞæV½ì36žÊ¬”÷j½ît&pvas9OÆ4½Ôm-•öÆ&B×w7ç¹DòæÞæj¥àøþT&·Q+í4«ó¹ñZéva»m™ã©ôõÝõjAH9žLßÜÛê»ÎD*s«°½XÜí;Öln|·Y])B=»¾¨Pš‰':–yaséôÄL×6_ØZÞmÖò‰Ô~³v}w£mõOŒM–º­k»ëg'g ­ÆÅíÕr§9•ÎÝ)îÞ*l[ž;›[«¶›Õù ‰ÐSË7âšžŽ%j½î…Í¥§ç«Ýös‹{­úT:»V-^ÝÙèØæÂØäN£²XÜ9=1½Y+½°µRî´f2¹«»7÷·¸š¢~qõæV½2žÊì6ª/l­´Ìþd:ûÜÚ¥ÒÂh"•ýâê-/&ÓÙ6–¯ím:¾—2âO­Ü\¯“F,O|êö带gãɧ–oÜ)îœÍdóÏ­/6Íþ\nüÒöêå­Õ¦Õ;=1½RÞ¿UØ:75‡úìâU„ÐD*ó…Õ[×w7|Î MûÜâÕõj1—H¥cñ¿¼þ|>‘N±Ïܾr»°m¨šøŸ[¼º]¯Ìç&$Buó……±)]Uoìm.÷˜š»SÜùâêíR§9ŸzõæÕuJÂèS·®¬×ŠÓ™|LÓ>võÙÙìX\7–J»—·Wž]X)ï~ùún³z"?ñÜÆâÅÍÛwOŽM½°¹¼Q-›š½¼½úôÚíJ¯=—ûì⵫;뺪úŒýÕÍ‹Õâɱ).ÄŸ]~úüÌ /ðÿòú…Û…í”aŒ%Ó»úlR7ò‰Ô'n\¼¼½æ±`alò©å›û­úÙÉÛ÷þìòçóãI=¶XÜ}fõöëNœ^.í}úÎåõjéÉYÓsÿüòÓÏœÐõù¥;ŇfN\Ø\~réz¡]dîäv½ò×·.½éÔ[õò'n¼°TÞ?5>%úðóŸhfÁçÁŸ_~úêîÆX2]ì4>qã…ÝfíÔøÔgî\}výާ'¦ŸX¼^h7ÎNÎ<¹|ãóK×ÊÝö#³'—J{Ÿ[¼öÆ“çBrñ ÉÙìØã×/|qõv×±˜š{fíÎRi÷¡™\ˆ=ûÙ‰t6—HýÉÅ/\Ø\Ö•qþ߯?¿Q-ž›¼¶»ñìÚ¶Ý?;9»\Ú»SÜ979‹úÌ«Uò‰TÓì=³vû©¹–Õ¿°±¼ßª%Óû­ú­ýí¾ëä©›û›»Íª¦¨^Ü.l7­~.žÚmTwšU±|"µ×ª·¬þX2]é¶÷Z5ÛóRFl·QõôÂ… O~ösš¦aŒ"úïýžÉÙ™˜¢v]»kÛ)#Öwì¦Õ÷?®ë\ˆ¦ÕK1Ÿ±ŽÝwƒ@¡ŠBiÇ2!ŠžÇ'ðtUóYàø>ã¼¶ï©„‚v:œ1&¤¤„ )á!ØTEyê©§žyæMÓ!Œ±w¾óßôMß¼Hw µ, :‚(}è¥/ú¾T:XO¢A×GtÈûÓ)A Æ¡ù-¼Æ9 "!&¸”R¥”KÁ¸€ yL.•8C+”2ÎÎ/cB]QÁÚ5p®©ÊÝk"KlÀ™¡j MFõY +*F(ØÉ‹ŠxŒÅ4 ŒLQF`7ð E%{ŒÁ|îð( lß7UUËs|$8ãÜt]JH\Ó£˜Ñá…gbñè1$ÇåI”ŠÅ-ß5]'¡ ¥]ÇËÆ“^tS¥JB7LÏ9Ê””¡¾ëÄ5MSÔè\޶<—`œ‰%z®=(ˆqÀ™Ï‚ñTN‡†ªÅu½çZa8ÐX¾'¤K¦{ŽÝ±­t,¡ÚwPô£>£ÉŠŽ’g“élV]ßu¦Ò9Ÿ±z¯CK¤Û– -„A«žÉæMש÷»q]Oê18aK™™Ö…’ÛCòZ µ†žÃÙ£c[£Ét¶ÞïÔû©tŽÒ±û-:dÞ›%˜ô› 1›k˜ÝJ·5‘ʪÖèwa'Bá¹ ªT{íùܸD²c[8Öz\"‘ŽÅ«½œ2)Á-«‡šË—;­b§9—S(mš]8PW¥Ó:5>Å…ØiT„”'ǦÊH cÄ…h˜Ý³3ÛôY@àÀ†P±Ý896…lš=ÐGBÅN3ŸH¥Ò;õj½ß939ãøþf½¬rj|ºÐ®Gâò‚ c›çgN4ÍÞF­”Ž'¦3yÐ&¹””–Õ÷{pz¾ÔnnÕË3Ù|&–X¯[fÿáÙ…¦ÕwŸ„æ|ØU(&¦ë˜žóÈìB©ÓD!„£S³ åÁÜ I0öXдúž8]íµ™à¦i¯Y{xæ|±¸ËÍÜ©ýf *‚¨+ÖÎ6Íží{~Ðlh€GRA ÙnTó‰Ôt&¿\Ú/¶›¯_8Ûsí¶Õ§d0õÒ™‰é„¦ßÞßnYý7Ÿ ö‚ Øi~Ý™‡êýî½lRÊízåçiö{}8U†C€Z=Ç®õ:o?ûp¡Ý¸¶»1“[ÈO.—vBð,´êgo>õÀRi÷ÆþæÃ3 ©X|£VR)š’R¶µXÜ}Ë©1Æ·Vßÿº³¯V WwÖÏLLOgò+å=‚ Ü´ ð!t«°ýúgâšþÂærÛêÿÍ_·^)‚É J.•vßqö/.l.K)¿îÜË…ÝËÛ«¯™;™K$W*û*¥Œ3•*«Õbʈ?zâô­ým„\!N¹ßðУKÅ]„ÆûDp5qˆ™k»ëoX8k¨êj¥ R…‰ÁRŠVïÂö7œ´ãXû­šJ)|®n¯?4³0–HÝ)ì¨T 8Óe±¸›Ð·žzðÒöê½Íwž{ Fø +·ú®ý¼i±¸ƒÐv°TÚýæ×¾¥ÚmÕû…(ÑÕL“é:û­ú·=ú¶µjDÂg‚«TÙª•ûžó¼ñNaûâÖÊÃ3 ©ì…¥B«þ·z}©Ó²<›½ƒÙ¤çV½<™ÎL¥³+åýr·õÚ¹Sn௔÷Âg&f ­Æ^«6ŸŸ0m»Qî»ö¹ÉÙ¶ö¿Áfw.7.¤(vš\ðéX¬°,$)åD2íÏXä¯Ö÷œL,Žr|?rdr|O£ª¦¨Ð°b"Ão½¦(ã€qŒ0’‡þŠbB(T‰‹40!]»W(´ÏÝ“^=Bè+=ßç³^J÷ú;¾ïWz%Õç¡¶ðP,ž{–÷©HƒsàÛyÐìKqþ’#“G Ëã"ïn^˜—dþXo¨!ÉÜío042)#)½(ç_úŸ_´âÁ î¯‰ßÏ"¼Û‹BŒË#ÏD÷âÓˆ ñx÷3|[øî¦åðÿBÕq,àᇡ꘿ Ñ?ð‹ËH¢/ÙEÕº[´=º‡Ë»Û9®m„б1y¼ŒF¡ÆŒñýci!ÿ2 È} ~K‰"Я”øÐ¢ênCa­C;”<î%”¡¼îý†Ëцi ¢rNÈጄ¢;þè Ü Ç ÃZ÷Üa X+ÝÂô•ºJ#7Q8t.ÊÊöˆèÈ}/E‚1:zøGÃÉ`\wÕÝ@\#ŒdÈvtD9vy ú=ju€É ß{]ÊÁ›‹exÇøn(ÀKHfL†S>x8Xi0¥—)>þ½ÚKð½º8,ÎÁvëWYÏúH‡UºÈ‹÷ˆïo‚,2ZawU‚SDH ­š…ð3ƒ#àË¢PIÉ8W…³‹”RU‚‰ÏŠÉð P)õÙÀªwx4ƒ…«Å J¤Â‚»W‰:Àãc6«(¶ïC6è57TÍeRSyt?vQb„PLÓÜ K膦¨}ÇVMx8Å5=¾T(U)í9vLU0£¾kÇ5#iÄ,Ï 8ËÄš¢t,SSÔL,pfznBe c„PRÙ¾ç³ ©2Df$tCHÙu¬”Gá‰\¥Š¦¨~7®é¹DÒ |ËóÒPa)eB3Æ-«—ŽÅ²ñD×±˜ài#.¥$CïðÁ0–RÆ4]¥J­×…ÛX~RF¬ÒmkŠ2™ÊrÁ›f/—H¢Á9XjŠSµr§™0Œ‰tÖö<ÓuòñAð½?øt Ùº‡ Ð݆'}¸0XD²ñ„”¨ÖëL¤2“élµ×æ‚gI8¢EûM´‹€§A:W)všc©ôL&Wïu]ßOe„æþƒ*Sél¡ÝÀeãI!¬ÒÉt¶c™]ÇšL礔c.d>‘–RZéLn6;Vl7çcÉ´‚Ü5®Étv»Q!„œ›&ï4ªS™\8wˆ2–LoÖJ™XBST!N»3Ùün£ŠK¦¹”f.;Þ²úM³wz|j<™Ù¬• U;;9øØnTæs㑸tEÍÆ+åý\"unr®k[åNk.?(À…ÈÅ“š¢¬V ³Ù±ÓãÓåN³k[ç&gó‰ÔRi7Oª…îDÙ2iÄ’Fl±´;“É£¡=RqAž;]UóÉÔ­ýíÉtV¡T†c\›\.íL™]PY,î.ŒM@ ê™Lþæþf>™†èö$\Í„ ôÈó#„851Ý4{ånó¡™ùÙÜø½Í”Ë%R\ æñìÄÌV½lºÎkçOç©«;ëS™<0e"C¤ë>;9»ßª7úÝ×ÍŸšÉæ/o¯%Óð’ÂÀ˜œ]*íy,xãÉs)#veg}67þèüéJ·]h5^;úäØä•uCQß°p!tkûÜÔ, ½ U›Éæ_Ø\žLeÞ¸p¶m™›µÒù™y„Å„s>™Î¦b±ËÛ«g'g×TŒOO]ØXO¦S±x4ÆA-!Ò±ÄD*óÂæÊ\nüM§(uš»ê#³'B”Ѐ³ùq…’+;ëç§O¼~áìRi·çXç&gΣLP@Ìž¼¼½*¤|û™‡ U»°±tvrö-§ج•ËÝæÃ³'À‚{dö_7úÆÞ¦é»ï8ûH.ž|zíöÙ‰°ŽCɇgžÛXÔõç^ƒ1~~}鑹…·ž~ðNq§mõš9pþ<NÏ÷]ûVaëÑgàûÅŸJç²ñäS+7ž]€½ „K"b¦é g¯ín¸w~z>àL!fš† õµs§¾°r+eÄò“ç¦ó'Ï.•výîëæNœ)Tñ{dîdßs®l¯½íôùן8ûìú.Ä7œ4eÄ?·xí5s'ÑšýÈì§ï\-‹ ¦Á—Q!” ‘2b'òŸ¼uéé90'G‡i:;9›Ð'–®¿vþÔÛÏ>¼TÚ­ö:ï8÷È|~ü©•3™|B7¸8˜22´ïÂ{qfb¦ÚëTºí‡fæg2ù;ÅCÕÎOÏ !7k¥ùÜÄɱÉývÝñ½ÓÓI=¶Q-åâIJH4„ñdºØnŒf³c„àªÓ¿¦aªõ;†ªjŠÚPʈu IÓ4¸JBÅ5ÝçÌgALÓÐa~ß*¸9ŒàÃO…ÆlG‘öG{r ÒÑF_Âá=BtV:øº2è8×ðï÷ùðÀEoTd¨ÝˆR)pP+:Þ£_åÙ•NâȽ™9\K« Æaˆ õ;;ñÐÂ`£†˜7ƒ h@? ï\ à[0(08‘af > €h–‰Á 5@à³1<„èw¸J†`ÓÑCÀ.¨T Ljá»È9‡d&`^Žš…\!€Öa1ð¤B‹1&d€Ïààò8,Øõ!Lp!¤¦(ÐF˜"„ר}!„àš> ê(¤"”Œà°ÉË“ †æ‘`ù€[ š¤Xæ½ C¿Cç°ÂC8<0ÎÁ| ª¢Ü=M°-z,PÿŒhà¯+ê YL!çŒsCUÁ[”¢REHÉÃf™àH¦ üJCf¨Úð4 !\èŠJ á‚ 9XŠnà+”ªTB0!TJ¡/Œ°®ªBJ7ð5EQHÄA³+„r!¼À7TâDÒP5Ž(„@PuŸ1MÇ;¾O0ÖUUá>8hF³òƒ<†Lp/bš3"‘„³pÍÀ¢ÒBqÁ¹ŽïÅ4Â8ø{(€ ÑUUÀL$t\;Æ*¥BË÷bš¦Ê8çRÀ,œ›,q4ð¾õ=„PLÓb¨\±q!`­Zž ^¡\pÛ÷âšA 8—R·> ªÀ‰—q®* Á¼ÈãšÎ…°<'®03–çªTÑU5àÜñ½¤nBlß“NhÂtݘ¦©TñYà± ©Ç†0Ürݤ£„8¾Ç…H1@±À96`̼”‡+lŒ°¦(\Óø{œ OÓ YÎMÏIqJ8û'˜€1ªPê±À ü”Ç÷]›×t!¥øºªŒ}Æ„°fz®m¨|qßKÅb“¾ë`Œ’zLHá3¦R…Ø,CÕB=ÇÖÅPµ€3ÓuÒ±%Äg”RW5!eϱâš]Nàeb ŒqϱBãºØ,MQ)!¶çœgâ )eô’úŒ™ž“%`…#„`{a-`Þý®m©Šó辡é O)%œ^º¶× ]US5¨E I1.„¾¤–ç²™ŽmªÓtŸ}×ÉÅ“f0ÒUÑq¬¤nhŠ0ÆɸO Õ%à¬k[Ùx|Íá%ᎡRê¾í¹¹D à”PãzŽ“4bê`ö…®jÃkFás‡"˜\Ûs UÑœÅÃwŸ‹Êg®ª“áíËcdVõ|_×´Ç{ìÇ~ìÇ(¥<¼G¾xùÒÛÞòVÁ9"ƒc*¼ûøýØïï°¶pðm…ÊÀ±*Ä žA ªêûßÿþÿðþƒ¢(!ÆØOþäOþʯü üé8å6\¾Â4Èñzļ>ÌÁ1jàqfÊûaðH³÷¼¤ˆ`ÃÇ•<öòå%¯3†õhü¢ï]kÀØÁ]ÀaSÐñc2D‡Ï£5®*0Ä×°Y":ä‘È€€Pt#ËãmQµŽ,ÆE–öp\ÀL¤| à/á‘—`PÒ° yÄÒ‹!5(d‹`Lè1k’AèHŠ–·82kEc¤„FËc<8™E¡ñ‚Q4¸È|8|Í8lÇB¢-@UŽ‘âƒiЦœb³F ‰ä¬:´ê¢ZÝ_J©)jdhDƒ›k êuø. ØVÂ<Í!•*CñaÜ;ª¢“”B´ˆÃAŒ5ª Ñ`š@¥¬´¡¾"¶55K#ÆHh;'ƒ®ƒRèÁ4Eq> !š28pkÊ —6ÆXWT5EŽÖ¢˜è¡”¢WcÀó·4‚gEÌèª:to00|T`ÑR-46 YYšr‹±¤(´áÛèNth>¡‘/:×ÅT .@ &†ª‘Áp°Ä¡íd(ÿ#ƃ“aLÕÀrO0mì3ð J*¥4ja„cªV…P¬†ë‡†ë“¤1h4ËÐBK6¥4Eb8\ÀÑ.SuX؉€}„!´ÀÁ`Ç@£áJ%”¨ÙFÒÀ°˜Ã'¡cª+P¡4¦éáå€6¾ÈðÞ…o< `}¦c‰ÀÃ#×t˜>U¡ Ck =†Ã>zß UÓU4´¨`¾hð{´õ m›+0¦é” þ »ÈS†V€„n€x'ý&!fÂ~uEUé`öº>˜\J³ñ$:`‡ ØPèк=xIû'¨k(<¥£ÐZ RÔE¥ Ðcbš#"˜$t]Ùb»Úà­8¼E‡Kîý^7•ÒHbª2H{?xØì¦c5ÜÈÐ=Làß&>áCr4tȽ¾Úúp£#|ÔÍçEu¤A¿÷n ½j4@¼Êc¾[Ÿ8Œd‰*Hc„ÐpD &MR$¢`ÈñâÁ/`µy, ˜ðÀ çl\p° ƒé‚pÎÅ¢g}Bˆg`hq_H¡P*²=W¡”` XUœžF`W°=WST!…é¹ph8ë».RSŸ3Û÷tUÅ›ž+¤P… Ñwì'뮪Žï÷];àΈ}׎izÀYǶ\æÃîß¶L]UÂÛ„¼BiÛ6a_ 8ïØ&œÕú®í>X›fOUJ¨ø]ÇJè€XÁ¶!¤¬÷»qM—RÔÍ®éÚ*UT ˆW¢RÅ ‚¦ÙKÅâ êýŽå¹1U3=§ÑïV®ÖïtlK!¯cMQf¯iö$’1MoY¦í{ ÝèØf­×83T½Úë´¬>|«ÊÝ–"¦é ³WëuàzºÔiµ-ÓPU7ðKí†ø€º-vš¹DÒ üB»Þsí„ntl«ÔiœÇ4­ÐnÔÍ®®¨>gû­ºå9)#VíwÊ&¼É{ÍjË2cš¦*Êf½l¨š¦({ÍZµ×!„Ä4}¯U 8OèF¹Û*¶\ˆ˜ªí4ªõ^7¦éŽïm7*–ç¦c±B»Qê´B ÝØoÕmÏKÅâÕ^{·Yó9KhÆN½Rî¶TªÄ4}£VR&tà ‚õZ1ŸHœ¯×Š~7®ëº¢.—÷uE5T­mõw›µ‰t¶çØëÕBÓêgã „ÐRy~Y­*ÝVLÕ M[*íBâš¾Y/ï¶j¡t,¾]¯ô\+—H;ÍZÉñ½|2]ëwöÕÉL®eö—Ëû-«ŸO¤ö[upc×íNq·Üi¦cñŽc.—öz®3‘Ê´¬þzµ8ÉaŒW+Ës³ñäN£ºV)‚'ôØâö~³ž4b¦ëÜ*l·ms*í¹öâî\nÜt[û[¥N3ŸHÕzÛÅ'ð3ñÄÂöV£¢)JÒˆÝÞßö9ËÆ«•Ârynدïmì5ë)#Óô«Ûk1]iúÍý­µjAWU)Ñ•õr§5žÌìµj· ÛnàO¤²{­úV½<›C]ÛY#˜¤ŒØ­ÂöRi¬’—·W÷[µ±dºÜm]ßÝè»Ît&_î¶‹» c“õ^çÊöZ¥×žLgת…›{[0e·V¶åt,×gÖnÇ4=iÄêýÎÕÝùI‚ñ­ý­žc§2nà?»¶8žJ몶Ө.—÷Æ& ­ÆÅ­•z¯3Ÿï»Îs닧Ƨ-Ïyn}i«^K¦ U}bùz>‘2Tíù¥¥Òž¦(¹Dò¹õEŸ³±dúÆÞæÕuÓ™Üj¥°Ó¨ÎåÆ#Äkʈ?¿±t«°1Oe^Ø\î:ÖT&çÁK×ÇS阦oÕˋœãS{ÍÚÓ«·ËæÉ±IÓuž\¾q"?¡*ÊÕµb»5Ÿ_.í=»¾Øµ­éLî¹õ;×÷¶tEÉ'R_\½íøþd:kzîgî\YÈOrÁ?¿x}±´;‘ÊTû'—oÔz33õ~÷éµÛg'g ÆÏo,6ÌÞlvìÆÞæ3k·-Ï™Hež\¾~c+Oõ\û³w®ÛÓãÓ¦ë|æÎÕ33 ¥—¶VvšÕ“ãSwŠ;O­ÜlYýÙÜØSË·.m­¤Œ˜ÏÙ'o]ÚªWò\ˆOÞ¼xblRWÔ{›‹Åݳ“³+åýÏ.^-w[ ùÉgVo=·¾ˆ ™Î俸z«Ôi-ŒM^ÛÝxrùFÛ6OOL/—ö.n­œŸ9±Y+êöåFåÜälÇ2?qã…sSs*¥/l.¯WŠg&gn¶?sçJ¥Û~`jn«^yrùÆ#³'1ÆŸ½s¥iõOä'ž]¿óäò ËuOML_Ûݸº³þÐ̉åÒÞ_ߺ¸ßjœŸž/wÚuã…‡f(!_X¹¹Û¬ž˜¾¸µòéÛWz®=›ûÄ.l,å“)ÓuþâÊ3›µòÓs=Çú‹+O?8=¯)Êó‹w ;NÏ_ÛYüÆ ånë¡™[õʧn_zÝü)‚ɧn]jÛÖ‰üÄVn~êöe˜²?¿üÌ ›ËÓ™|µÛùÓK_ØkV™=Yé¶ÿìòÓo:y®ÞïþÙ¥§oìožŸºSÜýèÕgÚ–yblòcWž}zõöX"mºÎ¿ðäFµøÐ̉¾ë|øùÏŸŸ>¡«ê³k·ïwÏOÏ_ÚZýØÕg‹íÆkæNm7*ÿýÚso>õ@¡Õøè•gV+ûg&fnìo~öÎ5ÓuNO-•ön¶ÏNÎlÖJO-߬vۧƧºŽõôê­…ñ)…Òk»M³;É3ΟÛXLÇqM¼ü\n¼ÑïÞÜßjZ½±dz·YÛ¨¹àÙxr¿Uoš=Øg¶êeÛ÷Ò±øn£êS|áùçŸøìçH˜ !ô¾ç?xú !¤ëX=dž#J­×ÁiŠÚ¶Í®k#„tU빶Ϙ¡j¡®m*„‚áÖö}]UÎ,Ïc‚+`ÒP]¼À'˜$|Ht€x¥xÙTå‰'žxöÙgáœ#„øº¯ûºoþæo¾ñY¡Ñmñ+JÇÂ#Ž*—¡éàˆ3Œƒ$%žÁY º<Ê‚\uÁ‡›A.œ ®ðøMzŒ1ĵÒ… pgÃÞêšRhT Vò`$‡9v‚ï™ßË <±˜¦3Á™àøÀøt€°CCfd§Õ ¼¸¦s)| ‹.²}OSTJ¨ãûáu*LkLÓlÏ;ܬ‚û ø†0œp!kºÜCAˆ#p¨²<—`Ótˆ¶%²K¨j¨ª(Û´=/›HzAжúᔪaÌ8w|/ŸLAS2„–ö+ŸHŒ5Íž"O@ )ˆÝ'¤0=g<•±}P“I#Ö²úÛÌ%R,ŒK–ð¶Õiº¦¨õ~âG¸¾_ëuB¹x²iõZf?Ob„«½ìk€ªÓ-¦éM³‡Âkâ¾kûœM¤2Í~!$„DRr!ºŽ5É›žSî¶(&éx¼ÖëÔÍîD*#¤(uZ.ó§2¹F¿ Y"„àfû^©Ó”HŽ%ÓÕ^ ÖöàÆ8'„Ôû]CÑRF¼Öm#„˜àIh .d«Ýv.‘Ò¨Rïw Áç@¿æ“i€p³}·ïØóÙñJ§³+¡Úm-ä'º®í>F˜ P¨©T–²Û¨vlëD~¢aöv›Õ¸¦ç©½f­ÜiÈOؾÛs¬Á…,B!ƹ”HHQíµOŽOµ,s»QQ‰2•Éí5kû­ú|n<à¼aö&pÁ]h×SF<Kl×Ë•nëÔøTßu6ke)щüÄ^³C@ùŒÕûÝs“³µ^g½ZŒkúx2ÎÆm«oy™ýV}³VšHeº¾^-Ôz§çk½œÙ‚0.ü,Ïm[ýóÓóÅvc­RÈÄ“¹Dj­Z(¶NÏ·­~ßµ1ÆðâoÔJ3Ù¼Bèri¯iöš]¨tÛK¥Ý˜¦O¥s›µ2ð o„ô‹$²•ùQ,C) Àzµxfb:à¬ØiRB\@.ít,žO¤6ªE¸Ö¤˜”;-'ðœž[¯£±ø,(´¯?qf¿Yƒ XQì=8Ç6Í^Ç6_;wjqÁÃ)“ DåbR.—÷œžãBì5ë”R7"qÁú\­_âLϵ¯í®{,xxöÄbi/ã †¢ ¥µ’®ª'Ǧnîo­”÷_;wÚòœR»AÃ[Ÿ¤@­U o>õ@£ß»²½F0ypjîÖþÖíÂöó'¸ÛJt‘ÌÀk¾XÜ}ãÉs=×¾´µê1ÿu'Nß.ì\ßÝ8;1£«êZµQ–ä °"‰ÝÜßzôÄ™€³¶–;¶õ–ÓÞÞ߆!À‹;o?óP¡Uï9vä¨p}oã‘Ù)ÑFµ¤Pê>0Ã`à7ö6Þzú|ÃìUº-Jp[ÀcD2àlµRøú^³V-º/ÃÀœWvÖÞ°pÎôœ­zE!Ä9¨Å`Œ· Ûï<÷H¹Ûzf펔ò g¯î¬_ÜZyíüI„ÐJy_¥ŠíÆ0óxewýç©õ:ÅvnÀá“2äB,•öþÖC¯ßiV¿°r3¦j¯;uacéòöê[OŸ7=w­RPµ=—`|y{\l¿°zk±¸ó ç­öÚO,]çR¼õôù‹[+Ïm,¾aá BèvaG¥Ší{0MpŠº´µò®ó¯«÷»»ªB(Üœ^Þ^=51‰%ž]¿³U+ýl7*àl±!ïw™;é±`¯U£„º,€!°pK„¢ÀŸBŠ@p„Ðn³6“É+DÙªW:¶yz|ºÞïÂ÷äYíµg2ù€ób»és6KYbˆ†aïÑïðyeœ{A6âðyކp05/ÀLè>ç\STÎ9FU÷•*R".Äa%ìK²è ò èݰëÚ+Nw©t_2TänÈQÇ{!Ñð‹öÝ"A³' Õ“è>ôßá†È™a8• Ý–ïD:RÀ7;ž!$%FpÃt:xÈ|—«f„d÷¾@V/`L0¹ü3\+І×p€††Ì ¸•.,®9@„„1øÿуk܃`0ð”xÐø¥Ü«b6"ÜRL&bàë@x¹E®~ !Ì~àw(!ƒfÑà’ I) ”Ѓ!„öf¸÷„ ãpÌ‚7pƒÃ«„F“©ïàË CP("Tºòƒ(„(!3\¾DÀ‡,„à “áûŒ±cveÞ˃R×RR‚ç`¢!ºì»r¶' ¥èn.Ä!T&м$¥”U0BŒsJ)’RªT¡0¹á¹ ¥ ¥LpbÃ1Î#O¾hÍ)0Fº¢"<ˆ[¡REé"\¼J)ÁQÌä!]QLÓÁp;XŸ`äf‚«”‚ÛÖàÎc. ¯öÀˆžga]QBç*¥ª¢Dþ©‘<!-»+:éãÐQAJùFÎ|0F…C³„`ŒÀs\WT>$s)1Bºª 0>ð€;k.8X»K"¼„·)ºËƒËa!¥®hà ˆ‡\)p蘗†àšvˆ™°¸*¥º¢‚ £¡j”PzÓ†â(b¸NúŒ)”ªF UƒyÄGˆ[L`¼1M£˜€G]LÕ@75TM£ œ|††@¢Ý#¦j ¡^PBbª>$O†ƒ˜¦áÐùȪ º»‡¢‹k:x.b|€™#áFè îo\ˆ˜¦)Q³CÈ€A>u‰âšN0w´¸n@Dª˜ªÃZÅÑpJI8F)eä[I†öRBÅ„ ŽLèFÈñ}MQÀÓŸ ×t…ÐáZ红ªæ3ˆ7‚‰ã{*UâºÎ‹kgfðP_0M‰pc€×  1ÃÃ-z`—2`)†^æ‘dŽó;zI)… ®¤Ñ`ÃáçÁÅœØéñ_໿áƒï`ô¡^;ä t¤¾D’„>0‘ Á"ûþ€— WËwî(Ý¥ÒE Ö7[ä̓"ðóa¶\%@ … ˆóè“ú<… (!á@0‚á[8°ê6 ˆÊ8á÷Éç,xÅgC³ WìÇFBâ|(t„O¿QŸ3]UU…‚õkàj0çlÈúwÜ®«*„êÖ¨"Â:pí[4%ÔUKay®zœš„°ýè±Í‹‘í3®¦ç‚Ç4š… ÂçÌôœ¸f ¸’ÑÀ%B(¡Çlßu|?KèŠÚ²ú”Ðl<pµ(L¡¡*ŠB•F¿ ·À" ˜ÐŒ¦ÙÃç“)!dÓì'õ £1QB E­õ:º¢æ“)7ð;¶™'RF¬av%’ ÍaܦL,ÑwÛwóÉtLӪݶBèD*pÖ0»Ùx2O4̘ßTJËÝVLÓÇSËszŽ Aƒ%’\Jà¡Òmeb „‚ ¡P×ôb§¡+êd:ë~Ëì%SÙx²Ümq!¦3y‚I¡ÝÔ’’K‰1Nñýv]!t&“8«vÛc‰BˆK€ˆäcÉtßµ›V,™\B̬ñT¦ÖïÚž;–HÁwˆ ‘O¦œÀƒPÃ!!$ø§kŠºÛ¬Ô—‹KC6žÜª—uEkã´‡ÉT¶Øn8¾w"?a¨Úv£’2b'òãÛªvÛs¹ñ±dz«^&˜db‰È°RD#OnÔJ1M?9>i¹Î~«>—›Îä¶&D>™baò’™L®ÑïÖz…üd.žÚ¬•Tªœž˜öX°]/O§s p&„¡jI=¶\ÞK‰33-«_ê4g²y-<—HŒW+û“éìɱÉB»Ù´ú§'¦Ó±Äbq®h!oÇ€[!ÎSFÜPµÅâîX2}fb¦Òm—;Í33ã©ÌbqÇP´l<ˆMèD~b§Qí;öƒÓs ݸ]ØNÇâNÍ5Íþ^³6Ÿ›@ƒ‹‚Á4±ƒøpa²(Z[4ŸŸX.ïûœOgòg\ !ÄÂØd­×)ušÌ¸Êä…·‹;'ò(ÌçSµl"ueg-ŸLC°±á°^c©¬ª(Ww6 ÆrÀ9§ à ƒ¹ã!tjlêNqÛ ‚¹ü8㜠.Ã!€ùg>7~y{•òè‰3ç7÷·NO£!3žD¼_NOµ,s¥²ÿÐô‰“ãSWwÖ¤”3Ù|À8äBøœQBf³c6–cšö¦“çúŽ}këüôüƒÓó×w7a)‚e.âÌ?§Æ§/l,cŒß|ꀳËÛ«g&g^3wòNq§iöNOGùW†k›š½´½êÁ[OŸ§„<·¾ùœBNä'ž^»‰%r‰”ÏÀ$žŸž¿º³ÑwÓãÓ>cìðBç&gŸ^»­)Ê\nÜ .b¶ù,ÐUm&;öù¥ëSélB7<3Íœ¸°±Ä…8=>å³€Ezƒ| §Æ§ž\¾×ôwœ}¸ïÚϯ/=2»ðè‰3—¶W{®ýÀÔœÇãvãð=8=ÿäòuMQÆ&½ `<â–Øb.7þéÛ—ó‰ôß|ðµµ^ç…­•7-œ{ÍÜ©§Wo3ÁÏNÎx,€1>:z½V\©ì¿ãÜ# c“Ÿ¹s%¦ißpþQÓu¾¸rëuó§ß|êç6»ŽõðÌ‚ÏXÀ¯ô…zhfá3w® ^í`0ð×ΟZ,îÚ·~h*}rùf>‘J1Ÿ3˜²Ó3×ö6ÎçsããÃòŒ‚²¡ð|°¥ä÷ZuÓsNOÇTm£ZLqJàT)BùD²ÐjÀRDUœ~ä´zð¡<ø(]¾I)/ÚµMðŒºœ;—N"4Á\…v`¾Uàƒ“3ç Ã kÇÚ¡B Ë¡2Q¢)ü%šèäPò È&upùy|(þWHVT>æ÷»òÃîó!ç`UâÈC! ð„ƒ=+üý ?æ!ã ~gœW€³¡‡Q³ÁA-Æ8ƒ‡>cP€s3ì ;è+ˆjàœG|ÆÀø,„ðY5åAX ¬%Dô0®À ã<*à>àBxCMyµ¼À‡fç^àGµ¼ €ZŒj¹þAܽB¿> 5&„p|ú s|j¹!3' šõßñ=¨e{.´ÍB-Ȩâ²<Zðßö\X9¶ç·g–ëÀœº¾7ÜlØW`¹NÔ¬ ú2]†ãú> ð„¦ë@³> L×1:¾@Œó¾k3nà›a³¶çFÍFÌØž;Ü,ÔòY`¹¼_¦ëØžc„TTÐ4+„°"f‚ çXlÐì`ŒŒó®mè¼À‡f…=džf!ÉŒÑrݾcC_]Û‚áø,è;6 Áò\h6`¬c™Ð¬í¹=Ûfº¶ |ôÞ;cC³Œó¶Õ‡f{^Ç6EX ªÕ¶ú Óu W•”²ç †àø^ÛêƒÀ»¶ÍÂ=>ÈÖñ½žcGµ` ŽÃ{¶Í2ΛfÖëû]ÛfÚVßtXÍ~úí9vÇ2At˃×A4˜G# Áñ=Èp%„hš=hÖg¬e†Ð±Mh– Ñ2ûЗå¼T¡€í¹ÐW­×ð\‚¢mö]߃Y¨õ:0û]Û‚¾`ŒÑ4EC¨÷» :Ÿ±F¿ K±çX=ÇyÖºmè×tZ¯ ÜF’aœAÎ()e×6!©ç¼ÚmCpՆРû*wZ0Ñ=ǪvÛ°fªÝ6ôë³ ÞïF“ Ü2ÎÊ–åºRʾkW:-à¶Öë´­>p[ïuAà}Çn™=`¦ÜiA¿–ç–ÚMà¶mõaF|Û xL×!!*ÝôëAµÛæyš±†qVl7`Œ–çÖ{˜ý¦ÙëÚ& ¼ÐªGcŒ$Sj7`Œ®ïU»mLËêÃ|ZuX?Ë,µP ÔnB7ð+ÝŒ± œq^hÕamÏ­tZfú]Xnàï5kÀLÓì•Ú øŠZu£ë{åN^í¶«Ý60³×¨ÂFѶÌB«ÎBÛ¦ÙƒfKí&Dîh[}`&`l¯Yƒ1Zž[î´ ÙJ·¼À‡c$äɯõÚ0/šf –¢ÝwQ´Ïxí !º¶â‚&×ñ=X´àª/©í8RÊßú­ßB 'N}áÒÅè; %…^D/7üä Iá¬}Ö9çAxáw\k„Aø¾=<¬™ 4+ß÷¥”?õS?…R@¯?ù“? bŒù¾)!Ð#<š’÷¦#U†U)hùØvŽ"!\`ÊC÷ÁCh^qOîÆuJyÏþÐÃÃÿÄÇ„áè¸t¿ÇFZ=\£0üÌ]ÜÞÓÔ)íë%)dònùXŽeûˆîÅíKrx¯vŽ–ºI|‘vŽÌã0îø%k+„—äý–<žÃ{Ëá%gäÅ%öås~÷<~©]|I}+™‘ÆËõýô{?szì²¶¿Tfн×ñ²½ºŸU÷â¯ö=>µ¿ !ÜO•Ù¿ÔöÅߦH(Šu¯[ä*þ’}ÝÿØïõ²©B>vfïóþë‹ñ~¸ý’6Àûø‹ ÷näKÚÃ_²Ö‹sË8Sõ·û·ôGt8ˆÉµk×ÞøÆ7rÎá𒜀2uÁݲ¬ t]ÇãÑC)% AÁèðô"AL<ÏÓu¦Æ¶m×u ÈÇãð„óÁõ}´I>Ê2Ï9 !ÿA˜¦‰1N$‡Yà)¥Ñ28Šx=~ß =‡@$×( >U!HáŠäñ WÑ P nÙ!ò!Q£``pa¶.$!$à,[ðXÀ¥P•¹A(W7˜à„ˆÆ(W.„Ë‚(’\½ )mߣ„@@ ˆ9 HAæxàxaú®Ï™F•€sÓs¥”*¥–ç:G1V(í»ŽRUÇ÷,Ï•iŠbûÄ+B¨ëX”P…RÓuLÏ%„¨Té¹6D)ƒ´ÖKÉ |Ës!@WÛ6Q6¹c™1MçR´í> m}´¬>BWÕ¶mö›¢*JËê )tEí9VÛ2ÁÓÅôÓsãº!¥¬÷»àðÔ²úmÛT%˜ÔzË÷⚆ªt[ºª)”šžÛ±Í¤ÃW»m„1\Ë‚›¼Bi¥Ûî¹6„(ušš¢ªT©õ:M³¯Pª«j¥Ûb‚Ç4½eõ«½BHSÔR·Õ¶Ì¸®{,(¶. RFÜñ½r§•‰%ΊíF×µ’z¬ïÚÅNSÓôR§Ù0»ºªjŠºßªI„cšæ±`¿UƒWµ^Â_ )v5]Q4E-´•^[¥Š¡iû­:Äv8ßn”“zL¡´Þﶬ~&žÀoÕË-¬ØnÛ ˜‘­z¹mõÓñDÛ¶¶.DÒ0vµr§e¨š¡j›!âµØiî6kWi£Zª÷;I#¦*ÊJy_S]ÕZV¯YOelß[«Û¶™‹'kýÎF­,‘LèúzµXê4SFÜñý•ʾ幹Dj¿YÛj”S²]¯ô\;OVzm€¦¦øz­¸ß¬šÓô•ò>‘¢”î·êµ~g,™®÷;Ëå=ËsÇñZ+Mgr}×¹SÜi˜Ý±d¦Òm-•ö„”)#~§¸»×¬fâ Û÷nîoõ]{,™ÞªWÖ*EBp:–ج•ÚV,™RÜØÛJ1]Õª½öf½4ÉcŒïv<dâ‰Ízy©´‹1ŽkÆýÍýV=Kèªv}wCSÔ¸n4ÍÞRio&;F0^*îö{,™vÿêÎÚx2C¾¾·¹Y/gãI;ð.o­vk*]­îv&ÙDrµR¨õ:“élÀùÅÍål·xm>7Ž~jåæbqw:“kZýÏ/^kY½ùüÄåíÕ6W4EK¦ŸßXj˜½™lÞcÁ§o_†¸Ç«•­Âö™‰Œñç—®q!ÆS™¶ÕrùÆÉñ)…Ы۫»ÍÚ‰±I.Å'o^JÇâ©Xü +·.n­dãI.Å'o^ÜiTOO-•vŸXºp>›»¹·¹\Ún?yó"%$ŸLÛ'—o<<»Ð±­OÞº´V)Ìç'JÿòÚó3Ù¼®ªŸ¹}åÒöêD*kùÞã×/ì·ç&g[Vÿ“7/Ÿ9aÞ_ݸx»¸3“ÍÇuããמË%’¤÷Ùõ;¹DRJôñkÏnÔJg&fnvþúÖ%!ÄD:ó‰¯ì¬M¤2éXü¿_{^WÕ|"Uh5>sçʃÓó”§×nï6«§Æ§oîoýÕÍlß›ËòæÅç×s‰d.‘úĘ“éì3kw>sç²”h.?~aci±¸ûÀÔüO/}1—Hfâ‰ÍZé3w®¾îÄéj·ýç—Ÿ^­˜šóûÈÅ'OŽM~üÂæÊ#³ ›µòŸ_~ºØn<<»Pî´>~í¹‡fJŸZ¹¹ßªŸŸvÿ/<9—OèÆÇ®>ûÔÊÍ©tÎ ü?ºðÄV½üàôüs‹yíyJèX2õ‘‹O]ÜZ931½Û¬ýñ O6ÍÞÙÉÙOݺôù¥ë ]ŸLçþúÖ¥®cÍ寝ì¬}öÎU'òË¥½;…íÓ3…VýóK7f÷D~âÆÞæåíU]Õ U{fýÎn£6É•»­ËÛkg¹Úm¯U‹³Ù±ŽmÞÜßj[ý‰TÖçìva{<™­–÷«½v:–°|w½Zò˜ŸŽ%ö›5Ÿâ‹.|þ3Ÿ=„xý'ßõÀ©3BÊZ¯Óq,ðì„DáqMï:v×1)&”жm:¯«šÏYϱ’*¡>窢Ôëõ?üÃ?üùÿïþçþ?þÇÿø¿ñøÀ>üá_ºt rêôiMU9çà£AüKùëѱˆ×·½ýíÿïÿ}„ÐÅ‹ÿŸÿôŸ~úßþÛ_ø…_øµ_ûµÇ{ìOÿôO———'''çææ"…òˆV)èœsEQºÝîïþîïþôOÿôÏýÜÏýò/ÿòoþæoþÎïüÎã?¾¶¶–H$fgg•(ˆ„¤¹Ku=ìnvXg<ô$Šo¤?“¡‡>ü.þËô òòð…6è’ òòA ´€sðЂC¸h8‡Jg”hRÊÐÃIF,‰ƒRzq¹A R… î>ãBWT spubEú<@¾µÉ |ˆ³÷Õ Us?¦jrq#+ˆ Q¥ ÿ ©CfxHåá];B™ÚoÕs‰”ÏXáÊ#‚Â÷šõéL¾Òm÷]FŠÚoÖRF,àl§Qé;ölv¬ÖïúŒ!$ó‰Ôn£Ê…˜Le»ŽµU/wk.7¶×ªÍåÆÎåÀyK˜ a-]¤„8+wZ c“ånÓô…Ò¸ªo7ªž8 A…`†`†, „àÜUê´Î&R™ÍZYH>•ɵmsµRhYý“ãS[ÊÉñ)Ê ÓoûÁ¸Úk›®3—[¯§29pB8+´êg&f í†é9”„žX¯ßrúAÛ÷À‰ á„H:ùBLJiû^¸Õ0€7®”÷çrc•n»Ôi¦c ¸3Bù¡Ï™”Èö\>h–GÍ‚—¼bõ\ „–J{§'¦wšÕZ¯ù7áa&–8¿µ¿Õ¶­§ç÷šµ€3Ÿ±ÙìØÂ6Bh!?Yî´ö›5ðæT½]Ù1TU¡Ê½­¾ë<8=¿^-|X–BJÓu(¡ëÕ¢”r*½¾·é3vvr¶Ôn^ÛY¯õ»NÏÝÚß~`jÎ ‚èxo†côY0€"dy.ÌÂtct€&–¨ï:“R»Ù0»LÍÞÜÛÔU R6_Ú^­vÛ¯?u{ûõ'Î0!"nͰY&8àîoîoæâÉ€ó;…íwœ{¤ëX ¡›µ²éºg&f¯ì¬!„NML—ÚõZq*ë:–Bé]U3jâúîÆ7¾æM=Ç&˜Ûj¯óÈìÂÕ CÕf²c¦ç<¿±TíµßpâìZ¥`z.ÆèD~âÒÖêw¼éàSÌôöÛsFpy{õ gWÊûŒ Ç÷˜ž»°¹|zbÆô!…í{Kå½·ž:ykõ­g΃»3¬™žc”Î!àÀ…¥™l¾ãØ×÷6ß|ò\Ƕ@ànXžƒzfýÎ#³ k•Âzµ˜Ž%:Ž5H&îyõ îv)!«•BË2_3wê¹%JðÙÉ™j¯óäòB»ñ¶3Ý*lÕ{µóÔÊ;ë¼éä¹µjñóK׫½ÎÎ>·±ôš¹S£!tkû-§¸¾·ùÆ…s\ € ^ßÛ<=1Uëu®ínÔûݦç6j%È9D0Y*íÚ¾wz|z·Y=íMËp#ÚnTò‰”é9•nk2•uŸRî¶FIÍ(¶ëLˆñTºçØ¥vÓñ½9cÀ0ÁFgº"®ém»Žk†ÏƒŽmù,Hè†å{>gqÊt³åøž¡¨BðŸþÙ_ø_ýµ^¯w¤åJ¥rûöí}èCoxãÿëý¯oyó›]×W4í8åå(º^(ÞûÞ÷>óÌ3GþT*•._¾üë¿þëÿä{¿÷?ÿçÿ<1>Î9àK¡(ÊÇ>ö±ýÑ­ÕjÃVÌF£±½½ýä“Oþâ/þâÞð†Ÿø‰Ÿxï{ßÙí›+ïaø<þ’ânkáᢑw Ä™â3±úB¶ð[ˆÀ‰òÓbë óˆ†À‰\]ÑÀ!Ót ‰¢©b¨*¸“ÇTM¥‚Y`1U'`ô°Ç•Ò*?† ú„傲&`Œá¬qäuEõ‚@0ãkŠÓtŸ3&x\×!¨Å$®Ø…’0/Fä¸7„ÑØ¸À'uIä¡h1M C°ÍÙw€I¤˜Â!MSÔ„nøœœ'4]¥Ô ÑSÉ`Г †XŸ±pà¡ÀIÄÌ hð°d¦ ÄÊ&$ òt,9ÀŽ 8K±¸®C6ˆL,AŒ)#î3æs–‰Åá JÂø®“#¡ fb‰JI"$.PŒ¥c¨¥%¸øQvAÓsB2±,{J H¦sDC°M„BhV¡4ж=-F ¥cU3ñdÀ¤mˆë(p¹x! ŒhFJ3‚±:Hm¤ŒxR7àm‚]Ñc¡i¹D |7ðsñDLÓ½ aDhIÝHñ¨!Ø ˆÕç³ÀöÝl,‘Ôc Rç“)„é: Ý€‹ƒ¾ÂKº(ò6 “¾H‰ÆiJhϵcšžO¤`OS ¥„ú, ˜Œ§Ò‰A" q€‘J•ƒ1 2±DR7\ßÇ«ô ;× K¦5UuŸ`Wè@t8ø†ªŽ'Ó^8¾—O¤ãšÑul‚ÉD*ƒê¹vʈç)ÓsÎÆSªm»¯)êX2͹@©T °É|2M0öy ¢„ï íL×QÍÄRJ'ðºÓ4Ç÷…”)# 7"P + 7Æ™FU]Ñào¨šBˆÏJˆv܇JˆJéÕG)€…1Æ Q”RŸI„º¦õûýwÛ·ÿüÏü¬iš”RJiR6(xxãúõwýÍ¿ùÄO$ŒÁ+‡Š‚öã?þÆ7¾ñ™gž!„(Šr¤Yxò'ùÈÛßö¶ÅÅE¸GŽ4ø/èyüàßóž÷Ôj5à-b HQŒñ­[·~ðð‡ø‡BpG|_9^½ä¾û!9H}‰…0ð|(ObX¸©`˜0Ñ¡RÊ@px½gƒ@w!žC!”p/ܪBÅùX;à¡nqHü*„€Nà)”èªêâUQJ 0OLÕ…”ŽïiƒXÕ,ˆËs)¥Qr°H22 ýoºÔGþ>Ï9xzÀ¡”RÆTÍ |Û÷⺮Qp)ÃàBôËPÕ°-±ô:–i…ì}naŒ¸mõ UM1ËsœÀkºDòÀ6ˆ†CûH!…¦(”f¿«Q%OØžÛw€ÄJ)…qMR4­>¤©åä2Õ¨RëuUª@0á¶m¦cñ„n4ú]!e|ñš2â}Ç6]7—HêªZíµ &cÉ4x|§ŒØ/£b˜Ã§"iBÊJ¯ k‰0&"W„€“bÀy=¡cÉtË4»Ž5‘ÎÆ5½ÐjŒ§29Ÿµ^âC´0CÕ4EÝkÖ UÌd»¶Ù´úðMЬ­"´•æ©Z¿Ós¬™LÎPµÝFUU”™LÞôœJ§=‘ÊäÉýVÃcÁlv c¼×ªPŒqÚˆo7*á¹Ü¸ãû…V=ŸH¡A€®ÁFÀ„@‘%Rpèw»^FH¦c @!„ÆS™J·Õ¶ÌùüxB×·je]UOä'z®½ßªO¥s©ìv£ê>\nT‹ÙX#p>°(ËAd;ØDØô/à,¦i1U])ï'tãÔødÓìÛÉtv˜Û¶ µ¶a)!Õd*kzÎV½<›ÍOgr›õ²ëûp»·TÜËÅ“ ô³!‹2ã|<•ñ8[-&S‚L U‹iúíÂvB7ÎMÎÖÍîn³6“CA>.t$.]ˆ™•ƒ‡`›3™üriÏõý©tv€‘ŒET ø ~›"`<|L¥Ï™Bh*“¿¹¿ÅŸLç‚0$Û‰üÄv½\ê4ÏOŸÈÆWvÖTª<2»Ðs¬ÅÒîÉñ©…üä­ÂŽí»³Ù±€s8,ŒMÛÍízå¡™ùÉTöòöÅd<™8cCqþÂ1Ê€1Æù‰±Éz¿»RÞ{`rv>7~uwÝ ü×ÍŸF]Þ^›ÍäB> ÂhvÈ?$oЬÏ#S¥„ ¬Ñ,Àš ó›Íœ]ÞZ]›::K<»¶˜'ãšLÑT ¨Ì³“3ëÕÂn³zzb ìåg ù‰¾k_Þ^;75w~úÄ•õ®m-ŒM(Mqf|f¯Y_.F,ð6Ÿ 8v}ñÔøôkçNÝ,lZõ7<—%¾°r3‹¿éÔ¹R§ycoóÌÄ A ˜ ¢pwnàLf²ù'WnhŠò¶Ó¶móÂÆ2Ôòó?O&Øç¯M¥óšÀp‹¼¡fÁpûÐô‰›û[…VãÁé9ˆ®/Ã[,0q=05ûôêm7ðOOƒ+Ñ`rÙ@à!@³™˜6=÷©•›ç§ç_7æùÅz¿ýÎsÄ5ýS·/%Óo?óÐv½re{ýM'Ï™˜ùÜâµ€³o8ÿ¨Ï‚'–®ŸŸB¹Ì‡ÈmãÉÌSË7R±xʈ{AàÖêäõ½MÓs_;š`|ug=ŸH=05·ßªÛͳ“³¹xòvqG!.O`!ADqËsÇSi.z Æ’éžkW{í‰T&KÚ &ÄT&'¤¬¸ý#9ÜQ—.¡‚ù'u#®ëÇ 8OÅâã®cªŠ×u'ðá“§jù.Bè½ïý¾'žxŒ[ Šá0d(aŒ1P­Çùîïþîõ MU¼§cÀ4-//7›M8D À¾#%`EÙÞÞþÖoýÖýý}J)„ JJé /¼ðc?öc I‡ C/µZír€xð!¿¦zäwy7v5üývU‚¦F 0¤¾ç‡}õ›Ý…ëS<0Ðwì¨Ù4•±žm·¶çö]æ1B/ŒERÓu™i§€ ¼È”õ;™€QBˆ¾cû8Ñ2¸‡ÉDRÇ÷"j§r}¯eöÙ`pÀl™=àÖr¶Õ‡yì…¸NÀB¿=ÇŠ@‘]ÛòPJÿÒhõCÀ`Ðèw¡_@ö–ªÙ@)ß«÷;ôŒÕ{hf7†…ö¡ÉÚV$cº`Êgµ^¦Ìõ}€Ý !šýnˆô«Ý6H©k[~˜©õ:¯Úm3=Ûê…Ã`z€z“R¶-3B¹Ó„1¶Ì> ¡@S߃¾¤”ËŒšõ^'‚àUºmØXʈÑtR»Ívl†ÜFK&ÌcËìÚÎöܽØìw+Ý ¡ÊÓñ½Z¯-Bô"ô0Ví¶ÓäÚõ^ÞÁb»1Œ^„ö€Á+ÝŒÑr@ƒJ)ë¡<}”;Ìc×¶ýì'{ÍÌø˜Š)Yí¶àáN½²mô»©˜s¾×¬5û=¸s/µ¯tZŠô‚`»^áXž—RV»mX«cÅVæ±Úmï7k°»îÔ+0§]Ûܪ•¡@­×¤$ 4aŒ]ÛªtÍ–;ÍBÓ÷ ­l~w :Î ­:¼zM³·Y+Á†¼Û¨–;-)¥å¹ë•bTšBZ©é:ûÍ,û½f­ÐªÃ ßoÖ`׺íÍZ ¾)›µ?mÏÝmTAà…V}·Q…f÷›5xqýîz¥¶êåb»}­”ö`ÊJíæf­ýî7ÐTÓuvÕÀ»­J8MË¥=mµÛ^« @¡U‡åѵ­¥â.Ìc½×ibœo‡“Û³­zf³ZÚoÖaÍlÕJ0oö»{ÍÌÝJiú5]g«V†!”;f|Æ6k%x÷+ÖriU¯”÷At]ÛºS؆~wÕõJÖÌÂN­×‹;ð [ @¼Zž»ZÞ‡7«m™0MŒóF–Gß±wê¨Ué¶"øm¡U‡¾lÏ…’Bˆz¯Ó —b+ÄÉvm ÄÅ8o™=˜¦¾mI)?ð Ãˆ×ç.¾«ë®èƒ¯Œå¹ƒ …2oµÛÓSS ÆÑ»4E HÇgµúOÿi¤EjŒç{rñU$CÙ ´y%RQB÷ïþÝa-KàÖïüÎï<2XJéùóçßþö·Ÿ _ª¸^Æòx‘a¾²c|ñZǾÿf_ÞBºkQÉ$~¯.^½i:²ïSÑæyŸ›ÃðNøªÎþKÖºŸ—ôå­™—±+¾Jc|ÙÓôj¿nÿ~w ¼8âõŇý.¥$„ôûýóçÏ—ËeEQcétú=ïyÏ·|Ë·œ9sc¼»»û»¿û»Ÿüä'‡«'‰ÅÅÅ“'OF˜„clñÊÂÛÞö¶üÁ|ãßhF©Túô§?ý‡ø‡Ýn—„^OPå±Çû‘ùƘñ!ÍfóüùóÍf3jêüùóþð‡ßò–· „‚ XYYùèG?úû¿ÿûûûû¡w¿ûÝ?þ8ÈáâU"Òqdë ƒ›„ÁfÈŽ0a˜LÁ‡îDRJÈô…1†Û®(Â5€ ~ÐXæàª\w &çg„°B J¨DrvaŒÎáâtpŒÀ•‡{,P©"¥tBÆœ;¾‡0©Ç…P€p)À‡)Š* qÚTE 83]œØlßoJ¨é9÷˜K÷ª„Ç÷¼ €˜ø=ןËsMϯ®cyo¨š]Û’©Té9¶åy*¥”RðbV( ëÚää6=j¹ß±L.¥¡j ºŽ× &xËê¹,€hìM³oh*!¶p…Ñ0{ç1MÌ,¤÷n[&Ä=¶<Ž_†¦›žÓu¬„óXPëwÜ ˆkz×±ý.!XWµŽmíÚòÝj¯Ã‡t®qÐ¥ÚkCèvÆy¥ÓŠëƸÒmwlÓÐ4…Òb»A …ô_õ~p²µ~ÇcA\7ºŽ]î´„”1M¯t[~ÏP5UQŠíBÒPµ0‡U¥Ðª&Ãö=·&˜å¹¥N+—HBvš¾ë¤c‰¶Ý/´ê!¸ùíØ&\kî6«à¸Vé¶Kíä/ušŽï'—b«^‰kºª(û­z¥ÛŠë|³V6=7OÔúÝf ²nWº­®ceâ !åF­¤REWÕŽeÚ|2…1ÞmT=$XÀùzµ˜6b”ÐÍZ¹Òm¥¸Ë‚µJÁ¼lµrk§YËa„>·x-—HÆ5}½Z\*B=½v› žO¦oío=¿±¤e<•¾¾»±ßªÍç'všÕ'—oØž7—¿°¹|y{5OI„>}çJ¡]?96å³àó‹×çóãã'WnÜÞߞɎµó3w®tlsalòÊöÚó닆¦å“é6—«½Î\n|­RxbéºÏùL&ÿ…•›på—ŠÅ?·xÍçl"•½¶»ñÅ•›šª¥cñOݺ²Tڛͪö×·.¥cñ”ßiTŸßX|`jcü…•›m»?›»]ØþÜâU„ðD:ûéÛW®ïnLe² =ö×·.iŠ’'/l.aùfÒˆšöøõ k•ÂÉñ)„äǯ=Š×*…6—ÏÏœ¨öÚßx¡Ðjœš½¶»ñ™;WÆÓÙüåíÕåòþÙÉ™ÍZùñz®}j|ú©•›_\¹•Ž%òÉÔK×»Ž5“ë9ö¿öÜÉñ)…*uóâÅíÕ…±ÉŽmþÅå§k½îÙÉÙg×?{ç à¬?zåÙ;Ås“³[õòÇ®=g{Þ©ñ©µJñ +7_3w²ÒmôÊÓ;Úùéù®côê3g&ftU½´µ²\Þ?;9»^-þÅ•gZVÿÜÔì^«ö™;Wž=IùÜⵞcÍdÇ,ÏýäÍKs¹q*O­Ü¼UØžHeâºñÔò ˆWß¶Í6—Æ&}Î^Ø\ÞoÕ'RYJÈ [+éD ßÙ¬•“†Óô¥â.<‹Új‰RÓôõj±Ökô~³Vò9K‰b»(äâ… Ÿ;ŒxýŽïýîs§NK)f·c[†ªq)ê½nÀ|;¶ih:ÁØôœ€1]U…”và¾ÿ[ø-Ó4…ßÿýßÿñü}ï{ß#<233333sþüùïû¾ï ‚üᤔ”RÏóÞùÎw¾æ5¯ñ cÈÿùñ ÷§Rʉ‰‰ßû½ßûõ_ÿõ·¼å-óóóÓÓÓçÎûÖoýÖ÷¾÷½Ï?ÿ|¡P CéRWVV~è‡~H×uÐÞ![[[¿ò+¿i¢¡ÿößþÛ»Þõ.𺣔NMMýí¿ý·äG~dnnîóŸÿü‰'Þ÷¾÷ÉcàáÉçØCØq%ÁLâ. ‡ÊÉ¡pÍG\Ǥ”àYæ1Äa N1g )Á$†H)Á'}Ø÷+ê-JÍ)Cp«ÇŒ0’ÒcAÀ¨J „ù (%\7ÆÕA6À'-Ç÷UEñ9sŸ ® ¶ƒ ØàT29lÁ”K*¶ïYž Q§Mϱ}WWU7ð8¦PÐ'ˆäC€H.hÈÓ¨ï:ºªÙa8DpEê96%” úhÀȃ…NÛ2TÔM Ž> üi:Ž׌¾ë„·Ã !Ô±MòÒ¶MËuãšÑ±L4mYý¸¦Û¾×²únàÇT­eöBQ¸y‰¤ËŒqϱ@«†à€â± çØ ` ×jšÝ¤aô»ÑÖï „¼ €ÄmÛL±–Õ«÷;°ôk½NÃì&õhÌ2„SÕz•*\ˆj·Ý2ûéX¼=Ã8é!°Ã{Aжû©X¼Üi!„Àñ&×ñ=Œ1ÄÃŒiz¹Ó*w[K¥Ôi¶Ì~6–(wÛpP ›•pÕŽcÝÀóKËw1&õ~×c¾¡j…v½Øn$õ˜å¹…v£m÷3ñD©ÓÜoÖ!(T¹Û"›ž‹n[ý¾ë$õdMµ#ô¢8€RzÌên£š‹'›f!–ë"„öZuMQ¹à;j©ÓK¦ íÌ,p»]/§cñ®mµ¬>,‘ÚnT6ª%`f½ZÚkÕ&RÙb»±^-ºŸÔcëÕBÈôp(´“éÌv£ºV)3†¦k[ãz¿Û´ú¹Dr£V\«šaûÞj¹°ßªOgrµBÈc <ñ—K{©L¥Ón[¦DNSk•Ä‹_.ïmÕËÓ™ü~«¾TÚµ<'eÄ—J»ðÆq!œÀß©Wg³cËå=„øà#%‚¦j½N½×K¦ow@†ƒ½Eˆ½èø>xâß.lO¥³eˆæŠPË2BK¥=•*BˆÛûÛk•Â\nl·Y»½¿ÝwìL,q»°}»¸3–LµÌ>¬“¦ÙW]©otss±¸;—ÛiTzŽÍ¥l[&BèVa VÚf­D m˜]ŠñFµd{^\7nîo!„ÚV?J³Û¶ú¡[…m•R.øRiW¡bÉ"„ßë8Ì~Ûêœ;¾¿\Ú[ÈO^ßÛ@Y¾ (Å+Ûkó¹ñ½fíÊöZµÛžJç®ím\ÙYKÇâ–ç­VöBëý®Bèje¿ï:©XüòÎêµõéL®Òm_ÚZÝiVOŒM^ÚZy‚À/ï¬-ŒOmT‹·VZV"•¹¸µŒjۦϘø· ۧƧoím½°¹Q ®î¬#„f^M³CèØ¦ãûRÊ+;kg&g‹;Ïo,Yž›'^Ø\FAìèŽm.•öNML_Ù^{nýŽJ.äµu…*µ^Ålßk˜=„гk‹c‰TÇ6Ÿ]»³TÚ=79 MYž K噵ۧƧvê•gÖnï·ê ã“O¯Þf@t\ðJ·M ½SØiYý±DêéÕÛÏ­/ÎfÇËÝæÓk·×ª…3“³7W¾¸r‹bB0þâê­¶–˜œ½¹¿Ùs¬@0ØH¿¸zs<™iô»·‹;”¸âGõ\»k›¡'–oœœ])ï—:M)QµÛ{NËêGÃ!*ÖZµØ2û¹x ÆmÛ„5Ã8oY&%tµRud½Z$„tm#\ïw›f?O@cËw™àÏ0–L—;­ýVs®Q¥Ðj”»­¤3]§Ümö]'¡]Ç>¢~@§¦ëxŒiŠÚ¶Í®miŠâ1æøB8rÊ<ðÙEˆ…pŒÐï}èCðëÙV×6ÝÀç‚wmSñ¯ÿÍ¿9}æÌ°—ÛÞÞ ³\2!¢|¯2lš}øá‡/]ºô=ßó= Àg nT}ß_XXøìç>û†7¼!2õQJ777üñHs8¢nÁïÓÓÓÃÜÏêºþ£?ú£«««ï{ßûP˜ýìØ¯CÍEÏî’u ÕŽZÂ÷Œdêh92TxAAX˜ à`éYõ§C¿A¼Â'röI$)¡c. SŽ )¥%„$Ö”R†pQ`F!£AîÅá,ŸCÙ䆶CpQ i±ª€L9ûÀšŽM‘ twÒI)¥¦(ü¤ÉShØ,>¨…Â26H(„ª6HozÉÆq®Rª«Ú Š ÆpOqHbfÀÇ5’$*„Æ4-4úb¨u)‘º¢Bˆ!dB7Áàd(ÏcLÕ4EOiRá0Pâᔎ•'õXa>H IFØçL!4®àˆÐ MQ@ÛKq8iDý¢æq äáŒC¸N‚1 8Ó-¡x'‹kTµ}`’ÔcB7ðºæU¢&}Î4E($hfˆ C" ÑÒ±¸BhÀEHB> ’F,®¶ïJ‰À`ðƒç€yôX@P›Ç‚„n$t˜QJUy¥¤$Äu"GúqMOÇâŽ?€RªTé;¶¦(ùD*àÌòÝt,ž4b¦çH‰r‰$F¸çØ1MÏÄ0CJ( QoùDš Þwí”1pÐFdv_WT@/:—ŽÅãšÞsmBÈx2-¥ôYijaŒùd rºSLÉä2?eÄ“F¬ï8¡ñTš`ܵ­˜¦çI?DJ*„xO OfÉ‚)ÑE0CÇ÷tUOe” † Ã%¡†àÖñTFSTgÀÌ@t¹x2KtKH9™Î*„t+¦écÉ´í{nàO¤21Mƒ5µßËÄÙx²ëØç`ô˜¯pŒ?–L'uU0&¶ï¦b±±DÊ <„ÀÒBª•‰%.¦* ì$ÑB UJÝÀØLgópHP©¢ ïl:“7T­iöãš1ɹßwÉT&mĆ˜Á¶ïeb‰©t¶ï8NàOgò Ãhš=]Q§Ó¹xNQTªÀ¹t6“-3eÄ'ÓYÇ÷BUTª8¾G ™Ës):¶™O¦Ç’éAhaâ`졹ìB¨eõsñäd:Ûˆ¦(Ì^S”ùܸÏYËê§2ãÉ´å»!H7 ï îlßÊäÒñDÝì*„.ä'…”pÔØœÏØ\n\SÕz¿›ÐôùÜ8ŒQSTX«c]Q Æ}×NñÙìxßµ-ÏË'ôX­×1õd~"à¼iöÆS™‰T"FŸ¢„šž«R˜±”°Ñ …P]Q@o3T-DVÀc¹m IDAT»¾Ú8På¿ýÙŸþ/?ð­~Ïg®išªbŒ)¡ªª2Îã±Ø7~ã7>#„ZÍæðw_¢ƒÚƒ=R„з|Ë·œ:uÊu]B¨ªÀö@(¥ªªAIg>øÁFw¯@ýèG‡?÷étÚ0Œá6?üá#„@5Ä!rcÌ[XXˆLtÇYéä!e <V9àá ¨„KبdTàXÄ)Èáð‹)!-‘J0¨Õ.FÁ!;{Àdû–ÃÑÃ\GˆWøŸBhÀ\UBˆøðÊF%ÌrBMUBŽï8_J ¥BØ- UãB¸¾œ”Cù^˜9l2”R¡Š”Òr]•RÈñê³ÀPuJˆéº㸦œÙž ï€Ͱ Ϩ}õ¨ŠÒslŒ‘F>ÔÍò\Ÿ1}ï ˜ uU…O‚®ªå$äîʱJhË2 &š¢9HÓô®cžj™=•*c.±àtEmZ=!e&ždœ·¬>¤©@¦MH&tà ‚®m$VÎ…Œi:B¨Þëê¡6 §¦(µ^! æ¦ÙKhFTÀP5Jpµ×†MÁôœžcecɘ¦Uºm)QLÕ¹ Ý& £eõ-ÏK¦UJKÝæ ·zhžD!v5®áR§ \1>T€s.èOµ^'Kdb‰j·m{ÞD:K0Þo×uU¥„0f6”0O"„„ì ÝaجDùÉÄ–çTºí|2‰% í†ø,µÐ®'tc"­÷»m«yl²š6ânàÛMÈHpEìcœ ^C¥cñÝf•K‘2âÐ,—HUº­–ÙŸÉä UÝnTtE5T-Á‰¹xr§Quƒ Kr>H:–H×{ÝZ¯ H[p~G‡1lJés&¤O¦[V¿ÐjLgr¹xr»^fœ/ŒMz,X¯³ñälv¬ÐnÔûݹ CÕV+•ÒSãS]ÛÚiTÇ’ƒ¾ÎRFœ`¼RÞOñ…±Ér·Ué¶&R)eÀ|,‘r­RKff2c»ÍjǶNO+„,wãš®)ªbó‰äriŸ 1–Lœû<@M§s…v½ÚkŸš˜ŠkúÂŽBé٩ٮcmÔJ¤\…ß.l§Œ\¾€Õ " BP=7ð—Š»ãÉ BÈ  DáçPc<™¹]؆Zy!4ɃõÜÔlR7®ïnbŒœšë:ÖJy>71“Éß.ìô]g:“ óRÌfÇàâþÜä,\K)!~!Ø3f³c«•ý†Ù›ÍAfO&ølv¬Öë¬U ó¹q„¦=ph.;¶Q-ÛùÜ¸Ò ˆWƹDÐÔÀ ü\"¥+Ê¥­•\< 3|Ñ'ÓY¸}~íüIÓs®î¬ÏfÇÎNÌÜ.ìTzí¹ì8Üe|>7^í¶o¶ÏMÎÎ寝l¯õûuó§ç·VàŠšUK¤.l.c„?Ý4{×÷6!©®¡L)MQž]»“'™=¹U+¯VöOäaŒC!}?‚ã{1MOñgÖîÄ5ãÑùÓ…vãæÞ&ävßcÁT:‡$zfíöT:ûèü™•òÞF­tj|š áøa¼FÎAý==1}mw£Òm¿iáœBÈS+7s‰„8…`‡³¹±gÖùÔ¦ç>³vRšF± …œ™˜©õ;—¶Vœž?=>ýÜÆ®m¾õôƒLˆ'–oL¤2oX8»RÞ[.ï¿þÄÙ±dúó‹×Jg2y×÷™³“³—¶Vf÷ìÄ, n›|Æ À\nì‰åëŒóù ×% |À ’€Õ=‘ŸhÛýÛ…í¹ƒ5øq·3Ù|±Ý,w›3™B(`,|,™öX°Y+ç)„ÏÀÒ5Eݪ—5EÎä»¶YëwÆ’©¤+všg“é ¢æYw«tðEƒ/i×±ãšÓ´Žm1ÁuU•R†`£ƒO<çüO>ò'ßý]ßÝèu ]×UÍ °¼ ÊçOœ@C¶?ŒÁÉCóAÒk˜+0¶ÊuX#’ Õ½ímoûÞïý^„`]B/^´m;Cœ „BÁB†h ðlo‰`2kD( +P’u„`±1B B1øSL0Âpî%RST°ÀÓtg¨t  ÐðtEK!$6(@JÁÈI …\“è°‘Š °!>'cMQ US©‚0Jh†¦(”R…Ò„f`ŒÁZÒ¶UQá…Jè1…R„0CáÀÓtCÕÀ9"Œ5ªª”ꊊ1J1UQ0Bª¢ÀQ8’€¡j£t,N Ř芢*Š®jᤋk:¸ôeãIª®¨ÿ¿öþ4è–å< D3³æiÕ¿yØóö9Ççh²tä¶-º[ú[!hÂØ–¹Ñ6Æ26\|mð. «Æ\°  ìFj Ùm!Ë’Î<ïyøö7ÏßšçZ5Weæýñ®µöÚãÙgû:âËqbíúª²2ßÌÊzëÍ÷yITYÆg4C“YEAÌê& –*IÊ¢"J²(I¢¨ˆRV7!UQeQTIR02„h†$ˆº¬`Œó†¥) \•7,Œ±$š¤@®!¤`dtEA—•œaj’‚1.˜à´Ó$Y•d]VB2šÑŒñ”•AÀ2ÒB² i²" ‚®¨!ÓvV DDˆÃC¬É2x<Š(•2¶¡h“¼aŸ–@Ȭˆ ÁPTE’8BŠ(² @—ð%A4U bš$k²¢Ê²*ʺ¢Lg²–ªcŒ‹VÆÖ CQ"ÌÚ…Œ¦K‚`k&8.ª$Š ¬Š$Ïç Y”,UO]QaΛª¦É²­á¹lA“Œ‰©¨º¢fT] ¤`fŠ–ÑtŒñRaJD‘–ªë²bk&xÖÎ[š†²TM“•Œ¦‹‚˜7Ì™l’MUn-KÕ EGßÖuˆ(˜Šf(Š©jª$Ûš1Ÿ/Úº‰ZÈó†e©š"IËùé¬nŠ‚P´ì;—Õ ‚Éraò´LU[.Le ¥é0…$A8YœÉ&Äùò%ι¡ªU‡7±.+'JÓyÃ"˜ÌæòÓ™\V7"œžƒÐNV7 E-˜‚ñ‰âŒ©j![3,UËê¦$ˆÓ™ì|®˜3,ãÓSsÀã•QõÓS³]V²º¡HrÞ°$A|lfQDY”²† ߦªÁܰuS—•ÇfB4YΛ–*É“Œ¦ç ¤_rºiªÚTÆÆŸ™šËhÆ8«M‡úgìüRaªhf!Í.-ÛTµŒ¦Ÿ›^(Z¶€ÉÉÒlѲ1ÂYݰ5=gXš$OeìS¥Ù’eŒŸ[4’7,[3J¦- Âraj.[`œeu¢z¦ªå ë±ÙEŒ±©¨E+£H²@HV73šQ43Š$Íe‹'K3”1[Ó VFDY fÆÖ „®¨3£ÉÊ´‰øÜòiYUI*YYKÕçÉùå;Ÿ7LCÑžZ81cç%AW€6|dùŒ$Šº¬LYYKÕærŒñ,žžÉ泺™ÕŒg—NBLU²l]Qçì¼$ŠÏ.žÍæuE™Ížœ[FYš>•É‚þMѲ f!¤+ÊT&g©Ú|®(òÜòéÙl!£é%Ëþ¥ÓKÕKVV“•Ùl^‘äž8;—-¨’¼\˜zlv‘r–3¬éLVEY”¦3Ù¼™™ËEBŸ]qê±¼™!OgrEÓ†Çy&›7U cœ3,ôŒfä ëüÂ2ÁÄPÕ’e+’,`’ÕMKÓs†©ˆRɲ— SŒ3CQ!ÇÖ“¥i‚‰*JM—EÉÖt󹂥êŠ(Š:•ÉAÚwѲ-U—1«™·®_ÿÖûo“¹t¿ð¥/--,‚„,ŠÍP$™`d*,ò’ Œß‰À®f syy9NbY’TI†w½$ˆ…ÏGŒ‰¢øö[o}÷»ßËB<ÿüóŸýìgãdÄÇá…^˜Tøô§?ý¹Ï}ŽR*ŒÈBÇ.|×BEùßù±æ8ÎOüÄO”J%ˆÃB<Ïûã?þã±ÏGùîw¿{ñâÅþáÎårC º‘òÄm—jì½N–1SÉð÷ýÞ{òÝW=øà#^õ(\*wý~`>@µxÂwÿ`}|Ȉ|¾×azÕNþxOýýPZ{ßËÙŸøT¼ýƒß4±åïjÏ{ïõð¾sfòO’Û#ZæƒßëQó(W=ü‰žÇG¯ö=L‡Žþû4Ý÷çiúþÍ™È{ºêû×ÂûŽéŸáß§iÿ(÷exå‡@ õ¯þÕ¿Bwòz\¾|™È;¾:MŽ5ü?q™O¦iš$ÉøŸõzý/þÅ¿îŽü­¿õ·8çqßnXó 8íñá´»F~©J½^Ïf³h‚Öä[ßúçÀ9‚à¹çžCÜ(Ðq˲þé?ý§ …Nžìæpã²ýïØÖäœÃvêÄŽ,7£Ø#ã®F˜š‡›/#…"Ø-H,(\q„ [vñ¢ee<Ún`œ? kã4« Ø UÓÏ£$ “ö³Ã$†}¥”Ò0‰1Æq?ŽÆùé~Ïô¢æG4&NÓ¡zÆaI É[NàGi‚1*qqÆ8wBß‹BŒpœ&}ßG'@æ5çÜ ü$M“ üÀc7 ý8ÄGiÒqp‹0MœÀǧŒB *\Õõ\°ŒƒÐ‡«Zƒ¾…c€A… 9(@µ…1v£ ç»0"m×. B¿ÞïÂïžïAµAÕz7 0Æ^¶\œýÖ Õ&4­÷»`®¾ïu}:[î¶úàÙr·Œ Õ^»9èÃ(Ôú]°í NSwº7Óõ܃v#HbÆy¥ÛªöÚ0ßÊÝô«áôÚ °mµ×†Öv}w·Y+µýæ ‡1öâp·Yƒ– ^íuÀ)£ûí:Lr·µÛ¬Å4Å´C#$ñ^«}¬õ:M§FÞ¨Aµ=ß=l7Á2íT¥Év³ »ÞïVºmèìZõ°Ööšu˜~‡fÓéÁ6âV£S´9èï·êÐì[•ƒ£n c\ëwWÊ{½ÀÃušÕ^¦ýF½ £Ðn¬”÷¸½RÞßmÕ 1µ#`ÏÚªWV+Ðǵêáp˜|w£^Ëì6kPmBéjå¦D­ßݪ—1Æn\=؆j+½öåý­žïRÎní­”÷ç]ß½´· ­m úkµCèãf½\íµÁòw×aк­ÍzF¥¼ÙmÕÞÙ]w?¡é•ý­›G{¡æ ÷öö*T[íwV*û0i/쬯W¡aWö·`qØiV·˜ŸW¶öp+Æxµ²_éµá¹¸¸»}Üo7VÊû0ý^ß\†m5*¯mÜìùnBÓwvÖ.ïo1ÎJßÞYƒ¹zãh÷õÍt~mcåæÑÆx§Y{ií ôV½¼^;‚IûÒÚ5¨¶1è]Ø]ƒ_9Ø8‹…olÝ‚UëÒþæk›+p‹·¶Wa2·]çÍ­U„P”&¯oÞ|{{ÏW7nºQ€1¾²¿õâêU/ aðÂê•«Û`¥W7nBžÉ›Û·^ݸ¦¯®ßl»ƸÖï¼½³–¹¸»±Ó¬‚ ¿uý ôFíèÒÞ&Ƹå:tãâõÃŒñ­Êþ·®¿Óôš¾°zõ•Œ³£n믾½Q/cŒ/ì¬ûÆÅA Âà[7.¼³³À‹«W¡Ù/¯_ÿÞ­+a#Œ¾·zµ1èaŒ/ïo}óÚÛ0=ÞÜ^]«Â(üþå7¶›U„Ы7¿uã<æ/¬^DεÃß¿üL »Ðñ„¦ßY¹“j»Y}ií î\}ëµÍŒñjåà÷.¼ O÷wV.ëúX!¿³r©áôBíÆß¼Íþ¿®¾õ½[WB[ÊWßyÆô…[WÿòNàaŒ¿»rSwºß¼ö<ûoï¬]Ø]‡)ñ_Þyéêá6Æx«^ùã›1Æoð{_}qí¬º¿å hùÖõ ߸ülwþÁ•7a"½±uëwÞz±ÜmaŒ_Y¿qsˆ­ñ¿qù èã­Ê>´¶Öïþî[/¼²~c|qoã?¼þýv#¡é½ôú7.¿¥IJéï]|µ9èCcþ¯«oAc~÷­¡†G»ÿû«ß^­`Œ/ím@U”±¯_| ŒüÚæÊo¿ñ]øýÒڵ뇻0L >‹1~}så[7.Àûëµ›ÐìõÚÑwV.×eìííµ ;k@Ù}iºÐr[å}˜Šëµ£z¿ ö¼v°ÝÎÕ.!´Û¬Á´÷£Ðå·wÇ¥îtÄ1Bmשö:ÀU^ïwû¾Ó£ë»|ô&«Ì9GÁ#c”qŒEÑqœÿü»¿ûçþÜŸ[^^þÚ×¾6ÞÞEciÆ€>ܘ{[Å'’þÙ( ^ph¡˜ššZíê_Žõúxk”1¦ªêúOÿizz:MSðê€÷Øó¼_üÅ_üÄ'>qáÂQÁAÄHƒû"^'7JY'«3½8š´¾ñ ” –ñ¡£8d—A3ÎB0"^9Gœ§”¦4…w0tn”¤)F˜1–¤)К@z ã!{ücÊ~ŽøH0iWÈõI)ü dMFIŒdŠ8ãF¸ç{“j¿ãÇãü°ÝDõGò‘qš8#p¢£jY?ÉGÆ|~l7«²(uÜÁA»QéutYÙk×÷š5HóÚmÖöZuCQÚ `ùïûÃjû& ãl§UµT}«QFqìŒpj=Ï…±(w[†¬l7+Û*ãÜ‹ÃíFe·Y³T}§Q¡ŒEiÕ®UQª9ݶëp„ ƒfÈ ðÁ2mw} “š¡žïA"|ÊhÛ^åEA?pÁ¹4µÒëlÖËGÝ–®(kµÃµê!ålø»Í:Ì=‚q¥Ûjú’ ܪܪ(¢ØôÖ«‡{­š­7Ë»¡AÀ@_?ܱ5c«Qd:|Þ „:îÀ¡Úëý®€Én³`Û•ÊB¨éô¤¥ ø:·*û)cƒ(ج—"ÔúŒðQ§Yëw$Q¼~´sãhWår·]é¶ÂÕ~`†nÆi oÍšÓ…ÉÄñ¸1-·"cW¶ó¦ue !äFaÇsBv7LU=h7nín7*–¦_=ؾr° rÏW¶¯îä s­rpí`§ÖïÈ¢tyëòþ¦*J‡ÝæA»1.÷Ú¢ ¬”÷Ák¿v¸®tÛŒñæ ¿Y/[ªöÖÎCê†!BèÂîzÞÌ\?ܽ´¿Ùö‚18ÄÕ~'¦é ðoíæ óÍ­[¡ŽçÀjÃ8¯ô:ð<ºaÏõÛ·dQ¬ôZ÷6n”wó¦uioóÝõAè'4½¸·‰*wÛÊæEa¥ÛF½½³Æ9o»ÎÛ;k—ö7 fæÊþÖÛ;kAO ä­[¡J¯ lÇ@J ]€Æ¼²q½hÚv7à5ß–¯nÜEi¿Ýب•1F{­º$W¶Ûž“RúÆÖ-øÒ`œ5œÞòn^7_\½†j8ÝÎp­¦ûz2ä"ð*½6Bè…Õ«¦ªo7«onݺv¸[43¯o®¼ºq3ˆ£A迳³&‰â^«£ï„>¬/¬^•Eñ¨ÛzuãæÛ;ëÓvî…Õ«P-˜Ž#´×®SFëN÷ÊþVÞ°¾{ë2B¨ÖïÂêñÚæÍ¢i_?ܹ´·Ywº".ìm „jN’óV+¶fÜ*ï­TöÃ4†¬YBHkЇ.DIGr£–ètÄêp—¢JrÏw;¾&1Á¸ë¹=Ï%„£$Î(Møèý› óYQL)ÐJÀ[Ò‹ASš¾ôòË?ÿó?îܹŸú‰Ÿøæ7¿†á]·ƒeŠéH+å>nÓDx/ÑǰÆBSSShÂ¥s]BiB÷ä“O¾øâ‹gΜ¯c œ W®\ùä'?ùOþÉ?E‘ƒk7¼Ûƒ»Ÿj×]ØÒñ»p®üN(å{òí ßmx&#(%!„€S»Ý|‚öžñHÐ|”sB0Á„rïB¼0>cŒcœ Ø 4ÒâîA¼2„ ¡-eTÀdŒ]…Ôº”QÀ[ÀÝÞɾ\sÇAŒ‡T/ §Têdš2ŠÑmÕK<2Uec§‰ S6ìÁÃ.h²‚§C:À‘ª)Á IJ0Ñdå¶j*ˆ˜!¤Ë*B(½¶9n?ºS<ÔPT Ž Œ2 ú’CÍ>„„Û²ªb—2¥)ÁÄRי貢ˆ2Ä5[§ d“$Œ¢”2¡)F8£éŒsÆ™0¢ç¦ŒeTÓ±ò&B0%<„‹¢(MI6AIŽLuÔ šeu“`’¤)!dÜß®VYFÀ·á¢§)¤c¯“‰ã ‰L2ôŒÓ$§›Š(-«ঋ·‘’CtX”$Š$åt3L’ Žr†©ÉòPË’Œq˜$¦ªf4V´±:$Áw4f À…ÛôO”&ÓÒd¥ç»’ -;¥Ô }[7lÝ„>¥´`f!Q’D'Z( B”$á©L–ržÐT„ Jˆ!%AœÊä€Ë&oXYÍèûã|ÚÎAHªBEIR°2ª(ûQðpx2 ‡ª…ôÐÉ. ¡*% P1$’BÇG}L§39E[®£ˆÒ¬]ˆÓÔ ý‚‘Éh†…€Cî]Q¦íDÙg²y]V›n_„ù\!eŒs)8¡”Ñù\Q$‚…"îlÌmÀ ÆØ ÃŒ¦OYYpdQ"£a‚YLEÄ„q,‰¢&Ë ¥)cú„°õoÒáUaŒ0à-MW$ù·û·ŸÿÄþ÷ŸùÌoþæoŽÅµææçÎ?õºý€'))îÇêqÛs¹›ä¶#„îÜAFwž~¥ô‰'žxûí·?ÿùϧiŠG’bcjå_þå_þéŸþi4ÞSŘ߫ñzHuÇŠG'cN“q”nܽ¡9tSÆÌ·é›A¯“Œä~á-N9ªa‚1Àþ1ÆãÚ &)¥Œ34$iŠ0‰±ý¡ô5¿ñ ʰãÀel3¼nÑd oë(IÆT))0†•"J”QxÓH‚&IJ)¨¦qjåã°*T;ÜÉž0T ì ‰#™aX¼8J•EqL­7ºŠÁÃì†çH—Õ”Q7 $Q@CYÕ!XØ < • lB­•1à:H,…t„xéù. ùŸ¼Š¢žˆŽPCl¤•±ë¹Œ3[×!¸­ˆ’®¨ƒÐÒD“d>!9ÊFR§Ãû2®J2G¼5p$Q´Tmø~êŠÂ9Î?` ézm¤Ä+ƨéô$AZ¨V¥Æ Ï8`2‡!ÕÂP´ Žz¾ éüéHå“#ž²!¿ /€AªýáÓ‰|ƒqµÉˆ•ŽDKuY©ô;°¬@xotÕmÄëX<^°0U{ ‰JV^$°ˆ'#aV„PJÓ”1SÕÂ$®ô:¶¦g ³ÚëxQÄÈ ¥ŒóŒ¦÷<¯9è$6NS=vwÀªå #漌ªuZ^Îfó)cû­º.+Ó™\Óé7þT&«É l#š »ÜN'4ÕdE d»YUEIÄxF£ØpFÕJwšKÕ§3ÙJ¯Ý8³Ù¼,Š[õ²$ˆT›¦¡¬n¶Ag 3¥4NÇÌ‹4iYŽó7•#Hðj’ò ‰Ì!„3£é[J”&' ÓqšlÔ,U›µóå^»í:3ÃÒ$e¬hfa°Ý¨–,»`d¶êåAœ,Î0ÆnUtIÁÇt¤5íVeŸs–ÕÍq2 B(¦ˆ×4¡œ•2vÇì·ê‰…˜.„PÉÊîµ §;mg瀙-Y¶[õòT&7•É®V_²ì„R ?Êä*½ÖQ·5cçB4…éÀzqšFi¬+ª*ÉWvdQÒd9Jã0B9üy´;ƒ3Ós)£7Ë{¶n,å§¶•ƒNãtiÎPTØ›>;=ßvµÊÁ|¶0›Í߬ì÷|·dÙ)M¡ 3vî°ÓÜmÖæ²ècœ&¥ŒíÅáõÃÐŒ“˜ntY¹r°% ÂÙ™…J·½V=œµópU”$E3“Rzy³`X¡ ‰âÛì’mh@\v6›¿q´WwzOÌ-r„.ì®›Švvzn¯U߬WflÀ“ư”¥ŒArÎ|¶¸ZÙßoן]”EñuE’ž˜]¬tÛ7Ë{Ó™áUé(®ïǬoq’À~NFÕßÜ^%„”2v˜ÄPíB®xãh·9èÏç Ma›b)_Úo5VÊû1vÉ)+ëÇÑ[Û«E3ƒîÜdð¢h¼a›B3vîÂÎzÏ÷žY8¥Ék7s†y~~y³v´Y//¦8ç^¤J(…¸×B®ty«îôžY8…zyýú˜’ † ²•Â$žÏ£$yms¥hÙÐBàÑ%`ÛÆOÎ-µýµêყ àX¯îꊲ˜/•»í†Ó…ŽÒtâšXˆ†+†({íº$ˆ¢ $c±àI kÄÇËÈdéxĹ¥éQ’ Â@“eE’œÀO)ÚÿIÄëdþÍ,Ã\ÛØøÌþè¿øÅ••aô}ûäSçý×ýððð¯üôO£{|/>äü¾âïmÕ襺ñ:v„Ða9„®ëhH1öêlÛþú׿þ¯ÿõ¿6Mö^ag–R*IÒüÿñ¯ü•¿2éL"^ºÇå¼dÿÆÐ×Û-¸"£X rt ½ì1«`'ÁAp+\% ÆqtÛO­´QUQà49dÈœ„ ¾Mý%` aŽHÒÆ€´á¸ãaÄB „#®J <Ä«rÄá¢VäˆK¢¤JžuYÖŽC QuL Ù€c§qfʪ0¼Šv•q®I |2BÆÌI¢ J‚ "ÄÆTY„­¥Ð*€+Ê¢Ä8ËhôQDIÑè»ÄÈ…³º£#‰¢$ª(QÎlÍ€–|,¯H|N‰Q†æÂ² Ê¢^Îõ)‚1 熬XªÎ2´'B²(A¿ŒI†þrÄ fF—UŽ&)YÝ„ñR%Y–$‘¢er¾UQ¢œOY¶(#E”I7odÀÿƒW|Ÿ  ¿nM–!`@‚‰¡¨¢ `„dAÔcŒ1ÑdE‘$CQSJ§3Yh9@Ma"!±’ šŠ Xo]RTY6U-¥é”•Õ!¤Hàm ƺ¢*’„0’ˆ`ª|?ÀËÌÒ´”Ñ¢eçM øhò%@g벪É2tÁT4ˆƒŠ‚0Ÿ+Úš‘RZ´2y#Ã9—ÉPTSÕÆš,Ïç cM—#¬Ê²©hðL™Š¦É2ÂHÄŒ¦Ã×àL³ºS:mgÜÇ8?QœÎçÜÒô…|ÉRõ8M— S@L£+Š¥ê!KÕUIΔS¥YY”B  ]°4M“CVB§J³3“2–3¬Å|)£ê1MO•fTIFD.oZqšÎç 3jÀVŒCF!§›P×%£êð­bk†&ËaE”d*`b©ZFÓLa©05cçaXÏM/”¬lÊhÑÌ,§瀱µ4]%E”ÎM/ÍL”&ó¹âB¾h©ZÊØ“óËŠ(ŽÕTµ‚™ “øìô¼¥éˆ#CUsº ɘK•dÀuŠD0TõñÙ%‚°$ y3£J2BØP”œaÍ ã¬deO•fcŠ$å 3£Š()’ôäÜÒT&%Érqz6[àœéŠšÓÍ¢•Ág óñ™EŽ,Š%ËfJSU€F$BÞÈì7N“gO겨ö¬nÎdrAŸžš[.L[ªÆ9fñÔ|¶@›ÊdŸ],X™0‰Ÿœ_^È—IR$ù™ÅSÓ™\˜Ä§J3 ùã\—•¼aÌ Æ8§›OÍŸàÉ¢T43ͰT`òÑç`&Í PÊEIÀO€l?»tZ=­–ªç “2öñ“ÁºT´l@Ú*’ SÀç-{ÖÎGirª4{nz!odâ4ýØÉs‹ù)ŒQÞ°ž[:’Eq*“ƒ·€­S™ì¬Ohº”/=9¢dÙAôÄÙåâ4º|6eT“”ù\A‘d‚Iΰf³ùÅ| óÔ‰)+¤ñ<öŒ¡¨“’eƒ÷¦JÒ¬Ïê&° üð¹§ÁàS™¬­³ÙBDY>»˜/É¢¤+ÊsËgÀ23c(jV7gOÎ-ÏØyÎyN·NOÍÂÖVΰ`!®ÊÉÃT4ÊèRa Þzº¬ÂS)ÁPTØ@˪ƥ ¿ùÍoN"^ÿ?ó¿ž?uVDA 0TQbœéŠªÉ2G\$Â8Š/h) Æ#Y’/\xçÏ|æÏlmlŠ¢{ÿøÇÿí¿ý·_þòÿç?ñ A^~å•ï}ï{·¡¬Ï?ÿÙÏ~–3î¸V¢ |o¤§}êùç?÷¹Ï±‘bÖ]ˆWx¿‡aøþÑ?ê÷ûcoïgögÏ;Ç;?|¤Ô û©Ÿú©ƒƒƒ••<Š"1Æ$Iºzõªa?ôC?Ñ»÷‰x½/”ãCFÜ|`8÷@rÞ×U ùym~{èUïé¾B>Ê}Þò÷aöЪÆÓéÑûøð”Á}tÓݧwÐ…÷}¯wýG¹ï{܇´ö!Cüˆÿó¾'ÕC–÷1¸ü„{ðè}£ÿáÚóûg™÷7©ñªä}!^T-d¤ÌÍÍ¡¤”òå/Ne”AÀ9ÿò—¿Œ& ¬ïñÊî‡x½qãÆ]~Þõëס/÷ú$IàÂo|ã³³³h”؆GÔÄ;;;ödDZÄ!âq¹A ­ŒM 5`Sxe1ÆŒ³Û”ª”$7¶ø0H8‚Ä&£ Mâ–ã}ˆ-4•ÒtœÛ% ÀQAòÜBÓ ÌŠ1]#6JZh!eÌ‹BØçÒÄCØõ¢0JHqƒ89œø8ÊØ @A!J7 `³Ðp•…ÐBÀ Yú¾á¢Ô‹>”6†s>}0=ßþ¨6¥tøÐðNÇu®åE!ðƒsÎ;ÞDŒóžïBU$ ¾ß÷7šÐt½8çmw˜_ 5Àˆq²0¡žïB2VBÓqvyÛ€¬B¨í:ÐÚ~àÕúˆ×ûݶ7ÀûqTé¶!¡µ5pjýÜ¢=èƒú_î¶¢4áˆ×úÆ ÇGj3T×v£n âËÝVkÐÇ;¡Ðn@N­ß©ôÚ°“uÐn ¡¸qTwz0vGV­ß#ï¶j€ê­÷»í&Ì„Z¿y†Â†¢dNÇ€‘·U·ÖûÝÝf 4…w›µšÓÅÇiZî´Æ i€“õãh³^èVÃénÕË®õ;`ð”ÒÃv&U¹ÛÚnT`bvšc$ïzíp^õ~4Ó(cíŒ~¥×^¯:-èxÛsnUö'Ûôì‰ÚkÕaZ:¿×ªÃØ•»­1üv·Yƒ½È¶ë¶Aõ ïµê=߃î‚î Õ2ηG ÝÃNóÆÑ.ôq¿U„]sлz°fܨÝ*ïó¹Ó¬ÄØ }€…&”Þ<Ú[¯ïÒÞ&€¶êåë‡;ðn7*0 n¬×ŽgŒó[•ƒ›G{ñ~à]ÜÝ(wÛãÝVíòþ¦‡ãF°5AÝ*ïÃ>]­×ÙnT1ÆñÕÊ€õöÛõ·wÖ@âìÊÁÖJy¤óVÊû0›ƒþZõ¦Ä;;ë GæÅá£]˜H‡Æ^«]xcs µ£7·WaÖ­Ub\íu^Û¸Ywº`O0(´€w§Y}uã&`VÞÙ]Y­Ö ÿòúu@®”÷_ß\>Þ8Ús¹apå`ó1˜2ve T§Znÿúá.<Ú·*€( “øâîŒÝ^«¾Z9€9se ·Ízù{·®t¼åì­[ïì®CÅ;;ë*w[×v`h^\»zýh¬tqoÞo﬽ºqƒrÖöß¾y L·RÞÿÎÍKÜyiíÀE£4y{{ FüÂîÆ «Wa¶_Ü]‡§x­zøG×/ÀÓ½RÞøvBÓ·¶Wa­;ê4/în`Œaðí›—.îmŽm +Õzí¼ÍAï›×Þ¾UÙ~óÚÛ=ß‹Óôo^z}sc¼ßnüþ•7v›5Œñ›Û«tãÈjÿáµ·.ïoÁêôÚæ <û+å}Au[߸ü`HÛ·¶Wáiº°»zz›õò×/½Óc­zãºÓû¯—_¤v­ß}yý:Æ8Hâo]çåõ0_X½ oW7nþÁ•·Â$îùÞ×/½(æŽ7øÞ­+Œó„¦tãâݸÈ8¯ô:_}çeÀw¿µ½ú{_sBß‹ÃÿzéõW6n€•þxåä$|wåò\y3¦iËuþË;/]ÚßÄ_ÜÛüÚ…W`ÿÖ ¯¬_çÅiòêÆM7 áÙ{Bÿ¥µk7Ë{0‘^^¿ àN£ ˆþ®ï¾³³«Ç^«~õ`;Lâ„Ò•ò¹ínŽàðû­úN£ 4×Û TÄQ|¿Äµæ O‚[4œdp5ý1Ÿ´!äÞ§B|¿ò+¿R©T4Šúß~ý×ÿößþÛ4¥Qi‚FNν;ª”³$Mlj:ÞxEh”Ü…'¯p»o~ó›œó±{º°°pêÔ)4@€÷!ÀYLÓôÇ~ìÇ®_¿þÙÏ~–ôd¥ûþÀÊßñzW9 '°‚ƒ> ø¸Ã8ω·Ó(9,¥Äajâ@Ùð I(∲— Y‡#N…d„P’R`Í€y 9¼ù@à–1Î)eQ2tÑ¢$t7ç e´ã:Nà!Ä›®9ƒÐ‡pX»N¯áôcØÕ®çº#¿1èqÄ#œPzÔi"„Z¤GÝ&Ád·Ys®™s^wº”1'ðëN—s¶×ª£z‘q¾×ª DØiVBƒ0èºøN«;]øV ’Âà½AµŒ1pÇ¡ãcPdÝé‚Â$®õ;0©º#P3ç¼ÚëÀ'àþ6kG¡ºÓ„ç|³^ˆ°Û¬îµj]ßõãVéu`æqTî¶B»Í*(ï6kÛŠ@ÈN³ºß®×½(M׫G¡j¯íF!3ªV%a(9:”tB/¯[%Ën{Nœ¦Kù’H„šÓ5u>W†rœÃLPŒ±2RÞ‰ €Ÿ ã†$ˆË…é0‰»þ`ÊÊæt”÷&¯JdÆáb¾¤ËJ?ð"(’ai¨†‰â49Qœ‘E±Òmж\œ†gA%Y€·èôÔãÒ$MîF¼QN¨LÂ$îx.@Ú®&±®(Œ³”˜c©SU”ƒ>P™$iÒrô°G0.ÄQJSƹ¡¨n¶Ž©¨pd4sΛƒ¤ '#aV„PJSʘ¡¨a7=XÄš&Œ¸Öï@gL:ˆl¥ÍšŽiï@¼Ž±«ñÄU1MÑd:<£$M)c¦¢qî ,Ü MrЮ‹D˜ÎäºÞ áô,EV;ŒñymÍh8½¶ëLer¢ ì·ëã;×üJ¯mª*B ¢0«áª¬n¶=§Þï–,[•äÝV26—-¸QxØi‚.pœ&·¯ÉñJÇHÉ8MJ3šžÐt§UÕe¥hÚµ~§í ²ºÁ&q²”B¤ÜRõ½VÍ¢œa¦ŒŽÕZ:¬V•ä­F°#nì4ª–ª¡a?ÞŸÚ‘@ „ˆF8Ù­zÅ£åÂTœ&›õ²¡¨3vî Ó¬÷» ù¢"JëÕ#ÆùB¾äþ^»pæ0‰‡b¬Œ…q̇ýJ'РC%Ótñ¥I†PÊ ‰øˆ<2š¸*N“¬nRÆÖkG¦ªÍe û­z­ßDvDPmB)8Ð9ÝÜl”{¾—3, {GÍL¥×Þo×— %[ÓWÊAššuµz3̹l~³^nz3C9 ã˜rV´2Ao«Q¤$Pjç +¡éÍòqü Ä«O"^#„PÑʬ׎ÚÞ`*“Mh$ÍjøH°uãfyÏóÓóýÀ¿~¸[43K…©ÚÑQ§yº4+ äÚÁŽ(S¥ÙZ¿³Z=œµó ÅëÞ”e¼×¢!âUÐ.â(oZcÄ+îó$}¸¸·¡ËŠ"ÉÁh?ÇÖŒ«;1MK–%ñкQ+—»íÙln˜5Dé\®ÐôníÍç %˾²¿=ü™L.Nðtçr…ýVc«Q935gÈêÛ»k)£O/œh¹Î¥½MÀj\?Úm{Îl¶ÐÔ‹BÆØ|®Xî4WÊ{'K3yú°»áGÑ3 '!2š5Ì¥ÂdÌØ9ÆØáèpô³º¹Q?rÿTi†R¶^=RD6ÓáûÒ„Ò¹lÞ‹££nô÷ª½Î ¦2YŒp¹×"„ätË ü®7Ȩº*Ê §«"íûÝ]R²ì¹â”µUCŸ)NMK²¦e³Ù™|¡˜/ȪZʧ²9Ó´LÝ(Ú9p`vw÷ÐD¬*‰‡\ÀØ•Œö±rä#Ä9O’!tGj¢ ¿‡ a @¦4MÁÑeùË_þò?ÿçÿÐcJéc=öc?öc¡±“×ëõþÒ_úKý¯ÿõ~¿?Þr… ü!Ò½ah*|Éßñ: }¶O‚[‡á&>Áš†ÐHãuÄCN¥p›lˆxeCZ,SÖU‰£0!·}MYŽ Ñ50" ^9GcY0Î%AGQò9ø<¦œ+¢$‰"<Þ@HYG |.‡ „PÎTQ}àrmôå£@ˆ( k0dUDJ©*˲(qŽ@Z_bH¡;ØPŠhËáˆ` ²°ªøjB©¡(º¢Â@f4]‘ä”RE’ Ek(ë``‡6¥QµD%E’)e²(fTqŽ0V%™Üæ[’ÁËQD 0¿cE’Q¢œ‰DÈ&T«Š2€éç#£+JL©&É • ˜vSÕgÔ‚>‚ÜÙ¢•1-¡)ȹrÄ1Bš,«’ ¬dÙº¬FibªZΰ$AˆÓ´dÙÍ ”J‚8ee5Y’8oZº¬rÄEB E…h¢®¨EËVD)Lã’eguÝ3™!„s¤+ª$ˆˆ#Bˆ©¨`:U–UIÖ%%HbVÄqÄg³yKÕƒ$¶5#oXœqðYÉ.-bÔ¢¢i¬ p#‚s®+ Øcl(š¡ªð€,äKPƒ©¨ª,+¢§éb~JEι&+º¬À¤5UÍ5r¹8%qd(Š&+š¤I´T˜R$‰1®É2 A9B ¢ˆ8D]9⺢AµcXDˆ«’diúpv©º*Ɉs¶nŒ9瀨…ÑÏh:`åg§§æ€‘ÇR5p|ý8:Yœ™ÊdcšJ¢xª4 _“¶fȢĜ­Ag4ýdiÆPT7 Ngfì<|Sž‰WAcD"00JR]VÎLÏgTÝ ý¥ÂÔ|®qúÇf%AdœÛº¡Ë çH $oZ  YÝÊ#Ð6U%)Lâ'f—f29/³ºyjj²f fØTYÎVÞ°œ ˜Ïæ²Pø.Zι¡h¶fä ³ï{§¦f S„”ѧæOÂ8f Îqÿüü²¡¨Œ3ÓL«ç»ËÅ©¥E’Â$~jáx¨9Ã|bnÙÖŒžï>6³¸T˜‚]‘gOK‚À8+CQ`>meRÑÖô¬nÂèOelÀP+’ Nã÷”¥ê”±¬nLÛ¹™l¾átŸ]<=Ÿ+ùÑB¾4—-ôw6›ÿÈòÙ„¦f³…i;m?|îé…|±îôžœ[>3=—R¦HÒ|®8Ÿ+¸a3Ì:ûT)“­;Ý8÷äÜ2ÄD~ôñgN–f›NÿÌÔüÓ 'šJ‚8—+ÌçŠa’è²ú#=3—+Tûg—N=³xJ•d/ ôñgN•f»¾;—-<·|&¥<—-Á‚¡h%Ë.Yv×s— Sg§ç5Iö¢ð™ÅSÀšQõŒfd Ó üÅ™¹\XTÏLÍç Ó¼i-䊚,ûq´˜/­Lʨ$ ù¢¡¨AÌŒ¥é)¥͸|â5ât}uõâ[oï…^|éÅ«.¾õúëßþÞwß|íõËï\x饗¿÷â Þ|ëí7ßúî‹/¼öúk¯¾ô²¬ÈK‹K/^üö·¿=Þµ¸îÏþìÏ꺖¦)Á8ISE’EAø?ÿÏß{û­·ÀåaŒ}úÓŸ†$6Ur Lñ…‘Æ+lãš–õ‰üA˲Y*ÎBÙÜÜüùŸÿùöÏþÙø¾@ü•¯|åãÿxš¦Ð58ów÷w/\¸ðïÿý¿'„œ?^×õñFŸ$I×®]ûão2ø ûØÇ~ò'’RzÄë½pž{ÿúžà*  æû ÃဩGoÌ$ åA?î¼ÜQíƒt9Ôȇ7æÝT>?\Ó=¨ ʈ¼¿Ñ¯óóOrXy¯–yô'wòOŸH2Á>DÓ½ë}?Ä™öïBôáZæ'€™6^îTß§azø\½ÝŒ?‘‡ô¾—¿¿§éMôˆ£?y8Nßã-ýàûÜ÷wÕƒ¯ï©@¸ëüƒÀ9ÿÃ?üÃÉpBè—~é—8ç£Ü~ž¦éßû{ïv4PB?÷s?Íû—ÿò_‚$k†|ñ:¨[\\üÌg>óã?þã?÷s?÷Å/~ñãÿ¸4b(ƒsàŸŸÿüçÇ÷÷ôþàB²<Ì‹(‹?ó3?óµ¯}íòå˯½öÚ¯ýÚ¯>ìd¿¾ò•¯pÎã8Fé8BqŽ0šm;€|â7šÈ¢DœÒÑÀ°Ó Ò[ðÃÆ +Œ{ûªhž0™Œ‡AK6bvIhʈ‘LÈQ‹Ó”2*Œôà`ÊhBSH‹Ò²ÜgªHb㈇ÃR´à^a§”Š¢À†0X _rQš@Ï#ʸ$ŠŒ±pt0Hâ8M!MÊ#2º04"„¼8L(•E)eÔ L°(IšFI ¤tƒÐgŒÉ¢Dõ£bxnDI¢ˆRÊ(( A¸.ˆ#Ø›ƒØPvÃPBˆA)’Ì8ëùç\¥„¦^(¢Äê^”$š,'4íz®€±$Š Ã¥H2!¤x@¤$qÏs%Q¡ë¹AA­ç»"AˆÓÔHÊéã\EÊXÏ÷I"„ô|Ï|UR!oÉŽ M{¾§É G¼å:AŠ¥ ¤kÈ’$ñ ðuEç²aJXš¤ C<¦)äs˜@F—q¢%QšÆ4¥Œ¥4Ó$LÆ9lüSFaƒ?ˆcP“a`cð“4@hG”± ‰¢4´• ‰ý$Jì'G&¢$‰’8¡é]GÐqP¦Cyq§i˜Æ~ºaR’œó„R?‰BƒÐOœ)ãPâ #¥±…ƒ  ŒõŸ1–2 ØU4bSBaäÇ‘…Qš ¿ï{)¥=ßî`m~Ç~:¡ßõݔѮïºaà„~œ¦•ì~LSÎy{àPÆ:î ï{^úQŠÈ½ÀƒÌª8MzþmÍ>°ã¬ã ânô/ˆã¶ë „z¾ áÉ´ã¹ã®çzQ0ƒŽ7hú)£5§Ë9’¤ã»¡Æ ©l=ßm ú)¥Õ^! †9Úv˜&¡0IàF¡®çgz¹×JiZëwÚ®Óõ^ÕB¨9èGi’2ZéµJñ×ó\Àºv)Mº-ðì[#4hsÐâs~ØiÄ4=ê¶N¯ã œÀííz¿ ¹D~Öû]„P¥Û~ÛuNï¨ÓŠÓà‡ƒ0W[ïwœ§ ^Ôz™V{ƒv=J’ƒN³9èUúm/ ÛÍÃNÓ ƒJ¯Ýó]Ž8l×nÃéõ| GÝTëÅ!€LÚÍ®ïÖ^¥×ÞmÖbšn6Ê0—D•»- ýÙjT¢$ÞnTÚÖ ßôËp4@Ð?ì´BÛj?ðº­J·½Ý¨DI²Õ¨€&i×ì¶ê.¶Ó¬VzífÍÃÍFy·Yo»ƒj¿sÐnlÔÂ$ÑÕÃN³xÛêV½ì†Áv£Ò÷½„¦;Í*Jñ 9ÝR%©x£¢e§Œ‚ÆëÕ+ XœŒ32G)›€K(YYΑøº¬duP. ãc\²l`FAÆYBéT&‡Ž’xR­U$‚@„0MG3vŽ2Öó][3lݹÃ{USý8Ê›–¥jÀó2›Í3Σ4‘Èm@뚊1ä©…9ÝÌVÇs¢4ËEBšƒ¾!«ÓvnúNàOÛ9CQ½(ð0ÓÔ C[7@Æ !$‹w#^Ð\g{ऌBZXÄ#}‘ac$Að£ˆ`²/…IÜrûEË.˜p€I÷ˆ‡:7kçlݨ;]Œðrq:¡iÍéæÌŒëz/ rEY”jý®*IË…i/ [ƒþŒ+švÃ饔ž,Î0Ϋ½vF3sÅžçö!_Òd¥x"dq¨ñ*B ,çašœžš9ê¶LE].LTSEI!wþÌÔ\LÓ8MdqˆëôÂðtiV„^àŽSB’(È¢˜RÓôìôâü°Ó°5c¹0 ”(Š(É‚èFøÜÌBœ&Õ~g:“›µóµ~7ˆ£s3ó¢ îµê¦ªž™žs¼),êNv¤…ꟛ^P$©ç $A¼š*ˆ£«Æznz¾wvjÞRõ¶ëˆ‚aòÖ ?kæ²ð ‡g×Ñdåñ™ÅžïÕî驹’eï6k)¥ççOª@•dUj’>>»d©Ún«& Ò³Kƒ(@i’<”ÅX“}II†Öª’, Æ wÒôçsÅÅ™ýV£xOÏŸPey»Q±5ãüü2|°i’¢J²‡qš>³x2¥0òc#¨’Ä’Ç–QF›\š¬Ü…xmzOÌ-NeìÍzY ÂsËgü8ÚkÖ– S§§f›ƒtG¥Ö o*ês˧›®³ßn<>»¸˜/m6Ê)¥=q6NS'ðUIVGÑ$ÆQ ðI•^ûdiæDqºÖë‚Ö ÿ$ ±C˨’Ôõ]Žøžz<ˆãõêá‰âôsK{ÍZ×w?vâœ,ˆÍAOeV©ôÚÏ.œ(L¯Wcš~êôñ.6Ì¥n œž8—ÑŒj¿#‹4¦Üm,Íœ›^ج•Ý(øÔ™'%A¸~´[²ìž8 SB—UØàœ=úÉ8Mת‡'Š3O/žÜiVÛ®ó©ÓO(’TíuTIáÄZ¿ûøÌâB¾´U¯$4ýÈòYÄÑV£R43Í,ÔœNÛužœ[Îhúv£* ÂsKaqÎIè1ˆ¬ W a(Å;—Í›Šæž€ÉíG{½’d*“‰$d¤Ý`zßEB(Ã_ýÕ_ý³öÏÆqŒG‘”®“p^² Šñãˆr‰ÆÃ¯ †I¦1à’Ü(@i²§ÔCX@!‘’ÓaÒÑa’I,ƒJ,„'$\Ù=‹8œ ‹R”¦nÂc|]‹P:†ßÆQDº¤Œû‡8õ³á ‚è„~”&¦¢qŽ@‘v¨ñ:2BJé˜hRŒ•r ŽN×w⦢q<x…C”W‘$ÆY×sáyH¥ŒÂ7FÇs8‡­ðIWJSD!ÞvrÃ`øª¬ Ãö°1”"„I‚§­éãÖÀŽ ¸T Sì ÁiM–ûß÷½ŒfˆDhz)c9ÝþL]V Em»ŽGª$ •s®ËÊ º¾lÉ5F¼²ÒñNàÛº! äÀª(A|ܘ”RM–)gu§+ bV7»ÞöÊBÉX±‘1p…uYm¹Î ô fÜ2ÀÄô}·5p,MW%¹1èÉK”$Õ~Ô½Z®ÓõyÓ"„Tzm„PѲÝ0¨;=SÕ E©÷»a›ªñõ±Æ+Ð5K‚”ÔSVÖ‹Cx!„â4M(Õ$!~Øi ÑשHÒQ·•ÐÔR´IlBiLSQLÚMàVpB¿Úk¸MEeœí·ë¢ ÌLÛušn¿`ZŠ(í·êIšÎe ^¶ÀšaXÂNv|_MRöÛõ(I2š‘Þ)ÆšÜV†ÙH¦6âdÕývà [7 Áƒ#nëFsÐkzYÝ@Ã’4£aï·ë¦¢æ ë°Óè¸Î|®HÙnT0Æš¬DI]º¢ìµjnÌe 1Mw[5 )} 4"ãd#Ìã'%ñb ‚¡Yݨ;Ýr·5›ÍŠºÕ¨q¼+9¡¿Ó¬:Lâ0MtYojŠ%ñ$üª¥Œ†# iœ&ñ¾Ä#ËŒ¯¶nì6ë-×YÌOA,Šs¹b¥×>ì´ s HΩYÝt£p­zhkÆŒßmÖ*½öb®TÀ!M“$LîmÌP¶hfÊÝÖQ·3,ιG°.&,3’†I%IFÓç7Žv%Q\.Δ»ííFu6›7mµzÓ$oXc>Ñ‚™Ùk5ʽöraš`rãhWÀÄÖŒpHAŠ2š¾Z9„~ÑÌ$éÉ[²ìr·½ß®/æKŠ(]?܉iznz¾ã nUöAƒË£(I,Uç]?Ú9Qœ.÷Z›µò\¶`©úõ£Ý0‰‹–}»1†µ×®øš¼Z=àˆ/åK]ÏÝo×óF&£ê;Íê óÅ”Òf Q:€æQšŽä†‡ ‘&ÉÍAßC€ %·í!ô^„Žç¤Œª¢Ì8K)…ä3YUdUÑu]ÕTYQUÕu]Õ4ø¡iš¢ªÃßú𠜠jBH”$6·þÎÿñ»í¾lÃišFQE!äG>ó™?üÖû7ÿæßüØÿôçÿÎÿë—h(P †ŸúâO]¿yãcûç\’¤”Ò¿ü—ÿòþþÞoþÖoþÏŸÿŸ—––`6½³€··°°ð ¿ð 7Wnþãüá¥<éÏ<nšæ?ü‡ÿpccã+_ùÊüÀÀîê]µ©ªú…/|áÊ•+?ù“?™¦) e1Æw`tï-ãæ±wÅGþ¹ŸaÈ„Cá:Æä´aŽ FØó#˜@ªøÝ!À2Œ 1 îÔ8ü#‰b’¦„I1Å)£’(ŠDˆRŽFá7˜C¡Œ*¢D0Ó˜`¬ˆ¢ÀH”&ª$ ÏA!¤J2$ºA.¨ü*¢Ä8Gˆ«’L$ñø“†1F^h)e >àQof,ã(Œ¤²Œ2Å CL°.«’úQTS…²T}š¬@¨O—ι¡¨ÀÕl©ZB©ú–ªAø >ËÐðC>±¡hˆs]V 4ekå¬ï{–ªÉ¢§)Md4èømMW%Éñ½ŒnŠÊ9OhšÕ-„¡j–—7,7 r†¥ˆexmpÎ3ª.ŽFÇ¡ ME)ê’Œn „,U: ÓeT}¨ŽJ„¬fpÎóF¦Éz€.Ô“¸ã:¥LƇS™\sгTà‡=ßámCV‡Ž3Æ€±E)¢X?„­ ï5k:ž3•Ée4r§t6›Cå pÇÓ™\?ð-£êð´˜+5½ÙlPÀ¹Îxé&ó¹bÇÌeó¦ªwBãEÓ†è‹&É+ƒšÏ:-Qf³MVëNw1?…Òu¥+š6¼þ%A*Y6ç|.›?`!WhA¹×šËæKV–qæ†ÁbaŠ`²×ªM»`fâ4±sŒó;Ìœ‹…Bh:“'L“”éL!´\œÞmÖDAX*LYªVî¶O—f!]iüðNgrª¬H‚x¢0Ýrû'K3–ªoÑ2Bh©PâœÏfó&1mÚÎ!„ÎLÏmÕ+–©/¦TI®ôZC WJã4=]š “x«QYÌóSã¶ëœšW%y­z( ÂÉ⌭{­úÉÒÌŒ↳3ó”±õêáb¾”7,/ ó%ˆ‚Ì ¸ªççOì4ª'Š3‹ùG¼ë»çç–B3v±'ç–;ͧæO „²š$O/œÜ¨*ÍZšÎo©0]ŸÎd%AB=³xr§Y=7³ž†çç–BK…)]V%Q²|æúáî©©Ù;ïEá¹éyÆø¹™?Š(gOÎ-qÎÏNÏË¢dëÆ¹™…æ ÿÜÒiE’/înMûüü²­éëµ£Ÿ| ÜhÉüà©Ç¯lŸžbnI ä°ÓüäéÇBóù"Ìj‘ç¦ça¡+šöxΜ,ÍBˆ]•äs3ó”±'ç–¼(LhúÜÒ™^à^ÚÛóä›Ûk§KsÏ.6u½zø‰“ÖjJéÇNœE=9· (ûg—N—»­OyÒ՗ׯ—2öÇNž+Z™k‡;ÿݹ§¡1c¾ÆÇfsº‰²4ý©…œó<ç'Áä#Ëg(gÏ,žqç’i?>»W›™Ï–H„9÷ôÍÊþógŸ\.LI§ÉógÎ÷|÷µÍ•Oœ|È’ž^<‰úôÙó/¯_Ÿ’²Ÿ:óÄŒ»¸·ñ™Çc}úô³Ï=wòÔIøÇÿïô—þâÿòꫯöú½ù¹ùÏ|æ3§N(=„c³3³õgÿêÏýÕŸ Ãpwwwkkëàà ^¯»®‹1¶m{iiéüùóO=õdÎv—…F¤$pB±Xü¥_ú¥¿ù7ÿæÚÚÚÕ«W÷öö:c,—Ë=öØcÏ?ÿü„ý&!#øA¸ÛLÂ÷Ûu<‚r÷GN¼ÛÁ»îõ«>ø ¤1w|ïU£Ñ†ò=ÌÌ 1wÙö¾õßgDÜÚ‡Ü÷½š=ByxËß«eîî×½ñäÉÊ!„ü!Í™»žˆG·Ì#Vû »=úT„à÷1øïã#N¤÷<ÐÖÂ÷:¿¯Õ>d>?ßuÉ}HînËÒ}Ü¡aïÚÈG´ç{½×{Šš`ï©1¸*>ÊÓôÁW§q§Ýï^-5?êCú^M÷ 3?Ä)ñ yurÆÈí\¯á]Æ(O4‘Ð6îÝ0eí΃àäÁñû¶v\?\>¦ »·Sãã·Ç;#yãÆ9|“UÝáÒ ·M'ç=Bcô¾žÿ‡—û|׫Þ÷Éï¯1ï©<èUôûxß«î; ºn¸§þaØó_ß?Ë<|¦}ðÞ“óñÁûˆºL¿ïòa5æ}Wû}*ßÁ½÷„Éøý ÆËæøÌw½ê!ßÓU÷Þw|cÌ&ÉëÜÚU;YÕCZKF)ÑøÝ,soµl‚£ŒFÞ­ÚwmÌ=]åùŒ~ßc™ñ !4ñ?´1œ@ÆÎWAý÷½ öÞí^wWËGEîîã5Ü·1ƒìð Æ˜q6¶‡ G|âÙÇh\ÛC«}“êCyrч‘H7vŒÆÕòÑ 'À ¸V÷þõAÝS±Üu_¸|âUü.M{÷V8nɽîã¯xâ‚;NôᾦyÑýî…&Ö¦; wÏBùГo?÷Ïuû®ñ¸ëîp/4‘í7éOLz|Ÿ•t|ò诣ÚFCŽÑ]Õ¿„îi Ÿ|ò'¶ÛWÝ9ºwÕp÷ëyÔ¬}œáÒݹ©ÿjï>alé÷rÕCƒü!qŸ!»Ó2·OÀèQÏØ}«E#¢l>‰šháý¿Ñßcñª{#Á÷Ç÷Øt߯Œ ÈÑCMwŸj''Ò{ŽI<¸“ÏÂÝÃtOµwXõsæÞ>ÞñLM4ßoíº}pò¾“Atÿjï¯{«½»1÷¿j¸<Ž«ü^¿çÌ{[øjÑýìyWcn¿2î4îC,so ©ÚG°Ì}ú .ßh&Á‹õž3ñ¨…£æ#~;Áè½M&âX“¯|ÿËñð¿»®zXµ@Á~Gm“'Œ—ßû4枃ã…z8ôã¥ßw†ß]-GCóá“êkéèÆ-×ð …ý®5ü/¯û¿ò&ßn“^ém3‚‹|w Ý~£ñ”ݯÜ×·ywæ¼G‹6Ž_j¯ðn»ýI~^—ãr\ŽËq9.Ç帗ïGy$×ãr\ŽËq9.Ç帗ãòÿÏ娥;.Ç帗ãr\ŽËqùS_Ž]ºãr\ŽËq9.Ç帗?õ娥;.Ç帗ãr\ŽËqùS_Ž]ºãr\ŽËq9.Ç帗?õ娥;.Ç帗ãr\ŽËqùS_Ž]ºãr\ŽËq9.Ç帗?õ娥;.Ç帗ãr\ŽËqùS_Ž]ºãr\ŽËq9.Ç帗?õåÿêÃúUš–›IEND®B`‚ldns-1.7.0/doc/images/libdnsoverview.png0000644000175000017500000012517613026206166017623 0ustar willemwillem‰PNG  IHDRA«Ç3CÔbKGDÿÿÿ ½§“ pHYsHHFÉk>€IDATxÚìu¸UÒ‡ß_ ˆbA‚KÐàîw]\XÜv?XXX`qwwwww×àî. $!©ïªáv†¹’+™+õ>O?Ó§ûôéj™îê:uªdf$I’LH$uö6¦>nÎ6³’..5³‡Ê¶\¬bf£$í ¬YÖüf¶ž¤NÀCÀf¶[¡žÀ}À©uˆ¹µ™}\ís•$IËÑ¥Ú$IÒ±Ô¸ W~þ ¼Ìì ¬Ü ,ÜSaóÀr@§(¾N+ÔUÚUÔ]BÒµföX,Ÿè œË—«¶ÿ¶Úç*I’–%• $I&4K³˜Ù7±ìSà‰°/ŸšÙ#u¬?8Xª¸ÐÌ~4G,~ÌÌ~¯ö J’dÂЩéM$I’Œkw ?1³Qh¯Ÿ¤…i@Ùú3€é%­]íO’¤u‘– $I&4ýñ.°æb `áBùI`ûBùwààHIwVûà“$i=¤”$I³"é!j¬ÌÛ˜ÙGeU~&kÆ]^af{ÖSçRàÿ€Í›p\›;GñI3;°!I’*JP’$ÍÍ>¸S2À—Ö? ì)©«™ž™ÙI'·7²™‡€·cþ§ !w’$-Kú%IÒ¬˜Ù+f6$¦‘ª\„€)©;€¤N’¶–´t Êu3ð5°Y#·ÿºp\L€S™$I “JP’$3û ?3ðƒ¤¡ÀÏÀ߀b×ÙU’¬0[K“{”Õ³ˆT‰ý)ª}’$i(ƒ%&IR-$õú_äÐô$I&4©%I’$IÒ!Éî°$I’$I:$©%I’$IÒ!I%(I’$I’I*AI’$I’tHR J’$I’¤C’JP’$I’$’T‚’$I’$餔$I’$I‡$• $IÚ’“´WëêË:ßf‘´Š¤%TaÝê’¶¬cÛÿHš½ÚÇ$ŠT‚’$i̬U˺ÞÀ€j ØHš¸x Ïz_΂Àòu4±0mµ#I&©%I3!©»¤y$Í(I…åŠYHš\Ò¬¥õ’:—Ö•µÕ»RPIÇÔYÒÀRöÂú^‘‘}RIs–÷“4·¤‰+´Ù3Úê\j?–w‘Ô3æ§“4mÌwú³Iê\Iîø«pœ=ãÜLTÇùë&©Gœ¯Ù%M^X7«¤¶é'i¤:“¢F›}$u-./´5[ñÚÅòN!Oß⵬e?}ÊÊ=ŠÇ,iIóIš#d)Öíç¬oâzNVÜXx¸x©¾vb»)%M_ayé^ë×»W…:3Kš_R¿†ì+IZ]šÞD’$’ÖNÞ¦~‘´š™ýL |"éx`%`Jà` ;ð±¤EÍìhk!à^ü‹|dÙ®ŽÀ³¯OüÌ+iG3»5Ö\¬ |,/é`sà-`.IÛ›Ùm±¯€ó€—q É0<“û¾x¦÷Ó%½ÌÜ"éàà} 'ÐKÒfö~ìÿsàl`E /𞤓€ß€~’–0³/+œÆCî.@·8¶­€­€é€Y%nfÿ ÙÖ>æ‘t«™íZáÚL\ °-°I´¹JóÑÖÊÀdÀиvcC©¹˜øxØ‹ ¡ý•¨ gS$­r Yº‹Ç¶[Go%]nfÔr¯­×ø-`I7šÙn!ÿÁÀT!ó1Õußžl ¼#é' ¨$÷î,À(`nI›šÙ=¡(ß뇅Û™ÙÃ$I[ÂÌrÊ)§&N@ s¡|pHÌOƒ¿ôvŠòÄÀ§À2Q> 8©°í¹À µìçà[`Š(¯ |ôˆòwÀù…úkàŠÉd…ò÷!oϘ_:ÖM|å•CîÁ…ö&&.”®(”‡GŽó à~ [,»8 –cÛWì¦òÎøËw(~&Šòä…m'ƈÒ9Ý2öÛx8†š„Ñ[÷®›{G¹®à­åcðî¥Ò¶Gck‘¿·?RÇYvu¡í»€Ý‹2Çïlq gŒò$¸¢´L…}ô¾Ör_\ Ü8Ê©ã>=¸ æW>úFyÍ8+DùdàÃÂú¿Oî»wËÚž¨ÚÿÜrß)»Ã’¤yøØHÒ)’.æ•Õ¹ ÀÌ~^fåg[G×äÀ¦¸u¦6î2³o¢­{qÅ`þÂúK ó«7šÙwQÿ.Ü¢±°ð“™=ë¾n+Û×gfö@©`f¿ˆãíÅÀ²Žóš²ã¼ÝÌFźç Ç]‰'Ìì³BÝQV+3{WŠJÝb#%í%é,à\™¯ÐÖTÀ£À5f¶¿Å›ºJ×f0¤ ãŠÀ•…m/ªïF¨ƒ7€Ý$í.i¦8?«ãÖ·%$mlH(ÉÚ˜ßÅtËŸ™ý\ n„<ƒÛ¢ ÌìN\a.rGi=ã^»÷€i$&iI]Íldƒöš$­ˆT‚’¤y8Øx8x ÿj/1ÖÌ~+”ÿ º£Íì5ÜŠ±®½hfïÖ±¯_*”‹þßæ{ã Z‘p+Pw¼‹ªHy¹ØV©Ûædài¼«å޲ãøµì8ËË]ë8¶òºÃËÖ·¿·Ý„+Aï—É2ЯÂùªDq?£ ûè+™µŸ¿PæST|Æþ8 W_“t]ø}õzÓãÝ~SãÝYOWh¾®ë9¾ô¢ò½T¤x=þðOà†èb,9LßbfO–íã#I××J:5ê-‚+ ãËeÀ’ŽžÄ•ðá ÙPÒêÀbø=5®<Ñ’¤ª¤”$ÍÃ?cZ ´)P¢þ ð¿²úWS°Þ˜ÙHIïügjãàE`=Üù÷´Âºcq'ÛR»?Æh³]B¶(ø™Ùž’ÖÁGœ ì;3ƒ¿œÏ.Û÷)x·Èj¸•icܧ¥Ä‘x÷L‰+ñQL%žÄýI*ñ,ãú¤|_V§x|«àJà걟ۨ±À¼JŸÏ‡’–v45nÝ)ñ{\›? Ën>‰m_—´8î4ü5pgáºVbSà_¸õí¼{´äãô®­í/ff#$­„+2kâJèàõZö±°C\Ï/K>b±Í%uÈ÷C3û9Žmë0`aj”÷{pËV‰oqGq¢pås$ðfv3IÒÆPݾ‚I’L$ÍŠ[Yæ1³ê¨wî»o3íw îüü‹¤ùqëÒ²fözÓZnHê 4³W#&ÓùÀH3Û¾Ú²%IÒtÒ1:IªŒ¤Óq_ŠƒëR€ZˆÅ7$}…[SöHhºÇùyï Û¯ÚB%IÒ<¤%(I’¤AwÅ»7_»\óÁŸ$¤”$IÒî‘4ïêì‡ûA½ <;6¿„>Ûø=$IÛ$• $)CÒ$ø°ã§Ì¬A£e’ ¤Î Rž’fÇGsuÁ»ö†ã#»àažÄ£·óü&íT‚’O8¼.…èY ˜ø‡™]RmÙ’Ú‘´ Þµó~“ë Hšx ¦Ý­B•’blr(n1z¸É<^’´rˆ|ÒáˆäKàJÏÚx@»ßð¼Xƒ/©¶œI½¬‡ ?«Ú‚´ÌìSI âŠÍ Œ›0üþŸW„ÆFyžìÇjËŸ$ÍMZ‚’vOd_P·60îуq?†ÿ3³ãÇ{'É'Fl½nf+U[–¶†¤^¸Ð\xú”cpëÏ9xιO«-k’´$©%펈í²®ô¬Ì‹[zzP{ÞªáÀ‰fvHµåOê'â½Å^f6ºÚ2µ5¢ø.`Qjr®ý†§Sy8ÄÌÞ¨¶œIÒ’dœ ¤=2Oüø Øp³~m÷ûpàœT€ÚkÅïHÜŸ+O"¡ï*x$ë’Ðh`s2fÓLÐ&ÙèY(Æ£¤‰˜ÙáÀ.T°®™Ù·ñ?š+½)éxI“W[î$i,©%í I%Ý œìefk™ÙÐX=÷yxØ £á¶=$ X wt/ÑØ Ú²µÌìà¶:Öif{óáçþIGHê[mÙ“d|I%(iHê-é$<-ÀýÀ¼fvwYµ5ñh¹kæê6ËÂŒ«•X)¤¤0³—PçS3Û¿&ÓC%,©g½;H’VB*AI›FR'I;ïà_¥s›ÙIåJNÄDùXÙÌFV[î¤Ñ¬ƒ§sÿG̨¶p3ûÀ̶Ãóíͼ/éß‘ƒ/IZ5©%mIKãñL¶Ö0³ÍìëZª÷6ŠØ(IÛe<çÕà[\±ý.ŸC嫈™½kf[+àÖ¡÷$íij’¤U’£“6‡¤Àqx¼›ÙÕÕ–)iyb4Ò'x¬§ûðÏÿ¦^3³ù«-gâHš8 X8 ¸ÀÌFU[®$)’– ¤Í ©»¤ƒñt C©u(VÇãÝlË~ÀS¤| Ì›þ(­3bfëàNëëïJÚ^R&îNZ ©%mIoá#R6³ƒÍlDµåJ&(k׋‘}€±fö9žÿê<_\ÒŠ0³çÌl5`˘ޒ´¥¤|ÿ$U'o¤U#i>IÛ™ÙFföaµåJ&,’ºÀÍÍlli1ž3û XwÌMZ!fö„™­ì„Ç"z]Ò&9ª/©&©%­I“I: î~=°€™=\m¹’ª!`ß²à–ðQa€ÙN¯¶ IݘÙCf¶ðO`_`ˆ¤u«-WÒ1I%(iUHê"i¼ëk î÷sV6ìØ˜Ù¨ ѽÇQ‚¢^v‘¶Ìì3[·ò&éyI«U[®¤c‘JPÒj4‚g|_ÁÌö0³ª-WÒjù³;,i»˜Ù­ÀüøˆÏ“$=)iÅjË•t R JªŽ¤™%Ý œ ü×Ì›ÙÕ–+iõüÅ”´M̹˜88WÒC’–ª¶lIû&• ¤jHšTÒQÀsÀóÀ\fvsµåJÚ i jg˜ÙX3»˜¸¸BÒ=’©¶lIû$• d‚#g+àm`0Ÿ™•é,’ñ$-Aí3ûÃÌ.fnn’t«¤AÕ–-i_¤”LPâ‹î)`O`c3Û*â¼$Éø’JP;ÇÌF›ÙÙÀlÀCÀÝ’®“4WµeKÚ©%Iý%]ŒÕ,jfOW[®¤M“Ýa3ûÝÌNfŻΖt…¤Y«-[Ò¶I%(iQ$u“´ð:ð >äýbˤuIÓIKPÃÌF˜Ùñ¸2ô6ð´¤ %ÍXmÙ’¶I*AI‹!i-à `Y` 3ÛÏÌ~®¶\I»!-A3ûÅÌŽÀ»É>^t–¤i«-[Ò¶H%(iv$ ”tp°‡™­efC«-WÒîHKPÇÌ~4³ƒñt)¿¯J:EÒTÕ–-i¤”4’zK: x¸˜×Ìî©¶\I»%• 3ûÎÌþ Ì…[ß”t¬¤Éª-[ÒºI%(i2’:IÚxè Ìmf'™ÙèjË–´k²;,3ûÊÌöæÃŸEïH:LRŸjË–´NR Jš„¤e€€­5ÌlG3ûºÚr%í‹È"_Î_,A’:W[Ö¤ú˜Ùgf¶+°0 0TÒA’zV[¶¤u‘JPÒ($ t5p%p¼™-cf/U[®¤ÝÒCÒ¿Ë–u¢` ?í«-hÒz0³Ìl` Üoè=IûJêQmÙ’ÖA*AÉx!©»¤ƒ—¡ø÷««-WÒ¾1³Ÿ€ $ý·°X„%HÒÔÀÀ°jËš´>Ìì=3Û XXW†ö”4Q]ÛIÚ6¦öM*AIƒ‘´1ð0/°™lf#ª-WÒa¸8¬ uÆJšÏ?7x¬ÚB&­3{ËÌþ¬¬€+C;×ÒÝ 0xPRïjËž´ ©%õ"i¤G€ƒ€mÍlc3û¨Úr%Ž»€QÀþ’Â-A“ã„§7³QÕ2iý˜Ù«f¶>°°ð®¤í*ø”Ý…û=/iÊjË4?ÊÀ½ImÄðÒ#€ €CóÌlLµåJ:&’:?“#€n@_à7`3» Úr&mIK‡ÓãϺk̬ÔÕú° ð9°”™}\my“æ#-AÉ_ÔEÒžx××hÜïçìT€’j/¥£Ø˜ètŽé®j˘´MÌìi3 ìì¼&i#I.Å•îþÀ‹’樶¼Ió‘JP2’¯à&âÌlO3û¡Úr%Ip# +5ϰ/Ììój —´mÌìQ3[ØØx  t‰©ð¬¤ª-kÒ-[<¸­Ú²%íIÓHÚ 8˜(º˜¸OÒjÕ–5i©uPäl¼-žÏÌŽ2³‘Õ–-IêáfÆ})už­¶PIÛ&>ÿ)é9\Ñ>)41нÂ&Ý›$ý­Ú²''»Ã: ’NÅ_{™ÙÓÕ–)IФeÛ^±è–îœ$M"#‡Å/,†‡_ûU œø°·™Wmù“ñ'• „¤þÀÑÀªÀÀ%–7@ÒÆÔwŽžø ØÍÌ®¬¶\IûDRwþªMÇ¸Š‘ÿ1³cª-o2~¤ÔÔ ØØ¸8ÜÌ~iR£IRE$=¬„Ü™Ö̾«¶LIÇAÒÄÔ(FK‹ã1†Ž5³«-_ÒpR jçHZõõ6ðO3Zm™’¤©Húpð–™Í[my’$òÍ |lfßV[ž¤at©¶IË i p 0°‡™ÝSm™’¤¹÷i»®Ú‚$ @ *y©Úr$ãGŽkCDôÒúêô‘t2ð8p/>ê+ ¤]© Þ,I’´]R j#Ĩ…ëXß)ºÞÆs+Íef'›ÙèjËž$-Äyförµ…H’¤í’JP œðîÂ@+­_xØ XÃÌþafßT[î$iaN«¶IR‘ƒqŠjËÑLÇ1yëN‰·Û ©µrbd×=ÀrÀeëHº¸8ÎÌ–1³ì“N:iåLZ9s¯W[ˆf`^<›@CX ¸¯Ú©µb"ÊmÀ’ÀgföY,ï.é`àeÜ/b ™]Smy“¤¹‘4Ÿ¤W[Ž$IÚ'©µR$u®ÇƒsuîŽåoáÚùBfv°™¨¶¼IRޤµ%]ÛÄff6hľ_Š’-ulŸIêÛRí'-‹¤C%Í#é(IWƲ>’‘t½¤cŠ]Y’“t¤[%-ižÂº5%]"érIÔ²¿5%m^¶leIÛÊëKº8ÚZ­lß;F—JZ·Bû›F{»IºNÒþá'º~ÏIÅû5º­öu§K𥬽%]-é _a¹$áJË6‘´J-ÇÝ%dºZÒY’æ®öµ/'• VHŒ»XFú ð¦¤G€ƒ€mÍlc3û¨Ú²&í‡x`Í!i`(áÅu=%ÍþiÅå½ãÁØ;¶íË;“SÄË¥w,ïà.’æ*µ'©¯¤A’¦O™»F;óDd_$MLô}w“ÔYR¯Xß_Òô±í$eíõªpìS‡l=£<)Ðèíw©¥­Þ…óÑ#äèç±[,ïçmÊ Ç6™¤$ÍXí{£²#p10¸&ž¼ˆ‡9øx2®Yoà~Üò~ >ò¶üùQzî³y#pФ*ìïGà¤°î—ø_iFÒ€ÿ×F;g”¹Ãñë€÷*´¿2p.žéþ"`;<µÌjÀyÀÌÀ…ú×Ëâ±¶¾ž—4uȲ-p,þz8¹°€½b?%ãQ´+qþ!vœß‡%ÍÔò—w<0³œZÙœüЇb7øEù5[ÿ0øÂÌ6kä>Ç›T‚Z’޶g\üþÇØ$&B:ØÌ^©¶ìIë%²SEñC3û°¬ÊÒx¨ÿ»K ¬ÆÏlüáºAáAn¢6æ/‹mÆHz¨O!¸ÑÆÍ]÷»¤=ð‡p\á„[wêâ `IÿnkÀÿ`¸™]ßÀs&ü«v13Ç7ª‰—â:3óËà_ÿ³Iš#ÎëW±üŠ8¶$]Ükr£…ŒË=cf¿7QÆöÀ-¸E ®ôÅÑ…ßâÖÏ*U4³}c0ÊÊÀ!¸¥sgÜB_ô ›ø%þ åÍ\ÃÍ·¶)ìÛ€% ÷G94à¸ÇÖS.ñÑW&wI)ú¡lýŸÇgfc%aÜî°žµìç[à=3[ ²¿…[¯ –P0-Eúµâ«yOþª›b¾Áûr·f0³uSJÀêøfo<Ñc9½qÓ|%úâŠÉ`Z`jàD¼«¦DñÁ=èZ<ß—•oûnÎÁ•®õ´™]l'®¼_Ò õ8+ÿP_›ø ð‡|÷:ÎKC(¾÷ßIMg$Ÿï¼+Ö¯çåïÀg’ö«¥ý½ SŸ&ÈÚn0³ÏÍlHLŸ6p³[€‹Îôá;Ö;|³&3³ßÌì6àNÜJDÌïNÈ%™»*í dy¿ÇÇÅòop¥í?¥¬á+Öëbcx+iÃÒq›ƒoðnéJråŠá‡„ò-i:`•Zöó80MÑ‘[Ò$±Mù¹ù¥pÍÞj¡ã®HZ‚Z’öÆ}J Ðpü÷î“p'ðp…/ø$©3; ׹%õ,³Ð€ût3³c±ëÑÀ¤uUˆ.¬€ÍÌì«x L;Çöð€¤]p¿¢•qçÑz÷û+•,d„sr¿hw¤¤¡¸ÒXiB©ýïkik&j,¸•xWZΪpΉe§§JZ ÷£:®¬Î`½F\—¤ 3{QÒ>Àƒ’¾À•ðn¸2Ú¸KÒ'ø5-YäÆ?LßÛ/ ë*q1îwH¡« ¼{ì"à}Ißâÿ3£ZàX“´pY||OœkfwF•€Û£ëo4®ÍShâà"I‡àæÔ²ŸCѺ@Ò¸5krÜ·µ¡Êi‹“Y䫌¤qDz1ÀÏÀ£xŸñÃf6¬Úò%I7Sà/ÞN¸¥ñÄøj{@?ŽøZ ø»™’ôGÔ-Ű:øÁÌþ+i6<¡äñÀ§fv‘¤«€çÍìä¾ßÀ¯6ÂG›\`fGHZ8ÐÌ« ó?Q¸)} p4Þ}õ–¤[ð—Ø¸¯Í¤ÀÍf6 °}/ü«öd\ún5[ÂÌ^•´þ": w2]8Ó̾‘ôî0ý(þ‘ò[”Ç•¦Mð®ÄÙÍìI7÷›ÙÙ…ý_‰¿€NÃ_ âþwã#}nÇ?ˆ¶z˜ÙÕ¾OÚ;¡„Oƒû–}SXÞ)–î³2¶l»>ø •ïÆcw•öß·~٠ݯ =ÖoÍ“¿–¯ïëþ¨°®0©™}]ÿžþô;ìÇUŸoÓ%-AUDÒÊÀòÀ?€GÌlhÓZL’F³ î´¹*®ßn˜(ÿ6Æõ›¨ñ§8,–•¸ W0³¡’VÂMç%+ÉøÈœ"kàÝ9kâ±±n~Šuï࣪*ñ°!îpü=°\Á”¾MÓÔøWýç”YÃÌìgIËDZM‚;#?ƒûæ`f7Ä×ÿFøè²× ǺV,Ÿ˜ÈÌ>–´Þ}Õø'®–ºÀ®ÅG€Ùï†XA¼‰w‹ŒÂΕpÿ¨§ñ¥¤… ëÌg–¥ë…™ýØLûÿ…¦uÁ6ùX 뿬cÝܧ­¡ûjµiœÒ”$I’$I‡$£“$I’$餔$I’$I‡$• $I’$I:$©%I’$IÒ!I%(I’$I’I*AI’$I’tHR J’$I’¤C’JP’$I’4È)Öo<ê¯ ©A‰{'à1LÉŽ;<©%IÒ`$M,iÓjË‘$Uäp<2xC™˜¡ÚB—Ñ ˜½ÚB´R J’d|è \]i…¤>’.kL£’thK -iÅHTœ$ BÒä’¶“´·¤ %õŒÄ¸3óHZOÒ"QwIÝ ÛÎ'iβö¦Žö6ÔµŽýŽÌõ+IÚ½°|)I»IZ3r™•–O*isIûHÚLÒä…uý%m-iI3ײ¿¹$-P¶lFIK—ɾ•¤¿Kš¶°|ÚkIÛJZ´Ú×m|I%(I’æbb<¿Xc˜OœÚRÌ,9ÁÏHÒ&‰„¨¯áyïºã¹âúãù⦧ƚrгÐÄ?€Í å©€+ð„¹»÷™2ή¶Ãï[$]ôöî”Óxÿßu–Å“#inàU`i`NàyI•þc37DBÕG«D;+Ç>æÅ?'iᨷ ž\ù*`njr¶Ì,§œrÊéÏ 8ظOy0y¬›ŠÈ½åÅð,ísàÕÇâ™Ð‡àÔËÛŒ'ýÏà¾þRüÛ½uÁ«^‡'5]8 X¥ÐÞŠÀ¥…ò¬xò×ÏBöƒâáü1ðc´OÔ½Xª°íZÀY1ß/ꮇ¿HîŒå›/Dûw³VûzåÔ"ÿ€jYw>ðeËþ&+ûókã ‡§rà=`ÝZÚ Y(¯‰'×íe޹0ð;нB;7ÇÊ;¯þ'¿Ä|縟—rÏø/Îå÷Õ íìÜó›FÝɪu­š:¥%(I’rfþìÌŒg…?§¼’¤u€+™Ù;ÀVÀHü yqüa^Î…ømüËòA3ûø®l,NÅf@Èqþ°-dëSh¯70[È3 ®=õfîÁ_ GFûëÆ¶³½ mõ‹íÀ_Tƒ¢î ÀñE|lçà6à¦:¾è“¶Ë‹ÀpIoJ:\Ò‚Mlï}3ûÀÌþª£þ£…ù%qÅçLIàÿ¡Iypåþà-I'JZ®°Ý"À½…òÀ\Ån»g p9°m,Úÿ&i*ü°¡¤ó%]¬û.ñ†™}×ò—¤eèRm’$i•\ffïHúð‰¤‰K+%í‚Y®Xz¸£Ìì÷:Ú,Kí•s Þ͵°M”Ku ïÊû­PÿZdms¤”$I%>-ÌŽ?ûSó ü/pTAj(ë‡oJìkf÷×Qÿ“ñh{:ü˸9)îzü«x‰Â²ð‘6I;BR'3w ß'i$îos þ˜²l“¯peø›ðÓY÷*1‹¤™ÃºÒ X ÷ jâŠÉfökQÆs,ðð„¤O©±t>¬<åõ!f6ºücÂÌÞ–ô&n‘]ïÆÌ¾–ô0ÀÌ./î»Úר¹H%¨£z5Ä\_úÝÍì‡jËT óÓÇïÔtE- Ü/i¤™ËÆ%ÉÂa 3{Ø îµ}p¿œibÛJÏ£òv~&)”§.Ì„+)• ”Èw+”è_Ïþ‡¯˜ÙQ-p¾“ÖÅFayïrÝï¸ ¸BÒ@àa3;÷º\ÒíÀ\¸ÿY‘ %= ,¼íÔ‹™Ý/éà¥h"ÜÙyWàIçâÝÀñ®¬ÿƦ‡à¬)Ḵ~»º8¸¢¨lá>@×Fwð¸²÷#î¸Ýö©¶SR•œÞ6N.[vJ-Ë6Œùë€%b~Eà‘˜îÁ}æ(Ûö¡BÒ´SŽuYüÁݺ›âêª_£œªúÿ¸·€,ˆûÌ\ \ëþtŒÆG• öˆrüa»5>Šd¢²v;ãñU&zûoźy_ðıìàÀ²6Áý)¦Ä}v^žŠuãŠÊÿpem*`ùX·*þ"Z ˜%–€wiM, ¼Üë¦Ä •ý—¾Å»»ã~Aÿ(ÖÉ©}Lq¯.†+>›Ó•­Ÿ·öÌ]X¶ð7\©Ÿ ˜1–Oÿ¥¾¸²*йŽ}/ ô®°|n|ÄÙ&…{XÀüÀÀ–ÀleÛôÁ}x6ú–w–.«Û#þSWØwܪ´MÔéZ8ƒª}½š2)¤C!i Üa¬¯yŸjjÌÿÓ–ýˆû<<'éc`73»=‚Ń+ =ð?Êø øsìc,°ã:‡~lfÃ&ð±. œnfƒPwS\Q[aBʘ´.$Ý+ñ‹óO{šûIôÅýt–ºÓàþ 'šÙ#’ÖÆ¿û;˜Ùû…v;ãÝ á Ë[À¿ÍìõX¿þ‚ènf+IÚøÂÌ®(´Ñ !¶>Bæ`3Û=ÖÏ€ÿ7ÂýŒ.0³Sbøïø‹ëW3Û$¢þž,<Ü ,lfû–gaÿ+ûáN×?™Ù^Õ¾fI’4ŽŽª•+8‹ãŽ Ëîú™Ù” CÌlÎh¯+nZ_ÅÌŽec…Ììåȳ >\x!ÜßàÉxpolˆQ<ÂÌ~‰ú=ð¾ÛA¸òv¢™}Rho+|Xå{ø ì(3]ǘÙÞ…º[ãCA-W‚¢ïz×ékà43JÒ® %èZ«Ý 4I’¤]Ðnœ›Æó!ŠOâf=â÷1Ü­¸ì‰¨[3â]å~73JX˜zÖ²ýšxŸòHüKyoIwâÃyÏÅÍÇêßËÎÀc4¼_®HÚV|ðnò/1PþÕº:þ%\‰{pEë |˜ñ’ú“$I’$퀎ìýÞ‡{\ü+…û–=\ÇöÓJºW,–6wú,r®Ø”øîƒP‰ûÌìL€ˆIñ73[3Ê¿Ã#cÝÂx¿íà‘o¾=®ðì ìbf÷Eýé7riƒˆa—€Áæ£}o‹w7$í—ýð`†I’$íšv©IÚwàxÀÌŽ¨Pí`IáJų¸´h,[w¬Ÿq„©q'ÐJVµ Ò»™¾«P.e-¼ P‰gñ!˜Ýp«Ôk…uCh„„Úx9†Cv n¬p¾—ÃQ†™Ùø$LZföZÓ[I’$iý´K%ÝRR>jîý<î´#>Be$@ÄDØòRûøÅÌn‰mÁMÝ\ÁÔPÆÖS.ñîtZdràk3%i8îÉÿy¬+Öòv3³Q±¬¶.ºoñQeË6@ö!¸ Æ ¨•$I’ÔB$ÝßÌ6¨¶,•védf_šÙ˜>ª¥NÉ/hܨÄc±¬¡þ@˜Ù[x(ó#R¿‰<ô“TJn7=ÃâîX/®Ä•¶w,È9wp^6ÖÏ‚wûUâAx«{ñ š³WšÙ’ÂSbÜŠû†nƒÇĺWÒòÀUÀ+¸›À"x`Áå¢ÝUð¤Ãçãn žf¶@CeKš—öê”$I#‘tþ_˜¸þÀ>·’ÞK¤ 43pnU~VÒãf¶GY{Óáý…ðÄ‹O™ÙFx$j€§ ÁE{áz?ă.ž‡G¯žÕÌö&Æ»…—2³á‘=þh<ßQÜ—mÕh’°b‚wú˜ÙqÑV?<0äff1âóŽÌñüss|á>.¯5³‘’>¦–ô®HC¯ÜG*AU%• $I*q™™½ i5<ÕÄ%±î6IO'‹ Û˜Ùïµ´5O310Ú|6–—F(þ^Ú6Þ#Ÿ›Ù©¥ëò³?Rn§¯cñ“ñû¹è³}–™½õwÄ…>[…¾Åý×Â-I;$RÄ ÂôõðD¤{Wà#‡o>+lrRü æ¾þ³9üC¢ä{RôÅíè~¹U'• $I*ñIa~jjrë•øx<Ú:#u[|-ŸffÇÖQÿÓ†5 ÀtÀ3ûl<¶ŸcŸO†yQY_šqI+CR'3î EY3»DÒ“x÷ìMÅúõµ9)_VÆ“ƒçœLªH*AI’T¢§ê3<g‘™ðÑ‚õbf?{JÚ Ïpä'+mßµŽ}ƒçå›´P.¦nùè$iF3û°B;åϸßð.® ù@Í;xwß03[½™ÏoÒºÙ(ú> ôÆ»m·Šu{·KZÏë8î‹¶vÚÝ;î;4yµ´£“¦¸$Iêã ‹¤Ý%M,i Ü/¢AHÚXÒ¬¸ÿÄÜ9ú—HÇò°MäÖëQKCððóDÖúRtrbTÙ¥x(‡%M*iÍXýï^›GûÝð ªkHš#Fý·ñof“´OÄÉšLÒZ’æ¨öEIZ”ÿÃó/>†'þÀÌÞÀ#ꟼ[u6Ží†à¾hE¶ŽåD(“…ñîÕb»ª}°™´%IRΫÀ—¥BD"_ +µ pžR¦Ômô;ã-gŸjòhw3û Öm;¯‡çÖûšxaöÿŒ¤q…äK<(éjœ°w ynÅ-FÏwšÙï’6Ã_B;ÛÆç Ûðn·c€É­&VÈ À÷…}ÿ¹ùŽvÆ­KCð$ÅI;ÅÌÆà¾kÏÖ²~ÞUV¾üGüþ+.{®¬üP âûbµ·#“q‚’$I’$é4¨;LÒ,’—t¶¤¾ Ù¦ZHZQÒöÕ–#I’$I’ÖMC}‚îºãææÖž ³>”5I’$I’¤Vêì‹á¬S_3ߘٯ’ú˜ÙZ|J3{7êO…+!ïÅðÂR;}€Ÿðìæý#á(’zã}ûïë×"K/`x 3î±ÿ³™á‰“FÿýD@g3Ë{šÙO’¦ˆùa™¦ YG‘$I’$I‡¢>KPO<„à^I·HZ÷¿x=Â××Å-xBO€å£Íu£¼*pOÌï‚gtºøY„&ØWR·Hªøp:ð~$²K’$I’¤Qçè°°¬,‡´_ÉÌ~)dÄnfsHÚ ˜ ˜#,0;—Kšš?˜Ù"’&Åc{˜ÏÌþt?°9pFâ<¬\çÿy1Ê7GùÁZ¶›xÕÌvY÷¦f}/ \)i&3û£Ú$IZ1”|f3{´Ú²$I’4'M‰tqa~eàŠ6n‰™ÏATâ3û­pkAéxÊZ%%ˆø=°¬\›dx‘ëÀM$m‰ëÇ_ƒÁ%Iâ, Pm!‹¤³$MÛ‚í_I\“v†¤å$í,inIsIš+–O¹ÃŠu׈üRyrI›IÚQÒL…åSÄž)$m!iIë·z«„GÒ‚4E ú¡0߇BùPn~Å»ÓJüZ˜]¡Ü•ºyè'iܯè^ «¤ùñ¼DOÕ²Ý3Y(÷Åc‰ Àµ©ÃÊäI’¤ý°.îCØRü èVíƒLšIGçâ~±'àþÛÄê¥ñØTE®ÄÓ¸ iQ¼·b1üûqIƒ£Þ <ñ5À‚xÏÄž‚,Jš Ø8’¤Ei®ˆÑoP“šˆ¦Ú )Þ,DðªGÃãà!<ˆÙ“ãáÜ<OÐxlÙôe·O’vMDE¾VÒ§ÑU=]Ùº!’Ö–ôJÔÙ¯°~IJú\Ò’Ž•Ô9ÖM!éEIHz]Òg’¶‘´X,ÿJÒÉe²üMÒ Q÷îˆ<]Iæ^’®‹6>—ôXø*žL‰§*"i½ˆ<}·¤$½¡?V’tnY›—ö'©«¤C%½ûxBRŸð…ðX´¿T|ÕŸTÖÖ³’¦Žù“cß·KúFÒ¬’ftƒ¤%½!iÛjßIý}€•Íìpˆ‹÷w`uàd3»<Ö™¤ÿáÎÕ%.Æ­G%fܤ†µq3ÞU vÈrC¡Î3Ô„óÿžqµoÌìíèBÛà||K’O„˜Ø˜!¬«C%+.E6³_€·$=ƒ+7¯›Ù[áH]ê‚úWÎ+l{xø>$é;à²RxIE[ài*.ÂÃkLƒ+L‡áŠÎ;eòŒ‰:óORŒ•dÀH3û=ö® ý·dAnÀ·Ú?€µ IZ‡ÎÚ¯+Ììù¨¿*nMº·ŒÄ_Š©U‡±üµ§¤S=ëKJ®pÅöz ég€ ó#ŠÆ óqEÿNà³Òý‘´,õ*A¿çÐBùb¹°|(µ8OšÙ¡eåKÊÊ4DX3û¸L–ïËe1³g ó?P¦ÅòÏð‡i’$ã2þÿ¼°ì“òJföu¡8Ï¢¤MqëÍxÓŒû36þ·Åm¿)+—êOûS,YXÿ0Q¹OÁ}ý.úHºد‚ŨÄW íBÄ®}7ßSS)žÓé£ý‹Êêäh¼êñ*0]Œþ@RÜÚwS¬ÿO¬«øÐ_˜ø˜ÙÈø0˜ÅÌn-5qëêâ|Ü28î‹”LZUUI+ËVXõ~ɲ”$I‹ò%þ•;=nÅ¿víÔÅžÀÿ™Ù anpÆù2†/›ÙÑõU +ÌAÀA’á]å·Çñ”¼([T¾J±¾ÑöIßâÝeŸUØýXÆ}–ŽÀ²R[}ø«âVÜÿ0¼ûqB"×¤Š˜Ù×’ŽÀ­•×â÷ðW…*Oâ×ùnIÃð‡boÇnÀ­’>À»–»á‰‚kÛçg’À•­«ª}: ÍåÝ\|›™Ë§fs°N’¤vÂ:r pT8/ˆws7”ï€5bÛ%ÇsÛrÎþNËÝ% ˆdAÒšáðÜ…šØd?Åï§À¦1ŶQb¯ƒ$-Ã’a\EåLà¤h£‡¤å%•F¿~l-iÎ*ÿ °D8‰OÍ_•®"â~LÇIê'©w ¡^¤ ç.i"¡|o‚¿ƒ¶+¬û÷i»ä»9´÷ãXÿ*îSvîOw°ilþb´W‰O€«¢«9™´*KP¤Óx«Úr$Ig|tËóÀkøÀƒcÝ(þÚMó:5ÝgÿÄMùÏãö(lûHÙ¶ÏáÅ%Þ%¾¸Íì1I›ûãa0~¤ö.¢~¸%hj<|ÇͬôÒÚ%ä88ÿ2¦¸±™}"i÷ýgàXÜVúº?ÿò¿ ˜,Žy‹X·°;îÈúo3{NÒþx|²ïñ¬³¿W8_%ÁQïqÜjõ&îï˜T‘ðË)ùn•¯û÷û)ñdÙúá¸Óùv?àݺÆ•£T~' Jëk’$I’Ô¤ñwæyMnì¯mo*¼ÄÌ®®ö±v$Z$i!`93;©É%I’$I’ÔB½>A¥àgP¦^¸Sf’$I’$I‹ÑÇè¾ÀTµOi¡œ%ÍÒ€ˆ’& §ÅR¹Oy9fŸÀûöÇYõg/koîBB×$I’$I’S§$ibà$Ü2spOŒŒ˜ xêt0DÒ õìë\|ø,’â΋ÿˆòüÀËQoàŽXÞøAÒñ¸rtD(_'⎃§ïKÚ¨Ú'2I’$i?Dê•9«-Gò)Ò¾dòÞ&P§±7þ|`f‹Ç4)ñ0™-€´8µž}³ÀƇ Ëu…$ÿÕÌæ1³M€-ñXBs˜ÙàØöì:†¾&I’$Éø2+5iSZ+sài9’FÒØ8A+ç{MBSËJêuÿ,Q4W¢n%è’Âü:xÈüõ%m‰+‡ËO’¤•!éÜRòÐh[’® «u’47%­!é’ÆñU•Ô7oî«Iš4Öu“´¡¤}$m-©˜„¸«¤µ$í馊m®'i’HP¼“¤iËÖO&i[IÒ°TSI=4V êÇÒ(ñ#УèãSN$‹û X¾y0O`¸4u+AÅ0û}ñD‰€iñ¸ §â“$i}¬‡'l „çìÚÔ†’¤'âIsç^*°”Ô xÏ•9žò<¡0x¤ò]ñT â÷(Ñcñ>¾/pž¤ƒcðü˜Wã=‹/Kš<ÖO‡n\½•9/›†&P´lÙx&æR’Â%ðÔÔÓÖƒÀ~À‘_åAà@¼»íkÆ`23;¶Ú'/IÚ#’ÎÀ£¯°,€çL:œØ%ºÁ‹Ûô.ÀÐcðœð…ýð#ñAŸàïöÂ?ˆîÖ1³Ý m>lmfFfîƒð¨»½ñ ŠkP“oëIIcñ¤«SKšÙ¾…¶^ÀÓR|-é4<`áºøGØÂ¸2uBïÏÀ±fvYµ¯ERu.後d¿‡kâ ÎÛf¶i¬[„x†1`0ž;ìòöö^1³m£î9À0IgRó±¥™]ëïÇïÓ ñ@¤÷™Ùö±ncü?4†(Aï“I:x]ˆ‡¿XÒïxØãñˆ¬õñ ®½î_(Œ'?l('àù±xôÙ~x¸ò]"Bg’$Mcü wc\Ù ¶ÅÈ#*l³þ<™ ²¼0ž*b/`#<ýÀPüy±8þŸ} Ž+`µØo‘y©ñÉ8 ÿØZOM°ðþE½°"žzbžªcƲ¶æ§ÆZ43°vlWÊFÿ2þÕ¿I¬PһńÌI‡äáÂü}Äàü~z¼´ÂÌž—ôkÌÿ!éàI7á þÝá>²`’ÎÃ{bJ½1sàƒ`ÜÈÓÓÄüBx’Õ÷Wûä´’Eþûè·\èX¼+ú$7²¶6³°¿ûq_ R¨ñgpÍúæBשñõGäùRÒ<¸ÃöÆøWÛmÀoÕ>™IÒŽ¸ÌÌ^*" ÆÑföy-õÇàÝÓóO›Ù³±|´$FÆ@‹R[‡˜Ù貺ØX9ºÕ^ŠíJ/‘òör|/Fý5ñgÍ­ø3îw¼;cÊÒk$ŽNeó%?ØQxBTàÏ®¬?»dÍl‹ü»žwîa\97|¤ó…vÏeÜtQ£ ó†$€'ê-ÊÓ =©›å3³×q夸ì üb6˜È™rh¡<вü8föÞÝF< ­ÐÎ÷x‚Ã$IZ†O*,û´Žú'âþ—½$]`fck©ÿeIªð¿è…Hm‰ã›˜œš®µ5ãþ’¶ÉÊÔXƒÖ ÆäQ`'IÇÅ}¼!0ü©Jö‹’JVÆÒv ›ÙK;ÔÉÌÆ6 ÞÞó!Ïey’&Ò¬ T%-Jå ó•™]íƒM’¤ÁŒmà2Ìì7à?À$-€wu?‚ûýŒå¯ŽËåùz~£0Ú%b„õж–ô#Þ]öU-íŸe#(ø1†ciçZ¶†gœ_£0â5I‘t!né\WBÀ‘ ×%}|‡ûôŒ¦—t7nÕYO¦ î:r·¤'ðn¯É€Á’fæ¯ÿ‰rNÄ}ß®ÃðÎTí“Óhî,òßàŽËåü<ží$IÒ†´î¿ðþÂW,À-H›IºŠÚ­I¯ IZxw‚.¾ÎN‘´5î´8𬙠—ô9°¤{bÝ+À¹Ññ)pX=â?„¿¬Ž–t\È¿0ð“™½@ÒQÙï™·bf_€÷RD7êìø½ó ð%ði úY÷[ë\af¯ÄvÃ%-,‰Ç!úØ¿d1•´H¸Ä‰„;ˆ™}÷ôàØîñh'}a›@³*Aföþ L’¤íò*þ@/ò(ß¼ LŽ+.ýñ/âýÍì©X·ðøH±c€ÏðáÅ#ÀöÂ?Â_ÌDö¡¸ãóø`ˆ×€-bÝøhuÿ3³%u¿Å• Y ò¿F!¤F¼ÐVÄG¬=Ž[­^§BW|Òq0³’£òS1•³Þ=Ö8¸ÖÌJ Ë;Ô8Ý—·k¸èÉ ë)+¿[Vþ ¸±°è’&Ñê²È'I’$IkGÒþøˆÅ±¸’tZI JÚ©U I'‡‡“wùºnÀöÀÜÀ=fvÇø¶?äŸØÆÌnäö]ñÑó÷›Ù­Õ>¦$I’¤cÑØˆÑ­I—HÚ¤Žõ³Hz­Úrø; BYb¯Xÿðvµ­…îü5®Ëø°æàA<nÕ´K$åM’$I: V‚"GÏô’æ“Ô½l]/Ió”g³•4©¤.’&’4—¤‰Ê¶éRV¿GY.’æ”4Y…zÝbýÜŠ| <¨cŸrù‚¾ÀT±¾O!¾’¦“4»¤:ÑEΗQ·\öÞ’:Iêu:WØ~€¤©êÙG<(Öíxï¥óÇ;W)O’¤îqÞû–µÑ½PîB>›NQž¬®ý‡%ªxŠåÞ1”ó-<:o±^§¸æs•Éò§ …c\¸~:¬ ß,’f(ã(ÃIÓHš8¦Nqô*ÔŸ³Òy–4•¤AÝøÏ¶ñSÄ}ÑRé’$I’Ö†™Õ;áN…/á_ìà16J]iûãÃŽßí Û=‹çõzx¹1c¬»øW¡®ð—áªQÞ0öóäôBÝëñÈÕoã±Â1ßÛíWážÅ½øŸ‰ij<üþƒx$ÛçâwÎZÎÁ\!ÇÃ…º³Öÿˆ§x5ÎÓ`ÒX׸¾ý(ëg`ú û9wæü0䜸 ¸W<žÇ»6Žzà£òŽ)´q>„ó¥8îoðt%g¼Ÿ€j9Îc“b¾Ôî¨(O‰‚è†G>}¯°Ý÷øH†wðPóà)>Ãd~ìË ™>Šcœw‚}½pŸ= Lõ׈u·/âNˆ'×ŵx Q±>Òçɸ/Èw%>jè>àkà?±|‘ãëåʆü'rÊ)§œj›€ÝãÙôBµeÉ©žkÕÀ útéEåñ»@¼gŒò‚øhŽ™¢ü,nÑèå c~CàµB›ËâÃY;áIè¾-)$xèüW€5£|}(“¶¿÷Q©íæÀ´—Ü[ï(àñZ¶Ÿè^(ï‹(•N‰yÿˆòñòž(Ê{àç¯e_W{ÊW…bÐ3ÊýB‘Y>ÊSÅùZ%Êá#`J×éœPºfò¦ÀZö½ žÛ<ñå øPäÒvwÇ|%%è¼By\©íå©CÑ(Ý—û–]¿3b¾>â¼(¯çkùBýñ‘ˆ½¢|4kfÁ(¯ |X¨?ya~²¥tßþ ¸ Úƶ6áI!'Žù%Ùª-SN9U{ŠgÝ(ücu¢jË“SÝS§èZX>¦ù)CR?<&Çq¥efV¶:wjý0–¿DM–ÛWYMbÕgq«¡MqÀs]f/a0m~I[àVÏËÚ½ÁÌ~¥i¬\Tïl`©RwSó¼dKI:!¢á.ÌWVí²¨k¸Å¦t¬ƒk¬fäÀÔ«œÍì—˜_ @ùHìï+<ÁåàBýÛ ×é9\á|·Pžµ–ý<Ì!i `%Ü’7 ºWÂ-gµqIa~ÜR·º¤-ñ c_ã÷Ò8D××`à¼8ž±¸µ¬x<ZÙðQ\!+Å zOÄûR¡¶¤†N¸¶ºwLU¨ÓaüZ˺ò@ˆ?E¿Šb §ÑDäXó”WÛ†ÏÆÔ¼DK>.ÓãV¡iðnŸb2»¿Œªjåòÿ€[qþâ°,iSàt\‘»ÏWÖ£¬ZÅcÅ#ßþRX÷{¬ŠÇÛó^¼^T(—GðþTpŸÁR®ˆ+=áJ_}JP1ÈW_¼ÛlžSjjàr*;zwÅ­‹ÇôcÙñTºÞÅc]¡ Ð%ü̞Ư×5¸eìþzý’Fbf›˜ÙéõTë†[Cj¢õ¶31îGV’œ ,Š¿ÄßW%æn?ÑÞx—ü™5/~¯/ŽlΆ[ó¯Å?`§i¨IËÓÅÌîÅ»„jãcüå² îô  €xÙ,DóÂ_û~x£`©x¿™N±†Ç]M!ì~më%),5%ùÆCûƒ›ô¿7³o+l¿:î/r}ëãqžßÆ»K”þ$å `vI“¬aKâÖ æàA`+ÜïësIâ ,{Q9"x%†ÓšÙ±õU4³Q’ÞÃïcñÔl¬̆ó;ÄÌ,³§.¬¯ïÞéPH:ÿ®¿Àï­cq?¯.f¶@Ù6Ç/™Ù5’fÅÍùðs{¿™m‹¿:I›maž+°ØÎ À øÐüEt>n¥í_ØvÜ7l$þ^Oxú7<¬Ä]ÑÞ2ÀÎf¶E”gNÆï5p«ìUx@Å>Ñþ·f6XÒx´ßGbÛÕ€ ÍlÇpÄ Ï}xðµ™­"iƒkZ¼KzOóÀyIÃÌ6,ÍK:øDÒÌf6 ¿G—Ã](fÄý ¯Œºgâ]÷ûGy¼ ~Ÿòû=©> É"?&¢¯^)éøô²øÃðFà`Içà#}¶Á†’QóÈ®ŸãÝû–?$éuà–è¾þ0~ÈÌ¹W#þÌKföxÙúÏñæ)’ÞÂen“ô-îÔ},e ] ¼ì!éÜʱýxœç3€çbÛ¡¸Óܨñؾü¼½&éaàš8?+3àªæàAü¥pF¡|ÞÙÐn¼ó]%‡gçž·&‘rŽNEº;ð_j"7•ñTÇÄyÛ‘q-q¯Eð³afv]3í·­2 ®ôo ¼‹ÿoÛâ=#*l3#5IIÀ•àµðó^R˜¶ÆýþJ]¢•>pÎÃォˆ0 föƒ¤=ñÎË€w9K2nŒÿ W@Š£%{ム‹óøÇצQ^ü?y8Þ…» 5]Õ³Æö%úPÓÜ9ÎÉx·í’–Ç?WÇ1ü·ÌWèrOÚ’VöíÙà÷ÂÌø3Â"…Ë›¸|Ázšû. ÖIC³ÈŸŠÃš¸…æ¥xŽ’´óe]¼Ëá¬Â‹ò|Æýš™¿¾üÿ…;Ù^[¶|-ü¡¹*®½†[ŒÀG•g”>˜ÍJ$^,;†ß%-Ç0ÐÙÌžŠþÙÍð‡á^fv[-§á <2èj¸%f㱸ÿ¢é"i£™ ‹äøPþÝqÇðŸjÙ× ø¨ª7–•Á».wŽóþ)°PÁ?æV\©+ñ ã&¿ü èׯsø çÖ‚üû3®%ðcà´BùX\A.ïáa-Û·(üŽâ*ÇÍ’ašÙe’¾Šsú°ŽÕ¤]Šû¹—qýªÞÁï·#q…v´yZ„•ðô +…¬sÅuÄÌ‘´nQ˜œÜ?¯ä_E¸CmfŸ7`Û1¸õm63{šÌÛ¥”¿×³íÀ#fö ~ï‚+­c+l{›™ýÙM^O"îUðû¡˜KìùØ®¶öëã%˱¤ðD™?à]÷á Ýœøó+i#Hš€³ðŒy–÷w×`Þ(OŽ?×?®£É$­“j{fç”SN­k»‡ÿ^¶l0CÙ2úÇüuÀ1?%®´~‰¬ìËûcêÙ÷<øGÀO¸…nµX¾ 1J±P÷là°²ewàÝl¥òZÀó1¿p_-ûݸ¥lÙ#Àº…ò¦Ô„èÇ?qaý“¸ìî²iÁj_ÓœÆû?°>£4rx\_=ÊSàŸkãx¥º‹ÚZø¸ÚÇ”S婹³È'IÒ>ÛÀeÁ̾v’´ nɽCÒ¸³»$u6³1µlû:°Qt‹î'A<ö]É™¿\¦Œ;°¡aþ#`æ2¿Àb;åÏÃß×WljþJqÿCͬ¶.õ¤í0WÄï–ôn%þþÍz9"åIwáþAGPpëHÚí&mF’$­ƒV<#Þ<·" Ç_*Ãñ¡+…¢´C„gè„w‹–ºŒ?JZAÒÀ:v?Ø2¢ƒÏ‹[JÜ+-GÆpå)ûÔþ‚’–Çnðîûm%M!iA¼k·.ÎöŠáÐÝ#ýåÑå“Ö™ý†+>áÁõp„gqÅøhBá1é±1pW!š~qäÛ¸¯YÒ É?g’$弊wey”¿:2?Bߛė2îX½Þeôü€Èï·°%îÓV>rjYàŸx€Ô·qÇcÌìmIÿëz†òò.ã†e÷S›wõ*j´1RÒŠ¸Oسx÷ÆÅx×Ã’Nþƒû¯mœ…wu¼ˆ[2ö3:ÎÉŸ%3{ZÒFøË± ô1Æ?&XÒ 0³ŸwXü‹…ùGËê~_kðp(ÏÖSNZ™E>I’$I’I“»Ã$-,iŸ˜ï$éœòDªIýHú»¤ec~qI{T[¦ȼ]ŒzkHÝ’oHÝf”ofIʧDWK’$I›$»W›—æð š X»ÐÞN¸);?sÇ|ojbS´fV*È\“Ó|qJÆí›Ÿ¦©L’$©6Û§"Ô|4X ’4™¤A’GER/I%M"iÎò )©‹¤9bêRaÛN’zJšGR§X>‰¤ykq²œHÒÜ’zR!×’¦,[Þ=Úé2÷¬°mIî%¹ ëúÇv]+l×KÒlÅœ4ÁCDÐF9}b¾_¥úq^fgOE÷ºŽu@œ³IÊ–÷(;ÖJéCj“¹Ò~çeÒZÖ—äî_Ëú)%Í_~<’&Ž{ _-mÎQ‹5r3<›}ñX»Ä±NR¡­ÉJÇõSJ’¤ÚlIoZÒD¤MJ:õ 0¯¤ÌlÏFìï-<ì긳`gIK›Ù÷’fÁ_þà–¤)%­m5Q6ßÅ£<¯„{ç-é<Áçp`šhëÃy/Ü9óM<‰Ý fvR-Ç·×ä}<éæÀváõjÈ3>dvNIë›Ù£±í*xÚñ‘'ßëÄ ó*ÔxIk™ÙÓ±í.¸£é«¸Eå·:î™é»¢.Àãeë—ÇR?¦t››Ù¡ô]ŽGä}O²º™½i Î^æ’t©™ímÎûü˜wŽ-ò)ˆï=<]BiÈðØÇšföl´µ7µzH\ŸQxüšspŸ'I’4;‘®e <ºùcMl.†K&/ÌwÇ#ø.åÍðtà/;&«¥Ïð¨¾%‡ì»ÚíQ¨»;pk¡ü%pzÌwÅ–'‰`ex÷£b~q\a›¢$?n˜³‚Lýð X Ú~Ø2Êçá/â^QÞx Ðî÷Àš…özä è^(¿‹žWXf‹uñ—ì.QÞÏT’ÏðDàÊÇÀà(‡¿œKçôXà^Ë9q…¡k”/Ç#ôNåý€Ûc~@Èe\»5¢|#ž–ÜÊyž“®$Ó/À¬1>ºt¬ÁòðÐø¿3Ey6|ÄÐÎÕì•SN9uÜ Ï40x¿Ú²´—©“¤i$-ÓüµèJ£$í-éìxAuÁ¿ÒÃåW§?+ü—aQIÇKº·z”ï㚨;:^`wYM˜û?ÛÂ}”ÞV–´%nÅú‚Ê&ÄepkÅl’¶À£Â~Ÿ¥o±š”Åý,|ffw–*šgaÏx}y¸ò73žãk9à3Û¼M™¥¤Òy‹º£pëDI†ñÄ®¥szQ=íô’ô?Içãùß&™JÜlfÃ+ë²xº”wBŽw)&ZÆ`ÜBFÈvAaÝbñ;]œóÍ©ÉI…õä8VÌlŒy"ÝEð·Äò¯qÅgpaŸ—ƺ±ÔŸKí¦:Žõ93û ÚÚ€ë“4IKF –Æl»E ±o)Ùv|QIÒZÙÿž:R{$M¤ žÿd—(¿Nå,á÷ã9vnÄ­3àÝ/á×Âü!’ÖÃãr„[Œf¥&ÑbmÛ–—K~7}£Ý¢sñµTÎßÓïÆš¾°ìyÜúSbxa~ta?½q‹A%úà]NÀŸ1JFàV^¶«­JÇ^”¡;ãvKÕÕE5-óäH¼ëq$þe1IöÓ³‚Œ¿R;åÇXœï‹Ñ+žóWRbÕÚÎkŸ ˦Ô9Ž£¶}6åœÖy^“ñbzü#à˜Fl;?~϶T‚Û%ðgÁýMm(Iš›ðÃ\=Šcpw‰‹«-W[§‹™Ý‹'£¬Høœ,ŠwAüŽ¿Ó¶€,«×™Ùµ±ßMhë`>3;¶uûà‰_ë{i–SòKéU°•x÷7¹0ŽgÜêòÞ¶Ÿ¤Næ~=ñü½ Þs ¯âï{¢¼Lu—ÀsÚœ2Íȸ)êâàÀRʃ¸æÇ3Ì×Vj‚á-\vÎ{盫t^—À»ËÏé¬eç{IàŽihì³”\w¡FœÏÒ9=XR73)ÁýÚ=’ÎÀ¯Ñúøà&¼«õßøÆB¸¿Üxwå§À†föQ8™‰[ô:áJËépå§_ø€ýlfËVØÿÞÀžø½ù-õ¹;ÞMør `YIÿÀ»Rÿ‡-–H$Šçº(ÚÙïzß÷©;¸¸YÈ|ð/3«ëƒ!IÂÔ fšRJPiˆcôø‹ûDI7áî–ÿp€¤Wñ/ú›ÐÖ¥Àî’.Á}QzàÊÁYföV±¢™½,én<¿Ñi¸EiA`ˆ™Ý\×NÌì%I÷Ŷ§â¾/3šÙ ÀÉÀ³’†áޏ‡'™ÙÏ’»Ü.”t ÞוÆqðP¼x~Å•‚Ú"`¾ §ñaÀ®4<»ñ#¸…îBIWãCÏë-u,pœ¤±qþ·+œ·w£»$ˆûÛ,¼kf×à/ÌkCùx W¶®5³7ã|_#éÜ¢0+5ÙãNŠ‘…}ðQã™=)éEà^y^ p߯ŽYtü£dc¼[y$Þ5½-°.~Ϭ‹wÅ.€we¤Æòvþ?„?c®Ç#=‡_Û-cû¿œÏpn?÷Ñ{'¬—]ñÁWâ÷Êÿð/a€¹€½ðð %…º´ßÓ•d‹ô×ãϱ{ð“ÅüêÀÓ¸23ÿ?bÜQ´ÓS3ˆ¡/°5ð¸E½þ?_ÿþm˸é;’¤1¬ûF–XNuäáKF½J™Yô“ï…?$.nÃ_ˆà]L—ÆüXüUÛ‹õDbˆrð(n‘uÂ}J¹V6,Ô=qCù߀•x¡of¿KZÏ¿.îtü<>©[âŠÈŠø÷M¼ÛàvjòòŸX(oŠ¡®Ç{È0TÒøËVà83»²pNã_ ëà¡Ùï Æ‚1„š‡üoŒûЈm½&iq`M\±º;ÖWº–ïJZ;Îíäø×öº…ózS´Qâc< Añ>(É|mÈüI-ûºFÒ¯¸5àCü…ºFaý?"ÅÀrÔ¤Hx,Ö=(i%üE5/nMú&6ÝW×ÁïÁ…ÌÃÛcf—Hú¿OßÃûÏW*ˆu5/Ê©¹‡‰óyz¡¼^È7³Ï 2üg¡/ßöT3{¿Çõ÷8¶’UJÇ4ºÔ~C"|jf§dÜÿ@˜ÿ˜»WÞR JšÊÆŒûáùî_ùTãšK Óf´yÂZ2{(CÝñî·áfV_²Ç¤$ͼ¾\«àJßlfömµe›Ç~7p½™]TX6*Žÿ£( ÿ0Ú·ÝŒ€œÿ0z ¬ÙoÌl+I›Û˜Ùêuìƒh{\1ÞÕ̆I:ifê¾í=QX6 ˜Öjò•übfJºx"¬µåû½xÒÌΊr7ÜêÓ£4À!m 5³£%ý YŠô^²Æ>ˆû˜ýI]Ç›$õ!i2ü£­h ú8Ą́¶|m™Œ:Ùöé \"i:üOñ î·‘4µ{Â_ë`“Ž [ײñw pФ™p%hgà ¼i3û´–6ê|î˜ÙMÀMòÀ¬çGàÖ%«eÛrYGà>%ëajºê>¦f`¥vŠÝÒ£ñÿÔ$Ô8Æ÷ÇC„T:'Ã%} ü×"¶V’4«á yQ ê‚÷–¤Ôš#mFREÌìW3[È̦2³iÍlëZœ“ñÀÌŽ4³iâ¼.lf9b¨€¤¥ä9îºQ£ü!"..4cDÚ^ ºaÁ¿fIZFÒlÚ]ÒêaUQ´]êŽþX^ž¯°®´2C€#‚úÚxWu‰ó€Í%m²Í&iP¡ýUCÞ©CÑ{Ø%ÚÚˆº€+§Iš+"›Ï£$i ã#nÁ•óÒn•e9HÆT‚’$)çUÆõ¿÷ß+F5Ÿ8÷åº ÷+Å‚Údz>¢ïD—ÁÌžÄCaìœTy÷ì†+2Oà PéK÷ÂXv$°w,{†B(Š`¼+í)<æÓÿðÁ˜Ù븟Ú.!Û¸ß!ç0Ü{ÛX¶®D=‰;è‰[“Àu)Û÷‘xàÖ ãÜœOÍË+IÆ›°F—b¡¾Ã-›cq×U«-c[&}‚’$I’¤•"iI<®Û\É^qxžQàv3[·Úr¶UêµIšYÒáÕ´1HšJÒIMo©bÛ«JÚ¼–u‹IjLnµÚöu\øüT I‹„§Làýn.iÍj{’$I) ?ÌÌŽŠeŸâÁ„VTYâî¤á4äÄuÇGTI‹Jzd<6é†ç¸j  vÿ€ÞŒ­z|ŽñXI{”-ÞeR"ißCøïŽÜÏj‹ªHjº+’$I:kû‚ÿ ›ð>DþÆ F›Œ Q‚Þv*.ëÐü1l¯V$uŠºóHêZ¶®_,Ÿ¸ly/I%MN…ÅÑ ýðìò}"Óxi›I%Í[ÁZòD­T¯g´Ý#ÿ 0œçŽx'•Ö ,“©ãAÓÓ§p̳ÅðâJç«þŸ<Žq’²õ•ÎIi]8Ÿ“TX7c\¯É+¬ëΨï…èžsð”¤.åç§tnc¾{œ«Nq¾zUh·KìwΨ§²ë[Šu6‘3®°íqº•-ïmõŒýv®pŽæ‹u N™$I2Aˆü`™ÙñÅÅD ÑP„–£ñ¹<“d­]’ÈX‹›äÅÑÝ‹;®TËv àÑf_Æ•‚!…u'ãN…âÃX×-¬ûwœ|7ò&þrìŽ;2ŽÀ!Ÿ¡&”þ0< ùP<ïO)³üÀ…¶‡âÎoàïSÖï‹+N÷ãñv/¬[$øPÓÀÙµûÖÀ½1ß¿aÆ:~ç®S…íÖ‹}|Çw\,ÿwÖ|½0õ)lw(n¥)ɽ],ïˆÅ>‡ï©ðáô¯âΦoáñ†Êe×adÈt€ð…²zC¥cþ <@Ü‹¸C韙ßcýŠ!ï3xbÒ{p‹Ï;¸“ë3ÀcQ÷à˜>òès<~Ì—ÅûÑrlÓ[±ÿ±nù¨ÿTlûJµ³ç”SN9Õ5]+,{¨^\6Qµem«SC.BQ  ê:ùñòŠG‰--+½ŒVõä…ò@ß(‚2)9mß…çÞÏÚþzÙ¾úê f½k”+)AWêßóË…‚Ò/ÊýC!™ïVûX;Öõ 9ÇG Ú+ÊÝBY¹–mÏö/[öeq_¡ðíókÅ ¿g”gÀó-M ,rv*l[R¯Ž/,߸§™>)”¢½ôŽòNÀã…óñ-°~…{c]à‘²v‹JÐæ±Ÿ^…òç@÷(ÿŠ·r> ü=Ê7à&åqÎCNãýPžØ´Úrä”SGâcz¡jËÑ^¦ñu¦ÊÁi’VÔÕ"±`sÓÄËóø!+7Yž3³»ña°Å>Í+,®6ðµ7ïÝ:¢Â^„G¬¯ŽúŶŸ-´½n‰XMÒ–ø°Ø¯qç³9ãE[J‰ñC¼TLJËcÛQ¸jÖñÜþŠÂüóer¿ ¬r/‡+•‹àé*úgJ A/l÷u8o…+®K§Luq›E:‹²ó¼ð½ò²îúX¸Æj’§^[ç.Ô¹,Ú‹?,Jû}ØQÒÞ’fµÚÓ6$uÓ?ï!º1/kL£›çЖZÒŠ‘˜5IÚ:v‡%Mg¼” 3†++Ãq‹Å'‘£«œÞÀ¯e£|]y\€ž…r1ãòhêN.zHê|ÈàóxÂÎÚ(¶ý5hûÆ~àŠÔÔ¸âñç£< ôøfœŸcŸíûâÝ”E¹/†™Gì]0Îï©Àgän¢8Gýb»i¢½Ã›0Ê |»ÚÎsïFœ»}(Ü;qýĸ÷ÎðZÎÓ¡xvïÅ€—$ÝÞß®dü˜ÿ/6†i¨‰…ÒÌ‚[µ“¤­£¦7‘”ïž™½mfû›Ù@IŸJº®’S}Ô]LÒC’æÀó«M$iHL³W¨?XÒK’¾‘ô¡¤}âu:0l÷bÔ=$,w×Iú*F‡ž¹ÜJí­(éÒByÖPp? Ù’47ž½~•hÿž¨{©¤¥ Û®%©”7¬_Ô]OÒ«’îŒå›Hz!Ú¿[ÒøZt“¤9HKP31^_Â’V–ÀKûáCÄ.¯gfßI:¸MÒ‘ø×ùBfv0Þeõ’މvöî4³7 ÂûÀÑfÉwè%à I§â>C â¾ ãËÀ®’ÎnÁ_ÆË'šÙû’®®ŠãZ ~܈ýÔÇ«À¿%}¼af÷ÖSÿ `ˆ¤Óq¥´þ‚?ïÆ[1ÎG/Ü9¸ÔEyp®¤)â¼ÎÌdf É;öÐEÒѸóñÆ@ƒº—ÌìõHbygÄp2`VóáŸo%|ff”m~&𪤃qåïßÀÅV9GÕ8Äýö.ž-~üžü°ù.[»b¼»t0~ŽÎÇ}³6*V’´õyc3{'ºUßÁ»aÜÓ%.įÛõ¸5r&3ûZÒ¿ð +Ró€€GÞàl![ŸB{½ÙBžIð gSc‘š¿¯ŽŽãÙ¢ÐþlŒ͹5á@ºàƒÖVÆHZw¼_#Žs'<ÇÙü üxH’æ »Ãš‘†(AŸà])࣒þ†‡ëÞÏ<Ùá_0³$=‡¿'ÂGä`f?JZ[¿îœ|^aÓ“pg×ᣓJÊÕ⸿NÜ’µ=ðÑÖcÀVøÈ'pÜc mƸŠËSÔ„ÓrýX©?ƒ#–ïŽàz˜ö¦2¯P“Ûå7 üþ¨£Ý1ø‡Ê¡¼¾ZØvl…mo6³Ç û­KæÕñüeųb»?€1ð;Ô̾‹6v.Æ»`§îÃc‘½Ý²—#Iþ$• f$Óf$I2’în5³s¢,\‰žWn¿ÄGxefg¶ë|`fÝëh{>Ü?k0>Ðb_3»?¢‚`fKê^|hfG–Ý \XRæ%­m,ŽÏ+›Ùšö»c¬Û¤°ì)à𜤭-ÌlÕè¢û è\²òHzÿp,Ï«öo3{•$™Hlcf¯T[–ö@:†&IR‰ óÓÇïÔtE- Ü/i¤™ËÆ%©–A„²°AX•ö.Å­*c©ü<*oç7Æõ œº0ÿ0s-Ç3–¿FÁ¸>hý+lWÜÿ0<¾ÔQ$IõHKP3’ùF’$©Ä’ §÷ã€k‹á0Ì#Õ.ìWHóò=îܾUD垨Ø`Dkÿ{8Yw­K¥0 ŸsKZ>œ¬kãe<$Æ”’á]r%îÆ³ÿÃõ§ŠîÕRû ÅèÈ’ßÏ`[I“G7ëöõœ“3†swwI$ýCõôÑ%I3“JP3’JP’$•8 wž·¾””Qx¤wÌì#ÜÇjIË›ÙÀ¦¸ßÜÙ@¥¤¿+à¾{¯ãJÔÆÑÖkxƒÿΊºïàÖ"'ãþkOáþh/E¿Gû³ãñÅæíîÃ}¤f0ÇQ¸ÝÓÀ?ñÁ¥n­ÑÀ£E‹Vø&m†;v¿‰fÛÒ§ IÚ,é”$É8„OеfvIµeI’d\$½lV ƒ’4´%I’$IÛ!»Ãš‘tŒN’¤œýðÄÆI’$íšT‚’$‡ðÏI’¤u’– f$»Ã’$I’¤íJP3’JP’$I’$’T‚’$i3Hº0òݵDÛÝ$]#)Ý’ÖLZ‚š‘T‚’$iKlÀ¸£›“Îx.½|.&­™T‚š‘ü³'Iò'’f4¤lz®°þ_’Þ‘ô©¤«$MË{FÝuâ÷3I–µ½µ¤—cÝm’f¨E†~’n–ô•¤Ï%=ËÏzwÅ>V•´°¤›$í)i¨¤%­%锲6Ÿ–4mÌO$騨ÿ•¤G%u®êÏGû JÚDÒQ…v:ź¾Q>[Òö’î‘ô­¤i$Í"éIŸHzMÒfÕ¾®I’T&;I’ùä\â<"ç–¤M€=U¢ÞxVõup+Ê `]<Šô”À³’î1³%­‡Gk^øØ¸X¬‚ ÿÂ#6ÏŠç÷Z4–ïŠG˜^$= Ïa¶ðž¾SÈ0SY›ƒ€n1|”WÀ£O/„çÛ øX&Ú ,ÌP¡­Ò³sV<ìÆÀû±ìIàÜj5;ð ¤wÍìÅj^ؤݖ f$-AI’ü‰™5³ÍìG`\™Ø"Vo œifï˜Ù<}ÄÚ’zš8ÔÌ~2³¡À¸bžvã|\©™¸Ï6 ‚c€ÀÜÀX3{:d?üGšÙï¥ìîxZÃÌì3û‰:ˆ<_;{šÙ§æ¼yÑFEµß£ý†¾h.1³!fö ®ý ÜÇ9¸WÜ’¤9H%¨IKP’$AÒÆÀŽÀ¡ð€çû3——™}"iž}ý«Xüu¡™@˜Ÿ÷·Y©°þq {…Ý L\ LÝ`Õ¡”|afcxh“Å>?j`ý†ðIa~z`*ࢲ:o6ãþ’$i&R J’d$-œ 6³¯ «>¢ÐÍ$iF¼‹és¼;¬.†÷›Ù©õíß̆ãV¦Gv÷czï¶*n•+G#€I rö¢FÙú·ÎÌ ¼P¶]ɲԕ«Ð8má µlW:ÎïÌlõ¦_‰$©HZ‚š‘ìK’äOÂyøVÜg„¤ Ì»Kš_R?<£ûuÑ TgHZNÒÄွc-2¬#iΪ>à—º¹>¶ˆõ=kÙ×+Àâ’•4p ¡¨„5élà4I³KšDÒ`IG—Ø·À6’†³ô`yIƒ$õ¯ç8ïºH:\RŸ˜V–´@õ®jÒÎH%¨IKP’$E¦Þ¶‰ Ü*²Š™Ý.iJà\ 7n™ùwÔùx”q­"oŸ˜Ù=’vÁ­IßÔ"Ô¸6n¹ùgÁ©x`à,\!ùx®¸±™ •´/p ðî¤<3ð{TùOÈ}5ÐWšžˆu›;áŽÎ{™ÙI‡ã#ǾþÌ‚;nÛ~UØ÷HI+Ä>ŸÂ-d¯WûÂ&IòWÔpß¿$I’$Iª‰¤÷•ÍlXµeidwX’$I’´²;¬I%(I’$I’I*AI’$IÒvHKP3’JP’$I’´R jFR J’$I’¤C’JP’$I’´ÒÔŒ¤”$I’$m‡T‚š‘T‚’¤‘ž‰´I’$IR J’v‚¤î’¶ôžÃjr3{¡©í&IÒªHKP3’JP’´q"GÖ%xÞ«³…ð”ÿª¶l-t¼«V[†$™Hš¬ÒbÊ” I}«-k[%• $iƒHšRÒ¾’>Ä3¬o ôzâYÒ×4³QMØEkæI=ª-D’LzI:®® ’6V®¶ m•L š$m„Ȫ¾°°4ž¬´\ø ØÌÌ>ª¶¼-t¦V`I„"$À$m \ ¼efßU[ȶJ*AIÒJ‘4 °®üÌŒ[~†ãÖžîeÕÿÞö«¶Ü-Ìßð—ÀÚÕ$I&·âÝÝÿTòZ8\WmÛ22K'ó$iíHê Ì̬ ì«&ŠßŸ€9Íì‹jËÚ‚ç kgwàW`Q3{«Úr%IK"©;ðþ_Ž/Æâÿƒ_€åÍì¥jËÙVIÇè$i˜Ùà`~ü«ðV k¬þ Ø =+@Á’Àè˜ï¬Ym’¤¥1³ß€—£8 þÞ.Y‚ÇÖ% • $iHš¸7ƒ/‚v¿ O0³‡ª-ã`=ü%01Þ5–$ëñ¨ùø1ànËîœ&‘JP’´r$-í½,mfsPóxhµeœ@¬t.”ç•Ô³ÚB%Éàn¼ ¬È/ÀÕ¬­“JP’´RäìÜìnfû˜Y©;hzÜ?f}3Ûè´bhüTe‹W[¶$iiÂ÷í·²Å÷W[¶¶N*AIÒ ‰î¯»pëÇ¢fvka]_¼;lm3û¶Ú²N Vã¯_½ð¡òIÒ¸‹q#E¿ff?W[¨¶N*AIÒÊ(t½EM÷W‘Ù€›ÙSÕ–uò7jC–”!‘ÎÑIÇá ¤ôü\[mÚ9D>IZ ’üø'°cÑúSVo3û¼ÚòNÀóR>4~"<.RiˆðÒföjµåL’–DR/à > bQ3{³ÚrµuÒ”$­€B÷×zÀ"µ)@I –Ä­?¿·ß‡à>‘Ö ¤]_oDqD*@ÍC*AIRe$-ƒw½ ,Ó^ó~5õð¡ñ·ã1’Àó%ý ÿ*Þ¤Ú&ÉâÜ/èöj Ò^H%(IªDŒþ:溛™ý«0ú+©a àj`ËâH83;ؘGRŸj ™$€»q_¸›ª-H{!s‡%Iˆî¯Ë¾x÷WZ*CãŸÀ}¤þ ÀÌΔ4*CµåM’fð!Ђ£NÒ”$˜ìþ/FóWÈð¯a/¸EèÉj š$-MD‡Þ7Ri$Í@ŽK’ DŒþÚØØÞ̲_¿HúX¨äJK’¤…Éî°$™º¿ú ›ÙÇÕ–)I’¤£“ÝaIÒº¿Þ–M(I’¤u– $i! Ý_{;d÷W³1ŽOP’$IcIKP’´’¦À‡³®þJ(I’ª!96•T¯ñCRwI"þV*AIÒÌD÷×KÀkÀrÙý•$ €¤‹Â?°tÂãmMÜ€º“WTIÎ J*AIÒLÄ—Öðx5»˜Ù¾ü0I’R“8i¤”$Í@¡ûk-¼ûëŽjË”$Ió#éIëIz^Ò’N([¿ž¤ç$}.é~IcùÀ¤ÀÝ’†HZ¥BÛ›K:^Ò)’>}Í!iIŸHz_ÒZ…ú}%]ë†JÚ/|ÿŒH/éCI/ë—íëIóÊ›J:¾–cî-鬨ÿ{’þ'©sµ¯EsJP’4IË⣿^#GMÒ1:©&ƒ€­€ÕEM$­ iià `{`ZàJàVI]]ñ$Àë‹Th{ `7à~`f੘Ÿ ˜hq¡¤Ò»û<ÞÀg— <§Þße€¥€Ëö5ÏÉWbr`ÆZŽùü77°°°sµ/DsJP’4’B÷×õÀÎÑýõGµåJ’¤Å9Ò̾5³Op%eÁX¾pð®=„wÍcf£¢ÎH3û½R˜à3»3ê_ Ljf¿™Ùõ@o`ZI˜Ùp3{8Ø:ÚÙ8ÓÌ>‰Ó‡4æ@%M…[¸O•±¸r·Aµ/BsC䓤D÷×å@O<øá'Õ–)I’¦!é|j,&Ç™ÙQµTýº0?‚‹ÊôÀ|À…õ¯3~ïÚò¶(û¸ú-ö×7dÓî¼ôùi€âs©±Ï¨é±¸…«ÈûÎ_àí¢éÌì×Fîw‚JP’Œ'ÑýuULÿIëO’´ÌlG`Ç&4ñð‰™ý·–õc®Í$îgÀ`&`h,›#–|ʸÝ[3•m?÷Q*ÑŸÊ|€ë [˜Ù÷õœ¿/ñ¨øm†ìK’RÖýµ“™í— P’$Îv—´ZÄÚ™VÒö’ºÅúO-$Í)©gSvÝeWÇIš\Ò k­¶,I’´mÒ'(Ij!âmüØø»™ÝUm™’$I’æ#• $©@t]ÂX8­I’$ívѧ—$͉¤åðà‡C€åSju¤OP’$ÍBZ‚’$ˆ(¬Ý_I’$‚T‚’„ìþJ’$éˆdwXÒá)t½Lv%I’tÒ”tX¢ûë?ÀîÀvfvwµeJ’$I&©%ISâÝ_ÝÉF:F'IÒ,dwXÒáˆî¯—€RJ’ê"éiI³Æü¡’vo}ô•4õ:ž£%íÐÀº7IZ¦ugŽìñM‘mrIWIzMÒÿ5¡ÿIÚµyÏ\ó"éqI3×U'-AI‡!»¿’¤Õ20QÌOÕBûØXØzÏÔÀ ¬{/ðEëÞl<ßÙvzË?7¡€Ÿšt–ZžYñÔ µ’JPÒ!(ëþZÈÌ>kb“I’4ˆ¾¾(žGk 𰙽׈vfÃ3Ÿÿ ¾4³ÛËê̬Œî2³ï$MÌ ´ž“ë5` ™=Û z™ÙãQ^øÑ̆Ey `A\a¹#˜"i¾ØW'`àŽ rÏÌ`f÷U8¬weDÒ@ü¥=X ø¸ô±&i‘8öå$M ¼Zmi`ð!p·™åËïâJæü¸ò´4ð°,ð˜¤ßåq…áÛ8¶Ÿ ²+ÎõœÀ¥s |üuúãìßÖˆóqCéE€%ðdﳚÙu\ëÁÀ\±Ï»#‘+’fŒs3¸ÏÌ>/lÓXÏÕvw…6'VŽóø€™}ÝaI»§Ðýõ>ú+ $™°,  L Ì<.i¥F´³!p>p0p¬¤cK+%m< Ì,¼JQO`F` `q\aèÜ.©d 8 ¸9,ÆÄ~fŒvÁóN ì<)©d¹Ú¸8˜èSXÒjÀ]Ôn59 X(æ7ýž N•th¬› ˜˜7Ž¡´pLìwOÆUÂŽ®Žå3ŹŸ2Ú^<ÎËÀ&xxÕ€W$õ‰¶;ãÊÄÑ@oÜ’¶i´½klG,¿ÿМ#ÎÑÍ…s°!nñšØOêzT¥“!©³¤;CöÞx¢ÙÍbݲ¸üq}_‘4¬ë <¬2\׸Ôíbq]—43Ë)§v9á_fá_n«U[žœšíº~ˆUW]–œ} 7Ç¿îKåo¹cþlàÐZ¶ÛÏÚÞ%Ê ߯ü$À÷À<…ú‡çÆüÀeeí½,ÊÀÇÀ“¸µ§0<”Ž©q‹Çl±ðªÝ¢|:naQ¡ÝK€S“}}–:ÎÅKÀê1ž¥½S”—>)Ô}X¤P^+ÚïRí`•(?œS¶¿ ÿÔ!Ï•Àî1¿#9¿K…zçÿùµã|MåIQÀTQ¬UØö|à±Zö¿n¥«´Ï§= åÃ{bþ_¥ù(/‰¢X8[Ö¯ <—ÝaI»¤Ðý51>ú+­?IR%$uÃ’Uq…c"à÷F6÷¬™ýó“Eûs=€=ÂšÓ ÿâ¯Ë‘øA¼k¥/ðþ²^)~Ÿ6³ß£›ìS3 `f&én\Y*ñ¸Å›µÀ¶x·Ì²æÝG åi‹î¬8¾ºœ¹—Ÿ3ÃjÓ W@æJ]oÖsmfŽÄ­c]Éðî2p«É]…ó]ïšÙ7qŽ~•ô-0Mt·Íç·Äøµ¦‹ã ò8ûŒã[0Îk‰;ÄüBÀC¥fö”¤±m7Ü¢´j8¡wÆïÃyS JÚ’–Ç Ëð/•1Õ–)I:8ûá>9«šÙ·áïq^#Û]˜/) ¿ú.Žù#êhëA¼[§oÌÃO¼åÒ>ÊC2t*ì»¶}<¬ˆ+~WÇñ*Ì×ÂpëÐE…eçůu?xwÙÍÀö¡ôŒ+C¥co¨ÛÌè²rIöQ1_tP®ËY¹¶}Z…uÅë`¶SÙö×_–˜>AI»AR'IÿÅÿÔÛ›ÙRJ’VÁ@àe çVÜy¶¹yOlfÏ–¦XÞ¥5eÙ6áÖŽµp¥çiÜÚ°5JÐËÀÔá´Lø­…ûŸÔ'ÏŠÀÑ’¶k¦c,?†GCÞ7ÊŽ¹¡£ÍÀ¯Íc¡uÁ‡K< ¬–”Faf¿áþ˜ÇùëD_Q%žÖ*ßgXÇžcÜ{g}jFÊ=W”=>†»Ç¶£ðî°YÊÎÓói JÚ ’æ4³·jY—Ý_IÒz¹¸HR_¼»¥gsï ^â;WKºwDž÷iùð®Ü ¼ifû˜Ù7’Þz˜ÙÇ’^££Ýoâãê>I7àNÞßà§údz7^ÆHšØÌÎnâaÞ œ#éà3»7Žõ%I·áÏ¿¥ñ—~C¸¸TÒ-qlßÖ]¬¼(é<|Á+fvâxʽ;îoõ*îœ]‰«€ â˜îÆ•¾7Ìì8`ßhg Þ¥º>r ÜÏhÛØæuÜòøc¡ÝÝ€[%-†w3Î tÓ_»1“¤õ NÏ5³ *¬[W€.NëOûFÒxË«-KÒpbÏ<¸…ä}`ÎøGÒR¸¥hD ƒ]éúJšènfïD¹ þÒ´ä“DK½€÷p¢Òñ^¸ï™Ùs±lN ³™½åY€ÞföRÙ¾çÆ‡™ûËgƘÙ…ºáföIA¦9'+øº,|`f߇N×’ÿQXC–°Æ_oZàýÒÇ^È6øxÑÌÞå }’b¸þo¥O¸å«'n ëçã½Â6‹ã><ßâá FHšifE‚Šç,B ¼ff¿Fy’hc(®Íff¯ã~Y,êû^8—ËàCä3³ï ÛôÀ­A£p+Ù \iQaiÜÏêSà‰T‚’VO˜OÃc‚lT¶ü@¼O[3»·Ú²&-O*AIÒ¶ˆXJóàq„âá6)*wÕ"»Ã’¶Àaø(ˆÃJ âkàJÜÁn!+ÌJ’$IZ¿â·Æ-i›µR JZ9Pm|ÔGÉD¼<Þýu pHv%IÒQ‘Ô¹µ?Í#[ÿ£É µ9:,iµD²ÃðØ£€a…Ñ_7³ƒZûŸ?i2‹|’ð§Pc"o'AZ‚’VIƺ  >ê¡f=»¿’$IÜ¡ynj#&ãIZ‚’ÖÊ1øhŠRЮnx®œGe%-¹b’$I:*›à±r’F’£Ã’V‡¤5ðØ=*¬þI…èYà@3{°Í'mIÀ•ŠC’“ßÄ^)äIDAT¤£ÃçÆ»‡™Ù»Õ–©-’– ¤U!iîóÓ£–*¿ãy_nƃd-‘ P’$¥q_ɱx뤤”´$uÅâ•+@£ñü7oáCû›Ùfö ¥)³#’ŽÑIëàñx·XÒÒ1:iMœŒ‡2/Ý—¿à/¼KðhÑoV[À$I’VÂúÔ2æ—4i):sÒpR JZ’ÖÃ#?Â}~žNî*3Ÿ$IÒ‘‘4-žÇ«Äo¸{À-Õ–­­‘JPRu$Í \|œ\jf_W[®$I’VÊjxpËÐ-Õ¬­‘JPÒX \Jh˜$I’ÔÉ&Œë;Ù‰tŽn©%UÇÌί¶ I›"£“K’]¦Âª®’æ3³W«-c["G‡%I’$IÛaqjºÂJqÓÀi OR J’$I’¶Ã:@wø“ÄÉÿBI%(I’$IÚ&©5‘T‚’$I’¤m’JPI%(I’$IÚ&©5‘T‚’$I’¤m’JPI%(I’¶F>ø“ÄÉÿBI%¨™‘ÔGÒÔÕ–£L¦ÿ“´Oë+éïÕ–9I’$©—T‚šH*AÍÏfÀ‰Õ¢Œ)bjS“U[à$I’¤^R j"1º‘HšX˜øÏä;L'i=`¸™Ý/iIà“¨»0p‰™ýZÖÞZÀcÀ²ÀôÀMfö¥¤åy€GÌìõBý‰€µ€þÀ‹föLY{Ës—-Ÿ˜®X_ÒšÑþð ÇÙX˜xÕÌ'I’$i ¤ÔDÒÔx¶ºãÙ|×&fÂ-)‹ DÝCËýcýDÚ»¸  ,À¶ßjÙÏ™ÀªÀ³’Æ£W£«qâ“„ôƒH:.ßãgž•´…ÿB(@‡ÿWm!Û ·’d<‘470®H¾dfoÖõâç÷Ù°Ô|URRjioày3û=ÊóߘٗQLbfoG¹3>ê«?ð²™½YÖÞ¢ÀÌø(².€™Ù±®'°:®È<Šû½hf¿Iˆíÿ¤ÐÖbøpû_€§K2%I5ˆAë—þ IÒ‘ô4°(þq»?›î`?|äñ ò÷AR;©%IÒ¦H%(éÈHÚ8èüÓ”@à{3Ë`·ãAú%I’$IÛá®øíôƃðöÀ»Æî®¶pmT‚’$I’¤`fïâÖ€ÎÔŒîý¸±Úòµ5R J’¤­‘ŽÑIGçV<`n‘‰ñôMÉxJP’$I’´-nÁ-?EÞ´ÿoï¼£íªª=üýRHï@-@ˆ¡7齈ˆ˜A¥[@}¢>@©ŠRÒC/‚‚‚€€´ÀPÅ@€$” HBBæûcÎMvçÞܲÏÍßgd¯²×^kí3ræk³Ió0V›&… $I’$i]ÜÍìñÝ>®­zR­‘‚’$I’¤¡T,UMg–Át2¤”$I’$­k™u$ö1ž- ™KRJ’¤µ‘†ÑI⚟öq}›eпy¢¡ÒfHÚOÐ9ÙÌŽ­z>I’$IÒˆ˜ÙxIoày#Ó5~iM¤€›€Ó€n~’¶””¨’$I’FáO¸2ãöª'ÒZi!(2oŒÅ_êÃ’:HêíËI×’4HÒ E&ô¨ï9±4°”eIËH<óé+i]I+Ïúý%õ–Ô;ê»Hê,©¤U%u«z/“$I’6Ã_€GÌìíª'ÒZi”ã°-_K·—/ÇIõ×Jº×ÍÄ£d¾/ix$&Ý8CÒ“xñÕ$ ,mKJºÏ̾ÙÜD"/Ë/€'ž’žNˆ±n~›§âaË×Â3±„',M’ä³#m‚’Ÿ¢êI´f&ª¤aÀf¶Q©|#°…™ÝuÞ2³ï‡væj<ãù·%mÜl™Û·þif'Ef÷—€šK¼(i"ð53»?ÊÍljŒ¼™mXê{6°°nJâI²pôð 3{ºê¹$IÕHêhfÓ«žGk¥!ŽÃšal!Ûç„%ü¹ÀJí/šÙCq= ×]ý'c€9‹= œ i/IKD<†æøK @I’$I¤44ºô‰p!©ÐY‰ãÞz”Ê”®§7Qבæ\ì ¼$éè–Î1I’$Yô´¡¤“$td8ò”ÛÛKú¦¤³$'éPICjú ’´»¤>’þ#©]Ô_*iǸÞOÒI `¾C%]Tõ¾µ]ú3›krÖ/Uo <»€Ÿó™ef;àîú‡EÓt\K’$IÚa'zžšâÀJÀÓ’¶)uü/0·Ó «j_Ü®´PþLˆë¾¸ ìüÒ+ž•ÌF1Œn)ǧHjtŽÅ¿X IWàÉéÞöަ1À@I¿^Åâ’$Yø¤at²P´:™ÝÕ—J \&i%üwô›ÀÚ%;µËê 7Ø­NýXàÝšç® l Œ7³ÛjÚáÎDÝ€‘föH Ö1ØÿC~tÉæuy` ™Ý[ê»8ðùâ¹á ýE p·™)Õo„›žì¼kf·Vù¾æ…FÒÎo¦Œ™] ìlŒ{d}ÕÌnŽæçsJÝ?~‰{m\<3‡yÜl 쎇!Ïžl¼,}oÆÿBH’$I=v+ @§Kà¿Ó€¯7&%„¥Å ¢†_›—Êkgý%Wgwà!`m\ktd ×q°JÜs¾¤cŠ!¿IêSê{°G@ÿ\Ò^ ?Šçû¯™½Wõ~$I’$­3{ hX(87’Þ§ê‰TACA¸jo¯˜Ï:ø¹êwªýÀ x´æû€½ÊjÈZ$휆[õw½À†gá‚VÑr(ð}Ü¥qnlyIšŽÇ[(xè"ip©nS’zKêXÓ¿°.žŠãJàAIí%õ(͹¸–¤’E²ØbŒöáIËHZ¡ÔÖ¿Þ¾ÔY_ïRú×Î/Ö@<{é:÷¶=îLóôúdzz—çc¯\^WóìÚ¦ò;í,U·½¤Å".’V”´ðwà7¥½ì׋dzk¿;íbïz•û'­Š¿1ËŽq?(I’dži(ÃhI;E@ÄWÝâù<4þ«À²’¾jf†Àðޤ/}€$}W—“´µ™=ÏXx ¼÷íüX]Ò!fvU<<žÀõ+¸çÙs@gàr< ÇáÀÝ¥%¬ƒw\¸7æ¼z}?õúo’~܈ÿàOÚKffãb7Kº%ú‘ôûè÷uøÙ{ÀJu]ãߟán°¢|ž-^øµ‡D[G\XÙ1ÊN+ù+àÒ¸þ:.Ïùž«¨_”ßέ™çÀÒͬc3`l©¼iÌox©î¸j¿ˆÓtð—¸^/úó_¸NŒr'\ Û¬‰ç/^ºî< ìåaø_ÐFy%\¸êå{€ÃJ÷ÞÜÓÄsÖÇ#õ–ë~»2·‹ò™À-MÜÿà R¹süÛÛ¿–³õÝ/ö`ÍRÝþÀq= öì€b,àe`‹(ÿ¸¢tïéÀUçó3OÿOœßáÉÅ÷,?ùÉO~æõ³ÐŽÃâ¸iëø,_§Ë–ñ£zGQažê`{à3›åsq-É€Òý—Æ=ÓÑx˜}€‹=â˜MÀ^Àˆh†k€v–´'žVãCüH«`óÏ;fvc©¼=p™šœ?àŒ‚Ifö·XÏS¸pM”§áyÖ7ñ¬%ýPÒY¸Æ¤³'—cf£b¬pÁs ¤NÀæÅzc/™Ëuë*\–϶mâøîià’~,i™MÃØšÙ“sèsYÌ}jìQñØ×Þ\4—ëJ‡›ð`‰wYºÆ'I2Ÿ,Ìã°p­ÀÀ„šö^xô×zô&•Êàc{0ËP²l09£X›™=$é-ü(è]\{tWôë‹ Ë•î= ?*xg¬½vŒÚõ¼t.ÙM®é?£¦n:Ÿv.¸O{E<£7еÔ^oì@wÜF¬ÜÞÔûhŠÚu½‹k®:ñéà–GàZ¸]€ã%ÝìÖÌØoÓî†[霈J—ùjôíàÖ2÷œ*x 7Ìý3»UÒ.À×âìcf·GóDàÔš1OÞ*•¯Æ4±‡ÃŸâmÅ [ª1Ìò¬*85ž‰™Þ7;áZ]iBdfïIÚønÔÞÎÌn—478ï|ÇšNh{'®µÚ7bÞÐÌŠ£¸­bŸûÇ8£ñãÏ2–ÞÓûñ(sn ¹á¦ø÷j"î^ŸvA­3{¬ê9$I²hÐ*³È'ÉÜ ©+°bÓÝpƒï×ÌìGUÏ-I’$©Ž† –˜$Ÿ€Ë%ý׆MެzRI’$Iµ¤&(I’$I’6Ij‚’$I’$i“¤”$I’$I›¤¡… IûJÚ:®7 ¯ªçt–¤>óxïf’N·òEI'Õ&mM’$I’F¥¡… <ÝÁšqÝ“Ù#;/$ý=Üï[Ê<%Þ”´$p;0–YÉA+!²³¿ZS·‹¤ËçuÌ`o¿Ç{DÒª zžI’$Ië¢á„ I=% ®“oêàèš¾‹GVx$um.p¢¤ö’V‘´¦¤îQ×&Ø7ƒN’zHêPso×ÈdßÔØKKZ¹‰YÄxëá¯aV¤h$õ‹¼jêìC;IÝ¢½¤žÑ6@ÒŠ¥¾KÆÚÚÕŒÑEÒ’V¨™[O`©XsïH×ÑX"Ê=ë¬opíøÑ¶LD¥nÉ»]LÒj!–ë;—÷7ÖÚ«Ø{<^PŸÒ;ªÝ‹eꬻS©Ü¾Ô¿[ŒW¼ó–ÛL’$IA*X¢¤ïãÑ ŸÀÓa”sA}¤ø…è{ð¿Àãñã,<þËÅuÆ] ¢¦ÿV‹@{ãI6OÄݦωñÇ1{¤ãG€Ÿ7ÖŒ»,p5ž›j*Ð]Ò03W3…õñ¨×p-П€“"2ö×ñ$®«Jú¶™ý5îyÏÿ5xèx¯¤kñ„¨+Kº¢¸WÌáeIÛEäè¯àYÜÇKïKú’™½ œûUh¤Žº÷€B¸¸ ÏÑ6èë{QR{À²øÜ*Qþ.Xå=€;âzüGs¹(¯†GÞ¯‰±ÜT*w:Äõ£À¶¥¶MñžºDù»1¿!uÖÞ,÷‰rwàà{Q>­˜[”‡ï–ÊÏ—ʫijŠû»á‚ä·¢|.ph©ÿºÀ«¥òx`­ª¿óùÉO~ò“Ÿj? í8,Žt¶ŽÏòuºlŒ6³ÿ˜Ù³¸ö¦[÷™ÙKÑ÷ßÌ~Ä´YéY=ñU›Kúµ¤ B˜Qo`3{×¼ ªý‹Ì5åõtÀ3Ó¿-iI{áÚ•–&çܘގçÞ„k[Ö-õ)'{%ÚoŒþÏáé"®òtÖ÷VëûðG3+2²À…²z|?‚º,æ:O†û…–ΧޫÂ5Q˜'Z½j>ÇK’$IÚ ó8l'\Ë~Ì3¡¦½'® *ó~cuÅ‚2åLå?`V†óCÍsZí„k/þŒ mof/71þ9À’îÂó™­V§OØ¿~1€ñ¤¡-¡®)óNŒ[ðvMû‡5BÑŒš=›k„À}¶NÁ5LC™]ÀšÝð#É~ÌÊ‘f¥õõ¤ô~̳{Oib¬^Àdó£ªzk5\À*h‰pþ‘™M+•ß9Õ£álß’$I’êYhB™4‡.c€5%µ7³ÃÎg]êkƒ~ZêÛ7<¾*žµgç?< éGÀƒx‚Î3ñã­î5ݯÀ3ª ÜmfêŒ÷Ndµef·ÌÖ< lY$-q=»€¶|Gà·¡aBÒ¥¶é^¥®föa©î¯73›v>cÔðJB•¤ÁÌ.À•ô–4ÐÌÆGݦ¥µ¾‡'a-X¥æþz﨓¤ÕB nwõŸ¸~×<¬Zg¼¹öðK’$I-É0ú<ãúE’®Ä †;Õëhfÿ4¸MÒm¸+ýÀÌzý%}×F< ĆþÍO‡ÄÝýf6ÚÌ&KºÏÆ>¬™9œ'é8\³µ°”™Åœ98HÒñ¸ðOq{›1-¸·%ü+Öõ°~TôbìßäpΔô0n¨ý°ž¤£€—Ìln”|NHØّ¸¶ì1I‡âÝ|Z;W¼¯·%\1’ÖÄ…´õ¢ËíÀ-’FEyßš!ž—4ø'.ÄLN‘tVŒ·n0^Œwµ¤ÇqmÖ~uÆ;ZÒMÀ]föÌÚó$I’¤Ñ0ÇqÌóEÜ«gðGü‡õ¡èòaì„{‚M‰~“€‰M ÿ .í ¬ 5³û£í Üh¸³kîÀ —kµ<¿ŠgafW;+âBÛRøq[=Æ¿/­÷màóøÚPÜu~¯RÿSpãè‚×™åíTpRÔ\ ‚Ä!Àßbì7€Ýq;œ‚­p¢þ@ÇvÀ—Œ9^ V¾Q^_%nŽ{¼mûx4ðfëÿ n°üe  °A¡ -Ý^À&ñŒ}p½‚ïWâGs…g pp<»?°Yq¼ifwàÞt[}q/ÀSKãí \{Ãu%I’$i“´Úª’ÖÆ½­>’47Ìdî>¿cwÀ]Åo7³E2ºskFÒ*Àƒf6O‘»'Ž`WâGÀkföBMŸÅð£Ë—ÌìùRý*À43{1Ê6õ…ïâNJýûàBs\ã;* Ú‰p]j¦÷z騳ˆï´.ðNÀßÿT2’~ŒkŒmAߣpç‡Ô4&IƒÒHÇasË®ÀwËi<°ë€¶Â=°Ψz‘Iò²-®½BIú8ÎÌ.ˆ>ý€»€% /Dðp¯¿åNÜ€~$®a»HÒúæ1¥¶Åµ”÷áqº†àG×ÛÆXWá1›ÊZÄàZW$ yŽÁ==Wй~©c'\C;G!Ø-ö#… $iPZ­dfGSAz{ŸAê‡dÁaR ´`xÉ̾T$í \)iª™•O'ãGŒ¿¯3Æ·ðcÅu‹P¡A*ÔÌÇ'šÙ)¥çÔºefŸ:J;°k€ýÍìÒRýºÔ± ‡Šfö^IíVh°Bóµ80¦ÆS‘°{댭£/Ð»Ž–¬3@¡‘*?»©Í–Ô?n~®©0I’,ªiïQóœÚpMñ]üèìÒšûG7Ñð/I#pÁA’.õÅßŵU¯KÚ*øY}‚™MÄ…‹ýqÏÉ£g$­í—౟ÎÇíyþa0ÊŒn(}ŠR™=jK˜Ž{ÿ†ÛoáÞ¦ÄÔh\ó¹ý¢’­Ó9Àú!ÄmÜif¯Æ½á^ªóÂ0Ü {wI{âGî«…Áx’$‘BP’$µ¬Ž͆™=Œ‡Ž8¼NÛfv™ˆ>O~TjÞÌÎ4³Ý€oJZ½4Ä}fvuéS¿À,¥¥L­±ë©Y½òz3{dúwq[¦ÔDEÊ幉tÞÓ±° ®ú9MÄ6K’dá6AI’|‚¤¥ñ㣠šèr~<5 ÷CR»²¡q¤PG¸½×¶ã‚ÍLZ£é*<ær шßÍÌÞ˜Ï%?Çë*Œ²7>Àívþƒ{¡ÏìÂìÇ„ïáš­‚UšyÎãÀófv*I’4 )%IÛ¦Ÿ¤ÃqeeüØæFÜ£ëS˜Ù³’®¾Ç¬Àœ‡IÚ¸ wß8Æ)\àt?³l{À#š?Vúû«`œ™0³;"*øHI¿ÃÉâ/÷Ù燓ñÈó¯ÅÜO~ef3%Ý'é ÷|êŽGZ¿ÔÌžþâÑÈWÀ…ˆ'€EÞ:I?áÓ!ÆEê–b[ãÑËûâ¨ëÌì_5÷îì˜Ù ¥ºƒ«Âv I»ÍìÁ(¯ƒ'WîŽHýSéÞÅq#æ¸]Ñ@<äÓѾSÌk<žsð[fö›hûp[áZ/i%\x[ô~«™ý£êïA’´eRJ’$I’¤M’†ÑI’$I’´IRJ’$I’¤M’BP’$I’$m’‚’$I’$i“¤”$I’$I›$… $I’$IÚ$)%I’$IÒ&I!(I’$I’6I AI’4’v‹ü`I’$Ÿ1:I’†CÒ4`°™M¨z.I’,º¤”$I’$I›$Ã’$©Iý%Ý$é¿’^•tK©mT$fERI×GŸ»$í#é¢hë*é1IÃ$–ôФ£«^[’$­ƒUO I’6ËáÀ;À ` °A©mm`±¸>øX èÜ ¼mí£ï.ÀÖÀÀHI·šÙ¨ª˜$Ic“š $Iªâc` °*0ÓÌFÖvÔØ 8Ö̦šÙxàì:ckfï™ÙXàŸÀzU/.I’Æ'… $Iªâ—À£ÀuÀDIÇÔéÓ×½Vª›X§ßë¥ë)@z–%I2GRJ’¤Ìì}3;ØÌ;‡IÚ¤¦Ï[À$`H©zÕªçž$É¢A AI’T‚¤]$ ‘Ô˜ŸIuºž œ)i3I»{T=÷$I RJ’¤*–.Ægß7³§£í`Z\ ܆Ûúœ¼m3¢ïÌÒ¸ÿ^®zqI’4>'(I’†FR'3›×®F›ÙqUÏ-I’ÖMj‚’$it¶‘ô¬¤€§~À爵T’$­ŸÔ%IÒðHZX˜nòI’$óM AI’$I’´Iò8,I’$I’6I AI’,HÚ>ŽÍŠrI_‘4´ê¹%IÒ˜¤”$É¢ÂñÀç$õÀ¨¿ ¬VõÄ’$iLÒ&(I’EI›—šÙJUÏ%I’Æ%5AI’T‚¤›BX)Ê’t§¤u£¼ž¤Û%½"éIÛ—úŽ´¤;$½%©·¤Ë%m)i+à`€¤Ç$#i”¤ÅK÷/'i¤¤.UïC’$Õ‘BP’$Uñ$ð½Ry+`0ð¸¤þÀmxtèe+%-}ã¤VÞ>ôî~ŒG¢Þ?&›ìSzÖw€çÍlJÕ›$Iu¤”$IUŒv•Ô=ÊûàGX3q[žQÀh`à•(ïXºÿ<3{ÊÌ&™ÙÇEeÜ?˜ifSÍlp°?€¤ö¸tnÕ$Iµt¨zI’´MÌìYI»IºØ•0lÆ#®\TsÛ¥ë—æâq·$mt&›Ù?«Þƒ$Iª%… $Iªd°/®¹yÂÌž‹ú€gÌlÇfîm±W‡™™¤s€ÎÀyU/I’TOj‚’$Yä‘ô?ÀH஀’$)øôÛ3`É"zTXtSoftwarexÚ+//×ËÌË.NN,HÕË/J6ØXSÊ\IEND®B`‚ldns-1.7.0/doc/header.html0000644000175000017500000000371113026206166014712 0ustar willemwillem $projectname: $title $title $treeview $search $mathjax $extrastylesheet
$projectname  $projectnumber
$projectbrief
$projectbrief
$searchbox
ldns-1.7.0/doc/tutorial1_mx.dox0000644000175000017500000001012713026206166015737 0ustar willemwillem/** \page tutorial1_mx Tutorial 1: Querying for MX records \dontinclude ldns-mx.c The full source code can be found in \link examples/ldns-mx.c \endlink ldns-mx is a simple tool that queries your default caching forwarder for the MX (Mail exchange) record of the given domain.
   % ldns-mx nlnetlabs.nl
   nlnetlabs.nl.   86400   IN      MX      100 omval.tednet.nl.
   nlnetlabs.nl.   86400   IN      MX      50 open.nlnetlabs.nl.
   
First of all, we need to include the correct header files, so that all functions are available to us: \skip include \until dns.h In this case we have used a configure script to generate a config.h file that does all our inclusions for us, so that it can be compiled on multiple platforms. If your platform supports the include files \c stdint.h and \c stdlib.h, you can include these instead of using a configure script. The first included files are prerequisites that ldns needs to function. The last one, of course, includes the functions of ldns itself. In our main function, we declare some variables that we are going to use: \skipline ldns_resolver \until ldns_status - The \c ldns_resolver structure keeps a list of nameservers, and can perform queries for us - An \c ldns_rdf is a basic data type of dns, the RDATA. See \ref design for a description about the building blocks of DNS. In this case, \c domain will be used to store the name the user specifies when calling the program - An \c ldns_pkt is a DNS packet, for instance a complete query, or an answer - The \c ldns_rr_list structure contains a list of DNS Resource Records (RRs). In this case, we will store the MX records we find in the list. - \c ldns_status is the basic type for status messages in ldns. Most functions will return a value of this type. First, we parse the command line argument (checks omitted on this page, see full source code), and store it in our \c domain variable: \skipline ldns_dname_new_frm_str This function takes a string containing a domain name (like "nlnetlabs.nl") and returns an \c ldns_rdf representing that name. If somehow the given string can not be parsed it returns NULL. Then, we create the resolver structure: \skipline ldns_resolver_new Most of the functions work like this, the first argument is a pointer to the structure where ldns should store its results (which is also a pointer). The function returns a status code indicating success (\ref LDNS_STATUS_OK) or an error number. Remember that these types of functions allocate memory that you should free later (using the ldns_free_ functions). The second argument is the filename that contains information about the resolver structure that is to be created. If this argument is NULL, /etc/resolv.conf is used. The syntax of the file is like that of /etc/resolv.conf. We tell the resolver to query for our domain, type MX, of class IN: \skipline ldns_resolver_query \until ) The last argument contains flags to influence the type of query the resolver structure sends. In this case, we want the nameserver to use recursion, so that we'll get the final answer. Therefore, we specify the \ref LDNS_RD (Recursion Desired) flag. This should return a packet if everything goes well. We get all RRs of type MX from the answer packet and store them in our list: \skipline ldns_pkt_rr_list_by_type \until ) If this list is not empty, we sort and print it: \skipline ldns_rr_list_sort \skipline ldns_rr_list_print And finally, just to be proper, we free our allocated data: \skipline free( \until resolver_deep_free For structures that can contain other ldns structures, there are two types of free() function available - \c ldns_free_ frees only the allocated data for the structure itself. - \c ldns_deep_free_ frees the structure, and ALL structures that are nested in it. For example, of you \c deep_free an ldns_rr_list, all \c ldns_rr structures that were present in the list are also freed. */ ldns-1.7.0/doc/tutorial3_signzone.dox0000644000175000017500000001304113026206166017147 0ustar willemwillem/** \page tutorial3_signzone Tutorial 3: Signing a zone file \dontinclude ldns-signzone.c The full source code can be found in \link examples/ldns-signzone.c \endlink Of course, we start by the usual includes. Since we need a bit more here, we'll add those right away. \skipline include \until define Let's skip the boring usage() and sanity check functions, and dive right into main(). \skipline main(int argc \skipline { We'll be reading another zone file, so let's prepare some variables for that. \skipline zone \until argi We will create a separate zone structure for the signed zone, so let's have a clear name for the original one. \skipline zone \until zone To sign a zone, we need keys, so we need some variables to read and store it; \skipline key \until status The \ref ldns_key structure holds (private) keys. These can be of any supported algorithm type; you can put an RSA key in it, an DSA key, or an HMAC key. Public keys can simply be put in an \ref ldns_rr structure with type \ref LDNS_RR_TYPE_DNSKEY. The \ref ldns_key_list type is much like the \ref ldns_rr_list, only, you guessed it, for \c ldns_key entries. The signed zone will be stored in a new file. \skipline file \until file And we have some command line options for the output zone. \skipline tm \until class \c origin is a domain name, so it can be stored in an \ref ldns_rdf variable with type \ref LDNS_RDF_TYPE_DNAME. The next part is option parsing, which is pretty straightforward using \c getopt(), so we'll skip this too. U can always look to the source of the file to check it out. Okay that's it for the variables, let's get to work! First we'll try to read in the zone that is to be signed. \skipline fopen(zone \until } else { If the file exists and can be read, we'll let ldns mold it into a zone structure: \skipline zone_new This creates a new (\c new) zone from (\c frm) a filepointer (\c fp), while remembering the current line (\c l) in the input file (for error messages). A pointer to the zone structure to be filled is passed as the first argument, like in most \c new_frm functions. Like a lot of ldns functions, this one returns a \c ldns_status indicating success or the type of failure, so let us check that. \skipline STATUS \until } else { If everything is ok so far, we check if the zone has a SOA record and contains actual data. \skipline orig_soa \until } \until } \until } Now that we have the complete zone in our memory, we won't be needing the file anymore. \skipline fclose \until } If there was no origin given, we'll use the one derived from the original zone file. \skipline origin \until } No signing party can be complete without keys to sign with, let's fetch those. Multiple key files can be specified on the command line, by using the base names of the .key/.private file pairs. \skipline key \until fopen As you can see, we append ".private" to the name, which should result in the complete file name of the private key. Later we'll also form the ".key" file name, which will be directly included in the signed zone. If the file exists, we'll read it and create a \c ldns_key from its contents, much like the way we read the zone earlier. \skipline line_nr \until STATUS If this went ok, we need to set the inception and expiration times, which are set in the keys, but will eventually end up in the RRSIGs generated by those keys. \skipline expiration \until } \skipline inception \until } And now that we have read the private keys, we read the public keys and add them to the zone. Reading them from the files works roughly the same as reading private keys, but public keys are normal Resource Records, and they can be stored in general \c ldns_rr structures. \skipline FREE \until } \until } With \c push() we add them to our key list and our zone. This function clones the data, so we can safely free it after that. \skipline push \until free And if we're done, we free the allocated memory for the file name. \until FREE If the reading did not work, we print an error. Finally, we move on to the next key in the argument list. \skipline } else { \until } \until } \until } Just to be sure, we add a little check to see if we actually have any keys now. \skipline count \until } So, we have our zone, we have our keys, let's do some signing! \skipline sign Yes. That's it. We now have a completely signed zone, \c ldns_zone_sign checks the keys, and uses the zone signing keys to sign the data resource records. NSEC and RRSIG resource records are generated and added to the new zone. So now that we have a signed zone, all that is left is to store it somewhere. If no explicit output file name was given, we'll just append ".signed" to the original zone file name. \skipline outputfile \until } \c ldns_zone_sign returns NULL if the signing did not work, so we must check that. \skipline signed_zone \until } else { Writing to a file is no different than normal printing, so we'll print to the file and close it. \skipline print \until } And of course, give an error if the signing failed. \skipline } else { \until } Just to be nice, let's free the rest of the data we allocated, and exit with the right return value. \skipline free \until } */ldns-1.7.0/doc/tutorial2_zone.dox0000644000175000017500000000703013026206166016266 0ustar willemwillem/** \page tutorial2_zone Tutorial 2: Reading a zone file \dontinclude ldns-read-zone.c The full source code can be found in \link examples/ldns-read-zone.c \endlink ldns-read-zone reads a zone file, and prints it to stdout, with 1 resource record per line.
% cat example.zone
$ORIGIN example.
$TTL 600

example.        IN SOA  example. op.example. (
                                2004022501 ; serial
                                28800      ; refresh (8 hours)
                                7200       ; retry (2 hours)
                                604800     ; expire (1 week)
                                18000      ; minimum (5 hours)
                                )

@       IN      MX      10 mail.example.
@       IN      NS      ns1
@       IN      NS      ns2
@       IN      A       123.123.123.123

% ldns-read-zone example.zone
example.        600     IN      SOA     example. op.example. 2004022501 28800 7200 604800 18000
example.        600     IN      MX      10 mail.example.
example.        600     IN      NS      ns1.example.
example.        600     IN      NS      ns2.example.
example.        600     IN      A       123.123.123.123
   
Again, let's start with including some necessary header files: \skipline include \until errno In this example, we are going to open a file, if that fails, we'll need errno.h to display an error message. Okay, let's declare the variables we are going to need today: \skipline filename \until ldns_status The only two ldns-specific types here are \c ldns_zone and \c ldns_status. - \c ldns_zone is the structure that can contain a complete zone - \c ldns_status again is used to check return values of ldns functions If we get no filename, we'll read standard input, otherwise, we'll try to open the given filename: \skipline if (argc == 0) \until exit(EXIT_FAILURE) \until } \until } With the \c FILE pointer in our hands, we visit ldns to pour it into a zone structure: \skipline ldns_zone_new_frm_fp_l There is also a \c ldns_zone_new_frm_fp, but this one also remembers the line number it was on, so we can use that if we encounter a parse error. Just like in \ref tutorial1_mx, the first argument is a pointer to the place ldns should store its creation in, and again, the return value is the status code. The second argument is the file pointer where our zone data should reside. The third argument, if not NULL, is a \c dname that contains the zones origin. It will place this dname after every name in the file that is not a fully qualified domain name. The fourth argument, if not 0, is the default TTL to use. Both these values can be specified in the zone file by setting \c $ORIGIN and \c $TTL. The fifth argument specifies the default class, which defaults to IN (\ref LDNS_RR_CLASS_IN). And finally, every time \c ldns_zone_new_frm_fp_l reads a line from the input file pointer, it will increment the value pointed to by the last argument with 1. Okay, with that, we should have a nice zone structure. Of course we need to check whether it has succeeded. \skipline LDNS_STATUS_OK \until deep_free If everything went well, we sort the zone if necessary, print it, and free it. Since \c ldns_zone contains other ldns structures, we use \c ldns_deep_free so that every \c ldns_rr_list, \c ldns_rr et cetera are freed too. \until line_nr); \until } If something went wrong, we use \c ldns_get_errorstr_by_id() to get a nice error string instead of just a status integer. And of course, we should play nice and close the file: \skipline fclose \until exit */ ldns-1.7.0/doc/function_manpages0000644000175000017500000005273213026206166016226 0ustar willemwillem# first function name will be the real name of the manpage # other names are aliases (symlinks) # all functions specified on the same line are included in the # same manual page. We cannot deal with linebreaks! # function named after the pipe `|' are put in the "see also" section # functions that must be included, separated by commas ### host2wire.h # conversion functions ldns_rr2wire, ldns_pkt2wire, ldns_rdf2wire | ldns_wire2rr, ldns_wire2pkt, ldns_wire2rdf - conversion functions # lower level conversions, some are from host2str.h ldns_pkt2buffer_str, ldns_pktheader2buffer_str, ldns_rr2buffer_str, ldns_rr_list2buffer_str, ldns_rdf2buffer_str, ldns_key2buffer_str, ldns_pkt2buffer_wire, ldns_rr2buffer_wire, ldns_rdf2buffer_wire, ldns_rrsig2buffer_wire, ldns_rr_rdata2buffer_wire | ldns_pkt2str, ldns_rr2str, ldns_rdf2str, ldns_rr_list2str, ldns_key2str - lower level conversions ### /host2wire.h ### host2str.h ldns_rr2str, ldns_pkt2str, ldns_rdf2str, ldns_rr_list2str, ldns_key2str | ldns_rr_print, ldns_rdf_print, ldns_pkt_print, ldns_rr_list_print, ldns_resolver_print, ldns_zone_print - functions for conversions to string ### /host2str.h ### host2str.h # and even lower ldns_rdf2buffer_str_a, ldns_rdf2buffer_str_aaaa, ldns_rdf2buffer_str_str, ldns_rdf2buffer_str_b64, ldns_rdf2buffer_str_hex, ldns_rdf2buffer_str_type, ldns_rdf2buffer_str_class, ldns_rdf2buffer_str_alg, ldns_rdf2buffer_str_loc, ldns_rdf2buffer_str_unknown, ldns_rdf2buffer_str_nsap, ldns_rdf2buffer_str_wks, ldns_rdf2buffer_str_nsec, ldns_rdf2buffer_str_period, ldns_rdf2buffer_str_tsigtime, ldns_rdf2buffer_str_apl, ldns_rdf2buffer_str_int16_data, ldns_rdf2buffer_str_int16, ldns_rdf2buffer_str_ipseckey - lower level to string conversion functions ### /host2str.h ### wire2host.h # wirefunctions ldns_wire2rr, ldns_wire2pkt, ldns_wire2rdf, ldns_wire2dname | ldns_rr2wire, ldns_pkt2wire, ldns_rdf2wire, ldns_dname2wire - convert from wire format to host type ldns_buffer2pkt_wire - convert buffer/wire format to ldns_pkt ### /wire2host.h ### dname.h ldns_dname_left_chop, ldns_dname_label_count - dname label functions ldns_dname2canonical - canonicalize dname ldns_dname_cat_clone, ldns_dname_cat - concatenate two dnames ldns_dname_new, ldns_dname_new_frm_str, ldns_dname_new_frm_data | ldns_pkt_query_new_frm_str, ldns_rdf_new_frm_str, ldns_rr_new_frm_str - create a dname ldns_dname_is_subdomain, ldns_dname_str_absolute, ldns_dname_label - check properties of dnames ldns_dname_compare, ldns_dname_interval | ldns_dname_is_subdomain - compare two dnames ### /dname.h ### dane.h ldns_dane_create_tlsa_rr, ldns_dane_create_tlsa_owner, ldns_dane_cert2rdf, ldns_dane_select_certificate | ldns_dane_verify, ldns_dane_verify_rr - TLSA RR creation functions ldns_dane_verify, ldns_dane_verify_rr | ldns_dane_create_tlsa_owner, ldns_dane_cert2rdf, ldns_dane_select_certificate, ldns_dane_create_tlsa_rr - TLSA RR verification functions ### /dane.h ### rdata.h ldns_rdf, ldns_rdf_type | ldns_rdf_set_size, ldns_rdf_set_type, ldns_rdf_set_data, ldns_rdf_size, ldns_rdf_get_type, ldns_rdf_data, ldns_rdf_compare, ldns_rdf_new, ldns_rdf_clone, ldns_rdf_new_frm_data, ldns_rdf_new_frm_str, ldns_rdf_new_frm_fp, ldns_rdf_free, ldns_rdf_deep_free, ldns_rdf_print, ldns_native2rdf_int8, ldns_native2rdf_int16, ldns_native2rdf_int32, ldns_native2rdf_int16_data, ldns_rdf2native_int8, ldns_rdf2native_int16, ldns_rdf2native_int32, ldns_rdf2native_sockaddr_storage, ldns_rdf2native_time_t, ldns_native2rdf_int8, ldns_native2rdf_int16, ldns_native2rdf_int32, ldns_native2rdf_int16_data, ldns_rdf2native_int8, ldns_rdf2native_int16, ldns_rdf2native_int32, ldns_rdf2native_sockaddr_storage, ldns_rdf2native_time_t, ldns_native2rdf_int8, ldns_native2rdf_int16, ldns_native2rdf_int32, ldns_native2rdf_int16_data, ldns_rdf2native_int8, ldns_rdf2native_int16, ldns_rdf2native_int32, ldns_rdf2native_sockaddr_storage, ldns_rdf2native_time_t - rdata field type ldns_rdf_set_size, ldns_rdf_set_type, ldns_rdf_set_data | ldns_rdf - set rdf attributes ldns_rdf_size, ldns_rdf_get_type, ldns_rdf_data, ldns_rdf_compare | ldns_rdf - get rdf attributes ldns_rdf_new, ldns_rdf_clone, ldns_rdf_new_frm_data, ldns_rdf_new_frm_str, ldns_rdf_new_frm_fp, ldns_rdf_free, ldns_rdf_deep_free, ldns_rdf_print | ldns_rdf - ldns_rdf creation, destruction and printing ldns_native2rdf_int8, ldns_native2rdf_int16, ldns_native2rdf_int32, ldns_native2rdf_int16_data, ldns_rdf2native_int8, ldns_rdf2native_int16, ldns_rdf2native_int32, ldns_rdf2native_sockaddr_storage, ldns_rdf2native_time_t | ldns_rdf - rdf numeric converion functions ldns_rdf_address_reverse | ldns_rdf - reverse an address rdf ldns_octet | ldns_rdf - removes escaped from the input # why is this in rdata.h? ldns_str2period - converts a ttl value (like 5d2h) to a long ### /rdata.h ### higher.h ldns_get_rr_list_addr_by_name, ldns_get_rr_list_name_by_addr | ldns_rr_list, ldns_rr - get addresses by name or names by address ldns_get_rr_list_hosts_frm_file, ldns_get_rr_list_hosts_frm_fp, ldns_get_rr_list_hosts_frm_fp_l | ldns_rr_list, ldns_rr - parse /etc/hosts file ldns_getaddrinfo - mimic libc getaddrinfo ### /higher.h # ### dnssec.h # # algs ldns_verify_rrsig_dsa, ldns_verify_rrsig_rsasha1, ldns_verify_rrsig_rsamd5 | ldns_key, ldns_sign_public, ldns_zone_sign, ldns_verify, ldns_verify_rrsig - verify signature data buffers # tsig ldns_pkt_tsig_verify, ldns_pkt_tsig_sign | ldns_key - tsig signing and verification # verify ldns_verify, ldns_verify_rrsig, ldns_verify_rrsig_keylist, ldns_verify_rrsig_keylist_notime, ldns_verify_notime | ldns_verify_rrsig_evp | ldns_verify_rrsig_dsa, ldns_verify_rrsig_rsasha1, ldns_verify_rrsig_rsamd5, ldns_sign_public, ldns_zone_sign, ldns_key - verify rrsigs # convert ldns_key_buf2dsa, ldns_key_buf2rsa | ldns_key_rr2ds - convert buffer to openssl key ldns_key_rr2ds | ldns_key - create DS rr from DNSKEY rr ldns_create_nsec | ldns_sign_public - Create a NSEC record # signing ldns_sign_public | ldns_sign_public_dsa, ldns_sign_public_rsamd5, ldns_sign_public_rsasha1, ldns_verify, ldns_verify_rrsig, ldns_key - sign an rrset ldns_sign_public_dsa, ldns_sign_public_rsamd5, ldns_sign_public_rsasha1 | ldns_sign_public - sign buffer ldns_init_random | ldns_sign_public, ldns_key - seed the random function ldns_pkt_verify | ldns_verify, ldns_sign_public, ldns_zone_sign - verify a packet ldns_zone_sign, ldns_zone_sign_nsec3 - dnssec sign a zone # new family of dnssec functions ldns_dnssec_zone, ldns_dnssec_name, ldns_dnssec_rrs, ldns_dnssec_rrsets | ldns_dnssec_zone_new, ldns_dnssec_name_new, ldns_dnssec_rrs_new, ldns_dnssec_rrsets_new - data structures ldns_dnssec_zone_find_rrset, ldns_dnssec_zone_new, ldns_dnssec_zone_free, ldns_dnssec_zone_add_rr, ldns_dnssec_zone_names_print, ldns_dnssec_zone_print, ldns_dnssec_zone_add_empty_nonterminals | ldns_dnssec_zone - functions for ldns_dnssec_zone ldns_dnssec_name_new, ldns_dnssec_name_new_frm_rr, ldns_dnssec_name_free, ldns_dnssec_name_name, ldns_dnssec_name_set_name, ldns_dnssec_name_set_nsec, ldns_dnssec_name_cmp, ldns_dnssec_name_add_rr, ldns_dnssec_name_find_rrset, ldns_dnssec_name_print | ldns_dnssec_zone - functions for ldns_dnssec_name ldns_dnssec_rrsets_new, ldns_dnssec_rrsets_free, ldns_dnssec_rrsets_type, ldns_dnssec_rrsets_set_type, ldns_dnssec_rrsets_add_rr, ldns_dnssec_rrsets_print | ldns_dnssec_zone - functions for ldns_dnssec_rrsets ldns_dnssec_rrs_new, ldns_dnssec_rrs_free, ldns_dnssec_rrs_add_rr, ldns_dnssec_rrs_print | ldns_dnssec_zone - functions for ldns_dnssec-rrs # verification ldns_dnssec_data_chain, ldns_dnssec_data_chain_struct, ldns_dnssec_trust_tree | ldns_dnssec_data_chain_new, ldns_dnssec_trust_tree_new, ldns_dnssec_verify_denial - data structures for validation chains ldns_dnssec_data_chain_new, ldns_dnssec_data_chain_free, ldns_dnssec_data_chain_deep_free, ldns_dnssec_build_data_chain, ldns_dnssec_data_chain_print | ldns_dnssec_data_chain - ldns_chain creation, destruction and printing ldns_dnssec_trust_tree_new, ldns_dnssec_trust_tree_free, ldns_dnssec_trust_tree_depth, ldns_dnssec_derive_trust_tree, ldns_dnssec_trust_tree_contains_keys, ldns_dnssec_trust_tree_print, ldns_dnssec_trust_tree_print_sm, ldns_dnssec_trust_tree_add_parent, ldns_dnssec_derive_trust_tree_normal_rrset, ldns_dnssec_derive_trust_tree_dnskey_rrset, ldns_dnssec_derive_trust_tree_ds_rrset, ldns_dnssec_derive_trust_tree_no_sig | ldns_dnssec_data_chain, ldns_dnssec_trust_tree - functions for ldns_dnssec_trust_tree ldns_dnssec_verify_denial, ldns_dnssec_verify_denial_nsec3 | ldns_dnssec_trust_tree, ldns_dnssec_data_chain - verify denial of existence # new signing functions ldns_dnssec_zone_sign, ldns_dnssec_zone_sign_nsec3, ldns_dnssec_zone_mark_glue, ldns_dnssec_name_node_next_nonglue, ldns_dnssec_zone_create_nsecs, ldns_dnssec_remove_signatures, ldns_dnssec_zone_create_rrsigs | ldns_dnssec_zone - sign ldns_dnssec_zone ### /dnssec.h ### dnskey.h ldns_key_new, ldns_key_new_frm_algorithm, ldns_key_new_frm_fp, ldns_key_new_frm_fp_l, ldns_key_new_frm_fp_rsa, ldns_key_new_frm_fp_rsa_l, ldns_key_new_frm_fp_dsa, ldns_key_new_frm_fp_dsa_l | ldns_key - create a ldns_key ldns_key_list_new - create a ldns_key_list # access, write ldns_key_set_algorithm, ldns_key_set_rsa_key, ldns_key_set_dsa_key, ldns_key_set_hmac_key, ldns_key_set_origttl, ldns_key_set_inception, ldns_key_set_expiration, ldns_key_set_pubkey_owner, ldns_key_set_keytag, ldns_key_set_flags, ldns_key_list_set_key_count, ldns_key_algo_supported | ldns_key_push_key, ldns_key - set ldns_key attributes ldns_key_list_push_key, ldns_key_list_pop_key | ldns_key - manipulate ldns_key_list # access, read ldns_key_list_key_count, ldns_key_list_key, ldns_key_rsa_key, ldns_key_dsa_key, ldns_key_algorithm, ldns_key_hmac_key, ldns_key_origttl, ldns_key_inception, ldns_key_expiration, ldns_key_keytag, ldns_key_pubkey_owner, ldns_key_flags | ldns_key - read ldns_keys # convert ldns_key2rr | ldns_key - convert ldns_key to rr ldns_key_free, ldns_key_deep_free, ldns_key_list_free | ldns_key - free a ldns_key # ldns_key_print | ldns_key_new, ldns_key - print a ldns_key ldns_calc_keytag, ldns_calc_keytag_raw | ldns_key - calculate ldns keytag ldns_key | ldns_key_new, ldns_key_new_frm_algorithm,ldns_key_new_frm_fp,ldns_key_new_frm_fp_l, ldns_key_new_frm_fp_rsa, ldns_key_new_frm_fp_rsa_l, ldns_key_new_frm_fp_dsa, ldns_key_new_frm_fp_dsa_l, ldns_key_list_new, ldns_key_set_algorithm, ldns_key_set_rsa_key, ldns_key_set_dsa_key, ldns_key_set_hmac_key, ldns_key_set_origttl, ldns_key_set_inception, ldns_key_set_expiration, ldns_key_set_pubkey_owner, ldns_key_set_keytag, ldns_key_set_flags, ldns_key_list_set_key_count, ldns_key_list_push_key, ldns_key_list_pop_key, ldns_key_list_key_count, ldns_key_list_key, ldns_key_rsa_key, ldns_key_dsa_key, ldns_key_algorithm, ldns_key_hmac_key, ldns_key_origttl, ldns_key_inception, ldns_key_expiration, ldns_key_keytag, ldns_key_pubkey_owner, ldns_key_flags, ldns_key2rr, ldns_key_free, ldns_key_deep_free, ldns_key_list_free, ldns_key_print - ldns_key data structure ### /dnskey.h ### MIEK TOT HIER TOT HIER # errr.h ldns_get_errorstr_by_id, ldns_status - errors ### net.h ldns_send | ldns_pkt, ldns_resolver - send a packet ldns_tcp_send_query, ldns_tcp_read_wire, ldns_tcp_connect | ldns_send, ldns_pkt, ldns_resolver - tcp queries ### /net.h ### buffer.h # general ldns_buffer, ldns_buffer_new, ldns_buffer_new_frm_data, ldns_buffer_clear, ldns_buffer_printf, ldns_buffer_free, ldns_buffer_copy, ldns_buffer_export, ldns_buffer_export2str, ldns_buffer2str | ldns_buffer_flip, ldns_buffer_rewind, ldns_buffer_position, ldns_buffer_set_position, ldns_buffer_skip, ldns_buffer_limit, ldns_buffer_set_limit, ldns_buffer_capacity, ldns_buffer_set_capacity, ldns_buffer_reserve, ldns_buffer_at, ldns_buffer_begin, ldns_buffer_end, ldns_buffer_current, ldns_buffer_remaining_at, ldns_buffer_remaining, ldns_buffer_available_at, ldns_buffer_available, ldns_buffer_status, ldns_buffer_status_ok, ldns_buffer_write_at, ldns_buffer_write, ldns_buffer_write_string_at, ldns_buffer_write_string, ldns_buffer_write_u8_at, ldns_buffer_write_u8, ldns_buffer_write_u16_at, ldns_buffer_write_u16, ldns_buffer_read_at, ldns_buffer_read, ldns_buffer_read_u8_at, ldns_buffer_read_u8, ldns_buffer_read_u16_at, ldns_buffer_read_u16, ldns_buffer_read_u32_at, ldns_buffer_read_u32, ldns_buffer_write_u32, ldns_buffer_write_u32_at - buffers # position ldns_buffer_flip, ldns_buffer_rewind, ldns_buffer_position, ldns_buffer_set_position, ldns_buffer_skip | ldns_buffer - buffer positioning # values and pointers ldns_buffer_limit, ldns_buffer_set_limit, ldns_buffer_capacity, ldns_buffer_set_capacity, ldns_buffer_reserve, ldns_buffer_at, ldns_buffer_begin, ldns_buffer_end, ldns_buffer_current | ldns_buffer - buffer limits and pointers # info ldns_buffer_remaining_at, ldns_buffer_remaining, ldns_buffer_available_at, ldns_buffer_available, ldns_buffer_status, ldns_buffer_status_ok | ldns_buffer - check buffer status # read and write ldns_buffer_write_at, ldns_buffer_write, ldns_buffer_write_string_at, ldns_buffer_write_string, ldns_buffer_write_u8_at, ldns_buffer_write_u8, ldns_buffer_write_u16_at, ldns_buffer_write_u16, ldns_buffer_read_at, ldns_buffer_read, ldns_buffer_read_u8_at, ldns_buffer_read_u8, ldns_buffer_read_u16_at, ldns_buffer_read_u16, ldns_buffer_read_u32_at, ldns_buffer_read_u32, ldns_buffer_write_u32, ldns_buffer_write_u32_at | ldns_buffer - reading and writing buffers ### /buffer.h # parse.h ldns_bget_token, ldns_bgetc, ldns_bskipcs | ldns_buffer - get tokens from buffers ldns_fget_token, ldns_fskipcs | ldns_buffer - get tokens from files # rr.h and other general rr funcs ldns_rr, ldns_rr_class, ldns_rr_type, ldns_rr_compress, ldns_rr_list | ldns_rr_new, ldns_rr_new_frm_type, ldns_rr_new_frm_str, ldns_rr_new_frm_fp, ldns_rr_free, ldns_rr_print, ldns_rr_set_owner, ldns_rr_set_ttl, ldns_rr_set_type, ldns_rr_set_rd_count, ldns_rr_set_class, ldns_rr_set_rdf, ldns_rr_push_rdf, ldns_rr_pop_rdf, ldns_rr_rdf, ldns_rr_owner, ldns_rr_rd_count, ldns_rr_ttl, ldns_rr_get_class, ldns_rr_list_rr_count, ldns_rr_list_set_rr_count, ldns_rr_list_new, ldns_rr_list_free, ldns_rr_list_cat, ldns_rr_list_push_rr, ldns_rr_list_pop_rr, ldns_is_rrset, ldns_rr_set_push_rr, ldns_rr_set_pop_rr, ldns_get_rr_class_by_name, ldns_get_rr_type_by_name, ldns_rr_list_clone, ldns_rr_list_sort, ldns_rr_compare, ldns_rr_compare_ds, ldns_rr_uncompressed_size, ldns_rr2canonical, ldns_rr_label_count, ldns_is_rrset, ldns_rr_descriptor, ldns_rr_descript - types representing dns resource records ldns_rr_new, ldns_rr_new_frm_type, ldns_rr_new_frm_str, ldns_rr_new_frm_fp, ldns_rr_free, ldns_rr_print | ldns_rr, ldns_rr_list - ldns_rr creation, destruction and printing ldns_rr_set_owner, ldns_rr_set_ttl, ldns_rr_set_type, ldns_rr_set_rd_count, ldns_rr_set_class, ldns_rr_set_rdf | ldns_rr, ldns_rr_list - set ldns_rr attributes ldns_rr_push_rdf, ldns_rr_pop_rdf | ldns_rr, ldns_rr_list - push and pop rdata fields ldns_rr_rdf, ldns_rr_owner, ldns_rr_rd_count, ldns_rr_ttl, ldns_rr_get_class | ldns_rr, ldns_rr_list - access rdata fields on ldns_rr ldns_rr_list_rr_count, ldns_rr_list_set_rr_count | ldns_rr, ldns_rr_list - get and set ldns_rr_list length ldns_rr_list_new, ldns_rr_list_free | ldns_rr, ldns_rr_list - ldns_rr_list creation and destruction ldns_rr_list_cat, ldns_rr_list_push_rr, ldns_rr_list_pop_rr | ldns_rr, ldns_rr_list - ldns_rr_list manipulation ldns_is_rrset | ldns_rr, ldns_rr_list - is rr_list a rrset ldns_rr_set_push_rr, ldns_rr_set_pop_rr | ldns_rr, ldns_rr_list - push and pop rr on a rrset ldns_get_rr_class_by_name, ldns_get_rr_type_by_name | ldns_rr, ldns_rr_list - lookup class or type by name ldns_rr_list_clone | ldns_rr, ldns_rr_list - clone a ldns_rr_list ldns_rr_list_sort | ldns_rr, ldns_rr_list - sort a ldns_rr_list ldns_rr_compare, ldns_rr_compare_ds | ldns_rr, ldns_rr_list - compare a ldns_rr ldns_rr_uncompressed_size | ldns_rr, ldns_rr_list - calculates the uncompressed size of an RR ldns_rr2canonical | ldns_rr, ldns_rr_list - canonicalize a RR ldns_rr_label_count | ldns_rr, ldns_rr_list - return ownername label count # rr descriptors ldns_rr_descriptor, ldns_rr_descript, ldns_rr_descriptor_minimum, ldns_rr_descriptor_maximum, ldns_rr_descriptor_field_type | ldns_rr, ldns_rdf - rdata field descriptors # packet.h ldns_pkt, ldns_pkt_section, ldns_pkt_type | ldns_pkt_new, ldns_pkt_free, ldns_pkt_print, ldns_pkt_query_new, ldns_pkt_query_new_frm_str, ldns_pkt_reply_type, ldns_pkt_id, ldns_pkt_qr, ldns_pkt_aa, ldns_pkt_tc, ldns_pkt_rd, ldns_pkt_cd, ldns_pkt_ra, ldns_pkt_ad, ldns_pkt_get_opcode, ldns_pkt_get_rcode, ldns_pkt_qdcount, ldns_pkt_ancount, ldns_pkt_nscount, ldns_pkt_arcount, ldns_pkt_answerfrom, ldns_pkt_querytime, ldns_pkt_size, ldns_pkt_tsig, ldns_pkt_question, ldns_pkt_answer, ldns_pkt_authority, ldns_pkt_additional, ldns_pkt_get_section_clone, ldns_pkt_rr_list_by_name, ldns_pkt_rr_list_by_type, ldns_pkt_rr_list_by_name_and_type, ldns_pkt_set_flags, ldns_pkt_set_id, ldns_pkt_set_qr, ldns_pkt_set_aa, ldns_pkt_set_tc, ldns_pkt_set_rd, ldns_pkt_set_cd, ldns_pkt_set_ra, ldns_pkt_set_ad, ldns_pkt_set_opcode, ldns_pkt_set_rcode, ldns_pkt_set_qdcount, ldns_pkt_set_ancount, ldns_pkt_set_nscount, ldns_pkt_set_arcount, ldns_pkt_set_answerfrom, ldns_pkt_set_querytime, ldns_pkt_set_size, ldns_pkt_set_section_count, ldns_pkt_set_tsig, ldns_pkt_edns, ldns_pkt_edns_udp_size, ldns_pkt_edns_extended_rcode, ldns_pkt_edns_version, ldns_pkt_edns_z, ldns_pkt_edns_data, ldns_pkt_set_edns_udp_size, ldns_pkt_set_edns_extended_rcode, ldns_pkt_set_edns_version, ldns_pkt_set_edns_z, ldns_pkt_set_edns_data - request or anser packets types ldns_pkt_new, ldns_pkt_free, ldns_pkt_print, ldns_pkt_query_new, ldns_pkt_query_new_frm_str, ldns_pkt_reply_type | ldns_pkt - ldns_pkt creation, destruction and printing # gets ldns_pkt_id, ldns_pkt_qr, ldns_pkt_aa, ldns_pkt_tc, ldns_pkt_rd, ldns_pkt_cd, ldns_pkt_ra, ldns_pkt_ad, ldns_pkt_get_opcode, ldns_pkt_get_rcode, ldns_pkt_qdcount, ldns_pkt_ancount, ldns_pkt_nscount, ldns_pkt_arcount, ldns_pkt_answerfrom, ldns_pkt_querytime, ldns_pkt_size, ldns_pkt_tsig, ldns_pkt_question, ldns_pkt_answer, ldns_pkt_authority, ldns_pkt_additional, ldns_pkt_get_section_clone, ldns_pkt_rr_list_by_name, ldns_pkt_rr_list_by_type, ldns_pkt_rr_list_by_name_and_type | ldns_pkt - get ldns_pkt attributes # sets ldns_pkt_set_flags, ldns_pkt_set_id, ldns_pkt_set_qr, ldns_pkt_set_aa, ldns_pkt_set_tc, ldns_pkt_set_rd, ldns_pkt_set_cd, ldns_pkt_set_ra, ldns_pkt_set_ad, ldns_pkt_set_opcode, ldns_pkt_set_rcode, ldns_pkt_set_qdcount, ldns_pkt_set_ancount, ldns_pkt_set_nscount, ldns_pkt_set_arcount, ldns_pkt_set_answerfrom, ldns_pkt_set_querytime, ldns_pkt_set_size, ldns_pkt_set_section_count, ldns_pkt_set_tsig | ldns_pkt - set ldns_pkt attributes # EDNS0 ldns_pkt_edns, ldns_pkt_edns_udp_size, ldns_pkt_edns_extended_rcode, ldns_pkt_edns_version, ldns_pkt_edns_z, ldns_pkt_edns_data, ldns_pkt_set_edns_udp_size, ldns_pkt_set_edns_extended_rcode, ldns_pkt_set_edns_version, ldns_pkt_set_edns_z, ldns_pkt_set_edns_data | ldns_pkt - ldns_pkt ends0 related functions # rr_functions.h ldns_rr_ns_nsdname - get dname rdata field from NS RR # ldns_rr_mx_preference, ldns_rr_mx_exchange - get MX RR rdata fields # ldns_rr_rrsig_typecovered, ldns_rr_rrsig_set_typecovered, ldns_rr_rrsig_algorithm, ldns_rr_rrsig_set_algorithm, ldns_rr_rrsig_labels, ldns_rr_rrsig_set_labels, ldns_rr_rrsig_origttl, ldns_rr_rrsig_set_origttl, ldns_rr_rrsig_expiration, ldns_rr_rrsig_set_expiration, ldns_rr_rrsig_inception, ldns_rr_rrsig_set_inception, ldns_rr_rrsig_keytag, ldns_rr_rrsig_set_keytag, ldns_rr_rrsig_signame, ldns_rr_rrsig_set_signame, ldns_rr_rrsig_sig, ldns_rr_rrsig_set_sig - get and set RRSIG RR rdata fields # ldns_rr_dnskey_flags, ldns_rr_dnskey_set_flags, ldns_rr_dnskey_protocol, ldns_rr_dnskey_set_protocol, ldns_rr_dnskey_algorithm, ldns_rr_dnskey_set_algorithm, ldns_rr_dnskey_key, ldns_rr_dnskey_set_key | ldns_rr - get and set DNSKEY RR rdata fields ### zone.h ldns_zone, ldns_zone_new, ldns_zone_free, ldns_zone_deep_free, ldns_zone_new_frm_fp, ldns_zone_new_frm_fp_l, ldns_zone_print, ldns_zone_print_fmt - ldns_zone creation, destruction and printing ldns_zone_sort, ldns_zone_glue_rr_list | ldns_zone - sort a zone and get the glue records ldns_zone_push_rr, ldns_zone_push_rr_list | ldns_zone - add rr's to a ldns_zone ldns_zone_set_rrs, ldns_zone_set_soa | ldns_zone, ldns_zone_rrs, ldns_zone_soa - ldns_zone set content ldns_zone_rrs, ldns_zone_soa | ldns_zone ldns_zone_set_rrs - ldns_zone get content ldns_zone_rr_count | ldns_zone - get ldns_zone size ### update.h ldns_update_pkt_new | ldns_update_pkt_tsig_add, ldns_update_pkt_tsig_add, ldns_update_zocount, ldns_update_prcount, ldns_update_upcount, ldns_update_adcount, ldns_update_set_zocount, ldns_update_set_prcount, ldns_update_set_upcount, ldns_update_set_adcount - create an update packet ldns_update_pkt_tsig_add | ldns_update_pkt_new - add resolver's tsig credentials to an ldns_pkt ldns_update_zocount, ldns_update_prcount, ldns_update_upcount, ldns_update_adcount | ldns_update_pkt_new - return update packet counters ldns_update_set_zocount, ldns_update_set_prcount, ldns_update_set_upcount, ldns_update_set_adcount | ldns_update_pkt_new - set the update packet counters ### keys.h ldns_algorithm - numbers assigned to algorithms used in dns ldns_axfr_start, ldns_axfr_next, ldns_axfr_abort, ldns_axfr_complete, ldns_axfr_last_pkt - functions for full zone transfer ldns_b32_ntop_calculate_size, ldns_b32_pton_calculate_size, ldns_b64_ntop_calculate_size, ldns_b64_pton_calculate_size - return size needed for b32 or b64 encoded or decoded data ldns_duration_type, ldns_duration_create, ldns_duration_create_from_string, ldns_duration_cleanup, ldns_duration_compare, ldns_duration2string, ldns_duration2time - duration type and related functions ldns_bubblebabble - encode data as BubbleBabble ldns_version - return library version ldns-1.7.0/doc/doxyparse.pl0000755000175000017500000002026213026206166015152 0ustar willemwillem#!/usr/bin/env perl # Doxygen is useful for html documentation, but sucks # in making manual pages. Still tool also parses the .h # files with the doxygen documentation and creates # the man page we want # # 2 way process # 1. All the .h files are processed to create in file in which: # filename | API | description | return values # are documented # 2. Another file is parsed which states which function should # be grouped together in which manpage. Symlinks are also created. # # With this all in place, all documentation should be autogenerated # from the doxydoc. use Getopt::Std; my $state; my $description; my $struct_description; my $key; my $return; my $param; my $api; my $const; my %description; my %api; my %return; my %options; my %manpages; my %see_also; my $BASE="doc/man"; my $MAN_SECTION = "3"; my $MAN_HEADER = ".ad l\n.TH ldns $MAN_SECTION \"30 May 2006\"\n"; my $MAN_MIDDLE = ".SH AUTHOR The ldns team at NLnet Labs. Which consists out of Jelte Jansen and Miek Gieben. .SH REPORTING BUGS Please report bugs to ldns-team\@nlnetlabs.nl or in our bugzilla at http://www.nlnetlabs.nl/bugs/index.html .SH COPYRIGHT Copyright (c) 2004 - 2006 NLnet Labs. .PP Licensed under the BSD License. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. "; my $MAN_FOOTER = ".SH REMARKS This manpage was automatically generated from the ldns source code by use of Doxygen and some perl. "; getopts("em:",\%options); # if -m manpage file is given process that file # parse the file which tells us what manpages go together my $functions, $see_also, $shorts; my $i = 0; my $report_errors = defined $options{'e'}; my $errors = 0; my %unique; if (defined $options{'m'}) { # process open(MAN, "<$options{'m'}") or die "Cannot open $options{'m'}"; # it's line based: # func1, func2, .. | see_also1, see_also2, ... while() { chomp; $i += 1; if (/^#/) { next; } if (/^$/) { next; } my @parts = split /[\t ]*\|[\t ]*/, $_; $functions = shift @parts; @parts = split /[\t ]*-[\t ]*/, join ', ', @parts; $see_also = shift @parts; if (! $see_also) { @parts = split /[\t ]*-[\t ]*/, $_; $functions = shift @parts; } #print "{$functions}\n"; #print "{$see_also}\n"; my @funcs = split /[\t ]*,[\t ]*/, $functions; my @also = split /[\t ]*,[\t ]*/, $see_also; $manpages{$funcs[0]} = \@funcs; $see_also{$funcs[0]} = \@also; $shorts{$funcs[0]} = join '', @parts; foreach (@funcs) { if ($unique{$_}) { push @{$unique{$_}}, ($i,); } else { $unique{$_} = [$i]; } } #print "[", $funcs[0], "]\n"; } close(MAN); while (($func, $lines) = each %unique ) { if (scalar @$lines > 1) { print STDERR "$func in function_manpages on lines: " . join(", ",@$lines) . "\n" if $report_errors; $errors += 1; } } } else { print "Need -m file to process the .h files\n"; exit 1; } # 0 - somewhere in the file # 1 - in a doxygen par # 2 - after doxygen, expect function # create our pwd mkdir "doc"; mkdir "doc/man"; mkdir "doc/man/man$MAN_SECTION"; $state = 0; $i = 0; my @lines = ; my $max = @lines; while($i < $max) { $typedef = ""; if ($lines[$i] =~ /^typedef struct/ and $lines[$i + 1] =~ /^struct/) { # move typedef to below struct $typedef = $lines[$i]; $j = $i; while ($lines[$j] !~ /}/) { $lines[$j] = $lines[$j+1]; $j++; } $lines[$j] = $lines[$j+1]; $lines[$j + 1] = $typedef; } $cur_line = $lines[$i]; chomp($cur_line); if ($cur_line =~ /^\/\*\*[\t ]*$/) { # /** Seen #print "Comment seen! [$cur_line]\n"; $state = 1; undef $description; undef $struct_description; $i++; next; } if ($cur_line =~ /\*\// and $state == 1) { #print "END Comment seen!\n"; if ($description =~ /^\\\\file/mg) { # Doxygen text for the file, do not expect # a function coming. # $state = 0; } else { $state = 2; } $i++; next; } if ($state == 1) { # inside doxygen $cur_line =~ s/\\/\\\\/g; $cur_line =~ s/^[ \t]*\* ?//; $description = $description . "\n" . $cur_line; #$description = $description . "\n.br\n" . $cur_line; } if ($state == 2 and $cur_line =~ /const/) { # the const word exists in the function call #$const = "const"; #s/[\t ]*const[\t ]*//; } else { #undef $const; } if ($cur_line =~ /^INLINE/) { $cur_line =~ s/^INLINE\s*//; while ($cur_line !~ /{/) { $i++; $cur_line .= " ".$lines[$i]; $cur_line =~ s/\n//; } $cur_line =~ s/{/;/; } if ($cur_line =~ /^[^#*\/ ]([\w\*]+)[\t ]+(.*?)[({](.*)\s*/ and $state == 2) { while ($cur_line !~ /\)\s*;/) { $i++; $cur_line .= $lines[$i]; chomp($cur_line); $cur_line =~ s/\n/ /g; $cur_line =~ s/\s\s*/ /g; } $cur_line =~ /([\w\* ]+)[\t ]+(.*?)\((.*)\)\s*;/; # this should also end the current comment parsing $return = $1; $key = $2; $api = $3; # sometimes the * is stuck to the function # name instead to the return type if ($key =~ /^\*/) { #print"Name starts with *\n"; $key =~ s/^\*//; if (defined($const)) { $return = $const . " " . $return . '*'; } else { $return = $return . '*'; } } $description =~ s/\\param\[in\][ \t]*([\*\w]+)[ \t]+/.br\n\\fB$1\\fR: /g; $description =~ s/\\param\[out\][ \t]*([\*\w]+)[ \t]+/.br\n\\fB$1\\fR: /g; $description =~ s/\\return[ \t]*/.br\nReturns /g; # Delete leading spaces to prevent manpages to be ascii format- # ted and enable justification of text. # $description =~ s/^[ \t]*//mg; # Prevent hyphening of all caps and underscore words $description =~ s/\b([A-Z_]+)\b/\\%$1/g; $description{$key} = $description; $api{$key} = $api; $return{$key} = $return; undef $description; undef $struct_description; $state = 0; } elsif ($state == 2 and ( $cur_line =~ /^typedef\sstruct\s(\w+)\s(\w+);/ or $cur_line =~ /^typedef\senum\s(\w+)\s(\w+);/)) { $struct_description .= "\n.br\n" . $cur_line; $key = $2; $struct_description =~ s/\/\*\*\s*(.*?)\s*\*\//\\fB$1:\\fR/g; $description{$key} = $struct_description; $api{$key} = "struct"; $return{$key} = $1; undef $description; undef $struct_description; $state = 0; } else { $struct_description .= "\n.br\n" . $cur_line; } $i++; } # create the manpages foreach (keys %manpages) { $name = $manpages{$_}; $also = $see_also{$_}; my $shrt = $shorts{$_}; $filename = @$name[0]; $filename = "$BASE/man$MAN_SECTION/$filename.$MAN_SECTION"; my $symlink_file = @$name[0] . "." . $MAN_SECTION; # print STDOUT $filename,"\n"; open (MAN, ">$filename") or die "Can not open $filename"; print MAN $MAN_HEADER; print MAN ".SH NAME\n"; print MAN join ", ", @$name; if ($shrt) { print MAN " \\- $shrt"; } print MAN "\n\n"; print MAN ".SH SYNOPSIS\n"; print MAN "#include \n.br\n"; print MAN "#include \n.br\n"; print MAN ".PP\n"; print MAN "#include \n"; print MAN ".PP\n"; foreach (@$name) { $b = $return{$_}; $b =~ s/\s+$//; if ($api{$_} ne "struct") { print MAN $b, " ", $_; print MAN "(", $api{$_},");\n"; print MAN ".PP\n"; } } print MAN "\n.SH DESCRIPTION\n"; foreach (@$name) { print MAN ".HP\n"; print MAN "\\fI", $_, "\\fR"; if ($api{$_} ne "struct") { print MAN "()"; } # print MAN ".br\n"; print MAN $description{$_}; print MAN "\n.PP\n"; } print MAN $MAN_MIDDLE; if (@$also) { print MAN "\n.SH SEE ALSO\n\\fI"; print MAN join "\\fR, \\fI", @$also; print MAN "\\fR.\nAnd "; print MAN "\\fBperldoc Net::DNS\\fR, \\fBRFC1034\\fR, \\fBRFC1035\\fR, \\fBRFC4033\\fR, \\fBRFC4034\\fR and \\fBRFC4035\\fR.\n"; } else { print MAN ".SH SEE ALSO \\fBperldoc Net::DNS\\fR, \\fBRFC1034\\fR, \\fBRFC1035\\fR, \\fBRFC4033\\fR, \\fBRFC4034\\fR and \\fBRFC4035\\fR.\n"; } print MAN $MAN_FOOTER; # create symlinks chdir("$BASE/man$MAN_SECTION"); foreach (@$name) { print STDOUT $_,"\n"; my $new_file = $_ . "." . $MAN_SECTION; if ($new_file eq $symlink_file) { next; } #print STDOUT "\t", $new_file, " -> ", $symlink_file, "\n"; symlink $symlink_file, $new_file; } chdir("../../.."); # and back, tricky and fragile... close(MAN); } foreach (keys %api) { next if (/ / || /^$/); if (not $unique{$_}) { print STDERR "no man page for $_\n" if $report_errors; #$errors += 1; } } exit ($report_errors and $errors != 0); ldns-1.7.0/doc/dns-lib-implementations0000644000175000017500000000414113026206166017253 0ustar willemwillemhttp://www.posadis.org/projects/poslib.php Poslib DNS library - Default branch http://www.posadis.org/poslib?DokuWiki=2b00f9da090fb9d4ad3d6e98b9c2f61f Poslib is the C++ library for applications using the Domain Name System that is used by all Posadis tools, including the Posadis DNS server and the Zoneedit and Dnsquery tools. It consists of a library for creating client applications using DNS, and a server library for DNS servers. FireDNS Library http://firestuff.org/projects/firedns FireDNS Library --------------- (c) 2002 Ian Gulliver under the GNU Public License, Version 2. See GPL for more details. From libfiredns(3): libfiredns is a library for handling asynchronous DNS requests. It provides a very simple interface for sending requests and parsing reponses, as well as low-timeout blocking functions. libfiredns functions have much lower timeouts than the stock functions and tend to be faster because they send requests to all configured system nameservers at the same time. If you have questions or comments, you can reach me at ian@penguinhosting.net. skadns Skadns is Kind of an Asynchronous DNS client software. * Kind of: it's small. Really small. But it just works. * Asynchronous: all DNS operations are non-blocking. * DNS client software: it's a DNS client, what you may know as a "stub resolver". To perform full DNS resolution, you will still need a full resolver like dnscache. Similar work * ares is an asynchronous DNS resolver library with a nice interface * and more configuration options than skadns (and a very reasonable * size). Use it if you find that skadns lacks configurability (you * shouldn't need more than it provides, but well, you're the user). * Yet it doesn't hide the DNS internals as opaquely as skadns does, * giving you a bunch of fds to select() on instead of just one. * adns works fine, and is small for a GNU project. Impressive. But * the interface is still too complex and much too generic - the * usual problems with GNU software. ADNS; documentation scares - is it still active simular aims - different ways ldns-1.7.0/doc/TODO0000644000175000017500000000076113026206166013266 0ustar willemwillemTODO Features: * Drill: print appropriate DS RRs (relates to Bug #355) * ldns-signzone optout to be really optout * Compression when generating wireformat. Preferably with a configurable policy: refer only backwards, case sensitivity, only refer to other owner names, etc. Bugfixes: * Bug #279: fix return values for net.h functions, and related: make return values for functions that cannot return memory-failure today. Needs medium version increase because of API change. * Lazy ABI ldns-1.7.0/doc/CodingStyle0000644000175000017500000000427613026206166014752 0ustar willemwillemThe libdns coding style guide * Use of tabs (real tabs, 8 positions long) * Spaces only after comma's, and in between operators. And after keywords (if, while, for) * Underscores to make long names readable * prefix (exported) identifiers with 'ldns_' * no unneeded parentheses after 'return' * always curly brackets in if-statements * use defines for (weird) constants, and masks * type 'bool', constants 'true'/'false'. Don't compare bools for equality. * always use LDNS_MALLOC/FREE etc, or the new/free/deep_free functions * buffer can scale, so don't alloc the max size, but the min size * make lint (uses splint) is your friend * Return values: - status code (structure to fill is usually passed as a first argument) - new/pointer: return pointer or NULL on error - 'read' functions: ldns_status wire2thing(uint8_t *p, size_t max, size_t pos, *thing); - void functions like ldns_rr_free - bool functions * Parameter sequence: (dest, [dest_meta, ] src, [src_meta] etc) * structure/union field names start with _ when "private" * enum for rcode, opcode, types etc, example: enum ldns_rcode { LDNS_RCODE_OK = 0, ... = ., LDNS_RCODE_FIRST = LDNS_RCODE_OK, LDNS_RCODE_LAST = 15, LDNS_RCODE_COUNT = LDNS_RCODE_LAST + 1 } * Everything by reference, all data structures an optional _clone() function * arrays: ps[] with size_t p_count for the number of elements * _size for size in bytes * _free and _clone copies perform deep free/copy. * Standard abbreviations, don't abbreviate other names: id = identity rr = resource record rrset = resource record set rdata = resource data rdf = resource data field rcode = result code qr = query/resource bit aa = authoritative answer tc = truncated rd = recursion disabled cd = checking disabled ra = recursion available ad = authentic data qdcount = question section count ancount = answer section count nscount = authority section count arcount = additional section count ldns- * use exit(EXIT_FAILURE)/ exit(SUCCES) * ldns-1.7.0/doc/design.dox0000644000175000017500000001041713026206166014562 0ustar willemwillem/** \page design Design The following image shows the various modules of libdns and their functionality. \image html libdnsoverview.png \section central_structures Central structures - \ref ldns_pkt A DNS Packet, which can contain a query, answers, and additional information. - \ref ldns_rr A Resource Record, which holds a bit of information about a specific domain name. - \ref ldns_rdf An RDATA field, every Resource Record contains one or more RDATA fields, depending on the type of RR. These are the 'basic types' of DNS data. - \ref ldns_rr_list A list of resource records - \ref ldns_zone A representation of a DNS Zone. The actual structure definitions are named \c ldns_struct_ which are all typedeffed to \c ldns_ A DNS Resource record looks like this:
nlnetlabs.nl.   600     IN      MX             10    open.nlnetlabs.nl.
 \              \       \       \              \                     /
  owner          ttl     class   type           \        rdf[]      /
  (rdf)     (uint32_t) (rr_class) (rr_type)
                                                 10          := rdf[0]
                                                 open.nlnetlabs.nl. := rdf[1]
* Owner: The owner name is put in an \c ldns_rdf structure, which is a normal rdata field but always has the type LDNS_RDF_TYPE_DNAME. An \ref ldns_rdf structure has 3 members; the size, the type of rdata and a void * pointer to the data. The data is always in uncompressed wireformat. The RSH (rdata) is put in an array of rdf's (in this case 2). The entire resource record is put in a RR structure, which has the fields described above (under the RR): - owner (nlnetlabs.nl.) - ttl (600) - class (LDNS_RR_CLASS_IN: 'IN') - type (LDNS_RR_TYPE_MX: 'MX') - rd_count (2) - rdata_fields[rd_count] - rdf[0] (10) - rdf[1] (open.nlnetlabs.nl.) * RR list structure: An RR list structure is simply a structure with a counter and an array of RR structures. Different kinds of RR's can be grouped together this way. * RRset structure: An RRset structure is an RR list structure, but its accessor function checks if the \c ldns_rr structures in there are: - from the same type - have the same TTL - have the same ownername This is the RFC definition of an RRset. * pkt structure: A pkt structure consists out of a header structure where packet specific flags are kept, TC, RD, IP from the server which sent the packet, etc. Further more it is divided in 4 sections: question, authority, answer and additional. All four sections have the type RRlist that simply hold a list of RR's \section wire_module Wire module and central structures Interface As the WIRE module takes care of the compression/decompression it needs a buffer which holds all the binary DNS data. All functions will operate on such a buffer to extract specific information which is then stored in RR structures. \section resolver_module Resolver module and central structures Interface The resolver module always returns a pkt structure. Either with the answer or a SERVFAIL pkt. The exact function-call parameters have not yet been decided on. Also the resolver module will need to access some of the to_wire and from_wire function to creates ldn_pkt's from the data it receives (arrow not drawn). \section str_module str module and central structures Interface Convert to and from strings. This module could be used to read in a zone file (list of RRs) and convert the text strings to the format used by ldns. Or the other way around. \section net_module Net module and resolver module interface The resolver module will get a packet and will mold it so that it can be sent off to a nameserver. It might need to interface with the wire module (arrow not drawn). \section Net module and OS/libc interface OS/network calls will be used here. The Net module is the only part of the library where the underlying OS matters. \section Client program ldns interface Any client program will have access to - Wire module - Central structures - Resolver module - str module (arrow not drawn in the above figure) \section dnssec_module DNSSEC module The DNSSEC types are handled in the RR module, but the crypto routines are contained in this module. This module will depend on OpenSSL for the crypto routines. */ ldns-1.7.0/doc/API.xml0000644000175000017500000003321013026206166013724 0ustar willemwillem LibDNS API NLnet Labs
Kruislaan 419 Amsterdam 1098 VA The Netherlands miek@nlnetlabs.nl http://www.nlnetlabs.nl
NLnet Labs
Kruislaan 419 Amsterdam 1098 VA The Netherlands jelte@nlnetlabs.nl http://www.nlnetlabs.nl
NLnet Labs
Kruislaan 419 Amsterdam 1098 VA The Netherlands erik@nlnetlabs.nl http://www.nlnetlabs.nl
DNS Elite Hacking A small abstract will come here, TBD.
LibDNS (or lDNS) is modelled after the Net::DNS perl library. It has been shown that Net::DNS can be used vefficiently for programming DNS aware applications. We want to bring the same level of efficiency to C programmers. The lDNS API consist of two layers. The top-layer, this is what is actually exported to the application via the library. And the bottom-layer, this is what lDNS needs to compile and function.
Short intermezzo detailing differences with other libraries. Most important ones are the libc resolver interface (from BIND8) and the lwres_ interface from BIND9.
At its lowest level lDNS is only dependent on libc. It uses a few networking systems calls; socket, bind, send/recv and friends. Further more it is to be expected that lDNS will depend on OpenSSL for its cryptography. As said, lDNS is modelled after Net::DNS, therefor its application API looks very much like the one used for Net::DNS. Some modification are made ofcourse, because not all functionality of Perl can be caught in C. This API document was written by carefully looking at the documentation contained in the Net::DNS Perl module.
The rdf structure, the RData Field, is a type that contains the different types in the rdata of an RR. Consider the following example: example.com. IN MX 10 mx.example.com. The "10 mx.example.com." is the rdata in this case. It consists of two fields, "10" and "mx.example.com". These have the types (in this case) LDNS_RDF_TYPE_INT8 and LDNS_RDF_TYPE_DNAME. The following functions operate on this structure. Create a new rdf structure. Return a pointer to it. Get the size of a rdf structure. Set the size of a rdf structure. Set the type of a rdf structure. Get the type of a rdf structure. Set the (binary/network order) data of a rdf structure. Get a pointer to the data in a rdf structure. Free a rdf structure. Create a new rdf structure from a string and a specific rdf_type. The type is needed to perform the correct conversion.
These functions operate on ldns_rr structures. Returns a pointer to the newly created ldns_rr structure. Prints the record to the stream s. Returns a pointer to a ldns_buffer containing with string containing RR-specific data. Returns the record's owner name as a ldns_rdf type. Returns the record's type. Returns the record's class. Returns the record's time-to-live (TTL). TODO the 'set' functions of the 'get'
In the DNS the atomic data type is an RRset. This is a list of RRs with the same ownername, type and class. Net::DNS doesn't have rrsets as a separate object. In lDNS we have the ldns_rr_list, which just holds a bunch of RR's. No specific check are made on the RRs that can be put in such a list. Special wrapper functions exist which allow the usage of ldns_rr_list of real (RFC compliant) RR sets. TODO: See rr.c
Create a new resolver structure and return the pointer to that. Returns the version of lDNS. Returns a ldns_pkt representing the MX records for the specified dname. Function is documented differently in Net::DNS. Do we need stuff like this?? XXX Set the default domain for this resolver. This domain is added when a query is made with a name without a trailing dot. Add a new nameserver to the resolver. These nameservers are queried when a search() or query() is done. Add a domain to the searchlist of a resolver. Perform a query. Try all the nameservers in the *res structure. Apply the search list. And default domain. If type is NULL it defaults to 'A', If class is NULL it default to 'IN'. Perform a query. Only the default domain is added. If type is NULL it defaults to 'A', If class is NULL it default to 'IN'. No search list nor default domain is applied. Return a pointer to a ldns_pkt structure with the information from the nameserver. If type is NULL it defaults to 'A', If class is NULL it default to 'IN'. TODO XX Gazillion helper functions to set port, src-port, etc. etc.
A packet structure (ldns_pkt) has five sections: The header section, a ldns_hdr structure. The question section, a ldns_rr_list structure. The answer section, a ldns_rr_list structure. The authority section, a ldns_rr_list structure. The additional section, a ldns_rr_list structure. ldns_hdr represents the header section of a DNS packet. A list of RRs in the Question section of a DNS packet. A list of RRs in the Question section of a DNS packet. A list of RRs in the Question section of a DNS packet. A list of RRs in the Question section of a DNS packet. Creates a new empty packet. Returns the packet data in binary format, suitable for sending to a nameserver. [XXX, suitable for sending to a NS?] Returns a ldns_hdr structure representing the header section of the packet. Returns a pointer to a ldns_rr_list representing the question section of the packet. Returns a pointer to a ldns_rr_list representing the answer section of the packet. Returns a pointer to a ldns_rr_list representing the authority section of the packet. Returns a pointer to a ldns_rr_list of representing the additional section of the packet. Prints the packet data on the standard output in an ASCII format similar to that used in DNS zone files. See RFC1035. Returns a ldns_buffer containing the string representation of the packet. Returns the IP address from which we received this packet. User-created packets will return NULL. Returns the size of the packet in bytes as it was received from a nameserver. User-created packets will return 0. [XXX user-created??] Adds *rr to the specified section of the packet. Return LDNS_STATUS_OK on success, LDNS_STATUS_ERR otherwise. Adds *rr to the specified section of the packet provided that the RR does not already exist in the packet. Return LDNS_STATUS_OK on success, LDNS_STATUS_ERR otherwise. Removes a RR from the specified section of the packet. Returns NULL if no RR's could be popped. Retrieve all RRs in a packet matching certain criteria. XXX function needs to be specified better. Print packet p to stream s.
Some resource records can have special access function no other RR has. Those are detailed here. XXX TODO don't exist (yet?).
insert your long list here.
A small example, which queries a nameserver on localhost to diplay the MX records for miek.nl.
/** * An example ldns program * In semi-C code * * Setup a resolver * Query a nameserver * Print the result */ #include <ldns.h> int main(void) { ldns_resolver *res; ldns_rdf *default_dom; ldns_rdf *nameserver; ldns_rdf *qname; ldns_pkt *pkt; /* init */ res = ldns_resolver_new(); if (!res) return 1; /* create a default domain and add it */ default_dom = ldns_rdf_new_frm_str("miek.nl.", LDNS_RDF_TYPE_DNAME); nameserver = ldns_rdf_new_frm_str("127.0.0.1", LDNS_RDF_TYPE_A); if (ldns_resolver_domain(res, default_dom) != LDNS_STATUS_OK) return 1; if (ldns_resolver_nameserver_push(res, nameserver) != LDNS_STATUS_OK) return 1; /* setup the question */ qname = ldns_rdf_new_frm_str("www", LDNS_RDF_TYPE_DNAME); /* fire it off. "miek.nl." will be added */ pkt = ldns_resolver_query(res, qname, LDNS_RR_TYPE_MX, NULL); /* print the resulting pkt to stdout */ ldns_pkt_print(stdout, pkt); return 0; }
ldns-1.7.0/error.c0000644000175000017500000002304113026206166013322 0ustar willemwillem/* * a error2str function to make sense of all the * error codes we have laying ardoun * * a Net::DNS like library for C * LibDNS Team @ NLnet Labs * (c) NLnet Labs, 2005-2006 * See the file LICENSE for the license */ #include #include ldns_lookup_table ldns_error_str[] = { { LDNS_STATUS_OK, "All OK" }, { LDNS_STATUS_EMPTY_LABEL, "Empty label" }, { LDNS_STATUS_LABEL_OVERFLOW, "Label length overflow" }, { LDNS_STATUS_DOMAINNAME_OVERFLOW, "Domainname length overflow" }, { LDNS_STATUS_DOMAINNAME_UNDERFLOW, "Domainname length underflow (zero length)" }, { LDNS_STATUS_DDD_OVERFLOW, "\\DDD sequence overflow (>255)" }, { LDNS_STATUS_PACKET_OVERFLOW, "Packet size overflow" }, { LDNS_STATUS_INVALID_POINTER, "Invalid compression pointer" }, { LDNS_STATUS_MEM_ERR, "General memory error" }, { LDNS_STATUS_INTERNAL_ERR, "Internal error, this should not happen" }, { LDNS_STATUS_SSL_ERR, "Error in SSL library" }, { LDNS_STATUS_ERR, "General LDNS error" }, { LDNS_STATUS_INVALID_INT, "Conversion error, integer expected" }, { LDNS_STATUS_INVALID_IP4, "Conversion error, ip4 addr expected" }, { LDNS_STATUS_INVALID_IP6, "Conversion error, ip6 addr expected" }, { LDNS_STATUS_INVALID_STR, "Conversion error, string expected" }, { LDNS_STATUS_INVALID_B32_EXT, "Conversion error, b32 ext encoding expected" }, { LDNS_STATUS_INVALID_B64, "Conversion error, b64 encoding expected" }, { LDNS_STATUS_INVALID_HEX, "Conversion error, hex encoding expected" }, { LDNS_STATUS_INVALID_TIME, "Conversion error, time encoding expected" }, { LDNS_STATUS_NETWORK_ERR, "Could not send or receive, because of network error" }, { LDNS_STATUS_ADDRESS_ERR, "Could not start AXFR, because of address error" }, { LDNS_STATUS_FILE_ERR, "Could not open the files" }, { LDNS_STATUS_UNKNOWN_INET, "Uknown address family" }, { LDNS_STATUS_NOT_IMPL, "This function is not implemented (yet), please notify the developers - or not..." }, { LDNS_STATUS_NULL, "Supplied value pointer null" }, { LDNS_STATUS_CRYPTO_UNKNOWN_ALGO, "Unknown cryptographic algorithm" }, { LDNS_STATUS_CRYPTO_ALGO_NOT_IMPL, "Cryptographic algorithm not implemented" }, { LDNS_STATUS_CRYPTO_NO_RRSIG, "No DNSSEC signature(s)" }, { LDNS_STATUS_CRYPTO_NO_DNSKEY, "No DNSSEC public key(s)" }, { LDNS_STATUS_CRYPTO_TYPE_COVERED_ERR, "The signature does not cover this RRset" }, { LDNS_STATUS_CRYPTO_NO_TRUSTED_DNSKEY, "No signatures found for trusted DNSSEC public key(s)" }, { LDNS_STATUS_CRYPTO_NO_DS, "No DS record(s)" }, { LDNS_STATUS_CRYPTO_NO_TRUSTED_DS, "Could not validate DS record(s)" }, { LDNS_STATUS_CRYPTO_NO_MATCHING_KEYTAG_DNSKEY, "No keys with the keytag and algorithm from the RRSIG found" }, { LDNS_STATUS_CRYPTO_VALIDATED, "Valid DNSSEC signature" }, { LDNS_STATUS_CRYPTO_BOGUS, "Bogus DNSSEC signature" }, { LDNS_STATUS_CRYPTO_SIG_EXPIRED, "DNSSEC signature has expired" }, { LDNS_STATUS_CRYPTO_SIG_NOT_INCEPTED, "DNSSEC signature not incepted yet" }, { LDNS_STATUS_CRYPTO_TSIG_BOGUS, "Bogus TSIG signature" }, { LDNS_STATUS_CRYPTO_TSIG_ERR, "Could not create TSIG signature" }, { LDNS_STATUS_CRYPTO_EXPIRATION_BEFORE_INCEPTION, "DNSSEC signature has expiration date earlier than inception date" }, { LDNS_STATUS_ENGINE_KEY_NOT_LOADED, "Unable to load private key from engine" }, { LDNS_STATUS_NSEC3_ERR, "Error in NSEC3 denial of existence proof" }, { LDNS_STATUS_RES_NO_NS, "No (valid) nameservers defined in the resolver" }, { LDNS_STATUS_RES_QUERY, "No correct query given to resolver" }, { LDNS_STATUS_WIRE_INCOMPLETE_HEADER, "header section incomplete" }, { LDNS_STATUS_WIRE_INCOMPLETE_QUESTION, "question section incomplete" }, { LDNS_STATUS_WIRE_INCOMPLETE_ANSWER, "answer section incomplete" }, { LDNS_STATUS_WIRE_INCOMPLETE_AUTHORITY, "authority section incomplete" }, { LDNS_STATUS_WIRE_INCOMPLETE_ADDITIONAL, "additional section incomplete" }, { LDNS_STATUS_NO_DATA, "No data" }, { LDNS_STATUS_EXISTS_ERR, "Element already exists" }, { LDNS_STATUS_CERT_BAD_ALGORITHM, "Bad algorithm type for CERT record" }, { LDNS_STATUS_SYNTAX_TYPE_ERR, "Syntax error, could not parse the RR's type" }, { LDNS_STATUS_SYNTAX_CLASS_ERR, "Syntax error, could not parse the RR's class" }, { LDNS_STATUS_SYNTAX_TTL_ERR, "Syntax error, could not parse the RR's TTL" }, { LDNS_STATUS_SYNTAX_INCLUDE_ERR_NOTIMPL, "Syntax error, $INCLUDE not implemented" }, { LDNS_STATUS_SYNTAX_RDATA_ERR, "Syntax error, could not parse the RR's rdata" }, { LDNS_STATUS_SYNTAX_DNAME_ERR, "Syntax error, could not parse the RR's dname(s)" }, { LDNS_STATUS_SYNTAX_VERSION_ERR, "Syntax error, version mismatch" }, { LDNS_STATUS_SYNTAX_ALG_ERR, "Syntax error, algorithm unknown or non parseable" }, { LDNS_STATUS_SYNTAX_KEYWORD_ERR, "Syntax error, unknown keyword in input" }, { LDNS_STATUS_SYNTAX_ERR, "Syntax error, could not parse the RR" }, { LDNS_STATUS_SYNTAX_EMPTY, "Empty line was returned" }, { LDNS_STATUS_SYNTAX_TTL, "$TTL directive was seen in the zone" }, { LDNS_STATUS_SYNTAX_ORIGIN, "$ORIGIN directive was seen in the zone" }, { LDNS_STATUS_SYNTAX_INCLUDE, "$INCLUDE directive was seen in the zone" }, { LDNS_STATUS_SYNTAX_ITERATIONS_OVERFLOW, "Iterations count for NSEC3 record higher than maximum" }, { LDNS_STATUS_SYNTAX_MISSING_VALUE_ERR, "Syntax error, value expected" }, { LDNS_STATUS_SYNTAX_INTEGER_OVERFLOW, "Syntax error, integer value too large" }, { LDNS_STATUS_SYNTAX_BAD_ESCAPE, "Syntax error, bad escape sequence" }, { LDNS_STATUS_SOCKET_ERROR, "Error creating socket" }, { LDNS_STATUS_DNSSEC_EXISTENCE_DENIED, "Existence denied by NSEC" }, { LDNS_STATUS_DNSSEC_NSEC_RR_NOT_COVERED, "RR not covered by the given NSEC RRs" }, { LDNS_STATUS_DNSSEC_NSEC_WILDCARD_NOT_COVERED, "wildcard not covered by the given NSEC RRs" }, { LDNS_STATUS_DNSSEC_NSEC3_ORIGINAL_NOT_FOUND, "original of NSEC3 hashed name could not be found" }, { LDNS_STATUS_MISSING_RDATA_FIELDS_RRSIG, "The RRSIG has to few rdata fields" }, { LDNS_STATUS_MISSING_RDATA_FIELDS_KEY, "The DNSKEY has to few rdata fields" }, { LDNS_STATUS_CRYPTO_SIG_EXPIRED_WITHIN_MARGIN, "DNSSEC signature will expire too soon" }, { LDNS_STATUS_CRYPTO_SIG_NOT_INCEPTED_WITHIN_MARGIN, "DNSSEC signature not incepted long enough" }, { LDNS_STATUS_DANE_UNKNOWN_CERTIFICATE_USAGE, "Unknown TLSA Certificate Usage" }, { LDNS_STATUS_DANE_UNKNOWN_SELECTOR, "Unknown TLSA Selector" }, { LDNS_STATUS_DANE_UNKNOWN_MATCHING_TYPE, "Unknown TLSA Matching Type" }, { LDNS_STATUS_DANE_UNKNOWN_PROTOCOL, "Unknown protocol. Only IPv4 and IPv6 are understood" }, { LDNS_STATUS_DANE_UNKNOWN_TRANSPORT, "Unknown transport. Should be one of {tcp, udp, sctp}" }, { LDNS_STATUS_DANE_MISSING_EXTRA_CERTS, /* Trust anchor assertion */ "More than one certificate should be provided" }, { LDNS_STATUS_DANE_EXTRA_CERTS_NOT_USED, /* Trust anchor assertion */ "Non of the extra certificates is used to sign the first" }, { LDNS_STATUS_DANE_OFFSET_OUT_OF_RANGE, /* Trust anchor assertion */ "The offset was out of range" }, { LDNS_STATUS_DANE_INSECURE, /* Unused by library */ "The queried resource records were insecure" }, { LDNS_STATUS_DANE_BOGUS, /* Unused by library */ "The queried resource records were bogus" }, { LDNS_STATUS_DANE_TLSA_DID_NOT_MATCH, "The TLSA record(s) " "did not match with the server certificate (chain)" }, { LDNS_STATUS_DANE_NON_CA_CERTIFICATE, "The certificate was not a CA certificate" }, { LDNS_STATUS_DANE_PKIX_DID_NOT_VALIDATE, "Could not PKIX validate" }, { LDNS_STATUS_DANE_PKIX_NO_SELF_SIGNED_TRUST_ANCHOR, "The validation path " "did not end in a self-signed certificate" }, { LDNS_STATUS_INVALID_ILNP64, "Conversion error, 4 colon separated hex numbers expected" }, { LDNS_STATUS_INVALID_EUI48, "Conversion error, 6 two character hex numbers " "separated by dashes expected (i.e. xx-xx-xx-xx-xx-xx" }, { LDNS_STATUS_INVALID_EUI64, "Conversion error, 8 two character hex numbers " "separated by dashes expected (i.e. xx-xx-xx-xx-xx-xx-xx-xx" }, { LDNS_STATUS_WIRE_RDATA_ERR, "invalid rdata in wire format" }, { LDNS_STATUS_INVALID_TAG, "Conversion error, a non-zero sequence of US-ASCII letters " "and numbers in lower case expected" }, { LDNS_STATUS_TYPE_NOT_IN_BITMAP, "The RR type bitmap rdata field did not have " "a bit reserved for the specific RR type" }, { LDNS_STATUS_INVALID_RDF_TYPE, "The rdata field was not of the expected type" }, { LDNS_STATUS_RDATA_OVERFLOW, "Rdata size overflow" }, { LDNS_STATUS_SYNTAX_SUPERFLUOUS_TEXT_ERR, "Syntax error, superfluous text present" }, { LDNS_STATUS_NSEC3_DOMAINNAME_OVERFLOW, "The NSEC3 domainname length overflow" }, #if OPENSSL_VERSION_NUMBER < 0x10100000 || defined(HAVE_LIBRESSL) { LDNS_STATUS_DANE_NEED_OPENSSL_GE_1_1_FOR_DANE_TA, "ldns needs to be linked with OpenSSL >= 1.1.0 to be able " "to verify the DANE-TA usage type." }, #else { LDNS_STATUS_DANE_NEED_OPENSSL_GE_1_1_FOR_DANE_TA, "ldns depends on the availability of the SSL_get0_dane() and " "X509_STORE_CTX_set0_dane() functions within OpenSSL >= 1.1.0 " "to be able to verify the DANE-TA usage type." }, #endif { 0, NULL } }; const char * ldns_get_errorstr_by_id(ldns_status err) { ldns_lookup_table *lt; lt = ldns_lookup_by_id(ldns_error_str, err); if (lt) { return lt->name; } return NULL; } ldns-1.7.0/tsig.c0000644000175000017500000002776013026206166013153 0ustar willemwillem/* * tsig.c * * contains the functions needed for TSIG [RFC2845] * * (c) 2005-2006 NLnet Labs * See the file LICENSE for the license */ #include #include #include #ifdef HAVE_SSL #include #include #endif /* HAVE_SSL */ const char * ldns_tsig_algorithm(const ldns_tsig_credentials *tc) { return tc->algorithm; } const char * ldns_tsig_keyname(const ldns_tsig_credentials *tc) { return tc->keyname; } const char * ldns_tsig_keydata(const ldns_tsig_credentials *tc) { return tc->keydata; } char * ldns_tsig_keyname_clone(const ldns_tsig_credentials *tc) { return strdup(tc->keyname); } char * ldns_tsig_keydata_clone(const ldns_tsig_credentials *tc) { return strdup(tc->keydata); } /* * Makes an exact copy of the wire, but with the tsig rr removed */ static uint8_t * ldns_tsig_prepare_pkt_wire(const uint8_t *wire, size_t wire_len, size_t *result_len) { uint8_t *wire2 = NULL; uint16_t qd_count; uint16_t an_count; uint16_t ns_count; uint16_t ar_count; ldns_rr *rr; size_t pos; uint16_t i; ldns_status status; if(wire_len < LDNS_HEADER_SIZE) { return NULL; } /* fake parse the wire */ qd_count = LDNS_QDCOUNT(wire); an_count = LDNS_ANCOUNT(wire); ns_count = LDNS_NSCOUNT(wire); ar_count = LDNS_ARCOUNT(wire); if (ar_count > 0) { ar_count--; } else { return NULL; } pos = LDNS_HEADER_SIZE; for (i = 0; i < qd_count; i++) { status = ldns_wire2rr(&rr, wire, wire_len, &pos, LDNS_SECTION_QUESTION); if (status != LDNS_STATUS_OK) { return NULL; } ldns_rr_free(rr); } for (i = 0; i < an_count; i++) { status = ldns_wire2rr(&rr, wire, wire_len, &pos, LDNS_SECTION_ANSWER); if (status != LDNS_STATUS_OK) { return NULL; } ldns_rr_free(rr); } for (i = 0; i < ns_count; i++) { status = ldns_wire2rr(&rr, wire, wire_len, &pos, LDNS_SECTION_AUTHORITY); if (status != LDNS_STATUS_OK) { return NULL; } ldns_rr_free(rr); } for (i = 0; i < ar_count; i++) { status = ldns_wire2rr(&rr, wire, wire_len, &pos, LDNS_SECTION_ADDITIONAL); if (status != LDNS_STATUS_OK) { return NULL; } ldns_rr_free(rr); } *result_len = pos; wire2 = LDNS_XMALLOC(uint8_t, *result_len); if(!wire2) { return NULL; } memcpy(wire2, wire, *result_len); ldns_write_uint16(wire2 + LDNS_ARCOUNT_OFF, ar_count); return wire2; } #ifdef HAVE_SSL static const EVP_MD * ldns_digest_function(char *name) { /* these are the mandatory algorithms from RFC4635 */ /* The optional algorithms are not yet implemented */ if (strcasecmp(name, "hmac-sha512.") == 0) { #ifdef HAVE_EVP_SHA512 return EVP_sha512(); #else return NULL; #endif } else if (strcasecmp(name, "hmac-shac384.") == 0) { #ifdef HAVE_EVP_SHA384 return EVP_sha384(); #else return NULL; #endif } else if (strcasecmp(name, "hmac-sha256.") == 0) { #ifdef HAVE_EVP_SHA256 return EVP_sha256(); #else return NULL; #endif } else if (strcasecmp(name, "hmac-sha1.") == 0) { return EVP_sha1(); } else if (strcasecmp(name, "hmac-md5.sig-alg.reg.int.") == 0) { return EVP_md5(); } else { return NULL; } } #endif #ifdef HAVE_SSL static ldns_status ldns_tsig_mac_new(ldns_rdf **tsig_mac, const uint8_t *pkt_wire, size_t pkt_wire_size, const char *key_data, const ldns_rdf *key_name_rdf, const ldns_rdf *fudge_rdf, const ldns_rdf *algorithm_rdf, const ldns_rdf *time_signed_rdf, const ldns_rdf *error_rdf, const ldns_rdf *other_data_rdf, const ldns_rdf *orig_mac_rdf, int tsig_timers_only) { ldns_status status; char *wireformat; int wiresize; unsigned char *mac_bytes = NULL; unsigned char *key_bytes = NULL; int key_size; const EVP_MD *digester; char *algorithm_name = NULL; unsigned int md_len = EVP_MAX_MD_SIZE; ldns_rdf *result = NULL; ldns_buffer *data_buffer = NULL; ldns_rdf *canonical_key_name_rdf = NULL; ldns_rdf *canonical_algorithm_rdf = NULL; if (key_name_rdf == NULL || algorithm_rdf == NULL) { return LDNS_STATUS_NULL; } canonical_key_name_rdf = ldns_rdf_clone(key_name_rdf); if (canonical_key_name_rdf == NULL) { return LDNS_STATUS_MEM_ERR; } canonical_algorithm_rdf = ldns_rdf_clone(algorithm_rdf); if (canonical_algorithm_rdf == NULL) { ldns_rdf_deep_free(canonical_key_name_rdf); return LDNS_STATUS_MEM_ERR; } /* * prepare the digestable information */ data_buffer = ldns_buffer_new(LDNS_MAX_PACKETLEN); if (!data_buffer) { status = LDNS_STATUS_MEM_ERR; goto clean; } /* if orig_mac is not NULL, add it too */ if (orig_mac_rdf) { (void) ldns_rdf2buffer_wire(data_buffer, orig_mac_rdf); } ldns_buffer_write(data_buffer, pkt_wire, pkt_wire_size); if (!tsig_timers_only) { ldns_dname2canonical(canonical_key_name_rdf); (void)ldns_rdf2buffer_wire(data_buffer, canonical_key_name_rdf); ldns_buffer_write_u16(data_buffer, LDNS_RR_CLASS_ANY); ldns_buffer_write_u32(data_buffer, 0); ldns_dname2canonical(canonical_algorithm_rdf); (void)ldns_rdf2buffer_wire(data_buffer, canonical_algorithm_rdf); } (void)ldns_rdf2buffer_wire(data_buffer, time_signed_rdf); (void)ldns_rdf2buffer_wire(data_buffer, fudge_rdf); if (!tsig_timers_only) { (void)ldns_rdf2buffer_wire(data_buffer, error_rdf); (void)ldns_rdf2buffer_wire(data_buffer, other_data_rdf); } wireformat = (char *) data_buffer->_data; wiresize = (int) ldns_buffer_position(data_buffer); algorithm_name = ldns_rdf2str(algorithm_rdf); if(!algorithm_name) { status = LDNS_STATUS_MEM_ERR; goto clean; } /* prepare the key */ key_bytes = LDNS_XMALLOC(unsigned char, ldns_b64_pton_calculate_size(strlen(key_data))); if(!key_bytes) { status = LDNS_STATUS_MEM_ERR; goto clean; } key_size = ldns_b64_pton(key_data, key_bytes, ldns_b64_pton_calculate_size(strlen(key_data))); if (key_size < 0) { status = LDNS_STATUS_INVALID_B64; goto clean; } /* hmac it */ /* 2 spare bytes for the length */ mac_bytes = LDNS_XMALLOC(unsigned char, md_len+2); if(!mac_bytes) { status = LDNS_STATUS_MEM_ERR; goto clean; } memset(mac_bytes, 0, md_len+2); digester = ldns_digest_function(algorithm_name); if (digester) { (void) HMAC(digester, key_bytes, key_size, (void *)wireformat, (size_t) wiresize, mac_bytes + 2, &md_len); ldns_write_uint16(mac_bytes, md_len); result = ldns_rdf_new_frm_data(LDNS_RDF_TYPE_INT16_DATA, md_len + 2, mac_bytes); } else { status = LDNS_STATUS_CRYPTO_UNKNOWN_ALGO; goto clean; } *tsig_mac = result; status = LDNS_STATUS_OK; clean: LDNS_FREE(mac_bytes); LDNS_FREE(key_bytes); LDNS_FREE(algorithm_name); ldns_buffer_free(data_buffer); ldns_rdf_deep_free(canonical_algorithm_rdf); ldns_rdf_deep_free(canonical_key_name_rdf); return status; } #endif /* HAVE_SSL */ #ifdef HAVE_SSL bool ldns_pkt_tsig_verify(ldns_pkt *pkt, const uint8_t *wire, size_t wirelen, const char *key_name, const char *key_data, const ldns_rdf *orig_mac_rdf) { return ldns_pkt_tsig_verify_next(pkt, wire, wirelen, key_name, key_data, orig_mac_rdf, 0); } bool ldns_pkt_tsig_verify_next(ldns_pkt *pkt, const uint8_t *wire, size_t wirelen, const char* key_name, const char *key_data, const ldns_rdf *orig_mac_rdf, int tsig_timers_only) { ldns_rdf *fudge_rdf; ldns_rdf *algorithm_rdf; ldns_rdf *time_signed_rdf; ldns_rdf *orig_id_rdf; ldns_rdf *error_rdf; ldns_rdf *other_data_rdf; ldns_rdf *pkt_mac_rdf; ldns_rdf *my_mac_rdf; ldns_rdf *key_name_rdf = ldns_rdf_new_frm_str(LDNS_RDF_TYPE_DNAME, key_name); uint16_t pkt_id, orig_pkt_id; ldns_status status; uint8_t *prepared_wire = NULL; size_t prepared_wire_size = 0; ldns_rr *orig_tsig = ldns_pkt_tsig(pkt); if (!orig_tsig || ldns_rr_rd_count(orig_tsig) <= 6) { ldns_rdf_deep_free(key_name_rdf); return false; } algorithm_rdf = ldns_rr_rdf(orig_tsig, 0); time_signed_rdf = ldns_rr_rdf(orig_tsig, 1); fudge_rdf = ldns_rr_rdf(orig_tsig, 2); pkt_mac_rdf = ldns_rr_rdf(orig_tsig, 3); orig_id_rdf = ldns_rr_rdf(orig_tsig, 4); error_rdf = ldns_rr_rdf(orig_tsig, 5); other_data_rdf = ldns_rr_rdf(orig_tsig, 6); /* remove temporarily */ ldns_pkt_set_tsig(pkt, NULL); /* temporarily change the id to the original id */ pkt_id = ldns_pkt_id(pkt); orig_pkt_id = ldns_rdf2native_int16(orig_id_rdf); ldns_pkt_set_id(pkt, orig_pkt_id); prepared_wire = ldns_tsig_prepare_pkt_wire(wire, wirelen, &prepared_wire_size); status = ldns_tsig_mac_new(&my_mac_rdf, prepared_wire, prepared_wire_size, key_data, key_name_rdf, fudge_rdf, algorithm_rdf, time_signed_rdf, error_rdf, other_data_rdf, orig_mac_rdf, tsig_timers_only); LDNS_FREE(prepared_wire); if (status != LDNS_STATUS_OK) { ldns_rdf_deep_free(key_name_rdf); return false; } /* Put back the values */ ldns_pkt_set_tsig(pkt, orig_tsig); ldns_pkt_set_id(pkt, pkt_id); ldns_rdf_deep_free(key_name_rdf); if (ldns_rdf_compare(pkt_mac_rdf, my_mac_rdf) == 0) { ldns_rdf_deep_free(my_mac_rdf); return true; } else { ldns_rdf_deep_free(my_mac_rdf); return false; } } #endif /* HAVE_SSL */ #ifdef HAVE_SSL ldns_status ldns_pkt_tsig_sign(ldns_pkt *pkt, const char *key_name, const char *key_data, uint16_t fudge, const char *algorithm_name, const ldns_rdf *query_mac) { return ldns_pkt_tsig_sign_next(pkt, key_name, key_data, fudge, algorithm_name, query_mac, 0); } ldns_status ldns_pkt_tsig_sign_next(ldns_pkt *pkt, const char *key_name, const char *key_data, uint16_t fudge, const char *algorithm_name, const ldns_rdf *query_mac, int tsig_timers_only) { ldns_rr *tsig_rr; ldns_rdf *key_name_rdf = ldns_rdf_new_frm_str(LDNS_RDF_TYPE_DNAME, key_name); ldns_rdf *fudge_rdf = NULL; ldns_rdf *orig_id_rdf = NULL; ldns_rdf *algorithm_rdf; ldns_rdf *error_rdf = NULL; ldns_rdf *mac_rdf = NULL; ldns_rdf *other_data_rdf = NULL; ldns_status status = LDNS_STATUS_OK; uint8_t *pkt_wire = NULL; size_t pkt_wire_len; struct timeval tv_time_signed; uint8_t *time_signed = NULL; ldns_rdf *time_signed_rdf = NULL; algorithm_rdf = ldns_rdf_new_frm_str(LDNS_RDF_TYPE_DNAME, algorithm_name); if(!key_name_rdf || !algorithm_rdf) { status = LDNS_STATUS_MEM_ERR; goto clean; } /* eww don't have create tsigtime rdf yet :( */ /* bleh :p */ if (gettimeofday(&tv_time_signed, NULL) == 0) { time_signed = LDNS_XMALLOC(uint8_t, 6); if(!time_signed) { status = LDNS_STATUS_MEM_ERR; goto clean; } ldns_write_uint64_as_uint48(time_signed, (uint64_t)tv_time_signed.tv_sec); } else { status = LDNS_STATUS_INTERNAL_ERR; goto clean; } time_signed_rdf = ldns_rdf_new(LDNS_RDF_TYPE_TSIGTIME, 6, time_signed); if(!time_signed_rdf) { LDNS_FREE(time_signed); status = LDNS_STATUS_MEM_ERR; goto clean; } fudge_rdf = ldns_native2rdf_int16(LDNS_RDF_TYPE_INT16, fudge); orig_id_rdf = ldns_native2rdf_int16(LDNS_RDF_TYPE_INT16, ldns_pkt_id(pkt)); error_rdf = ldns_native2rdf_int16(LDNS_RDF_TYPE_INT16, 0); other_data_rdf = ldns_native2rdf_int16_data(0, NULL); if(!fudge_rdf || !orig_id_rdf || !error_rdf || !other_data_rdf) { status = LDNS_STATUS_MEM_ERR; goto clean; } if (ldns_pkt2wire(&pkt_wire, pkt, &pkt_wire_len) != LDNS_STATUS_OK) { status = LDNS_STATUS_ERR; goto clean; } status = ldns_tsig_mac_new(&mac_rdf, pkt_wire, pkt_wire_len, key_data, key_name_rdf, fudge_rdf, algorithm_rdf, time_signed_rdf, error_rdf, other_data_rdf, query_mac, tsig_timers_only); if (!mac_rdf) { goto clean; } LDNS_FREE(pkt_wire); /* Create the TSIG RR */ tsig_rr = ldns_rr_new(); if(!tsig_rr) { status = LDNS_STATUS_MEM_ERR; goto clean; } ldns_rr_set_owner(tsig_rr, key_name_rdf); ldns_rr_set_class(tsig_rr, LDNS_RR_CLASS_ANY); ldns_rr_set_type(tsig_rr, LDNS_RR_TYPE_TSIG); ldns_rr_set_ttl(tsig_rr, 0); ldns_rr_push_rdf(tsig_rr, algorithm_rdf); ldns_rr_push_rdf(tsig_rr, time_signed_rdf); ldns_rr_push_rdf(tsig_rr, fudge_rdf); ldns_rr_push_rdf(tsig_rr, mac_rdf); ldns_rr_push_rdf(tsig_rr, orig_id_rdf); ldns_rr_push_rdf(tsig_rr, error_rdf); ldns_rr_push_rdf(tsig_rr, other_data_rdf); ldns_pkt_set_tsig(pkt, tsig_rr); return status; clean: LDNS_FREE(pkt_wire); ldns_rdf_free(key_name_rdf); ldns_rdf_free(algorithm_rdf); ldns_rdf_free(time_signed_rdf); ldns_rdf_free(fudge_rdf); ldns_rdf_free(orig_id_rdf); ldns_rdf_free(error_rdf); ldns_rdf_free(other_data_rdf); return status; } #endif /* HAVE_SSL */ ldns-1.7.0/compat/0000755000175000017500000000000013026206166013310 5ustar willemwillemldns-1.7.0/compat/inet_aton.c0000644000175000017500000001252413026206166015440 0ustar willemwillem/* From openssh4.3p2 compat/inet_aton.c */ /* * Copyright (c) 1983, 1990, 1993 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * Portions Copyright (c) 1993 by Digital Equipment Corporation. * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies, and that * the name of Digital Equipment Corporation not be used in advertising or * publicity pertaining to distribution of the document or software without * specific, written prior permission. * * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS * SOFTWARE. * - * --Copyright-- */ /* OPENBSD ORIGINAL: lib/libc/net/inet_addr.c */ #include #if !defined(HAVE_INET_ATON) #include #include #ifdef HAVE_NETINET_IN_H #include #endif #ifdef HAVE_ARPA_INET_H #include #endif #include #if 0 /* * Ascii internet address interpretation routine. * The value returned is in network order. */ in_addr_t inet_addr(const char *cp) { struct in_addr val; if (inet_aton(cp, &val)) return (val.s_addr); return (INADDR_NONE); } #endif /* * Check whether "cp" is a valid ascii representation * of an Internet address and convert to a binary address. * Returns 1 if the address is valid, 0 if not. * This replaces inet_addr, the return value from which * cannot distinguish between failure and a local broadcast address. */ int inet_aton(const char *cp, struct in_addr *addr) { uint32_t val; int base, n; char c; unsigned int parts[4]; unsigned int *pp = parts; c = *cp; for (;;) { /* * Collect number up to ``.''. * Values are specified as for C: * 0x=hex, 0=octal, isdigit=decimal. */ if (!isdigit((int) c)) return (0); val = 0; base = 10; if (c == '0') { c = *++cp; if (c == 'x' || c == 'X') base = 16, c = *++cp; else base = 8; } for (;;) { if (isascii((int) c) && isdigit((int) c)) { val = (val * base) + (c - '0'); c = *++cp; } else if (base == 16 && isascii((int) c) && isxdigit((int) c)) { val = (val << 4) | (c + 10 - (islower((int) c) ? 'a' : 'A')); c = *++cp; } else break; } if (c == '.') { /* * Internet format: * a.b.c.d * a.b.c (with c treated as 16 bits) * a.b (with b treated as 24 bits) */ if (pp >= parts + 3) return (0); *pp++ = val; c = *++cp; } else break; } /* * Check for trailing characters. */ if (c != '\0' && (!isascii((int) c) || !isspace((int) c))) return (0); /* * Concoct the address according to * the number of parts specified. */ n = pp - parts + 1; switch (n) { case 0: return (0); /* initial nondigit */ case 1: /* a -- 32 bits */ break; case 2: /* a.b -- 8.24 bits */ if ((val > 0xffffff) || (parts[0] > 0xff)) return (0); val |= parts[0] << 24; break; case 3: /* a.b.c -- 8.8.16 bits */ if ((val > 0xffff) || (parts[0] > 0xff) || (parts[1] > 0xff)) return (0); val |= (parts[0] << 24) | (parts[1] << 16); break; case 4: /* a.b.c.d -- 8.8.8.8 bits */ if ((val > 0xff) || (parts[0] > 0xff) || (parts[1] > 0xff) || (parts[2] > 0xff)) return (0); val |= (parts[0] << 24) | (parts[1] << 16) | (parts[2] << 8); break; } if (addr) addr->s_addr = htonl(val); return (1); } #endif /* !defined(HAVE_INET_ATON) */ ldns-1.7.0/compat/gmtime_r.c0000644000175000017500000000034713026206166015263 0ustar willemwillem#ifdef HAVE_CONFIG_H #include #endif #ifdef HAVE_TIME_H #include #endif struct tm *gmtime_r(const time_t *timep, struct tm *result) { /* no thread safety. */ *result = *gmtime(timep); return result; } ldns-1.7.0/compat/snprintf.c0000644000175000017500000007124613026206166015331 0ustar willemwillem/* snprintf - compatibility implementation of snprintf, vsnprintf * * Copyright (c) 2013, NLnet Labs. All rights reserved. * * This software is open source. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * 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. * * Neither the name of the NLNET LABS 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 COPYRIGHT HOLDERS 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 COPYRIGHT * HOLDER 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. */ #include #include #include #include #include #include #include #ifdef HAVE_STDINT_H #include #endif /* for test */ /* #define SNPRINTF_TEST 1 */ #ifdef SNPRINTF_TEST #define snprintf my_snprintf #define vsnprintf my_vsnprintf #endif /* SNPRINTF_TEST */ int snprintf(char* str, size_t size, const char* format, ...); int vsnprintf(char* str, size_t size, const char* format, va_list arg); /** * Very portable snprintf implementation, limited in functionality, * esp. for %[capital] %[nonportable] and so on. Reduced float functionality, * mostly in formatting and range (e+-16), for %f and %g. * * %s, %d, %u, %i, %x, %c, %n and %% are fully supported. * This includes width, precision, flags 0- +, and *(arg for wid,prec). * %f, %g, %m, %p have reduced support, support for wid,prec,flags,*, but * less floating point range, no %e formatting for %g. */ int snprintf(char* str, size_t size, const char* format, ...) { int r; va_list args; va_start(args, format); r = vsnprintf(str, size, format, args); va_end(args); return r; } /** add padding to string */ static void print_pad(char** at, size_t* left, int* ret, char p, int num) { while(num--) { if(*left > 1) { *(*at)++ = p; (*left)--; } (*ret)++; } } /** get negative symbol, 0 if none */ static char get_negsign(int negative, int plus, int space) { if(negative) return '-'; if(plus) return '+'; if(space) return ' '; return 0; } #define PRINT_DEC_BUFSZ 32 /* 20 is enough for 64 bit decimals */ /** print decimal into buffer, returns length */ static int print_dec(char* buf, int max, unsigned int value) { int i = 0; if(value == 0) { if(max > 0) { buf[0] = '0'; i = 1; } } else while(value && i < max) { buf[i++] = '0' + value % 10; value /= 10; } return i; } /** print long decimal into buffer, returns length */ static int print_dec_l(char* buf, int max, unsigned long value) { int i = 0; if(value == 0) { if(max > 0) { buf[0] = '0'; i = 1; } } else while(value && i < max) { buf[i++] = '0' + value % 10; value /= 10; } return i; } /** print long decimal into buffer, returns length */ static int print_dec_ll(char* buf, int max, unsigned long long value) { int i = 0; if(value == 0) { if(max > 0) { buf[0] = '0'; i = 1; } } else while(value && i < max) { buf[i++] = '0' + value % 10; value /= 10; } return i; } /** print hex into buffer, returns length */ static int print_hex(char* buf, int max, unsigned int value) { const char* h = "0123456789abcdef"; int i = 0; if(value == 0) { if(max > 0) { buf[0] = '0'; i = 1; } } else while(value && i < max) { buf[i++] = h[value & 0x0f]; value >>= 4; } return i; } /** print long hex into buffer, returns length */ static int print_hex_l(char* buf, int max, unsigned long value) { const char* h = "0123456789abcdef"; int i = 0; if(value == 0) { if(max > 0) { buf[0] = '0'; i = 1; } } else while(value && i < max) { buf[i++] = h[value & 0x0f]; value >>= 4; } return i; } /** print long long hex into buffer, returns length */ static int print_hex_ll(char* buf, int max, unsigned long long value) { const char* h = "0123456789abcdef"; int i = 0; if(value == 0) { if(max > 0) { buf[0] = '0'; i = 1; } } else while(value && i < max) { buf[i++] = h[value & 0x0f]; value >>= 4; } return i; } /** copy string into result, reversed */ static void spool_str_rev(char** at, size_t* left, int* ret, const char* buf, int len) { int i = len; while(i) { if(*left > 1) { *(*at)++ = buf[--i]; (*left)--; } else --i; (*ret)++; } } /** copy string into result */ static void spool_str(char** at, size_t* left, int* ret, const char* buf, int len) { int i; for(i=0; i 1) { *(*at)++ = buf[i]; (*left)--; } (*ret)++; } } /** print number formatted */ static void print_num(char** at, size_t* left, int* ret, int minw, int precision, int prgiven, int zeropad, int minus, int plus, int space, int zero, int negative, char* buf, int len) { int w = len; /* excludes minus sign */ char s = get_negsign(negative, plus, space); if(minus) { /* left adjust the number into the field, space padding */ /* calc numw = [sign][zeroes][number] */ int numw = w; if(precision == 0 && zero) numw = 0; if(numw < precision) numw = precision; if(s) numw++; /* sign */ if(s) print_pad(at, left, ret, s, 1); /* number */ if(precision == 0 && zero) { /* "" for the number */ } else { if(w < precision) print_pad(at, left, ret, '0', precision - w); spool_str_rev(at, left, ret, buf, len); } /* spaces */ if(numw < minw) print_pad(at, left, ret, ' ', minw - numw); } else { /* pad on the left of the number */ /* calculate numw has width of [sign][zeroes][number] */ int numw = w; if(precision == 0 && zero) numw = 0; if(numw < precision) numw = precision; if(!prgiven && zeropad && numw < minw) numw = minw; else if(s) numw++; /* pad with spaces */ if(numw < minw) print_pad(at, left, ret, ' ', minw - numw); /* print sign (and one less zeropad if so) */ if(s) { print_pad(at, left, ret, s, 1); numw--; } /* pad with zeroes */ if(w < numw) print_pad(at, left, ret, '0', numw - w); if(precision == 0 && zero) return; /* print the characters for the value */ spool_str_rev(at, left, ret, buf, len); } } /** print %d and %i */ static void print_num_d(char** at, size_t* left, int* ret, int value, int minw, int precision, int prgiven, int zeropad, int minus, int plus, int space) { char buf[PRINT_DEC_BUFSZ]; int negative = (value < 0); int zero = (value == 0); int len = print_dec(buf, (int)sizeof(buf), (unsigned int)(negative?-value:value)); print_num(at, left, ret, minw, precision, prgiven, zeropad, minus, plus, space, zero, negative, buf, len); } /** print %ld and %li */ static void print_num_ld(char** at, size_t* left, int* ret, long value, int minw, int precision, int prgiven, int zeropad, int minus, int plus, int space) { char buf[PRINT_DEC_BUFSZ]; int negative = (value < 0); int zero = (value == 0); int len = print_dec_l(buf, (int)sizeof(buf), (unsigned long)(negative?-value:value)); print_num(at, left, ret, minw, precision, prgiven, zeropad, minus, plus, space, zero, negative, buf, len); } /** print %lld and %lli */ static void print_num_lld(char** at, size_t* left, int* ret, long long value, int minw, int precision, int prgiven, int zeropad, int minus, int plus, int space) { char buf[PRINT_DEC_BUFSZ]; int negative = (value < 0); int zero = (value == 0); int len = print_dec_ll(buf, (int)sizeof(buf), (unsigned long long)(negative?-value:value)); print_num(at, left, ret, minw, precision, prgiven, zeropad, minus, plus, space, zero, negative, buf, len); } /** print %u */ static void print_num_u(char** at, size_t* left, int* ret, unsigned int value, int minw, int precision, int prgiven, int zeropad, int minus, int plus, int space) { char buf[PRINT_DEC_BUFSZ]; int negative = 0; int zero = (value == 0); int len = print_dec(buf, (int)sizeof(buf), value); print_num(at, left, ret, minw, precision, prgiven, zeropad, minus, plus, space, zero, negative, buf, len); } /** print %lu */ static void print_num_lu(char** at, size_t* left, int* ret, unsigned long value, int minw, int precision, int prgiven, int zeropad, int minus, int plus, int space) { char buf[PRINT_DEC_BUFSZ]; int negative = 0; int zero = (value == 0); int len = print_dec_l(buf, (int)sizeof(buf), value); print_num(at, left, ret, minw, precision, prgiven, zeropad, minus, plus, space, zero, negative, buf, len); } /** print %llu */ static void print_num_llu(char** at, size_t* left, int* ret, unsigned long long value, int minw, int precision, int prgiven, int zeropad, int minus, int plus, int space) { char buf[PRINT_DEC_BUFSZ]; int negative = 0; int zero = (value == 0); int len = print_dec_ll(buf, (int)sizeof(buf), value); print_num(at, left, ret, minw, precision, prgiven, zeropad, minus, plus, space, zero, negative, buf, len); } /** print %x */ static void print_num_x(char** at, size_t* left, int* ret, unsigned int value, int minw, int precision, int prgiven, int zeropad, int minus, int plus, int space) { char buf[PRINT_DEC_BUFSZ]; int negative = 0; int zero = (value == 0); int len = print_hex(buf, (int)sizeof(buf), value); print_num(at, left, ret, minw, precision, prgiven, zeropad, minus, plus, space, zero, negative, buf, len); } /** print %lx */ static void print_num_lx(char** at, size_t* left, int* ret, unsigned long value, int minw, int precision, int prgiven, int zeropad, int minus, int plus, int space) { char buf[PRINT_DEC_BUFSZ]; int negative = 0; int zero = (value == 0); int len = print_hex_l(buf, (int)sizeof(buf), value); print_num(at, left, ret, minw, precision, prgiven, zeropad, minus, plus, space, zero, negative, buf, len); } /** print %llx */ static void print_num_llx(char** at, size_t* left, int* ret, unsigned long long value, int minw, int precision, int prgiven, int zeropad, int minus, int plus, int space) { char buf[PRINT_DEC_BUFSZ]; int negative = 0; int zero = (value == 0); int len = print_hex_ll(buf, (int)sizeof(buf), value); print_num(at, left, ret, minw, precision, prgiven, zeropad, minus, plus, space, zero, negative, buf, len); } /** print %llp */ static void print_num_llp(char** at, size_t* left, int* ret, void* value, int minw, int precision, int prgiven, int zeropad, int minus, int plus, int space) { char buf[PRINT_DEC_BUFSZ]; int negative = 0; int zero = (value == 0); #if defined(UINTPTR_MAX) && defined(UINT32_MAX) && (UINTPTR_MAX == UINT32_MAX) /* avoid warning about upcast on 32bit systems */ unsigned long long llvalue = (unsigned long)value; #else unsigned long long llvalue = (unsigned long long)value; #endif int len = print_hex_ll(buf, (int)sizeof(buf), llvalue); if(zero) { buf[0]=')'; buf[1]='l'; buf[2]='i'; buf[3]='n'; buf[4]='('; len = 5; } else { /* put '0x' in front of the (reversed) buffer result */ if(len < PRINT_DEC_BUFSZ) buf[len++] = 'x'; if(len < PRINT_DEC_BUFSZ) buf[len++] = '0'; } print_num(at, left, ret, minw, precision, prgiven, zeropad, minus, plus, space, zero, negative, buf, len); } #define PRINT_FLOAT_BUFSZ 64 /* xx.yy with 20.20 about the max */ /** spool remainder after the decimal point to buffer, in reverse */ static int print_remainder(char* buf, int max, double r, int prec) { unsigned long long cap = 1; unsigned long long value; int len, i; if(prec > 19) prec = 19; /* max we can do */ if(max < prec) return 0; for(i=0; i= 5) { value++; /* that might carry to numbers before the comma, if so, * just ignore that rounding. failure because 64bitprintout */ if(value >= cap) value = cap-1; } len = print_dec_ll(buf, max, value); while(len < prec) { /* pad with zeroes, e.g. if 0.0012 */ buf[len++] = '0'; } if(len < max) buf[len++] = '.'; return len; } /** spool floating point to buffer */ static int print_float(char* buf, int max, double value, int prec) { /* as xxx.xxx if prec==0, no '.', with prec decimals after . */ /* no conversion for NAN and INF, because we do not want to require linking with -lm. */ /* Thus, the conversions use 64bit integers to convert the numbers, * which makes 19 digits before and after the decimal point the max */ unsigned long long whole = (unsigned long long)value; double remain = value - (double)whole; int len = 0; if(prec != 0) len = print_remainder(buf, max, remain, prec); len += print_dec_ll(buf+len, max-len, whole); return len; } /** print %f */ static void print_num_f(char** at, size_t* left, int* ret, double value, int minw, int precision, int prgiven, int zeropad, int minus, int plus, int space) { char buf[PRINT_FLOAT_BUFSZ]; int negative = (value < 0); int zero = 0; int len; if(!prgiven) precision = 6; len = print_float(buf, (int)sizeof(buf), negative?-value:value, precision); print_num(at, left, ret, minw, 1, 0, zeropad, minus, plus, space, zero, negative, buf, len); } /* rudimentary %g support */ static int print_float_g(char* buf, int max, double value, int prec) { unsigned long long whole = (unsigned long long)value; double remain = value - (double)whole; int before = 0; int len = 0; /* number of digits before the decimal point */ while(whole > 0) { before++; whole /= 10; } whole = (unsigned long long)value; if(prec > before && remain != 0.0) { /* see if the last decimals are zero, if so, skip them */ len = print_remainder(buf, max, remain, prec-before); while(len > 0 && buf[0]=='0') { memmove(buf, buf+1, --len); } } len += print_dec_ll(buf+len, max-len, whole); return len; } /** print %g */ static void print_num_g(char** at, size_t* left, int* ret, double value, int minw, int precision, int prgiven, int zeropad, int minus, int plus, int space) { char buf[PRINT_FLOAT_BUFSZ]; int negative = (value < 0); int zero = 0; int len; if(!prgiven) precision = 6; if(precision == 0) precision = 1; len = print_float_g(buf, (int)sizeof(buf), negative?-value:value, precision); print_num(at, left, ret, minw, 1, 0, zeropad, minus, plus, space, zero, negative, buf, len); } /** strnlen (compat implementation) */ static int my_strnlen(const char* s, int max) { int i; for(i=0; i 1) { *at++ = *fmt++; left--; } else fmt++; ret++; } /* see if we are at end */ if(!*fmt) break; /* fetch next argument % designation from format string */ fmt++; /* skip the '%' */ /********************************/ /* get the argument designation */ /********************************/ /* we must do this vararg stuff inside this function for * portability. Hence, get_designation, and print_designation * are not their own functions. */ /* printout designation: * conversion specifier: x, d, u, s, c, n, m, p * flags: # not supported * 0 zeropad (on the left) * - left adjust (right by default) * ' ' printspace for positive number (in - position). * + alwayssign * fieldwidth: [1-9][0-9]* minimum field width. * if this is * then type int next argument specifies the minwidth. * if this is negative, the - flag is set (with positive width). * precision: period[digits]*, %.2x. * if this is * then type int next argument specifies the precision. * just '.' or negative value means precision=0. * this is mindigits to print for d, i, u, x * this is aftercomma digits for f * this is max number significant digits for g * maxnumber characters to be printed for s * length: 0-none (int), 1-l (long), 2-ll (long long) * notsupported: hh (char), h (short), L (long double), q, j, z, t * Does not support %m$ and *m$ argument designation as array indices. * Does not support %#x * */ minw = 0; precision = 1; prgiven = 0; zeropad = 0; minus = 0; plus = 0; space = 0; length = 0; /* get flags in any order */ for(;;) { if(*fmt == '0') zeropad = 1; else if(*fmt == '-') minus = 1; else if(*fmt == '+') plus = 1; else if(*fmt == ' ') space = 1; else break; fmt++; } /* field width */ if(*fmt == '*') { fmt++; /* skip char */ minw = va_arg(arg, int); if(minw < 0) { minus = 1; minw = -minw; } } else while(*fmt >= '0' && *fmt <= '9') { minw = minw*10 + (*fmt++)-'0'; } /* precision */ if(*fmt == '.') { fmt++; /* skip period */ prgiven = 1; precision = 0; if(*fmt == '*') { fmt++; /* skip char */ precision = va_arg(arg, int); if(precision < 0) precision = 0; } else while(*fmt >= '0' && *fmt <= '9') { precision = precision*10 + (*fmt++)-'0'; } } /* length */ if(*fmt == 'l') { fmt++; /* skip char */ length = 1; if(*fmt == 'l') { fmt++; /* skip char */ length = 2; } } /* get the conversion */ if(!*fmt) conv = 0; else conv = *fmt++; /***********************************/ /* print that argument designation */ /***********************************/ switch(conv) { case 'i': case 'd': if(length == 0) print_num_d(&at, &left, &ret, va_arg(arg, int), minw, precision, prgiven, zeropad, minus, plus, space); else if(length == 1) print_num_ld(&at, &left, &ret, va_arg(arg, long), minw, precision, prgiven, zeropad, minus, plus, space); else if(length == 2) print_num_lld(&at, &left, &ret, va_arg(arg, long long), minw, precision, prgiven, zeropad, minus, plus, space); break; case 'u': if(length == 0) print_num_u(&at, &left, &ret, va_arg(arg, unsigned int), minw, precision, prgiven, zeropad, minus, plus, space); else if(length == 1) print_num_lu(&at, &left, &ret, va_arg(arg, unsigned long), minw, precision, prgiven, zeropad, minus, plus, space); else if(length == 2) print_num_llu(&at, &left, &ret, va_arg(arg, unsigned long long), minw, precision, prgiven, zeropad, minus, plus, space); break; case 'x': if(length == 0) print_num_x(&at, &left, &ret, va_arg(arg, unsigned int), minw, precision, prgiven, zeropad, minus, plus, space); else if(length == 1) print_num_lx(&at, &left, &ret, va_arg(arg, unsigned long), minw, precision, prgiven, zeropad, minus, plus, space); else if(length == 2) print_num_llx(&at, &left, &ret, va_arg(arg, unsigned long long), minw, precision, prgiven, zeropad, minus, plus, space); break; case 's': print_str(&at, &left, &ret, va_arg(arg, char*), minw, precision, prgiven, minus); break; case 'c': print_char(&at, &left, &ret, va_arg(arg, int), minw, minus); break; case 'n': *va_arg(arg, int*) = ret; break; case 'm': print_str(&at, &left, &ret, strerror(errno), minw, precision, prgiven, minus); break; case 'p': print_num_llp(&at, &left, &ret, va_arg(arg, void*), minw, precision, prgiven, zeropad, minus, plus, space); break; case '%': print_pad(&at, &left, &ret, '%', 1); break; case 'f': print_num_f(&at, &left, &ret, va_arg(arg, double), minw, precision, prgiven, zeropad, minus, plus, space); break; case 'g': print_num_g(&at, &left, &ret, va_arg(arg, double), minw, precision, prgiven, zeropad, minus, plus, space); break; /* unknown */ default: case 0: break; } } /* zero terminate */ if(left > 0) *at = 0; return ret; } #ifdef SNPRINTF_TEST /** do tests */ #undef snprintf #define DOTEST(bufsz, result, retval, ...) do { \ char buf[bufsz]; \ printf("now test %s\n", #__VA_ARGS__); \ int r=my_snprintf(buf, sizeof(buf), __VA_ARGS__); \ if(r != retval || strcmp(buf, result) != 0) { \ printf("error test(%s) was \"%s\":%d\n", \ ""#bufsz", "#result", "#retval", "#__VA_ARGS__, \ buf, r); \ exit(1); \ } \ r=snprintf(buf, sizeof(buf), __VA_ARGS__); \ if(r != retval || strcmp(buf, result) != 0) { \ printf("error test(%s) differs with system, \"%s\":%d\n", \ ""#bufsz", "#result", "#retval", "#__VA_ARGS__, \ buf, r); \ exit(1); \ } \ printf("test(\"%s\":%d) passed\n", buf, r); \ } while(0); /** test program */ int main(void) { int x = 0; /* bufsize, expectedstring, expectedretval, snprintf arguments */ DOTEST(1024, "hello", 5, "hello"); DOTEST(1024, "h", 1, "h"); /* warning from gcc for format string, but it does work * DOTEST(1024, "", 0, ""); */ DOTEST(3, "he", 5, "hello"); DOTEST(1, "", 7, "%d", 7823089); /* test positive numbers */ DOTEST(1024, "0", 1, "%d", 0); DOTEST(1024, "1", 1, "%d", 1); DOTEST(1024, "9", 1, "%d", 9); DOTEST(1024, "15", 2, "%d", 15); DOTEST(1024, "ab15cd", 6, "ab%dcd", 15); DOTEST(1024, "167", 3, "%d", 167); DOTEST(1024, "7823089", 7, "%d", 7823089); DOTEST(1024, " 12", 3, "%3d", 12); DOTEST(1024, "012", 3, "%.3d", 12); DOTEST(1024, "012", 3, "%3.3d", 12); DOTEST(1024, "012", 3, "%03d", 12); DOTEST(1024, " 012", 4, "%4.3d", 12); DOTEST(1024, "", 0, "%.0d", 0); /* test negative numbers */ DOTEST(1024, "-1", 2, "%d", -1); DOTEST(1024, "-12", 3, "%3d", -12); DOTEST(1024, " -2", 3, "%3d", -2); DOTEST(1024, "-012", 4, "%.3d", -12); DOTEST(1024, "-012", 4, "%3.3d", -12); DOTEST(1024, "-012", 4, "%4.3d", -12); DOTEST(1024, " -012", 5, "%5.3d", -12); DOTEST(1024, "-12", 3, "%03d", -12); DOTEST(1024, "-02", 3, "%03d", -2); DOTEST(1024, "-15", 3, "%d", -15); DOTEST(1024, "-7307", 5, "%d", -7307); DOTEST(1024, "-12 ", 5, "%-5d", -12); DOTEST(1024, "-00012", 6, "%-.5d", -12); /* test + and space flags */ DOTEST(1024, "+12", 3, "%+d", 12); DOTEST(1024, " 12", 3, "% d", 12); /* test %u */ DOTEST(1024, "12", 2, "%u", 12); DOTEST(1024, "0", 1, "%u", 0); DOTEST(1024, "4294967295", 10, "%u", 0xffffffff); /* test %x */ DOTEST(1024, "0", 1, "%x", 0); DOTEST(1024, "c", 1, "%x", 12); DOTEST(1024, "12ab34cd", 8, "%x", 0x12ab34cd); /* test %llu, %lld */ DOTEST(1024, "18446744073709551615", 20, "%llu", (long long)0xffffffffffffffff); DOTEST(1024, "-9223372036854775808", 20, "%lld", (long long)0x8000000000000000); DOTEST(1024, "9223372036854775808", 19, "%llu", (long long)0x8000000000000000); /* test %s */ DOTEST(1024, "hello", 5, "%s", "hello"); DOTEST(1024, " hello", 10, "%10s", "hello"); DOTEST(1024, "hello ", 10, "%-10s", "hello"); DOTEST(1024, "he", 2, "%.2s", "hello"); DOTEST(1024, " he", 4, "%4.2s", "hello"); DOTEST(1024, " h", 4, "%4.2s", "h"); /* test %c */ DOTEST(1024, "a", 1, "%c", 'a'); /* warning from gcc for format string, but it does work DOTEST(1024, " a", 5, "%5c", 'a'); DOTEST(1024, "a", 1, "%.0c", 'a'); */ /* test %n */ DOTEST(1024, "hello", 5, "hello%n", &x); if(x != 5) { printf("the %%n failed\n"); exit(1); } /* test %m */ errno = 0; DOTEST(1024, "Success", 7, "%m"); /* test %p */ DOTEST(1024, "0x10", 4, "%p", (void*)0x10); DOTEST(1024, "(nil)", 5, "%p", (void*)0x0); /* test %% */ DOTEST(1024, "%", 1, "%%"); /* test %f */ DOTEST(1024, "0.000000", 8, "%f", 0.0); DOTEST(1024, "0.00", 4, "%.2f", 0.0); /* differs, "-0.00" DOTEST(1024, "0.00", 4, "%.2f", -0.0); */ DOTEST(1024, "234.00", 6, "%.2f", 234.005); DOTEST(1024, "8973497.1246", 12, "%.4f", 8973497.12456); DOTEST(1024, "-12.000000", 10, "%f", -12.0); DOTEST(1024, "6", 1, "%.0f", 6.0); DOTEST(1024, "6", 1, "%g", 6.0); DOTEST(1024, "6.1", 3, "%g", 6.1); DOTEST(1024, "6.15", 4, "%g", 6.15); /* These format strings are from the code of NSD, Unbound, ldns */ DOTEST(1024, "abcdef", 6, "%s", "abcdef"); DOTEST(1024, "005", 3, "%03u", 5); DOTEST(1024, "12345", 5, "%03u", 12345); DOTEST(1024, "5", 1, "%d", 5); DOTEST(1024, "(nil)", 5, "%p", NULL); DOTEST(1024, "12345", 5, "%ld", (long)12345); DOTEST(1024, "12345", 5, "%lu", (long)12345); DOTEST(1024, " 12345", 12, "%12u", (unsigned)12345); DOTEST(1024, "12345", 5, "%u", (unsigned)12345); DOTEST(1024, "12345", 5, "%llu", (unsigned long long)12345); DOTEST(1024, "12345", 5, "%x", 0x12345); DOTEST(1024, "12345", 5, "%llx", (long long)0x12345); DOTEST(1024, "012345", 6, "%6.6d", 12345); DOTEST(1024, "012345", 6, "%6.6u", 12345); DOTEST(1024, "1234.54", 7, "%g", 1234.54); DOTEST(1024, "123456789.54", 12, "%.12g", 123456789.54); DOTEST(1024, "3456789123456.54", 16, "%.16g", 3456789123456.54); /* %24g does not work with 24 digits, not enough accuracy, * the first 16 digits are correct */ DOTEST(1024, "12345", 5, "%3.3d", 12345); DOTEST(1024, "000", 3, "%3.3d", 0); DOTEST(1024, "001", 3, "%3.3d", 1); DOTEST(1024, "012", 3, "%3.3d", 12); DOTEST(1024, "-012", 4, "%3.3d", -12); DOTEST(1024, "he", 2, "%.2s", "hello"); DOTEST(1024, "helloworld", 10, "%s%s", "hello", "world"); DOTEST(1024, "he", 2, "%.*s", 2, "hello"); DOTEST(1024, " hello", 7, "%*s", 7, "hello"); DOTEST(1024, "hello ", 7, "%*s", -7, "hello"); DOTEST(1024, "0", 1, "%c", '0'); DOTEST(1024, "A", 1, "%c", 'A'); DOTEST(1024, "", 1, "%c", 0); DOTEST(1024, "\010", 1, "%c", 8); DOTEST(1024, "%", 1, "%%"); DOTEST(1024, "0a", 2, "%02x", 0x0a); DOTEST(1024, "bd", 2, "%02x", 0xbd); DOTEST(1024, "12", 2, "%02ld", (long)12); DOTEST(1024, "02", 2, "%02ld", (long)2); DOTEST(1024, "02", 2, "%02u", (unsigned)2); DOTEST(1024, "765432", 6, "%05u", (unsigned)765432); DOTEST(1024, "10.234", 6, "%0.3f", 10.23421); DOTEST(1024, "123456.234", 10, "%0.3f", 123456.23421); DOTEST(1024, "123456789.234", 13, "%0.3f", 123456789.23421); DOTEST(1024, "123456.23", 9, "%.2f", 123456.23421); DOTEST(1024, "123456", 6, "%.0f", 123456.23421); DOTEST(1024, "0123", 4, "%.4x", 0x0123); DOTEST(1024, "00000123", 8, "%.8x", 0x0123); DOTEST(1024, "ffeb0cde", 8, "%.8x", 0xffeb0cde); DOTEST(1024, " 987654321", 10, "%10lu", (unsigned long)987654321); DOTEST(1024, " 987654321", 12, "%12lu", (unsigned long)987654321); DOTEST(1024, "987654321", 9, "%i", 987654321); DOTEST(1024, "-87654321", 9, "%i", -87654321); DOTEST(1024, "hello ", 16, "%-16s", "hello"); DOTEST(1024, " ", 16, "%-16s", ""); DOTEST(1024, "a ", 16, "%-16s", "a"); DOTEST(1024, "foobarfoobar ", 16, "%-16s", "foobarfoobar"); DOTEST(1024, "foobarfoobarfoobar", 18, "%-16s", "foobarfoobarfoobar"); /* combined expressions */ DOTEST(1024, "foo 1.0 size 512 edns", 21, "foo %s size %d %s%s", "1.0", 512, "", "edns"); DOTEST(15, "foo 1.0 size 5", 21, "foo %s size %d %s%s", "1.0", 512, "", "edns"); DOTEST(1024, "packet 1203ceff id", 18, "packet %2.2x%2.2x%2.2x%2.2x id", 0x12, 0x03, 0xce, 0xff); DOTEST(1024, "/tmp/testbound_123abcd.tmp", 26, "/tmp/testbound_%u%s%s.tmp", 123, "ab", "cd"); return 0; } #endif /* SNPRINTF_TEST */ ldns-1.7.0/compat/b64_ntop.c0000644000175000017500000001637613026206166015124 0ustar willemwillem/* * Copyright (c) 1996, 1998 by Internet Software Consortium. * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS * SOFTWARE. */ /* * Portions Copyright (c) 1995 by International Business Machines, Inc. * * International Business Machines, Inc. (hereinafter called IBM) grants * permission under its copyrights to use, copy, modify, and distribute this * Software with or without fee, provided that the above copyright notice and * all paragraphs of this notice appear in all copies, and that the name of IBM * not be used in connection with the marketing of any product incorporating * the Software or modifications thereof, without specific, written prior * permission. * * To the extent it has a right to do so, IBM grants an immunity from suit * under its patents, if any, for the use, sale or manufacture of products to * the extent that such products are used for performing Domain Name System * dynamic updates in TCP/IP networks by means of the Software. No immunity is * granted for any product per se or for any other function of any product. * * THE SOFTWARE IS PROVIDED "AS IS", AND IBM DISCLAIMS ALL WARRANTIES, * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A * PARTICULAR PURPOSE. IN NO EVENT SHALL IBM BE LIABLE FOR ANY SPECIAL, * DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER ARISING * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE, EVEN * IF IBM IS APPRISED OF THE POSSIBILITY OF SUCH DAMAGES. */ #include #include #include #include static const char Base64[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; static const char Pad64 = '='; /* (From RFC1521 and draft-ietf-dnssec-secext-03.txt) The following encoding technique is taken from RFC 1521 by Borenstein and Freed. It is reproduced here in a slightly edited form for convenience. A 65-character subset of US-ASCII is used, enabling 6 bits to be represented per printable character. (The extra 65th character, "=", is used to signify a special processing function.) The encoding process represents 24-bit groups of input bits as output strings of 4 encoded characters. Proceeding from left to right, a 24-bit input group is formed by concatenating 3 8-bit input groups. These 24 bits are then treated as 4 concatenated 6-bit groups, each of which is translated into a single digit in the base64 alphabet. Each 6-bit group is used as an index into an array of 64 printable characters. The character referenced by the index is placed in the output string. Table 1: The Base64 Alphabet Value Encoding Value Encoding Value Encoding Value Encoding 0 A 17 R 34 i 51 z 1 B 18 S 35 j 52 0 2 C 19 T 36 k 53 1 3 D 20 U 37 l 54 2 4 E 21 V 38 m 55 3 5 F 22 W 39 n 56 4 6 G 23 X 40 o 57 5 7 H 24 Y 41 p 58 6 8 I 25 Z 42 q 59 7 9 J 26 a 43 r 60 8 10 K 27 b 44 s 61 9 11 L 28 c 45 t 62 + 12 M 29 d 46 u 63 / 13 N 30 e 47 v 14 O 31 f 48 w (pad) = 15 P 32 g 49 x 16 Q 33 h 50 y Special processing is performed if fewer than 24 bits are available at the end of the data being encoded. A full encoding quantum is always completed at the end of a quantity. When fewer than 24 input bits are available in an input group, zero bits are added (on the right) to form an integral number of 6-bit groups. Padding at the end of the data is performed using the '=' character. Since all base64 input is an integral number of octets, only the ------------------------------------------------- following cases can arise: (1) the final quantum of encoding input is an integral multiple of 24 bits; here, the final unit of encoded output will be an integral multiple of 4 characters with no "=" padding, (2) the final quantum of encoding input is exactly 8 bits; here, the final unit of encoded output will be two characters followed by two "=" padding characters, or (3) the final quantum of encoding input is exactly 16 bits; here, the final unit of encoded output will be three characters followed by one "=" padding character. */ int ldns_b64_ntop(uint8_t const *src, size_t srclength, char *target, size_t targsize) { size_t datalength = 0; uint8_t input[3]; uint8_t output[4]; size_t i; if (srclength == 0) { if (targsize > 0) { target[0] = '\0'; return 0; } else { return -1; } } while (2 < srclength) { input[0] = *src++; input[1] = *src++; input[2] = *src++; srclength -= 3; output[0] = input[0] >> 2; output[1] = ((input[0] & 0x03) << 4) + (input[1] >> 4); output[2] = ((input[1] & 0x0f) << 2) + (input[2] >> 6); output[3] = input[2] & 0x3f; assert(output[0] < 64); assert(output[1] < 64); assert(output[2] < 64); assert(output[3] < 64); if (datalength + 4 > targsize) { return (-1); } target[datalength++] = Base64[output[0]]; target[datalength++] = Base64[output[1]]; target[datalength++] = Base64[output[2]]; target[datalength++] = Base64[output[3]]; } /* Now we worry about padding. */ if (0 != srclength) { /* Get what's left. */ input[0] = input[1] = input[2] = (uint8_t) '\0'; for (i = 0; i < srclength; i++) input[i] = *src++; output[0] = input[0] >> 2; output[1] = ((input[0] & 0x03) << 4) + (input[1] >> 4); output[2] = ((input[1] & 0x0f) << 2) + (input[2] >> 6); assert(output[0] < 64); assert(output[1] < 64); assert(output[2] < 64); if (datalength + 4 > targsize) { return (-2); } target[datalength++] = Base64[output[0]]; target[datalength++] = Base64[output[1]]; if (srclength == 1) { target[datalength++] = Pad64; } else { target[datalength++] = Base64[output[2]]; } target[datalength++] = Pad64; } if (datalength >= targsize) { return (-3); } target[datalength] = '\0'; /* Returned value doesn't count \0. */ return (int) (datalength); } ldns-1.7.0/compat/inet_ntop.c0000644000175000017500000001276013026206166015461 0ustar willemwillem/* From openssh 4.3p2 compat/inet_ntop.c */ /* Copyright (c) 1996 by Internet Software Consortium. * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS * SOFTWARE. */ /* OPENBSD ORIGINAL: lib/libc/net/inet_ntop.c */ #include #ifndef HAVE_INET_NTOP #include #include #ifdef HAVE_SYS_SOCKET_H #include #endif #ifdef HAVE_NETINET_IN_H #include #endif #include #include #include #ifndef IN6ADDRSZ #define IN6ADDRSZ 16 /* IPv6 T_AAAA */ #endif #ifndef INT16SZ #define INT16SZ 2 /* for systems without 16-bit ints */ #endif /* * WARNING: Don't even consider trying to compile this on a system where * sizeof(int) < 4. sizeof(int) > 4 is fine; all the world's not a VAX. */ static const char *inet_ntop4(const u_char *src, char *dst, size_t size); static const char *inet_ntop6(const u_char *src, char *dst, size_t size); /* char * * inet_ntop(af, src, dst, size) * convert a network format address to presentation format. * return: * pointer to presentation format address (`dst'), or NULL (see errno). * author: * Paul Vixie, 1996. */ const char * inet_ntop(int af, const void *src, char *dst, size_t size) { switch (af) { case AF_INET: return (inet_ntop4(src, dst, size)); case AF_INET6: return (inet_ntop6(src, dst, size)); default: #ifdef EAFNOSUPPORT errno = EAFNOSUPPORT; #else errno = ENOSYS; #endif return (NULL); } /* NOTREACHED */ } /* const char * * inet_ntop4(src, dst, size) * format an IPv4 address, more or less like inet_ntoa() * return: * `dst' (as a const) * notes: * (1) uses no statics * (2) takes a u_char* not an in_addr as input * author: * Paul Vixie, 1996. */ static const char * inet_ntop4(const u_char *src, char *dst, size_t size) { static const char fmt[] = "%u.%u.%u.%u"; char tmp[sizeof "255.255.255.255"]; int l; l = snprintf(tmp, size, fmt, src[0], src[1], src[2], src[3]); if (l <= 0 || l >= (int)size) { errno = ENOSPC; return (NULL); } strlcpy(dst, tmp, size); return (dst); } /* const char * * inet_ntop6(src, dst, size) * convert IPv6 binary address into presentation (printable) format * author: * Paul Vixie, 1996. */ static const char * inet_ntop6(const u_char *src, char *dst, size_t size) { /* * Note that int32_t and int16_t need only be "at least" large enough * to contain a value of the specified size. On some systems, like * Crays, there is no such thing as an integer variable with 16 bits. * Keep this in mind if you think this function should have been coded * to use pointer overlays. All the world's not a VAX. */ char tmp[sizeof "ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255"]; char *tp, *ep; struct { int base, len; } best, cur; u_int words[IN6ADDRSZ / INT16SZ]; int i; int advance; /* * Preprocess: * Copy the input (bytewise) array into a wordwise array. * Find the longest run of 0x00's in src[] for :: shorthanding. */ memset(words, '\0', sizeof words); for (i = 0; i < IN6ADDRSZ; i++) words[i / 2] |= (src[i] << ((1 - (i % 2)) << 3)); best.base = -1; best.len = 0; cur.base = -1; cur.len = 0; for (i = 0; i < (IN6ADDRSZ / INT16SZ); i++) { if (words[i] == 0) { if (cur.base == -1) cur.base = i, cur.len = 1; else cur.len++; } else { if (cur.base != -1) { if (best.base == -1 || cur.len > best.len) best = cur; cur.base = -1; } } } if (cur.base != -1) { if (best.base == -1 || cur.len > best.len) best = cur; } if (best.base != -1 && best.len < 2) best.base = -1; /* * Format the result. */ tp = tmp; ep = tmp + sizeof(tmp); for (i = 0; i < (IN6ADDRSZ / INT16SZ) && tp < ep; i++) { /* Are we inside the best run of 0x00's? */ if (best.base != -1 && i >= best.base && i < (best.base + best.len)) { if (i == best.base) { if (tp + 1 >= ep) return (NULL); *tp++ = ':'; } continue; } /* Are we following an initial run of 0x00s or any real hex? */ if (i != 0) { if (tp + 1 >= ep) return (NULL); *tp++ = ':'; } /* Is this address an encapsulated IPv4? */ if (i == 6 && best.base == 0 && (best.len == 6 || (best.len == 5 && words[5] == 0xffff))) { if (!inet_ntop4(src+12, tp, (size_t)(ep - tp))) return (NULL); tp += strlen(tp); break; } advance = snprintf(tp, ep - tp, "%x", words[i]); if (advance <= 0 || advance >= ep - tp) return (NULL); tp += advance; } /* Was it a trailing run of 0x00's? */ if (best.base != -1 && (best.base + best.len) == (IN6ADDRSZ / INT16SZ)) { if (tp + 1 >= ep) return (NULL); *tp++ = ':'; } if (tp + 1 >= ep) return (NULL); *tp++ = '\0'; /* * Check for overflow, copy, and we're done. */ if ((size_t)(tp - tmp) > size) { errno = ENOSPC; return (NULL); } strlcpy(dst, tmp, size); return (dst); } #endif /* !HAVE_INET_NTOP */ ldns-1.7.0/compat/malloc.c0000644000175000017500000000061513026206166014725 0ustar willemwillem/* Just a replacement, if the original malloc is not GNU-compliant. See autoconf documentation. */ #if HAVE_CONFIG_H #include #endif #undef malloc #include void *malloc (size_t n); /* Allocate an N-byte block of memory from the heap. If N is zero, allocate a 1-byte block. */ void * rpl_malloc (size_t n) { if (n == 0) n = 1; return malloc (n); } ldns-1.7.0/compat/strlcpy.c0000644000175000017500000000321213026206166015152 0ustar willemwillem/* from openssh 4.3p2 compat/strlcpy.c */ /* * Copyright (c) 1998 Todd C. Miller * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ /* OPENBSD ORIGINAL: lib/libc/string/strlcpy.c */ #include #ifndef HAVE_STRLCPY #include #include /* * Copy src to string dst of size siz. At most siz-1 characters * will be copied. Always NUL terminates (unless siz == 0). * Returns strlen(src); if retval >= siz, truncation occurred. */ size_t strlcpy(char *dst, const char *src, size_t siz) { char *d = dst; const char *s = src; size_t n = siz; /* Copy as many bytes as will fit */ if (n != 0 && --n != 0) { do { if ((*d++ = *s++) == 0) break; } while (--n != 0); } /* Not enough room in dst, add NUL and traverse rest of src */ if (n == 0) { if (siz != 0) *d = '\0'; /* NUL-terminate dst */ while (*s++) ; } return(s - src - 1); /* count does not include NUL */ } #endif /* !HAVE_STRLCPY */ ldns-1.7.0/compat/fake-rfc2553.c0000644000175000017500000001411113026206166015447 0ustar willemwillem/* From openssh 4.3p2 filename openbsd-compat/fake-rfc2553.h */ /* * Copyright (C) 2000-2003 Damien Miller. All rights reserved. * Copyright (C) 1999 WIDE Project. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the project nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ /* * Pseudo-implementation of RFC2553 name / address resolution functions * * But these functions are not implemented correctly. The minimum subset * is implemented for ssh use only. For example, this routine assumes * that ai_family is AF_INET. Don't use it for another purpose. */ #include #include #include #include #include #include #include "compat/fake-rfc2553.h" #ifndef HAVE_GETNAMEINFO int getnameinfo(const struct sockaddr *sa, size_t ATTR_UNUSED(salen), char *host, size_t hostlen, char *serv, size_t servlen, int flags) { struct sockaddr_in *sin = (struct sockaddr_in *)sa; struct hostent *hp; char tmpserv[16]; if (serv != NULL) { snprintf(tmpserv, sizeof(tmpserv), "%d", ntohs(sin->sin_port)); if (strlcpy(serv, tmpserv, servlen) >= servlen) return (EAI_MEMORY); } if (host != NULL) { if (flags & NI_NUMERICHOST) { if (strlcpy(host, inet_ntoa(sin->sin_addr), hostlen) >= hostlen) return (EAI_MEMORY); else return (0); } else { hp = gethostbyaddr((char *)&sin->sin_addr, sizeof(struct in_addr), AF_INET); if (hp == NULL) return (EAI_NODATA); if (strlcpy(host, hp->h_name, hostlen) >= hostlen) return (EAI_MEMORY); else return (0); } } return (0); } #endif /* !HAVE_GETNAMEINFO */ #ifndef HAVE_GAI_STRERROR #ifdef HAVE_CONST_GAI_STRERROR_PROTO const char * #else char * #endif gai_strerror(int err) { switch (err) { case EAI_NODATA: return ("no address associated with name"); case EAI_MEMORY: return ("memory allocation failure."); case EAI_NONAME: return ("nodename nor servname provided, or not known"); default: return ("unknown/invalid error."); } } #endif /* !HAVE_GAI_STRERROR */ #ifndef HAVE_FREEADDRINFO void freeaddrinfo(struct addrinfo *ai) { struct addrinfo *next; for(; ai != NULL;) { next = ai->ai_next; free(ai); ai = next; } } #endif /* !HAVE_FREEADDRINFO */ #ifndef HAVE_GETADDRINFO static struct addrinfo *malloc_ai(int port, u_long addr, const struct addrinfo *hints) { struct addrinfo *ai; ai = malloc(sizeof(*ai) + sizeof(struct sockaddr_in)); if (ai == NULL) return (NULL); memset(ai, '\0', sizeof(*ai) + sizeof(struct sockaddr_in)); ai->ai_addr = (struct sockaddr *)(ai + 1); /* XXX -- ssh doesn't use sa_len */ ai->ai_addrlen = sizeof(struct sockaddr_in); ai->ai_addr->sa_family = ai->ai_family = AF_INET; ((struct sockaddr_in *)(ai)->ai_addr)->sin_port = port; ((struct sockaddr_in *)(ai)->ai_addr)->sin_addr.s_addr = addr; /* XXX: the following is not generally correct, but does what we want */ if (hints->ai_socktype) ai->ai_socktype = hints->ai_socktype; else ai->ai_socktype = SOCK_STREAM; if (hints->ai_protocol) ai->ai_protocol = hints->ai_protocol; return (ai); } int getaddrinfo(const char *hostname, const char *servname, const struct addrinfo *hints, struct addrinfo **res) { struct hostent *hp; struct servent *sp; struct in_addr in; int i; long int port; u_long addr; port = 0; if (servname != NULL) { char *cp; port = strtol(servname, &cp, 10); if (port > 0 && port <= 65535 && *cp == '\0') port = htons(port); else if ((sp = getservbyname(servname, NULL)) != NULL) port = sp->s_port; else port = 0; } if (hints && hints->ai_flags & AI_PASSIVE) { addr = htonl(0x00000000); if (hostname && inet_aton(hostname, &in) != 0) addr = in.s_addr; *res = malloc_ai(port, addr, hints); if (*res == NULL) return (EAI_MEMORY); return (0); } if (!hostname) { *res = malloc_ai(port, htonl(0x7f000001), hints); if (*res == NULL) return (EAI_MEMORY); return (0); } if (inet_aton(hostname, &in)) { *res = malloc_ai(port, in.s_addr, hints); if (*res == NULL) return (EAI_MEMORY); return (0); } /* Don't try DNS if AI_NUMERICHOST is set */ if (hints && hints->ai_flags & AI_NUMERICHOST) return (EAI_NONAME); hp = gethostbyname(hostname); if (hp && hp->h_name && hp->h_name[0] && hp->h_addr_list[0]) { struct addrinfo *cur, *prev; cur = prev = *res = NULL; for (i = 0; hp->h_addr_list[i]; i++) { struct in_addr *in = (struct in_addr *)hp->h_addr_list[i]; cur = malloc_ai(port, in->s_addr, hints); if (cur == NULL) { if (*res != NULL) freeaddrinfo(*res); return (EAI_MEMORY); } if (prev) prev->ai_next = cur; else *res = cur; prev = cur; } return (0); } return (EAI_NODATA); } #endif /* !HAVE_GETADDRINFO */ ldns-1.7.0/compat/inet_pton.c0000644000175000017500000001223213026206166015453 0ustar willemwillem/* $KAME: inet_pton.c,v 1.5 2001/08/20 02:32:40 itojun Exp $ */ /* Copyright (c) 1996 by Internet Software Consortium. * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS * SOFTWARE. */ #include #include #include #include /* * WARNING: Don't even consider trying to compile this on a system where * sizeof(int) < 4. sizeof(int) > 4 is fine; all the world's not a VAX. */ static int inet_pton4 (const char *src, uint8_t *dst); static int inet_pton6 (const char *src, uint8_t *dst); /* * * The definitions we might miss. * */ #ifndef NS_INT16SZ #define NS_INT16SZ 2 #endif #ifndef NS_IN6ADDRSZ #define NS_IN6ADDRSZ 16 #endif #ifndef NS_INADDRSZ #define NS_INADDRSZ 4 #endif /* int * inet_pton(af, src, dst) * convert from presentation format (which usually means ASCII printable) * to network format (which is usually some kind of binary format). * return: * 1 if the address was valid for the specified address family * 0 if the address wasn't valid (`dst' is untouched in this case) * -1 if some other error occurred (`dst' is untouched in this case, too) * author: * Paul Vixie, 1996. */ int inet_pton(af, src, dst) int af; const char *src; void *dst; { switch (af) { case AF_INET: return (inet_pton4(src, dst)); case AF_INET6: return (inet_pton6(src, dst)); default: #ifdef EAFNOSUPPORT errno = EAFNOSUPPORT; #else errno = ENOSYS; #endif return (-1); } /* NOTREACHED */ } /* int * inet_pton4(src, dst) * like inet_aton() but without all the hexadecimal and shorthand. * return: * 1 if `src' is a valid dotted quad, else 0. * notice: * does not touch `dst' unless it's returning 1. * author: * Paul Vixie, 1996. */ static int inet_pton4(src, dst) const char *src; uint8_t *dst; { static const char digits[] = "0123456789"; int saw_digit, octets, ch; uint8_t tmp[NS_INADDRSZ], *tp; saw_digit = 0; octets = 0; *(tp = tmp) = 0; while ((ch = *src++) != '\0') { const char *pch; if ((pch = strchr(digits, ch)) != NULL) { uint32_t new = *tp * 10 + (pch - digits); if (new > 255) return (0); *tp = new; if (! saw_digit) { if (++octets > 4) return (0); saw_digit = 1; } } else if (ch == '.' && saw_digit) { if (octets == 4) return (0); *++tp = 0; saw_digit = 0; } else return (0); } if (octets < 4) return (0); memcpy(dst, tmp, NS_INADDRSZ); return (1); } /* int * inet_pton6(src, dst) * convert presentation level address to network order binary form. * return: * 1 if `src' is a valid [RFC1884 2.2] address, else 0. * notice: * (1) does not touch `dst' unless it's returning 1. * (2) :: in a full address is silently ignored. * credit: * inspired by Mark Andrews. * author: * Paul Vixie, 1996. */ static int inet_pton6(src, dst) const char *src; uint8_t *dst; { static const char xdigits_l[] = "0123456789abcdef", xdigits_u[] = "0123456789ABCDEF"; uint8_t tmp[NS_IN6ADDRSZ], *tp, *endp, *colonp; const char *xdigits, *curtok; int ch, saw_xdigit; uint32_t val; memset((tp = tmp), '\0', NS_IN6ADDRSZ); endp = tp + NS_IN6ADDRSZ; colonp = NULL; /* Leading :: requires some special handling. */ if (*src == ':') if (*++src != ':') return (0); curtok = src; saw_xdigit = 0; val = 0; while ((ch = *src++) != '\0') { const char *pch; if ((pch = strchr((xdigits = xdigits_l), ch)) == NULL) pch = strchr((xdigits = xdigits_u), ch); if (pch != NULL) { val <<= 4; val |= (pch - xdigits); if (val > 0xffff) return (0); saw_xdigit = 1; continue; } if (ch == ':') { curtok = src; if (!saw_xdigit) { if (colonp) return (0); colonp = tp; continue; } if (tp + NS_INT16SZ > endp) return (0); *tp++ = (uint8_t) (val >> 8) & 0xff; *tp++ = (uint8_t) val & 0xff; saw_xdigit = 0; val = 0; continue; } if (ch == '.' && ((tp + NS_INADDRSZ) <= endp) && inet_pton4(curtok, tp) > 0) { tp += NS_INADDRSZ; saw_xdigit = 0; break; /* '\0' was seen by inet_pton4(). */ } return (0); } if (saw_xdigit) { if (tp + NS_INT16SZ > endp) return (0); *tp++ = (uint8_t) (val >> 8) & 0xff; *tp++ = (uint8_t) val & 0xff; } if (colonp != NULL) { /* * Since some memmove()'s erroneously fail to handle * overlapping regions, we'll do the shift by hand. */ const int n = tp - colonp; int i; for (i = 1; i <= n; i++) { endp[- i] = colonp[n - i]; colonp[n - i] = 0; } tp = endp; } if (tp != endp) return (0); memcpy(dst, tmp, NS_IN6ADDRSZ); return (1); } ldns-1.7.0/compat/localtime_r.c0000644000175000017500000000035513026206166015751 0ustar willemwillem#ifdef HAVE_CONFIG_H #include #endif #ifdef HAVE_TIME_H #include #endif struct tm *localtime_r(const time_t *timep, struct tm *result) { /* no thread safety. */ *result = *localtime(timep); return result; } ldns-1.7.0/compat/memmove.c0000644000175000017500000000167113026206166015126 0ustar willemwillem/* * memmove.c: memmove compat implementation. * * Copyright (c) 2001-2008, NLnet Labs. All rights reserved. * * See LICENSE for the license. */ #include #include void *memmove(void *dest, const void *src, size_t n); void *memmove(void *dest, const void *src, size_t n) { uint8_t* from = (uint8_t*) src; uint8_t* to = (uint8_t*) dest; if (from == to || n == 0) return dest; if (to > from && to-from < (int)n) { /* to overlaps with from */ /* */ /* */ /* copy in reverse, to avoid overwriting from */ int i; for(i=n-1; i>=0; i--) to[i] = from[i]; return dest; } if (from > to && from-to < (int)n) { /* to overlaps with from */ /* */ /* */ /* copy forwards, to avoid overwriting from */ size_t i; for(i=0; i #include #include #include static const char Base64[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; static const char Pad64 = '='; /* (From RFC1521 and draft-ietf-dnssec-secext-03.txt) The following encoding technique is taken from RFC 1521 by Borenstein and Freed. It is reproduced here in a slightly edited form for convenience. A 65-character subset of US-ASCII is used, enabling 6 bits to be represented per printable character. (The extra 65th character, "=", is used to signify a special processing function.) The encoding process represents 24-bit groups of input bits as output strings of 4 encoded characters. Proceeding from left to right, a 24-bit input group is formed by concatenating 3 8-bit input groups. These 24 bits are then treated as 4 concatenated 6-bit groups, each of which is translated into a single digit in the base64 alphabet. Each 6-bit group is used as an index into an array of 64 printable characters. The character referenced by the index is placed in the output string. Table 1: The Base64 Alphabet Value Encoding Value Encoding Value Encoding Value Encoding 0 A 17 R 34 i 51 z 1 B 18 S 35 j 52 0 2 C 19 T 36 k 53 1 3 D 20 U 37 l 54 2 4 E 21 V 38 m 55 3 5 F 22 W 39 n 56 4 6 G 23 X 40 o 57 5 7 H 24 Y 41 p 58 6 8 I 25 Z 42 q 59 7 9 J 26 a 43 r 60 8 10 K 27 b 44 s 61 9 11 L 28 c 45 t 62 + 12 M 29 d 46 u 63 / 13 N 30 e 47 v 14 O 31 f 48 w (pad) = 15 P 32 g 49 x 16 Q 33 h 50 y Special processing is performed if fewer than 24 bits are available at the end of the data being encoded. A full encoding quantum is always completed at the end of a quantity. When fewer than 24 input bits are available in an input group, zero bits are added (on the right) to form an integral number of 6-bit groups. Padding at the end of the data is performed using the '=' character. Since all base64 input is an integral number of octets, only the ------------------------------------------------- following cases can arise: (1) the final quantum of encoding input is an integral multiple of 24 bits; here, the final unit of encoded output will be an integral multiple of 4 characters with no "=" padding, (2) the final quantum of encoding input is exactly 8 bits; here, the final unit of encoded output will be two characters followed by two "=" padding characters, or (3) the final quantum of encoding input is exactly 16 bits; here, the final unit of encoded output will be three characters followed by one "=" padding character. */ /* skips all whitespace anywhere. converts characters, four at a time, starting at (or after) src from base - 64 numbers into three 8 bit bytes in the target area. it returns the number of data bytes stored at the target, or -1 on error. */ int ldns_b64_pton(char const *origsrc, uint8_t *target, size_t targsize) { unsigned char const* src = (unsigned char*)origsrc; int tarindex, state, ch; char *pos; state = 0; tarindex = 0; if (strlen(origsrc) == 0) { return 0; } while ((ch = *src++) != '\0') { if (isspace((unsigned char)ch)) /* Skip whitespace anywhere. */ continue; if (ch == Pad64) break; pos = strchr(Base64, ch); if (pos == 0) { /* A non-base64 character. */ return (-1); } switch (state) { case 0: if (target) { if ((size_t)tarindex >= targsize) return (-1); target[tarindex] = (pos - Base64) << 2; } state = 1; break; case 1: if (target) { if ((size_t)tarindex + 1 >= targsize) return (-1); target[tarindex] |= (pos - Base64) >> 4; target[tarindex+1] = ((pos - Base64) & 0x0f) << 4 ; } tarindex++; state = 2; break; case 2: if (target) { if ((size_t)tarindex + 1 >= targsize) return (-1); target[tarindex] |= (pos - Base64) >> 2; target[tarindex+1] = ((pos - Base64) & 0x03) << 6; } tarindex++; state = 3; break; case 3: if (target) { if ((size_t)tarindex >= targsize) return (-1); target[tarindex] |= (pos - Base64); } tarindex++; state = 0; break; default: abort(); } } /* * We are done decoding Base-64 chars. Let's see if we ended * on a byte boundary, and/or with erroneous trailing characters. */ if (ch == Pad64) { /* We got a pad char. */ ch = *src++; /* Skip it, get next. */ switch (state) { case 0: /* Invalid = in first position */ case 1: /* Invalid = in second position */ return (-1); case 2: /* Valid, means one byte of info */ /* Skip any number of spaces. */ for ((void)NULL; ch != '\0'; ch = *src++) if (!isspace((unsigned char)ch)) break; /* Make sure there is another trailing = sign. */ if (ch != Pad64) return (-1); ch = *src++; /* Skip the = */ /* Fall through to "single trailing =" case. */ /* FALLTHROUGH */ case 3: /* Valid, means two bytes of info */ /* * We know this char is an =. Is there anything but * whitespace after it? */ for ((void)NULL; ch != '\0'; ch = *src++) if (!isspace((unsigned char)ch)) return (-1); /* * Now make sure for cases 2 and 3 that the "extra" * bits that slopped past the last full byte were * zeros. If we don't check them, they become a * subliminal channel. */ if (target && target[tarindex] != 0) return (-1); } } else { /* * We ended by seeing the end of the string. Make sure we * have no partial bytes lying around. */ if (state != 0) return (-1); } return (tarindex); } ldns-1.7.0/compat/isascii.c0000644000175000017500000000034113026206166015076 0ustar willemwillem/* Just a replacement, if the original isascii is not present */ #if HAVE_CONFIG_H #include #endif int isascii(int c); /* true if character is ascii. */ int isascii(int c) { return c >= 0 && c < 128; } ldns-1.7.0/compat/realloc.c0000644000175000017500000000106713026206166015101 0ustar willemwillem/* Just a replacement, if the original malloc is not GNU-compliant. Based on malloc.c */ #if HAVE_CONFIG_H #include #endif #undef realloc #include void *realloc (void*, size_t); void *malloc (size_t); /* Changes allocation to new sizes, copies over old data. * if oldptr is NULL, does a malloc. * if size is zero, allocate 1-byte block.... * (does not return NULL and free block) */ void * rpl_realloc (void* ptr, size_t n) { if (n == 0) n = 1; if(ptr == 0) { return malloc(n); } return realloc(ptr, n); } ldns-1.7.0/compat/fake-rfc2553.h0000644000175000017500000001241113026206166015455 0ustar willemwillem/* From openssh 4.3p2 filename openbsd-compat/fake-rfc2553.h */ /* * Copyright (C) 2000-2003 Damien Miller. All rights reserved. * Copyright (C) 1999 WIDE Project. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the project nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ /* * Pseudo-implementation of RFC2553 name / address resolution functions * * But these functions are not implemented correctly. The minimum subset * is implemented for ssh use only. For example, this routine assumes * that ai_family is AF_INET. Don't use it for another purpose. */ #ifndef _FAKE_RFC2553_H #define _FAKE_RFC2553_H #include #include #include #include #ifdef __cplusplus extern "C" { #endif /* * First, socket and INET6 related definitions */ #ifndef HAVE_STRUCT_SOCKADDR_STORAGE #ifndef _SS_MAXSIZE # define _SS_MAXSIZE 128 /* Implementation specific max size */ # define _SS_PADSIZE (_SS_MAXSIZE - sizeof (struct sockaddr)) struct sockaddr_storage { struct sockaddr ss_sa; char __ss_pad2[_SS_PADSIZE]; }; # define ss_family ss_sa.sa_family #endif /* _SS_MAXSIZE */ #endif /* !HAVE_STRUCT_SOCKADDR_STORAGE */ #ifndef IN6_IS_ADDR_LOOPBACK # define IN6_IS_ADDR_LOOPBACK(a) \ (((uint32_t *)(a))[0] == 0 && ((uint32_t *)(a))[1] == 0 && \ ((uint32_t *)(a))[2] == 0 && ((uint32_t *)(a))[3] == htonl(1)) #endif /* !IN6_IS_ADDR_LOOPBACK */ #ifndef HAVE_STRUCT_IN6_ADDR struct in6_addr { uint8_t s6_addr[16]; }; #endif /* !HAVE_STRUCT_IN6_ADDR */ #ifndef HAVE_STRUCT_SOCKADDR_IN6 struct sockaddr_in6 { unsigned short sin6_family; uint16_t sin6_port; uint32_t sin6_flowinfo; struct in6_addr sin6_addr; }; #endif /* !HAVE_STRUCT_SOCKADDR_IN6 */ #ifndef AF_INET6 /* Define it to something that should never appear */ #define AF_INET6 AF_MAX #endif /* * Next, RFC2553 name / address resolution API */ #ifndef NI_NUMERICHOST # define NI_NUMERICHOST (1) #endif #ifndef NI_NAMEREQD # define NI_NAMEREQD (1<<1) #endif #ifndef NI_NUMERICSERV # define NI_NUMERICSERV (1<<2) #endif #ifndef AI_PASSIVE # define AI_PASSIVE (1) #endif #ifndef AI_CANONNAME # define AI_CANONNAME (1<<1) #endif #ifndef AI_NUMERICHOST # define AI_NUMERICHOST (1<<2) #endif #ifndef NI_MAXSERV # define NI_MAXSERV 32 #endif /* !NI_MAXSERV */ #ifndef NI_MAXHOST # define NI_MAXHOST 1025 #endif /* !NI_MAXHOST */ #ifndef INT_MAX #define INT_MAX 0xffffffff #endif #ifndef EAI_NODATA # define EAI_NODATA (INT_MAX - 1) #endif #ifndef EAI_MEMORY # define EAI_MEMORY (INT_MAX - 2) #endif #ifndef EAI_NONAME # define EAI_NONAME (INT_MAX - 3) #endif #ifndef EAI_SYSTEM # define EAI_SYSTEM (INT_MAX - 4) #endif #ifndef HAVE_STRUCT_ADDRINFO struct addrinfo { int ai_flags; /* AI_PASSIVE, AI_CANONNAME */ int ai_family; /* PF_xxx */ int ai_socktype; /* SOCK_xxx */ int ai_protocol; /* 0 or IPPROTO_xxx for IPv4 and IPv6 */ size_t ai_addrlen; /* length of ai_addr */ char *ai_canonname; /* canonical name for hostname */ struct sockaddr *ai_addr; /* binary address */ struct addrinfo *ai_next; /* next structure in linked list */ }; #endif /* !HAVE_STRUCT_ADDRINFO */ #ifndef HAVE_GETADDRINFO #ifdef getaddrinfo # undef getaddrinfo #endif #define getaddrinfo(a,b,c,d) (ssh_getaddrinfo(a,b,c,d)) int getaddrinfo(const char *, const char *, const struct addrinfo *, struct addrinfo **); #endif /* !HAVE_GETADDRINFO */ #if !defined(HAVE_GAI_STRERROR) && !defined(HAVE_CONST_GAI_STRERROR_PROTO) #define gai_strerror(a) (ssh_gai_strerror(a)) char *gai_strerror(int); #endif /* !HAVE_GAI_STRERROR */ #ifndef HAVE_FREEADDRINFO #define freeaddrinfo(a) (ssh_freeaddrinfo(a)) void freeaddrinfo(struct addrinfo *); #endif /* !HAVE_FREEADDRINFO */ #ifndef HAVE_GETNAMEINFO #define getnameinfo(a,b,c,d,e,f,g) (ssh_getnameinfo(a,b,c,d,e,f,g)) int getnameinfo(const struct sockaddr *, size_t, char *, size_t, char *, size_t, int); #endif /* !HAVE_GETNAMEINFO */ #ifdef __cplusplus } #endif #endif /* !_FAKE_RFC2553_H */ ldns-1.7.0/compat/ctime_r.c0000644000175000017500000000040613026206166015076 0ustar willemwillem#ifdef HAVE_CONFIG_H #include #endif #ifdef HAVE_TIME_H #include #endif char *ctime_r(const time_t *timep, char *buf) { /* no thread safety. */ char* result = ctime(timep); if(buf && result) strcpy(buf, result); return result; } ldns-1.7.0/compat/timegm.c0000644000175000017500000000063613026206166014743 0ustar willemwillem#ifdef HAVE_CONFIG_H #include #endif #include #ifdef HAVE_STDLIB_H #include #endif #include time_t timegm (struct tm *tm) { time_t ret; char *tz; tz = getenv("TZ"); putenv((char*)"TZ="); tzset(); ret = mktime(tm); if (tz) { char buf[256]; snprintf(buf, sizeof(buf), "TZ=%s", tz); putenv(tz); } else putenv((char*)"TZ"); tzset(); return ret; } ldns-1.7.0/compat/isblank.c0000644000175000017500000000037713026206166015106 0ustar willemwillem/* Just a replacement, if the original isblank is not present */ #if HAVE_CONFIG_H #include #endif int isblank(int c); /* true if character is a blank (space or tab). C99. */ int isblank(int c) { return (c == ' ') || (c == '\t'); } ldns-1.7.0/compat/calloc.c0000644000175000017500000000063713026206166014717 0ustar willemwillem/* Just a replacement, if the original malloc is not GNU-compliant. See autoconf documentation. */ #if HAVE_CONFIG_H #include #endif void *calloc(); #if !HAVE_BZERO && HAVE_MEMSET # define bzero(buf, bytes) ((void) memset (buf, 0, bytes)) #endif void * calloc(size_t num, size_t size) { void *new = malloc(num * size); if (!new) { return NULL; } bzero(new, num * size); return new; } ldns-1.7.0/keys.c0000644000175000017500000015111113026206166013144 0ustar willemwillem/* * keys.c handle private keys for use in DNSSEC * * This module should hide some of the openSSL complexities * and give a general interface for private keys and hmac * handling * * (c) NLnet Labs, 2004-2006 * * See the file LICENSE for the license */ #include #include #ifdef HAVE_SSL #include #include #include #endif /* HAVE_SSL */ ldns_lookup_table ldns_signing_algorithms[] = { { LDNS_SIGN_RSAMD5, "RSAMD5" }, { LDNS_SIGN_RSASHA1, "RSASHA1" }, { LDNS_SIGN_RSASHA1_NSEC3, "RSASHA1-NSEC3-SHA1" }, #ifdef USE_SHA2 { LDNS_SIGN_RSASHA256, "RSASHA256" }, { LDNS_SIGN_RSASHA512, "RSASHA512" }, #endif #ifdef USE_GOST { LDNS_SIGN_ECC_GOST, "ECC-GOST" }, #endif #ifdef USE_ECDSA { LDNS_SIGN_ECDSAP256SHA256, "ECDSAP256SHA256" }, { LDNS_SIGN_ECDSAP384SHA384, "ECDSAP384SHA384" }, #endif #ifdef USE_ED25519 { LDNS_SIGN_ED25519, "ED25519" }, #endif #ifdef USE_ED448 { LDNS_SIGN_ED448, "ED448" }, #endif #ifdef USE_DSA { LDNS_SIGN_DSA, "DSA" }, { LDNS_SIGN_DSA_NSEC3, "DSA-NSEC3-SHA1" }, #endif { LDNS_SIGN_HMACMD5, "hmac-md5.sig-alg.reg.int" }, { LDNS_SIGN_HMACSHA1, "hmac-sha1" }, { LDNS_SIGN_HMACSHA256, "hmac-sha256" }, { LDNS_SIGN_HMACSHA224, "hmac-sha224" }, { LDNS_SIGN_HMACSHA384, "hmac-sha384" }, { LDNS_SIGN_HMACSHA512, "hmac-sha512" }, { 0, NULL } }; ldns_key_list * ldns_key_list_new(void) { ldns_key_list *key_list = LDNS_MALLOC(ldns_key_list); if (!key_list) { return NULL; } else { key_list->_key_count = 0; key_list->_keys = NULL; return key_list; } } ldns_key * ldns_key_new(void) { ldns_key *newkey; newkey = LDNS_MALLOC(ldns_key); if (!newkey) { return NULL; } else { /* some defaults - not sure wether to do this */ ldns_key_set_use(newkey, true); ldns_key_set_flags(newkey, LDNS_KEY_ZONE_KEY); ldns_key_set_origttl(newkey, 0); ldns_key_set_keytag(newkey, 0); ldns_key_set_inception(newkey, 0); ldns_key_set_expiration(newkey, 0); ldns_key_set_pubkey_owner(newkey, NULL); #ifdef HAVE_SSL ldns_key_set_evp_key(newkey, NULL); #endif /* HAVE_SSL */ ldns_key_set_hmac_key(newkey, NULL); ldns_key_set_external_key(newkey, NULL); return newkey; } } ldns_status ldns_key_new_frm_fp(ldns_key **k, FILE *fp) { return ldns_key_new_frm_fp_l(k, fp, NULL); } #ifdef HAVE_SSL ldns_status ldns_key_new_frm_engine(ldns_key **key, ENGINE *e, char *key_id, ldns_algorithm alg) { ldns_key *k; k = ldns_key_new(); if(!k) return LDNS_STATUS_MEM_ERR; #ifndef S_SPLINT_S k->_key.key = ENGINE_load_private_key(e, key_id, UI_OpenSSL(), NULL); if(!k->_key.key) { ldns_key_free(k); return LDNS_STATUS_ERR; } ldns_key_set_algorithm(k, (ldns_signing_algorithm) alg); if (!k->_key.key) { ldns_key_free(k); return LDNS_STATUS_ENGINE_KEY_NOT_LOADED; } #endif /* splint */ *key = k; return LDNS_STATUS_OK; } #endif #ifdef USE_GOST /** store GOST engine reference loaded into OpenSSL library */ ENGINE* ldns_gost_engine = NULL; int ldns_key_EVP_load_gost_id(void) { static int gost_id = 0; const EVP_PKEY_ASN1_METHOD* meth; ENGINE* e; if(gost_id) return gost_id; /* see if configuration loaded gost implementation from other engine*/ meth = EVP_PKEY_asn1_find_str(NULL, "gost2001", -1); if(meth) { EVP_PKEY_asn1_get0_info(&gost_id, NULL, NULL, NULL, NULL, meth); return gost_id; } /* see if engine can be loaded already */ e = ENGINE_by_id("gost"); if(!e) { /* load it ourself, in case statically linked */ ENGINE_load_builtin_engines(); ENGINE_load_dynamic(); e = ENGINE_by_id("gost"); } if(!e) { /* no gost engine in openssl */ return 0; } if(!ENGINE_set_default(e, ENGINE_METHOD_ALL)) { ENGINE_finish(e); ENGINE_free(e); return 0; } meth = EVP_PKEY_asn1_find_str(&e, "gost2001", -1); if(!meth) { /* algo not found */ ENGINE_finish(e); ENGINE_free(e); return 0; } /* Note: do not ENGINE_finish and ENGINE_free the acquired engine * on some platforms this frees up the meth and unloads gost stuff */ ldns_gost_engine = e; EVP_PKEY_asn1_get0_info(&gost_id, NULL, NULL, NULL, NULL, meth); return gost_id; } void ldns_key_EVP_unload_gost(void) { if(ldns_gost_engine) { ENGINE_finish(ldns_gost_engine); ENGINE_free(ldns_gost_engine); ldns_gost_engine = NULL; } } /** read GOST private key */ static EVP_PKEY* ldns_key_new_frm_fp_gost_l(FILE* fp, int* line_nr) { char token[16384]; const unsigned char* pp; int gost_id; EVP_PKEY* pkey; ldns_rdf* b64rdf = NULL; gost_id = ldns_key_EVP_load_gost_id(); if(!gost_id) return NULL; if (ldns_fget_keyword_data_l(fp, "GostAsn1", ": ", token, "\n", sizeof(token), line_nr) == -1) return NULL; while(strlen(token) < 96) { /* read more b64 from the file, b64 split on multiple lines */ if(ldns_fget_token_l(fp, token+strlen(token), "\n", sizeof(token)-strlen(token), line_nr) == -1) return NULL; } if(ldns_str2rdf_b64(&b64rdf, token) != LDNS_STATUS_OK) return NULL; pp = (unsigned char*)ldns_rdf_data(b64rdf); pkey = d2i_PrivateKey(gost_id, NULL, &pp, (int)ldns_rdf_size(b64rdf)); ldns_rdf_deep_free(b64rdf); return pkey; } #endif #ifdef USE_ECDSA /** calculate public key from private key */ static int ldns_EC_KEY_calc_public(EC_KEY* ec) { EC_POINT* pub_key; const EC_GROUP* group; group = EC_KEY_get0_group(ec); pub_key = EC_POINT_new(group); if(!pub_key) return 0; if(!EC_POINT_copy(pub_key, EC_GROUP_get0_generator(group))) { EC_POINT_free(pub_key); return 0; } if(!EC_POINT_mul(group, pub_key, EC_KEY_get0_private_key(ec), NULL, NULL, NULL)) { EC_POINT_free(pub_key); return 0; } if(EC_KEY_set_public_key(ec, pub_key) == 0) { EC_POINT_free(pub_key); return 0; } EC_POINT_free(pub_key); return 1; } /** read ECDSA private key */ static EVP_PKEY* ldns_key_new_frm_fp_ecdsa_l(FILE* fp, ldns_algorithm alg, int* line_nr) { char token[16384]; ldns_rdf* b64rdf = NULL; unsigned char* pp; BIGNUM* bn; EVP_PKEY* evp_key; EC_KEY* ec; if (ldns_fget_keyword_data_l(fp, "PrivateKey", ": ", token, "\n", sizeof(token), line_nr) == -1) return NULL; if(ldns_str2rdf_b64(&b64rdf, token) != LDNS_STATUS_OK) return NULL; pp = (unsigned char*)ldns_rdf_data(b64rdf); if(alg == LDNS_ECDSAP256SHA256) ec = EC_KEY_new_by_curve_name(NID_X9_62_prime256v1); else if(alg == LDNS_ECDSAP384SHA384) ec = EC_KEY_new_by_curve_name(NID_secp384r1); else ec = NULL; if(!ec) { ldns_rdf_deep_free(b64rdf); return NULL; } bn = BN_bin2bn(pp, (int)ldns_rdf_size(b64rdf), NULL); ldns_rdf_deep_free(b64rdf); if(!bn) { EC_KEY_free(ec); return NULL; } EC_KEY_set_private_key(ec, bn); BN_free(bn); if(!ldns_EC_KEY_calc_public(ec)) { EC_KEY_free(ec); return NULL; } evp_key = EVP_PKEY_new(); if(!evp_key) { EC_KEY_free(ec); return NULL; } if (!EVP_PKEY_assign_EC_KEY(evp_key, ec)) { EVP_PKEY_free(evp_key); EC_KEY_free(ec); return NULL; } return evp_key; } #endif #ifdef USE_ED25519 /** turn private key buffer into EC_KEY structure */ static EC_KEY* ldns_ed25519_priv_raw(uint8_t* pkey, int plen) { const unsigned char* pp; uint8_t buf[256]; int buflen = 0; uint8_t pre[] = {0x30, 0x32, 0x02, 0x01, 0x01, 0x04, 0x20}; int pre_len = 7; uint8_t post[] = {0xa0, 0x0b, 0x06, 0x09, 0x2b, 0x06, 0x01, 0x04, 0x01, 0xda, 0x47, 0x0f, 0x01}; int post_len = 13; int i; /* ASN looks like this for ED25519 * 30320201010420 <32byteskey> * andparameters a00b06092b06010401da470f01 * (noparameters, preamble is 30250201010420). * the key is reversed (little endian). */ buflen = pre_len + plen + post_len; if((size_t)buflen > sizeof(buf)) return NULL; memmove(buf, pre, pre_len); /* reverse the pkey into the buf */ for(i=0; i * andparameters a00b06092b06010401da470f01 * (noparameters, preamble is 30250201010420). * the key is reversed (little endian). * * For ED448 the key is 57 bytes, and that changes lengths. * 304b0201010439 <57bytekey> a00b06092b06010401da470f02 */ buflen = pre_len + plen + post_len; if((size_t)buflen > sizeof(buf)) return NULL; memmove(buf, pre, pre_len); /* reverse the pkey into the buf */ for(i=0; i_key.key) { ldns_key_free(k); return LDNS_STATUS_ERR; } #endif /* splint */ #endif break; #ifdef USE_ECDSA case LDNS_SIGN_ECDSAP256SHA256: case LDNS_SIGN_ECDSAP384SHA384: ldns_key_set_algorithm(k, alg); ldns_key_set_evp_key(k, ldns_key_new_frm_fp_ecdsa_l(fp, (ldns_algorithm)alg, line_nr)); #ifndef S_SPLINT_S if(!k->_key.key) { ldns_key_free(k); return LDNS_STATUS_ERR; } #endif /* splint */ break; #endif #ifdef USE_ED25519 case LDNS_SIGN_ED25519: ldns_key_set_algorithm(k, alg); ldns_key_set_evp_key(k, ldns_key_new_frm_fp_ed25519_l(fp, line_nr)); #ifndef S_SPLINT_S if(!k->_key.key) { ldns_key_free(k); return LDNS_STATUS_ERR; } #endif /* splint */ break; #endif #ifdef USE_ED448 case LDNS_SIGN_ED448: ldns_key_set_algorithm(k, alg); ldns_key_set_evp_key(k, ldns_key_new_frm_fp_ed448_l(fp, line_nr)); #ifndef S_SPLINT_S if(!k->_key.key) { ldns_key_free(k); return LDNS_STATUS_ERR; } #endif /* splint */ break; #endif default: ldns_key_free(k); return LDNS_STATUS_SYNTAX_ALG_ERR; } key_rr = ldns_key2rr(k); ldns_key_set_keytag(k, ldns_calc_keytag(key_rr)); ldns_rr_free(key_rr); if (key) { *key = k; return LDNS_STATUS_OK; } ldns_key_free(k); return LDNS_STATUS_ERR; } #ifdef HAVE_SSL RSA * ldns_key_new_frm_fp_rsa(FILE *f) { return ldns_key_new_frm_fp_rsa_l(f, NULL); } RSA * ldns_key_new_frm_fp_rsa_l(FILE *f, int *line_nr) { /* we parse * Modulus: * PublicExponent: * PrivateExponent: * Prime1: * Prime2: * Exponent1: * Exponent2: * Coefficient: * * man 3 RSA: * * struct * { * BIGNUM *n; // public modulus * BIGNUM *e; // public exponent * BIGNUM *d; // private exponent * BIGNUM *p; // secret prime factor * BIGNUM *q; // secret prime factor * BIGNUM *dmp1; // d mod (p-1) * BIGNUM *dmq1; // d mod (q-1) * BIGNUM *iqmp; // q^-1 mod p * // ... * */ char *b; RSA *rsa; uint8_t *buf; int i; BIGNUM *n=NULL, *e=NULL, *d=NULL, *p=NULL, *q=NULL, *dmp1=NULL, *dmq1=NULL, *iqmp=NULL; b = LDNS_XMALLOC(char, LDNS_MAX_LINELEN); buf = LDNS_XMALLOC(uint8_t, LDNS_MAX_LINELEN); rsa = RSA_new(); if (!b || !rsa || !buf) { goto error; } /* I could use functions again, but that seems an overkill, * allthough this also looks tedious */ /* Modules, rsa->n */ if (ldns_fget_keyword_data_l(f, "Modulus", ": ", b, "\n", LDNS_MAX_LINELEN, line_nr) == -1) { goto error; } i = ldns_b64_pton((const char*)b, buf, ldns_b64_ntop_calculate_size(strlen(b))); #ifndef S_SPLINT_S n = BN_bin2bn((const char unsigned*)buf, i, NULL); if (!n) { goto error; } /* PublicExponent, rsa->e */ if (ldns_fget_keyword_data_l(f, "PublicExponent", ": ", b, "\n", LDNS_MAX_LINELEN, line_nr) == -1) { goto error; } i = ldns_b64_pton((const char*)b, buf, ldns_b64_ntop_calculate_size(strlen(b))); e = BN_bin2bn((const char unsigned*)buf, i, NULL); if (!e) { goto error; } /* PrivateExponent, rsa->d */ if (ldns_fget_keyword_data_l(f, "PrivateExponent", ": ", b, "\n", LDNS_MAX_LINELEN, line_nr) == -1) { goto error; } i = ldns_b64_pton((const char*)b, buf, ldns_b64_ntop_calculate_size(strlen(b))); d = BN_bin2bn((const char unsigned*)buf, i, NULL); if (!d) { goto error; } /* Prime1, rsa->p */ if (ldns_fget_keyword_data_l(f, "Prime1", ": ", b, "\n", LDNS_MAX_LINELEN, line_nr) == -1) { goto error; } i = ldns_b64_pton((const char*)b, buf, ldns_b64_ntop_calculate_size(strlen(b))); p = BN_bin2bn((const char unsigned*)buf, i, NULL); if (!p) { goto error; } /* Prime2, rsa->q */ if (ldns_fget_keyword_data_l(f, "Prime2", ": ", b, "\n", LDNS_MAX_LINELEN, line_nr) == -1) { goto error; } i = ldns_b64_pton((const char*)b, buf, ldns_b64_ntop_calculate_size(strlen(b))); q = BN_bin2bn((const char unsigned*)buf, i, NULL); if (!q) { goto error; } /* Exponent1, rsa->dmp1 */ if (ldns_fget_keyword_data_l(f, "Exponent1", ": ", b, "\n", LDNS_MAX_LINELEN, line_nr) == -1) { goto error; } i = ldns_b64_pton((const char*)b, buf, ldns_b64_ntop_calculate_size(strlen(b))); dmp1 = BN_bin2bn((const char unsigned*)buf, i, NULL); if (!dmp1) { goto error; } /* Exponent2, rsa->dmq1 */ if (ldns_fget_keyword_data_l(f, "Exponent2", ": ", b, "\n", LDNS_MAX_LINELEN, line_nr) == -1) { goto error; } i = ldns_b64_pton((const char*)b, buf, ldns_b64_ntop_calculate_size(strlen(b))); dmq1 = BN_bin2bn((const char unsigned*)buf, i, NULL); if (!dmq1) { goto error; } /* Coefficient, rsa->iqmp */ if (ldns_fget_keyword_data_l(f, "Coefficient", ": ", b, "\n", LDNS_MAX_LINELEN, line_nr) == -1) { goto error; } i = ldns_b64_pton((const char*)b, buf, ldns_b64_ntop_calculate_size(strlen(b))); iqmp = BN_bin2bn((const char unsigned*)buf, i, NULL); if (!iqmp) { goto error; } #endif /* splint */ #if OPENSSL_VERSION_NUMBER < 0x10100000 || defined(HAVE_LIBRESSL) # ifndef S_SPLINT_S rsa->n = n; rsa->e = e; rsa->d = d; rsa->p = p; rsa->q = q; rsa->dmp1 = dmp1; rsa->dmq1 = dmq1; rsa->iqmp = iqmp; # endif #else if(!RSA_set0_key(rsa, n, e, d)) goto error; n = NULL; e = NULL; d = NULL; if(!RSA_set0_factors(rsa, p, q)) goto error; p = NULL; q = NULL; if(!RSA_set0_crt_params(rsa, dmp1, dmq1, iqmp)) goto error; #endif LDNS_FREE(buf); LDNS_FREE(b); return rsa; error: RSA_free(rsa); LDNS_FREE(b); LDNS_FREE(buf); BN_free(n); BN_free(e); BN_free(d); BN_free(p); BN_free(q); BN_free(dmp1); BN_free(dmq1); BN_free(iqmp); return NULL; } DSA * ldns_key_new_frm_fp_dsa(FILE *f) { return ldns_key_new_frm_fp_dsa_l(f, NULL); } DSA * ldns_key_new_frm_fp_dsa_l(FILE *f, ATTR_UNUSED(int *line_nr)) { int i; char *d; DSA *dsa; uint8_t *buf; BIGNUM *p=NULL, *q=NULL, *g=NULL, *priv_key=NULL, *pub_key=NULL; d = LDNS_XMALLOC(char, LDNS_MAX_LINELEN); buf = LDNS_XMALLOC(uint8_t, LDNS_MAX_LINELEN); dsa = DSA_new(); if (!d || !dsa || !buf) { goto error; } /* the line parser removes the () from the input... */ /* Prime, dsa->p */ if (ldns_fget_keyword_data_l(f, "Primep", ": ", d, "\n", LDNS_MAX_LINELEN, line_nr) == -1) { goto error; } i = ldns_b64_pton((const char*)d, buf, ldns_b64_ntop_calculate_size(strlen(d))); #ifndef S_SPLINT_S p = BN_bin2bn((const char unsigned*)buf, i, NULL); if (!p) { goto error; } /* Subprime, dsa->q */ if (ldns_fget_keyword_data_l(f, "Subprimeq", ": ", d, "\n", LDNS_MAX_LINELEN, line_nr) == -1) { goto error; } i = ldns_b64_pton((const char*)d, buf, ldns_b64_ntop_calculate_size(strlen(d))); q = BN_bin2bn((const char unsigned*)buf, i, NULL); if (!q) { goto error; } /* Base, dsa->g */ if (ldns_fget_keyword_data_l(f, "Baseg", ": ", d, "\n", LDNS_MAX_LINELEN, line_nr) == -1) { goto error; } i = ldns_b64_pton((const char*)d, buf, ldns_b64_ntop_calculate_size(strlen(d))); g = BN_bin2bn((const char unsigned*)buf, i, NULL); if (!g) { goto error; } /* Private key, dsa->priv_key */ if (ldns_fget_keyword_data_l(f, "Private_valuex", ": ", d, "\n", LDNS_MAX_LINELEN, line_nr) == -1) { goto error; } i = ldns_b64_pton((const char*)d, buf, ldns_b64_ntop_calculate_size(strlen(d))); priv_key = BN_bin2bn((const char unsigned*)buf, i, NULL); if (!priv_key) { goto error; } /* Public key, dsa->priv_key */ if (ldns_fget_keyword_data_l(f, "Public_valuey", ": ", d, "\n", LDNS_MAX_LINELEN, line_nr) == -1) { goto error; } i = ldns_b64_pton((const char*)d, buf, ldns_b64_ntop_calculate_size(strlen(d))); pub_key = BN_bin2bn((const char unsigned*)buf, i, NULL); if (!pub_key) { goto error; } #endif /* splint */ #if OPENSSL_VERSION_NUMBER < 0x10100000 || defined(HAVE_LIBRESSL) # ifndef S_SPLINT_S dsa->p = p; dsa->q = q; dsa->g = g; dsa->priv_key = priv_key; dsa->pub_key = pub_key; # endif #else if(!DSA_set0_pqg(dsa, p, q, g)) goto error; p = NULL; q = NULL; g = NULL; if(!DSA_set0_key(dsa, pub_key, priv_key)) goto error; #endif LDNS_FREE(buf); LDNS_FREE(d); return dsa; error: LDNS_FREE(d); LDNS_FREE(buf); DSA_free(dsa); BN_free(p); BN_free(q); BN_free(g); BN_free(priv_key); BN_free(pub_key); return NULL; } unsigned char * ldns_key_new_frm_fp_hmac(FILE *f, size_t *hmac_size) { return ldns_key_new_frm_fp_hmac_l(f, NULL, hmac_size); } unsigned char * ldns_key_new_frm_fp_hmac_l( FILE *f , ATTR_UNUSED(int *line_nr) , size_t *hmac_size ) { size_t i, bufsz; char d[LDNS_MAX_LINELEN]; unsigned char *buf = NULL; if (ldns_fget_keyword_data_l(f, "Key", ": ", d, "\n", LDNS_MAX_LINELEN, line_nr) == -1) { goto error; } bufsz = ldns_b64_ntop_calculate_size(strlen(d)); buf = LDNS_XMALLOC(unsigned char, bufsz); i = (size_t) ldns_b64_pton((const char*)d, buf, bufsz); *hmac_size = i; return buf; error: LDNS_FREE(buf); *hmac_size = 0; return NULL; } #endif /* HAVE_SSL */ #ifdef USE_GOST static EVP_PKEY* ldns_gen_gost_key(void) { EVP_PKEY_CTX* ctx; EVP_PKEY* p = NULL; int gost_id = ldns_key_EVP_load_gost_id(); if(!gost_id) return NULL; ctx = EVP_PKEY_CTX_new_id(gost_id, NULL); if(!ctx) { /* the id should be available now */ return NULL; } if(EVP_PKEY_CTX_ctrl_str(ctx, "paramset", "A") <= 0) { /* cannot set paramset */ EVP_PKEY_CTX_free(ctx); return NULL; } if(EVP_PKEY_keygen_init(ctx) <= 0) { EVP_PKEY_CTX_free(ctx); return NULL; } if(EVP_PKEY_keygen(ctx, &p) <= 0) { EVP_PKEY_free(p); EVP_PKEY_CTX_free(ctx); return NULL; } EVP_PKEY_CTX_free(ctx); return p; } #endif ldns_key * ldns_key_new_frm_algorithm(ldns_signing_algorithm alg, uint16_t size) { ldns_key *k; #ifdef HAVE_SSL #ifdef USE_DSA DSA *d; #endif /* USE_DSA */ # ifdef USE_ECDSA EC_KEY *ec = NULL; # endif # ifdef HAVE_EVP_PKEY_KEYGEN EVP_PKEY_CTX *ctx; # else RSA *r; # endif #else int i; uint16_t offset = 0; #endif unsigned char *hmac; k = ldns_key_new(); if (!k) { return NULL; } switch(alg) { case LDNS_SIGN_RSAMD5: case LDNS_SIGN_RSASHA1: case LDNS_SIGN_RSASHA1_NSEC3: case LDNS_SIGN_RSASHA256: case LDNS_SIGN_RSASHA512: #ifdef HAVE_SSL #ifdef HAVE_EVP_PKEY_KEYGEN ctx = EVP_PKEY_CTX_new_id(EVP_PKEY_RSA, NULL); if(!ctx) { ldns_key_free(k); return NULL; } if(EVP_PKEY_keygen_init(ctx) <= 0) { ldns_key_free(k); EVP_PKEY_CTX_free(ctx); return NULL; } if (EVP_PKEY_CTX_set_rsa_keygen_bits(ctx, size) <= 0) { ldns_key_free(k); EVP_PKEY_CTX_free(ctx); return NULL; } #ifndef S_SPLINT_S if (EVP_PKEY_keygen(ctx, &k->_key.key) <= 0) { ldns_key_free(k); EVP_PKEY_CTX_free(ctx); return NULL; } #endif EVP_PKEY_CTX_free(ctx); #else /* HAVE_EVP_PKEY_KEYGEN */ r = RSA_generate_key((int)size, RSA_F4, NULL, NULL); if(!r) { ldns_key_free(k); return NULL; } if (RSA_check_key(r) != 1) { ldns_key_free(k); return NULL; } ldns_key_set_rsa_key(k, r); RSA_free(r); #endif /* HAVE_EVP_PKEY_KEYGEN */ #endif /* HAVE_SSL */ break; case LDNS_SIGN_DSA: case LDNS_SIGN_DSA_NSEC3: #ifdef USE_DSA #ifdef HAVE_SSL # if OPENSSL_VERSION_NUMBER < 0x00908000L d = DSA_generate_parameters((int)size, NULL, 0, NULL, NULL, NULL, NULL); if (!d) { ldns_key_free(k); return NULL; } # else if (! (d = DSA_new())) { ldns_key_free(k); return NULL; } if (! DSA_generate_parameters_ex(d, (int)size, NULL, 0, NULL, NULL, NULL)) { DSA_free(d); ldns_key_free(k); return NULL; } # endif if (DSA_generate_key(d) != 1) { ldns_key_free(k); return NULL; } ldns_key_set_dsa_key(k, d); DSA_free(d); #endif /* HAVE_SSL */ #endif /* USE_DSA */ break; case LDNS_SIGN_HMACMD5: case LDNS_SIGN_HMACSHA1: case LDNS_SIGN_HMACSHA224: case LDNS_SIGN_HMACSHA256: case LDNS_SIGN_HMACSHA384: case LDNS_SIGN_HMACSHA512: #ifdef HAVE_SSL #ifndef S_SPLINT_S k->_key.key = NULL; #endif /* splint */ #endif /* HAVE_SSL */ size = size / 8; ldns_key_set_hmac_size(k, size); hmac = LDNS_XMALLOC(unsigned char, size); if(!hmac) { ldns_key_free(k); return NULL; } #ifdef HAVE_SSL if (RAND_bytes(hmac, (int) size) != 1) { LDNS_FREE(hmac); ldns_key_free(k); return NULL; } #else while (offset + sizeof(i) < size) { i = random(); memcpy(&hmac[offset], &i, sizeof(i)); offset += sizeof(i); } if (offset < size) { i = random(); memcpy(&hmac[offset], &i, size - offset); } #endif /* HAVE_SSL */ ldns_key_set_hmac_key(k, hmac); ldns_key_set_flags(k, 0); break; case LDNS_SIGN_ECC_GOST: #if defined(HAVE_SSL) && defined(USE_GOST) ldns_key_set_evp_key(k, ldns_gen_gost_key()); #ifndef S_SPLINT_S if(!k->_key.key) { ldns_key_free(k); return NULL; } #endif /* splint */ #else ldns_key_free(k); return NULL; #endif /* HAVE_SSL and USE_GOST */ break; case LDNS_SIGN_ECDSAP256SHA256: case LDNS_SIGN_ECDSAP384SHA384: #ifdef USE_ECDSA if(alg == LDNS_SIGN_ECDSAP256SHA256) ec = EC_KEY_new_by_curve_name(NID_X9_62_prime256v1); else if(alg == LDNS_SIGN_ECDSAP384SHA384) ec = EC_KEY_new_by_curve_name(NID_secp384r1); if(!ec) { ldns_key_free(k); return NULL; } if(!EC_KEY_generate_key(ec)) { ldns_key_free(k); EC_KEY_free(ec); return NULL; } #ifndef S_SPLINT_S k->_key.key = EVP_PKEY_new(); if(!k->_key.key) { ldns_key_free(k); EC_KEY_free(ec); return NULL; } if (!EVP_PKEY_assign_EC_KEY(k->_key.key, ec)) { ldns_key_free(k); EC_KEY_free(ec); return NULL; } #endif /* splint */ #else ldns_key_free(k); return NULL; #endif /* ECDSA */ break; #ifdef USE_ED25519 case LDNS_SIGN_ED25519: #ifdef HAVE_EVP_PKEY_KEYGEN ctx = EVP_PKEY_CTX_new_id(EVP_PKEY_EC, NULL); if(!ctx) { ldns_key_free(k); return NULL; } if(EVP_PKEY_keygen_init(ctx) <= 0) { ldns_key_free(k); EVP_PKEY_CTX_free(ctx); return NULL; } if (EVP_PKEY_CTX_set_ec_paramgen_curve_nid(ctx, NID_X25519) <= 0) { ldns_key_free(k); EVP_PKEY_CTX_free(ctx); return NULL; } if (EVP_PKEY_keygen(ctx, &k->_key.key) <= 0) { ldns_key_free(k); EVP_PKEY_CTX_free(ctx); return NULL; } EVP_PKEY_CTX_free(ctx); #endif break; #endif /* ED25519 */ #ifdef USE_ED448 case LDNS_SIGN_ED448: #ifdef HAVE_EVP_PKEY_KEYGEN ctx = EVP_PKEY_CTX_new_id(EVP_PKEY_EC, NULL); if(!ctx) { ldns_key_free(k); return NULL; } if(EVP_PKEY_keygen_init(ctx) <= 0) { ldns_key_free(k); EVP_PKEY_CTX_free(ctx); return NULL; } if (EVP_PKEY_CTX_set_ec_paramgen_curve_nid(ctx, NID_X448) <= 0) { ldns_key_free(k); EVP_PKEY_CTX_free(ctx); return NULL; } if (EVP_PKEY_keygen(ctx, &k->_key.key) <= 0) { ldns_key_free(k); EVP_PKEY_CTX_free(ctx); return NULL; } EVP_PKEY_CTX_free(ctx); #endif break; #endif /* ED448 */ } ldns_key_set_algorithm(k, alg); return k; } void ldns_key_print(FILE *output, const ldns_key *k) { char *str = ldns_key2str(k); if (str) { fprintf(output, "%s", str); } else { fprintf(output, "Unable to convert private key to string\n"); } LDNS_FREE(str); } void ldns_key_set_algorithm(ldns_key *k, ldns_signing_algorithm l) { k->_alg = l; } void ldns_key_set_flags(ldns_key *k, uint16_t f) { k->_extra.dnssec.flags = f; } #ifdef HAVE_SSL #ifndef S_SPLINT_S void ldns_key_set_evp_key(ldns_key *k, EVP_PKEY *e) { k->_key.key = e; } void ldns_key_set_rsa_key(ldns_key *k, RSA *r) { EVP_PKEY *key = EVP_PKEY_new(); EVP_PKEY_set1_RSA(key, r); k->_key.key = key; } void ldns_key_set_dsa_key(ldns_key *k, DSA *d) { #ifdef USE_DSA EVP_PKEY *key = EVP_PKEY_new(); EVP_PKEY_set1_DSA(key, d); k->_key.key = key; #else (void)k; (void)d; #endif } void ldns_key_assign_rsa_key(ldns_key *k, RSA *r) { EVP_PKEY *key = EVP_PKEY_new(); EVP_PKEY_assign_RSA(key, r); k->_key.key = key; } void ldns_key_assign_dsa_key(ldns_key *k, DSA *d) { #ifdef USE_DSA EVP_PKEY *key = EVP_PKEY_new(); EVP_PKEY_assign_DSA(key, d); k->_key.key = key; #else (void)k; (void)d; #endif } #endif /* splint */ #endif /* HAVE_SSL */ void ldns_key_set_hmac_key(ldns_key *k, unsigned char *hmac) { k->_key.hmac.key = hmac; } void ldns_key_set_hmac_size(ldns_key *k, size_t hmac_size) { k->_key.hmac.size = hmac_size; } void ldns_key_set_external_key(ldns_key *k, void *external_key) { k->_key.external_key = external_key; } void ldns_key_set_origttl(ldns_key *k, uint32_t t) { k->_extra.dnssec.orig_ttl = t; } void ldns_key_set_inception(ldns_key *k, uint32_t i) { k->_extra.dnssec.inception = i; } void ldns_key_set_expiration(ldns_key *k, uint32_t e) { k->_extra.dnssec.expiration = e; } void ldns_key_set_pubkey_owner(ldns_key *k, ldns_rdf *r) { k->_pubkey_owner = r; } void ldns_key_set_keytag(ldns_key *k, uint16_t tag) { k->_extra.dnssec.keytag = tag; } /* read */ size_t ldns_key_list_key_count(const ldns_key_list *key_list) { return key_list->_key_count; } ldns_key * ldns_key_list_key(const ldns_key_list *key, size_t nr) { if (nr < ldns_key_list_key_count(key)) { return key->_keys[nr]; } else { return NULL; } } ldns_signing_algorithm ldns_key_algorithm(const ldns_key *k) { return k->_alg; } void ldns_key_set_use(ldns_key *k, bool v) { if (k) { k->_use = v; } } bool ldns_key_use(const ldns_key *k) { if (k) { return k->_use; } return false; } #ifdef HAVE_SSL #ifndef S_SPLINT_S EVP_PKEY * ldns_key_evp_key(const ldns_key *k) { return k->_key.key; } RSA * ldns_key_rsa_key(const ldns_key *k) { if (k->_key.key) { return EVP_PKEY_get1_RSA(k->_key.key); } else { return NULL; } } DSA * ldns_key_dsa_key(const ldns_key *k) { #ifdef USE_DSA if (k->_key.key) { return EVP_PKEY_get1_DSA(k->_key.key); } else { return NULL; } #else (void)k; return NULL; #endif } #endif /* splint */ #endif /* HAVE_SSL */ unsigned char * ldns_key_hmac_key(const ldns_key *k) { if (k->_key.hmac.key) { return k->_key.hmac.key; } else { return NULL; } } size_t ldns_key_hmac_size(const ldns_key *k) { if (k->_key.hmac.size) { return k->_key.hmac.size; } else { return 0; } } void * ldns_key_external_key(const ldns_key *k) { return k->_key.external_key; } uint32_t ldns_key_origttl(const ldns_key *k) { return k->_extra.dnssec.orig_ttl; } uint16_t ldns_key_flags(const ldns_key *k) { return k->_extra.dnssec.flags; } uint32_t ldns_key_inception(const ldns_key *k) { return k->_extra.dnssec.inception; } uint32_t ldns_key_expiration(const ldns_key *k) { return k->_extra.dnssec.expiration; } uint16_t ldns_key_keytag(const ldns_key *k) { return k->_extra.dnssec.keytag; } ldns_rdf * ldns_key_pubkey_owner(const ldns_key *k) { return k->_pubkey_owner; } /* write */ void ldns_key_list_set_use(ldns_key_list *keys, bool v) { size_t i; for (i = 0; i < ldns_key_list_key_count(keys); i++) { ldns_key_set_use(ldns_key_list_key(keys, i), v); } } void ldns_key_list_set_key_count(ldns_key_list *key, size_t count) { key->_key_count = count; } bool ldns_key_list_push_key(ldns_key_list *key_list, ldns_key *key) { size_t key_count; ldns_key **keys; key_count = ldns_key_list_key_count(key_list); /* grow the array */ keys = LDNS_XREALLOC( key_list->_keys, ldns_key *, key_count + 1); if (!keys) { return false; } /* add the new member */ key_list->_keys = keys; key_list->_keys[key_count] = key; ldns_key_list_set_key_count(key_list, key_count + 1); return true; } ldns_key * ldns_key_list_pop_key(ldns_key_list *key_list) { size_t key_count; ldns_key** a; ldns_key *pop; if (!key_list) { return NULL; } key_count = ldns_key_list_key_count(key_list); if (key_count == 0) { return NULL; } pop = ldns_key_list_key(key_list, key_count); /* shrink the array */ a = LDNS_XREALLOC(key_list->_keys, ldns_key *, key_count - 1); if(a) { key_list->_keys = a; } ldns_key_list_set_key_count(key_list, key_count - 1); return pop; } #ifdef HAVE_SSL #ifndef S_SPLINT_S /* data pointer must be large enough (LDNS_MAX_KEYLEN) */ static bool ldns_key_rsa2bin(unsigned char *data, RSA *k, uint16_t *size) { int i,j; const BIGNUM *n=NULL, *e=NULL; if (!k) { return false; } #if OPENSSL_VERSION_NUMBER < 0x10100000 || defined(HAVE_LIBRESSL) n = k->n; e = k->e; #else RSA_get0_key(k, &n, &e, NULL); #endif if (BN_num_bytes(e) <= 256) { /* normally only this path is executed (small factors are * more common */ data[0] = (unsigned char) BN_num_bytes(e); i = BN_bn2bin(e, data + 1); j = BN_bn2bin(n, data + i + 1); *size = (uint16_t) i + j; } else if (BN_num_bytes(e) <= 65536) { data[0] = 0; /* BN_bn2bin does bigendian, _uint16 also */ ldns_write_uint16(data + 1, (uint16_t) BN_num_bytes(e)); BN_bn2bin(e, data + 3); BN_bn2bin(n, data + 4 + BN_num_bytes(e)); *size = (uint16_t) BN_num_bytes(n) + 6; } else { return false; } return true; } #ifdef USE_DSA /* data pointer must be large enough (LDNS_MAX_KEYLEN) */ static bool ldns_key_dsa2bin(unsigned char *data, DSA *k, uint16_t *size) { uint8_t T; const BIGNUM *p, *q, *g; const BIGNUM *pub_key, *priv_key; if (!k) { return false; } /* See RFC2536 */ # ifdef HAVE_DSA_GET0_PQG DSA_get0_pqg(k, &p, &q, &g); # else p = k->p; q = k->q; g = k->g; # endif # ifdef HAVE_DSA_GET0_KEY DSA_get0_key(k, &pub_key, &priv_key); # else pub_key = k->pub_key; priv_key = k->priv_key; # endif (void)priv_key; *size = (uint16_t)BN_num_bytes(p); T = (*size - 64) / 8; if (T > 8) { #ifdef STDERR_MSGS fprintf(stderr, "DSA key with T > 8 (ie. > 1024 bits)"); fprintf(stderr, " not implemented\n"); #endif return false; } /* size = 64 + (T * 8); */ memset(data, 0, 21 + *size * 3); data[0] = (unsigned char)T; BN_bn2bin(q, data + 1 ); /* 20 octects */ BN_bn2bin(p, data + 21 ); /* offset octects */ BN_bn2bin(g, data + 21 + *size * 2 - BN_num_bytes(g)); BN_bn2bin(pub_key,data + 21 + *size * 3 - BN_num_bytes(pub_key)); *size = 21 + *size * 3; return true; } #endif /* USE_DSA */ #ifdef USE_GOST static bool ldns_key_gost2bin(unsigned char* data, EVP_PKEY* k, uint16_t* size) { int i; unsigned char* pp = NULL; if(i2d_PUBKEY(k, &pp) != 37 + 64) { /* expect 37 byte(ASN header) and 64 byte(X and Y) */ free(pp); return false; } /* omit ASN header */ for(i=0; i<64; i++) data[i] = pp[i+37]; free(pp); *size = 64; return true; } #endif /* USE_GOST */ #endif /* splint */ #endif /* HAVE_SSL */ ldns_rr * ldns_key2rr(const ldns_key *k) { /* this function will convert a the keydata contained in * rsa/dsa pointers to a DNSKEY rr. It will fill in as * much as it can, but it does not know about key-flags * for instance */ ldns_rr *pubkey; ldns_rdf *keybin; unsigned char *bin = NULL; uint16_t size = 0; #ifdef HAVE_SSL RSA *rsa = NULL; #ifdef USE_DSA DSA *dsa = NULL; #endif /* USE_DSA */ #endif /* HAVE_SSL */ #ifdef USE_ECDSA EC_KEY* ec; #endif int internal_data = 0; if (!k) { return NULL; } pubkey = ldns_rr_new(); switch (ldns_key_algorithm(k)) { case LDNS_SIGN_HMACMD5: case LDNS_SIGN_HMACSHA1: case LDNS_SIGN_HMACSHA224: case LDNS_SIGN_HMACSHA256: case LDNS_SIGN_HMACSHA384: case LDNS_SIGN_HMACSHA512: ldns_rr_set_type(pubkey, LDNS_RR_TYPE_KEY); break; default: ldns_rr_set_type(pubkey, LDNS_RR_TYPE_DNSKEY); break; } /* zero-th rdf - flags */ ldns_rr_push_rdf(pubkey, ldns_native2rdf_int16(LDNS_RDF_TYPE_INT16, ldns_key_flags(k))); /* first - proto */ ldns_rr_push_rdf(pubkey, ldns_native2rdf_int8(LDNS_RDF_TYPE_INT8, LDNS_DNSSEC_KEYPROTO)); if (ldns_key_pubkey_owner(k)) { ldns_rr_set_owner(pubkey, ldns_rdf_clone(ldns_key_pubkey_owner(k))); } /* third - da algorithm */ switch(ldns_key_algorithm(k)) { case LDNS_SIGN_RSAMD5: case LDNS_SIGN_RSASHA1: case LDNS_SIGN_RSASHA1_NSEC3: case LDNS_SIGN_RSASHA256: case LDNS_SIGN_RSASHA512: ldns_rr_push_rdf(pubkey, ldns_native2rdf_int8(LDNS_RDF_TYPE_ALG, ldns_key_algorithm(k))); #ifdef HAVE_SSL rsa = ldns_key_rsa_key(k); if (rsa) { bin = LDNS_XMALLOC(unsigned char, LDNS_MAX_KEYLEN); if (!bin) { ldns_rr_free(pubkey); return NULL; } if (!ldns_key_rsa2bin(bin, rsa, &size)) { LDNS_FREE(bin); ldns_rr_free(pubkey); return NULL; } RSA_free(rsa); internal_data = 1; } #endif size++; break; case LDNS_SIGN_DSA: ldns_rr_push_rdf(pubkey, ldns_native2rdf_int8(LDNS_RDF_TYPE_ALG, LDNS_DSA)); #ifdef USE_DSA #ifdef HAVE_SSL dsa = ldns_key_dsa_key(k); if (dsa) { bin = LDNS_XMALLOC(unsigned char, LDNS_MAX_KEYLEN); if (!bin) { ldns_rr_free(pubkey); return NULL; } if (!ldns_key_dsa2bin(bin, dsa, &size)) { LDNS_FREE(bin); ldns_rr_free(pubkey); return NULL; } DSA_free(dsa); internal_data = 1; } #endif /* HAVE_SSL */ #endif /* USE_DSA */ break; case LDNS_SIGN_DSA_NSEC3: ldns_rr_push_rdf(pubkey, ldns_native2rdf_int8(LDNS_RDF_TYPE_ALG, LDNS_DSA_NSEC3)); #ifdef USE_DSA #ifdef HAVE_SSL dsa = ldns_key_dsa_key(k); if (dsa) { bin = LDNS_XMALLOC(unsigned char, LDNS_MAX_KEYLEN); if (!bin) { ldns_rr_free(pubkey); return NULL; } if (!ldns_key_dsa2bin(bin, dsa, &size)) { LDNS_FREE(bin); ldns_rr_free(pubkey); return NULL; } DSA_free(dsa); internal_data = 1; } #endif /* HAVE_SSL */ #endif /* USE_DSA */ break; case LDNS_SIGN_ECC_GOST: ldns_rr_push_rdf(pubkey, ldns_native2rdf_int8( LDNS_RDF_TYPE_ALG, ldns_key_algorithm(k))); #if defined(HAVE_SSL) && defined(USE_GOST) bin = LDNS_XMALLOC(unsigned char, LDNS_MAX_KEYLEN); if (!bin) { ldns_rr_free(pubkey); return NULL; } #ifndef S_SPLINT_S if (!ldns_key_gost2bin(bin, k->_key.key, &size)) { LDNS_FREE(bin); ldns_rr_free(pubkey); return NULL; } #endif /* splint */ internal_data = 1; #else ldns_rr_free(pubkey); return NULL; #endif /* HAVE_SSL and USE_GOST */ break; case LDNS_SIGN_ECDSAP256SHA256: case LDNS_SIGN_ECDSAP384SHA384: #ifdef USE_ECDSA ldns_rr_push_rdf(pubkey, ldns_native2rdf_int8( LDNS_RDF_TYPE_ALG, ldns_key_algorithm(k))); bin = NULL; #ifndef S_SPLINT_S ec = EVP_PKEY_get1_EC_KEY(k->_key.key); #endif EC_KEY_set_conv_form(ec, POINT_CONVERSION_UNCOMPRESSED); size = (uint16_t)i2o_ECPublicKey(ec, NULL); if(!i2o_ECPublicKey(ec, &bin)) { EC_KEY_free(ec); ldns_rr_free(pubkey); return NULL; } if(size > 1) { /* move back one byte to shave off the 0x02 * 'uncompressed' indicator that openssl made * Actually its 0x04 (from implementation). */ assert(bin[0] == POINT_CONVERSION_UNCOMPRESSED); size -= 1; memmove(bin, bin+1, size); } /* down the reference count for ec, its still assigned * to the pkey */ EC_KEY_free(ec); internal_data = 1; #else ldns_rr_free(pubkey); return NULL; #endif /* ECDSA */ break; #ifdef USE_ED25519 case LDNS_SIGN_ED25519: ldns_rr_push_rdf(pubkey, ldns_native2rdf_int8( LDNS_RDF_TYPE_ALG, ldns_key_algorithm(k))); bin = NULL; ec = EVP_PKEY_get1_EC_KEY(k->_key.key); EC_KEY_set_conv_form(ec, POINT_CONVERSION_UNCOMPRESSED); size = (uint16_t)i2o_ECPublicKey(ec, NULL); if(!i2o_ECPublicKey(ec, &bin)) { EC_KEY_free(ec); ldns_rr_free(pubkey); return NULL; } /* down the reference count for ec, its still assigned * to the pkey */ EC_KEY_free(ec); internal_data = 1; break; #endif #ifdef USE_ED448 case LDNS_SIGN_ED448: ldns_rr_push_rdf(pubkey, ldns_native2rdf_int8( LDNS_RDF_TYPE_ALG, ldns_key_algorithm(k))); bin = NULL; ec = EVP_PKEY_get1_EC_KEY(k->_key.key); EC_KEY_set_conv_form(ec, POINT_CONVERSION_UNCOMPRESSED); size = (uint16_t)i2o_ECPublicKey(ec, NULL); if(!i2o_ECPublicKey(ec, &bin)) { EC_KEY_free(ec); ldns_rr_free(pubkey); return NULL; } /* down the reference count for ec, its still assigned * to the pkey */ EC_KEY_free(ec); internal_data = 1; break; #endif case LDNS_SIGN_HMACMD5: case LDNS_SIGN_HMACSHA1: case LDNS_SIGN_HMACSHA224: case LDNS_SIGN_HMACSHA256: case LDNS_SIGN_HMACSHA384: case LDNS_SIGN_HMACSHA512: bin = LDNS_XMALLOC(unsigned char, ldns_key_hmac_size(k)); if (!bin) { ldns_rr_free(pubkey); return NULL; } ldns_rr_push_rdf(pubkey, ldns_native2rdf_int8(LDNS_RDF_TYPE_ALG, ldns_key_algorithm(k))); size = ldns_key_hmac_size(k); memcpy(bin, ldns_key_hmac_key(k), size); internal_data = 1; break; } /* fourth the key bin material */ if (internal_data) { keybin = ldns_rdf_new_frm_data(LDNS_RDF_TYPE_B64, size, bin); LDNS_FREE(bin); ldns_rr_push_rdf(pubkey, keybin); } return pubkey; } void ldns_key_free(ldns_key *key) { LDNS_FREE(key); } void ldns_key_deep_free(ldns_key *key) { unsigned char* hmac; if (ldns_key_pubkey_owner(key)) { ldns_rdf_deep_free(ldns_key_pubkey_owner(key)); } #ifdef HAVE_SSL if (ldns_key_evp_key(key)) { EVP_PKEY_free(ldns_key_evp_key(key)); } #endif /* HAVE_SSL */ if (ldns_key_hmac_key(key)) { hmac = ldns_key_hmac_key(key); LDNS_FREE(hmac); } LDNS_FREE(key); } void ldns_key_list_free(ldns_key_list *key_list) { size_t i; for (i = 0; i < ldns_key_list_key_count(key_list); i++) { ldns_key_deep_free(ldns_key_list_key(key_list, i)); } LDNS_FREE(key_list->_keys); LDNS_FREE(key_list); } ldns_rr * ldns_read_anchor_file(const char *filename) { FILE *fp; /*char line[LDNS_MAX_PACKETLEN];*/ char *line = LDNS_XMALLOC(char, LDNS_MAX_PACKETLEN); int c; size_t i = 0; ldns_rr *r; ldns_status status; if(!line) { return NULL; } fp = fopen(filename, "r"); if (!fp) { #ifdef STDERR_MSGS fprintf(stderr, "Unable to open %s: %s\n", filename, strerror(errno)); #endif LDNS_FREE(line); return NULL; } while ((c = fgetc(fp)) && i+1 < LDNS_MAX_PACKETLEN && c != EOF) { line[i] = c; i++; } line[i] = '\0'; fclose(fp); if (i <= 0) { #ifdef STDERR_MSGS fprintf(stderr, "nothing read from %s", filename); #endif LDNS_FREE(line); return NULL; } else { status = ldns_rr_new_frm_str(&r, line, 0, NULL, NULL); if (status == LDNS_STATUS_OK && (ldns_rr_get_type(r) == LDNS_RR_TYPE_DNSKEY || ldns_rr_get_type(r) == LDNS_RR_TYPE_DS)) { LDNS_FREE(line); return r; } else { #ifdef STDERR_MSGS fprintf(stderr, "Error creating DNSKEY or DS rr from %s: %s\n", filename, ldns_get_errorstr_by_id(status)); #endif LDNS_FREE(line); return NULL; } } } char * ldns_key_get_file_base_name(const ldns_key *key) { ldns_buffer *buffer; char *file_base_name; buffer = ldns_buffer_new(255); ldns_buffer_printf(buffer, "K"); (void)ldns_rdf2buffer_str_dname(buffer, ldns_key_pubkey_owner(key)); ldns_buffer_printf(buffer, "+%03u+%05u", ldns_key_algorithm(key), ldns_key_keytag(key)); file_base_name = ldns_buffer_export(buffer); ldns_buffer_free(buffer); return file_base_name; } int ldns_key_algo_supported(int algo) { ldns_lookup_table *lt = ldns_signing_algorithms; while(lt->name) { if(lt->id == algo) return 1; lt++; } return 0; } ldns_signing_algorithm ldns_get_signing_algorithm_by_name(const char* name) { /* list of (signing algorithm id, alias_name) */ ldns_lookup_table aliases[] = { /* from bind dnssec-keygen */ {LDNS_SIGN_HMACMD5, "HMAC-MD5"}, {LDNS_SIGN_DSA_NSEC3, "NSEC3DSA"}, {LDNS_SIGN_RSASHA1_NSEC3, "NSEC3RSASHA1"}, /* old ldns usage, now RFC names */ #ifdef USE_DSA {LDNS_SIGN_DSA_NSEC3, "DSA_NSEC3" }, #endif {LDNS_SIGN_RSASHA1_NSEC3, "RSASHA1_NSEC3" }, #ifdef USE_GOST {LDNS_SIGN_ECC_GOST, "GOST"}, #endif /* compat with possible output */ {LDNS_DH, "DH"}, {LDNS_ECC, "ECC"}, {LDNS_INDIRECT, "INDIRECT"}, {LDNS_PRIVATEDNS, "PRIVATEDNS"}, {LDNS_PRIVATEOID, "PRIVATEOID"}, {0, NULL}}; ldns_lookup_table* lt = ldns_signing_algorithms; ldns_signing_algorithm a; char *endptr; while(lt->name) { if(strcasecmp(lt->name, name) == 0) return lt->id; lt++; } lt = aliases; while(lt->name) { if(strcasecmp(lt->name, name) == 0) return lt->id; lt++; } a = strtol(name, &endptr, 10); if (*name && !*endptr) return a; return 0; } ldns-1.7.0/buffer.c0000644000175000017500000000736513026206166013455 0ustar willemwillem/* * buffer.c -- generic memory buffer . * * Copyright (c) 2001-2008, NLnet Labs. All rights reserved. * * See LICENSE for the license. * */ #include #include #include ldns_buffer * ldns_buffer_new(size_t capacity) { ldns_buffer *buffer = LDNS_MALLOC(ldns_buffer); if (!buffer) { return NULL; } buffer->_data = (uint8_t *) LDNS_XMALLOC(uint8_t, capacity); if (!buffer->_data) { LDNS_FREE(buffer); return NULL; } buffer->_position = 0; buffer->_limit = buffer->_capacity = capacity; buffer->_fixed = 0; buffer->_status = LDNS_STATUS_OK; ldns_buffer_invariant(buffer); return buffer; } void ldns_buffer_new_frm_data(ldns_buffer *buffer, const void *data, size_t size) { assert(data != NULL); buffer->_position = 0; buffer->_limit = buffer->_capacity = size; buffer->_fixed = 0; buffer->_data = LDNS_XMALLOC(uint8_t, size); if(!buffer->_data) { buffer->_status = LDNS_STATUS_MEM_ERR; return; } memcpy(buffer->_data, data, size); buffer->_status = LDNS_STATUS_OK; ldns_buffer_invariant(buffer); } bool ldns_buffer_set_capacity(ldns_buffer *buffer, size_t capacity) { void *data; ldns_buffer_invariant(buffer); assert(buffer->_position <= capacity); data = (uint8_t *) LDNS_XREALLOC(buffer->_data, uint8_t, capacity); if (!data) { buffer->_status = LDNS_STATUS_MEM_ERR; return false; } else { buffer->_data = data; buffer->_limit = buffer->_capacity = capacity; return true; } } bool ldns_buffer_reserve(ldns_buffer *buffer, size_t amount) { ldns_buffer_invariant(buffer); assert(!buffer->_fixed); if (buffer->_capacity < buffer->_position + amount) { size_t new_capacity = buffer->_capacity * 3 / 2; if (new_capacity < buffer->_position + amount) { new_capacity = buffer->_position + amount; } if (!ldns_buffer_set_capacity(buffer, new_capacity)) { buffer->_status = LDNS_STATUS_MEM_ERR; return false; } } buffer->_limit = buffer->_capacity; return true; } int ldns_buffer_printf(ldns_buffer *buffer, const char *format, ...) { va_list args; int written = 0; size_t remaining; if (ldns_buffer_status_ok(buffer)) { ldns_buffer_invariant(buffer); assert(buffer->_limit == buffer->_capacity); remaining = ldns_buffer_remaining(buffer); va_start(args, format); written = vsnprintf((char *) ldns_buffer_current(buffer), remaining, format, args); va_end(args); if (written == -1) { buffer->_status = LDNS_STATUS_INTERNAL_ERR; return -1; } else if ((size_t) written >= remaining) { if (!ldns_buffer_reserve(buffer, (size_t) written + 1)) { buffer->_status = LDNS_STATUS_MEM_ERR; return -1; } va_start(args, format); written = vsnprintf((char *) ldns_buffer_current(buffer), ldns_buffer_remaining(buffer), format, args); va_end(args); if (written == -1) { buffer->_status = LDNS_STATUS_INTERNAL_ERR; return -1; } } buffer->_position += written; } return written; } void ldns_buffer_free(ldns_buffer *buffer) { if (!buffer) { return; } if (!buffer->_fixed) LDNS_FREE(buffer->_data); LDNS_FREE(buffer); } void * ldns_buffer_export(ldns_buffer *buffer) { buffer->_fixed = 1; return buffer->_data; } int ldns_bgetc(ldns_buffer *buffer) { if (!ldns_buffer_available_at(buffer, buffer->_position, sizeof(uint8_t))) { ldns_buffer_set_position(buffer, ldns_buffer_limit(buffer)); /* ldns_buffer_rewind(buffer);*/ return EOF; } return (int)ldns_buffer_read_u8(buffer); } void ldns_buffer_copy(ldns_buffer* result, const ldns_buffer* from) { size_t tocopy = ldns_buffer_limit(from); if(tocopy > ldns_buffer_capacity(result)) tocopy = ldns_buffer_capacity(result); ldns_buffer_clear(result); ldns_buffer_write(result, ldns_buffer_begin(from), tocopy); ldns_buffer_flip(result); } ldns-1.7.0/linktest.c0000644000175000017500000000021013026206166014017 0ustar willemwillem #include "ldns/config.h" #include int main(void) { ldns_rr *rr = ldns_rr_new(); ldns_rr_free(rr); return 0; } ldns-1.7.0/zone.c0000644000175000017500000001425213026206166013150 0ustar willemwillem/* zone.c * * Functions for ldns_zone structure * a Net::DNS like library for C * * (c) NLnet Labs, 2005-2006 * See the file LICENSE for the license */ #include #include #include #include ldns_rr * ldns_zone_soa(const ldns_zone *z) { return z->_soa; } size_t ldns_zone_rr_count(const ldns_zone *z) { return ldns_rr_list_rr_count(z->_rrs); } void ldns_zone_set_soa(ldns_zone *z, ldns_rr *soa) { z->_soa = soa; } ldns_rr_list * ldns_zone_rrs(const ldns_zone *z) { return z->_rrs; } void ldns_zone_set_rrs(ldns_zone *z, ldns_rr_list *rrlist) { z->_rrs = rrlist; } bool ldns_zone_push_rr_list(ldns_zone *z, const ldns_rr_list *list) { return ldns_rr_list_cat(ldns_zone_rrs(z), list); } bool ldns_zone_push_rr(ldns_zone *z, ldns_rr *rr) { return ldns_rr_list_push_rr(ldns_zone_rrs(z), rr); } /* * Get the list of glue records in a zone * XXX: there should be a way for this to return error, other than NULL, * since NULL is a valid return */ ldns_rr_list * ldns_zone_glue_rr_list(const ldns_zone *z) { /* when do we find glue? It means we find an IP address * (AAAA/A) for a nameserver listed in the zone * * Alg used here: * first find all the zonecuts (NS records) * find all the AAAA or A records (can be done it the * above loop). * * Check if the aaaa/a list are subdomains under the * NS domains. * If yes -> glue, if no -> not glue */ ldns_rr_list *zone_cuts; ldns_rr_list *addr; ldns_rr_list *glue; ldns_rr *r, *ns, *a; ldns_rdf *dname_a, *ns_owner; size_t i,j; zone_cuts = NULL; addr = NULL; glue = NULL; /* we cannot determine glue in a 'zone' without a SOA */ if (!ldns_zone_soa(z)) { return NULL; } zone_cuts = ldns_rr_list_new(); if (!zone_cuts) goto memory_error; addr = ldns_rr_list_new(); if (!addr) goto memory_error; glue = ldns_rr_list_new(); if (!glue) goto memory_error; for(i = 0; i < ldns_zone_rr_count(z); i++) { r = ldns_rr_list_rr(ldns_zone_rrs(z), i); if (ldns_rr_get_type(r) == LDNS_RR_TYPE_A || ldns_rr_get_type(r) == LDNS_RR_TYPE_AAAA) { /* possibly glue */ if (!ldns_rr_list_push_rr(addr, r)) goto memory_error; continue; } if (ldns_rr_get_type(r) == LDNS_RR_TYPE_NS) { /* multiple zones will end up here - * for now; not a problem */ /* don't add NS records for the current zone itself */ if (ldns_rdf_compare(ldns_rr_owner(r), ldns_rr_owner(ldns_zone_soa(z))) != 0) { if (!ldns_rr_list_push_rr(zone_cuts, r)) goto memory_error; } continue; } } /* will sorting make it quicker ?? */ for(i = 0; i < ldns_rr_list_rr_count(zone_cuts); i++) { ns = ldns_rr_list_rr(zone_cuts, i); ns_owner = ldns_rr_owner(ns); for(j = 0; j < ldns_rr_list_rr_count(addr); j++) { a = ldns_rr_list_rr(addr, j); dname_a = ldns_rr_owner(a); if (ldns_dname_is_subdomain(dname_a, ns_owner) || ldns_dname_compare(dname_a, ns_owner) == 0) { /* GLUE! */ if (!ldns_rr_list_push_rr(glue, a)) goto memory_error; } } } ldns_rr_list_free(addr); ldns_rr_list_free(zone_cuts); if (ldns_rr_list_rr_count(glue) == 0) { ldns_rr_list_free(glue); return NULL; } else { return glue; } memory_error: if (zone_cuts) { LDNS_FREE(zone_cuts); } if (addr) { ldns_rr_list_free(addr); } if (glue) { ldns_rr_list_free(glue); } return NULL; } ldns_zone * ldns_zone_new(void) { ldns_zone *z; z = LDNS_MALLOC(ldns_zone); if (!z) { return NULL; } z->_rrs = ldns_rr_list_new(); if (!z->_rrs) { LDNS_FREE(z); return NULL; } ldns_zone_set_soa(z, NULL); return z; } /* we regocnize: * $TTL, $ORIGIN */ ldns_status ldns_zone_new_frm_fp(ldns_zone **z, FILE *fp, const ldns_rdf *origin, uint32_t ttl, ldns_rr_class c) { return ldns_zone_new_frm_fp_l(z, fp, origin, ttl, c, NULL); } /* XXX: class is never used */ ldns_status ldns_zone_new_frm_fp_l(ldns_zone **z, FILE *fp, const ldns_rdf *origin, uint32_t ttl, ldns_rr_class ATTR_UNUSED(c), int *line_nr) { ldns_zone *newzone; ldns_rr *rr; uint32_t my_ttl; ldns_rdf *my_origin; ldns_rdf *my_prev; bool soa_seen = false; /* 2 soa are an error */ ldns_status s; ldns_status ret; /* most cases of error are memory problems */ ret = LDNS_STATUS_MEM_ERR; newzone = NULL; my_origin = NULL; my_prev = NULL; my_ttl = ttl; if (origin) { my_origin = ldns_rdf_clone(origin); if (!my_origin) goto error; /* also set the prev */ my_prev = ldns_rdf_clone(origin); if (!my_prev) goto error; } newzone = ldns_zone_new(); if (!newzone) goto error; while(!feof(fp)) { s = ldns_rr_new_frm_fp_l(&rr, fp, &my_ttl, &my_origin, &my_prev, line_nr); switch (s) { case LDNS_STATUS_OK: if (ldns_rr_get_type(rr) == LDNS_RR_TYPE_SOA) { if (soa_seen) { /* second SOA * just skip, maybe we want to say * something??? */ ldns_rr_free(rr); continue; } soa_seen = true; ldns_zone_set_soa(newzone, rr); /* set origin to soa if not specified */ if (!my_origin) { my_origin = ldns_rdf_clone(ldns_rr_owner(rr)); } continue; } /* a normal RR - as sofar the DNS is normal */ if (!ldns_zone_push_rr(newzone, rr)) goto error; case LDNS_STATUS_SYNTAX_EMPTY: /* empty line was seen */ case LDNS_STATUS_SYNTAX_TTL: /* the function set the ttl */ break; case LDNS_STATUS_SYNTAX_ORIGIN: /* the function set the origin */ break; case LDNS_STATUS_SYNTAX_INCLUDE: ret = LDNS_STATUS_SYNTAX_INCLUDE_ERR_NOTIMPL; break; default: ret = s; goto error; } } if (my_origin) { ldns_rdf_deep_free(my_origin); } if (my_prev) { ldns_rdf_deep_free(my_prev); } if (z) { *z = newzone; } else { ldns_zone_free(newzone); } return LDNS_STATUS_OK; error: if (my_origin) { ldns_rdf_deep_free(my_origin); } if (my_prev) { ldns_rdf_deep_free(my_prev); } if (newzone) { ldns_zone_free(newzone); } return ret; } void ldns_zone_sort(ldns_zone *zone) { ldns_rr_list *zrr; assert(zone != NULL); zrr = ldns_zone_rrs(zone); ldns_rr_list_sort(zrr); } void ldns_zone_free(ldns_zone *zone) { ldns_rr_list_free(zone->_rrs); LDNS_FREE(zone); } void ldns_zone_deep_free(ldns_zone *zone) { ldns_rr_free(zone->_soa); ldns_rr_list_deep_free(zone->_rrs); LDNS_FREE(zone); } ldns-1.7.0/drill/0000755000175000017500000000000013026206202013122 5ustar willemwillemldns-1.7.0/drill/install-sh0000755000175000017500000003253713026206166015151 0ustar willemwillem#!/bin/sh # install - install a program, script, or datafile scriptversion=2009-04-28.21; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. # # Copyright (C) 1994 X Consortium # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the X Consortium shall not # be used in advertising or otherwise to promote the sale, use or other deal- # ings in this Software without prior written authorization from the X Consor- # tium. # # # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent # `make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. nl=' ' IFS=" "" $nl" # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit=${DOITPROG-} if test -z "$doit"; then doit_exec=exec else doit_exec=$doit fi # Put in absolute file names if you don't have them in your path; # or use environment vars. chgrpprog=${CHGRPPROG-chgrp} chmodprog=${CHMODPROG-chmod} chownprog=${CHOWNPROG-chown} cmpprog=${CMPPROG-cmp} cpprog=${CPPROG-cp} mkdirprog=${MKDIRPROG-mkdir} mvprog=${MVPROG-mv} rmprog=${RMPROG-rm} stripprog=${STRIPPROG-strip} posix_glob='?' initialize_posix_glob=' test "$posix_glob" != "?" || { if (set -f) 2>/dev/null; then posix_glob= else posix_glob=: fi } ' posix_mkdir= # Desired mode of installed file. mode=0755 chgrpcmd= chmodcmd=$chmodprog chowncmd= mvcmd=$mvprog rmcmd="$rmprog -f" stripcmd= src= dst= dir_arg= dst_arg= copy_on_change=false no_target_directory= usage="\ Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE or: $0 [OPTION]... SRCFILES... DIRECTORY or: $0 [OPTION]... -t DIRECTORY SRCFILES... or: $0 [OPTION]... -d DIRECTORIES... In the 1st form, copy SRCFILE to DSTFILE. In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. In the 4th, create DIRECTORIES. Options: --help display this help and exit. --version display version info and exit. -c (ignored) -C install only if different (preserve the last data modification time) -d create directories instead of installing files. -g GROUP $chgrpprog installed files to GROUP. -m MODE $chmodprog installed files to MODE. -o USER $chownprog installed files to USER. -s $stripprog installed files. -t DIRECTORY install into DIRECTORY. -T report an error if DSTFILE is a directory. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG " while test $# -ne 0; do case $1 in -c) ;; -C) copy_on_change=true;; -d) dir_arg=true;; -g) chgrpcmd="$chgrpprog $2" shift;; --help) echo "$usage"; exit $?;; -m) mode=$2 case $mode in *' '* | *' '* | *' '* | *'*'* | *'?'* | *'['*) echo "$0: invalid mode: $mode" >&2 exit 1;; esac shift;; -o) chowncmd="$chownprog $2" shift;; -s) stripcmd=$stripprog;; -t) dst_arg=$2 shift;; -T) no_target_directory=true;; --version) echo "$0 $scriptversion"; exit $?;; --) shift break;; -*) echo "$0: invalid option: $1" >&2 exit 1;; *) break;; esac shift done if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. # Otherwise, the last argument is the destination. Remove it from $@. for arg do if test -n "$dst_arg"; then # $@ is not empty: it contains at least $arg. set fnord "$@" "$dst_arg" shift # fnord fi shift # arg dst_arg=$arg done fi if test $# -eq 0; then if test -z "$dir_arg"; then echo "$0: no input file specified." >&2 exit 1 fi # It's OK to call `install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi if test -z "$dir_arg"; then trap '(exit $?); exit' 1 2 13 15 # Set umask so as not to create temps with too-generous modes. # However, 'strip' requires both read and write access to temps. case $mode in # Optimize common cases. *644) cp_umask=133;; *755) cp_umask=22;; *[0-7]) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw='% 200' fi cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; *) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw=,u+rw fi cp_umask=$mode$u_plus_rw;; esac fi for src do # Protect names starting with `-'. case $src in -*) src=./$src;; esac if test -n "$dir_arg"; then dst=$src dstdir=$dst test -d "$dstdir" dstdir_status=$? else # Waiting for this to be detected by the "$cpprog $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if test ! -f "$src" && test ! -d "$src"; then echo "$0: $src does not exist." >&2 exit 1 fi if test -z "$dst_arg"; then echo "$0: no destination specified." >&2 exit 1 fi dst=$dst_arg # Protect names starting with `-'. case $dst in -*) dst=./$dst;; esac # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. if test -d "$dst"; then if test -n "$no_target_directory"; then echo "$0: $dst_arg: Is a directory" >&2 exit 1 fi dstdir=$dst dst=$dstdir/`basename "$src"` dstdir_status=0 else # Prefer dirname, but fall back on a substitute if dirname fails. dstdir=` (dirname "$dst") 2>/dev/null || expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$dst" : 'X\(//\)[^/]' \| \ X"$dst" : 'X\(//\)$' \| \ X"$dst" : 'X\(/\)' \| . 2>/dev/null || echo X"$dst" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q' ` test -d "$dstdir" dstdir_status=$? fi fi obsolete_mkdir_used=false if test $dstdir_status != 0; then case $posix_mkdir in '') # Create intermediate dirs using mode 755 as modified by the umask. # This is like FreeBSD 'install' as of 1997-10-28. umask=`umask` case $stripcmd.$umask in # Optimize common cases. *[2367][2367]) mkdir_umask=$umask;; .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; *[0-7]) mkdir_umask=`expr $umask + 22 \ - $umask % 100 % 40 + $umask % 20 \ - $umask % 10 % 4 + $umask % 2 `;; *) mkdir_umask=$umask,go-w;; esac # With -d, create the new directory with the user-specified mode. # Otherwise, rely on $mkdir_umask. if test -n "$dir_arg"; then mkdir_mode=-m$mode else mkdir_mode= fi posix_mkdir=false case $umask in *[123567][0-7][0-7]) # POSIX mkdir -p sets u+wx bits regardless of umask, which # is incompatible with FreeBSD 'install' when (umask & 300) != 0. ;; *) tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 if (umask $mkdir_umask && exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 then if test -z "$dir_arg" || { # Check for POSIX incompatibilities with -m. # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or # other-writeable bit of parent directory when it shouldn't. # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. ls_ld_tmpdir=`ls -ld "$tmpdir"` case $ls_ld_tmpdir in d????-?r-*) different_mode=700;; d????-?--*) different_mode=755;; *) false;; esac && $mkdirprog -m$different_mode -p -- "$tmpdir" && { ls_ld_tmpdir_1=`ls -ld "$tmpdir"` test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" } } then posix_mkdir=: fi rmdir "$tmpdir/d" "$tmpdir" else # Remove any dirs left behind by ancient mkdir implementations. rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null fi trap '' 0;; esac;; esac if $posix_mkdir && ( umask $mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" ) then : else # The umask is ridiculous, or mkdir does not conform to POSIX, # or it failed possibly due to a race condition. Create the # directory the slow way, step by step, checking for races as we go. case $dstdir in /*) prefix='/';; -*) prefix='./';; *) prefix='';; esac eval "$initialize_posix_glob" oIFS=$IFS IFS=/ $posix_glob set -f set fnord $dstdir shift $posix_glob set +f IFS=$oIFS prefixes= for d do test -z "$d" && continue prefix=$prefix$d if test -d "$prefix"; then prefixes= else if $posix_mkdir; then (umask=$mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break # Don't fail if two instances are running concurrently. test -d "$prefix" || exit 1 else case $prefix in *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; *) qprefix=$prefix;; esac prefixes="$prefixes '$qprefix'" fi fi prefix=$prefix/ done if test -n "$prefixes"; then # Don't fail if two instances are running concurrently. (umask $mkdir_umask && eval "\$doit_exec \$mkdirprog $prefixes") || test -d "$dstdir" || exit 1 obsolete_mkdir_used=true fi fi fi if test -n "$dir_arg"; then { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 else # Make a couple of temp file names in the proper directory. dsttmp=$dstdir/_inst.$$_ rmtmp=$dstdir/_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 # Copy the file name to the temp name. (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && # and set any options; do chmod last to preserve setuid bits. # # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $cpprog $src $dsttmp" command. # { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && # If -C, don't bother to copy if it wouldn't change the file. if $copy_on_change && old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && eval "$initialize_posix_glob" && $posix_glob set -f && set X $old && old=:$2:$4:$5:$6 && set X $new && new=:$2:$4:$5:$6 && $posix_glob set +f && test "$old" = "$new" && $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 then rm -f "$dsttmp" else # Rename the file to the real destination. $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || # The rename failed, perhaps because mv can't rename something else # to itself, or perhaps because mv is so ancient that it does not # support -f. { # Now remove or move aside any old file at destination location. # We try this two ways since rm can't unlink itself on some # systems and the destination file might be busy for other # reasons. In this case, the final cleanup might fail but the new # file should still install successfully. { test ! -f "$dst" || $doit $rmcmd -f "$dst" 2>/dev/null || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } } || { echo "$0: cannot unlink or rename $dst" >&2 (exit 1); exit 1 } } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dst" } fi || exit 1 trap '' 0 fi done # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: ldns-1.7.0/drill/drill.c0000644000175000017500000007042513026206166014415 0ustar willemwillem/* * drill.c * the main file of drill * (c) 2005-2008 NLnet Labs * * See the file LICENSE for the license * */ #include "drill.h" #include #ifdef HAVE_SSL #include #endif /* query debug, 2 hex dumps */ int verbosity; static int is_ixfr_with_serial(const char* name, uint32_t *serial) { char* end; if (strlen(name) > 5 && strncasecmp(name, "IXFR", 4) == 0 && name[4] == '=') { *serial = (uint32_t) strtol((name+5), &end, 10); return 1; } return 0; } static void usage(FILE *stream, const char *progname) { fprintf(stream, " Usage: %s name [@server] [type] [class]\n", progname); fprintf(stream, "\t can be a domain name or an IP address (-x lookups)\n"); fprintf(stream, "\t defaults to A\n"); fprintf(stream, "\t defaults to IN\n"); fprintf(stream, "\n\targuments may be placed in random order\n"); fprintf(stream, "\n Options:\n"); fprintf(stream, "\t-D\t\tenable DNSSEC (DO bit)\n"); #ifdef HAVE_SSL fprintf(stream, "\t-T\t\ttrace from the root down to \n"); fprintf(stream, "\t-S\t\tchase signature(s) from to a known key [*]\n"); #endif /*HAVE_SSL*/ fprintf(stream, "\t-I
\tsource address to query from\n"); fprintf(stream, "\t-V \tverbosity (0-5)\n"); fprintf(stream, "\t-Q\t\tquiet mode (overrules -V)\n"); fprintf(stream, "\n"); fprintf(stream, "\t-f file\t\tread packet from file and send it\n"); fprintf(stream, "\t-i file\t\tread packet from file and print it\n"); fprintf(stream, "\t-w file\t\twrite answer packet to file\n"); fprintf(stream, "\t-q file\t\twrite query packet to file\n"); fprintf(stream, "\t-h\t\tshow this help\n"); fprintf(stream, "\t-v\t\tshow version\n"); fprintf(stream, "\n Query options:\n"); fprintf(stream, "\t-4\t\tstay on ip4\n"); fprintf(stream, "\t-6\t\tstay on ip6\n"); fprintf(stream, "\t-a\t\tfallback to EDNS0 and TCP if the answer is truncated\n"); fprintf(stream, "\t-b \tuse as the buffer size (defaults to 512 b)\n"); fprintf(stream, "\t-c \tuse file for rescursive nameserver configuration" "\n\t\t\t(/etc/resolv.conf)\n"); fprintf(stream, "\t-k \tspecify a file that contains a trusted DNSSEC key [**]\n"); fprintf(stream, "\t\t\tUsed to verify any signatures in the current answer.\n"); fprintf(stream, "\t\t\tWhen DNSSEC enabled tracing (-TD) or signature\n" "\t\t\tchasing (-S) and no key files are given, keys are read\n" "\t\t\tfrom: %s\n", LDNS_TRUST_ANCHOR_FILE); fprintf(stream, "\t-o \tset flags to:" "\n\t\t\t[QR|qr][AA|aa][TC|tc][RD|rd][CD|cd][RA|ra][AD|ad]\n"); fprintf(stream, "\t\t\tlowercase: unset bit, uppercase: set bit\n"); fprintf(stream, "\t-p \tuse as remote port number\n"); fprintf(stream, "\t-s\t\tshow the DS RR for each key in a packet\n"); fprintf(stream, "\t-u\t\tsend the query with udp (the default)\n"); fprintf(stream, "\t-x\t\tdo a reverse lookup\n"); fprintf(stream, "\twhen doing a secure trace:\n"); fprintf(stream, "\t-r \tuse file as root servers hint file\n"); fprintf(stream, "\t-t\t\tsend the query with tcp (connected)\n"); fprintf(stream, "\t-d \tuse domain as the start point for the trace\n"); fprintf(stream, "\t-y \tspecify named base64 tsig key, and optional an\n\t\t\talgorithm (defaults to hmac-md5.sig-alg.reg.int)\n"); fprintf(stream, "\t-z\t\tdon't randomize the nameservers before use\n"); fprintf(stream, "\n [*] = enables/implies DNSSEC\n"); fprintf(stream, " [**] = can be given more than once\n"); fprintf(stream, "\n ldns-team@nlnetlabs.nl | http://www.nlnetlabs.nl/ldns/\n"); } /** * Prints the drill version to stderr */ static void version(FILE *stream, const char *progname) { fprintf(stream, "%s version %s (ldns version %s)\n", progname, DRILL_VERSION, ldns_version()); fprintf(stream, "Written by NLnet Labs.\n"); fprintf(stream, "\nCopyright (c) 2004-2008 NLnet Labs.\n"); fprintf(stream, "Licensed under the revised BSD license.\n"); fprintf(stream, "There is NO warranty; not even for MERCHANTABILITY or FITNESS\n"); fprintf(stream, "FOR A PARTICULAR PURPOSE.\n"); } /** * Main function of drill * parse the arguments and prepare a query */ int main(int argc, char *argv[]) { ldns_resolver *res = NULL; ldns_resolver *cmdline_res = NULL; /* only used to resolv @name names */ ldns_rr_list *cmdline_rr_list = NULL; ldns_rdf *cmdline_dname = NULL; ldns_rdf *qname, *qname_tmp; ldns_pkt *pkt; ldns_pkt *qpkt; char *serv; char *src = NULL; const char *name; char *progname; char *query_file = NULL; char *answer_file = NULL; ldns_buffer *query_buffer = NULL; ldns_rdf *serv_rdf; ldns_rdf *src_rdf = NULL; ldns_rr_type type; ldns_rr_class clas; #if 0 ldns_pkt_opcode opcode = LDNS_PACKET_QUERY; #endif int i, c; int int_type; int int_clas; int PURPOSE; char *tsig_name = NULL; char *tsig_data = NULL; char *tsig_algorithm = NULL; size_t tsig_separator; size_t tsig_separator2; ldns_rr *axfr_rr; ldns_status status; char *type_str; uint32_t serial = 0; /* list of keys used in dnssec operations */ ldns_rr_list *key_list = ldns_rr_list_new(); /* what key verify the current answer */ ldns_rr_list *key_verified; /* resolver options */ uint16_t qflags; uint16_t qbuf; uint16_t qport; uint8_t qfamily; bool qdnssec; bool qfallback; bool qds; bool qusevc; bool qrandom; char *resolv_conf_file = NULL; ldns_rdf *trace_start_name = NULL; int result = 0; uint8_t s6addr[16]; char ip6_arpa_str[74]; #ifdef USE_WINSOCK int r; WSADATA wsa_data; #endif int_type = -1; serv = NULL; type = 0; int_clas = -1; name = NULL; clas = 0; qname = NULL; src = NULL; progname = strdup(argv[0]); #ifdef USE_WINSOCK r = WSAStartup(MAKEWORD(2,2), &wsa_data); if(r != 0) { printf("Failed WSAStartup: %d\n", r); result = EXIT_FAILURE; goto exit; } #endif /* USE_WINSOCK */ PURPOSE = DRILL_QUERY; qflags = LDNS_RD; qport = LDNS_PORT; verbosity = 2; qdnssec = false; qfamily = LDNS_RESOLV_INETANY; qfallback = false; qds = false; qbuf = 0; qusevc = false; qrandom = true; key_verified = NULL; ldns_init_random(NULL, 0); /* string from orig drill: "i:w:I46Sk:TNp:b:DsvhVcuaq:f:xr" */ /* global first, query opt next, option with parm's last * and sorted */ /* "46DITSVQf:i:w:q:achuvxzy:so:p:b:k:" */ while ((c = getopt(argc, argv, "46ab:c:d:Df:hi:I:k:o:p:q:Qr:sStTuvV:w:xy:z")) != -1) { switch(c) { /* global options */ case '4': qfamily = LDNS_RESOLV_INET; break; case '6': qfamily = LDNS_RESOLV_INET6; break; case 'D': qdnssec = true; break; case 'I': src = optarg; break; case 'T': if (PURPOSE == DRILL_CHASE) { fprintf(stderr, "-T and -S cannot be used at the same time.\n"); exit(EXIT_FAILURE); } PURPOSE = DRILL_TRACE; break; #ifdef HAVE_SSL case 'S': if (PURPOSE == DRILL_TRACE) { fprintf(stderr, "-T and -S cannot be used at the same time.\n"); exit(EXIT_FAILURE); } PURPOSE = DRILL_CHASE; break; #endif /* HAVE_SSL */ case 'V': if (strtok(optarg, "0123456789") != NULL) { fprintf(stderr, "-V expects an number as an argument.\n"); exit(EXIT_FAILURE); } verbosity = atoi(optarg); break; case 'Q': verbosity = -1; break; case 'f': query_file = optarg; break; case 'i': answer_file = optarg; PURPOSE = DRILL_AFROMFILE; break; case 'w': answer_file = optarg; break; case 'q': query_file = optarg; PURPOSE = DRILL_QTOFILE; break; case 'r': if (global_dns_root) { fprintf(stderr, "There was already a series of root servers set\n"); exit(EXIT_FAILURE); } global_dns_root = read_root_hints(optarg); if (!global_dns_root) { fprintf(stderr, "Unable to read root hints file %s, aborting\n", optarg); exit(EXIT_FAILURE); } break; /* query options */ case 'a': qfallback = true; break; case 'b': qbuf = (uint16_t)atoi(optarg); if (qbuf == 0) { error("%s", " could not be converted"); } break; case 'c': resolv_conf_file = optarg; break; case 't': qusevc = true; break; case 'k': status = read_key_file(optarg, key_list, false); if (status != LDNS_STATUS_OK) { error("Could not parse the key file %s: %s", optarg, ldns_get_errorstr_by_id(status)); } qdnssec = true; /* enable that too */ break; case 'o': /* only looks at the first hit: capital=ON, lowercase=OFF*/ if (strstr(optarg, "QR")) { DRILL_ON(qflags, LDNS_QR); } if (strstr(optarg, "qr")) { DRILL_OFF(qflags, LDNS_QR); } if (strstr(optarg, "AA")) { DRILL_ON(qflags, LDNS_AA); } if (strstr(optarg, "aa")) { DRILL_OFF(qflags, LDNS_AA); } if (strstr(optarg, "TC")) { DRILL_ON(qflags, LDNS_TC); } if (strstr(optarg, "tc")) { DRILL_OFF(qflags, LDNS_TC); } if (strstr(optarg, "RD")) { DRILL_ON(qflags, LDNS_RD); } if (strstr(optarg, "rd")) { DRILL_OFF(qflags, LDNS_RD); } if (strstr(optarg, "CD")) { DRILL_ON(qflags, LDNS_CD); } if (strstr(optarg, "cd")) { DRILL_OFF(qflags, LDNS_CD); } if (strstr(optarg, "RA")) { DRILL_ON(qflags, LDNS_RA); } if (strstr(optarg, "ra")) { DRILL_OFF(qflags, LDNS_RA); } if (strstr(optarg, "AD")) { DRILL_ON(qflags, LDNS_AD); } if (strstr(optarg, "ad")) { DRILL_OFF(qflags, LDNS_AD); } break; case 'p': qport = (uint16_t)atoi(optarg); if (qport == 0) { error("%s", " could not be converted"); } break; case 's': qds = true; break; case 'u': qusevc = false; break; case 'v': version(stdout, progname); result = EXIT_SUCCESS; goto exit; case 'x': PURPOSE = DRILL_REVERSE; break; case 'y': #ifdef HAVE_SSL if (strchr(optarg, ':')) { tsig_separator = (size_t) (strchr(optarg, ':') - optarg); if (strchr(optarg + tsig_separator + 1, ':')) { tsig_separator2 = (size_t) (strchr(optarg + tsig_separator + 1, ':') - optarg); tsig_algorithm = xmalloc(strlen(optarg) - tsig_separator2); strncpy(tsig_algorithm, optarg + tsig_separator2 + 1, strlen(optarg) - tsig_separator2); tsig_algorithm[strlen(optarg) - tsig_separator2 - 1] = '\0'; } else { tsig_separator2 = strlen(optarg); tsig_algorithm = strdup("hmac-md5.sig-alg.reg.int"); } tsig_name = xmalloc(tsig_separator + 1); tsig_data = xmalloc(tsig_separator2 - tsig_separator); strncpy(tsig_name, optarg, tsig_separator); strncpy(tsig_data, optarg + tsig_separator + 1, tsig_separator2 - tsig_separator - 1); /* strncpy does not append \0 if source is longer than n */ tsig_name[tsig_separator] = '\0'; tsig_data[ tsig_separator2 - tsig_separator - 1] = '\0'; } #else fprintf(stderr, "TSIG requested, but SSL is not supported\n"); result = EXIT_FAILURE; goto exit; #endif /* HAVE_SSL */ break; case 'z': qrandom = false; break; case 'd': trace_start_name = ldns_dname_new_frm_str(optarg); if (!trace_start_name) { fprintf(stderr, "Unable to parse argument for -%c\n", c); result = EXIT_FAILURE; goto exit; } break; case 'h': version(stdout, progname); usage(stdout, progname); result = EXIT_SUCCESS; goto exit; break; default: fprintf(stderr, "Unknown argument: -%c, use -h to see usage\n", c); result = EXIT_FAILURE; goto exit; } } argc -= optind; argv += optind; if ((PURPOSE == DRILL_CHASE || (PURPOSE == DRILL_TRACE && qdnssec)) && ldns_rr_list_rr_count(key_list) == 0) { (void) read_key_file(LDNS_TRUST_ANCHOR_FILE, key_list, true); } if (ldns_rr_list_rr_count(key_list) > 0) { printf(";; Number of trusted keys: %d\n", (int) ldns_rr_list_rr_count(key_list)); } /* do a secure trace when requested */ if (PURPOSE == DRILL_TRACE && qdnssec) { #ifdef HAVE_SSL if (ldns_rr_list_rr_count(key_list) == 0) { warning("%s", "No trusted keys were given. Will not be able to verify authenticity!"); } PURPOSE = DRILL_SECTRACE; #else fprintf(stderr, "ldns has not been compiled with OpenSSL support. Secure trace not available\n"); exit(1); #endif /* HAVE_SSL */ } /* parse the arguments, with multiple arguments, the last argument * found is used */ for(i = 0; i < argc; i++) { /* if ^@ then it's a server */ if (argv[i][0] == '@') { if (strlen(argv[i]) == 1) { warning("%s", "No nameserver given"); exit(EXIT_FAILURE); } serv = argv[i] + 1; continue; } /* if has a dot, it's a name */ if (strchr(argv[i], '.')) { name = argv[i]; continue; } /* if it matches a type, it's a type */ if (int_type == -1) { type = ldns_get_rr_type_by_name(argv[i]); if (type != 0) { int_type = 0; continue; } else if (is_ixfr_with_serial(argv[i], &serial)) { type = LDNS_RR_TYPE_IXFR; int_type = 0; continue; } } /* if it matches a class, it's a class */ if (int_clas == -1) { clas = ldns_get_rr_class_by_name(argv[i]); if (clas != 0) { int_clas = 0; continue; } } /* it all fails assume it's a name */ name = argv[i]; } /* act like dig and use for . NS */ if (!name) { name = "."; int_type = 0; type = LDNS_RR_TYPE_NS; } /* defaults if not given */ if (int_clas == -1) { clas = LDNS_RR_CLASS_IN; } if (int_type == -1) { if (PURPOSE != DRILL_REVERSE) { type = LDNS_RR_TYPE_A; } else { type = LDNS_RR_TYPE_PTR; } } if (src) { src_rdf = ldns_rdf_new_addr_frm_str(src); if(!src_rdf) { fprintf(stderr, "-I must be a valid IP[v6] address.\n"); exit(EXIT_FAILURE); } if (ldns_rdf_size(src_rdf) == 4) { qfamily = LDNS_RESOLV_INET; } else if (ldns_rdf_size(src_rdf) == 16) { qfamily = LDNS_RESOLV_INET6; } } /* set the nameserver to use */ if (!serv) { /* no server given -- make a resolver from /etc/resolv.conf */ status = ldns_resolver_new_frm_file(&res, resolv_conf_file); if (status != LDNS_STATUS_OK) { warning("Could not create a resolver structure: %s (%s)\n" "Try drill @localhost if you have a resolver running on your machine.", ldns_get_errorstr_by_id(status), resolv_conf_file); result = EXIT_FAILURE; goto exit; } } else { res = ldns_resolver_new(); if (!res || strlen(serv) <= 0) { warning("Could not create a resolver structure"); result = EXIT_FAILURE; goto exit; } /* add the nameserver */ serv_rdf = ldns_rdf_new_addr_frm_str(serv); if (!serv_rdf) { /* try to resolv the name if possible */ status = ldns_resolver_new_frm_file(&cmdline_res, resolv_conf_file); if (status != LDNS_STATUS_OK) { error("%s", "@server ip could not be converted"); } ldns_resolver_set_dnssec(cmdline_res, qdnssec); ldns_resolver_set_ip6(cmdline_res, qfamily); ldns_resolver_set_fallback(cmdline_res, qfallback); ldns_resolver_set_usevc(cmdline_res, qusevc); ldns_resolver_set_source(cmdline_res, src_rdf); cmdline_dname = ldns_dname_new_frm_str(serv); cmdline_rr_list = ldns_get_rr_list_addr_by_name( cmdline_res, cmdline_dname, LDNS_RR_CLASS_IN, qflags); ldns_rdf_deep_free(cmdline_dname); if (!cmdline_rr_list) { /* This error msg is not always accurate */ error("%s `%s\'", "could not find any address for the name:", serv); } else { if (ldns_resolver_push_nameserver_rr_list( res, cmdline_rr_list ) != LDNS_STATUS_OK) { error("%s", "pushing nameserver"); } } } else { if (ldns_resolver_push_nameserver(res, serv_rdf) != LDNS_STATUS_OK) { error("%s", "pushing nameserver"); } else { ldns_rdf_deep_free(serv_rdf); } } } /* set the resolver options */ ldns_resolver_set_ixfr_serial(res, serial); ldns_resolver_set_port(res, qport); ldns_resolver_set_source(res, src_rdf); if (verbosity >= 5) { ldns_resolver_set_debug(res, true); } else { ldns_resolver_set_debug(res, false); } ldns_resolver_set_dnssec(res, qdnssec); /* ldns_resolver_set_dnssec_cd(res, qdnssec);*/ ldns_resolver_set_ip6(res, qfamily); ldns_resolver_set_fallback(res, qfallback); ldns_resolver_set_usevc(res, qusevc); ldns_resolver_set_random(res, qrandom); if (qbuf != 0) { ldns_resolver_set_edns_udp_size(res, qbuf); } if (!name && PURPOSE != DRILL_AFROMFILE && !query_file ) { usage(stdout, progname); result = EXIT_FAILURE; goto exit; } if (tsig_name && tsig_data) { /* With dig TSIG keys are also specified with -y, * but format with drill is: -y * and with dig: -y [hmac:]name:key * * When we detect an unknown tsig algorithm in algo, * but a known algorithm in name, we cane assume dig * order was used. * * Following if statement is to anticipate and correct dig order */ if ( strcasecmp(tsig_algorithm, "hmac-md5.sig-alg.reg.int") && strcasecmp(tsig_algorithm, "hmac-md5") && strcasecmp(tsig_algorithm, "hmac-sha1") && strcasecmp(tsig_algorithm, "hmac-sha256") && ( strcasecmp(tsig_name, "hmac-md5.sig-alg.reg.int") == 0 || strcasecmp(tsig_name, "hmac-md5") == 0 || strcasecmp(tsig_name, "hmac-sha1") == 0 || strcasecmp(tsig_name, "hmac-sha256") == 0 )) { /* Roll options */ char *tmp_tsig_algorithm = tsig_name; tsig_name = tsig_data; tsig_data = tsig_algorithm; tsig_algorithm = tmp_tsig_algorithm; } if (strcasecmp(tsig_algorithm, "hmac-md5") == 0) { free(tsig_algorithm); tsig_algorithm = strdup("hmac-md5.sig-alg.reg.int"); } ldns_resolver_set_tsig_keyname(res, tsig_name); ldns_resolver_set_tsig_keydata(res, tsig_data); ldns_resolver_set_tsig_algorithm(res, tsig_algorithm); } /* main switching part of drill */ switch(PURPOSE) { case DRILL_TRACE: /* do a trace from the root down */ if (!global_dns_root) { init_root(); } qname = ldns_dname_new_frm_str(name); if (!qname) { error("%s", "parsing query name"); } /* don't care about return packet */ do_trace(res, qname, type, clas); clear_root(); break; case DRILL_SECTRACE: /* do a secure trace from the root down */ if (!global_dns_root) { init_root(); } qname = ldns_dname_new_frm_str(name); if (!qname) { error("%s", "making qname"); } /* don't care about return packet */ #ifdef HAVE_SSL result = do_secure_trace(res, qname, type, clas, key_list, trace_start_name); #endif /* HAVE_SSL */ clear_root(); break; case DRILL_CHASE: qname = ldns_dname_new_frm_str(name); if (!qname) { error("%s", "making qname"); } ldns_resolver_set_dnssec(res, true); ldns_resolver_set_dnssec_cd(res, true); /* set dnssec implies udp_size of 4096 */ ldns_resolver_set_edns_udp_size(res, 4096); pkt = NULL; status = ldns_resolver_query_status( &pkt, res, qname, type, clas, qflags); if (status != LDNS_STATUS_OK) { error("error sending query: %s", ldns_get_errorstr_by_id(status)); } if (!pkt) { if (status == LDNS_STATUS_OK) { error("%s", "error pkt sending"); } result = EXIT_FAILURE; } else { if (verbosity >= 3) { ldns_pkt_print(stdout, pkt); } if (!ldns_pkt_answer(pkt)) { mesg("No answer in packet"); } else { #ifdef HAVE_SSL ldns_resolver_set_dnssec_anchors(res, ldns_rr_list_clone(key_list)); result = do_chase(res, qname, type, clas, key_list, pkt, qflags, NULL); if (result == LDNS_STATUS_OK) { if (verbosity != -1) { mesg("Chase successful"); } result = 0; } else { if (verbosity != -1) { mesg("Chase failed."); } } #endif /* HAVE_SSL */ } ldns_pkt_free(pkt); } break; case DRILL_AFROMFILE: pkt = read_hex_pkt(answer_file); if (pkt) { if (verbosity != -1) { ldns_pkt_print(stdout, pkt); } ldns_pkt_free(pkt); } break; case DRILL_QTOFILE: qname = ldns_dname_new_frm_str(name); if (!qname) { error("%s", "making qname"); } status = ldns_resolver_prepare_query_pkt(&qpkt, res, qname, type, clas, qflags); if(status != LDNS_STATUS_OK) { error("%s", "making query: %s", ldns_get_errorstr_by_id(status)); } dump_hex(qpkt, query_file); ldns_pkt_free(qpkt); break; case DRILL_NSEC: break; case DRILL_REVERSE: /* ipv4 or ipv6 addr? */ if (strchr(name, ':')) { if (!inet_pton(AF_INET6, name, &s6addr)) { error("Syntax error: cannot parse IPv6 address\n"); } (void) snprintf(ip6_arpa_str, sizeof(ip6_arpa_str), "%x.%x.%x.%x.%x.%x.%x.%x." "%x.%x.%x.%x.%x.%x.%x.%x." "%x.%x.%x.%x.%x.%x.%x.%x." "%x.%x.%x.%x.%x.%x.%x.%x.ip6.arpa.", (unsigned int)(s6addr[15] & 0x0F), (unsigned int)(s6addr[15] >> 4), (unsigned int)(s6addr[14] & 0x0F), (unsigned int)(s6addr[14] >> 4), (unsigned int)(s6addr[13] & 0x0F), (unsigned int)(s6addr[13] >> 4), (unsigned int)(s6addr[12] & 0x0F), (unsigned int)(s6addr[12] >> 4), (unsigned int)(s6addr[11] & 0x0F), (unsigned int)(s6addr[11] >> 4), (unsigned int)(s6addr[10] & 0x0F), (unsigned int)(s6addr[10] >> 4), (unsigned int)(s6addr[9] & 0x0F), (unsigned int)(s6addr[9] >> 4), (unsigned int)(s6addr[8] & 0x0F), (unsigned int)(s6addr[8] >> 4), (unsigned int)(s6addr[7] & 0x0F), (unsigned int)(s6addr[7] >> 4), (unsigned int)(s6addr[6] & 0x0F), (unsigned int)(s6addr[6] >> 4), (unsigned int)(s6addr[5] & 0x0F), (unsigned int)(s6addr[5] >> 4), (unsigned int)(s6addr[4] & 0x0F), (unsigned int)(s6addr[4] >> 4), (unsigned int)(s6addr[3] & 0x0F), (unsigned int)(s6addr[3] >> 4), (unsigned int)(s6addr[2] & 0x0F), (unsigned int)(s6addr[2] >> 4), (unsigned int)(s6addr[1] & 0x0F), (unsigned int)(s6addr[1] >> 4), (unsigned int)(s6addr[0] & 0x0F), (unsigned int)(s6addr[0] >> 4)); qname = ldns_dname_new_frm_str(ip6_arpa_str); } else { qname = ldns_dname_new_frm_str(name); qname_tmp = ldns_dname_reverse(qname); ldns_rdf_deep_free(qname); qname = qname_tmp; qname_tmp = ldns_dname_new_frm_str("in-addr.arpa."); status = ldns_dname_cat(qname, qname_tmp); if (status != LDNS_STATUS_OK) { error("%s", "could not create reverse address for ip4: %s\n", ldns_get_errorstr_by_id(status)); } ldns_rdf_deep_free(qname_tmp); } if (!qname) { error("%s", "-x implies an ip address"); } /* create a packet and set the RD flag on it */ pkt = NULL; status = ldns_resolver_query_status( &pkt, res, qname, type, clas, qflags); if (status != LDNS_STATUS_OK) { error("error sending query: %s", ldns_get_errorstr_by_id(status)); } if (!pkt) { if (status == LDNS_STATUS_OK) { error("%s", "pkt sending"); } result = EXIT_FAILURE; } else { if (verbosity != -1) { ldns_pkt_print(stdout, pkt); } ldns_pkt_free(pkt); } break; case DRILL_QUERY: default: if (query_file) { /* this old way, the query packet needed to be parseable, but we want to be able to send mangled packets, so we need to do it directly */ #if 0 qpkt = read_hex_pkt(query_file); if (qpkt) { status = ldns_resolver_send_pkt(&pkt, res, qpkt); if (status != LDNS_STATUS_OK) { printf("Error: %s\n", ldns_get_errorstr_by_id(status)); exit(1); } } else { /* qpkt was bogus, reset pkt */ pkt = NULL; } #endif query_buffer = read_hex_buffer(query_file); if (query_buffer) { status = ldns_send_buffer(&pkt, res, query_buffer, NULL); ldns_buffer_free(query_buffer); if (status != LDNS_STATUS_OK) { printf("Error: %s\n", ldns_get_errorstr_by_id(status)); exit(1); } } else { printf("NO BUFFER\n"); pkt = NULL; } } else { qname = ldns_dname_new_frm_str(name); if (!qname) { error("%s", "error in making qname"); } if (type == LDNS_RR_TYPE_AXFR) { status = ldns_axfr_start(res, qname, clas); if(status != LDNS_STATUS_OK) { error("Error starting axfr: %s", ldns_get_errorstr_by_id(status)); } axfr_rr = ldns_axfr_next(res); if(!axfr_rr) { fprintf(stderr, "AXFR failed.\n"); ldns_pkt_print(stdout, ldns_axfr_last_pkt(res)); goto exit; } while (axfr_rr) { if (verbosity != -1) { ldns_rr_print(stdout, axfr_rr); } ldns_rr_free(axfr_rr); axfr_rr = ldns_axfr_next(res); } goto exit; } else { /* create a packet and set the RD flag on it */ pkt = NULL; status = ldns_resolver_query_status( &pkt, res, qname, type, clas, qflags); if (status != LDNS_STATUS_OK) { error("error sending query: %s" , ldns_get_errorstr_by_id( status)); } } } if (!pkt) { mesg("No packet received"); result = EXIT_FAILURE; } else { if (verbosity != -1) { ldns_pkt_print(stdout, pkt); if (ldns_pkt_tc(pkt)) { fprintf(stdout, "\n;; WARNING: The answer packet was truncated; you might want to\n"); fprintf(stdout, ";; query again with TCP (-t argument), or EDNS0 (-b for buffer size)\n"); } } if (qds) { if (verbosity != -1) { print_ds_of_keys(pkt); printf("\n"); } } if (ldns_rr_list_rr_count(key_list) > 0) { /* -k's were given on the cmd line */ ldns_rr_list *rrset_verified; uint16_t key_count; rrset_verified = ldns_pkt_rr_list_by_name_and_type( pkt, qname, type, LDNS_SECTION_ANY_NOQUESTION); if (type == LDNS_RR_TYPE_ANY) { /* don't verify this */ break; } if (verbosity != -1) { printf("; "); ldns_rr_list_print(stdout, rrset_verified); } /* verify */ #ifdef HAVE_SSL key_verified = ldns_rr_list_new(); result = ldns_pkt_verify(pkt, type, qname, key_list, NULL, key_verified); if (result == LDNS_STATUS_ERR) { /* is the existence denied then? */ result = ldns_verify_denial(pkt, qname, type, NULL, NULL); if (result == LDNS_STATUS_OK) { if (verbosity != -1) { printf("Existence denied for "); ldns_rdf_print(stdout, qname); type_str = ldns_rr_type2str(type); printf("\t%s\n", type_str); LDNS_FREE(type_str); } } else { if (verbosity != -1) { printf("Bad data; RR for name and " "type not found or failed to " "verify, and denial of " "existence failed.\n"); } } } else if (result == LDNS_STATUS_OK) { for(key_count = 0; key_count < ldns_rr_list_rr_count(key_verified); key_count++) { if (verbosity != -1) { printf("; VALIDATED by id = %u, owner = ", (unsigned int)ldns_calc_keytag( ldns_rr_list_rr(key_verified, key_count))); ldns_rdf_print(stdout, ldns_rr_owner( ldns_rr_list_rr(key_list, key_count))); printf("\n"); } } } else { for(key_count = 0; key_count < ldns_rr_list_rr_count(key_list); key_count++) { if (verbosity != -1) { printf("; %s for id = %u, owner = ", ldns_get_errorstr_by_id(result), (unsigned int)ldns_calc_keytag( ldns_rr_list_rr(key_list, key_count))); ldns_rdf_print(stdout, ldns_rr_owner( ldns_rr_list_rr(key_list, key_count))); printf("\n"); } } } ldns_rr_list_free(key_verified); #else (void) key_count; #endif /* HAVE_SSL */ } if (answer_file) { dump_hex(pkt, answer_file); } ldns_pkt_free(pkt); } break; } exit: ldns_rdf_deep_free(qname); ldns_rdf_deep_free(src_rdf); ldns_resolver_deep_free(res); ldns_resolver_deep_free(cmdline_res); ldns_rr_list_deep_free(key_list); ldns_rr_list_deep_free(cmdline_rr_list); ldns_rdf_deep_free(trace_start_name); xfree(progname); xfree(tsig_name); xfree(tsig_data); xfree(tsig_algorithm); #ifdef HAVE_SSL CRYPTO_cleanup_all_ex_data(); ERR_free_strings(); EVP_cleanup(); #endif #ifdef USE_WINSOCK WSACleanup(); #endif return result; } ldns-1.7.0/drill/error.c0000644000175000017500000000247113026206166014434 0ustar willemwillem/** * error.c * * error reporting routines * basicly wrappers around printf * * (c) 2005 NLnet Labs * * See the file LICENSE for the license * */ #include "drill.h" #include static void warning_va_list(const char *fmt, va_list args) { fprintf(stderr, "Warning: "); vfprintf(stderr, fmt, args); fprintf(stderr, "\n"); } void warning(const char *fmt, ...) { va_list args; va_start(args, fmt); warning_va_list(fmt, args); va_end(args); } static void error_va_list(const char *fmt, va_list args) { fprintf(stderr, "Error: "); vfprintf(stderr, fmt, args); fprintf(stderr, "\n"); } void error(const char *fmt, ...) { va_list args; va_start(args, fmt); error_va_list(fmt, args); va_end(args); exit(EXIT_FAILURE); } static void verbose_va_list(const char *fmt, va_list args) { vfprintf(stdout, fmt, args); fprintf(stdout, "\n"); } /* print stuff */ void mesg(const char *fmt, ...) { va_list args; if (verbosity == -1) { return; } fprintf(stdout, ";; "); va_start(args, fmt); verbose_va_list(fmt, args); va_end(args); } #if 0 /* print stuff when in verbose mode (1) */ void verbose(const char *fmt, ...) { va_list args; if (verbosity < 1) { return; } va_start(args, fmt); verbose_va_list(fmt, args); va_end(args); } #endif ldns-1.7.0/drill/README0000644000175000017500000000045613026206166014020 0ustar willemwillemQUICK INSTALL GUIDE drill is a subdirectory in ldns. To compile drill you need: autoreconf && ./configure && make If ldns is installed in a different location, use --with-ldns=directory See also ./configure --help In the first case you must run drill as: LD_LIBRARY_PATH=../.libs ./drill ldns-1.7.0/drill/configure.ac0000644000175000017500000001471613026206166015432 0ustar willemwillem# -*- Autoconf -*- # Process this file with autoconf to produce a configure script. AC_PREREQ(2.56) AC_INIT(ldns, 1.7.0, libdns@nlnetlabs.nl,libdns) AC_CONFIG_SRCDIR([drill.c]) sinclude(../acx_nlnetlabs.m4) OURCPPFLAGS='' CPPFLAGS=${CPPFLAGS:-${OURCPPFLAGS}} OURCFLAGS='-g' CFLAGS=${CFLAGS:-${OURCFLAGS}} AC_DEFINE(WINVER, 0x0502, [the version of the windows API enabled]) AC_AIX # Checks for programs. AC_PROG_CC AC_PROG_MAKE_SET AC_CHECK_PROGS(libtool, [glibtool libtool15 libtool], [../libtool]) # add option to disable the evil rpath dnl Check whether to use rpath or not AC_ARG_ENABLE(rpath, [ --disable-rpath disable hardcoded rpath (default=enabled)], enable_rpath=$enableval, enable_rpath=yes) if test "x$enable_rpath" = xyes; then RPATH_VAL="-Wl,-rpath=\${libdir}" fi ACX_CHECK_COMPILER_FLAG(std=c99, [C99FLAG="-std=c99"]) ACX_CHECK_COMPILER_FLAG(xc99, [C99FLAG="-xc99"]) AC_TYPE_SIZE_T ACX_CHECK_COMPILER_FLAG(O2, [CFLAGS="$CFLAGS -O2"]) ACX_CHECK_COMPILER_FLAG_NEEDED($C99FLAG -D__EXTENSIONS__ -D_BSD_SOURCE -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600, [ #include "confdefs.h" #include #include #include #ifdef HAVE_TIME_H #include #endif #include #ifdef HAVE_GETOPT_H #include #endif int test() { int a; char **opts = NULL; struct timeval tv; char *t; time_t time = 0; char *buf = NULL; t = ctime_r(&time, buf); tv.tv_usec = 10; srandom(32); a = getopt(2, opts, "a"); a = isascii(32); return a; } ], [CFLAGS="$CFLAGS $C99FLAG -D__EXTENSIONS__ -D_BSD_SOURCE -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600"]) ACX_CHECK_COMPILER_FLAG_NEEDED($C99FLAG, [#include ], [CFLAGS="$CFLAGS $C99FLAG"]) AC_C_INLINE AC_CHECK_TYPE(int8_t, char) AC_CHECK_TYPE(int16_t, short) AC_CHECK_TYPE(int32_t, int) AC_CHECK_TYPE(int64_t, long long) AC_CHECK_TYPE(uint8_t, unsigned char) AC_CHECK_TYPE(uint16_t, unsigned short) AC_CHECK_TYPE(uint32_t, unsigned int) AC_CHECK_TYPE(uint64_t, unsigned long long) AC_CHECK_TYPE(ssize_t, int) AC_CHECK_HEADERS([sys/types.h getopt.h stdlib.h stdio.h assert.h netinet/in.h ctype.h time.h arpa/inet.h sys/time.h sys/socket.h sys/select.h],,, [AC_INCLUDES_DEFAULT]) AC_CHECK_HEADERS([netinet/in_systm.h net/if.h netinet/ip.h netinet/udp.h netinet/if_ether.h netinet/ip6.h],,, [ AC_INCLUDES_DEFAULT #ifdef HAVE_NETINET_IN_SYSTM_H #include #endif #ifdef HAVE_NETINET_IN_H #include #endif #ifdef HAVE_SYS_SOCKET_H #include #endif #ifdef HAVE_NET_IF_H #include #endif]) # MinGW32 tests AC_CHECK_HEADERS([winsock2.h ws2tcpip.h],,, [AC_INCLUDES_DEFAULT]) ACX_TYPE_SOCKLEN_T AC_CHECK_HEADERS([sys/param.h sys/mount.h],,, [AC_INCLUDES_DEFAULT] [ [ #if HAVE_SYS_PARAM_H # include #endif ] ]) AC_CHECK_TYPE(in_addr_t, [], [AC_DEFINE([in_addr_t], [uint32_t], [in_addr_t])], [ #if HAVE_SYS_TYPES_H # include #endif #if HAVE_NETINET_IN_H # include #endif]) AC_CHECK_TYPE(in_port_t, [], [AC_DEFINE([in_port_t], [uint16_t], [in_port_t])], [ #if HAVE_SYS_TYPES_H # include #endif #if HAVE_NETINET_IN_H # include #endif]) # check to see if libraries are needed for these functions. AC_SEARCH_LIBS(socket, socket) AC_SEARCH_LIBS([inet_pton], [nsl]) ACX_WITH_SSL_OPTIONAL ACX_CHECK_GETADDRINFO_WITH_INCLUDES LIBS_STC="$LIBS" AC_SUBST(LIBS_STC) # check for ldns AC_ARG_WITH(ldns, AC_HELP_STRING([--with-ldns=PATH specify prefix of path of ldns library to use]) , [ specialldnsdir="$withval" CPPFLAGS="$CPPFLAGS -I$withval/include" LDFLAGS="-L$withval -L$withval/lib $LDFLAGS" LDNSDIR="$withval" LIBS="-lldns $LIBS" LIBS_STC="$withval/lib/libldns.a $LIBS_STC" ] ) #AC_CHECK_HEADER(ldns/ldns.h,, [ # AC_MSG_ERROR([Can't find ldns headers (make copy-headers in devel source.)]) # ], [AC_INCLUDES_DEFAULT] #) AC_CHECK_FUNCS(isblank) # check for ldns development source tree AC_MSG_CHECKING([for ldns devel source]) ldns_dev_dir=.. if test -f $ldns_dev_dir/ldns/util.h && \ grep LDNS_VERSION $ldns_dev_dir/ldns/util.h >/dev/null; then ldns_version=`grep LDNS_VERSION $ldns_dev_dir/ldns/util.h | sed -e 's/^.*"\(.*\)".*$/\1/'` AC_MSG_RESULT([using $ldns_dev_dir with $ldns_version]) CPPFLAGS="$CPPFLAGS -I$ldns_dev_dir/include" LDFLAGS="-L$ldns_dev_dir -L$ldns_dev_dir/lib $LDFLAGS" LIBS="-lldns $LIBS" AC_DEFINE(HAVE_LIBLDNS, 1, [If the ldns library is available.]) LDNSDIR="$ldns_dev_dir" LIBS_STC="$ldns_dev_dir/lib/libldns.a $LIBS_STC" else AC_MSG_RESULT([no]) AC_CHECK_LIB(ldns, ldns_rr_new, , [ AC_MSG_ERROR([Can't find ldns library])dnl ' ] ) fi AC_SUBST(LDNSDIR) AC_ARG_WITH(trust-anchor, AC_HELP_STRING([--with-trust-anchor=KEYFILE], [Default location of the trust anchor file. [default=SYSCONFDIR/unbound/root.key]]), [ LDNS_TRUST_ANCHOR_FILE="$withval" ],[ if test "x$LDNS_TRUST_ANCHOR_FILE" = "x"; then if test "x$sysconfdir" = 'x${prefix}/etc' ; then if test "x$prefix" = 'xNONE' ; then LDNS_TRUST_ANCHOR_FILE="/etc/unbound/root.key" else LDNS_TRUST_ANCHOR_FILE="${prefix}/etc/unbound/root.key" fi else LDNS_TRUST_ANCHOR_FILE="${sysconfdir}/unbound/root.key" fi fi ]) AC_DEFINE_UNQUOTED([LDNS_TRUST_ANCHOR_FILE], ["$LDNS_TRUST_ANCHOR_FILE"], [Default trust anchor file]) AC_SUBST(LDNS_TRUST_ANCHOR_FILE) AC_MSG_NOTICE([Default trust anchor: $LDNS_TRUST_ANCHOR_FILE]) AH_BOTTOM([ #include #include #include #include #if STDC_HEADERS #include #include #endif #ifdef HAVE_STDINT_H #include #endif #ifdef HAVE_SYS_SOCKET_H #include #endif #ifdef HAVE_NETINET_IN_H #include #endif #ifdef HAVE_ARPA_INET_H #include #endif #ifdef HAVE_NETINET_UDP_H #include #endif #ifdef HAVE_TIME_H #include #endif #ifdef HAVE_NETINET_IN_SYSTM_H #include #endif #ifdef HAVE_NETINET_IP_H #include #endif #ifdef HAVE_NET_IF_H #include #endif #ifdef HAVE_NETINET_IF_ETHER_H #include #endif #ifdef HAVE_WINSOCK2_H #define USE_WINSOCK 1 #include #endif #ifdef HAVE_WS2TCPIP_H #include #endif #ifndef EXIT_FAILURE #define EXIT_FAILURE 1 #endif #ifndef EXIT_SUCCESS #define EXIT_SUCCESS 0 #endif #ifdef S_SPLINT_S #define FD_ZERO(a) /* a */ #define FD_SET(a,b) /* a, b */ #endif ]) AC_CONFIG_FILES([Makefile drill.1]) AC_CONFIG_HEADER([config.h]) AC_OUTPUT ldns-1.7.0/drill/drill_util.c0000644000175000017500000001545613026206166015455 0ustar willemwillem/* * util.c * some handy function needed in drill and not implemented * in ldns * (c) 2005 NLnet Labs * * See the file LICENSE for the license * */ #include "drill.h" #include #include static int read_line(FILE *input, char *line, size_t len) { int i; int c; for (i = 0; i < (int)len-1; i++) { c = getc(input); if (c == EOF) { return -1; } else if (c != '\n') { line[i] = c; } else { break; } } line[i] = '\0'; return i; } /* key_list must be initialized with ldns_rr_list_new() */ ldns_status read_key_file(const char *filename, ldns_rr_list *key_list, bool silently) { int line_len = 0; int line_nr = 0; int key_count = 0; char line[LDNS_MAX_LINELEN]; ldns_status status; FILE *input_file; ldns_rr *rr; input_file = fopen(filename, "r"); if (!input_file) { if (! silently) { fprintf(stderr, "Error opening %s: %s\n", filename, strerror(errno)); } return LDNS_STATUS_ERR; } while (line_len >= 0) { line_len = (int) read_line(input_file, line, sizeof(line)); line_nr++; if (line_len > 0 && line[0] != ';') { status = ldns_rr_new_frm_str(&rr, line, 0, NULL, NULL); if (status != LDNS_STATUS_OK) { if (! silently) { fprintf(stderr, "Error parsing DNSKEY RR " "in line %d: %s\n", line_nr, ldns_get_errorstr_by_id(status) ); } } else if (ldns_rr_get_type(rr) == LDNS_RR_TYPE_DNSKEY || ldns_rr_get_type(rr) == LDNS_RR_TYPE_DS) { ldns_rr_list_push_rr(key_list, rr); key_count++; } else { ldns_rr_free(rr); } } } fclose(input_file); if (key_count > 0) { return LDNS_STATUS_OK; } else { /*fprintf(stderr, "No keys read\n");*/ return LDNS_STATUS_ERR; } } ldns_rdf * ldns_rdf_new_addr_frm_str(char *str) { ldns_rdf *a; a = ldns_rdf_new_frm_str(LDNS_RDF_TYPE_A, str); if (!a) { /* maybe ip6 */ a = ldns_rdf_new_frm_str(LDNS_RDF_TYPE_AAAA, str); if (!a) { return NULL; } } return a; } static inline void local_print_ds(FILE* out, const char* pre, ldns_rr* ds) { if (out && ds) { fprintf(out, "%s", pre); ldns_rr_print(out, ds); ldns_rr_free(ds); } } /* * For all keys in a packet print the DS */ void print_ds_of_keys(ldns_pkt *p) { ldns_rr_list *keys; uint16_t i; ldns_rr *ds; /* TODO fix the section stuff, here or in ldns */ keys = ldns_pkt_rr_list_by_type(p, LDNS_RR_TYPE_DNSKEY, LDNS_SECTION_ANSWER); /* this also returns the question section rr, which does not * have any data.... and this inturn crashes everything */ if (keys) { for (i = 0; i < ldns_rr_list_rr_count(keys); i++) { fprintf(stdout, ";\n; equivalent DS records for key %u:\n", (unsigned int)ldns_calc_keytag(ldns_rr_list_rr(keys, i))); ds = ldns_key_rr2ds(ldns_rr_list_rr(keys, i), LDNS_SHA1); local_print_ds(stdout, "; sha1: ", ds); ds = ldns_key_rr2ds(ldns_rr_list_rr(keys, i), LDNS_SHA256); local_print_ds(stdout, "; sha256: ", ds); } ldns_rr_list_deep_free(keys); } } static void print_class_type(FILE *fp, ldns_rr *r) { ldns_lookup_table *lt; lt = ldns_lookup_by_id(ldns_rr_classes, ldns_rr_get_class(r)); if (lt) { fprintf(fp, " %s", lt->name); } else { fprintf(fp, " CLASS%d", ldns_rr_get_class(r)); } /* okay not THE way - but the quickest */ switch (ldns_rr_get_type(r)) { case LDNS_RR_TYPE_RRSIG: fprintf(fp, " RRSIG "); break; case LDNS_RR_TYPE_DNSKEY: fprintf(fp, " DNSKEY "); break; case LDNS_RR_TYPE_DS: fprintf(fp, " DS "); break; default: break; } } void print_ds_abbr(FILE *fp, ldns_rr *ds) { if (!ds || (ldns_rr_get_type(ds) != LDNS_RR_TYPE_DS)) { return; } ldns_rdf_print(fp, ldns_rr_owner(ds)); fprintf(fp, " %d", (int)ldns_rr_ttl(ds)); print_class_type(fp, ds); ldns_rdf_print(fp, ldns_rr_rdf(ds, 0)); fprintf(fp, " "); ldns_rdf_print(fp, ldns_rr_rdf(ds, 1)); fprintf(fp, " "); ldns_rdf_print(fp, ldns_rr_rdf(ds, 2)); fprintf(fp, " "); ldns_rdf_print(fp, ldns_rr_rdf(ds, 3)); fprintf(fp, " "); } /* print some of the elements of a signature */ void print_rrsig_abbr(FILE *fp, ldns_rr *sig) { if (!sig || (ldns_rr_get_type(sig) != LDNS_RR_TYPE_RRSIG)) { return; } ldns_rdf_print(fp, ldns_rr_owner(sig)); fprintf(fp, " %d", (int)ldns_rr_ttl(sig)); print_class_type(fp, sig); /* print a number of rdf's */ /* typecovered */ ldns_rdf_print(fp, ldns_rr_rdf(sig, 0)); fprintf(fp, " "); /* algo */ ldns_rdf_print(fp, ldns_rr_rdf(sig, 1)); fprintf(fp, " "); /* labels */ ldns_rdf_print(fp, ldns_rr_rdf(sig, 2)); fprintf(fp, " (\n\t\t\t"); /* expir */ ldns_rdf_print(fp, ldns_rr_rdf(sig, 4)); fprintf(fp, " "); /* incep */ ldns_rdf_print(fp, ldns_rr_rdf(sig, 5)); fprintf(fp, " "); /* key-id */ ldns_rdf_print(fp, ldns_rr_rdf(sig, 6)); fprintf(fp, " "); /* key owner */ ldns_rdf_print(fp, ldns_rr_rdf(sig, 7)); fprintf(fp, ")"); } void print_dnskey_abbr(FILE *fp, ldns_rr *key) { if (!key || (ldns_rr_get_type(key) != LDNS_RR_TYPE_DNSKEY)) { return; } ldns_rdf_print(fp, ldns_rr_owner(key)); fprintf(fp, " %d", (int)ldns_rr_ttl(key)); print_class_type(fp, key); /* print a number of rdf's */ /* flags */ ldns_rdf_print(fp, ldns_rr_rdf(key, 0)); fprintf(fp, " "); /* proto */ ldns_rdf_print(fp, ldns_rr_rdf(key, 1)); fprintf(fp, " "); /* algo */ ldns_rdf_print(fp, ldns_rr_rdf(key, 2)); if (ldns_rdf2native_int16(ldns_rr_rdf(key, 0)) == 256) { fprintf(fp, " ;{id = %u (zsk), size = %db}", (unsigned int)ldns_calc_keytag(key), (int)ldns_rr_dnskey_key_size(key)); return; } if (ldns_rdf2native_int16(ldns_rr_rdf(key, 0)) == 257) { fprintf(fp, " ;{id = %u (ksk), size = %db}", (unsigned int)ldns_calc_keytag(key), (int)ldns_rr_dnskey_key_size(key)); return; } fprintf(fp, " ;{id = %u, size = %db}", (unsigned int)ldns_calc_keytag(key), (int)ldns_rr_dnskey_key_size(key)); } void print_rr_list_abbr(FILE *fp, ldns_rr_list *rrlist, const char *usr) { size_t i; ldns_rr_type tp; for(i = 0; i < ldns_rr_list_rr_count(rrlist); i++) { tp = ldns_rr_get_type(ldns_rr_list_rr(rrlist, i)); if (i == 0 && tp != LDNS_RR_TYPE_RRSIG) { if (usr) { fprintf(fp, "%s ", usr); } } switch(tp) { case LDNS_RR_TYPE_DNSKEY: print_dnskey_abbr(fp, ldns_rr_list_rr(rrlist, i)); break; case LDNS_RR_TYPE_RRSIG: print_rrsig_abbr(fp, ldns_rr_list_rr(rrlist, i)); break; case LDNS_RR_TYPE_DS: print_ds_abbr(fp, ldns_rr_list_rr(rrlist, i)); break; default: /* not handled */ break; } fputs("\n", fp); } } void * xmalloc(size_t s) { void *p; p = malloc(s); if (!p) { printf("Mem failure\n"); exit(EXIT_FAILURE); } return p; } void * xrealloc(void *p, size_t size) { void *q; q = realloc(p, size); if (!q) { printf("Mem failure\n"); exit(EXIT_FAILURE); } return q; } void xfree(void *p) { if (p) { free(p); } } ldns-1.7.0/drill/drill.h0000644000175000017500000000512413026206166014414 0ustar willemwillem/* * drill.h * the main header file of drill * (c) 2005, 2006 NLnet Labs * * See the file LICENSE for the license * */ #ifndef _DRILL_H_ #define _DRILL_H_ #include "config.h" #include "drill_util.h" #define DRILL_VERSION PACKAGE_VERSION /* what kind of stuff do we allow */ #define DRILL_QUERY 0 #define DRILL_TRACE 1 #define DRILL_CHASE 2 #define DRILL_AFROMFILE 3 #define DRILL_QTOFILE 4 #define DRILL_NSEC 5 #define DRILL_REVERSE 6 #define DRILL_SECTRACE 7 #define DRILL_ON(VAR, BIT) \ (VAR) = (VAR) | (BIT) #define DRILL_OFF(VAR, BIT) \ (VAR) = (VAR) & ~(BIT) extern ldns_rr_list *global_dns_root; extern int verbosity; void do_trace(ldns_resolver *res, ldns_rdf *name, ldns_rr_type type, ldns_rr_class c); ldns_status do_chase(ldns_resolver *res, ldns_rdf *name, ldns_rr_type type, ldns_rr_class c, ldns_rr_list *trusted_keys, ldns_pkt *pkt_o, uint16_t qflags, ldns_rr_list *prev_key_list); int do_secure_trace(ldns_resolver *res, ldns_rdf *name, ldns_rr_type type, ldns_rr_class c, ldns_rr_list *trusted_keys, ldns_rdf *start_name); ldns_rr_list * get_rr(ldns_resolver *res, ldns_rdf *zname, ldns_rr_type t, ldns_rr_class c); void drill_pkt_print(FILE *fd, ldns_resolver *r, ldns_pkt *p); void drill_pkt_print_footer(FILE *fd, ldns_resolver *r, ldns_pkt *p); ldns_pkt_type get_dnssec_rr(ldns_pkt *p, ldns_rdf *name, ldns_rr_type t, ldns_rr_list **rrlist, ldns_rr_list **sig); ldns_rr *ldns_nsec3_exact_match(ldns_rdf *qname, ldns_rr_type qtype, ldns_rr_list *nsec3s); ldns_rdf *ldns_nsec3_closest_encloser(ldns_rdf *qname, ldns_rr_type qtype, ldns_rr_list *nsec3s); /* verifies denial of existence of *name in *pkt (must contain NSEC or NSEC3 records * if *nsec_rrs and *nsec_rr_sigs are given, pointers to the relevant nsecs and their signatures are * placed there */ ldns_status ldns_verify_denial(ldns_pkt *pkt, ldns_rdf *name, ldns_rr_type type, ldns_rr_list **nsec_rrs, ldns_rr_list **nsec_rr_sigs); ldns_pkt *read_hex_pkt(char *filename); ldns_buffer *read_hex_buffer(char *filename); void init_root(void); ldns_rr_list *read_root_hints(const char *filename); void clear_root(void); void dump_hex(const ldns_pkt *pkt, const char *file); void warning(const char *fmt, ...); void error(const char *fmt, ...); void mesg(const char *fmt, ...); /* screen.c */ void resolver_print_nameservers(ldns_resolver *r); void print_dnskey(ldns_rr_list *key_list); void print_ds(ldns_rr_list *ds_list); #endif /* _DRILL_H_ */ ldns-1.7.0/drill/REGRESSIONS0000644000175000017500000000156213026206166014665 0ustar willemwillemREGRESSIONS This version of drill is based on ldns and as such some things are slightly changed. This file documents the changes. o When tracing (-T option) we use the local resolver (as specified in /etc/resolv.conf) to lookup names. This increases the speed dramatically, but you obviously need to be able to reach a recursive server/cache. Previously drill would try to resolve the names by itself. o Printing of DSs after DNSKEY records. Because we don't parse our own packets anymore, we cannot print the DS directly after the DNSKEY record. The DSs are now printed AFTER the packet. o The long options are removed. o The chase function has a different output, and will be subject to change in the near future. o The useless (for jokes only) -I option was dropped. FIXED: o the argument parsing is much smarter, the order doesn't matter (much) anymore ldns-1.7.0/drill/drill_util.h0000644000175000017500000000223113026206166015445 0ustar willemwillem/* * util.h * util.c header file * in ldns * (c) 2005 NLnet Labs * * See the file LICENSE for the license * */ #ifndef _DRILL_UTIL_H_ #define _DRILL_UTIL_H_ #include /** * Read keys from filename and append to key_list. */ ldns_status read_key_file(const char *filename, ldns_rr_list *key_list, bool silently); /** * return a address rdf, either A or AAAA * NULL if anything goes wrong */ ldns_rdf * ldns_rdf_new_addr_frm_str(char *); /** * print all the ds of the keys in the packet */ void print_ds_of_keys(ldns_pkt *p); /** * print some rdfs of a signature */ void print_rrsig_abbr(FILE *fp, ldns_rr *sig); /** * print some rdfs of a dnskey */ void print_dnskey_abbr(FILE *fp, ldns_rr *key); /** * print some rdfs of a ds */ void print_ds_abbr(FILE *fp, ldns_rr *ds); /** * print some rdfs of a rr in a rr_list */ void print_rr_list_abbr(FILE *fp, ldns_rr_list *sig, const char *usr); /** * Alloc some memory, with error checking */ void *xmalloc(size_t s); /** * Realloc some memory, with error checking */ void *xrealloc(void *p, size_t s); /** * Free the data */ void xfree(void *q); #endif /* _DRILL_UTIL_H_ */ ldns-1.7.0/drill/ChangeLog.22-nov-20050000644000175000017500000000641513026206166016321 0ustar willemwillem--------- Drill now is a subdirectory in ldns. To make life easier --------- we are using ldns' version numbering for drill from now on. --------- Sadly this means we GO BACKWARDS in the versions --------- This ChangeLog will not be updated anymore - all changes are --------- documented in ldns' ChangeLog 1.0-pre3: to be released: drill-team * Secure tracing works * Added section about DNSSEC in the manual page * Allow the class information to be given to do_chase() * Lint fixes for the code * Bugzilla was setup for drill * Bug #97 (drill); -S crash was fixed * Add -Q (quiet) flag was added. This supresses output from drill. 1.0-pre2: 20 Jun 2005: drill-team * Second prerelease * Bugs where fix in the chasing functionality 1.0-pre1: 1 Jun 2005: drill-team * First drill release based on ldns * drill's core code is not much more simple, as all the difficult stuff is moved to ldns. * Much saner argument parsing ---------- Above Newer drill based on ldns -------------- ---------- Below Older drill with it's own DNS handling -------------- 0.9.2: Feb 3 2005: drill-team * Added two more options (borrowed from dig) --rd, don't set the RD bit in queries --fail, don't query the next nameserver on SERVFAIL * Fixed handling of obscure data types * Handle classes other the 'IN' when making a query * For people using FreeBSD: drill is now in the ports (Thanks to Jaap Akkerhuis) 0.9.1: Jan 5 2005: drill-team * Makefile tweaks * drill ns . works * re-check the root in when tracing * added handling for some lesser known types (including WKS) 0.9: Dec 6 2004: drill-team * big configure.ac and Makefile.in updates (made more general) * escapes in names argument and txt and dname data * gcc 2(.95) support * packet wire data is now checked for dangerous elements (like looping compression etc) * (Multiple) Octal char representation * Responses can be saved to file * 'Answers' can be read from file instead of server * Lots and lots of bugfixes and improvements 0.8.1: Oct 27 2004: Miek * configure.ac updates * secure resolving updates (still doesn't work) * printing additions - CERT RR supported - LOC RR support * All non supported RRs are handled as unknown * If no namservers found in /etc/resolv.conf default to 127.0.0.1 * Various bugs fixed - Close sockets after using them - Some memory leaks were plugged 0.8: Oct 26 2004: Miek * Lots of features added. Drill is almost feature complete * Unknown RR's are supported * Numerous smaller updates in documentation * Numerous code cleanups * Dig is no longer needed to build drill 0.7: Oct 21 2004: Miek * reworked interal code * DNSSEC is working, except the secure resolving * build updates * more sane options parsing * more sane argument handling 0.6-alpha: Oct 2004: Jelte * No log 0.5-alpha: Sept 22 2004: Miek * most of the DNS stuff is working * moved to configure * tested on Linux/FreeBSD * fully IPV6 capable * new DNSSEC types supported * DNSSEC somewhat working * gcc => 3 is needed for building 0.4-alpha: Sept 9 2004: Miek * moved to autoconf for building * lots of various updates * really a workable program now 0.3-alpha: Sept 6 2004: Miek * IPv6 support * automatic secure resolving * --trace updates * --chase updates * more checks ldns-1.7.0/drill/dnssec.c0000644000175000017500000003207513026206166014565 0ustar willemwillem/* * dnssec.c * Some DNSSEC helper function are defined here * and tracing is done * (c) 2005 NLnet Labs * * See the file LICENSE for the license * */ #include "drill.h" #include /* get rr_type from a server from a server */ ldns_rr_list * get_rr(ldns_resolver *res, ldns_rdf *zname, ldns_rr_type t, ldns_rr_class c) { /* query, retrieve, extract and return */ ldns_pkt *p; ldns_rr_list *found; p = ldns_pkt_new(); found = NULL; if (ldns_resolver_send(&p, res, zname, t, c, 0) == LDNS_STATUS_OK) { found = ldns_pkt_rr_list_by_type(p, t, LDNS_SECTION_ANY_NOQUESTION); } ldns_pkt_free(p); return found; } void drill_pkt_print(FILE *fd, ldns_resolver *r, ldns_pkt *p) { ldns_rr_list *new_nss; ldns_rr_list *hostnames; char *answerfrom_str; if (verbosity < 5) { return; } hostnames = ldns_get_rr_list_name_by_addr(r, ldns_pkt_answerfrom(p), 0, 0); new_nss = ldns_pkt_rr_list_by_type(p, LDNS_RR_TYPE_NS, LDNS_SECTION_ANSWER); ldns_rr_list_print(fd, new_nss); ldns_rr_list_deep_free(new_nss); fprintf(fd, ";; Received %d bytes from %s#%d(", (int) ldns_pkt_size(p), ldns_rdf2str(ldns_pkt_answerfrom(p)), (int) ldns_resolver_port(r)); /* if we can resolve this print it, other print the ip again */ if (hostnames) { ldns_rdf_print(fd, ldns_rr_rdf(ldns_rr_list_rr(hostnames, 0), 0)); ldns_rr_list_deep_free(hostnames); } else { answerfrom_str = ldns_rdf2str(ldns_pkt_answerfrom(p)); if (answerfrom_str) { fprintf(fd, "%s", answerfrom_str); LDNS_FREE(answerfrom_str); } } fprintf(fd, ") in %u ms\n\n", (unsigned int)ldns_pkt_querytime(p)); } void drill_pkt_print_footer(FILE *fd, ldns_resolver *r, ldns_pkt *p) { ldns_rr_list *hostnames; char *answerfrom_str; if (verbosity < 5) { return; } hostnames = ldns_get_rr_list_name_by_addr(r, ldns_pkt_answerfrom(p), 0, 0); fprintf(fd, ";; Received %d bytes from %s#%d(", (int) ldns_pkt_size(p), ldns_rdf2str(ldns_pkt_answerfrom(p)), (int) ldns_resolver_port(r)); /* if we can resolve this print it, other print the ip again */ if (hostnames) { ldns_rdf_print(fd, ldns_rr_rdf(ldns_rr_list_rr(hostnames, 0), 0)); ldns_rr_list_deep_free(hostnames); } else { answerfrom_str = ldns_rdf2str(ldns_pkt_answerfrom(p)); if (answerfrom_str) { fprintf(fd, "%s", answerfrom_str); LDNS_FREE(answerfrom_str); } } fprintf(fd, ") in %u ms\n\n", (unsigned int)ldns_pkt_querytime(p)); } /* * generic function to get some RRset from a nameserver * and possible some signatures too (that would be the day...) */ ldns_pkt_type get_dnssec_rr(ldns_pkt *p, ldns_rdf *name, ldns_rr_type t, ldns_rr_list **rrlist, ldns_rr_list **sig) { ldns_pkt_type pt = LDNS_PACKET_UNKNOWN; ldns_rr_list *sigs = NULL; size_t i; if (!p) { if (rrlist) { *rrlist = NULL; } return LDNS_PACKET_UNKNOWN; } pt = ldns_pkt_reply_type(p); if (name) { if (rrlist) { *rrlist = ldns_pkt_rr_list_by_name_and_type(p, name, t, LDNS_SECTION_ANSWER); if (!*rrlist) { *rrlist = ldns_pkt_rr_list_by_name_and_type( p, name, t, LDNS_SECTION_AUTHORITY); } } if (sig) { sigs = ldns_pkt_rr_list_by_name_and_type(p, name, LDNS_RR_TYPE_RRSIG, LDNS_SECTION_ANSWER); if (!sigs) { sigs = ldns_pkt_rr_list_by_name_and_type( p, name, LDNS_RR_TYPE_RRSIG, LDNS_SECTION_AUTHORITY); } } } else { /* A DS-referral - get the DS records if they are there */ if (rrlist) { *rrlist = ldns_pkt_rr_list_by_type( p, t, LDNS_SECTION_AUTHORITY); } if (sig) { sigs = ldns_pkt_rr_list_by_type(p, LDNS_RR_TYPE_RRSIG, LDNS_SECTION_AUTHORITY); } } if (sig) { *sig = ldns_rr_list_new(); for (i = 0; i < ldns_rr_list_rr_count(sigs); i++) { /* only add the sigs that cover this type */ if (t == ldns_rdf2rr_type(ldns_rr_rrsig_typecovered( ldns_rr_list_rr(sigs, i)))) { ldns_rr_list_push_rr(*sig, ldns_rr_clone( ldns_rr_list_rr( sigs, i))); } } } ldns_rr_list_deep_free(sigs); if (pt == LDNS_PACKET_NXDOMAIN || pt == LDNS_PACKET_NODATA) { return pt; } else { return LDNS_PACKET_ANSWER; } } ldns_status ldns_verify_denial(ldns_pkt *pkt, ldns_rdf *name, ldns_rr_type type, ldns_rr_list **nsec_rrs, ldns_rr_list **nsec_rr_sigs) { #ifdef HAVE_SSL uint16_t nsec_i; ldns_rr_list *nsecs; ldns_status result; if (verbosity >= 5) { printf("VERIFY DENIAL FROM:\n"); ldns_pkt_print(stdout, pkt); } result = LDNS_STATUS_CRYPTO_NO_RRSIG; /* Try to see if there are NSECS in the packet */ nsecs = ldns_pkt_rr_list_by_type(pkt, LDNS_RR_TYPE_NSEC, LDNS_SECTION_ANY_NOQUESTION); if (nsecs) { for (nsec_i = 0; nsec_i < ldns_rr_list_rr_count(nsecs); nsec_i++) { /* there are four options: * - name equals ownername and is covered by the type bitmap * - name equals ownername but is not covered by the type bitmap * - name falls within nsec coverage but is not equal to the owner name * - name falls outside of nsec coverage */ if (ldns_dname_compare(ldns_rr_owner(ldns_rr_list_rr(nsecs, nsec_i)), name) == 0) { /* printf("CHECKING NSEC:\n"); ldns_rr_print(stdout, ldns_rr_list_rr(nsecs, nsec_i)); printf("DAWASEM\n"); */ if (ldns_nsec_bitmap_covers_type( ldns_nsec_get_bitmap(ldns_rr_list_rr(nsecs, nsec_i)), type)) { /* Error, according to the nsec this rrset is signed */ result = LDNS_STATUS_CRYPTO_NO_RRSIG; } else { /* ok nsec denies existence */ if (verbosity >= 3) { printf(";; Existence of data set with this type denied by NSEC\n"); } /*printf(";; Verifiably insecure.\n");*/ if (nsec_rrs && nsec_rr_sigs) { (void) get_dnssec_rr(pkt, ldns_rr_owner(ldns_rr_list_rr(nsecs, nsec_i)), LDNS_RR_TYPE_NSEC, nsec_rrs, nsec_rr_sigs); } ldns_rr_list_deep_free(nsecs); return LDNS_STATUS_OK; } } else if (ldns_nsec_covers_name(ldns_rr_list_rr(nsecs, nsec_i), name)) { if (verbosity >= 3) { printf(";; Existence of data set with this name denied by NSEC\n"); } if (nsec_rrs && nsec_rr_sigs) { (void) get_dnssec_rr(pkt, ldns_rr_owner(ldns_rr_list_rr(nsecs, nsec_i)), LDNS_RR_TYPE_NSEC, nsec_rrs, nsec_rr_sigs); } ldns_rr_list_deep_free(nsecs); return LDNS_STATUS_OK; } else { /* nsec has nothing to do with this data */ } } ldns_rr_list_deep_free(nsecs); } else if( (nsecs = ldns_pkt_rr_list_by_type(pkt, LDNS_RR_TYPE_NSEC3, LDNS_SECTION_ANY_NOQUESTION)) ) { ldns_rr_list* sigs = ldns_pkt_rr_list_by_type(pkt, LDNS_RR_TYPE_RRSIG, LDNS_SECTION_ANY_NOQUESTION); ldns_rr* q = ldns_rr_new(); ldns_rr* match = NULL; if(!sigs) { if (q) { ldns_rr_free(q); } ldns_rr_list_deep_free(nsecs); return LDNS_STATUS_MEM_ERR; } if(!q) { ldns_rr_list_deep_free(nsecs); ldns_rr_list_deep_free(sigs); return LDNS_STATUS_MEM_ERR; } ldns_rr_set_question(q, 1); ldns_rr_set_ttl(q, 0); ldns_rr_set_owner(q, ldns_rdf_clone(name)); if(!ldns_rr_owner(q)) { ldns_rr_free(q); ldns_rr_list_deep_free(sigs); ldns_rr_list_deep_free(nsecs); return LDNS_STATUS_MEM_ERR; } ldns_rr_set_type(q, type); /* result = ldns_dnssec_verify_denial_nsec3(q, nsecs, sigs, ldns_pkt_get_rcode(pkt), type, ldns_pkt_ancount(pkt) == 0); */ result = ldns_dnssec_verify_denial_nsec3_match(q, nsecs, sigs, ldns_pkt_get_rcode(pkt), type, ldns_pkt_ancount(pkt) == 0, &match); if (result == LDNS_STATUS_OK && match && nsec_rrs && nsec_rr_sigs) { (void) get_dnssec_rr(pkt, ldns_rr_owner(match), LDNS_RR_TYPE_NSEC3, nsec_rrs, nsec_rr_sigs); } ldns_rr_free(q); ldns_rr_list_deep_free(nsecs); ldns_rr_list_deep_free(sigs); } return result; #else (void)pkt; (void)name; (void)type; (void)nsec_rrs; (void)nsec_rr_sigs; return LDNS_STATUS_ERR; #endif /* HAVE_SSL */ } /* NSEC3 draft -07 */ /*return hash name match*/ ldns_rr * ldns_nsec3_exact_match(ldns_rdf *qname, ldns_rr_type qtype, ldns_rr_list *nsec3s) { uint8_t algorithm; uint32_t iterations; uint8_t salt_length; uint8_t *salt; ldns_rdf *sname = NULL, *hashed_sname = NULL; size_t nsec_i; ldns_rr *nsec; ldns_rr *result = NULL; const ldns_rr_descriptor *descriptor; ldns_rdf *zone_name = NULL; if (verbosity >= 4) { printf(";; finding exact match for "); descriptor = ldns_rr_descript(qtype); if (descriptor && descriptor->_name) { printf("%s ", descriptor->_name); } else { printf("TYPE%d ", qtype); } ldns_rdf_print(stdout, qname); printf("\n"); } if (!qname || !nsec3s || ldns_rr_list_rr_count(nsec3s) < 1) { if (verbosity >= 4) { printf("no qname, nsec3s or list empty\n"); } return NULL; } nsec = ldns_rr_list_rr(nsec3s, 0); algorithm = ldns_nsec3_algorithm(nsec); salt_length = ldns_nsec3_salt_length(nsec); salt = ldns_nsec3_salt_data(nsec); iterations = ldns_nsec3_iterations(nsec); if (salt == NULL) { goto done; } sname = ldns_rdf_clone(qname); if (sname == NULL) { goto done; } if (verbosity >= 4) { printf(";; owner name hashes to: "); } hashed_sname = ldns_nsec3_hash_name(sname, algorithm, iterations, salt_length, salt); if (hashed_sname == NULL) { goto done; } zone_name = ldns_dname_left_chop(ldns_rr_owner(nsec)); if (zone_name == NULL) { goto done; } if (ldns_dname_cat(hashed_sname, zone_name) != LDNS_STATUS_OK) { goto done; }; if (verbosity >= 4) { ldns_rdf_print(stdout, hashed_sname); printf("\n"); } for (nsec_i = 0; nsec_i < ldns_rr_list_rr_count(nsec3s); nsec_i++) { nsec = ldns_rr_list_rr(nsec3s, nsec_i); /* check values of iterations etc! */ /* exact match? */ if (ldns_dname_compare(ldns_rr_owner(nsec), hashed_sname) == 0) { result = nsec; goto done; } } done: ldns_rdf_deep_free(zone_name); ldns_rdf_deep_free(sname); ldns_rdf_deep_free(hashed_sname); LDNS_FREE(salt); if (verbosity >= 4) { if (result) { printf(";; Found.\n"); } else { printf(";; Not foud.\n"); } } return result; } /*return the owner name of the closest encloser for name from the list of rrs */ /* this is NOT the hash, but the original name! */ ldns_rdf * ldns_nsec3_closest_encloser(ldns_rdf *qname, ldns_rr_type qtype, ldns_rr_list *nsec3s) { /* remember parameters, they must match */ uint8_t algorithm; uint32_t iterations; uint8_t salt_length; uint8_t *salt; ldns_rdf *sname = NULL, *hashed_sname = NULL, *tmp; bool flag; bool exact_match_found; bool in_range_found; ldns_rdf *zone_name = NULL; size_t nsec_i; ldns_rr *nsec; ldns_rdf *result = NULL; if (!qname || !nsec3s || ldns_rr_list_rr_count(nsec3s) < 1) { return NULL; } if (verbosity >= 4) { printf(";; finding closest encloser for type %d ", qtype); ldns_rdf_print(stdout, qname); printf("\n"); } nsec = ldns_rr_list_rr(nsec3s, 0); algorithm = ldns_nsec3_algorithm(nsec); salt_length = ldns_nsec3_salt_length(nsec); salt = ldns_nsec3_salt_data(nsec); iterations = ldns_nsec3_iterations(nsec); if (salt == NULL) { goto done; } sname = ldns_rdf_clone(qname); if (sname == NULL) { goto done; } flag = false; zone_name = ldns_dname_left_chop(ldns_rr_owner(nsec)); if (zone_name == NULL) { goto done; } /* algorithm from nsec3-07 8.3 */ while (ldns_dname_label_count(sname) > 0) { exact_match_found = false; in_range_found = false; if (verbosity >= 3) { printf(";; "); ldns_rdf_print(stdout, sname); printf(" hashes to: "); } hashed_sname = ldns_nsec3_hash_name(sname, algorithm, iterations, salt_length, salt); if (hashed_sname == NULL) { goto done; } if (ldns_dname_cat(hashed_sname, zone_name) != LDNS_STATUS_OK){ goto done; } if (verbosity >= 3) { ldns_rdf_print(stdout, hashed_sname); printf("\n"); } for (nsec_i = 0; nsec_i < ldns_rr_list_rr_count(nsec3s); nsec_i++) { nsec = ldns_rr_list_rr(nsec3s, nsec_i); /* check values of iterations etc! */ /* exact match? */ if (ldns_dname_compare(ldns_rr_owner(nsec), hashed_sname) == 0) { if (verbosity >= 4) { printf(";; exact match found\n"); } exact_match_found = true; } else if (ldns_nsec_covers_name(nsec, hashed_sname)) { if (verbosity >= 4) { printf(";; in range of an nsec\n"); } in_range_found = true; } } if (!exact_match_found && in_range_found) { flag = true; } else if (exact_match_found && flag) { result = ldns_rdf_clone(sname); } else if (exact_match_found && !flag) { // error! if (verbosity >= 4) { printf(";; the closest encloser is the same name (ie. this is an exact match, ie there is no closest encloser)\n"); } ldns_rdf_deep_free(hashed_sname); goto done; } else { flag = false; } ldns_rdf_deep_free(hashed_sname); tmp = sname; sname = ldns_dname_left_chop(sname); ldns_rdf_deep_free(tmp); if (sname == NULL) { goto done; } } done: LDNS_FREE(salt); ldns_rdf_deep_free(zone_name); ldns_rdf_deep_free(sname); if (!result) { if (verbosity >= 4) { printf(";; no closest encloser found\n"); } } /* todo checks from end of 6.2. here or in caller? */ return result; } ldns-1.7.0/drill/configure0000755000175000017500000055727313026206201015053 0ustar willemwillem#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.69 for ldns 1.7.0. # # Report bugs to . # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. # # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # Use a proper internal environment variable to ensure we don't fall # into an infinite loop, continuously re-executing ourselves. if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then _as_can_reexec=no; export _as_can_reexec; # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 as_fn_exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi " as_required="as_fn_return () { (exit \$1); } as_fn_success () { as_fn_return 0; } as_fn_failure () { as_fn_return 1; } as_fn_ret_success () { return 0; } as_fn_ret_failure () { return 1; } exitcode=0 as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : else exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1 test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 test \$(( 1 + 1 )) = 2 || exit 1" if (eval "$as_required") 2>/dev/null; then : as_have_required=yes else as_have_required=no fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. as_shell=$as_dir/$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : CONFIG_SHELL=$as_shell as_have_required=yes if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : break 2 fi fi done;; esac as_found=false done $as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : CONFIG_SHELL=$SHELL as_have_required=yes fi; } IFS=$as_save_IFS if test "x$CONFIG_SHELL" != x; then : export CONFIG_SHELL # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi if test x$as_have_required = xno; then : $as_echo "$0: This script requires a shell more modern than all" $as_echo "$0: the shells that I found on your system." if test x${ZSH_VERSION+set} = xset ; then $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" $as_echo "$0: be upgraded to zsh 4.3.4 or later." else $as_echo "$0: Please tell bug-autoconf@gnu.org and $0: libdns@nlnetlabs.nl about your system, including any $0: error possibly output before this message. Then install $0: a modern shell, or manually run the script under such a $0: shell if you do have one." fi exit 1 fi fi fi SHELL=${CONFIG_SHELL-/bin/sh} export SHELL # Unset more variables known to interfere with behavior of common tools. CLICOLOR_FORCE= GREP_OPTIONS= unset CLICOLOR_FORCE GREP_OPTIONS ## --------------------- ## ## M4sh Shell Functions. ## ## --------------------- ## # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO as_lineno_2a=$LINENO eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # If we had to re-execute with $CONFIG_SHELL, we're ensured to have # already done that, so ensure we don't try to do so again and fall # in an infinite loop. This has already happened in practice. _as_can_reexec=no; export _as_can_reexec # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= # Identity of this package. PACKAGE_NAME='ldns' PACKAGE_TARNAME='libdns' PACKAGE_VERSION='1.7.0' PACKAGE_STRING='ldns 1.7.0' PACKAGE_BUGREPORT='libdns@nlnetlabs.nl' PACKAGE_URL='' ac_unique_file="drill.c" # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef STDC_HEADERS # include # include #else # ifdef HAVE_STDLIB_H # include # endif #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" ac_subst_vars='LTLIBOBJS LIBOBJS LDNS_TRUST_ANCHOR_FILE LDNSDIR LIBS_STC RUNTIME_PATH HAVE_SSL libtool SET_MAKE EGREP GREP CPP OBJEXT EXEEXT ac_ct_CC CPPFLAGS LDFLAGS CFLAGS CC target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir runstatedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking enable_rpath with_ssl with_ldns with_trust_anchor ' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CPP' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' runstatedir='${localstatedir}/run' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *=) ac_optarg= ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -runstatedir | --runstatedir | --runstatedi | --runstated \ | --runstate | --runstat | --runsta | --runst | --runs \ | --run | --ru | --r) ac_prev=runstatedir ;; -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \ | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \ | --run=* | --ru=* | --r=*) runstatedir=$ac_optarg ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) as_fn_error $? "unrecognized option: \`$ac_option' Try \`$0 --help' for more information" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir runstatedir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || as_fn_error $? "pwd does not report name of working directory" # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures ldns 1.7.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking ...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/libdns] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of ldns 1.7.0:";; esac cat <<\_ACEOF Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --disable-rpath disable hardcoded rpath (default=enabled) Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-ssl=pathname enable SSL (will check /usr/local/ssl /usr/lib/ssl /usr/ssl /usr/pkg /usr/local /opt/local /usr/sfw /usr) --with-ldns=PATH specify prefix of path of ldns library to use --with-trust-anchor=KEYFILE Default location of the trust anchor file. [default=SYSCONFDIR/unbound/root.key] Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory LIBS libraries to pass to the linker, e.g. -l CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to . _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested configure. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF ldns configure 1.7.0 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi ## ------------------------ ## ## Autoconf initialization. ## ## ------------------------ ## # ac_fn_c_try_compile LINENO # -------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_compile # ac_fn_c_try_cpp LINENO # ---------------------- # Try to preprocess conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_cpp () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } > conftest.i && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_cpp # ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists, giving a warning if it cannot be compiled using # the include files in INCLUDES and setting the cache variable VAR # accordingly. ac_fn_c_check_header_mongrel () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if eval \${$3+:} false; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 $as_echo_n "checking $2 usability... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_header_compiler=yes else ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 $as_echo_n "checking $2 presence... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <$2> _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : ac_header_preproc=yes else ac_header_preproc=no fi rm -f conftest.err conftest.i conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( yes:no: ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; no:yes:* ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ( $as_echo "## ---------------------------------- ## ## Report this to libdns@nlnetlabs.nl ## ## ---------------------------------- ##" ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=\$ac_header_compiler" fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_mongrel # ac_fn_c_try_run LINENO # ---------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. Assumes # that executables *can* be run. ac_fn_c_try_run () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then : ac_retval=0 else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_run # ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists and can be compiled using the include files in # INCLUDES, setting the cache variable VAR accordingly. ac_fn_c_check_header_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_compile # ac_fn_c_check_type LINENO TYPE VAR INCLUDES # ------------------------------------------- # Tests whether TYPE exists after having included INCLUDES, setting cache # variable VAR accordingly. ac_fn_c_check_type () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=no" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { if (sizeof ($2)) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { if (sizeof (($2))) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else eval "$3=yes" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_type # ac_fn_c_try_link LINENO # ----------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_link # ac_fn_c_check_func LINENO FUNC VAR # ---------------------------------- # Tests whether FUNC exists, setting the cache variable VAR accordingly ac_fn_c_check_func () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Define $2 to an innocuous variant, in case declares $2. For example, HP-UX 11i declares gettimeofday. */ #define $2 innocuous_$2 /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $2 (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $2 /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $2 (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$2 || defined __stub___$2 choke me #endif int main () { return $2 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_func cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by ldns $as_me 1.7.0, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. $as_echo "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; 2) as_fn_append ac_configure_args1 " '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi as_fn_append ac_configure_args " '$ac_arg'" ;; esac done done { ac_configure_args0=; unset ac_configure_args0;} { ac_configure_args1=; unset ac_configure_args1;} # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo $as_echo "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo $as_echo "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then $as_echo "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then $as_echo "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo cat confdefs.h echo fi test "$ac_signal" != 0 && $as_echo "$as_me: caught signal $ac_signal" $as_echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h $as_echo "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_URL "$PACKAGE_URL" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then # We do not want a PATH search for config.site. case $CONFIG_SITE in #(( -*) ac_site_file1=./$CONFIG_SITE;; */*) ac_site_file1=$CONFIG_SITE;; *) ac_site_file1=./$CONFIG_SITE;; esac elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site else ac_site_file1=$ac_default_prefix/share/config.site ac_site_file2=$ac_default_prefix/etc/config.site fi for ac_site_file in "$ac_site_file1" "$ac_site_file2" do test "x$ac_site_file" = xNONE && continue if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See \`config.log' for more details" "$LINENO" 5; } fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special files # actually), so we avoid doing that. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 $as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 $as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 $as_echo "$as_me: former value: \`$ac_old_val'" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 $as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## ## -------------------- ## ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu # acx_nlnetlabs.m4 - common macros for configure checks # Copyright 2009, Wouter Wijngaards, NLnet Labs. # BSD licensed. # # Version 34 # 2016-03-21 Check -ldl -pthread for libcrypto for ldns and openssl 1.1.0. # 2016-03-21 Use HMAC_Update instead of HMAC_CTX_Init (for openssl-1.1.0). # 2016-01-04 -D_DEFAULT_SOURCE defined with -D_BSD_SOURCE for Linux glibc 2.20 # 2015-12-11 FLTO check for new OSX, clang. # 2015-11-18 spelling check fix. # 2015-11-05 ACX_SSL_CHECKS no longer adds -ldl needlessly. # 2015-08-28 ACX_CHECK_PIE and ACX_CHECK_RELRO_NOW added. # 2015-03-17 AHX_CONFIG_REALLOCARRAY added # 2013-09-19 FLTO help text improved. # 2013-07-18 Enable ACX_CHECK_COMPILER_FLAG to test for -Wstrict-prototypes # 2013-06-25 FLTO has --disable-flto option. # 2013-05-03 Update W32_SLEEP for newer mingw that links but not defines it. # 2013-03-22 Fix ACX_RSRC_VERSION for long version numbers. # 2012-02-09 Fix AHX_MEMCMP_BROKEN with undef in compat/memcmp.h. # 2012-01-20 Fix COMPILER_FLAGS_UNBOUND for gcc 4.6.2 assigned-not-used-warns. # 2011-12-05 Fix getaddrinfowithincludes on windows with fedora16 mingw32-gcc. # Fix ACX_MALLOC for redefined malloc error. # Fix GETADDRINFO_WITH_INCLUDES to add -lws2_32 # 2011-11-10 Fix FLTO test to not drop a.out in current directory. # 2011-11-01 Fix FLTO test for llvm on Lion. # 2011-08-01 Fix nonblock test (broken at v13). # 2011-08-01 Fix autoconf 2.68 warnings # 2011-06-23 Add ACX_CHECK_FLTO to check -flto. # 2010-08-16 Fix FLAG_OMITTED for AS_TR_CPP changes in autoconf-2.66. # 2010-07-02 Add check for ss_family (for minix). # 2010-04-26 Fix to use CPPFLAGS for CHECK_COMPILER_FLAGS. # 2010-03-01 Fix RPATH using CONFIG_COMMANDS to run at the very end. # 2010-02-18 WITH_SSL outputs the LIBSSL_LDFLAGS, LIBS, CPPFLAGS separate, -ldl # 2010-02-01 added ACX_CHECK_MEMCMP_SIGNED, AHX_MEMCMP_BROKEN # 2010-01-20 added AHX_COONFIG_STRLCAT # 2009-07-14 U_CHAR detection improved for windows crosscompile. # added ACX_FUNC_MALLOC # fixup some #if to #ifdef # NONBLOCKING test for mingw crosscompile. # 2009-07-13 added ACX_WITH_SSL_OPTIONAL # 2009-07-03 fixup LDFLAGS for empty ssl dir. # # Automates some of the checking constructs. Aims at portability for POSIX. # Documentation for functions is below. # # the following macro's are provided in this file: # (see below for details on each macro). # # ACX_ESCAPE_BACKSLASH - escape backslashes in var for C-preproc. # ACX_RSRC_VERSION - create windows resource version number. # ACX_CHECK_COMPILER_FLAG - see if cc supports a flag. # ACX_CHECK_ERROR_FLAGS - see which flag is -werror (used below). # ACX_CHECK_COMPILER_FLAG_NEEDED - see if flags make the code compile cleanly. # ACX_DEPFLAG - find cc dependency flags. # ACX_DETERMINE_EXT_FLAGS_UNBOUND - find out which flags enable BSD and POSIX. # ACX_CHECK_FORMAT_ATTRIBUTE - find cc printf format syntax. # ACX_CHECK_UNUSED_ATTRIBUTE - find cc variable unused syntax. # ACX_CHECK_FLTO - see if cc supports -flto and use it if so. # ACX_LIBTOOL_C_ONLY - create libtool for C only, improved. # ACX_TYPE_U_CHAR - u_char type. # ACX_TYPE_RLIM_T - rlim_t type. # ACX_TYPE_SOCKLEN_T - socklen_t type. # ACX_TYPE_IN_ADDR_T - in_addr_t type. # ACX_TYPE_IN_PORT_T - in_port_t type. # ACX_ARG_RPATH - add --disable-rpath option. # ACX_WITH_SSL - add --with-ssl option, link -lcrypto. # ACX_WITH_SSL_OPTIONAL - add --with-ssl option, link -lcrypto, # where --without-ssl is also accepted # ACX_LIB_SSL - setup to link -lssl. # ACX_SYS_LARGEFILE - improved sys_largefile, fseeko, >2G files. # ACX_CHECK_GETADDRINFO_WITH_INCLUDES - find getaddrinfo, portably. # ACX_FUNC_DEPRECATED - see if func is deprecated. # ACX_CHECK_NONBLOCKING_BROKEN - see if nonblocking sockets really work. # ACX_MKDIR_ONE_ARG - determine mkdir(2) number of arguments. # ACX_FUNC_IOCTLSOCKET - find ioctlsocket, portably. # ACX_FUNC_MALLOC - check malloc, define replacement . # AHX_CONFIG_FORMAT_ATTRIBUTE - config.h text for format. # AHX_CONFIG_UNUSED_ATTRIBUTE - config.h text for unused. # AHX_CONFIG_FSEEKO - define fseeko, ftello fallback. # AHX_CONFIG_RAND_MAX - define RAND_MAX if needed. # AHX_CONFIG_MAXHOSTNAMELEN - define MAXHOSTNAMELEN if needed. # AHX_CONFIG_IPV6_MIN_MTU - define IPV6_MIN_MTU if needed. # AHX_CONFIG_SNPRINTF - snprintf compat prototype # AHX_CONFIG_INET_PTON - inet_pton compat prototype # AHX_CONFIG_INET_NTOP - inet_ntop compat prototype # AHX_CONFIG_INET_ATON - inet_aton compat prototype # AHX_CONFIG_MEMMOVE - memmove compat prototype # AHX_CONFIG_STRLCAT - strlcat compat prototype # AHX_CONFIG_STRLCPY - strlcpy compat prototype # AHX_CONFIG_GMTIME_R - gmtime_r compat prototype # AHX_CONFIG_W32_SLEEP - w32 compat for sleep # AHX_CONFIG_W32_USLEEP - w32 compat for usleep # AHX_CONFIG_W32_RANDOM - w32 compat for random # AHX_CONFIG_W32_SRANDOM - w32 compat for srandom # AHX_CONFIG_W32_FD_SET_T - w32 detection of FD_SET_T. # ACX_CFLAGS_STRIP - strip one flag from CFLAGS # ACX_STRIP_EXT_FLAGS - strip extension flags from CFLAGS # AHX_CONFIG_FLAG_OMITTED - define omitted flag # AHX_CONFIG_FLAG_EXT - define omitted extension flag # AHX_CONFIG_EXT_FLAGS - define the stripped extension flags # ACX_CHECK_MEMCMP_SIGNED - check if memcmp uses signed characters. # AHX_MEMCMP_BROKEN - replace memcmp func for CHECK_MEMCMP_SIGNED. # ACX_CHECK_SS_FAMILY - check for sockaddr_storage.ss_family # ACX_CHECK_PIE - add --enable-pie option and check if works # ACX_CHECK_RELRO_NOW - add --enable-relro-now option and check it # OURCPPFLAGS='' CPPFLAGS=${CPPFLAGS:-${OURCPPFLAGS}} OURCFLAGS='-g' CFLAGS=${CFLAGS:-${OURCFLAGS}} $as_echo "#define WINVER 0x0502" >>confdefs.h ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 $as_echo_n "checking whether the C compiler works... " >&6; } ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { { ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an `-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else ac_file='' fi if test -z "$ac_file"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables See \`config.log' for more details" "$LINENO" 5; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 $as_echo_n "checking for C compiler default output file name... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 $as_echo "$ac_file" >&6; } ac_exeext=$ac_cv_exeext rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 $as_echo_n "checking for suffix of executables... " >&6; } if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest conftest$ac_cv_exeext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 $as_echo "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { FILE *f = fopen ("conftest.out", "w"); return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF ac_clean_files="$ac_clean_files conftest.out" # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 $as_echo_n "checking whether we are cross compiling... " >&6; } if test "$cross_compiling" != yes; then { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if { ac_try='./conftest$ac_cv_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details" "$LINENO" 5; } fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 $as_echo "$cross_compiling" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } if ${ac_cv_objext+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 $as_echo "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes else CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 $as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include struct stat; /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac if test "x$ac_cv_prog_cc_c89" != xno; then : fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 $as_echo_n "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if ${ac_cv_prog_CPP+:} false; then : $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 $as_echo "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } if ${ac_cv_path_GREP+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$GREP"; then ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_GREP" || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_GREP"; then as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_GREP=$GREP fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 $as_echo "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } if ${ac_cv_path_EGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else if test -z "$EGREP"; then ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_EGREP" || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP"; then as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_EGREP=$EGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 $as_echo "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if ${ac_cv_header_stdc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_stdc=yes else ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : : else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : else ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then $as_echo "#define STDC_HEADERS 1" >>confdefs.h fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default " if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done ac_fn_c_check_header_mongrel "$LINENO" "minix/config.h" "ac_cv_header_minix_config_h" "$ac_includes_default" if test "x$ac_cv_header_minix_config_h" = xyes; then : MINIX=yes else MINIX= fi if test "$MINIX" = yes; then $as_echo "#define _POSIX_SOURCE 1" >>confdefs.h $as_echo "#define _POSIX_1_SOURCE 2" >>confdefs.h $as_echo "#define _MINIX 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether it is safe to define __EXTENSIONS__" >&5 $as_echo_n "checking whether it is safe to define __EXTENSIONS__... " >&6; } if ${ac_cv_safe_to_define___extensions__+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ # define __EXTENSIONS__ 1 $ac_includes_default int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_safe_to_define___extensions__=yes else ac_cv_safe_to_define___extensions__=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_safe_to_define___extensions__" >&5 $as_echo "$ac_cv_safe_to_define___extensions__" >&6; } test $ac_cv_safe_to_define___extensions__ = yes && $as_echo "#define __EXTENSIONS__ 1" >>confdefs.h $as_echo "#define _ALL_SOURCE 1" >>confdefs.h $as_echo "#define _GNU_SOURCE 1" >>confdefs.h $as_echo "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h $as_echo "#define _TANDEM_SOURCE 1" >>confdefs.h # Checks for programs. ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes else CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 $as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include struct stat; /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac if test "x$ac_cv_prog_cc_c89" != xno; then : fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } SET_MAKE= else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi for ac_prog in glibtool libtool15 libtool do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_libtool+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$libtool"; then ac_cv_prog_libtool="$libtool" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_libtool="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi libtool=$ac_cv_prog_libtool if test -n "$libtool"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libtool" >&5 $as_echo "$libtool" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$libtool" && break done test -n "$libtool" || libtool="../libtool" # add option to disable the evil rpath # Check whether --enable-rpath was given. if test "${enable_rpath+set}" = set; then : enableval=$enable_rpath; enable_rpath=$enableval else enable_rpath=yes fi if test "x$enable_rpath" = xyes; then RPATH_VAL="-Wl,-rpath=\${libdir}" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -std=c99" >&5 $as_echo_n "checking whether $CC supports -std=c99... " >&6; } cache=`echo std=c99 | sed 'y%.=/+-%___p_%'` if eval \${cv_prog_cc_flag_$cache+:} false; then : $as_echo_n "(cached) " >&6 else echo 'void f(void){}' >conftest.c if test -z "`$CC $CPPFLAGS $CFLAGS -std=c99 -c conftest.c 2>&1`"; then eval "cv_prog_cc_flag_$cache=yes" else eval "cv_prog_cc_flag_$cache=no" fi rm -f conftest conftest.o conftest.c fi if eval "test \"`echo '$cv_prog_cc_flag_'$cache`\" = yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } : C99FLAG="-std=c99" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } : fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -xc99" >&5 $as_echo_n "checking whether $CC supports -xc99... " >&6; } cache=`echo xc99 | sed 'y%.=/+-%___p_%'` if eval \${cv_prog_cc_flag_$cache+:} false; then : $as_echo_n "(cached) " >&6 else echo 'void f(void){}' >conftest.c if test -z "`$CC $CPPFLAGS $CFLAGS -xc99 -c conftest.c 2>&1`"; then eval "cv_prog_cc_flag_$cache=yes" else eval "cv_prog_cc_flag_$cache=no" fi rm -f conftest conftest.o conftest.c fi if eval "test \"`echo '$cv_prog_cc_flag_'$cache`\" = yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } : C99FLAG="-xc99" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } : fi ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" if test "x$ac_cv_type_size_t" = xyes; then : else cat >>confdefs.h <<_ACEOF #define size_t unsigned int _ACEOF fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -O2" >&5 $as_echo_n "checking whether $CC supports -O2... " >&6; } cache=`echo O2 | sed 'y%.=/+-%___p_%'` if eval \${cv_prog_cc_flag_$cache+:} false; then : $as_echo_n "(cached) " >&6 else echo 'void f(void){}' >conftest.c if test -z "`$CC $CPPFLAGS $CFLAGS -O2 -c conftest.c 2>&1`"; then eval "cv_prog_cc_flag_$cache=yes" else eval "cv_prog_cc_flag_$cache=no" fi rm -f conftest conftest.o conftest.c fi if eval "test \"`echo '$cv_prog_cc_flag_'$cache`\" = yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } : CFLAGS="$CFLAGS -O2" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } : fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Werror" >&5 $as_echo_n "checking whether $CC supports -Werror... " >&6; } cache=`echo Werror | sed 'y%.=/+-%___p_%'` if eval \${cv_prog_cc_flag_$cache+:} false; then : $as_echo_n "(cached) " >&6 else echo 'void f(void){}' >conftest.c if test -z "`$CC $CPPFLAGS $CFLAGS -Werror -c conftest.c 2>&1`"; then eval "cv_prog_cc_flag_$cache=yes" else eval "cv_prog_cc_flag_$cache=no" fi rm -f conftest conftest.o conftest.c fi if eval "test \"`echo '$cv_prog_cc_flag_'$cache`\" = yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } : ERRFLAG="-Werror" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } : ERRFLAG="-errwarn" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wall" >&5 $as_echo_n "checking whether $CC supports -Wall... " >&6; } cache=`echo Wall | sed 'y%.=/+-%___p_%'` if eval \${cv_prog_cc_flag_$cache+:} false; then : $as_echo_n "(cached) " >&6 else echo 'void f(void){}' >conftest.c if test -z "`$CC $CPPFLAGS $CFLAGS -Wall -c conftest.c 2>&1`"; then eval "cv_prog_cc_flag_$cache=yes" else eval "cv_prog_cc_flag_$cache=no" fi rm -f conftest conftest.o conftest.c fi if eval "test \"`echo '$cv_prog_cc_flag_'$cache`\" = yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } : ERRFLAG="$ERRFLAG -Wall" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } : ERRFLAG="$ERRFLAG -errfmt" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we need $C99FLAG -D__EXTENSIONS__ -D_BSD_SOURCE -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 as a flag for $CC" >&5 $as_echo_n "checking whether we need $C99FLAG -D__EXTENSIONS__ -D_BSD_SOURCE -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 as a flag for $CC... " >&6; } cache=`$as_echo "$C99FLAG -D__EXTENSIONS__ -D_BSD_SOURCE -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600" | $as_tr_sh` if eval \${cv_prog_cc_flag_needed_$cache+:} false; then : $as_echo_n "(cached) " >&6 else echo ' #include "confdefs.h" #include #include #include #ifdef HAVE_TIME_H #include #endif #include #ifdef HAVE_GETOPT_H #include #endif int test() { int a; char **opts = NULL; struct timeval tv; char *t; time_t time = 0; char *buf = NULL; t = ctime_r(&time, buf); tv.tv_usec = 10; srandom(32); a = getopt(2, opts, "a"); a = isascii(32); return a; } ' > conftest.c echo 'void f(){}' >>conftest.c if test -z "`$CC $CPPFLAGS $CFLAGS $ERRFLAG -c conftest.c 2>&1`"; then eval "cv_prog_cc_flag_needed_$cache=no" else if test -z "`$CC $CPPFLAGS $CFLAGS $C99FLAG -D__EXTENSIONS__ -D_BSD_SOURCE -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 $ERRFLAG -c conftest.c 2>&1`"; then eval "cv_prog_cc_flag_needed_$cache=yes" else eval "cv_prog_cc_flag_needed_$cache=fail" #echo 'Test with flag fails too!' #cat conftest.c #echo "$CC $CPPFLAGS $CFLAGS $C99FLAG -D__EXTENSIONS__ -D_BSD_SOURCE -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 $ERRFLAG -c conftest.c 2>&1" #echo `$CC $CPPFLAGS $CFLAGS $C99FLAG -D__EXTENSIONS__ -D_BSD_SOURCE -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 $ERRFLAG -c conftest.c 2>&1` #exit 1 fi fi rm -f conftest conftest.c conftest.o fi if eval "test \"`echo '$cv_prog_cc_flag_needed_'$cache`\" = yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } : CFLAGS="$CFLAGS $C99FLAG -D__EXTENSIONS__ -D_BSD_SOURCE -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600" else if eval "test \"`echo '$cv_prog_cc_flag_needed_'$cache`\" = no"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } #echo 'Test with flag is no!' #cat conftest.c #echo "$CC $CPPFLAGS $CFLAGS $C99FLAG -D__EXTENSIONS__ -D_BSD_SOURCE -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 $ERRFLAG -c conftest.c 2>&1" #echo `$CC $CPPFLAGS $CFLAGS $C99FLAG -D__EXTENSIONS__ -D_BSD_SOURCE -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 $ERRFLAG -c conftest.c 2>&1` #exit 1 : else { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5 $as_echo "failed" >&6; } : fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we need $C99FLAG as a flag for $CC" >&5 $as_echo_n "checking whether we need $C99FLAG as a flag for $CC... " >&6; } cache=`$as_echo "$C99FLAG" | $as_tr_sh` if eval \${cv_prog_cc_flag_needed_$cache+:} false; then : $as_echo_n "(cached) " >&6 else echo '#include ' > conftest.c echo 'void f(){}' >>conftest.c if test -z "`$CC $CPPFLAGS $CFLAGS $ERRFLAG -c conftest.c 2>&1`"; then eval "cv_prog_cc_flag_needed_$cache=no" else if test -z "`$CC $CPPFLAGS $CFLAGS $C99FLAG $ERRFLAG -c conftest.c 2>&1`"; then eval "cv_prog_cc_flag_needed_$cache=yes" else eval "cv_prog_cc_flag_needed_$cache=fail" #echo 'Test with flag fails too!' #cat conftest.c #echo "$CC $CPPFLAGS $CFLAGS $C99FLAG $ERRFLAG -c conftest.c 2>&1" #echo `$CC $CPPFLAGS $CFLAGS $C99FLAG $ERRFLAG -c conftest.c 2>&1` #exit 1 fi fi rm -f conftest conftest.c conftest.o fi if eval "test \"`echo '$cv_prog_cc_flag_needed_'$cache`\" = yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } : CFLAGS="$CFLAGS $C99FLAG" else if eval "test \"`echo '$cv_prog_cc_flag_needed_'$cache`\" = no"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } #echo 'Test with flag is no!' #cat conftest.c #echo "$CC $CPPFLAGS $CFLAGS $C99FLAG $ERRFLAG -c conftest.c 2>&1" #echo `$CC $CPPFLAGS $CFLAGS $C99FLAG $ERRFLAG -c conftest.c 2>&1` #exit 1 : else { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5 $as_echo "failed" >&6; } : fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5 $as_echo_n "checking for inline... " >&6; } if ${ac_cv_c_inline+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifndef __cplusplus typedef int foo_t; static $ac_kw foo_t static_foo () {return 0; } $ac_kw foo_t foo () {return 0; } #endif _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_c_inline=$ac_kw fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext test "$ac_cv_c_inline" != no && break done fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5 $as_echo "$ac_cv_c_inline" >&6; } case $ac_cv_c_inline in inline | yes) ;; *) case $ac_cv_c_inline in no) ac_val=;; *) ac_val=$ac_cv_c_inline;; esac cat >>confdefs.h <<_ACEOF #ifndef __cplusplus #define inline $ac_val #endif _ACEOF ;; esac ac_fn_c_check_type "$LINENO" "int8_t" "ac_cv_type_int8_t" "$ac_includes_default" if test "x$ac_cv_type_int8_t" = xyes; then : else cat >>confdefs.h <<_ACEOF #define int8_t char _ACEOF fi ac_fn_c_check_type "$LINENO" "int16_t" "ac_cv_type_int16_t" "$ac_includes_default" if test "x$ac_cv_type_int16_t" = xyes; then : else cat >>confdefs.h <<_ACEOF #define int16_t short _ACEOF fi ac_fn_c_check_type "$LINENO" "int32_t" "ac_cv_type_int32_t" "$ac_includes_default" if test "x$ac_cv_type_int32_t" = xyes; then : else cat >>confdefs.h <<_ACEOF #define int32_t int _ACEOF fi ac_fn_c_check_type "$LINENO" "int64_t" "ac_cv_type_int64_t" "$ac_includes_default" if test "x$ac_cv_type_int64_t" = xyes; then : else cat >>confdefs.h <<_ACEOF #define int64_t long long _ACEOF fi ac_fn_c_check_type "$LINENO" "uint8_t" "ac_cv_type_uint8_t" "$ac_includes_default" if test "x$ac_cv_type_uint8_t" = xyes; then : else cat >>confdefs.h <<_ACEOF #define uint8_t unsigned char _ACEOF fi ac_fn_c_check_type "$LINENO" "uint16_t" "ac_cv_type_uint16_t" "$ac_includes_default" if test "x$ac_cv_type_uint16_t" = xyes; then : else cat >>confdefs.h <<_ACEOF #define uint16_t unsigned short _ACEOF fi ac_fn_c_check_type "$LINENO" "uint32_t" "ac_cv_type_uint32_t" "$ac_includes_default" if test "x$ac_cv_type_uint32_t" = xyes; then : else cat >>confdefs.h <<_ACEOF #define uint32_t unsigned int _ACEOF fi ac_fn_c_check_type "$LINENO" "uint64_t" "ac_cv_type_uint64_t" "$ac_includes_default" if test "x$ac_cv_type_uint64_t" = xyes; then : else cat >>confdefs.h <<_ACEOF #define uint64_t unsigned long long _ACEOF fi ac_fn_c_check_type "$LINENO" "ssize_t" "ac_cv_type_ssize_t" "$ac_includes_default" if test "x$ac_cv_type_ssize_t" = xyes; then : else cat >>confdefs.h <<_ACEOF #define ssize_t int _ACEOF fi for ac_header in sys/types.h getopt.h stdlib.h stdio.h assert.h netinet/in.h ctype.h time.h arpa/inet.h sys/time.h sys/socket.h sys/select.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default " if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in netinet/in_systm.h net/if.h netinet/ip.h netinet/udp.h netinet/if_ether.h netinet/ip6.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" " $ac_includes_default #ifdef HAVE_NETINET_IN_SYSTM_H #include #endif #ifdef HAVE_NETINET_IN_H #include #endif #ifdef HAVE_SYS_SOCKET_H #include #endif #ifdef HAVE_NET_IF_H #include #endif " if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done # MinGW32 tests for ac_header in winsock2.h ws2tcpip.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default " if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done ac_fn_c_check_type "$LINENO" "socklen_t" "ac_cv_type_socklen_t" " $ac_includes_default #ifdef HAVE_SYS_SOCKET_H # include #endif #ifdef HAVE_WS2TCPIP_H # include #endif " if test "x$ac_cv_type_socklen_t" = xyes; then : else $as_echo "#define socklen_t int" >>confdefs.h fi for ac_header in sys/param.h sys/mount.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default #if HAVE_SYS_PARAM_H # include #endif " if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done ac_fn_c_check_type "$LINENO" "in_addr_t" "ac_cv_type_in_addr_t" " #if HAVE_SYS_TYPES_H # include #endif #if HAVE_NETINET_IN_H # include #endif " if test "x$ac_cv_type_in_addr_t" = xyes; then : else $as_echo "#define in_addr_t uint32_t" >>confdefs.h fi ac_fn_c_check_type "$LINENO" "in_port_t" "ac_cv_type_in_port_t" " #if HAVE_SYS_TYPES_H # include #endif #if HAVE_NETINET_IN_H # include #endif " if test "x$ac_cv_type_in_port_t" = xyes; then : else $as_echo "#define in_port_t uint16_t" >>confdefs.h fi # check to see if libraries are needed for these functions. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing socket" >&5 $as_echo_n "checking for library containing socket... " >&6; } if ${ac_cv_search_socket+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char socket (); int main () { return socket (); ; return 0; } _ACEOF for ac_lib in '' socket; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO"; then : ac_cv_search_socket=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext if ${ac_cv_search_socket+:} false; then : break fi done if ${ac_cv_search_socket+:} false; then : else ac_cv_search_socket=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_socket" >&5 $as_echo "$ac_cv_search_socket" >&6; } ac_res=$ac_cv_search_socket if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing inet_pton" >&5 $as_echo_n "checking for library containing inet_pton... " >&6; } if ${ac_cv_search_inet_pton+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char inet_pton (); int main () { return inet_pton (); ; return 0; } _ACEOF for ac_lib in '' nsl; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO"; then : ac_cv_search_inet_pton=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext if ${ac_cv_search_inet_pton+:} false; then : break fi done if ${ac_cv_search_inet_pton+:} false; then : else ac_cv_search_inet_pton=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_inet_pton" >&5 $as_echo "$ac_cv_search_inet_pton" >&6; } ac_res=$ac_cv_search_inet_pton if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi # Check whether --with-ssl was given. if test "${with_ssl+set}" = set; then : withval=$with_ssl; else withval="yes" fi withval=$withval if test x_$withval != x_no; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SSL" >&5 $as_echo_n "checking for SSL... " >&6; } if test x_$withval = x_ -o x_$withval = x_yes; then withval="/usr/local/ssl /usr/lib/ssl /usr/ssl /usr/pkg /usr/local /opt/local /usr/sfw /usr" fi for dir in $withval; do ssldir="$dir" if test -f "$dir/include/openssl/ssl.h"; then found_ssl="yes" cat >>confdefs.h <<_ACEOF #define HAVE_SSL /**/ _ACEOF if test "$ssldir" != "/usr"; then CPPFLAGS="$CPPFLAGS -I$ssldir/include" LIBSSL_CPPFLAGS="$LIBSSL_CPPFLAGS -I$ssldir/include" fi break; fi done if test x_$found_ssl != x_yes; then as_fn_error $? "Cannot find the SSL libraries in $withval" "$LINENO" 5 else { $as_echo "$as_me:${as_lineno-$LINENO}: result: found in $ssldir" >&5 $as_echo "found in $ssldir" >&6; } HAVE_SSL=yes if test "$ssldir" != "/usr" -a "$ssldir" != ""; then LDFLAGS="$LDFLAGS -L$ssldir/lib" LIBSSL_LDFLAGS="$LIBSSL_LDFLAGS -L$ssldir/lib" if test "x$enable_rpath" = xyes; then if echo "$ssldir/lib" | grep "^/" >/dev/null; then RUNTIME_PATH="$RUNTIME_PATH -R$ssldir/lib" fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for HMAC_Update in -lcrypto" >&5 $as_echo_n "checking for HMAC_Update in -lcrypto... " >&6; } LIBS="$LIBS -lcrypto" LIBSSL_LIBS="$LIBSSL_LIBS -lcrypto" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { int HMAC_Update(void); (void)HMAC_Update(); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } $as_echo "#define HAVE_HMAC_UPDATE 1" >>confdefs.h else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } # check if -lwsock32 or -lgdi32 are needed. BAKLIBS="$LIBS" BAKSSLLIBS="$LIBSSL_LIBS" LIBS="$LIBS -lgdi32" LIBSSL_LIBS="$LIBSSL_LIBS -lgdi32" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if -lcrypto needs -lgdi32" >&5 $as_echo_n "checking if -lcrypto needs -lgdi32... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { int HMAC_Update(void); (void)HMAC_Update(); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : $as_echo "#define HAVE_HMAC_UPDATE 1" >>confdefs.h { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } LIBS="$BAKLIBS" LIBSSL_LIBS="$BAKSSLLIBS" LIBS="$LIBS -ldl" LIBSSL_LIBS="$LIBSSL_LIBS -ldl" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if -lcrypto needs -ldl" >&5 $as_echo_n "checking if -lcrypto needs -ldl... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { int HMAC_Update(void); (void)HMAC_Update(); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : $as_echo "#define HAVE_HMAC_UPDATE 1" >>confdefs.h { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } LIBS="$BAKLIBS" LIBSSL_LIBS="$BAKSSLLIBS" LIBS="$LIBS -ldl -pthread" LIBSSL_LIBS="$LIBSSL_LIBS -ldl -pthread" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if -lcrypto needs -ldl -pthread" >&5 $as_echo_n "checking if -lcrypto needs -ldl -pthread... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { int HMAC_Update(void); (void)HMAC_Update(); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : $as_echo "#define HAVE_HMAC_UPDATE 1" >>confdefs.h { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } as_fn_error $? "OpenSSL found in $ssldir, but version 0.9.7 or higher is required" "$LINENO" 5 fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi fi for ac_header in openssl/ssl.h do : ac_fn_c_check_header_compile "$LINENO" "openssl/ssl.h" "ac_cv_header_openssl_ssl_h" "$ac_includes_default " if test "x$ac_cv_header_openssl_ssl_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_OPENSSL_SSL_H 1 _ACEOF fi done for ac_header in openssl/err.h do : ac_fn_c_check_header_compile "$LINENO" "openssl/err.h" "ac_cv_header_openssl_err_h" "$ac_includes_default " if test "x$ac_cv_header_openssl_err_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_OPENSSL_ERR_H 1 _ACEOF fi done for ac_header in openssl/rand.h do : ac_fn_c_check_header_compile "$LINENO" "openssl/rand.h" "ac_cv_header_openssl_rand_h" "$ac_includes_default " if test "x$ac_cv_header_openssl_rand_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_OPENSSL_RAND_H 1 _ACEOF fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for getaddrinfo" >&5 $as_echo_n "checking for getaddrinfo... " >&6; } ac_cv_func_getaddrinfo=no cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __cplusplus extern "C" { #endif char* getaddrinfo(); char* (*f) () = getaddrinfo; #ifdef __cplusplus } #endif int main() { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_func_getaddrinfo="yes" if test "$ac_cv_header_windows_h" = "yes"; then $as_echo "#define USE_WINSOCK 1" >>confdefs.h USE_WINSOCK="1" LIBS="$LIBS -lws2_32" fi else ORIGLIBS="$LIBS" LIBS="$LIBS -lws2_32" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef HAVE_WS2TCPIP_H #include #endif int main () { (void)getaddrinfo(NULL, NULL, NULL, NULL); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_func_getaddrinfo="yes" $as_echo "#define USE_WINSOCK 1" >>confdefs.h USE_WINSOCK="1" else ac_cv_func_getaddrinfo="no" LIBS="$ORIGLIBS" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_getaddrinfo" >&5 $as_echo "$ac_cv_func_getaddrinfo" >&6; } if test $ac_cv_func_getaddrinfo = yes; then $as_echo "#define HAVE_GETADDRINFO 1" >>confdefs.h fi LIBS_STC="$LIBS" # check for ldns # Check whether --with-ldns was given. if test "${with_ldns+set}" = set; then : withval=$with_ldns; specialldnsdir="$withval" CPPFLAGS="$CPPFLAGS -I$withval/include" LDFLAGS="-L$withval -L$withval/lib $LDFLAGS" LDNSDIR="$withval" LIBS="-lldns $LIBS" LIBS_STC="$withval/lib/libldns.a $LIBS_STC" fi #AC_CHECK_HEADER(ldns/ldns.h,, [ # AC_MSG_ERROR([Can't find ldns headers (make copy-headers in devel source.)]) # ], [AC_INCLUDES_DEFAULT] #) for ac_func in isblank do : ac_fn_c_check_func "$LINENO" "isblank" "ac_cv_func_isblank" if test "x$ac_cv_func_isblank" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_ISBLANK 1 _ACEOF fi done # check for ldns development source tree { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ldns devel source" >&5 $as_echo_n "checking for ldns devel source... " >&6; } ldns_dev_dir=.. if test -f $ldns_dev_dir/ldns/util.h && \ grep LDNS_VERSION $ldns_dev_dir/ldns/util.h >/dev/null; then ldns_version=`grep LDNS_VERSION $ldns_dev_dir/ldns/util.h | sed -e 's/^.*"\(.*\)".*$/\1/'` { $as_echo "$as_me:${as_lineno-$LINENO}: result: using $ldns_dev_dir with $ldns_version" >&5 $as_echo "using $ldns_dev_dir with $ldns_version" >&6; } CPPFLAGS="$CPPFLAGS -I$ldns_dev_dir/include" LDFLAGS="-L$ldns_dev_dir -L$ldns_dev_dir/lib $LDFLAGS" LIBS="-lldns $LIBS" $as_echo "#define HAVE_LIBLDNS 1" >>confdefs.h LDNSDIR="$ldns_dev_dir" LIBS_STC="$ldns_dev_dir/lib/libldns.a $LIBS_STC" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ldns_rr_new in -lldns" >&5 $as_echo_n "checking for ldns_rr_new in -lldns... " >&6; } if ${ac_cv_lib_ldns_ldns_rr_new+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lldns $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char ldns_rr_new (); int main () { return ldns_rr_new (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_ldns_ldns_rr_new=yes else ac_cv_lib_ldns_ldns_rr_new=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ldns_ldns_rr_new" >&5 $as_echo "$ac_cv_lib_ldns_ldns_rr_new" >&6; } if test "x$ac_cv_lib_ldns_ldns_rr_new" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBLDNS 1 _ACEOF LIBS="-lldns $LIBS" else as_fn_error $? "Can't find ldns library" "$LINENO" 5 fi fi # Check whether --with-trust-anchor was given. if test "${with_trust_anchor+set}" = set; then : withval=$with_trust_anchor; LDNS_TRUST_ANCHOR_FILE="$withval" else if test "x$LDNS_TRUST_ANCHOR_FILE" = "x"; then if test "x$sysconfdir" = 'x${prefix}/etc' ; then if test "x$prefix" = 'xNONE' ; then LDNS_TRUST_ANCHOR_FILE="/etc/unbound/root.key" else LDNS_TRUST_ANCHOR_FILE="${prefix}/etc/unbound/root.key" fi else LDNS_TRUST_ANCHOR_FILE="${sysconfdir}/unbound/root.key" fi fi fi cat >>confdefs.h <<_ACEOF #define LDNS_TRUST_ANCHOR_FILE "$LDNS_TRUST_ANCHOR_FILE" _ACEOF { $as_echo "$as_me:${as_lineno-$LINENO}: Default trust anchor: $LDNS_TRUST_ANCHOR_FILE" >&5 $as_echo "$as_me: Default trust anchor: $LDNS_TRUST_ANCHOR_FILE" >&6;} ac_config_files="$ac_config_files Makefile drill.1" ac_config_headers="$ac_config_headers config.h" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes: double-quote # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else case $cache_file in #( */* | ?:*) mv -f confcache "$cache_file"$$ && mv -f "$cache_file"$$ "$cache_file" ;; #( *) mv -f confcache "$cache_file" ;; esac fi fi else { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 ## ----------------------------------- ## ## Main body of $CONFIG_STATUS script. ## ## ----------------------------------- ## _ASEOF test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by ldns $as_me 1.7.0, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac case $ac_config_headers in *" "*) set x $ac_config_headers; shift; ac_config_headers=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit --config print configuration, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ ldns config.status 1.7.0 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Copyright (C) 2012 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in --*=?*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; --*=) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg= ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) $as_echo "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) $as_echo "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append CONFIG_HEADERS " '$ac_optarg'" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header as_fn_error $? "ambiguous option: \`$1' Try \`$0 --help' for more information.";; --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX $as_echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "drill.1") CONFIG_FILES="$CONFIG_FILES drill.1" ;; "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= ac_tmp= trap 'exit_status=$? : "${ac_tmp:=$tmp}" { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this # point, so we can use a bashism as a fallback. if test "x$ac_cr" = x; then eval ac_cr=\$\'\\r\' fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' >$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF # VPATH may cause trouble with some makes, so we remove sole $(srcdir), # ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ h s/// s/^/:/ s/[ ]*$/:/ s/:\$(srcdir):/:/g s/:\${srcdir}:/:/g s/:@srcdir@:/:/g s/^:*// s/:*$// x s/\(=[ ]*\).*/\1/ G s/\n// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" # Set up the scripts for CONFIG_HEADERS section. # No need to generate them if there are no CONFIG_HEADERS. # This happens for instance with `./config.status Makefile'. if test -n "$CONFIG_HEADERS"; then cat >"$ac_tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF # Transform confdefs.h into an awk script `defines.awk', embedded as # here-document in config.status, that substitutes the proper values into # config.h.in to produce config.h. # Create a delimiter string that does not exist in confdefs.h, to ease # handling of long lines. ac_delim='%!_!# ' for ac_last_try in false false :; do ac_tt=`sed -n "/$ac_delim/p" confdefs.h` if test -z "$ac_tt"; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done # For the awk script, D is an array of macro values keyed by name, # likewise P contains macro parameters if any. Preserve backslash # newline sequences. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* sed -n ' s/.\{148\}/&'"$ac_delim"'/g t rset :rset s/^[ ]*#[ ]*define[ ][ ]*/ / t def d :def s/\\$// t bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3"/p s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p d :bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3\\\\\\n"\\/p t cont s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p t cont d :cont n s/.\{148\}/&'"$ac_delim"'/g t clear :clear s/\\$// t bsnlc s/["\\]/\\&/g; s/^/"/; s/$/"/p d :bsnlc s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p b cont ' >$CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 for (key in D) D_is_set[key] = 1 FS = "" } /^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { line = \$ 0 split(line, arg, " ") if (arg[1] == "#") { defundef = arg[2] mac1 = arg[3] } else { defundef = substr(arg[1], 2) mac1 = arg[2] } split(mac1, mac2, "(") #) macro = mac2[1] prefix = substr(line, 1, index(line, defundef) - 1) if (D_is_set[macro]) { # Preserve the white space surrounding the "#". print prefix "define", macro P[macro] D[macro] next } else { # Replace #undef with comments. This is necessary, for example, # in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. if (defundef == "undef") { print "/*", prefix defundef, macro, "*/" next } } } { print } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 fi # test -n "$CONFIG_HEADERS" eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS " shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`$as_echo "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$ac_tmp/stdin" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" case $ac_file in -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; :H) # # CONFIG_HEADER # if test x"$ac_file" != x-; then { $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" } >"$ac_tmp/config.h" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 $as_echo "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$ac_tmp/config.h" "$ac_file" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ || as_fn_error $? "could not create -" "$LINENO" 5 fi ;; esac done # for ac_tag as_fn_exit 0 _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi ldns-1.7.0/drill/Makefile.in0000644000175000017500000000574113026206166015207 0ustar willemwillem# Standard installation pathnames # See the file LICENSE for the license SHELL = @SHELL@ VERSION = @PACKAGE_VERSION@ basesrcdir = $(shell basename `pwd`) srcdir = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ mandir = @mandir@ includedir = @includedir@ datarootdir = @datarootdir@ CC = @CC@ CFLAGS = -I. @CFLAGS@ CPPFLAGS = @CPPFLAGS@ LDFLAGS = @LDFLAGS@ LIBS = @LIBS@ INSTALL = $(srcdir)/install-sh -c INSTALL_PROGRAM = $(INSTALL) LDNSDIR = @LDNSDIR@ LIBS_STC = @LIBS_STC@ COMPILE = $(CC) $(CPPFLAGS) $(CFLAGS) -I. -I$(srcdir) LINK = $(CC) $(CFLAGS) $(LDFLAGS) LINT = splint LINTFLAGS=+quiet -weak -warnposix -unrecog -Din_addr_t=uint32_t -Du_int=unsigned -Du_char=uint8_t -preproc -Drlimit=rlimit64 -D__gnuc_va_list=va_list #-Dglob64=glob -Dglobfree64=globfree # compat with openssl linux edition. LINTFLAGS+="-DBN_ULONG=unsigned long" -Dkrb5_int32=int "-Dkrb5_ui_4=unsigned int" -DPQ_64BIT=uint64_t -DRC4_INT=unsigned -fixedformalarray -D"ENGINE=unsigned" -D"RSA=unsigned" -D"DSA=unsigned" -D"EVP_PKEY=unsigned" -D"EVP_MD=unsigned" -D"SSL=unsigned" -D"SSL_CTX=unsigned" -D"X509=unsigned" -D"RC4_KEY=unsigned" -D"EVP_MD_CTX=unsigned" # compat with NetBSD ifeq "$(shell uname)" "NetBSD" LINTFLAGS+="-D__RENAME(x)=" -D_NETINET_IN_H_ endif # compat with OpenBSD LINTFLAGS+="-Dsigset_t=long" # FreeBSD8 LINTFLAGS+="-D__uint16_t=uint16_t" LINTFLAGS+=-D__signed__=signed "-D__packed=" "-D__aligned(x)=" # Ubuntu Linux 11.04 LINTFLAGS+="-D__u16=struct __u16" "-D__u32=struct __u32" "-D__u64=struct __u64" OBJ=drill.o drill_util.o error.o root.o work.o chasetrace.o dnssec.o securetrace.o SRC=$(OBJ:.o=.c) HEADER=drill.h $(srcdir)/drill_util.h .PHONY: all clean realclean docclean doc release tags install all-static all: drill all-static: drill-stc tags: ctags *.[ch] drill: $(OBJ) $(LINK) -o drill $(OBJ) $(LIBS) drill-stc: $(OBJ) $(LINK) -o drill $(OBJ) $(LIBS_STC) ## implicit rule %.o: $(srcdir)/%.c $(COMPILE) -c $< clean: rm -f ${OBJ} rm -f drill rm -f *core rm -f config.h.in~ rm -f config.log rm -f config.guess rm -f config.status docclean: rm -rf doxydoc distclean: clean docclean rm -f config.h realclean: clean docclean rm -f tags rm -f config.log rm -f config.sub rm -f ltmain.sh rm -f config.status rm -rf autom4te.cache rm -f config.h rm -f config.h.in rm -f configure rm -f Makefile rm -f drill.1 rm -f aclocal.m4 doc: doxygen drill.doxygen install: all $(INSTALL) -d $(DESTDIR)$(bindir) $(INSTALL) drill $(DESTDIR)$(bindir)/drill $(INSTALL) -m 644 drill.1 $(DESTDIR)$(mandir)/man1/drill.1 uninstall: @echo rm -f -- $(DESTDIR)$(bindir)/drill rm -f -- $(DESTDIR)$(mandir)/man1/drill.1 rmdir -p $(DESTDIR)$(bindir) rmdir -p $(DESTDIR)$(mandir)/man1 @echo lint: @for i in $(SRC) ; do \ $(LINT) $(LINTFLAGS) $(CPPFLAGS) -I$(srcdir) $(srcdir)/$$i ; \ if [ $$? -ne 0 ] ; then exit 1 ; fi ; \ done confclean: clean rm -rf config.log config.status config.h Makefile drill.1 ldns-1.7.0/drill/config.h.in0000644000175000017500000001516113026206202015151 0ustar willemwillem/* config.h.in. Generated from configure.ac by autoheader. */ /* Define to 1 if you have the header file. */ #undef HAVE_ARPA_INET_H /* Define to 1 if you have the header file. */ #undef HAVE_ASSERT_H /* Define to 1 if you have the header file. */ #undef HAVE_CTYPE_H /* Whether getaddrinfo is available */ #undef HAVE_GETADDRINFO /* Define to 1 if you have the header file. */ #undef HAVE_GETOPT_H /* If you have HMAC_Update */ #undef HAVE_HMAC_UPDATE /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define to 1 if you have the `isblank' function. */ #undef HAVE_ISBLANK /* Define to 1 if you have the `ldns' library (-lldns). */ #undef HAVE_LIBLDNS /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Define to 1 if you have the header file. */ #undef HAVE_NETINET_IF_ETHER_H /* Define to 1 if you have the header file. */ #undef HAVE_NETINET_IN_H /* Define to 1 if you have the header file. */ #undef HAVE_NETINET_IN_SYSTM_H /* Define to 1 if you have the header file. */ #undef HAVE_NETINET_IP6_H /* Define to 1 if you have the header file. */ #undef HAVE_NETINET_IP_H /* Define to 1 if you have the header file. */ #undef HAVE_NETINET_UDP_H /* Define to 1 if you have the header file. */ #undef HAVE_NET_IF_H /* Define to 1 if you have the header file. */ #undef HAVE_OPENSSL_ERR_H /* Define to 1 if you have the header file. */ #undef HAVE_OPENSSL_RAND_H /* Define to 1 if you have the header file. */ #undef HAVE_OPENSSL_SSL_H /* Define if you have the SSL libraries installed. */ #undef HAVE_SSL /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDIO_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_MOUNT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_PARAM_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_SELECT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_SOCKET_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TIME_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_TIME_H /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Define to 1 if you have the header file. */ #undef HAVE_WINSOCK2_H /* Define to 1 if you have the header file. */ #undef HAVE_WS2TCPIP_H /* Default trust anchor file */ #undef LDNS_TRUST_ANCHOR_FILE /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the home page for this package. */ #undef PACKAGE_URL /* Define to the version of this package. */ #undef PACKAGE_VERSION /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* Enable extensions on AIX 3, Interix. */ #ifndef _ALL_SOURCE # undef _ALL_SOURCE #endif /* Enable GNU extensions on systems that have them. */ #ifndef _GNU_SOURCE # undef _GNU_SOURCE #endif /* Enable threading extensions on Solaris. */ #ifndef _POSIX_PTHREAD_SEMANTICS # undef _POSIX_PTHREAD_SEMANTICS #endif /* Enable extensions on HP NonStop. */ #ifndef _TANDEM_SOURCE # undef _TANDEM_SOURCE #endif /* Enable general extensions on Solaris. */ #ifndef __EXTENSIONS__ # undef __EXTENSIONS__ #endif /* Whether the windows socket API is used */ #undef USE_WINSOCK /* the version of the windows API enabled */ #undef WINVER /* Define to 1 if on MINIX. */ #undef _MINIX /* Define to 2 if the system does not provide POSIX.1 features except with this defined. */ #undef _POSIX_1_SOURCE /* Define to 1 if you need to in order for `stat' and other things to work. */ #undef _POSIX_SOURCE /* in_addr_t */ #undef in_addr_t /* in_port_t */ #undef in_port_t /* Define to `__inline__' or `__inline' if that's what the C compiler calls it, or to nothing if 'inline' is not supported under any name. */ #ifndef __cplusplus #undef inline #endif /* Define to `short' if does not define. */ #undef int16_t /* Define to `int' if does not define. */ #undef int32_t /* Define to `long long' if does not define. */ #undef int64_t /* Define to `char' if does not define. */ #undef int8_t /* Define to `unsigned int' if does not define. */ #undef size_t /* Define to 'int' if not defined */ #undef socklen_t /* Define to `int' if does not define. */ #undef ssize_t /* Define to `unsigned short' if does not define. */ #undef uint16_t /* Define to `unsigned int' if does not define. */ #undef uint32_t /* Define to `unsigned long long' if does not define. */ #undef uint64_t /* Define to `unsigned char' if does not define. */ #undef uint8_t #include #include #include #include #if STDC_HEADERS #include #include #endif #ifdef HAVE_STDINT_H #include #endif #ifdef HAVE_SYS_SOCKET_H #include #endif #ifdef HAVE_NETINET_IN_H #include #endif #ifdef HAVE_ARPA_INET_H #include #endif #ifdef HAVE_NETINET_UDP_H #include #endif #ifdef HAVE_TIME_H #include #endif #ifdef HAVE_NETINET_IN_SYSTM_H #include #endif #ifdef HAVE_NETINET_IP_H #include #endif #ifdef HAVE_NET_IF_H #include #endif #ifdef HAVE_NETINET_IF_ETHER_H #include #endif #ifdef HAVE_WINSOCK2_H #define USE_WINSOCK 1 #include #endif #ifdef HAVE_WS2TCPIP_H #include #endif #ifndef EXIT_FAILURE #define EXIT_FAILURE 1 #endif #ifndef EXIT_SUCCESS #define EXIT_SUCCESS 0 #endif #ifdef S_SPLINT_S #define FD_ZERO(a) /* a */ #define FD_SET(a,b) /* a, b */ #endif ldns-1.7.0/drill/root.c0000644000175000017500000001143313026206166014264 0ustar willemwillem/* * root.c * Function to handle to the rootservers * and to update and prime them * (c) 2005 NLnet Labs * * See the file LICENSE for the license * */ #include "drill.h" #include #include /* a global list of the root-servers */ ldns_rr_list *global_dns_root = NULL; /* put a hardcoded list in the root and * init the root rrlist structure */ void init_root(void) { ldns_rr *r; global_dns_root = ldns_rr_list_new(); (void)ldns_rr_new_frm_str(&r, "A.ROOT-SERVERS.NET. 3600000 A 198.41.0.4", 0, NULL, NULL); ldns_rr_list_push_rr(global_dns_root, r); (void)ldns_rr_new_frm_str(&r, "A.ROOT-SERVERS.NET. 3600000 AAAA 2001:503:BA3E::2:30", 0, NULL, NULL); ldns_rr_list_push_rr(global_dns_root, r); (void)ldns_rr_new_frm_str(&r, "B.ROOT-SERVERS.NET. 3600000 A 192.228.79.201", 0, NULL, NULL); ldns_rr_list_push_rr(global_dns_root, r); (void)ldns_rr_new_frm_str(&r, "C.ROOT-SERVERS.NET. 3600000 A 192.33.4.12", 0, NULL, NULL); ldns_rr_list_push_rr(global_dns_root, r); (void)ldns_rr_new_frm_str(&r, "D.ROOT-SERVERS.NET. 3600000 A 128.8.10.90", 0, NULL, NULL); ldns_rr_list_push_rr(global_dns_root, r); (void)ldns_rr_new_frm_str(&r, "E.ROOT-SERVERS.NET. 3600000 A 192.203.230.10", 0, NULL, NULL); ldns_rr_list_push_rr(global_dns_root, r); (void)ldns_rr_new_frm_str(&r, "F.ROOT-SERVERS.NET. 3600000 A 192.5.5.241", 0, NULL, NULL); ldns_rr_list_push_rr(global_dns_root, r); (void)ldns_rr_new_frm_str(&r, "F.ROOT-SERVERS.NET. 3600000 AAAA 2001:500:2F::F", 0, NULL, NULL); ldns_rr_list_push_rr(global_dns_root, r); (void)ldns_rr_new_frm_str(&r, "G.ROOT-SERVERS.NET. 3600000 A 192.112.36.4", 0, NULL, NULL); ldns_rr_list_push_rr(global_dns_root, r); (void)ldns_rr_new_frm_str(&r, "H.ROOT-SERVERS.NET. 3600000 A 128.63.2.53", 0, NULL, NULL); ldns_rr_list_push_rr(global_dns_root, r); (void)ldns_rr_new_frm_str(&r, "H.ROOT-SERVERS.NET. 3600000 AAAA 2001:500:1::803F:235", 0, NULL, NULL); ldns_rr_list_push_rr(global_dns_root, r); (void)ldns_rr_new_frm_str(&r, "I.ROOT-SERVERS.NET. 3600000 A 192.36.148.17", 0, NULL, NULL); ldns_rr_list_push_rr(global_dns_root, r); (void)ldns_rr_new_frm_str(&r, "J.ROOT-SERVERS.NET. 3600000 A 192.58.128.30", 0, NULL, NULL); ldns_rr_list_push_rr(global_dns_root, r); (void)ldns_rr_new_frm_str(&r, "J.ROOT-SERVERS.NET. 3600000 AAAA 2001:503:C27::2:30", 0, NULL, NULL); ldns_rr_list_push_rr(global_dns_root, r); (void)ldns_rr_new_frm_str(&r, "K.ROOT-SERVERS.NET. 3600000 A 193.0.14.129 ", 0, NULL, NULL); ldns_rr_list_push_rr(global_dns_root, r); (void)ldns_rr_new_frm_str(&r, "K.ROOT-SERVERS.NET. 3600000 AAAA 2001:7FD::1", 0, NULL, NULL); ldns_rr_list_push_rr(global_dns_root, r); (void)ldns_rr_new_frm_str(&r, "L.ROOT-SERVERS.NET. 3600000 A 199.7.83.42", 0, NULL, NULL); ldns_rr_list_push_rr(global_dns_root, r); (void)ldns_rr_new_frm_str(&r, "L.ROOT-SERVERS.NET. 3600000 AAAA 2001:500:3::42 ", 0, NULL, NULL); ldns_rr_list_push_rr(global_dns_root, r); (void)ldns_rr_new_frm_str(&r, "M.ROOT-SERVERS.NET. 3600000 A 202.12.27.33", 0, NULL, NULL); ldns_rr_list_push_rr(global_dns_root, r); (void)ldns_rr_new_frm_str(&r, "M.ROOT-SERVERS.NET. 3600000 AAAA 2001:DC3::35", 0, NULL, NULL); ldns_rr_list_push_rr(global_dns_root, r); } /* * Read a hints file as root * * The file with the given path should contain a list of NS RRs * for the root zone and A records for those NS RRs. * Read them, check them, and append the a records to the rr list given. */ ldns_rr_list * read_root_hints(const char *filename) { FILE *fp = NULL; int line_nr = 0; ldns_zone *z; ldns_status status; ldns_rr_list *addresses = NULL; ldns_rr *rr; size_t i; fp = fopen(filename, "r"); if (!fp) { fprintf(stderr, "Unable to open %s for reading: %s\n", filename, strerror(errno)); return NULL; } status = ldns_zone_new_frm_fp_l(&z, fp, NULL, 0, 0, &line_nr); fclose(fp); if (status != LDNS_STATUS_OK) { fprintf(stderr, "Error reading root hints file: %s\n", ldns_get_errorstr_by_id(status)); return NULL; } else { addresses = ldns_rr_list_new(); for (i = 0; i < ldns_rr_list_rr_count(ldns_zone_rrs(z)); i++) { rr = ldns_rr_list_rr(ldns_zone_rrs(z), i); /*if ((address_family == 0 || address_family == 1) && */ if ( ldns_rr_get_type(rr) == LDNS_RR_TYPE_A ) { ldns_rr_list_push_rr(addresses, ldns_rr_clone(rr)); } /*if ((address_family == 0 || address_family == 2) &&*/ if ( ldns_rr_get_type(rr) == LDNS_RR_TYPE_AAAA) { ldns_rr_list_push_rr(addresses, ldns_rr_clone(rr)); } } ldns_zone_deep_free(z); return addresses; } } void clear_root(void) { ldns_rr_list_deep_free(global_dns_root); } ldns-1.7.0/drill/chasetrace.c0000644000175000017500000003176613026206166015416 0ustar willemwillem/* * chasetrace.c * Where all the hard work concerning chasing * and tracing is done * (c) 2005, 2006 NLnet Labs * * See the file LICENSE for the license * */ #include "drill.h" #include /* Cache all RRs from rr_list "rr_list" to "referrals" database for lookup * later on. Print the NS RRs that were not already present. */ static void add_rr_list_to_referrals( ldns_dnssec_zone *referrals, ldns_rr_list *rr_list) { size_t i; ldns_rr *rr; ldns_dnssec_rrsets *rrset; ldns_dnssec_rrs *rrs; for (i = 0; i < ldns_rr_list_rr_count(rr_list); i++) { rr = ldns_rr_list_rr(rr_list, i); /* Check if a RR equal to "rr" is present in "referrals" */ rrset = ldns_dnssec_zone_find_rrset( referrals, ldns_rr_owner(rr), ldns_rr_get_type(rr)); if (rrset) { for (rrs = rrset->rrs; rrs; rrs = rrs->next) if (ldns_rr_compare(rr, rrs->rr) == 0) break; if (rrs) continue; /* "rr" is present, next! */ } if (ldns_rr_get_type(rr) == LDNS_RR_TYPE_NS && verbosity != -1) ldns_rr_print(stdout, rr); (void) ldns_dnssec_zone_add_rr(referrals, rr); } } /* Cache all RRs from packet "p" to "referrals" database for lookup later on. * Print the NS RRs that were not already present. */ static void add_referrals(ldns_dnssec_zone *referrals, ldns_pkt *p) { ldns_rr_list *l = ldns_pkt_all_noquestion(p); if (l) { add_rr_list_to_referrals(referrals, l); ldns_rr_list_free(l); } } /* Equip name-server "res" with the name-servers authoritative for as much * of "name" as possible. Lookup addresses if needed. */ static bool set_nss_for_name( ldns_resolver *res, ldns_dnssec_zone *referrals, ldns_rdf *name, ldns_resolver *local_res, ldns_rr_class c) { ldns_dnssec_rrsets *nss = NULL; ldns_dnssec_rrs *nss_rrs; ldns_dnssec_rrsets *as = NULL; ldns_dnssec_rrs *as_rrs; ldns_rdf *lookup = ldns_rdf_clone(name); ldns_rdf *new_lookup; ldns_rdf *addr; ldns_rr_list *addrs; /* nss will become the rrset of as much of "name" as possible */ for (;;) { nss = ldns_dnssec_zone_find_rrset( referrals, lookup, LDNS_RR_TYPE_NS); if (nss != NULL) { ldns_rdf_deep_free(lookup); break; } new_lookup = ldns_dname_left_chop(lookup); ldns_rdf_deep_free(lookup); lookup = new_lookup; if (!lookup) { error("No referrals for name found"); return false; } } /* remove the old nameserver from the resolver */ while ((addr = ldns_resolver_pop_nameserver(res))) ldns_rdf_deep_free(addr); /* Find and add the address records for the rrset as name-servers */ for (nss_rrs = nss->rrs; nss_rrs; nss_rrs = nss_rrs->next) { if ((as = ldns_dnssec_zone_find_rrset( referrals, ldns_rr_rdf(nss_rrs->rr, 0), LDNS_RR_TYPE_A))) for (as_rrs = as->rrs; as_rrs; as_rrs = as_rrs->next) (void) ldns_resolver_push_nameserver( res, ldns_rr_rdf(as_rrs->rr, 0)); if ((as = ldns_dnssec_zone_find_rrset( referrals, ldns_rr_rdf(nss_rrs->rr, 0), LDNS_RR_TYPE_AAAA))) for (as_rrs = as->rrs; as_rrs; as_rrs = as_rrs->next) (void) ldns_resolver_push_nameserver( res, ldns_rr_rdf(as_rrs->rr, 0)); } /* Is our resolver equipped with name-servers? Good! We're done */ if (ldns_resolver_nameserver_count(res) > 0) return true; /* Lookup addresses with local resolver add add to "referrals" database */ addrs = ldns_rr_list_new(); for (nss_rrs = nss->rrs; nss_rrs; nss_rrs = nss_rrs->next) { ldns_rr_list *addrs_by_name = ldns_get_rr_list_addr_by_name( local_res, ldns_rr_rdf(nss_rrs->rr, 0), c, 0); ldns_rr_list_cat(addrs, addrs_by_name); ldns_rr_list_free(addrs_by_name); } if (ldns_rr_list_rr_count(addrs) == 0) error("Could not find the nameserver ip addr; abort"); else if (ldns_resolver_push_nameserver_rr_list(res, addrs) != LDNS_STATUS_OK) error("Error adding new nameservers"); else { ldns_rr_list_deep_free(addrs); return true; } add_rr_list_to_referrals(referrals, addrs); ldns_rr_list_deep_free(addrs); return false; } /** * trace down from the root to name */ /* same naive method as in drill0.9 * We resolve _ALL_ the names, which is of course not needed. * We _do_ use the local resolver to do that, so it still is * fast, but it can be made to run much faster. */ void do_trace(ldns_resolver *local_res, ldns_rdf *name, ldns_rr_type t, ldns_rr_class c) { static uint8_t zero[1] = { 0 }; static const ldns_rdf root_dname = { 1, LDNS_RDF_TYPE_DNAME, &zero }; ldns_resolver *res = NULL; ldns_pkt *p = NULL; ldns_rr_list *final_answer; ldns_rr_list *new_nss; ldns_rr_list *cname = NULL; ldns_rr_list *answers = NULL; uint16_t loop_count; ldns_status status; ldns_dnssec_zone* referrals = NULL; ldns_rdf *addr; loop_count = 0; final_answer = NULL; res = ldns_resolver_new(); if (!res) { error("Memory allocation failed"); goto cleanup; } /* transfer some properties of local_res to res, * because they were given on the commandline */ ldns_resolver_set_ip6(res, ldns_resolver_ip6(local_res)); ldns_resolver_set_port(res, ldns_resolver_port(local_res)); ldns_resolver_set_debug(res, ldns_resolver_debug(local_res)); ldns_resolver_set_dnssec(res, ldns_resolver_dnssec(local_res)); ldns_resolver_set_fail(res, ldns_resolver_fail(local_res)); ldns_resolver_set_usevc(res, ldns_resolver_usevc(local_res)); ldns_resolver_set_random(res, ldns_resolver_random(local_res)); ldns_resolver_set_source(res, ldns_resolver_source(local_res)); ldns_resolver_set_recursive(res, false); /* setup the root nameserver in the new resolver */ status = ldns_resolver_push_nameserver_rr_list(res, global_dns_root); if (status != LDNS_STATUS_OK) { fprintf(stderr, "Error adding root servers to resolver: %s\n", ldns_get_errorstr_by_id(status)); ldns_rr_list_print(stdout, global_dns_root); goto cleanup; } /* this must be a real query to local_res */ status = ldns_resolver_send(&p, res, &root_dname, LDNS_RR_TYPE_NS, c, 0); /* p can still be NULL */ if (ldns_pkt_empty(p)) { warning("No root server information received"); } if (status == LDNS_STATUS_OK) { if (!ldns_pkt_empty(p)) { drill_pkt_print(stdout, local_res, p); } referrals = ldns_dnssec_zone_new(); add_referrals(referrals, p); } else { error("cannot use local resolver"); goto cleanup; } if (! set_nss_for_name(res, referrals, name, local_res, c)) { goto cleanup; } ldns_pkt_free(p); p = NULL; status = ldns_resolver_send(&p, res, name, t, c, 0); while(status == LDNS_STATUS_OK && ldns_pkt_reply_type(p) == LDNS_PACKET_REFERRAL) { if (!p) { /* some error occurred -- bail out */ goto cleanup; } add_referrals(referrals, p); /* checks itself for verbosity */ drill_pkt_print_footer(stdout, local_res, p); if (! set_nss_for_name(res, referrals, name, local_res, c)) { goto cleanup; } if (loop_count++ > 20) { /* unlikely that we are doing anything useful */ error("Looks like we are looping"); goto cleanup; } ldns_pkt_free(p); p = NULL; status = ldns_resolver_send(&p, res, name, t, c, 0); /* Exit trace on error */ if (status != LDNS_STATUS_OK) break; /* An answer might be the desired answer (and no referral) */ if (ldns_pkt_reply_type(p) != LDNS_PACKET_ANSWER) continue; /* Exit trace when the requested type is found */ answers = ldns_pkt_rr_list_by_type(p, t, LDNS_SECTION_ANSWER); if (answers && ldns_rr_list_rr_count(answers) > 0) { ldns_rr_list_free(answers); answers = NULL; break; } ldns_rr_list_free(answers); answers = NULL; /* Get the CNAMEs from the answer */ cname = ldns_pkt_rr_list_by_type( p, LDNS_RR_TYPE_CNAME, LDNS_SECTION_ANSWER); /* No CNAME either: exit trace */ if (ldns_rr_list_rr_count(cname) == 0) break; /* Print CNAME referral */ ldns_rr_list_print(stdout, cname); /* restart with the CNAME */ name = ldns_rr_rdf(ldns_rr_list_rr(cname, 0), 0); ldns_rr_list_free(cname); cname = NULL; /* remove the old nameserver from the resolver */ while((addr = ldns_resolver_pop_nameserver(res))) ldns_rdf_deep_free(addr); /* Restart trace from the root up */ (void) ldns_resolver_push_nameserver_rr_list( res, global_dns_root); ldns_pkt_free(p); p = NULL; status = ldns_resolver_send(&p, res, name, t, c, 0); } ldns_pkt_free(p); p = NULL; status = ldns_resolver_send(&p, res, name, t, c, 0); if (!p) { goto cleanup; } new_nss = ldns_pkt_authority(p); final_answer = ldns_pkt_answer(p); if (verbosity != -1) { ldns_rr_list_print(stdout, final_answer); ldns_rr_list_print(stdout, new_nss); } drill_pkt_print_footer(stdout, local_res, p); cleanup: if (res) { while((addr = ldns_resolver_pop_nameserver(res))) ldns_rdf_deep_free(addr); ldns_resolver_free(res); } if (referrals) ldns_dnssec_zone_deep_free(referrals); if (p) ldns_pkt_free(p); } /** * Chase the given rr to a known and trusted key * * Based on drill 0.9 * * the last argument prev_key_list, if not null, and type == DS, then the ds * rr list we have must all be a ds for the keys in this list */ #ifdef HAVE_SSL ldns_status do_chase(ldns_resolver *res, ldns_rdf *name, ldns_rr_type type, ldns_rr_class c, ldns_rr_list *trusted_keys, ldns_pkt *pkt_o, uint16_t qflags, ldns_rr_list * ATTR_UNUSED(prev_key_list)) { ldns_rr_list *rrset = NULL; ldns_status result; ldns_rr *orig_rr = NULL; /* ldns_rr_list *sigs; ldns_rr *cur_sig; uint16_t sig_i; ldns_rr_list *keys; */ ldns_pkt *pkt; ldns_status tree_result; ldns_dnssec_data_chain *chain; ldns_dnssec_trust_tree *tree; const ldns_rr_descriptor *descriptor; descriptor = ldns_rr_descript(type); ldns_dname2canonical(name); pkt = ldns_pkt_clone(pkt_o); if (!name) { mesg("No name to chase"); ldns_pkt_free(pkt); return LDNS_STATUS_EMPTY_LABEL; } if (verbosity != -1) { printf(";; Chasing: "); ldns_rdf_print(stdout, name); if (descriptor && descriptor->_name) { printf(" %s\n", descriptor->_name); } else { printf(" type %d\n", type); } } if (!trusted_keys || ldns_rr_list_rr_count(trusted_keys) < 1) { warning("No trusted keys specified"); } if (pkt) { rrset = ldns_pkt_rr_list_by_name_and_type(pkt, name, type, LDNS_SECTION_ANSWER ); if (!rrset) { /* nothing in answer, try authority */ rrset = ldns_pkt_rr_list_by_name_and_type(pkt, name, type, LDNS_SECTION_AUTHORITY ); } /* answer might be a cname, chase that first, then chase cname target? (TODO) */ if (!rrset) { rrset = ldns_pkt_rr_list_by_name_and_type(pkt, name, LDNS_RR_TYPE_CNAME, LDNS_SECTION_ANSWER ); if (!rrset) { /* nothing in answer, try authority */ rrset = ldns_pkt_rr_list_by_name_and_type(pkt, name, LDNS_RR_TYPE_CNAME, LDNS_SECTION_AUTHORITY ); } } } else { /* no packet? */ if (verbosity >= 0) { fprintf(stderr, "%s", ldns_get_errorstr_by_id(LDNS_STATUS_MEM_ERR)); fprintf(stderr, "\n"); } return LDNS_STATUS_MEM_ERR; } if (!rrset) { /* not found in original packet, try again */ ldns_pkt_free(pkt); pkt = NULL; pkt = ldns_resolver_query(res, name, type, c, qflags); if (!pkt) { if (verbosity >= 0) { fprintf(stderr, "%s", ldns_get_errorstr_by_id(LDNS_STATUS_NETWORK_ERR)); fprintf(stderr, "\n"); } return LDNS_STATUS_NETWORK_ERR; } if (verbosity >= 5) { ldns_pkt_print(stdout, pkt); } rrset = ldns_pkt_rr_list_by_name_and_type(pkt, name, type, LDNS_SECTION_ANSWER ); } orig_rr = ldns_rr_new(); /* if the answer had no answer section, we need to construct our own rr (for instance if * the rr qe asked for doesn't exist. This rr will be destroyed when the chain is freed */ if (ldns_pkt_ancount(pkt) < 1) { ldns_rr_set_type(orig_rr, type); ldns_rr_set_owner(orig_rr, ldns_rdf_clone(name)); chain = ldns_dnssec_build_data_chain(res, qflags, rrset, pkt, ldns_rr_clone(orig_rr)); } else { /* chase the first answer */ chain = ldns_dnssec_build_data_chain(res, qflags, rrset, pkt, NULL); } if (verbosity >= 4) { printf("\n\nDNSSEC Data Chain:\n"); ldns_dnssec_data_chain_print(stdout, chain); } result = LDNS_STATUS_OK; tree = ldns_dnssec_derive_trust_tree(chain, NULL); if (verbosity >= 2) { printf("\n\nDNSSEC Trust tree:\n"); ldns_dnssec_trust_tree_print(stdout, tree, 0, true); } if (ldns_rr_list_rr_count(trusted_keys) > 0) { tree_result = ldns_dnssec_trust_tree_contains_keys(tree, trusted_keys); if (tree_result == LDNS_STATUS_DNSSEC_EXISTENCE_DENIED) { if (verbosity >= 1) { printf("Existence denied or verifiably insecure\n"); } result = LDNS_STATUS_OK; } else if (tree_result != LDNS_STATUS_OK) { if (verbosity >= 1) { printf("No trusted keys found in tree: first error was: %s\n", ldns_get_errorstr_by_id(tree_result)); } result = tree_result; } } else { if (verbosity >= 0) { printf("You have not provided any trusted keys.\n"); } } ldns_rr_free(orig_rr); ldns_dnssec_trust_tree_free(tree); ldns_dnssec_data_chain_deep_free(chain); ldns_rr_list_deep_free(rrset); ldns_pkt_free(pkt); /* ldns_rr_free(orig_rr);*/ return result; } #endif /* HAVE_SSL */ ldns-1.7.0/drill/securetrace.c0000644000175000017500000005411213026206166015607 0ustar willemwillem/* * securechasetrace.c * Where all the hard work concerning secure tracing is done * * (c) 2005, 2006 NLnet Labs * * See the file LICENSE for the license * */ #include "drill.h" #include #define SELF "[S]" /* self sig ok */ #define TRUST "[T]" /* chain from parent */ #define BOGUS "[B]" /* bogus */ #define UNSIGNED "[U]" /* no relevant dnssec data found */ #if 0 /* See if there is a key/ds in trusted that matches * a ds in *ds. */ static ldns_rr_list * ds_key_match(ldns_rr_list *ds, ldns_rr_list *trusted) { size_t i, j; bool match; ldns_rr *rr_i, *rr_j; ldns_rr_list *keys; if (!trusted || !ds) { return NULL; } match = false; keys = ldns_rr_list_new(); if (!keys) { return NULL; } if (!ds || !trusted) { return NULL; } for (i = 0; i < ldns_rr_list_rr_count(trusted); i++) { rr_i = ldns_rr_list_rr(trusted, i); for (j = 0; j < ldns_rr_list_rr_count(ds); j++) { rr_j = ldns_rr_list_rr(ds, j); if (ldns_rr_compare_ds(rr_i, rr_j)) { match = true; /* only allow unique RRs to match */ ldns_rr_set_push_rr(keys, rr_i); } } } if (match) { return keys; } else { return NULL; } } #endif static ldns_pkt * get_dnssec_pkt(ldns_resolver *r, ldns_rdf *name, ldns_rr_type t) { ldns_pkt *p = NULL; p = ldns_resolver_query(r, name, t, LDNS_RR_CLASS_IN, 0); if (!p) { return NULL; } else { if (verbosity >= 5) { ldns_pkt_print(stdout, p); } return p; } } #ifdef HAVE_SSL /* * retrieve keys for this zone */ static ldns_pkt_type get_key(ldns_pkt *p, ldns_rdf *apexname, ldns_rr_list **rrlist, ldns_rr_list **opt_sig) { return get_dnssec_rr(p, apexname, LDNS_RR_TYPE_DNSKEY, rrlist, opt_sig); } /* * check to see if we can find a DS rrset here which we can then follow */ static ldns_pkt_type get_ds(ldns_pkt *p, ldns_rdf *ownername, ldns_rr_list **rrlist, ldns_rr_list **opt_sig) { return get_dnssec_rr(p, ownername, LDNS_RR_TYPE_DS, rrlist, opt_sig); } #endif /* HAVE_SSL */ static void remove_resolver_nameservers(ldns_resolver *res) { ldns_rdf *pop; /* remove the old nameserver from the resolver */ while((pop = ldns_resolver_pop_nameserver(res))) { ldns_rdf_deep_free(pop); } } /*ldns_pkt **/ #ifdef HAVE_SSL int do_secure_trace(ldns_resolver *local_res, ldns_rdf *name, ldns_rr_type t, ldns_rr_class c, ldns_rr_list *trusted_keys, ldns_rdf *start_name ) { ldns_resolver *res; ldns_pkt *p, *local_p; ldns_rr_list *new_nss; ldns_rr_list *ns_addr; ldns_rdf *pop; ldns_rdf **labels = NULL; ldns_status status, st; ssize_t i; size_t j; size_t k; size_t l; uint8_t labels_count = 0; /* dnssec */ ldns_rr_list *key_list; ldns_rr_list *key_sig_list; ldns_rr_list *ds_list; ldns_rr_list *ds_sig_list; ldns_rr_list *correct_key_list; ldns_rr_list *trusted_ds_rrs; bool new_keys_trusted = false; ldns_rr_list *current_correct_keys; ldns_rr_list *dataset; ldns_rr_list *nsec_rrs = NULL; ldns_rr_list *nsec_rr_sigs = NULL; /* empty non-terminal check */ bool ent; ldns_rr *nsecrr; /* The nsec that proofs the non-terminal */ ldns_rdf *hashed_name; /* The query hashed with nsec3 params */ ldns_rdf *label0; /* The first label of an nsec3 owner name */ /* glue handling */ ldns_rr_list *new_ns_addr; ldns_rr_list *old_ns_addr; ldns_rr *ns_rr; int result = 0; /* printing niceness */ const ldns_rr_descriptor *descriptor; descriptor = ldns_rr_descript(t); new_nss = NULL; ns_addr = NULL; key_list = NULL; ds_list = NULL; p = NULL; local_p = NULL; res = ldns_resolver_new(); key_sig_list = NULL; ds_sig_list = NULL; if (!res) { error("Memory allocation failed"); result = -1; return result; } correct_key_list = ldns_rr_list_new(); if (!correct_key_list) { error("Memory allocation failed"); result = -1; return result; } trusted_ds_rrs = ldns_rr_list_new(); if (!trusted_ds_rrs) { error("Memory allocation failed"); result = -1; return result; } /* Add all preset trusted DS signatures to the list of trusted DS RRs. */ for (j = 0; j < ldns_rr_list_rr_count(trusted_keys); j++) { ldns_rr* one_rr = ldns_rr_list_rr(trusted_keys, j); if (ldns_rr_get_type(one_rr) == LDNS_RR_TYPE_DS) { ldns_rr_list_push_rr(trusted_ds_rrs, ldns_rr_clone(one_rr)); } } /* transfer some properties of local_res to res */ ldns_resolver_set_ip6(res, ldns_resolver_ip6(local_res)); ldns_resolver_set_port(res, ldns_resolver_port(local_res)); ldns_resolver_set_debug(res, ldns_resolver_debug(local_res)); ldns_resolver_set_fail(res, ldns_resolver_fail(local_res)); ldns_resolver_set_usevc(res, ldns_resolver_usevc(local_res)); ldns_resolver_set_random(res, ldns_resolver_random(local_res)); ldns_resolver_set_source(res, ldns_resolver_source(local_res)); ldns_resolver_set_recursive(local_res, true); ldns_resolver_set_recursive(res, false); ldns_resolver_set_dnssec_cd(res, false); ldns_resolver_set_dnssec(res, true); /* setup the root nameserver in the new resolver */ status = ldns_resolver_push_nameserver_rr_list(res, global_dns_root); if (status != LDNS_STATUS_OK) { printf("ERRRRR: %s\n", ldns_get_errorstr_by_id(status)); ldns_rr_list_print(stdout, global_dns_root); result = status; goto done; } labels_count = ldns_dname_label_count(name); if (start_name) { if (ldns_dname_is_subdomain(name, start_name)) { labels_count -= ldns_dname_label_count(start_name); } else { fprintf(stderr, "Error; "); ldns_rdf_print(stderr, name); fprintf(stderr, " is not a subdomain of "); ldns_rdf_print(stderr, start_name); fprintf(stderr, "\n"); goto done; } } labels = LDNS_XMALLOC(ldns_rdf*, labels_count + 2); if (!labels) { goto done; } labels[0] = ldns_dname_new_frm_str(LDNS_ROOT_LABEL_STR); labels[1] = ldns_rdf_clone(name); for(i = 2 ; i < (ssize_t)labels_count + 2; i++) { labels[i] = ldns_dname_left_chop(labels[i - 1]); } /* get the nameserver for the label * ask: dnskey and ds for the label */ for(i = (ssize_t)labels_count + 1; i > 0; i--) { status = ldns_resolver_send(&local_p, res, labels[i], LDNS_RR_TYPE_NS, c, 0); if (verbosity >= 5) { ldns_pkt_print(stdout, local_p); } new_nss = ldns_pkt_rr_list_by_type(local_p, LDNS_RR_TYPE_NS, LDNS_SECTION_ANSWER); if (!new_nss) { /* if it's a delegation, servers put them in the auth section */ new_nss = ldns_pkt_rr_list_by_type(local_p, LDNS_RR_TYPE_NS, LDNS_SECTION_AUTHORITY); } /* if this is the final step there might not be nameserver records of course if the data is in the apex, there are, so cover both cases */ if (new_nss || i > 1) { for(j = 0; j < ldns_rr_list_rr_count(new_nss); j++) { ns_rr = ldns_rr_list_rr(new_nss, j); pop = ldns_rr_rdf(ns_rr, 0); if (!pop) { printf("nopo\n"); break; } /* retrieve it's addresses */ /* trust glue? */ new_ns_addr = NULL; if (ldns_dname_is_subdomain(pop, labels[i])) { new_ns_addr = ldns_pkt_rr_list_by_name_and_type(local_p, pop, LDNS_RR_TYPE_A, LDNS_SECTION_ADDITIONAL); } if (!new_ns_addr || ldns_rr_list_rr_count(new_ns_addr) == 0) { new_ns_addr = ldns_get_rr_list_addr_by_name(res, pop, c, 0); } if (!new_ns_addr || ldns_rr_list_rr_count(new_ns_addr) == 0) { new_ns_addr = ldns_get_rr_list_addr_by_name(local_res, pop, c, 0); } if (new_ns_addr) { old_ns_addr = ns_addr; ns_addr = ldns_rr_list_cat_clone(ns_addr, new_ns_addr); ldns_rr_list_deep_free(old_ns_addr); } ldns_rr_list_deep_free(new_ns_addr); } ldns_rr_list_deep_free(new_nss); if (ns_addr) { remove_resolver_nameservers(res); if (ldns_resolver_push_nameserver_rr_list(res, ns_addr) != LDNS_STATUS_OK) { error("Error adding new nameservers"); ldns_pkt_free(local_p); goto done; } ldns_rr_list_deep_free(ns_addr); } else { status = ldns_verify_denial(local_p, labels[i], LDNS_RR_TYPE_NS, &nsec_rrs, &nsec_rr_sigs); /* verify the nsec3 themselves*/ if (verbosity >= 4) { printf("NSEC(3) Records to verify:\n"); ldns_rr_list_print(stdout, nsec_rrs); printf("With signatures:\n"); ldns_rr_list_print(stdout, nsec_rr_sigs); printf("correct keys:\n"); ldns_rr_list_print(stdout, correct_key_list); } if (status == LDNS_STATUS_OK) { if ((st = ldns_verify(nsec_rrs, nsec_rr_sigs, trusted_keys, NULL)) == LDNS_STATUS_OK) { fprintf(stdout, "%s ", TRUST); fprintf(stdout, "Existence denied: "); ldns_rdf_print(stdout, labels[i]); /* if (descriptor && descriptor->_name) { printf(" %s", descriptor->_name); } else { printf(" TYPE%u", t); } */ fprintf(stdout, " NS\n"); } else if ((st = ldns_verify(nsec_rrs, nsec_rr_sigs, correct_key_list, NULL)) == LDNS_STATUS_OK) { fprintf(stdout, "%s ", SELF); fprintf(stdout, "Existence denied: "); ldns_rdf_print(stdout, labels[i]); /* if (descriptor && descriptor->_name) { printf(" %s", descriptor->_name); } else { printf(" TYPE%u", t); } */ fprintf(stdout, " NS\n"); } else { fprintf(stdout, "%s ", BOGUS); result = 1; printf(";; Error verifying denial of existence for name "); ldns_rdf_print(stdout, labels[i]); /* printf(" type "); if (descriptor && descriptor->_name) { printf("%s", descriptor->_name); } else { printf("TYPE%u", t); } */ printf("NS: %s\n", ldns_get_errorstr_by_id(st)); } } else { fprintf(stdout, "%s ", BOGUS); result = 1; printf(";; Error verifying denial of existence for name "); ldns_rdf_print(stdout, labels[i]); printf("NS: %s\n", ldns_get_errorstr_by_id(status)); } /* there might be an empty non-terminal, in which case we need to continue */ ent = false; for (j = 0; j < ldns_rr_list_rr_count(nsec_rrs); j++) { nsecrr = ldns_rr_list_rr(nsec_rrs, j); /* For NSEC when the next name is a subdomain of the question */ if (ldns_rr_get_type(nsecrr) == LDNS_RR_TYPE_NSEC && ldns_dname_is_subdomain(ldns_rr_rdf(nsecrr, 0), labels[i])) { ent = true; /* For NSEC3, the hash matches the name and the type bitmap is empty*/ } else if (ldns_rr_get_type(nsecrr) == LDNS_RR_TYPE_NSEC3) { hashed_name = ldns_nsec3_hash_name_frm_nsec3(nsecrr, labels[i]); label0 = ldns_dname_label(ldns_rr_owner(nsecrr), 0); if (hashed_name && label0 && ldns_dname_compare(hashed_name, label0) == 0 && ldns_nsec3_bitmap(nsecrr) == NULL) { ent = true; } if (label0) { LDNS_FREE(label0); } if (hashed_name) { LDNS_FREE(hashed_name); } } } if (!ent) { ldns_rr_list_deep_free(nsec_rrs); ldns_rr_list_deep_free(nsec_rr_sigs); ldns_pkt_free(local_p); goto done; } else { printf(";; There is an empty non-terminal here, continue\n"); continue; } } if (ldns_resolver_nameserver_count(res) == 0) { error("No nameservers found for this node"); goto done; } } ldns_pkt_free(local_p); fprintf(stdout, ";; Domain: "); ldns_rdf_print(stdout, labels[i]); fprintf(stdout, "\n"); /* retrieve keys for current domain, and verify them if they match an already trusted DS, or if one of the keys used to sign these is trusted, add the keys to the trusted list */ p = get_dnssec_pkt(res, labels[i], LDNS_RR_TYPE_DNSKEY); (void) get_key(p, labels[i], &key_list, &key_sig_list); if (key_sig_list) { if (key_list) { current_correct_keys = ldns_rr_list_new(); if ((st = ldns_verify(key_list, key_sig_list, key_list, current_correct_keys)) == LDNS_STATUS_OK) { /* add all signed keys (don't just add current_correct, you'd miss * the zsk's then */ for (j = 0; j < ldns_rr_list_rr_count(key_list); j++) { ldns_rr_list_push_rr(correct_key_list, ldns_rr_clone(ldns_rr_list_rr(key_list, j))); } /* check whether these keys were signed * by a trusted keys. if so, these * keys are also trusted */ new_keys_trusted = false; for (k = 0; k < ldns_rr_list_rr_count(current_correct_keys); k++) { for (j = 0; j < ldns_rr_list_rr_count(trusted_ds_rrs); j++) { if (ldns_rr_compare_ds(ldns_rr_list_rr(current_correct_keys, k), ldns_rr_list_rr(trusted_ds_rrs, j))) { new_keys_trusted = true; } } } /* also all keys are trusted if one of the current correct keys is trusted */ for (k = 0; k < ldns_rr_list_rr_count(current_correct_keys); k++) { for (j = 0; j < ldns_rr_list_rr_count(trusted_keys); j++) { if (ldns_rr_compare(ldns_rr_list_rr(current_correct_keys, k), ldns_rr_list_rr(trusted_keys, j)) == 0) { new_keys_trusted = true; } } } if (new_keys_trusted) { ldns_rr_list_push_rr_list(trusted_keys, key_list); print_rr_list_abbr(stdout, key_list, TRUST); ldns_rr_list_free(key_list); key_list = NULL; } else { if (verbosity >= 2) { printf(";; Signature ok but no chain to a trusted key or ds record\n"); } print_rr_list_abbr(stdout, key_list, SELF); ldns_rr_list_deep_free(key_list); key_list = NULL; } } else { print_rr_list_abbr(stdout, key_list, BOGUS); result = 2; ldns_rr_list_deep_free(key_list); key_list = NULL; } ldns_rr_list_free(current_correct_keys); current_correct_keys = NULL; } else { printf(";; No DNSKEY record found for "); ldns_rdf_print(stdout, labels[i]); printf("\n"); } } ldns_pkt_free(p); ldns_rr_list_deep_free(key_sig_list); key_sig_list = NULL; /* check the DS records for the next child domain */ if (i > 1) { p = get_dnssec_pkt(res, labels[i-1], LDNS_RR_TYPE_DS); (void) get_ds(p, labels[i-1], &ds_list, &ds_sig_list); if (!ds_list) { ldns_pkt_free(p); if (ds_sig_list) { ldns_rr_list_deep_free(ds_sig_list); } p = get_dnssec_pkt(res, name, LDNS_RR_TYPE_DNSKEY); (void) get_ds(p, NULL, &ds_list, &ds_sig_list); } if (ds_sig_list) { if (ds_list) { if (verbosity >= 4) { printf("VERIFYING:\n"); printf("DS LIST:\n"); ldns_rr_list_print(stdout, ds_list); printf("SIGS:\n"); ldns_rr_list_print(stdout, ds_sig_list); printf("KEYS:\n"); ldns_rr_list_print(stdout, correct_key_list); } current_correct_keys = ldns_rr_list_new(); if ((st = ldns_verify(ds_list, ds_sig_list, correct_key_list, current_correct_keys)) == LDNS_STATUS_OK) { /* if the ds is signed by a trusted key and a key from correct keys matches that ds, add that key to the trusted keys */ new_keys_trusted = false; if (verbosity >= 2) { printf("Checking if signing key is trusted:\n"); } for (j = 0; j < ldns_rr_list_rr_count(current_correct_keys); j++) { if (verbosity >= 2) { printf("New key: "); ldns_rr_print(stdout, ldns_rr_list_rr(current_correct_keys, j)); } for (k = 0; k < ldns_rr_list_rr_count(trusted_keys); k++) { if (verbosity >= 2) { printf("\tTrusted key: "); ldns_rr_print(stdout, ldns_rr_list_rr(trusted_keys, k)); } if (ldns_rr_compare(ldns_rr_list_rr(current_correct_keys, j), ldns_rr_list_rr(trusted_keys, k)) == 0) { if (verbosity >= 2) { printf("Key is now trusted!\n"); } for (l = 0; l < ldns_rr_list_rr_count(ds_list); l++) { ldns_rr_list_push_rr(trusted_ds_rrs, ldns_rr_clone(ldns_rr_list_rr(ds_list, l))); new_keys_trusted = true; } } } } if (new_keys_trusted) { print_rr_list_abbr(stdout, ds_list, TRUST); } else { print_rr_list_abbr(stdout, ds_list, SELF); } } else { result = 3; print_rr_list_abbr(stdout, ds_list, BOGUS); } ldns_rr_list_free(current_correct_keys); current_correct_keys = NULL; } else { /* wait apparently there were no keys either, go back to the ds packet */ ldns_pkt_free(p); ldns_rr_list_deep_free(ds_sig_list); p = get_dnssec_pkt(res, labels[i-1], LDNS_RR_TYPE_DS); (void) get_ds(p, labels[i-1], &ds_list, &ds_sig_list); status = ldns_verify_denial(p, labels[i-1], LDNS_RR_TYPE_DS, &nsec_rrs, &nsec_rr_sigs); if (verbosity >= 4) { printf("NSEC(3) Records to verify:\n"); ldns_rr_list_print(stdout, nsec_rrs); printf("With signatures:\n"); ldns_rr_list_print(stdout, nsec_rr_sigs); printf("correct keys:\n"); ldns_rr_list_print(stdout, correct_key_list); } if (status == LDNS_STATUS_OK) { if ((st = ldns_verify(nsec_rrs, nsec_rr_sigs, trusted_keys, NULL)) == LDNS_STATUS_OK) { fprintf(stdout, "%s ", TRUST); fprintf(stdout, "Existence denied: "); ldns_rdf_print(stdout, labels[i-1]); printf(" DS"); fprintf(stdout, "\n"); } else if ((st = ldns_verify(nsec_rrs, nsec_rr_sigs, correct_key_list, NULL)) == LDNS_STATUS_OK) { fprintf(stdout, "%s ", SELF); fprintf(stdout, "Existence denied: "); ldns_rdf_print(stdout, labels[i-1]); printf(" DS"); fprintf(stdout, "\n"); } else { result = 4; fprintf(stdout, "%s ", BOGUS); printf("Error verifying denial of existence for "); ldns_rdf_print(stdout, labels[i-1]); printf(" DS"); printf(": %s\n", ldns_get_errorstr_by_id(st)); } } else { if (status == LDNS_STATUS_CRYPTO_NO_RRSIG) { printf(";; No DS for "); ldns_rdf_print(stdout, labels[i - 1]); } else { printf("[B] Unable to verify denial of existence for "); ldns_rdf_print(stdout, labels[i - 1]); printf(" DS: %s\n", ldns_get_errorstr_by_id(status)); } } if (verbosity >= 2) { printf(";; No ds record for delegation\n"); } } } ldns_rr_list_deep_free(ds_list); ldns_pkt_free(p); } else { /* if this is the last label, just verify the data and stop */ p = get_dnssec_pkt(res, labels[i], t); (void) get_dnssec_rr(p, labels[i], t, &dataset, &key_sig_list); if (dataset && ldns_rr_list_rr_count(dataset) > 0) { if (key_sig_list && ldns_rr_list_rr_count(key_sig_list) > 0) { /* If this is a wildcard, you must be able to deny exact match */ if ((st = ldns_verify(dataset, key_sig_list, trusted_keys, NULL)) == LDNS_STATUS_OK) { fprintf(stdout, "%s ", TRUST); ldns_rr_list_print(stdout, dataset); } else if ((st = ldns_verify(dataset, key_sig_list, correct_key_list, NULL)) == LDNS_STATUS_OK) { fprintf(stdout, "%s ", SELF); ldns_rr_list_print(stdout, dataset); } else { result = 5; fprintf(stdout, "%s ", BOGUS); ldns_rr_list_print(stdout, dataset); printf(";; Error: %s\n", ldns_get_errorstr_by_id(st)); } } else { fprintf(stdout, "%s ", UNSIGNED); ldns_rr_list_print(stdout, dataset); } ldns_rr_list_deep_free(dataset); } else { status = ldns_verify_denial(p, name, t, &nsec_rrs, &nsec_rr_sigs); if (status == LDNS_STATUS_OK) { /* verify the nsec3 themselves*/ if (verbosity >= 5) { printf("NSEC(3) Records to verify:\n"); ldns_rr_list_print(stdout, nsec_rrs); printf("With signatures:\n"); ldns_rr_list_print(stdout, nsec_rr_sigs); printf("correct keys:\n"); ldns_rr_list_print(stdout, correct_key_list); /* printf("trusted keys at %p:\n", trusted_keys); ldns_rr_list_print(stdout, trusted_keys); */ } if ((st = ldns_verify(nsec_rrs, nsec_rr_sigs, trusted_keys, NULL)) == LDNS_STATUS_OK) { fprintf(stdout, "%s ", TRUST); fprintf(stdout, "Existence denied: "); ldns_rdf_print(stdout, name); if (descriptor && descriptor->_name) { printf(" %s", descriptor->_name); } else { printf(" TYPE%u", t); } fprintf(stdout, "\n"); } else if ((st = ldns_verify(nsec_rrs, nsec_rr_sigs, correct_key_list, NULL)) == LDNS_STATUS_OK) { fprintf(stdout, "%s ", SELF); fprintf(stdout, "Existence denied: "); ldns_rdf_print(stdout, name); if (descriptor && descriptor->_name) { printf(" %s", descriptor->_name); } else { printf(" TYPE%u", t); } fprintf(stdout, "\n"); } else { result = 6; fprintf(stdout, "%s ", BOGUS); printf("Error verifying denial of existence for "); ldns_rdf_print(stdout, name); printf(" type "); if (descriptor && descriptor->_name) { printf("%s", descriptor->_name); } else { printf("TYPE%u", t); } printf(": %s\n", ldns_get_errorstr_by_id(st)); } ldns_rr_list_deep_free(nsec_rrs); ldns_rr_list_deep_free(nsec_rr_sigs); } else { /* */ if (status == LDNS_STATUS_CRYPTO_NO_RRSIG) { printf("%s ", UNSIGNED); printf("No data found for: "); ldns_rdf_print(stdout, name); printf(" type "); if (descriptor && descriptor->_name) { printf("%s", descriptor->_name); } else { printf("TYPE%u", t); } printf("\n"); } else { printf("[B] Unable to verify denial of existence for "); ldns_rdf_print(stdout, name); printf(" type "); if (descriptor && descriptor->_name) { printf("%s", descriptor->_name); } else { printf("TYPE%u", t); } printf("\n"); } } } ldns_pkt_free(p); } new_nss = NULL; ns_addr = NULL; ldns_rr_list_deep_free(key_list); key_list = NULL; ldns_rr_list_deep_free(key_sig_list); key_sig_list = NULL; ds_list = NULL; ldns_rr_list_deep_free(ds_sig_list); ds_sig_list = NULL; } printf(";;" SELF " self sig OK; " BOGUS " bogus; " TRUST " trusted\n"); /* verbose mode? printf("Trusted keys:\n"); ldns_rr_list_print(stdout, trusted_keys); printf("trusted dss:\n"); ldns_rr_list_print(stdout, trusted_ds_rrs); */ done: ldns_rr_list_deep_free(trusted_ds_rrs); ldns_rr_list_deep_free(correct_key_list); ldns_resolver_deep_free(res); if (labels) { for(i = 0 ; i < (ssize_t)labels_count + 2; i++) { ldns_rdf_deep_free(labels[i]); } LDNS_FREE(labels); } return result; } #endif /* HAVE_SSL */ ldns-1.7.0/drill/drill.1.in0000644000175000017500000001435113026206166014734 0ustar willemwillem.\" @(#)drill.1 1.7.0 14-Jul-2004 OF; .TH drill 1 "28 May 2006" .SH NAME drill \- get (debug) information out of DNS(SEC) .SH SYNOPSIS .B drill [ .IR OPTIONS ] .IR name [ .IR @server ] [ .IR type ] [ .IR class ] .SH DESCRIPTION \fBdrill\fR is a tool to designed to get all sorts of information out of the DNS. It is specificly designed to be used with DNSSEC. .PP The name \fBdrill\fR is a pun on \fBdig\fR. With \fBdrill\fR you should be able get even more information than with \fBdig\fR. .PP If no arguments are given class defaults to 'IN' and type to 'A'. The server(s) specified in /etc/resolv.conf are used to query against. .PP \fIname\fR Ask for this name. .PP \fI@server\fR Send to query to this server. If not specified use the nameservers from \fI/etc/resolv.conf\fR. .PP \fItype\fR Ask for this RR type. If type is not given on the command line it defaults to 'A'. Except when doing a reverse lookup when it defaults to 'PTR'. .PP \fIclass\fR Use this class when querying. .SH SAMPLE USAGE \fBdrill mx miek.nl\fR Show the MX records of the domain miek.nl .TP \fBdrill \-S jelte.nlnetlabs.nl\fR Chase any signatures in the jelte.nlnetlab.nl domain. This option is only available when ldns has been compiled with openssl-support. .TP \fBdrill \-TD www.example.com\fR Do a DNSSEC (\-D) trace (\-T) from the rootservers down to www.example.com. This option only works when ldns has been compiled with openssl support. .TP \fBdrill \-s dnskey jelte.nlnetlabs.nl\fR Show the DNSKEY record(s) for jelte.nlnetlabs.nl. For each found DNSKEY record also print the DS record. .SH OPTIONS .TP \fB\-D Enable DNSSEC in the query. When querying for DNSSEC types (DNSKEY, RRSIG, DS and NSEC) this is \fInot\fR automatically enabled. .TP \fB\-T Trace \fIname\fR from the root down. When using this option the @server arguments is not used. .TP \fB\-S Chase the signature(s) of 'name' to a known key or as high up in the tree as possible. .TP \fB\-I \fIIPv4 or IPv6 address\fR Source address to query from. The source address has to be present on an interface of the host running drill. .TP \fB\-V \fIlevel\fR Be more verbose. Set level to 5 to see the actual query that is sent. .TP \fB\-Q Quiet mode, this overrules \-V. .TP \fB\-f \fIfile\fR Read the query from a file. The query must be dumped with \-w. .TP \fB\-i \fIfile\fR read the answer from the file instead from the network. This aids in debugging and can be used to check if a query on disk is valid. If the file contains binary data it is assumed to be a query in network order. .TP \fB\-w \fIfile\fR Write an answer packet to file. .TP \fB\-q \fIfile\fR Write the query packet to file. .TP \fB\-v Show drill's version. .TP \fB\-h Show a short help message. .SS QUERY OPTIONS .TP \fB\-4 Stay on ip4. Only send queries to ip4 enabled nameservers. .TP \fB\-6 Stay on ip6. Only send queries to ip6 enabled nameservers. .TP \fB\-a Use the resolver structure's fallback mechanism if the answer is truncated (TC=1). If a truncated packet is received and this option is set, drill will first send a new query with EDNS0 buffer size 4096. If the EDNS0 buffer size was already set to 512+ bytes, or the above retry also results in a truncated answer, the resolver structure will fall back to TCP. .TP \fB\-b \fIsize\fR Use size as the buffer size in the EDNS0 pseudo RR. .TP \fB\-c \fIfile\fR Use file instead of /etc/resolv.conf for nameserver configuration. .TP \fB\-d \fIdomain\fR When tracing (\-T), start from this domain instead of the root. .TP \fB\-t Use TCP/IP when querying a server .TP \fB\-k \fIkeyfile\fR Use this file to read a (trusted) key from. When this options is given \fBdrill\fR tries to validate the current answer with this key. No chasing is done. When \fBdrill\fR is doing a secure trace, this key will be used as trust anchor. Can contain a DNSKEY or a DS record. Alternatively, when DNSSEC enabled tracing (\fB-TD\fR) or signature chasing (\fB-S\fR), if \fB-k\fR is not specified, and a default trust anchor (@LDNS_TRUST_ANCHOR_FILE@) exists and contains a valid DNSKEY or DS record, it will be used as the trust anchor. .TP \fB\-o \fImnemonic\fR Use this option to set or unset specific header bits. A bit is set by using the bit mnemonic in CAPITAL letters. A bit is unset when the mnemonic is given in lowercase. The following mnemonics are understood by \fBdrill\fR: QR, qr: set, unset QueRy (default: on) AA, aa: set, unset Authoritative Answer (default: off) TC, tc: set, unset TrunCated (default: off) RD, rd: set, unset Recursion Desired (default: on) CD, cd: set, unset Checking Disabled (default: off) RA, ra: set, unset Recursion Available (default: off) AD, ad: set, unset Authenticated Data (default: off) Thus: \fB-o CD\fR, will enable Checking Disabled, which instructs the cache to not validate the answers it gives out. .TP \fB\-p \fIport\fR Use this port instead of the default of 53. .TP \fB\-r \fIfile\fR When tracing (\-T), use file as a root servers hint file. .TP \fB\-s When encountering a DNSKEY print the equivalent DS also. .TP \fB\-u Use UDP when querying a server. This is the default. .TP \fB\-w \fIfile\fR write the answer to a file. The file will contain a hexadecimal dump of the query. This can be used in conjunction with \-f. .TP \fB\-x Do a reverse lookup. The type argument is not used, it is preset to PTR. .TP \fB\-y \fI\fR specify named base64 tsig key, and optional an algorithm (defaults to hmac-md5.sig-alg.reg.int) .TP \fB\-z \fR don't randomize the nameserver list before sending queries. .SH "EXIT STATUS" The exit status is 0 if the looked up answer is secure and trusted, or insecure. The exit status is not 0 if the looked up answer is untrusted or bogus, or an error occurred while performing the lookup. .SH "FILES" .TP @LDNS_TRUST_ANCHOR_FILE@ The file from which trusted keys are loaded when no \fB-k\fR option is given. .SH "SEE ALSO" .LP unbound-anchor(8) .SH AUTHOR Jelte Jansen and Miek Gieben. Both of NLnet Labs. .SH REPORTING BUGS Report bugs to . .SH BUGS .SH COPYRIGHT Copyright (c) 2004-2008 NLnet Labs. Licensed under the revised BSD license. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. .SH SEE ALSO \fBdig\fR(1), \fIRFC403{3,4,5}\fR. ldns-1.7.0/drill/work.c0000644000175000017500000001175013026206166014265 0ustar willemwillem/* * work.c * Where all the hard work is done * (c) 2005 NLnet Labs * * See the file LICENSE for the license * */ #include "drill.h" #include /** * Converts a hex string to binary data * len is the length of the string * buf is the buffer to store the result in * offset is the starting position in the result buffer * * This function returns the length of the result */ static size_t hexstr2bin(char *hexstr, int len, uint8_t *buf, size_t offset, size_t buf_len) { char c; int i; uint8_t int8 = 0; int sec = 0; size_t bufpos = 0; if (len % 2 != 0) { return 0; } for (i=0; i= '0' && c <= '9') { int8 += c & 0x0f; } else if (c >= 'a' && c <= 'z') { int8 += (c & 0x0f) + 9; } else if (c >= 'A' && c <= 'Z') { int8 += (c & 0x0f) + 9; } else { return 0; } if (sec == 0) { int8 = int8 << 4; sec = 1; } else { if (bufpos + offset + 1 <= buf_len) { buf[bufpos+offset] = int8; int8 = 0; sec = 0; bufpos++; } else { error("Buffer too small in hexstr2bin"); } } } } return bufpos; } static size_t packetbuffromfile(char *filename, uint8_t *wire) { FILE *fp = NULL; int c; /* stat hack * 0 = normal * 1 = comment (skip to end of line) * 2 = unprintable character found, read binary data directly */ int state = 0; uint8_t *hexbuf = xmalloc(LDNS_MAX_PACKETLEN); int hexbufpos = 0; size_t wirelen; if (strncmp(filename, "-", 2) == 0) { fp = stdin; } else { fp = fopen(filename, "r"); } if (fp == NULL) { perror("Unable to open file for reading"); xfree(hexbuf); return 0; } /*verbose("Opened %s\n", filename);*/ c = fgetc(fp); while (c != EOF && hexbufpos < LDNS_MAX_PACKETLEN) { if (state < 2 && !isascii(c)) { /*verbose("non ascii character found in file: (%d) switching to raw mode\n", c);*/ state = 2; } switch (state) { case 0: if ( (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F') ) { hexbuf[hexbufpos] = (uint8_t) c; hexbufpos++; } else if (c == ';') { state = 1; } else if (c == ' ' || c == '\t' || c == '\n') { /* skip whitespace */ } break; case 1: if (c == '\n' || c == EOF) { state = 0; } break; case 2: hexbuf[hexbufpos] = (uint8_t) c; hexbufpos++; break; } c = fgetc(fp); } if (c == EOF) { /* if (have_drill_opt && drill_opt->verbose) { verbose("END OF FILE REACHED\n"); if (state < 2) { verbose("read:\n"); verbose("%s\n", hexbuf); } else { verbose("Not printing wire because it contains non ascii data\n"); } } */ } if (hexbufpos >= LDNS_MAX_PACKETLEN) { /*verbose("packet size reached\n");*/ } /* lenient mode: length must be multiple of 2 */ if (hexbufpos % 2 != 0) { hexbuf[hexbufpos] = (uint8_t) '0'; hexbufpos++; } if (state < 2) { wirelen = hexstr2bin((char *) hexbuf, hexbufpos, wire, 0, LDNS_MAX_PACKETLEN); } else { memcpy(wire, hexbuf, (size_t) hexbufpos); wirelen = (size_t) hexbufpos; } if (fp != stdin) { fclose(fp); } xfree(hexbuf); return wirelen; } ldns_buffer * read_hex_buffer(char *filename) { uint8_t *wire; size_t wiresize; ldns_buffer *result_buffer = NULL; wire = xmalloc(LDNS_MAX_PACKETLEN); wiresize = packetbuffromfile(filename, wire); result_buffer = LDNS_MALLOC(ldns_buffer); ldns_buffer_new_frm_data(result_buffer, wire, wiresize); ldns_buffer_set_position(result_buffer, ldns_buffer_capacity(result_buffer)); xfree(wire); return result_buffer; } ldns_pkt * read_hex_pkt(char *filename) { uint8_t *wire; size_t wiresize; ldns_pkt *pkt = NULL; ldns_status status = LDNS_STATUS_ERR; wire = xmalloc(LDNS_MAX_PACKETLEN); wiresize = packetbuffromfile(filename, wire); if (wiresize > 0) { status = ldns_wire2pkt(&pkt, wire, wiresize); } xfree(wire); if (status == LDNS_STATUS_OK) { return pkt; } else { fprintf(stderr, "Error parsing hex file: %s\n", ldns_get_errorstr_by_id(status)); return NULL; } } void dump_hex(const ldns_pkt *pkt, const char *filename) { uint8_t *wire = NULL; size_t size, i; FILE *fp; ldns_status status; fp = fopen(filename, "w"); if (fp == NULL) { error("Unable to open %s for writing", filename); return; } status = ldns_pkt2wire(&wire, pkt, &size); if (status != LDNS_STATUS_OK) { error("Unable to convert packet: error code %u", status); LDNS_FREE(wire); fclose(fp); return; } fprintf(fp, "; 0"); for (i = 1; i < 20; i++) { fprintf(fp, " %2u", (unsigned int) i); } fprintf(fp, "\n"); fprintf(fp, ";--"); for (i = 1; i < 20; i++) { fprintf(fp, " --"); } fprintf(fp, "\n"); for (i = 0; i < size; i++) { if (i % 20 == 0 && i > 0) { fprintf(fp, "\t;\t%4u-%4u\n", (unsigned int) i-19, (unsigned int) i); } fprintf(fp, " %02x", (unsigned int)wire[i]); } fprintf(fp, "\n"); fclose(fp); LDNS_FREE(wire); } ldns-1.7.0/sha2.c0000644000175000017500000007356413026206166013045 0ustar willemwillem/* * FILE: sha2.c * AUTHOR: Aaron D. Gifford - http://www.aarongifford.com/ * * Copyright (c) 2000-2001, Aaron D. Gifford * All rights reserved. * * Modified by Jelte Jansen to fit in ldns, and not clash with any * system-defined SHA code. * Changes: * - Renamed (external) functions and constants to fit ldns style * - Removed _End and _Data functions * - Added ldns_shaX(data, len, digest) convenience functions * - Removed prototypes of _Transform functions and made those static * * 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 copyright holder nor the names of contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTOR(S) ``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 OR CONTRIBUTOR(S) 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. * * $Id: sha2.c,v 1.1 2001/11/08 00:01:51 adg Exp adg $ */ #include #include /* memcpy()/memset() or bcopy()/bzero() */ #include /* assert() */ #include /* * ASSERT NOTE: * Some sanity checking code is included using assert(). On my FreeBSD * system, this additional code can be removed by compiling with NDEBUG * defined. Check your own systems manpage on assert() to see how to * compile WITHOUT the sanity checking code on your system. * * UNROLLED TRANSFORM LOOP NOTE: * You can define SHA2_UNROLL_TRANSFORM to use the unrolled transform * loop version for the hash transform rounds (defined using macros * later in this file). Either define on the command line, for example: * * cc -DSHA2_UNROLL_TRANSFORM -o sha2 sha2.c sha2prog.c * * or define below: * * #define SHA2_UNROLL_TRANSFORM * */ /*** SHA-256/384/512 Machine Architecture Definitions *****************/ /* * BYTE_ORDER NOTE: * * Please make sure that your system defines BYTE_ORDER. If your * architecture is little-endian, make sure it also defines * LITTLE_ENDIAN and that the two (BYTE_ORDER and LITTLE_ENDIAN) are * equivilent. * * If your system does not define the above, then you can do so by * hand like this: * * #define LITTLE_ENDIAN 1234 * #define BIG_ENDIAN 4321 * * And for little-endian machines, add: * * #define BYTE_ORDER LITTLE_ENDIAN * * Or for big-endian machines: * * #define BYTE_ORDER BIG_ENDIAN * * The FreeBSD machine this was written on defines BYTE_ORDER * appropriately by including (which in turn includes * where the appropriate definitions are actually * made). */ #if !defined(BYTE_ORDER) || (BYTE_ORDER != LITTLE_ENDIAN && BYTE_ORDER != BIG_ENDIAN) #error Define BYTE_ORDER to be equal to either LITTLE_ENDIAN or BIG_ENDIAN #endif typedef uint8_t sha2_byte; /* Exactly 1 byte */ typedef uint32_t sha2_word32; /* Exactly 4 bytes */ #ifdef S_SPLINT_S typedef unsigned long long sha2_word64; /* lint 8 bytes */ #else typedef uint64_t sha2_word64; /* Exactly 8 bytes */ #endif /*** SHA-256/384/512 Various Length Definitions ***********************/ /* NOTE: Most of these are in sha2.h */ #define ldns_sha256_SHORT_BLOCK_LENGTH (LDNS_SHA256_BLOCK_LENGTH - 8) #define ldns_sha384_SHORT_BLOCK_LENGTH (LDNS_SHA384_BLOCK_LENGTH - 16) #define ldns_sha512_SHORT_BLOCK_LENGTH (LDNS_SHA512_BLOCK_LENGTH - 16) /*** ENDIAN REVERSAL MACROS *******************************************/ #if BYTE_ORDER == LITTLE_ENDIAN #define REVERSE32(w,x) { \ sha2_word32 tmp = (w); \ tmp = (tmp >> 16) | (tmp << 16); \ (x) = ((tmp & 0xff00ff00UL) >> 8) | ((tmp & 0x00ff00ffUL) << 8); \ } #ifndef S_SPLINT_S #define REVERSE64(w,x) { \ sha2_word64 tmp = (w); \ tmp = (tmp >> 32) | (tmp << 32); \ tmp = ((tmp & 0xff00ff00ff00ff00ULL) >> 8) | \ ((tmp & 0x00ff00ff00ff00ffULL) << 8); \ (x) = ((tmp & 0xffff0000ffff0000ULL) >> 16) | \ ((tmp & 0x0000ffff0000ffffULL) << 16); \ } #else /* splint */ #define REVERSE64(w,x) /* splint */ #endif /* splint */ #endif /* BYTE_ORDER == LITTLE_ENDIAN */ /* * Macro for incrementally adding the unsigned 64-bit integer n to the * unsigned 128-bit integer (represented using a two-element array of * 64-bit words): */ #define ADDINC128(w,n) { \ (w)[0] += (sha2_word64)(n); \ if ((w)[0] < (n)) { \ (w)[1]++; \ } \ } #ifdef S_SPLINT_S #undef ADDINC128 #define ADDINC128(w,n) /* splint */ #endif /* * Macros for copying blocks of memory and for zeroing out ranges * of memory. Using these macros makes it easy to switch from * using memset()/memcpy() and using bzero()/bcopy(). * * Please define either SHA2_USE_MEMSET_MEMCPY or define * SHA2_USE_BZERO_BCOPY depending on which function set you * choose to use: */ #if !defined(SHA2_USE_MEMSET_MEMCPY) && !defined(SHA2_USE_BZERO_BCOPY) /* Default to memset()/memcpy() if no option is specified */ #define SHA2_USE_MEMSET_MEMCPY 1 #endif #if defined(SHA2_USE_MEMSET_MEMCPY) && defined(SHA2_USE_BZERO_BCOPY) /* Abort with an error if BOTH options are defined */ #error Define either SHA2_USE_MEMSET_MEMCPY or SHA2_USE_BZERO_BCOPY, not both! #endif #ifdef SHA2_USE_MEMSET_MEMCPY #define MEMSET_BZERO(p,l) memset((p), 0, (l)) #define MEMCPY_BCOPY(d,s,l) memcpy((d), (s), (l)) #endif #ifdef SHA2_USE_BZERO_BCOPY #define MEMSET_BZERO(p,l) bzero((p), (l)) #define MEMCPY_BCOPY(d,s,l) bcopy((s), (d), (l)) #endif /*** THE SIX LOGICAL FUNCTIONS ****************************************/ /* * Bit shifting and rotation (used by the six SHA-XYZ logical functions: * * NOTE: The naming of R and S appears backwards here (R is a SHIFT and * S is a ROTATION) because the SHA-256/384/512 description document * (see http://csrc.nist.gov/cryptval/shs/sha256-384-512.pdf) uses this * same "backwards" definition. */ /* Shift-right (used in SHA-256, SHA-384, and SHA-512): */ #define R(b,x) ((x) >> (b)) /* 32-bit Rotate-right (used in SHA-256): */ #define S32(b,x) (((x) >> (b)) | ((x) << (32 - (b)))) /* 64-bit Rotate-right (used in SHA-384 and SHA-512): */ #define S64(b,x) (((x) >> (b)) | ((x) << (64 - (b)))) /* Two of six logical functions used in SHA-256, SHA-384, and SHA-512: */ #define Ch(x,y,z) (((x) & (y)) ^ ((~(x)) & (z))) #define Maj(x,y,z) (((x) & (y)) ^ ((x) & (z)) ^ ((y) & (z))) /* Four of six logical functions used in SHA-256: */ #define Sigma0_256(x) (S32(2, (x)) ^ S32(13, (x)) ^ S32(22, (x))) #define Sigma1_256(x) (S32(6, (x)) ^ S32(11, (x)) ^ S32(25, (x))) #define sigma0_256(x) (S32(7, (x)) ^ S32(18, (x)) ^ R(3 , (x))) #define sigma1_256(x) (S32(17, (x)) ^ S32(19, (x)) ^ R(10, (x))) /* Four of six logical functions used in SHA-384 and SHA-512: */ #define Sigma0_512(x) (S64(28, (x)) ^ S64(34, (x)) ^ S64(39, (x))) #define Sigma1_512(x) (S64(14, (x)) ^ S64(18, (x)) ^ S64(41, (x))) #define sigma0_512(x) (S64( 1, (x)) ^ S64( 8, (x)) ^ R( 7, (x))) #define sigma1_512(x) (S64(19, (x)) ^ S64(61, (x)) ^ R( 6, (x))) /*** SHA-XYZ INITIAL HASH VALUES AND CONSTANTS ************************/ /* Hash constant words K for SHA-256: */ static const sha2_word32 K256[64] = { 0x428a2f98UL, 0x71374491UL, 0xb5c0fbcfUL, 0xe9b5dba5UL, 0x3956c25bUL, 0x59f111f1UL, 0x923f82a4UL, 0xab1c5ed5UL, 0xd807aa98UL, 0x12835b01UL, 0x243185beUL, 0x550c7dc3UL, 0x72be5d74UL, 0x80deb1feUL, 0x9bdc06a7UL, 0xc19bf174UL, 0xe49b69c1UL, 0xefbe4786UL, 0x0fc19dc6UL, 0x240ca1ccUL, 0x2de92c6fUL, 0x4a7484aaUL, 0x5cb0a9dcUL, 0x76f988daUL, 0x983e5152UL, 0xa831c66dUL, 0xb00327c8UL, 0xbf597fc7UL, 0xc6e00bf3UL, 0xd5a79147UL, 0x06ca6351UL, 0x14292967UL, 0x27b70a85UL, 0x2e1b2138UL, 0x4d2c6dfcUL, 0x53380d13UL, 0x650a7354UL, 0x766a0abbUL, 0x81c2c92eUL, 0x92722c85UL, 0xa2bfe8a1UL, 0xa81a664bUL, 0xc24b8b70UL, 0xc76c51a3UL, 0xd192e819UL, 0xd6990624UL, 0xf40e3585UL, 0x106aa070UL, 0x19a4c116UL, 0x1e376c08UL, 0x2748774cUL, 0x34b0bcb5UL, 0x391c0cb3UL, 0x4ed8aa4aUL, 0x5b9cca4fUL, 0x682e6ff3UL, 0x748f82eeUL, 0x78a5636fUL, 0x84c87814UL, 0x8cc70208UL, 0x90befffaUL, 0xa4506cebUL, 0xbef9a3f7UL, 0xc67178f2UL }; /* initial hash value H for SHA-256: */ static const sha2_word32 ldns_sha256_initial_hash_value[8] = { 0x6a09e667UL, 0xbb67ae85UL, 0x3c6ef372UL, 0xa54ff53aUL, 0x510e527fUL, 0x9b05688cUL, 0x1f83d9abUL, 0x5be0cd19UL }; /* Hash constant words K for SHA-384 and SHA-512: */ static const sha2_word64 K512[80] = { 0x428a2f98d728ae22ULL, 0x7137449123ef65cdULL, 0xb5c0fbcfec4d3b2fULL, 0xe9b5dba58189dbbcULL, 0x3956c25bf348b538ULL, 0x59f111f1b605d019ULL, 0x923f82a4af194f9bULL, 0xab1c5ed5da6d8118ULL, 0xd807aa98a3030242ULL, 0x12835b0145706fbeULL, 0x243185be4ee4b28cULL, 0x550c7dc3d5ffb4e2ULL, 0x72be5d74f27b896fULL, 0x80deb1fe3b1696b1ULL, 0x9bdc06a725c71235ULL, 0xc19bf174cf692694ULL, 0xe49b69c19ef14ad2ULL, 0xefbe4786384f25e3ULL, 0x0fc19dc68b8cd5b5ULL, 0x240ca1cc77ac9c65ULL, 0x2de92c6f592b0275ULL, 0x4a7484aa6ea6e483ULL, 0x5cb0a9dcbd41fbd4ULL, 0x76f988da831153b5ULL, 0x983e5152ee66dfabULL, 0xa831c66d2db43210ULL, 0xb00327c898fb213fULL, 0xbf597fc7beef0ee4ULL, 0xc6e00bf33da88fc2ULL, 0xd5a79147930aa725ULL, 0x06ca6351e003826fULL, 0x142929670a0e6e70ULL, 0x27b70a8546d22ffcULL, 0x2e1b21385c26c926ULL, 0x4d2c6dfc5ac42aedULL, 0x53380d139d95b3dfULL, 0x650a73548baf63deULL, 0x766a0abb3c77b2a8ULL, 0x81c2c92e47edaee6ULL, 0x92722c851482353bULL, 0xa2bfe8a14cf10364ULL, 0xa81a664bbc423001ULL, 0xc24b8b70d0f89791ULL, 0xc76c51a30654be30ULL, 0xd192e819d6ef5218ULL, 0xd69906245565a910ULL, 0xf40e35855771202aULL, 0x106aa07032bbd1b8ULL, 0x19a4c116b8d2d0c8ULL, 0x1e376c085141ab53ULL, 0x2748774cdf8eeb99ULL, 0x34b0bcb5e19b48a8ULL, 0x391c0cb3c5c95a63ULL, 0x4ed8aa4ae3418acbULL, 0x5b9cca4f7763e373ULL, 0x682e6ff3d6b2b8a3ULL, 0x748f82ee5defb2fcULL, 0x78a5636f43172f60ULL, 0x84c87814a1f0ab72ULL, 0x8cc702081a6439ecULL, 0x90befffa23631e28ULL, 0xa4506cebde82bde9ULL, 0xbef9a3f7b2c67915ULL, 0xc67178f2e372532bULL, 0xca273eceea26619cULL, 0xd186b8c721c0c207ULL, 0xeada7dd6cde0eb1eULL, 0xf57d4f7fee6ed178ULL, 0x06f067aa72176fbaULL, 0x0a637dc5a2c898a6ULL, 0x113f9804bef90daeULL, 0x1b710b35131c471bULL, 0x28db77f523047d84ULL, 0x32caab7b40c72493ULL, 0x3c9ebe0a15c9bebcULL, 0x431d67c49c100d4cULL, 0x4cc5d4becb3e42b6ULL, 0x597f299cfc657e2aULL, 0x5fcb6fab3ad6faecULL, 0x6c44198c4a475817ULL }; /* initial hash value H for SHA-384 */ static const sha2_word64 sha384_initial_hash_value[8] = { 0xcbbb9d5dc1059ed8ULL, 0x629a292a367cd507ULL, 0x9159015a3070dd17ULL, 0x152fecd8f70e5939ULL, 0x67332667ffc00b31ULL, 0x8eb44a8768581511ULL, 0xdb0c2e0d64f98fa7ULL, 0x47b5481dbefa4fa4ULL }; /* initial hash value H for SHA-512 */ static const sha2_word64 sha512_initial_hash_value[8] = { 0x6a09e667f3bcc908ULL, 0xbb67ae8584caa73bULL, 0x3c6ef372fe94f82bULL, 0xa54ff53a5f1d36f1ULL, 0x510e527fade682d1ULL, 0x9b05688c2b3e6c1fULL, 0x1f83d9abfb41bd6bULL, 0x5be0cd19137e2179ULL }; /*** SHA-256: *********************************************************/ void ldns_sha256_init(ldns_sha256_CTX* context) { if (context == (ldns_sha256_CTX*)0) { return; } MEMCPY_BCOPY(context->state, ldns_sha256_initial_hash_value, LDNS_SHA256_DIGEST_LENGTH); MEMSET_BZERO(context->buffer, LDNS_SHA256_BLOCK_LENGTH); context->bitcount = 0; } #ifdef SHA2_UNROLL_TRANSFORM /* Unrolled SHA-256 round macros: */ #if BYTE_ORDER == LITTLE_ENDIAN #define ROUND256_0_TO_15(a,b,c,d,e,f,g,h) \ REVERSE32(*data++, W256[j]); \ T1 = (h) + Sigma1_256(e) + Ch((e), (f), (g)) + \ K256[j] + W256[j]; \ (d) += T1; \ (h) = T1 + Sigma0_256(a) + Maj((a), (b), (c)); \ j++ #else /* BYTE_ORDER == LITTLE_ENDIAN */ #define ROUND256_0_TO_15(a,b,c,d,e,f,g,h) \ T1 = (h) + Sigma1_256(e) + Ch((e), (f), (g)) + \ K256[j] + (W256[j] = *data++); \ (d) += T1; \ (h) = T1 + Sigma0_256(a) + Maj((a), (b), (c)); \ j++ #endif /* BYTE_ORDER == LITTLE_ENDIAN */ #define ROUND256(a,b,c,d,e,f,g,h) \ s0 = W256[(j+1)&0x0f]; \ s0 = sigma0_256(s0); \ s1 = W256[(j+14)&0x0f]; \ s1 = sigma1_256(s1); \ T1 = (h) + Sigma1_256(e) + Ch((e), (f), (g)) + K256[j] + \ (W256[j&0x0f] += s1 + W256[(j+9)&0x0f] + s0); \ (d) += T1; \ (h) = T1 + Sigma0_256(a) + Maj((a), (b), (c)); \ j++ static void ldns_sha256_Transform(ldns_sha256_CTX* context, const sha2_word32* data) { sha2_word32 a, b, c, d, e, f, g, h, s0, s1; sha2_word32 T1, *W256; int j; W256 = (sha2_word32*)context->buffer; /* initialize registers with the prev. intermediate value */ a = context->state[0]; b = context->state[1]; c = context->state[2]; d = context->state[3]; e = context->state[4]; f = context->state[5]; g = context->state[6]; h = context->state[7]; j = 0; do { /* Rounds 0 to 15 (unrolled): */ ROUND256_0_TO_15(a,b,c,d,e,f,g,h); ROUND256_0_TO_15(h,a,b,c,d,e,f,g); ROUND256_0_TO_15(g,h,a,b,c,d,e,f); ROUND256_0_TO_15(f,g,h,a,b,c,d,e); ROUND256_0_TO_15(e,f,g,h,a,b,c,d); ROUND256_0_TO_15(d,e,f,g,h,a,b,c); ROUND256_0_TO_15(c,d,e,f,g,h,a,b); ROUND256_0_TO_15(b,c,d,e,f,g,h,a); } while (j < 16); /* Now for the remaining rounds to 64: */ do { ROUND256(a,b,c,d,e,f,g,h); ROUND256(h,a,b,c,d,e,f,g); ROUND256(g,h,a,b,c,d,e,f); ROUND256(f,g,h,a,b,c,d,e); ROUND256(e,f,g,h,a,b,c,d); ROUND256(d,e,f,g,h,a,b,c); ROUND256(c,d,e,f,g,h,a,b); ROUND256(b,c,d,e,f,g,h,a); } while (j < 64); /* Compute the current intermediate hash value */ context->state[0] += a; context->state[1] += b; context->state[2] += c; context->state[3] += d; context->state[4] += e; context->state[5] += f; context->state[6] += g; context->state[7] += h; /* Clean up */ a = b = c = d = e = f = g = h = T1 = 0; } #else /* SHA2_UNROLL_TRANSFORM */ static void ldns_sha256_Transform(ldns_sha256_CTX* context, const sha2_word32* data) { sha2_word32 a, b, c, d, e, f, g, h, s0, s1; sha2_word32 T1, T2, *W256; int j; W256 = (sha2_word32*)context->buffer; /* initialize registers with the prev. intermediate value */ a = context->state[0]; b = context->state[1]; c = context->state[2]; d = context->state[3]; e = context->state[4]; f = context->state[5]; g = context->state[6]; h = context->state[7]; j = 0; do { #if BYTE_ORDER == LITTLE_ENDIAN /* Copy data while converting to host byte order */ REVERSE32(*data++,W256[j]); /* Apply the SHA-256 compression function to update a..h */ T1 = h + Sigma1_256(e) + Ch(e, f, g) + K256[j] + W256[j]; #else /* BYTE_ORDER == LITTLE_ENDIAN */ /* Apply the SHA-256 compression function to update a..h with copy */ T1 = h + Sigma1_256(e) + Ch(e, f, g) + K256[j] + (W256[j] = *data++); #endif /* BYTE_ORDER == LITTLE_ENDIAN */ T2 = Sigma0_256(a) + Maj(a, b, c); h = g; g = f; f = e; e = d + T1; d = c; c = b; b = a; a = T1 + T2; j++; } while (j < 16); do { /* Part of the message block expansion: */ s0 = W256[(j+1)&0x0f]; s0 = sigma0_256(s0); s1 = W256[(j+14)&0x0f]; s1 = sigma1_256(s1); /* Apply the SHA-256 compression function to update a..h */ T1 = h + Sigma1_256(e) + Ch(e, f, g) + K256[j] + (W256[j&0x0f] += s1 + W256[(j+9)&0x0f] + s0); T2 = Sigma0_256(a) + Maj(a, b, c); h = g; g = f; f = e; e = d + T1; d = c; c = b; b = a; a = T1 + T2; j++; } while (j < 64); /* Compute the current intermediate hash value */ context->state[0] += a; context->state[1] += b; context->state[2] += c; context->state[3] += d; context->state[4] += e; context->state[5] += f; context->state[6] += g; context->state[7] += h; /* Clean up */ a = b = c = d = e = f = g = h = T1 = T2 = 0; } #endif /* SHA2_UNROLL_TRANSFORM */ void ldns_sha256_update(ldns_sha256_CTX* context, const sha2_byte *data, size_t len) { size_t freespace, usedspace; if (len == 0) { /* Calling with no data is valid - we do nothing */ return; } /* Sanity check: */ assert(context != (ldns_sha256_CTX*)0 && data != (sha2_byte*)0); usedspace = (context->bitcount >> 3) % LDNS_SHA256_BLOCK_LENGTH; if (usedspace > 0) { /* Calculate how much free space is available in the buffer */ freespace = LDNS_SHA256_BLOCK_LENGTH - usedspace; if (len >= freespace) { /* Fill the buffer completely and process it */ MEMCPY_BCOPY(&context->buffer[usedspace], data, freespace); context->bitcount += freespace << 3; len -= freespace; data += freespace; ldns_sha256_Transform(context, (sha2_word32*)context->buffer); } else { /* The buffer is not yet full */ MEMCPY_BCOPY(&context->buffer[usedspace], data, len); context->bitcount += len << 3; /* Clean up: */ usedspace = freespace = 0; return; } } while (len >= LDNS_SHA256_BLOCK_LENGTH) { /* Process as many complete blocks as we can */ ldns_sha256_Transform(context, (sha2_word32*)data); context->bitcount += LDNS_SHA256_BLOCK_LENGTH << 3; len -= LDNS_SHA256_BLOCK_LENGTH; data += LDNS_SHA256_BLOCK_LENGTH; } if (len > 0) { /* There's left-overs, so save 'em */ MEMCPY_BCOPY(context->buffer, data, len); context->bitcount += len << 3; } /* Clean up: */ usedspace = freespace = 0; } typedef union _ldns_sha2_buffer_union { uint8_t* theChars; uint64_t* theLongs; } ldns_sha2_buffer_union; void ldns_sha256_final(sha2_byte digest[], ldns_sha256_CTX* context) { sha2_word32 *d = (sha2_word32*)digest; size_t usedspace; ldns_sha2_buffer_union cast_var; /* Sanity check: */ assert(context != (ldns_sha256_CTX*)0); /* If no digest buffer is passed, we don't bother doing this: */ if (digest != (sha2_byte*)0) { usedspace = (context->bitcount >> 3) % LDNS_SHA256_BLOCK_LENGTH; #if BYTE_ORDER == LITTLE_ENDIAN /* Convert FROM host byte order */ REVERSE64(context->bitcount,context->bitcount); #endif if (usedspace > 0) { /* Begin padding with a 1 bit: */ context->buffer[usedspace++] = 0x80; if (usedspace <= ldns_sha256_SHORT_BLOCK_LENGTH) { /* Set-up for the last transform: */ MEMSET_BZERO(&context->buffer[usedspace], ldns_sha256_SHORT_BLOCK_LENGTH - usedspace); } else { if (usedspace < LDNS_SHA256_BLOCK_LENGTH) { MEMSET_BZERO(&context->buffer[usedspace], LDNS_SHA256_BLOCK_LENGTH - usedspace); } /* Do second-to-last transform: */ ldns_sha256_Transform(context, (sha2_word32*)context->buffer); /* And set-up for the last transform: */ MEMSET_BZERO(context->buffer, ldns_sha256_SHORT_BLOCK_LENGTH); } } else { /* Set-up for the last transform: */ MEMSET_BZERO(context->buffer, ldns_sha256_SHORT_BLOCK_LENGTH); /* Begin padding with a 1 bit: */ *context->buffer = 0x80; } /* Set the bit count: */ cast_var.theChars = context->buffer; cast_var.theLongs[ldns_sha256_SHORT_BLOCK_LENGTH / 8] = context->bitcount; /* final transform: */ ldns_sha256_Transform(context, (sha2_word32*)context->buffer); #if BYTE_ORDER == LITTLE_ENDIAN { /* Convert TO host byte order */ int j; for (j = 0; j < 8; j++) { REVERSE32(context->state[j],context->state[j]); *d++ = context->state[j]; } } #else MEMCPY_BCOPY(d, context->state, LDNS_SHA256_DIGEST_LENGTH); #endif } /* Clean up state data: */ MEMSET_BZERO(context, sizeof(ldns_sha256_CTX)); usedspace = 0; } unsigned char * ldns_sha256(unsigned char *data, unsigned int data_len, unsigned char *digest) { ldns_sha256_CTX ctx; ldns_sha256_init(&ctx); ldns_sha256_update(&ctx, data, data_len); ldns_sha256_final(digest, &ctx); return digest; } /*** SHA-512: *********************************************************/ void ldns_sha512_init(ldns_sha512_CTX* context) { if (context == (ldns_sha512_CTX*)0) { return; } MEMCPY_BCOPY(context->state, sha512_initial_hash_value, LDNS_SHA512_DIGEST_LENGTH); MEMSET_BZERO(context->buffer, LDNS_SHA512_BLOCK_LENGTH); context->bitcount[0] = context->bitcount[1] = 0; } #ifdef SHA2_UNROLL_TRANSFORM /* Unrolled SHA-512 round macros: */ #if BYTE_ORDER == LITTLE_ENDIAN #define ROUND512_0_TO_15(a,b,c,d,e,f,g,h) \ REVERSE64(*data++, W512[j]); \ T1 = (h) + Sigma1_512(e) + Ch((e), (f), (g)) + \ K512[j] + W512[j]; \ (d) += T1, \ (h) = T1 + Sigma0_512(a) + Maj((a), (b), (c)), \ j++ #else /* BYTE_ORDER == LITTLE_ENDIAN */ #define ROUND512_0_TO_15(a,b,c,d,e,f,g,h) \ T1 = (h) + Sigma1_512(e) + Ch((e), (f), (g)) + \ K512[j] + (W512[j] = *data++); \ (d) += T1; \ (h) = T1 + Sigma0_512(a) + Maj((a), (b), (c)); \ j++ #endif /* BYTE_ORDER == LITTLE_ENDIAN */ #define ROUND512(a,b,c,d,e,f,g,h) \ s0 = W512[(j+1)&0x0f]; \ s0 = sigma0_512(s0); \ s1 = W512[(j+14)&0x0f]; \ s1 = sigma1_512(s1); \ T1 = (h) + Sigma1_512(e) + Ch((e), (f), (g)) + K512[j] + \ (W512[j&0x0f] += s1 + W512[(j+9)&0x0f] + s0); \ (d) += T1; \ (h) = T1 + Sigma0_512(a) + Maj((a), (b), (c)); \ j++ static void ldns_sha512_Transform(ldns_sha512_CTX* context, const sha2_word64* data) { sha2_word64 a, b, c, d, e, f, g, h, s0, s1; sha2_word64 T1, *W512 = (sha2_word64*)context->buffer; int j; /* initialize registers with the prev. intermediate value */ a = context->state[0]; b = context->state[1]; c = context->state[2]; d = context->state[3]; e = context->state[4]; f = context->state[5]; g = context->state[6]; h = context->state[7]; j = 0; do { ROUND512_0_TO_15(a,b,c,d,e,f,g,h); ROUND512_0_TO_15(h,a,b,c,d,e,f,g); ROUND512_0_TO_15(g,h,a,b,c,d,e,f); ROUND512_0_TO_15(f,g,h,a,b,c,d,e); ROUND512_0_TO_15(e,f,g,h,a,b,c,d); ROUND512_0_TO_15(d,e,f,g,h,a,b,c); ROUND512_0_TO_15(c,d,e,f,g,h,a,b); ROUND512_0_TO_15(b,c,d,e,f,g,h,a); } while (j < 16); /* Now for the remaining rounds up to 79: */ do { ROUND512(a,b,c,d,e,f,g,h); ROUND512(h,a,b,c,d,e,f,g); ROUND512(g,h,a,b,c,d,e,f); ROUND512(f,g,h,a,b,c,d,e); ROUND512(e,f,g,h,a,b,c,d); ROUND512(d,e,f,g,h,a,b,c); ROUND512(c,d,e,f,g,h,a,b); ROUND512(b,c,d,e,f,g,h,a); } while (j < 80); /* Compute the current intermediate hash value */ context->state[0] += a; context->state[1] += b; context->state[2] += c; context->state[3] += d; context->state[4] += e; context->state[5] += f; context->state[6] += g; context->state[7] += h; /* Clean up */ a = b = c = d = e = f = g = h = T1 = 0; } #else /* SHA2_UNROLL_TRANSFORM */ static void ldns_sha512_Transform(ldns_sha512_CTX* context, const sha2_word64* data) { sha2_word64 a, b, c, d, e, f, g, h, s0, s1; sha2_word64 T1, T2, *W512 = (sha2_word64*)context->buffer; int j; /* initialize registers with the prev. intermediate value */ a = context->state[0]; b = context->state[1]; c = context->state[2]; d = context->state[3]; e = context->state[4]; f = context->state[5]; g = context->state[6]; h = context->state[7]; j = 0; do { #if BYTE_ORDER == LITTLE_ENDIAN /* Convert TO host byte order */ REVERSE64(*data++, W512[j]); /* Apply the SHA-512 compression function to update a..h */ T1 = h + Sigma1_512(e) + Ch(e, f, g) + K512[j] + W512[j]; #else /* BYTE_ORDER == LITTLE_ENDIAN */ /* Apply the SHA-512 compression function to update a..h with copy */ T1 = h + Sigma1_512(e) + Ch(e, f, g) + K512[j] + (W512[j] = *data++); #endif /* BYTE_ORDER == LITTLE_ENDIAN */ T2 = Sigma0_512(a) + Maj(a, b, c); h = g; g = f; f = e; e = d + T1; d = c; c = b; b = a; a = T1 + T2; j++; } while (j < 16); do { /* Part of the message block expansion: */ s0 = W512[(j+1)&0x0f]; s0 = sigma0_512(s0); s1 = W512[(j+14)&0x0f]; s1 = sigma1_512(s1); /* Apply the SHA-512 compression function to update a..h */ T1 = h + Sigma1_512(e) + Ch(e, f, g) + K512[j] + (W512[j&0x0f] += s1 + W512[(j+9)&0x0f] + s0); T2 = Sigma0_512(a) + Maj(a, b, c); h = g; g = f; f = e; e = d + T1; d = c; c = b; b = a; a = T1 + T2; j++; } while (j < 80); /* Compute the current intermediate hash value */ context->state[0] += a; context->state[1] += b; context->state[2] += c; context->state[3] += d; context->state[4] += e; context->state[5] += f; context->state[6] += g; context->state[7] += h; /* Clean up */ a = b = c = d = e = f = g = h = T1 = T2 = 0; } #endif /* SHA2_UNROLL_TRANSFORM */ void ldns_sha512_update(ldns_sha512_CTX* context, const sha2_byte *data, size_t len) { size_t freespace, usedspace; if (len == 0) { /* Calling with no data is valid - we do nothing */ return; } /* Sanity check: */ assert(context != (ldns_sha512_CTX*)0 && data != (sha2_byte*)0); usedspace = (context->bitcount[0] >> 3) % LDNS_SHA512_BLOCK_LENGTH; if (usedspace > 0) { /* Calculate how much free space is available in the buffer */ freespace = LDNS_SHA512_BLOCK_LENGTH - usedspace; if (len >= freespace) { /* Fill the buffer completely and process it */ MEMCPY_BCOPY(&context->buffer[usedspace], data, freespace); ADDINC128(context->bitcount, freespace << 3); len -= freespace; data += freespace; ldns_sha512_Transform(context, (sha2_word64*)context->buffer); } else { /* The buffer is not yet full */ MEMCPY_BCOPY(&context->buffer[usedspace], data, len); ADDINC128(context->bitcount, len << 3); /* Clean up: */ usedspace = freespace = 0; return; } } while (len >= LDNS_SHA512_BLOCK_LENGTH) { /* Process as many complete blocks as we can */ ldns_sha512_Transform(context, (sha2_word64*)data); ADDINC128(context->bitcount, LDNS_SHA512_BLOCK_LENGTH << 3); len -= LDNS_SHA512_BLOCK_LENGTH; data += LDNS_SHA512_BLOCK_LENGTH; } if (len > 0) { /* There's left-overs, so save 'em */ MEMCPY_BCOPY(context->buffer, data, len); ADDINC128(context->bitcount, len << 3); } /* Clean up: */ usedspace = freespace = 0; } static void ldns_sha512_Last(ldns_sha512_CTX* context) { size_t usedspace; ldns_sha2_buffer_union cast_var; usedspace = (context->bitcount[0] >> 3) % LDNS_SHA512_BLOCK_LENGTH; #if BYTE_ORDER == LITTLE_ENDIAN /* Convert FROM host byte order */ REVERSE64(context->bitcount[0],context->bitcount[0]); REVERSE64(context->bitcount[1],context->bitcount[1]); #endif if (usedspace > 0) { /* Begin padding with a 1 bit: */ context->buffer[usedspace++] = 0x80; if (usedspace <= ldns_sha512_SHORT_BLOCK_LENGTH) { /* Set-up for the last transform: */ MEMSET_BZERO(&context->buffer[usedspace], ldns_sha512_SHORT_BLOCK_LENGTH - usedspace); } else { if (usedspace < LDNS_SHA512_BLOCK_LENGTH) { MEMSET_BZERO(&context->buffer[usedspace], LDNS_SHA512_BLOCK_LENGTH - usedspace); } /* Do second-to-last transform: */ ldns_sha512_Transform(context, (sha2_word64*)context->buffer); /* And set-up for the last transform: */ MEMSET_BZERO(context->buffer, LDNS_SHA512_BLOCK_LENGTH - 2); } } else { /* Prepare for final transform: */ MEMSET_BZERO(context->buffer, ldns_sha512_SHORT_BLOCK_LENGTH); /* Begin padding with a 1 bit: */ *context->buffer = 0x80; } /* Store the length of input data (in bits): */ cast_var.theChars = context->buffer; cast_var.theLongs[ldns_sha512_SHORT_BLOCK_LENGTH / 8] = context->bitcount[1]; cast_var.theLongs[ldns_sha512_SHORT_BLOCK_LENGTH / 8 + 1] = context->bitcount[0]; /* final transform: */ ldns_sha512_Transform(context, (sha2_word64*)context->buffer); } void ldns_sha512_final(sha2_byte digest[], ldns_sha512_CTX* context) { sha2_word64 *d = (sha2_word64*)digest; /* Sanity check: */ assert(context != (ldns_sha512_CTX*)0); /* If no digest buffer is passed, we don't bother doing this: */ if (digest != (sha2_byte*)0) { ldns_sha512_Last(context); /* Save the hash data for output: */ #if BYTE_ORDER == LITTLE_ENDIAN { /* Convert TO host byte order */ int j; for (j = 0; j < 8; j++) { REVERSE64(context->state[j],context->state[j]); *d++ = context->state[j]; } } #else MEMCPY_BCOPY(d, context->state, LDNS_SHA512_DIGEST_LENGTH); #endif } /* Zero out state data */ MEMSET_BZERO(context, sizeof(ldns_sha512_CTX)); } unsigned char * ldns_sha512(unsigned char *data, unsigned int data_len, unsigned char *digest) { ldns_sha512_CTX ctx; ldns_sha512_init(&ctx); ldns_sha512_update(&ctx, data, data_len); ldns_sha512_final(digest, &ctx); return digest; } /*** SHA-384: *********************************************************/ void ldns_sha384_init(ldns_sha384_CTX* context) { if (context == (ldns_sha384_CTX*)0) { return; } MEMCPY_BCOPY(context->state, sha384_initial_hash_value, LDNS_SHA512_DIGEST_LENGTH); MEMSET_BZERO(context->buffer, LDNS_SHA384_BLOCK_LENGTH); context->bitcount[0] = context->bitcount[1] = 0; } void ldns_sha384_update(ldns_sha384_CTX* context, const sha2_byte* data, size_t len) { ldns_sha512_update((ldns_sha512_CTX*)context, data, len); } void ldns_sha384_final(sha2_byte digest[], ldns_sha384_CTX* context) { sha2_word64 *d = (sha2_word64*)digest; /* Sanity check: */ assert(context != (ldns_sha384_CTX*)0); /* If no digest buffer is passed, we don't bother doing this: */ if (digest != (sha2_byte*)0) { ldns_sha512_Last((ldns_sha512_CTX*)context); /* Save the hash data for output: */ #if BYTE_ORDER == LITTLE_ENDIAN { /* Convert TO host byte order */ int j; for (j = 0; j < 6; j++) { REVERSE64(context->state[j],context->state[j]); *d++ = context->state[j]; } } #else MEMCPY_BCOPY(d, context->state, LDNS_SHA384_DIGEST_LENGTH); #endif } /* Zero out state data */ MEMSET_BZERO(context, sizeof(ldns_sha384_CTX)); } unsigned char * ldns_sha384(unsigned char *data, unsigned int data_len, unsigned char *digest) { ldns_sha384_CTX ctx; ldns_sha384_init(&ctx); ldns_sha384_update(&ctx, data, data_len); ldns_sha384_final(digest, &ctx); return digest; } ldns-1.7.0/duration.c0000644000175000017500000002120213026206166014013 0ustar willemwillem/* * $Id: duration.c 4518 2011-02-24 15:39:09Z matthijs $ * * Copyright (c) 2009 NLNet Labs. 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. * * 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. * */ /** * * This file is copied from the OpenDNSSEC source repository * and only slightly adapted to make it fit. */ /** * * Durations. */ #include #include #include #include #include #include /** * Create a new 'instant' duration. * */ ldns_duration_type* ldns_duration_create(void) { ldns_duration_type* duration; duration = malloc(sizeof(ldns_duration_type)); if (!duration) { return NULL; } duration->years = 0; duration->months = 0; duration->weeks = 0; duration->days = 0; duration->hours = 0; duration->minutes = 0; duration->seconds = 0; return duration; } /** * Compare durations. * */ int ldns_duration_compare(const ldns_duration_type* d1, const ldns_duration_type* d2) { if (!d1 && !d2) { return 0; } if (!d1 || !d2) { return d1?-1:1; } if (d1->years != d2->years) { return (int) (d1->years - d2->years); } if (d1->months != d2->months) { return (int) (d1->months - d2->months); } if (d1->weeks != d2->weeks) { return (int) (d1->weeks - d2->weeks); } if (d1->days != d2->days) { return (int) (d1->days - d2->days); } if (d1->hours != d2->hours) { return (int) (d1->hours - d2->hours); } if (d1->minutes != d2->minutes) { return (int) (d1->minutes - d2->minutes); } if (d1->seconds != d2->seconds) { return (int) (d1->seconds - d2->seconds); } return 0; } /** * Create a duration from string. * */ ldns_duration_type* ldns_duration_create_from_string(const char* str) { ldns_duration_type* duration = ldns_duration_create(); char* P, *X, *T, *W; int not_weeks = 0; if (!duration) { return NULL; } if (!str) { return duration; } P = strchr(str, 'P'); if (!P) { ldns_duration_cleanup(duration); return NULL; } T = strchr(str, 'T'); X = strchr(str, 'Y'); if (X) { duration->years = (time_t) atoi(str+1); str = X; not_weeks = 1; } X = strchr(str, 'M'); if (X && (!T || (size_t) (X-P) < (size_t) (T-P))) { duration->months = (time_t) atoi(str+1); str = X; not_weeks = 1; } X = strchr(str, 'D'); if (X) { duration->days = (time_t) atoi(str+1); str = X; not_weeks = 1; } if (T) { str = T; not_weeks = 1; } X = strchr(str, 'H'); if (X && T) { duration->hours = (time_t) atoi(str+1); str = X; not_weeks = 1; } X = strrchr(str, 'M'); if (X && T && (size_t) (X-P) > (size_t) (T-P)) { duration->minutes = (time_t) atoi(str+1); str = X; not_weeks = 1; } X = strchr(str, 'S'); if (X && T) { duration->seconds = (time_t) atoi(str+1); str = X; not_weeks = 1; } W = strchr(str, 'W'); if (W) { if (not_weeks) { ldns_duration_cleanup(duration); return NULL; } else { duration->weeks = (time_t) atoi(str+1); str = W; } } return duration; } /** * Get the number of digits in a number. * */ static size_t digits_in_number(time_t duration) { uint32_t period = (uint32_t) duration; size_t count = 0; while (period > 0) { count++; period /= 10; } return count; } /** * Convert a duration to a string. * */ char* ldns_duration2string(const ldns_duration_type* duration) { char* str = NULL, *num = NULL; size_t count = 2; int T = 0; if (!duration) { return NULL; } if (duration->years > 0) { count = count + 1 + digits_in_number(duration->years); } if (duration->months > 0) { count = count + 1 + digits_in_number(duration->months); } if (duration->weeks > 0) { count = count + 1 + digits_in_number(duration->weeks); } if (duration->days > 0) { count = count + 1 + digits_in_number(duration->days); } if (duration->hours > 0) { count = count + 1 + digits_in_number(duration->hours); T = 1; } if (duration->minutes > 0) { count = count + 1 + digits_in_number(duration->minutes); T = 1; } if (duration->seconds > 0) { count = count + 1 + digits_in_number(duration->seconds); T = 1; } if (T) { count++; } str = (char*) calloc(count, sizeof(char)); str[0] = 'P'; str[1] = '\0'; if (duration->years > 0) { count = digits_in_number(duration->years); num = (char*) calloc(count+2, sizeof(char)); snprintf(num, count+2, "%uY", (unsigned int) duration->years); str = strncat(str, num, count+2); free((void*) num); } if (duration->months > 0) { count = digits_in_number(duration->months); num = (char*) calloc(count+2, sizeof(char)); snprintf(num, count+2, "%uM", (unsigned int) duration->months); str = strncat(str, num, count+2); free((void*) num); } if (duration->weeks > 0) { count = digits_in_number(duration->weeks); num = (char*) calloc(count+2, sizeof(char)); snprintf(num, count+2, "%uW", (unsigned int) duration->weeks); str = strncat(str, num, count+2); free((void*) num); } if (duration->days > 0) { count = digits_in_number(duration->days); num = (char*) calloc(count+2, sizeof(char)); snprintf(num, count+2, "%uD", (unsigned int) duration->days); str = strncat(str, num, count+2); free((void*) num); } if (T) { str = strncat(str, "T", 1); } if (duration->hours > 0) { count = digits_in_number(duration->hours); num = (char*) calloc(count+2, sizeof(char)); snprintf(num, count+2, "%uH", (unsigned int) duration->hours); str = strncat(str, num, count+2); free((void*) num); } if (duration->minutes > 0) { count = digits_in_number(duration->minutes); num = (char*) calloc(count+2, sizeof(char)); snprintf(num, count+2, "%uM", (unsigned int) duration->minutes); str = strncat(str, num, count+2); free((void*) num); } if (duration->seconds > 0) { count = digits_in_number(duration->seconds); num = (char*) calloc(count+2, sizeof(char)); snprintf(num, count+2, "%uS", (unsigned int) duration->seconds); str = strncat(str, num, count+2); free((void*) num); } return str; } /** * Convert a duration to a time. * */ time_t ldns_duration2time(const ldns_duration_type* duration) { time_t period = 0; if (duration) { period += (duration->seconds); period += (duration->minutes)*60; period += (duration->hours)*3600; period += (duration->days)*86400; period += (duration->weeks)*86400*7; period += (duration->months)*86400*31; period += (duration->years)*86400*365; /* [TODO] calculate correct number of days in this month/year */ /* if (duration->months || duration->years) { } */ } return period; } /** * Clean up duration. * */ void ldns_duration_cleanup(ldns_duration_type* duration) { if (!duration) { return; } free(duration); return; } ldns-1.7.0/README0000644000175000017500000001005513026206166012706 0ustar willemwillem Contents: REQUIREMENTS INSTALLATION libdns examples drill INFORMATION FOR SPECIFIC OPERATING SYSTEMS Mac OS X Solaris KNOWN ISSUES pyldns Your Support Project page: http://www.nlnetlabs.nl/ldns/ On that page you can also subscribe to the ldns mailing list. * Development ldns is mainly developed on Linux and FreeBSD. It is regularly tested to compile on other systems like Solaris and Mac OS X. REQUIREMENTS - OpenSSL (Optional, but needed for features like DNSSEC) - OpenSSL >= 0.9.7f for DANE support - OpenSSL >= 1.0.0 for ECDSA and GOST support - libpcap (Optional, but needed for examples/ldns-dpa) - (GNU) libtool (in OSX, that's glibtool, not libtool) - GNU make INSTALLATION 1. Unpack the tarball 2. cd ldns- 3. ./configure --with-examples --with-drill (optionally compile python bindings too with: --with-pyldns) 4. make 5. make install * Building from repository If you are building from the repository you will need to have (gnu) autotools like libtool and autoreconf installed. A list of all the commands needed to build everything can be found in README.git. Note that the actual commands may be a little bit different on your machine. Most notably, you'll need to run libtoolize (or glibtoolize). If you skip this step, you'll get an error about missing config.sub. * Developers ldns is developed by the ldns team at NLnet Labs. This team currently consists of: o Willem Toorop o Wouter Wijngaards o Matthijs Mekking Former main developers: o Jelte Jansen o Miek Gieben * Credits We have received patches from the following people, thanks! o Bedrich Kosata o Erik Rozendaal o Håkan Olsson o Jakob Schlyter o Paul Wouters o Simon Vallet o Ondřej Surý o Karel Slany o Havard Eidnes o Leo Baltus o Dag-Erling Smørgrav INFORMATION FOR SPECIFIC OPERATING SYSTEMS MAC OS X For MACOSX 10.4 and later, it seems that you have to set the MACOSX_DEPLOYMENT_TARGET environment variable to 10.4 before running make. Apparently it defaults to 10.1. This appears to be a known problem in 10.2 to 10.4, see: http://developer.apple.com/qa/qa2001/qa1233.html for more information. SOLARIS In Solaris multi-architecture systems (which have both 32-bit and 64-bit support), it can be a bit taxing to convince the system to compile in 64-bit mode. Jakob Schlyter has kindly contributed a build script that sets the right build and link options. You can find it in contrib/build-solaris.sh KNOWN ISSUES A complete list of currently known open issues can be found here: http://www.nlnetlabs.nl/projects/ldns/bugs * pyldns Compiling pyldns produces many ``unused parameter'' warnings. Those are harmless and may safely be ignored. Also, when building with SWIG older than 2.0.4, compiling pyldns produces many ``missing initializer'' warnings. Those are harmless too. Your Support NLnet Labs offers all of its software products as open source, most published under a BSD license. You can download them, not only from the NLnet Labs website but also through the various OS distributions for which NSD, ldns, and Unbound are packaged. We therefore have little idea who uses our software in production environments and have no direct ties with 'our customers'. Therefore, we ask you to contact us at users@NLnetLabs.nl and tell us whether you use one of our products in your production environment, what that environment looks like, and maybe even share some praise. We would like to refer to the fact that your organization is using our products. We will only do that if you explicitly allow us. In all other cases we will keep the information you share with us to ourselves. In addition to the moral support you can also support us financially. NLnet Labs is a recognized not-for-profit charity foundation that is chartered to develop open-source software and open-standards for the Internet. If you use our software to satisfaction please express that by giving us a donation. For small donations PayPal can be used. For larger and regular donations please contact us at users@NLnetLabs.nl. Also see http://www.nlnetlabs.nl/labs/contributors/. ldns-1.7.0/str2host.c0000644000175000017500000011321013026206166013757 0ustar willemwillem/* * str2host.c * * conversion routines from the presentation format * to the host format * * a Net::DNS like library for C * * (c) NLnet Labs, 2004-2006 * * See the file LICENSE for the license */ #include #include #ifdef HAVE_SYS_SOCKET_H #include #endif #ifdef HAVE_ARPA_INET_H #include #endif #include #include #ifdef HAVE_NETDB_H #include #endif #include #ifdef HAVE_SYS_PARAM_H #include #endif ldns_status ldns_str2rdf_int16(ldns_rdf **rd, const char *shortstr) { char *end = NULL; uint16_t *r; r = LDNS_MALLOC(uint16_t); if(!r) return LDNS_STATUS_MEM_ERR; *r = htons((uint16_t)strtol((char *)shortstr, &end, 10)); if(*end != 0) { LDNS_FREE(r); return LDNS_STATUS_INVALID_INT; } else { *rd = ldns_rdf_new_frm_data( LDNS_RDF_TYPE_INT16, sizeof(uint16_t), r); LDNS_FREE(r); return *rd?LDNS_STATUS_OK:LDNS_STATUS_MEM_ERR; } } ldns_status ldns_str2rdf_time(ldns_rdf **rd, const char *time) { /* convert a time YYYYDDMMHHMMSS to wireformat */ uint16_t *r = NULL; struct tm tm; uint32_t l; char *end; /* Try to scan the time... */ r = (uint16_t*)LDNS_MALLOC(uint32_t); if(!r) return LDNS_STATUS_MEM_ERR; memset(&tm, 0, sizeof(tm)); if (strlen(time) == 14 && sscanf(time, "%4d%2d%2d%2d%2d%2d", &tm.tm_year, &tm.tm_mon, &tm.tm_mday, &tm.tm_hour, &tm.tm_min, &tm.tm_sec) == 6 ) { tm.tm_year -= 1900; tm.tm_mon--; /* Check values */ if (tm.tm_year < 70) { goto bad_format; } if (tm.tm_mon < 0 || tm.tm_mon > 11) { goto bad_format; } if (tm.tm_mday < 1 || tm.tm_mday > 31) { goto bad_format; } if (tm.tm_hour < 0 || tm.tm_hour > 23) { goto bad_format; } if (tm.tm_min < 0 || tm.tm_min > 59) { goto bad_format; } if (tm.tm_sec < 0 || tm.tm_sec > 59) { goto bad_format; } l = htonl(ldns_mktime_from_utc(&tm)); memcpy(r, &l, sizeof(uint32_t)); *rd = ldns_rdf_new_frm_data( LDNS_RDF_TYPE_TIME, sizeof(uint32_t), r); LDNS_FREE(r); return *rd?LDNS_STATUS_OK:LDNS_STATUS_MEM_ERR; } else { /* handle it as 32 bits timestamp */ l = htonl((uint32_t)strtol((char*)time, &end, 10)); if(*end != 0) { LDNS_FREE(r); return LDNS_STATUS_ERR; } else { memcpy(r, &l, sizeof(uint32_t)); *rd = ldns_rdf_new_frm_data( LDNS_RDF_TYPE_INT32, sizeof(uint32_t), r); LDNS_FREE(r); return *rd?LDNS_STATUS_OK:LDNS_STATUS_MEM_ERR; } } bad_format: LDNS_FREE(r); return LDNS_STATUS_INVALID_TIME; } ldns_status ldns_str2rdf_nsec3_salt(ldns_rdf **rd, const char *salt_str) { uint8_t salt_length; int c; int salt_length_str; uint8_t *salt; uint8_t *data; if(rd == NULL) { return LDNS_STATUS_NULL; } salt_length_str = (int)strlen(salt_str); if (salt_length_str == 1 && salt_str[0] == '-') { salt_length_str = 0; } else if (salt_length_str % 2 != 0) { return LDNS_STATUS_INVALID_HEX; } if (salt_length_str > 512) { return LDNS_STATUS_INVALID_HEX; } salt = LDNS_XMALLOC(uint8_t, salt_length_str / 2); if(!salt) { return LDNS_STATUS_MEM_ERR; } for (c = 0; c < salt_length_str; c += 2) { if (isxdigit((int) salt_str[c]) && isxdigit((int) salt_str[c+1])) { salt[c/2] = (uint8_t) ldns_hexdigit_to_int(salt_str[c]) * 16 + ldns_hexdigit_to_int(salt_str[c+1]); } else { LDNS_FREE(salt); return LDNS_STATUS_INVALID_HEX; } } salt_length = (uint8_t) (salt_length_str / 2); data = LDNS_XMALLOC(uint8_t, 1 + salt_length); if(!data) { LDNS_FREE(salt); return LDNS_STATUS_MEM_ERR; } data[0] = salt_length; memcpy(&data[1], salt, salt_length); *rd = ldns_rdf_new_frm_data(LDNS_RDF_TYPE_NSEC3_SALT, 1 + salt_length, data); LDNS_FREE(data); LDNS_FREE(salt); return *rd?LDNS_STATUS_OK:LDNS_STATUS_MEM_ERR; } ldns_status ldns_str2rdf_period(ldns_rdf **rd,const char *period) { uint32_t p; const char *end; /* Allocate required space... */ p = ldns_str2period(period, &end); if (*end != 0) { return LDNS_STATUS_ERR; } else { p = (uint32_t) htonl(p); *rd = ldns_rdf_new_frm_data( LDNS_RDF_TYPE_PERIOD, sizeof(uint32_t), &p); } return *rd?LDNS_STATUS_OK:LDNS_STATUS_MEM_ERR; } ldns_status ldns_str2rdf_int32(ldns_rdf **rd, const char *longstr) { char *end; uint16_t *r = NULL; uint32_t l; r = (uint16_t*)LDNS_MALLOC(uint32_t); if(!r) return LDNS_STATUS_MEM_ERR; errno = 0; /* must set to zero before call, note race condition on errno */ if(*longstr == '-') l = htonl((uint32_t)strtol((char*)longstr, &end, 10)); else l = htonl((uint32_t)strtoul((char*)longstr, &end, 10)); if(*end != 0) { LDNS_FREE(r); return LDNS_STATUS_ERR; } else { if (errno == ERANGE) { LDNS_FREE(r); return LDNS_STATUS_SYNTAX_INTEGER_OVERFLOW; } memcpy(r, &l, sizeof(uint32_t)); *rd = ldns_rdf_new_frm_data( LDNS_RDF_TYPE_INT32, sizeof(uint32_t), r); LDNS_FREE(r); return *rd?LDNS_STATUS_OK:LDNS_STATUS_MEM_ERR; } } ldns_status ldns_str2rdf_int8(ldns_rdf **rd, const char *bytestr) { char *end; uint8_t *r = NULL; r = LDNS_MALLOC(uint8_t); if(!r) return LDNS_STATUS_MEM_ERR; *r = (uint8_t)strtol((char*)bytestr, &end, 10); if(*end != 0) { LDNS_FREE(r); return LDNS_STATUS_ERR; } else { *rd = ldns_rdf_new_frm_data( LDNS_RDF_TYPE_INT8, sizeof(uint8_t), r); LDNS_FREE(r); return *rd?LDNS_STATUS_OK:LDNS_STATUS_MEM_ERR; } } /* * Checks whether the escaped value at **s is an decimal value or * a 'normally' escaped character (and not eos) * * The string pointer at *s is increased by either 0 (on error), 1 (on * normal escapes), or 3 (on decimals) * * Returns the number of bytes read from the escaped string, or * 0 on error */ INLINE bool parse_escape(uint8_t *ch_p, const char** str_p) { uint16_t val; if ((*str_p)[0] && isdigit((unsigned char)(*str_p)[0]) && (*str_p)[1] && isdigit((unsigned char)(*str_p)[1]) && (*str_p)[2] && isdigit((unsigned char)(*str_p)[2])) { val = (uint16_t)(((*str_p)[0] - '0') * 100 + ((*str_p)[1] - '0') * 10 + ((*str_p)[2] - '0')); if (val > 255) { goto error; } *ch_p = (uint8_t)val; *str_p += 3; return true; } else if ((*str_p)[0] && !isdigit((unsigned char)(*str_p)[0])) { *ch_p = (uint8_t)*(*str_p)++; return true; } error: *str_p = NULL; return false; /* LDNS_STATUS_SYNTAX_BAD_ESCAPE */ } INLINE bool parse_char(uint8_t *ch_p, const char** str_p) { switch (**str_p) { case '\0': return false; case '\\': *str_p += 1; return parse_escape(ch_p, str_p); default: *ch_p = (uint8_t)*(*str_p)++; return true; } } /* * No special care is taken, all dots are translated into * label seperators. * Could be made more efficient....we do 3 memcpy's in total... */ ldns_status ldns_str2rdf_dname(ldns_rdf **d, const char *str) { size_t len; const char *s; uint8_t *q, *pq, label_len; uint8_t buf[LDNS_MAX_DOMAINLEN + 1]; *d = NULL; len = strlen((char*)str); /* octet representation can make strings a lot longer than actual length */ if (len > LDNS_MAX_DOMAINLEN * 4) { return LDNS_STATUS_DOMAINNAME_OVERFLOW; } if (0 == len) { return LDNS_STATUS_DOMAINNAME_UNDERFLOW; } /* root label */ if (1 == len && *str == '.') { *d = ldns_rdf_new_frm_data(LDNS_RDF_TYPE_DNAME, 1, "\0"); return LDNS_STATUS_OK; } /* get on with the rest */ /* s is on the current character in the string * pq points to where the labellength is going to go * label_len keeps track of the current label's length * q builds the dname inside the buf array */ len = 0; q = buf+1; pq = buf; label_len = 0; for (s = str; *s; s++, q++) { if (q > buf + LDNS_MAX_DOMAINLEN) { return LDNS_STATUS_DOMAINNAME_OVERFLOW; } *q = 0; switch (*s) { case '.': if (label_len > LDNS_MAX_LABELLEN) { return LDNS_STATUS_LABEL_OVERFLOW; } if (label_len == 0) { return LDNS_STATUS_EMPTY_LABEL; } len += label_len + 1; *pq = label_len; label_len = 0; pq = q; break; case '\\': /* octet value or literal char */ s += 1; if (! parse_escape(q, &s)) { return LDNS_STATUS_SYNTAX_BAD_ESCAPE; } s -= 1; label_len++; break; default: *q = (uint8_t)*s; label_len++; } } /* add root label if last char was not '.' */ if (!ldns_dname_str_absolute(str)) { if (q > buf + LDNS_MAX_DOMAINLEN) { return LDNS_STATUS_DOMAINNAME_OVERFLOW; } if (label_len > LDNS_MAX_LABELLEN) { return LDNS_STATUS_LABEL_OVERFLOW; } if (label_len == 0) { /* label_len 0 but not . at end? */ return LDNS_STATUS_EMPTY_LABEL; } len += label_len + 1; *pq = label_len; *q = 0; } len++; *d = ldns_rdf_new_frm_data(LDNS_RDF_TYPE_DNAME, len, buf); return LDNS_STATUS_OK; } ldns_status ldns_str2rdf_a(ldns_rdf **rd, const char *str) { in_addr_t address; if (inet_pton(AF_INET, (char*)str, &address) != 1) { return LDNS_STATUS_INVALID_IP4; } else { *rd = ldns_rdf_new_frm_data( LDNS_RDF_TYPE_A, sizeof(address), &address); } return *rd?LDNS_STATUS_OK:LDNS_STATUS_MEM_ERR; } ldns_status ldns_str2rdf_aaaa(ldns_rdf **rd, const char *str) { uint8_t address[LDNS_IP6ADDRLEN + 1]; if (inet_pton(AF_INET6, (char*)str, address) != 1) { return LDNS_STATUS_INVALID_IP6; } else { *rd = ldns_rdf_new_frm_data( LDNS_RDF_TYPE_AAAA, sizeof(address) - 1, &address); } return *rd?LDNS_STATUS_OK:LDNS_STATUS_MEM_ERR; } ldns_status ldns_str2rdf_str(ldns_rdf **rd, const char *str) { uint8_t *data, *dp, ch = 0; size_t length; /* Worst case space requirement. We'll realloc to actual size later. */ dp = data = LDNS_XMALLOC(uint8_t, strlen(str) > 255 ? 256 : (strlen(str) + 1)); if (! data) { return LDNS_STATUS_MEM_ERR; } /* Fill data (up to 255 characters) */ while (parse_char(&ch, &str)) { if (dp - data >= 255) { LDNS_FREE(data); return LDNS_STATUS_INVALID_STR; } *++dp = ch; } if (! str) { return LDNS_STATUS_SYNTAX_BAD_ESCAPE; } length = (size_t)(dp - data); /* Fix last length byte */ data[0] = (uint8_t)length; /* Lose the overmeasure */ data = LDNS_XREALLOC(dp = data, uint8_t, length + 1); if (! data) { LDNS_FREE(dp); return LDNS_STATUS_MEM_ERR; } /* Create rdf */ *rd = ldns_rdf_new(LDNS_RDF_TYPE_STR, length + 1, data); if (! *rd) { LDNS_FREE(data); return LDNS_STATUS_MEM_ERR; } return LDNS_STATUS_OK; } ldns_status ldns_str2rdf_apl(ldns_rdf **rd, const char *str) { const char *my_str = str; char *my_ip_str; size_t ip_str_len; uint16_t family; bool negation; uint8_t afdlength = 0; uint8_t *afdpart; uint8_t prefix; uint8_t *data; size_t i = 0; /* [!]afi:address/prefix */ if (strlen(my_str) < 2 || strchr(my_str, ':') == NULL || strchr(my_str, '/') == NULL || strchr(my_str, ':') > strchr(my_str, '/')) { return LDNS_STATUS_INVALID_STR; } if (my_str[0] == '!') { negation = true; my_str += 1; } else { negation = false; } family = (uint16_t) atoi(my_str); my_str = strchr(my_str, ':') + 1; /* need ip addr and only ip addr for inet_pton */ ip_str_len = (size_t) (strchr(my_str, '/') - my_str); my_ip_str = LDNS_XMALLOC(char, ip_str_len + 1); if(!my_ip_str) return LDNS_STATUS_MEM_ERR; strncpy(my_ip_str, my_str, ip_str_len + 1); my_ip_str[ip_str_len] = '\0'; if (family == 1) { /* ipv4 */ afdpart = LDNS_XMALLOC(uint8_t, 4); if(!afdpart) { LDNS_FREE(my_ip_str); return LDNS_STATUS_MEM_ERR; } if (inet_pton(AF_INET, my_ip_str, afdpart) == 0) { LDNS_FREE(my_ip_str); LDNS_FREE(afdpart); return LDNS_STATUS_INVALID_STR; } for (i = 0; i < 4; i++) { if (afdpart[i] != 0) { afdlength = i + 1; } } } else if (family == 2) { /* ipv6 */ afdpart = LDNS_XMALLOC(uint8_t, 16); if(!afdpart) { LDNS_FREE(my_ip_str); return LDNS_STATUS_MEM_ERR; } if (inet_pton(AF_INET6, my_ip_str, afdpart) == 0) { LDNS_FREE(my_ip_str); LDNS_FREE(afdpart); return LDNS_STATUS_INVALID_STR; } for (i = 0; i < 16; i++) { if (afdpart[i] != 0) { afdlength = i + 1; } } } else { /* unknown family */ LDNS_FREE(my_ip_str); return LDNS_STATUS_INVALID_STR; } my_str = strchr(my_str, '/') + 1; prefix = (uint8_t) atoi(my_str); data = LDNS_XMALLOC(uint8_t, 4 + afdlength); if(!data) { LDNS_FREE(afdpart); LDNS_FREE(my_ip_str); return LDNS_STATUS_INVALID_STR; } ldns_write_uint16(data, family); data[2] = prefix; data[3] = afdlength; if (negation) { /* set bit 1 of byte 3 */ data[3] = data[3] | 0x80; } memcpy(data + 4, afdpart, afdlength); *rd = ldns_rdf_new_frm_data(LDNS_RDF_TYPE_APL, afdlength + 4, data); LDNS_FREE(afdpart); LDNS_FREE(data); LDNS_FREE(my_ip_str); return *rd?LDNS_STATUS_OK:LDNS_STATUS_MEM_ERR; } ldns_status ldns_str2rdf_b64(ldns_rdf **rd, const char *str) { uint8_t *buffer; int16_t i; buffer = LDNS_XMALLOC(uint8_t, ldns_b64_ntop_calculate_size(strlen(str))); if(!buffer) { return LDNS_STATUS_MEM_ERR; } i = (uint16_t)ldns_b64_pton((const char*)str, buffer, ldns_b64_ntop_calculate_size(strlen(str))); if (-1 == i) { LDNS_FREE(buffer); return LDNS_STATUS_INVALID_B64; } else { *rd = ldns_rdf_new_frm_data( LDNS_RDF_TYPE_B64, (uint16_t) i, buffer); } LDNS_FREE(buffer); return *rd?LDNS_STATUS_OK:LDNS_STATUS_MEM_ERR; } ldns_status ldns_str2rdf_b32_ext(ldns_rdf **rd, const char *str) { uint8_t *buffer; int i; /* first byte contains length of actual b32 data */ uint8_t len = ldns_b32_pton_calculate_size(strlen(str)); buffer = LDNS_XMALLOC(uint8_t, len + 1); if(!buffer) { return LDNS_STATUS_MEM_ERR; } buffer[0] = len; i = ldns_b32_pton_extended_hex((const char*)str, strlen(str), buffer + 1, ldns_b32_ntop_calculate_size(strlen(str))); if (i < 0) { LDNS_FREE(buffer); return LDNS_STATUS_INVALID_B32_EXT; } else { *rd = ldns_rdf_new_frm_data( LDNS_RDF_TYPE_B32_EXT, (uint16_t) i + 1, buffer); } LDNS_FREE(buffer); return *rd?LDNS_STATUS_OK:LDNS_STATUS_MEM_ERR; } ldns_status ldns_str2rdf_hex(ldns_rdf **rd, const char *str) { uint8_t *t, *t_orig; int i; size_t len; len = strlen(str); if (len > LDNS_MAX_RDFLEN * 2) { return LDNS_STATUS_LABEL_OVERFLOW; } else { t = LDNS_XMALLOC(uint8_t, (len / 2) + 1); if(!t) { return LDNS_STATUS_MEM_ERR; } t_orig = t; /* Now process octet by octet... */ while (*str) { *t = 0; if (isspace((int) *str)) { str++; } else { for (i = 16; i >= 1; i -= 15) { while (*str && isspace((int) *str)) { str++; } if (*str) { if (isxdigit((int) *str)) { *t += ldns_hexdigit_to_int(*str) * i; } else { LDNS_FREE(t_orig); return LDNS_STATUS_ERR; } ++str; } } ++t; } } *rd = ldns_rdf_new_frm_data(LDNS_RDF_TYPE_HEX, (size_t) (t - t_orig), t_orig); LDNS_FREE(t_orig); } return *rd?LDNS_STATUS_OK:LDNS_STATUS_MEM_ERR; } ldns_status ldns_str2rdf_nsec(ldns_rdf **rd, const char *str) { const char *delimiters = "\n\t "; char *token = LDNS_XMALLOC(char, LDNS_MAX_RDFLEN); ldns_buffer *str_buf; ssize_t c; uint16_t cur_type; size_t type_count = 0; ldns_rr_type type_list[65536]; if(!token) return LDNS_STATUS_MEM_ERR; if(rd == NULL) { LDNS_FREE(token); return LDNS_STATUS_NULL; } str_buf = LDNS_MALLOC(ldns_buffer); if(!str_buf) { LDNS_FREE(token); return LDNS_STATUS_MEM_ERR; } ldns_buffer_new_frm_data(str_buf, (char *)str, strlen(str)); if(ldns_buffer_status(str_buf) != LDNS_STATUS_OK) { LDNS_FREE(str_buf); LDNS_FREE(token); return LDNS_STATUS_MEM_ERR; } while ((c = ldns_bget_token(str_buf, token, delimiters, LDNS_MAX_RDFLEN)) != -1 && c != 0) { if(type_count >= sizeof(type_list)) { LDNS_FREE(str_buf); LDNS_FREE(token); return LDNS_STATUS_ERR; } cur_type = ldns_get_rr_type_by_name(token); type_list[type_count] = cur_type; type_count++; } *rd = ldns_dnssec_create_nsec_bitmap(type_list, type_count, LDNS_RR_TYPE_NSEC); LDNS_FREE(token); ldns_buffer_free(str_buf); return *rd?LDNS_STATUS_OK:LDNS_STATUS_MEM_ERR; } ldns_status ldns_str2rdf_type(ldns_rdf **rd, const char *str) { uint16_t type; type = htons(ldns_get_rr_type_by_name(str)); /* ldns_rr_type is a 16 bit value */ *rd = ldns_rdf_new_frm_data( LDNS_RDF_TYPE_TYPE, sizeof(uint16_t), &type); return *rd?LDNS_STATUS_OK:LDNS_STATUS_MEM_ERR; } ldns_status ldns_str2rdf_class(ldns_rdf **rd, const char *str) { uint16_t klass; klass = htons(ldns_get_rr_class_by_name(str)); /* class is 16 bit */ *rd = ldns_rdf_new_frm_data( LDNS_RDF_TYPE_CLASS, sizeof(uint16_t), &klass); return *rd?LDNS_STATUS_OK:LDNS_STATUS_MEM_ERR; } /* An certificate alg field can either be specified as a 8 bits number * or by its symbolic name. Handle both */ ldns_status ldns_str2rdf_cert_alg(ldns_rdf **rd, const char *str) { ldns_lookup_table *lt; ldns_status st; uint8_t idd[2]; lt = ldns_lookup_by_name(ldns_cert_algorithms, str); st = LDNS_STATUS_OK; if (lt) { ldns_write_uint16(idd, (uint16_t) lt->id); *rd = ldns_rdf_new_frm_data( LDNS_RDF_TYPE_INT16, sizeof(uint16_t), idd); if (!*rd) { st = LDNS_STATUS_ERR; } } else { /* try as-is (a number) */ st = ldns_str2rdf_int16(rd, str); if (st == LDNS_STATUS_OK && ldns_rdf2native_int16(*rd) == 0) { st = LDNS_STATUS_CERT_BAD_ALGORITHM; } } return st; } static ldns_lookup_table ldns_tlsa_certificate_usages[] = { { LDNS_TLSA_USAGE_PKIX_TA , "PKIX-TA" }, { LDNS_TLSA_USAGE_PKIX_EE , "PKIX-EE" }, { LDNS_TLSA_USAGE_DANE_TA , "DANE-TA" }, { LDNS_TLSA_USAGE_DANE_EE , "DANE-EE" }, { LDNS_TLSA_USAGE_PRIVCERT , "PrivCert" }, { 0, NULL } }; static ldns_lookup_table ldns_tlsa_selectors[] = { { LDNS_TLSA_SELECTOR_CERT , "Cert" }, { LDNS_TLSA_SELECTOR_SPKI , "SPKI" }, { LDNS_TLSA_SELECTOR_PRIVSEL , "PrivSel" }, { 0, NULL } }; static ldns_lookup_table ldns_tlsa_matching_types[] = { { LDNS_TLSA_MATCHING_TYPE_FULL , "Full" }, { LDNS_TLSA_MATCHING_TYPE_SHA2_256 , "SHA2-256" }, { LDNS_TLSA_MATCHING_TYPE_SHA2_512 , "SHA2-512" }, { LDNS_TLSA_MATCHING_TYPE_PRIVMATCH , "PrivMatch" }, { 0, NULL } }; static ldns_status ldns_str2rdf_mnemonic4int8(ldns_lookup_table *lt, ldns_rdf **rd, const char *str) { if ((lt = ldns_lookup_by_name(lt, str))) { /* it was given as a integer */ *rd = ldns_native2rdf_int8(LDNS_RDF_TYPE_INT8, (uint8_t) lt->id); if (!*rd) return LDNS_STATUS_ERR; else return LDNS_STATUS_OK; } return ldns_str2rdf_int8(rd, str); } /* An alg field can either be specified as a 8 bits number * or by its symbolic name. Handle both */ ldns_status ldns_str2rdf_alg(ldns_rdf **rd, const char *str) { return ldns_str2rdf_mnemonic4int8(ldns_algorithms, rd, str); } ldns_status ldns_str2rdf_certificate_usage(ldns_rdf **rd, const char *str) { return ldns_str2rdf_mnemonic4int8( ldns_tlsa_certificate_usages, rd, str); } ldns_status ldns_str2rdf_selector(ldns_rdf **rd, const char *str) { return ldns_str2rdf_mnemonic4int8(ldns_tlsa_selectors, rd, str); } ldns_status ldns_str2rdf_matching_type(ldns_rdf **rd, const char *str) { return ldns_str2rdf_mnemonic4int8(ldns_tlsa_matching_types, rd, str); } ldns_status ldns_str2rdf_unknown( ATTR_UNUSED(ldns_rdf **rd) , ATTR_UNUSED(const char *str) ) { /* this should be caught in an earlier time (general str2host for rr's */ return LDNS_STATUS_NOT_IMPL; } ldns_status ldns_str2rdf_service( ATTR_UNUSED(ldns_rdf **rd) , ATTR_UNUSED(const char *str) ) { /* is this used? is this actually WKS? or SRV? */ return LDNS_STATUS_NOT_IMPL; } static int loc_parse_cm(char* my_str, char** endstr, uint8_t* m, uint8_t* e) { /* read [.][mM] */ /* into mantissa exponent format for LOC type */ uint32_t meters = 0, cm = 0, val; while (isblank((unsigned char)*my_str)) { my_str++; } meters = (uint32_t)strtol(my_str, &my_str, 10); if (*my_str == '.') { my_str++; cm = (uint32_t)strtol(my_str, &my_str, 10); } if (meters >= 1) { *e = 2; val = meters; } else { *e = 0; val = cm; } while(val >= 10) { (*e)++; val /= 10; } *m = (uint8_t)val; if (*e > 9) return 0; if (*my_str == 'm' || *my_str == 'M') { my_str++; } *endstr = my_str; return 1; } ldns_status ldns_str2rdf_loc(ldns_rdf **rd, const char *str) { uint32_t latitude = 0; uint32_t longitude = 0; uint32_t altitude = 0; uint8_t *data; uint32_t equator = (uint32_t) ldns_power(2, 31); uint32_t h = 0; uint32_t m = 0; uint8_t size_b = 1, size_e = 2; uint8_t horiz_pre_b = 1, horiz_pre_e = 6; uint8_t vert_pre_b = 1, vert_pre_e = 3; double s = 0.0; bool northerness; bool easterness; char *my_str = (char *) str; /* only support version 0 */ if (isdigit((int) *my_str)) { h = (uint32_t) strtol(my_str, &my_str, 10); } else { return LDNS_STATUS_INVALID_STR; } while (isblank((int) *my_str)) { my_str++; } if (isdigit((int) *my_str)) { m = (uint32_t) strtol(my_str, &my_str, 10); } else if (*my_str == 'N' || *my_str == 'S') { goto north; } else { return LDNS_STATUS_INVALID_STR; } while (isblank((int) *my_str)) { my_str++; } if (isdigit((int) *my_str)) { s = strtod(my_str, &my_str); } north: while (isblank((int) *my_str)) { my_str++; } if (*my_str == 'N') { northerness = true; } else if (*my_str == 'S') { northerness = false; } else { return LDNS_STATUS_INVALID_STR; } my_str++; /* store number */ s = 1000.0 * s; /* add a little to make floor in conversion a round */ s += 0.0005; latitude = (uint32_t) s; latitude += 1000 * 60 * m; latitude += 1000 * 60 * 60 * h; if (northerness) { latitude = equator + latitude; } else { latitude = equator - latitude; } while (isblank((unsigned char)*my_str)) { my_str++; } if (isdigit((int) *my_str)) { h = (uint32_t) strtol(my_str, &my_str, 10); } else { return LDNS_STATUS_INVALID_STR; } while (isblank((int) *my_str)) { my_str++; } if (isdigit((int) *my_str)) { m = (uint32_t) strtol(my_str, &my_str, 10); } else if (*my_str == 'E' || *my_str == 'W') { goto east; } else { return LDNS_STATUS_INVALID_STR; } while (isblank((unsigned char)*my_str)) { my_str++; } if (isdigit((int) *my_str)) { s = strtod(my_str, &my_str); } east: while (isblank((unsigned char)*my_str)) { my_str++; } if (*my_str == 'E') { easterness = true; } else if (*my_str == 'W') { easterness = false; } else { return LDNS_STATUS_INVALID_STR; } my_str++; /* store number */ s *= 1000.0; /* add a little to make floor in conversion a round */ s += 0.0005; longitude = (uint32_t) s; longitude += 1000 * 60 * m; longitude += 1000 * 60 * 60 * h; if (easterness) { longitude += equator; } else { longitude = equator - longitude; } altitude = (uint32_t)(strtod(my_str, &my_str)*100.0 + 10000000.0 + 0.5); if (*my_str == 'm' || *my_str == 'M') { my_str++; } if (strlen(my_str) > 0) { if(!loc_parse_cm(my_str, &my_str, &size_b, &size_e)) return LDNS_STATUS_INVALID_STR; } if (strlen(my_str) > 0) { if(!loc_parse_cm(my_str, &my_str, &horiz_pre_b, &horiz_pre_e)) return LDNS_STATUS_INVALID_STR; } if (strlen(my_str) > 0) { if(!loc_parse_cm(my_str, &my_str, &vert_pre_b, &vert_pre_e)) return LDNS_STATUS_INVALID_STR; } data = LDNS_XMALLOC(uint8_t, 16); if(!data) { return LDNS_STATUS_MEM_ERR; } data[0] = 0; data[1] = 0; data[1] = ((size_b << 4) & 0xf0) | (size_e & 0x0f); data[2] = ((horiz_pre_b << 4) & 0xf0) | (horiz_pre_e & 0x0f); data[3] = ((vert_pre_b << 4) & 0xf0) | (vert_pre_e & 0x0f); ldns_write_uint32(data + 4, latitude); ldns_write_uint32(data + 8, longitude); ldns_write_uint32(data + 12, altitude); *rd = ldns_rdf_new_frm_data( LDNS_RDF_TYPE_LOC, 16, data); LDNS_FREE(data); return *rd?LDNS_STATUS_OK:LDNS_STATUS_MEM_ERR; } ldns_status ldns_str2rdf_wks(ldns_rdf **rd, const char *str) { uint8_t *bitmap = NULL; uint8_t *data; int bm_len = 0; struct protoent *proto = NULL; struct servent *serv = NULL; int serv_port; ldns_buffer *str_buf; char *proto_str = NULL; char *token; if(strlen(str) == 0) token = LDNS_XMALLOC(char, 50); else token = LDNS_XMALLOC(char, strlen(str)+2); if(!token) return LDNS_STATUS_MEM_ERR; str_buf = LDNS_MALLOC(ldns_buffer); if(!str_buf) {LDNS_FREE(token); return LDNS_STATUS_MEM_ERR;} ldns_buffer_new_frm_data(str_buf, (char *)str, strlen(str)); if(ldns_buffer_status(str_buf) != LDNS_STATUS_OK) { LDNS_FREE(str_buf); LDNS_FREE(token); return LDNS_STATUS_MEM_ERR; } while(ldns_bget_token(str_buf, token, "\t\n ", strlen(str)) > 0) { if (!proto_str) { proto_str = strdup(token); if (!proto_str) { LDNS_FREE(bitmap); LDNS_FREE(token); ldns_buffer_free(str_buf); return LDNS_STATUS_INVALID_STR; } } else { serv = getservbyname(token, proto_str); if (serv) { serv_port = (int) ntohs((uint16_t) serv->s_port); } else { serv_port = atoi(token); } if (serv_port / 8 >= bm_len) { uint8_t *b2 = LDNS_XREALLOC(bitmap, uint8_t, (serv_port / 8) + 1); if(!b2) { LDNS_FREE(bitmap); LDNS_FREE(token); ldns_buffer_free(str_buf); free(proto_str); return LDNS_STATUS_INVALID_STR; } bitmap = b2; /* set to zero to be sure */ for (; bm_len <= serv_port / 8; bm_len++) { bitmap[bm_len] = 0; } } ldns_set_bit(bitmap + (serv_port / 8), 7 - (serv_port % 8), true); } } if (!proto_str || !bitmap) { LDNS_FREE(bitmap); LDNS_FREE(token); ldns_buffer_free(str_buf); free(proto_str); return LDNS_STATUS_INVALID_STR; } data = LDNS_XMALLOC(uint8_t, bm_len + 1); if(!data) { LDNS_FREE(token); ldns_buffer_free(str_buf); LDNS_FREE(bitmap); free(proto_str); return LDNS_STATUS_INVALID_STR; } if (proto_str) proto = getprotobyname(proto_str); if (proto) { data[0] = (uint8_t) proto->p_proto; } else if (proto_str) { data[0] = (uint8_t) atoi(proto_str); } memcpy(data + 1, bitmap, (size_t) bm_len); *rd = ldns_rdf_new_frm_data(LDNS_RDF_TYPE_WKS, (uint16_t) (bm_len + 1), data); LDNS_FREE(data); LDNS_FREE(token); ldns_buffer_free(str_buf); LDNS_FREE(bitmap); free(proto_str); #ifdef HAVE_ENDSERVENT endservent(); #endif #ifdef HAVE_ENDPROTOENT endprotoent(); #endif if(!*rd) return LDNS_STATUS_MEM_ERR; return LDNS_STATUS_OK; } ldns_status ldns_str2rdf_nsap(ldns_rdf **rd, const char *str) { size_t len, i; char* nsap_str = (char*) str; /* just a hex string with optional dots? */ if (str[0] != '0' || str[1] != 'x') { return LDNS_STATUS_INVALID_STR; } else { len = strlen(str); for (i=0; i < len; i++) { if (nsap_str[i] == '.') nsap_str[i] = ' '; } return ldns_str2rdf_hex(rd, str+2); } } ldns_status ldns_str2rdf_atma(ldns_rdf **rd, const char *str) { size_t len, i; char* atma_str = (char*) str; ldns_status status; /* just a hex string with optional dots? */ len = strlen(str); for (i=0; i < len; i++) { if (atma_str[i] == '.') atma_str[i] = ' '; } status = ldns_str2rdf_hex(rd, str); if (status != LDNS_STATUS_OK) { ; /* probably in e.164 format than */ } return status; } ldns_status ldns_str2rdf_ipseckey(ldns_rdf **rd, const char *str) { uint8_t precedence = 0; uint8_t gateway_type = 0; uint8_t algorithm = 0; char* gateway = NULL; char* publickey = NULL; uint8_t *data; ldns_buffer *str_buf; char *token; int token_count = 0; int ipseckey_len = 0; ldns_rdf* gateway_rdf = NULL; ldns_rdf* publickey_rdf = NULL; ldns_status status = LDNS_STATUS_OK; if(strlen(str) == 0) token = LDNS_XMALLOC(char, 256); else token = LDNS_XMALLOC(char, strlen(str)+2); if(!token) return LDNS_STATUS_MEM_ERR; str_buf = LDNS_MALLOC(ldns_buffer); if(!str_buf) {LDNS_FREE(token); return LDNS_STATUS_MEM_ERR;} ldns_buffer_new_frm_data(str_buf, (char *)str, strlen(str)); if(ldns_buffer_status(str_buf) != LDNS_STATUS_OK) { LDNS_FREE(str_buf); LDNS_FREE(token); return LDNS_STATUS_MEM_ERR; } while(ldns_bget_token(str_buf, token, "\t\n ", strlen(str)) > 0) { switch (token_count) { case 0: precedence = (uint8_t)atoi(token); break; case 1: gateway_type = (uint8_t)atoi(token); break; case 2: algorithm = (uint8_t)atoi(token); break; case 3: gateway = strdup(token); if (!gateway || (gateway_type == 0 && (token[0] != '.' || token[1] != '\0'))) { LDNS_FREE(gateway); LDNS_FREE(token); ldns_buffer_free(str_buf); return LDNS_STATUS_INVALID_STR; } break; case 4: publickey = strdup(token); break; default: LDNS_FREE(token); ldns_buffer_free(str_buf); return LDNS_STATUS_INVALID_STR; break; } token_count++; } if (!gateway || !publickey) { if (gateway) LDNS_FREE(gateway); if (publickey) LDNS_FREE(publickey); LDNS_FREE(token); ldns_buffer_free(str_buf); return LDNS_STATUS_INVALID_STR; } if (gateway_type == 1) { status = ldns_str2rdf_a(&gateway_rdf, gateway); } else if (gateway_type == 2) { status = ldns_str2rdf_aaaa(&gateway_rdf, gateway); } else if (gateway_type == 3) { status = ldns_str2rdf_dname(&gateway_rdf, gateway); } if (status != LDNS_STATUS_OK) { if (gateway) LDNS_FREE(gateway); if (publickey) LDNS_FREE(publickey); LDNS_FREE(token); ldns_buffer_free(str_buf); return LDNS_STATUS_INVALID_STR; } status = ldns_str2rdf_b64(&publickey_rdf, publickey); if (status != LDNS_STATUS_OK) { if (gateway) LDNS_FREE(gateway); if (publickey) LDNS_FREE(publickey); LDNS_FREE(token); ldns_buffer_free(str_buf); if (gateway_rdf) ldns_rdf_free(gateway_rdf); return LDNS_STATUS_INVALID_STR; } /* now copy all into one ipseckey rdf */ if (gateway_type) ipseckey_len = 3 + (int)ldns_rdf_size(gateway_rdf) + (int)ldns_rdf_size(publickey_rdf); else ipseckey_len = 3 + (int)ldns_rdf_size(publickey_rdf); data = LDNS_XMALLOC(uint8_t, ipseckey_len); if(!data) { if (gateway) LDNS_FREE(gateway); if (publickey) LDNS_FREE(publickey); LDNS_FREE(token); ldns_buffer_free(str_buf); if (gateway_rdf) ldns_rdf_free(gateway_rdf); if (publickey_rdf) ldns_rdf_free(publickey_rdf); return LDNS_STATUS_MEM_ERR; } data[0] = precedence; data[1] = gateway_type; data[2] = algorithm; if (gateway_type) { memcpy(data + 3, ldns_rdf_data(gateway_rdf), ldns_rdf_size(gateway_rdf)); memcpy(data + 3 + ldns_rdf_size(gateway_rdf), ldns_rdf_data(publickey_rdf), ldns_rdf_size(publickey_rdf)); } else { memcpy(data + 3, ldns_rdf_data(publickey_rdf), ldns_rdf_size(publickey_rdf)); } *rd = ldns_rdf_new_frm_data(LDNS_RDF_TYPE_IPSECKEY, (uint16_t) ipseckey_len, data); if (gateway) LDNS_FREE(gateway); if (publickey) LDNS_FREE(publickey); LDNS_FREE(token); ldns_buffer_free(str_buf); ldns_rdf_free(gateway_rdf); ldns_rdf_free(publickey_rdf); LDNS_FREE(data); if(!*rd) return LDNS_STATUS_MEM_ERR; return LDNS_STATUS_OK; } ldns_status ldns_str2rdf_ilnp64(ldns_rdf **rd, const char *str) { unsigned int a, b, c, d; uint16_t shorts[4]; int l; if (sscanf(str, "%4x:%4x:%4x:%4x%n", &a, &b, &c, &d, &l) != 4 || l != (int)strlen(str) || /* more data to read */ strpbrk(str, "+-") /* signed hexes */ ) { return LDNS_STATUS_INVALID_ILNP64; } else { shorts[0] = htons(a); shorts[1] = htons(b); shorts[2] = htons(c); shorts[3] = htons(d); *rd = ldns_rdf_new_frm_data( LDNS_RDF_TYPE_ILNP64, 4 * sizeof(uint16_t), &shorts); } return *rd ? LDNS_STATUS_OK : LDNS_STATUS_MEM_ERR; } ldns_status ldns_str2rdf_eui48(ldns_rdf **rd, const char *str) { unsigned int a, b, c, d, e, f; uint8_t bytes[6]; int l; if (sscanf(str, "%2x-%2x-%2x-%2x-%2x-%2x%n", &a, &b, &c, &d, &e, &f, &l) != 6 || l != (int)strlen(str)) { return LDNS_STATUS_INVALID_EUI48; } else { bytes[0] = a; bytes[1] = b; bytes[2] = c; bytes[3] = d; bytes[4] = e; bytes[5] = f; *rd = ldns_rdf_new_frm_data(LDNS_RDF_TYPE_EUI48, 6, &bytes); } return *rd ? LDNS_STATUS_OK : LDNS_STATUS_MEM_ERR; } ldns_status ldns_str2rdf_eui64(ldns_rdf **rd, const char *str) { unsigned int a, b, c, d, e, f, g, h; uint8_t bytes[8]; int l; if (sscanf(str, "%2x-%2x-%2x-%2x-%2x-%2x-%2x-%2x%n", &a, &b, &c, &d, &e, &f, &g, &h, &l) != 8 || l != (int)strlen(str)) { return LDNS_STATUS_INVALID_EUI64; } else { bytes[0] = a; bytes[1] = b; bytes[2] = c; bytes[3] = d; bytes[4] = e; bytes[5] = f; bytes[6] = g; bytes[7] = h; *rd = ldns_rdf_new_frm_data(LDNS_RDF_TYPE_EUI64, 8, &bytes); } return *rd ? LDNS_STATUS_OK : LDNS_STATUS_MEM_ERR; } ldns_status ldns_str2rdf_tag(ldns_rdf **rd, const char *str) { uint8_t *data; const char* ptr; if (strlen(str) > 255) { return LDNS_STATUS_INVALID_TAG; } for (ptr = str; *ptr; ptr++) { if (! isalnum((unsigned char)*ptr)) { return LDNS_STATUS_INVALID_TAG; } } data = LDNS_XMALLOC(uint8_t, strlen(str) + 1); if (!data) { return LDNS_STATUS_MEM_ERR; } data[0] = strlen(str); memcpy(data + 1, str, strlen(str)); *rd = ldns_rdf_new(LDNS_RDF_TYPE_TAG, strlen(str) + 1, data); if (!*rd) { LDNS_FREE(data); return LDNS_STATUS_MEM_ERR; } return LDNS_STATUS_OK; } ldns_status ldns_str2rdf_long_str(ldns_rdf **rd, const char *str) { uint8_t *data, *dp, ch = 0; size_t length; /* Worst case space requirement. We'll realloc to actual size later. */ dp = data = LDNS_XMALLOC(uint8_t, strlen(str)); if (! data) { return LDNS_STATUS_MEM_ERR; } /* Fill data with parsed bytes */ while (parse_char(&ch, &str)) { *dp++ = ch; if (dp - data > LDNS_MAX_RDFLEN) { LDNS_FREE(data); return LDNS_STATUS_INVALID_STR; } } if (! str) { return LDNS_STATUS_SYNTAX_BAD_ESCAPE; } length = (size_t)(dp - data); /* Lose the overmeasure */ data = LDNS_XREALLOC(dp = data, uint8_t, length); if (! data) { LDNS_FREE(dp); return LDNS_STATUS_MEM_ERR; } /* Create rdf */ *rd = ldns_rdf_new(LDNS_RDF_TYPE_LONG_STR, length, data); if (! *rd) { LDNS_FREE(data); return LDNS_STATUS_MEM_ERR; } return LDNS_STATUS_OK; } ldns_status ldns_str2rdf_hip(ldns_rdf **rd, const char *str) { const char *hit = strchr(str, ' ') + 1; const char *pk = hit == NULL ? NULL : strchr(hit, ' ') + 1; size_t hit_size = hit == NULL ? 0 : pk == NULL ? strlen(hit) : (size_t) (pk - hit) - 1; size_t pk_size = pk == NULL ? 0 : strlen(pk); size_t hit_wire_size = (hit_size + 1) / 2; size_t pk_wire_size = ldns_b64_pton_calculate_size(pk_size); size_t rdf_size = 4 + hit_wire_size + pk_wire_size; char *endptr; /* utility var for strtol usage */ int algorithm = strtol(str, &endptr, 10); uint8_t *data, *dp; int hi, lo, written; if (hit_size == 0 || pk_size == 0 || (hit_size + 1) / 2 > 255 || rdf_size > LDNS_MAX_RDFLEN || algorithm < 0 || algorithm > 255 || (errno != 0 && algorithm == 0) /* out of range */ || endptr == str /* no digits */) { return LDNS_STATUS_SYNTAX_ERR; } if ((data = LDNS_XMALLOC(uint8_t, rdf_size)) == NULL) { return LDNS_STATUS_MEM_ERR; } /* From RFC 5205 section 5. HIP RR Storage Format: ************************************************* 0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | HIT length | PK algorithm | PK length | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | ~ HIT ~ | | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | | +-+-+-+-+-+-+-+-+-+-+-+ + | Public Key | ~ ~ | | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | | ~ Rendezvous Servers ~ | | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | +-+-+-+-+-+-+-+ */ data[0] = (uint8_t) hit_wire_size; data[1] = (uint8_t) algorithm; for (dp = data + 4; *hit && *hit != ' '; dp++) { if ((hi = ldns_hexdigit_to_int(*hit++)) == -1 || (lo = ldns_hexdigit_to_int(*hit++)) == -1) { LDNS_FREE(data); return LDNS_STATUS_INVALID_HEX; } *dp = (uint8_t) hi << 4 | lo; } if ((written = ldns_b64_pton(pk, dp, pk_wire_size)) <= 0) { LDNS_FREE(data); return LDNS_STATUS_INVALID_B64; } /* Because ldns_b64_pton_calculate_size isn't always correct: * (we have to fix it at some point) */ pk_wire_size = (uint16_t) written; ldns_write_uint16(data + 2, pk_wire_size); rdf_size = 4 + hit_wire_size + pk_wire_size; /* Create rdf */ if (! (*rd = ldns_rdf_new(LDNS_RDF_TYPE_HIP, rdf_size, data))) { LDNS_FREE(data); return LDNS_STATUS_MEM_ERR; } return LDNS_STATUS_OK; } ldns-1.7.0/LICENSE0000644000175000017500000000274613026206166013043 0ustar willemwillemCopyright (c) 2005,2006, NLnetLabs All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * 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. * Neither the name of NLnetLabs 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 COPYRIGHT HOLDERS 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 COPYRIGHT OWNER 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. ldns-1.7.0/configure.ac0000644000175000017500000007715213026206166014327 0ustar willemwillem# -*- Autoconf -*- # Process this file with autoconf to produce a configure script. AC_PREREQ(2.56) sinclude(acx_nlnetlabs.m4) # must be numbers. ac_defun because of later processing. m4_define([VERSION_MAJOR],[1]) m4_define([VERSION_MINOR],[7]) m4_define([VERSION_MICRO],[0]) AC_INIT(ldns, m4_defn([VERSION_MAJOR]).m4_defn([VERSION_MINOR]).m4_defn([VERSION_MICRO]), libdns@nlnetlabs.nl, libdns) AC_CONFIG_SRCDIR([packet.c]) # needed to build correct soname AC_SUBST(LDNS_VERSION_MAJOR, [VERSION_MAJOR]) AC_SUBST(LDNS_VERSION_MINOR, [VERSION_MINOR]) AC_SUBST(LDNS_VERSION_MICRO, [VERSION_MICRO]) # Library version # --------------- # current:revision:age # (binary-api-number):(which-binary-api-version):(how-many-nrs-backwardscompat) # if source code changes increment revision # if any interfaces have been added/removed/changed since last update then # increment current and set revision to 0 # if any interfaces have been added since the last public release then increment age # if any interfaces have been removed or changed since the last public release then # set age to 0 # # ldns-1.6.17 and before had a .so with version same as VERSION_INFO # ldns-1.7.0 will have libversion 2:0:0 # AC_SUBST(VERSION_INFO, [2:0:0]) AC_AIX if test "$ac_cv_header_minix_config_h" = "yes"; then AC_DEFINE(_NETBSD_SOURCE,1, [Enable for compile on Minix]) fi LT_INIT AC_CONFIG_MACRO_DIR([m4]) OURCPPFLAGS='' CPPFLAGS=${CPPFLAGS:-${OURCPPFLAGS}} CFLAGS="$CFLAGS" # Checks for programs. AC_PROG_CC ACX_DEPFLAG AC_PROG_MAKE_SET # Extra (sp)lint flags for NetBSD AC_CANONICAL_HOST case "$host_os" in netbsd*) LINTFLAGS="'-D__RENAME(x)=' -D_NETINET_IN_H_ $LINTFLAGS" ;; *) LINTFLAGS="$LINTFLAGS" ;; esac AC_SUBST(LINTFLAGS) AC_DEFINE(WINVER, 0x0502, [the version of the windows API enabled]) ACX_CHECK_COMPILER_FLAG(std=c99, [C99FLAG="-std=c99"]) ACX_CHECK_COMPILER_FLAG(xc99, [C99FLAG="-xc99"]) # routine to copy files # argument 1 is a list of files (relative to the source dir) # argument 2 is a destination directory (relative to the current # working directory AC_DEFUN([COPY_FILES], [ for file in $1; do sh $srcdir/install-sh -m 644 $file $2 done ]) # copy all .h files in the dir at argument 1 # (relative to source) to the dir at argument 2 # (relative to current dir) AC_DEFUN([COPY_HEADER_FILES], [ echo "copying header files" COPY_FILES($srcdir/$1/*.h, $2) ]) # Checks for typedefs, structures, and compiler characteristics. AC_C_CONST AC_LANG_C if test "x$CFLAGS" = "x" ; then ACX_CHECK_COMPILER_FLAG(g, [CFLAGS="-g"]) ACX_CHECK_COMPILER_FLAG(O2, [CFLAGS="-O2 $CFLAGS"]) fi ACX_CHECK_COMPILER_FLAG(Wall, [CFLAGS="-Wall $CFLAGS"]) ACX_CHECK_COMPILER_FLAG(W, [CFLAGS="-W $CFLAGS"]) ACX_CHECK_COMPILER_FLAG(Wwrite-strings, [CFLAGS="-Wwrite-strings $CFLAGS"]) ACX_CHECK_COMPILER_FLAG(Wstrict-prototypes, [CFLAGS="-Wstrict-prototypes $CFLAGS"]) #ACX_CHECK_COMPILER_FLAG(Wshadow, [CFLAGS="-Wshadow $CFLAGS"]) ACX_CHECK_COMPILER_FLAG(Wunused-function, [CFLAGS="-Wunused-function $CFLAGS"]) ACX_CHECK_COMPILER_FLAG(Wmissing-prototypes, [CFLAGS="-Wmissing-prototypes $CFLAGS"]) AC_CHECK_HEADERS([getopt.h time.h],,, [AC_INCLUDES_DEFAULT]) # MinGW32 tests AC_CHECK_HEADERS([winsock2.h ws2tcpip.h],,, [AC_INCLUDES_DEFAULT]) # end mingw32 tests ACX_DETERMINE_EXT_FLAGS_UNBOUND AC_C_INLINE AC_CHECK_TYPE(int8_t, char) AC_CHECK_TYPE(int16_t, short) AC_CHECK_TYPE(int32_t, int) AC_CHECK_TYPE(int64_t, long long) AC_CHECK_TYPE(uint8_t, unsigned char) AC_CHECK_TYPE(uint16_t, unsigned short) AC_CHECK_TYPE(uint32_t, unsigned int) AC_CHECK_TYPE(uint64_t, unsigned long long) # my own checks AC_CHECK_PROG(doxygen, doxygen, doxygen) # check to see if libraries are needed for these functions. AC_SEARCH_LIBS([socket], [socket]) AC_SEARCH_LIBS([inet_pton], [nsl]) AC_ARG_WITH(drill, AC_HELP_STRING([--with-drill], [Also build drill.]), [],[with_drill="no"]) if test x_$with_drill != x_no ; then AC_SUBST(DRILL,[drill]) AC_SUBST(INSTALL_DRILL,[install-drill]) AC_SUBST(UNINSTALL_DRILL,[uninstall-drill]) AC_SUBST(CLEAN_DRILL,[clean-drill]) AC_SUBST(LINT_DRILL,[lint-drill]) if test -e $srcdir/drill/config.h -o -e drill/config.h ; then AC_MSG_ERROR([ A config.h was detected in the drill subdirectory. This does not work with the --with-drill option. Please remove the config.h from the drill subdirectory or do not use the --with-drill option.]) fi else AC_SUBST(DRILL,[""]) AC_SUBST(INSTALL_DRILL,[""]) AC_SUBST(UNINSTALL_DRILL,[""]) AC_SUBST(CLEAN_DRILL,[""]) AC_SUBST(LINT_DRILL,[""]) fi AC_ARG_WITH(examples, AC_HELP_STRING([--with-examples], [Also build examples.]), [],[with_examples="no"]) if test x_$with_examples != x_no ; then AC_SUBST(EXAMPLES,[examples]) AC_SUBST(INSTALL_EXAMPLES,[install-examples]) AC_SUBST(UNINSTALL_EXAMPLES,[uninstall-examples]) AC_SUBST(CLEAN_EXAMPLES,[clean-examples]) AC_SUBST(LINT_EXAMPLES,[lint-examples]) if test -e $srcdir/examples/config.h -o -e examples/config.h ; then AC_MSG_ERROR([ A config.h was detected in the examples subdirectory. This does not work with the --with-examples option. Please remove the config.h from the examples subdirectory or do not use the --with-examples option.]) fi else AC_SUBST(EXAMPLES,[""]) AC_SUBST(INSTALL_EXAMPLES,[""]) AC_SUBST(UNINSTALL_EXAMPLES,[""]) AC_SUBST(CLEAN_EXAMPLES,[""]) AC_SUBST(LINT_EXAMPLES,[""]) fi # add option to disable installation of ldns-config script AC_ARG_ENABLE(ldns-config, AC_HELP_STRING([--disable-ldns-config], [disable installation of ldns-config (default=enabled)]), enable_ldns_config=$enableval, enable_ldns_config=yes) if test "x$enable_ldns_config" = xyes; then AC_SUBST(INSTALL_CONFIG, [install-config]) AC_SUBST(INSTALL_CONFIG_MANPAGE, [install-config-manpage]) AC_SUBST(UNINSTALL_CONFIG, [uninstall-config]) AC_SUBST(UNINSTALL_CONFIG_MANPAGE, [uninstall-config-manpage]) else AC_SUBST(INSTALL_CONFIG, [""]) AC_SUBST(INSTALL_CONFIG_MANPAGE, [""]) AC_SUBST(UNINSTALL_CONFIG, [""]) AC_SUBST(UNINSTALL_CONFIG_MANPAGE, [""]) fi # add option to disable library printing to stderr AC_ARG_ENABLE(stderr-msgs, AC_HELP_STRING([--enable-stderr-msgs], [Enable printing to stderr (default=disabled)]), enable_stderr_msgs=$enableval, enable_stderr_msgs=no) case "$enable_stderr_msgs" in no) dnl default ;; *) AC_DEFINE_UNQUOTED([STDERR_MSGS], [1], [Define this to enable messages to stderr.]) ;; esac AX_HAVE_POLL( [AX_CONFIG_FEATURE_ENABLE(poll)], [AX_CONFIG_FEATURE_DISABLE(poll)]) AX_CONFIG_FEATURE( [poll], [This platform supports poll(7)], [HAVE_POLL], [This platform supports poll(7).]) # check for python PYTHON_X_CFLAGS="" ldns_with_pyldns=no ldns_with_pyldnsx=no AC_ARG_WITH(pyldns, AC_HELP_STRING([--with-pyldns], [generate python library, or --without-pyldns to disable Python support.]), [],[ withval="no" ]) ldns_have_python=no if test x_$withval != x_no; then sinclude(ax_python_devel.m4) ac_save_LIBS="$LIBS" dnl otherwise AC_PYTHON_DEVEL thrashes $LIBS AX_PYTHON_DEVEL([>= '2.4.0']) if test ! -z "$ac_python_version"; then ldns_have_python=yes fi # pass additional Python 3 option to SWIG if test `$PYTHON -c "import sys; \ ver = sys.version.split()[[0]]; \ print(ver >= '3')"` = "True"; then AC_SUBST(SWIGPY3, ["-py3 -DPY3"]) fi # check for SWIG if test x_$ldns_have_python != x_no; then sinclude(ax_pkg_swig.m4) # check for >=SWIG-2.0.4 if Python 3.2 used if test `$PYTHON -c "import sys; \ ver = sys.version.split()[[0]]; \ print(ver >= '3.2')"` = "True"; then AX_PKG_SWIG(2.0.4, [], [AC_MSG_ERROR([SWIG-2.0.4 is required to build pyldns for Python 3.2 and greater.])]) else AX_PKG_SWIG fi if test ! -x "$SWIG"; then AC_MSG_ERROR([failed to find SWIG tool, install it, or do not build pyldns]) else AC_DEFINE(HAVE_SWIG,1,[Define if you have SWIG libraries and header files.]) AC_SUBST(PYLDNS, "pyldns") AC_SUBST(swig, "$SWIG") ldns_with_pyldns=yes fi else AC_MSG_RESULT([*** don't have Python, skipping SWIG, no pyldns ***]) # ' fi # xtra cflags for pyldns if test x_$ldns_have_python != x_no; then ACX_CHECK_COMPILER_FLAG(fno-strict-aliasing, [PYTHON_X_CFLAGS="-fno-strict-aliasing"]) ACX_CHECK_COMPILER_FLAG(Wno-missing-field-initializers, [PYTHON_X_CFLAGS="-Wno-missing-field-initializers $PYTHON_X_CFLAGS"]) ACX_CHECK_COMPILER_FLAG(Wno-unused-parameter, [PYTHON_X_CFLAGS="-Wno-unused-parameter $PYTHON_X_CFLAGS"]) ACX_CHECK_COMPILER_FLAG(Wno-unused-variable, [PYTHON_X_CFLAGS="-Wno-unused-variable $PYTHON_X_CFLAGS"]) fi fi AC_SUBST(PYTHON_X_CFLAGS) # Check for pyldnsx AC_ARG_WITH(pyldnsx, AC_HELP_STRING([--without-pyldnsx], [Do not install the ldnsx python module, or --with-pyldnsx to install it.]), [],[ withval="with_pyldns" ]) if test x_$withval != x_no; then if test x_$ldns_with_pyldns != x_no; then AC_SUBST(PYLDNSX, "pyldnsx") ldns_with_pyldnsx=yes else if test x_$withval != x_with_pyldns; then AC_MSG_ERROR([--with-pyldns is needed for the ldnsx python module]) fi fi fi if test x_$ldns_with_pyldns != x_no; then AC_SUBST(PYLDNSINST, "install-pyldns")dnl AC_SUBST(PYLDNSUNINST, "uninstall-pyldns") else AC_SUBST(PYLDNSINST, "")dnl AC_SUBST(PYLDNSUNINST, "") fi if test x_$ldns_with_pyldnsx != x_no; then AC_SUBST(PYLDNSXINST, "install-pyldnsx")dnl AC_SUBST(PYLDNSXUNINST, "uninstall-pyldnsx") else AC_SUBST(PYLDNSXINST, "")dnl AC_SUBST(PYLDNSXUNINST, "") fi # check for perl ldns_with_p5_dns_ldns=no AC_ARG_WITH(p5-dns-ldns, AC_HELP_STRING([--with-p5-dns-ldns], [generate DNS::LDNS perl bindings]), [],[ withval="no" ]) ldns_have_perl=no if test x_$withval != x_no; then AC_PATH_PROG([PERL], [perl]) if test -z "$PERL"; then AC_MSG_ERROR([Cannot find perl in your system path]) fi AC_SUBST(P5_DNS_LDNS, "p5-dns-ldns")dnl AC_SUBST(TEST_P5_DNS_LDNS, "test-p5-dns-ldns")dnl AC_SUBST(INSTALL_P5_DNS_LDNS, "install-p5-dns-ldns")dnl AC_SUBST(UNINSTALL_P5_DNS_LDNS, "uninstall-p5-dns-ldns")dnl AC_SUBST(CLEAN_P5_DNS_LDNS, "clean-p5-dns-ldns") else AC_SUBST(P5_DNS_LDNS, "")dnl AC_SUBST(TEST_P5_DNS_LDNS, "")dnl AC_SUBST(INSTALL_P5_DNS_LDNS, "")dnl AC_SUBST(UNINSTALL_P5_DNS_LDNS, "")dnl AC_SUBST(CLEAN_P5_DNS_LDNS, "") fi # Use libtool ACX_LIBTOOL_C_ONLY tmp_CPPFLAGS=$CPPFLAGS tmp_LDFLAGS=$LDFLAGS tmp_LIBS=$LIBS ACX_WITH_SSL_OPTIONAL AC_MSG_CHECKING([for LibreSSL]) if grep VERSION_TEXT $ssldir/include/openssl/opensslv.h | grep "LibreSSL" >/dev/null; then AC_MSG_RESULT([yes]) AC_DEFINE([HAVE_LIBRESSL], [1], [Define if we have LibreSSL]) else AC_MSG_RESULT([no]) fi AC_CHECK_FUNCS([EVP_sha256 EVP_sha384 EVP_sha512 ENGINE_load_cryptodev EVP_PKEY_keygen ECDSA_SIG_get0 EVP_MD_CTX_new EVP_PKEY_base_id DSA_SIG_set0 DSA_SIG_get0 EVP_dss1 DSA_get0_pqg DSA_get0_key]) # for macosx, see if glibtool exists and use that # BSD's need to know the version... #AC_CHECK_PROG(glibtool, glibtool, [glibtool], ) #AC_CHECK_PROGS(libtool, [libtool15 libtool], [./libtool]) AC_ARG_ENABLE(sha2, AC_HELP_STRING([--disable-sha2], [Disable SHA256 and SHA512 RRSIG support])) case "$enable_sha2" in no) ;; yes|*) if test "x$HAVE_SSL" != "xyes"; then AC_MSG_ERROR([SHA2 enabled, but no SSL support]) fi AC_MSG_CHECKING(for SHA256 and SHA512) AC_CHECK_FUNC(SHA256_Init, [], [ AC_MSG_ERROR([No SHA2 functions found in OpenSSL: please upgrade OpenSSL or rerun with --disable-sha2]) ]) AC_DEFINE_UNQUOTED([USE_SHA2], [1], [Define this to enable SHA256 and SHA512 support.]) ;; esac # check wether gost also works AC_DEFUN([AC_CHECK_GOST_WORKS], [AC_REQUIRE([AC_PROG_CC]) AC_MSG_CHECKING([if GOST works]) if test c${cross_compiling} = cno; then BAKCFLAGS="$CFLAGS" if test -n "$ssldir"; then CFLAGS="$CFLAGS -Wl,-rpath,$ssldir/lib" fi AC_RUN_IFELSE([AC_LANG_SOURCE([[ #include #include #include #include #include /* routine to load gost (from sldns) */ int load_gost_id(void) { static int gost_id = 0; const EVP_PKEY_ASN1_METHOD* meth; ENGINE* e; if(gost_id) return gost_id; /* see if configuration loaded gost implementation from other engine*/ meth = EVP_PKEY_asn1_find_str(NULL, "gost2001", -1); if(meth) { EVP_PKEY_asn1_get0_info(&gost_id, NULL, NULL, NULL, NULL, meth); return gost_id; } /* see if engine can be loaded already */ e = ENGINE_by_id("gost"); if(!e) { /* load it ourself, in case statically linked */ ENGINE_load_builtin_engines(); ENGINE_load_dynamic(); e = ENGINE_by_id("gost"); } if(!e) { /* no gost engine in openssl */ return 0; } if(!ENGINE_set_default(e, ENGINE_METHOD_ALL)) { ENGINE_finish(e); ENGINE_free(e); return 0; } meth = EVP_PKEY_asn1_find_str(&e, "gost2001", -1); if(!meth) { /* algo not found */ ENGINE_finish(e); ENGINE_free(e); return 0; } EVP_PKEY_asn1_get0_info(&gost_id, NULL, NULL, NULL, NULL, meth); return gost_id; } int main(void) { EVP_MD_CTX* ctx; const EVP_MD* md; unsigned char digest[64]; /* its a 256-bit digest, so uses 32 bytes */ const char* str = "Hello world"; const unsigned char check[] = { 0x40 , 0xed , 0xf8 , 0x56 , 0x5a , 0xc5 , 0x36 , 0xe1 , 0x33 , 0x7c , 0x7e , 0x87 , 0x62 , 0x1c , 0x42 , 0xe0 , 0x17 , 0x1b , 0x5e , 0xce , 0xa8 , 0x46 , 0x65 , 0x4d , 0x8d , 0x3e , 0x22 , 0x9b , 0xe1 , 0x30 , 0x19 , 0x9d }; OPENSSL_config(NULL); (void)load_gost_id(); md = EVP_get_digestbyname("md_gost94"); if(!md) return 1; memset(digest, 0, sizeof(digest)); ctx = EVP_MD_CTX_create(); if(!ctx) return 2; if(!EVP_DigestInit_ex(ctx, md, NULL)) return 3; if(!EVP_DigestUpdate(ctx, str, 10)) return 4; if(!EVP_DigestFinal_ex(ctx, digest, NULL)) return 5; /* uncomment to see the hash calculated. {int i; for(i=0; i<32; i++) printf(" %2.2x", (int)digest[i]); printf("\n");} */ if(memcmp(digest, check, sizeof(check)) != 0) return 6; return 0; } ]])] , [eval "ac_cv_c_gost_works=yes"], [eval "ac_cv_c_gost_works=no"]) CFLAGS="$BAKCFLAGS" else eval "ac_cv_c_gost_works=maybe" fi ])dnl AC_ARG_ENABLE(gost, AC_HELP_STRING([--disable-gost], [Disable GOST support])) case "$enable_gost" in no) ;; *) dnl default if test "x$HAVE_SSL" != "xyes"; then AC_MSG_ERROR([GOST enabled, but no SSL support]) fi AC_MSG_CHECKING(for GOST) AC_CHECK_FUNC(EVP_PKEY_set_type_str, [],[AC_MSG_ERROR([OpenSSL >= 1.0.0 is needed for GOST support or rerun with --disable-gost])]) AC_CHECK_FUNC(EC_KEY_new, [], [AC_MSG_ERROR([No ECC functions found in OpenSSL: please upgrade OpenSSL or rerun with --disable-gost])]) AC_CHECK_GOST_WORKS AC_ARG_ENABLE(gost-anyway, AC_HELP_STRING([--enable-gost-anyway], [Enable GOST even whithout a GOST engine installed])) if test "$ac_cv_c_gost_works" != "no" -o "$enable_gost_anyway" = "yes"; then if test "$ac_cv_c_gost_works" = "no"; then AC_MSG_RESULT([no, but compiling with GOST support anyway]) else AC_MSG_RESULT([yes]) fi use_gost="yes" AC_DEFINE([USE_GOST], [1], [Define this to enable GOST support.]) else AC_MSG_RESULT([no]) AC_MSG_WARN([Gost support does not work because the engine is missing.]) AC_MSG_WARN([Install gost-engine first or use the --enable-gost-anyway to compile with GOST support anyway]) AC_MSG_WARN([See also https://github.com/gost-engine/engine/wiki for information about gost-engine]) fi ;; esac AC_ARG_ENABLE(ecdsa, AC_HELP_STRING([--disable-ecdsa], [Disable ECDSA support])) case "$enable_ecdsa" in no) ;; *) dnl default if test "x$HAVE_SSL" != "xyes"; then AC_MSG_ERROR([ECDSA enabled, but no SSL support]) fi AC_CHECK_FUNC(ECDSA_sign, [], [AC_MSG_ERROR([OpenSSL does not support ECDSA: please upgrade OpenSSL or rerun with --disable-ecdsa])]) AC_CHECK_FUNC(SHA384_Init, [], [AC_MSG_ERROR([OpenSSL does not support SHA384: please upgrade OpenSSL or rerun with --disable-ecdsa])]) AC_CHECK_DECLS([NID_X9_62_prime256v1, NID_secp384r1], [], [AC_MSG_ERROR([OpenSSL does not support the ECDSA curves: please upgrade OpenSSL or rerun with --disable-ecdsa])], [AC_INCLUDES_DEFAULT #include ]) # we now know we have ECDSA and the required curves. AC_DEFINE_UNQUOTED([USE_ECDSA], [1], [Define this to enable ECDSA support.]) ;; esac AC_ARG_ENABLE(dsa, AC_HELP_STRING([--disable-dsa], [Disable DSA support])) case "$enable_dsa" in no) ;; *) dnl default # detect if DSA is supported, and turn it off if not. AC_CHECK_FUNC(DSA_SIG_new, [ AC_DEFINE_UNQUOTED([USE_DSA], [1], [Define this to enable DSA support.]) ], [if test "x$enable_dsa" = "xyes"; then AC_MSG_ERROR([OpenSSL does not support DSA and you used --enable-dsa.]) fi ]) ;; esac AC_ARG_ENABLE(ed25519, AC_HELP_STRING([--enable-ed25519], [Enable ED25519 support (experimental)])) case "$enable_ed25519" in yes) if test "x$HAVE_SSL" != "xyes"; then AC_MSG_ERROR([ED25519 enabled, but no SSL support]) fi AC_CHECK_DECLS([NID_X25519], [], [AC_MSG_ERROR([OpenSSL does not support the EDDSA curve: please upgrade OpenSSL or rerun with --disable-ed25519])], [AC_INCLUDES_DEFAULT #include ]) AC_DEFINE_UNQUOTED([USE_ED25519], [1], [Define this to enable ED25519 support.]) ;; *|no) dnl default ;; esac AC_ARG_ENABLE(ed448, AC_HELP_STRING([--enable-ed448], [Enable ED448 support (experimental)])) case "$enable_ed448" in yes) if test "x$HAVE_SSL" != "xyes"; then AC_MSG_ERROR([ED448 enabled, but no SSL support]) fi AC_CHECK_DECLS([NID_X448], [], [AC_MSG_ERROR([OpenSSL does not support the EDDSA curve: please upgrade OpenSSL or rerun with --disable-ed448])], [AC_INCLUDES_DEFAULT #include ]) AC_DEFINE_UNQUOTED([USE_ED448], [1], [Define this to enable ED448 support.]) ;; *|no) dnl default ;; esac AC_ARG_ENABLE(dane, AC_HELP_STRING([--disable-dane], [Disable DANE support])) AC_ARG_ENABLE(dane-verify, AC_HELP_STRING([--disable-dane-verify], [Disable DANE verify support])) AC_ARG_ENABLE(dane-ta-usage, AC_HELP_STRING([--disable-dane-ta-usage], [Disable DANE-TA usage type support])) AC_ARG_ENABLE(full-dane,, [ enable_dane_ta_usage=yes enable_dane_verify=yes enable_dane=yes ]) AC_ARG_ENABLE(no-dane-ta-usage,, [ enable_dane_ta_usage=no enable_dane_verify=yes enable_dane=yes ]) AC_ARG_ENABLE(no-dane-verify,, [ enable_dane_ta_usage=no enable_dane_verify=no enable_dane=yes ]) case "$enable_dane" in no) AC_SUBST(ldns_build_config_use_dane, 0) AC_SUBST(ldns_build_config_use_dane_verify, 0) AC_SUBST(ldns_build_config_use_dane_ta_usage, 0) ;; *) dnl default if test "x$HAVE_SSL" != "xyes"; then AC_MSG_ERROR([DANE enabled, but no SSL support]) fi AC_CHECK_FUNC(X509_check_ca, [], [AC_MSG_ERROR([OpenSSL does not support DANE: please upgrade OpenSSL or rerun with --disable-dane])]) AC_SUBST(ldns_build_config_use_dane, 1) AC_DEFINE_UNQUOTED([USE_DANE], [1], [Define this to enable DANE support.]) case "$enable_dane_verify" in no) AC_SUBST(ldns_build_config_use_dane_verify, 0) AC_SUBST(ldns_build_config_use_dane_ta_usage, 0) ;; *) AC_SUBST(ldns_build_config_use_dane_verify, 1) AC_DEFINE_UNQUOTED([USE_DANE_VERIFY], [1], [Define this to enable DANE verify support.]) case "$enable_dane_ta_usage" in no) AC_SUBST(ldns_build_config_use_dane_ta_usage, 0) ;; *) dnl default LIBS="-lssl $LIBS" AC_CHECK_FUNC(SSL_get0_dane, [], [AC_MSG_ERROR([OpenSSL does not support offline DANE verification (Needed for the DANE-TA usage type). Please upgrade OpenSSL to version >= 1.1.0 or rerun with --disable-dane-verify or --disable-dane-ta-usage])]) LIBSSL_LIBS="$LIBSSL_LIBS -lssl" AC_SUBST(ldns_build_config_use_dane_ta_usage, 1) AC_DEFINE_UNQUOTED([USE_DANE_TA_USAGE], [1], [Define this to enable DANE-TA usage type support.]) ;; esac esac ;; esac AC_ARG_ENABLE(rrtype-ninfo, AC_HELP_STRING([--enable-rrtype-ninfo], [Enable draft RR type ninfo.])) case "$enable_rrtype_ninfo" in yes) AC_DEFINE_UNQUOTED([RRTYPE_NINFO], [], [Define this to enable RR type NINFO.]) ;; no|*) ;; esac AC_ARG_ENABLE(rrtype-rkey, AC_HELP_STRING([--enable-rrtype-rkey], [Enable draft RR type rkey.])) case "$enable_rrtype_rkey" in yes) AC_DEFINE_UNQUOTED([RRTYPE_RKEY], [], [Define this to enable RR type RKEY.]) ;; no|*) ;; esac AC_ARG_ENABLE(rrtype-openpgpkey, AC_HELP_STRING([--disable-rrtype-openpgpkey], [Disable openpgpkey RR type.])) case "$enable_rrtype_openpgpkey" in no) ;; yes|*) AC_DEFINE_UNQUOTED([RRTYPE_OPENPGPKEY], [], [Define this to enable RR type OPENPGPKEY.]) ;; esac AC_ARG_ENABLE(rrtype-ta, AC_HELP_STRING([--enable-rrtype-ta], [Enable draft RR type ta.])) case "$enable_rrtype_ta" in yes) AC_DEFINE_UNQUOTED([RRTYPE_TA], [], [Define this to enable RR type TA.]) ;; no|*) ;; esac AC_ARG_ENABLE(rrtype-avc, AC_HELP_STRING([--enable-rrtype-avc], [Enable draft RR type avc.])) case "$enable_rrtype_avc" in yes) AC_DEFINE_UNQUOTED([RRTYPE_AVC], [], [Define this to enable RR type AVC.]) ;; no|*) ;; esac AC_SUBST(LIBSSL_CPPFLAGS) AC_SUBST(LIBSSL_LDFLAGS) AC_SUBST(LIBSSL_LIBS) if test "x$HAVE_SSL" = "xyes"; then AC_SUBST(LIBSSL_SSL_LIBS, ["-lssl $LIBSSL_LIBS"]) fi CPPFLAGS=$tmp_CPPFLAGS LDFLAGS=$tmp_LDFLAGS LIBS=$tmp_LIBS # add option to disable the evil rpath ACX_ARG_RPATH #AC_RUN_IFELSE([AC_LANG_SOURCE( #[ #int main() #{ #short one = 1; #char *cp = (char*)&one; #if ( *cp == 0 ) #return(0); #else #return(1); #} #])], [],[ #AC_DEFINE(CONFCHECK_LITTLE_ENDIAN, 1, [system appears to be little-endian]) #],[]) # should define WORDS_BIGENDIAN if the system is big-endian AC_C_BIGENDIAN # Checks for header files. AC_HEADER_STDC AC_HEADER_STDBOOL #AC_HEADER_SYS_WAIT #AC_CHECK_HEADERS([getopt.h fcntl.h stdlib.h string.h strings.h unistd.h]) # do the very minimum - we can always extend this AC_CHECK_HEADERS([getopt.h stdarg.h openssl/ssl.h netinet/in.h time.h arpa/inet.h netdb.h],,, [AC_INCLUDES_DEFAULT]) AC_CHECK_HEADERS(sys/param.h sys/mount.h,,, [AC_INCLUDES_DEFAULT [ #if HAVE_SYS_PARAM_H # include #endif ] ]) AC_CHECK_HEADER(sys/socket.h, [ include_sys_socket_h='#include ' AC_DEFINE(HAVE_SYS_SOCKET_H, 1, [define if you have sys/socket.h]) ],[ include_sys_socket_h='' ],[AC_INCLUDES_DEFAULT [ #if HAVE_SYS_PARAM_H # include #endif ] ]) AC_SUBST(include_sys_socket_h) AC_CHECK_HEADER(inttypes.h, [ include_inttypes_h='#include ' AC_DEFINE(HAVE_INTTYPES_H, 1, [define if you have inttypes.h]) AC_SUBST(ldns_build_config_have_inttypes_h, 1) ],[ include_inttypes_h='' AC_SUBST(ldns_build_config_have_inttypes_h, 0) ],[AC_INCLUDES_DEFAULT ]) AC_SUBST(include_inttypes_h) AC_CHECK_HEADER(sys/types.h, [ include_systypes_h='#include ' AC_DEFINE(HAVE_SYS_TYPES_H, 1, [define if you have sys/types.h]) ],[ include_systypes_h='' ],[AC_INCLUDES_DEFAULT ]) AC_SUBST(include_systypes_h) AC_CHECK_HEADER(unistd.h, [ include_unistd_h='#include ' AC_DEFINE(HAVE_UNISTD_H, 1, [define if you have unistd.h]) ],[ include_unistd_h='' ],[AC_INCLUDES_DEFAULT ]) AC_SUBST(include_unistd_h) AC_CHECK_SIZEOF(time_t,,[ AC_INCLUDES_DEFAULT #ifdef TIME_WITH_SYS_TIME # include # include #else # ifdef HAVE_SYS_TIME_H # include # else # include # endif #endif ]) if test x_$with_examples != x_no; then AC_CHECK_HEADERS([pcap.h],,, [AC_INCLUDES_DEFAULT]) AC_CHECK_LIB(pcap, pcap_open_offline, [ AC_DEFINE([HAVE_LIBPCAP], [1], [Define to 1 if you have the `pcap' library (-lpcap).])dnl` AC_SUBST([LIBPCAP_LIBS], [-lpcap]) ], [ AC_MSG_WARN([Can't find pcap library (needed for ldns-dpa, will not build dpa now.)])dnl' AC_SUBST([LIBPCAP_LIBS], []) ] ) AC_CHECK_HEADERS([netinet/in_systm.h net/if.h netinet/ip.h netinet/udp.h netinet/igmp.h netinet/if_ether.h netinet/ip6.h net/ethernet.h netinet/ip_compat.h],,, [ AC_INCLUDES_DEFAULT #ifdef HAVE_NETINET_IN_SYSTM_H #include #endif #ifdef HAVE_NETINET_IN_H #include #endif #ifdef HAVE_SYS_SOCKET_H #include #endif #ifdef HAVE_NET_IF_H #include #endif]) fi ACX_TYPE_SOCKLEN_T if test "x$ac_cv_type_socklen_t" = xyes; then AC_SUBST(ldns_build_config_have_socklen_t, 1) else AC_SUBST(ldns_build_config_have_socklen_t, 0) fi AC_TYPE_SIZE_T AC_CHECK_TYPE(ssize_t, int) dnl AC_TYPE_INTPTR_T does not work on all platforms (autoconf) AC_CHECK_TYPE(intptr_t, size_t) AC_CHECK_TYPE(in_addr_t, [], [AC_DEFINE([in_addr_t], [uint32_t], [in_addr_t])], [ #if HAVE_SYS_TYPES_H # include #endif #if HAVE_NETINET_IN_H # include #endif]) AC_CHECK_TYPE(in_port_t, [], [AC_DEFINE([in_port_t], [uint16_t], [in_port_t])], [ #if HAVE_SYS_TYPES_H # include #endif #if HAVE_NETINET_IN_H # include #endif]) ACX_CHECK_SS_FAMILY AC_FUNC_MALLOC AC_FUNC_REALLOC AC_REPLACE_FUNCS(b64_pton) AC_REPLACE_FUNCS(b64_ntop) AC_REPLACE_FUNCS(calloc) AC_REPLACE_FUNCS(timegm) AC_REPLACE_FUNCS(gmtime_r) AC_REPLACE_FUNCS(ctime_r) AC_REPLACE_FUNCS(localtime_r) AC_REPLACE_FUNCS(isblank) AC_REPLACE_FUNCS(isascii) AC_REPLACE_FUNCS(inet_aton) AC_REPLACE_FUNCS(inet_pton) AC_REPLACE_FUNCS(inet_ntop) AC_REPLACE_FUNCS(snprintf) AC_REPLACE_FUNCS(strlcpy) AC_REPLACE_FUNCS(memmove) AC_FUNC_FORK AC_CHECK_FUNCS([endprotoent endservent sleep random fcntl strtoul bzero memset b32_ntop b32_pton]) if test "x$HAVE_B32_NTOP" = "xyes"; then AC_SUBST(ldns_build_config_have_b32_ntop, 1) else AC_SUBST(ldns_build_config_have_b32_ntop, 0) fi if test "x$HAVE_B32_PTON" = "xyes"; then AC_SUBST(ldns_build_config_have_b32_pton, 1) else AC_SUBST(ldns_build_config_have_b32_pton, 0) fi ACX_CHECK_GETADDRINFO_WITH_INCLUDES if test $ac_cv_func_getaddrinfo = no; then AC_LIBOBJ([fake-rfc2553]) fi if test "$USE_WINSOCK" = 1; then AC_CHECK_TOOL(WINDRES, windres) fi ACX_FUNC_IOCTLSOCKET #AC_SEARCH_LIBS(RSA_new, [crypto]) ACX_CHECK_FORMAT_ATTRIBUTE ACX_CHECK_UNUSED_ATTRIBUTE # check OSX deployment target, if needed if echo $build_os | grep darwin > /dev/null; then sdk_p=`xcode-select -print-path`; sdk_v="$( /usr/bin/xcrun --show-sdk-version )"; case $sdk_v in 10.9|10.8) sdk_c="10.7";; 10.11|10.10|*) sdk_c="10.10";; esac export MACOSX_DEPLOYMENT_TARGET="${sdk_c}"; export CFLAGS="$CFLAGS -mmacosx-version-min=${sdk_c} -isysroot ${sdk_p}/Platforms/MacOSX.platform/Developer/SDKs/MacOSX${sdk_v}.sdk"; fi AC_DEFINE([SYSCONFDIR], [sysconfdir], [System configuration dir]) AC_ARG_WITH(trust-anchor, AC_HELP_STRING([--with-trust-anchor=KEYFILE], [Default location of the trust anchor file for drill and ldns-dane. [default=SYSCONFDIR/unbound/root.key]]), [ AC_SUBST([LDNS_TRUST_ANCHOR_FILE], ["$withval"]) AC_MSG_NOTICE([Default trust anchor: $withval]) ],[ AC_SUBST([LDNS_TRUST_ANCHOR_FILE], ["\$(sysconfdir)/unbound/root.key"]) ]) AC_ARG_WITH(ca-file, AC_HELP_STRING([--with-ca-file=CAFILE], [File containing CA certificates for ldns-dane]), [ AC_DEFINE([HAVE_DANE_CA_FILE], [1], [Is a CAFILE given at configure time]) AC_DEFINE_UNQUOTED([LDNS_DANE_CA_FILE], ["$withval"], [Is a CAFILE given at configure time]) AC_MSG_NOTICE([Using CAfile: $withval]) AC_SUBST(DEFAULT_CAFILE, ["Default is $withval"]) ],[ AC_DEFINE([HAVE_DANE_CA_FILE], [0], [Is a CAFILE given at configure time]) AC_SUBST(DEFAULT_CAFILE, []) ]) AC_ARG_WITH(ca-path, AC_HELP_STRING([--with-ca-path=CAPATH], [Directory containing CA certificate files for ldns-dane]), [ AC_DEFINE([HAVE_DANE_CA_PATH], [1], [Is a CAPATH given at configure time]) AC_DEFINE_UNQUOTED([LDNS_DANE_CA_PATH], ["$withval"], [Is a CAPATH given at configure time]) AC_MSG_NOTICE([Using CApath: $withval]) AC_SUBST(DEFAULT_CAPATH, ["Default is $withval"]) ],[ AC_DEFINE([HAVE_DANE_CA_PATH], [0], [Is a CAPATH given at configure time]) AC_SUBST(DEFAULT_CAPATH, []) ]) AH_BOTTOM([ #include #include #include #include #ifndef LITTLE_ENDIAN #define LITTLE_ENDIAN 1234 #endif #ifndef BIG_ENDIAN #define BIG_ENDIAN 4321 #endif #ifndef BYTE_ORDER #ifdef WORDS_BIGENDIAN #define BYTE_ORDER BIG_ENDIAN #else #define BYTE_ORDER LITTLE_ENDIAN #endif /* WORDS_BIGENDIAN */ #endif /* BYTE_ORDER */ #if STDC_HEADERS #include #include #endif #ifdef HAVE_STDINT_H #include #endif #ifdef HAVE_SYS_SOCKET_H #include #endif #ifdef HAVE_NETINET_IN_H #include #endif #ifdef HAVE_ARPA_INET_H #include #endif #ifdef HAVE_WINSOCK2_H #include #endif #ifdef HAVE_WS2TCPIP_H #include #endif ] AHX_CONFIG_W32_FD_SET_T ) AH_BOTTOM([ #ifdef __cplusplus extern "C" { #endif int ldns_b64_ntop(uint8_t const *src, size_t srclength, char *target, size_t targsize); /** * calculates the size needed to store the result of b64_ntop */ /*@unused@*/ static inline size_t ldns_b64_ntop_calculate_size(size_t srcsize) { return ((((srcsize + 2) / 3) * 4) + 1); } int ldns_b64_pton(char const *src, uint8_t *target, size_t targsize); /** * calculates the size needed to store the result of ldns_b64_pton */ /*@unused@*/ static inline size_t ldns_b64_pton_calculate_size(size_t srcsize) { return (((((srcsize + 3) / 4) * 3)) + 1); } /** * Given in dnssec_zone.c, also used in dnssec_sign.c:w */ int ldns_dname_compare_v(const void *a, const void *b); #ifndef HAVE_SLEEP /* use windows sleep, in millisecs, instead */ #define sleep(x) Sleep((x)*1000) #endif #ifndef HAVE_RANDOM #define srandom(x) srand(x) #define random(x) rand(x) #endif #ifndef HAVE_TIMEGM #include time_t timegm (struct tm *tm); #endif /* !TIMEGM */ #ifndef HAVE_GMTIME_R struct tm *gmtime_r(const time_t *timep, struct tm *result); #endif #ifndef HAVE_LOCALTIME_R struct tm *localtime_r(const time_t *timep, struct tm *result); #endif #ifndef HAVE_ISBLANK int isblank(int c); #endif /* !HAVE_ISBLANK */ #ifndef HAVE_ISASCII int isascii(int c); #endif /* !HAVE_ISASCII */ #ifndef HAVE_SNPRINTF #include int snprintf (char *str, size_t count, const char *fmt, ...); int vsnprintf (char *str, size_t count, const char *fmt, va_list arg); #endif /* HAVE_SNPRINTF */ #ifndef HAVE_INET_PTON int inet_pton(int af, const char* src, void* dst); #endif /* HAVE_INET_PTON */ #ifndef HAVE_INET_NTOP const char *inet_ntop(int af, const void *src, char *dst, size_t size); #endif #ifndef HAVE_INET_ATON int inet_aton(const char *cp, struct in_addr *addr); #endif #ifndef HAVE_MEMMOVE void *memmove(void *dest, const void *src, size_t n); #endif #ifndef HAVE_STRLCPY size_t strlcpy(char *dst, const char *src, size_t siz); #endif #ifdef USE_WINSOCK #define SOCK_INVALID INVALID_SOCKET #define close_socket(_s) do { if (_s > SOCK_INVALID) {closesocket(_s); _s = SOCK_INVALID;} } while(0) #else #define SOCK_INVALID -1 #define close_socket(_s) do { if (_s > SOCK_INVALID) {close(_s); _s = SOCK_INVALID;} } while(0) #endif #ifdef __cplusplus } #endif #ifndef HAVE_GETADDRINFO #include "compat/fake-rfc2553.h" #endif #ifndef HAVE_STRTOUL #define strtoul (unsigned long)strtol #endif ]) if test "x$HAVE_SSL" = "xyes"; then AC_SUBST(ldns_build_config_have_ssl, 1) else AC_SUBST(ldns_build_config_have_ssl, 0) fi if test "x$ac_cv_c_format_attribute" = "xyes"; then AC_SUBST(ldns_build_config_have_attr_format, 1) else AC_SUBST(ldns_build_config_have_attr_format, 0) fi if test "x$ac_cv_c_unused_attribute" = "xyes"; then AC_SUBST(ldns_build_config_have_attr_unused, 1) else AC_SUBST(ldns_build_config_have_attr_unused, 0) fi CONFIG_FILES="Makefile ldns/common.h ldns/net.h ldns/util.h packaging/libldns.pc packaging/ldns-config" AC_SUBST(CONFIG_FILES) AC_CONFIG_FILES([$CONFIG_FILES]) AC_CONFIG_HEADER([ldns/config.h]) AC_OUTPUT COPY_HEADER_FILES(ldns/, ldns/) dnl AC_CONFIG_SUBDIRS([drill]) ldns-1.7.0/ax_pkg_swig.m40000644000175000017500000001523413026206166014576 0ustar willemwillem# =========================================================================== # http://www.gnu.org/software/autoconf-archive/ax_pkg_swig.html # =========================================================================== # # SYNOPSIS # # AX_PKG_SWIG([major.minor.micro], [action-if-found], [action-if-not-found]) # # DESCRIPTION # # This macro searches for a SWIG installation on your system. If found, # then SWIG is AC_SUBST'd; if not found, then $SWIG is empty. If SWIG is # found, then SWIG_LIB is set to the SWIG library path, and AC_SUBST'd. # # You can use the optional first argument to check if the version of the # available SWIG is greater than or equal to the value of the argument. It # should have the format: N[.N[.N]] (N is a number between 0 and 999. Only # the first N is mandatory.) If the version argument is given (e.g. # 1.3.17), AX_PKG_SWIG checks that the swig package is this version number # or higher. # # As usual, action-if-found is executed if SWIG is found, otherwise # action-if-not-found is executed. # # In configure.in, use as: # # AX_PKG_SWIG(1.3.17, [], [ AC_MSG_ERROR([SWIG is required to build..]) ]) # AX_SWIG_ENABLE_CXX # AX_SWIG_MULTI_MODULE_SUPPORT # AX_SWIG_PYTHON # # LICENSE # # Copyright (c) 2008 Sebastian Huber # Copyright (c) 2008 Alan W. Irwin # Copyright (c) 2008 Rafael Laboissiere # Copyright (c) 2008 Andrew Collier # Copyright (c) 2011 Murray Cumming # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the # Free Software Foundation; either version 2 of the License, or (at your # option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General # Public License for more details. # # You should have received a copy of the GNU General Public License along # with this program. If not, see . # # As a special exception, the respective Autoconf Macro's copyright owner # gives unlimited permission to copy, distribute and modify the configure # scripts that are the output of Autoconf when processing the Macro. You # need not follow the terms of the GNU General Public License when using # or distributing such scripts, even though portions of the text of the # Macro appear in them. The GNU General Public License (GPL) does govern # all other use of the material that constitutes the Autoconf Macro. # # This special exception to the GPL applies to versions of the Autoconf # Macro released by the Autoconf Archive. When you make and distribute a # modified version of the Autoconf Macro, you may extend this special # exception to the GPL to apply to your modified version as well. #serial 8 AC_DEFUN([AX_PKG_SWIG],[ # Ubuntu has swig 2.0 as /usr/bin/swig2.0 AC_PATH_PROGS([SWIG],[swig2.0 swig]) if test -z "$SWIG" ; then m4_ifval([$3],[$3],[:]) elif test -n "$1" ; then AC_MSG_CHECKING([SWIG version]) [swig_version=`$SWIG -version 2>&1 | grep 'SWIG Version' | sed 's/.*\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*/\1/g'`] AC_MSG_RESULT([$swig_version]) if test -n "$swig_version" ; then # Calculate the required version number components [required=$1] [required_major=`echo $required | sed 's/[^0-9].*//'`] if test -z "$required_major" ; then [required_major=0] fi [required=`echo $required | sed 's/[0-9]*[^0-9]//'`] [required_minor=`echo $required | sed 's/[^0-9].*//'`] if test -z "$required_minor" ; then [required_minor=0] fi [required=`echo $required | sed 's/[0-9]*[^0-9]//'`] [required_patch=`echo $required | sed 's/[^0-9].*//'`] if test -z "$required_patch" ; then [required_patch=0] fi # Calculate the available version number components [available=$swig_version] [available_major=`echo $available | sed 's/[^0-9].*//'`] if test -z "$available_major" ; then [available_major=0] fi [available=`echo $available | sed 's/[0-9]*[^0-9]//'`] [available_minor=`echo $available | sed 's/[^0-9].*//'`] if test -z "$available_minor" ; then [available_minor=0] fi [available=`echo $available | sed 's/[0-9]*[^0-9]//'`] [available_patch=`echo $available | sed 's/[^0-9].*//'`] if test -z "$available_patch" ; then [available_patch=0] fi # Convert the version tuple into a single number for easier comparison. # Using base 100 should be safe since SWIG internally uses BCD values # to encode its version number. required_swig_vernum=`expr $required_major \* 10000 \ \+ $required_minor \* 100 \+ $required_patch` available_swig_vernum=`expr $available_major \* 10000 \ \+ $available_minor \* 100 \+ $available_patch` if test $available_swig_vernum -lt $required_swig_vernum; then AC_MSG_WARN([SWIG version >= $1 is required. You have $swig_version.]) SWIG='' m4_ifval([$3],[$3],[]) else AC_MSG_CHECKING([for SWIG library]) SWIG_LIB=`$SWIG -swiglib` AC_MSG_RESULT([$SWIG_LIB]) m4_ifval([$2],[$2],[]) fi else AC_MSG_WARN([cannot determine SWIG version]) SWIG='' m4_ifval([$3],[$3],[]) fi fi AC_SUBST([SWIG_LIB]) ]) ldns-1.7.0/libdns.vim0000644000175000017500000004621513026206166014025 0ustar willemwillem" Vim syntax file " Language: C libdns " Maintainer: miekg " Last change: 2011-09-15 " ldns/util.h syn keyword ldnsMacro LDNS_MALLOC syn keyword ldnsMacro LDNS_XMALLOC syn keyword ldnsMacro LDNS_CALLOC syn keyword ldnsMacro LDNS_REALLOC syn keyword ldnsMacro LDNS_XREALLOC syn keyword ldnsMacro LDNS_FREE syn keyword ldnsMacro LDNS_DEP syn keyword ldnsMacro LDNS_VERSION syn keyword ldnsMacro LDNS_REVISION " ldns/dname.h syn keyword ldnsMacro LDNS_DNAME_NORMALIZE " ldns/tsig.h syn keyword ldnsType ldns_tsig_credentials " ldns/update.h " -- " ldns/rdata.h syn keyword ldnsType ldns_rdf syn keyword ldnsType ldns_rdf_type syn keyword ldnsType ldns_cert_algorithm syn keyword ldnsConstant LDNS_RDF_TYPE_NONE syn keyword ldnsConstant LDNS_RDF_TYPE_DNAME syn keyword ldnsConstant LDNS_RDF_TYPE_INT8 syn keyword ldnsConstant LDNS_RDF_TYPE_INT16 syn keyword ldnsConstant LDNS_RDF_TYPE_INT16_DATA syn keyword ldnsConstant LDNS_RDF_TYPE_INT32 syn keyword ldnsConstant LDNS_RDF_TYPE_A syn keyword ldnsConstant LDNS_RDF_TYPE_AAAA syn keyword ldnsConstant LDNS_RDF_TYPE_STR syn keyword ldnsConstant LDNS_RDF_TYPE_APL syn keyword ldnsConstant LDNS_RDF_TYPE_B32_EXT syn keyword ldnsConstant LDNS_RDF_TYPE_B64 syn keyword ldnsConstant LDNS_RDF_TYPE_HEX syn keyword ldnsConstant LDNS_RDF_TYPE_NSEC syn keyword ldnsConstant LDNS_RDF_TYPE_TYPE syn keyword ldnsConstant LDNS_RDF_TYPE_CLASS syn keyword ldnsConstant LDNS_RDF_TYPE_CERT syn keyword ldnsConstant LDNS_RDF_TYPE_CERT_ALG syn keyword ldnsConstant LDNS_RDF_TYPE_ALG syn keyword ldnsConstant LDNS_RDF_TYPE_UNKNOWN syn keyword ldnsConstant LDNS_RDF_TYPE_TIME syn keyword ldnsConstant LDNS_RDF_TYPE_PERIOD syn keyword ldnsConstant LDNS_RDF_TYPE_TSIGTIME syn keyword ldnsConstant LDNS_RDF_TYPE_SERVICE syn keyword ldnsConstant LDNS_RDF_TYPE_LOC syn keyword ldnsConstant LDNS_RDF_TYPE_WKS syn keyword ldnsConstant LDNS_RDF_TYPE_NSAP syn keyword ldnsConstant LDNS_RDF_TYPE_ATMA syn keyword ldnsConstant LDNS_RDF_TYPE_NSEC3_SALT syn keyword ldnsConstant LDNS_RDF_TYPE_NSEC3_NEXT_OWNER syn keyword ldnsConstant LDNS_RDF_TYPE_IPSECKEY syn keyword ldnsConstant LDNS_RDF_TYPE_TSIG syn keyword ldnsConstant LDNS_MAX_RDFLEN syn keyword ldnsConstant LDNS_RDF_SIZE_BYTE syn keyword ldnsConstant LDNS_RDF_SIZE_WORD syn keyword ldnsConstant LDNS_RDF_SIZE_DOUBLEWORD syn keyword ldnsConstant LDNS_RDF_SIZE_6BYTES syn keyword ldnsConstant LDNS_RDF_SIZE_16BYTES syn keyword ldnsConstant LDNS_NSEC3_VARS_OPTOUT_MASK syn keyword ldnsConstant LDNS_CERT_PKIX syn keyword ldnsConstant LDNS_CERT_SPKI syn keyword ldnsConstant LDNS_CERT_PGP syn keyword ldnsConstant LDNS_CERT_IPKIX syn keyword ldnsConstant LDNS_CERT_ISPKI syn keyword ldnsConstant LDNS_CERT_IPGP syn keyword ldnsConstant LDNS_CERT_ACPKIX syn keyword ldnsConstant LDNS_CERT_IACPKIX syn keyword ldnsConstant LDNS_CERT_URI syn keyword ldnsConstant LDNS_CERT_OID " ldns/ldns.h syn keyword ldnsConstant LDNS_PORT syn keyword ldnsConstant LDNS_IP4ADDRLEN syn keyword ldnsConstant LDNS_IP6ADDRLEN syn keyword ldnsConstant LDNS_ROOT_LABEL_STR syn keyword ldnsConstant LDNS_DEFAULT_TTL " ldns/packet.h syn keyword ldnsType ldns_pkt syn keyword ldnsType ldns_pkt_section syn keyword ldnsType ldns_pkt_type syn keyword ldnsType ldns_pkt_opcode syn keyword ldnsType ldns_pkt_rcode syn keyword ldnsType ldns_hdr syn keyword ldnsConstant LDNS_QR syn keyword ldnsConstant LDNS_AA syn keyword ldnsConstant LDNS_TC syn keyword ldnsConstant LDNS_RD syn keyword ldnsConstant LDNS_CD syn keyword ldnsConstant LDNS_RA syn keyword ldnsConstant LDNS_AD syn keyword ldnsConstant LDNS_MAX_PACKETLEN syn keyword ldnsConstant LDNS_PACKET_QUESTION syn keyword ldnsConstant LDNS_PACKET_REFERRAL syn keyword ldnsConstant LDNS_PACKET_ANSWER syn keyword ldnsConstant LDNS_PACKET_NXDOMAIN syn keyword ldnsConstant LDNS_PACKET_NODATA syn keyword ldnsConstant LDNS_PACKET_UNKNOWN syn keyword ldnsConstant LDNS_SECTION_QUESTION syn keyword ldnsConstant LDNS_SECTION_ANSWER syn keyword ldnsConstant LDNS_SECTION_AUTHORITY syn keyword ldnsConstant LDNS_SECTION_ADDITIONAL syn keyword ldnsConstant LDNS_SECTION_ANY syn keyword ldnsConstant LDNS_SECTION_ANY_NOQUESTION syn keyword ldnsConstant LDNS_PACKET_QUERY syn keyword ldnsConstant LDNS_PACKET_IQUERY syn keyword ldnsConstant LDNS_PACKET_STATUS syn keyword ldnsConstant LDNS_PACKET_NOTIFY syn keyword ldnsConstant LDNS_PACKET_UPDATE syn keyword ldnsConstant LDNS_RCODE_NOERROR syn keyword ldnsConstant LDNS_RCODE_FORMERR syn keyword ldnsConstant LDNS_RCODE_SERVFAIL syn keyword ldnsConstant LDNS_RCODE_NXDOMAIN syn keyword ldnsConstant LDNS_RCODE_NOTIMPL syn keyword ldnsConstant LDNS_RCODE_REFUSED syn keyword ldnsConstant LDNS_RCODE_YXDOMAIN syn keyword ldnsConstant LDNS_RCODE_YXRRSET syn keyword ldnsConstant LDNS_RCODE_NXRRSET syn keyword ldnsConstant LDNS_RCODE_NOTAUTH syn keyword ldnsConstant LDNS_RCODE_NOTZONE " dns/error.h syn keyword ldnsConstant LDNS_STATUS_OK syn keyword ldnsConstant LDNS_STATUS_EMPTY_LABEL syn keyword ldnsConstant LDNS_STATUS_LABEL_OVERFLOW syn keyword ldnsConstant LDNS_STATUS_DOMAINNAME_OVERFLOW syn keyword ldnsConstant LDNS_STATUS_DOMAINNAME_UNDERFLOW syn keyword ldnsConstant LDNS_STATUS_DDD_OVERFLOW syn keyword ldnsConstant LDNS_STATUS_PACKET_OVERFLOW syn keyword ldnsConstant LDNS_STATUS_INVALID_POINTER syn keyword ldnsConstant LDNS_STATUS_MEM_ERR syn keyword ldnsConstant LDNS_STATUS_INTERNAL_ERR syn keyword ldnsConstant LDNS_STATUS_SSL_ERR syn keyword ldnsConstant LDNS_STATUS_ERR syn keyword ldnsConstant LDNS_STATUS_INVALID_INT syn keyword ldnsConstant LDNS_STATUS_INVALID_IP4 syn keyword ldnsConstant LDNS_STATUS_INVALID_IP6 syn keyword ldnsConstant LDNS_STATUS_INVALID_STR syn keyword ldnsConstant LDNS_STATUS_INVALID_B32_EXT syn keyword ldnsConstant LDNS_STATUS_INVALID_B64 syn keyword ldnsConstant LDNS_STATUS_INVALID_HEX syn keyword ldnsConstant LDNS_STATUS_INVALID_TIME syn keyword ldnsConstant LDNS_STATUS_NETWORK_ERR syn keyword ldnsConstant LDNS_STATUS_ADDRESS_ERR syn keyword ldnsConstant LDNS_STATUS_FILE_ERR syn keyword ldnsConstant LDNS_STATUS_UNKNOWN_INET syn keyword ldnsConstant LDNS_STATUS_NOT_IMPL syn keyword ldnsConstant LDNS_STATUS_NULL syn keyword ldnsConstant LDNS_STATUS_CRYPTO_UNKNOWN_ALGO syn keyword ldnsConstant LDNS_STATUS_CRYPTO_ALGO_NOT_IMPL syn keyword ldnsConstant LDNS_STATUS_CRYPTO_NO_RRSIG syn keyword ldnsConstant LDNS_STATUS_CRYPTO_NO_DNSKEY syn keyword ldnsConstant LDNS_STATUS_CRYPTO_NO_TRUSTED_DNSKEY syn keyword ldnsConstant LDNS_STATUS_CRYPTO_NO_DS syn keyword ldnsConstant LDNS_STATUS_CRYPTO_NO_TRUSTED_DS syn keyword ldnsConstant LDNS_STATUS_CRYPTO_NO_MATCHING_KEYTAG_DNSKEY syn keyword ldnsConstant LDNS_STATUS_CRYPTO_VALIDATED syn keyword ldnsConstant LDNS_STATUS_CRYPTO_BOGUS syn keyword ldnsConstant LDNS_STATUS_CRYPTO_SIG_EXPIRED syn keyword ldnsConstant LDNS_STATUS_CRYPTO_SIG_NOT_INCEPTED syn keyword ldnsConstant LDNS_STATUS_CRYPTO_TSIG_BOGUS syn keyword ldnsConstant LDNS_STATUS_CRYPTO_TSIG_ERR syn keyword ldnsConstant LDNS_STATUS_CRYPTO_EXPIRATION_BEFORE_INCEPTION syn keyword ldnsConstant LDNS_STATUS_CRYPTO_TYPE_COVERED_ERR syn keyword ldnsConstant LDNS_STATUS_ENGINE_KEY_NOT_LOADED syn keyword ldnsConstant LDNS_STATUS_NSEC3_ERR syn keyword ldnsConstant LDNS_STATUS_RES_NO_NS syn keyword ldnsConstant LDNS_STATUS_RES_QUERY syn keyword ldnsConstant LDNS_STATUS_WIRE_INCOMPLETE_HEADER syn keyword ldnsConstant LDNS_STATUS_WIRE_INCOMPLETE_QUESTION syn keyword ldnsConstant LDNS_STATUS_WIRE_INCOMPLETE_ANSWER syn keyword ldnsConstant LDNS_STATUS_WIRE_INCOMPLETE_AUTHORITY syn keyword ldnsConstant LDNS_STATUS_WIRE_INCOMPLETE_ADDITIONAL syn keyword ldnsConstant LDNS_STATUS_NO_DATA syn keyword ldnsConstant LDNS_STATUS_CERT_BAD_ALGORITHM syn keyword ldnsConstant LDNS_STATUS_SYNTAX_TYPE_ERR syn keyword ldnsConstant LDNS_STATUS_SYNTAX_CLASS_ERR syn keyword ldnsConstant LDNS_STATUS_SYNTAX_TTL_ERR syn keyword ldnsConstant LDNS_STATUS_SYNTAX_INCLUDE_ERR_NOTIMPL syn keyword ldnsConstant LDNS_STATUS_SYNTAX_RDATA_ERR syn keyword ldnsConstant LDNS_STATUS_SYNTAX_DNAME_ERR syn keyword ldnsConstant LDNS_STATUS_SYNTAX_VERSION_ERR syn keyword ldnsConstant LDNS_STATUS_SYNTAX_ALG_ERR syn keyword ldnsConstant LDNS_STATUS_SYNTAX_KEYWORD_ERR syn keyword ldnsConstant LDNS_STATUS_SYNTAX_TTL syn keyword ldnsConstant LDNS_STATUS_SYNTAX_ORIGIN syn keyword ldnsConstant LDNS_STATUS_SYNTAX_INCLUDE syn keyword ldnsConstant LDNS_STATUS_SYNTAX_EMPTY syn keyword ldnsConstant LDNS_STATUS_SYNTAX_ITERATIONS_OVERFLOW syn keyword ldnsConstant LDNS_STATUS_SYNTAX_MISSING_VALUE_ERR syn keyword ldnsConstant LDNS_STATUS_SYNTAX_INTEGER_OVERFLOW syn keyword ldnsConstant LDNS_STATUS_SYNTAX_BAD_ESCAPE syn keyword ldnsConstant LDNS_STATUS_SOCKET_ERROR syn keyword ldnsConstant LDNS_STATUS_SYNTAX_ERR syn keyword ldnsConstant LDNS_STATUS_DNSSEC_EXISTENCE_DENIED syn keyword ldnsConstant LDNS_STATUS_DNSSEC_NSEC_RR_NOT_COVERED syn keyword ldnsConstant LDNS_STATUS_DNSSEC_NSEC_WILDCARD_NOT_COVERED syn keyword ldnsConstant LDNS_STATUS_DNSSEC_NSEC3_ORIGINAL_NOT_FOUND syn keyword ldnsConstant LDNS_STATUS_MISSING_RDATA_FIELDS_RRSIG syn keyword ldnsConstant LDNS_STATUS_MISSING_RDATA_FIELDS_KEY " ldns/resolver.h syn keyword ldnsType ldns_resolver syn keyword ldnsConstant LDNS_RESOLV_CONF syn keyword ldnsConstant LDNS_RESOLV_HOSTS syn keyword ldnsConstant LDNS_RESOLV_KEYWORD syn keyword ldnsConstant LDNS_RESOLV_DEFDOMAIN syn keyword ldnsConstant LDNS_RESOLV_NAMESERVER syn keyword ldnsConstant LDNS_RESOLV_SEARCH syn keyword ldnsConstant LDNS_RESOLV_SORTLIST syn keyword ldnsConstant LDNS_RESOLV_OPTIONS syn keyword ldnsConstant LDNS_RESOLV_ANCHOR syn keyword ldnsConstant LDNS_RESOLV_KEYWORDS syn keyword ldnsConstant LDNS_RESOLV_INETANY syn keyword ldnsConstant LDNS_RESOLV_INET syn keyword ldnsConstant LDNS_RESOLV_INET6 syn keyword ldnsConstant LDNS_RESOLV_RTT_INF syn keyword ldnsConstant LDNS_RESOLV_RTT_MIN " ldns/zone.h syn keyword ldnsType ldns_zone " ldns/dnssec.h syn keyword ldnsConstant LDNS_NSEC3_MAX_ITERATIONS syn keyword ldnsConstant LDNS_DEFAULT_EXP_TIME syn keyword ldnsConstant LDNS_DNSSEC_KEYPROTO syn keyword ldnsConstant LDNS_MAX_KEYLEN " ldns/dnssec_sign.h " -- " ldns/dnssec_zone.h syn keyword ldnsType ldns_dnssec_rrs syn keyword ldnsType ldns_dnssec_rrsets syn keyword ldnsType ldns_dnssec_name syn keyword ldnsType ldns_dnssec_zone " ldns/dnssec_verify.h syn keyword ldnsType ldns_dnssec_data_chain syn keyword ldnsType ldns_dnssec_trust_tree " ldns/rr.h syn keyword ldnsType ldns_rr_list syn keyword ldnsType ldns_rr_descriptor syn keyword ldnsType ldns_rr syn keyword ldnsType ldns_rr_type syn keyword ldnsType ldns_rr_class syn keyword ldnsType ldns_rr_compress syn keyword ldnsConstant LDNS_MAX_LABELLEN syn keyword ldnsConstant LDNS_MAX_DOMAINLEN syn keyword ldnsConstant LDNS_RR_COMPRESS syn keyword ldnsConstant LDNS_RR_NO_COMPRESS syn keyword ldnsConstant LDNS_RR_CLASS_IN syn keyword ldnsConstant LDNS_RR_CLASS_CH syn keyword ldnsConstant LDNS_RR_CLASS_HS syn keyword ldnsConstant LDNS_RR_CLASS_NONE syn keyword ldnsConstant LDNS_RR_CLASS_ANY syn keyword ldnsConstant LDNS_RR_TYPE_A syn keyword ldnsConstant LDNS_RR_TYPE_A6 syn keyword ldnsConstant LDNS_RR_TYPE_AAAA syn keyword ldnsConstant LDNS_RR_TYPE_AFSDB syn keyword ldnsConstant LDNS_RR_TYPE_ANY syn keyword ldnsConstant LDNS_RR_TYPE_APL syn keyword ldnsConstant LDNS_RR_TYPE_ATMA syn keyword ldnsConstant LDNS_RR_TYPE_AXFR syn keyword ldnsConstant LDNS_RR_TYPE_CERT syn keyword ldnsConstant LDNS_RR_TYPE_CNAME syn keyword ldnsConstant LDNS_RR_TYPE_COUNT syn keyword ldnsConstant LDNS_RR_TYPE_DHCID syn keyword ldnsConstant LDNS_RR_TYPE_DLV syn keyword ldnsConstant LDNS_RR_TYPE_DNAME syn keyword ldnsConstant LDNS_RR_TYPE_DNSKEY syn keyword ldnsConstant LDNS_RR_TYPE_DS syn keyword ldnsConstant LDNS_RR_TYPE_EID syn keyword ldnsConstant LDNS_RR_TYPE_FIRST syn keyword ldnsConstant LDNS_RR_TYPE_GID syn keyword ldnsConstant LDNS_RR_TYPE_GPOS syn keyword ldnsConstant LDNS_RR_TYPE_HINFO syn keyword ldnsConstant LDNS_RR_TYPE_IPSECKEY syn keyword ldnsConstant LDNS_RR_TYPE_ISDN syn keyword ldnsConstant LDNS_RR_TYPE_IXFR syn keyword ldnsConstant LDNS_RR_TYPE_KEY syn keyword ldnsConstant LDNS_RR_TYPE_KX syn keyword ldnsConstant LDNS_RR_TYPE_LAST syn keyword ldnsConstant LDNS_RR_TYPE_LOC syn keyword ldnsConstant LDNS_RR_TYPE_MAILA syn keyword ldnsConstant LDNS_RR_TYPE_MAILB syn keyword ldnsConstant LDNS_RR_TYPE_MB syn keyword ldnsConstant LDNS_RR_TYPE_MD syn keyword ldnsConstant LDNS_RR_TYPE_MF syn keyword ldnsConstant LDNS_RR_TYPE_MG syn keyword ldnsConstant LDNS_RR_TYPE_MINFO syn keyword ldnsConstant LDNS_RR_TYPE_MR syn keyword ldnsConstant LDNS_RR_TYPE_MX syn keyword ldnsConstant LDNS_RR_TYPE_NAPTR syn keyword ldnsConstant LDNS_RR_TYPE_NIMLOC syn keyword ldnsConstant LDNS_RR_TYPE_NS syn keyword ldnsConstant LDNS_RR_TYPE_NSAP syn keyword ldnsConstant LDNS_RR_TYPE_NSAP_PTR syn keyword ldnsConstant LDNS_RR_TYPE_NSEC syn keyword ldnsConstant LDNS_RR_TYPE_NSEC3 syn keyword ldnsConstant LDNS_RR_TYPE_NSEC3 syn keyword ldnsConstant LDNS_RR_TYPE_NSEC3PARAM syn keyword ldnsConstant LDNS_RR_TYPE_NSEC3PARAMS syn keyword ldnsConstant LDNS_RR_TYPE_NSEC3PARAMS syn keyword ldnsConstant LDNS_RR_TYPE_NULL syn keyword ldnsConstant LDNS_RR_TYPE_NXT syn keyword ldnsConstant LDNS_RR_TYPE_OPT syn keyword ldnsConstant LDNS_RR_TYPE_PTR syn keyword ldnsConstant LDNS_RR_TYPE_PX syn keyword ldnsConstant LDNS_RR_TYPE_RP syn keyword ldnsConstant LDNS_RR_TYPE_RRSIG syn keyword ldnsConstant LDNS_RR_TYPE_RT syn keyword ldnsConstant LDNS_RR_TYPE_SIG syn keyword ldnsConstant LDNS_RR_TYPE_SINK syn keyword ldnsConstant LDNS_RR_TYPE_SOA syn keyword ldnsConstant LDNS_RR_TYPE_SPF syn keyword ldnsConstant LDNS_RR_TYPE_SRV syn keyword ldnsConstant LDNS_RR_TYPE_SSHFP syn keyword ldnsConstant LDNS_RR_TYPE_TALINK syn keyword ldnsConstant LDNS_RR_TYPE_TSIG syn keyword ldnsConstant LDNS_RR_TYPE_TXT syn keyword ldnsConstant LDNS_RR_TYPE_UID syn keyword ldnsConstant LDNS_RR_TYPE_UINFO syn keyword ldnsConstant LDNS_RR_TYPE_UNSPEC syn keyword ldnsConstant LDNS_RR_TYPE_WKS syn keyword ldnsConstant LDNS_RR_TYPE_X25 " ldns/buffer.h syn keyword ldnsType ldns_buffer syn keyword ldnsConstant LDNS_MIN_BUFLEN " ldns/host2str.h syn keyword ldnsConstant LDNS_APL_IP4 syn keyword ldnsConstant LDNS_APL_IP6 syn keyword ldnsConstant LDNS_APL_MASK syn keyword ldnsConstant LDNS_APL_NEGATION " ldns/keys.h syn keyword ldnsType ldns_key syn keyword ldnsType ldns_key_list syn keyword ldnsType ldns_signing_algorithm syn keyword ldnsType ldns_hash syn keyword ldnsType ldns_algorithm syn keyword ldnsConstant LDNS_KEY_ZONE_KEY syn keyword ldnsConstant LDNS_KEY_SEP_KEY syn keyword ldnsConstant LDNS_KEY_REVOKE_KEY syn keyword ldnsConstant LDNS_SHA1 syn keyword ldnsConstant LDNS_SHA256 syn keyword ldnsConstant LDNS_HASH_GOST syn keyword ldnsConstant LDNS_SHA384 syn keyword ldnsConstant LDNS_SIGN_RSAMD5 syn keyword ldnsConstant LDNS_SIGN_RSASHA1 syn keyword ldnsConstant LDNS_SIGN_DSA syn keyword ldnsConstant LDNS_SIGN_RSASHA1_NSEC3 syn keyword ldnsConstant LDNS_SIGN_RSASHA256 syn keyword ldnsConstant LDNS_SIGN_RSASHA512 syn keyword ldnsConstant LDNS_SIGN_DSA_NSEC3 syn keyword ldnsConstant LDNS_SIGN_ECC_GOST syn keyword ldnsConstant LDNS_SIGN_ECDSAP256SHA256 syn keyword ldnsConstant LDNS_SIGN_ECDSAP384SHA384 syn keyword ldnsConstant LDNS_SIGN_HMACMD5 syn keyword ldnsConstant LDNS_SIGN_HMACSHA1 syn keyword ldnsConstant LDNS_SIGN_HMACSHA256 " ldns/wire2host.h syn keyword ldnsMacro LDNS_WIRE2HOST_H syn keyword ldnsMacro LDNS_HEADER_SIZE syn keyword ldnsMacro LDNS_RD_MASK syn keyword ldnsMacro LDNS_RD_SHIFT syn keyword ldnsMacro LDNS_RD_WIRE syn keyword ldnsMacro LDNS_RD_SET syn keyword ldnsMacro LDNS_RD_CLR syn keyword ldnsMacro LDNS_TC_MASK syn keyword ldnsMacro LDNS_TC_SHIFT syn keyword ldnsMacro LDNS_TC_WIRE syn keyword ldnsMacro LDNS_TC_SET syn keyword ldnsMacro LDNS_TC_CLR syn keyword ldnsMacro LDNS_AA_MASK syn keyword ldnsMacro LDNS_AA_SHIFT syn keyword ldnsMacro LDNS_AA_WIRE syn keyword ldnsMacro LDNS_AA_SET syn keyword ldnsMacro LDNS_AA_CLR syn keyword ldnsMacro LDNS_OPCODE_MASK syn keyword ldnsMacro LDNS_OPCODE_SHIFT syn keyword ldnsMacro LDNS_OPCODE_WIRE syn keyword ldnsMacro LDNS_OPCODE_SET syn keyword ldnsMacro LDNS_QR_MASK syn keyword ldnsMacro LDNS_QR_SHIFT syn keyword ldnsMacro LDNS_QR_WIRE syn keyword ldnsMacro LDNS_QR_SET syn keyword ldnsMacro LDNS_QR_CLR syn keyword ldnsMacro LDNS_RCODE_MASK syn keyword ldnsMacro LDNS_RCODE_SHIFT syn keyword ldnsMacro LDNS_RCODE_WIRE syn keyword ldnsMacro LDNS_RCODE_SET syn keyword ldnsMacro LDNS_CD_MASK syn keyword ldnsMacro LDNS_CD_SHIFT syn keyword ldnsMacro LDNS_CD_WIRE syn keyword ldnsMacro LDNS_CD_SET syn keyword ldnsMacro LDNS_CD_CLR syn keyword ldnsMacro LDNS_AD_MASK syn keyword ldnsMacro LDNS_AD_SHIFT syn keyword ldnsMacro LDNS_AD_WIRE syn keyword ldnsMacro LDNS_AD_SET syn keyword ldnsMacro LDNS_AD_CLR syn keyword ldnsMacro LDNS_Z_MASK syn keyword ldnsMacro LDNS_Z_SHIFT syn keyword ldnsMacro LDNS_Z_WIRE syn keyword ldnsMacro LDNS_Z_SET syn keyword ldnsMacro LDNS_Z_CLR syn keyword ldnsMacro LDNS_RA_MASK syn keyword ldnsMacro LDNS_RA_SHIFT syn keyword ldnsMacro LDNS_RA_WIRE syn keyword ldnsMacro LDNS_RA_SET syn keyword ldnsMacro LDNS_RA_CLR syn keyword ldnsMacro LDNS_ID_WIRE syn keyword ldnsMacro LDNS_ID_SET syn keyword ldnsMacro LDNS_QDCOUNT_OFF syn keyword ldnsMacro QDCOUNT syn keyword ldnsMacro LDNS_QDCOUNT syn keyword ldnsMacro LDNS_ANCOUNT_OFF syn keyword ldnsMacro LDNS_ANCOUNT syn keyword ldnsMacro LDNS_NSCOUNT_OFF syn keyword ldnsMacro LDNS_NSCOUNT syn keyword ldnsMacro LDNS_ARCOUNT_OFF syn keyword ldnsMacro LDNS_ARCOUNT " ldns/host2wire.h " -- " ldns/* -- All functions " Created with: " Get all the functions that start with 'ldns_' " egrep '^[a-z_]+ [*a-z_0-9]+\(' *.h | sed -e 's/(.*$//' | awk '{print $2}' | \ " sed 's/^\*//' | grep '^ldns' | sort " Not included, but could be added...? " Default highlighting command -nargs=+ HiLink hi def link HiLink ldnsType Type " Currently no functions are defined HiLink ldnsFunction Function HiLink ldnsMacro Macro HiLink ldnsConstant Constant delcommand HiLink ldns-1.7.0/libdns.doxygen0000644000175000017500000031777113026206166014717 0ustar willemwillem# Doxyfile 1.8.11 # This file describes the settings to be used by the documentation system # doxygen (www.doxygen.org) for a project. # # All text after a double hash (##) is considered a comment and is placed in # front of the TAG it is preceding. # # All text after a single hash (#) is considered a comment and will be ignored. # The format is: # TAG = value [value, ...] # For lists, items can also be appended using: # TAG += value [value, ...] # Values that contain spaces should be placed between quotes (\" \"). #--------------------------------------------------------------------------- # Project related configuration options #--------------------------------------------------------------------------- # This tag specifies the encoding used for all characters in the config file # that follow. The default is UTF-8 which is also the encoding used for all text # before the first occurrence of this tag. Doxygen uses libiconv (or the iconv # built into libc) for the transcoding. See http://www.gnu.org/software/libiconv # for the list of possible encodings. # The default value is: UTF-8. DOXYFILE_ENCODING = UTF-8 # The PROJECT_NAME tag is a single word (or a sequence of words surrounded by # double-quotes, unless you are using Doxywizard) that should identify the # project for which the documentation is generated. This name is used in the # title of most generated pages and in a few other places. # The default value is: My Project. PROJECT_NAME = ldns # The PROJECT_NUMBER tag can be used to enter a project or revision number. This # could be handy for archiving the generated documentation or if some version # control system is used. PROJECT_NUMBER = 1.7.0 # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a # quick idea about the purpose of the project. Keep the description short. PROJECT_BRIEF = # With the PROJECT_LOGO tag one can specify a logo or an icon that is included # in the documentation. The maximum height of the logo should not exceed 55 # pixels and the maximum width should not exceed 200 pixels. Doxygen will copy # the logo to the output directory. PROJECT_LOGO = doc/images/LogoInGradientBar2-y100.png # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path # into which the generated documentation will be written. If a relative path is # entered, it will be relative to the location where doxygen was started. If # left blank the current directory will be used. OUTPUT_DIRECTORY = doc/ # If the CREATE_SUBDIRS tag is set to YES then doxygen will create 4096 sub- # directories (in 2 levels) under the output directory of each output format and # will distribute the generated files over these directories. Enabling this # option can be useful when feeding doxygen a huge amount of source files, where # putting all generated files in the same directory would otherwise causes # performance problems for the file system. # The default value is: NO. CREATE_SUBDIRS = NO # If the ALLOW_UNICODE_NAMES tag is set to YES, doxygen will allow non-ASCII # characters to appear in the names of generated files. If set to NO, non-ASCII # characters will be escaped, for example _xE3_x81_x84 will be used for Unicode # U+3044. # The default value is: NO. ALLOW_UNICODE_NAMES = NO # The OUTPUT_LANGUAGE tag is used to specify the language in which all # documentation generated by doxygen is written. Doxygen will use this # information to generate all constant output in the proper language. # Possible values are: Afrikaans, Arabic, Armenian, Brazilian, Catalan, Chinese, # Chinese-Traditional, Croatian, Czech, Danish, Dutch, English (United States), # Esperanto, Farsi (Persian), Finnish, French, German, Greek, Hungarian, # Indonesian, Italian, Japanese, Japanese-en (Japanese with English messages), # Korean, Korean-en (Korean with English messages), Latvian, Lithuanian, # Macedonian, Norwegian, Persian (Farsi), Polish, Portuguese, Romanian, Russian, # Serbian, Serbian-Cyrillic, Slovak, Slovene, Spanish, Swedish, Turkish, # Ukrainian and Vietnamese. # The default value is: English. OUTPUT_LANGUAGE = English # If the BRIEF_MEMBER_DESC tag is set to YES, doxygen will include brief member # descriptions after the members that are listed in the file and class # documentation (similar to Javadoc). Set to NO to disable this. # The default value is: YES. BRIEF_MEMBER_DESC = YES # If the REPEAT_BRIEF tag is set to YES, doxygen will prepend the brief # description of a member or function before the detailed description # # Note: If both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the # brief descriptions will be completely suppressed. # The default value is: YES. REPEAT_BRIEF = YES # This tag implements a quasi-intelligent brief description abbreviator that is # used to form the text in various listings. Each string in this list, if found # as the leading text of the brief description, will be stripped from the text # and the result, after processing the whole list, is used as the annotated # text. Otherwise, the brief description is used as-is. If left blank, the # following values are used ($name is automatically replaced with the name of # the entity):The $name class, The $name widget, The $name file, is, provides, # specifies, contains, represents, a, an and the. ABBREVIATE_BRIEF = # If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then # doxygen will generate a detailed section even if there is only a brief # description. # The default value is: NO. ALWAYS_DETAILED_SEC = NO # If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all # inherited members of a class in the documentation of that class as if those # members were ordinary class members. Constructors, destructors and assignment # operators of the base classes will not be shown. # The default value is: NO. INLINE_INHERITED_MEMB = NO # If the FULL_PATH_NAMES tag is set to YES, doxygen will prepend the full path # before files name in the file list and in the header files. If set to NO the # shortest path that makes the file name unique will be used # The default value is: YES. FULL_PATH_NAMES = YES # The STRIP_FROM_PATH tag can be used to strip a user-defined part of the path. # Stripping is only done if one of the specified strings matches the left-hand # part of the path. The tag can be used to show relative paths in the file list. # If left blank the directory from which doxygen is run is used as the path to # strip. # # Note that you can specify absolute paths here, but also relative paths, which # will be relative from the directory where doxygen is started. # This tag requires that the tag FULL_PATH_NAMES is set to YES. STRIP_FROM_PATH = # The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the # path mentioned in the documentation of a class, which tells the reader which # header file to include in order to use a class. If left blank only the name of # the header file containing the class definition is used. Otherwise one should # specify the list of include paths that are normally passed to the compiler # using the -I flag. STRIP_FROM_INC_PATH = # If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but # less readable) file names. This can be useful is your file systems doesn't # support long names like on DOS, Mac, or CD-ROM. # The default value is: NO. SHORT_NAMES = NO # If the JAVADOC_AUTOBRIEF tag is set to YES then doxygen will interpret the # first line (until the first dot) of a Javadoc-style comment as the brief # description. If set to NO, the Javadoc-style will behave just like regular Qt- # style comments (thus requiring an explicit @brief command for a brief # description.) # The default value is: NO. JAVADOC_AUTOBRIEF = YES # If the QT_AUTOBRIEF tag is set to YES then doxygen will interpret the first # line (until the first dot) of a Qt-style comment as the brief description. If # set to NO, the Qt-style will behave just like regular Qt-style comments (thus # requiring an explicit \brief command for a brief description.) # The default value is: NO. QT_AUTOBRIEF = NO # The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make doxygen treat a # multi-line C++ special comment block (i.e. a block of //! or /// comments) as # a brief description. This used to be the default behavior. The new default is # to treat a multi-line C++ comment block as a detailed description. Set this # tag to YES if you prefer the old behavior instead. # # Note that setting this tag to YES also means that rational rose comments are # not recognized any more. # The default value is: NO. MULTILINE_CPP_IS_BRIEF = NO # If the INHERIT_DOCS tag is set to YES then an undocumented member inherits the # documentation from any documented member that it re-implements. # The default value is: YES. INHERIT_DOCS = YES # If the SEPARATE_MEMBER_PAGES tag is set to YES then doxygen will produce a new # page for each member. If set to NO, the documentation of a member will be part # of the file/class/namespace that contains it. # The default value is: NO. SEPARATE_MEMBER_PAGES = NO # The TAB_SIZE tag can be used to set the number of spaces in a tab. Doxygen # uses this value to replace tabs by spaces in code fragments. # Minimum value: 1, maximum value: 16, default value: 4. TAB_SIZE = 8 # This tag can be used to specify a number of aliases that act as commands in # the documentation. An alias has the form: # name=value # For example adding # "sideeffect=@par Side Effects:\n" # will allow you to put the command \sideeffect (or @sideeffect) in the # documentation, which will result in a user-defined paragraph with heading # "Side Effects:". You can put \n's in the value part of an alias to insert # newlines. ALIASES = # This tag can be used to specify a number of word-keyword mappings (TCL only). # A mapping has the form "name=value". For example adding "class=itcl::class" # will allow you to use the command class in the itcl::class meaning. TCL_SUBST = # Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources # only. Doxygen will then generate output that is more tailored for C. For # instance, some of the names that are used will be different. The list of all # members will be omitted, etc. # The default value is: NO. OPTIMIZE_OUTPUT_FOR_C = YES # Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java or # Python sources only. Doxygen will then generate output that is more tailored # for that language. For instance, namespaces will be presented as packages, # qualified scopes will look different, etc. # The default value is: NO. OPTIMIZE_OUTPUT_JAVA = NO # Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran # sources. Doxygen will then generate output that is tailored for Fortran. # The default value is: NO. OPTIMIZE_FOR_FORTRAN = NO # Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL # sources. Doxygen will then generate output that is tailored for VHDL. # The default value is: NO. OPTIMIZE_OUTPUT_VHDL = NO # Doxygen selects the parser to use depending on the extension of the files it # parses. With this tag you can assign which parser to use for a given # extension. Doxygen has a built-in mapping, but you can override or extend it # using this tag. The format is ext=language, where ext is a file extension, and # language is one of the parsers supported by doxygen: IDL, Java, Javascript, # C#, C, C++, D, PHP, Objective-C, Python, Fortran (fixed format Fortran: # FortranFixed, free formatted Fortran: FortranFree, unknown formatted Fortran: # Fortran. In the later case the parser tries to guess whether the code is fixed # or free formatted code, this is the default for Fortran type files), VHDL. For # instance to make doxygen treat .inc files as Fortran files (default is PHP), # and .f files as C (default is Fortran), use: inc=Fortran f=C. # # Note: For files without extension you can use no_extension as a placeholder. # # Note that for custom extensions you also need to set FILE_PATTERNS otherwise # the files are not read by doxygen. EXTENSION_MAPPING = # If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments # according to the Markdown format, which allows for more readable # documentation. See http://daringfireball.net/projects/markdown/ for details. # The output of markdown processing is further processed by doxygen, so you can # mix doxygen, HTML, and XML commands with Markdown formatting. Disable only in # case of backward compatibilities issues. # The default value is: YES. MARKDOWN_SUPPORT = YES # When enabled doxygen tries to link words that correspond to documented # classes, or namespaces to their corresponding documentation. Such a link can # be prevented in individual cases by putting a % sign in front of the word or # globally by setting AUTOLINK_SUPPORT to NO. # The default value is: YES. AUTOLINK_SUPPORT = YES # If you use STL classes (i.e. std::string, std::vector, etc.) but do not want # to include (a tag file for) the STL sources as input, then you should set this # tag to YES in order to let doxygen match functions declarations and # definitions whose arguments contain STL classes (e.g. func(std::string); # versus func(std::string) {}). This also make the inheritance and collaboration # diagrams that involve STL classes more complete and accurate. # The default value is: NO. BUILTIN_STL_SUPPORT = NO # If you use Microsoft's C++/CLI language, you should set this option to YES to # enable parsing support. # The default value is: NO. CPP_CLI_SUPPORT = NO # Set the SIP_SUPPORT tag to YES if your project consists of sip (see: # http://www.riverbankcomputing.co.uk/software/sip/intro) sources only. Doxygen # will parse them like normal C++ but will assume all classes use public instead # of private inheritance when no explicit protection keyword is present. # The default value is: NO. SIP_SUPPORT = NO # For Microsoft's IDL there are propget and propput attributes to indicate # getter and setter methods for a property. Setting this option to YES will make # doxygen to replace the get and set methods by a property in the documentation. # This will only work if the methods are indeed getting or setting a simple # type. If this is not the case, or you want to show the methods anyway, you # should set this option to NO. # The default value is: YES. IDL_PROPERTY_SUPPORT = YES # If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC # tag is set to YES then doxygen will reuse the documentation of the first # member in the group (if any) for the other members of the group. By default # all members of a group must be documented explicitly. # The default value is: NO. DISTRIBUTE_GROUP_DOC = NO # If one adds a struct or class to a group and this option is enabled, then also # any nested class or struct is added to the same group. By default this option # is disabled and one has to add nested compounds explicitly via \ingroup. # The default value is: NO. GROUP_NESTED_COMPOUNDS = NO # Set the SUBGROUPING tag to YES to allow class member groups of the same type # (for instance a group of public functions) to be put as a subgroup of that # type (e.g. under the Public Functions section). Set it to NO to prevent # subgrouping. Alternatively, this can be done per class using the # \nosubgrouping command. # The default value is: YES. SUBGROUPING = YES # When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and unions # are shown inside the group in which they are included (e.g. using \ingroup) # instead of on a separate page (for HTML and Man pages) or section (for LaTeX # and RTF). # # Note that this feature does not work in combination with # SEPARATE_MEMBER_PAGES. # The default value is: NO. INLINE_GROUPED_CLASSES = NO # When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and unions # with only public data fields or simple typedef fields will be shown inline in # the documentation of the scope in which they are defined (i.e. file, # namespace, or group documentation), provided this scope is documented. If set # to NO, structs, classes, and unions are shown on a separate page (for HTML and # Man pages) or section (for LaTeX and RTF). # The default value is: NO. INLINE_SIMPLE_STRUCTS = NO # When TYPEDEF_HIDES_STRUCT tag is enabled, a typedef of a struct, union, or # enum is documented as struct, union, or enum with the name of the typedef. So # typedef struct TypeS {} TypeT, will appear in the documentation as a struct # with name TypeT. When disabled the typedef will appear as a member of a file, # namespace, or class. And the struct will be named TypeS. This can typically be # useful for C code in case the coding convention dictates that all compound # types are typedef'ed and only the typedef is referenced, never the tag name. # The default value is: NO. TYPEDEF_HIDES_STRUCT = NO # The size of the symbol lookup cache can be set using LOOKUP_CACHE_SIZE. This # cache is used to resolve symbols given their name and scope. Since this can be # an expensive process and often the same symbol appears multiple times in the # code, doxygen keeps a cache of pre-resolved symbols. If the cache is too small # doxygen will become slower. If the cache is too large, memory is wasted. The # cache size is given by this formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range # is 0..9, the default is 0, corresponding to a cache size of 2^16=65536 # symbols. At the end of a run doxygen will report the cache usage and suggest # the optimal cache size from a speed point of view. # Minimum value: 0, maximum value: 9, default value: 0. LOOKUP_CACHE_SIZE = 0 #--------------------------------------------------------------------------- # Build related configuration options #--------------------------------------------------------------------------- # If the EXTRACT_ALL tag is set to YES, doxygen will assume all entities in # documentation are documented, even if no documentation was available. Private # class members and static file members will be hidden unless the # EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES. # Note: This will also disable the warnings about undocumented members that are # normally produced when WARNINGS is set to YES. # The default value is: NO. EXTRACT_ALL = YES # If the EXTRACT_PRIVATE tag is set to YES, all private members of a class will # be included in the documentation. # The default value is: NO. EXTRACT_PRIVATE = NO # If the EXTRACT_PACKAGE tag is set to YES, all members with package or internal # scope will be included in the documentation. # The default value is: NO. EXTRACT_PACKAGE = NO # If the EXTRACT_STATIC tag is set to YES, all static members of a file will be # included in the documentation. # The default value is: NO. EXTRACT_STATIC = NO # If the EXTRACT_LOCAL_CLASSES tag is set to YES, classes (and structs) defined # locally in source files will be included in the documentation. If set to NO, # only classes defined in header files are included. Does not have any effect # for Java sources. # The default value is: YES. EXTRACT_LOCAL_CLASSES = YES # This flag is only useful for Objective-C code. If set to YES, local methods, # which are defined in the implementation section but not in the interface are # included in the documentation. If set to NO, only methods in the interface are # included. # The default value is: NO. EXTRACT_LOCAL_METHODS = NO # If this flag is set to YES, the members of anonymous namespaces will be # extracted and appear in the documentation as a namespace called # 'anonymous_namespace{file}', where file will be replaced with the base name of # the file that contains the anonymous namespace. By default anonymous namespace # are hidden. # The default value is: NO. EXTRACT_ANON_NSPACES = NO # If the HIDE_UNDOC_MEMBERS tag is set to YES, doxygen will hide all # undocumented members inside documented classes or files. If set to NO these # members will be included in the various overviews, but no documentation # section is generated. This option has no effect if EXTRACT_ALL is enabled. # The default value is: NO. HIDE_UNDOC_MEMBERS = NO # If the HIDE_UNDOC_CLASSES tag is set to YES, doxygen will hide all # undocumented classes that are normally visible in the class hierarchy. If set # to NO, these classes will be included in the various overviews. This option # has no effect if EXTRACT_ALL is enabled. # The default value is: NO. HIDE_UNDOC_CLASSES = NO # If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend # (class|struct|union) declarations. If set to NO, these declarations will be # included in the documentation. # The default value is: NO. HIDE_FRIEND_COMPOUNDS = NO # If the HIDE_IN_BODY_DOCS tag is set to YES, doxygen will hide any # documentation blocks found inside the body of a function. If set to NO, these # blocks will be appended to the function's detailed documentation block. # The default value is: NO. HIDE_IN_BODY_DOCS = NO # The INTERNAL_DOCS tag determines if documentation that is typed after a # \internal command is included. If the tag is set to NO then the documentation # will be excluded. Set it to YES to include the internal documentation. # The default value is: NO. INTERNAL_DOCS = NO # If the CASE_SENSE_NAMES tag is set to NO then doxygen will only generate file # names in lower-case letters. If set to YES, upper-case letters are also # allowed. This is useful if you have classes or files whose names only differ # in case and if your file system supports case sensitive file names. Windows # and Mac users are advised to set this option to NO. # The default value is: system dependent. CASE_SENSE_NAMES = YES # If the HIDE_SCOPE_NAMES tag is set to NO then doxygen will show members with # their full class and namespace scopes in the documentation. If set to YES, the # scope will be hidden. # The default value is: NO. HIDE_SCOPE_NAMES = NO # If the HIDE_COMPOUND_REFERENCE tag is set to NO (default) then doxygen will # append additional text to a page's title, such as Class Reference. If set to # YES the compound reference will be hidden. # The default value is: NO. HIDE_COMPOUND_REFERENCE= NO # If the SHOW_INCLUDE_FILES tag is set to YES then doxygen will put a list of # the files that are included by a file in the documentation of that file. # The default value is: YES. SHOW_INCLUDE_FILES = NO # If the SHOW_GROUPED_MEMB_INC tag is set to YES then Doxygen will add for each # grouped member an include statement to the documentation, telling the reader # which file to include in order to use the member. # The default value is: NO. SHOW_GROUPED_MEMB_INC = NO # If the FORCE_LOCAL_INCLUDES tag is set to YES then doxygen will list include # files with double quotes in the documentation rather than with sharp brackets. # The default value is: NO. FORCE_LOCAL_INCLUDES = NO # If the INLINE_INFO tag is set to YES then a tag [inline] is inserted in the # documentation for inline members. # The default value is: YES. INLINE_INFO = YES # If the SORT_MEMBER_DOCS tag is set to YES then doxygen will sort the # (detailed) documentation of file and class members alphabetically by member # name. If set to NO, the members will appear in declaration order. # The default value is: YES. SORT_MEMBER_DOCS = NO # If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the brief # descriptions of file, namespace and class members alphabetically by member # name. If set to NO, the members will appear in declaration order. Note that # this will also influence the order of the classes in the class list. # The default value is: NO. SORT_BRIEF_DOCS = NO # If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the # (brief and detailed) documentation of class members so that constructors and # destructors are listed first. If set to NO the constructors will appear in the # respective orders defined by SORT_BRIEF_DOCS and SORT_MEMBER_DOCS. # Note: If SORT_BRIEF_DOCS is set to NO this option is ignored for sorting brief # member documentation. # Note: If SORT_MEMBER_DOCS is set to NO this option is ignored for sorting # detailed member documentation. # The default value is: NO. SORT_MEMBERS_CTORS_1ST = NO # If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the hierarchy # of group names into alphabetical order. If set to NO the group names will # appear in their defined order. # The default value is: NO. SORT_GROUP_NAMES = NO # If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be sorted by # fully-qualified names, including namespaces. If set to NO, the class list will # be sorted only by class name, not including the namespace part. # Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. # Note: This option applies only to the class list, not to the alphabetical # list. # The default value is: NO. SORT_BY_SCOPE_NAME = NO # If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to do proper # type resolution of all parameters of a function it will reject a match between # the prototype and the implementation of a member function even if there is # only one candidate or it is obvious which candidate to choose by doing a # simple string match. By disabling STRICT_PROTO_MATCHING doxygen will still # accept a match between prototype and implementation in such cases. # The default value is: NO. STRICT_PROTO_MATCHING = NO # The GENERATE_TODOLIST tag can be used to enable (YES) or disable (NO) the todo # list. This list is created by putting \todo commands in the documentation. # The default value is: YES. GENERATE_TODOLIST = YES # The GENERATE_TESTLIST tag can be used to enable (YES) or disable (NO) the test # list. This list is created by putting \test commands in the documentation. # The default value is: YES. GENERATE_TESTLIST = YES # The GENERATE_BUGLIST tag can be used to enable (YES) or disable (NO) the bug # list. This list is created by putting \bug commands in the documentation. # The default value is: YES. GENERATE_BUGLIST = YES # The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or disable (NO) # the deprecated list. This list is created by putting \deprecated commands in # the documentation. # The default value is: YES. GENERATE_DEPRECATEDLIST= YES # The ENABLED_SECTIONS tag can be used to enable conditional documentation # sections, marked by \if ... \endif and \cond # ... \endcond blocks. ENABLED_SECTIONS = # The MAX_INITIALIZER_LINES tag determines the maximum number of lines that the # initial value of a variable or macro / define can have for it to appear in the # documentation. If the initializer consists of more lines than specified here # it will be hidden. Use a value of 0 to hide initializers completely. The # appearance of the value of individual variables and macros / defines can be # controlled using \showinitializer or \hideinitializer command in the # documentation regardless of this setting. # Minimum value: 0, maximum value: 10000, default value: 30. MAX_INITIALIZER_LINES = 30 # Set the SHOW_USED_FILES tag to NO to disable the list of files generated at # the bottom of the documentation of classes and structs. If set to YES, the # list will mention the files that were used to generate the documentation. # The default value is: YES. SHOW_USED_FILES = NO # Set the SHOW_FILES tag to NO to disable the generation of the Files page. This # will remove the Files entry from the Quick Index and from the Folder Tree View # (if specified). # The default value is: YES. SHOW_FILES = YES # Set the SHOW_NAMESPACES tag to NO to disable the generation of the Namespaces # page. This will remove the Namespaces entry from the Quick Index and from the # Folder Tree View (if specified). # The default value is: YES. SHOW_NAMESPACES = YES # The FILE_VERSION_FILTER tag can be used to specify a program or script that # doxygen should invoke to get the current version for each file (typically from # the version control system). Doxygen will invoke the program by executing (via # popen()) the command command input-file, where command is the value of the # FILE_VERSION_FILTER tag, and input-file is the name of an input file provided # by doxygen. Whatever the program writes to standard output is used as the file # version. For an example see the documentation. FILE_VERSION_FILTER = # The LAYOUT_FILE tag can be used to specify a layout file which will be parsed # by doxygen. The layout file controls the global structure of the generated # output files in an output format independent way. To create the layout file # that represents doxygen's defaults, run doxygen with the -l option. You can # optionally specify a file name after the option, if omitted DoxygenLayout.xml # will be used as the name of the layout file. # # Note that if you run doxygen from a directory containing a file called # DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE # tag is left empty. LAYOUT_FILE = # The CITE_BIB_FILES tag can be used to specify one or more bib files containing # the reference definitions. This must be a list of .bib files. The .bib # extension is automatically appended if omitted. This requires the bibtex tool # to be installed. See also http://en.wikipedia.org/wiki/BibTeX for more info. # For LaTeX the style of the bibliography can be controlled using # LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the # search path. See also \cite for info how to create references. CITE_BIB_FILES = #--------------------------------------------------------------------------- # Configuration options related to warning and progress messages #--------------------------------------------------------------------------- # The QUIET tag can be used to turn on/off the messages that are generated to # standard output by doxygen. If QUIET is set to YES this implies that the # messages are off. # The default value is: NO. QUIET = YES # The WARNINGS tag can be used to turn on/off the warning messages that are # generated to standard error (stderr) by doxygen. If WARNINGS is set to YES # this implies that the warnings are on. # # Tip: Turn warnings on while writing the documentation. # The default value is: YES. WARNINGS = YES # If the WARN_IF_UNDOCUMENTED tag is set to YES then doxygen will generate # warnings for undocumented members. If EXTRACT_ALL is set to YES then this flag # will automatically be disabled. # The default value is: YES. WARN_IF_UNDOCUMENTED = YES # If the WARN_IF_DOC_ERROR tag is set to YES, doxygen will generate warnings for # potential errors in the documentation, such as not documenting some parameters # in a documented function, or documenting parameters that don't exist or using # markup commands wrongly. # The default value is: YES. WARN_IF_DOC_ERROR = YES # This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that # are documented, but have no documentation for their parameters or return # value. If set to NO, doxygen will only warn about wrong or incomplete # parameter documentation, but not about the absence of documentation. # The default value is: NO. WARN_NO_PARAMDOC = NO # If the WARN_AS_ERROR tag is set to YES then doxygen will immediately stop when # a warning is encountered. # The default value is: NO. WARN_AS_ERROR = NO # The WARN_FORMAT tag determines the format of the warning messages that doxygen # can produce. The string should contain the $file, $line, and $text tags, which # will be replaced by the file and line number from which the warning originated # and the warning text. Optionally the format may contain $version, which will # be replaced by the version of the file (if it could be obtained via # FILE_VERSION_FILTER) # The default value is: $file:$line: $text. WARN_FORMAT = "doxygen: $file:$line: $text" # The WARN_LOGFILE tag can be used to specify a file to which warning and error # messages should be written. If left blank the output is written to standard # error (stderr). WARN_LOGFILE = #--------------------------------------------------------------------------- # Configuration options related to the input files #--------------------------------------------------------------------------- # The INPUT tag is used to specify the files and/or directories that contain # documented source files. You may enter file names like myfile.cpp or # directories like /usr/src/myproject. Separate the files or directories with # spaces. See also FILE_PATTERNS and EXTENSION_MAPPING # Note: If this tag is empty the current directory is searched. INPUT = . \ ldns/ \ doc/ \ examples/ldns-mx.c \ examples/ldns-read-zone.c \ examples/ldns-signzone.c # This tag can be used to specify the character encoding of the source files # that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses # libiconv (or the iconv built into libc) for the transcoding. See the libiconv # documentation (see: http://www.gnu.org/software/libiconv) for the list of # possible encodings. # The default value is: UTF-8. INPUT_ENCODING = UTF-8 # If the value of the INPUT tag contains directories, you can use the # FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and # *.h) to filter out the source-files in the directories. # # Note that for custom extensions or not directly supported extensions you also # need to set EXTENSION_MAPPING for the extension otherwise the files are not # read by doxygen. # # If left blank the following patterns are tested:*.c, *.cc, *.cxx, *.cpp, # *.c++, *.java, *.ii, *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h, # *.hh, *.hxx, *.hpp, *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc, # *.m, *.markdown, *.md, *.mm, *.dox, *.py, *.pyw, *.f90, *.f, *.for, *.tcl, # *.vhd, *.vhdl, *.ucf, *.qsf, *.as and *.js. FILE_PATTERNS = # The RECURSIVE tag can be used to specify whether or not subdirectories should # be searched for input files as well. # The default value is: NO. RECURSIVE = NO # The EXCLUDE tag can be used to specify files and/or directories that should be # excluded from the INPUT source files. This way you can easily exclude a # subdirectory from a directory tree whose root is specified with the INPUT tag. # # Note that relative paths are relative to the directory from which doxygen is # run. EXCLUDE = # The EXCLUDE_SYMLINKS tag can be used to select whether or not files or # directories that are symbolic links (a Unix file system feature) are excluded # from the input. # The default value is: NO. EXCLUDE_SYMLINKS = NO # If the value of the INPUT tag contains directories, you can use the # EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude # certain files from those directories. # # Note that the wildcards are matched against the file with absolute path, so to # exclude all test directories for example use the pattern */test/* EXCLUDE_PATTERNS = # The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names # (namespaces, classes, functions, etc.) that should be excluded from the # output. The symbol name can be a fully qualified name, a word, or if the # wildcard * is used, a substring. Examples: ANamespace, AClass, # AClass::ANamespace, ANamespace::*Test # # Note that the wildcards are matched against the file with absolute path, so to # exclude all test directories use the pattern */test/* EXCLUDE_SYMBOLS = # The EXAMPLE_PATH tag can be used to specify one or more files or directories # that contain example code fragments that are included (see the \include # command). EXAMPLE_PATH = examples # If the value of the EXAMPLE_PATH tag contains directories, you can use the # EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and # *.h) to filter out the source-files in the directories. If left blank all # files are included. EXAMPLE_PATTERNS = # If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be # searched for input files to be used with the \include or \dontinclude commands # irrespective of the value of the RECURSIVE tag. # The default value is: NO. EXAMPLE_RECURSIVE = NO # The IMAGE_PATH tag can be used to specify one or more files or directories # that contain images that are to be included in the documentation (see the # \image command). IMAGE_PATH = doc/images # The INPUT_FILTER tag can be used to specify a program that doxygen should # invoke to filter for each input file. Doxygen will invoke the filter program # by executing (via popen()) the command: # # # # where is the value of the INPUT_FILTER tag, and is the # name of an input file. Doxygen will then use the output that the filter # program writes to standard output. If FILTER_PATTERNS is specified, this tag # will be ignored. # # Note that the filter must not add or remove lines; it is applied before the # code is scanned, but not when the output code is generated. If lines are added # or removed, the anchors will not be placed correctly. # # Note that for custom extensions or not directly supported extensions you also # need to set EXTENSION_MAPPING for the extension otherwise the files are not # properly processed by doxygen. INPUT_FILTER = # The FILTER_PATTERNS tag can be used to specify filters on a per file pattern # basis. Doxygen will compare the file name with each pattern and apply the # filter if there is a match. The filters are a list of the form: pattern=filter # (like *.cpp=my_cpp_filter). See INPUT_FILTER for further information on how # filters are used. If the FILTER_PATTERNS tag is empty or if none of the # patterns match the file name, INPUT_FILTER is applied. # # Note that for custom extensions or not directly supported extensions you also # need to set EXTENSION_MAPPING for the extension otherwise the files are not # properly processed by doxygen. FILTER_PATTERNS = # If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using # INPUT_FILTER) will also be used to filter the input files that are used for # producing the source files to browse (i.e. when SOURCE_BROWSER is set to YES). # The default value is: NO. FILTER_SOURCE_FILES = NO # The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file # pattern. A pattern will override the setting for FILTER_PATTERN (if any) and # it is also possible to disable source filtering for a specific pattern using # *.ext= (so without naming a filter). # This tag requires that the tag FILTER_SOURCE_FILES is set to YES. FILTER_SOURCE_PATTERNS = # If the USE_MDFILE_AS_MAINPAGE tag refers to the name of a markdown file that # is part of the input, its contents will be placed on the main page # (index.html). This can be useful if you have a project on for instance GitHub # and want to reuse the introduction page also for the doxygen output. USE_MDFILE_AS_MAINPAGE = #--------------------------------------------------------------------------- # Configuration options related to source browsing #--------------------------------------------------------------------------- # If the SOURCE_BROWSER tag is set to YES then a list of source files will be # generated. Documented entities will be cross-referenced with these sources. # # Note: To get rid of all source code in the generated output, make sure that # also VERBATIM_HEADERS is set to NO. # The default value is: NO. SOURCE_BROWSER = YES # Setting the INLINE_SOURCES tag to YES will include the body of functions, # classes and enums directly into the documentation. # The default value is: NO. INLINE_SOURCES = NO # Setting the STRIP_CODE_COMMENTS tag to YES will instruct doxygen to hide any # special comment blocks from generated source code fragments. Normal C, C++ and # Fortran comments will always remain visible. # The default value is: YES. STRIP_CODE_COMMENTS = YES # If the REFERENCED_BY_RELATION tag is set to YES then for each documented # function all documented functions referencing it will be listed. # The default value is: NO. REFERENCED_BY_RELATION = NO # If the REFERENCES_RELATION tag is set to YES then for each documented function # all documented entities called/used by that function will be listed. # The default value is: NO. REFERENCES_RELATION = YES # If the REFERENCES_LINK_SOURCE tag is set to YES and SOURCE_BROWSER tag is set # to YES then the hyperlinks from functions in REFERENCES_RELATION and # REFERENCED_BY_RELATION lists will link to the source code. Otherwise they will # link to the documentation. # The default value is: YES. REFERENCES_LINK_SOURCE = YES # If SOURCE_TOOLTIPS is enabled (the default) then hovering a hyperlink in the # source code will show a tooltip with additional information such as prototype, # brief description and links to the definition and documentation. Since this # will make the HTML file larger and loading of large files a bit slower, you # can opt to disable this feature. # The default value is: YES. # This tag requires that the tag SOURCE_BROWSER is set to YES. SOURCE_TOOLTIPS = YES # If the USE_HTAGS tag is set to YES then the references to source code will # point to the HTML generated by the htags(1) tool instead of doxygen built-in # source browser. The htags tool is part of GNU's global source tagging system # (see http://www.gnu.org/software/global/global.html). You will need version # 4.8.6 or higher. # # To use it do the following: # - Install the latest version of global # - Enable SOURCE_BROWSER and USE_HTAGS in the config file # - Make sure the INPUT points to the root of the source tree # - Run doxygen as normal # # Doxygen will invoke htags (and that will in turn invoke gtags), so these # tools must be available from the command line (i.e. in the search path). # # The result: instead of the source browser generated by doxygen, the links to # source code will now point to the output of htags. # The default value is: NO. # This tag requires that the tag SOURCE_BROWSER is set to YES. USE_HTAGS = NO # If the VERBATIM_HEADERS tag is set the YES then doxygen will generate a # verbatim copy of the header file for each class for which an include is # specified. Set to NO to disable this. # See also: Section \class. # The default value is: YES. VERBATIM_HEADERS = YES # If the CLANG_ASSISTED_PARSING tag is set to YES then doxygen will use the # clang parser (see: http://clang.llvm.org/) for more accurate parsing at the # cost of reduced performance. This can be particularly helpful with template # rich C++ code for which doxygen's built-in parser lacks the necessary type # information. # Note: The availability of this option depends on whether or not doxygen was # generated with the -Duse-libclang=ON option for CMake. # The default value is: NO. CLANG_ASSISTED_PARSING = NO # If clang assisted parsing is enabled you can provide the compiler with command # line options that you would normally use when invoking the compiler. Note that # the include paths will already be set by doxygen for the files and directories # specified with INPUT and INCLUDE_PATH. # This tag requires that the tag CLANG_ASSISTED_PARSING is set to YES. CLANG_OPTIONS = #--------------------------------------------------------------------------- # Configuration options related to the alphabetical class index #--------------------------------------------------------------------------- # If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index of all # compounds will be generated. Enable this if the project contains a lot of # classes, structs, unions or interfaces. # The default value is: YES. ALPHABETICAL_INDEX = YES # The COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns in # which the alphabetical index list will be split. # Minimum value: 1, maximum value: 20, default value: 5. # This tag requires that the tag ALPHABETICAL_INDEX is set to YES. COLS_IN_ALPHA_INDEX = 3 # In case all classes in a project start with a common prefix, all classes will # be put under the same header in the alphabetical index. The IGNORE_PREFIX tag # can be used to specify a prefix (or a list of prefixes) that should be ignored # while generating the index headers. # This tag requires that the tag ALPHABETICAL_INDEX is set to YES. IGNORE_PREFIX = ldns_ #--------------------------------------------------------------------------- # Configuration options related to the HTML output #--------------------------------------------------------------------------- # If the GENERATE_HTML tag is set to YES, doxygen will generate HTML output # The default value is: YES. GENERATE_HTML = YES # The HTML_OUTPUT tag is used to specify where the HTML docs will be put. If a # relative path is entered the value of OUTPUT_DIRECTORY will be put in front of # it. # The default directory is: html. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_OUTPUT = html # The HTML_FILE_EXTENSION tag can be used to specify the file extension for each # generated HTML page (for example: .htm, .php, .asp). # The default value is: .html. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_FILE_EXTENSION = .html # The HTML_HEADER tag can be used to specify a user-defined HTML header file for # each generated HTML page. If the tag is left blank doxygen will generate a # standard header. # # To get valid HTML the header file that includes any scripts and style sheets # that doxygen needs, which is dependent on the configuration options used (e.g. # the setting GENERATE_TREEVIEW). It is highly recommended to start with a # default header using # doxygen -w html new_header.html new_footer.html new_stylesheet.css # YourConfigFile # and then modify the file new_header.html. See also section "Doxygen usage" # for information on how to generate the default header that doxygen normally # uses. # Note: The header is subject to change so you typically have to regenerate the # default header when upgrading to a newer version of doxygen. For a description # of the possible markers and block names see the documentation. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_HEADER = doc/header.html # The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each # generated HTML page. If the tag is left blank doxygen will generate a standard # footer. See HTML_HEADER for more information on how to generate a default # footer and what special commands can be used inside the footer. See also # section "Doxygen usage" for information on how to generate the default footer # that doxygen normally uses. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_FOOTER = # The HTML_STYLESHEET tag can be used to specify a user-defined cascading style # sheet that is used by each HTML page. It can be used to fine-tune the look of # the HTML output. If left blank doxygen will generate a default style sheet. # See also section "Doxygen usage" for information on how to generate the style # sheet that doxygen normally uses. # Note: It is recommended to use HTML_EXTRA_STYLESHEET instead of this tag, as # it is more robust and this tag (HTML_STYLESHEET) will in the future become # obsolete. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_STYLESHEET = # The HTML_EXTRA_STYLESHEET tag can be used to specify additional user-defined # cascading style sheets that are included after the standard style sheets # created by doxygen. Using this option one can overrule certain style aspects. # This is preferred over using HTML_STYLESHEET since it does not replace the # standard style sheet and is therefore more robust against future updates. # Doxygen will copy the style sheet files to the output directory. # Note: The order of the extra style sheet files is of importance (e.g. the last # style sheet in the list overrules the setting of the previous ones in the # list). For an example see the documentation. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_EXTRA_STYLESHEET = # The HTML_EXTRA_FILES tag can be used to specify one or more extra images or # other source files which should be copied to the HTML output directory. Note # that these files will be copied to the base HTML output directory. Use the # $relpath^ marker in the HTML_HEADER and/or HTML_FOOTER files to load these # files. In the HTML_STYLESHEET file, use the file name only. Also note that the # files will be copied as-is; there are no commands or markers available. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_EXTRA_FILES = # The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen # will adjust the colors in the style sheet and background images according to # this color. Hue is specified as an angle on a colorwheel, see # http://en.wikipedia.org/wiki/Hue for more information. For instance the value # 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300 # purple, and 360 is red again. # Minimum value: 0, maximum value: 359, default value: 220. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_COLORSTYLE_HUE = 220 # The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of the colors # in the HTML output. For a value of 0 the output will use grayscales only. A # value of 255 will produce the most vivid colors. # Minimum value: 0, maximum value: 255, default value: 100. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_COLORSTYLE_SAT = 100 # The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to the # luminance component of the colors in the HTML output. Values below 100 # gradually make the output lighter, whereas values above 100 make the output # darker. The value divided by 100 is the actual gamma applied, so 80 represents # a gamma of 0.8, The value 220 represents a gamma of 2.2, and 100 does not # change the gamma. # Minimum value: 40, maximum value: 240, default value: 80. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_COLORSTYLE_GAMMA = 80 # If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML # page will contain the date and time when the page was generated. Setting this # to YES can help to show when doxygen was last run and thus if the # documentation is up to date. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_TIMESTAMP = YES # If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML # documentation will contain sections that can be hidden and shown after the # page has loaded. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_DYNAMIC_SECTIONS = NO # With HTML_INDEX_NUM_ENTRIES one can control the preferred number of entries # shown in the various tree structured indices initially; the user can expand # and collapse entries dynamically later on. Doxygen will expand the tree to # such a level that at most the specified number of entries are visible (unless # a fully collapsed tree already exceeds this amount). So setting the number of # entries 1 will produce a full collapsed tree by default. 0 is a special value # representing an infinite number of entries and will result in a full expanded # tree by default. # Minimum value: 0, maximum value: 9999, default value: 100. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_INDEX_NUM_ENTRIES = 100 # If the GENERATE_DOCSET tag is set to YES, additional index files will be # generated that can be used as input for Apple's Xcode 3 integrated development # environment (see: http://developer.apple.com/tools/xcode/), introduced with # OSX 10.5 (Leopard). To create a documentation set, doxygen will generate a # Makefile in the HTML output directory. Running make will produce the docset in # that directory and running make install will install the docset in # ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find it at # startup. See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html # for more information. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. GENERATE_DOCSET = NO # This tag determines the name of the docset feed. A documentation feed provides # an umbrella under which multiple documentation sets from a single provider # (such as a company or product suite) can be grouped. # The default value is: Doxygen generated docs. # This tag requires that the tag GENERATE_DOCSET is set to YES. DOCSET_FEEDNAME = "Doxygen generated docs" # This tag specifies a string that should uniquely identify the documentation # set bundle. This should be a reverse domain-name style string, e.g. # com.mycompany.MyDocSet. Doxygen will append .docset to the name. # The default value is: org.doxygen.Project. # This tag requires that the tag GENERATE_DOCSET is set to YES. DOCSET_BUNDLE_ID = org.doxygen.Project # The DOCSET_PUBLISHER_ID tag specifies a string that should uniquely identify # the documentation publisher. This should be a reverse domain-name style # string, e.g. com.mycompany.MyDocSet.documentation. # The default value is: org.doxygen.Publisher. # This tag requires that the tag GENERATE_DOCSET is set to YES. DOCSET_PUBLISHER_ID = org.doxygen.Publisher # The DOCSET_PUBLISHER_NAME tag identifies the documentation publisher. # The default value is: Publisher. # This tag requires that the tag GENERATE_DOCSET is set to YES. DOCSET_PUBLISHER_NAME = Publisher # If the GENERATE_HTMLHELP tag is set to YES then doxygen generates three # additional HTML index files: index.hhp, index.hhc, and index.hhk. The # index.hhp is a project file that can be read by Microsoft's HTML Help Workshop # (see: http://www.microsoft.com/en-us/download/details.aspx?id=21138) on # Windows. # # The HTML Help Workshop contains a compiler that can convert all HTML output # generated by doxygen into a single compiled HTML file (.chm). Compiled HTML # files are now used as the Windows 98 help format, and will replace the old # Windows help format (.hlp) on all Windows platforms in the future. Compressed # HTML files also contain an index, a table of contents, and you can search for # words in the documentation. The HTML workshop also contains a viewer for # compressed HTML files. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. GENERATE_HTMLHELP = NO # The CHM_FILE tag can be used to specify the file name of the resulting .chm # file. You can add a path in front of the file if the result should not be # written to the html output directory. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. CHM_FILE = # The HHC_LOCATION tag can be used to specify the location (absolute path # including file name) of the HTML help compiler (hhc.exe). If non-empty, # doxygen will try to run the HTML help compiler on the generated index.hhp. # The file has to be specified with full path. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. HHC_LOCATION = # The GENERATE_CHI flag controls if a separate .chi index file is generated # (YES) or that it should be included in the master .chm file (NO). # The default value is: NO. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. GENERATE_CHI = NO # The CHM_INDEX_ENCODING is used to encode HtmlHelp index (hhk), content (hhc) # and project file content. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. CHM_INDEX_ENCODING = # The BINARY_TOC flag controls whether a binary table of contents is generated # (YES) or a normal table of contents (NO) in the .chm file. Furthermore it # enables the Previous and Next buttons. # The default value is: NO. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. BINARY_TOC = NO # The TOC_EXPAND flag can be set to YES to add extra items for group members to # the table of contents of the HTML help documentation and to the tree view. # The default value is: NO. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. TOC_EXPAND = NO # If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and # QHP_VIRTUAL_FOLDER are set, an additional index file will be generated that # can be used as input for Qt's qhelpgenerator to generate a Qt Compressed Help # (.qch) of the generated HTML documentation. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. GENERATE_QHP = NO # If the QHG_LOCATION tag is specified, the QCH_FILE tag can be used to specify # the file name of the resulting .qch file. The path specified is relative to # the HTML output folder. # This tag requires that the tag GENERATE_QHP is set to YES. QCH_FILE = # The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help # Project output. For more information please see Qt Help Project / Namespace # (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#namespace). # The default value is: org.doxygen.Project. # This tag requires that the tag GENERATE_QHP is set to YES. QHP_NAMESPACE = org.doxygen.Project # The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt # Help Project output. For more information please see Qt Help Project / Virtual # Folders (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#virtual- # folders). # The default value is: doc. # This tag requires that the tag GENERATE_QHP is set to YES. QHP_VIRTUAL_FOLDER = doc # If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom # filter to add. For more information please see Qt Help Project / Custom # Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom- # filters). # This tag requires that the tag GENERATE_QHP is set to YES. QHP_CUST_FILTER_NAME = # The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the # custom filter to add. For more information please see Qt Help Project / Custom # Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom- # filters). # This tag requires that the tag GENERATE_QHP is set to YES. QHP_CUST_FILTER_ATTRS = # The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this # project's filter section matches. Qt Help Project / Filter Attributes (see: # http://qt-project.org/doc/qt-4.8/qthelpproject.html#filter-attributes). # This tag requires that the tag GENERATE_QHP is set to YES. QHP_SECT_FILTER_ATTRS = # The QHG_LOCATION tag can be used to specify the location of Qt's # qhelpgenerator. If non-empty doxygen will try to run qhelpgenerator on the # generated .qhp file. # This tag requires that the tag GENERATE_QHP is set to YES. QHG_LOCATION = # If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files will be # generated, together with the HTML files, they form an Eclipse help plugin. To # install this plugin and make it available under the help contents menu in # Eclipse, the contents of the directory containing the HTML and XML files needs # to be copied into the plugins directory of eclipse. The name of the directory # within the plugins directory should be the same as the ECLIPSE_DOC_ID value. # After copying Eclipse needs to be restarted before the help appears. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. GENERATE_ECLIPSEHELP = NO # A unique identifier for the Eclipse help plugin. When installing the plugin # the directory name containing the HTML and XML files should also have this # name. Each documentation set should have its own identifier. # The default value is: org.doxygen.Project. # This tag requires that the tag GENERATE_ECLIPSEHELP is set to YES. ECLIPSE_DOC_ID = org.doxygen.Project # If you want full control over the layout of the generated HTML pages it might # be necessary to disable the index and replace it with your own. The # DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) at top # of each HTML page. A value of NO enables the index and the value YES disables # it. Since the tabs in the index contain the same information as the navigation # tree, you can set this option to YES if you also set GENERATE_TREEVIEW to YES. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. DISABLE_INDEX = NO # The GENERATE_TREEVIEW tag is used to specify whether a tree-like index # structure should be generated to display hierarchical information. If the tag # value is set to YES, a side panel will be generated containing a tree-like # index structure (just like the one that is generated for HTML Help). For this # to work a browser that supports JavaScript, DHTML, CSS and frames is required # (i.e. any modern browser). Windows users are probably better off using the # HTML help feature. Via custom style sheets (see HTML_EXTRA_STYLESHEET) one can # further fine-tune the look of the index. As an example, the default style # sheet generated by doxygen has an example that shows how to put an image at # the root of the tree instead of the PROJECT_NAME. Since the tree basically has # the same information as the tab index, you could consider setting # DISABLE_INDEX to YES when enabling this option. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. GENERATE_TREEVIEW = NO # The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values that # doxygen will group on one line in the generated HTML documentation. # # Note that a value of 0 will completely suppress the enum values from appearing # in the overview section. # Minimum value: 0, maximum value: 20, default value: 4. # This tag requires that the tag GENERATE_HTML is set to YES. ENUM_VALUES_PER_LINE = 4 # If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be used # to set the initial width (in pixels) of the frame in which the tree is shown. # Minimum value: 0, maximum value: 1500, default value: 250. # This tag requires that the tag GENERATE_HTML is set to YES. TREEVIEW_WIDTH = 250 # If the EXT_LINKS_IN_WINDOW option is set to YES, doxygen will open links to # external symbols imported via tag files in a separate window. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. EXT_LINKS_IN_WINDOW = NO # Use this tag to change the font size of LaTeX formulas included as images in # the HTML documentation. When you change the font size after a successful # doxygen run you need to manually remove any form_*.png images from the HTML # output directory to force them to be regenerated. # Minimum value: 8, maximum value: 50, default value: 10. # This tag requires that the tag GENERATE_HTML is set to YES. FORMULA_FONTSIZE = 10 # Use the FORMULA_TRANPARENT tag to determine whether or not the images # generated for formulas are transparent PNGs. Transparent PNGs are not # supported properly for IE 6.0, but are supported on all modern browsers. # # Note that when changing this option you need to delete any form_*.png files in # the HTML output directory before the changes have effect. # The default value is: YES. # This tag requires that the tag GENERATE_HTML is set to YES. FORMULA_TRANSPARENT = YES # Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see # http://www.mathjax.org) which uses client side Javascript for the rendering # instead of using pre-rendered bitmaps. Use this if you do not have LaTeX # installed or if you want to formulas look prettier in the HTML output. When # enabled you may also need to install MathJax separately and configure the path # to it using the MATHJAX_RELPATH option. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. USE_MATHJAX = NO # When MathJax is enabled you can set the default output format to be used for # the MathJax output. See the MathJax site (see: # http://docs.mathjax.org/en/latest/output.html) for more details. # Possible values are: HTML-CSS (which is slower, but has the best # compatibility), NativeMML (i.e. MathML) and SVG. # The default value is: HTML-CSS. # This tag requires that the tag USE_MATHJAX is set to YES. MATHJAX_FORMAT = HTML-CSS # When MathJax is enabled you need to specify the location relative to the HTML # output directory using the MATHJAX_RELPATH option. The destination directory # should contain the MathJax.js script. For instance, if the mathjax directory # is located at the same level as the HTML output directory, then # MATHJAX_RELPATH should be ../mathjax. The default value points to the MathJax # Content Delivery Network so you can quickly see the result without installing # MathJax. However, it is strongly recommended to install a local copy of # MathJax from http://www.mathjax.org before deployment. # The default value is: http://cdn.mathjax.org/mathjax/latest. # This tag requires that the tag USE_MATHJAX is set to YES. MATHJAX_RELPATH = http://www.mathjax.org/mathjax # The MATHJAX_EXTENSIONS tag can be used to specify one or more MathJax # extension names that should be enabled during MathJax rendering. For example # MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols # This tag requires that the tag USE_MATHJAX is set to YES. MATHJAX_EXTENSIONS = # The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces # of code that will be used on startup of the MathJax code. See the MathJax site # (see: http://docs.mathjax.org/en/latest/output.html) for more details. For an # example see the documentation. # This tag requires that the tag USE_MATHJAX is set to YES. MATHJAX_CODEFILE = # When the SEARCHENGINE tag is enabled doxygen will generate a search box for # the HTML output. The underlying search engine uses javascript and DHTML and # should work on any modern browser. Note that when using HTML help # (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets (GENERATE_DOCSET) # there is already a search function so this one should typically be disabled. # For large projects the javascript based search engine can be slow, then # enabling SERVER_BASED_SEARCH may provide a better solution. It is possible to # search using the keyboard; to jump to the search box use + S # (what the is depends on the OS and browser, but it is typically # , /