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