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.
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.
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]
22 * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
28 #include <sys/param.h>
36 * DFS root or link states
39 * The specified DFS root or DFS link is in the normal state.
41 * DFS_VOLUME_STATE_INCONSISTENT
42 * The internal DFS database is inconsistent with the specified DFS root or
43 * DFS link. Attempts to repair the inconsistency have failed. This is a
44 * read-only state and MUST NOT be set by clients.
46 * DFS_VOLUME_STATE_OFFLINE
47 * The specified DFS root or DFS link is offline or unavailable.
49 * DFS_VOLUME_STATE_ONLINE
50 * The specified DFS root or DFS link is available.
52 * DFS_VOLUME_FLAVOR_STANDALONE Standalone namespace
53 * DFS_VOLUME_FLAVOR_AD_BLOB Domain-based namespace
55 #define DFS_VOLUME_STATE_OK 0x00000001
56 #define DFS_VOLUME_STATE_INCONSISTENT 0x00000002
57 #define DFS_VOLUME_STATE_OFFLINE 0x00000003
58 #define DFS_VOLUME_STATE_ONLINE 0x00000004
59 #define DFS_VOLUME_STATE_RESYNCHRONIZE 0x00000010
60 #define DFS_VOLUME_STATE_STANDBY 0x00000020
61 #define DFS_VOLUME_STATE_FORCE_SYNC 0x00000040
63 #define DFS_VOLUME_FLAVOR_STANDALONE 0x00000100
64 #define DFS_VOLUME_FLAVOR_AD_BLOB 0x00000200
67 * The following bitmasks is only relevant when reading the volume state, not
70 #define DFS_VOLUME_STATES 0x0000000F
71 #define DFS_VOLUME_FLAVORS 0x00000300
74 * States specified by this mask are used to perform a server operation and are
75 * not persisted to the DFS metadata
77 #define DFS_VOLUME_STATES_SRV_OPS 0x00000070
82 #define DFS_STORAGE_STATE_OFFLINE 1
83 #define DFS_STORAGE_STATE_ONLINE 2
86 * Flags for NetrDfsAdd operation:
88 * 0x00000000 This creates a new link or adds a new target to an
91 * DFS_ADD_VOLUME This creates a new link in the DFS namespace if one does
92 * not already exist or fails if a link already exists.
94 * DFS_RESTORE_VOLUME This adds a target without verifying its existence.
96 #define DFS_CREATE_VOLUME 0x00000000
97 #define DFS_ADD_VOLUME 0x00000001
98 #define DFS_RESTORE_VOLUME 0x00000002
100 #define DFS_MOVE_FLAG_REPLACE_IF_EXISTS 1
103 DfsInvalidPriorityClass
= -1,
104 DfsSiteCostNormalPriorityClass
= 0,
105 DfsGlobalHighPriorityClass
= 1,
106 DfsSiteCostHighPriorityClass
= 2,
107 DfsSiteCostLowPriorityClass
= 3,
108 DfsGlobalLowPriorityClass
= 4
109 } dfs_target_pclass_t
;
111 #define DFS_PRIORITY_RANK_MAX 0x001F
113 #define DFS_PROPERTY_FLAG_INSITE_REFERRALS 0x00000001
114 #define DFS_PROPERTY_FLAG_ROOT_SCALABILITY 0x00000002
115 #define DFS_PROPERTY_FLAG_SITE_COSTING 0x00000004
116 #define DFS_PROPERTY_FLAG_TARGET_FAILBACK 0x00000008
117 #define DFS_PROPERTY_FLAG_CLUSTER_ENABLED 0x00000010
118 #define DFS_PROPERTY_FLAG_ABDE 0x00000020
120 #define DFS_NAME_MAX MAXNAMELEN
121 #define DFS_PATH_MAX MAXPATHLEN
122 #define DFS_COMMENT_MAX 256
123 #define DFS_SRVNAME_MAX MAXNAMELEN
125 #define DFS_REPARSE_SVCTYPE "SMB-DFS"
127 #define DFS_OBJECT_LINK 1
128 #define DFS_OBJECT_ROOT 2
129 #define DFS_OBJECT_ANY 3
132 * Referral Request Types
135 DFS_REFERRAL_INVALID
= 0,
143 typedef struct dfs_target_priority
{
144 dfs_target_pclass_t p_class
;
146 } dfs_target_priority_t
;
149 * t_server a null-terminated Unicode string that specifies the DFS link
152 * t_share a null-terminated Unicode DFS link target share name string.
153 * This may also be a share name with a path relative to the share,
154 * for example, "share1\mydir1\mydir2". When specified this way,
155 * each pathname component MUST be a directory
157 * t_state valid states are online/offline (see DFS_STORAGE_STATE_XXX in
160 * t_priority priority class and rank
162 typedef struct dfs_target
{
163 char t_server
[DFS_SRVNAME_MAX
];
164 char t_share
[DFS_NAME_MAX
];
166 dfs_target_priority_t t_priority
;
169 typedef struct dfs_info
{
170 char i_uncpath
[DFS_PATH_MAX
];
171 char i_comment
[DFS_COMMENT_MAX
];
172 char i_guid
[UUID_PRINTABLE_STRING_LENGTH
];
175 uint32_t i_propflag_mask
;
176 uint32_t i_propflags
;
179 dfs_target_t
*i_targets
;
188 #endif /* _SMB_DFS_H */