Lines Matching defs:group

63  * has_protocol(group, proto)
64 * If the group has an optionset with the specified protocol,
68 has_protocol(sa_group_t group, char *protocol)
73 optionset = sa_get_optionset(group, protocol);
459 sa_group_t group;
478 group = sa_get_parent_group(parent);
480 if (group == NULL) {
484 for (opt = sa_get_optionset(group, NULL);
525 * enable_group(group, updateproto, notify, proto)
527 * enable all the shares in the specified group. This is a helper for
534 enable_group(sa_group_t group, char *updateproto, int notify, char *proto)
538 /* If the protocol isn't enabled for this group skip it */
539 if (!has_protocol(group, proto))
542 for (share = sa_get_share(group, NULL);
555 * isenabled(group)
557 * Returns B_TRUE if the group is enabled or B_FALSE if it isn't.
562 isenabled(sa_group_t group)
567 if (group != NULL) {
568 state = sa_get_group_attr(group, "state");
596 sa_group_t group;
600 group = (sa_group_t)work->item;
606 * group.
609 ret = sa_set_group_attr(group, "state", "enabled");
615 * Check to see if group is enabled. If it isn't, skip
617 * group is disabled. The properties may have been
619 * group is enabled.
621 if (!isenabled(group))
647 /* if itemdata == NULL then the whole group */
649 zfs = sa_get_group_attr(group, "zfs");
657 enable_group(group, zfs == NULL ? updateproto : NULL,
662 for (subgroup = sa_get_sub_group(group);
671 zfs = sa_get_group_attr(group, "zfs");
672 name = sa_get_group_attr(group, "name");
815 * add_optionset(group, optlist, protocol, *err)
817 * to the group.
823 add_optionset(sa_group_t group, struct options *optlist, char *proto, int *err)
830 optionset = sa_get_optionset(group, proto);
832 optionset = sa_create_optionset(group, proto);
841 handle = sa_find_group_handle(group);
905 * resource_compliant(group)
907 * Go through all the shares in the group. Assume compliant, but if
912 resource_compliant(sa_group_t group)
916 for (share = sa_get_share(group, NULL); share != NULL;
1017 * make_resources(group)
1019 * Go through all the shares in the group and make them have resource
1023 make_resources(sa_group_t group)
1029 for (share = sa_get_share(group, NULL); share != NULL;
1059 * check_valid_group(group, protocol)
1061 * Check to see that the group should have the protocol added (if
1066 check_valid_group(sa_group_t group, char *groupname, char *protocol)
1070 if (has_protocol(group, protocol)) {
1094 * enforce_featureset(group, protocol, dryrun, force)
1096 * Check the protocol featureset against the group and enforce any
1101 enforce_featureset(sa_group_t group, char *protocol, boolean_t dryrun,
1111 * allow on a group. Only server protocols are allowed here.
1126 !resource_compliant(group)) {
1128 make_resources(group);
1140 * set_all_protocols(group)
1143 * group.
1147 set_all_protocols(sa_group_t group)
1157 * group. Only server protocols can go here.
1163 optionset = sa_create_optionset(group, protolist[i]);
1179 * create a new group
1188 sa_group_t group;
1277 (void) printf(gettext("\textraneous group(s) at end\n"));
1299 * If a group already exists, we can only add a new protocol
1308 group = sa_get_group(handle, groupname);
1309 if (group != NULL) {
1310 /* group exists so must be a protocol add */
1311 ret = check_valid_group(group, groupname, protocol);
1319 (void) printf(gettext("Invalid group name: %s\n"),
1328 group, NULL);
1332 if (group == NULL) {
1333 group = sa_create_group(handle, (char *)groupname,
1337 if (group != NULL) {
1341 * Check group and protocol against featureset
1344 ret = enforce_featureset(group, protocol,
1351 * optionset(s) to the group.
1354 (void) add_optionset(group, optlist, protocol,
1357 optionset = sa_create_optionset(group,
1362 /* default group create so add all protocols */
1363 ret = set_all_protocols(group);
1366 * We have a group and legal additions
1378 if (group != NULL)
1379 (void) sa_remove_group(group);
1383 (void) printf(gettext("Could not create group: %s\n"),
1394 ret = sa_remove_group(group);
1401 * group_status(group)
1403 * return the current status (enabled/disabled) of the group.
1407 group_status(sa_group_t group)
1412 state = sa_get_group_attr(group, "state");
1425 * Delete a group.
1432 sa_group_t group;
1512 (void) printf(gettext("\textraneous group(s) at end\n"));
1525 * Determine if the group already exists since it must in
1530 * - group is empty
1536 group = sa_get_group(handle, groupname);
1537 if (group == NULL) {
1543 share = sa_get_share(group, NULL);
1562 ret = sa_remove_group(group);
1575 security = sa_get_security(group, sectype, protocol);
1581 optionset = sa_get_optionset(group, protocol);
1595 sa_get_security(group, NULL, NULL);
1618 for (share = sa_get_share(group, NULL);
1627 (void) printf(gettext("Could not delete group: %s\n"),
1671 * group_proto(group)
1674 * with this group.
1678 group_proto(sa_group_t group)
1687 * group and extracting the type value. The initial call to
1692 for (optionset = sa_get_optionset(group, NULL);
1722 sa_group_t group;
1783 for (group = sa_get_group(handle, NULL);
1784 group != NULL;
1785 group = sa_get_next_group(group)) {
1788 if (protocol == NULL || has_protocol(group, protocol)) {
1789 name = sa_get_group_attr(group, "name");
1800 (void) printf("\t%s", isenabled(group) ?
1803 proto = group_proto(group);
1870 * show_properties(group, protocol, prefix)
1872 * print the properties for a group. If protocol is NULL, do all
1883 show_properties(sa_group_t group, char *protocol, char *prefix)
1891 optionset = sa_get_optionset(group, protocol);
1897 security = sa_get_security(group, protocol, NULL);
1904 for (optionset = sa_get_optionset(group, protocol);
1915 for (security = sa_get_security(group, NULL, protocol);
2160 * show_group(group, verbose, properties, proto, subgroup)
2162 * helper function to show the contents of a group.
2166 show_group(sa_group_t group, int verbose, int properties, char *proto,
2175 groupname = sa_get_group_attr(group, "name");
2177 if (proto != NULL && !has_protocol(group, proto)) {
2182 * check to see if the group is managed by ZFS. If
2188 zfs = sa_get_group_attr(group, "zfs");
2193 share = sa_get_share(group, NULL);
2199 show_properties(group, proto, "");
2204 for (zgroup = sa_get_sub_group(group);
2214 * Have a group, so list the contents. Resource and
2217 for (share = sa_get_share(group, NULL);
2256 * show_group_xml(doc, group)
2258 * Copy the group info into the XML doc.
2262 show_group_xml(xmlDocPtr doc, sa_group_t group)
2268 node = xmlCopyNode((xmlNodePtr)group, 1);
2288 sa_group_t group;
2359 /* No group specified so go through them all */
2360 for (group = sa_get_group(handle, NULL);
2361 group != NULL;
2362 group = sa_get_next_group(group)) {
2364 * Have a group so check if one we want and then list
2368 show_group_xml(doc, group);
2370 show_group(group, verbose, properties, protocol,
2376 group = sa_get_group(handle, argv[optind]);
2377 if (group != NULL) {
2379 show_group_xml(doc, group);
2381 show_group(group, verbose, properties,
2399 * enable_share(group, share, update_legacy)
2401 * helper function to enable a share if the group is enabled.
2405 enable_share(sa_handle_t handle, sa_group_t group, sa_share_t share,
2418 * need to enable this share if the group is enabled but not
2420 * represented in the group.
2422 value = sa_get_group_attr(group, "state");
2429 zfs = sa_get_group_attr(group, "zfs");
2436 * Step through each optionset at the group level and
2438 * works because protocols must be set on the group
2442 for (optionset = sa_get_optionset(group, NULL);
2491 * sa_require_resource(group)
2493 * if any of the defined protocols on the group require resource
2498 sa_require_resource(sa_group_t group)
2502 for (optionset = sa_get_optionset(group, NULL);
2535 sa_group_t group;
2568 * Save share path into group. Currently limit
2682 group = sa_get_group(handle, argv[optind]);
2683 if (group != NULL) {
2684 if (sa_require_resource(group) == B_TRUE &&
2689 "in group\n"));
2694 ret = sa_check_path(group, sharepath,
2697 share = sa_add_share(group, sharepath,
2702 * share into a different group than it already is in.
2707 if (parent != group) {
2747 group,
2753 group,
2812 sa_group_t group;
2838 * Remove share path from group. Currently limit
2899 group = sa_get_group(handle, argv[optind]);
2900 if (group == NULL) {
2937 zfsnew = sa_get_group_attr(group, "zfs");
2948 if (ret == SA_OK && parent != group && !dryrun) {
2952 * "unshared" if the new group is disabled and
2954 * share to update if the new group is
2958 * aren't in the new group.
2970 ret = sa_move_share(group, share);
2975 if (ret == SA_OK && parent != group && !dryrun) {
2978 (void) enable_share(handle, group, share, 1);
3008 sa_group_t group;
3029 * Remove share path from group. Currently limit
3042 * Remove share from group if last resource or remove
3095 (void) printf(gettext("Extraneous group(s) at end of "
3099 group = sa_get_group(handle, argv[optind]);
3100 if (group == NULL) {
3107 group = NULL;
3128 if (group != NULL)
3129 share = sa_get_share(group, sharepath);
3164 if (group != NULL)
3165 share = sa_get_share(group, dir);
3183 if (group != NULL)
3184 (void) printf(gettext("Share not found in group %s:"
3191 if (group == NULL)
3192 group = sa_get_parent_group(share);
3240 pname = sa_get_group_attr(group, "name");
3267 sa_group_t group, sharegroup;
3305 * Save share path into group. Currently limit
3354 (void) printf(gettext("\tExtraneous group(s) at end\n"));
3373 group = sa_get_group(handle, groupname);
3375 group = NULL;
3425 if (group != NULL && group != sharegroup) {
3526 * add_security(group, sectype, optlist, proto, *err)
3529 * group.
3533 add_security(sa_group_t group, char *sectype,
3542 security = sa_get_security(group, sectype, proto);
3544 security = sa_create_security(group, sectype, proto);
3552 handle = sa_find_group_handle(group);
3615 * zfscheck(group, share)
3619 * acceptable is the path that defines the zfs sub-group (dataset with
3624 * If group is not a ZFS group/subgroup, we assume OK since the check
3626 * for here is that the group is ZFS and the share is not the defining
3631 zfscheck(sa_group_t group, sa_share_t share)
3636 if (sa_group_is_zfs(group)) {
3638 * The group is a ZFS group. Does the share represent
3639 * the dataset that defined the group? It is only OK
3663 * the sharepath if present or group if present, otherwise it is used
3675 sa_group_t group;
3680 group = sa_get_group(handle, groupname);
3681 if (group != NULL) {
3687 * the group.
3690 share = sa_get_share(group, sharepath);
3693 "Share does not exist in group %s\n"),
3697 /* if ZFS and OK, then only group */
3698 ret = zfscheck(group, share);
3700 sa_group_is_zfs(group))
3704 "Properties on ZFS group shares "
3712 * group. Also check the protocol to see if it
3723 resource = sa_get_resource(group, rsrcname);
3744 /* group must exist */
3746 share == NULL ? group : share, NULL);
3752 change |= add_optionset(group, optlist,
3755 worklist = add_list(worklist, group,
3765 * we have a group and potentially legal additions
3794 sa_group_t group;
3809 group = sa_get_group(handle, groupname);
3810 if (group != NULL) {
3813 share = sa_get_share(group, sharepath);
3816 "Share does not exist in group %s\n"),
3820 /* if ZFS and OK, then only group */
3821 ret = zfscheck(group, share);
3823 sa_group_is_zfs(group))
3827 "Properties on ZFS group shares "
3832 /* group must exist */
3834 share == NULL ? group : share, sectype);
3840 change = add_security(group, sectype,
3848 worklist = add_list(worklist, group, share,
3858 * We have a group and potentially legal additions.
4019 (void) printf(gettext("Changing properties for group "
4040 * remove_options(group, optlist, proto, *err)
4042 * Helper function to actually remove options from a group after all
4047 remove_options(sa_group_t group, struct options *optlist,
4056 optionset = sa_get_optionset(group, proto);
4077 * valid_unset(group, optlist, proto)
4084 valid_unset(sa_group_t group, struct options *optlist, char *proto)
4091 optionset = sa_get_optionset(group, proto);
4107 * valid_unset_security(group, optlist, proto)
4114 valid_unset_security(sa_group_t group, struct options *optlist, char *proto,
4124 security = sa_get_security(group, sec, proto);
4146 * remove_security(group, optlist, proto)
4152 remove_security(sa_group_t group, char *sectype,
4160 security = sa_get_security(group, sectype, proto);
4201 sa_group_t group;
4208 group = sa_get_group(handle, groupname);
4209 if (group == NULL)
4214 * the group.
4217 share = sa_get_share(group, sharepath);
4220 "Share does not exist in group %s\n"),
4228 * group. Also check the protocol to see if it
4238 resource = sa_get_resource(group, rsrcname);
4259 /* group must exist */
4260 ret = valid_unset(share != NULL ? share : group,
4281 change |= remove_options(group,
4285 worklist = add_list(worklist, group, share,
4299 * We have a group and potentially legal additions
4324 sa_group_t group;
4330 group = sa_get_group(handle, groupname);
4331 if (group == NULL) {
4336 share = sa_get_share(group, sharepath);
4339 "Share does not exist in group %s\n"),
4344 ret = valid_unset_security(share != NULL ? share : group,
4366 change = remove_security(group, sectype,
4373 security = sa_get_security(group, sec, protocol);
4390 worklist = add_list(worklist, group, 0, protocol);
4394 * We have a group and potentially legal additions
4556 * If a group already exists, we can only add a new
4595 sa_group_t group;
4650 (void) printf(gettext("\tmust specify group\n"));
4655 group = sa_get_group(handle, argv[optind]);
4656 if (group != NULL) {
4659 state = sa_get_group_attr(group, "state");
4670 worklist = add_list(worklist, group,
4674 "Enabling group \"%s\"\n"),
4685 for (group = sa_get_group(handle, NULL);
4686 group != NULL;
4687 group = sa_get_next_group(group)) {
4688 worklist = add_list(worklist, group, 0, protocol);
4695 (void) printf(gettext("Could not enable group: %s\n"),
4710 * disable_group(group, proto)
4712 * Disable all the shares in the specified group.. This is a helper
4718 disable_group(sa_group_t group, char *proto)
4727 if (!has_protocol(group, proto))
4730 for (share = sa_get_share(group, NULL);
4749 * provided. It optionally marks the group as disabled. Used by both
4757 sa_group_t subgroup, group;
4760 group = (sa_group_t)work->item;
4762 ret = sa_set_group_attr(group, "state", "disabled");
4765 name = sa_get_group_attr(group, "name");
4768 for (subgroup = sa_get_sub_group(group);
4775 ret = disable_group(group, work->proto);
4810 sa_group_t group;
4867 (void) printf(gettext("\tmust specify group\n"));
4872 group = sa_get_group(handle, argv[optind]);
4873 if (group != NULL) {
4876 state = sa_get_group_attr(group, "state");
4887 worklist = add_list(worklist, group, 0,
4891 "Disabling group "
4902 for (group = sa_get_group(handle, NULL);
4903 group != NULL;
4904 group = sa_get_next_group(group))
4905 worklist = add_list(worklist, group, 0, protocol);
4911 (void) printf(gettext("Could not disable group: %s\n"),
4928 * of the group(s) and only enables shares if the group is already
4942 sa_group_t group;
5004 group = sa_get_group(handle, argv[optind]);
5005 if (group != NULL) {
5006 state = sa_get_group_attr(group, "state");
5009 worklist = add_list(worklist, group, 0,
5013 "Starting group \"%s\"\n"),
5022 if (sa_get_optionset(group,
5033 for (group = sa_get_group(handle, NULL);
5034 group != NULL;
5035 group = sa_get_next_group(group)) {
5036 state = sa_get_group_attr(group, "state");
5038 worklist = add_list(worklist, group, 0,
5057 * of the group(s) and only disables shares if the group is already
5070 sa_group_t group;
5130 group = sa_get_group(handle, argv[optind]);
5131 if (group != NULL) {
5132 state = sa_get_group_attr(group, "state");
5135 worklist = add_list(worklist, group, 0,
5139 "Stopping group \"%s\"\n"),
5150 for (group = sa_get_group(handle, NULL);
5151 group != NULL;
5152 group = sa_get_next_group(group)) {
5153 state = sa_get_group_attr(group, "state");
5155 worklist = add_list(worklist, group, 0,
5285 * out_share(out, group, proto)
5292 out_share(FILE *out, sa_group_t group, char *proto)
5303 if (proto != NULL && sa_get_optionset(group, proto) == NULL)
5318 for (share = sa_get_share(group, NULL);
5335 groupname = sa_get_group_attr(group, "name");
5397 sa_group_t group;
5399 for (group = sa_get_group(handle, NULL);
5400 group != NULL;
5401 group = sa_get_next_group(group)) {
5407 * the group appropriately.
5410 zfs = sa_get_group_attr(group, "zfs");
5414 for (zgroup = sa_get_sub_group(group);
5418 /* got a group, so display it */
5422 out_share(out, group, proto);
5445 sa_group_t group = NULL;
5550 * The legacy group is always present and zfs groups
5552 * the zfs share will already be in that group so it
5553 * isn't an error. If the protocol is "smb", the group
5565 * group.
5568 group = sa_get_parent_group(share);
5570 group = sa_get_group(handle, legacygroup);
5571 if (group == NULL && strcmp(legacygroup, "smb") == 0) {
5573 * This group may not exist, so create
5577 group = sa_create_group(handle, legacygroup,
5579 if (group != NULL)
5580 (void) sa_create_optionset(group,
5585 if (group == NULL) {
5590 groupstatus = group_status(group);
5592 share = sa_add_share(group, sharepath,
5602 group = sa_get_group(handle,
5604 if (group == NULL) {
5612 group, sharepath,
5667 /* Have a group to hold this share path */
5910 "[-d \"description text\"] -s sharepath group");
5914 "create [-nvh] [-P proto [-p property=value]] group");
5917 ret = gettext("delete [-nvh] [-P proto] [-f] group");
5920 ret = gettext("disable [-nvh] {-a | group ...}");
5923 ret = gettext("enable [-nvh] {-a | group ...}");
5930 "move-share [-nvh] -s sharepath destination-group");
5935 "group");
5940 "group");
5944 "[-p property=value]* group");
5948 "[-d \"description text\"] -s sharepath group");
5951 ret = gettext("show [-pvxh] [-P proto] [group ...]");
5958 ret = gettext("start [-vh] [-P proto] {-a | group ...}");
5961 ret = gettext("stop [-vh] [-P proto] {-a | group ...}");
5965 "[-p property]* group");
5969 "-S security-type [-p property]* group");