2dc4dd
--- dhcp-3.0.5/common/conflex.c.ldapconf	2007-01-31 20:39:38.000000000 -0500
2dc4dd
+++ dhcp-3.0.5/common/conflex.c	2007-01-31 20:39:38.000000000 -0500
2dc4dd
@@ -47,6 +47,7 @@
2dc4dd
 static enum dhcp_token read_number PROTO ((int, struct parse *));
2dc4dd
 static enum dhcp_token read_num_or_name PROTO ((int, struct parse *));
2dc4dd
 static enum dhcp_token intern PROTO ((char *, enum dhcp_token));
2dc4dd
+static char read_function PROTO ((struct parse *));
2dc4dd
 
2dc4dd
 isc_result_t new_parse (cfile, file, inbuf, buflen, name, eolp)
2dc4dd
 	struct parse **cfile;
2dc4dd
@@ -74,6 +75,10 @@
2dc4dd
 	tmp -> file = file;
2dc4dd
 	tmp -> eol_token = eolp;
2dc4dd
 
2dc4dd
+	if (file != -1) {
2dc4dd
+		tmp -> read_function = read_function;;
2dc4dd
+	}
2dc4dd
+
2dc4dd
 	tmp -> bufix = 0;
2dc4dd
 	tmp -> buflen = buflen;
2dc4dd
 	if (inbuf) {
2dc4dd
@@ -113,22 +118,11 @@
2dc4dd
 	int c;
2dc4dd
 
2dc4dd
 	if (cfile -> bufix == cfile -> buflen) {
2dc4dd
-		if (cfile -> file != -1) {
2dc4dd
-			cfile -> buflen =
2dc4dd
-				read (cfile -> file,
2dc4dd
-				      cfile -> inbuf, cfile -> bufsiz);
2dc4dd
-			if (cfile -> buflen == 0) {
2dc4dd
-				c = EOF;
2dc4dd
-				cfile -> bufix = 0;
2dc4dd
-			} else if (cfile -> buflen < 0) {
2dc4dd
-				c = EOF;
2dc4dd
-				cfile -> bufix = cfile -> buflen = 0;
2dc4dd
-			} else {
2dc4dd
-				c = cfile -> inbuf [0];
2dc4dd
-				cfile -> bufix = 1;
2dc4dd
-			}
2dc4dd
-		} else
2dc4dd
+		if (cfile -> read_function) {
2dc4dd
+			c = cfile -> read_function (cfile);
2dc4dd
+		} else {
2dc4dd
 			c = EOF;
2dc4dd
+		}
2dc4dd
 	} else {
2dc4dd
 		c = cfile -> inbuf [cfile -> bufix];
2dc4dd
 		cfile -> bufix++;
2dc4dd
@@ -1130,3 +1124,25 @@
2dc4dd
 	}
2dc4dd
 	return dfv;
2dc4dd
 }
2dc4dd
+
2dc4dd
+
2dc4dd
+static char
2dc4dd
+read_function (struct parse * cfile)
2dc4dd
+{
2dc4dd
+  char c;
2dc4dd
+
2dc4dd
+	cfile -> buflen = read (cfile -> file, cfile -> inbuf, cfile -> bufsiz);
2dc4dd
+	if (cfile -> buflen == 0) {
2dc4dd
+		c = EOF;
2dc4dd
+		cfile -> bufix = 0;
2dc4dd
+	} else if (cfile -> buflen < 0) {
2dc4dd
+		c = EOF;
2dc4dd
+		cfile -> bufix = cfile -> buflen = 0;
2dc4dd
+	} else {
2dc4dd
+		c = cfile -> inbuf [0];
2dc4dd
+		cfile -> bufix = 1;
2dc4dd
+	}
2dc4dd
+
2dc4dd
+	return c;
2dc4dd
+}
2dc4dd
+
2dc4dd
--- dhcp-3.0.5/common/print.c.ldapconf	2007-01-31 20:39:38.000000000 -0500
2dc4dd
+++ dhcp-3.0.5/common/print.c	2007-01-31 20:39:38.000000000 -0500
2dc4dd
@@ -166,9 +166,9 @@
2dc4dd
 }
2dc4dd
 
2dc4dd
 char *print_hw_addr (htype, hlen, data)
