author | jv227347 <Jordan.Vaughan@Sun.com> |
Mon, 09 Nov 2009 21:09:22 -0800 | |
changeset 11024 | 16869afd5fb1 |
parent 8662 | 18153249ee93 |
child 12578 | f9062c43c8bc |
permissions | -rw-r--r-- |
0 | 1 |
%{ |
2 |
/* |
|
3 |
* CDDL HEADER START |
|
4 |
* |
|
5 |
* The contents of this file are subject to the terms of the |
|
1645 | 6 |
* Common Development and Distribution License (the "License"). |
7 |
* You may not use this file except in compliance with the License. |
|
0 | 8 |
* |
9 |
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE |
|
10 |
* or http://www.opensolaris.org/os/licensing. |
|
11 |
* See the License for the specific language governing permissions |
|
12 |
* and limitations under the License. |
|
13 |
* |
|
14 |
* When distributing Covered Code, include this CDDL HEADER in each |
|
15 |
* file and include the License file at usr/src/OPENSOLARIS.LICENSE. |
|
16 |
* If applicable, add the following below this CDDL HEADER, with the |
|
17 |
* fields enclosed by brackets "[]" replaced with your own identifying |
|
18 |
* information: Portions Copyright [yyyy] [name of copyright owner] |
|
19 |
* |
|
20 |
* CDDL HEADER END |
|
222 | 21 |
*/ |
22 |
||
23 |
/* |
|
8662
18153249ee93
PSARC/2008/647 Configurable Hostids for Non-Global Zones
jv227347 <Jordan.Vaughan@Sun.com>
parents:
6215
diff
changeset
|
24 |
* Copyright 2009 Sun Microsystems, Inc. All rights reserved. |
0 | 25 |
* Use is subject to license terms. |
26 |
*/ |
|
27 |
||
28 |
#include <stdio.h> |
|
11024
16869afd5fb1
6893156 zonecfg(1M)'s grammar rejects property names and resource types where it expects property values
jv227347 <Jordan.Vaughan@Sun.com>
parents:
8662
diff
changeset
|
29 |
#include <strings.h> |
0 | 30 |
|
31 |
#include "zonecfg.h" |
|
32 |
||
33 |
static cmd_t *cmd = NULL; /* Command being processed */ |
|
34 |
static complex_property_ptr_t complex = NULL; |
|
35 |
static list_property_ptr_t new_list = NULL, tmp_list, last, |
|
36 |
list[MAX_EQ_PROP_PAIRS]; |
|
37 |
static property_value_t property[MAX_EQ_PROP_PAIRS]; |
|
38 |
||
6215
78f5eb4d8d4d
6527047 zonecfg shouldn't use two different boolean types
gjelinek
parents:
6076
diff
changeset
|
39 |
extern boolean_t newline_terminated; |
0 | 40 |
extern int num_prop_vals; /* # of property values */ |
41 |
||
42 |
/* yacc externals */ |
|
43 |
extern int yydebug; |
|
44 |
extern void yyerror(char *s); |
|
45 |
||
11024
16869afd5fb1
6893156 zonecfg(1M)'s grammar rejects property names and resource types where it expects property values
jv227347 <Jordan.Vaughan@Sun.com>
parents:
8662
diff
changeset
|
46 |
/* |
16869afd5fb1
6893156 zonecfg(1M)'s grammar rejects property names and resource types where it expects property values
jv227347 <Jordan.Vaughan@Sun.com>
parents:
8662
diff
changeset
|
47 |
* This function is used by the simple_prop_val reduction rules to set up |
16869afd5fb1
6893156 zonecfg(1M)'s grammar rejects property names and resource types where it expects property values
jv227347 <Jordan.Vaughan@Sun.com>
parents:
8662
diff
changeset
|
48 |
* a list_property_ptr_t and adjust the above global variables appropriately. |
16869afd5fb1
6893156 zonecfg(1M)'s grammar rejects property names and resource types where it expects property values
jv227347 <Jordan.Vaughan@Sun.com>
parents:
8662
diff
changeset
|
49 |
* Note that this function duplicates the specified string and makes |
16869afd5fb1
6893156 zonecfg(1M)'s grammar rejects property names and resource types where it expects property values
jv227347 <Jordan.Vaughan@Sun.com>
parents:
8662
diff
changeset
|
50 |
* the new list's lp_simple field point to the duplicate. This function does |
16869afd5fb1
6893156 zonecfg(1M)'s grammar rejects property names and resource types where it expects property values
jv227347 <Jordan.Vaughan@Sun.com>
parents:
8662
diff
changeset
|
51 |
* not free the original string. |
16869afd5fb1
6893156 zonecfg(1M)'s grammar rejects property names and resource types where it expects property values
jv227347 <Jordan.Vaughan@Sun.com>
parents:
8662
diff
changeset
|
52 |
* |
16869afd5fb1
6893156 zonecfg(1M)'s grammar rejects property names and resource types where it expects property values
jv227347 <Jordan.Vaughan@Sun.com>
parents:
8662
diff
changeset
|
53 |
* This function returns a pointer to the duplicated string or NULL if an error |
16869afd5fb1
6893156 zonecfg(1M)'s grammar rejects property names and resource types where it expects property values
jv227347 <Jordan.Vaughan@Sun.com>
parents:
8662
diff
changeset
|
54 |
* occurred. The simple_prop_val reduction rules that invoke this function |
16869afd5fb1
6893156 zonecfg(1M)'s grammar rejects property names and resource types where it expects property values
jv227347 <Jordan.Vaughan@Sun.com>
parents:
8662
diff
changeset
|
55 |
* should set $$ to the returned pointer. |
16869afd5fb1
6893156 zonecfg(1M)'s grammar rejects property names and resource types where it expects property values
jv227347 <Jordan.Vaughan@Sun.com>
parents:
8662
diff
changeset
|
56 |
*/ |
16869afd5fb1
6893156 zonecfg(1M)'s grammar rejects property names and resource types where it expects property values
jv227347 <Jordan.Vaughan@Sun.com>
parents:
8662
diff
changeset
|
57 |
static char * |
16869afd5fb1
6893156 zonecfg(1M)'s grammar rejects property names and resource types where it expects property values
jv227347 <Jordan.Vaughan@Sun.com>
parents:
8662
diff
changeset
|
58 |
simple_prop_val_func(const char *str) |
16869afd5fb1
6893156 zonecfg(1M)'s grammar rejects property names and resource types where it expects property values
jv227347 <Jordan.Vaughan@Sun.com>
parents:
8662
diff
changeset
|
59 |
{ |
16869afd5fb1
6893156 zonecfg(1M)'s grammar rejects property names and resource types where it expects property values
jv227347 <Jordan.Vaughan@Sun.com>
parents:
8662
diff
changeset
|
60 |
char *retstr; |
16869afd5fb1
6893156 zonecfg(1M)'s grammar rejects property names and resource types where it expects property values
jv227347 <Jordan.Vaughan@Sun.com>
parents:
8662
diff
changeset
|
61 |
|
16869afd5fb1
6893156 zonecfg(1M)'s grammar rejects property names and resource types where it expects property values
jv227347 <Jordan.Vaughan@Sun.com>
parents:
8662
diff
changeset
|
62 |
if ((new_list = alloc_list()) == NULL) |
16869afd5fb1
6893156 zonecfg(1M)'s grammar rejects property names and resource types where it expects property values
jv227347 <Jordan.Vaughan@Sun.com>
parents:
8662
diff
changeset
|
63 |
return (NULL); |
16869afd5fb1
6893156 zonecfg(1M)'s grammar rejects property names and resource types where it expects property values
jv227347 <Jordan.Vaughan@Sun.com>
parents:
8662
diff
changeset
|
64 |
if ((retstr = strdup(str)) == NULL) { |
16869afd5fb1
6893156 zonecfg(1M)'s grammar rejects property names and resource types where it expects property values
jv227347 <Jordan.Vaughan@Sun.com>
parents:
8662
diff
changeset
|
65 |
free_list(new_list); |
16869afd5fb1
6893156 zonecfg(1M)'s grammar rejects property names and resource types where it expects property values
jv227347 <Jordan.Vaughan@Sun.com>
parents:
8662
diff
changeset
|
66 |
return (NULL); |
16869afd5fb1
6893156 zonecfg(1M)'s grammar rejects property names and resource types where it expects property values
jv227347 <Jordan.Vaughan@Sun.com>
parents:
8662
diff
changeset
|
67 |
} |
16869afd5fb1
6893156 zonecfg(1M)'s grammar rejects property names and resource types where it expects property values
jv227347 <Jordan.Vaughan@Sun.com>
parents:
8662
diff
changeset
|
68 |
new_list->lp_simple = retstr; |
16869afd5fb1
6893156 zonecfg(1M)'s grammar rejects property names and resource types where it expects property values
jv227347 <Jordan.Vaughan@Sun.com>
parents:
8662
diff
changeset
|
69 |
new_list->lp_complex = NULL; |
16869afd5fb1
6893156 zonecfg(1M)'s grammar rejects property names and resource types where it expects property values
jv227347 <Jordan.Vaughan@Sun.com>
parents:
8662
diff
changeset
|
70 |
new_list->lp_next = NULL; |
16869afd5fb1
6893156 zonecfg(1M)'s grammar rejects property names and resource types where it expects property values
jv227347 <Jordan.Vaughan@Sun.com>
parents:
8662
diff
changeset
|
71 |
if (list[num_prop_vals] == NULL) { |
16869afd5fb1
6893156 zonecfg(1M)'s grammar rejects property names and resource types where it expects property values
jv227347 <Jordan.Vaughan@Sun.com>
parents:
8662
diff
changeset
|
72 |
list[num_prop_vals] = new_list; |
16869afd5fb1
6893156 zonecfg(1M)'s grammar rejects property names and resource types where it expects property values
jv227347 <Jordan.Vaughan@Sun.com>
parents:
8662
diff
changeset
|
73 |
} else { |
16869afd5fb1
6893156 zonecfg(1M)'s grammar rejects property names and resource types where it expects property values
jv227347 <Jordan.Vaughan@Sun.com>
parents:
8662
diff
changeset
|
74 |
for (tmp_list = list[num_prop_vals]; tmp_list != NULL; |
16869afd5fb1
6893156 zonecfg(1M)'s grammar rejects property names and resource types where it expects property values
jv227347 <Jordan.Vaughan@Sun.com>
parents:
8662
diff
changeset
|
75 |
tmp_list = tmp_list->lp_next) |
16869afd5fb1
6893156 zonecfg(1M)'s grammar rejects property names and resource types where it expects property values
jv227347 <Jordan.Vaughan@Sun.com>
parents:
8662
diff
changeset
|
76 |
last = tmp_list; |
16869afd5fb1
6893156 zonecfg(1M)'s grammar rejects property names and resource types where it expects property values
jv227347 <Jordan.Vaughan@Sun.com>
parents:
8662
diff
changeset
|
77 |
last->lp_next = new_list; |
16869afd5fb1
6893156 zonecfg(1M)'s grammar rejects property names and resource types where it expects property values
jv227347 <Jordan.Vaughan@Sun.com>
parents:
8662
diff
changeset
|
78 |
} |
16869afd5fb1
6893156 zonecfg(1M)'s grammar rejects property names and resource types where it expects property values
jv227347 <Jordan.Vaughan@Sun.com>
parents:
8662
diff
changeset
|
79 |
return (retstr); |
16869afd5fb1
6893156 zonecfg(1M)'s grammar rejects property names and resource types where it expects property values
jv227347 <Jordan.Vaughan@Sun.com>
parents:
8662
diff
changeset
|
80 |
} |
16869afd5fb1
6893156 zonecfg(1M)'s grammar rejects property names and resource types where it expects property values
jv227347 <Jordan.Vaughan@Sun.com>
parents:
8662
diff
changeset
|
81 |
|
16869afd5fb1
6893156 zonecfg(1M)'s grammar rejects property names and resource types where it expects property values
jv227347 <Jordan.Vaughan@Sun.com>
parents:
8662
diff
changeset
|
82 |
/* |
16869afd5fb1
6893156 zonecfg(1M)'s grammar rejects property names and resource types where it expects property values
jv227347 <Jordan.Vaughan@Sun.com>
parents:
8662
diff
changeset
|
83 |
* This function is used by the complex_piece reduction rules to set up a |
16869afd5fb1
6893156 zonecfg(1M)'s grammar rejects property names and resource types where it expects property values
jv227347 <Jordan.Vaughan@Sun.com>
parents:
8662
diff
changeset
|
84 |
* complex_property_prt_t and adjust the above global variables appropriately. |
16869afd5fb1
6893156 zonecfg(1M)'s grammar rejects property names and resource types where it expects property values
jv227347 <Jordan.Vaughan@Sun.com>
parents:
8662
diff
changeset
|
85 |
* Note that this function duplicates the specified string and makes the new |
16869afd5fb1
6893156 zonecfg(1M)'s grammar rejects property names and resource types where it expects property values
jv227347 <Jordan.Vaughan@Sun.com>
parents:
8662
diff
changeset
|
86 |
* complex_property_ptr_t's cp_value field point to the duplicate. It also sets |
16869afd5fb1
6893156 zonecfg(1M)'s grammar rejects property names and resource types where it expects property values
jv227347 <Jordan.Vaughan@Sun.com>
parents:
8662
diff
changeset
|
87 |
* the complex_property_ptr_t's cp_type field to cp_type and its cp_next field |
16869afd5fb1
6893156 zonecfg(1M)'s grammar rejects property names and resource types where it expects property values
jv227347 <Jordan.Vaughan@Sun.com>
parents:
8662
diff
changeset
|
88 |
* to cp_next. This function does not free the original string. |
16869afd5fb1
6893156 zonecfg(1M)'s grammar rejects property names and resource types where it expects property values
jv227347 <Jordan.Vaughan@Sun.com>
parents:
8662
diff
changeset
|
89 |
* |
16869afd5fb1
6893156 zonecfg(1M)'s grammar rejects property names and resource types where it expects property values
jv227347 <Jordan.Vaughan@Sun.com>
parents:
8662
diff
changeset
|
90 |
* This function returns a pointer to the complex_property_t created for the |
16869afd5fb1
6893156 zonecfg(1M)'s grammar rejects property names and resource types where it expects property values
jv227347 <Jordan.Vaughan@Sun.com>
parents:
8662
diff
changeset
|
91 |
* complex_piece or NULL if an error occurred. The complex_piece reduction |
16869afd5fb1
6893156 zonecfg(1M)'s grammar rejects property names and resource types where it expects property values
jv227347 <Jordan.Vaughan@Sun.com>
parents:
8662
diff
changeset
|
92 |
* rules that invoke this function should set $$ to the returned pointer. |
16869afd5fb1
6893156 zonecfg(1M)'s grammar rejects property names and resource types where it expects property values
jv227347 <Jordan.Vaughan@Sun.com>
parents:
8662
diff
changeset
|
93 |
*/ |
16869afd5fb1
6893156 zonecfg(1M)'s grammar rejects property names and resource types where it expects property values
jv227347 <Jordan.Vaughan@Sun.com>
parents:
8662
diff
changeset
|
94 |
static complex_property_ptr_t |
16869afd5fb1
6893156 zonecfg(1M)'s grammar rejects property names and resource types where it expects property values
jv227347 <Jordan.Vaughan@Sun.com>
parents:
8662
diff
changeset
|
95 |
complex_piece_func(int cp_type, const char *str, complex_property_ptr_t cp_next) |
16869afd5fb1
6893156 zonecfg(1M)'s grammar rejects property names and resource types where it expects property values
jv227347 <Jordan.Vaughan@Sun.com>
parents:
8662
diff
changeset
|
96 |
{ |
16869afd5fb1
6893156 zonecfg(1M)'s grammar rejects property names and resource types where it expects property values
jv227347 <Jordan.Vaughan@Sun.com>
parents:
8662
diff
changeset
|
97 |
complex_property_ptr_t retval; |
16869afd5fb1
6893156 zonecfg(1M)'s grammar rejects property names and resource types where it expects property values
jv227347 <Jordan.Vaughan@Sun.com>
parents:
8662
diff
changeset
|
98 |
|
16869afd5fb1
6893156 zonecfg(1M)'s grammar rejects property names and resource types where it expects property values
jv227347 <Jordan.Vaughan@Sun.com>
parents:
8662
diff
changeset
|
99 |
if ((retval = alloc_complex()) == NULL) |
16869afd5fb1
6893156 zonecfg(1M)'s grammar rejects property names and resource types where it expects property values
jv227347 <Jordan.Vaughan@Sun.com>
parents:
8662
diff
changeset
|
100 |
return (NULL); |
16869afd5fb1
6893156 zonecfg(1M)'s grammar rejects property names and resource types where it expects property values
jv227347 <Jordan.Vaughan@Sun.com>
parents:
8662
diff
changeset
|
101 |
if ((retval->cp_value = strdup(str)) == NULL) { |
16869afd5fb1
6893156 zonecfg(1M)'s grammar rejects property names and resource types where it expects property values
jv227347 <Jordan.Vaughan@Sun.com>
parents:
8662
diff
changeset
|
102 |
free_complex(retval); |
16869afd5fb1
6893156 zonecfg(1M)'s grammar rejects property names and resource types where it expects property values
jv227347 <Jordan.Vaughan@Sun.com>
parents:
8662
diff
changeset
|
103 |
return (NULL); |
16869afd5fb1
6893156 zonecfg(1M)'s grammar rejects property names and resource types where it expects property values
jv227347 <Jordan.Vaughan@Sun.com>
parents:
8662
diff
changeset
|
104 |
} |
16869afd5fb1
6893156 zonecfg(1M)'s grammar rejects property names and resource types where it expects property values
jv227347 <Jordan.Vaughan@Sun.com>
parents:
8662
diff
changeset
|
105 |
retval->cp_type = cp_type; |
16869afd5fb1
6893156 zonecfg(1M)'s grammar rejects property names and resource types where it expects property values
jv227347 <Jordan.Vaughan@Sun.com>
parents:
8662
diff
changeset
|
106 |
retval->cp_next = cp_next; |
16869afd5fb1
6893156 zonecfg(1M)'s grammar rejects property names and resource types where it expects property values
jv227347 <Jordan.Vaughan@Sun.com>
parents:
8662
diff
changeset
|
107 |
complex = retval; |
16869afd5fb1
6893156 zonecfg(1M)'s grammar rejects property names and resource types where it expects property values
jv227347 <Jordan.Vaughan@Sun.com>
parents:
8662
diff
changeset
|
108 |
return (retval); |
16869afd5fb1
6893156 zonecfg(1M)'s grammar rejects property names and resource types where it expects property values
jv227347 <Jordan.Vaughan@Sun.com>
parents:
8662
diff
changeset
|
109 |
} |
16869afd5fb1
6893156 zonecfg(1M)'s grammar rejects property names and resource types where it expects property values
jv227347 <Jordan.Vaughan@Sun.com>
parents:
8662
diff
changeset
|
110 |
|
16869afd5fb1
6893156 zonecfg(1M)'s grammar rejects property names and resource types where it expects property values
jv227347 <Jordan.Vaughan@Sun.com>
parents:
8662
diff
changeset
|
111 |
|
0 | 112 |
%} |
113 |
||
114 |
%union { |
|
115 |
int ival; |
|
116 |
char *strval; |
|
117 |
cmd_t *cmd; |
|
118 |
complex_property_ptr_t complex; |
|
119 |
list_property_ptr_t list; |
|
120 |
} |
|
121 |
||
122 |
%start commands |
|
123 |
||
124 |
%token HELP CREATE EXPORT ADD DELETE REMOVE SELECT SET INFO CANCEL END VERIFY |
|
565 | 125 |
%token COMMIT REVERT EXIT SEMICOLON TOKEN ZONENAME ZONEPATH AUTOBOOT POOL NET |
126 |
%token FS IPD ATTR DEVICE RCTL SPECIAL RAW DIR OPTIONS TYPE ADDRESS PHYSICAL |
|
8662
18153249ee93
PSARC/2008/647 Configurable Hostids for Non-Global Zones
jv227347 <Jordan.Vaughan@Sun.com>
parents:
6215
diff
changeset
|
127 |
%token IPTYPE HOSTID |
565 | 128 |
%token NAME MATCH PRIV LIMIT ACTION VALUE EQUAL OPEN_SQ_BRACKET CLOSE_SQ_BRACKET |
3792 | 129 |
%token OPEN_PAREN CLOSE_PAREN COMMA DATASET LIMITPRIV BOOTARGS BRAND PSET PCAP |
3247 | 130 |
%token MCAP NCPUS IMPORTANCE SHARES MAXLWPS MAXSHMMEM MAXSHMIDS MAXMSGIDS |
6076
39e1b255225b
6583565 need a mechanism to configure a per zone default route in shared IP stack for TX
gfaden
parents:
3792
diff
changeset
|
131 |
%token MAXSEMIDS LOCKED SWAP SCHED CLEAR DEFROUTER |
0 | 132 |
|
133 |
%type <strval> TOKEN EQUAL OPEN_SQ_BRACKET CLOSE_SQ_BRACKET |
|
134 |
property_value OPEN_PAREN CLOSE_PAREN COMMA simple_prop_val |
|
135 |
%type <complex> complex_piece complex_prop_val |
|
3792 | 136 |
%type <ival> resource_type NET FS IPD DEVICE RCTL ATTR DATASET PSET PCAP MCAP |
0 | 137 |
%type <ival> property_name SPECIAL RAW DIR OPTIONS TYPE ADDRESS PHYSICAL NAME |
2267 | 138 |
MATCH ZONENAME ZONEPATH AUTOBOOT POOL LIMITPRIV BOOTARGS VALUE PRIV LIMIT |
8662
18153249ee93
PSARC/2008/647 Configurable Hostids for Non-Global Zones
jv227347 <Jordan.Vaughan@Sun.com>
parents:
6215
diff
changeset
|
139 |
ACTION BRAND SCHED IPTYPE DEFROUTER HOSTID |
0 | 140 |
%type <cmd> command |
141 |
%type <cmd> add_command ADD |
|
142 |
%type <cmd> cancel_command CANCEL |
|
143 |
%type <cmd> commit_command COMMIT |
|
144 |
%type <cmd> create_command CREATE |
|
145 |
%type <cmd> delete_command DELETE |
|
146 |
%type <cmd> end_command END |
|
147 |
%type <cmd> exit_command EXIT |
|
148 |
%type <cmd> export_command EXPORT |
|
149 |
%type <cmd> help_command HELP |
|
150 |
%type <cmd> info_command INFO |
|
151 |
%type <cmd> remove_command REMOVE |
|
152 |
%type <cmd> revert_command REVERT |
|
153 |
%type <cmd> select_command SELECT |
|
154 |
%type <cmd> set_command SET |
|
3247 | 155 |
%type <cmd> clear_command CLEAR |
0 | 156 |
%type <cmd> verify_command VERIFY |
157 |
%type <cmd> terminator |
|
158 |
||
159 |
%% |
|
160 |
||
161 |
commands: command terminator |
|
162 |
{ |
|
163 |
if ($1 != NULL) { |
|
164 |
if ($1->cmd_handler != NULL) |
|
165 |
$1->cmd_handler($1); |
|
166 |
free_cmd($1); |
|
167 |
bzero(list, sizeof (list_property_t)); |
|
168 |
num_prop_vals = 0; |
|
169 |
} |
|
170 |
return (0); |
|
171 |
} |
|
172 |
| command error terminator |
|
173 |
{ |
|
174 |
if ($1 != NULL) { |
|
175 |
free_cmd($1); |
|
176 |
bzero(list, sizeof (list_property_t)); |
|
177 |
num_prop_vals = 0; |
|
178 |
} |
|
179 |
if (YYRECOVERING()) |
|
222 | 180 |
YYABORT; |
0 | 181 |
yyclearin; |
182 |
yyerrok; |
|
183 |
} |
|
184 |
| error terminator |
|
185 |
{ |
|
186 |
if (YYRECOVERING()) |
|
222 | 187 |
YYABORT; |
0 | 188 |
yyclearin; |
189 |
yyerrok; |
|
190 |
} |
|
191 |
| terminator |
|
192 |
{ |
|
193 |
return (0); |
|
194 |
} |
|
195 |
||
196 |
command: add_command |
|
197 |
| cancel_command |
|
3247 | 198 |
| clear_command |
0 | 199 |
| create_command |
200 |
| commit_command |
|
201 |
| delete_command |
|
202 |
| end_command |
|
203 |
| exit_command |
|
204 |
| export_command |
|
205 |
| help_command |
|
206 |
| info_command |
|
207 |
| remove_command |
|
208 |
| revert_command |
|
209 |
| select_command |
|
210 |
| set_command |
|
211 |
| verify_command |
|
212 |
||
6215
78f5eb4d8d4d
6527047 zonecfg shouldn't use two different boolean types
gjelinek
parents:
6076
diff
changeset
|
213 |
terminator: '\n' { newline_terminated = B_TRUE; } |
78f5eb4d8d4d
6527047 zonecfg shouldn't use two different boolean types
gjelinek
parents:
6076
diff
changeset
|
214 |
| ';' { newline_terminated = B_FALSE; } |
0 | 215 |
|
216 |
add_command: ADD |
|
217 |
{ |
|
218 |
short_usage(CMD_ADD); |
|
219 |
(void) fputs("\n", stderr); |
|
6215
78f5eb4d8d4d
6527047 zonecfg shouldn't use two different boolean types
gjelinek
parents:
6076
diff
changeset
|
220 |
usage(B_FALSE, HELP_RES_PROPS); |
0 | 221 |
YYERROR; |
222 |
} |
|
223 |
| ADD TOKEN |
|
224 |
{ |
|
225 |
if (($$ = alloc_cmd()) == NULL) |
|
226 |
YYERROR; |
|
227 |
cmd = $$; |
|
228 |
$$->cmd_handler = &add_func; |
|
229 |
$$->cmd_argc = 1; |
|
230 |
$$->cmd_argv[0] = $2; |
|
231 |
$$->cmd_argv[1] = NULL; |
|
232 |
} |
|
233 |
| ADD resource_type |
|
234 |
{ |
|
235 |
if (($$ = alloc_cmd()) == NULL) |
|
236 |
YYERROR; |
|
237 |
cmd = $$; |
|
238 |
$$->cmd_handler = &add_func; |
|
239 |
$$->cmd_argc = 0; |
|
240 |
$$->cmd_res_type = $2; |
|
241 |
$$->cmd_prop_nv_pairs = 0; |
|
242 |
} |
|
243 |
| ADD property_name property_value |
|
244 |
{ |
|
245 |
if (($$ = alloc_cmd()) == NULL) |
|
246 |
YYERROR; |
|
247 |
cmd = $$; |
|
248 |
$$->cmd_handler = &add_func; |
|
249 |
$$->cmd_argc = 0; |
|
250 |
$$->cmd_prop_nv_pairs = 1; |
|
251 |
$$->cmd_prop_name[0] = $2; |
|
252 |
$$->cmd_property_ptr[0] = &property[0]; |
|
253 |
} |
|
254 |
||
255 |
cancel_command: CANCEL |
|
256 |
{ |
|
257 |
if (($$ = alloc_cmd()) == NULL) |
|
258 |
YYERROR; |
|
259 |
cmd = $$; |
|
260 |
$$->cmd_handler = &cancel_func; |
|
261 |
$$->cmd_argc = 0; |
|
262 |
$$->cmd_argv[0] = NULL; |
|
263 |
} |
|
264 |
| CANCEL TOKEN |
|
265 |
{ |
|
266 |
if (($$ = alloc_cmd()) == NULL) |
|
267 |
YYERROR; |
|
268 |
cmd = $$; |
|
269 |
$$->cmd_handler = &cancel_func; |
|
270 |
$$->cmd_argc = 1; |
|
271 |
$$->cmd_argv[0] = $2; |
|
272 |
$$->cmd_argv[1] = NULL; |
|
273 |
} |
|
274 |
||
275 |
create_command: CREATE |
|
276 |
{ |
|
277 |
if (($$ = alloc_cmd()) == NULL) |
|
278 |
YYERROR; |
|
279 |
cmd = $$; |
|
280 |
$$->cmd_handler = &create_func; |
|
281 |
$$->cmd_argc = 0; |
|
282 |
$$->cmd_argv[0] = NULL; |
|
283 |
} |
|
284 |
| CREATE TOKEN |
|
285 |
{ |
|
286 |
if (($$ = alloc_cmd()) == NULL) |
|
287 |
YYERROR; |
|
288 |
cmd = $$; |
|
289 |
$$->cmd_handler = &create_func; |
|
290 |
$$->cmd_argc = 1; |
|
291 |
$$->cmd_argv[0] = $2; |
|
292 |
$$->cmd_argv[1] = NULL; |
|
293 |
} |
|
294 |
| CREATE TOKEN TOKEN |
|
295 |
{ |
|
296 |
if (($$ = alloc_cmd()) == NULL) |
|
297 |
YYERROR; |
|
298 |
cmd = $$; |
|
299 |
$$->cmd_handler = &create_func; |
|
300 |
$$->cmd_argc = 2; |
|
301 |
$$->cmd_argv[0] = $2; |
|
302 |
$$->cmd_argv[1] = $3; |
|
303 |
$$->cmd_argv[2] = NULL; |
|
304 |
} |
|
305 |
| CREATE TOKEN TOKEN TOKEN |
|
306 |
{ |
|
307 |
if (($$ = alloc_cmd()) == NULL) |
|
308 |
YYERROR; |
|
309 |
cmd = $$; |
|
310 |
$$->cmd_handler = &create_func; |
|
311 |
$$->cmd_argc = 3; |
|
312 |
$$->cmd_argv[0] = $2; |
|
313 |
$$->cmd_argv[1] = $3; |
|
314 |
$$->cmd_argv[2] = $4; |
|
315 |
$$->cmd_argv[3] = NULL; |
|
316 |
} |
|
317 |
||
318 |
commit_command: COMMIT |
|
319 |
{ |
|
320 |
if (($$ = alloc_cmd()) == NULL) |
|
321 |
YYERROR; |
|
322 |
cmd = $$; |
|
323 |
$$->cmd_handler = &commit_func; |
|
324 |
$$->cmd_argc = 0; |
|
325 |
$$->cmd_argv[0] = NULL; |
|
326 |
} |
|
327 |
| COMMIT TOKEN |
|
328 |
{ |
|
329 |
if (($$ = alloc_cmd()) == NULL) |
|
330 |
YYERROR; |
|
331 |
cmd = $$; |
|
332 |
$$->cmd_handler = &commit_func; |
|
333 |
$$->cmd_argc = 1; |
|
334 |
$$->cmd_argv[0] = $2; |
|
335 |
$$->cmd_argv[1] = NULL; |
|
336 |
} |
|
337 |
||
338 |
delete_command: DELETE |
|
339 |
{ |
|
340 |
if (($$ = alloc_cmd()) == NULL) |
|
341 |
YYERROR; |
|
342 |
cmd = $$; |
|
343 |
$$->cmd_handler = &delete_func; |
|
344 |
$$->cmd_argc = 0; |
|
345 |
$$->cmd_argv[0] = NULL; |
|
346 |
} |
|
347 |
| DELETE TOKEN |
|
348 |
{ |
|
349 |
if (($$ = alloc_cmd()) == NULL) |
|
350 |
YYERROR; |
|
351 |
cmd = $$; |
|
352 |
$$->cmd_handler = &delete_func; |
|
353 |
$$->cmd_argc = 1; |
|
354 |
$$->cmd_argv[0] = $2; |
|
355 |
$$->cmd_argv[1] = NULL; |
|
356 |
} |
|
357 |
||
358 |
end_command: END |
|
359 |
{ |
|
360 |
if (($$ = alloc_cmd()) == NULL) |
|
361 |
YYERROR; |
|
362 |
cmd = $$; |
|
363 |
$$->cmd_handler = &end_func; |
|
364 |
$$->cmd_argc = 0; |
|
365 |
$$->cmd_argv[0] = NULL; |
|
366 |
} |
|
367 |
| END TOKEN |
|
368 |
{ |
|
369 |
if (($$ = alloc_cmd()) == NULL) |
|
370 |
YYERROR; |
|
371 |
cmd = $$; |
|
372 |
$$->cmd_handler = &end_func; |
|
373 |
$$->cmd_argc = 1; |
|
374 |
$$->cmd_argv[0] = $2; |
|
375 |
$$->cmd_argv[1] = NULL; |
|
376 |
} |
|
377 |
||
378 |
exit_command: EXIT |
|
379 |
{ |
|
380 |
if (($$ = alloc_cmd()) == NULL) |
|
381 |
YYERROR; |
|
382 |
cmd = $$; |
|
383 |
$$->cmd_handler = &exit_func; |
|
384 |
$$->cmd_argc = 0; |
|
385 |
$$->cmd_argv[0] = NULL; |
|
386 |
} |
|
387 |
| EXIT TOKEN |
|
388 |
{ |
|
389 |
if (($$ = alloc_cmd()) == NULL) |
|
390 |
YYERROR; |
|
391 |
cmd = $$; |
|
392 |
$$->cmd_handler = &exit_func; |
|
393 |
$$->cmd_argc = 1; |
|
394 |
$$->cmd_argv[0] = $2; |
|
395 |
$$->cmd_argv[1] = NULL; |
|
396 |
} |
|
397 |
||
398 |
export_command: EXPORT |
|
399 |
{ |
|
400 |
if (($$ = alloc_cmd()) == NULL) |
|
401 |
YYERROR; |
|
402 |
cmd = $$; |
|
403 |
$$->cmd_handler = &export_func; |
|
404 |
$$->cmd_argc = 0; |
|
405 |
$$->cmd_argv[0] = NULL; |
|
406 |
} |
|
407 |
| EXPORT TOKEN |
|
408 |
{ |
|
409 |
if (($$ = alloc_cmd()) == NULL) |
|
410 |
YYERROR; |
|
411 |
cmd = $$; |
|
412 |
$$->cmd_handler = &export_func; |
|
413 |
$$->cmd_argc = 1; |
|
414 |
$$->cmd_argv[0] = $2; |
|
415 |
$$->cmd_argv[1] = NULL; |
|
416 |
} |
|
417 |
| EXPORT TOKEN TOKEN |
|
418 |
{ |
|
419 |
if (($$ = alloc_cmd()) == NULL) |
|
420 |
YYERROR; |
|
421 |
cmd = $$; |
|
422 |
$$->cmd_handler = &export_func; |
|
423 |
$$->cmd_argc = 2; |
|
424 |
$$->cmd_argv[0] = $2; |
|
425 |
$$->cmd_argv[1] = $3; |
|
426 |
$$->cmd_argv[2] = NULL; |
|
427 |
} |
|
428 |
||
429 |
help_command: HELP |
|
430 |
{ |
|
431 |
if (($$ = alloc_cmd()) == NULL) |
|
432 |
YYERROR; |
|
433 |
cmd = $$; |
|
434 |
$$->cmd_handler = &help_func; |
|
435 |
$$->cmd_argc = 0; |
|
436 |
$$->cmd_argv[0] = NULL; |
|
437 |
} |
|
438 |
| HELP TOKEN |
|
439 |
{ |
|
440 |
if (($$ = alloc_cmd()) == NULL) |
|
441 |
YYERROR; |
|
442 |
cmd = $$; |
|
443 |
$$->cmd_handler = &help_func; |
|
444 |
$$->cmd_argc = 1; |
|
445 |
$$->cmd_argv[0] = $2; |
|
446 |
$$->cmd_argv[1] = NULL; |
|
447 |
} |
|
448 |
||
449 |
info_command: INFO |
|
450 |
{ |
|
451 |
if (($$ = alloc_cmd()) == NULL) |
|
452 |
YYERROR; |
|
453 |
cmd = $$; |
|
454 |
$$->cmd_handler = &info_func; |
|
455 |
$$->cmd_res_type = RT_UNKNOWN; |
|
456 |
$$->cmd_prop_nv_pairs = 0; |
|
457 |
} |
|
458 |
| INFO TOKEN |
|
459 |
{ |
|
460 |
short_usage(CMD_INFO); |
|
461 |
(void) fputs("\n", stderr); |
|
6215
78f5eb4d8d4d
6527047 zonecfg shouldn't use two different boolean types
gjelinek
parents:
6076
diff
changeset
|
462 |
usage(B_FALSE, HELP_RES_PROPS); |
0 | 463 |
free($2); |
464 |
YYERROR; |
|
465 |
} |
|
466 |
| INFO resource_type |
|
467 |
{ |
|
468 |
if (($$ = alloc_cmd()) == NULL) |
|
469 |
YYERROR; |
|
470 |
cmd = $$; |
|
471 |
$$->cmd_handler = &info_func; |
|
472 |
$$->cmd_res_type = $2; |
|
473 |
$$->cmd_prop_nv_pairs = 0; |
|
474 |
} |
|
565 | 475 |
| INFO ZONENAME |
476 |
{ |
|
477 |
if (($$ = alloc_cmd()) == NULL) |
|
478 |
YYERROR; |
|
479 |
cmd = $$; |
|
480 |
$$->cmd_handler = &info_func; |
|
481 |
$$->cmd_res_type = RT_ZONENAME; |
|
482 |
$$->cmd_prop_nv_pairs = 0; |
|
483 |
} |
|
0 | 484 |
| INFO ZONEPATH |
485 |
{ |
|
486 |
if (($$ = alloc_cmd()) == NULL) |
|
487 |
YYERROR; |
|
488 |
cmd = $$; |
|
489 |
$$->cmd_handler = &info_func; |
|
490 |
$$->cmd_res_type = RT_ZONEPATH; |
|
491 |
$$->cmd_prop_nv_pairs = 0; |
|
492 |
} |
|
2712
f74a135872bc
PSARC/2005/471 BrandZ: Support for non-native zones
nn35248
parents:
2303
diff
changeset
|
493 |
| INFO BRAND |
f74a135872bc
PSARC/2005/471 BrandZ: Support for non-native zones
nn35248
parents:
2303
diff
changeset
|
494 |
{ |
f74a135872bc
PSARC/2005/471 BrandZ: Support for non-native zones
nn35248
parents:
2303
diff
changeset
|
495 |
if (($$ = alloc_cmd()) == NULL) |
f74a135872bc
PSARC/2005/471 BrandZ: Support for non-native zones
nn35248
parents:
2303
diff
changeset
|
496 |
YYERROR; |
f74a135872bc
PSARC/2005/471 BrandZ: Support for non-native zones
nn35248
parents:
2303
diff
changeset
|
497 |
cmd = $$; |
f74a135872bc
PSARC/2005/471 BrandZ: Support for non-native zones
nn35248
parents:
2303
diff
changeset
|
498 |
$$->cmd_handler = &info_func; |
f74a135872bc
PSARC/2005/471 BrandZ: Support for non-native zones
nn35248
parents:
2303
diff
changeset
|
499 |
$$->cmd_res_type = RT_BRAND; |
f74a135872bc
PSARC/2005/471 BrandZ: Support for non-native zones
nn35248
parents:
2303
diff
changeset
|
500 |
$$->cmd_prop_nv_pairs = 0; |
f74a135872bc
PSARC/2005/471 BrandZ: Support for non-native zones
nn35248
parents:
2303
diff
changeset
|
501 |
} |
0 | 502 |
| INFO AUTOBOOT |
503 |
{ |
|
504 |
if (($$ = alloc_cmd()) == NULL) |
|
505 |
YYERROR; |
|
506 |
cmd = $$; |
|
507 |
$$->cmd_handler = &info_func; |
|
508 |
$$->cmd_res_type = RT_AUTOBOOT; |
|
509 |
$$->cmd_prop_nv_pairs = 0; |
|
510 |
} |
|
3448 | 511 |
| INFO IPTYPE |
512 |
{ |
|
513 |
if (($$ = alloc_cmd()) == NULL) |
|
514 |
YYERROR; |
|
515 |
cmd = $$; |
|
516 |
$$->cmd_handler = &info_func; |
|
517 |
$$->cmd_res_type = RT_IPTYPE; |
|
518 |
$$->cmd_prop_nv_pairs = 0; |
|
519 |
} |
|
0 | 520 |
| INFO POOL |
521 |
{ |
|
522 |
if (($$ = alloc_cmd()) == NULL) |
|
523 |
YYERROR; |
|
524 |
cmd = $$; |
|
525 |
$$->cmd_handler = &info_func; |
|
526 |
$$->cmd_res_type = RT_POOL; |
|
527 |
$$->cmd_prop_nv_pairs = 0; |
|
528 |
} |
|
1645 | 529 |
| INFO LIMITPRIV |
530 |
{ |
|
531 |
if (($$ = alloc_cmd()) == NULL) |
|
532 |
YYERROR; |
|
533 |
cmd = $$; |
|
534 |
$$->cmd_handler = &info_func; |
|
535 |
$$->cmd_res_type = RT_LIMITPRIV; |
|
536 |
$$->cmd_prop_nv_pairs = 0; |
|
537 |
} |
|
2267 | 538 |
| INFO BOOTARGS |
539 |
{ |
|
540 |
if (($$ = alloc_cmd()) == NULL) |
|
541 |
YYERROR; |
|
542 |
cmd = $$; |
|
543 |
$$->cmd_handler = &info_func; |
|
544 |
$$->cmd_res_type = RT_BOOTARGS; |
|
545 |
$$->cmd_prop_nv_pairs = 0; |
|
546 |
} |
|
3247 | 547 |
| INFO SCHED |
548 |
{ |
|
549 |
if (($$ = alloc_cmd()) == NULL) |
|
550 |
YYERROR; |
|
551 |
cmd = $$; |
|
552 |
$$->cmd_handler = &info_func; |
|
553 |
$$->cmd_res_type = RT_SCHED; |
|
554 |
$$->cmd_prop_nv_pairs = 0; |
|
555 |
} |
|
556 |
| INFO SHARES |
|
557 |
{ |
|
558 |
if (($$ = alloc_cmd()) == NULL) |
|
559 |
YYERROR; |
|
560 |
cmd = $$; |
|
561 |
$$->cmd_handler = &info_func; |
|
562 |
$$->cmd_res_type = RT_SHARES; |
|
563 |
$$->cmd_prop_nv_pairs = 0; |
|
564 |
} |
|
565 |
| INFO MAXLWPS |
|
566 |
{ |
|
567 |
if (($$ = alloc_cmd()) == NULL) |
|
568 |
YYERROR; |
|
569 |
cmd = $$; |
|
570 |
$$->cmd_handler = &info_func; |
|
571 |
$$->cmd_res_type = RT_MAXLWPS; |
|
572 |
$$->cmd_prop_nv_pairs = 0; |
|
573 |
} |
|
574 |
| INFO MAXSHMMEM |
|
575 |
{ |
|
576 |
if (($$ = alloc_cmd()) == NULL) |
|
577 |
YYERROR; |
|
578 |
cmd = $$; |
|
579 |
$$->cmd_handler = &info_func; |
|
580 |
$$->cmd_res_type = RT_MAXSHMMEM; |
|
581 |
$$->cmd_prop_nv_pairs = 0; |
|
582 |
} |
|
583 |
| INFO MAXSHMIDS |
|
584 |
{ |
|
585 |
if (($$ = alloc_cmd()) == NULL) |
|
586 |
YYERROR; |
|
587 |
cmd = $$; |
|
588 |
$$->cmd_handler = &info_func; |
|
589 |
$$->cmd_res_type = RT_MAXSHMIDS; |
|
590 |
$$->cmd_prop_nv_pairs = 0; |
|
591 |
} |
|
592 |
| INFO MAXMSGIDS |
|
593 |
{ |
|
594 |
if (($$ = alloc_cmd()) == NULL) |
|
595 |
YYERROR; |
|
596 |
cmd = $$; |
|
597 |
$$->cmd_handler = &info_func; |
|
598 |
$$->cmd_res_type = RT_MAXMSGIDS; |
|
599 |
$$->cmd_prop_nv_pairs = 0; |
|
600 |
} |
|
601 |
| INFO MAXSEMIDS |
|
602 |
{ |
|
603 |
if (($$ = alloc_cmd()) == NULL) |
|
604 |
YYERROR; |
|
605 |
cmd = $$; |
|
606 |
$$->cmd_handler = &info_func; |
|
607 |
$$->cmd_res_type = RT_MAXSEMIDS; |
|
608 |
$$->cmd_prop_nv_pairs = 0; |
|
609 |
} |
|
8662
18153249ee93
PSARC/2008/647 Configurable Hostids for Non-Global Zones
jv227347 <Jordan.Vaughan@Sun.com>
parents:
6215
diff
changeset
|
610 |
| INFO HOSTID |
18153249ee93
PSARC/2008/647 Configurable Hostids for Non-Global Zones
jv227347 <Jordan.Vaughan@Sun.com>
parents:
6215
diff
changeset
|
611 |
{ |
18153249ee93
PSARC/2008/647 Configurable Hostids for Non-Global Zones
jv227347 <Jordan.Vaughan@Sun.com>
parents:
6215
diff
changeset
|
612 |
if (($$ = alloc_cmd()) == NULL) |
18153249ee93
PSARC/2008/647 Configurable Hostids for Non-Global Zones
jv227347 <Jordan.Vaughan@Sun.com>
parents:
6215
diff
changeset
|
613 |
YYERROR; |
18153249ee93
PSARC/2008/647 Configurable Hostids for Non-Global Zones
jv227347 <Jordan.Vaughan@Sun.com>
parents:
6215
diff
changeset
|
614 |
cmd = $$; |
18153249ee93
PSARC/2008/647 Configurable Hostids for Non-Global Zones
jv227347 <Jordan.Vaughan@Sun.com>
parents:
6215
diff
changeset
|
615 |
$$->cmd_handler = &info_func; |
18153249ee93
PSARC/2008/647 Configurable Hostids for Non-Global Zones
jv227347 <Jordan.Vaughan@Sun.com>
parents:
6215
diff
changeset
|
616 |
$$->cmd_res_type = RT_HOSTID; |
18153249ee93
PSARC/2008/647 Configurable Hostids for Non-Global Zones
jv227347 <Jordan.Vaughan@Sun.com>
parents:
6215
diff
changeset
|
617 |
$$->cmd_prop_nv_pairs = 0; |
18153249ee93
PSARC/2008/647 Configurable Hostids for Non-Global Zones
jv227347 <Jordan.Vaughan@Sun.com>
parents:
6215
diff
changeset
|
618 |
} |
0 | 619 |
| INFO resource_type property_name EQUAL property_value |
620 |
{ |
|
621 |
if (($$ = alloc_cmd()) == NULL) |
|
622 |
YYERROR; |
|
623 |
cmd = $$; |
|
624 |
$$->cmd_handler = &info_func; |
|
625 |
$$->cmd_res_type = $2; |
|
626 |
$$->cmd_prop_nv_pairs = 1; |
|
627 |
$$->cmd_prop_name[0] = $3; |
|
628 |
$$->cmd_property_ptr[0] = &property[0]; |
|
629 |
} |
|
630 |
| INFO resource_type property_name EQUAL property_value property_name EQUAL property_value |
|
631 |
{ |
|
632 |
if (($$ = alloc_cmd()) == NULL) |
|
633 |
YYERROR; |
|
634 |
cmd = $$; |
|
635 |
$$->cmd_handler = &info_func; |
|
636 |
$$->cmd_res_type = $2; |
|
637 |
$$->cmd_prop_nv_pairs = 2; |
|
638 |
$$->cmd_prop_name[0] = $3; |
|
639 |
$$->cmd_property_ptr[0] = &property[0]; |
|
640 |
$$->cmd_prop_name[1] = $6; |
|
641 |
$$->cmd_property_ptr[1] = &property[1]; |
|
642 |
} |
|
643 |
| INFO resource_type property_name EQUAL property_value property_name EQUAL property_value property_name EQUAL property_value |
|
644 |
{ |
|
645 |
if (($$ = alloc_cmd()) == NULL) |
|
646 |
YYERROR; |
|
647 |
cmd = $$; |
|
648 |
$$->cmd_handler = &info_func; |
|
649 |
$$->cmd_res_type = $2; |
|
650 |
$$->cmd_prop_nv_pairs = 3; |
|
651 |
$$->cmd_prop_name[0] = $3; |
|
652 |
$$->cmd_property_ptr[0] = &property[0]; |
|
653 |
$$->cmd_prop_name[1] = $6; |
|
654 |
$$->cmd_property_ptr[1] = &property[1]; |
|
655 |
$$->cmd_prop_name[2] = $9; |
|
656 |
$$->cmd_property_ptr[2] = &property[2]; |
|
657 |
} |
|
658 |
||
659 |
remove_command: REMOVE |
|
660 |
{ |
|
661 |
short_usage(CMD_REMOVE); |
|
662 |
(void) fputs("\n", stderr); |
|
6215
78f5eb4d8d4d
6527047 zonecfg shouldn't use two different boolean types
gjelinek
parents:
6076
diff
changeset
|
663 |
usage(B_FALSE, HELP_RES_PROPS); |
0 | 664 |
YYERROR; |
665 |
} |
|
3247 | 666 |
| REMOVE TOKEN |
667 |
{ |
|
668 |
short_usage(CMD_REMOVE); |
|
669 |
(void) fputs("\n", stderr); |
|
6215
78f5eb4d8d4d
6527047 zonecfg shouldn't use two different boolean types
gjelinek
parents:
6076
diff
changeset
|
670 |
usage(B_FALSE, HELP_RES_PROPS); |
3247 | 671 |
YYERROR; |
672 |
} |
|
0 | 673 |
| REMOVE resource_type |
674 |
{ |
|
3247 | 675 |
if (($$ = alloc_cmd()) == NULL) |
676 |
YYERROR; |
|
677 |
cmd = $$; |
|
678 |
$$->cmd_handler = &remove_func; |
|
679 |
$$->cmd_res_type = $2; |
|
680 |
} |
|
681 |
| REMOVE TOKEN resource_type |
|
682 |
{ |
|
683 |
if (($$ = alloc_cmd()) == NULL) |
|
684 |
YYERROR; |
|
685 |
cmd = $$; |
|
686 |
$$->cmd_handler = &remove_func; |
|
687 |
$$->cmd_res_type = $3; |
|
688 |
$$->cmd_argc = 1; |
|
689 |
$$->cmd_argv[0] = $2; |
|
690 |
$$->cmd_argv[1] = NULL; |
|
0 | 691 |
} |
692 |
| REMOVE property_name property_value |
|
693 |
{ |
|
694 |
if (($$ = alloc_cmd()) == NULL) |
|
695 |
YYERROR; |
|
696 |
cmd = $$; |
|
697 |
$$->cmd_handler = &remove_func; |
|
698 |
$$->cmd_prop_nv_pairs = 1; |
|
699 |
$$->cmd_prop_name[0] = $2; |
|
700 |
$$->cmd_property_ptr[0] = &property[0]; |
|
701 |
} |
|
702 |
| REMOVE resource_type property_name EQUAL property_value |
|
703 |
{ |
|
704 |
if (($$ = alloc_cmd()) == NULL) |
|
705 |
YYERROR; |
|
706 |
cmd = $$; |
|
707 |
$$->cmd_handler = &remove_func; |
|
708 |
$$->cmd_res_type = $2; |
|
709 |
$$->cmd_prop_nv_pairs = 1; |
|
710 |
$$->cmd_prop_name[0] = $3; |
|
711 |
$$->cmd_property_ptr[0] = &property[0]; |
|
712 |
} |
|
713 |
| REMOVE resource_type property_name EQUAL property_value property_name EQUAL property_value |
|
714 |
{ |
|
715 |
if (($$ = alloc_cmd()) == NULL) |
|
716 |
YYERROR; |
|
717 |
cmd = $$; |
|
718 |
$$->cmd_handler = &remove_func; |
|
719 |
$$->cmd_res_type = $2; |
|
720 |
$$->cmd_prop_nv_pairs = 2; |
|
721 |
$$->cmd_prop_name[0] = $3; |
|
722 |
$$->cmd_property_ptr[0] = &property[0]; |
|
723 |
$$->cmd_prop_name[1] = $6; |
|
724 |
$$->cmd_property_ptr[1] = &property[1]; |
|
725 |
} |
|
726 |
| REMOVE resource_type property_name EQUAL property_value property_name EQUAL property_value property_name EQUAL property_value |
|
727 |
{ |
|
728 |
if (($$ = alloc_cmd()) == NULL) |
|
729 |
YYERROR; |
|
730 |
cmd = $$; |
|
731 |
$$->cmd_handler = &remove_func; |
|
732 |
$$->cmd_res_type = $2; |
|
733 |
$$->cmd_prop_nv_pairs = 3; |
|
734 |
$$->cmd_prop_name[0] = $3; |
|
735 |
$$->cmd_property_ptr[0] = &property[0]; |
|
736 |
$$->cmd_prop_name[1] = $6; |
|
737 |
$$->cmd_property_ptr[1] = &property[1]; |
|
738 |
$$->cmd_prop_name[2] = $9; |
|
739 |
$$->cmd_property_ptr[2] = &property[2]; |
|
740 |
} |
|
741 |
||
742 |
revert_command: REVERT |
|
743 |
{ |
|
744 |
if (($$ = alloc_cmd()) == NULL) |
|
745 |
YYERROR; |
|
746 |
cmd = $$; |
|
747 |
$$->cmd_handler = &revert_func; |
|
748 |
$$->cmd_argc = 0; |
|
749 |
$$->cmd_argv[0] = NULL; |
|
750 |
} |
|
751 |
| REVERT TOKEN |
|
752 |
{ |
|
753 |
if (($$ = alloc_cmd()) == NULL) |
|
754 |
YYERROR; |
|
755 |
cmd = $$; |
|
756 |
$$->cmd_handler = &revert_func; |
|
757 |
$$->cmd_argc = 1; |
|
758 |
$$->cmd_argv[0] = $2; |
|
759 |
$$->cmd_argv[1] = NULL; |
|
760 |
} |
|
761 |
||
762 |
select_command: SELECT |
|
763 |
{ |
|
764 |
short_usage(CMD_SELECT); |
|
765 |
(void) fputs("\n", stderr); |
|
6215
78f5eb4d8d4d
6527047 zonecfg shouldn't use two different boolean types
gjelinek
parents:
6076
diff
changeset
|
766 |
usage(B_FALSE, HELP_RES_PROPS); |
0 | 767 |
YYERROR; |
768 |
} |
|
3247 | 769 |
| SELECT PSET |
770 |
{ |
|
771 |
if (($$ = alloc_cmd()) == NULL) |
|
772 |
YYERROR; |
|
773 |
cmd = $$; |
|
774 |
$$->cmd_handler = &select_func; |
|
775 |
$$->cmd_res_type = RT_DCPU; |
|
776 |
} |
|
3792 | 777 |
| SELECT PCAP |
778 |
{ |
|
779 |
if (($$ = alloc_cmd()) == NULL) |
|
780 |
YYERROR; |
|
781 |
cmd = $$; |
|
782 |
$$->cmd_handler = &select_func; |
|
783 |
$$->cmd_res_type = RT_PCAP; |
|
784 |
} |
|
3247 | 785 |
| SELECT MCAP |
786 |
{ |
|
787 |
if (($$ = alloc_cmd()) == NULL) |
|
788 |
YYERROR; |
|
789 |
cmd = $$; |
|
790 |
$$->cmd_handler = &select_func; |
|
791 |
$$->cmd_res_type = RT_MCAP; |
|
792 |
} |
|
0 | 793 |
| SELECT resource_type |
794 |
{ |
|
795 |
short_usage(CMD_SELECT); |
|
796 |
YYERROR; |
|
797 |
} |
|
798 |
| SELECT resource_type property_name EQUAL property_value |
|
799 |
{ |
|
800 |
if (($$ = alloc_cmd()) == NULL) |
|
801 |
YYERROR; |
|
802 |
cmd = $$; |
|
803 |
$$->cmd_handler = &select_func; |
|
804 |
$$->cmd_res_type = $2; |
|
805 |
$$->cmd_prop_nv_pairs = 1; |
|
806 |
$$->cmd_prop_name[0] = $3; |
|
807 |
$$->cmd_property_ptr[0] = &property[0]; |
|
808 |
} |
|
809 |
| SELECT resource_type property_name EQUAL property_value property_name EQUAL property_value |
|
810 |
{ |
|
811 |
if (($$ = alloc_cmd()) == NULL) |
|
812 |
YYERROR; |
|
813 |
cmd = $$; |
|
814 |
$$->cmd_handler = &select_func; |
|
815 |
$$->cmd_res_type = $2; |
|
816 |
$$->cmd_prop_nv_pairs = 2; |
|
817 |
$$->cmd_prop_name[0] = $3; |
|
818 |
$$->cmd_property_ptr[0] = &property[0]; |
|
819 |
$$->cmd_prop_name[1] = $6; |
|
820 |
$$->cmd_property_ptr[1] = &property[1]; |
|
821 |
} |
|
822 |
| SELECT resource_type property_name EQUAL property_value property_name EQUAL property_value property_name EQUAL property_value |
|
823 |
{ |
|
824 |
if (($$ = alloc_cmd()) == NULL) |
|
825 |
YYERROR; |
|
826 |
cmd = $$; |
|
827 |
$$->cmd_handler = &select_func; |
|
828 |
$$->cmd_res_type = $2; |
|
829 |
$$->cmd_prop_nv_pairs = 3; |
|
830 |
$$->cmd_prop_name[0] = $3; |
|
831 |
$$->cmd_property_ptr[0] = &property[0]; |
|
832 |
$$->cmd_prop_name[1] = $6; |
|
833 |
$$->cmd_property_ptr[1] = &property[1]; |
|
834 |
$$->cmd_prop_name[2] = $9; |
|
835 |
$$->cmd_property_ptr[2] = &property[2]; |
|
836 |
} |
|
837 |
||
838 |
set_command: SET |
|
839 |
{ |
|
840 |
short_usage(CMD_SET); |
|
841 |
(void) fputs("\n", stderr); |
|
6215
78f5eb4d8d4d
6527047 zonecfg shouldn't use two different boolean types
gjelinek
parents:
6076
diff
changeset
|
842 |
usage(B_FALSE, HELP_PROPS); |
0 | 843 |
YYERROR; |
844 |
} |
|
845 |
| SET property_name EQUAL OPEN_SQ_BRACKET CLOSE_SQ_BRACKET |
|
846 |
{ |
|
847 |
if (($$ = alloc_cmd()) == NULL) |
|
848 |
YYERROR; |
|
849 |
cmd = $$; |
|
850 |
$$->cmd_handler = &set_func; |
|
851 |
$$->cmd_prop_nv_pairs = 0; |
|
852 |
$$->cmd_prop_name[0] = $2; |
|
853 |
property[0].pv_type = PROP_VAL_LIST; |
|
854 |
property[0].pv_list = NULL; |
|
855 |
$$->cmd_property_ptr[0] = &property[0]; |
|
856 |
} |
|
857 |
| SET property_name EQUAL property_value |
|
858 |
{ |
|
859 |
if (($$ = alloc_cmd()) == NULL) |
|
860 |
YYERROR; |
|
861 |
cmd = $$; |
|
862 |
$$->cmd_handler = &set_func; |
|
863 |
$$->cmd_prop_nv_pairs = 1; |
|
864 |
$$->cmd_prop_name[0] = $2; |
|
865 |
$$->cmd_property_ptr[0] = &property[0]; |
|
866 |
} |
|
2303 | 867 |
| SET TOKEN ZONEPATH EQUAL property_value |
868 |
{ |
|
869 |
if (($$ = alloc_cmd()) == NULL) |
|
870 |
YYERROR; |
|
871 |
cmd = $$; |
|
872 |
$$->cmd_argc = 1; |
|
873 |
$$->cmd_argv[0] = $2; |
|
874 |
$$->cmd_argv[1] = NULL; |
|
875 |
$$->cmd_handler = &set_func; |
|
876 |
$$->cmd_prop_nv_pairs = 1; |
|
877 |
$$->cmd_prop_name[0] = PT_ZONEPATH; |
|
878 |
$$->cmd_property_ptr[0] = &property[0]; |
|
879 |
} |
|
0 | 880 |
|
3247 | 881 |
clear_command: CLEAR |
882 |
{ |
|
883 |
short_usage(CMD_CLEAR); |
|
884 |
(void) fputs("\n", stderr); |
|
6215
78f5eb4d8d4d
6527047 zonecfg shouldn't use two different boolean types
gjelinek
parents:
6076
diff
changeset
|
885 |
usage(B_FALSE, HELP_PROPS); |
3247 | 886 |
YYERROR; |
887 |
} |
|
888 |
| CLEAR property_name |
|
889 |
{ |
|
890 |
if (($$ = alloc_cmd()) == NULL) |
|
891 |
YYERROR; |
|
892 |
cmd = $$; |
|
893 |
$$->cmd_handler = &clear_func; |
|
894 |
$$->cmd_res_type = $2; |
|
895 |
} |
|
896 |
||
0 | 897 |
verify_command: VERIFY |
898 |
{ |
|
899 |
if (($$ = alloc_cmd()) == NULL) |
|
900 |
YYERROR; |
|
901 |
cmd = $$; |
|
902 |
$$->cmd_handler = &verify_func; |
|
903 |
$$->cmd_argc = 0; |
|
904 |
$$->cmd_argv[0] = NULL; |
|
905 |
} |
|
906 |
| VERIFY TOKEN |
|
907 |
{ |
|
908 |
if (($$ = alloc_cmd()) == NULL) |
|
909 |
YYERROR; |
|
910 |
cmd = $$; |
|
911 |
$$->cmd_handler = &verify_func; |
|
912 |
$$->cmd_argc = 1; |
|
913 |
$$->cmd_argv[0] = $2; |
|
914 |
$$->cmd_argv[1] = NULL; |
|
915 |
} |
|
916 |
||
917 |
resource_type: NET { $$ = RT_NET; } |
|
918 |
| FS { $$ = RT_FS; } |
|
919 |
| IPD { $$ = RT_IPD; } |
|
920 |
| DEVICE { $$ = RT_DEVICE; } |
|
921 |
| RCTL { $$ = RT_RCTL; } |
|
922 |
| ATTR { $$ = RT_ATTR; } |
|
789 | 923 |
| DATASET { $$ = RT_DATASET; } |
3247 | 924 |
| PSET { $$ = RT_DCPU; } |
3792 | 925 |
| PCAP { $$ = RT_PCAP; } |
3247 | 926 |
| MCAP { $$ = RT_MCAP; } |
0 | 927 |
|
928 |
property_name: SPECIAL { $$ = PT_SPECIAL; } |
|
929 |
| RAW { $$ = PT_RAW; } |
|
930 |
| DIR { $$ = PT_DIR; } |
|
931 |
| TYPE { $$ = PT_TYPE; } |
|
932 |
| OPTIONS { $$ = PT_OPTIONS; } |
|
565 | 933 |
| ZONENAME { $$ = PT_ZONENAME; } |
0 | 934 |
| ZONEPATH { $$ = PT_ZONEPATH; } |
935 |
| AUTOBOOT { $$ = PT_AUTOBOOT; } |
|
3448 | 936 |
| IPTYPE { $$ = PT_IPTYPE; } |
0 | 937 |
| POOL { $$ = PT_POOL; } |
1645 | 938 |
| LIMITPRIV { $$ = PT_LIMITPRIV; } |
2267 | 939 |
| BOOTARGS { $$ = PT_BOOTARGS; } |
0 | 940 |
| ADDRESS { $$ = PT_ADDRESS; } |
941 |
| PHYSICAL { $$ = PT_PHYSICAL; } |
|
6076
39e1b255225b
6583565 need a mechanism to configure a per zone default route in shared IP stack for TX
gfaden
parents:
3792
diff
changeset
|
942 |
| DEFROUTER { $$ = PT_DEFROUTER; } |
0 | 943 |
| NAME { $$ = PT_NAME; } |
944 |
| VALUE { $$ = PT_VALUE; } |
|
945 |
| MATCH { $$ = PT_MATCH; } |
|
946 |
| PRIV { $$ = PT_PRIV; } |
|
947 |
| LIMIT { $$ = PT_LIMIT; } |
|
948 |
| ACTION { $$ = PT_ACTION; } |
|
2712
f74a135872bc
PSARC/2005/471 BrandZ: Support for non-native zones
nn35248
parents:
2303
diff
changeset
|
949 |
| BRAND { $$ = PT_BRAND; } |
3247 | 950 |
| NCPUS { $$ = PT_NCPUS; } |
951 |
| LOCKED { $$ = PT_LOCKED; } |
|
952 |
| SWAP { $$ = PT_SWAP; } |
|
953 |
| IMPORTANCE { $$ = PT_IMPORTANCE; } |
|
954 |
| SHARES { $$ = PT_SHARES; } |
|
955 |
| MAXLWPS { $$ = PT_MAXLWPS; } |
|
956 |
| MAXSHMMEM { $$ = PT_MAXSHMMEM; } |
|
957 |
| MAXSHMIDS { $$ = PT_MAXSHMIDS; } |
|
958 |
| MAXMSGIDS { $$ = PT_MAXMSGIDS; } |
|
959 |
| MAXSEMIDS { $$ = PT_MAXSEMIDS; } |
|
960 |
| SCHED { $$ = PT_SCHED; } |
|
8662
18153249ee93
PSARC/2008/647 Configurable Hostids for Non-Global Zones
jv227347 <Jordan.Vaughan@Sun.com>
parents:
6215
diff
changeset
|
961 |
| HOSTID { $$ = PT_HOSTID; } |
0 | 962 |
|
963 |
/* |
|
964 |
* The grammar builds data structures from the bottom up. Thus various |
|
965 |
* strings are lexed into TOKENs or commands or resource or property values. |
|
966 |
* Below is where the resource and property values are built up into more |
|
967 |
* complex data structures. |
|
968 |
* |
|
969 |
* There are three kinds of properties: simple (single valued), complex |
|
970 |
* (one or more name=value pairs) and list (concatenation of one or more |
|
971 |
* simple or complex properties). |
|
972 |
* |
|
973 |
* So the property structure has a type which is one of these, and the |
|
974 |
* corresponding _simple, _complex or _list is set to the corresponding |
|
975 |
* lower-level data structure. |
|
976 |
*/ |
|
977 |
||
978 |
property_value: simple_prop_val |
|
979 |
{ |
|
980 |
property[num_prop_vals].pv_type = PROP_VAL_SIMPLE; |
|
981 |
property[num_prop_vals].pv_simple = $1; |
|
982 |
if (list[num_prop_vals] != NULL) { |
|
983 |
free_outer_list(list[num_prop_vals]); |
|
984 |
list[num_prop_vals] = NULL; |
|
985 |
} |
|
986 |
num_prop_vals++; |
|
987 |
} |
|
988 |
| complex_prop_val |
|
989 |
{ |
|
990 |
property[num_prop_vals].pv_type = PROP_VAL_COMPLEX; |
|
991 |
property[num_prop_vals].pv_complex = complex; |
|
992 |
if (list[num_prop_vals] != NULL) { |
|
993 |
free_outer_list(list[num_prop_vals]); |
|
994 |
list[num_prop_vals] = NULL; |
|
995 |
} |
|
996 |
num_prop_vals++; |
|
997 |
} |
|
998 |
| list_prop_val |
|
999 |
{ |
|
1000 |
property[num_prop_vals].pv_type = PROP_VAL_LIST; |
|
1001 |
property[num_prop_vals].pv_list = list[num_prop_vals]; |
|
1002 |
num_prop_vals++; |
|
1003 |
} |
|
1004 |
||
1005 |
/* |
|
1006 |
* One level lower, lists are made up of simple or complex values, so |
|
1007 |
* simple_prop_val and complex_prop_val fill in a list structure and |
|
1008 |
* insert it into the linked list which is built up. And because |
|
1009 |
* complex properties can have multiple name=value pairs, we keep |
|
1010 |
* track of them in another linked list. |
|
1011 |
* |
|
1012 |
* The complex and list structures for the linked lists are allocated |
|
1013 |
* below, and freed by recursive functions which are ultimately called |
|
1014 |
* by free_cmd(), which is called from the top-most "commands" part of |
|
1015 |
* the grammar. |
|
11024
16869afd5fb1
6893156 zonecfg(1M)'s grammar rejects property names and resource types where it expects property values
jv227347 <Jordan.Vaughan@Sun.com>
parents:
8662
diff
changeset
|
1016 |
* |
16869afd5fb1
6893156 zonecfg(1M)'s grammar rejects property names and resource types where it expects property values
jv227347 <Jordan.Vaughan@Sun.com>
parents:
8662
diff
changeset
|
1017 |
* NOTE: simple_prop_val and complex_piece need reduction rules for |
16869afd5fb1
6893156 zonecfg(1M)'s grammar rejects property names and resource types where it expects property values
jv227347 <Jordan.Vaughan@Sun.com>
parents:
8662
diff
changeset
|
1018 |
* property_name and resource_type so that the parser will accept property names |
16869afd5fb1
6893156 zonecfg(1M)'s grammar rejects property names and resource types where it expects property values
jv227347 <Jordan.Vaughan@Sun.com>
parents:
8662
diff
changeset
|
1019 |
* and resource type names as property values. |
0 | 1020 |
*/ |
1021 |
||
1022 |
simple_prop_val: TOKEN |
|
1023 |
{ |
|
11024
16869afd5fb1
6893156 zonecfg(1M)'s grammar rejects property names and resource types where it expects property values
jv227347 <Jordan.Vaughan@Sun.com>
parents:
8662
diff
changeset
|
1024 |
$$ = simple_prop_val_func($1); |
16869afd5fb1
6893156 zonecfg(1M)'s grammar rejects property names and resource types where it expects property values
jv227347 <Jordan.Vaughan@Sun.com>
parents:
8662
diff
changeset
|
1025 |
free($1); |
16869afd5fb1
6893156 zonecfg(1M)'s grammar rejects property names and resource types where it expects property values
jv227347 <Jordan.Vaughan@Sun.com>
parents:
8662
diff
changeset
|
1026 |
if ($$ == NULL) |
0 | 1027 |
YYERROR; |
11024
16869afd5fb1
6893156 zonecfg(1M)'s grammar rejects property names and resource types where it expects property values
jv227347 <Jordan.Vaughan@Sun.com>
parents:
8662
diff
changeset
|
1028 |
} |
16869afd5fb1
6893156 zonecfg(1M)'s grammar rejects property names and resource types where it expects property values
jv227347 <Jordan.Vaughan@Sun.com>
parents:
8662
diff
changeset
|
1029 |
| resource_type |
16869afd5fb1
6893156 zonecfg(1M)'s grammar rejects property names and resource types where it expects property values
jv227347 <Jordan.Vaughan@Sun.com>
parents:
8662
diff
changeset
|
1030 |
{ |
16869afd5fb1
6893156 zonecfg(1M)'s grammar rejects property names and resource types where it expects property values
jv227347 <Jordan.Vaughan@Sun.com>
parents:
8662
diff
changeset
|
1031 |
if (($$ = simple_prop_val_func(res_types[$1])) == NULL) |
16869afd5fb1
6893156 zonecfg(1M)'s grammar rejects property names and resource types where it expects property values
jv227347 <Jordan.Vaughan@Sun.com>
parents:
8662
diff
changeset
|
1032 |
YYERROR; |
16869afd5fb1
6893156 zonecfg(1M)'s grammar rejects property names and resource types where it expects property values
jv227347 <Jordan.Vaughan@Sun.com>
parents:
8662
diff
changeset
|
1033 |
} |
16869afd5fb1
6893156 zonecfg(1M)'s grammar rejects property names and resource types where it expects property values
jv227347 <Jordan.Vaughan@Sun.com>
parents:
8662
diff
changeset
|
1034 |
| property_name |
16869afd5fb1
6893156 zonecfg(1M)'s grammar rejects property names and resource types where it expects property values
jv227347 <Jordan.Vaughan@Sun.com>
parents:
8662
diff
changeset
|
1035 |
{ |
16869afd5fb1
6893156 zonecfg(1M)'s grammar rejects property names and resource types where it expects property values
jv227347 <Jordan.Vaughan@Sun.com>
parents:
8662
diff
changeset
|
1036 |
if (($$ = simple_prop_val_func(prop_types[$1])) == NULL) |
16869afd5fb1
6893156 zonecfg(1M)'s grammar rejects property names and resource types where it expects property values
jv227347 <Jordan.Vaughan@Sun.com>
parents:
8662
diff
changeset
|
1037 |
YYERROR; |
0 | 1038 |
} |
1039 |
||
1040 |
complex_prop_val: OPEN_PAREN complex_piece CLOSE_PAREN |
|
1041 |
{ |
|
1042 |
if ((new_list = alloc_list()) == NULL) |
|
1043 |
YYERROR; |
|
1044 |
new_list->lp_simple = NULL; |
|
1045 |
new_list->lp_complex = complex; |
|
1046 |
new_list->lp_next = NULL; |
|
1047 |
if (list[num_prop_vals] == NULL) { |
|
1048 |
list[num_prop_vals] = new_list; |
|
1049 |
} else { |
|
1050 |
for (tmp_list = list[num_prop_vals]; tmp_list != NULL; |
|
1051 |
tmp_list = tmp_list->lp_next) |
|
1052 |
last = tmp_list; |
|
1053 |
last->lp_next = new_list; |
|
1054 |
} |
|
1055 |
} |
|
1056 |
||
1057 |
complex_piece: property_name EQUAL TOKEN |
|
1058 |
{ |
|
11024
16869afd5fb1
6893156 zonecfg(1M)'s grammar rejects property names and resource types where it expects property values
jv227347 <Jordan.Vaughan@Sun.com>
parents:
8662
diff
changeset
|
1059 |
$$ = complex_piece_func($1, $3, NULL); |
16869afd5fb1
6893156 zonecfg(1M)'s grammar rejects property names and resource types where it expects property values
jv227347 <Jordan.Vaughan@Sun.com>
parents:
8662
diff
changeset
|
1060 |
free($3); |
16869afd5fb1
6893156 zonecfg(1M)'s grammar rejects property names and resource types where it expects property values
jv227347 <Jordan.Vaughan@Sun.com>
parents:
8662
diff
changeset
|
1061 |
if ($$ == NULL) |
0 | 1062 |
YYERROR; |
11024
16869afd5fb1
6893156 zonecfg(1M)'s grammar rejects property names and resource types where it expects property values
jv227347 <Jordan.Vaughan@Sun.com>
parents:
8662
diff
changeset
|
1063 |
} |
16869afd5fb1
6893156 zonecfg(1M)'s grammar rejects property names and resource types where it expects property values
jv227347 <Jordan.Vaughan@Sun.com>
parents:
8662
diff
changeset
|
1064 |
| property_name EQUAL resource_type |
16869afd5fb1
6893156 zonecfg(1M)'s grammar rejects property names and resource types where it expects property values
jv227347 <Jordan.Vaughan@Sun.com>
parents:
8662
diff
changeset
|
1065 |
{ |
16869afd5fb1
6893156 zonecfg(1M)'s grammar rejects property names and resource types where it expects property values
jv227347 <Jordan.Vaughan@Sun.com>
parents:
8662
diff
changeset
|
1066 |
if (($$ = complex_piece_func($1, res_types[$3], NULL)) == NULL) |
16869afd5fb1
6893156 zonecfg(1M)'s grammar rejects property names and resource types where it expects property values
jv227347 <Jordan.Vaughan@Sun.com>
parents:
8662
diff
changeset
|
1067 |
YYERROR; |
16869afd5fb1
6893156 zonecfg(1M)'s grammar rejects property names and resource types where it expects property values
jv227347 <Jordan.Vaughan@Sun.com>
parents:
8662
diff
changeset
|
1068 |
} |
16869afd5fb1
6893156 zonecfg(1M)'s grammar rejects property names and resource types where it expects property values
jv227347 <Jordan.Vaughan@Sun.com>
parents:
8662
diff
changeset
|
1069 |
| property_name EQUAL property_name |
16869afd5fb1
6893156 zonecfg(1M)'s grammar rejects property names and resource types where it expects property values
jv227347 <Jordan.Vaughan@Sun.com>
parents:
8662
diff
changeset
|
1070 |
{ |
16869afd5fb1
6893156 zonecfg(1M)'s grammar rejects property names and resource types where it expects property values
jv227347 <Jordan.Vaughan@Sun.com>
parents:
8662
diff
changeset
|
1071 |
if (($$ = complex_piece_func($1, prop_types[$3], NULL)) == NULL) |
16869afd5fb1
6893156 zonecfg(1M)'s grammar rejects property names and resource types where it expects property values
jv227347 <Jordan.Vaughan@Sun.com>
parents:
8662
diff
changeset
|
1072 |
YYERROR; |
0 | 1073 |
} |
1074 |
| property_name EQUAL TOKEN COMMA complex_piece |
|
1075 |
{ |
|
11024
16869afd5fb1
6893156 zonecfg(1M)'s grammar rejects property names and resource types where it expects property values
jv227347 <Jordan.Vaughan@Sun.com>
parents:
8662
diff
changeset
|
1076 |
$$ = complex_piece_func($1, $3, complex); |
16869afd5fb1
6893156 zonecfg(1M)'s grammar rejects property names and resource types where it expects property values
jv227347 <Jordan.Vaughan@Sun.com>
parents:
8662
diff
changeset
|
1077 |
free($3); |
16869afd5fb1
6893156 zonecfg(1M)'s grammar rejects property names and resource types where it expects property values
jv227347 <Jordan.Vaughan@Sun.com>
parents:
8662
diff
changeset
|
1078 |
if ($$ == NULL) |
0 | 1079 |
YYERROR; |
11024
16869afd5fb1
6893156 zonecfg(1M)'s grammar rejects property names and resource types where it expects property values
jv227347 <Jordan.Vaughan@Sun.com>
parents:
8662
diff
changeset
|
1080 |
} |
16869afd5fb1
6893156 zonecfg(1M)'s grammar rejects property names and resource types where it expects property values
jv227347 <Jordan.Vaughan@Sun.com>
parents:
8662
diff
changeset
|
1081 |
| property_name EQUAL resource_type COMMA complex_piece |
16869afd5fb1
6893156 zonecfg(1M)'s grammar rejects property names and resource types where it expects property values
jv227347 <Jordan.Vaughan@Sun.com>
parents:
8662
diff
changeset
|
1082 |
{ |
16869afd5fb1
6893156 zonecfg(1M)'s grammar rejects property names and resource types where it expects property values
jv227347 <Jordan.Vaughan@Sun.com>
parents:
8662
diff
changeset
|
1083 |
if (($$ = complex_piece_func($1, res_types[$3], complex)) == |
16869afd5fb1
6893156 zonecfg(1M)'s grammar rejects property names and resource types where it expects property values
jv227347 <Jordan.Vaughan@Sun.com>
parents:
8662
diff
changeset
|
1084 |
NULL) |
16869afd5fb1
6893156 zonecfg(1M)'s grammar rejects property names and resource types where it expects property values
jv227347 <Jordan.Vaughan@Sun.com>
parents:
8662
diff
changeset
|
1085 |
YYERROR; |
16869afd5fb1
6893156 zonecfg(1M)'s grammar rejects property names and resource types where it expects property values
jv227347 <Jordan.Vaughan@Sun.com>
parents:
8662
diff
changeset
|
1086 |
} |
16869afd5fb1
6893156 zonecfg(1M)'s grammar rejects property names and resource types where it expects property values
jv227347 <Jordan.Vaughan@Sun.com>
parents:
8662
diff
changeset
|
1087 |
| property_name EQUAL property_name COMMA complex_piece |
16869afd5fb1
6893156 zonecfg(1M)'s grammar rejects property names and resource types where it expects property values
jv227347 <Jordan.Vaughan@Sun.com>
parents:
8662
diff
changeset
|
1088 |
{ |
16869afd5fb1
6893156 zonecfg(1M)'s grammar rejects property names and resource types where it expects property values
jv227347 <Jordan.Vaughan@Sun.com>
parents:
8662
diff
changeset
|
1089 |
if (($$ = complex_piece_func($1, prop_types[$3], complex)) == |
16869afd5fb1
6893156 zonecfg(1M)'s grammar rejects property names and resource types where it expects property values
jv227347 <Jordan.Vaughan@Sun.com>
parents:
8662
diff
changeset
|
1090 |
NULL) |
16869afd5fb1
6893156 zonecfg(1M)'s grammar rejects property names and resource types where it expects property values
jv227347 <Jordan.Vaughan@Sun.com>
parents:
8662
diff
changeset
|
1091 |
YYERROR; |
0 | 1092 |
} |
1093 |
||
1094 |
list_piece: simple_prop_val |
|
1095 |
| complex_prop_val |
|
1096 |
| simple_prop_val COMMA list_piece |
|
1097 |
| complex_prop_val COMMA list_piece |
|
1098 |
||
1099 |
list_prop_val: OPEN_SQ_BRACKET list_piece CLOSE_SQ_BRACKET |
|
1100 |
%% |