Print this page
    
    
      
        | Split | 
	Close | 
      
      | Expand all | 
      | Collapse all | 
    
    
          --- old/usr/src/cmd/zonecfg/zonecfg.h
          +++ new/usr/src/cmd/zonecfg/zonecfg.h
   1    1  /*
   2    2   * CDDL HEADER START
   3    3   *
   4    4   * The contents of this file are subject to the terms of the
   5    5   * Common Development and Distribution License (the "License").
   6    6   * You may not use this file except in compliance with the License.
   7    7   *
   8    8   * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
   9    9   * or http://www.opensolaris.org/os/licensing.
  10   10   * See the License for the specific language governing permissions
  11   11   * and limitations under the License.
  12   12   *
  13   13   * When distributing Covered Code, include this CDDL HEADER in each
  
    | 
      ↓ open down ↓ | 
    13 lines elided | 
    
      ↑ open up ↑ | 
  
  14   14   * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15   15   * If applicable, add the following below this CDDL HEADER, with the
  16   16   * fields enclosed by brackets "[]" replaced with your own identifying
  17   17   * information: Portions Copyright [yyyy] [name of copyright owner]
  18   18   *
  19   19   * CDDL HEADER END
  20   20   */
  21   21  
  22   22  /*
  23   23   * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  24      - * Copyright (c) 2011, Joyent Inc. All rights reserved.
  25   24   */
  26   25  
  27   26  #ifndef _ZONECFG_H
  28   27  #define _ZONECFG_H
  29   28  
  30   29  /*
  31   30   * header file for zonecfg command
  32   31   */
  33   32  
  34   33  #ifdef __cplusplus
  35   34  extern "C" {
  36   35  #endif
  37   36  
  38   37  #include <unistd.h>
  39   38  
  40   39  #define Z_ERR           1
  41   40  #define Z_USAGE         2
  42   41  #define Z_REPEAT        3
  43   42  
  44   43  #define CMD_ADD         0
  45   44  #define CMD_CANCEL      1
  46   45  #define CMD_CLEAR       2
  47   46  #define CMD_COMMIT      3
  48   47  #define CMD_CREATE      4
  49   48  #define CMD_DELETE      5
  50   49  #define CMD_END         6
  51   50  #define CMD_EXIT        7
  52   51  #define CMD_EXPORT      8
  53   52  #define CMD_HELP        9
  54   53  #define CMD_INFO        10
  55   54  #define CMD_REMOVE      11
  56   55  #define CMD_REVERT      12
  57   56  #define CMD_SELECT      13
  58   57  #define CMD_SET         14
  59   58  #define CMD_VERIFY      15
  60   59  
  61   60  #define CMD_MIN         CMD_ADD
  62   61  #define CMD_MAX         CMD_VERIFY
  63   62  
  64   63  /* resource types: increment RT_MAX when expanding this list */
  65   64  #define RT_UNKNOWN      0
  66   65  #define RT_ZONENAME     1       /* really a property, but for info ... */
  67   66  #define RT_ZONEPATH     2       /* really a property, but for info ... */
  68   67  #define RT_AUTOBOOT     3       /* really a property, but for info ... */
  69   68  #define RT_POOL         4       /* really a property, but for info ... */
  70   69  #define RT_FS           5
  71   70  #define RT_NET          6
  72   71  #define RT_DEVICE       7
  73   72  #define RT_RCTL         8
  74   73  #define RT_ATTR         9
  75   74  #define RT_DATASET      10
  76   75  #define RT_LIMITPRIV    11      /* really a property, but for info ... */
  77   76  #define RT_BOOTARGS     12      /* really a property, but for info ... */
  78   77  #define RT_BRAND        13      /* really a property, but for info ... */
  79   78  #define RT_DCPU         14
  80   79  #define RT_MCAP         15
  81   80  #define RT_MAXLWPS      16      /* really a rctl alias property, but for info */
  82   81  #define RT_MAXSHMMEM    17      /* really a rctl alias property, but for info */
  83   82  #define RT_MAXSHMIDS    18      /* really a rctl alias property, but for info */
  
    | 
      ↓ open down ↓ | 
    49 lines elided | 
    
      ↑ open up ↑ | 
  
  84   83  #define RT_MAXMSGIDS    19      /* really a rctl alias property, but for info */
  85   84  #define RT_MAXSEMIDS    20      /* really a rctl alias property, but for info */
  86   85  #define RT_SHARES       21      /* really a rctl alias property, but for info */
  87   86  #define RT_SCHED        22      /* really a property, but for info ... */
  88   87  #define RT_IPTYPE       23      /* really a property, but for info ... */
  89   88  #define RT_PCAP         24
  90   89  #define RT_HOSTID       25      /* really a property, but for info ... */
  91   90  #define RT_ADMIN        26
  92   91  #define RT_FS_ALLOWED   27
  93   92  #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   93  
  97   94  #define RT_MIN          RT_UNKNOWN
  98      -#define RT_MAX          RT_UUID
       95 +#define RT_MAX          RT_MAXPROCS
  99   96  
 100   97  /* property types: increment PT_MAX when expanding this list */
 101   98  #define PT_UNKNOWN      0
 102   99  #define PT_ZONENAME     1
 103  100  #define PT_ZONEPATH     2
 104  101  #define PT_AUTOBOOT     3
 105  102  #define PT_POOL         4
 106  103  #define PT_DIR          5
 107  104  #define PT_SPECIAL      6
 108  105  #define PT_TYPE         7
 109  106  #define PT_OPTIONS      8
 110  107  #define PT_ADDRESS      9
 111  108  #define PT_PHYSICAL     10
 112  109  #define PT_NAME         11
 113  110  #define PT_VALUE        12
 114  111  #define PT_MATCH        13
 115  112  #define PT_PRIV         14
 116  113  #define PT_LIMIT        15
 117  114  #define PT_ACTION       16
 118  115  #define PT_RAW          17
 119  116  #define PT_LIMITPRIV    18
 120  117  #define PT_BOOTARGS     19
 121  118  #define PT_BRAND        20
 122  119  #define PT_NCPUS        21
 123  120  #define PT_IMPORTANCE   22
 124  121  #define PT_SWAP         23
 125  122  #define PT_LOCKED       24
 126  123  #define PT_SHARES       25
 127  124  #define PT_MAXLWPS      26
 128  125  #define PT_MAXSHMMEM    27
 129  126  #define PT_MAXSHMIDS    28
 130  127  #define PT_MAXMSGIDS    29
 131  128  #define PT_MAXSEMIDS    30
 132  129  #define PT_MAXLOCKEDMEM 31
 133  130  #define PT_MAXSWAP      32
 134  131  #define PT_SCHED        33
 135  132  #define PT_IPTYPE       34
 136  133  #define PT_DEFROUTER    35
 137  134  #define PT_HOSTID       36
  
    | 
      ↓ open down ↓ | 
    29 lines elided | 
    
      ↑ open up ↑ | 
  
 138  135  #define PT_USER         37
 139  136  #define PT_AUTHS        38
 140  137  #define PT_FS_ALLOWED   39
 141  138  #define PT_MAXPROCS     40
 142  139  #define PT_ALLOWED_ADDRESS      41
 143  140  #define PT_ZFSPRI       42
 144  141  #define PT_MAC          43
 145  142  #define PT_VLANID       44
 146  143  #define PT_GNIC         45
 147  144  #define PT_NPROP        46
 148      -#define PT_UUID         47
 149  145  
 150  146  #define PT_MIN          PT_UNKNOWN
 151      -#define PT_MAX          PT_UUID
      147 +#define PT_MAX          PT_NPROP
 152  148  
 153  149  #define MAX_EQ_PROP_PAIRS       3
 154  150  
 155  151  #define PROP_VAL_SIMPLE         0
 156  152  #define PROP_VAL_COMPLEX        1
 157  153  #define PROP_VAL_LIST           2
 158  154  
 159  155  #define PROP_VAL_MIN            PROP_VAL_SIMPLE
 160  156  #define PROP_VAL_MAX            PROP_VAL_LIST
 161  157  
 162  158  /*
 163  159   * If any subcommand is ever modified to take more than three arguments,
 164  160   * this will need to be incremented.
 165  161   */
 166  162  #define MAX_SUBCMD_ARGS         3
 167  163  
 168  164  typedef struct complex_property {
 169  165          int     cp_type;        /* from the PT_* list above */
 170  166          char    *cp_value;
 171  167          struct complex_property *cp_next;
 172  168  } complex_property_t, *complex_property_ptr_t;
 173  169  
 174  170  typedef struct list_property {
 175  171          char    *lp_simple;
 176  172          complex_property_ptr_t  lp_complex;
 177  173          struct list_property    *lp_next;
 178  174  } list_property_t, *list_property_ptr_t;
 179  175  
 180  176  typedef struct property_value {
 181  177          int     pv_type;        /* from the PROP_VAL_* list above */
 182  178          char    *pv_simple;
 183  179          complex_property_ptr_t  pv_complex;
 184  180          list_property_ptr_t     pv_list;
 185  181  } property_value_t, *property_value_ptr_t;
 186  182  
 187  183  typedef struct cmd {
 188  184          char    *cmd_name;
 189  185          void    (*cmd_handler)(struct cmd *);
 190  186          int     cmd_res_type;
 191  187          int     cmd_prop_nv_pairs;
 192  188          int     cmd_prop_name[MAX_EQ_PROP_PAIRS];
 193  189          property_value_ptr_t    cmd_property_ptr[MAX_EQ_PROP_PAIRS];
 194  190          int     cmd_argc;
 195  191          char    *cmd_argv[MAX_SUBCMD_ARGS + 1];
 196  192  } cmd_t;
 197  193  
 198  194  #define HELP_USAGE      0x01
 199  195  #define HELP_SUBCMDS    0x02
 200  196  #define HELP_SYNTAX     0x04
 201  197  #define HELP_RESOURCES  0x08
 202  198  #define HELP_PROPS      0x10
 203  199  #define HELP_META       0x20
 204  200  #define HELP_NETADDR    0x40
 205  201  #define HELP_RES_SCOPE  0x80
 206  202  
 207  203  #define HELP_RES_PROPS  (HELP_RESOURCES | HELP_PROPS)
 208  204  
 209  205  extern void add_func(cmd_t *);
 210  206  extern void cancel_func(cmd_t *);
 211  207  extern void commit_func(cmd_t *);
 212  208  extern void create_func(cmd_t *);
 213  209  extern void delete_func(cmd_t *);
 214  210  extern void end_func(cmd_t *);
 215  211  extern void exit_func(cmd_t *);
 216  212  extern void export_func(cmd_t *);
 217  213  extern void help_func(cmd_t *);
 218  214  extern void info_func(cmd_t *);
 219  215  extern void remove_func(cmd_t *);
 220  216  extern void revert_func(cmd_t *);
 221  217  extern void select_func(cmd_t *);
 222  218  extern void set_func(cmd_t *);
 223  219  extern void verify_func(cmd_t *);
 224  220  extern void clear_func(cmd_t *);
 225  221  
 226  222  extern cmd_t *alloc_cmd(void);
 227  223  extern complex_property_ptr_t alloc_complex(void);
 228  224  extern list_property_ptr_t alloc_list(void);
 229  225  extern void free_cmd(cmd_t *cmd);
 230  226  extern void free_complex(complex_property_ptr_t complex);
 231  227  extern void free_list(list_property_ptr_t list);
 232  228  extern void free_outer_list(list_property_ptr_t list);
 233  229  
 234  230  extern void usage(boolean_t verbose, uint_t flags);
 235  231  
 236  232  extern FILE *yyin;
 237  233  extern char *res_types[];
 238  234  extern char *prop_types[];
 239  235  
 240  236  /*
 241  237   * NOTE: Only Lex and YACC should use the following functions.
 242  238   */
 243  239  extern void assert_no_unclaimed_tokens(void);
 244  240  extern char *claim_token(char *);
 245  241  
 246  242  #ifdef __cplusplus
 247  243  }
 248  244  #endif
 249  245  
 250  246  #endif  /* _ZONECFG_H */
  
    | 
      ↓ open down ↓ | 
    89 lines elided | 
    
      ↑ open up ↑ | 
  
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX