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.
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.
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]
23 * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
30 * header file for zonecfg command
60 #define CMD_MIN CMD_ADD
61 #define CMD_MAX CMD_VERIFY
63 /* resource types: increment RT_MAX when expanding this list */
65 #define RT_ZONENAME 1 /* really a property, but for info ... */
66 #define RT_ZONEPATH 2 /* really a property, but for info ... */
67 #define RT_AUTOBOOT 3 /* really a property, but for info ... */
68 #define RT_POOL 4 /* really a property, but for info ... */
75 #define RT_LIMITPRIV 11 /* really a property, but for info ... */
76 #define RT_BOOTARGS 12 /* really a property, but for info ... */
77 #define RT_BRAND 13 /* really a property, but for info ... */
80 #define RT_MAXLWPS 16 /* really a rctl alias property, but for info */
81 #define RT_MAXSHMMEM 17 /* really a rctl alias property, but for info */
82 #define RT_MAXSHMIDS 18 /* really a rctl alias property, but for info */
83 #define RT_MAXMSGIDS 19 /* really a rctl alias property, but for info */
84 #define RT_MAXSEMIDS 20 /* really a rctl alias property, but for info */
85 #define RT_SHARES 21 /* really a rctl alias property, but for info */
86 #define RT_SCHED 22 /* really a property, but for info ... */
87 #define RT_IPTYPE 23 /* really a property, but for info ... */
89 #define RT_HOSTID 25 /* really a property, but for info ... */
91 #define RT_FS_ALLOWED 27
92 #define RT_MAXPROCS 28 /* really a rctl alias property, but for info */
93 #define RT_SECFLAGS 29
95 #define RT_MIN RT_UNKNOWN
96 #define RT_MAX RT_SECFLAGS
98 /* property types: increment PT_MAX when expanding this list */
100 #define PT_ZONENAME 1
101 #define PT_ZONEPATH 2
102 #define PT_AUTOBOOT 3
109 #define PT_PHYSICAL 10
117 #define PT_LIMITPRIV 18
118 #define PT_BOOTARGS 19
121 #define PT_IMPORTANCE 22
125 #define PT_MAXLWPS 26
126 #define PT_MAXSHMMEM 27
127 #define PT_MAXSHMIDS 28
128 #define PT_MAXMSGIDS 29
129 #define PT_MAXSEMIDS 30
130 #define PT_MAXLOCKEDMEM 31
131 #define PT_MAXSWAP 32
134 #define PT_DEFROUTER 35
138 #define PT_FS_ALLOWED 39
139 #define PT_MAXPROCS 40
140 #define PT_ALLOWED_ADDRESS 41
141 #define PT_DEFAULT 42
145 #define PT_MIN PT_UNKNOWN
146 #define PT_MAX PT_UPPER
148 #define MAX_EQ_PROP_PAIRS 3
150 #define PROP_VAL_SIMPLE 0
151 #define PROP_VAL_COMPLEX 1
152 #define PROP_VAL_LIST 2
154 #define PROP_VAL_MIN PROP_VAL_SIMPLE
155 #define PROP_VAL_MAX PROP_VAL_LIST
158 * If any subcommand is ever modified to take more than three arguments,
159 * this will need to be incremented.
161 #define MAX_SUBCMD_ARGS 3
163 typedef struct complex_property
{
164 int cp_type
; /* from the PT_* list above */
166 struct complex_property
*cp_next
;
167 } complex_property_t
, *complex_property_ptr_t
;
169 typedef struct list_property
{
171 complex_property_ptr_t lp_complex
;
172 struct list_property
*lp_next
;
173 } list_property_t
, *list_property_ptr_t
;
175 typedef struct property_value
{
176 int pv_type
; /* from the PROP_VAL_* list above */
178 complex_property_ptr_t pv_complex
;
179 list_property_ptr_t pv_list
;
180 } property_value_t
, *property_value_ptr_t
;
184 void (*cmd_handler
)(struct cmd
*);
186 int cmd_prop_nv_pairs
;
187 int cmd_prop_name
[MAX_EQ_PROP_PAIRS
];
188 property_value_ptr_t cmd_property_ptr
[MAX_EQ_PROP_PAIRS
];
190 char *cmd_argv
[MAX_SUBCMD_ARGS
+ 1];
193 #define HELP_USAGE 0x01
194 #define HELP_SUBCMDS 0x02
195 #define HELP_SYNTAX 0x04
196 #define HELP_RESOURCES 0x08
197 #define HELP_PROPS 0x10
198 #define HELP_META 0x20
199 #define HELP_NETADDR 0x40
200 #define HELP_RES_SCOPE 0x80
202 #define HELP_RES_PROPS (HELP_RESOURCES | HELP_PROPS)
204 extern void add_func(cmd_t
*);
205 extern void cancel_func(cmd_t
*);
206 extern void commit_func(cmd_t
*);
207 extern void create_func(cmd_t
*);
208 extern void delete_func(cmd_t
*);
209 extern void end_func(cmd_t
*);
210 extern void exit_func(cmd_t
*);
211 extern void export_func(cmd_t
*);
212 extern void help_func(cmd_t
*);
213 extern void info_func(cmd_t
*);
214 extern void remove_func(cmd_t
*);
215 extern void revert_func(cmd_t
*);
216 extern void select_func(cmd_t
*);
217 extern void set_func(cmd_t
*);
218 extern void verify_func(cmd_t
*);
219 extern void clear_func(cmd_t
*);
221 extern cmd_t
*alloc_cmd(void);
222 extern complex_property_ptr_t
alloc_complex(void);
223 extern list_property_ptr_t
alloc_list(void);
224 extern void free_cmd(cmd_t
*cmd
);
225 extern void free_complex(complex_property_ptr_t
complex);
226 extern void free_list(list_property_ptr_t list
);
227 extern void free_outer_list(list_property_ptr_t list
);
229 extern void usage(boolean_t verbose
, uint_t flags
);
232 extern char *res_types
[];
233 extern char *prop_types
[];
236 * NOTE: Only Lex and YACC should use the following functions.
238 extern void assert_no_unclaimed_tokens(void);
239 extern char *claim_token(char *);
245 #endif /* _ZONECFG_H */