<chapter id="dhcp-ref-4"><title>DHCP Commands
and Files (Reference)</title><highlights><para>This chapter explains the relationships between the DHCP commands and the DHCP
files. However, the chapter does not explain how to use the commands.</para><itemizedlist><para>The chapter contains the following information:</para><listitem><para><olink targetptr="dhcp-ref-5" remap="internal">DHCP Commands</olink></para>
</listitem><listitem><para><olink targetptr="dhcp-ref-6" remap="internal">Files Used by the DHCP Service</olink></para>
</listitem><listitem><para><olink targetptr="dhcp-ref-9" remap="internal">DHCP Option Information</olink></para>
</listitem>
</itemizedlist>
</highlights><sect1 id="dhcp-ref-5"><title>DHCP Commands</title><para>The following table lists the commands that you can use to manage DHCP on your
network.</para><table frame="all" pgwide="1" id="dhcp-ref-tbl-1"><title>Commands Used in DHCP</title><tgroup cols="3" colsep="1" rowsep="1"><colspec colname="colspec0" colwidth="88.24*"/><colspec colname="colspec1" colwidth="376.41*"/><colspec colname="colspec2" colwidth="216.95*"/><thead><row><entry><para>Command</para>
</entry><entry><para>Description</para>
</entry><entry><para>Man Page</para>
</entry>
</row>
</thead><tbody><row><entry><para><literal>dhtadm</literal></para>
</entry><entry><para>Used to make changes to the options and macros in the <filename>dhcptab</filename>. This command is most useful in scripts that you create to automate changes
to your DHCP information. Use <command>dhtadm</command> with the <literal>-P</literal> option,
and pipe the output through the <command>grep</command> command for a quick way to
search for particular option values in the <literal>dhcptab</literal> table.</para>
</entry><entry><para><olink targetdoc="refman1m" targetptr="dhtadm-1m" remap="external"><citerefentry><refentrytitle>dhtadm</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink></para>
</entry>
</row><row><entry><para><literal>pntadm</literal></para>
</entry><entry><para>Used to make changes to the DHCP network tables that map client IDs to
IP addresses and optionally associate configuration information with IP addresses.</para>
</entry><entry><para><olink targetdoc="refman1m" targetptr="pntadm-1m" remap="external"><citerefentry><refentrytitle>pntadm</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink></para>
</entry>
</row><row><entry><para><literal>dhcpconfig</literal></para>
</entry><entry><para>Used to configure and unconfigure DHCP servers and BOOTP relay agents.
Also used to convert to a different data store format, and to import and export DHCP
configuration data.</para>
</entry><entry><para><olink targetdoc="refman1m" targetptr="dhcpconfig-1m" remap="external"><citerefentry><refentrytitle>dhcpconfig</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink></para>
</entry>
</row><row><entry><para><literal>in.dhcpd</literal></para>
</entry><entry><para>The DHCP server daemon. The daemon is started when the system is started.
You should not start the server daemon directly. Use DHCP Manager, the <command>svcadm</command> command, or <command>dhcpconfig</command> to start and stop the daemon.
The daemon should be invoked directly only to run the server in debug mode to troubleshoot
problems.</para>
</entry><entry><para><olink targetdoc="refman1m" targetptr="in.dhcpd-1m" remap="external"><citerefentry><refentrytitle>in.dhcpd</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink></para>
</entry>
</row><row><entry><para><literal>dhcpmgr</literal></para>
</entry><entry><para>The DHCP Manager, a graphical user interface (GUI) tool used to configure
and manage the DHCP service. DHCP Manager is the recommended Solaris DHCP management
tool.</para>
</entry><entry><para><olink targetdoc="refman1m" targetptr="dhcpmgr-1m" remap="external"><citerefentry><refentrytitle>dhcpmgr</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink></para>
</entry>
</row><row><entry><para><literal>ifconfig</literal></para>
</entry><entry><para>Used at system boot to assign IP addresses to network interfaces, configure
network interface parameters, or both. On a Solaris DHCP client, <literal>ifconfig</literal> starts DHCP to get the parameters (including the IP address) needed to
configure a network interface.</para>
</entry><entry><para><olink targetdoc="refman1m" targetptr="ifconfig-1m" remap="external"><citerefentry><refentrytitle>ifconfig</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink></para>
</entry>
</row><row><entry><para><literal>dhcpinfo</literal></para>
</entry><entry><para>Used by system startup scripts on Solaris client systems to obtain information
(such as the host name) from the DHCP client daemon, <literal>dhcpagent</literal>.
You can also use <literal>dhcpinfo</literal> in scripts or at the command line to
obtain specified parameter values.</para>
</entry><entry><para><olink targetdoc="refman1" targetptr="dhcpinfo-1" remap="external"><citerefentry><refentrytitle>dhcpinfo</refentrytitle><manvolnum>1</manvolnum></citerefentry></olink></para>
</entry>
</row><row><entry><para><literal>snoop</literal></para>
</entry><entry><para>Used to capture and display the contents of packets being passed across the
network. <literal>snoop</literal> is useful for troubleshooting problems with the
DHCP service.</para>
</entry><entry><para><olink targetdoc="refman1m" targetptr="snoop-1m" remap="external"><citerefentry><refentrytitle>snoop</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink></para>
</entry>
</row><row><entry><para><literal>dhcpagent</literal></para>
</entry><entry><para>The DHCP client daemon, which implements the client side of the DHCP protocol.</para>
</entry><entry><para><olink targetdoc="refman1m" targetptr="dhcpagent-1m" remap="external"><citerefentry><refentrytitle>dhcpagent</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink></para>
</entry>
</row>
</tbody>
</tgroup>
</table><sect2 id="dhcp-ref-1"><title>Running DHCP Commands in Scripts</title><para>The <literal>dhcpconfig</literal>, <literal>dhtadm</literal>, and <literal>pntadm</literal> commands are optimized for use in scripts. In particular, the <literal>pntadm</literal> command is useful for creating a large number of IP address entries
in a DHCP network table. The following sample script uses <literal>pntadm</literal> in
batch mode to create IP addresses. </para><example id="dhcp-ref-ex-1206"><title><literal>addclient.ksh</literal> Script With
the <literal>pntadm</literal> Command</title><programlisting role="complete">#! /usr/bin/ksh
#
# This script utilizes the pntadm batch facility to add client entries
# to a DHCP network table. It assumes that the user has the rights to
# run pntadm to add entries to DHCP network tables.

