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