Print this page


Split Close
Expand all
Collapse all
          --- old/usr/src/head/libzonecfg.h
          +++ new/usr/src/head/libzonecfg.h
↓ 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 2015, Joyent, Inc.
  25   24   */
  26   25  
  27   26  #ifndef _LIBZONECFG_H
  28   27  #define _LIBZONECFG_H
  29   28  
  30   29  /*
  31   30   * Zone configuration header file.
  32   31   */
  33   32  
  34   33  #ifdef __cplusplus
↓ open down ↓ 78 lines elided ↑ open up ↑
 113  112  #define ZONE_STATE_INCOMPLETE           1
 114  113  #define ZONE_STATE_INSTALLED            2
 115  114  #define ZONE_STATE_READY                3
 116  115  #define ZONE_STATE_RUNNING              4
 117  116  #define ZONE_STATE_SHUTTING_DOWN        5
 118  117  #define ZONE_STATE_DOWN                 6
 119  118  #define ZONE_STATE_MOUNTED              7
 120  119  
 121  120  #define ZONE_STATE_MAXSTRLEN    14
 122  121  
 123      -#define ZONE_PROP_MAXSTRLEN     1024
 124      -
 125  122  #define LIBZONECFG_PATH         "libzonecfg.so.1"
 126  123  
 127  124  #define ZONE_CONFIG_ROOT        "/etc/zones"
 128  125  #define ZONE_INDEX_FILE         ZONE_CONFIG_ROOT "/index"
 129  126  
 130  127  #define MAXUSERNAME             (sizeof (((struct utmpx *)0)->ut_name))
 131  128  #define MAXAUTHS                4096
 132  129  #define ZONE_MGMT_PROF          "Zone Management"
 133  130  
 134  131  #define ZONE_INT32SZ            11              /* string to hold 32bit int. */
↓ open down ↓ 28 lines elided ↑ open up ↑
 163  160  #define ALIAS_ZFSPRI            "zfs-io-priority"
 164  161  
 165  162  /* Default name for zone detached manifest */
 166  163  #define ZONE_DETACHED   "SUNWdetached.xml"
 167  164  
 168  165  /*
 169  166   * Bit flag definitions for passing into libzonecfg functions.
 170  167   */
 171  168  #define ZONE_DRY_RUN            0x01
 172  169  
 173      -typedef enum zone_iptype {
 174      -        ZS_SHARED,
 175      -        ZS_EXCLUSIVE
 176      -} zone_iptype_t;
 177      -
 178  170  /*
 179  171   * The integer field expresses the current values on a get.
 180  172   * On a put, it represents the new values if >= 0 or "don't change" if < 0.
 181  173   */
 182  174  struct zoneent {
 183  175          char    zone_name[ZONENAME_MAX];        /* name of the zone */
 184  176          int     zone_state;     /* configured | incomplete | installed */
 185  177          char    zone_path[MAXPATHLEN];          /* path to zone storage */
 186  178          uuid_t  zone_uuid;                      /* unique ID for zone */
 187  179          char    zone_newname[ZONENAME_MAX];     /* for doing renames */
 188      -        char    zone_brand[MAXNAMELEN];         /* zone's brand */
 189      -        zone_iptype_t zone_iptype;              /* zone's IP type */
 190      -        zoneid_t zone_did;                      /* persistent debug ID */
 191  180  };
 192  181  
 193  182  typedef struct zone_dochandle *zone_dochandle_t;        /* opaque handle */
 194  183  
 195  184  typedef uint_t zone_state_t;
 196  185  
 197  186  typedef struct zone_fsopt {
 198  187          struct zone_fsopt *zone_fsopt_next;
 199  188          char               zone_fsopt_opt[MAX_MNTOPT_STR];
 200  189  } zone_fsopt_t;
