diff options
Diffstat (limited to 'usr/src/head/libzonecfg.h')
-rw-r--r-- | usr/src/head/libzonecfg.h | 47 |
1 files changed, 35 insertions, 12 deletions
diff --git a/usr/src/head/libzonecfg.h b/usr/src/head/libzonecfg.h index d41dbb0520..0212224de5 100644 --- a/usr/src/head/libzonecfg.h +++ b/usr/src/head/libzonecfg.h @@ -21,6 +21,7 @@ /* * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, Joyent, Inc. All rights reserved. */ #ifndef _LIBZONECFG_H @@ -42,6 +43,7 @@ extern "C" { #include <netinet/in.h> #include <sys/socket.h> #include <net/if.h> +#include <sys/mac.h> #include <stdio.h> #include <rctl.h> #include <zone.h> @@ -127,6 +129,8 @@ extern "C" { #define MAXAUTHS 4096 #define ZONE_MGMT_PROF "Zone Management" +#define ZONE_INT32SZ 11 /* string to hold 32bit int. */ + /* Owner, group, and mode (defined by packaging) for the config directory */ #define ZONE_CONFIG_UID 0 /* root */ #define ZONE_CONFIG_GID 3 /* sys */ @@ -150,9 +154,11 @@ extern "C" { #define ALIAS_MAXSEMIDS "max-sem-ids" #define ALIAS_MAXLOCKEDMEM "locked" #define ALIAS_MAXSWAP "swap" +#define ALIAS_MAXPHYSMEM "physical" #define ALIAS_SHARES "cpu-shares" #define ALIAS_CPUCAP "cpu-cap" #define ALIAS_MAXPROCS "max-processes" +#define ALIAS_ZFSPRI "zfs-io-priority" /* Default name for zone detached manifest */ #define ZONE_DETACHED "SUNWdetached.xml" @@ -191,15 +197,30 @@ struct zone_fstab { char zone_fs_raw[MAXPATHLEN]; /* device to fsck */ }; +/* + * Generic resource attribute list. + * Key/value resource that can be attached to net or device. + */ +struct zone_res_attrtab { + char zone_res_attr_name[MAXNAMELEN]; + char zone_res_attr_value[MAXNAMELEN]; + struct zone_res_attrtab *zone_res_attr_next; +}; + struct zone_nwiftab { char zone_nwif_address[INET6_ADDRSTRLEN]; /* shared-ip only */ char zone_nwif_allowed_address[INET6_ADDRSTRLEN]; /* excl-ip only */ char zone_nwif_physical[LIFNAMSIZ]; + char zone_nwif_mac[MAXMACADDRLEN]; /* excl-ip only */ + char zone_nwif_vlan_id[ZONE_INT32SZ]; /* excl-ip only */ + char zone_nwif_gnic[LIFNAMSIZ]; /* excl-ip only */ char zone_nwif_defrouter[INET6_ADDRSTRLEN]; + struct zone_res_attrtab *zone_nwif_attrp; }; struct zone_devtab { char zone_dev_match[MAXPATHLEN]; + struct zone_res_attrtab *zone_dev_attrp; }; struct zone_rctlvaltab { @@ -230,10 +251,6 @@ struct zone_psettab { char zone_importance[MAXNAMELEN]; }; -struct zone_mcaptab { - char zone_physmem_cap[MAXNAMELEN]; -}; - struct zone_pkgtab { char zone_pkg_name[MAXNAMELEN]; char zone_pkg_version[ZONE_PKG_VERSMAX]; @@ -317,6 +334,8 @@ extern int zonecfg_set_bootargs(zone_dochandle_t, char *); extern int zonecfg_get_sched_class(zone_dochandle_t, char *, size_t); extern int zonecfg_set_sched(zone_dochandle_t, char *); extern int zonecfg_get_dflt_sched_class(zone_dochandle_t, char *, int); +extern zoneid_t zonecfg_get_did(zone_dochandle_t); +extern void zonecfg_set_did(zone_dochandle_t); /* * Set/retrieve the brand for the zone @@ -341,6 +360,15 @@ extern int zonecfg_find_mounts(char *, int(*)(const struct mnttab *, void *), void *); /* + * Resource key/value attributes (properties). + */ +extern int zonecfg_add_res_attr(struct zone_res_attrtab **, + struct zone_res_attrtab *); +extern void zonecfg_free_res_attr_list(struct zone_res_attrtab *); +extern int zonecfg_remove_res_attr(struct zone_res_attrtab **, + struct zone_res_attrtab *); + +/* * Network interface configuration. */ extern int zonecfg_add_nwif(zone_dochandle_t, struct zone_nwiftab *); @@ -422,13 +450,6 @@ extern int zonecfg_modify_pset(zone_dochandle_t, struct zone_psettab *); extern int zonecfg_lookup_pset(zone_dochandle_t, struct zone_psettab *); /* - * mem-cap configuration. - */ -extern int zonecfg_delete_mcap(zone_dochandle_t); -extern int zonecfg_modify_mcap(zone_dochandle_t, struct zone_mcaptab *); -extern int zonecfg_lookup_mcap(zone_dochandle_t, struct zone_mcaptab *); - -/* * Temporary pool support functions. */ extern int zonecfg_destroy_tmp_pool(char *, char *, int); @@ -485,7 +506,6 @@ extern int zonecfg_setdsent(zone_dochandle_t); extern int zonecfg_getdsent(zone_dochandle_t, struct zone_dstab *); extern int zonecfg_enddsent(zone_dochandle_t); extern int zonecfg_getpsetent(zone_dochandle_t, struct zone_psettab *); -extern int zonecfg_getmcapent(zone_dochandle_t, struct zone_mcaptab *); extern int zonecfg_getpkgdata(zone_dochandle_t, uu_avl_pool_t *, uu_avl_t *); extern int zonecfg_setdevperment(zone_dochandle_t); @@ -509,6 +529,7 @@ extern int zonecfg_set_limitpriv(zone_dochandle_t, char *); * Higher-level routines. */ extern int zone_get_brand(char *, char *, size_t); +extern zoneid_t zone_get_did(char *); extern int zone_get_rootpath(char *, char *, size_t); extern int zone_get_devroot(char *, char *, size_t); extern int zone_get_zonepath(char *, char *, size_t); @@ -517,7 +538,9 @@ extern int zone_set_state(char *, zone_state_t); extern char *zone_state_str(zone_state_t); extern int zonecfg_get_name_by_uuid(const uuid_t, char *, size_t); extern int zonecfg_get_uuid(const char *, uuid_t); +extern int zonecfg_set_uuid(const char *, const char *, const char *); extern int zonecfg_default_brand(char *, size_t); +extern int zonecfg_fix_obsolete(zone_dochandle_t); /* * Iterator for configured zones. |