1 '\" te 2 .\" Copyright (c) 1992-1996 Competitive Automation, Inc. 3 .\" Copyright (c) 2009, Sun Microsystems, Inc. All Rights Reserved. 4 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License. You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. 5 .\" See the License for the specific language governing permissions and limitations under the License. When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the 6 .\" fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner] 7 .TH DHCPINFO 1 "May 15, 2009" 8 .SH NAME 9 dhcpinfo \- display values of parameters received through DHCP 10 .SH SYNOPSIS 11 .LP 12 .nf 13 \fBdhcpinfo\fR [\fB-c\fR] [\fB-i\fR \fIinterface\fR] [\fB-n\fR \fIlimit\fR] [\fB-v 4|6\fR] \fIcode\fR 14 .fi 15 16 .LP 17 .nf 18 \fBdhcpinfo\fR [\fB-c\fR] [\fB-i\fR \fIinterface\fR] [\fB-n\fR \fIlimit\fR] [\fB-v 4|6\fR] \fIidentifier\fR 19 .fi 20 21 .SH DESCRIPTION 22 .sp 23 .LP 24 The \fBdhcpinfo\fR utility prints the \fBDHCP\fR-supplied value(s) of the 25 parameter requested on the command line. The parameter can be identified either 26 by its numeric code in the \fBDHCP\fR specification, or by its mnemonic 27 identifier, as listed in \fBdhcp_inittab\fR(4). This command is intended to be 28 used in command substitutions in the shell scripts invoked by \fBinit\fR(1M) at 29 system boot. It first contacts the \fBDHCP\fR client daemon at system boot or 30 in event scripts as described in \fBdhcpagent\fR(1M). It first contacts the 31 DHCP client daemon \fBdhcpagent\fR(1M) to verify that \fBDHCP\fR has 32 successfully completed on the requested interface. If \fBDHCP\fR has 33 successfully completed on the requested interface, \fBdhcpinfo\fR retrieves the 34 values for the requested parameter. Parameter values echoed by \fBdhcpinfo\fR 35 should not be used without checking its exit status. See \fBexit\fR(1). 36 .sp 37 .LP 38 See \fBdhcp_inittab\fR(4) for the list of mnemonic identifier codes for all 39 \fBDHCP\fR parameters. See \fIRFC 2132, DHCP Options and BOOTP Vendor 40 Extensions\fR for more details on DHCPv4 parameters, and RFC 3315, Dynamic Host 41 Configuration Protocol for IPv6 (DHCPv6), for more details on DHCPv6 42 parameters. 43 .SS "Output Format" 44 .sp 45 .LP 46 The output from \fBdhcpinfo\fR consists of one or more lines of \fBASCII\fR 47 text; the format of the output depends upon the requested parameter. The number 48 of values returned per line and the total number of lines output for a given 49 parameter are determined by the parameter's \fBgranularity\fR and \fBmaximum\fR 50 values, respectively, as defined by \fBdhcp_inittab\fR(4). 51 .sp 52 .LP 53 The format of each individual value is determined by the data type of the 54 option, as determined by \fBdhcp_inittab\fR(4). The possible data types and 55 their formats are listed below: 56 .sp 57 58 .sp 59 .TS 60 c c c 61 l l l . 62 Data Type Format \fBdhcp_inittab\fR(4) type 63 Unsigned Number One or more decimal digits T{ 64 \fBUNUMBER8\fR, \fBUNUMBER16\fR, \fBUNUMBER32\fR, \fBUNUMBER64\fR 65 T} 66 Signed Number T{ 67 One or more decimal digits, optionally preceded by a minus sign 68 T} T{ 69 \fBSNUMBER8\fR, \fBSNUMBER16\fR, \fBSNUMBER32\fR, \fBSNUMBER64\fR 70 T} 71 \fBIP\fR Address Dotted-decimal notation \fBIP\fR 72 IPv6 Address Colon-separated notation \fBIPv6\fR 73 Octet T{ 74 The string \fB0x\fR followed by a two-digit hexadecimal value 75 T} \fBOCTET\fR 76 String Zero or more \fBASCII\fR characters \fBASCII\fR 77 DUID DHCP Unique Identifier text \fBDUID\fR 78 Domain Name T{ 79 Standard dot-separated domain name, RFC 1035 format 80 T} \fBDOMAIN\fR 81 .TE 82 83 .SH OPTIONS 84 .sp 85 .LP 86 The following options are supported: 87 .sp 88 .ne 2 89 .na 90 \fB\fB-c\fR\fR 91 .ad 92 .RS 16n 93 Displays the output in a canonical format. This format is identical to the 94 \fBOCTET\fR format with a granularity of \fB1\fR. 95 .RE 96 97 .sp 98 .ne 2 99 .na 100 \fB\fB-i\fR \fIinterface\fR\fR 101 .ad 102 .RS 16n 103 Specifies the interface to retrieve values for \fBDHCP\fR parameters from. If 104 this option is not specified, the primary interface is used. 105 .sp 106 If a primary interface has not been selected for the system by 107 \fBifconfig\fR(1M) or for this command by \fB-i\fR, the system automatically 108 selects an interface to consider as primary for the current command invocation. 109 The selection chooses the interface whose name sorts lexically first, and that 110 has DHCP parameters attached. This selection does not affect system state. Use 111 \fBifconfig\fR(1M) to set a primary interface. 112 .sp 113 The recommended practice in the \fBdhcpagent\fR(1M) \fBeventhook\fR scripts is 114 to specify the desired interface with \fB-i\fR, rather than relying on primary 115 selection. 116 .sp 117 For DHCPv6, the interface name used should be the name of the physical 118 interface, not one of the logical interfaces created by \fBdhcpagent\fR. 119 .RE 120 121 .sp 122 .ne 2 123 .na 124 \fB\fB-n\fR \fIlimit\fR\fR 125 .ad 126 .RS 16n 127 Limits the list of values displayed to \fIlimit\fR lines. 128 .RE 129 130 .sp 131 .ne 2 132 .na 133 \fB\fB-v\fR\fB4 | 6\fR\fR 134 .ad 135 .RS 16n 136 Specifies the DHCP version to query. Use \fB-v4\fRfor DHCPv4 and \fB-v6\fR for 137 DHCPv6. 138 .RE 139 140 .SH OPERANDS 141 .sp 142 .LP 143 The following operands are supported: 144 .sp 145 .ne 2 146 .na 147 \fB\fIcode\fR\fR 148 .ad 149 .RS 14n 150 Numeric code for the requested \fBDHCP\fR parameter, as defined by the 151 \fBDHCP\fR specification. Vendor options are specified by adding \fB256\fR to 152 the actual vendor code for DHCPv4, and \fB65536\fR for DHCPv6. 153 .RE 154 155 .sp 156 .ne 2 157 .na 158 \fB\fIidentifier\fR\fR 159 .ad 160 .RS 14n 161 Mnemonic symbol for the requested \fBDHCP\fR parameter, as listed in 162 \fBdhcp_inittab\fR(4). 163 .RE 164 165 .SH EXIT STATUS 166 .sp 167 .LP 168 The following exit values are returned: 169 .sp 170 .ne 2 171 .na 172 \fB\fB0\fR\fR 173 .ad 174 .RS 5n 175 Successful operation. 176 .RE 177 178 .sp 179 .ne 2 180 .na 181 \fB\fB2\fR\fR 182 .ad 183 .RS 5n 184 The operation was not successful. The \fBDHCP\fR client daemon might not be 185 running, the interface might have failed to configure, or no satisfactory 186 \fBDHCP\fR responses were received. 187 .RE 188 189 .sp 190 .ne 2 191 .na 192 \fB\fB3\fR\fR 193 .ad 194 .RS 5n 195 Bad arguments. 196 .RE 197 198 .sp 199 .ne 2 200 .na 201 \fB\fB4\fR\fR 202 .ad 203 .RS 5n 204 The operation timed out. 205 .RE 206 207 .sp 208 .ne 2 209 .na 210 \fB\fB6\fR\fR 211 .ad 212 .RS 5n 213 System error (should never occur). 214 .RE 215 216 .SH ATTRIBUTES 217 .sp 218 .LP 219 See \fBattributes\fR(5) for descriptions of the following attributes: 220 .sp 221 222 .sp 223 .TS 224 box; 225 c | c 226 l | l . 227 ATTRIBUTE TYPE ATTRIBUTE VALUE 228 _ 229 Interface Stability Committed 230 .TE 231 232 .SH SEE ALSO 233 .sp 234 .LP 235 \fBdhcpagent\fR(1M), \fBifconfig\fR(1M), \fBinit\fR(1M), \fBdhcp_inittab\fR(4), 236 \fBattributes\fR(5) 237 .sp 238 .LP 239 Alexander, S., and R. Droms, \fIRFC 2132, DHCP Options and BOOTP Vendor 240 Extensions\fR, Silicon Graphics, Inc., Bucknell University, March 1997. 241 .sp 242 .LP 243 Droms, R. , \fIRFC 3315, Dynamic Host Configuration Protocol for IPv6 244 (DHCPv6)\fR, Cisco Systems, July 2003. 245 .sp 246 .LP 247 Mockapetris, P.V. , \fIRFC 1035, Domain names - implementation and 248 specification\fR, ISI, November 1987.