xref: /illumos-gate/usr/src/cmd/cmd-inet/sbin/dhcpagent/defaults.h (revision 66582b606a8194f7f3ba5b3a3a6dca5b0d346361)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License (the "License").
6  * You may not use this file except in compliance with the License.
7  *
8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9  * or http://www.opensolaris.org/os/licensing.
10  * See the License for the specific language governing permissions
11  * and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL HEADER in each
14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15  * If applicable, add the following below this CDDL HEADER, with the
16  * fields enclosed by brackets "[]" replaced with your own identifying
17  * information: Portions Copyright [yyyy] [name of copyright owner]
18  *
19  * CDDL HEADER END
20  */
21 /*
22  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
23  * Use is subject to license terms.
24  * Copyright (c) 2016-2017, Chris Fraire <cfraire@me.com>.
25  */
26 
27 #ifndef	DEFAULTS_H
28 #define	DEFAULTS_H
29 
30 #include <sys/types.h>
31 
32 /*
33  * defaults.[ch] encapsulate the agent's interface to the dhcpagent
34  * defaults file.  see defaults.c for documentation on how to use the
35  * exported functions.
36  */
37 
38 #ifdef	__cplusplus
39 extern "C" {
40 #endif
41 
42 /*
43  * tunable parameters -- keep in the same order as defaults[] in defaults.c
44  */
45 
46 enum {
47 
48 	DF_RELEASE_ON_SIGTERM,	/* send RELEASE on each if upon SIGTERM */
49 	_UNUSED_DF_IGNORE_FAILED_ARP,
50 	DF_OFFER_WAIT,		/* how long to wait to collect offers */
51 	_UNUSED_DF_ARP_WAIT,
52 	DF_CLIENT_ID,		/* our client id */
53 	DF_PARAM_REQUEST_LIST,	/* our parameter request list */
54 	DF_REQUEST_HOSTNAME,	/* request hostname associated with interface */
55 	DF_DEBUG_LEVEL,		/* set debug level (undocumented) */
56 	DF_VERBOSE,		/* set verbose mode (undocumented) */
57 	DF_VERIFIED_LEASE_ONLY,	/* send RELEASE on SIGTERM and need verify */
58 	DF_PARAM_IGNORE_LIST,	/* our parameter ignore list */
59 	DF_REQUEST_FQDN,	/* request FQDN associated with interface */
60 	DF_V4_DEFAULT_IAID_DUID,	/* IAID/DUID if no DF_CLIENT_ID */
61 	DF_DNS_DOMAINNAME,	/* static domain name if not in --reqhost */
62 	DF_ADOPT_DOMAINNAME	/* adopt DHCP domain if not in --reqhost */
63 };
64 
65 #define	DHCP_AGENT_DEFAULTS	"/etc/default/dhcpagent"
66 
67 boolean_t	df_get_bool(const char *, boolean_t, uint_t);
68 int		df_get_int(const char *, boolean_t, uint_t);
69 const char	*df_get_string(const char *, boolean_t, uint_t);
70 
71 #ifdef	__cplusplus
72 }
73 #endif
74 
75 #endif	/* DEFAULTS_H */
76