]> git.pld-linux.org Git - packages/dhcp.git/commitdiff
- updated from fedora
authorArkadiusz Miśkiewicz <arekm@maven.pl>
Sun, 3 Feb 2008 18:23:06 +0000 (18:23 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    dhcp-ldap.patch -> 1.7
    dhcp-libdhcp4client.patch -> 1.4

dhcp-ldap.patch
dhcp-libdhcp4client.patch

index 48db234ab8fc0fa06d373f0e4f97e233cad6f907..7b71ea70a7f8107c6f5ef94a223b421e5e3c8c91 100644 (file)
-diff -Naur dhcp-3.0.5/Changelog-LDAP dhcp-3.0.5-ldap/Changelog-LDAP
---- dhcp-3.0.5/Changelog-LDAP  1969-12-31 19:00:00.000000000 -0500
-+++ dhcp-3.0.5-ldap/Changelog-LDAP     2007-02-23 14:06:33.000000000 -0500
-@@ -0,0 +1,251 @@
-+2007-2-23 Brian Masney <masneyb@ntelos.net>
-+      * contrib/dhcpd-conf-to-ldap.pl - fixed a parsing bug in which
-+      didn't handle correctly quoted string containing spaces.
-+      (Rapha?l Luta <raphael.luta@aptiwan.com>)
-+
-+      * dst/Makefile.dist server/Makefile.dist site.conf - updated build
-+      method when using -lssl.
-+      (from Marius Tomaschewski <mt@suse.de>)
-+
-+      * server/ldap.c - fix for ldap_read_function to avoid returning
-+      empty strings (skipped host declaration from ldap) that are causing
-+      parsing errors in ldap-dynamic mode.
-+      (from Marius Tomaschewski <mt@suse.de>)
-+
-+      * includes/dhcpd.h README.ldap server/dhcpd.c server/ldap.c
-+      server/stables.c - added ldap-ssl <off|start_tls|ldaps|on> option and
-+        several ldap-tls* options, that are described in the "man ldap.conf".
-+      (from Marius Tomaschewski <mt@suse.de>)
-+
-+      * includes/dhcpd.h server/ldap.c server/stables.c - added ldap-referrals
-+      <on|off> option. Also implemented a LDAP rebuind function
-+      (from Kalyan <skalyanasundaram@novell.com>)
-+
-+      * includes/dhcpd.h server/ldap.c server/stables.c - renamed dhcpd.conf
-+      option ldap-server-cn to ldap-dhcp-server-cn
-+      (from Marius Tomaschewski <mt@suse.de>)
-+
-+      * contrib/dhcp.schema - schema updates 
-+      (from Kalyan <skalyanasundaram@novell.com>)
-+
-+      * server/ldap.c server/ldap_casa.c - CASA support fixes
-+      (from Marius Tomaschewski <mt@suse.de>)
-+
-+      * server/ldap.c - added strncat() fix
-+      (from Marius Tomaschewski <mt@suse.de>)
-+
-+2006-12-15 Brian Masney <masneyb@ntelos.net>
-+      * server/ldap.c (ldap_read_config) - unbind from the LDAP server after
-+      the config file has been ran if the server is being ran in static mode
-+      (from Tomas Hoger <thoger@pobox.sk>)
-+
-+      * server/ldap.c (ldap_read_function) - fixed bug where the entire
-+      configuration was not being processed in the LDAP directory.
-+
-+      * server/ldap.c - added the following functions for reading values
-+      from the config file: _do_lookup_dhcp_string_option(),
-+      _do_lookup_dhcp_int_option() and _do_lookup_dhcp_enum_option(). This
-+      helped to clean up ldap_start() start a bit. Also, various small
-+      formatting changes to the code.
-+
-+2006-12-15 Marius Tomaschewski <mt@suse.de>
-+      * Changelog-LDAP - Added / changed some of entries in
-+      Changelog-LDAP, e.g.  changes to the dhcpServer and
-+      dhcpService objectclasses in schema file was not mentioned.
-+
-+        * server/ldap.c Some a little bit paranoid checks to strchr results
-+      in the group patch, avoided allocation of groupname using snprintf
-+      with a "%.*s" format.
-+
-+        * server/ldap.c - Readded FIXME comment about one space in
-+      dhcpHWAddress.
-+
-+        * server/ldap.c Changed "dhcpdnsZone" and "dhcpdnszoneServer" into
-+      "dhcpDnsZone" and "dhcpDnsZoneServer".
-+
-+        * Fixed memory leak in ldap_parse_zone (dfree of keyCn), added checks
-+      for dmalloc and strchr results.
-+
-+      * ldap_casa.c, ldap_casa.h - surrounded content of ldap_casa.h and
-+      ldap_casa.c with if defined(LDAP_CASA_AUTH).
-+
-+      * contrib/dhcp.schema  - Reverted the equality change for dhcpOption.
-+      The dhcp options are case-insensitive in dhcpd.conf.
-+
-+      * Changed "dhcpdnsZone" and "dhcpdnszoneServer" into "dhcpDnsZone"
-+      and "dhcpDnsZoneServer".
-+
-+      * Changed "FQDNs" into "DNs" in dhcpLocatorDN description (DN is already
-+      absolute, RDN is relative DN, FQDN means a full qualified domain name).
-+
-+2006-12-15 Kalyan <skalyanasundaram@novell.com>
-+      * includes/ldap_casa.h server/ldap_casa.c - updated to support CASA
-+      1.7
-+
-+2006-8-15 Kalyan <skalyanasundaram@novell.com>
-+      * server/ldap.c (ldap_parse_options) - fetch option from the group
-+      if the host belongs to that group in the dynamic method.
-+
-+      * contrib/dhcp.schema - modified dhcpServiceDN attribute in dhcpServer
-+      objectclasses to be optional instead of mandatory
-+
-+      * contrib/dhcp.schema - modified dhcpPrimaryDN attribute in dhcpService
-+      objectclasses to be optional instead of mandatory
-+
-+      * contrib/dhcp.schema - schema has been updated with
-+      new objectclasses dhcpLocator,dhcpTsigKey,dhcpdnsZone,dhcpFailOver and
-+      many attributes.
-+
-+      * contrib/dhcp.schema - dhcpHWAddress's equality has been modified to
-+      caseIgnoreIA5Match.
-+
-+      * server/ldap.c - added support for reading the dhcpTsigKey and
-+      dhcpdnsZone objects. 
-+
-+      * server/ldap.c (ldap_parse_options) Fetch option from the group if
-+      the host belongs to that group in the dynamic method.
-+
-+      * server/ldap.c - CASA authentication is enabled.
-+
-+      * server/ldap.c - introduced new attribute ldap-server-cn to mention
-+      the dhcpServer object name in configuration.
-+
-+2006-7-17 Brian Masney <masneyb@ntelos.net>
-+      * server/ldap.c (ldap_read_function) - fixes for reading the data
-+      from the LDAP tree in some cases (patch from
-+      Darrin Smith <beldin@beldin.org>)
-+
-+2006-3-17 Brian Masney <masneyb@ntelos.net>
-+      * server/ldap.c (ldap_read_function) - added patch from 
-+      Dmitriy Bogun <kabanyura@gmail.com>. This patch fixes a bug when
-+      EOF wasn't returned in some cases.
-+
-+2005-9-26 Brian Masney <masneyb@ntelos.net>
-+      * server/ldap.c (ldap_start) - added support for reading the
-+      ldap-port option. This option was not being used.
-+
-+2005-5-24 Brian Masney <masneyb@ntelos.net>
-+      * server/ldap.c (ldap_parse_host) - allow dhcpHost entries that do
-+      not have a hardware address associated with them
-+
-+2005-4-11 Brian Masney <masneyb@ntelos.net>
-+      * README.ldap - updated directions on how to use LDAP over SSL on
-+      non-Linux machines
-+
-+2005-2-23 Brian Masney <masneyb@ntelos.net>
-+      * server/ldap.c (ldap_generate_config_string) - do a case insensitive
-+      string comparsion when comparing the object classes
-+
-+2004-11-8 Brian Masney <masneyb@ntelos.net>
-+      * debian/control - updated the depends and build-depends line
-+      (from Andrew Pollock <me@andrew.net.au>)
-+
-+2004-10-13 Brian Masney <masneyb@ntelos.net>
-+      * server/ldap.c (ldap_start) - allow doing an anonymous bind to the
-+      LDAP server
-+
-+2004-9-27 Brian Masney <masneyb@ntelos.net>
-+      * contrib/dhcpd-conf-to-ldap.pl - make sure the DHCP hardware address
-+      is always lowercased
-+
-+2004-7-30 Brian Masney <masneyb@ntelos.net>
-+      * server/ldap.c - added more debbuging statements. Fixed possible crash
-+      that could occur whenever more than 1 external DN is added to an LDAP
-+      entry. Fixed possible infinite loop when reading the external DNs.
-+      (from Sebastian Hetze <s.hetze@linux-ag.de>)
-+
-+2004-7-1 Brian Masney <masneyb@ntelos.net>
-+      * README.ldap - updated build instructions paragraph
-+      (from Mason Schmitt <sysadmin@sunwave.net>)
-+
-+2004-6-29 Brian Masney <masneyb@ntelos.net>
-+      * debian/control - set the minimum required version of the DHCP server
-+      to be 3.0.1rc9
-+
-+      * configure - fix for sed when configure was run from an older shell
-+
-+2004-6-22 Brian Masney <masneyb@ntelos.net>
-+      * Updated patch to use ISC DHCP 3.0.1rc14
-+
-+2004-5-24 Brian Masney <masneyb@ntelos.net>
-+      * server/ldap.c - don't append a ; to the end of a dhcpStatement if it
-+      ends in }
-+
-+      * server/ldap.c contrib/dhcpd-conf-to-ldap.pl - support having multiple
-+      dhcpRange statements (from Marco D'Ettorre <marco.dettorre@sys-net.it>)
-+
-+2004-5-5 Brian Masney <masneyb@ntelos.net>
-+      * server/ldap.c - added more debugging statements when
-+      it is compiled in to help troubleshoot parsing errors. Don't free
-+      a LDAP connection prematurely when there is a reference to another
-+      LDAP tree. If the config entry ends in }, make sure a ; gets tacked
-+      on
-+
-+      * debian/* - Updated version number. Renamed package from
-+      dhcp3-ldap-ntelos to dhcp3-server-ldap.
-+
-+      * server/ldap.c - enclose the shared-network name in quotes so
-+      that there can be shared network statements in LDAP that have spaces
-+      in them
-+
-+      * configure - after the work directory is setup, add -lldap -llber
-+      to the server Makefile
-+
-+Wed Apr 21 15:09:08 CEST 2004 - mt@suse.de
-+      * contrib/dhcpd-conf-to-ldap.pl:
-+        - added "--conf=file" option usable instead of stdin
-+        - added "--ldif=file" option usable instead of stdout
-+        - added "--second=host|dn" option usefull for failover
-+        - added "--use=feature" option to enable extended features;
-+          currently used to enable failover (default is disabled).
-+        - extended remaining_line() to support block statements
-+        - fixed / improved failover support, added notes about
-+
-+      * server/ldap.c:
-+        - moved code checking statement ends to check_statement_end()
-+        - moved parsing of entry options/statements to
-+          ldap_parse_entry_options()
-+        - moved code closing debug fd into ldap_close_debug_fd()
-+        - moved code writing to debug fd into ldap_write_debug()
-+        - added support for full hostname in dhcpServer search filter
-+        - added support for multiple dhcpService entries in dhcpServer object
-+        - added parsing of options and statements for dhcpServer object
-+        - added verify if dhcpService contains server dn as primary or
-+          secondary
-+        - changed to search for dhcpHost,dhcpSubClass bellow of all
-+          dhcpService trees instead of base-dn (avoids finding of hosts in
-+          foreign configs)
-+        - fixes to free all dn's fetched by ldap_get_dn (e.g. debug output)
-+        - fixes to free ldap results, mainly in cases where no LDAP_SUCCESS
-+          returned or other error conditions happened
-+        - fixed/improved some log messages
-+
-+2004-3-30 Brian Masney <masneyb@ntelos.net>
-+      * contrib/dhcpd-conf-to-ldap.pl - added option to control the
-+      DHCP Config DN. Wrap the DHCP Statements in { }
-+      This patch was contributed by Marius Tomaschewski <mt@suse.de>
-+
-+      * server/ldap.c - changed ldap_username and ldap_password to
-+      be optional (anonymous bind is used then). Added {} block support
-+      to dhcpStatements. (no ";" at end if statement ends with a "}").
-+      Fixed writing to ldap-debug-file. Changed find_haddr_in_ldap() to
-+      use dhcpHost objectClass in its filter
-+      This patch was contributed by Marius Tomaschewski <mt@suse.de>
-+
-+2004-3-23 Brian Masney <masneyb@ntelos.net>
-+      * contrib/dhcpd-conf-to-ldap.pl - added options for server, basedn
-+      options and usage message (Net::Domain instead of SYS::Hostname).
-+      Added handling of zone, authoritative and failover (config and
-+      pool-refs) statements. Added numbering of groups and pools per
-+      subnet. This patch was contributed by Marius Tomaschewski <mt@suse.de>
-+
-+2004-2-26 Brian Masney <masneyb@ntelos.net>
-+      * fixed an instance where the LDAP server would restart, but the DHCP
-+      server would not reconnect
-+
-+2004-2-18 Brian Masney <masneyb@ntelos.net>
-+      * allow multiple dhcp*DN entries in the LDAP entry.
-+
-+2003-9-11 Brian Masney <masneyb@ntelos.net>
-+      * updated patch to work with 3.0.1rc12
-+
-diff -Naur dhcp-3.0.5/README.ldap dhcp-3.0.5-ldap/README.ldap
---- dhcp-3.0.5/README.ldap     1969-12-31 19:00:00.000000000 -0500
-+++ dhcp-3.0.5-ldap/README.ldap        2007-02-23 13:13:36.000000000 -0500
-@@ -0,0 +1,190 @@
-+LDAP Support in DHCP
-+Brian Masney <masneyb@ntelos.net>
-+Last updated 3/23/2003
-+
-+This document describes setting up the DHCP server to read it's configuration 
-+from LDAP. This work is based on the IETF document 
-+draft-ietf-dhc-ldap-schema-01.txt included in the doc directory. For the latest
-+version of this document, please see http://home.ntelos.net/~masneyb.
-+
-+First question on most people's mind is "Why do I want to store my 
-+configuration in LDAP?" If you run a small DHCP server, and the configuration
-+on it rarely changes, then you won't need to store your configuration in LDAP.
-+But, if you have several DHCP servers, and you want an easy way to manage your 
-+configuration, this can be a solution. 
-+
-+The first step will be to setup your LDAP server. I am using OpenLDAP from
-+www.openldap.org. Building and installing OpenLDAP is beyond the scope of this 
-+document. There is plenty of documentation out there about this. Once you have 
-+OpenLDAP installed, you will have to edit your slapd.conf file. I added the 
-+following 2 lines to my configuration file:
-+
-+include         /etc/ldap/schema/dhcp.schema
-+index           dhcpHWAddress         eq
-+index           dhcpClassData eq
-+
-+The first line tells it to include the dhcp schema file. You will find this 
-+file under the contrib directory in this distribution. You will need to copy 
-+this file to where your other schema files are (maybe
-+/usr/local/openldap/etc/openldap/schema/). The second line sets up
-+an index for the dhcpHWAddress parameter. The third parameter is for reading 
-+subclasses from LDAP every time a DHCP request comes in. Make sure you run the 
-+slapindex command and restart slapd to have these changes to into effect.
-+
-+Now that you have LDAP setup, you should be able to use gq (http://biot.com/gq/)
-+to verify that the dhcp schema file is loaded into LDAP. Pull up gq, and click
-+on the Schema tab. Go under objectClasses, and you should see at least the 
-+following object classes listed: dhcpClass, dhcpGroup, dhcpHost, dhcpOptions, 
-+dhcpPool, dhcpServer, dhcpService, dhcpSharedNetwork, dhcpSubClass, and 
-+dhcpSubnet. If you do not see these, you need to check over your LDAP 
-+configuration before you go any further.
-+
-+You should now be ready to build DHCP. If you would like to enable LDAP over
-+SSL, you will need to perform the following steps:
-+
-+  * Edit the includes/site.h file and uncomment the USE_SSL line
-+    or specify "-DUSE_SSL" via CFLAGS.
-+  * Edit the dst/Makefile.dist file and remove md5_dgst.c and md5_dgst.o
-+    from the SRC= and OBJ= lines (around line 24)
-+  * Now run configure in the base source directory. If you chose to enable
-+    LDAP over SSL, you must append -lcrypto -lssl to the LIBS= line in the file
-+    work.os/server/Makefile (replace os with your operating system, linux-2.2 on
-+    my machine).  You should now be able to type make to build your DHCP server.
-+
-+If you choose to not enable LDAP over SSL, then you only need to run configure
-+and make in the toplevel source directory.
-+
-+Once you have DHCP installed, you will need to setup your initial plaintext 
-+config file. In my /etc/dhcpd.conf file, I have:
-+
-+ldap-server "localhost";
-+ldap-port 389;
-+ldap-username "cn=DHCP User, dc=ntelos, dc=net";
-+ldap-password "blah";
-+ldap-base-dn "dc=ntelos, dc=net";
-+ldap-method dynamic;
-+ldap-debug-file "/var/log/dhcp-ldap-startup.log";
-+
-+If SSL has been enabled at compile time using the USE_SSL flag, the dhcp
-+server trys to use TLS if possible, but continues without TLS if not.
-+
-+You can modify this behaviour using following option in /etc/dhcpd.conf:
-+
-+ldap-ssl <off | ldaps | start_tls | on>
-+   off:       disables TLS/LDAPS.
-+   ldaps:     enables LDAPS -- don't forget to set ldap-port to 636.
-+   start_tls: enables TLS using START_TLS command
-+   on:        enables LDAPS if ldap-port is set to 636 or TLS in 
-+              other cases.
-+
-+See also "man 5 ldap.conf" for description the following TLS related 
-+options:
-+   ldap-tls-reqcert, ldap-tls-ca-file, ldap-tls-ca-dir, ldap-tls-cert
-+   ldap-tls-key, ldap-tls-crlcheck, ldap-tls-ciphers, ldap-tls-randfile
-+
-+All of these parameters should be self explanatory except for the ldap-method.
-+You can set this to static or dynamic. If you set it to static, the 
-+configuration is read once on startup, and LDAP isn't used anymore. But, if you
-+set this to dynamic, the configuration is read once on startup, and the 
-+hosts that are stored in LDAP are looked up every time a DHCP request comes in.
-+
-+When the optional statement ldap-debug-file is specified, on startup the DHCP
-+server will write out the configuration that it generated from LDAP. If you are
-+getting errors about your LDAP configuration, this is a good place to start
-+looking.
-+
-+The next step is to set up your LDAP tree. Here is an example config that will
-+give a 10.100.0.x address to machines that have a host entry in LDAP. 
-+Otherwise, it will give a 10.200.0.x address to them. (NOTE: replace 
-+dc=ntelos, dc=net with your base dn). If you would like to convert your 
-+existing dhcpd.conf file to LDIF format, there is a script 
-+contrib/dhcpd-conf-to-ldap.pl that will convert it for you. Type
-+dhcpd-conf-to-ldap.pl --help to see the usage information for this script.
-+
-+# You must specify the server's host name in LDAP that you are going to run
-+# DHCP on and point it to which config tree you want to use. Whenever DHCP 
-+# first starts up, it will do a search for this entry to find out which 
-+# config to use
-+dn: cn=brian.ntelos.net, dc=ntelos, dc=net
-+objectClass: top
-+objectClass: dhcpServer
-+cn: brian.ntelos.net
-+dhcpServiceDN: cn=DHCP Service Config, dc=ntelos, dc=net
-+
-+# Here is the config tree that brian.ntelos.net points to. 
-+dn: cn=DHCP Service Config, dc=ntelos, dc=net
-+cn: DHCP Service Config
-+objectClass: top
-+objectClass: dhcpService
-+dhcpPrimaryDN: dc=ntelos, dc=net
-+dhcpStatements: ddns-update-style none
-+dhcpStatements: default-lease-time 600
-+dhcpStatements: max-lease-time 7200
-+
-+# Set up a shared network segment
-+dn: cn=WV Test, cn=DHCP Service Config, dc=ntelos, dc=net
-+cn: WV
-+objectClass: top
-+objectClass: dhcpSharedNetwork
-+
-+# Set up a subnet declaration with a pool statement. Also note that we have
-+# a dhcpOptions object with this entry
-+dn: cn=10.100.0.0, cn=WV Test, cn=DHCP Service Config, dc=ntelos, dc=net
-+cn: 10.100.0.0
-+objectClass: top
-+objectClass: dhcpSubnet
-+objectClass: dhcpOptions
-+dhcpOption: domain-name-servers 10.100.0.2
-+dhcpOption: routers 10.100.0.1
-+dhcpOption: subnet-mask 255.255.255.0
-+dhcpOption: broadcast-address 10.100.0.255
-+dhcpNetMask: 24
-+
-+# Set up a pool for this subnet. Only known hosts will get these IPs
-+dn: cn=Known Pool, cn=10.100.0.0, cn=WV Test, cn=DHCP Service Config, dc=ntelos, dc=net
-+cn: Known Pool
-+objectClass: top
-+objectClass: dhcpPool
-+dhcpRange: 10.100.0.3 10.100.0.254
-+dhcpPermitList: deny unknown-clients
-+
-+# Set up another subnet declaration with a pool statement
-+dn: cn=10.200.0.0, cn=WV Test, cn=DHCP Service Config, dc=ntelos, dc=net
-+cn: 10.200.0.0
-+objectClass: top
-+objectClass: dhcpSubnet
-+objectClass: dhcpOptions
-+dhcpOption: domain-name-servers 10.200.0.2
-+dhcpOption: routers 10.200.0.1
-+dhcpOption: subnet-mask 255.255.255.0
-+dhcpOption: broadcast-address 10.200.0.255
-+dhcpNetMask: 24
-+
-+# Set up a pool for this subnet. Only unknown hosts will get these IPs
-+dn: cn=Known Pool, cn=10.200.0.0, cn=WV Test, cn=DHCP Service Config, dc=ntelos, dc=net
-+cn: Known Pool
-+objectClass: top
-+objectClass: dhcpPool
-+dhcpRange: 10.200.0.3 10.200.0.254
-+dhcpPermitList: deny known clients
-+
-+# Set aside a group for all of our known MAC addresses
-+dn: cn=Customers, cn=DHCP Service Config, dc=ntelos, dc=net
-+objectClass: top
-+objectClass: dhcpGroup
-+cn: Customers
-+
-+# Host entry for my laptop
-+dn: cn=brianlaptop, cn=Customers, cn=DHCP Service Config, dc=ntelos, dc=net
-+objectClass: top
-+objectClass: dhcpHost
-+cn: brianlaptop
-+dhcpHWAddress: ethernet 00:00:00:00:00:00
-+
-+You can use the command slapadd to load all of these entries into your LDAP 
-+server. After you load this, you should be able to start up DHCP. If you run
-+into problems reading the configuration, try running dhcpd with the -d flag. 
-+If you still have problems, edit the site.conf file in the DHCP source and
-+add the line: COPTS= -DDEBUG_LDAP and recompile DHCP. (make sure you run make 
-+clean and rerun configure before you rebuild).
-+
-diff -Naur dhcp-3.0.5/common/conflex.c dhcp-3.0.5-ldap/common/conflex.c
---- dhcp-3.0.5/common/conflex.c        2006-02-22 17:43:27.000000000 -0500
-+++ dhcp-3.0.5-ldap/common/conflex.c   2006-12-14 10:03:41.000000000 -0500
-@@ -47,6 +47,7 @@
- static enum dhcp_token read_number PROTO ((int, struct parse *));
- static enum dhcp_token read_num_or_name PROTO ((int, struct parse *));
- static enum dhcp_token intern PROTO ((unsigned char *, enum dhcp_token));
-+static int read_function PROTO ((struct parse *));
- isc_result_t new_parse (cfile, file, inbuf, buflen, name, eolp)
-       struct parse **cfile;
-@@ -74,6 +75,10 @@
-       tmp -> file = file;
-       tmp -> eol_token = eolp;
-+      if (file != -1) {
-+              tmp -> read_function = read_function;;
-+      }
-+
-       tmp -> bufix = 0;
-       tmp -> buflen = buflen;
-       if (inbuf) {
-@@ -113,22 +118,11 @@
-       int c;
-       if (cfile -> bufix == cfile -> buflen) {
--              if (cfile -> file != -1) {
--                      cfile -> buflen =
--                              read (cfile -> file,
--                                    cfile -> inbuf, cfile -> bufsiz);
--                      if (cfile -> buflen == 0) {
--                              c = EOF;
--                              cfile -> bufix = 0;
--                      } else if (cfile -> buflen < 0) {
--                              c = EOF;
--                              cfile -> bufix = cfile -> buflen = 0;
--                      } else {
--                              c = cfile -> inbuf [0];
--                              cfile -> bufix = 1;
--                      }
--              } else
-+              if (cfile -> read_function) {
-+                      c = cfile -> read_function (cfile);
-+              } else {
-                       c = EOF;
-+              }
-       } else {
-               c = cfile -> inbuf [cfile -> bufix];
-               cfile -> bufix++;
-@@ -1128,3 +1122,25 @@
-       }
-       return dfv;
- }
-+
-+
-+static int
-+read_function (struct parse * cfile)
-+{
-+  int c;
-+
-+      cfile -> buflen = read (cfile -> file, cfile -> inbuf, cfile -> bufsiz);
-+      if (cfile -> buflen == 0) {
-+              c = EOF;
-+              cfile -> bufix = 0;
-+      } else if (cfile -> buflen < 0) {
-+              c = EOF;
-+              cfile -> bufix = cfile -> buflen = 0;
-+      } else {
-+              c = cfile -> inbuf [0];
-+              cfile -> bufix = 1;
-+      }
-+
-+      return c;
-+}
-+
-diff -Naur dhcp-3.0.5/common/print.c dhcp-3.0.5-ldap/common/print.c
---- dhcp-3.0.5/common/print.c  2006-02-22 17:43:27.000000000 -0500
-+++ dhcp-3.0.5-ldap/common/print.c     2006-12-14 10:03:41.000000000 -0500
-@@ -166,9 +166,9 @@
- }
- char *print_hw_addr (htype, hlen, data)
--      int htype;
--      int hlen;
--      unsigned char *data;
-+      const int htype;
-+      const int hlen;
-+      const unsigned char *data;
- {
-       static char habuf [49];
-       char *s;
-diff -Naur dhcp-3.0.5/contrib/dhcp.schema dhcp-3.0.5-ldap/contrib/dhcp.schema
---- dhcp-3.0.5/contrib/dhcp.schema     1969-12-31 19:00:00.000000000 -0500
-+++ dhcp-3.0.5-ldap/contrib/dhcp.schema        2007-02-23 12:53:22.000000000 -0500
-@@ -0,0 +1,462 @@
-+attributetype ( 2.16.840.1.113719.1.203.4.1 
-+      NAME 'dhcpPrimaryDN' 
-+      EQUALITY distinguishedNameMatch
-+      DESC 'The DN of the dhcpServer which is the primary server for the configuration.' 
-+      SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE )
-+
-+attributetype ( 2.16.840.1.113719.1.203.4.2 
-+      NAME 'dhcpSecondaryDN' 
-+      EQUALITY distinguishedNameMatch
-+      DESC 'The DN of dhcpServer(s) which provide backup service for the configuration.'
-+      SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 )
-+
-+attributetype ( 2.16.840.1.113719.1.203.4.3 
-+      NAME 'dhcpStatements' 
-+      EQUALITY caseIgnoreIA5Match
-+      DESC 'Flexible storage for specific data depending on what object this exists in. Like conditional statements, server parameters, etc. This allows the standard to evolve without needing to adjust the schema.' 
-+      SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 )
-+
-+attributetype ( 2.16.840.1.113719.1.203.4.4 
-+      NAME 'dhcpRange' 
-+      EQUALITY caseIgnoreIA5Match
-+      DESC 'The starting & ending IP Addresses in the range (inclusive), separated by a hyphen; if the range only contains one address, then just the address can be specified with no hyphen.  Each range is defined as a separate value.'
-+      SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 )
-+
-+attributetype ( 2.16.840.1.113719.1.203.4.5 
-+      NAME 'dhcpPermitList' 
-+      EQUALITY caseIgnoreIA5Match
-+      DESC 'This attribute contains the permit lists associated with a pool. Each permit list is defined as a separate value.' 
-+      SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 )
-+
-+attributetype ( 2.16.840.1.113719.1.203.4.6 
-+      NAME 'dhcpNetMask' 
-+      EQUALITY integerMatch
-+      DESC 'The subnet mask length for the subnet.  The mask can be easily computed from this length.' 
-+      SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )
-+
-+attributetype ( 2.16.840.1.113719.1.203.4.7 
-+      NAME 'dhcpOption' 
-+      EQUALITY caseIgnoreIA5Match
-+      DESC 'Encoded option values to be sent to clients.  Each value represents a single option and contains (OptionTag, Length, OptionValue) encoded in the format used by DHCP.' 
-+      SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 )
-+
-+attributetype ( 2.16.840.1.113719.1.203.4.8 
-+      NAME 'dhcpClassData' 
-+      EQUALITY caseIgnoreIA5Match
-+      DESC 'Encoded text string or list of bytes expressed in hexadecimal, separated by colons.  Clients match subclasses based on matching the class data with the results of match or spawn with statements in the class name declarations.' 
-+      SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE )
-+
-+attributetype ( 2.16.840.1.113719.1.203.4.9 
-+      NAME 'dhcpOptionsDN' 
-+      EQUALITY distinguishedNameMatch
-+      DESC 'The distinguished name(s) of the dhcpOption objects containing the configuration options provided by the server.' 
-+      SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 )
-+
-+attributetype ( 2.16.840.1.113719.1.203.4.10 
-+      NAME 'dhcpHostDN' 
-+      EQUALITY distinguishedNameMatch
-+      DESC 'the distinguished name(s) of the dhcpHost objects.' 
-+      SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 ) 
-+
-+attributetype ( 2.16.840.1.113719.1.203.4.11 
-+      NAME 'dhcpPoolDN' 
-+      EQUALITY distinguishedNameMatch
-+      DESC 'The distinguished name(s) of pools.' 
-+      SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 )
-+
-+attributetype ( 2.16.840.1.113719.1.203.4.12 
-+      NAME 'dhcpGroupDN' 
-+      EQUALITY distinguishedNameMatch
-+      DESC 'The distinguished name(s)   of the groups.' 
-+      SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 )
-+
-+attributetype ( 2.16.840.1.113719.1.203.4.13 
-+      NAME 'dhcpSubnetDN' 
-+      EQUALITY distinguishedNameMatch
-+      DESC 'The distinguished name(s) of the subnets.' 
-+      SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 )
-+
-+attributetype ( 2.16.840.1.113719.1.203.4.14 
-+      NAME 'dhcpLeaseDN' 
-+      EQUALITY distinguishedNameMatch
-+      DESC 'The distinguished name of a client address.' 
-+      SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE)
-+
-+attributetype ( 2.16.840.1.113719.1.203.4.15 
-+      NAME 'dhcpLeasesDN' 
-+      DESC 'The distinguished name(s) client addresses.' 
-+      EQUALITY distinguishedNameMatch
-+      SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 )
-+
-+attributetype ( 2.16.840.1.113719.1.203.4.16 
-+      NAME 'dhcpClassesDN' 
-+      EQUALITY distinguishedNameMatch
-+      DESC 'The distinguished name(s) of a class(es) in a subclass.' 
-+      SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 )
-+
-+attributetype ( 2.16.840.1.113719.1.203.4.17 
-+      NAME 'dhcpSubclassesDN' 
-+      EQUALITY distinguishedNameMatch
-+      DESC 'The distinguished name(s) of subclass(es).' 
-+      SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 )
-+
-+attributetype ( 2.16.840.1.113719.1.203.4.18 
-+      NAME 'dhcpSharedNetworkDN' 
-+      EQUALITY distinguishedNameMatch
-+      DESC 'The distinguished name(s) of sharedNetworks.' 
-+      SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 )
-+
-+attributetype ( 2.16.840.1.113719.1.203.4.19 
-+      NAME 'dhcpServiceDN' 
-+      EQUALITY distinguishedNameMatch
-+      DESC 'The DN of dhcpService object(s)which contain the configuration information. Each dhcpServer object has this attribute identifying the DHCP configuration(s) that the server is associated with.' 
-+      SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 )
-+
-+attributetype ( 2.16.840.1.113719.1.203.4.20 
-+      NAME 'dhcpVersion'
-+      DESC 'The version attribute of this object.'
-+      EQUALITY caseIgnoreIA5Match
-+      SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE )
-+
-+attributetype ( 2.16.840.1.113719.1.203.4.21 
-+      NAME 'dhcpImplementation' 
-+      EQUALITY caseIgnoreIA5Match
-+      DESC 'Description of the DHCP Server implementation e.g. DHCP Servers vendor.' 
-+      SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE )
-+
-+attributetype ( 2.16.840.1.113719.1.203.4.22 
-+      NAME 'dhcpAddressState' 
-+      EQUALITY caseIgnoreIA5Match
-+      DESC 'This stores information about the current binding-status of an address.  For dynamic addresses managed by DHCP, the values should be restricted to the following: "FREE", "ACTIVE", "EXPIRED", "RELEASED", "RESET", "ABANDONED", "BACKUP".  For other addresses, it SHOULD be one of the following: "UNKNOWN", "RESERVED" (an address that is managed by DHCP that is reserved for a specific client), "RESERVED-ACTIVE" (same as reserved, but address is currently in use), "ASSIGNED" (assigned manually or by some other mechanism), "UNASSIGNED", "NOTASSIGNABLE".'
-+      SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE )
-+
-+attributetype ( 2.16.840.1.113719.1.203.4.23 
-+      NAME 'dhcpExpirationTime' 
-+      EQUALITY generalizedTimeMatch 
-+      DESC 'This is the time the current lease for an address expires.' 
-+      SYNTAX 1.3.6.1.4.1.1466.115.121.1.24 SINGLE-VALUE )
-+
-+attributetype ( 2.16.840.1.113719.1.203.4.24 
-+      NAME 'dhcpStartTimeOfState' 
-+      EQUALITY generalizedTimeMatch 
-+      DESC 'This is the time of the last state change for a leased address.' 
-+      SYNTAX 1.3.6.1.4.1.1466.115.121.1.24 SINGLE-VALUE )
-+
-+attributetype ( 2.16.840.1.113719.1.203.4.25 
-+      NAME 'dhcpLastTransactionTime' 
-+      EQUALITY generalizedTimeMatch 
-+      DESC 'This is the last time a valid DHCP packet was received from the client.'
-+      SYNTAX 1.3.6.1.4.1.1466.115.121.1.24 SINGLE-VALUE )
-+
-+attributetype ( 2.16.840.1.113719.1.203.4.26 
-+      NAME 'dhcpBootpFlag' 
-+      EQUALITY booleanMatch 
-+      DESC 'This indicates whether the address was assigned via BOOTP.' 
-+      SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE )
-+
-+attributetype ( 2.16.840.1.113719.1.203.4.27 
-+      NAME 'dhcpDomainName' 
-+      EQUALITY caseIgnoreIA5Match
-+      DESC 'This is the name of the domain sent to the client by the server.  It is essentially the same as the value for DHCP option 15 sent to the client, and represents only the domain - not the full FQDN.  To obtain the full FQDN assigned to the client you must prepend the "dhcpAssignedHostName" to this value with a ".".' 
-+      SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE )
-+
-+attributetype ( 2.16.840.1.113719.1.203.4.28 
-+      NAME 'dhcpDnsStatus' 
-+      EQUALITY integerMatch
-+      DESC 'This indicates the status of updating DNS resource records on behalf of the client by the DHCP server for this address.  The value is a 16-bit bitmask.'
-+      SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )
-+
-+attributetype ( 2.16.840.1.113719.1.203.4.29 
-+      NAME 'dhcpRequestedHostName' 
-+      EQUALITY caseIgnoreIA5Match
-+      DESC 'This is the hostname that was requested by the client.' 
-+      SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE )
-+
-+attributetype ( 2.16.840.1.113719.1.203.4.30 
-+      NAME 'dhcpAssignedHostName' 
-+      EQUALITY caseIgnoreIA5Match
-+      DESC 'This is the actual hostname that was assigned to a client. It may not be the name that was requested by the client.  The fully qualified domain name can be determined by appending the value of "dhcpDomainName" (with a dot separator) to this name.' 
-+      SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE )
-+
-+attributetype ( 2.16.840.1.113719.1.203.4.31 
-+      NAME 'dhcpReservedForClient' 
-+      EQUALITY distinguishedNameMatch
-+      DESC 'The distinguished name of a "dhcpClient" that an address is reserved for.  This may not be the same as the "dhcpAssignedToClient" attribute if the address is being reassigned but the current lease has not yet expired.'
-+      SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE )
-+
-+attributetype ( 2.16.840.1.113719.1.203.4.32 
-+      NAME 'dhcpAssignedToClient' 
-+      EQUALITY distinguishedNameMatch
-+      DESC 'This is the distinguished name of a "dhcpClient" that an address is currently assigned to.  This attribute is only present in the class when the address is leased.' 
-+      SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE )
-+
-+attributetype ( 2.16.840.1.113719.1.203.4.33 
-+      NAME 'dhcpRelayAgentInfo' 
-+      EQUALITY octetStringMatch
-+      DESC 'If the client request was received via a relay agent, this contains information about the relay agent that was available from the DHCP request.  This is a hex-encoded option value.' 
-+      SYNTAX 1.3.6.1.4.1.1466.115.121.1.40 SINGLE-VALUE )
-+
-+attributetype ( 2.16.840.1.113719.1.203.4.34 
-+      NAME 'dhcpHWAddress' 
-+      EQUALITY caseIgnoreIA5Match
-+      DESC 'The clients hardware address that requested this IP address.' 
-+      SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE )
-+
-+attributetype ( 2.16.840.1.113719.1.203.4.35 
-+      NAME 'dhcpHashBucketAssignment' 
-+      EQUALITY octetStringMatch
-+      DESC 'HashBucketAssignment bit map for the DHCP Server, as defined in DHC Load Balancing Algorithm [RFC 3074].' 
-+      SYNTAX 1.3.6.1.4.1.1466.115.121.1.40 SINGLE-VALUE )
-+
-+attributetype ( 2.16.840.1.113719.1.203.4.36 
-+      NAME 'dhcpDelayedServiceParameter' 
-+      EQUALITY integerMatch
-+      DESC 'Delay in seconds corresponding to Delayed Service Parameter configuration, as defined in  DHC Load Balancing Algorithm [RFC 3074]. '
-+      SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )
-+
-+attributetype ( 2.16.840.1.113719.1.203.4.37 
-+      NAME 'dhcpMaxClientLeadTime' 
-+      EQUALITY integerMatch
-+      DESC 'Maximum Client Lead Time configuration in seconds, as defined in DHCP Failover Protocol [FAILOVR]' 
-+      SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )
-+
-+attributetype ( 2.16.840.1.113719.1.203.4.38 
-+      NAME 'dhcpFailOverEndpointState' 
-+      EQUALITY caseIgnoreIA5Match
-+      DESC 'Server (Failover Endpoint) state, as defined in DHCP Failover Protocol [FAILOVR]' 
-+      SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE )
-+
-+attributetype ( 2.16.840.1.113719.1.203.4.39 
-+      NAME 'dhcpErrorLog' 
-+      EQUALITY caseIgnoreIA5Match
-+      DESC 'Generic error log attribute that allows logging error conditions within a dhcpService or a dhcpSubnet, like no IP addresses available for lease.'
-+      SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE )
-+
-+attributetype ( 2.16.840.1.113719.1.203.4.40 
-+      NAME 'dhcpLocatorDN' 
-+      EQUALITY distinguishedNameMatch 
-+      DESC 'The DN of dhcpLocator object which contain the DNs of all DHCP configuration objects. There will be a single dhcpLocator object in the tree with links to all the DHCP objects in the tree' 
-+      SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 )
-+
-+attributetype  ( 2.16.840.1.113719.1.203.4.41 
-+      NAME 'dhcpKeyAlgorithm' 
-+      EQUALITY caseIgnoreIA5Match 
-+      DESC 'Algorithm to generate TSIG Key' 
-+      SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE )
-+
-+attributetype  ( 2.16.840.1.113719.1.203.4.42 
-+      NAME 'dhcpKeySecret' 
-+      EQUALITY octetStringMatch 
-+      DESC 'Secret to generate TSIG Key' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40 SINGLE-VALUE )
-+
-+attributetype ( 2.16.840.1.113719.1.203.4.43 
-+      NAME 'dhcpDnsZoneServer' 
-+      EQUALITY caseIgnoreIA5Match 
-+      DESC 'Master server of the DNS Zone' 
-+      SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE )
-+
-+attributetype ( 2.16.840.1.113719.1.203.4.44 
-+      NAME 'dhcpKeyDN' 
-+      EQUALITY distinguishedNameMatch 
-+      DESC 'The DNs of TSIG Key to use in secure dynamic updates. In case of locator object, this will be list of TSIG keys.  In case of DHCP Service, Shared Network, Subnet and DNS Zone, it will be a single key.' 
-+      SYNTAX 1.3.6.1.4.1.1466.115.121.1.12)
-+
-+attributetype ( 2.16.840.1.113719.1.203.4.45 
-+      NAME 'dhcpZoneDN' 
-+      EQUALITY distinguishedNameMatch 
-+      DESC 'The DNs of DNS Zone. In case of locator object, this will be list of DNS Zones in the tree. In case of DHCP Service, Shared Network and Subnet, it will be a single DNS Zone.' 
-+      SYNTAX 1.3.6.1.4.1.1466.115.121.1.12)
-+
-+attributetype ( 2.16.840.1.113719.1.203.4.46 
-+      NAME 'dhcpFailOverPrimaryServer' 
-+      EQUALITY caseIgnoreIA5Match 
-+      DESC 'IP address or DNS name of the server playing primary role in DHC Load Balancing and Fail over.' 
-+      SYNTAX 1.3.6.1.4.1.1466.115.121.1.26  )
-+
-+attributetype ( 2.16.840.1.113719.1.203.4.47 
-+      NAME 'dhcpFailOverSecondaryServer' 
-+      EQUALITY caseIgnoreIA5Match 
-+      DESC 'IP address or DNS name of the server playing secondary role in DHC Load Balancing and Fail over.' 
-+      SYNTAX 1.3.6.1.4.1.1466.115.121.1.26  )
-+
-+attributetype ( 2.16.840.1.113719.1.203.4.48
-+      NAME 'dhcpFailOverPrimaryPort' 
-+      EQUALITY integerMatch 
-+      DESC 'Port on which primary server listens for connections from its fail over peer (secondary server)' 
-+      SYNTAX 1.3.6.1.4.1.1466.115.121.1.27  )
-+      
-+attributetype ( 2.16.840.1.113719.1.203.4.49
-+      NAME 'dhcpFailOverSecondaryPort' 
-+      EQUALITY integerMatch 
-+      DESC 'Port on which secondary server listens for connections from its fail over peer (primary server)' 
-+      SYNTAX 1.3.6.1.4.1.1466.115.121.1.27  )
-+
-+attributetype ( 2.16.840.1.113719.1.203.4.50
-+      NAME 'dhcpFailOverResponseDelay' 
-+      EQUALITY integerMatch 
-+      DESC 'Maximum response time in seconds, before Server assumes that connection to fail over peer has failed' 
-+      SYNTAX 1.3.6.1.4.1.1466.115.121.1.27  )
-+
-+attributetype ( 2.16.840.1.113719.1.203.4.51
-+      NAME 'dhcpFailOverUnackedUpdates' 
-+      EQUALITY integerMatch 
-+      DESC 'Number of BNDUPD messages that server can send before it receives BNDACK from its fail over peer' 
-+      SYNTAX 1.3.6.1.4.1.1466.115.121.1.27  )
-+
-+attributetype ( 2.16.840.1.113719.1.203.4.52
-+      NAME 'dhcpFailOverSplit' 
-+      EQUALITY integerMatch 
-+      DESC 'Split between the primary and secondary servers for fail over purpose' 
-+      SYNTAX 1.3.6.1.4.1.1466.115.121.1.27  )
-+
-+attributetype ( 2.16.840.1.113719.1.203.4.53
-+      NAME 'dhcpFailOverLoadBalanceTime' 
-+      EQUALITY integerMatch 
-+      DESC 'Cutoff time in seconds, after which load balance is disabled' 
-+      SYNTAX 1.3.6.1.4.1.1466.115.121.1.27  )
-+
-+attributetype ( 2.16.840.1.113719.1.203.4.54
-+      NAME 'dhcpFailOverPeerDN' 
-+      EQUALITY distinguishedNameMatch 
-+      DESC 'The DNs of Fail over peers. In case of locator object, this will be list of fail over peers in the tree. In case of Subnet and pool, it will be a single Fail Over Peer' 
-+      SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 ) 
-+
-+#List of all servers in the tree
-+attributetype ( 2.16.840.1.113719.1.203.4.55
-+      NAME 'dhcpServerDN' 
-+      EQUALITY distinguishedNameMatch 
-+      DESC 'List of all  DHCP Servers in the tree. Used by dhcpLocatorObject' 
-+      SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 )
-+
-+attributetype ( 2.16.840.1.113719.1.203.4.56
-+      NAME 'dhcpComments' 
-+      EQUALITY caseIgnoreIA5Match 
-+      DESC 'Generic attribute that allows coments  within any DHCP object' 
-+      SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE )
-+
-+# Classes
-+
-+objectclass ( 2.16.840.1.113719.1.203.6.1 
-+      NAME 'dhcpService' 
-+      DESC 'Service object that represents the actual DHCP Service configuration. This is a container object.' 
-+      SUP top 
-+      MUST (cn) 
-+      MAY ( dhcpPrimaryDN $ dhcpSecondaryDN $ dhcpServerDN $ dhcpSharedNetworkDN $ dhcpSubnetDN $ dhcpGroupDN $ dhcpHostDN $  dhcpClassesDN $ dhcpOptionsDN $ dhcpZoneDN $ dhcpKeyDN $ dhcpFailOverPeerDN $ dhcpStatements $dhcpComments $ dhcpOption) )
-+
-+objectclass ( 2.16.840.1.113719.1.203.6.2 
-+      NAME 'dhcpSharedNetwork' 
-+      DESC 'This stores configuration information for a shared network.' 
-+      SUP top 
-+      MUST cn 
-+      MAY ( dhcpSubnetDN $ dhcpPoolDN $ dhcpOptionsDN $ dhcpZoneDN $ dhcpStatements $dhcpComments $ dhcpOption) X-NDS_CONTAINMENT ('dhcpService' ) )
-+
-+objectclass ( 2.16.840.1.113719.1.203.6.3 
-+      NAME 'dhcpSubnet' 
-+      DESC 'This class defines a subnet. This is a container object.' 
-+      SUP top 
-+      MUST ( cn $ dhcpNetMask ) 
-+      MAY ( dhcpRange $ dhcpPoolDN $ dhcpGroupDN $ dhcpHostDN $ dhcpClassesDN $ dhcpLeasesDN $ dhcpOptionsDN $ dhcpZoneDN $ dhcpKeyDN $ dhcpFailOverPeerDN $ dhcpStatements $ dhcpComments $ dhcpOption ) X-NDS_CONTAINMENT ('dhcpService' 'dhcpSharedNetwork') )
-+
-+objectclass ( 2.16.840.1.113719.1.203.6.4 
-+      NAME 'dhcpPool' 
-+      DESC 'This stores configuration information about a pool.' 
-+      SUP top 
-+      MUST ( cn $ dhcpRange ) 
-+      MAY ( dhcpClassesDN $ dhcpPermitList $ dhcpLeasesDN $ dhcpOptionsDN $ dhcpZoneDN $dhcpKeyDN $ dhcpStatements $ dhcpComments $ dhcpOption ) 
-+      X-NDS_CONTAINMENT ('dhcpSubnet' 'dhcpSharedNetwork') )
-+
-+objectclass ( 2.16.840.1.113719.1.203.6.5 
-+      NAME 'dhcpGroup' 
-+      DESC 'Group object that lists host DNs and parameters. This is a container object.' 
-+      SUP top 
-+      MUST cn 
-+      MAY ( dhcpHostDN $ dhcpOptionsDN $ dhcpStatements $ dhcpComments $ dhcpOption )
-+      X-NDS_CONTAINMENT ('dhcpSubnet' 'dhcpService' ) )
-+
-+objectclass ( 2.16.840.1.113719.1.203.6.6 
-+      NAME 'dhcpHost' 
-+      DESC 'This represents information about a particular client' 
-+      SUP top 
-+      MUST cn 
-+      MAY  (dhcpLeaseDN $ dhcpHWAddress $ dhcpOptionsDN $ dhcpStatements $ dhcpComments $ dhcpOption) 
-+      X-NDS_CONTAINMENT ('dhcpService' 'dhcpSubnet' 'dhcpGroup') )
-+
-+objectclass ( 2.16.840.1.113719.1.203.6.7 
-+      NAME 'dhcpClass' 
-+      DESC 'Represents information about a collection of related clients.' 
-+      SUP top 
-+      MUST cn 
-+      MAY (dhcpSubClassesDN $ dhcpOptionsDN $ dhcpStatements $ dhcpComments $ dhcpOption) 
-+      X-NDS_CONTAINMENT ('dhcpService' 'dhcpSubnet' ) )
-+
-+objectclass ( 2.16.840.1.113719.1.203.6.8 
-+      NAME 'dhcpSubClass' 
-+      DESC 'Represents information about a collection of related classes.' 
-+      SUP top 
-+      MUST cn 
-+      MAY (dhcpClassData $ dhcpOptionsDN $ dhcpStatements $ dhcpComments $ dhcpOption) X-NDS_CONTAINMENT 'dhcpClass' )
-+
-+objectclass ( 2.16.840.1.113719.1.203.6.9 
-+      NAME 'dhcpOptions' 
-+      DESC 'Represents information about a collection of options defined.' 
-+      SUP top AUXILIARY
-+      MUST cn 
-+      MAY ( dhcpOption $ dhcpComments ) 
-+      X-NDS_CONTAINMENT  ('dhcpService' 'dhcpSharedNetwork' 'dhcpSubnet' 'dhcpPool' 'dhcpGroup' 'dhcpHost' 'dhcpClass' ) )
-+
-+objectclass ( 2.16.840.1.113719.1.203.6.10 
-+      NAME 'dhcpLeases' 
-+      DESC 'This class represents an IP Address, which may or may not have been leased.' 
-+      SUP top 
-+      MUST ( cn $ dhcpAddressState ) 
-+      MAY ( dhcpExpirationTime $ dhcpStartTimeOfState $ dhcpLastTransactionTime $ dhcpBootpFlag $ dhcpDomainName $ dhcpDnsStatus $ dhcpRequestedHostName $ dhcpAssignedHostName $ dhcpReservedForClient $ dhcpAssignedToClient $ dhcpRelayAgentInfo $ dhcpHWAddress ) 
-+      X-NDS_CONTAINMENT ( 'dhcpService' 'dhcpSubnet' 'dhcpPool') )
-+
-+objectclass ( 2.16.840.1.113719.1.203.6.11 
-+      NAME 'dhcpLog' 
-+      DESC 'This is the object that holds past information about the IP address. The cn is the time/date stamp when the address was assigned or released, the address state at the time, if the address was assigned or released.' 
-+      SUP top 
-+      MUST ( cn ) 
-+      MAY ( dhcpAddressState $ dhcpExpirationTime $ dhcpStartTimeOfState $ dhcpLastTransactionTime $ dhcpBootpFlag $ dhcpDomainName $ dhcpDnsStatus $ dhcpRequestedHostName $ dhcpAssignedHostName $ dhcpReservedForClient $ dhcpAssignedToClient $ dhcpRelayAgentInfo $ dhcpHWAddress $ dhcpErrorLog) 
-+      X-NDS_CONTAINMENT ('dhcpLeases' 'dhcpPool' 'dhcpSubnet' 'dhcpSharedNetwork' 'dhcpService' ) )
-+
-+objectclass ( 2.16.840.1.113719.1.203.6.12 
-+      NAME 'dhcpServer' 
-+      DESC 'DHCP Server Object' 
-+      SUP top 
-+      MUST ( cn ) 
-+      MAY (dhcpServiceDN  $ dhcpLocatorDN $ dhcpVersion $ dhcpImplementation $ dhcpHashBucketAssignment $ dhcpDelayedServiceParameter $ dhcpMaxClientLeadTime $ dhcpFailOverEndpointState $ dhcpStatements $ dhcpComments $ dhcpOption) 
-+      X-NDS_CONTAINMENT ('organization' 'organizationalunit' 'domain') )
-+
-+objectclass ( 2.16.840.1.113719.1.203.6.13 
-+      NAME 'dhcpTSigKey' 
-+      DESC 'TSIG key for secure dynamic updates' 
-+      SUP top 
-+      MUST (cn $ dhcpKeyAlgorithm $ dhcpKeySecret ) 
-+      MAY ( dhcpComments ) 
-+      X-NDS_CONTAINMENT ('dhcpService' 'dhcpSharedNetwork' 'dhcpSubnet') )
-+
-+objectclass ( 2.16.840.1.113719.1.203.6.14 
-+      NAME 'dhcpDnsZone' 
-+      DESC 'DNS Zone for updating leases' 
-+      SUP top 
-+      MUST (cn $ dhcpDnsZoneServer ) 
-+      MAY (dhcpKeyDN $ dhcpComments) 
-+      X-NDS_CONTAINMENT ('dhcpService' 'dhcpSharedNetwork' 'dhcpSubnet') )
-+
-+objectclass ( 2.16.840.1.113719.1.203.6.15 
-+      NAME 'dhcpFailOverPeer' 
-+      DESC 'This class defines the Fail over peer' 
-+      SUP top 
-+  MUST ( cn $ dhcpFailOverPrimaryServer $ dhcpFailOverSecondaryServer $ dhcpFailoverPrimaryPort $ dhcpFailOverSecondaryPort) MAY (dhcpFailOverResponseDelay  $ dhcpFailOverUnackedUpdates $ dhcpMaxClientLeadTime $ dhcpFailOverSplit $ dhcpHashBucketAssignment $ dhcpFailOverLoadBalanceTime $ dhcpComments ) 
-+      X-NDS_CONTAINMENT ('dhcpService' 'dhcpSharedNetwork' 'dhcpSubnet') )
-+
-+objectclass ( 2.16.840.1.113719.1.203.6.16 
-+      NAME 'dhcpLocator' 
-+      DESC 'Locator object for DHCP configuration in the tree. There will be a single dhcpLocator object in the tree with links to all the DHCP objects in the tree' 
-+      SUP top 
-+      MUST ( cn ) 
-+      MAY ( dhcpServiceDN $dhcpServerDN $ dhcpSharedNetworkDN $ dhcpSubnetDN $ dhcpPoolDN $ dhcpGroupDN $ dhcpHostDN $  dhcpClassesDN $ dhcpKeyDN $ dhcpZoneDN $ dhcpFailOverPeerDN $ dhcpOption $ dhcpComments) 
-+      X-NDS_CONTAINMENT ('organization' 'organizationalunit' 'domain') )
-+
-+
-diff -Naur dhcp-3.0.5/contrib/dhcpd-conf-to-ldap.pl dhcp-3.0.5-ldap/contrib/dhcpd-conf-to-ldap.pl
---- dhcp-3.0.5/contrib/dhcpd-conf-to-ldap.pl   1969-12-31 19:00:00.000000000 -0500
-+++ dhcp-3.0.5-ldap/contrib/dhcpd-conf-to-ldap.pl      2007-02-23 14:01:43.000000000 -0500
-@@ -0,0 +1,760 @@
-+#!/usr/bin/perl -w
-+
-+# Brian Masney <masneyb@ntelos.net>
-+# To use this script, set your base DN below. Then run 
-+# ./dhcpd-conf-to-ldap.pl < /path-to-dhcpd-conf/dhcpd.conf > output-file
-+# The output of this script will generate entries in LDIF format. You can use
-+# the slapadd command to add these entries into your LDAP server. You will
-+# definately want to double check that your LDAP entries are correct before
-+# you load them into LDAP.
-+
-+# This script does not do much error checking. Make sure before you run this
-+# that the DHCP server doesn't give any errors about your config file
-+
-+# FailOver notes:
-+#   Failover is disabled by default, since it may need manually intervention.
-+#   You can try the '--use=failover' option to see what happens :-)
-+#
-+#   If enabled, the failover pool references will be written to LDIF output.
-+#   The failover configs itself will be added to the dhcpServer statements
-+#   and not to the dhcpService object (since this script uses only one and
-+#   it may be usefull to have multiple service containers in failover mode).
-+#   Further, this script does not check if primary or secondary makes sense,
-+#   it simply converts what it gets...
-+
-+use Net::Domain qw(hostname hostfqdn hostdomain);
-+use Getopt::Long;
-+
-+my $domain = hostdomain();           # your.domain
-+my $basedn = "dc=".$domain;
-+   $basedn =~ s/\./,dc=/g;           # dc=your,dc=domain
-+my $server = hostname();             # hostname (nodename)
-+my $dhcpcn = 'DHCP Config';          # CN of DHCP config tree
-+my $dhcpdn = "cn=$dhcpcn, $basedn";  # DHCP config tree DN
-+my $second = '';                     # secondary server DN / hostname
-+my $i_conf = '';                     # dhcp.conf file to read or stdin
-+my $o_ldif = '';                     # output ldif file name or stdout
-+my @use    = ();                     # extended flags (failover)
-+
-+sub usage($;$)
-+{
-+  my $rc = shift;
-+  my $err= shift;
-+
-+  print STDERR "Error: $err\n\n" if(defined $err);
-+  print STDERR <<__EOF_USAGE__;
-+usage: 
-+  $0 [options] < dhcpd.conf > dhcpd.ldif
-+
-+options:
-+
-+  --basedn  "dc=your,dc=domain"        ("$basedn")
-+
-+  --dhcpdn  "dhcp config DN"           ("$dhcpdn")
-+
-+  --server  "dhcp server name"         ("$server")
-+
-+  --second  "secondary server or DN"   ("$second")
-+
-+  --conf    "/path/to/dhcpd.conf"      (default is stdin)
-+  --ldif    "/path/to/output.ldif"     (default is stdout)
-+
-+  --use     "extended features"        (see source comments)
-+__EOF_USAGE__
-+  exit($rc);
-+}
-+
-+
-+sub next_token
-+{
-+  local ($lowercase) = @_;
-+  local ($token, $newline);
-+
-+  do 
-+    {
-+      if (!defined ($line) || length ($line) == 0)
-+        {
-+          $line = <>;
-+          return undef if !defined ($line);
-+          chop $line;
-+          $line_number++;
-+          $token_number = 0;
-+        }
-+
-+      $line =~ s/#.*//;
-+      $line =~ s/^\s+//;
-+      $line =~ s/\s+$//;
-+    }
-+  while (length ($line) == 0);
-+
-+  if (($token, $newline) = $line =~ /^(.*?)\s+(.*)/)
-+    {
-+      if ($token =~ /^"/) {
-+       #handle quoted token
-+       if ($token !~ /"\s*$/)
-+       {
-+         ($tok, $newline)  = $newline =~ /([^"]+")(.*)/;
-+         $token .= " $tok";
-+        }
-+      }
-+      $line = $newline;
-+    }
-+  else
-+    {
-+      $token = $line;
-+      $line = '';
-+    }
-+  $token_number++;
-+
-+  $token =~ y/[A-Z]/[a-z]/ if $lowercase;
-+
-+  return ($token);
-+}
-+
-+
-+sub remaining_line
-+{
-+  local ($block) = shift || 0;
-+  local ($tmp, $str);
-+
-+  $str = "";
-+  while (defined($tmp = next_token (0)))
-+    {
-+      $str .= ' ' if !($str eq "");
-+      $str .= $tmp;
-+      last if $tmp =~ /;\s*$/;
-+      last if($block and $tmp =~ /\s*[}{]\s*$/);
-+    }
-+
-+  $str =~ s/;$//;
-+  return ($str);
-+}
-+
-+
-+sub
-+add_dn_to_stack
-+{
-+  local ($dn) = @_;
-+
-+  $current_dn = "$dn, $current_dn";
-+}
-+
-+
-+sub
-+remove_dn_from_stack
-+{
-+  $current_dn =~ s/^.*?,\s*//;
-+}
-+
-+
-+sub
-+parse_error
-+{
-+  print "Parse error on line number $line_number at token number $token_number\n";
-+  exit (1);
-+}
-+
-+
-+sub
-+print_entry
-+{
-+  return if (scalar keys %curentry == 0);
-+
-+  if (!defined ($curentry{'type'}))
-+    {
-+      $hostdn = "cn=$server, $basedn";
-+      print "dn: $hostdn\n";
-+      print "cn: $server\n";
-+      print "objectClass: top\n";
-+      print "objectClass: dhcpServer\n";
-+      print "dhcpServiceDN: $current_dn\n";
-+      if(grep(/FaIlOvEr/i, @use))
-+        {
-+          foreach my $fo_peer (keys %failover)
-+            {
-+              next if(scalar(@{$failover{$fo_peer}}) <= 1);
-+              print "dhcpStatements: failover peer $fo_peer { ",
-+                    join('; ', @{$failover{$fo_peer}}), "; }\n";
-+            }
-+        }
-+      print "\n";
-+
-+      print "dn: $current_dn\n";
-+      print "cn: $dhcpcn\n";
-+      print "objectClass: top\n";
-+      print "objectClass: dhcpService\n";
-+      if (defined ($curentry{'options'}))
-+        {
-+          print "objectClass: dhcpOptions\n";
-+        }
-+      print "dhcpPrimaryDN: $hostdn\n";
-+      if(grep(/FaIlOvEr/i, @use) and ($second ne ''))
-+        {
-+          print "dhcpSecondaryDN: $second\n";
-+        }
-+    }
-+  elsif ($curentry{'type'} eq 'subnet')
-+    {
-+      print "dn: $current_dn\n";
-+      print "cn: " . $curentry{'ip'} . "\n";
-+      print "objectClass: top\n";
-+      print "objectClass: dhcpSubnet\n";
-+      if (defined ($curentry{'options'}))
-+        {
-+          print "objectClass: dhcpOptions\n";
-+        }
-+      
-+      print "dhcpNetMask: " . $curentry{'netmask'} . "\n";
-+      if (defined ($curentry{'ranges'}))
-+        {
-+          foreach $statement (@{$curentry{'ranges'}})
-+            {
-+              print "dhcpRange: $statement\n";
-+            }
-+        }
-+    }
-+  elsif ($curentry{'type'} eq 'shared-network')
-+    {
-+      print "dn: $current_dn\n";
-+      print "cn: " . $curentry{'descr'} . "\n";
-+      print "objectClass: top\n";
-+      print "objectClass: dhcpSharedNetwork\n";
-+      if (defined ($curentry{'options'}))
-+        {
-+          print "objectClass: dhcpOptions\n";
-+        }
-+    }
-+  elsif ($curentry{'type'} eq 'group')
-+    {
-+      print "dn: $current_dn\n";
-+      print "cn: group", $curentry{'idx'}, "\n";
-+      print "objectClass: top\n";
-+      print "objectClass: dhcpGroup\n";
-+      if (defined ($curentry{'options'}))
-+        {
-+          print "objectClass: dhcpOptions\n";
-+        }
-+    }
-+  elsif ($curentry{'type'} eq 'host')
-+    {
-+      print "dn: $current_dn\n";
-+      print "cn: " . $curentry{'host'} . "\n";
-+      print "objectClass: top\n";
-+      print "objectClass: dhcpHost\n";
-+      if (defined ($curentry{'options'}))
-+        {
-+          print "objectClass: dhcpOptions\n";
-+        }
-+
-+      if (defined ($curentry{'hwaddress'}))
-+        {
-+          $curentry{'hwaddress'} =~ y/[A-Z]/[a-z]/;
-+          print "dhcpHWAddress: " . $curentry{'hwaddress'} . "\n";
-+        }
-+    }
-+  elsif ($curentry{'type'} eq 'pool')
-+    {
-+      print "dn: $current_dn\n";
-+      print "cn: pool", $curentry{'idx'}, "\n";
-+      print "objectClass: top\n";
-+      print "objectClass: dhcpPool\n";
-+      if (defined ($curentry{'options'}))
-+        {
-+          print "objectClass: dhcpOptions\n";
-+        }
-+
-+      if (defined ($curentry{'ranges'}))
-+        {
-+          foreach $statement (@{$curentry{'ranges'}})
-+            {
-+              print "dhcpRange: $statement\n";
-+            }
-+        }
-+    }
-+  elsif ($curentry{'type'} eq 'class')
-+    {
-+      print "dn: $current_dn\n";
-+      print "cn: " . $curentry{'class'} . "\n";
-+      print "objectClass: top\n";
-+      print "objectClass: dhcpClass\n";
-+      if (defined ($curentry{'options'}))
-+        {
-+          print "objectClass: dhcpOptions\n";
-+        }
-+    }
-+  elsif ($curentry{'type'} eq 'subclass')
-+    {
-+      print "dn: $current_dn\n";
-+      print "cn: " . $curentry{'subclass'} . "\n";
-+      print "objectClass: top\n";
-+      print "objectClass: dhcpSubClass\n";
-+      if (defined ($curentry{'options'}))
-+        {
-+          print "objectClass: dhcpOptions\n";
-+        }
-+      print "dhcpClassData: " . $curentry{'class'} . "\n";
-+    }
-+
-+  if (defined ($curentry{'statements'}))
-+    {
-+      foreach $statement (@{$curentry{'statements'}})
-+        {
-+          print "dhcpStatements: $statement\n";
-+        }
-+    }
-+
-+  if (defined ($curentry{'options'}))
-+    {
-+      foreach $statement (@{$curentry{'options'}})
-+        {
-+          print "dhcpOption: $statement\n";
-+        }
-+    }
-+
-+  print "\n";
-+  undef (%curentry);
-+}
-+
-+
-+sub parse_netmask
-+{
-+  local ($netmask) = @_;
-+  local ($i);
-+
-+  if ((($a, $b, $c, $d) = $netmask =~ /^(\d+)\.(\d+)\.(\d+)\.(\d+)$/) != 4)
-+    {
-+      parse_error ();
-+    }
-+
-+  $num = (($a & 0xff) << 24) |
-+         (($b & 0xff) << 16) |
-+         (($c & 0xff) << 8) |
-+          ($d & 0xff);
-+
-+  for ($i=1; $i<=32 && $num & (1 << (32 - $i)); $i++)
-+    {
-+    }
-+  $i--;
-+
-+  return ($i);
-+}
-+
-+
-+sub parse_subnet
-+{
-+  local ($ip, $tmp, $netmask);
-+
-+  print_entry () if %curentry;
-+    
-+  $ip = next_token (0);
-+  parse_error () if !defined ($ip);
-+
-+  $tmp = next_token (1);
-+  parse_error () if !defined ($tmp);
-+  parse_error () if !($tmp eq 'netmask');
-+
-+  $tmp = next_token (0);
-+  parse_error () if !defined ($tmp);
-+  $netmask = parse_netmask ($tmp);
-+
-+  $tmp = next_token (0);
-+  parse_error () if !defined ($tmp);
-+  parse_error () if !($tmp eq '{');
-+
-+  add_dn_to_stack ("cn=$ip");
-+  $curentry{'type'} = 'subnet';
-+  $curentry{'ip'} = $ip;
-+  $curentry{'netmask'} = $netmask;
-+  $cursubnet = $ip;
-+  $curcounter{$ip} = { pool  => 0, group => 0 };
-+}
-+
-+
-+sub parse_shared_network
-+{
-+  local ($descr, $tmp);
-+
-+  print_entry () if %curentry;
-+
-+  $descr = next_token (0);
-+  parse_error () if !defined ($descr);
-+
-+  $tmp = next_token (0);
-+  parse_error () if !defined ($tmp);
-+  parse_error () if !($tmp eq '{');
-+
-+  add_dn_to_stack ("cn=$descr");
-+  $curentry{'type'} = 'shared-network';
-+  $curentry{'descr'} = $descr;
-+}
-+
-+
-+sub parse_host
-+{
-+  local ($descr, $tmp);
-+
-+  print_entry () if %curentry;
-+
-+  $host = next_token (0);
-+  parse_error () if !defined ($host);
-+
-+  $tmp = next_token (0);
-+  parse_error () if !defined ($tmp);
-+  parse_error () if !($tmp eq '{');
-+
-+  add_dn_to_stack ("cn=$host");
-+  $curentry{'type'} = 'host';
-+  $curentry{'host'} = $host;
-+}
-+
-+
-+sub parse_group
-+{
-+  local ($descr, $tmp);
-+
-+  print_entry () if %curentry;
-+
-+  $tmp = next_token (0);
-+  parse_error () if !defined ($tmp);
-+  parse_error () if !($tmp eq '{');
-+
-+  my $idx;
-+  if(exists($curcounter{$cursubnet})) {
-+    $idx = ++$curcounter{$cursubnet}->{'group'};
-+  } else {
-+    $idx = ++$curcounter{''}->{'group'};
-+  }
-+
-+  add_dn_to_stack ("cn=group".$idx);
-+  $curentry{'type'} = 'group';
-+  $curentry{'idx'} = $idx;
-+}
-+
-+
-+sub parse_pool
-+{
-+  local ($descr, $tmp);
-+
-+  print_entry () if %curentry;
-+
-+  $tmp = next_token (0);
-+  parse_error () if !defined ($tmp);
-+  parse_error () if !($tmp eq '{');
-+
-+  my $idx;
-+  if(exists($curcounter{$cursubnet})) {
-+    $idx = ++$curcounter{$cursubnet}->{'pool'};
-+  } else {
-+    $idx = ++$curcounter{''}->{'pool'};
-+  }
-+
-+  add_dn_to_stack ("cn=pool".$idx);
-+  $curentry{'type'} = 'pool';
-+  $curentry{'idx'} = $idx;
-+}
-+
-+
-+sub parse_class
-+{
-+  local ($descr, $tmp);
-+
-+  print_entry () if %curentry;
-+
-+  $class = next_token (0);
-+  parse_error () if !defined ($class);
-+
-+  $tmp = next_token (0);
-+  parse_error () if !defined ($tmp);
-+  parse_error () if !($tmp eq '{');
-+
-+  $class =~ s/\"//g;
-+  add_dn_to_stack ("cn=$class");
-+  $curentry{'type'} = 'class';
-+  $curentry{'class'} = $class;
-+}
-+
-+
-+sub parse_subclass
-+{
-+  local ($descr, $tmp);
-+
-+  print_entry () if %curentry;
-+
-+  $class = next_token (0);
-+  parse_error () if !defined ($class);
-+
-+  $subclass = next_token (0);
-+  parse_error () if !defined ($subclass);
-+
-+  $tmp = next_token (0);
-+  parse_error () if !defined ($tmp);
-+  parse_error () if !($tmp eq '{');
-+
-+  add_dn_to_stack ("cn=$subclass");
-+  $curentry{'type'} = 'subclass';
-+  $curentry{'class'} = $class;
-+  $curentry{'subclass'} = $subclass;
-+}
-+
-+
-+sub parse_hwaddress
-+{
-+  local ($type, $hw, $tmp);
-+
-+  $type = next_token (1);
-+  parse_error () if !defined ($type);
-+
-+  $hw = next_token (1);
-+  parse_error () if !defined ($hw);
-+  $hw =~ s/;$//;
-+
-+  $curentry{'hwaddress'} = "$type $hw";
-+}
-+
-+    
-+sub parse_range
-+{
-+  local ($tmp, $str);
-+
-+  $str = remaining_line ();
-+
-+  if (!($str eq ''))
-+    {
-+      $str =~ s/;$//;
-+      push (@{$curentry{'ranges'}}, $str);
-+    }
-+}
-+
-+
-+sub parse_statement
-+{
-+  local ($token) = shift;
-+  local ($str);
-+
-+  if ($token eq 'option')
-+    {
-+      $str = remaining_line ();
-+      push (@{$curentry{'options'}}, $str);
-+    }
-+  elsif($token eq 'failover')
-+    {
-+      $str = remaining_line (1); # take care on block
-+      if($str =~ /[{]/)
-+        {
-+          my ($peername, @statements);
-+
-+          parse_error() if($str !~ /^\s*peer\s+(.+?)\s+[{]\s*$/);
-+          parse_error() if(($peername = $1) !~ /^\"?[^\"]+\"?$/);
-+
-+          #
-+          # failover config block found:
-+          # e.g. 'failover peer "some-name" {'
-+          #
-+          if(not grep(/FaIlOvEr/i, @use))
-+            {
-+              print STDERR "Warning: Failover config 'peer $peername' found!\n";
-+              print STDERR "         Skipping it, since failover disabled!\n";
-+              print STDERR "         You may try out --use=failover option.\n";
-+            }
-+
-+          until($str =~ /[}]/ or $str eq "")
-+            {
-+                $str = remaining_line (1);
-+                # collect all statements, except ending '}'
-+                push(@statements, $str) if($str !~ /[}]/);
-+            }
-+          $failover{$peername} = [@statements];
-+        }
-+      else
-+        {
-+          #
-+          # pool reference to failover config is fine
-+          # e.g. 'failover peer "some-name";'
-+          #
-+          if(not grep(/FaIlOvEr/i, @use))
-+            {
-+              print STDERR "Warning: Failover reference '$str' found!\n";
-+              print STDERR "         Skipping it, since failover disabled!\n";
-+              print STDERR "         You may try out --use=failover option.\n";
-+            }
-+          else
-+            {
-+              push (@{$curentry{'statements'}}, $token. " " . $str);
-+            }
-+        }
-+    }
-+  elsif($token eq 'zone')
-+    {
-+      $str = $token;
-+      while($str !~ /}$/) {
-+        $str .= ' ' . next_token (0);
-+      }
-+      push (@{$curentry{'statements'}}, $str);
-+    }
-+  elsif($token =~ /^(authoritative)[;]*$/)
-+    {
-+      push (@{$curentry{'statements'}}, $1);
-+    }
-+  else
-+    {
-+      $str = $token . " " . remaining_line ();
-+      push (@{$curentry{'statements'}}, $str);
-+    }
-+}
-+
-+
-+my $ok = GetOptions(
-+    'basedn=s'      => \$basedn,
-+    'dhcpdn=s'      => \$dhcpdn,
-+    'server=s'      => \$server,
-+    'second=s'      => \$second,
-+    'conf=s'        => \$i_conf,
-+    'ldif=s'        => \$o_ldif,
-+    'use=s'         => \@use,
-+    'h|help|usage'  => sub { usage(0); },
-+);
-+
-+unless($server =~ /^\w+/)
-+  {
-+    usage(1, "invalid server name '$server'");
-+  }
-+unless($basedn =~ /^\w+=[^,]+/)
-+  {
-+    usage(1, "invalid base dn '$basedn'");
-+  }
-+
-+if($dhcpdn =~ /^cn=([^,]+)/i)
-+  {
-+    $dhcpcn = "$1";
-+  }
-+$second = '' if not defined $second;
-+unless($second eq '' or $second =~ /^cn=[^,]+\s*,\s*\w+=[^,]+/i)
-+  {
-+    if($second =~ /^cn=[^,]+$/i)
-+      {
-+        # relative DN 'cn=name'
-+        $second = "$second, $basedn";
-+      }
-+    elsif($second =~ /^\w+/)
-+      {
-+        # assume hostname only
-+        $second = "cn=$second, $basedn";
-+      }
-+    else
-+      {
-+        usage(1, "invalid secondary '$second'")
-+      }
-+  }
-+
-+usage(1) unless($ok);
-+
-+if($i_conf ne "" and -f $i_conf)
-+  {
-+    if(not open(STDIN, '<', $i_conf))
-+      {
-+        print STDERR "Error: can't open conf file '$i_conf': $!\n";
-+        exit(1);
-+      }
-+  }
-+if($o_ldif ne "")
-+  {
-+    if(-e $o_ldif)
-+      {
-+        print STDERR "Error: output ldif name '$o_ldif' already exists!\n";
-+        exit(1);
-+      }
-+    if(not open(STDOUT, '>', $o_ldif))
-+      {
-+        print STDERR "Error: can't open ldif file '$o_ldif': $!\n";
-+        exit(1);
-+      }
-+  }
-+
-+
-+print STDERR "Creating LDAP Configuration with the following options:\n";
-+print STDERR "\tBase DN: $basedn\n";
-+print STDERR "\tDHCP DN: $dhcpdn\n";
-+print STDERR "\tServer DN: cn=$server, $basedn\n";
-+print STDERR "\tSecondary DN: $second\n"
-+             if(grep(/FaIlOvEr/i, @use) and $second ne '');
-+print STDERR "\n";
-+
-+my $token;
-+my $token_number = 0;
-+my $line_number = 0;
-+my %curentry;
-+my $cursubnet = '';
-+my %curcounter = ( '' => { pool => 0, group => 0 } );
-+
-+$current_dn = "$dhcpdn";
-+$curentry{'descr'} = $dhcpcn;
-+$line = '';
-+%failover = ();
-+
-+while (($token = next_token (1)))
-+  {
-+    if ($token eq '}')
-+      {
-+        print_entry () if %curentry;
-+        if($current_dn =~ /.+?,\s*${dhcpdn}$/) {
-+          # don't go below dhcpdn ...
-+          remove_dn_from_stack ();
-+        }
-+      }
-+    elsif ($token eq 'subnet')
-+      {
-+        parse_subnet ();
-+        next;
-+      }
-+    elsif ($token eq 'shared-network')
-+      {
-+        parse_shared_network ();
-+        next;
-+      }
-+    elsif ($token eq 'class')
-+      {
-+        parse_class ();
-+        next;
-+      }
-+    elsif ($token eq 'subclass')
-+      {
-+        parse_subclass ();
-+        next;
-+      }
-+    elsif ($token eq 'pool')
-+      {
-+        parse_pool ();
-+        next;
-+      }
-+    elsif ($token eq 'group')
-+      {
-+        parse_group ();
-+        next;
-+      }
-+    elsif ($token eq 'host')
-+      {
-+        parse_host ();
-+        next;
-+      }
-+    elsif ($token eq 'hardware')
-+      {
-+        parse_hwaddress ();
-+        next;
-+      }
-+    elsif ($token eq 'range')
-+      {
-+        parse_range ();
-+        next;
-+      }
-+    else
-+      {
-+        parse_statement ($token);
-+        next;
-+      }
-+  }
-+
-+close(STDIN)  if($i_conf);
-+close(STDOUT) if($o_ldif);
-+
-+print STDERR "Done.\n";
-+
-diff -Naur dhcp-3.0.5/debian/changelog dhcp-3.0.5-ldap/debian/changelog
---- dhcp-3.0.5/debian/changelog        1969-12-31 19:00:00.000000000 -0500
-+++ dhcp-3.0.5-ldap/debian/changelog   2006-12-14 10:03:41.000000000 -0500
-@@ -0,0 +1,25 @@
-+dhcp3-server-ldap (3.0.4-1) unstable; urgency=low
-+
-+  * See ChangeLog-LDAP for changes in this release
-+
-+ -- Brian Masney <masneyb@gftp.org>  Mon, 08 May 2006 08:31:46 -0400
-+
-+dhcp3-server-ldap (3.0.1rc13-1) unstable; urgency=low
-+
-+  * See ChangeLog-LDAP for changes in this release
-+
-+ -- Brian Masney <masneyb@gftp.org>  Wed, 05 May 2004 07:20:13 -0400
-+
-+dhcp3-server-ldap (3.0.1rc12-1) unstable; urgency=low
-+
-+  * Updated patch to work against ISC DHCPD 3.0.1rc12
-+
-+ -- Brian Masney <masneyb@gftp.org>  Mon, 08 Sep 2003 16:34:00 -0400
-+
-+dhcp3-server-ldap (3.0.1rc11-2) unstable; urgency=low
-+
-+  * Added these Debian files. They are mostly from the existing dhcp3-server
-+    package in Debian.
-+
-+ -- Brian Masney <masneyb@gftp.org>  Mon, 04 Aug 2003 13:34:00 -0400
-+
-diff -Naur dhcp-3.0.5/debian/control dhcp-3.0.5-ldap/debian/control
---- dhcp-3.0.5/debian/control  1969-12-31 19:00:00.000000000 -0500
-+++ dhcp-3.0.5-ldap/debian/control     2006-12-14 10:03:41.000000000 -0500
-@@ -0,0 +1,12 @@
-+Source: dhcp3-server-ldap
-+Section: net
-+Priority: optional
-+Maintainer: Brian Masney <masneyb@gftp.org>
-+Build-Depends: debhelper (>= 2.1.18), dpkg-dev (>= 1.7.0), groff, libldap2-dev
-+Standards-Version: 2.4.0.0
-+
-+Package: dhcp3-server-ldap
-+Architecture: any
-+Depends: ${shlibs:Depends}, debconf, debianutils (>= 1.7), dhcp3-server (>= 3.0+3.0.1rc9)
-+Conflicts: dhcp, dhcp3-ldap-ntelos
-+Description: This is the DHCP server with LDAP patches applied to it
-diff -Naur dhcp-3.0.5/debian/copyright dhcp-3.0.5-ldap/debian/copyright
---- dhcp-3.0.5/debian/copyright        1969-12-31 19:00:00.000000000 -0500
-+++ dhcp-3.0.5-ldap/debian/copyright   2006-12-14 10:03:41.000000000 -0500
-@@ -0,0 +1,30 @@
-+/*
-+ * Copyright (c) 1996, 1997 The Internet Software Consortium.
-+ * 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 Internet Software Consortium 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 INTERNET SOFTWARE CONSORTIUM 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 INTERNET SOFTWARE CONSORTIUM 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.
-+ */
-diff -Naur dhcp-3.0.5/debian/dhcp3-server-ldap.files dhcp-3.0.5-ldap/debian/dhcp3-server-ldap.files
---- dhcp-3.0.5/debian/dhcp3-server-ldap.files  1969-12-31 19:00:00.000000000 -0500
-+++ dhcp-3.0.5-ldap/debian/dhcp3-server-ldap.files     2006-12-14 10:03:41.000000000 -0500
-@@ -0,0 +1 @@
-+usr/sbin/dhcpd3
-diff -Naur dhcp-3.0.5/debian/dhcp3-server-ldap.postinst dhcp-3.0.5-ldap/debian/dhcp3-server-ldap.postinst
---- dhcp-3.0.5/debian/dhcp3-server-ldap.postinst       1969-12-31 19:00:00.000000000 -0500
-+++ dhcp-3.0.5-ldap/debian/dhcp3-server-ldap.postinst  2006-12-14 10:03:41.000000000 -0500
-@@ -0,0 +1,13 @@
-+#!/bin/sh
-+
-+set -e 
-+
-+# Removes the left over diversions of the old package
-+
-+if [ "$1" = remove -o "$1" = upgrade ]; then
-+      for v in `list_versions`; do
-+              dpkg-divert --package dhcp3-server-ldap --remove \
-+                      --rename --divert /usr/sbin/dhcpd3-noldap \
-+                      /usr/sbin/dhcpd3
-+      done
-+fi
-diff -Naur dhcp-3.0.5/debian/dhcp3-server-ldap.postrm dhcp-3.0.5-ldap/debian/dhcp3-server-ldap.postrm
---- dhcp-3.0.5/debian/dhcp3-server-ldap.postrm 1969-12-31 19:00:00.000000000 -0500
-+++ dhcp-3.0.5-ldap/debian/dhcp3-server-ldap.postrm    2006-12-14 10:03:41.000000000 -0500
-@@ -0,0 +1,8 @@
-+#!/bin/sh
-+
-+set -e 
-+
-+if [ "$1" = remove ]; then
-+      dpkg-divert --package dhcp3-server-ldap --remove --rename \
-+              --divert /usr/sbin/dhcpd3-noldap /usr/sbin/dhcpd3
-+fi
-diff -Naur dhcp-3.0.5/debian/dhcp3-server-ldap.preinst dhcp-3.0.5-ldap/debian/dhcp3-server-ldap.preinst
---- dhcp-3.0.5/debian/dhcp3-server-ldap.preinst        1969-12-31 19:00:00.000000000 -0500
-+++ dhcp-3.0.5-ldap/debian/dhcp3-server-ldap.preinst   2006-12-14 10:03:41.000000000 -0500
-@@ -0,0 +1,14 @@
-+#!/bin/sh
-+
-+set -e 
-+
-+if [ "$1" = install -o "$1" = upgrade ]; then
-+      if dpkg-divert --list /usr/sbin/dhcpd3 \
-+              | grep -q "by dhcp3-server-ldap";
-+      then
-+              exit 0
-+      fi
-+              
-+      dpkg-divert --package dhcp3-server-ldap --add --rename \
-+              --divert /usr/sbin/dhcpd3-noldap /usr/sbin/dhcpd3
-+fi
-diff -Naur dhcp-3.0.5/debian/dirs dhcp-3.0.5-ldap/debian/dirs
---- dhcp-3.0.5/debian/dirs     1969-12-31 19:00:00.000000000 -0500
-+++ dhcp-3.0.5-ldap/debian/dirs        2006-12-14 10:03:41.000000000 -0500
-@@ -0,0 +1 @@
-+usr/sbin
-diff -Naur dhcp-3.0.5/debian/rules dhcp-3.0.5-ldap/debian/rules
---- dhcp-3.0.5/debian/rules    1969-12-31 19:00:00.000000000 -0500
-+++ dhcp-3.0.5-ldap/debian/rules       2006-12-14 10:03:41.000000000 -0500
-@@ -0,0 +1,87 @@
-+#!/usr/bin/make -f
-+# Made with the iad of dh_make, by Craig Small
-+# Sample debian/rules that uses debhelper. GNU copyright 1997 by Joey Hess.
-+# Also some stuff taken from debmake scripts, by Cristopt Lameter.
-+
-+# Uncomment this to turn on verbose mode.
-+#export DH_VERBOSE=1
-+
-+export DH_COMPAT=3
-+
-+DESTDIR = `pwd`/debian/tmp
-+
-+IVARS = DESTDIR=$(DESTDIR)
-+
-+BVARS = PREDEFINES='-D_PATH_DHCPD_DB=\"/var/lib/dhcp3/dhcpd.leases\" \
-+      -D_PATH_DHCLIENT_DB=\"/var/lib/dhcp3/dhclient.leases\" \
-+      -D_PATH_DHCLIENT_SCRIPT=\"/etc/dhcp3/dhclient-script\" \
-+      -D_PATH_DHCPD_CONF=\"/etc/dhcp3/dhcpd.conf\" \
-+        -D_PATH_DHCLIENT_CONF=\"/etc/dhcp3/dhclient.conf\"'
-+
-+build: build-stamp
-+build-stamp:
-+      dh_testdir
-+
-+      ./configure
-+      $(MAKE) $(BVARS)
-+
-+      touch build-stamp
-+
-+clean: 
-+      dh_testdir
-+      rm -f build-stamp install-stamp
-+
-+      # Add here commands to clean up after the build process.
-+      -$(MAKE) distclean
-+
-+      # Remove leftover junk...
-+      rm -Rf work.linux-2.2/
-+
-+      dh_clean
-+
-+install: install-stamp
-+install-stamp: build-stamp
-+      dh_testdir
-+      dh_testroot
-+      dh_clean -k
-+      dh_installdirs
-+
-+      # Add here commands to install the package into debian/tmp.
-+      $(MAKE) install $(IVARS)
-+
-+      mv $(DESTDIR)/usr/sbin/dhcpd $(DESTDIR)/usr/sbin/dhcpd3
-+
-+      dh_movefiles
-+
-+      # Remove unwanted directories that dh_movefiles leaves around
-+      rmdir $(DESTDIR)/etc
-+      rm -Rf $(DESTDIR)/sbin/
-+      rm -Rf $(DESTDIR)/usr/bin/
-+      rm -Rf $(DESTDIR)/usr/include/
-+      rm -Rf $(DESTDIR)/usr/lib/
-+      rm -Rf $(DESTDIR)/usr/local/
-+      rm -Rf $(DESTDIR)/usr/man/
-+      rm -Rf $(DESTDIR)/var/
-+      rm -f $(DESTDIR)/usr/sbin/dhcrelay
-+
-+      touch install-stamp
-+
-+# Build architecture-dependent files here (this package does not contain
-+#     architecture-independent files).
-+binary-arch: build install
-+      dh_testdir -a
-+      dh_testroot -a
-+      dh_strip -a
-+      dh_compress -a
-+      dh_fixperms -a
-+      dh_installdeb -a
-+      dh_shlibdeps -a
-+      dh_gencontrol -a
-+      dh_md5sums -a
-+      dh_builddeb -a
-+
-+source diff:                                                                  
-+      @echo >&2 'source and diff are obsolete - use dpkg-source -b'; false
-+
-+binary: binary-arch
-+.PHONY: build clean binary-indep binary-arch binary
-diff -Naur dhcp-3.0.5/doc/draft-ietf-dhc-ldap-schema-01.txt dhcp-3.0.5-ldap/doc/draft-ietf-dhc-ldap-schema-01.txt
---- dhcp-3.0.5/doc/draft-ietf-dhc-ldap-schema-01.txt   1969-12-31 19:00:00.000000000 -0500
-+++ dhcp-3.0.5-ldap/doc/draft-ietf-dhc-ldap-schema-01.txt      2006-12-14 10:03:41.000000000 -0500
-@@ -0,0 +1,1089 @@
-+
-+
-+
-+
-+
-+Network Working Group                                  M. Meredith,
-+Internet Draft                                         V. Nanjundaswamy,
-+Document: <draft-ietf-dhc-ldap-schema-00.txt>          M. Hinckley
-+Category: Proposed Standard                            Novell Inc.
-+Expires: 15th December 2001                            16th June 2001
-+
-+
-+                          LDAP Schema for DHCP
-+
-+Status of this Memo
-+
-+This document is an Internet-Draft and is in full conformance with all
-+provisions of Section 10 of RFC2026 [ ].
-+
-+Internet-Drafts are working documents of the Internet Engineering Task
-+Force (IETF), its areas, and its working groups.  Note that other groups
-+may also distribute working documents as Internet-Drafts. Internet-
-+Drafts are draft documents valid for a maximum of six months and may be
-+updated, replaced, or obsolete by other documents at any time.  It is
-+inappropriate to use Internet-Drafts as reference material or to cite
-+them other than as "work in progress."  The list of current Internet-
-+Drafts can be accessed at http://www.ietf.org/ietf/1id-abstracts.txt The
-+list of Internet-Draft Shadow Directories can be accessed at
-+http://www.ietf.org/shadow.html.
-+
-+1. Abstract
-+
-+This document defines a schema for representing DHCP configuration in an
-+LDAP directory. It can be used to represent the DHCP Service
-+configuration(s) for an entire enterprise network, a subset of the
-+network, or even a single server. Representing DHCP configuration in an
-+LDAP directory enables centralized management of DHCP services offered
-+by one or more DHCP Servers within the enterprise.
-+
-+2. Conventions used in this document
-+
-+The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
-+"SHOULD", "SHOULD NOT", "RECOMMENDED",  "MAY", and "OPTIONAL" in this
-+document are to be interpreted as described in RFC-2119 [ ].
-+
-+In places where different sets of terminology are commonly used to
-+represent similar DHCP concepts, this schema uses the terminology of the
-+Internet Software Consortium's DHCP server reference implementation.
-+For more information see www.isc.org.
-+
-+3. Design Considerations
-+
-+The DHCP LDAP schema is designed to be a simple multi-server schema. The
-+
-+
-+
-+M. Meredith et al.        Expires December 2001                 [Page 1]
-+
-+
-+
-+
-+
-+INTERNET-DRAFT            LDAP Schema for DHCP              16 June 2001
-+
-+
-+intent of this schema is to provide a basic framework for representing
-+the most common elements used in the configuration of DHCP Server.  This
-+should allow other network services to obtain and use basic DHCP
-+configuration information in a server-independent but knowledgeable way.
-+
-+It is expected that some implementations may need to extend the schema
-+objects, in order to implement all of their features or needs. It is
-+recommended that you use the schema defined in this draft to represent
-+DHCP configuration information in an LDAP directory.  Conforming to a
-+standard schema improves interoperability between DHCP implementations
-+from different vendors.
-+
-+Some implementations may choose not to support all of the objects
-+defined here.
-+
-+Two decisions are explicitly left up to each implementation:
-+
-+First, implementations may choose not to store the lease information in
-+the directory, so those objects would not be used.
-+
-+Second, implementations may choose not to implement the auditing
-+information.
-+
-+It is up to the implementation to determine if the data in the directory
-+is considered "authoritative", or if it is simply a copy of data from an
-+authoritative source. Validity of the information if used as a copy is
-+to be ensured by the implementation.
-+
-+Primarily two types of applications will use the information in this
-+schema: 1. DHCP servers (for loading their configuration) 2. Management
-+Interfaces (for defining/editing configurations).
-+
-+The schema should be efficient for the needs of both types of
-+applications.  The schema is designed to allow objects managed by DHCP
-+(such as computers, subnets, etc) to be present anywhere in a directory
-+hierarchy (to allow those objects to be placed in the directory for
-+managing administrative control and access to the objects).
-+
-+The schema uses a few naming conventions - all object classes and
-+attributes are prefixed with "dhcp" to decrease the chance that object
-+classes and attributes will have the same name.  The schema also uses
-+standard naming attributes ("cn", "ou", etc) for all objects.
-+
-+4. Common DHCP Configuration Attributes
-+
-+Although DHCP manages several different types of objects, the
-+configuration of those objects is often similar.  Consequently, most of
-+these objects have a common set of attributes, which are defined below.
-+
-+
-+
-+M. Meredith et al.        Expires December 2001                 [Page 2]
-+
-+
-+
-+
-+
-+INTERNET-DRAFT            LDAP Schema for DHCP              16 June 2001
-+
-+
-+4.1. Attributes Definitions
-+
-+The schema definitions listed below are for readability.  The LDIF
-+layout for this schema will follow in section 8.
-+
-+Name: dhcpPrimaryDN Description: The Distinguished Name of the
-+dhcpServer object, which is the primary server for the configuration.
-+Syntax: DN Flags: SINGLE-VALUE
-+
-+Named: dhcpSecondaryDN Description: The Distinguished Name(s) of the
-+dhcpServer object(s), which are secondary servers for the configuration.
-+Syntax: DN
-+
-+Name: dhcpStatements Description: Flexible storage for representing any
-+specific data depending on the object to which it is attached. Examples
-+include conditional statements, Server parameters, etc.  This also
-+serves as a 'catch-all' attribute that allows the standard to evolve
-+without needing to update the schema.  Syntax: IA5String
-+
-+Name: dhcpRange Description: The starting and ending IP Addresses in the
-+range (inclusive), separated by a hyphen; if the range only contains one
-+address, then just the address can be specified with no hyphen.  Each
-+range is defined as a separate value.  Syntax: IA5String
-+
-+Name: dhcpPermitList Description: This attribute contains the permit
-+lists associated with a pool. Each permit list is defined as a separate
-+value.  Syntax: IA5String
-+
-+Name: dhcpNetMask Description: The subnet mask length for the subnet.
-+The mask can be easily computed from this length.  Syntax: Integer
-+Flags: SINGLE-VALUE
-+
-+Name: dhcpOption Description: Encoded option values to be sent to
-+clients.  Each value represents a single option and contains (OptionTag,
-+Length, OptionData) encoded in the format used by DHCP.  For more
-+information see [DHCPOPT].  Syntax: OctetString
-+
-+Name: dhcpClassData Description: Encoded text string or list of bytes
-+expressed in hexadecimal, separated by colons. Clients match subclasses
-+based on matching the class data with the results of a 'match' or 'spawn
-+with' statement in the class name declarations.  Syntax: IA5String
-+Flags: SINGLE-VALUE
-+
-+Name: dhcpSubclassesDN Description: List of subclasses, these are the
-+actual DN of each subclass object.  Syntax: DN
-+
-+Name: dhcpClassesDN Description: List of classes, these are the actual
-+DN of each class object.  Syntax: DN
-+
-+
-+
-+M. Meredith et al.        Expires December 2001                 [Page 3]
-+
-+
-+
-+
-+
-+INTERNET-DRAFT            LDAP Schema for DHCP              16 June 2001
-+
-+
-+Name: dhcpSubnetDN Description: List of subnets, these are the actual DN
-+of each subnet object.  Syntax: DN
-+
-+Name: dhcpPoolDN Description: List of pools, these are the actual DN of
-+each Pool object.  Syntax: DN
-+
-+Name: dhcpOptionsDN Description: List of options, these are the actual
-+DN of each Options object.  Syntax: DN
-+
-+Name: dhcpHostDN Description: List of hosts, these are the actual DN of
-+each host object.  Syntax: DN
-+
-+Name: dhcpSharedNetworkDN Description: List of shared networks, these
-+are the actual DN of each shared network object.  Syntax: DN
-+
-+Name: dhcpGroupDN Description: List of groups, these are the actual DN
-+of each Group object.  Syntax: DN
-+
-+Name: dhcpLeaseDN Description: Single Lease DN. A dhcpHost configuration
-+uses this attribute to identify a static IP address assignment.  Syntax:
-+DN Flags: SINGLE-VALUE
-+
-+Name: dhcpLeasesDN Description: List of leases, these are the actual DN
-+of each lease object.  Syntax: DN
-+
-+Name: dhcpServiceDN Description: The DN of dhcpService object(s)which
-+contain the configuration information. Each dhcpServer object has this
-+attribute identifying the DHCP configuration(s) that the server is
-+associated with.  Syntax: DN
-+
-+Name: dhcpHWAddress Description: The hardware address of the client
-+associated with a lease Syntax: OctetString Flags: SINGLE-VALUE
-+
-+Name: dhcpVersion Description: This is the version identified for the
-+object that this attribute is part of. In case of the dhcpServer object,
-+this represents the DHCP software version.  Syntax: IA5String Flags:
-+SINGLE-VALUE
-+
-+Name: dhcpImplementation Description: DHCP Server implementation
-+description e.g. DHCP Vendor information.  Syntax: IA5String Flags:
-+SINGLE-VALUE
-+
-+Name: dhcpHashBucketAssignment Description: HashBucketAssignment bit map
-+for the DHCP Server, as defined in DHC Load Balancing Algorithm [RFC
-+3074].  Syntax: Octet String Flags: SINGLE-VALUE
-+
-+Name: dhcpDelayedServiceParameter Description: Delay in seconds
-+corresponding to Delayed Service Parameter configuration, as defined in
-+
-+
-+
-+M. Meredith et al.        Expires December 2001                 [Page 4]
-+
-+
-+
-+
-+
-+INTERNET-DRAFT            LDAP Schema for DHCP              16 June 2001
-+
-+
-+DHC Load Balancing Algorithm [RFC 3074].  Syntax: Integer Flags: SINGLE-
-+VALUE
-+
-+Name: dhcpMaxClientLeadTime Description: Maximum Client Lead Time
-+configuration in seconds, as defined in DHCP Failover Protocol [FAILOVR]
-+Syntax: Integer Flags: SINGLE-VALUE
-+
-+Name: dhcpFailOverEndpointState Description: Server (Failover Endpoint)
-+state, as defined in DHCP Failover Protocol [FAILOVR] Syntax: IA5String
-+Flags: SINGLE-VALUE
-+
-+5. Configurations and Services
-+
-+The schema definitions below are for readability the LDIF layout for
-+this schema will follow in section 8.
-+
-+The DHC working group is currently considering several proposals for
-+fail-over and redundancy of DHCP servers.  These may require sharing of
-+configuration information between servers.  This schema provides a
-+generalized mechanism for supporting any of these proposals, by
-+separating the definition of a server from the definition of
-+configuration service provided by the server.
-+
-+Separating the DHCP Server (dhcpServer) and the DHCP Configuration
-+(dhcpService) representations allows a configuration service to be
-+provided by one or more servers. Similarly, a server may provide one or
-+more configurations. The schema allows a server to be configured as
-+either a primary or secondary provider of a DHCP configuration.
-+
-+Configurations are also defined so that one configuration can include
-+some of the objects that are defined in another configuration.  This
-+allows for sharing and/or a hierarchy of related configuration items.
-+
-+Name: dhcpService Description:  Service object that represents the
-+actual DHCP Service configuration. This will be a container with the
-+following attributes.  Must: cn, dhcpPrimaryDN May: dhcpSecondaryDN,
-+dhcpSharedNetworkDN, dhcpSubnetDN, dhcpGroupDN, dhcpHostDN,
-+dhcpClassesDN, dhcpOptionsDN, dhcpStatements
-+
-+The following objects could exist inside the dhcpService container:
-+dhcpSharedNetwork, dhcpSubnet, dhcpGroup, dhcpHost, dhcpClass,
-+dhcpOptions, dhcpLog
-+
-+Name: dhcpServer Description:  Server object that the DHCP server will
-+login as.  The configuration information is in the dhcpService container
-+that the dhcpServiceDN points to.  Must: cn, dhcpServiceDN May:
-+dhcpVersion, dhcpImplementation, dhcpHashBucketAssignment,
-+dhcpDelayedServiceParameter, dhcpMaxClientLeadTime, 
-+
-+
-+
-+M. Meredith et al.        Expires December 2001                 [Page 5]
-+
-+
-+
-+
-+
-+INTERNET-DRAFT            LDAP Schema for DHCP              16 June 2001
-+dhcpFailOverEndpointState, dhcpStatements
-+
-+5.1. DHCP Declaration related classes:
-+
-+Name: dhcpSharedNetwork Description: Shared Network class will list what
-+pools and subnets are in this network.
-+
-+This will be a container with the following attributes.  Must: cn May:
-+dhcpSubnetDN, dhcpPoolDN, dhcpOptionsDN, dhcpStatements
-+
-+The following objects can exist within a dhcpSharedNetwork container:
-+dhcpSubnet, dhcpPool, dhcpOptions, dhcpLog
-+
-+Name: dhcpSubnet Description: Subnet object will include configuration
-+information associated with a subnet, including a range and a net mask.
-+
-+This will be a container with the following attributes.  Must: cn
-+(Subnet address), dhcpNetMask May: dhcpRange, dhcpPoolDN, dhcpGroupDN,
-+dhcpHostDN, dhcpClassesDN, dhcpLeasesDN, dhcpOptionsDN, dhcpStatements
-+
-+The following objects can exist within a dhcpSubnet container: dhcpPool,
-+dhcpGroup, dhcpHost, dhcpClass, dhcpOptions, dhcpLease, dhcpLog
-+
-+Name: dhcpGroup Description: Group object will have configuration
-+information associated with a group.
-+
-+This will be a container with the following attributes.  Must: cn May:
-+dhcpHostDN, dhcpOptionsDN, dhcpStatements
-+
-+The following objects can exist within a dhcpGroup container: dhcpHost,
-+dhcpOptions
-+
-+Name: dhcpHost Description: The host object includes DHCP host
-+declarations to assign a static IP address or declare the client as
-+known or specify statements for a specific client.  Must: cn May:
-+dhcpLeaseDN, dhcpHWAddress, dhcpOptionsDN, dhcpStatements
-+
-+The following objects can exist within a dhcpHost container: dhcpLease,
-+dhcpOptions
-+
-+Name: dhcpOptions Description: The options class is for option space
-+declarations, it contains a list of options.  Must: cn, dhcpOption
-+
-+Name: dhcpClass Description: This is a class to group clients together
-+based on matching rules.
-+
-+This will be a container with the following attributes.  Must: cn May:
-+dhcpSubClassesDN, dhcpOptionsDN, dhcpStatements
-+
-+The following object can exist within a dhcpClass container:
-+dhcpSubclass, dhcpOptions
-+
-+
-+
-+M. Meredith et al.        Expires December 2001                 [Page 6]
-+
-+
-+
-+
-+
-+INTERNET-DRAFT            LDAP Schema for DHCP              16 June 2001
-+
-+
-+Name: dhcpSubClass Description: This includes configuration information
-+for a subclass associated with a class. The dhcpSubClass object will
-+always be contained within the corresponding class container object.
-+Must: cn May:  dhcpClassData, dhcpOptionsDN, dhcpStatements
-+
-+Name: dhcpPool Description: This contains configuration for a pool that
-+will have the range of addresses, permit lists and point to classes and
-+leases that are members of this pool.
-+
-+This will be a container that could be contained by dhcpSubnet or a
-+dhcpSharedNetwork.  Must: cn, dhcpRange May: dhcpClassesDN,
-+dhcpPermitList, dhcpLeasesDN, dhcpOptionsDN, dhcpStatements
-+
-+The following objects can exist within a dhcpPool container: dhcpClass,
-+dhcpOptions, dhcpLease, dhcpLog
-+
-+6. Tracking Address Assignments
-+
-+The behavior of a DHCP server is influenced by two factors - it's
-+configuration and the current state of the addresses that have been
-+assigned to clients. This schema defines a set of objects for
-+representing the DHCP configuration associated with a server. The
-+following object classes provide the ability to record how addresses are
-+used including maintaining history (audit log) on individual leases.
-+Recording lease information in a directory could result in a significant
-+performance impact and is therefore optional. Implementations supporting
-+logging of leases need to consider the performance impact.
-+
-+6.1. dhcpLeases Attribute Definitions
-+
-+The schema definitions below are for readability the LDIF layout for
-+this schema will follow in section 8.
-+
-+Name: dhcpAddressState Description: This stores information about the
-+current binding-status of an address.  For dynamic addresses managed by
-+DHCP, the values should be restricted to the states defined in the DHCP
-+Failover Protocol draft [FAILOVR]: 'FREE', 'ACTIVE', 'EXPIRED',
-+'RELEASED', 'RESET', 'ABANDONED', 'BACKUP'.  For more information on
-+these states see [FAILOVR].  For other addresses, it SHOULD be one of
-+the following: 'UNKNOWN', 'RESERVED' (an address that is managed by DHCP
-+that is reserved for a specific client), 'RESERVED-ACTIVE' (same as
-+reserved, but address is currently in use),  'ASSIGNED' (assigned
-+manually or by some other mechanism), 'UNASSIGNED', 'NOTASSIGNABLE'.
-+Syntax: IA5String Flags: SINGLE-VALUE
-+
-+Name: dhcpExpirationTime Description: This is the time the current lease
-+for an address expires.  Syntax: DateTime Flags: SINGLE-VALUE
-+
-+
-+
-+
-+M. Meredith et al.        Expires December 2001                 [Page 7]
-+
-+
-+
-+
-+
-+INTERNET-DRAFT            LDAP Schema for DHCP              16 June 2001
-+
-+
-+Name: dhcpStartTimeOfState Description: This is the time of the last
-+state change for a leased address.  Syntax: DateTime Flags: SINGLE-VALUE
-+
-+Name: dhcpLastTransactionTime Description: This is the last time a valid
-+DHCP packet was received from the client.  Syntax: DateTime Flags:
-+SINGLE-VALUE
-+
-+Name: dhcpBootpFlag Description: This indicates whether the address was
-+assigned via BOOTP Syntax: Boolean Flags: SINGLE-VALUE
-+
-+Name: dhcpDomainName Description: This is the name of the domain sent to
-+the client by the server.  It is essentially the same as the value for
-+DHCP option 15 sent to the client, and represents only the domain - not
-+the full FQDN.  To obtain the full FQDN assigned to the client you must
-+prepend the "dhcpAssignedHostName" to this value with a ".".  Syntax:
-+IA5String Flags: SINGLE-VALUE
-+
-+Name: dhcpDnsStatus Description: This indicates the status of updating
-+DNS resource records on behalf of the client by the DHCP server for this
-+address.  The value is a 16-bit bitmask that has the same values as
-+specified by the Failover-DDNS option (see [FAILOVR]).  Syntax: Integer
-+Flags: SINGLE-VALUE
-+
-+Name: dhcpRequestedHostName Description: This is the hostname that was
-+requested by the client.  Syntax: IA5String Flags: SINGLE-VALUE
-+
-+Name: dhcpAssignedHostName Description: This is the actual hostname that
-+was assigned to a client. It may not be the name that was requested by
-+the client.  The fully qualified domain name can be determined by
-+appending the value of "dhcpDomainName" (with a dot separator) to this
-+name.  Syntax: IA5String Flags: SINGLE-VALUE
-+
-+Name: dhcpReservedForClient Description: This is the distinguished name
-+of the "dhcpHost" that an address is reserved for.  This may not be the
-+same as the "dhcpAssignedToClient" attribute if the address is being
-+reassigned but the current lease has not yet expired.  Syntax: DN Flags:
-+SINGLE-VALUE
-+
-+Name: dhcpAssignedToClient Description: This is the distinguished name
-+of a "dhcpHost" that an address is currently assigned to.  This
-+attribute is only present in the class when the address is leased.
-+Syntax: DN Flags: SINGLE-VALUE
-+
-+Name: dhcpRelayAgentInfo Description: If the client request was received
-+via a relay agent, this contains information about the relay agent that
-+was available from the DHCP request.  This is a hex-encoded option
-+value.  Syntax: OctetString Flags: SINGLE-VALUE
-+
-+Name: dhcpErrorLog Description: Generic error log attribute that allows
-+logging error conditions within a dhcpService or a dhcpSubnet, like no IP 
-+addresses available for lease. Syntax: IA5String 
-+
-+M. Meredith et al.        Expires December 2001                 [Page 8]
-+
-+
-+
-+
-+
-+INTERNET-DRAFT            LDAP Schema for DHCP              16 June 2001
-+
-+
-+6.2.  dhcpLeases Object Class
-+
-+This class represents an IP address.  It may or may not be leaseable,
-+and the object may exist even though a lease is not currently active for
-+the associated IP address.
-+
-+It is recommended that all Lease objects for a single DHCP Service be
-+centrally located within a single container. This ensures that the lease
-+objects and the corresponding logs do not have to be relocated, when
-+address ranges allocated to individual DHCP subnets and/or pools change.
-+
-+The schema definitions below are for readability the LDIF layout for
-+this schema will follow in section 8.
-+
-+Name: dhcpLeases Description: This is the object that holds state
-+information about an IP address. The cn (which is the IP address), and
-+the current address-state are mandatory attributes. If the address is
-+assigned then, some of the optional attributes will have valid data.
-+Must: cn, dhcpAddressState May: dhcpExpirationTime,
-+dhcpStartTimeOfState, dhcpLastTransactionTime, dhcpBootpFlag,
-+dhcpDomainName, dhcpDnsStatus, dhcpRequestedHostName,
-+dhcpAssignedHostName, dhcpReservedForClient, dhcpAssignedToClient,
-+dhcpRelayAgentInfo, dhcpHWAddress
-+
-+6.3 Audit Log Information
-+
-+A dhcpLog object is created whenever a lease is assigned or released.
-+This object is intended to be created under the corresponding dhcpLeases
-+container, or dhcpPool, dhcpSubnet, dhcpSharedNetwork or dhcpService
-+containers.
-+
-+The log information under the dhcpLeases container would be for
-+addresses matching that lease information. The log information in the
-+other containers could be used for errors, i.e. when a pool or subnet is
-+out our addresses or if a server is not able to assign any more
-+addresses for a particular dhcpService.
-+
-+Name: dhcpLog Description: This is the object that holds past
-+information about an IP address. The cn is the time/date stamp when the
-+address was assigned or released, the address state at the time, if the
-+address was assigned or released.  Must: cn May: dhcpAddressState,
-+dhcpExpirationTime, dhcpStartTimeOfState, dhcpLastTransactionTime,
-+dhcpBootpFlag, dhcpDomainName, dhcpDnsStatus, dhcpRequestedHostName,
-+dhcpAssignedHostName, dhcpReservedForClient, dhcpAssignedToClient,
-+dhcpRelayAgentInfo, dhcpHWAddress, dhcpErrorLog
-+
-+
-+
-+
-+
-+
-+M. Meredith et al.        Expires December 2001                 [Page 9]
-+
-+
-+
-+
-+
-+INTERNET-DRAFT            LDAP Schema for DHCP              16 June 2001
-+
-+
-+7. Determining settings
-+
-+The dhcpStatements attribute is the key to DHC enhancements that may
-+come along, and the different key words that a particular server
-+implementation may use. This attribute can be used to hold conditional
-+DHCP Statements and DHCP server parameters. Having a generic settings
-+attribute that is just a string, allows this schema to be extensible and
-+easy to configure.
-+
-+All of the attributes that end with DN are references to the class that
-+precedes the DN e.g. the dhcpPrimaryDN and dhcpSecondaryDN attributes
-+hold the Distinguished Names of the dhcpServer objects that are
-+associated with the dhcpService object.
-+
-+8. LDIF format for attributes and classes.
-+
-+# Attributes
-+
-+( 2.16.840.1.113719.1.203.4.1 NAME 'dhcpPrimaryDN' DESC
-+'The DN of the dhcpServer which is the primary server for the
-+configuration.' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE )
-+
-+( 2.16.840.1.113719.1.203.4.2 NAME 'dhcpSecondaryDN' DESC 'The DN of
-+dhcpServer(s) which provide backup service for the configuration.'
-+SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 )
-+
-+( 2.16.840.1.113719.1.203.4.3 NAME 'dhcpStatements' DESC 'Flexible
-+storage for specific data depending on what object this exists in. Like
-+conditional statements, server parameters, etc. This allows the standard
-+to evolve without needing to adjust the schema.' SYNTAX
-+1.3.6.1.4.1.1466.115.121.1.26 )
-+
-+( 2.16.840.1.113719.1.203.4.4 NAME 'dhcpRange' DESC 'The starting &
-+ending IP Addresses in the range (inclusive), separated by a hyphen; if
-+the range only contains one address, then just the address can be
-+specified with no hyphen.  Each range is defined as a separate value.'
-+SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 )
-+
-+( 2.16.840.1.113719.1.203.4.5 NAME 'dhcpPermitList' DESC 'This attribute
-+contains the permit lists associated with a pool. Each permit list is
-+defined as a separate value.' SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 )
-+
-+( 2.16.840.1.113719.1.203.4.6 NAME 'dhcpNetMask' DESC 'The subnet mask
-+length for the subnet.  The mask can be easily computed from this
-+length.' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )
-+
-+( 2.16.840.1.113719.1.203.4.7 NAME 'dhcpOption' DESC 'Encoded option
-+values to be sent to clients.  Each value represents a single option and
-+contains (OptionTag, Length, OptionValue) encoded in the format used by
-+DHCP.' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40 )
-+
-+M. Meredith et al.        Expires December 2001                [Page 10]
-+
-+
-+
-+
-+
-+INTERNET-DRAFT            LDAP Schema for DHCP              16 June 2001
-+
-+
-+( 2.16.840.1.113719.1.203.4.8 NAME 'dhcpClassData' DESC 'Encoded text
-+string or list of bytes expressed in hexadecimal, separated by colons.
-+Clients match subclasses based on matching the class data with the
-+results of match or spawn with statements in the class name
-+declarations.' SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE )
-+
-+( 2.16.840.1.113719.1.203.4.9 NAME 'dhcpOptionsDN' DESC 'The
-+distinguished name(s) of the dhcpOption objects containing the
-+configuration options provided by the server.' SYNTAX
-+1.3.6.1.4.1.1466.115.121.1.12 )
-+
-+( 2.16.840.1.113719.1.203.4.10 NAME 'dhcpHostDN' DESC 'the distinguished
-+name(s) of the dhcpHost objects.' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 )
-+
-+( 2.16.840.1.113719.1.203.4.11 NAME 'dhcpPoolDN' DESC 'The distinguished
-+name(s) of pools.' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 )
-+
-+( 2.16.840.1.113719.1.203.4.12 NAME 'dhcpGroupDN' DESC 'The
-+distinguished name(s)   of the groups.' SYNTAX
-+1.3.6.1.4.1.1466.115.121.1.12 )
-+
-+( 2.16.840.1.113719.1.203.4.13 NAME 'dhcpSubnetDN' DESC 'The
-+distinguished name(s) of the subnets.' SYNTAX
-+1.3.6.1.4.1.1466.115.121.1.12 )
-+
-+( 2.16.840.1.113719.1.203.4.14 NAME 'dhcpLeaseDN' DESC 'The
-+distinguished name of a client address.' SYNTAX
-+1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE)
-+
-+( 2.16.840.1.113719.1.203.4.15 NAME 'dhcpLeasesDN' DESC 'The
-+distinguished name(s) client addresses.' SYNTAX
-+1.3.6.1.4.1.1466.115.121.1.12 )
-+
-+( 2.16.840.1.113719.1.203.4.16 NAME 'dhcpClassesDN' DESC 'The
-+distinguished name(s) of a class(es) in a subclass.' SYNTAX
-+1.3.6.1.4.1.1466.115.121.1.12 )
-+
-+( 2.16.840.1.113719.1.203.4.17 NAME 'dhcpSubclassesDN' DESC 'The
-+distinguished name(s) of subclass(es).' SYNTAX
-+1.3.6.1.4.1.1466.115.121.1.12 )
-+
-+( 2.16.840.1.113719.1.203.4.18 NAME 'dhcpSharedNetworkDN' DESC 'The
-+distinguished name(s) of sharedNetworks.' SYNTAX
-+1.3.6.1.4.1.1466.115.121.1.12 )
-+
-+( 2.16.840.1.113719.1.203.4.19 NAME 'dhcpServiceDN' DESC 'The DN of
-+dhcpService object(s)which contain the configuration information. Each
-+dhcpServer object has this attribute identifying the DHCP
-+
-+
-+
-+M. Meredith et al.        Expires December 2001                [Page 11]
-+
-+
-+
-+
-+
-+INTERNET-DRAFT            LDAP Schema for DHCP              16 June 2001
-+
-+
-+configuration(s) that the server is associated with.' SYNTAX
-+1.3.6.1.4.1.1466.115.121.1.12 )
-+
-+( 2.16.840.1.113719.1.203.4.20 NAME 'dhcpVersion' DESC 'The version
-+attribute of this object.' SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-
-+VALUE )
-+
-+( 2.16.840.1.113719.1.203.4.21 NAME 'dhcpImplementation' DESC
-+'Description of the DHCP Server implementation e.g. DHCP Server's
-+vendor.' SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE )
-+
-+( 2.16.840.1.113719.1.203.4.22 NAME 'dhcpAddressState' DESC 'This stores
-+information about the current binding-status of an address.  For dynamic
-+addresses managed by DHCP, the values should be restricted to the
-+following: "FREE", "ACTIVE", "EXPIRED", "RELEASED", "RESET",
-+"ABANDONED", "BACKUP".  For other addresses, it SHOULD be one of the
-+following: "UNKNOWN", "RESERVED" (an address that is managed by DHCP
-+that is reserved for a specific client), "RESERVED-ACTIVE" (same as
-+reserved, but address is currently in use), "ASSIGNED" (assigned
-+manually or by some other mechanism), "UNASSIGNED", "NOTASSIGNABLE".'
-+SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE )
-+
-+( 2.16.840.1.113719.1.203.4.23 NAME 'dhcpExpirationTime' DESC 'This is
-+the time the current lease for an address expires.' SYNTAX
-+1.3.6.1.4.1.1466.115.121.1.24 SINGLE-VALUE )
-+
-+( 2.16.840.1.113719.1.203.4.24 NAME 'dhcpStartTimeOfState' DESC 'This is
-+the time of the last state change for a leased address.' SYNTAX
-+1.3.6.1.4.1.1466.115.121.1.24 SINGLE-VALUE )
-+
-+( 2.16.840.1.113719.1.203.4.25 NAME 'dhcpLastTransactionTime' DESC 'This
-+is the last time a valid DHCP packet was received from the client.'
-+SYNTAX 1.3.6.1.4.1.1466.115.121.1.24 SINGLE-VALUE )
-+
-+( 2.16.840.1.113719.1.203.4.26 NAME 'dhcpBootpFlag' DESC 'This indicates
-+whether the address was assigned via BOOTP.' SYNTAX
-+1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE )
-+
-+( 2.16.840.1.113719.1.203.4.27 NAME 'dhcpDomainName' DESC 'This is the
-+name of the domain sent to the client by the server.  It is essentially
-+the same as the value for DHCP option 15 sent to the client, and
-+represents only the domain - not the full FQDN.  To obtain the full FQDN
-+assigned to the client you must prepend the "dhcpAssignedHostName" to
-+this value with a ".".' SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-
-+VALUE )
-+
-+( 2.16.840.1.113719.1.203.4.28 NAME 'dhcpDnsStatus' DESC 'This indicates
-+the status of updating DNS resource records on behalf of the client by
-+
-+
-+
-+M. Meredith et al.        Expires December 2001                [Page 12]
-+
-+
-+
-+
-+
-+INTERNET-DRAFT            LDAP Schema for DHCP              16 June 2001
-+
-+
-+the DHCP server for this address.  The value is a 16-bit bitmask.'
-+SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )
-+
-+( 2.16.840.1.113719.1.203.4.29 NAME 'dhcpRequestedHostName' DESC 'This
-+is the hostname that was requested by the client.' SYNTAX
-+1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE )
-+
-+( 2.16.840.1.113719.1.203.4.30 NAME 'dhcpAssignedHostName' DESC 'This is
-+the actual hostname that was assigned to a client. It may not be the
-+name that was requested by the client.  The fully qualified domain name
-+can be determined by appending the value of "dhcpDomainName" (with a dot
-+separator) to this name.' SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-
-+VALUE )
-+
-+( 2.16.840.1.113719.1.203.4.31 NAME 'dhcpReservedForClient' DESC 'The
-+distinguished name of a "dhcpClient" that an address is reserved for.
-+This may not be the same as the "dhcpAssignedToClient" attribute if the
-+address is being reassigned but the current lease has not yet expired.'
-+SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE )
-+
-+( 2.16.840.1.113719.1.203.4.32 NAME 'dhcpAssignedToClient' DESC 'This is
-+the distinguished name of a "dhcpClient" that an address is currently
-+assigned to.  This attribute is only present in the class when the
-+address is leased.' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE )
-+
-+( 2.16.840.1.113719.1.203.4.33 NAME 'dhcpRelayAgentInfo' DESC 'If the
-+client request was received via a relay agent, this contains information
-+about the relay agent that was available from the DHCP request.  This is
-+a hex-encoded option value.' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40
-+SINGLE-VALUE )
-+
-+( 2.16.840.1.113719.1.203.4.34 NAME 'dhcpHWAddress' DESC 'The clients
-+hardware address that requested this IP address.' SYNTAX
-+1.3.6.1.4.1.1466.115.121.1.40 SINGLE-VALUE )
-+
-+( 2.16.840.1.113719.1.203.4.35 NAME 'dhcpHashBucketAssignment' DESC
-+'HashBucketAssignment bit map for the DHCP Server, as defined in DHC
-+Load Balancing Algorithm [RFC 3074].' SYNTAX
-+1.3.6.1.4.1.1466.115.121.1.40 SINGLE-VALUE )
-+
-+( 2.16.840.1.113719.1.203.4.36 NAME 'dhcpDelayedServiceParameter' DESC
-+'Delay in seconds corresponding to Delayed Service Parameter
-+configuration, as defined in  DHC Load Balancing Algorithm [RFC 3074]. '
-+SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )
-+
-+( 2.16.840.1.113719.1.203.4.37 NAME 'dhcpMaxClientLeadTime' DESC
-+'Maximum Client Lead Time configuration in seconds, as defined in DHCP
-+Failover Protocol [FAILOVR]' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27
-+
-+
-+
-+M. Meredith et al.        Expires December 2001                [Page 13]
-+
-+
-+
-+
-+
-+INTERNET-DRAFT            LDAP Schema for DHCP              16 June 2001
-+
-+
-+SINGLE-VALUE )
-+
-+( 2.16.840.1.113719.1.203.4.38 NAME 'dhcpFailOverEndpointState' DESC
-+'Server (Failover Endpoint) state, as defined in DHCP Failover Protocol
-+[FAILOVR]' SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE )
-+
-+( 2.16.840.1.113719.1.203.4.39 NAME 'dhcpErrorLog' DESC
-+Generic error log attribute that allows logging error conditions within a 
-+dhcpService or a dhcpSubnet, like no IP addresses available for lease. 
-+SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE )
-+
-+#Classes
-+
-+( 2.16.840.1.113719.1.203.6.1 NAME 'dhcpService' DESC ' Service object
-+that represents the actual DHCP Service configuration. This is a
-+container object.' SUP top MUST (cn $ dhcpPrimaryDN) MAY
-+(dhcpSecondaryDN $ dhcpSharedNetworkDN $ dhcpSubnetDN $ dhcpGroupDN $
-+dhcpHostDN $  dhcpClassesDN $ dhcpOptionsDN $ dhcpStatements ) )
-+
-+( 2.16.840.1.113719.1.203.6.2 NAME 'dhcpSharedNetwork' DESC 'This stores
-+configuration information for a shared network.' SUP top MUST  cn MAY
-+(dhcpSubnetDN $ dhcpPoolDN $ dhcpOptionsDN $ dhcpStatements) X-
-+NDS_CONTAINMENT ('dhcpService' ) )
-+
-+( 2.16.840.1.113719.1.203.6.3 NAME 'dhcpSubnet' DESC 'This class defines
-+a subnet. This is a container object.' SUP top MUST ( cn $ dhcpNetMask )
-+MAY (dhcpRange $ dhcpPoolDN $ dhcpGroupDN $ dhcpHostDN $ dhcpClassesDN $
-+dhcpLeasesDN $ dhcpOptionsDN $ dhcpStatements) X-NDS_CONTAINMENT
-+('dhcpService' 'dhcpSharedNetwork') )
-+
-+( 2.16.840.1.113719.1.203.6.4 NAME 'dhcpPool' DESC 'This stores
-+configuration information about a pool.' SUP top MUST ( cn $ dhcpRange )
-+MAY (dhcpClassesDN $ dhcpPermitList $ dhcpLeasesDN $ dhcpOptionsDN $
-+dhcpStatements) X-NDS_CONTAINMENT ('dhcpSubnet' 'dhcpSharedNetwork') )
-+
-+( 2.16.840.1.113719.1.203.6.5 NAME 'dhcpGroup' DESC 'Group object that
-+lists host DNs and parameters. This is a container object.' SUP top MUST
-+cn MAY ( dhcpHostDN $ dhcpOptionsDN $ dhcpStatements ) X-NDS_CONTAINMENT
-+('dhcpSubnet' 'dhcpService' ) )
-+
-+( 2.16.840.1.113719.1.203.6.6 NAME 'dhcpHost' DESC 'This represents
-+information about a particular client' SUP top MUST cn MAY  (dhcpLeaseDN
-+$ dhcpHWAddress $ dhcpOptionsDN $ dhcpStatements) X-NDS_CONTAINMENT
-+('dhcpService' 'dhcpSubnet' 'dhcpGroup') )
-+
-+( 2.16.840.1.113719.1.203.6.7 NAME 'dhcpClass' DESC 'Represents
-+information about a collection of related clients.' SUP top MUST cn MAY
-+(dhcpSubClassesDN $ dhcpOptionsDN $ dhcpStatements) X-NDS_CONTAINMENT
-+('dhcpService' 'dhcpSubnet' ) )
-+
-+( 2.16.840.1.113719.1.203.6.8 NAME 'dhcpSubClass' DESC 'Represents
-+information about a collection of related classes.' SUP top MUST cn MAY
-+(dhcpClassData $ dhcpOptionsDN $ dhcpStatements) X-NDS_CONTAINMENT
-+
-+
-+
-+M. Meredith et al.        Expires December 2001                [Page 14]
-+
-+
-+
-+
-+
-+INTERNET-DRAFT            LDAP Schema for DHCP              16 June 2001
-+
-+
-+'dhcpClass' )
-+
-+( 2.16.840.1.113719.1.203.6.9 NAME 'dhcpOptions' DESC 'Represents
-+information about a collection of options defined.' SUP top MUST cn MAY
-+( dhcpOption ) X-NDS_CONTAINMENT  ('dhcpService' 'dhcpSharedNetwork'
-+'dhcpSubnet' 'dhcpPool' 'dhcpGroup' 'dhcpHost' 'dhcpClass' )
-+
-+( 2.16.840.1.113719.1.203.6.10 NAME 'dhcpLeases' DESC 'This class
-+represents an IP Address, which may or may not have been leased.' SUP
-+top MUST ( cn $ dhcpAddressState ) MAY ( dhcpExpirationTime $
-+dhcpStartTimeOfState $ dhcpLastTransactionTime $ dhcpBootpFlag $
-+dhcpDomainName $ dhcpDnsStatus $ dhcpRequestedHostName $
-+dhcpAssignedHostName $ dhcpReservedForClient $ dhcpAssignedToClient $
-+dhcpRelayAgentInfo $ dhcpHWAddress ) X-NDS_CONTAINMENT ( 'dhcpService'
-+'dhcpSubnet' 'dhcpPool') )
-+
-+( 2.16.840.1.113719.1.203.6.11 NAME 'dhcpLog' DESC 'This is the object
-+that holds past information about the IP address. The cn is the
-+time/date stamp when the address was assigned or released, the address
-+state at the time, if the address was assigned or released.' SUP top
-+MUST ( cn ) MAY ( dhcpAddressState $ dhcpExpirationTime $
-+dhcpStartTimeOfState $ dhcpLastTransactionTime $ dhcpBootpFlag $
-+dhcpDomainName $ dhcpDnsStatus $ dhcpRequestedHostName $
-+dhcpAssignedHostName $ dhcpReservedForClient $ dhcpAssignedToClient $
-+dhcpRelayAgentInfo $ dhcpHWAddress $ dhcpErrorLog) X-NDS_CONTAINMENT 
-+('dhcpLeases' 'dhcpPool' 'dhcpSubnet' 'dhcpSharedNetwork' 'dhcpService' ) )
-+
-+( 2.16.840.1.113719.1.203.6.12 NAME 'dhcpServer' DESC 'DHCP Server
-+Object' SUP top MUST (cn, dhcpServiceDN) MAY (dhcpVersion $
-+dhcpImplementation $ dhcpHashBucketAssignment $
-+dhcpDelayedServiceParameter $ dhcpMaxClientLeadTime $
-+dhcpFailOverEndpointState $ dhcpStatements) X-NDS_CONTAINMENT ('O' 'OU' 
-+'dc') )
-+
-+9. Security Considerations
-+
-+Since the DHCP Configuration information is stored in a directory, the
-+security of the information is limited to the security offered by the
-+directory including the security of the objects within that directory.
-+
-+10.  Intellectual Property Rights Notices
-+
-+The IETF takes no position regarding the validity or scope of any
-+intellectual property or other rights that might be claimed to pertain
-+to the implementation or use of the technology described in this
-+document or the extent to which any license under such rights might or
-+might not be available; neither does it represent that it has made any
-+effort to identify any such rights.  Information on the IETF's
-+procedures with respect to rights in standards-track and standards-
-+
-+
-+
-+M. Meredith et al.        Expires December 2001                [Page 15]
-+
-+
-+
-+
-+
-+INTERNET-DRAFT            LDAP Schema for DHCP              16 June 2001
-+
-+
-+related documentation can be found in BCP-11.  Copies of claims of
-+rights made available for publication and any assurances of licenses to
-+be made available, or the result of an attempt made to obtain a general
-+license or permission for the use of such proprietary rights by
-+implementors or users of this specification can be obtained from the
-+IETF Secretariat.
-+
-+The IETF invites any interested party to bring to its attention any
-+copyrights, patents or patent applications, or other proprietary rights
-+which may cover technology that may be required to practice this
-+standard.  Please address the information to the IETF Executive
-+Director.
-+
-+11.  Full Copyright Statement
-+
-+Copyright (C) The Internet Society (2001).  All Rights Reserved.
-+
-+This document and translations of it may be copied and furnished to
-+others, and derivative works that comment on or otherwise explain it or
-+assist in its implementation may be prepared, copied, published and
-+distributed, in whole or in part, without restriction of any kind,
-+provided that the above copyright notice and this paragraph are included
-+on all such copies and derivative works.  However, this document itself
-+may not be modified in any way, such as by removing the copyright notice
-+or references to the Internet Society or other Internet organizations,
-+except as needed for the purpose of developing Internet standards in
-+which case the procedures for copyrights defined in the Internet
-+Standards process must be followed, or as required to translate it into
-+languages other than English.
-+
-+The limited permissions granted above are perpetual and will not be
-+revoked by the Internet Society or its successors or assigns.
-+
-+This document and the information contained herein is provided on an "AS
-+IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING TASK
-+FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT
-+LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT
-+INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR
-+FITNESS FOR A PARTICULAR PURPOSE.
-+
-+12. References
-+
-+[RFC2131] Droms, R., "Dynamic Host Configuration Protocol", RFC 2131,
-+March 1997.
-+
-+[RFC2132] Alexander, S., Droms, R., "DHCP Options and BOOTP Vendor
-+Extensions", RFC 2132, March 1997.
-+
-+
-+
-+
-+M. Meredith et al.        Expires December 2001                [Page 16]
-+
-+
-+
-+
-+
-+INTERNET-DRAFT            LDAP Schema for DHCP              16 June 2001
-+
-+
-+[MSDHCP]  Gu, Y., Vyaghrapuri, R., "An LDAP Schema for Dynamic Host
-+Configuration Protocol Service", Internet Draft <draft-gu-dhcp-ldap-
-+schema-00.txt>, August 1998.
-+
-+[NOVDHCP] Miller, T., Patel, A., Rao, P., "Lightweight Directory Access
-+Protocol (v3): Schema for Dynamic Host Configuration Protocol (DHCP)",
-+Internet Draft <draft-miller-dhcp-ldap-schema-00.txt>, June 1998.
-+
-+[FAILOVR] Droms, R., Rabil, G., Dooley, M., Kapur, A., Gonczi, S., Volz,
-+B., "DHCP Failover Protocol", Internet Draft <draft-ietf-dhc-
-+failover-08.txt>, July 2000.
-+
-+[RFC 3074] Volz B., Gonczi S., Lemon T., Stevens R., "DHC Load Balancing
-+Algorithm", February 2001
-+
-+[AGENT]   Patrick, M., "DHCP Relay Agent Information Option", Internet
-+Draft <draft-ietf-dhc-agent-options-09.txt>, March 2000.
-+
-+[DHCPOPT] Carney, M., "New Option Review Guidelines and Additional
-+Option Namespace", Internet Draft <draft-ietf-dhc-
-+option_review_and_namespace-01.txt>, October 1999.
-+
-+[POLICY]  Strassner, J., Elleson, E., Moore, B., "Policy Framework LDAP
-+Core Schema", Internet Draft <draft-ietf-policy-core-schema-06.txt>,
-+November 1999.
-+
-+[RFC2251] Wahl, M., Howes, T., Kille, S., "Lightweight Directory Access
-+Protocol (v3)", RFC 2251, December 1997.
-+
-+[RFC2252] Wahl, M., Coulbeck, A., Howes, T., Kille, S., "Lightweight
-+Directory Access Protocol (v3) Attribute Syntax Definitions", RFC 2252,
-+December 1997.
-+
-+[RFC2255] Howes, T., Smith, M., "The LDAP URL Format", RFC 2255,
-+December 1997.
-+
-+[RFC951]  Croft, B., Gilmore, J., "Bootstrap Protocol (BOOTP)", RFC 951,
-+September 1985.
-+
-+[RFC2119] Bradner, S. "Key words for use in RFCs to Indicate Requirement
-+Levels", RFC 2119, March 1997.
-+
-+13. Acknowledgments
-+
-+This work is partially based on a previous draft draft-ietf-dhc-
-+schema-02.doc.
-+
-+
-+
-+
-+
-+M. Meredith et al.        Expires December 2001                [Page 17]
-+
-+
-+
-+
-+
-+INTERNET-DRAFT            LDAP Schema for DHCP              16 June 2001
-+
-+
-+14. Author's Addresses
-+
-+Comments regarding this draft may be sent to the authors at the
-+following address:
-+
-+Mark Meredith
-+Mark Hinckley
-+Novell Inc.
-+1800 S. Novell Place
-+Provo, Utah 84606
-+
-+Vijay K. Nanjundaswamy
-+Novell Software Development (I) Ltd
-+49/1 & 49/3, Garvebhavi Palya,
-+7th Mile, Hosur Road
-+Bangalore 560068
-+
-+email: mark_meredith@novell.com
-+email: knvijay@novell.com
-+email: mhinckley@novell.com
-+
-+This Internet Draft expires December 16, 2001.
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+M. Meredith et al.        Expires December 2001                [Page 18]
-+
-+
-+
-+
-diff -Naur dhcp-3.0.5/dst/Makefile.dist dhcp-3.0.5-ldap/dst/Makefile.dist
---- dhcp-3.0.5/dst/Makefile.dist       2004-06-10 13:59:28.000000000 -0400
-+++ dhcp-3.0.5-ldap/dst/Makefile.dist  2007-02-23 13:41:54.000000000 -0500
-@@ -23,12 +23,13 @@
- SRC    = dst_support.c dst_api.c hmac_link.c md5_dgst.c base64.c prandom.c
- OBJ    = dst_support.o dst_api.o hmac_link.o md5_dgst.o base64.o prandom.o
-+OBJ_NM5= dst_support.o dst_api.o hmac_link.o base64.o prandom.o
- HDRS   = dst_internal.h md5.h md5_locl.h
- INCLUDES = $(BINDINC) -I$(TOP)/includes
- CFLAGS = $(DEBUG) $(PREDEFINES) $(INCLUDES) $(COPTS) -DHMAC_MD5 -DMINIRES_LIB
--all:  libdst.a
-+all:  libdst.a libdst-nomd5.a
- install:
-@@ -37,11 +38,16 @@
-       ar cruv libdst.a $(OBJ)
-       $(RANLIB) libdst.a
-+libdst-nomd5.a:       $(OBJ_NM5)
-+      rm -f libdst-nomd5.a
-+      ar cruv libdst-nomd5.a $(OBJ_NM5)
-+      $(RANLIB) libdst-nomd5.a
-+
- depend:
-       $(MKDEP) $(INCLUDES) $(PREDEFINES) $(SRC)
- clean:
--      -rm -f $(OBJ) libdst.a
-+      -rm -f $(OBJ) libdst.a libdst-nomd5.a
- realclean: clean
-       -rm -f *~ $(CATMANPAGES) $(SEDMANPAGES)
-diff -Naur dhcp-3.0.5/includes/dhcpd.h dhcp-3.0.5-ldap/includes/dhcpd.h
---- dhcp-3.0.5/includes/dhcpd.h        2006-05-17 16:16:59.000000000 -0400
-+++ dhcp-3.0.5-ldap/includes/dhcpd.h   2007-02-23 13:13:36.000000000 -0500
-@@ -79,6 +79,11 @@
- #include <isc-dhcp/result.h>
- #include <omapip/omapip_p.h>
-+#if defined(LDAP_CONFIGURATION)
-+# include <ldap.h>
-+# include <sys/utsname.h> /* for uname() */
-+#endif
-+
- #if !defined (BYTE_NAME_HASH_SIZE)
- # define BYTE_NAME_HASH_SIZE  401     /* Default would be rediculous. */
- #endif
-@@ -139,6 +144,8 @@
-       char *inbuf;
-       unsigned bufix, buflen;
-       unsigned bufsiz;
-+
-+      int (*read_function) (struct parse *);
- };
+diff -up dhcp-4.0.0/server/Makefile.am.ldap dhcp-4.0.0/server/Makefile.am
+--- dhcp-4.0.0/server/Makefile.am.ldap 2007-05-29 06:32:11.000000000 -1000
++++ dhcp-4.0.0/server/Makefile.am      2008-01-22 15:09:56.000000000 -1000
+@@ -4,12 +4,10 @@ dist_sysconf_DATA = dhcpd.conf
+ sbin_PROGRAMS = dhcpd
+ dhcpd_SOURCES = dhcpd.c dhcp.c bootp.c confpars.c db.c class.c failover.c \
+               omapi.c mdb.c stables.c salloc.c ddns.c dhcpleasequery.c \
+-              dhcpv6.c mdb6.c
++              dhcpv6.c mdb6.c ldap.c ldap_casa.c
  
- /* Variable-length array of data. */
-@@ -244,6 +251,32 @@
-       u_int8_t hbuf [17];
- };
+-# libomapi.a this is here twice to handle circular library dependencies :(
+-dhcpd_LDADD = ../common/libdhcp.a ../omapip/libomapi.a ../dst/libdst.a \
+-            ../dhcpctl/libdhcpctl.a ../minires/libres.a \
+-            ../omapip/libomapi.a
++dhcpd_LDADD = ../common/libdhcp.a ../omapip/libomapi.a ../minires/libres.a \
++            ../dhcpctl/libdhcpctl.a ../dst/libdstnomd5.a -lldap
  
-+#if defined(LDAP_CONFIGURATION)
-+# define LDAP_BUFFER_SIZE             8192
-+# define LDAP_METHOD_STATIC           0
-+# define LDAP_METHOD_DYNAMIC          1
-+#if defined (USE_SSL)
-+# define LDAP_SSL_OFF                 0
-+# define LDAP_SSL_ON                  1
-+# define LDAP_SSL_TLS                 2
-+# define LDAP_SSL_LDAPS                       3
-+#endif
-+
-+/* This is a tree of the current configuration we are building from LDAP */
-+
-+struct ldap_config_stack {
-+      LDAPMessage * res;      /* Pointer returned from ldap_search */
-+      LDAPMessage * ldent;    /* Current item in LDAP that we're processing 
-+                                 in res */
-+      int close_brace;        /* Put a closing } after we're through with
-+                                 this item */
-+      int processed;          /* We set this flag if this base item has been
-+                                 processed. After this base item is processed,
-+                                 we can start processing the children */
-+      struct ldap_config_stack *next;
-+};
-+#endif
+ man_MANS = dhcpd.8 dhcpd.conf.5 dhcpd.leases.5
+ EXTRA_DIST = $(man_MANS)
+diff -up dhcp-4.0.0/server/mdb.c.ldap dhcp-4.0.0/server/mdb.c
+--- dhcp-4.0.0/server/mdb.c.ldap       2007-11-30 11:51:43.000000000 -1000
++++ dhcp-4.0.0/server/mdb.c    2008-01-22 15:09:56.000000000 -1000
+@@ -600,6 +600,12 @@ int find_hosts_by_haddr (struct host_dec
+                        const char *file, int line)
+ {
+       struct hardware h;
++      int ret;
 +
- typedef enum {
-       server_startup = 0,
-       server_running = 1,
-@@ -426,6 +459,29 @@
- # define DEFAULT_PING_TIMEOUT 1
- #endif
 +#if defined(LDAP_CONFIGURATION)
-+# define SV_LDAP_SERVER               47
-+# define SV_LDAP_PORT                         48
-+# define SV_LDAP_USERNAME             49
-+# define SV_LDAP_PASSWORD             50
-+# define SV_LDAP_BASE_DN              51
-+# define SV_LDAP_METHOD                       52
-+# define SV_LDAP_DEBUG_FILE           53
-+# define SV_LDAP_DHCP_SERVER_CN               54
-+# define SV_LDAP_REFERRALS              55
-+#if defined (USE_SSL)
-+# define SV_LDAP_SSL                  56
-+# define SV_LDAP_TLS_REQCERT          57
-+# define SV_LDAP_TLS_CA_FILE          58
-+# define SV_LDAP_TLS_CA_DIR           59
-+# define SV_LDAP_TLS_CERT             60
-+# define SV_LDAP_TLS_KEY              61
-+# define SV_LDAP_TLS_CRLCHECK         62
-+# define SV_LDAP_TLS_CIPHERS          63
-+# define SV_LDAP_TLS_RANDFILE         64
-+#endif
++      if ((ret = find_haddr_in_ldap (hp, htype, hlen, haddr, file, line)))
++              return ret;
 +#endif
-+
- #if !defined (DEFAULT_DEFAULT_LEASE_TIME)
- # define DEFAULT_DEFAULT_LEASE_TIME 43200
- #endif
-@@ -1531,7 +1587,7 @@
- char *quotify_string (const char *, const char *, int);
- char *quotify_buf (const unsigned char *, unsigned, const char *, int);
- char *print_base64 (const unsigned char *, unsigned, const char *, int);
--char *print_hw_addr PROTO ((int, int, unsigned char *));
-+char *print_hw_addr PROTO ((const int, const int, const unsigned char *));
- void print_lease PROTO ((struct lease *));
- void dump_raw PROTO ((const unsigned char *, unsigned));
- void dump_packet_option (struct option_cache *, struct packet *,
-@@ -2632,3 +2688,19 @@
- #endif /* FAILOVER_PROTOCOL */
  
- const char *binding_state_print (enum failover_state);
-+
-+/* ldap.c */
-+#if defined(LDAP_CONFIGURATION)
-+extern struct enumeration ldap_methods;
-+#if defined (USE_SSL)
-+extern struct enumeration ldap_ssl_usage_enum;
-+extern struct enumeration ldap_tls_reqcert_enum;
-+extern struct enumeration ldap_tls_crlcheck_enum;
-+#endif
-+isc_result_t ldap_read_config (void);
-+int find_haddr_in_ldap (struct host_decl **, int, unsigned,
-+                        const unsigned char *, const char *, int);
-+int find_subclass_in_ldap (struct class *, struct class **, 
-+                         struct data_string *);
-+#endif
-+
-diff -Naur dhcp-3.0.5/includes/ldap_casa.h dhcp-3.0.5-ldap/includes/ldap_casa.h
---- dhcp-3.0.5/includes/ldap_casa.h    1969-12-31 19:00:00.000000000 -0500
-+++ dhcp-3.0.5-ldap/includes/ldap_casa.h       2006-12-14 10:03:41.000000000 -0500
-@@ -0,0 +1,83 @@
-+/* ldap_casa.h
+       h.hlen = hlen + 1;
+       h.hbuf [0] = htype;
+diff -up /dev/null dhcp-4.0.0/server/ldap_casa.c
+--- /dev/null  2008-01-19 23:52:35.158021373 -1000
++++ dhcp-4.0.0/server/ldap_casa.c      2008-01-22 15:09:56.000000000 -1000
+@@ -0,0 +1,138 @@
++/* ldap_casa.c
 +   
-+   Definition for CASA modules... */
++   CASA routines for DHCPD... */
 +
 +/* Copyright (c) 2004 Internet Systems Consorium, Inc. ("ISC")
 + * Copyright (c) 1995-2003 Internet Software Consortium.
@@ -3280,151 +73,112 @@ diff -Naur dhcp-3.0.5/includes/ldap_casa.h dhcp-3.0.5-ldap/includes/ldap_casa.h
 + */
 +
 +#if defined(LDAP_CASA_AUTH)
-+#ifndef __LDAP_CASA_H__
-+#define __LDAP_CASA_H__
++#include "ldap_casa.h"
++#include "dhcpd.h"
 +
-+#include <micasa_mgmd.h>
-+#include <dlfcn.h>
-+#include <string.h>
++int
++load_casa (void)
++{
++       if( !(casaIDK = dlopen(MICASA_LIB,RTLD_LAZY)))
++                return 0;
++       p_miCASAGetCredential = (CASA_GetCredential_T) dlsym(casaIDK, "miCASAGetCredential");
++       p_miCASASetCredential = (CASA_SetCredential_T) dlsym(casaIDK, "miCASASetCredential");
++       p_miCASARemoveCredential = (CASA_RemoveCredential_T) dlsym(casaIDK, "miCASARemoveCredential");
 +
-+#define MICASA_LIB     "libmicasa.so.1"
++       if((p_miCASAGetCredential == NULL) ||
++         (p_miCASASetCredential == NULL) ||
++         (p_miCASARemoveCredential == NULL))
++       {
++          if(casaIDK)
++            dlclose(casaIDK);
++          casaIDK = NULL;
++          p_miCASAGetCredential = NULL;
++          p_miCASASetCredential = NULL;
++          p_miCASARemoveCredential = NULL;
++          return 0;
++       }
++       else
++          return 1;
++}
 +
-+SSCS_TYPEDEF_LIBCALL(int, CASA_GetCredential_T)
-+(
-+       uint32_t            ssFlags,
-+       SSCS_SECRET_ID_T   *appSecretID,
-+       SSCS_SECRET_ID_T   *sharedSecretID,
-+       uint32_t           *credentialType,
-+       void               *credential,
-+       SSCS_EXT_T         *ext 
-+);
-+SSCS_TYPEDEF_LIBCALL(int, CASA_SetCredential_T)
-+(
-+       uint32_t            ssFlags,
-+       SSCS_SECRET_ID_T   *appSecretID,
-+       SSCS_SECRET_ID_T   *sharedSecretID,
-+       uint32_t            credentialType,
-+       void               *credential,
-+       SSCS_EXT_T         *ext
-+);
++static void
++release_casa(void)
++{
++   if(casaIDK)
++   {
++      dlclose(casaIDK);
++      casaIDK = NULL;
++   }
 +
-+SSCS_TYPEDEF_LIBCALL(int, CASA_RemoveCredential_T)
-+(
-+       uint32_t            ssFlags,
-+       SSCS_SECRET_ID_T   *appSecretID,
-+       SSCS_SECRET_ID_T   *sharedSecretID,
-+       SSCS_EXT_T         *ext
-+);
-+static CASA_GetCredential_T            p_miCASAGetCredential = NULL;
-+static CASA_SetCredential_T            p_miCASASetCredential = NULL;
-+static CASA_RemoveCredential_T         p_miCASARemoveCredential = NULL;
-+static void                            *casaIDK = NULL;
++   p_miCASAGetCredential = NULL;
++   p_miCASASetCredential = NULL;
++   p_miCASARemoveCredential = NULL;
 +
-+int load_casa(void);
-+static void release_casa(void);
-+int load_uname_pwd_from_miCASA(char **, char **);
++}
++
++int
++load_uname_pwd_from_miCASA (char **ldap_username, char **ldap_password)
++ {
++   int                     result = 0;
++   uint32_t                credentialtype = SSCS_CRED_TYPE_SERVER_F;
++   SSCS_BASIC_CREDENTIAL   credential;
++   SSCS_SECRET_ID_T        applicationSecretId;
++   char                    *tempVar = NULL;
++
++   const char applicationName[10] = "dhcp-ldap";
 +
-+#endif /* __LDAP_CASA_H__ */
-+#endif /* LDAP_CASA_AUTH */
++   if ( load_casa() )
++   {
++      memset(&credential, 0, sizeof(SSCS_BASIC_CREDENTIAL));
++      memset(&applicationSecretId, 0, sizeof(SSCS_SECRET_ID_T));
 +
-diff -Naur dhcp-3.0.5/includes/site.h dhcp-3.0.5-ldap/includes/site.h
---- dhcp-3.0.5/includes/site.h 2002-03-12 13:33:39.000000000 -0500
-+++ dhcp-3.0.5-ldap/includes/site.h    2006-12-14 10:03:41.000000000 -0500
-@@ -177,3 +177,13 @@
-    traces. */
- #define TRACING
++      applicationSecretId.len = strlen(applicationName) + 1;
++      memcpy (applicationSecretId.id, applicationName, applicationSecretId.len);
 +
-+/* Define this if you want to read your config from LDAP. Read README.ldap
-+   about how to set this up */
++      credential.unFlags = USERNAME_TYPE_CN_F;
 +
-+#define LDAP_CONFIGURATION
++      result = p_miCASAGetCredential (0,
++                 &applicationSecretId,NULL,&credentialtype,
++                 &credential,NULL);
 +
-+/* Define this if you want to enable LDAP over a SSL connection. You will need
-+   to add -lcrypto -lssl to the LIBS= line of server/Makefile */
++      if(credential.unLen)
++      {
++         tempVar = dmalloc (credential.unLen + 1, MDL);
++         if (!tempVar)
++             log_fatal ("no memory for ldap_username");
++         memcpy(tempVar , credential.username, credential.unLen);
++         *ldap_username = tempVar;
 +
-+#define USE_SSL
-diff -Naur dhcp-3.0.5/server/Makefile.dist dhcp-3.0.5-ldap/server/Makefile.dist
---- dhcp-3.0.5/server/Makefile.dist    2004-06-10 13:59:50.000000000 -0400
-+++ dhcp-3.0.5-ldap/server/Makefile.dist       2007-02-23 13:41:54.000000000 -0500
-@@ -25,14 +25,14 @@
- CATMANPAGES = dhcpd.cat8 dhcpd.conf.cat5 dhcpd.leases.cat5
- SEDMANPAGES = dhcpd.man8 dhcpd.conf.man5 dhcpd.leases.man5
- SRCS   = dhcpd.c dhcp.c bootp.c confpars.c db.c class.c failover.c \
--       omapi.c mdb.c stables.c salloc.c ddns.c dhcpleasequery.c
-+       ldap.c ldap_casa.c omapi.c mdb.c stables.c salloc.c ddns.c dhcpleasequery.c
- OBJS   = dhcpd.o dhcp.o bootp.o confpars.o db.o class.o failover.o \
--       omapi.o mdb.o stables.o salloc.o ddns.o dhcpleasequery.o
-+       ldap.o ldap_casa.o omapi.o mdb.o stables.o salloc.o ddns.o dhcpleasequery.o
- PROG   = dhcpd
- MAN    = dhcpd.8 dhcpd.conf.5 dhcpd.leases.5
- INCLUDES = -I$(TOP) $(BINDINC) -I$(TOP)/includes
--DHCPLIB = ../common/libdhcp.a $(BINDLIB) ../omapip/libomapi.a ../dst/libdst.a
-+DHCPLIB = ../common/libdhcp.a $(BINDLIB) ../omapip/libomapi.a ../dst/libdst-nomd5.a -lssl -lcrypto -lldap -llber
- CFLAGS = $(DEBUG) $(PREDEFINES) $(INCLUDES) $(COPTS)
- all:  $(PROG) $(CATMANPAGES)
-diff -Naur dhcp-3.0.5/server/class.c dhcp-3.0.5-ldap/server/class.c
---- dhcp-3.0.5/server/class.c  2004-06-10 13:59:51.000000000 -0400
-+++ dhcp-3.0.5-ldap/server/class.c     2006-12-14 10:03:41.000000000 -0500
-@@ -90,6 +90,7 @@
-       int matched = 0;
-       int status;
-       int ignorep;
-+      int classfound;
-       for (class = collection -> classes; class; class = class -> nic) {
- #if defined (DEBUG_CLASS_MATCHING)
-@@ -135,9 +136,19 @@
-                                  class -> submatch, MDL));
-                       if (status && data.len) {
-                               nc = (struct class *)0;
--                              if (class_hash_lookup (&nc, class -> hash,
--                                                     (const char *)data.data,
--                                                     data.len, MDL)) {
-+                                classfound = class_hash_lookup (&nc, 
-+                                              class -> hash, 
-+                                              (const char *)data.data,
-+                                              data.len, MDL);
++         tempVar = dmalloc (credential.pwordLen + 1, MDL);
++         if (!tempVar)
++             log_fatal ("no memory for ldap_password");
++         memcpy(tempVar, credential.password, credential.pwordLen);
++         *ldap_password = tempVar;
 +
-+#ifdef LDAP_CONFIGURATION
-+                                if (!classfound && 
-+                                              find_subclass_in_ldap (class, 
-+                                                              &nc, &data)) 
-+                                      classfound = 1;
++#if defined (DEBUG_LDAP)
++         log_info ("Authentication credential taken from CASA");
 +#endif
 +
-+                              if (classfound) {
- #if defined (DEBUG_CLASS_MATCHING)
-                                       log_info ("matches subclass %s.",
-                                             print_hex_1 (data.len,
-diff -Naur dhcp-3.0.5/server/confpars.c dhcp-3.0.5-ldap/server/confpars.c
---- dhcp-3.0.5/server/confpars.c       2006-07-20 12:02:52.000000000 -0400
-+++ dhcp-3.0.5-ldap/server/confpars.c  2006-12-14 10:03:41.000000000 -0500
-@@ -63,7 +63,17 @@
- isc_result_t readconf ()
- {
--      return read_conf_file (path_dhcpd_conf, root_group, ROOT_GROUP, 0);
-+      isc_result_t res;
++         release_casa();
++         return 1;
 +
-+      res = read_conf_file (path_dhcpd_conf, root_group, ROOT_GROUP, 0);
-+#if defined(LDAP_CONFIGURATION)
-+      if (res != ISC_R_SUCCESS)
-+              return (res);
++        }
++        else
++        {
++            release_casa();
++            return 0;
++        }
++      }
++      else
++          return 0; //casa libraries not loaded
++ }
 +
-+      return ldap_read_config ();
-+#else
-+      return (res);
-+#endif
- }
- isc_result_t read_conf_file (const char *filename, struct group *group,
-diff -Naur dhcp-3.0.5/server/dhcpd.c dhcp-3.0.5-ldap/server/dhcpd.c
---- dhcp-3.0.5/server/dhcpd.c  2006-07-17 11:23:44.000000000 -0400
-+++ dhcp-3.0.5-ldap/server/dhcpd.c     2007-02-23 13:13:36.000000000 -0500
-@@ -436,6 +436,14 @@
++#endif /* LDAP_CASA_AUTH */
++
+diff -up dhcp-4.0.0/server/dhcpd.c.ldap dhcp-4.0.0/server/dhcpd.c
+--- dhcp-4.0.0/server/dhcpd.c.ldap     2007-11-30 11:51:43.000000000 -1000
++++ dhcp-4.0.0/server/dhcpd.c  2008-01-22 15:09:56.000000000 -1000
+@@ -505,6 +505,14 @@ main(int argc, char **argv) {
        /* Add the ddns update style enumeration prior to parsing. */
        add_enumeration (&ddns_styles);
        add_enumeration (&syslog_enum);
@@ -3439,10 +193,10 @@ diff -Naur dhcp-3.0.5/server/dhcpd.c dhcp-3.0.5-ldap/server/dhcpd.c
  
        if (!group_allocate (&root_group, MDL))
                log_fatal ("Can't allocate root group!");
-diff -Naur dhcp-3.0.5/server/ldap.c dhcp-3.0.5-ldap/server/ldap.c
---- dhcp-3.0.5/server/ldap.c   1969-12-31 19:00:00.000000000 -0500
-+++ dhcp-3.0.5-ldap/server/ldap.c      2007-02-23 13:36:24.000000000 -0500
-@@ -0,0 +1,1977 @@
+diff -up /dev/null dhcp-4.0.0/server/ldap.c
+--- /dev/null  2008-01-19 23:52:35.158021373 -1000
++++ dhcp-4.0.0/server/ldap.c   2008-01-22 15:09:56.000000000 -1000
+@@ -0,0 +1,2004 @@
 +/* ldap.c
 +
 +   Routines for reading the configuration from LDAP */
@@ -3484,6 +238,7 @@ diff -Naur dhcp-3.0.5/server/ldap.c dhcp-3.0.5-ldap/server/ldap.c
 +
 +#include "dhcpd.h"
 +#include <signal.h>
++#include <errno.h>
 +
 +#if defined(LDAP_CONFIGURATION)
 +
@@ -3535,115 +290,115 @@ diff -Naur dhcp-3.0.5/server/ldap.c dhcp-3.0.5-ldap/server/ldap.c
 +static void
 +ldap_parse_class (struct ldap_config_stack *item, struct parse *cfile)
 +{
-+  char **tempstr;
++  struct berval **tempbv;
 +
-+  if ((tempstr = ldap_get_values (ld, item->ldent, "cn")) == NULL ||
-+      tempstr[0] == NULL)
++  if ((tempbv = ldap_get_values_len (ld, item->ldent, "cn")) == NULL ||
++      tempbv[0] == NULL)
 +    {
-+      if (tempstr != NULL)
-+        ldap_value_free (tempstr);
++      if (tempbv != NULL)
++        ldap_value_free_len (tempbv);
 +
 +      return;
 +    }
 +
 +  x_strncat (cfile->inbuf, "class \"", LDAP_BUFFER_SIZE);
-+  x_strncat (cfile->inbuf, tempstr[0], LDAP_BUFFER_SIZE);
++  x_strncat (cfile->inbuf, tempbv[0]->bv_val, LDAP_BUFFER_SIZE);
 +  x_strncat (cfile->inbuf, "\" {\n", LDAP_BUFFER_SIZE);
 +
 +  item->close_brace = 1;
-+  ldap_value_free (tempstr);
++  ldap_value_free_len (tempbv);
 +}
 +
 +
 +static void
 +ldap_parse_subclass (struct ldap_config_stack *item, struct parse *cfile)
 +{
-+  char **tempstr, **classdata;
++  struct berval **tempbv, **classdata;
 +
-+  if ((tempstr = ldap_get_values (ld, item->ldent, "cn")) == NULL ||
-+      tempstr[0] == NULL)
++  if ((tempbv = ldap_get_values_len (ld, item->ldent, "cn")) == NULL ||
++      tempbv[0] == NULL)
 +    {
-+      if (tempstr != NULL)
-+        ldap_value_free (tempstr);
++      if (tempbv != NULL)
++        ldap_value_free_len (tempbv);
 +
 +      return;
 +    }
 +
-+  if ((classdata = ldap_get_values (ld, item->ldent, 
++  if ((classdata = ldap_get_values_len (ld, item->ldent, 
 +                                  "dhcpClassData")) == NULL || 
 +      classdata[0] == NULL)
 +    {
 +      if (classdata != NULL)
-+        ldap_value_free (classdata);
-+      ldap_value_free (tempstr);
++        ldap_value_free_len (classdata);
++      ldap_value_free_len (tempbv);
 +
 +      return;
 +    }
 +
 +  x_strncat (cfile->inbuf, "subclass ", LDAP_BUFFER_SIZE);
-+  x_strncat (cfile->inbuf, classdata[0], LDAP_BUFFER_SIZE);
++  x_strncat (cfile->inbuf, classdata[0]->bv_val, LDAP_BUFFER_SIZE);
 +  x_strncat (cfile->inbuf, " ", LDAP_BUFFER_SIZE);
-+  x_strncat (cfile->inbuf, tempstr[0], LDAP_BUFFER_SIZE);
++  x_strncat (cfile->inbuf, tempbv[0]->bv_val, LDAP_BUFFER_SIZE);
 +  x_strncat (cfile->inbuf, " {\n", LDAP_BUFFER_SIZE);
 +
 +  item->close_brace = 1;
-+  ldap_value_free (tempstr);
-+  ldap_value_free (classdata);
++  ldap_value_free_len (tempbv);
++  ldap_value_free_len (classdata);
 +}
 +
 +
 +static void
 +ldap_parse_host (struct ldap_config_stack *item, struct parse *cfile)
 +{
-+  char **tempstr, **hwaddr;
++  struct berval **tempbv, **hwaddr;
 +
-+  if ((tempstr = ldap_get_values (ld, item->ldent, "cn")) == NULL ||
-+      tempstr[0] == NULL)
++  if ((tempbv = ldap_get_values_len (ld, item->ldent, "cn")) == NULL ||
++      tempbv[0] == NULL)
 +    {
-+      if (tempstr != NULL)
-+        ldap_value_free (tempstr);
++      if (tempbv != NULL)
++        ldap_value_free_len (tempbv);
 +
 +      return;
 +    }
 +
-+  hwaddr = ldap_get_values (ld, item->ldent, "dhcpHWAddress");
++  hwaddr = ldap_get_values_len (ld, item->ldent, "dhcpHWAddress");
 +
 +  x_strncat (cfile->inbuf, "host ", LDAP_BUFFER_SIZE);
-+  x_strncat (cfile->inbuf, tempstr[0], LDAP_BUFFER_SIZE);
++  x_strncat (cfile->inbuf, tempbv[0]->bv_val, LDAP_BUFFER_SIZE);
 +
 +  if (hwaddr != NULL && hwaddr[0] != NULL)
 +    {
 +      x_strncat (cfile->inbuf, " {\nhardware ", LDAP_BUFFER_SIZE);
-+      x_strncat (cfile->inbuf, hwaddr[0], LDAP_BUFFER_SIZE);
++      x_strncat (cfile->inbuf, hwaddr[0]->bv_val, LDAP_BUFFER_SIZE);
 +      x_strncat (cfile->inbuf, ";\n", LDAP_BUFFER_SIZE);
-+      ldap_value_free (hwaddr);
++      ldap_value_free_len (hwaddr);
 +    }
 +
 +  item->close_brace = 1;
-+  ldap_value_free (tempstr);
++  ldap_value_free_len (tempbv);
 +}
 +
 +
 +static void
 +ldap_parse_shared_network (struct ldap_config_stack *item, struct parse *cfile)
 +{
-+  char **tempstr;
++  struct berval **tempbv;
 +
-+  if ((tempstr = ldap_get_values (ld, item->ldent, "cn")) == NULL ||
-+      tempstr[0] == NULL)
++  if ((tempbv = ldap_get_values_len (ld, item->ldent, "cn")) == NULL ||
++      tempbv[0] == NULL)
 +    {
-+      if (tempstr != NULL)
-+        ldap_value_free (tempstr);
++      if (tempbv != NULL)
++        ldap_value_free_len (tempbv);
 +
 +      return;
 +    }
 +
 +  x_strncat (cfile->inbuf, "shared-network \"", LDAP_BUFFER_SIZE);
-+  x_strncat (cfile->inbuf, tempstr[0], LDAP_BUFFER_SIZE);
++  x_strncat (cfile->inbuf, tempbv[0]->bv_val, LDAP_BUFFER_SIZE);
 +  x_strncat (cfile->inbuf, "\" {\n", LDAP_BUFFER_SIZE);
 +
 +  item->close_brace = 1;
-+  ldap_value_free (tempstr);
++  ldap_value_free_len (tempbv);
 +}
 +
 +
@@ -3669,51 +424,51 @@ diff -Naur dhcp-3.0.5/server/ldap.c dhcp-3.0.5-ldap/server/ldap.c
 +static void
 +ldap_parse_subnet (struct ldap_config_stack *item, struct parse *cfile)
 +{
-+  char **tempstr, **netmaskstr, netmaskbuf[16];
++  struct berval **tempbv, **netmaskstr;
++  char netmaskbuf[16];
 +  int i;
 +
-+  if ((tempstr = ldap_get_values (ld, item->ldent, "cn")) == NULL ||
-+      tempstr[0] == NULL)
++  if ((tempbv = ldap_get_values_len (ld, item->ldent, "cn")) == NULL ||
++      tempbv[0] == NULL)
 +    {
-+      if (tempstr != NULL)
-+        ldap_value_free (tempstr);
++      if (tempbv != NULL)
++        ldap_value_free_len (tempbv);
 +
 +      return;
 +    }
 +
-+  if ((netmaskstr = ldap_get_values (ld, item->ldent, 
++  if ((netmaskstr = ldap_get_values_len (ld, item->ldent, 
 +                                     "dhcpNetmask")) == NULL || 
 +      netmaskstr[0] == NULL)
 +    {
 +      if (netmaskstr != NULL)
-+        ldap_value_free (netmaskstr);
-+      ldap_value_free (tempstr);
++        ldap_value_free_len (netmaskstr);
++      ldap_value_free_len (tempbv);
 +
 +      return;
 +    }
 +
 +  x_strncat (cfile->inbuf, "subnet ", LDAP_BUFFER_SIZE);
-+  x_strncat (cfile->inbuf, tempstr[0], LDAP_BUFFER_SIZE);
++  x_strncat (cfile->inbuf, tempbv[0]->bv_val, LDAP_BUFFER_SIZE);
 +
 +  x_strncat (cfile->inbuf, " netmask ", LDAP_BUFFER_SIZE);
-+  parse_netmask (strtol (netmaskstr[0], NULL, 10), netmaskbuf);
++  parse_netmask (strtol (netmaskstr[0]->bv_val, NULL, 10), netmaskbuf);
 +  x_strncat (cfile->inbuf, netmaskbuf, LDAP_BUFFER_SIZE);
 +
 +  x_strncat (cfile->inbuf, " {\n", LDAP_BUFFER_SIZE);
 +
-+  ldap_value_free (tempstr);
-+  ldap_value_free (netmaskstr);
++  ldap_value_free_len (tempbv);
++  ldap_value_free_len (netmaskstr);
 +
-+  if ((tempstr = ldap_get_values (ld, item->ldent, "dhcpRange")) != NULL)
++  if ((tempbv = ldap_get_values_len (ld, item->ldent, "dhcpRange")) != NULL)
 +    {
-+      for (i=0; tempstr[i] != NULL; i++)
++      for (i=0; tempbv[i] != NULL; i++)
 +        {
 +          x_strncat (cfile->inbuf, "range", LDAP_BUFFER_SIZE);
 +          x_strncat (cfile->inbuf, " ", LDAP_BUFFER_SIZE);
-+          x_strncat (cfile->inbuf, tempstr[i], LDAP_BUFFER_SIZE);
++          x_strncat (cfile->inbuf, tempbv[i]->bv_val, LDAP_BUFFER_SIZE);
 +          x_strncat (cfile->inbuf, ";\n", LDAP_BUFFER_SIZE);
 +        }
-+      ldap_value_free (tempstr);
 +    }
 +
 +  item->close_brace = 1;
@@ -3723,31 +478,31 @@ diff -Naur dhcp-3.0.5/server/ldap.c dhcp-3.0.5-ldap/server/ldap.c
 +static void
 +ldap_parse_pool (struct ldap_config_stack *item, struct parse *cfile)
 +{
-+  char **tempstr;
++  struct berval **tempbv;
 +  int i;
 +
 +  x_strncat (cfile->inbuf, "pool {\n", LDAP_BUFFER_SIZE);
 +
-+  if ((tempstr = ldap_get_values (ld, item->ldent, "dhcpRange")) != NULL)
++  if ((tempbv = ldap_get_values_len (ld, item->ldent, "dhcpRange")) != NULL)
 +    {
 +      x_strncat (cfile->inbuf, "range", LDAP_BUFFER_SIZE);
-+      for (i=0; tempstr[i] != NULL; i++)
++      for (i=0; tempbv[i] != NULL; i++)
 +        {
 +          x_strncat (cfile->inbuf, " ", LDAP_BUFFER_SIZE);
-+          x_strncat (cfile->inbuf, tempstr[i], LDAP_BUFFER_SIZE);
++          x_strncat (cfile->inbuf, tempbv[i]->bv_val, LDAP_BUFFER_SIZE);
 +        }
 +      x_strncat (cfile->inbuf, ";\n", LDAP_BUFFER_SIZE);
-+      ldap_value_free (tempstr);
++      ldap_value_free_len (tempbv);
 +    }
 +
-+  if ((tempstr = ldap_get_values (ld, item->ldent, "dhcpPermitList")) != NULL)
++  if ((tempbv = ldap_get_values_len (ld, item->ldent, "dhcpPermitList")) != NULL)
 +    {
-+      for (i=0; tempstr[i] != NULL; i++)
++      for (i=0; tempbv[i] != NULL; i++)
 +        {
-+          x_strncat (cfile->inbuf, tempstr[i], LDAP_BUFFER_SIZE);
++          x_strncat (cfile->inbuf, tempbv[i]->bv_val, LDAP_BUFFER_SIZE);
 +          x_strncat (cfile->inbuf, ";\n", LDAP_BUFFER_SIZE);
 +        }
-+      ldap_value_free (tempstr);
++      ldap_value_free_len (tempbv);
 +    }
 +
 +  item->close_brace = 1;
@@ -3765,30 +520,30 @@ diff -Naur dhcp-3.0.5/server/ldap.c dhcp-3.0.5-ldap/server/ldap.c
 +static void
 +ldap_parse_key (struct ldap_config_stack *item, struct parse *cfile)
 +{
-+  char **tempstr;
++  struct berval **tempbv;
 +
-+  if ((tempstr = ldap_get_values (ld, item->ldent, "cn")) != NULL)
++  if ((tempbv = ldap_get_values_len (ld, item->ldent, "cn")) != NULL)
 +    {
 +      x_strncat (cfile->inbuf, "key ", LDAP_BUFFER_SIZE);
-+      x_strncat (cfile->inbuf, tempstr[0], LDAP_BUFFER_SIZE);
++      x_strncat (cfile->inbuf, tempbv[0]->bv_val, LDAP_BUFFER_SIZE);
 +      x_strncat (cfile->inbuf, " {\n", LDAP_BUFFER_SIZE);
-+      ldap_value_free (tempstr);
++      ldap_value_free_len (tempbv);
 +    }
 +
-+  if ((tempstr = ldap_get_values (ld, item->ldent, "dhcpKeyAlgorithm")) != NULL)
++  if ((tempbv = ldap_get_values_len (ld, item->ldent, "dhcpKeyAlgorithm")) != NULL)
 +    {
 +      x_strncat (cfile->inbuf, "algorithm ", LDAP_BUFFER_SIZE);
-+      x_strncat (cfile->inbuf, tempstr[0], LDAP_BUFFER_SIZE);
++      x_strncat (cfile->inbuf, tempbv[0]->bv_val, LDAP_BUFFER_SIZE);
 +      x_strncat (cfile->inbuf, ";\n", LDAP_BUFFER_SIZE);
-+      ldap_value_free (tempstr);
++      ldap_value_free_len (tempbv);
 +    }
 +
-+  if ((tempstr = ldap_get_values (ld, item->ldent, "dhcpKeySecret")) != NULL)
++  if ((tempbv = ldap_get_values_len (ld, item->ldent, "dhcpKeySecret")) != NULL)
 +    {
 +      x_strncat (cfile->inbuf, "secret ", LDAP_BUFFER_SIZE);
-+      x_strncat (cfile->inbuf, tempstr[0], LDAP_BUFFER_SIZE);
++      x_strncat (cfile->inbuf, tempbv[0]->bv_val, LDAP_BUFFER_SIZE);
 +      x_strncat (cfile->inbuf, ";\n", LDAP_BUFFER_SIZE);
-+      ldap_value_free (tempstr);
++      ldap_value_free_len (tempbv);
 +    }
 +
 +  item->close_brace = 1;
@@ -3799,30 +554,30 @@ diff -Naur dhcp-3.0.5/server/ldap.c dhcp-3.0.5-ldap/server/ldap.c
 +ldap_parse_zone (struct ldap_config_stack *item, struct parse *cfile)
 +{
 +  char *cnFindStart, *cnFindEnd;
-+  char **tempstr;
++  struct berval **tempbv;
 +  char *keyCn;
 +  size_t len;
 +
-+  if ((tempstr = ldap_get_values (ld, item->ldent, "cn")) != NULL)
++  if ((tempbv = ldap_get_values_len (ld, item->ldent, "cn")) != NULL)
 +    {
 +      x_strncat (cfile->inbuf, "zone ", LDAP_BUFFER_SIZE);
-+      x_strncat (cfile->inbuf, tempstr[0], LDAP_BUFFER_SIZE);
++      x_strncat (cfile->inbuf, tempbv[0]->bv_val, LDAP_BUFFER_SIZE);
 +      x_strncat (cfile->inbuf, " {\n", LDAP_BUFFER_SIZE);
-+      ldap_value_free (tempstr);
++      ldap_value_free_len (tempbv);
 +    }
 +
-+  if ((tempstr = ldap_get_values (ld, item->ldent, "dhcpDnsZoneServer")) != NULL)
++  if ((tempbv = ldap_get_values_len (ld, item->ldent, "dhcpDnsZoneServer")) != NULL)
 +    {
 +      x_strncat (cfile->inbuf, "primary ", LDAP_BUFFER_SIZE);
-+      x_strncat (cfile->inbuf, tempstr[0], LDAP_BUFFER_SIZE);
++      x_strncat (cfile->inbuf, tempbv[0]->bv_val, LDAP_BUFFER_SIZE);
 +
 +      x_strncat (cfile->inbuf, ";\n", LDAP_BUFFER_SIZE);
-+      ldap_value_free (tempstr);
++      ldap_value_free_len (tempbv);
 +    }
 +
-+  if ((tempstr = ldap_get_values (ld, item->ldent, "dhcpKeyDN")) != NULL)
++  if ((tempbv = ldap_get_values_len (ld, item->ldent, "dhcpKeyDN")) != NULL)
 +    {
-+      cnFindStart = strchr(tempstr[0],'=');
++      cnFindStart = strchr(tempbv[0]->bv_val,'=');
 +      if (cnFindStart != NULL)
 +        cnFindEnd = strchr(++cnFindStart,',');
 +      else
@@ -3851,7 +606,7 @@ diff -Naur dhcp-3.0.5/server/ldap.c dhcp-3.0.5-ldap/server/ldap.c
 +          dfree (keyCn, MDL);
 +        }
 +
-+      ldap_value_free (tempstr);
++      ldap_value_free_len (tempbv);
 +     }
 +
 +  item->close_brace = 1;
@@ -3892,7 +647,7 @@ diff -Naur dhcp-3.0.5/server/ldap.c dhcp-3.0.5-ldap/server/ldap.c
 +  sigemptyset (&new.sa_mask);
 +  sigaction (SIGPIPE, &new, &old);
 +
-+  ldap_unbind (ld);
++  ldap_unbind_ext_s (ld, NULL, NULL);
 +  ld = NULL;
 +
 +  sigaction (SIGPIPE, &old, &new);
@@ -3949,7 +704,7 @@ diff -Naur dhcp-3.0.5/server/ldap.c dhcp-3.0.5-ldap/server/ldap.c
 +                             &global_scope, oc, MDL) &&
 +      db.data != NULL && *db.data != '\0')
 +    {
-+      ret = strtol (db.data, NULL, 10);
++      ret = strtol ((const char *) db.data, NULL, 10);
 +      data_string_forget (&db, MDL);
 +    }
 +  else
@@ -3964,7 +719,7 @@ diff -Naur dhcp-3.0.5/server/ldap.c dhcp-3.0.5-ldap/server/ldap.c
 +{
 +  struct option_cache *oc;
 +  struct data_string db;
-+  int ret;
++  int ret = -1;
 +
 +  memset (&db, 0, sizeof (db));
 +  oc = lookup_option (&server_universe, options, option_name);
@@ -3994,7 +749,8 @@ diff -Naur dhcp-3.0.5/server/ldap.c dhcp-3.0.5-ldap/server/ldap.c
 +{
 +  int ret;
 +  LDAPURLDesc *ldapurl = NULL;
-+  char *who = NULL, *pwd = NULL;
++  char *who = NULL;
++  struct berval creds;
 +
 +  log_info("LDAP rebind to '%s'", url);
 +  if ((ret = ldap_url_parse(url, &ldapurl)) != LDAP_SUCCESS)
@@ -4042,10 +798,12 @@ diff -Naur dhcp-3.0.5/server/ldap.c dhcp-3.0.5-ldap/server/ldap.c
 +  if (ldap_username != NULL || *ldap_username != '\0')
 +    {
 +      who = ldap_username;
-+      pwd = ldap_password;
++      creds.bv_val = strdup(ldap_password);
++      creds.bv_len = strlen(ldap_password);
 +    }
 +
-+  if ((ret = ldap_simple_bind_s (ld, who, pwd)) != LDAP_SUCCESS)
++  if ((ret = ldap_sasl_bind_s (ld, who, LDAP_SASL_SIMPLE, &creds,
++                               NULL, NULL, NULL)) != LDAP_SUCCESS)
 +    {
 +      log_error ("Error: Cannot login into ldap server %s:%d: %s",
 +                 ldapurl->lud_host, ldapurl->lud_port, ldap_err2string (ret));
@@ -4058,6 +816,8 @@ diff -Naur dhcp-3.0.5/server/ldap.c dhcp-3.0.5-ldap/server/ldap.c
 +{
 +  struct option_state *options;
 +  int ret, version;
++  char *uri = NULL;
++  struct berval creds;
 +
 +  if (ld != NULL)
 +    return;
@@ -4230,12 +990,25 @@ diff -Naur dhcp-3.0.5/server/ldap.c dhcp-3.0.5-ldap/server/ldap.c
 +    }
 +#endif
 +
-+  if ((ld = ldap_init (ldap_server, ldap_port)) == NULL)
++  /* enough for 'ldap://+ + hostname + ':' + port number */
++  uri = malloc(strlen(ldap_server) + 16);
++  if (uri == NULL)
++    {
++      log_error ("Cannot build ldap init URI %s:%d", ldap_server, ldap_port);
++      return;
++    }
++
++  sprintf("ldap://%s:%d", ldap_server, ldap_port);
++  ldap_initialize(&ld, uri);
++
++  if (ld == NULL)
 +    {
 +      log_error ("Cannot init ldap session to %s:%d", ldap_server, ldap_port);
 +      return;
 +    }
 +
++  free(uri);
++
 +  version = LDAP_VERSION3;
 +  if ((ret = ldap_set_option (ld, LDAP_OPT_PROTOCOL_VERSION, &version)) != LDAP_OPT_SUCCESS)
 +    {
@@ -4297,8 +1070,11 @@ diff -Naur dhcp-3.0.5/server/ldap.c dhcp-3.0.5-ldap/server/ldap.c
 +
 +  if (ldap_username != NULL && *ldap_username != '\0')
 +    {
-+      if ((ret = ldap_simple_bind_s (ld, ldap_username,
-+                                     ldap_password)) != LDAP_SUCCESS)
++      creds.bv_val = strdup(ldap_password);
++      creds.bv_len = strlen(ldap_password);
++
++      if ((ret == ldap_sasl_bind_s (ld, ldap_username, LDAP_SASL_SIMPLE,
++                                    &creds, NULL, NULL, NULL)) != LDAP_SUCCESS)
 +        {
 +          log_error ("Error: Cannot login into ldap server %s:%d: %s",
 +                     ldap_server, ldap_port, ldap_err2string (ret));
@@ -4320,8 +1096,7 @@ diff -Naur dhcp-3.0.5/server/ldap.c dhcp-3.0.5-ldap/server/ldap.c
 +                    "dhcpGroupDN", "dhcpHostDN", "dhcpClassesDN",
 +                    "dhcpPoolDN", NULL};
 +  LDAPMessage * newres, * newent;
-+  struct ldap_config_stack *ns;
-+  char **tempstr;
++  struct berval **tempbv;
 +  int i, j, ret;
 +#if defined (DEBUG_LDAP)
 +  char *dn;
@@ -4341,25 +1116,25 @@ diff -Naur dhcp-3.0.5/server/ldap.c dhcp-3.0.5-ldap/server/ldap.c
 +
 +  for (i=0; search[i] != NULL; i++)
 +    {
-+      if ((tempstr = ldap_get_values (ld, ent, search[i])) == NULL)
++      if ((tempbv = ldap_get_values_len (ld, ent, search[i])) == NULL)
 +        continue;
 +
-+      for (j=0; tempstr[j] != NULL; j++)
++      for (j=0; tempbv[j] != NULL; j++)
 +        {
-+          if (*tempstr[j] == '\0')
++          if (*tempbv[j]->bv_val == '\0')
 +            continue;
 +
-+          if ((ret = ldap_search_s (ld, tempstr[j], LDAP_SCOPE_BASE, 
-+                                    "objectClass=*", NULL, 0, 
-+                                    &newres)) != LDAP_SUCCESS)
++          if ((ret = ldap_search_ext_s(ld, tempbv[j]->bv_val, LDAP_SCOPE_BASE,
++                                       "objectClass=*", NULL, 0, NULL,
++                                       NULL, NULL, 0, &newres)) != LDAP_SUCCESS)
 +            {
-+              ldap_value_free (tempstr);
++              ldap_value_free_len (tempbv);
 +              ldap_stop();
 +              return;
 +            }
 +    
 +#if defined (DEBUG_LDAP)
-+          log_info ("Adding contents of subtree '%s' to config stack from '%s' reference", tempstr[j], search[i]);
++          log_info ("Adding contents of subtree '%s' to config stack from '%s' reference", tempbv[j], search[i]);
 +#endif
 +          for (newent = ldap_first_entry (ld, newres);
 +               newent != NULL;
@@ -4379,7 +1154,7 @@ diff -Naur dhcp-3.0.5/server/ldap.c dhcp-3.0.5-ldap/server/ldap.c
 +            }
 +        }
 +
-+      ldap_value_free (tempstr);
++      ldap_value_free_len (tempbv);
 +    }
 +}
 +
@@ -4494,26 +1269,26 @@ diff -Naur dhcp-3.0.5/server/ldap.c dhcp-3.0.5-ldap/server/ldap.c
 +ldap_parse_entry_options (LDAPMessage *ent, char *buffer, size_t size,
 +                          int *lease_limit)
 +{
-+  char **tempstr;
++  struct berval **tempbv;
 +  int i;
 +
 +  if (ent == NULL || buffer == NULL || size == 0)
 +    return (ISC_R_FAILURE);
 +
-+  if ((tempstr = ldap_get_values (ld, ent, "dhcpStatements")) != NULL)
++  if ((tempbv = ldap_get_values_len (ld, ent, "dhcpStatements")) != NULL)
 +    {
-+      for (i=0; tempstr[i] != NULL; i++)
++      for (i=0; tempbv[i] != NULL; i++)
 +        {
 +          if (lease_limit != NULL &&
-+              strncasecmp ("lease limit ", tempstr[i], 12) == 0)
++              strncasecmp ("lease limit ", tempbv[i]->bv_val, 12) == 0)
 +            {
-+              *lease_limit = (int) strtol ((tempstr[i]) + 12, NULL, 10);
++              *lease_limit = (int) strtol ((tempbv[i]->bv_val) + 12, NULL, 10);
 +              continue;
 +            }
 +
-+          x_strncat (buffer, tempstr[i], size);
++          x_strncat (buffer, tempbv[i]->bv_val, size);
 +
-+          switch((int) check_statement_end (tempstr[i]))
++          switch((int) check_statement_end (tempbv[i]->bv_val))
 +            {
 +              case '}':
 +              case ';':
@@ -4524,16 +1299,16 @@ diff -Naur dhcp-3.0.5/server/ldap.c dhcp-3.0.5-ldap/server/ldap.c
 +                break;
 +            }
 +        }
-+      ldap_value_free (tempstr);
++      ldap_value_free_len (tempbv);
 +    }
 +
-+  if ((tempstr = ldap_get_values (ld, ent, "dhcpOption")) != NULL)
++  if ((tempbv = ldap_get_values_len (ld, ent, "dhcpOption")) != NULL)
 +    {
-+      for (i=0; tempstr[i] != NULL; i++)
++      for (i=0; tempbv[i] != NULL; i++)
 +        {
 +          x_strncat (buffer, "option ", size);
-+          x_strncat (buffer, tempstr[i], size);
-+          switch ((int) check_statement_end (tempstr[i]))
++          x_strncat (buffer, tempbv[i]->bv_val, size);
++          switch ((int) check_statement_end (tempbv[i]->bv_val))
 +            {
 +              case ';':
 +                x_strncat (buffer, "\n", size);
@@ -4543,7 +1318,7 @@ diff -Naur dhcp-3.0.5/server/ldap.c dhcp-3.0.5-ldap/server/ldap.c
 +                break;
 +            }
 +        }
-+      ldap_value_free (tempstr);
++      ldap_value_free_len (tempbv);
 +    }
 +
 +  return (ISC_R_SUCCESS);
@@ -4553,10 +1328,11 @@ diff -Naur dhcp-3.0.5/server/ldap.c dhcp-3.0.5-ldap/server/ldap.c
 +static void
 +ldap_generate_config_string (struct parse *cfile)
 +{
-+  char **objectClass, *dn;
++  struct berval **objectClass;
++  char *dn;
 +  struct ldap_config_stack *entry;
 +  LDAPMessage * ent, * res;
-+  int i, j, ignore, found;
++  int i, ignore, found;
 +  int ret;
 +
 +  if (ld == NULL)
@@ -4565,7 +1341,7 @@ diff -Naur dhcp-3.0.5/server/ldap.c dhcp-3.0.5-ldap/server/ldap.c
 +    return;
 +
 +  entry = ldap_stack;
-+  if ((objectClass = ldap_get_values (ld, entry->ldent, 
++  if ((objectClass = ldap_get_values_len (ld, entry->ldent, 
 +                                      "objectClass")) == NULL)
 +    return;
 +    
@@ -4573,21 +1349,21 @@ diff -Naur dhcp-3.0.5/server/ldap.c dhcp-3.0.5-ldap/server/ldap.c
 +  found = 1;
 +  for (i=0; objectClass[i] != NULL; i++)
 +    {
-+      if (strcasecmp (objectClass[i], "dhcpSharedNetwork") == 0)
++      if (strcasecmp (objectClass[i]->bv_val, "dhcpSharedNetwork") == 0)
 +        ldap_parse_shared_network (entry, cfile);
-+      else if (strcasecmp (objectClass[i], "dhcpClass") == 0)
++      else if (strcasecmp (objectClass[i]->bv_val, "dhcpClass") == 0)
 +        ldap_parse_class (entry, cfile);
-+      else if (strcasecmp (objectClass[i], "dhcpSubnet") == 0)
++      else if (strcasecmp (objectClass[i]->bv_val, "dhcpSubnet") == 0)
 +        ldap_parse_subnet (entry, cfile);
-+      else if (strcasecmp (objectClass[i], "dhcpPool") == 0)
++      else if (strcasecmp (objectClass[i]->bv_val, "dhcpPool") == 0)
 +        ldap_parse_pool (entry, cfile);
-+      else if (strcasecmp (objectClass[i], "dhcpGroup") == 0)
++      else if (strcasecmp (objectClass[i]->bv_val, "dhcpGroup") == 0)
 +        ldap_parse_group (entry, cfile);
-+      else if (strcasecmp (objectClass[i], "dhcpTSigKey") == 0)
++      else if (strcasecmp (objectClass[i]->bv_val, "dhcpTSigKey") == 0)
 +        ldap_parse_key (entry, cfile);
-+      else if (strcasecmp (objectClass[i], "dhcpDnsZone") == 0)
++      else if (strcasecmp (objectClass[i]->bv_val, "dhcpDnsZone") == 0)
 +        ldap_parse_zone (entry, cfile);
-+      else if (strcasecmp (objectClass[i], "dhcpHost") == 0)
++      else if (strcasecmp (objectClass[i]->bv_val, "dhcpHost") == 0)
 +        {
 +          if (ldap_method == LDAP_METHOD_STATIC)
 +            ldap_parse_host (entry, cfile);
@@ -4597,7 +1373,7 @@ diff -Naur dhcp-3.0.5/server/ldap.c dhcp-3.0.5-ldap/server/ldap.c
 +              break;
 +            }
 +        }
-+      else if (strcasecmp (objectClass[i], "dhcpSubClass") == 0)
++      else if (strcasecmp (objectClass[i]->bv_val, "dhcpSubClass") == 0)
 +        {
 +          if (ldap_method == LDAP_METHOD_STATIC)
 +            ldap_parse_subclass (entry, cfile);
@@ -4617,7 +1393,7 @@ diff -Naur dhcp-3.0.5/server/ldap.c dhcp-3.0.5-ldap/server/ldap.c
 +        }
 +    }
 +
-+  ldap_value_free (objectClass);
++  ldap_value_free_len (objectClass);
 +
 +  if (ignore)
 +    {
@@ -4636,8 +1412,9 @@ diff -Naur dhcp-3.0.5/server/ldap.c dhcp-3.0.5-ldap/server/ldap.c
 +#endif
 +
 +  if (dn == NULL ||
-+      (ret = ldap_search_s (ld, dn, LDAP_SCOPE_ONELEVEL, "objectClass=*", 
-+                            NULL, 0, &res)) != LDAP_SUCCESS)
++      (ret = ldap_search_ext_s (ld, dn, LDAP_SCOPE_ONELEVEL,
++                                "objectClass=*", NULL, 0, NULL, NULL,
++                                NULL, 0, &res)) != LDAP_SUCCESS)
 +    {
 +      if (dn)
 +        ldap_memfree (dn);
@@ -4716,13 +1493,14 @@ diff -Naur dhcp-3.0.5/server/ldap.c dhcp-3.0.5-ldap/server/ldap.c
 +static char *
 +ldap_get_host_name (LDAPMessage * ent)
 +{
-+  char **name, *ret;
++  struct berval **name;
++  char *ret;
 +
 +  ret = NULL;
-+  if ((name = ldap_get_values (ld, ent, "cn")) == NULL || name[0] == NULL)
++  if ((name = ldap_get_values_len (ld, ent, "cn")) == NULL || name[0] == NULL)
 +    {
 +      if (name != NULL)
-+        ldap_value_free (name);
++        ldap_value_free_len (name);
 +
 +#if defined (DEBUG_LDAP)
 +      ret = ldap_get_dn (ld, ent);
@@ -4735,9 +1513,9 @@ diff -Naur dhcp-3.0.5/server/ldap.c dhcp-3.0.5-ldap/server/ldap.c
 +      return (NULL);
 +    }
 +
-+  ret = dmalloc (strlen (name[0]) + 1, MDL);
-+  strcpy (ret, name[0]);
-+  ldap_value_free (name);
++  ret = dmalloc (strlen (name[0]->bv_val) + 1, MDL);
++  strcpy (ret, name[0]->bv_val);
++  ldap_value_free_len (name);
 +
 +  return (ret);
 +}
@@ -4774,13 +1552,14 @@ diff -Naur dhcp-3.0.5/server/ldap.c dhcp-3.0.5-ldap/server/ldap.c
 +{
 +  LDAPMessage * ldres, * hostres, * ent, * hostent;
 +  char hfilter[1024], sfilter[1024], fqdn[257];
-+  char *buffer, **tempstr = NULL, *hostdn;
++  char *buffer, *hostdn;
 +  ldap_dn_node *curr = NULL;
 +  struct parse *cfile;
 +  struct utsname unme;
 +  isc_result_t res;
 +  size_t length;
 +  int ret, cnt;
++  struct berval **tempbv = NULL;
 +
 +  if (ld == NULL)
 +    ldap_start ();
@@ -4818,8 +1597,9 @@ diff -Naur dhcp-3.0.5/server/ldap.c dhcp-3.0.5-ldap/server/ldap.c
 +
 +  }
 +  hostres = NULL;
-+  if ((ret = ldap_search_s (ld, ldap_base_dn, LDAP_SCOPE_SUBTREE,
-+                            hfilter, NULL, 0, &hostres)) != LDAP_SUCCESS)
++  if ((ret = ldap_search_ext_s (ld, ldap_base_dn, LDAP_SCOPE_SUBTREE,
++                                hfilter, NULL, 0, NULL, NULL, NULL, 0,
++                                &hostres)) != LDAP_SUCCESS)
 +    {
 +      log_error ("Cannot find host LDAP entry %s %s",
 +               ((ldap_dhcp_server_cn == NULL)?(unme.nodename):(ldap_dhcp_server_cn)), hfilter);
@@ -4844,13 +1624,13 @@ diff -Naur dhcp-3.0.5/server/ldap.c dhcp-3.0.5-ldap/server/ldap.c
 +#endif
 +
 +  if (hostdn == NULL ||
-+      (tempstr = ldap_get_values (ld, hostent, "dhcpServiceDN")) == NULL ||
-+      tempstr[0] == NULL)
++      (tempbv = ldap_get_values_len (ld, hostent, "dhcpServiceDN")) == NULL ||
++      tempbv[0] == NULL)
 +    {
 +      log_error ("Error: Cannot find LDAP entry matching %s", hfilter);
 +
-+      if (tempstr != NULL)
-+        ldap_value_free (tempstr);
++      if (tempbv != NULL)
++        ldap_value_free_len (tempbv);
 +
 +      if (hostdn)
 +        ldap_memfree (hostdn);
@@ -4889,17 +1669,18 @@ diff -Naur dhcp-3.0.5/server/ldap.c dhcp-3.0.5-ldap/server/ldap.c
 +  cfile->read_function = ldap_read_function;
 +
 +  res = ISC_R_SUCCESS;
-+  for (cnt=0; tempstr[cnt] != NULL; cnt++)
++  for (cnt=0; tempbv[cnt] != NULL; cnt++)
 +    {
 +      snprintf(sfilter, sizeof(sfilter), "(&(objectClass=dhcpService)"
 +                        "(|(dhcpPrimaryDN=%s)(dhcpSecondaryDN=%s)))",
 +                        hostdn, hostdn);
 +      ldres = NULL;
-+      if ((ret = ldap_search_s (ld, tempstr[cnt], LDAP_SCOPE_BASE,
-+                                sfilter, NULL, 0, &ldres)) != LDAP_SUCCESS)
++      if ((ret = ldap_search_ext_s (ld, tempbv[cnt]->bv_val, LDAP_SCOPE_BASE,
++                                    sfilter, NULL, 0, NULL, NULL, NULL,
++                                    0, &ldres)) != LDAP_SUCCESS)
 +        {
 +          log_error ("Error searching for dhcpServiceDN '%s': %s. Please update the LDAP entry '%s'",
-+                     tempstr[cnt], ldap_err2string (ret), hostdn);
++                     tempbv[cnt]->bv_val, ldap_err2string (ret), hostdn);
 +          if(NULL != ldres)
 +            ldap_msgfree(ldres);
 +          res = ISC_R_FAILURE;
@@ -4909,7 +1690,7 @@ diff -Naur dhcp-3.0.5/server/ldap.c dhcp-3.0.5-ldap/server/ldap.c
 +      if ((ent = ldap_first_entry (ld, ldres)) == NULL)
 +        {
 +          log_error ("Error: Cannot find dhcpService DN '%s' with primary or secondary server reference. Please update the LDAP server entry '%s'",
-+                     tempstr[cnt], hostdn);
++                     tempbv[cnt]->bv_val, hostdn);
 +
 +          ldap_msgfree(ldres);
 +          res = ISC_R_FAILURE;
@@ -4925,7 +1706,7 @@ diff -Naur dhcp-3.0.5/server/ldap.c dhcp-3.0.5-ldap/server/ldap.c
 +      curr = dmalloc (sizeof (*curr), MDL);
 +      if (curr != NULL)
 +        {
-+          length = strlen (tempstr[cnt]);
++          length = strlen (tempbv[cnt]->bv_val);
 +          curr->dn = dmalloc (length + 1, MDL);
 +          if (curr->dn == NULL)
 +            {
@@ -4933,7 +1714,7 @@ diff -Naur dhcp-3.0.5/server/ldap.c dhcp-3.0.5-ldap/server/ldap.c
 +              curr = NULL;
 +            }
 +          else
-+            strcpy (curr->dn, tempstr[cnt]);
++            strcpy (curr->dn, tempbv[cnt]->bv_val);
 +        }
 +
 +      if (curr != NULL)
@@ -4952,13 +1733,13 @@ diff -Naur dhcp-3.0.5/server/ldap.c dhcp-3.0.5-ldap/server/ldap.c
 +        log_fatal ("no memory to remember ldap service dn");
 +
 +#if defined (DEBUG_LDAP)
-+      log_info ("LDAP: Parsing dhcpService DN '%s' ...", tempstr[cnt]);
++      log_info ("LDAP: Parsing dhcpService DN '%s' ...", tempbv[cnt]);
 +#endif
 +      add_to_config_stack (ldres, ent);
 +      res = conf_file_subparse (cfile, root_group, ROOT_GROUP);
 +      if (res != ISC_R_SUCCESS)
 +        {
-+          log_error ("LDAP: cannot parse dhcpService entry '%s'", tempstr[cnt]);
++          log_error ("LDAP: cannot parse dhcpService entry '%s'", tempbv[cnt]->bv_val);
 +          break;
 +        }
 +    }
@@ -4967,7 +1748,7 @@ diff -Naur dhcp-3.0.5/server/ldap.c dhcp-3.0.5-ldap/server/ldap.c
 +  ldap_close_debug_fd();
 +
 +  ldap_memfree (hostdn);
-+  ldap_value_free (tempstr);
++  ldap_value_free_len (tempbv);
 +
 +  if (res != ISC_R_SUCCESS)
 +    {
@@ -5010,7 +1791,7 @@ diff -Naur dhcp-3.0.5/server/ldap.c dhcp-3.0.5-ldap/server/ldap.c
 +                         int type, struct host_decl *host,
 +                         struct class **class)
 +{
-+  int i, declaration, lease_limit;
++  int declaration, lease_limit;
 +  char option_buffer[8192];
 +  enum dhcp_token token;
 +  struct parse *cfile;
@@ -5054,8 +1835,8 @@ diff -Naur dhcp-3.0.5/server/ldap.c dhcp-3.0.5-ldap/server/ldap.c
 +
 +          if (basedn != NULL && *basedn != '\0')
 +            {
-+              ret = ldap_search_s (ld, basedn, LDAP_SCOPE_SUBTREE,
-+                                   filter, NULL, 0, &groupdn);
++              ret = ldap_search_ext_s (ld, basedn, LDAP_SCOPE_SUBTREE, filter,
++                                       NULL, 0, NULL, NULL, NULL, 0, &groupdn);
 +              if (ret == LDAP_SUCCESS)
 +                {
 +                  if ((entry = ldap_first_entry (ld, groupdn)) != NULL)
@@ -5116,7 +1897,7 @@ diff -Naur dhcp-3.0.5/server/ldap.c dhcp-3.0.5-ldap/server/ldap.c
 +find_haddr_in_ldap (struct host_decl **hp, int htype, unsigned hlen,
 +                    const unsigned char *haddr, const char *file, int line)
 +{
-+  char buf[128], *type_str, **tempstr, *addr_str;
++  char buf[128], *type_str;
 +  LDAPMessage * res, *ent;
 +  struct host_decl * host;
 +  isc_result_t status;
@@ -5163,8 +1944,8 @@ diff -Naur dhcp-3.0.5/server/ldap.c dhcp-3.0.5-ldap/server/ldap.c
 +#if defined (DEBUG_LDAP)
 +      log_info ("Searching for %s in LDAP tree %s", buf, curr->dn);
 +#endif
-+      ret = ldap_search_s (ld, curr->dn, LDAP_SCOPE_SUBTREE,
-+                           buf, NULL, 0, &res);
++      ret = ldap_search_ext_s (ld, curr->dn, LDAP_SCOPE_SUBTREE, buf, NULL, 0,
++                               NULL, NULL, NULL, 0, &res);
 +
 +      if(ret == LDAP_SERVER_DOWN)
 +        {
@@ -5178,8 +1959,8 @@ diff -Naur dhcp-3.0.5/server/ldap.c dhcp-3.0.5-ldap/server/ldap.c
 +              return (0);
 +            }
 +
-+          ret = ldap_search_s (ld, curr->dn, LDAP_SCOPE_SUBTREE,
-+                               buf, NULL, 0, &res);
++          ret = ldap_search_ext_s (ld, curr->dn, LDAP_SCOPE_SUBTREE, buf, NULL,
++                                   0, NULL, NULL, NULL, 0, &res);
 +        }
 +
 +      if (ret == LDAP_SUCCESS)
@@ -5215,7 +1996,7 @@ diff -Naur dhcp-3.0.5/server/ldap.c dhcp-3.0.5-ldap/server/ldap.c
 +#if defined (DEBUG_LDAP)
 +          else
 +            {
-+              log_info ("ldap_search_s returned %s when searching for %s in %s",
++              log_info ("ldap_search_ext_s returned %s when searching for %s in %s",
 +                        ldap_err2string (ret), buf, curr->dn);
 +            }
 +#endif
@@ -5277,7 +2058,7 @@ diff -Naur dhcp-3.0.5/server/ldap.c dhcp-3.0.5-ldap/server/ldap.c
 +                       struct data_string *data)
 +{
 +  LDAPMessage * res, * ent;
-+  int i, ret, lease_limit;
++  int ret, lease_limit;
 +  isc_result_t status;
 +  ldap_dn_node *curr;
 +  char buf[1024];
@@ -5293,7 +2074,7 @@ diff -Naur dhcp-3.0.5/server/ldap.c dhcp-3.0.5-ldap/server/ldap.c
 +  snprintf (buf, sizeof (buf),
 +            "(&(objectClass=dhcpSubClass)(cn=%s)(dhcpClassData=%s))",
 +            print_hex_1 (data->len, data->data, 60),
-+            print_hex_2 (strlen (class->name), class->name, 60));
++            print_hex_2 (strlen (class->name), (u_int8_t *) class->name, 60));
 +#if defined (DEBUG_LDAP)
 +  log_info ("Searching LDAP for %s", buf);
 +#endif
@@ -5306,8 +2087,8 @@ diff -Naur dhcp-3.0.5/server/ldap.c dhcp-3.0.5-ldap/server/ldap.c
 +#if defined (DEBUG_LDAP)
 +      log_info ("Searching for %s in LDAP tree %s", buf, curr->dn);
 +#endif
-+      ret = ldap_search_s (ld, curr->dn, LDAP_SCOPE_SUBTREE,
-+                           buf, NULL, 0, &res);
++      ret = ldap_search_ext_s (ld, curr->dn, LDAP_SCOPE_SUBTREE, buf, NULL, 0,
++                               NULL, NULL, NULL, 0, &res);
 +
 +      if(ret == LDAP_SERVER_DOWN)
 +        {
@@ -5322,8 +2103,8 @@ diff -Naur dhcp-3.0.5/server/ldap.c dhcp-3.0.5-ldap/server/ldap.c
 +              return (0);
 +            }
 +
-+          ret = ldap_search_s (ld, curr->dn, LDAP_SCOPE_SUBTREE,
-+                               buf, NULL, 0, &res);
++          ret = ldap_search_ext_s (ld, curr->dn, LDAP_SCOPE_SUBTREE, buf,
++                                   NULL, 0, NULL, NULL, NULL, 0, &res);
 +        }
 +
 +      if (ret == LDAP_SUCCESS)
@@ -5359,7 +2140,7 @@ diff -Naur dhcp-3.0.5/server/ldap.c dhcp-3.0.5-ldap/server/ldap.c
 +#if defined (DEBUG_LDAP)
 +          else
 +            {
-+              log_info ("ldap_search_s returned %s when searching for %s in %s",
++              log_info ("ldap_search_ext_s returned %s when searching for %s in %s",
 +                        ldap_err2string (ret), buf, curr->dn);
 +            }
 +#endif
@@ -5420,192 +2201,106 @@ diff -Naur dhcp-3.0.5/server/ldap.c dhcp-3.0.5-ldap/server/ldap.c
 +}
 +
 +#endif
-diff -Naur dhcp-3.0.5/server/ldap_casa.c dhcp-3.0.5-ldap/server/ldap_casa.c
---- dhcp-3.0.5/server/ldap_casa.c      1969-12-31 19:00:00.000000000 -0500
-+++ dhcp-3.0.5-ldap/server/ldap_casa.c 2007-02-23 12:48:56.000000000 -0500
-@@ -0,0 +1,138 @@
-+/* ldap_casa.c
-+   
-+   CASA routines for DHCPD... */
-+
-+/* Copyright (c) 2004 Internet Systems Consorium, Inc. ("ISC")
-+ * Copyright (c) 1995-2003 Internet Software Consortium.
-+ * Copyright (c) 2006 Novell, Inc.
-+
-+ * 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 ISC, ISC DHCP, 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 INTERNET SYSTEMS CONSORTIUM 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 ISC 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.
-+
-+ * This file was written by S Kalyanasundaram <skalyanasundaram@novell.com>
-+ */
-+
-+#if defined(LDAP_CASA_AUTH)
-+#include "ldap_casa.h"
-+#include "dhcpd.h"
-+
-+int
-+load_casa (void)
-+{
-+       if( !(casaIDK = dlopen(MICASA_LIB,RTLD_LAZY)))
-+                return 0;
-+       p_miCASAGetCredential = (CASA_GetCredential_T) dlsym(casaIDK, "miCASAGetCredential");
-+       p_miCASASetCredential = (CASA_SetCredential_T) dlsym(casaIDK, "miCASASetCredential");
-+       p_miCASARemoveCredential = (CASA_RemoveCredential_T) dlsym(casaIDK, "miCASARemoveCredential");
-+
-+       if((p_miCASAGetCredential == NULL) ||
-+         (p_miCASASetCredential == NULL) ||
-+         (p_miCASARemoveCredential == NULL))
-+       {
-+          if(casaIDK)
-+            dlclose(casaIDK);
-+          casaIDK = NULL;
-+          p_miCASAGetCredential = NULL;
-+          p_miCASASetCredential = NULL;
-+          p_miCASARemoveCredential = NULL;
-+          return 0;
-+       }
-+       else
-+          return 1;
-+}
-+
-+static void
-+release_casa(void)
-+{
-+   if(casaIDK)
-+   {
-+      dlclose(casaIDK);
-+      casaIDK = NULL;
-+   }
-+
-+   p_miCASAGetCredential = NULL;
-+   p_miCASASetCredential = NULL;
-+   p_miCASARemoveCredential = NULL;
-+
-+}
-+
-+int
-+load_uname_pwd_from_miCASA (char **ldap_username, char **ldap_password)
-+ {
-+   int                     result = 0;
-+   uint32_t                credentialtype = SSCS_CRED_TYPE_SERVER_F;
-+   SSCS_BASIC_CREDENTIAL   credential;
-+   SSCS_SECRET_ID_T        applicationSecretId;
-+   char                    *tempVar = NULL;
-+
-+   const char applicationName[10] = "dhcp-ldap";
-+
-+   if ( load_casa() )
-+   {
-+      memset(&credential, 0, sizeof(SSCS_BASIC_CREDENTIAL));
-+      memset(&applicationSecretId, 0, sizeof(SSCS_SECRET_ID_T));
-+
-+      applicationSecretId.len = strlen(applicationName) + 1;
-+      memcpy (applicationSecretId.id, applicationName, applicationSecretId.len);
-+
-+      credential.unFlags = USERNAME_TYPE_CN_F;
-+
-+      result = p_miCASAGetCredential (0,
-+                 &applicationSecretId,NULL,&credentialtype,
-+                 &credential,NULL);
-+
-+      if(credential.unLen)
-+      {
-+         tempVar = dmalloc (credential.unLen + 1, MDL);
-+         if (!tempVar)
-+             log_fatal ("no memory for ldap_username");
-+         memcpy(tempVar , credential.username, credential.unLen);
-+         *ldap_username = tempVar;
+diff -up dhcp-4.0.0/server/confpars.c.ldap dhcp-4.0.0/server/confpars.c
+--- dhcp-4.0.0/server/confpars.c.ldap  2007-11-30 11:51:43.000000000 -1000
++++ dhcp-4.0.0/server/confpars.c       2008-01-22 15:09:56.000000000 -1000
+@@ -60,7 +60,17 @@ void parse_trace_setup ()
+ isc_result_t readconf ()
+ {
+-      return read_conf_file (path_dhcpd_conf, root_group, ROOT_GROUP, 0);
++      isc_result_t res;
 +
-+         tempVar = dmalloc (credential.pwordLen + 1, MDL);
-+         if (!tempVar)
-+             log_fatal ("no memory for ldap_password");
-+         memcpy(tempVar, credential.password, credential.pwordLen);
-+         *ldap_password = tempVar;
++      res = read_conf_file (path_dhcpd_conf, root_group, ROOT_GROUP, 0);
++#if defined(LDAP_CONFIGURATION)
++      if (res != ISC_R_SUCCESS)
++              return (res);
 +
-+#if defined (DEBUG_LDAP)
-+         log_info ("Authentication credential taken from CASA");
++      return ldap_read_config ();
++#else
++      return (res);
 +#endif
+ }
+ isc_result_t read_conf_file (const char *filename, struct group *group,
+diff -up dhcp-4.0.0/server/class.c.ldap dhcp-4.0.0/server/class.c
+--- dhcp-4.0.0/server/class.c.ldap     2007-09-05 07:32:10.000000000 -1000
++++ dhcp-4.0.0/server/class.c  2008-01-22 15:09:56.000000000 -1000
+@@ -84,6 +84,7 @@ int check_collection (packet, lease, col
+       int matched = 0;
+       int status;
+       int ignorep;
++      int classfound;
+       for (class = collection -> classes; class; class = class -> nic) {
+ #if defined (DEBUG_CLASS_MATCHING)
+@@ -129,9 +130,15 @@ int check_collection (packet, lease, col
+                                  class -> submatch, MDL));
+                       if (status && data.len) {
+                               nc = (struct class *)0;
+-                              if (class_hash_lookup (&nc, class -> hash,
+-                                                     (const char *)data.data,
+-                                                     data.len, MDL)) {
++                              classfound = class_hash_lookup (&nc, class -> hash,
++                                      (const char *)data.data, data.len, MDL);
 +
-+         release_casa();
-+         return 1;
-+
-+        }
-+        else
-+        {
-+            release_casa();
-+            return 0;
-+        }
-+      }
-+      else
-+          return 0; //casa libraries not loaded
-+ }
-+
-+#endif /* LDAP_CASA_AUTH */
-+
-diff -Naur dhcp-3.0.5/server/mdb.c dhcp-3.0.5-ldap/server/mdb.c
---- dhcp-3.0.5/server/mdb.c    2006-07-18 14:16:25.000000000 -0400
-+++ dhcp-3.0.5-ldap/server/mdb.c       2006-12-14 10:03:41.000000000 -0500
-@@ -375,6 +375,12 @@
- {
-       struct host_decl *foo;
-       struct hardware h;
-+      int ret;
-+
-+#if defined(LDAP_CONFIGURATION)
-+      if ((ret = find_haddr_in_ldap (hp, htype, hlen, haddr, file, line)))
-+              return ret;
++#ifdef LDAP_CONFIGURATION
++                              if (!classfound && find_subclass_in_ldap (class, &nc, &data))
++                                      classfound = 1;
 +#endif
-       h.hlen = hlen + 1;
-       h.hbuf [0] = htype;
-diff -Naur dhcp-3.0.5/server/stables.c dhcp-3.0.5-ldap/server/stables.c
---- dhcp-3.0.5/server/stables.c        2004-06-10 13:59:58.000000000 -0400
-+++ dhcp-3.0.5-ldap/server/stables.c   2007-02-23 13:13:36.000000000 -0500
-@@ -236,9 +236,86 @@
-       { "adaptive-lease-time-threshold", "B", &server_universe,  50, 1 },
-       { "do-reverse-updates", "f",            &server_universe,  51, 1 },
-       { "fqdn-reply", "f",                    &server_universe,  52, 1 },
++
++                              if (classfound) {
+ #if defined (DEBUG_CLASS_MATCHING)
+                                       log_info ("matches subclass %s.",
+                                             print_hex_1 (data.len,
+diff -up dhcp-4.0.0/server/stables.c.ldap dhcp-4.0.0/server/stables.c
+--- dhcp-4.0.0/server/stables.c.ldap   2007-11-20 08:34:37.000000000 -1000
++++ dhcp-4.0.0/server/stables.c        2008-01-22 15:09:56.000000000 -1000
+@@ -238,9 +238,107 @@ static struct option server_options[] = 
+       { "dhcpv6-lease-file-name", "t",        &server_universe,  54, 1 },
+       { "dhcpv6-pid-file-name", "t",          &server_universe,  55, 1 },
+       { "limit-addrs-per-ia", "L",            &server_universe,  56, 1 },
 +#if defined(LDAP_CONFIGURATION)
-+      { "ldap-server", "t",                           &server_universe, 53, 1 },
-+      { "ldap-port", "d",                             &server_universe, 54, 1 },
-+      { "ldap-username", "t",                         &server_universe, 55, 1 },
-+      { "ldap-password", "t",                         &server_universe, 56, 1 },
-+      { "ldap-base-dn", "t",                          &server_universe, 57, 1 },
-+      { "ldap-method", "Nldap-methods.",              &server_universe, 58, 1 },
-+      { "ldap-debug-file", "t",                       &server_universe, 59, 1 },
-+      { "ldap-dhcp-server-cn", "t",                   &server_universe, 60, 1 },
-+      { "ldap-referrals", "f",                        &server_universe, 61, 1 },
++      { "ldap-server", "t",                           &server_universe,  57, 1 },
++      { "ldap-port", "d",                                     &server_universe,  58, 1 },
++      { "ldap-username", "t",                         &server_universe,  59, 1 },
++      { "ldap-password", "t",                         &server_universe,  60, 1 },
++      { "ldap-base-dn", "t",                          &server_universe,  61, 1 },
++      { "ldap-method", "Nldap-methods.",      &server_universe,  62, 1 },
++      { "ldap-debug-file", "t",                       &server_universe,  63, 1 },
++      { "ldap-dhcp-server-cn", "t",           &server_universe,  64, 1 },
++      { "ldap-referrals", "f",                        &server_universe,  65, 1 },
 +#if defined(USE_SSL)
-+      { "ldap-ssl", "Nldap-ssl-usage.",               &server_universe, 62, 1 },
-+      { "ldap-tls-reqcert", "Nldap-tls-reqcert.",     &server_universe, 63, 1 },
-+      { "ldap-tls-ca-file", "t",                      &server_universe, 64, 1 },
-+      { "ldap-tls-ca-dir", "t",                       &server_universe, 65, 1 },
-+      { "ldap-tls-cert", "t",                         &server_universe, 66, 1 },
-+      { "ldap-tls-key", "t",                          &server_universe, 67, 1 },
-+      { "ldap-tls-crlcheck", "Nldap-tls-crlcheck.",   &server_universe, 68, 1 },
-+      { "ldap-tls-ciphers", "t",                      &server_universe, 69, 1 },
-+      { "ldap-tls-randfile", "t",                     &server_universe, 70, 1 },
++      { "ldap-ssl", "Nldap-ssl-usage.",       &server_universe,  66, 1 },
++      { "ldap-tls-reqcert", "Nldap-tls-reqcert.",     &server_universe,  67, 1 },
++      { "ldap-tls-ca-file", "t",                      &server_universe,  68, 1 },
++      { "ldap-tls-ca-dir", "t",                       &server_universe,  69, 1 },
++      { "ldap-tls-cert", "t",                         &server_universe,  70, 1 },
++      { "ldap-tls-key", "t",                          &server_universe,  71, 1 },
++      { "ldap-tls-crlcheck", "Nldap-tls-crlcheck.",   &server_universe,  72, 1 },
++      { "ldap-tls-ciphers", "t",                      &server_universe,  73, 1 },
++      { "ldap-tls-randfile", "t",                     &server_universe,  74, 1 },
++#else
++      { "unknown-66", "X",                            &server_universe,  66, 1 },
++      { "unknown-67", "X",                            &server_universe,  67, 1 },
++      { "unknown-68", "X",                            &server_universe,  68, 1 },
++      { "unknown-69", "X",                            &server_universe,  69, 1 },
++      { "unknown-70", "X",                            &server_universe,  70, 1 },
++      { "unknown-71", "X",                            &server_universe,  71, 1 },
++      { "unknown-72", "X",                            &server_universe,  72, 1 },
++      { "unknown-73", "X",                            &server_universe,  73, 1 },
++      { "unknown-74", "X",                            &server_universe,  74, 1 },
 +#endif
++#else
++      { "unknown-57", "X",                            &server_universe,  57, 1 },
++      { "unknown-58", "X",                            &server_universe,  58, 1 },
++      { "unknown-59", "X",                            &server_universe,  59, 1 },
++      { "unknown-60", "X",                            &server_universe,  60, 1 },
++      { "unknown-61", "X",                            &server_universe,  61, 1 },
++      { "unknown-62", "X",                            &server_universe,  62, 1 },
++      { "unknown-63", "X",                            &server_universe,  63, 1 },
++      { "unknown-64", "X",                            &server_universe,  64, 1 },
++      { "unknown-65", "X",                            &server_universe,  65, 1 },
 +#endif
        { NULL, NULL, NULL, 0, 0 }
  };
@@ -5619,35 +2314,36 @@ diff -Naur dhcp-3.0.5/server/stables.c dhcp-3.0.5-ldap/server/stables.c
 +
 +struct enumeration ldap_methods = {
 +      (struct enumeration *)0,
-+      "ldap-methods",
++      "ldap-methods", 1,
 +      ldap_values
 +};
 +
 +#if defined(USE_SSL)
 +struct enumeration_value ldap_ssl_usage_values [] = {
-+      { "off",       LDAP_SSL_OFF  },
-+      { "on",        LDAP_SSL_ON   },
-+      { "ldaps",     LDAP_SSL_LDAPS},
-+      { "start_tls", LDAP_SSL_TLS  },
++      { "off", LDAP_SSL_OFF },
++      { "on",LDAP_SSL_ON },
++      { "ldaps", LDAP_SSL_LDAPS },
++      { "start_tls", LDAP_SSL_TLS },
 +      { (char *) 0, 0 }
 +};
++
 +struct enumeration ldap_ssl_usage_enum = {
 +      (struct enumeration *)0,
-+      "ldap-ssl-usage",
++      "ldap-ssl-usage", 1,
 +      ldap_ssl_usage_values
 +};
 +
 +struct enumeration_value ldap_tls_reqcert_values [] = {
-+      { "never",  LDAP_OPT_X_TLS_NEVER },
-+      { "hard",   LDAP_OPT_X_TLS_HARD  },
++      { "never", LDAP_OPT_X_TLS_NEVER },
++      { "hard", LDAP_OPT_X_TLS_HARD  },
 +      { "demand", LDAP_OPT_X_TLS_DEMAND},
-+      { "allow",  LDAP_OPT_X_TLS_ALLOW },
-+      { "try",    LDAP_OPT_X_TLS_TRY   },
++      { "allow", LDAP_OPT_X_TLS_ALLOW },
++      { "try", LDAP_OPT_X_TLS_TRY   },
 +      { (char *) 0, 0 }
 +};
 +struct enumeration ldap_tls_reqcert_enum = {
 +      (struct enumeration *)0,
-+      "ldap-tls-reqcert",
++      "ldap-tls-reqcert", 1,
 +      ldap_tls_reqcert_values
 +};
 +
@@ -5659,7 +2355,7 @@ diff -Naur dhcp-3.0.5/server/stables.c dhcp-3.0.5-ldap/server/stables.c
 +};
 +struct enumeration ldap_tls_crlcheck_enum = {
 +      (struct enumeration *)0,
-+      "ldap-tls-crlcheck",
++      "ldap-tls-crlcheck", 1,
 +      ldap_tls_crlcheck_values
 +};
 +#endif
@@ -5668,10 +2364,321 @@ diff -Naur dhcp-3.0.5/server/stables.c dhcp-3.0.5-ldap/server/stables.c
  struct enumeration_value ddns_styles_values [] = {
        { "none", 0 },
        { "ad-hoc", 1 },
-diff -Naur dhcp-3.0.5/site.conf dhcp-3.0.5-ldap/site.conf
---- dhcp-3.0.5/site.conf       1999-07-07 11:20:10.000000000 -0400
-+++ dhcp-3.0.5-ldap/site.conf  2007-02-23 13:41:54.000000000 -0500
-@@ -1,2 +1,3 @@
- # Put local site configuration stuff here to override the default
- # settings in Makefile.conf
-+#COPTS = -DDEBUG_LDAP -DLDAP_CASA_AUTH -DDEBUG_CLASS_MATCHING -Wall -O -Wno-unused
+diff -up dhcp-4.0.0/dst/Makefile.am.ldap dhcp-4.0.0/dst/Makefile.am
+--- dhcp-4.0.0/dst/Makefile.am.ldap    2007-05-29 06:32:10.000000000 -1000
++++ dhcp-4.0.0/dst/Makefile.am 2008-01-22 15:09:56.000000000 -1000
+@@ -2,7 +2,12 @@ AM_CPPFLAGS = -DMINIRES_LIB -DHMAC_MD5
+ lib_LIBRARIES = libdst.a
++noinst_LIBRARIES = libdstnomd5.a
++
+ libdst_a_SOURCES = dst_support.c dst_api.c hmac_link.c md5_dgst.c \
+                  base64.c prandom.c
++libdstnomd5_a_SOURCES = dst_support.c dst_api.c hmac_link.c \
++                 base64.c prandom.c
++
+ EXTRA_DIST = dst_internal.h md5.h md5_locl.h
+diff -up dhcp-4.0.0/common/print.c.ldap dhcp-4.0.0/common/print.c
+--- dhcp-4.0.0/common/print.c.ldap     2007-10-01 04:47:35.000000000 -1000
++++ dhcp-4.0.0/common/print.c  2008-01-22 15:09:56.000000000 -1000
+@@ -163,9 +163,9 @@ char *print_base64 (const unsigned char 
+ }
+ char *print_hw_addr (htype, hlen, data)
+-      int htype;
+-      int hlen;
+-      unsigned char *data;
++      const int htype;
++      const int hlen;
++      const unsigned char *data;
+ {
+       static char habuf [49];
+       char *s;
+diff -up dhcp-4.0.0/common/conflex.c.ldap dhcp-4.0.0/common/conflex.c
+--- dhcp-4.0.0/common/conflex.c.ldap   2007-10-31 09:13:33.000000000 -1000
++++ dhcp-4.0.0/common/conflex.c        2008-01-22 15:10:31.000000000 -1000
+@@ -43,6 +43,7 @@ static enum dhcp_token read_string PROTO
+ static enum dhcp_token read_number PROTO ((int, struct parse *));
+ static enum dhcp_token read_num_or_name PROTO ((int, struct parse *));
+ static enum dhcp_token intern PROTO ((char *, enum dhcp_token));
++static int read_function PROTO ((struct parse *));
+ isc_result_t new_parse (cfile, file, inbuf, buflen, name, eolp)
+       struct parse **cfile;
+@@ -76,6 +77,10 @@ isc_result_t new_parse (cfile, file, inb
+       tmp->file = file;
+       tmp->eol_token = eolp;
++      if (file != -1) {
++              tmp -> read_function = read_function;
++      }
++
+       if (inbuf != NULL) {
+               tmp->inbuf = inbuf;
+               tmp->buflen = buflen;
+@@ -170,9 +175,13 @@ static int get_char (cfile)
+       /* My kingdom for WITH... */
+       int c;
+-      if (cfile->bufix == cfile->buflen)
+-              c = EOF;
+-      else {
++      if (cfile->bufix == cfile->buflen) {
++              if (cfile -> read_function) {
++                      c = cfile -> read_function (cfile);
++              } else {
++                      c = EOF;
++              }
++      } else {
+               c = cfile->inbuf [cfile->bufix];
+               cfile->bufix++;
+       }
+@@ -1415,3 +1424,25 @@ intern(char *atom, enum dhcp_token dfv) 
+       }
+       return dfv;
+ }
++
++static int
++read_function (struct parse * cfile)
++{
++      int c;
++
++      ssize_t n = read (cfile -> file, cfile -> inbuf, cfile -> bufsiz);
++      if (n == 0) {
++              c = EOF;
++              cfile -> bufix = 0;
++              cfile -> buflen = 0;
++      } else if (n < 0) {
++              c = EOF;
++              cfile -> bufix = cfile -> buflen = 0;
++      } else {
++              c = cfile -> inbuf [0];
++              cfile -> bufix = 1;
++              cfile -> buflen = n;
++      }
++
++      return c;
++}
+diff -up dhcp-4.0.0/includes/dhcpd.h.ldap dhcp-4.0.0/includes/dhcpd.h
+--- dhcp-4.0.0/includes/dhcpd.h.ldap   2007-12-08 09:36:00.000000000 -1000
++++ dhcp-4.0.0/includes/dhcpd.h        2008-01-22 15:09:56.000000000 -1000
+@@ -101,6 +101,11 @@ typedef time_t TIME;
+ #include <isc-dhcp/result.h>
+ #include <omapip/omapip_p.h>
++#if defined(LDAP_CONFIGURATION)
++# include <ldap.h>
++# include <sys/utsname.h> /* for uname() */
++#endif
++
+ #if !defined (BYTE_NAME_HASH_SIZE)
+ # define BYTE_NAME_HASH_SIZE  401     /* Default would be ridiculous. */
+ #endif
+@@ -290,6 +295,8 @@ struct parse {
+       size_t bufsiz;
+       struct parse *saved_state;
++
++      int (*read_function) (struct parse *);
+ };
+ /* Variable-length array of data. */
+@@ -421,6 +428,32 @@ struct hardware {
+       u_int8_t hbuf [17];
+ };
++#if defined(LDAP_CONFIGURATION)
++# define LDAP_BUFFER_SIZE             8192
++# define LDAP_METHOD_STATIC           0
++# define LDAP_METHOD_DYNAMIC  1
++#if defined (USE_SSL)
++# define LDAP_SSL_OFF                 0
++# define LDAP_SSL_ON                  1
++# define LDAP_SSL_TLS                 2
++# define LDAP_SSL_LDAPS                       3
++#endif
++
++/* This is a tree of the current configuration we are building from LDAP */
++struct ldap_config_stack {
++      LDAPMessage * res;      /* Pointer returned from ldap_search */
++      LDAPMessage * ldent;    /* Current item in LDAP that we're processing.
++                                                      in res */
++      int close_brace;        /* Put a closing } after we're through with
++                                              this item */
++      int processed;  /* We set this flag if this base item has been
++                                      processed. After this base item is processed,
++                                      we can start processing the children */
++      struct ldap_config_stack *children;
++      struct ldap_config_stack *next;
++};
++#endif
++
+ typedef enum {
+       server_startup = 0,
+       server_running = 1,
+@@ -626,6 +659,29 @@ struct lease_state {
+ # define DEFAULT_PING_TIMEOUT 1
+ #endif
++#if defined(LDAP_CONFIGURATION)
++# define SV_LDAP_SERVER                               47
++# define SV_LDAP_PORT                         48
++# define SV_LDAP_USERNAME                     49
++# define SV_LDAP_PASSWORD                     50
++# define SV_LDAP_BASE_DN                      51
++# define SV_LDAP_METHOD                               52
++# define SV_LDAP_DEBUG_FILE                   53
++# define SV_LDAP_DHCP_SERVER_CN               54
++# define SV_LDAP_REFERRALS                    55
++#if defined (USE_SSL)
++# define SV_LDAP_SSL                          56
++# define SV_LDAP_TLS_REQCERT          57
++# define SV_LDAP_TLS_CA_FILE          58
++# define SV_LDAP_TLS_CA_DIR                   59
++# define SV_LDAP_TLS_CERT                     60
++# define SV_LDAP_TLS_KEY                      61
++# define SV_LDAP_TLS_CRLCHECK         62
++# define SV_LDAP_TLS_CIPHERS          63
++# define SV_LDAP_TLS_RANDFILE         64
++#endif
++#endif
++
+ #if !defined (DEFAULT_DEFAULT_LEASE_TIME)
+ # define DEFAULT_DEFAULT_LEASE_TIME 43200
+ #endif
+@@ -2035,7 +2091,7 @@ extern int db_time_format;
+ char *quotify_string (const char *, const char *, int);
+ char *quotify_buf (const unsigned char *, unsigned, const char *, int);
+ char *print_base64 (const unsigned char *, unsigned, const char *, int);
+-char *print_hw_addr PROTO ((int, int, unsigned char *));
++char *print_hw_addr PROTO ((const int, const int, const unsigned char *));
+ void print_lease PROTO ((struct lease *));
+ void dump_raw PROTO ((const unsigned char *, unsigned));
+ void dump_packet_option (struct option_cache *, struct packet *,
+@@ -3158,6 +3214,20 @@ OMAPI_OBJECT_ALLOC_DECL (dhcp_failover_l
+ const char *binding_state_print (enum failover_state);
++/* ldap.c */
++#if defined(LDAP_CONFIGURATION)
++extern struct enumeration ldap_methods;
++#if defined (USE_SSL)
++extern struct enumeration ldap_ssl_usage_enum;
++extern struct enumeration ldap_tls_reqcert_enum;
++extern struct enumeration ldap_tls_crlcheck_enum;
++#endif
++isc_result_t ldap_read_config (void);
++int find_haddr_in_ldap (struct host_decl **, int, unsigned,
++                        const unsigned char *, const char *, int);
++int find_subclass_in_ldap (struct class *, struct class **,
++                           struct data_string *);
++#endif
+ /* mdb6.c */
+ HASH_FUNCTIONS_DECL(ia_na, unsigned char *, struct ia_na, ia_na_hash_t);
+diff -up dhcp-4.0.0/includes/site.h.ldap dhcp-4.0.0/includes/site.h
+--- dhcp-4.0.0/includes/site.h.ldap    2006-07-31 12:19:51.000000000 -1000
++++ dhcp-4.0.0/includes/site.h 2008-01-22 15:09:56.000000000 -1000
+@@ -183,3 +183,13 @@
+    traces. */
+ #define TRACING
++
++/* Define this if you want to read your config from LDAP. Read README.ldap
++   about how to set this up */
++
++#define LDAP_CONFIGURATION
++
++/* Define this if you want to enable LDAP over a SSL connection. You will need
++   to add -lcrypto -lssl to the LIBS= line of server/Makefile */
++
++#define USE_SSL
+diff -up /dev/null dhcp-4.0.0/includes/ldap_casa.h
+--- /dev/null  2008-01-19 23:52:35.158021373 -1000
++++ dhcp-4.0.0/includes/ldap_casa.h    2008-01-22 15:09:56.000000000 -1000
+@@ -0,0 +1,83 @@
++/* ldap_casa.h
++   
++   Definition for CASA modules... */
++
++/* Copyright (c) 2004 Internet Systems Consorium, Inc. ("ISC")
++ * Copyright (c) 1995-2003 Internet Software Consortium.
++ * Copyright (c) 2006 Novell, Inc.
++
++ * 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 ISC, ISC DHCP, 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 INTERNET SYSTEMS CONSORTIUM 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 ISC 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.
++
++ * This file was written by S Kalyanasundaram <skalyanasundaram@novell.com>
++ */
++
++#if defined(LDAP_CASA_AUTH)
++#ifndef __LDAP_CASA_H__
++#define __LDAP_CASA_H__
++
++#include <micasa_mgmd.h>
++#include <dlfcn.h>
++#include <string.h>
++
++#define MICASA_LIB     "libmicasa.so.1"
++
++SSCS_TYPEDEF_LIBCALL(int, CASA_GetCredential_T)
++(
++       uint32_t            ssFlags,
++       SSCS_SECRET_ID_T   *appSecretID,
++       SSCS_SECRET_ID_T   *sharedSecretID,
++       uint32_t           *credentialType,
++       void               *credential,
++       SSCS_EXT_T         *ext 
++);
++SSCS_TYPEDEF_LIBCALL(int, CASA_SetCredential_T)
++(
++       uint32_t            ssFlags,
++       SSCS_SECRET_ID_T   *appSecretID,
++       SSCS_SECRET_ID_T   *sharedSecretID,
++       uint32_t            credentialType,
++       void               *credential,
++       SSCS_EXT_T         *ext
++);
++
++SSCS_TYPEDEF_LIBCALL(int, CASA_RemoveCredential_T)
++(
++       uint32_t            ssFlags,
++       SSCS_SECRET_ID_T   *appSecretID,
++       SSCS_SECRET_ID_T   *sharedSecretID,
++       SSCS_EXT_T         *ext
++);
++static CASA_GetCredential_T            p_miCASAGetCredential = NULL;
++static CASA_SetCredential_T            p_miCASASetCredential = NULL;
++static CASA_RemoveCredential_T         p_miCASARemoveCredential = NULL;
++static void                            *casaIDK = NULL;
++
++int load_casa(void);
++static void release_casa(void);
++int load_uname_pwd_from_miCASA(char **, char **);
++
++#endif /* __LDAP_CASA_H__ */
++#endif /* LDAP_CASA_AUTH */
++
index 7619a2f0423d31424d10dc1626f68844a24afe54..dcbefe16375a7df693bc5b277b50334f6045370e 100644 (file)
@@ -1,21 +1,89 @@
-diff -up dhcp-3.1.0/omapip/dispatch.c.libdhcp4client dhcp-3.1.0/omapip/dispatch.c
---- dhcp-3.1.0/omapip/dispatch.c.libdhcp4client        2005-03-17 15:15:21.000000000 -0500
-+++ dhcp-3.1.0/omapip/dispatch.c       2007-10-24 14:55:56.000000000 -0400
-@@ -34,7 +34,7 @@
+diff -up dhcp-4.0.0/configure.ac.libdhcp4client dhcp-4.0.0/configure.ac
+--- dhcp-4.0.0/configure.ac.libdhcp4client     2007-12-14 08:24:56.000000000 -1000
++++ dhcp-4.0.0/configure.ac    2008-01-22 17:04:28.000000000 -1000
+@@ -1,5 +1,32 @@
+ AC_INIT([DHCP], [4.0.0], [dhcp-users@isc.org])
++dnl Versioning
++dnl (from glib's configure.in ...)
++dnl Making releases:
++dnl     DHCP_MICRO_VERSION += 1;
++dnl     DHCP_INTERFACE_AGE += 1;
++dnl     DHCP_BINARY_AGE += 1;
++dnl if any functions have been added, set DHCP_INTERFACE_AGE to 0.
++dnl if backwards compatibility has been broken (e.g., functions removed,
++dnl function signatures changed),
++dnl set DHCP_BINARY_AGE and DHCP_INTERFACE_AGE to 0.
++DHCP_MAJOR_VERSION=4
++DHCP_MINOR_VERSION=0
++DHCP_MICRO_VERSION=0
++DHCP_INTERFACE_AGE=0
++DHCP_BINARY_AGE=0
++DHCP_VERSION_SUFFIX=
++DHCP_VERSION=$DHCP_MAJOR_VERSION.$DHCP_MINOR_VERSION.$DHCP_MICRO_VERSION$DHCP_VERSION_SUFFIX
++
++LT_RELEASE=$DHCP_MAJOR_VERSION.$DHCP_MINOR_VERSION
++LT_CURRENT=`expr $DHCP_MICRO_VERSION - $DHCP_INTERFACE_AGE`
++LT_REVISION=$DHCP_INTERFACE_AGE
++AC_SUBST(DHCP_VERSION)
++AC_SUBST(LT_RELEASE)
++AC_SUBST(LT_CURRENT)
++AC_SUBST(LT_REVISION)
++AC_SUBST(LT_AGE)
++
+ # we specify "foreign" to avoid having to have the GNU mandated files,
+ # like AUTHORS, COPYING, and such
+ AM_INIT_AUTOMAKE([foreign])
+@@ -20,7 +47,8 @@ if test "$GCC" = "yes"; then
+       fi
+ fi
  
+-AC_PROG_RANLIB
++AC_PROG_LIBTOOL
++
+ AC_CONFIG_HEADERS([includes/config.h])
+ # we sometimes need to know byte order for building packets
+diff -up dhcp-4.0.0/omapip/Makefile.am.libdhcp4client dhcp-4.0.0/omapip/Makefile.am
+--- dhcp-4.0.0/omapip/Makefile.am.libdhcp4client       2007-05-29 06:32:11.000000000 -1000
++++ dhcp-4.0.0/omapip/Makefile.am      2008-01-22 17:04:28.000000000 -1000
+@@ -1,10 +1,18 @@
+ lib_LIBRARIES = libomapi.a
++noinst_LIBRARIES = libomapiLIBDHCP.a
+ noinst_PROGRAMS = svtest
+ libomapi_a_SOURCES = protocol.c buffer.c alloc.c result.c connection.c \
+                    errwarn.c listener.c dispatch.c generic.c support.c \
+                    handle.c message.c convert.c hash.c auth.c inet_addr.c \
+                    array.c trace.c mrtrace.c toisc.c iscprint.c
++
++libomapiLIBDHCP_a_CFLAGS = -DLIBDHCP
++libomapiLIBDHCP_a_SOURCES = alloc.c array.c auth.c buffer.c connection.c \
++                   convert.c dispatch.c errwarn.c handle.c hash.c listener.c \
++                   mrtrace.c result.c support.c toisc.c trace.c generic.c message.c \
++                   protocol.c
++
+ man_MANS = omapi.3
+ EXTRA_DIST = $(man_MANS)
+diff -up dhcp-4.0.0/omapip/dispatch.c.libdhcp4client dhcp-4.0.0/omapip/dispatch.c
+--- dhcp-4.0.0/omapip/dispatch.c.libdhcp4client        2007-11-30 11:51:43.000000000 -1000
++++ dhcp-4.0.0/omapip/dispatch.c       2008-01-22 17:04:28.000000000 -1000
+@@ -37,7 +37,7 @@
  #include <omapip/omapip_p.h>
+ #include <sys/time.h>
  
 -static omapi_io_object_t omapi_io_states;
 +omapi_io_object_t omapi_io_states;
TIME cur_time;
time_t cur_time;
  
  OMAPI_OBJECT_ALLOC (omapi_io,
-diff -up dhcp-3.1.0/omapip/errwarn.c.libdhcp4client dhcp-3.1.0/omapip/errwarn.c
---- dhcp-3.1.0/omapip/errwarn.c.libdhcp4client 2007-10-24 14:55:56.000000000 -0400
-+++ dhcp-3.1.0/omapip/errwarn.c        2007-10-24 14:57:16.000000000 -0400
-@@ -39,6 +39,11 @@ static char copyright[] =
- #include <omapip/omapip_p.h>
+diff -up dhcp-4.0.0/omapip/errwarn.c.libdhcp4client dhcp-4.0.0/omapip/errwarn.c
+--- dhcp-4.0.0/omapip/errwarn.c.libdhcp4client 2008-01-22 17:04:28.000000000 -1000
++++ dhcp-4.0.0/omapip/errwarn.c        2008-01-22 17:04:28.000000000 -1000
+@@ -37,6 +37,11 @@
  #include <errno.h>
+ #include <syslog.h>
  
 +#ifdef LIBDHCP
 +#include <isc-dhcp/libdhcp_control.h>
@@ -25,7 +93,7 @@ diff -up dhcp-3.1.0/omapip/errwarn.c.libdhcp4client dhcp-3.1.0/omapip/errwarn.c
  #ifdef DEBUG
  int log_perror = -1;
  #else
-@@ -48,7 +53,9 @@ int log_priority;
+@@ -46,7 +51,9 @@ int log_priority;
  void (*log_cleanup) (void);
  
  #define CVT_BUF_MAX 1023
@@ -35,7 +103,7 @@ diff -up dhcp-3.1.0/omapip/errwarn.c.libdhcp4client dhcp-3.1.0/omapip/errwarn.c
  static char fbuf [CVT_BUF_MAX + 1];
  
  /* Log an error message, then exit... */
-@@ -58,6 +65,16 @@ void log_fatal (const char * fmt, ... )
+@@ -56,6 +63,16 @@ void log_fatal (const char * fmt, ... )
    va_list list;
  
    do_percentm (fbuf, fmt);
@@ -52,7 +120,7 @@ diff -up dhcp-3.1.0/omapip/errwarn.c.libdhcp4client dhcp-3.1.0/omapip/errwarn.c
  
    /* %Audit% This is log output. %2004.06.17,Safe%
     * If we truncate we hope the user can get a hint from the log.
-@@ -91,6 +108,7 @@ void log_fatal (const char * fmt, ... )
+@@ -89,6 +106,7 @@ void log_fatal (const char * fmt, ... )
    if (log_cleanup)
          (*log_cleanup) ();
    exit (1);
@@ -60,7 +128,7 @@ diff -up dhcp-3.1.0/omapip/errwarn.c.libdhcp4client dhcp-3.1.0/omapip/errwarn.c
  }
  
  /* Log an error message... */
-@@ -101,6 +119,13 @@ int log_error (const char * fmt, ...)
+@@ -99,6 +117,13 @@ int log_error (const char * fmt, ...)
  
    do_percentm (fbuf, fmt);
  
@@ -74,7 +142,7 @@ diff -up dhcp-3.1.0/omapip/errwarn.c.libdhcp4client dhcp-3.1.0/omapip/errwarn.c
    /* %Audit% This is log output. %2004.06.17,Safe%
     * If we truncate we hope the user can get a hint from the log.
     */
-@@ -116,7 +141,7 @@ int log_error (const char * fmt, ...)
+@@ -114,7 +139,7 @@ int log_error (const char * fmt, ...)
          write (STDERR_FILENO, mbuf, strlen (mbuf));
          write (STDERR_FILENO, "\n", 1);
    }
@@ -83,7 +151,7 @@ diff -up dhcp-3.1.0/omapip/errwarn.c.libdhcp4client dhcp-3.1.0/omapip/errwarn.c
    return 0;
  }
  
-@@ -128,6 +153,13 @@ int log_info (const char *fmt, ...)
+@@ -126,6 +151,13 @@ int log_info (const char *fmt, ...)
  
    do_percentm (fbuf, fmt);
  
@@ -97,7 +165,7 @@ diff -up dhcp-3.1.0/omapip/errwarn.c.libdhcp4client dhcp-3.1.0/omapip/errwarn.c
    /* %Audit% This is log output. %2004.06.17,Safe%
     * If we truncate we hope the user can get a hint from the log.
     */
-@@ -143,7 +175,7 @@ int log_info (const char *fmt, ...)
+@@ -141,7 +173,7 @@ int log_info (const char *fmt, ...)
          write (STDERR_FILENO, mbuf, strlen (mbuf));
          write (STDERR_FILENO, "\n", 1);
    }
@@ -106,7 +174,7 @@ diff -up dhcp-3.1.0/omapip/errwarn.c.libdhcp4client dhcp-3.1.0/omapip/errwarn.c
    return 0;
  }
  
-@@ -154,7 +186,13 @@ int log_debug (const char *fmt, ...)
+@@ -152,7 +184,13 @@ int log_debug (const char *fmt, ...)
    va_list list;
  
    do_percentm (fbuf, fmt);
@@ -121,7 +189,7 @@ diff -up dhcp-3.1.0/omapip/errwarn.c.libdhcp4client dhcp-3.1.0/omapip/errwarn.c
    /* %Audit% This is log output. %2004.06.17,Safe%
     * If we truncate we hope the user can get a hint from the log.
     */
-@@ -170,7 +208,7 @@ int log_debug (const char *fmt, ...)
+@@ -168,7 +206,7 @@ int log_debug (const char *fmt, ...)
          write (STDERR_FILENO, mbuf, strlen (mbuf));
          write (STDERR_FILENO, "\n", 1);
    }
@@ -130,10 +198,10 @@ diff -up dhcp-3.1.0/omapip/errwarn.c.libdhcp4client dhcp-3.1.0/omapip/errwarn.c
    return 0;
  }
  
-diff -up dhcp-3.1.0/omapip/alloc.c.libdhcp4client dhcp-3.1.0/omapip/alloc.c
---- dhcp-3.1.0/omapip/alloc.c.libdhcp4client   2006-02-24 18:16:30.000000000 -0500
-+++ dhcp-3.1.0/omapip/alloc.c  2007-10-24 14:55:56.000000000 -0400
-@@ -40,6 +40,33 @@ static char copyright[] =
+diff -up dhcp-4.0.0/omapip/alloc.c.libdhcp4client dhcp-4.0.0/omapip/alloc.c
+--- dhcp-4.0.0/omapip/alloc.c.libdhcp4client   2007-07-12 20:43:42.000000000 -1000
++++ dhcp-4.0.0/omapip/alloc.c  2008-01-22 17:04:28.000000000 -1000
+@@ -37,6 +37,33 @@
  
  #include <omapip/omapip_p.h>
  
@@ -167,8 +235,8 @@ diff -up dhcp-3.1.0/omapip/alloc.c.libdhcp4client dhcp-3.1.0/omapip/alloc.c
  #if defined (DEBUG_MEMORY_LEAKAGE) || defined (DEBUG_MALLOC_POOL) || \
                defined (DEBUG_MEMORY_LEAKAGE_ON_EXIT)
  struct dmalloc_preamble *dmalloc_list;
-@@ -78,7 +105,9 @@ VOIDPTR dmalloc (size, file, line)
-               return (VOIDPTR)0;
+@@ -72,7 +99,9 @@ dmalloc(unsigned size, const char *file,
+               return NULL;
  
        foo = malloc(len);
 -
@@ -176,9 +244,9 @@ diff -up dhcp-3.1.0/omapip/alloc.c.libdhcp4client dhcp-3.1.0/omapip/alloc.c
 +      record_pointer(foo);
 +#endif
        if (!foo)
-               return (VOIDPTR)0;
-       bar = (VOIDPTR)(foo + DMDOFFSET);
-@@ -200,6 +229,9 @@ void dfree (ptr, file, line)
+               return NULL;
+       bar = (void *)(foo + DMDOFFSET);
+@@ -191,6 +220,9 @@ dfree(void *ptr, const char *file, int l
                     0, (unsigned char *)ptr + DMDOFFSET, 0, 1, RC_MALLOC);
  #endif
        free (ptr);
@@ -188,22 +256,31 @@ diff -up dhcp-3.1.0/omapip/alloc.c.libdhcp4client dhcp-3.1.0/omapip/alloc.c
  }
  
  #if defined (DEBUG_MEMORY_LEAKAGE) || defined (DEBUG_MALLOC_POOL) || \
-diff -up dhcp-3.1.0/configure.libdhcp4client dhcp-3.1.0/configure
---- dhcp-3.1.0/configure.libdhcp4client        2005-03-17 15:14:55.000000000 -0500
-+++ dhcp-3.1.0/configure       2007-10-24 14:55:56.000000000 -0400
-@@ -246,7 +246,7 @@ if [ ! -d $workname ]; then
- fi
+diff -up dhcp-4.0.0/dst/Makefile.am.libdhcp4client dhcp-4.0.0/dst/Makefile.am
+--- dhcp-4.0.0/dst/Makefile.am.libdhcp4client  2008-01-22 17:04:28.000000000 -1000
++++ dhcp-4.0.0/dst/Makefile.am 2008-01-22 17:04:28.000000000 -1000
+@@ -2,7 +2,7 @@ AM_CPPFLAGS = -DMINIRES_LIB -DHMAC_MD5
  
- if [ x"$dirs" = x ]; then
--  dirs=". client server relay common omapip dhcpctl minires dst"
-+  dirs=". client server relay common omapip dhcpctl minires dst libdhcp4client"
- fi
+ lib_LIBRARIES = libdst.a
+-noinst_LIBRARIES = libdstnomd5.a
++noinst_LIBRARIES = libdstnomd5.a libdstLIBDHCP.a
  
- for foo in $dirs; do
-diff -up dhcp-3.1.0/dst/hmac_link.c.libdhcp4client dhcp-3.1.0/dst/hmac_link.c
---- dhcp-3.1.0/dst/hmac_link.c.libdhcp4client  2001-02-22 02:22:08.000000000 -0500
-+++ dhcp-3.1.0/dst/hmac_link.c 2007-10-24 14:55:56.000000000 -0400
-@@ -38,6 +38,10 @@ static const char rcsid[] = "$Header: /p
+ libdst_a_SOURCES = dst_support.c dst_api.c hmac_link.c md5_dgst.c \
+                  base64.c prandom.c
+@@ -10,4 +10,8 @@ libdst_a_SOURCES = dst_support.c dst_api
+ libdstnomd5_a_SOURCES = dst_support.c dst_api.c hmac_link.c \
+                  base64.c prandom.c
++libdstLIBDHCP_a_CFLAGS = -DLIBDHCP
++libdstLIBDHCP_a_SOURCES = dst_support.c dst_api.c hmac_link.c md5_dgst.c \
++                 base64.c prandom.c
++
+ EXTRA_DIST = dst_internal.h md5.h md5_locl.h
+diff -up dhcp-4.0.0/dst/hmac_link.c.libdhcp4client dhcp-4.0.0/dst/hmac_link.c
+--- dhcp-4.0.0/dst/hmac_link.c.libdhcp4client  2007-12-05 14:50:22.000000000 -1000
++++ dhcp-4.0.0/dst/hmac_link.c 2008-01-22 17:04:28.000000000 -1000
+@@ -39,6 +39,10 @@ static const char rcsid[] = "$Header: /p
  
  #include "dst_internal.h"
  
@@ -214,7 +291,7 @@ diff -up dhcp-3.1.0/dst/hmac_link.c.libdhcp4client dhcp-3.1.0/dst/hmac_link.c
  #ifdef USE_MD5
  # include "md5.h"
  # ifndef _MD5_H_
-@@ -86,7 +90,11 @@ dst_hmac_md5_sign(const int mode, DST_KE
+@@ -87,7 +91,11 @@ dst_hmac_md5_sign(const int mode, DST_KE
        MD5_CTX *ctx = NULL;
  
        if (mode & SIG_MODE_INIT) 
@@ -226,7 +303,7 @@ diff -up dhcp-3.1.0/dst/hmac_link.c.libdhcp4client dhcp-3.1.0/dst/hmac_link.c
        else if (context)
                ctx = (MD5_CTX *) *context;
        if (ctx == NULL) 
-@@ -153,7 +161,11 @@ dst_hmac_md5_verify(const int mode, DST_
+@@ -154,7 +162,11 @@ dst_hmac_md5_verify(const int mode, DST_
        MD5_CTX *ctx = NULL;
  
        if (mode & SIG_MODE_INIT) 
@@ -238,7 +315,7 @@ diff -up dhcp-3.1.0/dst/hmac_link.c.libdhcp4client dhcp-3.1.0/dst/hmac_link.c
        else if (context)
                ctx = (MD5_CTX *) *context;
        if (ctx == NULL) 
-@@ -217,8 +229,11 @@ dst_buffer_to_hmac_md5(DST_KEY *dkey, co
+@@ -218,8 +230,11 @@ dst_buffer_to_hmac_md5(DST_KEY *dkey, co
  
        if (dkey == NULL || key == NULL || keylen < 0)
                return (-1);
@@ -251,7 +328,7 @@ diff -up dhcp-3.1.0/dst/hmac_link.c.libdhcp4client dhcp-3.1.0/dst/hmac_link.c
                  return (-2);
  
        memset(hkey->hk_ipad, 0, sizeof(hkey->hk_ipad));
-@@ -347,7 +362,11 @@ dst_hmac_md5_key_from_file_format(DST_KE
+@@ -348,7 +363,11 @@ dst_hmac_md5_key_from_file_format(DST_KE
        if (eol == NULL)
                return (-4);
        len = eol - p;
@@ -263,7 +340,7 @@ diff -up dhcp-3.1.0/dst/hmac_link.c.libdhcp4client dhcp-3.1.0/dst/hmac_link.c
        memcpy(tmp, p, len);
        *(tmp + len) = 0x0;
        key_len = b64_pton((char *)tmp, key, HMAC_LEN+1);       /* see above */
-@@ -439,8 +458,11 @@ dst_hmac_md5_generate_key(DST_KEY *key, 
+@@ -440,8 +459,11 @@ dst_hmac_md5_generate_key(DST_KEY *key, 
                return(0);
        
        len = size > 64 ? 64 : size;
@@ -276,7 +353,7 @@ diff -up dhcp-3.1.0/dst/hmac_link.c.libdhcp4client dhcp-3.1.0/dst/hmac_link.c
        n = dst_random(DST_RAND_SEMI, len, buff);
        n += dst_random(DST_RAND_KEY, len, buff);
        if (n <= len) { /* failed getting anything */
-@@ -463,7 +485,11 @@ dst_hmac_md5_init()
+@@ -464,7 +486,11 @@ dst_hmac_md5_init()
  {
        if (dst_t_func[KEY_HMAC_MD5] != NULL)
                return (1);
@@ -288,10 +365,32 @@ diff -up dhcp-3.1.0/dst/hmac_link.c.libdhcp4client dhcp-3.1.0/dst/hmac_link.c
        if (dst_t_func[KEY_HMAC_MD5] == NULL)
                return (0);
        memset(dst_t_func[KEY_HMAC_MD5], 0, sizeof(struct dst_func));
-diff -up dhcp-3.1.0/common/discover.c.libdhcp4client dhcp-3.1.0/common/discover.c
---- dhcp-3.1.0/common/discover.c.libdhcp4client        2006-11-07 18:41:39.000000000 -0500
-+++ dhcp-3.1.0/common/discover.c       2007-10-24 14:55:56.000000000 -0400
-@@ -121,6 +121,10 @@ isc_result_t interface_initialize (omapi
+diff -up dhcp-4.0.0/common/Makefile.am.libdhcp4client dhcp-4.0.0/common/Makefile.am
+--- dhcp-4.0.0/common/Makefile.am.libdhcp4client       2007-11-16 01:04:11.000000000 -1000
++++ dhcp-4.0.0/common/Makefile.am      2008-01-22 17:04:28.000000000 -1000
+@@ -1,11 +1,17 @@
+ AM_CPPFLAGS = -I.. -DLOCALSTATEDIR='"@localstatedir@"'
+-noinst_LIBRARIES = libdhcp.a
++noinst_LIBRARIES = libdhcp.a libdhcpLIBDHCP.a
+ libdhcp_a_SOURCES = alloc.c bpf.c comapi.c conflex.c ctrace.c discover.c \
+                   dispatch.c dlpi.c dns.c ethernet.c execute.c fddi.c \
+                   icmp.c inet.c lpf.c memory.c nit.c options.c packet.c \
+                   parse.c print.c raw.c resolv.c socket.c tables.c tr.c \
+                   tree.c upf.c heap.c
++libdhcpLIBDHCP_a_CFLAGS = -DLIBDHCP
++libdhcpLIBDHCP_a_SOURCES = alloc.c bpf.c comapi.c conflex.c ctrace.c \
++                  discover.c dispatch.c dlpi.c dns.c ethernet.c \
++                  execute.c inet.c lpf.c memory.c nit.c options.c \
++                  packet.c parse.c print.c resolv.c socket.c \
++                  tables.c tr.c tree.c upf.c
+ man_MANS = dhcp-eval.5 dhcp-options.5
+ EXTRA_DIST = $(man_MANS)
+diff -up dhcp-4.0.0/common/discover.c.libdhcp4client dhcp-4.0.0/common/discover.c
+--- dhcp-4.0.0/common/discover.c.libdhcp4client        2007-10-05 12:29:51.000000000 -1000
++++ dhcp-4.0.0/common/discover.c       2008-01-22 17:04:28.000000000 -1000
+@@ -883,6 +883,10 @@ add_ipv6_addr_to_interface(struct interf
     register that interface with the network I/O software, figure out what
     subnet it's on, and add it to the list of interfaces. */
  
@@ -299,50 +398,50 @@ diff -up dhcp-3.1.0/common/discover.c.libdhcp4client dhcp-3.1.0/common/discover.
 +int have_setup_fallback = 0;
 +#endif
 +
- void discover_interfaces (state)
-       int state;
- {
-@@ -141,7 +145,9 @@ void discover_interfaces (state)
-       char *s;
- #endif
+ void 
+ discover_interfaces(int state) {
+       struct iface_conf_list ifaces;
+@@ -902,7 +906,9 @@ discover_interfaces(int state) {
        isc_result_t status;
+       int wifcount = 0;
 +#ifndef LIBDHCP
        static int setup_fallback = 0;
 +#endif
-       int wifcount = 0;
  
-       /* Create an unbound datagram socket to do the SIOCGIFADDR ioctl on. */
-@@ -695,10 +701,17 @@ void discover_interfaces (state)
+       if (!begin_iface_scan(&ifaces)) {
+               log_fatal("Can't get list of interfaces.");
+@@ -1242,10 +1248,17 @@ discover_interfaces(int state) {
                log_fatal ("Not configured to listen on any interfaces!");
        }
  
 +#ifdef LIBDHCP
-+      if (!have_setup_fallback) {
++      if ((local_family == AF_INET) && !have_setup_fallback) {
 +              have_setup_fallback = 1;
 +              maybe_setup_fallback ();
 +      }
 +#else
-       if (!setup_fallback) {
+       if ((local_family == AF_INET) && !setup_fallback) {
                setup_fallback = 1;
-               maybe_setup_fallback ();
+               maybe_setup_fallback();
        }
 +#endif
  
- #if defined (HAVE_SETFD)
+ #if defined (F_SETFD)
        if (fallback_interface) {
-diff -up dhcp-3.1.0/common/tree.c.libdhcp4client dhcp-3.1.0/common/tree.c
---- dhcp-3.1.0/common/tree.c.libdhcp4client    2007-02-14 17:41:22.000000000 -0500
-+++ dhcp-3.1.0/common/tree.c   2007-10-24 14:55:56.000000000 -0400
-@@ -41,7 +41,7 @@ static char copyright[] =
- #include <omapip/omapip_p.h>
- #include <ctype.h>
+diff -up dhcp-4.0.0/common/tree.c.libdhcp4client dhcp-4.0.0/common/tree.c
+--- dhcp-4.0.0/common/tree.c.libdhcp4client    2007-08-22 03:41:37.000000000 -1000
++++ dhcp-4.0.0/common/tree.c   2008-01-22 17:04:28.000000000 -1000
+@@ -41,7 +41,7 @@
+ # include <regex.h>
+ #endif
  
 -struct binding_scope *global_scope;
 +struct binding_scope __attribute__ ((visibility ("default"))) *global_scope;
  
  static int do_host_lookup PROTO ((struct data_string *,
                                  struct dns_host_entry *));
-@@ -2761,6 +2761,7 @@ int evaluate_numeric_expression (result,
+@@ -2859,6 +2859,7 @@ int evaluate_numeric_expression (result,
     result of that evaluation.   There should never be both an expression
     and a valid data_string. */
  
@@ -350,21 +449,21 @@ diff -up dhcp-3.1.0/common/tree.c.libdhcp4client dhcp-3.1.0/common/tree.c
  int evaluate_option_cache (result, packet, lease, client_state,
                           in_options, cfg_options, scope, oc, file, line)
        struct data_string *result;
-diff -up dhcp-3.1.0/common/options.c.libdhcp4client dhcp-3.1.0/common/options.c
---- dhcp-3.1.0/common/options.c.libdhcp4client 2007-05-23 15:26:22.000000000 -0400
-+++ dhcp-3.1.0/common/options.c        2007-10-24 14:55:56.000000000 -0400
-@@ -2501,6 +2501,7 @@ int fqdn_option_space_encapsulate (resul
-       return 1;
+diff -up dhcp-4.0.0/common/options.c.libdhcp4client dhcp-4.0.0/common/options.c
+--- dhcp-4.0.0/common/options.c.libdhcp4client 2007-11-30 11:51:43.000000000 -1000
++++ dhcp-4.0.0/common/options.c        2008-01-22 17:04:28.000000000 -1000
+@@ -3392,6 +3392,7 @@ fqdn6_universe_decode(struct option_stat
+       return 0;
  }
  
 +__attribute__ ((visibility ("default")))
  void option_space_foreach (struct packet *packet, struct lease *lease,
                           struct client_state *client_state,
                           struct option_state *in_options,
-diff -up dhcp-3.1.0/common/dispatch.c.libdhcp4client dhcp-3.1.0/common/dispatch.c
---- dhcp-3.1.0/common/dispatch.c.libdhcp4client        2007-10-24 14:55:56.000000000 -0400
-+++ dhcp-3.1.0/common/dispatch.c       2007-10-24 14:55:56.000000000 -0400
-@@ -39,8 +39,24 @@ static char copyright[] =
+diff -up dhcp-4.0.0/common/dispatch.c.libdhcp4client dhcp-4.0.0/common/dispatch.c
+--- dhcp-4.0.0/common/dispatch.c.libdhcp4client        2008-01-22 17:04:28.000000000 -1000
++++ dhcp-4.0.0/common/dispatch.c       2008-01-22 17:04:28.000000000 -1000
+@@ -34,8 +34,24 @@
  
  #include "dhcpd.h"
  
@@ -391,7 +490,7 @@ diff -up dhcp-3.1.0/common/dispatch.c.libdhcp4client dhcp-3.1.0/common/dispatch.
  
  void set_time(TIME t)
  {
-@@ -53,9 +69,41 @@ void set_time(TIME t)
+@@ -48,9 +64,41 @@ void set_time(TIME t)
  
  struct timeval *process_outstanding_timeouts (struct timeval *tvp)
  {
@@ -433,7 +532,7 @@ diff -up dhcp-3.1.0/common/dispatch.c.libdhcp4client dhcp-3.1.0/common/dispatch.
        another:
        if (timeouts) {
                struct timeout *t;
-@@ -73,9 +121,15 @@ struct timeval *process_outstanding_time
+@@ -68,9 +116,15 @@ struct timeval *process_outstanding_time
                        tvp -> tv_sec = timeouts -> when;
                        tvp -> tv_usec = 0;
                }
@@ -449,7 +548,7 @@ diff -up dhcp-3.1.0/common/dispatch.c.libdhcp4client dhcp-3.1.0/common/dispatch.
  }
  
  /* Wait for packets to come in using select().   When one does, call
-@@ -104,13 +158,28 @@ void add_timeout (when, where, what, ref
+@@ -99,13 +153,28 @@ void add_timeout (when, where, what, ref
        tvref_t ref;
        tvunref_t unref;
  {
@@ -480,7 +579,7 @@ diff -up dhcp-3.1.0/common/dispatch.c.libdhcp4client dhcp-3.1.0/common/dispatch.
                        if (t)
                                t -> next = q -> next;
                        else
-@@ -119,7 +188,29 @@ void add_timeout (when, where, what, ref
+@@ -114,7 +183,29 @@ void add_timeout (when, where, what, ref
                }
                t = q;
        }
@@ -510,7 +609,7 @@ diff -up dhcp-3.1.0/common/dispatch.c.libdhcp4client dhcp-3.1.0/common/dispatch.
        /* If we didn't supersede a timeout, allocate a timeout
           structure now. */
        if (!q) {
-@@ -128,7 +219,7 @@ void add_timeout (when, where, what, ref
+@@ -123,7 +214,7 @@ void add_timeout (when, where, what, ref
                        free_timeouts = q -> next;
                } else {
                        q = ((struct timeout *)
@@ -519,7 +618,7 @@ diff -up dhcp-3.1.0/common/dispatch.c.libdhcp4client dhcp-3.1.0/common/dispatch.
                        if (!q)
                                log_fatal ("add_timeout: no memory!");
                }
-@@ -158,22 +249,76 @@ void add_timeout (when, where, what, ref
+@@ -153,22 +244,76 @@ void add_timeout (when, where, what, ref
                if (t -> next -> when > q -> when) {
                        q -> next = t -> next;
                        t -> next = q;
@@ -596,7 +695,7 @@ diff -up dhcp-3.1.0/common/dispatch.c.libdhcp4client dhcp-3.1.0/common/dispatch.
        t = (struct timeout *)0;
        for (q = timeouts; q; q = q -> next) {
                if (q -> func == where && q -> what == what) {
-@@ -193,10 +338,15 @@ void cancel_timeout (where, what)
+@@ -188,10 +333,15 @@ void cancel_timeout (where, what)
                q -> next = free_timeouts;
                free_timeouts = q;
        }
@@ -612,7 +711,7 @@ diff -up dhcp-3.1.0/common/dispatch.c.libdhcp4client dhcp-3.1.0/common/dispatch.
        struct timeout *t, *n;
        for (t = timeouts; t; t = n) {
                n = t -> next;
-@@ -205,13 +355,20 @@ void cancel_all_timeouts ()
+@@ -200,13 +350,20 @@ void cancel_all_timeouts ()
                t -> next = free_timeouts;
                free_timeouts = t;
        }
@@ -633,10 +732,10 @@ diff -up dhcp-3.1.0/common/dispatch.c.libdhcp4client dhcp-3.1.0/common/dispatch.
        }
 +#endif
  }
-diff -up dhcp-3.1.0/common/alloc.c.libdhcp4client dhcp-3.1.0/common/alloc.c
---- dhcp-3.1.0/common/alloc.c.libdhcp4client   2006-06-01 16:23:17.000000000 -0400
-+++ dhcp-3.1.0/common/alloc.c  2007-10-24 14:55:56.000000000 -0400
-@@ -1013,7 +1013,11 @@ int executable_statement_reference (ptr,
+diff -up dhcp-4.0.0/common/alloc.c.libdhcp4client dhcp-4.0.0/common/alloc.c
+--- dhcp-4.0.0/common/alloc.c.libdhcp4client   2007-10-23 14:54:11.000000000 -1000
++++ dhcp-4.0.0/common/alloc.c  2008-01-22 17:04:28.000000000 -1000
+@@ -1004,7 +1004,11 @@ int executable_statement_reference (ptr,
        return 1;
  }
  
@@ -648,10 +747,10 @@ diff -up dhcp-3.1.0/common/alloc.c.libdhcp4client dhcp-3.1.0/common/alloc.c
  
  #if defined (DEBUG_MEMORY_LEAKAGE) || \
                defined (DEBUG_MEMORY_LEAKAGE_ON_EXIT)
-diff -up dhcp-3.1.0/includes/dhcpd.h.libdhcp4client dhcp-3.1.0/includes/dhcpd.h
---- dhcp-3.1.0/includes/dhcpd.h.libdhcp4client 2007-10-24 14:55:56.000000000 -0400
-+++ dhcp-3.1.0/includes/dhcpd.h        2007-10-24 14:55:56.000000000 -0400
-@@ -1000,14 +1000,6 @@ struct hardware_link {
+diff -up dhcp-4.0.0/includes/dhcpd.h.libdhcp4client dhcp-4.0.0/includes/dhcpd.h
+--- dhcp-4.0.0/includes/dhcpd.h.libdhcp4client 2008-01-22 17:04:28.000000000 -1000
++++ dhcp-4.0.0/includes/dhcpd.h        2008-01-22 17:05:02.000000000 -1000
+@@ -1199,14 +1199,6 @@ struct hardware_link {
  
  typedef void (*tvref_t)(void *, void *, const char *, int);
  typedef void (*tvunref_t)(void *, const char *, int);
@@ -666,19 +765,60 @@ diff -up dhcp-3.1.0/includes/dhcpd.h.libdhcp4client dhcp-3.1.0/includes/dhcpd.h
  
  struct protocol {
        struct protocol *next;
-@@ -1960,7 +1952,6 @@ extern void (*bootp_packet_handler) PROT
-                                           struct dhcp_packet *, unsigned,
-                                           unsigned int,
-                                           struct iaddr, struct hardware *));
+@@ -1664,7 +1656,6 @@ extern const char *path_dhcpd_pid;
+ extern int dhcp_max_agent_option_packet_length;
+-int main(int, char **);
+ void postconf_initialization(int);
+ void postdb_startup(void);
+ void cleanup PROTO ((void));
+@@ -2337,7 +2328,6 @@ extern void (*bootp_packet_handler) PROT
+ extern void (*dhcpv6_packet_handler)(struct interface_info *,
+                                    const char *, int,
+                                    int, const struct iaddr *, isc_boolean_t);
 -extern struct timeout *timeouts;
  extern omapi_object_type_t *dhcp_type_interface;
  #if defined (TRACING)
- trace_type_t *interface_trace;
-diff -up dhcp-3.1.0/client/dhclient.c.libdhcp4client dhcp-3.1.0/client/dhclient.c
---- dhcp-3.1.0/client/dhclient.c.libdhcp4client        2007-10-24 14:55:56.000000000 -0400
-+++ dhcp-3.1.0/client/dhclient.c       2007-10-24 14:56:20.000000000 -0400
-@@ -82,16 +82,52 @@ int quiet=0;
- int nowait=0;
+ extern trace_type_t *interface_trace;
+@@ -2392,6 +2382,10 @@ extern struct universe dhcpv6_universe;
+ extern struct universe nwip_universe;
+ extern struct universe fqdn_universe;
+ extern struct universe vsio_universe;
++extern struct universe vendor_class_universe;
++extern struct universe vendor_universe;
++extern struct universe isc_universe;
++extern struct universe isc6_universe;
+ extern int dhcp_option_default_priority_list [];
+ extern int dhcp_option_default_priority_list_count;
+ extern const char *hardware_types [256];
+diff -up dhcp-4.0.0/client/Makefile.am.libdhcp4client dhcp-4.0.0/client/Makefile.am
+--- dhcp-4.0.0/client/Makefile.am.libdhcp4client       2007-12-12 09:23:42.000000000 -1000
++++ dhcp-4.0.0/client/Makefile.am      2008-01-22 17:04:28.000000000 -1000
+@@ -1,10 +1,18 @@
+ dist_sysconf_DATA = dhclient.conf
+ sbin_PROGRAMS = dhclient
++lib_LTLIBRARIES = libdhcp4client.la
+ dhclient_SOURCES = clparse.c dhclient.c dhc6.c \
+                  scripts/bsdos scripts/freebsd scripts/linux scripts/netbsd \
+                  scripts/nextstep scripts/openbsd scripts/solaris
+ dhclient_LDADD = ../common/libdhcp.a ../minires/libres.a \
+                ../omapip/libomapi.a ../dst/libdst.a
++libdhcp4client_la_CFLAGS = -DLIBDHCP -DLOCALSTATEDIR='"@localstatedir@"'
++libdhcp4client_la_LDFLAGS = -version-info \
++               $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \
++               -release $(LT_RELEASE)
++libdhcp4client_la_SOURCES = clparse.c dhclient.c dhc6.c
++libdhcp4client_la_LIBADD = ../common/libdhcpLIBDHCP.a ../minires/libres.a \
++               ../omapip/libomapiLIBDHCP.a ../dst/libdstLIBDHCP.a
+ man_MANS = dhclient.8 dhclient-script.8 dhclient.conf.5 dhclient.leases.5
+ EXTRA_DIST = $(man_MANS)
+diff -up dhcp-4.0.0/client/dhclient.c.libdhcp4client dhcp-4.0.0/client/dhclient.c
+--- dhcp-4.0.0/client/dhclient.c.libdhcp4client        2008-01-22 17:04:28.000000000 -1000
++++ dhcp-4.0.0/client/dhclient.c       2008-01-22 17:05:47.000000000 -1000
+@@ -83,14 +83,50 @@ int nowait=0;
+ char *mockup_relay = NULL;
  int bootp_broadcast_always = 0;
  
 +#ifdef LIBDHCP
@@ -686,11 +826,13 @@ diff -up dhcp-3.1.0/client/dhclient.c.libdhcp4client dhcp-3.1.0/client/dhclient.
 +#endif
 +
  extern u_int32_t default_requested_options[];
- #ifdef EXTENDED_NEW_OPTION_INFO
- int extended_option_environment = 0;
- #endif
  static void usage PROTO ((void));
  
+ static isc_result_t write_duid(struct data_string *duid);
+-int 
+-main(int argc, char **argv) {
 +#ifdef LIBDHCP
 +#include "isc-dhcp/libdhcp_control.h"
 +LIBDHCP_Control *libdhcp_control;
@@ -716,56 +858,56 @@ diff -up dhcp-3.1.0/client/dhclient.c.libdhcp4client dhcp-3.1.0/client/dhclient.
 +extern void omapi_free_all_pointers(void);
 +
 +__attribute__ ((visibility ("default")))
-+int dhcpv4_client (libdhcp_ctl, argc, argv, envp)
-+      LIBDHCP_Control *libdhcp_ctl;
++int dhcpv4_client (LIBDHCP_Control *libdhcp_ctl, int argc, char **argv,
++                   char **envp)
 +#else
- int main (argc, argv, envp)
++int main(int argc, char **argv, char **envp)
 +#endif
-       int argc;
-       char **argv, **envp;
- {
++{
 +#ifdef LIBDHCP
 +      libdhcp_control = libdhcp_ctl;
 +#endif
        int fd;
        int i;
-       struct servent *ent;
-@@ -120,6 +156,7 @@ int main (argc, argv, envp)
-       char *arg_conf = NULL;
-       int arg_conf_len = 0;
+       struct interface_info *ip;
+@@ -122,6 +158,7 @@ main(int argc, char **argv) {
+       /* Initialize client globals. */
+       memset(&default_duid, 0, sizeof(default_duid));
  
 +#ifndef LIBDHCP
          /* Make sure that file descriptors 0 (stdin), 1, (stdout), and
             2 (stderr) are open. To do this, we assume that when we
-            open a file the lowest available file decriptor is used. */
-@@ -143,6 +180,7 @@ int main (argc, argv, envp)
- #if !(defined (DEBUG) || defined (SYSLOG_4_2) || defined (__CYGWIN32__))
+            open a file the lowest available file descriptor is used. */
+@@ -140,6 +177,7 @@ main(int argc, char **argv) {
+ #if !(defined (DEBUG) || defined (__CYGWIN32__))
        setlogmask (LOG_UPTO (LOG_INFO));
  #endif        
 +#endif
  
        /* Set up the OMAPI. */
        status = omapi_init ();
-@@ -439,6 +477,10 @@ int main (argc, argv, envp)
+@@ -485,8 +523,12 @@ main(int argc, char **argv) {
                }
        }
  
 +#ifdef LIBDHCP
 +      if (libdhcp_control && (libdhcp_control->capability & DHCP_USE_PID_FILE))
 +#endif
+       write_client_pid_file();
 +#ifndef LIBDHCP
        if (!quiet) {
-               log_info ("%s %s", message, DHCP_VERSION);
+               log_info ("%s %s", message, PACKAGE_VERSION);
                log_info (copyright);
-@@ -449,6 +491,7 @@ int main (argc, argv, envp)
-               log_info ("%s", "");
-       } else
+@@ -497,6 +539,7 @@ main(int argc, char **argv) {
                log_perror = 0;
+               quiet_interface_discovery = 1;
+       }
 +#endif
  
        /* If we're given a relay agent address to insert, for testing
           purposes, figure out what it is. */
-@@ -680,11 +723,17 @@ int main (argc, argv, envp)
+@@ -702,11 +745,17 @@ main(int argc, char **argv) {
                arg_conf_len = 0;
        }
  
@@ -783,7 +925,7 @@ diff -up dhcp-3.1.0/client/dhclient.c.libdhcp4client dhcp-3.1.0/client/dhclient.
  
        /* XXX */
  /*    config_counter(&snd_counter, &rcv_counter); */
-@@ -703,7 +752,7 @@ int main (argc, argv, envp)
+@@ -725,7 +774,7 @@ main(int argc, char **argv) {
                if (!persist) {
                        /* Nothing more to do. */
                        log_info ("No broadcast interfaces found - exiting.");
@@ -792,7 +934,7 @@ diff -up dhcp-3.1.0/client/dhclient.c.libdhcp4client dhcp-3.1.0/client/dhclient.
                }
        } else if (!release_mode && !exit_mode) {
                /* Call the script with the list of interfaces. */
-@@ -799,6 +848,7 @@ int main (argc, argv, envp)
+@@ -863,6 +912,7 @@ main(int argc, char **argv) {
        dmalloc_outstanding = 0;
  #endif
  
@@ -800,7 +942,7 @@ diff -up dhcp-3.1.0/client/dhclient.c.libdhcp4client dhcp-3.1.0/client/dhclient.
        /* If we're not supposed to wait before getting the address,
           don't. */
        if (nowait)
-@@ -811,6 +861,126 @@ int main (argc, argv, envp)
+@@ -875,6 +925,132 @@ main(int argc, char **argv) {
  
        /* Start dispatching packets and timeouts... */
        dispatch ();
@@ -896,13 +1038,19 @@ diff -up dhcp-3.1.0/client/dhclient.c.libdhcp4client dhcp-3.1.0/client/dhclient.
 +      dhcp_type_shared_network = NULL;
 +      dhcp_type_control = NULL;
 +      memset(&dhcp_universe, '\0', sizeof(struct universe));
++      memset(&dhcpv6_universe, '\0', sizeof(struct universe));
 +      memset(&nwip_universe, '\0', sizeof(struct universe));
 +      memset(&fqdn_universe, '\0', sizeof(struct universe));
++      memset(&vendor_class_universe, '\0', sizeof(struct universe));
++      memset(&vendor_universe, '\0', sizeof(struct universe));
++      memset(&vsio_universe, '\0', sizeof(struct universe));
++      memset(&isc_universe, '\0', sizeof(struct universe));
++      memset(&isc6_universe, '\0', sizeof(struct universe));
 +      universe_hash = 0;
 +      universes = 0;
 +      universe_count = 0;
 +      universe_max = 0;
-+      config_universe = 0; 
++      config_universe = 0;
 +      extern struct hash_bucket *free_hash_buckets;
 +      free_hash_buckets = NULL;
 +      extern struct dhcp_packet *dhcp_free_list;
@@ -927,7 +1075,7 @@ diff -up dhcp-3.1.0/client/dhclient.c.libdhcp4client dhcp-3.1.0/client/dhclient.
  
        /*NOTREACHED*/
        return 0;
-@@ -1203,7 +1373,20 @@ void dhcpack (packet)
+@@ -1270,7 +1446,20 @@ void dhcpack (packet)
        if (client -> new -> rebind < cur_time)
                client -> new -> rebind = TIME_MAX;
  
@@ -948,7 +1096,7 @@ diff -up dhcp-3.1.0/client/dhclient.c.libdhcp4client dhcp-3.1.0/client/dhclient.
  }
  
  void bind_lease (client)
-@@ -1241,6 +1424,9 @@ void bind_lease (client)
+@@ -1306,6 +1495,9 @@ void bind_lease (client)
                return;
        }
  
@@ -958,21 +1106,20 @@ diff -up dhcp-3.1.0/client/dhclient.c.libdhcp4client dhcp-3.1.0/client/dhclient.
        /* Write out the new lease. */
        write_client_lease (client, client -> new, 0, 0);
  
-@@ -1343,11 +1529,13 @@ int commit_leases ()
-       return 0;
- }
+@@ -1398,10 +1590,12 @@ void state_stop (cpp)
+       }
+ }  
  
 +#ifndef LIBDHCP
- int write_lease (lease)
-       struct lease *lease;
+ int commit_leases ()
  {
        return 0;
  }
 +#endif
  
- int write_host (host)
-       struct host_decl *host;
-@@ -1957,6 +2145,10 @@ void state_panic (cpp)
+ int write_lease (lease)
+       struct lease *lease;
+@@ -2074,6 +2268,10 @@ void state_panic (cpp)
           tell the shell script that we failed to allocate an address,
           and try again later. */
        if (onetry) {
@@ -983,17 +1130,17 @@ diff -up dhcp-3.1.0/client/dhclient.c.libdhcp4client dhcp-3.1.0/client/dhclient.
                if (!quiet)
                        log_info ("Unable to obtain a lease on first try.%s",
                                  "  Exiting.");
-@@ -2579,7 +2771,9 @@ void destroy_client_lease (lease)
+@@ -2691,7 +2889,9 @@ void destroy_client_lease (lease)
        free_client_lease (lease, MDL);
  }
  
 +#ifndef LIBDHCP
- FILE *leaseFile;
+ FILE *leaseFile = NULL;
 +#endif
+ int leases_written = 0;
  
  void rewrite_client_leases ()
- {
-@@ -2960,6 +3154,54 @@ void script_write_params (client, prefix
+@@ -3218,6 +3418,54 @@ void script_write_params (client, prefix
  int script_go (client)
        struct client_state *client;
  {
@@ -1045,28 +1192,28 @@ diff -up dhcp-3.1.0/client/dhclient.c.libdhcp4client dhcp-3.1.0/client/dhclient.
 +
 +      return 0;
 +#else
-       int rval;
        char *scriptName;
        char *argv [2];
-@@ -3038,6 +3280,7 @@ int script_go (client)
-       GET_TIME (&cur_time);
+       char **envp;
+@@ -3294,6 +3542,7 @@ int script_go (client)
+       time(&cur_time);
        return (WIFEXITED (wstatus) ?
                WEXITSTATUS (wstatus) : -WTERMSIG (wstatus));
 +#endif
  }
  
  void client_envadd (struct client_state *client,
-@@ -3120,6 +3363,9 @@ void go_daemon ()
+@@ -3376,6 +3625,9 @@ void go_daemon ()
  
        /* Don't become a daemon if the user requested otherwise. */
        if (no_daemon) {
 +#ifdef LIBDHCP
-+              if (libdhcp_control && (libdhcp_control->capability & DHCP_USE_PID_FILE ))
++              if (libdhcp_control && (libdhcp_control->capability & DHCP_USE_PID_FILE))
 +#endif
                write_client_pid_file ();
                return;
        }
-@@ -3129,6 +3375,10 @@ void go_daemon ()
+@@ -3385,6 +3637,10 @@ void go_daemon ()
                return;
        state = 1;
  
@@ -1077,26 +1224,3 @@ diff -up dhcp-3.1.0/client/dhclient.c.libdhcp4client dhcp-3.1.0/client/dhclient.
        /* Stop logging to stderr... */
        log_perror = 0;
  
-diff -up dhcp-3.1.0/Makefile.dist.libdhcp4client dhcp-3.1.0/Makefile.dist
---- dhcp-3.1.0/Makefile.dist.libdhcp4client    2005-03-17 15:14:54.000000000 -0500
-+++ dhcp-3.1.0/Makefile.dist   2007-10-24 14:55:56.000000000 -0400
-@@ -22,7 +22,7 @@
- #   http://www.isc.org/
--SUBDIRS=      common $(MINIRES) dst omapip server client relay dhcpctl
-+SUBDIRS=      common $(MINIRES) dst omapip server client relay dhcpctl libdhcp4client
- all:
-       @for dir in ${SUBDIRS}; do \
---- dhcp-3.1.0/minires/Makefile.dist.orig      2007-12-25 12:41:11.744624000 +0100
-+++ dhcp-3.1.0/minires/Makefile.dist   2007-12-25 12:54:35.448726491 +0100
-@@ -32,7 +32,7 @@
-        ns_date.o ns_parse.o ns_sign.o ns_name.o ns_samedomain.o ns_verify.o
- INCLUDES = $(BINDINC) -I$(TOP)/includes
--CFLAGS = $(DEBUG) $(PREDEFINES) $(INCLUDES) $(COPTS) -DHMAC_MD5 -DMINIRES_LIB
-+CFLAGS = $(DEBUG) $(PREDEFINES) $(INCLUDES) $(COPTS) -DHMAC_MD5 -DMINIRES_LIB -fPIC
- all:  libres.a
This page took 0.726784 seconds and 4 git commands to generate.