118
119 %}
120
121 %union {
122 int ival;
123 char *strval;
124 cmd_t *cmd;
125 complex_property_ptr_t complex;
126 list_property_ptr_t list;
127 }
128
129 %start commands
130
131 %token HELP CREATE EXPORT ADD DELETE REMOVE SELECT SET INFO CANCEL END VERIFY
132 %token COMMIT REVERT EXIT SEMICOLON TOKEN ZONENAME ZONEPATH AUTOBOOT POOL NET
133 %token FS ATTR DEVICE RCTL SPECIAL RAW DIR OPTIONS TYPE ADDRESS PHYSICAL
134 %token IPTYPE HOSTID FS_ALLOWED ALLOWED_ADDRESS
135 %token NAME MATCH PRIV LIMIT ACTION VALUE EQUAL OPEN_SQ_BRACKET CLOSE_SQ_BRACKET
136 %token OPEN_PAREN CLOSE_PAREN COMMA DATASET LIMITPRIV BOOTARGS BRAND PSET PCAP
137 %token MCAP NCPUS IMPORTANCE SHARES MAXLWPS MAXSHMMEM MAXSHMIDS MAXMSGIDS
138 %token MAXSEMIDS LOCKED SWAP SCHED CLEAR DEFROUTER ADMIN USER AUTHS MAXPROCS
139
140 %type <strval> TOKEN EQUAL OPEN_SQ_BRACKET CLOSE_SQ_BRACKET
141 property_value OPEN_PAREN CLOSE_PAREN COMMA simple_prop_val
142 %type <complex> complex_piece complex_prop_val
143 %type <ival> resource_type NET FS DEVICE RCTL ATTR DATASET PSET PCAP MCAP
144 ADMIN
145 %type <ival> property_name SPECIAL RAW DIR OPTIONS TYPE ADDRESS PHYSICAL NAME
146 MATCH ZONENAME ZONEPATH AUTOBOOT POOL LIMITPRIV BOOTARGS VALUE PRIV LIMIT
147 ACTION BRAND SCHED IPTYPE DEFROUTER HOSTID USER AUTHS FS_ALLOWED
148 ALLOWED_ADDRESS
149 %type <cmd> command
150 %type <cmd> add_command ADD
151 %type <cmd> cancel_command CANCEL
152 %type <cmd> commit_command COMMIT
153 %type <cmd> create_command CREATE
154 %type <cmd> delete_command DELETE
155 %type <cmd> end_command END
156 %type <cmd> exit_command EXIT
157 %type <cmd> export_command EXPORT
158 %type <cmd> help_command HELP
159 %type <cmd> info_command INFO
160 %type <cmd> remove_command REMOVE
161 %type <cmd> revert_command REVERT
162 %type <cmd> select_command SELECT
163 %type <cmd> set_command SET
164 %type <cmd> clear_command CLEAR
165 %type <cmd> verify_command VERIFY
166 %type <cmd> terminator
167
168 %%
942 {
943 if (($$ = alloc_cmd()) == NULL)
944 YYERROR;
945 cmd = $$;
946 $$->cmd_handler = &verify_func;
947 $$->cmd_argc = 1;
948 $$->cmd_argv[0] = claim_token($2);
949 $$->cmd_argv[1] = NULL;
950 }
951
952 resource_type: NET { $$ = RT_NET; }
953 | FS { $$ = RT_FS; }
954 | DEVICE { $$ = RT_DEVICE; }
955 | RCTL { $$ = RT_RCTL; }
956 | ATTR { $$ = RT_ATTR; }
957 | DATASET { $$ = RT_DATASET; }
958 | PSET { $$ = RT_DCPU; }
959 | PCAP { $$ = RT_PCAP; }
960 | MCAP { $$ = RT_MCAP; }
961 | ADMIN { $$ = RT_ADMIN; }
962
963 property_name: SPECIAL { $$ = PT_SPECIAL; }
964 | RAW { $$ = PT_RAW; }
965 | DIR { $$ = PT_DIR; }
966 | TYPE { $$ = PT_TYPE; }
967 | OPTIONS { $$ = PT_OPTIONS; }
968 | ZONENAME { $$ = PT_ZONENAME; }
969 | ZONEPATH { $$ = PT_ZONEPATH; }
970 | AUTOBOOT { $$ = PT_AUTOBOOT; }
971 | IPTYPE { $$ = PT_IPTYPE; }
972 | POOL { $$ = PT_POOL; }
973 | LIMITPRIV { $$ = PT_LIMITPRIV; }
974 | BOOTARGS { $$ = PT_BOOTARGS; }
975 | ADDRESS { $$ = PT_ADDRESS; }
976 | ALLOWED_ADDRESS { $$ = PT_ALLOWED_ADDRESS; }
977 | PHYSICAL { $$ = PT_PHYSICAL; }
978 | DEFROUTER { $$ = PT_DEFROUTER; }
979 | NAME { $$ = PT_NAME; }
980 | VALUE { $$ = PT_VALUE; }
981 | MATCH { $$ = PT_MATCH; }
982 | PRIV { $$ = PT_PRIV; }
983 | LIMIT { $$ = PT_LIMIT; }
984 | ACTION { $$ = PT_ACTION; }
985 | BRAND { $$ = PT_BRAND; }
986 | NCPUS { $$ = PT_NCPUS; }
987 | LOCKED { $$ = PT_LOCKED; }
988 | SWAP { $$ = PT_SWAP; }
989 | IMPORTANCE { $$ = PT_IMPORTANCE; }
990 | SHARES { $$ = PT_SHARES; }
991 | MAXLWPS { $$ = PT_MAXLWPS; }
992 | MAXPROCS { $$ = PT_MAXPROCS; }
993 | MAXSHMMEM { $$ = PT_MAXSHMMEM; }
994 | MAXSHMIDS { $$ = PT_MAXSHMIDS; }
995 | MAXMSGIDS { $$ = PT_MAXMSGIDS; }
996 | MAXSEMIDS { $$ = PT_MAXSEMIDS; }
997 | SCHED { $$ = PT_SCHED; }
998 | HOSTID { $$ = PT_HOSTID; }
999 | USER { $$ = PT_USER; }
1000 | AUTHS { $$ = PT_AUTHS; }
1001 | FS_ALLOWED { $$ = PT_FS_ALLOWED; }
1002
1003 /*
1004 * The grammar builds data structures from the bottom up. Thus various
1005 * strings are lexed into TOKENs or commands or resource or property values.
1006 * Below is where the resource and property values are built up into more
1007 * complex data structures.
1008 *
1009 * There are three kinds of properties: simple (single valued), complex
1010 * (one or more name=value pairs) and list (concatenation of one or more
1011 * simple or complex properties).
1012 *
1013 * So the property structure has a type which is one of these, and the
1014 * corresponding _simple, _complex or _list is set to the corresponding
1015 * lower-level data structure.
1016 */
1017
1018 property_value: simple_prop_val
1019 {
1020 property[num_prop_vals].pv_type = PROP_VAL_SIMPLE;
1021 property[num_prop_vals].pv_simple = $1;
|
118
119 %}
120
121 %union {
122 int ival;
123 char *strval;
124 cmd_t *cmd;
125 complex_property_ptr_t complex;
126 list_property_ptr_t list;
127 }
128
129 %start commands
130
131 %token HELP CREATE EXPORT ADD DELETE REMOVE SELECT SET INFO CANCEL END VERIFY
132 %token COMMIT REVERT EXIT SEMICOLON TOKEN ZONENAME ZONEPATH AUTOBOOT POOL NET
133 %token FS ATTR DEVICE RCTL SPECIAL RAW DIR OPTIONS TYPE ADDRESS PHYSICAL
134 %token IPTYPE HOSTID FS_ALLOWED ALLOWED_ADDRESS
135 %token NAME MATCH PRIV LIMIT ACTION VALUE EQUAL OPEN_SQ_BRACKET CLOSE_SQ_BRACKET
136 %token OPEN_PAREN CLOSE_PAREN COMMA DATASET LIMITPRIV BOOTARGS BRAND PSET PCAP
137 %token MCAP NCPUS IMPORTANCE SHARES MAXLWPS MAXSHMMEM MAXSHMIDS MAXMSGIDS
138 %token MAXSEMIDS LOCKED SWAP SCHED CLEAR DEFROUTER ADMIN SECFLAGS USER AUTHS MAXPROCS
139 %token DEFAULT UPPER LOWER
140
141 %type <strval> TOKEN EQUAL OPEN_SQ_BRACKET CLOSE_SQ_BRACKET
142 property_value OPEN_PAREN CLOSE_PAREN COMMA simple_prop_val
143 %type <complex> complex_piece complex_prop_val
144 %type <ival> resource_type NET FS DEVICE RCTL ATTR DATASET PSET PCAP MCAP
145 ADMIN SECFLAGS
146 %type <ival> property_name SPECIAL RAW DIR OPTIONS TYPE ADDRESS PHYSICAL NAME
147 MATCH ZONENAME ZONEPATH AUTOBOOT POOL LIMITPRIV BOOTARGS VALUE PRIV LIMIT
148 ACTION BRAND SCHED IPTYPE DEFROUTER HOSTID USER AUTHS FS_ALLOWED
149 ALLOWED_ADDRESS DEFAULT UPPER LOWER
150 %type <cmd> command
151 %type <cmd> add_command ADD
152 %type <cmd> cancel_command CANCEL
153 %type <cmd> commit_command COMMIT
154 %type <cmd> create_command CREATE
155 %type <cmd> delete_command DELETE
156 %type <cmd> end_command END
157 %type <cmd> exit_command EXIT
158 %type <cmd> export_command EXPORT
159 %type <cmd> help_command HELP
160 %type <cmd> info_command INFO
161 %type <cmd> remove_command REMOVE
162 %type <cmd> revert_command REVERT
163 %type <cmd> select_command SELECT
164 %type <cmd> set_command SET
165 %type <cmd> clear_command CLEAR
166 %type <cmd> verify_command VERIFY
167 %type <cmd> terminator
168
169 %%
943 {
944 if (($$ = alloc_cmd()) == NULL)
945 YYERROR;
946 cmd = $$;
947 $$->cmd_handler = &verify_func;
948 $$->cmd_argc = 1;
949 $$->cmd_argv[0] = claim_token($2);
950 $$->cmd_argv[1] = NULL;
951 }
952
953 resource_type: NET { $$ = RT_NET; }
954 | FS { $$ = RT_FS; }
955 | DEVICE { $$ = RT_DEVICE; }
956 | RCTL { $$ = RT_RCTL; }
957 | ATTR { $$ = RT_ATTR; }
958 | DATASET { $$ = RT_DATASET; }
959 | PSET { $$ = RT_DCPU; }
960 | PCAP { $$ = RT_PCAP; }
961 | MCAP { $$ = RT_MCAP; }
962 | ADMIN { $$ = RT_ADMIN; }
963 | SECFLAGS { $$ = RT_SECFLAGS; }
964
965 property_name: SPECIAL { $$ = PT_SPECIAL; }
966 | RAW { $$ = PT_RAW; }
967 | DIR { $$ = PT_DIR; }
968 | TYPE { $$ = PT_TYPE; }
969 | OPTIONS { $$ = PT_OPTIONS; }
970 | ZONENAME { $$ = PT_ZONENAME; }
971 | ZONEPATH { $$ = PT_ZONEPATH; }
972 | AUTOBOOT { $$ = PT_AUTOBOOT; }
973 | IPTYPE { $$ = PT_IPTYPE; }
974 | POOL { $$ = PT_POOL; }
975 | LIMITPRIV { $$ = PT_LIMITPRIV; }
976 | BOOTARGS { $$ = PT_BOOTARGS; }
977 | ADDRESS { $$ = PT_ADDRESS; }
978 | ALLOWED_ADDRESS { $$ = PT_ALLOWED_ADDRESS; }
979 | PHYSICAL { $$ = PT_PHYSICAL; }
980 | DEFROUTER { $$ = PT_DEFROUTER; }
981 | NAME { $$ = PT_NAME; }
982 | VALUE { $$ = PT_VALUE; }
983 | MATCH { $$ = PT_MATCH; }
984 | PRIV { $$ = PT_PRIV; }
985 | LIMIT { $$ = PT_LIMIT; }
986 | ACTION { $$ = PT_ACTION; }
987 | BRAND { $$ = PT_BRAND; }
988 | NCPUS { $$ = PT_NCPUS; }
989 | LOCKED { $$ = PT_LOCKED; }
990 | SWAP { $$ = PT_SWAP; }
991 | IMPORTANCE { $$ = PT_IMPORTANCE; }
992 | SHARES { $$ = PT_SHARES; }
993 | MAXLWPS { $$ = PT_MAXLWPS; }
994 | MAXPROCS { $$ = PT_MAXPROCS; }
995 | MAXSHMMEM { $$ = PT_MAXSHMMEM; }
996 | MAXSHMIDS { $$ = PT_MAXSHMIDS; }
997 | MAXMSGIDS { $$ = PT_MAXMSGIDS; }
998 | MAXSEMIDS { $$ = PT_MAXSEMIDS; }
999 | SCHED { $$ = PT_SCHED; }
1000 | HOSTID { $$ = PT_HOSTID; }
1001 | USER { $$ = PT_USER; }
1002 | AUTHS { $$ = PT_AUTHS; }
1003 | FS_ALLOWED { $$ = PT_FS_ALLOWED; }
1004 | DEFAULT { $$ = PT_DEFAULT; }
1005 | UPPER { $$ = PT_UPPER; }
1006 | LOWER { $$ = PT_LOWER; }
1007
1008 /*
1009 * The grammar builds data structures from the bottom up. Thus various
1010 * strings are lexed into TOKENs or commands or resource or property values.
1011 * Below is where the resource and property values are built up into more
1012 * complex data structures.
1013 *
1014 * There are three kinds of properties: simple (single valued), complex
1015 * (one or more name=value pairs) and list (concatenation of one or more
1016 * simple or complex properties).
1017 *
1018 * So the property structure has a type which is one of these, and the
1019 * corresponding _simple, _complex or _list is set to the corresponding
1020 * lower-level data structure.
1021 */
1022
1023 property_value: simple_prop_val
1024 {
1025 property[num_prop_vals].pv_type = PROP_VAL_SIMPLE;
1026 property[num_prop_vals].pv_simple = $1;
|