#
# Based on the nsswitch setting, query the netmasks table for a netmask.
# Accepts one argument, a dotted IP address.
#
get_netmask()
{
	MTMP=`getent netmasks ${1} | awk '{ print $2 }'`
	if [ ! -z "${MTMP}" ]
	then
		print - ${MTMP}
	fi
}

#
# Based on the network specification, determine whether or not network is 
# subnetted or supernetted.
# Given a dotted IP network number, convert it to the default class
# network.(used to detect subnetting). Requires one argument, the
# network number. (e.g. 10.0.0.0) Echos the default network and default
# mask for success, null if error.
#
get_default_class()
{
	NN01=${1%%.*}
	tmp=${1#*.}
	NN02=${tmp%%.*}
	tmp=${tmp#*.}
	NN03=${tmp%%.*}
	tmp=${tmp#*.}
	NN04=${tmp%%.*}
	RETNET=""
	RETMASK=""

	typeset -i16 ONE=10#${1%%.*}
	typeset -i10 X=$((${ONE}&amp;16#f0))
	if [ ${X} -eq 224 ]
	then
		# Multicast
		typeset -i10 TMP=$((${ONE}&amp;16#f0))
		RETNET="${TMP}.0.0.0"
		RETMASK="240.0.0.0"
	fi
	typeset -i10 X=$((${ONE}&amp;16#80))
	if [ -z "${RETNET}" -a ${X} -eq 0 ]
	then
		# Class A
		RETNET="${NN01}.0.0.0"
		RETMASK="255.0.0.0"
	fi
	typeset -i10 X=$((${ONE}&amp;16#c0))
	if [ -z "${RETNET}" -a ${X} -eq 128 ]
	then
		# Class B
		RETNET="${NN01}.${NN02}.0.0"
		RETMASK="255.255.0.0"
	fi
	typeset -i10 X=$((${ONE}&amp;16#e0))
	if [ -z "${RETNET}" -a ${X} -eq 192 ]
	then
		# Class C
		RETNET="${NN01}.${NN02}.${NN03}.0"
		RETMASK="255.255.255.0"
	fi
	print - ${RETNET} ${RETMASK}
	unset NNO1 NNO2 NNO3 NNO4 RETNET RETMASK X ONE
}

#
# Given a dotted form of an IP address, convert it to its hex equivalent.
#
convert_dotted_to_hex()
{
	typeset -i10 one=${1%%.*}
	typeset -i16 one=${one}
	typeset -Z2 one=${one}
	tmp=${1#*.}

	typeset -i10 two=${tmp%%.*}
	typeset -i16 two=${two}
	typeset -Z2 two=${two}
	tmp=${tmp#*.}

	typeset -i10 three=${tmp%%.*}
	typeset -i16 three=${three}
	typeset -Z2 three=${three}
	tmp=${tmp#*.}

	typeset -i10 four=${tmp%%.*}
	typeset -i16 four=${four}
	typeset -Z2 four=${four}

	 hex=`print - ${one}${two}${three}${four} | sed -e 's/#/0/g'`
	 print - 16#${hex}
	 unset one two three four tmp
}

#
# Generate an IP address given the network address, mask, increment.
# 
get_addr()
{
	typeset -i16 net=`convert_dotted_to_hex ${1}`
	typeset -i16 mask=`convert_dotted_to_hex ${2}`
	typeset -i16 incr=10#${3}

	# Maximum legal value - invert the mask, add to net.
	typeset -i16 mhosts=~${mask}
	typeset -i16 maxnet=${net}+${mhosts}

	# Add the incr value.
	let net=${net}+${incr}

	if [ $((${net} &lt; ${maxnet})) -eq 1 ]
	then
		typeset -i16 a=${net}\&amp;16#ff000000
		typeset -i10 a="${a}>>24"

		typeset -i16 b=${net}\&amp;16#ff0000
		typeset -i10 b="${b}>>16"

		typeset -i16 c=${net}\&amp;16#ff00
		typeset -i10 c="${c}>>8"

		typeset -i10 d=${net}\&amp;16#ff
		print - "${a}.${b}.${c}.${d}"
	fi
	unset net mask incr mhosts maxnet a b c d
}

# Given a network address and client address, return the index.
client_index()
{
	typeset -i NNO1=${1%%.*}
	tmp=${1#*.}
	typeset -i NNO2=${tmp%%.*}
	tmp=${tmp#*.}
	typeset -i NNO3=${tmp%%.*}
	tmp=${tmp#*.}
	typeset -i NNO4=${tmp%%.*}

	typeset -i16 NNF1
	let NNF1=${NNO1}
	typeset -i16 NNF2
	let NNF2=${NNO2}
	typeset -i16 NNF3
	let NNF3=${NNO3}
	typeset -i16 NNF4
	let NNF4=${NNO4}
	typeset +i16 NNF1
	typeset +i16 NNF2
	typeset +i16 NNF3
	typeset +i16 NNF4
	NNF1=${NNF1#16\#}
	NNF2=${NNF2#16\#}
	NNF3=${NNF3#16\#}
	NNF4=${NNF4#16\#}
	if [ ${#NNF1} -eq 1 ]
	then
		NNF1="0${NNF1}"
	fi
	if [ ${#NNF2} -eq 1 ]
	then
		NNF2="0${NNF2}"
	fi
	if [ ${#NNF3} -eq 1 ]
	then
		NNF3="0${NNF3}"
	fi
	if [ ${#NNF4} -eq 1 ]
	then
		NNF4="0${NNF4}"
	fi
	typeset -i16 NN
	let NN=16#${NNF1}${NNF2}${NNF3}${NNF4}
	unset NNF1 NNF2 NNF3 NNF4

	typeset -i NNO1=${2%%.*}
	tmp=${2#*.}
	typeset -i NNO2=${tmp%%.*}
	tmp=${tmp#*.}
	typeset -i NNO3=${tmp%%.*}
	tmp=${tmp#*.}
	typeset -i NNO4=${tmp%%.*}
	typeset -i16 NNF1
	let NNF1=${NNO1}
	typeset -i16 NNF2
	let NNF2=${NNO2}
	typeset -i16 NNF3
	let NNF3=${NNO3}
	typeset -i16 NNF4
	let NNF4=${NNO4}
	typeset +i16 NNF1
	typeset +i16 NNF2
	typeset +i16 NNF3
	typeset +i16 NNF4
	NNF1=${NNF1#16\#}
	NNF2=${NNF2#16\#}
	NNF3=${NNF3#16\#}
	NNF4=${NNF4#16\#}
	if [ ${#NNF1} -eq 1 ]
	then
		NNF1="0${NNF1}"
	fi
	if [ ${#NNF2} -eq 1 ]
	then
		NNF2="0${NNF2}"
	fi
	if [ ${#NNF3} -eq 1 ]
	then
		NNF3="0${NNF3}"
	fi
	if [ ${#NNF4} -eq 1 ]
	then
		NNF4="0${NNF4}"
	fi
	typeset -i16 NC
	let NC=16#${NNF1}${NNF2}${NNF3}${NNF4}
	typeset -i10 ANS
	let ANS=${NC}-${NN}
	print - $ANS
}

#
# Check usage.
#
if [ "$#" != 3 ]
then
	print "This script is used to add client entries to a DHCP network"
	print "table by utilizing the pntadm batch facilty.\n"
	print "usage: $0 network start_ip entries\n"
	print "where: network is the IP address of the network"
        print "       start_ip is the starting IP address \n"
        print "       entries is the number of the entries to add\n"
	print "example: $0 10.148.174.0 10.148.174.1 254\n"
	return
fi

#
# Use input arguments to set script variables.
#
NETWORK=$1
START_IP=$2
typeset -i STRTNUM=`client_index ${NETWORK} ${START_IP}`
let ENDNUM=${STRTNUM}+$3
let ENTRYNUM=${STRTNUM}
BATCHFILE=/tmp/batchfile.$$
MACRO=`uname -n`

#
# Check if mask in netmasks table. First try
# for network address as given, in case VLSM
# is in use.
#
NETMASK=`get_netmask ${NETWORK}`
if [ -z "${NETMASK}" ]
then
	get_default_class ${NETWORK} | read DEFNET DEFMASK
	# use the default.
	if [ "${DEFNET}" != "${NETWORK}" ]
	then
		# likely subnetted/supernetted.
		print - "\n\n###\tWarning\t###\n"
		print - "Network ${NETWORK} is netmasked, but no entry was found  \n
              in the 'netmasks' table; please update the 'netmasks'  \n
              table in the appropriate nameservice before continuing. \n 
              (See /etc/nsswitch.conf.) \n" >&amp;2
		return 1
	else
		# use the default.
		NETMASK="${DEFMASK}"
	fi
fi

#
# Create a batch file.
#
print -n "Creating batch file "
while [ ${ENTRYNUM} -lt ${ENDNUM} ]
do
	if [ $((${ENTRYNUM}-${STRTNUM}))%50 -eq 0 ]
	then
		print -n "."
	fi

	CLIENTIP=`get_addr ${NETWORK} ${NETMASK} ${ENTRYNUM}`
	print "pntadm -A ${CLIENTIP} -m ${MACRO} ${NETWORK}" >> ${BATCHFILE}
	let ENTRYNUM=${ENTRYNUM}+1
done
print " done.\n"

#
# Run pntadm in batch mode and redirect output to a temporary file.
# Progress can be monitored by using the output file.
#
print "Batch processing output redirected to ${BATCHFILE}"
print "Batch processing started."

pntadm -B ${BATCHFILE} -v > /tmp/batch.out 2 >&amp;1

print "Batch processing completed."</programlisting>
</example>
</sect2>
</sect1><sect1 id="dhcp-ref-6"><title>Files Used by the DHCP Service</title><para>The following table lists files associated with Solaris DHCP.</para><table frame="all" pgwide="1" id="dhcp-ref-tbl-7"><title>Files and Tables Used by
DHCP Daemons and Commands</title><tgroup cols="3" colsep="1" rowsep="1"><colspec colname="colspec0" colwidth="116.85*"/><colspec colname="colspec1" colwidth="334.47*"/><colspec colname="colspec3" colwidth="229.77*"/><thead><row><entry><para>File or Table Name</para>
</entry><entry><para>Description</para>
</entry><entry><para>Man Page</para>
</entry>
</row>
</thead><tbody><row><entry><para><literal>dhcptab</literal></para>
</entry><entry><para>A generic term for the table of DHCP configuration information that is
recorded as options with assigned values, which are then grouped into macros. The
name of the <literal>dhcptab</literal> table and its location is determined by the
data store you use for DHCP information.</para>
</entry><entry><para><olink targetdoc="refman4" targetptr="dhcptab-4" remap="external"><citerefentry><refentrytitle>dhcptab</refentrytitle><manvolnum>4</manvolnum></citerefentry></olink></para>
</entry>
</row><row><entry><para>DHCP network table</para>
</entry><entry><para>Maps IP addresses to client IDs and configuration options. DHCP network tables
are named according to the IP address of the network, such as <literal>10.21.32.0</literal>. There is no file that is called <filename>dhcp_network</filename>. The
name and location of DHCP network tables is determined by the data store you use for
DHCP information.</para>
</entry><entry><para><olink targetdoc="refman4" targetptr="dhcp-network-4" remap="external"><citerefentry><refentrytitle>dhcp_network</refentrytitle><manvolnum>4</manvolnum></citerefentry></olink></para>
</entry>
</row><row><entry><para><literal>dhcpsvc.conf</literal></para>
</entry><entry><para>Stores startup options for the DHCP daemon and data store information.
This file must not be edited manually. Use the <command>dhcpconfig</command> command
to change startup options.</para>
</entry><entry><para><olink targetdoc="refman4" targetptr="dhcpsvc.conf-4" remap="external"><citerefentry><refentrytitle>dhcpsvc.conf</refentrytitle><manvolnum>4</manvolnum></citerefentry></olink></para>
</entry>
</row><row><entry><para><literal>nsswitch.conf</literal></para>
</entry><entry><para>Specifies the location of name service databases and the order in which
to search name services for various kinds of information. The <literal>nsswitch.conf</literal> file is read to obtain accurate configuration information when you configure
a DHCP server. The file is located in the <literal>/etc</literal> directory.</para>
</entry><entry><para><olink targetdoc="refman4" targetptr="nsswitch.conf-4" remap="external"><citerefentry><refentrytitle>nsswitch.conf</refentrytitle><manvolnum>4</manvolnum></citerefentry></olink></para>
</entry>
</row><row><entry><para><literal>resolv.conf</literal></para>
</entry><entry><para>Contains information used to resolve DNS queries. During DHCP server configuration,
this file is consulted for information about the DNS domain and DNS server. The file
is located in the <literal>/etc</literal> directory.</para>
</entry><entry><para><olink targetdoc="refman4" targetptr="resolv.conf-4" remap="external"><citerefentry><refentrytitle>resolv.conf</refentrytitle><manvolnum>4</manvolnum></citerefentry></olink></para>
</entry>
</row><row><entry><para><literal>dhcp.</literal><replaceable>interface</replaceable></para>
</entry><entry><para>Indicates that DHCP is to be used on the client's network interface that
is specified in the <filename>dhcp.</filename><replaceable>interface</replaceable> file
name. For example, the existence of a file named <literal>dhcp.qe0</literal> indicates
that DHCP is to be used on the <literal>qe0</literal> interface. The <literal>dhcp.</literal><replaceable>interface</replaceable> file might contain commands that are
passed as options to the <literal>ifconfig</literal> command, which is used to start
DHCP on the client. The file is located in the <literal>/etc</literal> directory on
Solaris DHCP client systems.</para>
</entry><entry><para>No specific man page, see <olink targetdoc="refman5" targetptr="dhcp-5" remap="external"><citerefentry><refentrytitle>dhcp</refentrytitle><manvolnum>5</manvolnum></citerefentry></olink></para>
</entry>
</row><row><entry><para><replaceable>interface</replaceable><literal>.dhc</literal></para>
</entry><entry><para>Contains the configuration parameters that are obtained from DHCP for
the given network interface. The client caches the current configuration information
in <filename>/etc/dhcp/</filename><replaceable>interface</replaceable><filename>.dhc</filename> when the interface's IP address lease is dropped. For example, if DHCP
is used on the <literal>qe0</literal> interface, the <literal>dhcpagent</literal> caches
the configuration information in <filename>/etc/dhcp/qe0.dhc</filename>. The next
time DHCP starts on the interface, the client requests to use the cached configuration
if the lease has not expired. If the DHCP server denies the request, the client begins
the standard process for DHCP lease negotiation.</para>
</entry><entry><para>No specific man page, see <olink targetdoc="refman1m" targetptr="dhcpagent-1m" remap="external"><citerefentry><refentrytitle>dhcpagent</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink></para>
</entry>
</row><row><entry><para><literal>dhcpagent</literal></para>
</entry><entry><para>Sets parameter values for the <literal>dhcpagent</literal> client daemon.
The path to the file is <literal>/etc/default/dhcpagent</literal>. See the <literal>/etc/default/dhcpagent</literal> file or the <olink targetdoc="refman1m" targetptr="dhcpagent-1m" remap="external"><citerefentry><refentrytitle>dhcpagent</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink> man
page for information about the parameters.</para>
</entry><entry><para><olink targetdoc="refman1m" targetptr="dhcpagent-1m" remap="external"><citerefentry><refentrytitle>dhcpagent</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink></para>
</entry>
</row><row><entry><para>DHCP <literal>inittab</literal></para>
</entry><entry><para>Defines aspects of DHCP option codes, such as the data type, and assigns
mnemonic labels. See the <olink targetdoc="refman4" targetptr="dhcp-inittab-4" remap="external"><citerefentry><refentrytitle>dhcp_inittab</refentrytitle><manvolnum>4</manvolnum></citerefentry></olink> man
page for more information about the file syntax.</para><para>On the client, the information in the <filename>/etc/dhcp/inittab</filename> file
is used by <literal>dhcpinfo</literal> to provide more meaningful information to human
readers of the information. On the DHCP server system, this file is used by the DHCP
daemon and management tools to obtain DHCP option information.</para><para>The <filename>/etc/dhcp/inittab</filename> file replaces the <filename>/etc/dhcp/dhcptags</filename> file that was used in previous releases. <olink targetptr="dhcp-ref-9" remap="internal">DHCP Option Information</olink> provides more information about this replacement.</para>
</entry><entry><para><olink targetdoc="refman4" targetptr="dhcp-inittab-4" remap="external"><citerefentry><refentrytitle>dhcp_inittab</refentrytitle><manvolnum>4</manvolnum></citerefentry></olink></para>
</entry>
</row>
</tbody>
</tgroup>
</table>
</sect1><sect1 id="dhcp-ref-9"><title>DHCP Option Information</title><para>Historically, DHCP option information has been stored in several places,
including the server's <literal>dhcptab</literal> table, the client's <literal>dhcptags</literal> file, and internal tables of various programs. In the Solaris 8 release
and later releases, the option information is consolidated in the <literal>/etc/dhcp/inittab</literal> file. See the <olink targetdoc="refman4" targetptr="dhcp-inittab-4" remap="external"><citerefentry><refentrytitle>dhcp_inittab</refentrytitle><manvolnum>4</manvolnum></citerefentry></olink> man
page for detailed information about the file.</para><para>The Solaris DHCP client uses the DHCP <literal>inittab</literal> file as a replacement
for the <literal>dhcptags</literal> file. The client uses the file to obtain information
about option codes that were received in a DHCP packet. The <literal>in.dhcpd</literal>, <literal>snoop</literal>, and <literal>dhcpmgr</literal> programs on the DHCP server use the <literal>inittab</literal> file as well.</para><sect2 id="dhcp-ref-8"><title>Determining if Your Site Is Affected</title><itemizedlist><para>Most sites that use Solaris DHCP are <emphasis>not</emphasis> affected by the
switch to the <literal>/etc/dhcp/inittab</literal> file. Your site is affected if
you meet all of the following criteria:</para><listitem><para>You plan to upgrade from a Solaris release that is older than that
the Solaris 8 release.</para>
</listitem><listitem><para>You previously created new DHCP options.</para>
</listitem><listitem><para>You modified the <literal>/etc/dhcp/dhcptags</literal> file, and you
want to retain the changes.</para>
</listitem>
</itemizedlist><para>When you upgrade, the upgrade log notifies you that your <literal>dhcptags</literal> file
had been modified and that you should make changes to the DHCP <literal>inittab</literal> file.</para>
</sect2><sect2 id="dhcp-ref-10"><title>Differences Between <filename>dhcptags</filename> and <filename>inittab</filename> Files</title><para>The <filename>inittab</filename> file contains more information than the <literal>dhcptags</literal> file. The <filename>inittab</filename> file also uses a different
syntax. </para><para>A sample <filename>dhcptags</filename> entry is as follows:</para><para><literal>33   StaticRt   -       IPList       Static_Routes</literal>  </para><para><literal>33</literal> is the numeric code that is passed in the DHCP packet. <literal>StaticRt</literal> is the option name. <literal>IPList</literal> indicates that the
data type for <literal>StaticRt</literal> must be a list of IP addresses. <literal>Static_Routes</literal> is a more descriptive name.</para><para>The <literal>inittab</literal> file consists of one-line records that describe
each option. The format is similar to the format that defines symbols in <literal>dhcptab</literal>. The following table describes the syntax of the <literal>inittab</literal> file.</para><variablelist><varlistentry><term>Option</term><listitem><para>Description</para>
</listitem>
</varlistentry><varlistentry><term><replaceable>option-name</replaceable></term><listitem><para>Name of the option. The option name must be unique within its option
category, and not overlap with other option names in the Standard, Site, and Vendor
categories. For example, you cannot have two Site options with the same name, and
you should not create a Site option with the same name as a Standard option.  </para>
</listitem>
</varlistentry><varlistentry><term><replaceable>category</replaceable></term><listitem><para>Identifies the namespace in which the option belongs. Must be one
of the following: Standard, Site, Vendor, Field, or Internal.</para>
</listitem>
</varlistentry><varlistentry><term><replaceable>code</replaceable></term><listitem><para>Identifies the option when sent over the network. In most cases, the
code uniquely identifies the option, without a category.  However, in the case of
internal categories such as Field or Internal, a code might be used for other purposes.
The code might not be globally unique.  The code should be unique within the option's
category, and not overlap with codes in the Standard and Site fields.    </para>
</listitem>
</varlistentry><varlistentry><term><replaceable>type</replaceable></term><listitem><para>Describes the data that is associated with this option.  Valid types
are IP, ASCII, Octet, Boolean, Unumber8, Unumber16, Unumber32, Unumber64, Snumber8,
Snumber16, Snumber32, and Snumber64.  For numbers, an initial U or S indicates that
the number is unsigned or signed. The digits at the end indicate how many bits are
in the number. For example, Unumber8 is an unsigned 8-bit number. The type is not
case sensitive.</para>
</listitem>
</varlistentry><varlistentry><term><replaceable>granularity</replaceable></term><listitem><para>Describes how many units of data make up a whole value for this option. </para>
</listitem>
</varlistentry><varlistentry><term><replaceable>maximum</replaceable></term><listitem><para>Describes how many whole values are allowed for this option.  0 indicates
an infinite number.</para>
</listitem>
</varlistentry><varlistentry><term><replaceable>consumers</replaceable></term><listitem><para>Describes which programs can use this information. Consumers should
be set to <literal>sdmi</literal>, where:</para><variablelist><varlistentry><term><literal>s</literal></term><listitem><para><literal>snoop</literal></para>
</listitem>
</varlistentry><varlistentry><term><literal>d</literal></term><listitem><para><literal>in.dhcpd</literal></para>
</listitem>
</varlistentry><varlistentry><term><literal>m</literal></term><listitem><para><literal>dhcpmgr</literal></para>
</listitem>
</varlistentry><varlistentry><term><literal>i</literal></term><listitem><para><literal>dhcpinfo</literal></para>
</listitem>
</varlistentry>
</variablelist>
</listitem>
</varlistentry>
</variablelist><para>A sample <literal>inittab</literal> entry is as follows:</para><para><literal>StaticRt - Standard, 33, IP, 2, 0, sdmi</literal></para><para>This entry describes an option that is named <literal>StaticRt</literal>. The
option is in the Standard category, and is option code 33. The expected data is a
potentially infinite number of pairs of IP addresses because the type is <literal>IP</literal>, the granularity is <literal>2</literal>, and the maximum is infinite
(<literal>0</literal>). The consumers of this option are <literal>sdmi</literal>: <literal>snoop</literal>, <literal>in.dhcpd</literal>, <literal>dhcpmgr</literal>, and <literal>dhcpinfo</literal>.</para>
</sect2><sect2 id="dhcp-ref-14"><title>Converting <literal>dhcptags</literal> Entries to <literal>inittab</literal> Entries</title><para>If you previously added entries to your <literal>dhcptags</literal> file, you
must add corresponding entries to the new <literal>inittab</literal> file if you want
to continue using the options you added to your site. The following example shows
how a sample <literal>dhcptags</literal> entry might be expressed in <literal>inittab</literal> format.</para><para>Suppose you had added the following <literal>dhcptags</literal> entry for fax
machines that are connected to the network:</para><para><literal>128  FaxMchn - IP Fax_Machine</literal></para><para>The code <literal>128</literal> means that the option must be in the Site category.
The option name is <literal>FaxMchn</literal>, and the data type is <literal>IP</literal>.</para><para>The corresponding <literal>inittab</literal> entry might be:</para><para><literal>FaxMchn SITE,	128,	IP,	1,	1, sdmi</literal></para><para>The granularity of 1 and the maximum of 1 indicate that one IP address is expected
for this option.</para>
</sect2>
</sect1>
</chapter>