4  * The contents of this file are subject to the terms of the
   5  * Common Development and Distribution License (the "License").
   6  * You may not use this file except in compliance with the License.
   7  *
   8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
   9  * or http://www.opensolaris.org/os/licensing.
  10  * See the License for the specific language governing permissions
  11  * and limitations under the License.
  12  *
  13  * When distributing Covered Code, include this CDDL HEADER in each
  14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15  * If applicable, add the following below this CDDL HEADER, with the
  16  * fields enclosed by brackets "[]" replaced with your own identifying
  17  * information: Portions Copyright [yyyy] [name of copyright owner]
  18  *
  19  * CDDL HEADER END
  20  */
  21 
  22 /*
  23  * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  24  * Copyright (c) 2011, Joyent Inc. All rights reserved.
  25  */
  26 
  27 #ifndef _ZONECFG_H
  28 #define _ZONECFG_H
  29 
  30 /*
  31  * header file for zonecfg command
  32  */
  33 
  34 #ifdef __cplusplus
  35 extern "C" {
  36 #endif
  37 
  38 #include <unistd.h>
  39 
  40 #define Z_ERR           1
  41 #define Z_USAGE         2
  42 #define Z_REPEAT        3
  43 
  44 #define CMD_ADD         0
 
  74 #define RT_ATTR         9
  75 #define RT_DATASET      10
  76 #define RT_LIMITPRIV    11      /* really a property, but for info ... */
  77 #define RT_BOOTARGS     12      /* really a property, but for info ... */
  78 #define RT_BRAND        13      /* really a property, but for info ... */
  79 #define RT_DCPU         14
  80 #define RT_MCAP         15
  81 #define RT_MAXLWPS      16      /* really a rctl alias property, but for info */
  82 #define RT_MAXSHMMEM    17      /* really a rctl alias property, but for info */
  83 #define RT_MAXSHMIDS    18      /* really a rctl alias property, but for info */
  84 #define RT_MAXMSGIDS    19      /* really a rctl alias property, but for info */
  85 #define RT_MAXSEMIDS    20      /* really a rctl alias property, but for info */
  86 #define RT_SHARES       21      /* really a rctl alias property, but for info */
  87 #define RT_SCHED        22      /* really a property, but for info ... */
  88 #define RT_IPTYPE       23      /* really a property, but for info ... */
  89 #define RT_PCAP         24
  90 #define RT_HOSTID       25      /* really a property, but for info ... */
  91 #define RT_ADMIN        26
  92 #define RT_FS_ALLOWED   27
  93 #define RT_MAXPROCS     28      /* really a rctl alias property, but for info */
  94 #define RT_ZFSPRI       29      /* really a rctl alias property, but for info */
  95 #define RT_UUID         30      /* really a property, but for info */
  96 
  97 #define RT_MIN          RT_UNKNOWN
  98 #define RT_MAX          RT_UUID
  99 
 100 /* property types: increment PT_MAX when expanding this list */
 101 #define PT_UNKNOWN      0
 102 #define PT_ZONENAME     1
 103 #define PT_ZONEPATH     2
 104 #define PT_AUTOBOOT     3
 105 #define PT_POOL         4
 106 #define PT_DIR          5
 107 #define PT_SPECIAL      6
 108 #define PT_TYPE         7
 109 #define PT_OPTIONS      8
 110 #define PT_ADDRESS      9
 111 #define PT_PHYSICAL     10
 112 #define PT_NAME         11
 113 #define PT_VALUE        12
 114 #define PT_MATCH        13
 115 #define PT_PRIV         14
 116 #define PT_LIMIT        15
 117 #define PT_ACTION       16
 118 #define PT_RAW          17
 
 
 128 #define PT_MAXSHMMEM    27
 129 #define PT_MAXSHMIDS    28
 130 #define PT_MAXMSGIDS    29
 131 #define PT_MAXSEMIDS    30
 132 #define PT_MAXLOCKEDMEM 31
 133 #define PT_MAXSWAP      32
 134 #define PT_SCHED        33
 135 #define PT_IPTYPE       34
 136 #define PT_DEFROUTER    35
 137 #define PT_HOSTID       36
 138 #define PT_USER         37
 139 #define PT_AUTHS        38
 140 #define PT_FS_ALLOWED   39
 141 #define PT_MAXPROCS     40
 142 #define PT_ALLOWED_ADDRESS      41
 143 #define PT_ZFSPRI       42
 144 #define PT_MAC          43
 145 #define PT_VLANID       44
 146 #define PT_GNIC         45
 147 #define PT_NPROP        46
 148 #define PT_UUID         47
 149 
 150 #define PT_MIN          PT_UNKNOWN
 151 #define PT_MAX          PT_UUID
 152 
 153 #define MAX_EQ_PROP_PAIRS       3
 154 
 155 #define PROP_VAL_SIMPLE         0
 156 #define PROP_VAL_COMPLEX        1
 157 #define PROP_VAL_LIST           2
 158 
 159 #define PROP_VAL_MIN            PROP_VAL_SIMPLE
 160 #define PROP_VAL_MAX            PROP_VAL_LIST
 161 
 162 /*
 163  * If any subcommand is ever modified to take more than three arguments,
 164  * this will need to be incremented.
 165  */
 166 #define MAX_SUBCMD_ARGS         3
 167 
 168 typedef struct complex_property {
 169         int     cp_type;        /* from the PT_* list above */
 170         char    *cp_value;
 171         struct complex_property *cp_next;
 
 | 
 
 
   4  * The contents of this file are subject to the terms of the
   5  * Common Development and Distribution License (the "License").
   6  * You may not use this file except in compliance with the License.
   7  *
   8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
   9  * or http://www.opensolaris.org/os/licensing.
  10  * See the License for the specific language governing permissions
  11  * and limitations under the License.
  12  *
  13  * When distributing Covered Code, include this CDDL HEADER in each
  14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15  * If applicable, add the following below this CDDL HEADER, with the
  16  * fields enclosed by brackets "[]" replaced with your own identifying
  17  * information: Portions Copyright [yyyy] [name of copyright owner]
  18  *
  19  * CDDL HEADER END
  20  */
  21 
  22 /*
  23  * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  24  */
  25 
  26 #ifndef _ZONECFG_H
  27 #define _ZONECFG_H
  28 
  29 /*
  30  * header file for zonecfg command
  31  */
  32 
  33 #ifdef __cplusplus
  34 extern "C" {
  35 #endif
  36 
  37 #include <unistd.h>
  38 
  39 #define Z_ERR           1
  40 #define Z_USAGE         2
  41 #define Z_REPEAT        3
  42 
  43 #define CMD_ADD         0
 
  73 #define RT_ATTR         9
  74 #define RT_DATASET      10
  75 #define RT_LIMITPRIV    11      /* really a property, but for info ... */
  76 #define RT_BOOTARGS     12      /* really a property, but for info ... */
  77 #define RT_BRAND        13      /* really a property, but for info ... */
  78 #define RT_DCPU         14
  79 #define RT_MCAP         15
  80 #define RT_MAXLWPS      16      /* really a rctl alias property, but for info */
  81 #define RT_MAXSHMMEM    17      /* really a rctl alias property, but for info */
  82 #define RT_MAXSHMIDS    18      /* really a rctl alias property, but for info */
  83 #define RT_MAXMSGIDS    19      /* really a rctl alias property, but for info */
  84 #define RT_MAXSEMIDS    20      /* really a rctl alias property, but for info */
  85 #define RT_SHARES       21      /* really a rctl alias property, but for info */
  86 #define RT_SCHED        22      /* really a property, but for info ... */
  87 #define RT_IPTYPE       23      /* really a property, but for info ... */
  88 #define RT_PCAP         24
  89 #define RT_HOSTID       25      /* really a property, but for info ... */
  90 #define RT_ADMIN        26
  91 #define RT_FS_ALLOWED   27
  92 #define RT_MAXPROCS     28      /* really a rctl alias property, but for info */
  93 
  94 #define RT_MIN          RT_UNKNOWN
  95 #define RT_MAX          RT_MAXPROCS
  96 
  97 /* property types: increment PT_MAX when expanding this list */
  98 #define PT_UNKNOWN      0
  99 #define PT_ZONENAME     1
 100 #define PT_ZONEPATH     2
 101 #define PT_AUTOBOOT     3
 102 #define PT_POOL         4
 103 #define PT_DIR          5
 104 #define PT_SPECIAL      6
 105 #define PT_TYPE         7
 106 #define PT_OPTIONS      8
 107 #define PT_ADDRESS      9
 108 #define PT_PHYSICAL     10
 109 #define PT_NAME         11
 110 #define PT_VALUE        12
 111 #define PT_MATCH        13
 112 #define PT_PRIV         14
 113 #define PT_LIMIT        15
 114 #define PT_ACTION       16
 115 #define PT_RAW          17
 
 
 125 #define PT_MAXSHMMEM    27
 126 #define PT_MAXSHMIDS    28
 127 #define PT_MAXMSGIDS    29
 128 #define PT_MAXSEMIDS    30
 129 #define PT_MAXLOCKEDMEM 31
 130 #define PT_MAXSWAP      32
 131 #define PT_SCHED        33
 132 #define PT_IPTYPE       34
 133 #define PT_DEFROUTER    35
 134 #define PT_HOSTID       36
 135 #define PT_USER         37
 136 #define PT_AUTHS        38
 137 #define PT_FS_ALLOWED   39
 138 #define PT_MAXPROCS     40
 139 #define PT_ALLOWED_ADDRESS      41
 140 #define PT_ZFSPRI       42
 141 #define PT_MAC          43
 142 #define PT_VLANID       44
 143 #define PT_GNIC         45
 144 #define PT_NPROP        46
 145 
 146 #define PT_MIN          PT_UNKNOWN
 147 #define PT_MAX          PT_NPROP
 148 
 149 #define MAX_EQ_PROP_PAIRS       3
 150 
 151 #define PROP_VAL_SIMPLE         0
 152 #define PROP_VAL_COMPLEX        1
 153 #define PROP_VAL_LIST           2
 154 
 155 #define PROP_VAL_MIN            PROP_VAL_SIMPLE
 156 #define PROP_VAL_MAX            PROP_VAL_LIST
 157 
 158 /*
 159  * If any subcommand is ever modified to take more than three arguments,
 160  * this will need to be incremented.
 161  */
 162 #define MAX_SUBCMD_ARGS         3
 163 
 164 typedef struct complex_property {
 165         int     cp_type;        /* from the PT_* list above */
 166         char    *cp_value;
 167         struct complex_property *cp_next;
 
 |