#!/sbin/runscript
# Copyright 1999-2015 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/net-misc/dhcp/files/dhcpd.init5,v 1.6 2015/02/10 00:27:08 polynomial-c Exp $
+# $Id$
extra_commands="configtest"
echo ${var:-$2}
}
+setup_opts() {
+ DHCPD_CHROOT=${DHCPD_CHROOT%/}
+
+ # Work out our cffile if it's in our DHCPD_OPTS
+ case " ${DHCPD_OPTS} " in
+ *" -cf "*)
+ DHCPD_CONF=" ${DHCPD_OPTS} "
+ DHCPD_CONF="${DHCPD_CONF##* -cf }"
+ DHCPD_CONF="${DHCPD_CONF%% *}"
+ ;;
+ *) DHCPD_OPTS="${DHCPD_OPTS} -cf ${DHCPD_CONF}"
+ ;;
+ esac
+}
+
checkconfig() {
- set -- ${DHCPD_OPTS} ${chroot:+-chroot} ${chroot} -t
+ set -- ${DHCPD_OPTS} -chroot "${DHCPD_CHROOT:-/}" -t
dhcpd "$@" 1>/dev/null 2>&1
local ret=$?
}
configtest() {
- local chroot=${DHCPD_CHROOT%/}
+ setup_opts
ebegin "Checking ${SVCNAME} configuration"
checkconfig
}
start() {
- local chroot=${DHCPD_CHROOT%/}
-
- # Work out our cffile if it's in our DHCPD_OPTS
- case " ${DHCPD_OPTS} " in
- *" -cf "*)
- DHCPD_CONF=" ${DHCPD_OPTS} "
- DHCPD_CONF="${DHCPD_CONF##* -cf }"
- DHCPD_CONF="${DHCPD_CONF%% *}"
- ;;
- *) DHCPD_OPTS="${DHCPD_OPTS} -cf ${DHCPD_CONF}"
- ;;
- esac
+ setup_opts
+ local chroot="${DHCPD_CHROOT}"
if [ -n "${chroot}" ] ; then
# the config test want's these to exist
--pidfile "${chroot}/${pidfile}" \
-- ${DHCPD_OPTS} -q -pf "${pidfile}" -lf "${leasefile}" \
-user dhcp -group dhcp \
- ${chroot:+-chroot} ${chroot} ${DHCPD_IFACE}
+ -chroot "${chroot:-/}" ${DHCPD_IFACE}
eend $? \
&& save_options dhcpd_chroot "${chroot}" \
&& save_options pidfile "${pidfile}"
stop() {
local chroot="$(get_options dhcpd_chroot)"
- [ -z "$chroot" ] && chroot="$(get_options chroot)"
+ [ -z "${chroot}" ] && chroot="$(get_options chroot)"
ebegin "Stopping ${chroot:+chrooted }${SVCNAME}"
start-stop-daemon --stop --exec /usr/sbin/dhcpd \
fi
fi
- eend $res
+ eend ${res}
}
DESC 'Generic attribute that allows coments within any DHCP object'
SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE )
+attributetype ( 2.16.840.1.113719.1.203.4.57
+ NAME 'dhcpClientId'
+ EQUALITY caseIgnoreIA5Match
+ DESC 'client Identifier.'
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 )
+
+attributetype ( 2.16.840.1.113719.1.203.4.58
+ NAME 'dhcpRange6'
+ 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 )
+
# Classes
objectclass ( 2.16.840.1.113719.1.203.6.1
DESC 'This represents information about a particular client'
SUP top
MUST cn
- MAY (dhcpLeaseDN $ dhcpHWAddress $ dhcpOptionsDN $ dhcpStatements $ dhcpComments $ dhcpOption)
+ MAY (dhcpLeaseDN $ dhcpHWAddress $ dhcpOptionsDN $ dhcpStatements $ dhcpComments $ dhcpOption $ dhcpClientId)
X-NDS_CONTAINMENT ('dhcpService' 'dhcpSubnet' 'dhcpGroup') )
objectclass ( 2.16.840.1.113719.1.203.6.7
MAY ( dhcpServiceDN $dhcpServerDN $ dhcpSharedNetworkDN $ dhcpSubnetDN $ dhcpPoolDN $ dhcpGroupDN $ dhcpHostDN $ dhcpClassesDN $ dhcpKeyDN $ dhcpZoneDN $ dhcpFailOverPeerDN $ dhcpOption $ dhcpComments)
X-NDS_CONTAINMENT ('organization' 'organizationalunit' 'domain') )
+objectclass ( 2.16.840.1.113719.1.203.6.17
+ NAME 'dhcpSubnet6'
+ DESC 'This class defines an IPv6 subnet. This is a container object.'
+ SUP top
+ MUST ( cn )
+ MAY ( dhcpRange6 $ dhcpPoolDN $ dhcpGroupDN $ dhcpHostDN $ dhcpClassesDN $ dhcpLeasesDN $ dhcpOptionsDN $ dhcpZoneDN $ dhcpKeyDN $ dhcpFailOverPeerDN $ dhcpStatements $ dhcpComments $ dhcpOption $ dhcpPermitList ) X-NDS_CONTAINMENT ('dhcpService' 'dhcpSharedNetwork') )
+
+objectclass ( 2.16.840.1.113719.1.203.6.18
+ NAME 'dhcpPool6'
+ DESC 'This stores configuration information about an IPv6 pool.'
+ SUP top
+ MUST ( cn $ dhcpRange6 )
+ MAY ( dhcpClassesDN $ dhcpPermitList $ dhcpLeasesDN $ dhcpOptionsDN $ dhcpZoneDN $dhcpKeyDN $ dhcpStatements $ dhcpComments $ dhcpOption )
+ X-NDS_CONTAINMENT ('dhcpSubnet' 'dhcpSharedNetwork') )