↓ open down ↓ 5 lines elided ↑ open up ↑
 206  195          zone_fsopt_t   *zone_fs_options;                /* mount options */
 207  196          char            zone_fs_raw[MAXPATHLEN];        /* device to fsck */
 208  197  };
 209  198  
 210  199  /*
 211  200   * Generic resource attribute list.
 212  201   * Key/value resource that can be attached to net or device.
 213  202   */
 214  203  struct zone_res_attrtab {
 215  204          char    zone_res_attr_name[MAXNAMELEN];
 216      -        char    zone_res_attr_value[ZONE_PROP_MAXSTRLEN];
      205 +        char    zone_res_attr_value[MAXNAMELEN];
 217  206          struct zone_res_attrtab *zone_res_attr_next;
 218  207  };
 219  208  
 220  209  struct zone_nwiftab {
 221  210          char    zone_nwif_address[INET6_ADDRSTRLEN]; /* shared-ip only */
 222  211          char    zone_nwif_allowed_address[INET6_ADDRSTRLEN]; /* excl-ip only */
 223  212          char    zone_nwif_physical[LIFNAMSIZ];
 224  213          char    zone_nwif_mac[MAXMACADDRLEN];           /* excl-ip only */
 225  214          char    zone_nwif_vlan_id[ZONE_INT32SZ];        /* excl-ip only */
 226  215          char    zone_nwif_gnic[LIFNAMSIZ];              /* excl-ip only */
↓ open down ↓ 57 lines elided ↑ open up ↑
 284  273          char                    zonename[ZONENAME_MAX];
 285  274          struct zone_userauths   *next;
 286  275  } zone_userauths_t;
 287  276  
 288  277  typedef struct {
 289  278          uu_avl_node_t   zpe_entry;
 290  279          char            *zpe_name;
 291  280          char            *zpe_vers;
 292  281  } zone_pkg_entry_t;
 293  282  
      283 +typedef enum zone_iptype {
      284 +        ZS_SHARED,
      285 +        ZS_EXCLUSIVE
      286 +} zone_iptype_t;
      287 +
 294  288  /*
 295  289   * Basic configuration management routines.
 296  290   */
 297  291  extern  zone_dochandle_t        zonecfg_init_handle(void);
 298  292  extern  int     zonecfg_get_handle(const char *, zone_dochandle_t);
 299  293  extern  int     zonecfg_get_snapshot_handle(const char *, zone_dochandle_t);
 300  294  extern  int     zonecfg_get_template_handle(const char *, const char *,
 301  295      zone_dochandle_t);
 302  296  extern  int     zonecfg_get_xml_handle(const char *, zone_dochandle_t);
 303  297  extern  int     zonecfg_check_handle(zone_dochandle_t);
↓ open down ↓ 7 lines elided ↑ open up ↑
 311  305  extern  void    zonecfg_set_root(const char *);
 312  306  extern  const char *zonecfg_get_root(void);
 313  307  extern  boolean_t zonecfg_in_alt_root(void);
 314  308  extern  int     zonecfg_num_resources(zone_dochandle_t, char *);
 315  309  extern  int     zonecfg_del_all_resources(zone_dochandle_t, char *);
 316  310  extern  boolean_t zonecfg_valid_ncpus(char *, char *);
 317  311  extern  boolean_t zonecfg_valid_importance(char *);
 318  312  extern  int     zonecfg_str_to_bytes(char *, uint64_t *);
 319  313  extern  boolean_t zonecfg_valid_memlimit(char *, uint64_t *);
 320  314  extern  boolean_t zonecfg_valid_alias_limit(char *, char *, uint64_t *);
 321      -extern  void    zonecfg_notify_create(zone_dochandle_t);
 322  315  
 323  316  /*
 324  317   * Zone name, path to zone directory, autoboot setting, pool, boot
 325  318   * arguments, and scheduling-class.
 326  319   */
 327  320  extern  int     zonecfg_validate_zonename(const char *);
 328  321  extern  int     zonecfg_get_name(zone_dochandle_t, char *, size_t);
 329  322  extern  int     zonecfg_set_name(zone_dochandle_t, char *);
 330  323  extern  int     zonecfg_get_zonepath(zone_dochandle_t, char *, size_t);
 331  324  extern  int     zonecfg_set_zonepath(zone_dochandle_t, char *);
↓ open down ↓ 205 lines elided ↑ open up ↑
 537  530  extern  int     zone_get_brand(char *, char *, size_t);
 538  531  extern  zoneid_t zone_get_did(char *);
 539  532  extern  int     zone_get_rootpath(char *, char *, size_t);
 540  533  extern  int     zone_get_devroot(char *, char *, size_t);
 541  534  extern  int     zone_get_zonepath(char *, char *, size_t);
 542  535  extern  int     zone_get_state(char *, zone_state_t *);
 543  536  extern  int     zone_set_state(char *, zone_state_t);
 544  537  extern  char    *zone_state_str(zone_state_t);
 545  538  extern  int     zonecfg_get_name_by_uuid(const uuid_t, char *, size_t);
 546  539  extern  int     zonecfg_get_uuid(const char *, uuid_t);
 547      -extern  int     zonecfg_set_uuid(const char *, const char *, const char *);
 548  540  extern  int     zonecfg_default_brand(char *, size_t);
 549  541  extern  int     zonecfg_fix_obsolete(zone_dochandle_t);
 550  542  
 551  543  /*
 552  544   * Iterator for configured zones.
 553  545   */
 554  546  extern FILE             *setzoneent(void);
 555  547  extern char             *getzoneent(FILE *);
 556  548  extern struct zoneent   *getzoneent_private(FILE *);
 557  549  extern void             endzoneent(FILE *);
↓ open down ↓ 72 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX