5 * The contents of this file are subject to the terms of the
6 * Common Development and Distribution License (the "License").
7 * You may not use this file except in compliance with the License.
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
21 */
22
23 /*
24 * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
25 * Copyright 2013, Joyent Inc. All rights reserved.
26 */
27
28 /*
29 * This file defines zonecfg(1M)'s grammar.
30 *
31 * Reduction rules that consume TOKENs must invoke claim_token() immediately
32 * before freeing the TOKENs or adding them to data structures (e.g., cmd) that
33 * will be cleaned up when the parser finishes or encounters errors.
34 */
35
36 #include <stdio.h>
37 #include <strings.h>
38
39 #include "zonecfg.h"
40
41 static cmd_t *cmd = NULL; /* Command being processed */
42 static complex_property_ptr_t complex = NULL;
43 static list_property_ptr_t new_list = NULL, tmp_list, last,
44 list[MAX_EQ_PROP_PAIRS];
45 static property_value_t property[MAX_EQ_PROP_PAIRS];
120 %}
121
122 %union {
123 int ival;
124 char *strval;
125 cmd_t *cmd;
126 complex_property_ptr_t complex;
127 list_property_ptr_t list;
128 }
129
130 %start commands
131
132 %token HELP CREATE EXPORT ADD DELETE REMOVE SELECT SET INFO CANCEL END VERIFY
133 %token COMMIT REVERT EXIT SEMICOLON TOKEN ZONENAME ZONEPATH AUTOBOOT POOL NET
134 %token FS ATTR DEVICE RCTL SPECIAL RAW DIR OPTIONS TYPE ADDRESS PHYSICAL
135 %token IPTYPE HOSTID FS_ALLOWED ALLOWED_ADDRESS
136 %token NAME MATCH PRIV LIMIT ACTION VALUE EQUAL OPEN_SQ_BRACKET CLOSE_SQ_BRACKET
137 %token OPEN_PAREN CLOSE_PAREN COMMA DATASET LIMITPRIV BOOTARGS BRAND PSET PCAP
138 %token MCAP NCPUS IMPORTANCE SHARES MAXLWPS MAXSHMMEM MAXSHMIDS MAXMSGIDS
139 %token MAXSEMIDS LOCKED SWAP SCHED CLEAR DEFROUTER ADMIN USER AUTHS MAXPROCS
140 %token ZFSPRI MAC VLANID GNIC NPROP UUID
141
142 %type <strval> TOKEN EQUAL OPEN_SQ_BRACKET CLOSE_SQ_BRACKET
143 property_value OPEN_PAREN CLOSE_PAREN COMMA simple_prop_val
144 %type <complex> complex_piece complex_prop_val
145 %type <ival> resource_type NET FS DEVICE RCTL ATTR DATASET PSET PCAP MCAP
146 ADMIN
147 %type <ival> property_name SPECIAL RAW DIR OPTIONS TYPE ADDRESS PHYSICAL NAME
148 MATCH ZONENAME ZONEPATH AUTOBOOT POOL LIMITPRIV BOOTARGS VALUE PRIV LIMIT
149 ACTION BRAND SCHED IPTYPE DEFROUTER HOSTID USER AUTHS FS_ALLOWED
150 ALLOWED_ADDRESS MAC VLANID GNIC NPROP UUID
151 %type <cmd> command
152 %type <cmd> add_command ADD
153 %type <cmd> cancel_command CANCEL
154 %type <cmd> commit_command COMMIT
155 %type <cmd> create_command CREATE
156 %type <cmd> delete_command DELETE
157 %type <cmd> end_command END
158 %type <cmd> exit_command EXIT
159 %type <cmd> export_command EXPORT
160 %type <cmd> help_command HELP
161 %type <cmd> info_command INFO
162 %type <cmd> remove_command REMOVE
163 %type <cmd> revert_command REVERT
164 %type <cmd> select_command SELECT
165 %type <cmd> set_command SET
166 %type <cmd> clear_command CLEAR
167 %type <cmd> verify_command VERIFY
168 %type <cmd> terminator
169
170 %%
635 $$->cmd_prop_nv_pairs = 0;
636 }
637 | INFO HOSTID
638 {
639 if (($$ = alloc_cmd()) == NULL)
640 YYERROR;
641 cmd = $$;
642 $$->cmd_handler = &info_func;
643 $$->cmd_res_type = RT_HOSTID;
644 $$->cmd_prop_nv_pairs = 0;
645 }
646 | INFO FS_ALLOWED
647 {
648 if (($$ = alloc_cmd()) == NULL)
649 YYERROR;
650 cmd = $$;
651 $$->cmd_handler = &info_func;
652 $$->cmd_res_type = RT_FS_ALLOWED;
653 $$->cmd_prop_nv_pairs = 0;
654 }
655 | INFO UUID
656 {
657 if (($$ = alloc_cmd()) == NULL)
658 YYERROR;
659 cmd = $$;
660 $$->cmd_handler = &info_func;
661 $$->cmd_res_type = RT_UUID;
662 $$->cmd_prop_nv_pairs = 0;
663 }
664 | INFO ZFSPRI
665 {
666 if (($$ = alloc_cmd()) == NULL)
667 YYERROR;
668 cmd = $$;
669 $$->cmd_handler = &info_func;
670 $$->cmd_res_type = RT_ZFSPRI;
671 $$->cmd_prop_nv_pairs = 0;
672 }
673 | INFO resource_type property_name EQUAL property_value
674 {
675 if (($$ = alloc_cmd()) == NULL)
676 YYERROR;
677 cmd = $$;
678 $$->cmd_handler = &info_func;
679 $$->cmd_res_type = $2;
680 $$->cmd_prop_nv_pairs = 1;
681 $$->cmd_prop_name[0] = $3;
682 $$->cmd_property_ptr[0] = &property[0];
683 }
684 | INFO resource_type property_name EQUAL property_value property_name EQUAL property_value
685 {
686 if (($$ = alloc_cmd()) == NULL)
687 YYERROR;
688 cmd = $$;
689 $$->cmd_handler = &info_func;
690 $$->cmd_res_type = $2;
691 $$->cmd_prop_nv_pairs = 2;
692 $$->cmd_prop_name[0] = $3;
737 {
738 if (($$ = alloc_cmd()) == NULL)
739 YYERROR;
740 cmd = $$;
741 $$->cmd_handler = &remove_func;
742 $$->cmd_res_type = $3;
743 $$->cmd_argc = 1;
744 $$->cmd_argv[0] = claim_token($2);
745 $$->cmd_argv[1] = NULL;
746 }
747 | REMOVE property_name property_value
748 {
749 if (($$ = alloc_cmd()) == NULL)
750 YYERROR;
751 cmd = $$;
752 $$->cmd_handler = &remove_func;
753 $$->cmd_prop_nv_pairs = 1;
754 $$->cmd_prop_name[0] = $2;
755 $$->cmd_property_ptr[0] = &property[0];
756 }
757 | REMOVE TOKEN property_name property_value
758 {
759 if (($$ = alloc_cmd()) == NULL)
760 YYERROR;
761 cmd = $$;
762 $$->cmd_handler = &remove_func;
763 $$->cmd_argc = 1;
764 $$->cmd_argv[0] = claim_token($2);
765 $$->cmd_argv[1] = NULL;
766 $$->cmd_prop_nv_pairs = 1;
767 $$->cmd_prop_name[0] = $3;
768 $$->cmd_property_ptr[0] = &property[0];
769 }
770 | REMOVE resource_type property_name EQUAL property_value
771 {
772 if (($$ = alloc_cmd()) == NULL)
773 YYERROR;
774 cmd = $$;
775 $$->cmd_handler = &remove_func;
776 $$->cmd_res_type = $2;
777 $$->cmd_prop_nv_pairs = 1;
778 $$->cmd_prop_name[0] = $3;
779 $$->cmd_property_ptr[0] = &property[0];
780 }
781 | REMOVE TOKEN resource_type property_name EQUAL property_value
782 {
783 if (($$ = alloc_cmd()) == NULL)
784 YYERROR;
785 cmd = $$;
786 $$->cmd_handler = &remove_func;
787 $$->cmd_res_type = $3;
788 $$->cmd_argc = 1;
789 $$->cmd_argv[0] = claim_token($2);
790 $$->cmd_argv[1] = NULL;
791 $$->cmd_prop_nv_pairs = 1;
792 $$->cmd_prop_name[0] = $4;
793 $$->cmd_property_ptr[0] = &property[0];
794 }
795 | REMOVE resource_type property_name EQUAL property_value property_name EQUAL property_value
796 {
797 if (($$ = alloc_cmd()) == NULL)
798 YYERROR;
799 cmd = $$;
800 $$->cmd_handler = &remove_func;
801 $$->cmd_res_type = $2;
802 $$->cmd_prop_nv_pairs = 2;
803 $$->cmd_prop_name[0] = $3;
804 $$->cmd_property_ptr[0] = &property[0];
805 $$->cmd_prop_name[1] = $6;
806 $$->cmd_property_ptr[1] = &property[1];
807 }
808 | REMOVE TOKEN resource_type property_name EQUAL property_value property_name EQUAL property_value
809 {
810 if (($$ = alloc_cmd()) == NULL)
811 YYERROR;
812 cmd = $$;
813 $$->cmd_handler = &remove_func;
814 $$->cmd_res_type = $3;
815 $$->cmd_argc = 1;
816 $$->cmd_argv[0] = claim_token($2);
817 $$->cmd_argv[1] = NULL;
818 $$->cmd_prop_nv_pairs = 2;
819 $$->cmd_prop_name[0] = $4;
820 $$->cmd_property_ptr[0] = &property[0];
821 $$->cmd_prop_name[1] = $7;
822 $$->cmd_property_ptr[1] = &property[1];
823 }
824 | REMOVE resource_type property_name EQUAL property_value property_name EQUAL property_value property_name EQUAL property_value
825 {
826 if (($$ = alloc_cmd()) == NULL)
827 YYERROR;
828 cmd = $$;
829 $$->cmd_handler = &remove_func;
830 $$->cmd_res_type = $2;
831 $$->cmd_prop_nv_pairs = 3;
832 $$->cmd_prop_name[0] = $3;
833 $$->cmd_property_ptr[0] = &property[0];
834 $$->cmd_prop_name[1] = $6;
835 $$->cmd_property_ptr[1] = &property[1];
836 $$->cmd_prop_name[2] = $9;
837 $$->cmd_property_ptr[2] = &property[2];
838 }
839 | REMOVE TOKEN resource_type property_name EQUAL property_value property_name EQUAL property_value property_name EQUAL property_value
840 {
841 if (($$ = alloc_cmd()) == NULL)
842 YYERROR;
843 cmd = $$;
844 $$->cmd_handler = &remove_func;
845 $$->cmd_res_type = $3;
846 $$->cmd_argc = 1;
847 $$->cmd_argv[0] = claim_token($2);
848 $$->cmd_argv[1] = NULL;
849 $$->cmd_prop_nv_pairs = 3;
850 $$->cmd_prop_name[0] = $4;
851 $$->cmd_property_ptr[0] = &property[0];
852 $$->cmd_prop_name[1] = $7;
853 $$->cmd_property_ptr[1] = &property[1];
854 $$->cmd_prop_name[2] = $10;
855 $$->cmd_property_ptr[2] = &property[2];
856 }
857
858 revert_command: REVERT
859 {
860 if (($$ = alloc_cmd()) == NULL)
861 YYERROR;
862 cmd = $$;
863 $$->cmd_handler = &revert_func;
864 $$->cmd_argc = 0;
865 $$->cmd_argv[0] = NULL;
866 }
867 | REVERT TOKEN
868 {
869 if (($$ = alloc_cmd()) == NULL)
870 YYERROR;
871 cmd = $$;
872 $$->cmd_handler = &revert_func;
873 $$->cmd_argc = 1;
874 $$->cmd_argv[0] = claim_token($2);
875 $$->cmd_argv[1] = NULL;
876 }
1067 | PRIV { $$ = PT_PRIV; }
1068 | LIMIT { $$ = PT_LIMIT; }
1069 | ACTION { $$ = PT_ACTION; }
1070 | BRAND { $$ = PT_BRAND; }
1071 | NCPUS { $$ = PT_NCPUS; }
1072 | LOCKED { $$ = PT_LOCKED; }
1073 | SWAP { $$ = PT_SWAP; }
1074 | IMPORTANCE { $$ = PT_IMPORTANCE; }
1075 | SHARES { $$ = PT_SHARES; }
1076 | MAXLWPS { $$ = PT_MAXLWPS; }
1077 | MAXPROCS { $$ = PT_MAXPROCS; }
1078 | MAXSHMMEM { $$ = PT_MAXSHMMEM; }
1079 | MAXSHMIDS { $$ = PT_MAXSHMIDS; }
1080 | MAXMSGIDS { $$ = PT_MAXMSGIDS; }
1081 | MAXSEMIDS { $$ = PT_MAXSEMIDS; }
1082 | SCHED { $$ = PT_SCHED; }
1083 | HOSTID { $$ = PT_HOSTID; }
1084 | USER { $$ = PT_USER; }
1085 | AUTHS { $$ = PT_AUTHS; }
1086 | FS_ALLOWED { $$ = PT_FS_ALLOWED; }
1087 | UUID { $$ = PT_UUID; }
1088 | ZFSPRI { $$ = PT_ZFSPRI; }
1089
1090 /*
1091 * The grammar builds data structures from the bottom up. Thus various
1092 * strings are lexed into TOKENs or commands or resource or property values.
1093 * Below is where the resource and property values are built up into more
1094 * complex data structures.
1095 *
1096 * There are three kinds of properties: simple (single valued), complex
1097 * (one or more name=value pairs) and list (concatenation of one or more
1098 * simple or complex properties).
1099 *
1100 * So the property structure has a type which is one of these, and the
1101 * corresponding _simple, _complex or _list is set to the corresponding
1102 * lower-level data structure.
1103 */
1104
1105 property_value: simple_prop_val
1106 {
1107 property[num_prop_vals].pv_type = PROP_VAL_SIMPLE;
1108 property[num_prop_vals].pv_simple = $1;
|
5 * The contents of this file are subject to the terms of the
6 * Common Development and Distribution License (the "License").
7 * You may not use this file except in compliance with the License.
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
21 */
22
23 /*
24 * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
25 */
26
27 /*
28 * This file defines zonecfg(1M)'s grammar.
29 *
30 * Reduction rules that consume TOKENs must invoke claim_token() immediately
31 * before freeing the TOKENs or adding them to data structures (e.g., cmd) that
32 * will be cleaned up when the parser finishes or encounters errors.
33 */
34
35 #include <stdio.h>
36 #include <strings.h>
37
38 #include "zonecfg.h"
39
40 static cmd_t *cmd = NULL; /* Command being processed */
41 static complex_property_ptr_t complex = NULL;
42 static list_property_ptr_t new_list = NULL, tmp_list, last,
43 list[MAX_EQ_PROP_PAIRS];
44 static property_value_t property[MAX_EQ_PROP_PAIRS];
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 %token ZFSPRI MAC VLANID GNIC NPROP
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
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 MAC VLANID GNIC NPROP
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 %%
634 $$->cmd_prop_nv_pairs = 0;
635 }
636 | INFO HOSTID
637 {
638 if (($$ = alloc_cmd()) == NULL)
639 YYERROR;
640 cmd = $$;
641 $$->cmd_handler = &info_func;
642 $$->cmd_res_type = RT_HOSTID;
643 $$->cmd_prop_nv_pairs = 0;
644 }
645 | INFO FS_ALLOWED
646 {
647 if (($$ = alloc_cmd()) == NULL)
648 YYERROR;
649 cmd = $$;
650 $$->cmd_handler = &info_func;
651 $$->cmd_res_type = RT_FS_ALLOWED;
652 $$->cmd_prop_nv_pairs = 0;
653 }
654 | INFO resource_type property_name EQUAL property_value
655 {
656 if (($$ = alloc_cmd()) == NULL)
657 YYERROR;
658 cmd = $$;
659 $$->cmd_handler = &info_func;
660 $$->cmd_res_type = $2;
661 $$->cmd_prop_nv_pairs = 1;
662 $$->cmd_prop_name[0] = $3;
663 $$->cmd_property_ptr[0] = &property[0];
664 }
665 | INFO resource_type property_name EQUAL property_value property_name EQUAL property_value
666 {
667 if (($$ = alloc_cmd()) == NULL)
668 YYERROR;
669 cmd = $$;
670 $$->cmd_handler = &info_func;
671 $$->cmd_res_type = $2;
672 $$->cmd_prop_nv_pairs = 2;
673 $$->cmd_prop_name[0] = $3;
718 {
719 if (($$ = alloc_cmd()) == NULL)
720 YYERROR;
721 cmd = $$;
722 $$->cmd_handler = &remove_func;
723 $$->cmd_res_type = $3;
724 $$->cmd_argc = 1;
725 $$->cmd_argv[0] = claim_token($2);
726 $$->cmd_argv[1] = NULL;
727 }
728 | REMOVE property_name property_value
729 {
730 if (($$ = alloc_cmd()) == NULL)
731 YYERROR;
732 cmd = $$;
733 $$->cmd_handler = &remove_func;
734 $$->cmd_prop_nv_pairs = 1;
735 $$->cmd_prop_name[0] = $2;
736 $$->cmd_property_ptr[0] = &property[0];
737 }
738 | REMOVE resource_type property_name EQUAL property_value
739 {
740 if (($$ = alloc_cmd()) == NULL)
741 YYERROR;
742 cmd = $$;
743 $$->cmd_handler = &remove_func;
744 $$->cmd_res_type = $2;
745 $$->cmd_prop_nv_pairs = 1;
746 $$->cmd_prop_name[0] = $3;
747 $$->cmd_property_ptr[0] = &property[0];
748 }
749 | REMOVE resource_type property_name EQUAL property_value property_name EQUAL property_value
750 {
751 if (($$ = alloc_cmd()) == NULL)
752 YYERROR;
753 cmd = $$;
754 $$->cmd_handler = &remove_func;
755 $$->cmd_res_type = $2;
756 $$->cmd_prop_nv_pairs = 2;
757 $$->cmd_prop_name[0] = $3;
758 $$->cmd_property_ptr[0] = &property[0];
759 $$->cmd_prop_name[1] = $6;
760 $$->cmd_property_ptr[1] = &property[1];
761 }
762 | REMOVE resource_type property_name EQUAL property_value property_name EQUAL property_value property_name EQUAL property_value
763 {
764 if (($$ = alloc_cmd()) == NULL)
765 YYERROR;
766 cmd = $$;
767 $$->cmd_handler = &remove_func;
768 $$->cmd_res_type = $2;
769 $$->cmd_prop_nv_pairs = 3;
770 $$->cmd_prop_name[0] = $3;
771 $$->cmd_property_ptr[0] = &property[0];
772 $$->cmd_prop_name[1] = $6;
773 $$->cmd_property_ptr[1] = &property[1];
774 $$->cmd_prop_name[2] = $9;
775 $$->cmd_property_ptr[2] = &property[2];
776 }
777
778 revert_command: REVERT
779 {
780 if (($$ = alloc_cmd()) == NULL)
781 YYERROR;
782 cmd = $$;
783 $$->cmd_handler = &revert_func;
784 $$->cmd_argc = 0;
785 $$->cmd_argv[0] = NULL;
786 }
787 | REVERT TOKEN
788 {
789 if (($$ = alloc_cmd()) == NULL)
790 YYERROR;
791 cmd = $$;
792 $$->cmd_handler = &revert_func;
793 $$->cmd_argc = 1;
794 $$->cmd_argv[0] = claim_token($2);
795 $$->cmd_argv[1] = NULL;
796 }
987 | PRIV { $$ = PT_PRIV; }
988 | LIMIT { $$ = PT_LIMIT; }
989 | ACTION { $$ = PT_ACTION; }
990 | BRAND { $$ = PT_BRAND; }
991 | NCPUS { $$ = PT_NCPUS; }
992 | LOCKED { $$ = PT_LOCKED; }
993 | SWAP { $$ = PT_SWAP; }
994 | IMPORTANCE { $$ = PT_IMPORTANCE; }
995 | SHARES { $$ = PT_SHARES; }
996 | MAXLWPS { $$ = PT_MAXLWPS; }
997 | MAXPROCS { $$ = PT_MAXPROCS; }
998 | MAXSHMMEM { $$ = PT_MAXSHMMEM; }
999 | MAXSHMIDS { $$ = PT_MAXSHMIDS; }
1000 | MAXMSGIDS { $$ = PT_MAXMSGIDS; }
1001 | MAXSEMIDS { $$ = PT_MAXSEMIDS; }
1002 | SCHED { $$ = PT_SCHED; }
1003 | HOSTID { $$ = PT_HOSTID; }
1004 | USER { $$ = PT_USER; }
1005 | AUTHS { $$ = PT_AUTHS; }
1006 | FS_ALLOWED { $$ = PT_FS_ALLOWED; }
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;
|