2dc4dd
-	int htype;
2dc4dd
-	int hlen;
2dc4dd
-	unsigned char *data;
2dc4dd
+	const int htype;
2dc4dd
+	const int hlen;
2dc4dd
+	const unsigned char *data;
2dc4dd
 {
2dc4dd
 	static char habuf [49];
2dc4dd
 	char *s;
2dc4dd
--- /dev/null	2007-01-31 10:24:38.956568237 -0500
2dc4dd
+++ dhcp-3.0.5/contrib/dhcpd-conf-to-ldap.pl	2007-01-31 20:39:38.000000000 -0500
2dc4dd
@@ -0,0 +1,517 @@
2dc4dd
+#!/usr/bin/perl -w
2dc4dd
+
2dc4dd
+# Brian Masney <masneyb@ntelos.net>
2dc4dd
+# To use this script, set your base DN below. Then run 
2dc4dd
+# ./dhcpd-conf-to-ldap.pl < /path-to-dhcpd-conf/dhcpd.conf > output-file
2dc4dd
+# The output of this script will generate entries in LDIF format. You can use
2dc4dd
+# the slapadd command to add these entries into your LDAP server. You will
2dc4dd
+# definately want to double check that your LDAP entries are correct before
2dc4dd
+# you load them into LDAP.
2dc4dd
+
2dc4dd
+# This script does not do much error checking. Make sure before you run this
2dc4dd
+# that the DHCP server doesn't give any errors about your config file
2dc4dd
+
2dc4dd
+use Sys::Hostname;
2dc4dd
+
2dc4dd
+my $basedn = "dc=ntelos, dc=net";
2dc4dd
+
2dc4dd
+sub next_token
2dc4dd
+{
2dc4dd
+  local ($lowercase) = @_;
2dc4dd
+  local ($token, $newline);
2dc4dd
+
2dc4dd
+  do 
2dc4dd
+    {
2dc4dd
+      if (!defined ($line) || length ($line) == 0)
2dc4dd
+        {
2dc4dd
+          $line = <>;
2dc4dd
+          return undef if !defined ($line);
2dc4dd
+          chop $line;
2dc4dd
+          $line_number++;
2dc4dd
+          $token_number = 0;
2dc4dd
+        }
2dc4dd
+
2dc4dd
+      $line =~ s/#.*//;
2dc4dd
+      $line =~ s/^\s+//;
2dc4dd
+      $line =~ s/\s+$//;
2dc4dd
+    }
2dc4dd
+  while (length ($line) == 0);
2dc4dd
+
2dc4dd
+  if (($token, $newline) = $line =~ /^(.*?)\s+(.*)/)
2dc4dd
+    {
2dc4dd
+      $line = $newline;
2dc4dd
+    }
2dc4dd
+  else
2dc4dd
+    {
2dc4dd
+      $token = $line;
2dc4dd
+      $line = '';
2dc4dd
+    }
2dc4dd
+  $token_number++;
2dc4dd
+
2dc4dd
+  $token =~ y/[A-Z]/[a-z]/ if $lowercase;
2dc4dd
+
2dc4dd
+  return ($token);
2dc4dd
+}
2dc4dd
+
2dc4dd
+
2dc4dd
+sub remaining_line
2dc4dd
+{
2dc4dd
+  local ($tmp, $str);
2dc4dd
+
2dc4dd
+  $str = "";
2dc4dd
+  while (($tmp = next_token (0)))
2dc4dd
+    {
2dc4dd
+      $str .= ' ' if !($str eq "");
2dc4dd
+      $str .= $tmp;
2dc4dd
+      last if $tmp =~ /;\s*$/;
2dc4dd
+    }
2dc4dd
+
2dc4dd
+  $str =~ s/;$//;
2dc4dd
+  return ($str);
2dc4dd
+}
2dc4dd
+
2dc4dd
+
2dc4dd
+sub
2dc4dd
+add_dn_to_stack
2dc4dd
+{
2dc4dd
+  local ($dn) = @_;
2dc4dd
+
2dc4dd
+  $current_dn = "$dn, $current_dn";
2dc4dd
+}
2dc4dd
+
2dc4dd
+
2dc4dd
+sub
2dc4dd
+remove_dn_from_stack
2dc4dd
+{
2dc4dd
+  $current_dn =~ s/^.*?,\s*//;
2dc4dd
+}
2dc4dd
+
2dc4dd
+
2dc4dd
+sub
2dc4dd
+parse_error
2dc4dd
+{
2dc4dd
+  print "Parse error on line number $line_number at token number $token_number\n";
2dc4dd
+  exit (1);
2dc4dd
+}
2dc4dd
+
2dc4dd
+
2dc4dd
+sub
2dc4dd
+print_entry
2dc4dd
+{
2dc4dd
+  return if (scalar keys %curentry == 0);
2dc4dd
+
2dc4dd
+  if (!defined ($curentry{'type'}))
2dc4dd
+    {
2dc4dd
+      $host = hostname ();
2dc4dd
+      $hostdn = "cn=$host, $basedn";
2dc4dd
+      print "dn: $hostdn\n";
2dc4dd
+      print "objectClass: top\n";
2dc4dd
+      print "objectClass: dhcpServer\n";
2dc4dd
+      print "cn: $host\n";
2dc4dd
+      print "dhcpServiceDN: $current_dn\n\n";
2dc4dd
+
2dc4dd
+      print "dn: $current_dn\n";
2dc4dd
+      print "cn: DHCP Config\n";
2dc4dd
+      print "objectClass: top\n";
2dc4dd
+      print "objectClass: dhcpService\n";
2dc4dd
+      if (defined ($curentry{'options'}))
2dc4dd
+        {
2dc4dd
+          print "objectClass: dhcpOptions\n";
2dc4dd
+        }
2dc4dd
+      print "dhcpPrimaryDN: $hostdn\n";
2dc4dd
+    }
2dc4dd
+  elsif ($curentry{'type'} eq 'subnet')
2dc4dd
+    {
2dc4dd
+      print "dn: $current_dn\n";
2dc4dd
+      print "cn: " . $curentry{'ip'} . "\n";
2dc4dd
+      print "objectClass: top\n";
2dc4dd
+      print "objectClass: dhcpSubnet\n";
2dc4dd
+      if (defined ($curentry{'options'}))
2dc4dd
+        {
2dc4dd
+          print "objectClass: dhcpOptions\n";
2dc4dd
+        }
2dc4dd
+      
2dc4dd
+      print "dhcpNetMask: " . $curentry{'netmask'} . "\n";
2dc4dd
+      if (defined ($curentry{'range'}))
2dc4dd
+        {
2dc4dd
+          print "dhcpRange: " . $curentry{'range'} . "\n";
2dc4dd
+        }
2dc4dd
+    }
2dc4dd
+  elsif ($curentry{'type'} eq 'shared-network')
2dc4dd
+    {
2dc4dd
+      print "dn: $current_dn\n";
2dc4dd
+      print "cn: " . $curentry{'descr'} . "\n";
2dc4dd
+      print "objectClass: top\n";
2dc4dd
+      print "objectClass: dhcpSharedNetwork\n";
2dc4dd
+      if (defined ($curentry{'options'}))
2dc4dd
+        {
2dc4dd
+          print "objectClass: dhcpOptions\n";
2dc4dd
+        }
2dc4dd
+    }
2dc4dd
+  elsif ($curentry{'type'} eq 'group')
2dc4dd
+    {
2dc4dd
+      print "dn: $current_dn\n";
2dc4dd
+      print "cn: group\n";
2dc4dd
+      print "objectClass: top\n";
2dc4dd
+      print "objectClass: dhcpGroup\n";
2dc4dd
+      if (defined ($curentry{'options'}))
2dc4dd
+        {
2dc4dd
+          print "objectClass: dhcpOptions\n";
2dc4dd
+        }
2dc4dd
+    }
2dc4dd
+  elsif ($curentry{'type'} eq 'host')
2dc4dd
+    {
2dc4dd
+      print "dn: $current_dn\n";
2dc4dd
+      print "cn: " . $curentry{'host'} . "\n";
2dc4dd
+      print "objectClass: top\n";
2dc4dd
+      print "objectClass: dhcpHost\n";
2dc4dd
+      if (defined ($curentry{'options'}))
2dc4dd
+        {
2dc4dd
+          print "objectClass: dhcpOptions\n";
2dc4dd
+        }
2dc4dd
+
2dc4dd
+      if (defined ($curentry{'hwaddress'}))
2dc4dd
+        {
2dc4dd
+          print "dhcpHWAddress: " . $curentry{'hwaddress'} . "\n";
2dc4dd
+        }
2dc4dd
+    }
2dc4dd
+  elsif ($curentry{'type'} eq 'pool')
2dc4dd
+    {
2dc4dd
+      print "dn: $current_dn\n";
2dc4dd
+      print "cn: pool\n";
2dc4dd
+      print "objectClass: top\n";
2dc4dd
+      print "objectClass: dhcpPool\n";
2dc4dd
+      if (defined ($curentry{'options'}))
2dc4dd
+        {
2dc4dd
+          print "objectClass: dhcpOptions\n";
2dc4dd
+        }
2dc4dd
+
2dc4dd
+      if (defined ($curentry{'range'}))
2dc4dd
+        {
2dc4dd
+          print "dhcpRange: " . $curentry{'range'} . "\n";
2dc4dd
+        }
2dc4dd
+    }
2dc4dd
+  elsif ($curentry{'type'} eq 'class')
2dc4dd
+    {
2dc4dd
+      print "dn: $current_dn\n";
2dc4dd
+      print "cn: " . $curentry{'class'} . "\n";
2dc4dd
+      print "objectClass: top\n";
2dc4dd
+      print "objectClass: dhcpClass\n";
2dc4dd
+      if (defined ($curentry{'options'}))
2dc4dd
+        {
2dc4dd
+          print "objectClass: dhcpOptions\n";
2dc4dd
+        }
2dc4dd
+    }
2dc4dd
+  elsif ($curentry{'type'} eq 'subclass')
2dc4dd
+    {
2dc4dd
+      print "dn: $current_dn\n";
2dc4dd
+      print "cn: " . $curentry{'subclass'} . "\n";
2dc4dd
+      print "objectClass: top\n";
2dc4dd
+      print "objectClass: dhcpSubClass\n";
2dc4dd
+      if (defined ($curentry{'options'}))
2dc4dd
+        {
2dc4dd
+          print "objectClass: dhcpOptions\n";
2dc4dd
+        }
2dc4dd
+      print "dhcpClassData: " . $curentry{'class'} . "\n";
2dc4dd
+    }
2dc4dd
+
2dc4dd
+  if (defined ($curentry{'statements'}))
2dc4dd
+    {
2dc4dd
+      foreach $statement (@{$curentry{'statements'}})
2dc4dd
+        {
2dc4dd
+          print "dhcpStatements: $statement\n";
2dc4dd
+        }
2dc4dd
+    }
2dc4dd
+
2dc4dd
+  if (defined ($curentry{'options'}))
2dc4dd
+    {
2dc4dd
+      foreach $statement (@{$curentry{'options'}})
2dc4dd
+        {
2dc4dd
+          print "dhcpOption: $statement\n";
2dc4dd
+        }
2dc4dd
+    }
2dc4dd
+
2dc4dd
+  print "\n";
2dc4dd
+  undef (%curentry);
2dc4dd
+}
2dc4dd
+
2dc4dd
+
2dc4dd
+sub parse_netmask
2dc4dd
+{
2dc4dd
+  local ($netmask) = @_;
2dc4dd
+  local ($i);
2dc4dd
+
2dc4dd
+  if ((($a, $b, $c, $d) = $netmask =~ /^(\d+)\.(\d+)\.(\d+)\.(\d+)$/) != 4)
2dc4dd
+    {
2dc4dd
+      parse_error ();
2dc4dd
+    }
2dc4dd
+
2dc4dd
+  $num = (($a & 0xff) << 24) |
2dc4dd
+         (($b & 0xff) << 16) |
2dc4dd
+         (($c & 0xff) << 8) |
2dc4dd
+          ($d & 0xff);
2dc4dd
+
2dc4dd
+  for ($i=1; $i<=32 && $num & (1 << (32 - $i)); $i++)
2dc4dd
+    {
2dc4dd
+    }
2dc4dd
+  $i--;
2dc4dd
+
2dc4dd
+  return ($i);
2dc4dd
+}
2dc4dd
+
2dc4dd
+
2dc4dd
+sub parse_subnet
2dc4dd
+{
2dc4dd
+  local ($ip, $tmp, $netmask);
2dc4dd
+
2dc4dd
+  print_entry () if %curentry;
2dc4dd
+    
2dc4dd
+  $ip = next_token (0);
2dc4dd
+  parse_error () if !defined ($ip);
2dc4dd
+
2dc4dd
+  $tmp = next_token (1);
2dc4dd
+  parse_error () if !defined ($tmp);
2dc4dd
+  parse_error () if !($tmp eq 'netmask');
2dc4dd
+
2dc4dd
+  $tmp = next_token (0);
2dc4dd
+  parse_error () if !defined ($tmp);
2dc4dd
+  $netmask = parse_netmask ($tmp);
2dc4dd
+
2dc4dd
+  $tmp = next_token (0);
2dc4dd
+  parse_error () if !defined ($tmp);
2dc4dd
+  parse_error () if !($tmp eq '{');
2dc4dd
+
2dc4dd
+  add_dn_to_stack ("cn=$ip");
2dc4dd
+  $curentry{'type'} = 'subnet';
2dc4dd
+  $curentry{'ip'} = $ip;
2dc4dd
+  $curentry{'netmask'} = $netmask;
2dc4dd
+}
2dc4dd
+
2dc4dd
+
2dc4dd
+sub parse_shared_network
2dc4dd
+{
2dc4dd
+  local ($descr, $tmp);
2dc4dd
+
2dc4dd
+  print_entry () if %curentry;
2dc4dd
+
2dc4dd
+  $descr = next_token (0);
2dc4dd
+  parse_error () if !defined ($descr);
2dc4dd
+
2dc4dd
+  $tmp = next_token (0);
2dc4dd
+  parse_error () if !defined ($tmp);
2dc4dd
+  parse_error () if !($tmp eq '{');
2dc4dd
+
2dc4dd
+  add_dn_to_stack ("cn=$descr");
2dc4dd
+  $curentry{'type'} = 'shared-network';
2dc4dd
+  $curentry{'descr'} = $descr;
2dc4dd
+}
2dc4dd
+
2dc4dd
+
2dc4dd
+sub parse_host
2dc4dd
+{
2dc4dd
+  local ($descr, $tmp);
2dc4dd
+
2dc4dd
+  print_entry () if %curentry;
2dc4dd
+
2dc4dd
+  $host = next_token (0);
2dc4dd
+  parse_error () if !defined ($host);
2dc4dd
+
2dc4dd
+  $tmp = next_token (0);
2dc4dd
+  parse_error () if !defined ($tmp);
2dc4dd
+  parse_error () if !($tmp eq '{');
2dc4dd
+
2dc4dd
+  add_dn_to_stack ("cn=$host");
2dc4dd
+  $curentry{'type'} = 'host';
2dc4dd
+  $curentry{'host'} = $host;
2dc4dd
+}
2dc4dd
+
2dc4dd
+
2dc4dd
+sub parse_group
2dc4dd
+{
2dc4dd
+  local ($descr, $tmp);
2dc4dd
+
2dc4dd
+  print_entry () if %curentry;
2dc4dd
+
2dc4dd
+  $tmp = next_token (0);
2dc4dd
+  parse_error () if !defined ($tmp);
2dc4dd
+  parse_error () if !($tmp eq '{');
2dc4dd
+
2dc4dd
+  add_dn_to_stack ("cn=group");
2dc4dd
+  $curentry{'type'} = 'group';
2dc4dd
+}
2dc4dd
+
2dc4dd
+
2dc4dd
+sub parse_pool
2dc4dd
+{
2dc4dd
+  local ($descr, $tmp);
2dc4dd
+
2dc4dd
+  print_entry () if %curentry;
2dc4dd
+
2dc4dd
+  $tmp = next_token (0);
2dc4dd
+  parse_error () if !defined ($tmp);
2dc4dd
+  parse_error () if !($tmp eq '{');
2dc4dd
+
2dc4dd
+  add_dn_to_stack ("cn=pool");
2dc4dd
+  $curentry{'type'} = 'pool';
2dc4dd
+}
2dc4dd
+
2dc4dd
+
2dc4dd
+sub parse_class
2dc4dd
+{
2dc4dd
+  local ($descr, $tmp);
2dc4dd
+
2dc4dd
+  print_entry () if %curentry;
2dc4dd
+
2dc4dd
+  $class = next_token (0);
2dc4dd
+  parse_error () if !defined ($class);
2dc4dd
+
2dc4dd
+  $tmp = next_token (0);
2dc4dd
+  parse_error () if !defined ($tmp);
2dc4dd
+  parse_error () if !($tmp eq '{');
2dc4dd
+
2dc4dd
+  $class =~ s/\"//g;
2dc4dd
+  add_dn_to_stack ("cn=$class");
2dc4dd
+  $curentry{'type'} = 'class';
2dc4dd
+  $curentry{'class'} = $class;
2dc4dd
+}
2dc4dd
+
2dc4dd
+
2dc4dd
+sub parse_subclass
2dc4dd
+{
2dc4dd
+  local ($descr, $tmp);
2dc4dd
+
2dc4dd
+  print_entry () if %curentry;
2dc4dd
+
2dc4dd
+  $class = next_token (0);
2dc4dd
+  parse_error () if !defined ($class);
2dc4dd
+
2dc4dd
+  $subclass = next_token (0);
2dc4dd
+  parse_error () if !defined ($subclass);
2dc4dd
+
2dc4dd
+  $tmp = next_token (0);
2dc4dd
+  parse_error () if !defined ($tmp);
2dc4dd
+  parse_error () if !($tmp eq '{');
2dc4dd
+
2dc4dd
+  add_dn_to_stack ("cn=$subclass");
2dc4dd
+  $curentry{'type'} = 'subclass';
2dc4dd
+  $curentry{'class'} = $class;
2dc4dd
+  $curentry{'subclass'} = $subclass;
2dc4dd
+}
2dc4dd
+
2dc4dd
+
2dc4dd
+sub parse_hwaddress
2dc4dd
+{
2dc4dd
+  local ($type, $hw, $tmp);
2dc4dd
+
2dc4dd
+  $type = next_token (0);
2dc4dd
+  parse_error () if !defined ($type);
2dc4dd
+
2dc4dd
+  $hw = next_token (0);
2dc4dd
+  parse_error () if !defined ($hw);
2dc4dd
+  $hw =~ s/;$//;
2dc4dd
+
2dc4dd
+  $curentry{'hwaddress'} = "$type $hw";
2dc4dd
+}
2dc4dd
+
2dc4dd
+    
2dc4dd
+sub parse_range
2dc4dd
+{
2dc4dd
+  local ($tmp, $str);
2dc4dd
+
2dc4dd
+  $str = remaining_line ();
2dc4dd
+
2dc4dd
+  if (!($str eq ''))
2dc4dd
+    {
2dc4dd
+      $str =~ s/;$//;
2dc4dd
+      $curentry{'range'} = $str;
2dc4dd
+    }
2dc4dd
+}
2dc4dd
+
2dc4dd
+
2dc4dd
+sub parse_statement
2dc4dd
+{
2dc4dd
+  local ($token) = shift;
2dc4dd
+  local ($str);
2dc4dd
+
2dc4dd
+  if ($token eq 'option')
2dc4dd
+    {
2dc4dd
+      $str = remaining_line ();
2dc4dd
+      push (@{$curentry{'options'}}, $str);
2dc4dd
+    }
2dc4dd
+  else
2dc4dd
+    {
2dc4dd
+      $str = $token . " " . remaining_line ();
2dc4dd
+      push (@{$curentry{'statements'}}, $str);
2dc4dd
+    }
2dc4dd
+}
2dc4dd
+
2dc4dd
+
2dc4dd
+my $token;
2dc4dd
+my $token_number = 0;
2dc4dd
+my $line_number = 0;
2dc4dd
+my %curentry;
2dc4dd
+
2dc4dd
+$current_dn = "cn=DHCP Config, $basedn";
2dc4dd
+$curentry{'descr'} = 'DHCP Config';
2dc4dd
+$line = '';
2dc4dd
+
2dc4dd
+while (($token = next_token (1)))
2dc4dd
+  {
2dc4dd
+    if ($token eq '}')
2dc4dd
+      {
2dc4dd
+        print_entry () if %curentry;
2dc4dd
+        remove_dn_from_stack ();
2dc4dd
+      }
2dc4dd
+    elsif ($token eq 'subnet')
2dc4dd
+      {
2dc4dd
+        parse_subnet ();
2dc4dd
+        next;
2dc4dd
+      }
2dc4dd
+    elsif ($token eq 'shared-network')
2dc4dd
+      {
2dc4dd
+        parse_shared_network ();
2dc4dd
+        next;
2dc4dd
+      }
2dc4dd
+    elsif ($token eq 'class')
2dc4dd
+      {
2dc4dd
+        parse_class ();
2dc4dd
+        next;
2dc4dd
+      }
2dc4dd
+    elsif ($token eq 'subclass')
2dc4dd
+      {
2dc4dd
+        parse_subclass ();
2dc4dd
+        next;
2dc4dd
+      }
2dc4dd
+    elsif ($token eq 'pool')
2dc4dd
+      {
2dc4dd
+        parse_pool ();
2dc4dd
+        next;
2dc4dd
+      }
2dc4dd
+    elsif ($token eq 'group')
2dc4dd
+      {
2dc4dd
+        parse_group ();
2dc4dd
+        next;
2dc4dd
+      }
2dc4dd
+    elsif ($token eq 'host')
2dc4dd
+      {
2dc4dd
+        parse_host ();
2dc4dd
+        next;
2dc4dd
+      }
2dc4dd
+    elsif ($token eq 'hardware')
2dc4dd
+      {
2dc4dd
+        parse_hwaddress ();
2dc4dd
+        next;
2dc4dd
+      }
2dc4dd
+    elsif ($token eq 'range')
2dc4dd
+      {
2dc4dd
+        parse_range ();
2dc4dd
+        next;
2dc4dd
+      }
2dc4dd
+    else
2dc4dd
+      {
2dc4dd
+        parse_statement ($token);
2dc4dd
+        next;
2dc4dd
+      }
2dc4dd
+  }
2dc4dd
+
2dc4dd
+
2dc4dd
--- /dev/null	2007-01-31 10:24:38.956568237 -0500
2dc4dd
+++ dhcp-3.0.5/doc/draft-ietf-dhc-ldap-schema-01.txt	2007-01-31 20:39:38.000000000 -0500
2dc4dd
@@ -0,0 +1,1089 @@
2dc4dd
+
2dc4dd
+
2dc4dd
+
2dc4dd
+
2dc4dd
+
2dc4dd
+Network Working Group                                  M. Meredith,
2dc4dd
+Internet Draft                                         V. Nanjundaswamy,
2dc4dd
+Document: <draft-ietf-dhc-ldap-schema-00.txt>          M. Hinckley
2dc4dd
+Category: Proposed Standard                            Novell Inc.
2dc4dd
+Expires: 15th December 2001                            16th June 2001
2dc4dd
+
2dc4dd
+
2dc4dd
+                          LDAP Schema for DHCP
2dc4dd
+
2dc4dd
+Status of this Memo
2dc4dd
+
2dc4dd
+This document is an Internet-Draft and is in full conformance with all
2dc4dd
+provisions of Section 10 of RFC2026 [ ].
2dc4dd
+
2dc4dd
+Internet-Drafts are working documents of the Internet Engineering Task
2dc4dd
+Force (IETF), its areas, and its working groups.  Note that other groups
2dc4dd
+may also distribute working documents as Internet-Drafts. Internet-
2dc4dd
+Drafts are draft documents valid for a maximum of six months and may be
2dc4dd
+updated, replaced, or obsolete by other documents at any time.  It is
2dc4dd
+inappropriate to use Internet-Drafts as reference material or to cite
2dc4dd
+them other than as "work in progress."  The list of current Internet-
2dc4dd
+Drafts can be accessed at http://www.ietf.org/ietf/1id-abstracts.txt The
2dc4dd
+list of Internet-Draft Shadow Directories can be accessed at
2dc4dd
+http://www.ietf.org/shadow.html.
2dc4dd
+
2dc4dd
+1. Abstract
2dc4dd
+
2dc4dd
+This document defines a schema for representing DHCP configuration in an
2dc4dd
+LDAP directory. It can be used to represent the DHCP Service
2dc4dd
+configuration(s) for an entire enterprise network, a subset of the
2dc4dd
+network, or even a single server. Representing DHCP configuration in an
2dc4dd
+LDAP directory enables centralized management of DHCP services offered
2dc4dd
+by one or more DHCP Servers within the enterprise.
2dc4dd
+
2dc4dd
+2. Conventions used in this document
2dc4dd
+
2dc4dd
+The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
2dc4dd
+"SHOULD", "SHOULD NOT", "RECOMMENDED",  "MAY", and "OPTIONAL" in this
2dc4dd
+document are to be interpreted as described in RFC-2119 [ ].
2dc4dd
+
2dc4dd
+In places where different sets of terminology are commonly used to
2dc4dd
+represent similar DHCP concepts, this schema uses the terminology of the
2dc4dd
+Internet Software Consortium's DHCP server reference implementation.
2dc4dd
+For more information see www.isc.org.
2dc4dd
+
2dc4dd
+3. Design Considerations
2dc4dd
+
2dc4dd
+The DHCP LDAP schema is designed to be a simple multi-server schema. The
2dc4dd
+
2dc4dd
+
2dc4dd
+
2dc4dd
+M. Meredith et al.        Expires December 2001                 [Page 1]
2dc4dd
+
2dc4dd
+
2dc4dd
+
2dc4dd
+
2dc4dd
+
2dc4dd
+INTERNET-DRAFT            LDAP Schema for DHCP              16 June 2001
2dc4dd
+
2dc4dd
+
2dc4dd
+intent of this schema is to provide a basic framework for representing
2dc4dd
+the most common elements used in the configuration of DHCP Server.  This
2dc4dd
+should allow other network services to obtain and use basic DHCP
2dc4dd
+configuration information in a server-independent but knowledgeable way.
2dc4dd
+
2dc4dd
+It is expected that some implementations may need to extend the schema
2dc4dd
+objects, in order to implement all of their features or needs. It is
2dc4dd
+recommended that you use the schema defined in this draft to represent
2dc4dd
+DHCP configuration information in an LDAP directory.  Conforming to a
2dc4dd
+standard schema improves interoperability between DHCP implementations
2dc4dd
+from different vendors.
2dc4dd
+
2dc4dd
+Some implementations may choose not to support all of the objects
2dc4dd
+defined here.
2dc4dd
+
2dc4dd
+Two decisions are explicitly left up to each implementation:
2dc4dd
+
2dc4dd
+First, implementations may choose not to store the lease information in
2dc4dd
+the directory, so those objects would not be used.
2dc4dd
+
2dc4dd
+Second, implementations may choose not to implement the auditing
2dc4dd
+information.
2dc4dd
+
2dc4dd
+It is up to the implementation to determine if the data in the directory
2dc4dd
+is considered "authoritative", or if it is simply a copy of data from an
2dc4dd
+authoritative source. Validity of the information if used as a copy is
2dc4dd
+to be ensured by the implementation.
2dc4dd
+
2dc4dd
+Primarily two types of applications will use the information in this
2dc4dd
+schema: 1. DHCP servers (for loading their configuration) 2. Management
2dc4dd
+Interfaces (for defining/editing configurations).
2dc4dd
+
2dc4dd
+The schema should be efficient for the needs of both types of
2dc4dd
+applications.  The schema is designed to allow objects managed by DHCP
2dc4dd
+(such as computers, subnets, etc) to be present anywhere in a directory
2dc4dd
+hierarchy (to allow those objects to be placed in the directory for
2dc4dd
+managing administrative control and access to the objects).
2dc4dd
+
2dc4dd
+The schema uses a few naming conventions - all object classes and
2dc4dd
+attributes are prefixed with "dhcp" to decrease the chance that object
2dc4dd
+classes and attributes will have the same name.  The schema also uses
2dc4dd
+standard naming attributes ("cn", "ou", etc) for all objects.
2dc4dd
+
2dc4dd
+4. Common DHCP Configuration Attributes
2dc4dd
+
2dc4dd
+Although DHCP manages several different types of objects, the
2dc4dd
+configuration of those objects is often similar.  Consequently, most of
2dc4dd
+these objects have a common set of attributes, which are defined below.
2dc4dd
+
2dc4dd
+
2dc4dd
+
2dc4dd
+M. Meredith et al.        Expires December 2001                 [Page 2]
2dc4dd
+
2dc4dd
+
2dc4dd
+
2dc4dd
+
2dc4dd
+
2dc4dd
+INTERNET-DRAFT            LDAP Schema for DHCP              16 June 2001
2dc4dd
+
2dc4dd
+
2dc4dd
+4.1. Attributes Definitions
2dc4dd
+
2dc4dd
+The schema definitions listed below are for readability.  The LDIF
2dc4dd
+layout for this schema will follow in section 8.
2dc4dd
+
2dc4dd
+Name: dhcpPrimaryDN Description: The Distinguished Name of the
2dc4dd
+dhcpServer object, which is the primary server for the configuration.
2dc4dd
+Syntax: DN Flags: SINGLE-VALUE
2dc4dd
+
2dc4dd
+Named: dhcpSecondaryDN Description: The Distinguished Name(s) of the
2dc4dd
+dhcpServer object(s), which are secondary servers for the configuration.
2dc4dd
+Syntax: DN
2dc4dd
+
2dc4dd
+Name: dhcpStatements Description: Flexible storage for representing any
2dc4dd
+specific data depending on the object to which it is attached. Examples
2dc4dd
+include conditional statements, Server parameters, etc.  This also
2dc4dd
+serves as a 'catch-all' attribute that allows the standard to evolve
2dc4dd
+without needing to update the schema.  Syntax: IA5String
2dc4dd
+
2dc4dd
+Name: dhcpRange Description: The starting and ending IP Addresses in the
2dc4dd
+range (inclusive), separated by a hyphen; if the range only contains one
2dc4dd
+address, then just the address can be specified with no hyphen.  Each
2dc4dd
+range is defined as a separate value.  Syntax: IA5String
2dc4dd
+
2dc4dd
+Name: dhcpPermitList Description: This attribute contains the permit
2dc4dd
+lists associated with a pool. Each permit list is defined as a separate
2dc4dd
+value.  Syntax: IA5String
2dc4dd
+
2dc4dd
+Name: dhcpNetMask Description: The subnet mask length for the subnet.
2dc4dd
+The mask can be easily computed from this length.  Syntax: Integer
2dc4dd
+Flags: SINGLE-VALUE
2dc4dd
+
2dc4dd
+Name: dhcpOption Description: Encoded option values to be sent to
2dc4dd
+clients.  Each value represents a single option and contains (OptionTag,
2dc4dd
+Length, OptionData) encoded in the format used by DHCP.  For more
2dc4dd
+information see [DHCPOPT].  Syntax: OctetString
2dc4dd
+
2dc4dd
+Name: dhcpClassData Description: Encoded text string or list of bytes
2dc4dd
+expressed in hexadecimal, separated by colons. Clients match subclasses
2dc4dd
+based on matching the class data with the results of a 'match' or 'spawn
2dc4dd
+with' statement in the class name declarations.  Syntax: IA5String
2dc4dd
+Flags: SINGLE-VALUE
2dc4dd
+
2dc4dd
+Name: dhcpSubclassesDN Description: List of subclasses, these are the
2dc4dd
+actual DN of each subclass object.  Syntax: DN
2dc4dd
+
2dc4dd
+Name: dhcpClassesDN Description: List of classes, these are the actual
2dc4dd
+DN of each class object.  Syntax: DN
2dc4dd
+
2dc4dd
+
2dc4dd
+
2dc4dd
+M. Meredith et al.        Expires December 2001                 [Page 3]
2dc4dd
+
2dc4dd
+
2dc4dd
+
2dc4dd
+
2dc4dd
+
2dc4dd
+INTERNET-DRAFT            LDAP Schema for DHCP              16 June 2001
2dc4dd
+
2dc4dd
+
2dc4dd
+Name: dhcpSubnetDN Description: List of subnets, these are the actual DN
2dc4dd
+of each subnet object.  Syntax: DN
2dc4dd
+
2dc4dd
+Name: dhcpPoolDN Description: List of pools, these are the actual DN of
2dc4dd
+each Pool object.  Syntax: DN
2dc4dd
+
2dc4dd
+Name: dhcpOptionsDN Description: List of options, these are the actual
2dc4dd
+DN of each Options object.  Syntax: DN
2dc4dd
+
2dc4dd
+Name: dhcpHostDN Description: List of hosts, these are the actual DN of
2dc4dd
+each host object.  Syntax: DN
2dc4dd
+
2dc4dd
+Name: dhcpSharedNetworkDN Description: List of shared networks, these
2dc4dd
+are the actual DN of each shared network object.  Syntax: DN
2dc4dd
+
2dc4dd
+Name: dhcpGroupDN Description: List of groups, these are the actual DN
2dc4dd
+of each Group object.  Syntax: DN
2dc4dd
+
2dc4dd
+Name: dhcpLeaseDN Description: Single Lease DN. A dhcpHost configuration
2dc4dd
+uses this attribute to identify a static IP address assignment.  Syntax:
2dc4dd
+DN Flags: SINGLE-VALUE
2dc4dd
+
2dc4dd
+Name: dhcpLeasesDN Description: List of leases, these are the actual DN
2dc4dd
+of each lease object.  Syntax: DN
2dc4dd
+
2dc4dd
+Name: dhcpServiceDN Description: The DN of dhcpService object(s)which
2dc4dd
+contain the configuration information. Each dhcpServer object has this
2dc4dd
+attribute identifying the DHCP configuration(s) that the server is
2dc4dd
+associated with.  Syntax: DN
2dc4dd
+
2dc4dd
+Name: dhcpHWAddress Description: The hardware address of the client
2dc4dd
+associated with a lease Syntax: OctetString Flags: SINGLE-VALUE
2dc4dd
+
2dc4dd
+Name: dhcpVersion Description: This is the version identified for the
2dc4dd
+object that this attribute is part of. In case of the dhcpServer object,
2dc4dd
+this represents the DHCP software version.  Syntax: IA5String Flags:
2dc4dd
+SINGLE-VALUE
2dc4dd
+
2dc4dd
+Name: dhcpImplementation Description: DHCP Server implementation
2dc4dd
+description e.g. DHCP Vendor information.  Syntax: IA5String Flags:
2dc4dd
+SINGLE-VALUE
2dc4dd
+
2dc4dd
+Name: dhcpHashBucketAssignment Description: HashBucketAssignment bit map
2dc4dd
+for the DHCP Server, as defined in DHC Load Balancing Algorithm [RFC
2dc4dd
+3074].  Syntax: Octet String Flags: SINGLE-VALUE
2dc4dd
+
2dc4dd
+Name: dhcpDelayedServiceParameter Description: Delay in seconds
2dc4dd
+corresponding to Delayed Service Parameter configuration, as defined in
2dc4dd
+
2dc4dd
+
2dc4dd
+
2dc4dd
+M. Meredith et al.        Expires December 2001                 [Page 4]
2dc4dd
+
2dc4dd
+
2dc4dd
+
2dc4dd
+
2dc4dd
+
2dc4dd
+INTERNET-DRAFT            LDAP Schema for DHCP              16 June 2001
2dc4dd
+
2dc4dd
+
2dc4dd
+DHC Load Balancing Algorithm [RFC 3074].  Syntax: Integer Flags: SINGLE-
2dc4dd
+VALUE
2dc4dd
+
2dc4dd
+Name: dhcpMaxClientLeadTime Description: Maximum Client Lead Time
2dc4dd
+configuration in seconds, as defined in DHCP Failover Protocol [FAILOVR]
2dc4dd
+Syntax: Integer Flags: SINGLE-VALUE
2dc4dd
+
2dc4dd
+Name: dhcpFailOverEndpointState Description: Server (Failover Endpoint)
2dc4dd
+state, as defined in DHCP Failover Protocol [FAILOVR] Syntax: IA5String
2dc4dd
+Flags: SINGLE-VALUE
2dc4dd
+
2dc4dd
+5. Configurations and Services
2dc4dd
+
2dc4dd
+The schema definitions below are for readability the LDIF layout for
2dc4dd
+this schema will follow in section 8.
2dc4dd
+
2dc4dd
+The DHC working group is currently considering several proposals for
2dc4dd
+fail-over and redundancy of DHCP servers.  These may require sharing of
2dc4dd
+configuration information between servers.  This schema provides a
2dc4dd
+generalized mechanism for supporting any of these proposals, by
2dc4dd
+separating the definition of a server from the definition of
2dc4dd
+configuration service provided by the server.
2dc4dd
+
2dc4dd
+Separating the DHCP Server (dhcpServer) and the DHCP Configuration
2dc4dd
+(dhcpService) representations allows a configuration service to be
2dc4dd
+provided by one or more servers. Similarly, a server may provide one or
2dc4dd
+more configurations. The schema allows a server to be configured as
2dc4dd
+either a primary or secondary provider of a DHCP configuration.
2dc4dd
+
2dc4dd
+Configurations are also defined so that one configuration can include
2dc4dd
+some of the objects that are defined in another configuration.  This
2dc4dd
+allows for sharing and/or a hierarchy of related configuration items.
2dc4dd
+
2dc4dd
+Name: dhcpService Description:  Service object that represents the
2dc4dd
+actual DHCP Service configuration. This will be a container with the
2dc4dd
+following attributes.  Must: cn, dhcpPrimaryDN May: dhcpSecondaryDN,
2dc4dd
+dhcpSharedNetworkDN, dhcpSubnetDN, dhcpGroupDN, dhcpHostDN,
2dc4dd
+dhcpClassesDN, dhcpOptionsDN, dhcpStatements
2dc4dd
+
2dc4dd
+The following objects could exist inside the dhcpService container:
2dc4dd
+dhcpSharedNetwork, dhcpSubnet, dhcpGroup, dhcpHost, dhcpClass,
2dc4dd
+dhcpOptions, dhcpLog
2dc4dd
+
2dc4dd
+Name: dhcpServer Description:  Server object that the DHCP server will
2dc4dd
+login as.  The configuration information is in the dhcpService container
2dc4dd
+that the dhcpServiceDN points to.  Must: cn, dhcpServiceDN May:
2dc4dd
+dhcpVersion, dhcpImplementation, dhcpHashBucketAssignment,
2dc4dd
+dhcpDelayedServiceParameter, dhcpMaxClientLeadTime, 
2dc4dd
+
2dc4dd
+
2dc4dd
+
2dc4dd
+M. Meredith et al.        Expires December 2001                 [Page 5]
2dc4dd
+
2dc4dd
+
2dc4dd
+
2dc4dd
+
2dc4dd
+
2dc4dd
+INTERNET-DRAFT            LDAP Schema for DHCP              16 June 2001
2dc4dd
+dhcpFailOverEndpointState, dhcpStatements
2dc4dd
+
2dc4dd
+5.1. DHCP Declaration related classes:
2dc4dd
+
2dc4dd
+Name: dhcpSharedNetwork Description: Shared Network class will list what
2dc4dd
+pools and subnets are in this network.
2dc4dd
+
2dc4dd
+This will be a container with the following attributes.  Must: cn May:
2dc4dd
+dhcpSubnetDN, dhcpPoolDN, dhcpOptionsDN, dhcpStatements
2dc4dd
+
2dc4dd
+The following objects can exist within a dhcpSharedNetwork container:
2dc4dd
+dhcpSubnet, dhcpPool, dhcpOptions, dhcpLog
2dc4dd
+
2dc4dd
+Name: dhcpSubnet Description: Subnet object will include configuration
2dc4dd
+information associated with a subnet, including a range and a net mask.
2dc4dd
+
2dc4dd
+This will be a container with the following attributes.  Must: cn
2dc4dd
+(Subnet address), dhcpNetMask May: dhcpRange, dhcpPoolDN, dhcpGroupDN,
2dc4dd
+dhcpHostDN, dhcpClassesDN, dhcpLeasesDN, dhcpOptionsDN, dhcpStatements
2dc4dd
+
2dc4dd
+The following objects can exist within a dhcpSubnet container: dhcpPool,
2dc4dd
+dhcpGroup, dhcpHost, dhcpClass, dhcpOptions, dhcpLease, dhcpLog
2dc4dd
+
2dc4dd
+Name: dhcpGroup Description: Group object will have configuration
2dc4dd
+information associated with a group.
2dc4dd
+
2dc4dd
+This will be a container with the following attributes.  Must: cn May:
2dc4dd
+dhcpHostDN, dhcpOptionsDN, dhcpStatements
2dc4dd
+
2dc4dd
+The following objects can exist within a dhcpGroup container: dhcpHost,
2dc4dd
+dhcpOptions
2dc4dd
+
2dc4dd
+Name: dhcpHost Description: The host object includes DHCP host
2dc4dd
+declarations to assign a static IP address or declare the client as
2dc4dd
+known or specify statements for a specific client.  Must: cn May:
2dc4dd
+dhcpLeaseDN, dhcpHWAddress, dhcpOptionsDN, dhcpStatements
2dc4dd
+
2dc4dd
+The following objects can exist within a dhcpHost container: dhcpLease,
2dc4dd
+dhcpOptions
2dc4dd
+
2dc4dd
+Name: dhcpOptions Description: The options class is for option space
2dc4dd
+declarations, it contains a list of options.  Must: cn, dhcpOption
2dc4dd
+
2dc4dd
+Name: dhcpClass Description: This is a class to group clients together
2dc4dd
+based on matching rules.
2dc4dd
+
2dc4dd
+This will be a container with the following attributes.  Must: cn May:
2dc4dd
+dhcpSubClassesDN, dhcpOptionsDN, dhcpStatements
2dc4dd
+
2dc4dd
+The following object can exist within a dhcpClass container:
2dc4dd
+dhcpSubclass, dhcpOptions
2dc4dd
+
2dc4dd
+
2dc4dd
+
2dc4dd
+M. Meredith et al.        Expires December 2001                 [Page 6]
2dc4dd
+
2dc4dd
+
2dc4dd
+
2dc4dd
+
2dc4dd
+
2dc4dd
+INTERNET-DRAFT            LDAP Schema for DHCP              16 June 2001
2dc4dd
+
2dc4dd
+
2dc4dd
+Name: dhcpSubClass Description: This includes configuration information
2dc4dd
+for a subclass associated with a class. The dhcpSubClass object will
2dc4dd
+always be contained within the corresponding class container object.
2dc4dd
+Must: cn May:  dhcpClassData, dhcpOptionsDN, dhcpStatements
2dc4dd
+
2dc4dd
+Name: dhcpPool Description: This contains configuration for a pool that
2dc4dd
+will have the range of addresses, permit lists and point to classes and
2dc4dd
+leases that are members of this pool.
2dc4dd
+
2dc4dd
+This will be a container that could be contained by dhcpSubnet or a
2dc4dd
+dhcpSharedNetwork.  Must: cn, dhcpRange May: dhcpClassesDN,
2dc4dd
+dhcpPermitList, dhcpLeasesDN, dhcpOptionsDN, dhcpStatements
2dc4dd
+
2dc4dd
+The following objects can exist within a dhcpPool container: dhcpClass,
2dc4dd
+dhcpOptions, dhcpLease, dhcpLog
2dc4dd
+
2dc4dd
+6. Tracking Address Assignments
2dc4dd
+
2dc4dd
+The behavior of a DHCP server is influenced by two factors - it's
2dc4dd
+configuration and the current state of the addresses that have been
2dc4dd
+assigned to clients. This schema defines a set of objects for
2dc4dd
+representing the DHCP configuration associated with a server. The
2dc4dd
+following object classes provide the ability to record how addresses are
2dc4dd
+used including maintaining history (audit log) on individual leases.
2dc4dd
+Recording lease information in a directory could result in a significant
2dc4dd
+performance impact and is therefore optional. Implementations supporting
2dc4dd
+logging of leases need to consider the performance impact.
2dc4dd
+
2dc4dd
+6.1. dhcpLeases Attribute Definitions
2dc4dd
+
2dc4dd
+The schema definitions below are for readability the LDIF layout for
2dc4dd
+this schema will follow in section 8.
2dc4dd
+
2dc4dd
+Name: dhcpAddressState Description: This stores information about the
2dc4dd
+current binding-status of an address.  For dynamic addresses managed by
2dc4dd
+DHCP, the values should be restricted to the states defined in the DHCP
2dc4dd
+Failover Protocol draft [FAILOVR]: 'FREE', 'ACTIVE', 'EXPIRED',
2dc4dd
+'RELEASED', 'RESET', 'ABANDONED', 'BACKUP'.  For more information on
2dc4dd
+these states see [FAILOVR].  For other addresses, it SHOULD be one of
2dc4dd
+the following: 'UNKNOWN', 'RESERVED' (an address that is managed by DHCP
2dc4dd
+that is reserved for a specific client), 'RESERVED-ACTIVE' (same as
2dc4dd
+reserved, but address is currently in use),  'ASSIGNED' (assigned
2dc4dd
+manually or by some other mechanism), 'UNASSIGNED', 'NOTASSIGNABLE'.
2dc4dd
+Syntax: IA5String Flags: SINGLE-VALUE
2dc4dd
+
2dc4dd
+Name: dhcpExpirationTime Description: This is the time the current lease
2dc4dd
+for an address expires.  Syntax: DateTime Flags: SINGLE-VALUE
2dc4dd
+
2dc4dd
+
2dc4dd
+
2dc4dd
+
2dc4dd
+M. Meredith et al.        Expires December 2001                 [Page 7]
2dc4dd
+
2dc4dd
+
2dc4dd
+
2dc4dd
+
2dc4dd
+
2dc4dd
+INTERNET-DRAFT            LDAP Schema for DHCP              16 June 2001
2dc4dd
+
2dc4dd
+
2dc4dd
+Name: dhcpStartTimeOfState Description: This is the time of the last
2dc4dd
+state change for a leased address.  Syntax: DateTime Flags: SINGLE-VALUE
2dc4dd
+
2dc4dd
+Name: dhcpLastTransactionTime Description: This is the last time a valid
2dc4dd
+DHCP packet was received from the client.  Syntax: DateTime Flags:
2dc4dd
+SINGLE-VALUE
2dc4dd
+
2dc4dd
+Name: dhcpBootpFlag Description: This indicates whether the address was
2dc4dd
+assigned via BOOTP Syntax: Boolean Flags: SINGLE-VALUE
2dc4dd
+
2dc4dd
+Name: dhcpDomainName Description: This is the name of the domain sent to
2dc4dd
+the client by the server.  It is essentially the same as the value for
2dc4dd
+DHCP option 15 sent to the client, and represents only the domain - not
2dc4dd
+the full FQDN.  To obtain the full FQDN assigned to the client you must
2dc4dd
+prepend the "dhcpAssignedHostName" to this value with a ".".  Syntax:
2dc4dd
+IA5String Flags: SINGLE-VALUE
2dc4dd
+
2dc4dd
+Name: dhcpDnsStatus Description: This indicates the status of updating
2dc4dd
+DNS resource records on behalf of the client by the DHCP server for this
2dc4dd
+address.  The value is a 16-bit bitmask that has the same values as
2dc4dd
+specified by the Failover-DDNS option (see [FAILOVR]).  Syntax: Integer
2dc4dd
+Flags: SINGLE-VALUE
2dc4dd
+
2dc4dd
+Name: dhcpRequestedHostName Description: This is the hostname that was
2dc4dd
+requested by the client.  Syntax: IA5String Flags: SINGLE-VALUE
2dc4dd
+
2dc4dd
+Name: dhcpAssignedHostName Description: This is the actual hostname that
2dc4dd
+was assigned to a client. It may not be the name that was requested by
2dc4dd
+the client.  The fully qualified domain name can be determined by
2dc4dd
+appending the value of "dhcpDomainName" (with a dot separator) to this
2dc4dd
+name.  Syntax: IA5String Flags: SINGLE-VALUE
2dc4dd
+
2dc4dd
+Name: dhcpReservedForClient Description: This is the distinguished name
2dc4dd
+of the "dhcpHost" that an address is reserved for.  This may not be the
2dc4dd
+same as the "dhcpAssignedToClient" attribute if the address is being
2dc4dd
+reassigned but the current lease has not yet expired.  Syntax: DN Flags:
2dc4dd
+SINGLE-VALUE
2dc4dd
+
2dc4dd
+Name: dhcpAssignedToClient Description: This is the distinguished name
2dc4dd
+of a "dhcpHost" that an address is currently assigned to.  This
2dc4dd
+attribute is only present in the class when the address is leased.
2dc4dd
+Syntax: DN Flags: SINGLE-VALUE
2dc4dd
+
2dc4dd
+Name: dhcpRelayAgentInfo Description: If the client request was received
2dc4dd
+via a relay agent, this contains information about the relay agent that
2dc4dd
+was available from the DHCP request.  This is a hex-encoded option
2dc4dd
+value.  Syntax: OctetString Flags: SINGLE-VALUE
2dc4dd
+
2dc4dd
+Name: dhcpErrorLog Description: Generic error log attribute that allows
2dc4dd
+logging error conditions within a dhcpService or a dhcpSubnet, like no IP 
2dc4dd
+addresses available for lease. Syntax: IA5String 
2dc4dd
+
2dc4dd
+M. Meredith et al.        Expires December 2001                 [Page 8]
2dc4dd
+
2dc4dd
+
2dc4dd
+
2dc4dd
+
2dc4dd
+
2dc4dd
+INTERNET-DRAFT            LDAP Schema for DHCP              16 June 2001
2dc4dd
+
2dc4dd
+
2dc4dd
+6.2.  dhcpLeases Object Class
2dc4dd
+
2dc4dd
+This class represents an IP address.  It may or may not be leaseable,
2dc4dd
+and the object may exist even though a lease is not currently active for
2dc4dd
+the associated IP address.
2dc4dd
+
2dc4dd
+It is recommended that all Lease objects for a single DHCP Service be
2dc4dd
+centrally located within a single container. This ensures that the lease
2dc4dd
+objects and the corresponding logs do not have to be relocated, when
2dc4dd
+address ranges allocated to individual DHCP subnets and/or pools change.
2dc4dd
+
2dc4dd
+The schema definitions below are for readability the LDIF layout for
2dc4dd
+this schema will follow in section 8.
2dc4dd
+
2dc4dd
+Name: dhcpLeases Description: This is the object that holds state
2dc4dd
+information about an IP address. The cn (which is the IP address), and
2dc4dd
+the current address-state are mandatory attributes. If the address is
2dc4dd
+assigned then, some of the optional attributes will have valid data.
2dc4dd
+Must: cn, dhcpAddressState May: dhcpExpirationTime,
2dc4dd
+dhcpStartTimeOfState, dhcpLastTransactionTime, dhcpBootpFlag,
2dc4dd
+dhcpDomainName, dhcpDnsStatus, dhcpRequestedHostName,
2dc4dd
+dhcpAssignedHostName, dhcpReservedForClient, dhcpAssignedToClient,
2dc4dd
+dhcpRelayAgentInfo, dhcpHWAddress
2dc4dd
+
2dc4dd
+6.3 Audit Log Information
2dc4dd
+
2dc4dd
+A dhcpLog object is created whenever a lease is assigned or released.
2dc4dd
+This object is intended to be created under the corresponding dhcpLeases
2dc4dd
+container, or dhcpPool, dhcpSubnet, dhcpSharedNetwork or dhcpService
2dc4dd
+containers.
2dc4dd
+
2dc4dd
+The log information under the dhcpLeases container would be for
2dc4dd
+addresses matching that lease information. The log information in the
2dc4dd
+other containers could be used for errors, i.e. when a pool or subnet is
2dc4dd
+out our addresses or if a server is not able to assign any more
2dc4dd
+addresses for a particular dhcpService.
2dc4dd
+
2dc4dd
+Name: dhcpLog Description: This is the object that holds past
2dc4dd
+information about an IP address. The cn is the time/date stamp when the
2dc4dd
+address was assigned or released, the address state at the time, if the
2dc4dd
+address was assigned or released.  Must: cn May: dhcpAddressState,
2dc4dd
+dhcpExpirationTime, dhcpStartTimeOfState, dhcpLastTransactionTime,
2dc4dd
+dhcpBootpFlag, dhcpDomainName, dhcpDnsStatus, dhcpRequestedHostName,
2dc4dd
+dhcpAssignedHostName, dhcpReservedForClient, dhcpAssignedToClient,
2dc4dd
+dhcpRelayAgentInfo, dhcpHWAddress, dhcpErrorLog
2dc4dd
+
2dc4dd
+
2dc4dd
+
2dc4dd
+
2dc4dd
+
2dc4dd
+
2dc4dd
+M. Meredith et al.        Expires December 2001                 [Page 9]
2dc4dd
+
2dc4dd
+
2dc4dd
+
2dc4dd
+
2dc4dd
+
2dc4dd
+INTERNET-DRAFT            LDAP Schema for DHCP              16 June 2001
2dc4dd
+
2dc4dd
+
2dc4dd
+7. Determining settings
2dc4dd
+
2dc4dd
+The dhcpStatements attribute is the key to DHC enhancements that may
2dc4dd
+come along, and the different key words that a particular server
2dc4dd
+implementation may use. This attribute can be used to hold conditional
2dc4dd
+DHCP Statements and DHCP server parameters. Having a generic settings
2dc4dd
+attribute that is just a string, allows this schema to be extensible and
2dc4dd
+easy to configure.
2dc4dd
+
2dc4dd
+All of the attributes that end with DN are references to the class that
2dc4dd
+precedes the DN e.g. the dhcpPrimaryDN and dhcpSecondaryDN attributes
2dc4dd
+hold the Distinguished Names of the dhcpServer objects that are
2dc4dd
+associated with the dhcpService object.
2dc4dd
+
2dc4dd
+8. LDIF format for attributes and classes.
2dc4dd
+
2dc4dd
+# Attributes
2dc4dd
+
2dc4dd
+( 2.16.840.1.113719.1.203.4.1 NAME 'dhcpPrimaryDN' DESC
2dc4dd
+'The DN of the dhcpServer which is the primary server for the
2dc4dd
+configuration.' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE )
2dc4dd
+
2dc4dd
+( 2.16.840.1.113719.1.203.4.2 NAME 'dhcpSecondaryDN' DESC 'The DN of
2dc4dd
+dhcpServer(s) which provide backup service for the configuration.'
2dc4dd
+SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 )
2dc4dd
+
2dc4dd
+( 2.16.840.1.113719.1.203.4.3 NAME 'dhcpStatements' DESC 'Flexible
2dc4dd
+storage for specific data depending on what object this exists in. Like
2dc4dd
+conditional statements, server parameters, etc. This allows the standard
2dc4dd
+to evolve without needing to adjust the schema.' SYNTAX
2dc4dd
+1.3.6.1.4.1.1466.115.121.1.26 )
2dc4dd
+
2dc4dd
+( 2.16.840.1.113719.1.203.4.4 NAME 'dhcpRange' DESC 'The starting &
2dc4dd
+ending IP Addresses in the range (inclusive), separated by a hyphen; if
2dc4dd
+the range only contains one address, then just the address can be
2dc4dd
+specified with no hyphen.  Each range is defined as a separate value.'
2dc4dd
+SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 )
2dc4dd
+
2dc4dd
+( 2.16.840.1.113719.1.203.4.5 NAME 'dhcpPermitList' DESC 'This attribute
2dc4dd
+contains the permit lists associated with a pool. Each permit list is
2dc4dd
+defined as a separate value.' SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 )
2dc4dd
+
2dc4dd
+( 2.16.840.1.113719.1.203.4.6 NAME 'dhcpNetMask' DESC 'The subnet mask
2dc4dd
+length for the subnet.  The mask can be easily computed from this
2dc4dd
+length.' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )
2dc4dd
+
2dc4dd
+( 2.16.840.1.113719.1.203.4.7 NAME 'dhcpOption' DESC 'Encoded option
2dc4dd
+values to be sent to clients.  Each value represents a single option and
2dc4dd
+contains (OptionTag, Length, OptionValue) encoded in the format used by
2dc4dd
+DHCP.' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40 )
2dc4dd
+
2dc4dd
+M. Meredith et al.        Expires December 2001                [Page 10]
2dc4dd
+
2dc4dd
+
2dc4dd
+
2dc4dd
+
2dc4dd
+
2dc4dd
+INTERNET-DRAFT            LDAP Schema for DHCP              16 June 2001
2dc4dd
+
2dc4dd
+
2dc4dd
+( 2.16.840.1.113719.1.203.4.8 NAME 'dhcpClassData' DESC 'Encoded text
2dc4dd
+string or list of bytes expressed in hexadecimal, separated by colons.
2dc4dd
+Clients match subclasses based on matching the class data with the
2dc4dd
+results of match or spawn with statements in the class name
2dc4dd
+declarations.' SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE )
2dc4dd
+
2dc4dd
+( 2.16.840.1.113719.1.203.4.9 NAME 'dhcpOptionsDN' DESC 'The
2dc4dd
+distinguished name(s) of the dhcpOption objects containing the
2dc4dd
+configuration options provided by the server.' SYNTAX
2dc4dd
+1.3.6.1.4.1.1466.115.121.1.12 )
2dc4dd
+
2dc4dd
+( 2.16.840.1.113719.1.203.4.10 NAME 'dhcpHostDN' DESC 'the distinguished
2dc4dd
+name(s) of the dhcpHost objects.' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 )
2dc4dd
+
2dc4dd
+( 2.16.840.1.113719.1.203.4.11 NAME 'dhcpPoolDN' DESC 'The distinguished
2dc4dd
+name(s) of pools.' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 )
2dc4dd
+
2dc4dd
+( 2.16.840.1.113719.1.203.4.12 NAME 'dhcpGroupDN' DESC 'The
2dc4dd
+distinguished name(s)   of the groups.' SYNTAX
2dc4dd
+1.3.6.1.4.1.1466.115.121.1.12 )
2dc4dd
+
2dc4dd
+( 2.16.840.1.113719.1.203.4.13 NAME 'dhcpSubnetDN' DESC 'The
2dc4dd
+distinguished name(s) of the subnets.' SYNTAX
2dc4dd
+1.3.6.1.4.1.1466.115.121.1.12 )
2dc4dd
+
2dc4dd
+( 2.16.840.1.113719.1.203.4.14 NAME 'dhcpLeaseDN' DESC 'The
2dc4dd
+distinguished name of a client address.' SYNTAX
2dc4dd
+1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE)
2dc4dd
+
2dc4dd
+( 2.16.840.1.113719.1.203.4.15 NAME 'dhcpLeasesDN' DESC 'The
2dc4dd
+distinguished name(s) client addresses.' SYNTAX
2dc4dd
+1.3.6.1.4.1.1466.115.121.1.12 )
2dc4dd
+
2dc4dd
+( 2.16.840.1.113719.1.203.4.16 NAME 'dhcpClassesDN' DESC 'The
2dc4dd
+distinguished name(s) of a class(es) in a subclass.' SYNTAX
2dc4dd
+1.3.6.1.4.1.1466.115.121.1.12 )
2dc4dd
+
2dc4dd
+( 2.16.840.1.113719.1.203.4.17 NAME 'dhcpSubclassesDN' DESC 'The
2dc4dd
+distinguished name(s) of subclass(es).' SYNTAX
2dc4dd
+1.3.6.1.4.1.1466.115.121.1.12 )
2dc4dd
+
2dc4dd
+( 2.16.840.1.113719.1.203.4.18 NAME 'dhcpSharedNetworkDN' DESC 'The
2dc4dd
+distinguished name(s) of sharedNetworks.' SYNTAX
2dc4dd
+1.3.6.1.4.1.1466.115.121.1.12 )
2dc4dd
+
2dc4dd
+( 2.16.840.1.113719.1.203.4.19 NAME 'dhcpServiceDN' DESC 'The DN of
2dc4dd
+dhcpService object(s)which contain the configuration information. Each
2dc4dd
+dhcpServer object has this attribute identifying the DHCP
2dc4dd
+
2dc4dd
+
2dc4dd
+
2dc4dd
+M. Meredith et al.        Expires December 2001                [Page 11]
2dc4dd
+
2dc4dd
+
2dc4dd
+
2dc4dd
+
2dc4dd
+
2dc4dd
+INTERNET-DRAFT            LDAP Schema for DHCP              16 June 2001
2dc4dd
+
2dc4dd
+
2dc4dd
+configuration(s) that the server is associated with.' SYNTAX
2dc4dd
+1.3.6.1.4.1.1466.115.121.1.12 )
2dc4dd
+
2dc4dd
+( 2.16.840.1.113719.1.203.4.20 NAME 'dhcpVersion' DESC 'The version
2dc4dd
+attribute of this object.' SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-
2dc4dd
+VALUE )
2dc4dd
+
2dc4dd
+( 2.16.840.1.113719.1.203.4.21 NAME 'dhcpImplementation' DESC
2dc4dd
+'Description of the DHCP Server implementation e.g. DHCP Server's
2dc4dd
+vendor.' SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE )
2dc4dd
+
2dc4dd
+( 2.16.840.1.113719.1.203.4.22 NAME 'dhcpAddressState' DESC 'This stores
2dc4dd
+information about the current binding-status of an address.  For dynamic
2dc4dd
+addresses managed by DHCP, the values should be restricted to the
2dc4dd
+following: "FREE", "ACTIVE", "EXPIRED", "RELEASED", "RESET",
2dc4dd
+"ABANDONED", "BACKUP".  For other addresses, it SHOULD be one of the
2dc4dd
+following: "UNKNOWN", "RESERVED" (an address that is managed by DHCP
2dc4dd
+that is reserved for a specific client), "RESERVED-ACTIVE" (same as
2dc4dd
+reserved, but address is currently in use), "ASSIGNED" (assigned
2dc4dd
+manually or by some other mechanism), "UNASSIGNED", "NOTASSIGNABLE".'
2dc4dd
+SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE )
2dc4dd
+
2dc4dd
+( 2.16.840.1.113719.1.203.4.23 NAME 'dhcpExpirationTime' DESC 'This is
2dc4dd
+the time the current lease for an address expires.' SYNTAX
2dc4dd
+1.3.6.1.4.1.1466.115.121.1.24 SINGLE-VALUE )
2dc4dd
+
2dc4dd
+( 2.16.840.1.113719.1.203.4.24 NAME 'dhcpStartTimeOfState' DESC 'This is
2dc4dd
+the time of the last state change for a leased address.' SYNTAX
2dc4dd
+1.3.6.1.4.1.1466.115.121.1.24 SINGLE-VALUE )
2dc4dd
+
2dc4dd
+( 2.16.840.1.113719.1.203.4.25 NAME 'dhcpLastTransactionTime' DESC 'This
2dc4dd
+is the last time a valid DHCP packet was received from the client.'
2dc4dd
+SYNTAX 1.3.6.1.4.1.1466.115.121.1.24 SINGLE-VALUE )
2dc4dd
+
2dc4dd
+( 2.16.840.1.113719.1.203.4.26 NAME 'dhcpBootpFlag' DESC 'This indicates
2dc4dd
+whether the address was assigned via BOOTP.' SYNTAX
2dc4dd
+1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE )
2dc4dd
+
2dc4dd
+( 2.16.840.1.113719.1.203.4.27 NAME 'dhcpDomainName' DESC 'This is the
2dc4dd
+name of the domain sent to the client by the server.  It is essentially
2dc4dd
+the same as the value for DHCP option 15 sent to the client, and
2dc4dd
+represents only the domain - not the full FQDN.  To obtain the full FQDN
2dc4dd
+assigned to the client you must prepend the "dhcpAssignedHostName" to
2dc4dd
+this value with a ".".' SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-
2dc4dd
+VALUE )
2dc4dd
+
2dc4dd
+( 2.16.840.1.113719.1.203.4.28 NAME 'dhcpDnsStatus' DESC 'This indicates
2dc4dd
+the status of updating DNS resource records on behalf of the client by
2dc4dd
+
2dc4dd
+
2dc4dd
+
2dc4dd
+M. Meredith et al.        Expires December 2001                [Page 12]
2dc4dd
+
2dc4dd
+
2dc4dd
+
2dc4dd
+
2dc4dd
+
2dc4dd
+INTERNET-DRAFT            LDAP Schema for DHCP              16 June 2001
2dc4dd
+
2dc4dd
+
2dc4dd
+the DHCP server for this address.  The value is a 16-bit bitmask.'
2dc4dd
+SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )
2dc4dd
+
2dc4dd
+( 2.16.840.1.113719.1.203.4.29 NAME 'dhcpRequestedHostName' DESC 'This
2dc4dd
+is the hostname that was requested by the client.' SYNTAX
2dc4dd
+1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE )
2dc4dd
+
2dc4dd
+( 2.16.840.1.113719.1.203.4.30 NAME 'dhcpAssignedHostName' DESC 'This is
2dc4dd
+the actual hostname that was assigned to a client. It may not be the
2dc4dd
+name that was requested by the client.  The fully qualified domain name
2dc4dd
+can be determined by appending the value of "dhcpDomainName" (with a dot
2dc4dd
+separator) to this name.' SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-
2dc4dd
+VALUE )
2dc4dd
+
2dc4dd
+( 2.16.840.1.113719.1.203.4.31 NAME 'dhcpReservedForClient' DESC 'The
2dc4dd
+distinguished name of a "dhcpClient" that an address is reserved for.
2dc4dd
+This may not be the same as the "dhcpAssignedToClient" attribute if the
2dc4dd
+address is being reassigned but the current lease has not yet expired.'
2dc4dd
+SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE )
2dc4dd
+
2dc4dd
+( 2.16.840.1.113719.1.203.4.32 NAME 'dhcpAssignedToClient' DESC 'This is
2dc4dd
+the distinguished name of a "dhcpClient" that an address is currently
2dc4dd
+assigned to.  This attribute is only present in the class when the
2dc4dd
+address is leased.' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE )
2dc4dd
+
2dc4dd
+( 2.16.840.1.113719.1.203.4.33 NAME 'dhcpRelayAgentInfo' DESC 'If the
2dc4dd
+client request was received via a relay agent, this contains information
2dc4dd
+about the relay agent that was available from the DHCP request.  This is
2dc4dd
+a hex-encoded option value.' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40
2dc4dd
+SINGLE-VALUE )
2dc4dd
+
2dc4dd
+( 2.16.840.1.113719.1.203.4.34 NAME 'dhcpHWAddress' DESC 'The clients
2dc4dd
+hardware address that requested this IP address.' SYNTAX
2dc4dd
+1.3.6.1.4.1.1466.115.121.1.40 SINGLE-VALUE )
2dc4dd
+
2dc4dd
+( 2.16.840.1.113719.1.203.4.35 NAME 'dhcpHashBucketAssignment' DESC
2dc4dd
+'HashBucketAssignment bit map for the DHCP Server, as defined in DHC
2dc4dd
+Load Balancing Algorithm [RFC 3074].' SYNTAX
2dc4dd
+1.3.6.1.4.1.1466.115.121.1.40 SINGLE-VALUE )
2dc4dd
+
2dc4dd
+( 2.16.840.1.113719.1.203.4.36 NAME 'dhcpDelayedServiceParameter' DESC
2dc4dd
+'Delay in seconds corresponding to Delayed Service Parameter
2dc4dd
+configuration, as defined in  DHC Load Balancing Algorithm [RFC 3074]. '
2dc4dd
+SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )
2dc4dd
+
2dc4dd
+( 2.16.840.1.113719.1.203.4.37 NAME 'dhcpMaxClientLeadTime' DESC
2dc4dd
+'Maximum Client Lead Time configuration in seconds, as defined in DHCP
2dc4dd
+Failover Protocol [FAILOVR]' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27
2dc4dd
+
2dc4dd
+
2dc4dd
+
2dc4dd
+M. Meredith et al.        Expires December 2001                [Page 13]
2dc4dd
+
2dc4dd
+
2dc4dd
+
2dc4dd
+
2dc4dd
+
2dc4dd
+INTERNET-DRAFT            LDAP Schema for DHCP              16 June 2001
2dc4dd
+
2dc4dd
+
2dc4dd
+SINGLE-VALUE )
2dc4dd
+
2dc4dd
+( 2.16.840.1.113719.1.203.4.38 NAME 'dhcpFailOverEndpointState' DESC
2dc4dd
+'Server (Failover Endpoint) state, as defined in DHCP Failover Protocol
2dc4dd
+[FAILOVR]' SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE )
2dc4dd
+
2dc4dd
+( 2.16.840.1.113719.1.203.4.39 NAME 'dhcpErrorLog' DESC
2dc4dd
+Generic error log attribute that allows logging error conditions within a 
2dc4dd
+dhcpService or a dhcpSubnet, like no IP addresses available for lease. 
2dc4dd
+SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE )
2dc4dd
+
2dc4dd
+#Classes
2dc4dd
+
2dc4dd
+( 2.16.840.1.113719.1.203.6.1 NAME 'dhcpService' DESC ' Service object
2dc4dd
+that represents the actual DHCP Service configuration. This is a
2dc4dd
+container object.' SUP top MUST (cn $ dhcpPrimaryDN) MAY
2dc4dd
+(dhcpSecondaryDN $ dhcpSharedNetworkDN $ dhcpSubnetDN $ dhcpGroupDN $
2dc4dd
+dhcpHostDN $  dhcpClassesDN $ dhcpOptionsDN $ dhcpStatements ) )
2dc4dd
+
2dc4dd
+( 2.16.840.1.113719.1.203.6.2 NAME 'dhcpSharedNetwork' DESC 'This stores
2dc4dd
+configuration information for a shared network.' SUP top MUST  cn MAY
2dc4dd
+(dhcpSubnetDN $ dhcpPoolDN $ dhcpOptionsDN $ dhcpStatements) X-
2dc4dd
+NDS_CONTAINMENT ('dhcpService' ) )
2dc4dd
+
2dc4dd
+( 2.16.840.1.113719.1.203.6.3 NAME 'dhcpSubnet' DESC 'This class defines
2dc4dd
+a subnet. This is a container object.' SUP top MUST ( cn $ dhcpNetMask )
2dc4dd
+MAY (dhcpRange $ dhcpPoolDN $ dhcpGroupDN $ dhcpHostDN $ dhcpClassesDN $
2dc4dd
+dhcpLeasesDN $ dhcpOptionsDN $ dhcpStatements) X-NDS_CONTAINMENT
2dc4dd
+('dhcpService' 'dhcpSharedNetwork') )
2dc4dd
+
2dc4dd
+( 2.16.840.1.113719.1.203.6.4 NAME 'dhcpPool' DESC 'This stores
2dc4dd
+configuration information about a pool.' SUP top MUST ( cn $ dhcpRange )
2dc4dd
+MAY (dhcpClassesDN $ dhcpPermitList $ dhcpLeasesDN $ dhcpOptionsDN $
2dc4dd
+dhcpStatements) X-NDS_CONTAINMENT ('dhcpSubnet' 'dhcpSharedNetwork') )
2dc4dd
+
2dc4dd
+( 2.16.840.1.113719.1.203.6.5 NAME 'dhcpGroup' DESC 'Group object that
2dc4dd
+lists host DNs and parameters. This is a container object.' SUP top MUST
2dc4dd
+cn MAY ( dhcpHostDN $ dhcpOptionsDN $ dhcpStatements ) X-NDS_CONTAINMENT
2dc4dd
+('dhcpSubnet' 'dhcpService' ) )
2dc4dd
+
2dc4dd
+( 2.16.840.1.113719.1.203.6.6 NAME 'dhcpHost' DESC 'This represents
2dc4dd
+information about a particular client' SUP top MUST cn MAY  (dhcpLeaseDN
2dc4dd
+$ dhcpHWAddress $ dhcpOptionsDN $ dhcpStatements) X-NDS_CONTAINMENT
2dc4dd
+('dhcpService' 'dhcpSubnet' 'dhcpGroup') )
2dc4dd
+
2dc4dd
+( 2.16.840.1.113719.1.203.6.7 NAME 'dhcpClass' DESC 'Represents
2dc4dd
+information about a collection of related clients.' SUP top MUST cn MAY
2dc4dd
+(dhcpSubClassesDN $ dhcpOptionsDN $ dhcpStatements) X-NDS_CONTAINMENT
2dc4dd
+('dhcpService' 'dhcpSubnet' ) )
2dc4dd
+
2dc4dd
+( 2.16.840.1.113719.1.203.6.8 NAME 'dhcpSubClass' DESC 'Represents
2dc4dd
+information about a collection of related classes.' SUP top MUST cn MAY
2dc4dd
+(dhcpClassData $ dhcpOptionsDN $ dhcpStatements) X-NDS_CONTAINMENT
2dc4dd
+
2dc4dd
+
2dc4dd
+
2dc4dd
+M. Meredith et al.        Expires December 2001                [Page 14]
2dc4dd
+
2dc4dd
+
2dc4dd
+
2dc4dd
+
2dc4dd
+
2dc4dd
+INTERNET-DRAFT            LDAP Schema for DHCP              16 June 2001
2dc4dd
+
2dc4dd
+
2dc4dd
+'dhcpClass' )
2dc4dd
+
2dc4dd
+( 2.16.840.1.113719.1.203.6.9 NAME 'dhcpOptions' DESC 'Represents
2dc4dd
+information about a collection of options defined.' SUP top MUST cn MAY
2dc4dd
+( dhcpOption ) X-NDS_CONTAINMENT  ('dhcpService' 'dhcpSharedNetwork'
2dc4dd
+'dhcpSubnet' 'dhcpPool' 'dhcpGroup' 'dhcpHost' 'dhcpClass' )
2dc4dd
+
2dc4dd
+( 2.16.840.1.113719.1.203.6.10 NAME 'dhcpLeases' DESC 'This class
2dc4dd
+represents an IP Address, which may or may not have been leased.' SUP
2dc4dd
+top MUST ( cn $ dhcpAddressState ) MAY ( dhcpExpirationTime $
2dc4dd
+dhcpStartTimeOfState $ dhcpLastTransactionTime $ dhcpBootpFlag $
2dc4dd
+dhcpDomainName $ dhcpDnsStatus $ dhcpRequestedHostName $
2dc4dd
+dhcpAssignedHostName $ dhcpReservedForClient $ dhcpAssignedToClient $
2dc4dd
+dhcpRelayAgentInfo $ dhcpHWAddress ) X-NDS_CONTAINMENT ( 'dhcpService'
2dc4dd
+'dhcpSubnet' 'dhcpPool') )
2dc4dd
+
2dc4dd
+( 2.16.840.1.113719.1.203.6.11 NAME 'dhcpLog' DESC 'This is the object
2dc4dd
+that holds past information about the IP address. The cn is the
2dc4dd
+time/date stamp when the address was assigned or released, the address
2dc4dd
+state at the time, if the address was assigned or released.' SUP top
2dc4dd
+MUST ( cn ) MAY ( dhcpAddressState $ dhcpExpirationTime $
2dc4dd
+dhcpStartTimeOfState $ dhcpLastTransactionTime $ dhcpBootpFlag $
2dc4dd
+dhcpDomainName $ dhcpDnsStatus $ dhcpRequestedHostName $
2dc4dd
+dhcpAssignedHostName $ dhcpReservedForClient $ dhcpAssignedToClient $
2dc4dd
+dhcpRelayAgentInfo $ dhcpHWAddress $ dhcpErrorLog) X-NDS_CONTAINMENT 
2dc4dd
+('dhcpLeases' 'dhcpPool' 'dhcpSubnet' 'dhcpSharedNetwork' 'dhcpService' ) )
2dc4dd
+
2dc4dd
+( 2.16.840.1.113719.1.203.6.12 NAME 'dhcpServer' DESC 'DHCP Server
2dc4dd
+Object' SUP top MUST (cn, dhcpServiceDN) MAY (dhcpVersion $
2dc4dd
+dhcpImplementation $ dhcpHashBucketAssignment $
2dc4dd
+dhcpDelayedServiceParameter $ dhcpMaxClientLeadTime $
2dc4dd
+dhcpFailOverEndpointState $ dhcpStatements) X-NDS_CONTAINMENT ('O' 'OU' 
2dc4dd
+'dc') )
2dc4dd
+
2dc4dd
+9. Security Considerations
2dc4dd
+
2dc4dd
+Since the DHCP Configuration information is stored in a directory, the
2dc4dd
+security of the information is limited to the security offered by the
2dc4dd
+directory including the security of the objects within that directory.
2dc4dd
+
2dc4dd
+10.  Intellectual Property Rights Notices
2dc4dd
+
2dc4dd
+The IETF takes no position regarding the validity or scope of any
2dc4dd
+intellectual property or other rights that might be claimed to pertain
2dc4dd
+to the implementation or use of the technology described in this
2dc4dd
+document or the extent to which any license under such rights might or
2dc4dd
+might not be available; neither does it represent that it has made any
2dc4dd
+effort to identify any such rights.  Information on the IETF's
2dc4dd
+procedures with respect to rights in standards-track and standards-
2dc4dd
+
2dc4dd
+
2dc4dd
+
2dc4dd
+M. Meredith et al.        Expires December 2001                [Page 15]
2dc4dd
+
2dc4dd
+
2dc4dd
+
2dc4dd
+
2dc4dd
+
2dc4dd
+INTERNET-DRAFT            LDAP Schema for DHCP              16 June 2001
2dc4dd
+
2dc4dd
+
2dc4dd
+related documentation can be found in BCP-11.  Copies of claims of
2dc4dd
+rights made available for publication and any assurances of licenses to
2dc4dd
+be made available, or the result of an attempt made to obtain a general
2dc4dd
+license or permission for the use of such proprietary rights by
2dc4dd
+implementors or users of this specification can be obtained from the
2dc4dd
+IETF Secretariat.
2dc4dd
+
2dc4dd
+The IETF invites any interested party to bring to its attention any
2dc4dd
+copyrights, patents or patent applications, or other proprietary rights
2dc4dd
+which may cover technology that may be required to practice this
2dc4dd
+standard.  Please address the information to the IETF Executive
2dc4dd
+Director.
2dc4dd
+
2dc4dd
+11.  Full Copyright Statement
2dc4dd
+
2dc4dd
+Copyright (C) The Internet Society (2001).  All Rights Reserved.
2dc4dd
+
2dc4dd
+This document and translations of it may be copied and furnished to
2dc4dd
+others, and derivative works that comment on or otherwise explain it or
2dc4dd
+assist in its implementation may be prepared, copied, published and
2dc4dd
+distributed, in whole or in part, without restriction of any kind,
2dc4dd
+provided that the above copyright notice and this paragraph are included
2dc4dd
+on all such copies and derivative works.  However, this document itself
2dc4dd
+may not be modified in any way, such as by removing the copyright notice
2dc4dd
+or references to the Internet Society or other Internet organizations,
2dc4dd
+except as needed for the purpose of developing Internet standards in
2dc4dd
+which case the procedures for copyrights defined in the Internet
2dc4dd
+Standards process must be followed, or as required to translate it into
2dc4dd
+languages other than English.
2dc4dd
+
2dc4dd
+The limited permissions granted above are perpetual and will not be
2dc4dd
+revoked by the Internet Society or its successors or assigns.
2dc4dd
+
2dc4dd
+This document and the information contained herein is provided on an "AS
2dc4dd
+IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING TASK
2dc4dd
+FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT
2dc4dd
+LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT
2dc4dd
+INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR
2dc4dd
+FITNESS FOR A PARTICULAR PURPOSE.
2dc4dd
+
2dc4dd
+12. References
2dc4dd
+
2dc4dd
+[RFC2131] Droms, R., "Dynamic Host Configuration Protocol", RFC 2131,
2dc4dd
+March 1997.
2dc4dd
+
2dc4dd
+[RFC2132] Alexander, S., Droms, R., "DHCP Options and BOOTP Vendor
2dc4dd
+Extensions", RFC 2132, March 1997.
2dc4dd
+
2dc4dd
+
2dc4dd
+
2dc4dd
+
2dc4dd
+M. Meredith et al.        Expires December 2001                [Page 16]
2dc4dd
+
2dc4dd
+
2dc4dd
+
2dc4dd
+
2dc4dd
+
2dc4dd
+INTERNET-DRAFT            LDAP Schema for DHCP              16 June 2001
2dc4dd
+
2dc4dd
+
2dc4dd
+[MSDHCP]  Gu, Y., Vyaghrapuri, R., "An LDAP Schema for Dynamic Host
2dc4dd
+Configuration Protocol Service", Internet Draft 
2dc4dd
+schema-00.txt>, August 1998.
2dc4dd
+
2dc4dd
+[NOVDHCP] Miller, T., Patel, A., Rao, P., "Lightweight Directory Access
2dc4dd
+Protocol (v3): Schema for Dynamic Host Configuration Protocol (DHCP)",
2dc4dd
+Internet Draft <draft-miller-dhcp-ldap-schema-00.txt>, June 1998.
2dc4dd
+
2dc4dd
+[FAILOVR] Droms, R., Rabil, G., Dooley, M., Kapur, A., Gonczi, S., Volz,
2dc4dd
+B., "DHCP Failover Protocol", Internet Draft 
2dc4dd
+failover-08.txt>, July 2000.
2dc4dd
+
2dc4dd
+[RFC 3074] Volz B., Gonczi S., Lemon T., Stevens R., "DHC Load Balancing
2dc4dd
+Algorithm", February 2001
2dc4dd
+
2dc4dd
+[AGENT]   Patrick, M., "DHCP Relay Agent Information Option", Internet
2dc4dd
+Draft <draft-ietf-dhc-agent-options-09.txt>, March 2000.
2dc4dd
+
2dc4dd
+[DHCPOPT] Carney, M., "New Option Review Guidelines and Additional
2dc4dd
+Option Namespace", Internet Draft 
2dc4dd
+option_review_and_namespace-01.txt>, October 1999.
2dc4dd
+
2dc4dd
+[POLICY]  Strassner, J., Elleson, E., Moore, B., "Policy Framework LDAP
2dc4dd
+Core Schema", Internet Draft <draft-ietf-policy-core-schema-06.txt>,
2dc4dd
+November 1999.
2dc4dd
+
2dc4dd
+[RFC2251] Wahl, M., Howes, T., Kille, S., "Lightweight Directory Access
2dc4dd
+Protocol (v3)", RFC 2251, December 1997.
2dc4dd
+
2dc4dd
+[RFC2252] Wahl, M., Coulbeck, A., Howes, T., Kille, S., "Lightweight
2dc4dd
+Directory Access Protocol (v3) Attribute Syntax Definitions", RFC 2252,
2dc4dd
+December 1997.
2dc4dd
+
2dc4dd
+[RFC2255] Howes, T., Smith, M., "The LDAP URL Format", RFC 2255,
2dc4dd
+December 1997.
2dc4dd
+
2dc4dd
+[RFC951]  Croft, B., Gilmore, J., "Bootstrap Protocol (BOOTP)", RFC 951,
2dc4dd
+September 1985.
2dc4dd
+
2dc4dd
+[RFC2119] Bradner, S. "Key words for use in RFCs to Indicate Requirement
2dc4dd
+Levels", RFC 2119, March 1997.
2dc4dd
+
2dc4dd
+13. Acknowledgments
2dc4dd
+
2dc4dd
+This work is partially based on a previous draft draft-ietf-dhc-
2dc4dd
+schema-02.doc.
2dc4dd
+
2dc4dd
+
2dc4dd
+
2dc4dd
+
2dc4dd
+
2dc4dd
+M. Meredith et al.        Expires December 2001                [Page 17]
2dc4dd
+
2dc4dd
+
2dc4dd
+
2dc4dd
+
2dc4dd
+
2dc4dd
+INTERNET-DRAFT            LDAP Schema for DHCP              16 June 2001
2dc4dd
+
2dc4dd
+
2dc4dd
+14. Author's Addresses
2dc4dd
+
2dc4dd
+Comments regarding this draft may be sent to the authors at the
2dc4dd
+following address:
2dc4dd
+
2dc4dd
+Mark Meredith
2dc4dd
+Mark Hinckley
2dc4dd
+Novell Inc.
2dc4dd
+1800 S. Novell Place
2dc4dd
+Provo, Utah 84606
2dc4dd
+
2dc4dd
+Vijay K. Nanjundaswamy
2dc4dd
+Novell Software Development (I) Ltd
2dc4dd
+49/1 & 49/3, Garvebhavi Palya,
2dc4dd
+7th Mile, Hosur Road
2dc4dd
+Bangalore 560068
2dc4dd
+
2dc4dd
+email: mark_meredith@novell.com
2dc4dd
+email: knvijay@novell.com
2dc4dd
+email: mhinckley@novell.com
2dc4dd
+
2dc4dd
+This Internet Draft expires December 16, 2001.
2dc4dd
+
2dc4dd
+
2dc4dd
+
2dc4dd
+
2dc4dd
+
2dc4dd
+
2dc4dd
+
2dc4dd
+
2dc4dd
+
2dc4dd
+
2dc4dd
+
2dc4dd
+
2dc4dd
+
2dc4dd
+
2dc4dd
+
2dc4dd
+
2dc4dd
+
2dc4dd
+
2dc4dd
+
2dc4dd
+
2dc4dd
+
2dc4dd
+
2dc4dd
+
2dc4dd
+
2dc4dd
+
2dc4dd
+
2dc4dd
+
2dc4dd
+
2dc4dd
+
2dc4dd
+M. Meredith et al.        Expires December 2001                [Page 18]
2dc4dd
+
2dc4dd
+
2dc4dd
+
2dc4dd
+
2dc4dd
--- dhcp-3.0.5/includes/dhcpd.h.ldapconf	2007-01-31 20:39:38.000000000 -0500
2dc4dd
+++ dhcp-3.0.5/includes/dhcpd.h	2007-01-31 20:39:38.000000000 -0500
2dc4dd
@@ -79,6 +79,11 @@
2dc4dd
 #include <isc-dhcp/result.h>
2dc4dd
 #include <omapip/omapip_p.h>
2dc4dd
 
2dc4dd
+#if defined(LDAP_CONFIGURATION)
2dc4dd
+# include <ldap.h>
2dc4dd
+# include <sys/utsname.h> /* for uname() */
2dc4dd
+#endif
2dc4dd
+
2dc4dd
 #if !defined (OPTION_HASH_SIZE)
2dc4dd
 # define OPTION_HASH_SIZE 17
2dc4dd
 # define OPTION_HASH_PTWO 32	/* Next power of two above option hash. */
2dc4dd
@@ -139,6 +144,8 @@
2dc4dd
 	char *inbuf;
2dc4dd
 	unsigned bufix, buflen;
2dc4dd
 	unsigned bufsiz;
2dc4dd
+
2dc4dd
+	char (*read_function) (struct parse *);
2dc4dd
 };
2dc4dd
 
2dc4dd
 /* Variable-length array of data. */
2dc4dd
@@ -244,6 +251,27 @@
2dc4dd
 	u_int8_t hbuf [17];
2dc4dd
 };
2dc4dd
 
2dc4dd
+#if defined(LDAP_CONFIGURATION)
2dc4dd
+# define LDAP_BUFFER_SIZE		8192
2dc4dd
+# define LDAP_METHOD_STATIC		0
2dc4dd
+# define LDAP_METHOD_DYNAMIC		1
2dc4dd
+
2dc4dd
+/* This is a tree of the current configuration we are building from LDAP */
2dc4dd
+
2dc4dd
+struct ldap_config_stack {
2dc4dd
+	LDAPMessage * res; 	/* Pointer returned from ldap_search */
2dc4dd
+	LDAPMessage * ldent; 	/* Current item in LDAP that we're processing 
2dc4dd
+				   in res */
2dc4dd
+	int close_brace;	/* Put a closing } after we're through with
2dc4dd
+				   this item */
2dc4dd
+	int processed; 		/* We set this flag if this base item has been
2dc4dd
+				   processed. After this base item is processed,
2dc4dd
+				   we can start processing the children */
2dc4dd
+	struct ldap_config_stack *children;
2dc4dd
+	struct ldap_config_stack *next;
2dc4dd
+};
2dc4dd
+#endif
2dc4dd
+
2dc4dd
 typedef enum {
2dc4dd
 	server_startup = 0,
2dc4dd
 	server_running = 1,
2dc4dd
@@ -426,6 +454,15 @@
2dc4dd
 # define DEFAULT_PING_TIMEOUT 1
2dc4dd
 #endif
2dc4dd
 
2dc4dd
+#if defined(LDAP_CONFIGURATION)
2dc4dd
+# define SV_LDAP_SERVER  		46
2dc4dd
+# define SV_LDAP_PORT  			47
2dc4dd
+# define SV_LDAP_USERNAME  		48
2dc4dd
+# define SV_LDAP_PASSWORD  		49
2dc4dd
+# define SV_LDAP_BASE_DN 		50
2dc4dd
+# define SV_LDAP_METHOD			51
2dc4dd
+#endif
2dc4dd
+
2dc4dd
 #if !defined (DEFAULT_DEFAULT_LEASE_TIME)
2dc4dd
 # define DEFAULT_DEFAULT_LEASE_TIME 43200
2dc4dd
 #endif
2dc4dd
@@ -1526,7 +1563,7 @@
2dc4dd
 char *quotify_string (const char *, const char *, int);
2dc4dd
 char *quotify_buf (const unsigned char *, unsigned, const char *, int);
2dc4dd
 char *print_base64 (const unsigned char *, unsigned, const char *, int);
2dc4dd
-char *print_hw_addr PROTO ((int, int, unsigned char *));
2dc4dd
+char *print_hw_addr PROTO ((const int, const int, const unsigned char *));
2dc4dd
 void print_lease PROTO ((struct lease *));
2dc4dd
 void dump_raw PROTO ((const unsigned char *, unsigned));
2dc4dd
 void dump_packet_option (struct option_cache *, struct packet *,
2dc4dd
@@ -2640,3 +2677,14 @@
2dc4dd
 #endif /* FAILOVER_PROTOCOL */
2dc4dd
 
2dc4dd
 const char *binding_state_print (enum failover_state);
2dc4dd
+
2dc4dd
+/* ldap.c */
2dc4dd
+#if defined(LDAP_CONFIGURATION)
2dc4dd
+extern struct enumeration ldap_methods;
2dc4dd
+isc_result_t ldap_read_config (void);
2dc4dd
+int find_haddr_in_ldap (struct host_decl **, int, unsigned,
2dc4dd
+                        const unsigned char *, const char *, int);
2dc4dd
+int find_subclass_in_ldap (struct class *, struct class **, 
2dc4dd
+			   struct data_string *);
2dc4dd
+#endif
2dc4dd
+
2dc4dd
--- dhcp-3.0.5/includes/site.h.ldapconf	2002-03-12 13:33:39.000000000 -0500
2dc4dd
+++ dhcp-3.0.5/includes/site.h	2007-01-31 20:39:38.000000000 -0500
2dc4dd
@@ -177,3 +177,13 @@
2dc4dd
    traces. */
2dc4dd
 
2dc4dd
 #define TRACING
2dc4dd
+
2dc4dd
+/* Define this if you want to read your config from LDAP. Read README.ldap
2dc4dd
+   about how to set this up */
2dc4dd
+
2dc4dd
+#define LDAP_CONFIGURATION
2dc4dd
+
2dc4dd
+#define _PATH_DHCPD_DB    "/var/lib/dhcpd/dhcpd.leases"
2dc4dd
+#define _PATH_DHCLIENT_DB "/var/lib/dhclient/dhclient.leases"
2dc4dd
+#define _PATH_DHCPD_DB    "/var/lib/dhcpd/dhcpd.leases"
2dc4dd
+#define _PATH_DHCLIENT_DB "/var/lib/dhclient/dhclient.leases"
2dc4dd
--- dhcp-3.0.5/server/Makefile.dist.ldapconf	2007-01-31 20:39:38.000000000 -0500
2dc4dd
+++ dhcp-3.0.5/server/Makefile.dist	2007-01-31 21:00:06.000000000 -0500
2dc4dd
@@ -25,9 +25,9 @@
2dc4dd
 CATMANPAGES = dhcpd.cat8 dhcpd.conf.cat5 dhcpd.leases.cat5
2dc4dd
 SEDMANPAGES = dhcpd.man8 dhcpd.conf.man5 dhcpd.leases.man5
2dc4dd
 SRCS   = dhcpd.c dhcp.c bootp.c confpars.c db.c class.c failover.c \
2dc4dd
-	 omapi.c mdb.c stables.c salloc.c ddns.c
2dc4dd
+	 omapi.c mdb.c stables.c salloc.c ddns.c ldap.c
2dc4dd
 OBJS   = dhcpd.o dhcp.o bootp.o confpars.o db.o class.o failover.o \
2dc4dd
-	 omapi.o mdb.o stables.o salloc.o ddns.o
2dc4dd
+	 omapi.o mdb.o stables.o salloc.o ddns.o ldap.o
2dc4dd
 PROG   = dhcpd
2dc4dd
 MAN    = dhcpd.8 dhcpd.conf.5 dhcpd.leases.5
2dc4dd
 
2dc4dd
@@ -103,6 +103,6 @@
2dc4dd
 		-e "s#RUNDIR#$(VARRUN)#g" < dhcpd.leases.5 >dhcpd.leases.man5
2dc4dd
 
2dc4dd
 dhcpd:	$(OBJS) $(COBJ) $(DHCPLIB)
2dc4dd
-	$(CC) $(LFLAGS) -pie $(RPM_OPT_FLAGS) -Wl,-z,relro,-z,now,-z,noexecstack,-z,nodlopen -o dhcpd $(OBJS) $(DHCPLIB) $(LIBS)
2dc4dd
+	$(CC) $(LFLAGS) -pie $(RPM_OPT_FLAGS) -Wl,-z,relro,-z,now,-z,noexecstack,-z,nodlopen -o dhcpd $(OBJS) $(DHCPLIB) $(LIBS) -lldap
2dc4dd
 
2dc4dd
 # Dependencies (semi-automatically-generated)
2dc4dd
--- dhcp-3.0.5/server/class.c.ldapconf	2004-06-10 13:59:51.000000000 -0400
2dc4dd
+++ dhcp-3.0.5/server/class.c	2007-01-31 20:39:38.000000000 -0500
2dc4dd
@@ -90,6 +90,7 @@
2dc4dd
 	int matched = 0;
2dc4dd
 	int status;
2dc4dd
 	int ignorep;
2dc4dd
+	int classfound;
2dc4dd
 
2dc4dd
 	for (class = collection -> classes; class; class = class -> nic) {
2dc4dd
 #if defined (DEBUG_CLASS_MATCHING)
2dc4dd
@@ -135,9 +136,19 @@
2dc4dd
 				   class -> submatch, MDL));
2dc4dd
 			if (status && data.len) {
2dc4dd
 				nc = (struct class *)0;
2dc4dd
-				if (class_hash_lookup (&nc, class -> hash,
2dc4dd
-						       (const char *)data.data,
2dc4dd
-						       data.len, MDL)) {
2dc4dd
+                                classfound = class_hash_lookup (&nc, 
2dc4dd
+						class -> hash, 
2dc4dd
+						(const char *)data.data,
2dc4dd
+						data.len, MDL);
2dc4dd
+
2dc4dd
+#ifdef LDAP_CONFIGURATION
2dc4dd
+                                if (!classfound && 
2dc4dd
+						find_subclass_in_ldap (class, 
2dc4dd
+								&nc, &data)) 
2dc4dd
+					classfound = 1;
2dc4dd
+#endif
2dc4dd
+
2dc4dd
+				if (classfound) {
2dc4dd
 #if defined (DEBUG_CLASS_MATCHING)
2dc4dd
 					log_info ("matches subclass %s.",
2dc4dd
 					      print_hex_1 (data.len,
2dc4dd
--- dhcp-3.0.5/server/confpars.c.ldapconf	2007-01-31 20:39:38.000000000 -0500
2dc4dd
+++ dhcp-3.0.5/server/confpars.c	2007-01-31 20:39:38.000000000 -0500
2dc4dd
@@ -63,7 +63,17 @@
2dc4dd
 
2dc4dd
 isc_result_t readconf ()
2dc4dd
 {
2dc4dd
-	return read_conf_file (path_dhcpd_conf, root_group, ROOT_GROUP, 0);
2dc4dd
+	isc_result_t res;
2dc4dd
+
2dc4dd
+	res = read_conf_file (path_dhcpd_conf, root_group, ROOT_GROUP, 0);
2dc4dd
+#if defined(LDAP_CONFIGURATION)
2dc4dd
+	if (res != ISC_R_SUCCESS)
2dc4dd
+		return (res);
2dc4dd
+
2dc4dd
+	return ldap_read_config ();
2dc4dd
+#else
2dc4dd
+	return (res);
2dc4dd
+#endif
2dc4dd
 }
2dc4dd
 
2dc4dd
 isc_result_t read_conf_file (const char *filename, struct group *group,
2dc4dd
--- dhcp-3.0.5/server/dhcpd.c.ldapconf	2007-01-31 20:39:38.000000000 -0500
2dc4dd
+++ dhcp-3.0.5/server/dhcpd.c	2007-01-31 20:39:38.000000000 -0500
2dc4dd
@@ -433,6 +433,9 @@
2dc4dd
 	/* Add the ddns update style enumeration prior to parsing. */
2dc4dd
 	add_enumeration (&ddns_styles);
2dc4dd
 	add_enumeration (&syslog_enum);
2dc4dd
+#if defined (LDAP_CONFIGURATION)
2dc4dd
+	add_enumeration (&ldap_methods);
2dc4dd
+#endif
2dc4dd
 
2dc4dd
 	if (!group_allocate (&root_group, MDL))
2dc4dd
 		log_fatal ("Can't allocate root group!");
2dc4dd
--- /dev/null	2007-01-31 10:24:38.956568237 -0500
2dc4dd
+++ dhcp-3.0.5/server/ldap.c	2007-01-31 20:39:38.000000000 -0500
2dc4dd
@@ -0,0 +1,1142 @@
2dc4dd
+/* ldap.c
2dc4dd
+
2dc4dd
+   Routines for reading the configuration from LDAP */
2dc4dd
+
2dc4dd
+/*
2dc4dd
+ * Copyright (c) 1996-2001 Ntelos, Inc.
2dc4dd
+ * All rights reserved.
2dc4dd
+ *
2dc4dd
+ * Redistribution and use in source and binary forms, with or without
2dc4dd
+ * modification, are permitted provided that the following conditions
2dc4dd
+ * are met:
2dc4dd
+ *
2dc4dd
+ * 1. Redistributions of source code must retain the above copyright
2dc4dd
+ *    notice, this list of conditions and the following disclaimer.
2dc4dd
+ * 2. Redistributions in binary form must reproduce the above copyright
2dc4dd
+ *    notice, this list of conditions and the following disclaimer in the
2dc4dd
+ *    documentation and/or other materials provided with the distribution.
2dc4dd
+ * 3. Neither the name of The Internet Software Consortium nor the names
2dc4dd
+ *    of its contributors may be used to endorse or promote products derived
2dc4dd
+ *    from this software without specific prior written permission.
2dc4dd
+ *
2dc4dd
+ * THIS SOFTWARE IS PROVIDED BY THE INTERNET SOFTWARE CONSORTIUM AND
2dc4dd
+ * CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
2dc4dd
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
2dc4dd
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
2dc4dd
+ * DISCLAIMED.  IN NO EVENT SHALL THE INTERNET SOFTWARE CONSORTIUM OR
2dc4dd
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
2dc4dd
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
2dc4dd
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
2dc4dd
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
2dc4dd
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
2dc4dd
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
2dc4dd
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2dc4dd
+ * SUCH DAMAGE.
2dc4dd
+ *
2dc4dd
+ * This LDAP module was written by Brian Masney <masneyb@ntelos.net>. It's
2dc4dd
+ * development was sponsored by Ntelos, Inc. (www.ntelos.com).
2dc4dd
+ */
2dc4dd
+
2dc4dd
+#include "dhcpd.h"
2dc4dd
+
2dc4dd
+#if defined(LDAP_CONFIGURATION)
2dc4dd
+
2dc4dd
+static LDAP * ld = NULL;
2dc4dd
+static char *ldap_server = NULL, 
2dc4dd
+            *ldap_username = NULL, 
2dc4dd
+            *ldap_password = NULL,
2dc4dd
+            *ldap_base_dn = NULL;
2dc4dd
+static int ldap_method = LDAP_METHOD_DYNAMIC,
2dc4dd
+           disable_ldap = 0;
2dc4dd
+static struct ldap_config_stack *ldap_stack = NULL;
2dc4dd
+
2dc4dd
+
2dc4dd
+static void
2dc4dd
+ldap_parse_class (struct ldap_config_stack *item, struct parse *cfile)
2dc4dd
+{
2dc4dd
+  struct berval **temp;
2dc4dd
+
2dc4dd
+  if ((temp = ldap_get_values_len (ld, item->ldent, "cn")) == NULL ||
2dc4dd
+      temp[0]->bv_val == NULL)
2dc4dd
+    {
2dc4dd
+      if (temp != NULL)
2dc4dd
+        ldap_value_free_len (temp);
2dc4dd
+
2dc4dd
+      return;
2dc4dd
+    }
2dc4dd
+
2dc4dd
+  strncat (cfile->inbuf, "class \"", LDAP_BUFFER_SIZE);
2dc4dd
+  strncat (cfile->inbuf, temp[0]->bv_val, LDAP_BUFFER_SIZE);
2dc4dd
+  strncat (cfile->inbuf, "\" {\n", LDAP_BUFFER_SIZE);
2dc4dd
+
2dc4dd
+  item->close_brace = 1;
2dc4dd
+  ldap_value_free_len (temp);
2dc4dd
+}
2dc4dd
+
2dc4dd
+
2dc4dd
+static void
2dc4dd
+ldap_parse_subclass (struct ldap_config_stack *item, struct parse *cfile)
2dc4dd
+{
2dc4dd
+  struct berval **temp, **classdata;
2dc4dd
+
2dc4dd
+  if ((temp = ldap_get_values_len (ld, item->ldent, "cn")) == NULL ||
2dc4dd
+      temp[0]->bv_val == NULL)
2dc4dd
+    {
2dc4dd
+      if (temp != NULL)
2dc4dd
+        ldap_value_free_len (temp);
2dc4dd
+
2dc4dd
+      return;
2dc4dd
+    }
2dc4dd
+
2dc4dd
+
2dc4dd
+  if ((classdata = ldap_get_values_len (ld, item->ldent, 
2dc4dd
+                                  "dhcpClassData")) == NULL || 
2dc4dd
+      classdata[0]->bv_val == NULL)
2dc4dd
+    {
2dc4dd
+      if (classdata != NULL)
2dc4dd
+        ldap_value_free_len (classdata);
2dc4dd
+      ldap_value_free_len (temp);
2dc4dd
+
2dc4dd
+      return;
2dc4dd
+    }
2dc4dd
+
2dc4dd
+  strncat (cfile->inbuf, "subclass ", LDAP_BUFFER_SIZE);
2dc4dd
+  strncat (cfile->inbuf, (*classdata)->bv_val, LDAP_BUFFER_SIZE);
2dc4dd
+  strncat (cfile->inbuf, " ", LDAP_BUFFER_SIZE);
2dc4dd
+  strncat (cfile->inbuf, (*temp)->bv_val, LDAP_BUFFER_SIZE);
2dc4dd
+  strncat (cfile->inbuf, " {\n", LDAP_BUFFER_SIZE);
2dc4dd
+
2dc4dd
+  item->close_brace = 1;
2dc4dd
+  ldap_value_free_len (temp);
2dc4dd
+  ldap_value_free_len (classdata);
2dc4dd
+}
2dc4dd
+
2dc4dd
+
2dc4dd
+static void
2dc4dd
+ldap_parse_host (struct ldap_config_stack *item, struct parse *cfile)
2dc4dd
+{
2dc4dd
+  struct berval **temp, **hwaddr;
2dc4dd
+
2dc4dd
+
2dc4dd
+  if ((temp = ldap_get_values_len (ld, item->ldent, "cn")) == NULL ||
2dc4dd
+      temp[0]->bv_val == NULL)
2dc4dd
+    {
2dc4dd
+      if (temp != NULL)
2dc4dd
+        ldap_value_free_len (temp);
2dc4dd
+
2dc4dd
+      return;
2dc4dd
+    }
2dc4dd
+
2dc4dd
+  if ((hwaddr = ldap_get_values_len (ld, item->ldent, 
2dc4dd
+                                 "dhcpHWAddress")) == NULL || 
2dc4dd
+      hwaddr[0]->bv_val == NULL)
2dc4dd
+    {
2dc4dd
+      if (hwaddr != NULL)
2dc4dd
+        ldap_value_free_len (hwaddr);
2dc4dd
+      ldap_value_free_len (temp);
2dc4dd
+
2dc4dd
+      return;
2dc4dd
+    }
2dc4dd
+
2dc4dd
+  strncat (cfile->inbuf, "host ", LDAP_BUFFER_SIZE);
2dc4dd
+  strncat (cfile->inbuf, (*temp)->bv_val, LDAP_BUFFER_SIZE);
2dc4dd
+  strncat (cfile->inbuf, " {\nhardware ", LDAP_BUFFER_SIZE);
2dc4dd
+  strncat (cfile->inbuf, (*hwaddr)->bv_val, LDAP_BUFFER_SIZE);
2dc4dd
+  strncat (cfile->inbuf, ";\n", LDAP_BUFFER_SIZE);
2dc4dd
+
2dc4dd
+  item->close_brace = 1;
2dc4dd
+  ldap_value_free_len (temp);
2dc4dd
+  ldap_value_free_len (hwaddr);
2dc4dd
+}
2dc4dd
+
2dc4dd
+
2dc4dd
+static void
2dc4dd
+ldap_parse_shared_network (struct ldap_config_stack *item, struct parse *cfile)
2dc4dd
+{
2dc4dd
+  struct berval **temp;
2dc4dd
+
2dc4dd
+
2dc4dd
+  if ((temp = ldap_get_values_len (ld, item->ldent, "cn")) == NULL ||
2dc4dd
+      temp[0]->bv_val == NULL)
2dc4dd
+    {
2dc4dd
+      if (temp != NULL)
2dc4dd
+        ldap_value_free_len (temp);
2dc4dd
+
2dc4dd
+      return;
2dc4dd
+    }
2dc4dd
+
2dc4dd
+  strncat (cfile->inbuf, "shared-network ", LDAP_BUFFER_SIZE);
2dc4dd
+  strncat (cfile->inbuf, (*temp)->bv_val, LDAP_BUFFER_SIZE);
2dc4dd
+  strncat (cfile->inbuf, " {\n", LDAP_BUFFER_SIZE);
2dc4dd
+
2dc4dd
+  item->close_brace = 1;