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.
23 * Copyright 2014 Nexenta Systems, Inc. All rights reserved.
29 #include <sys/param.h>
37 * DFS root or link states
40 * The specified DFS root or DFS link is in the normal state.
42 * DFS_VOLUME_STATE_INCONSISTENT
43 * The internal DFS database is inconsistent with the specified DFS root or
44 * DFS link. Attempts to repair the inconsistency have failed. This is a
45 * read-only state and MUST NOT be set by clients.
47 * DFS_VOLUME_STATE_OFFLINE
48 * The specified DFS root or DFS link is offline or unavailable.
50 * DFS_VOLUME_STATE_ONLINE
51 * The specified DFS root or DFS link is available.
53 * DFS_VOLUME_FLAVOR_STANDALONE Standalone namespace
54 * DFS_VOLUME_FLAVOR_AD_BLOB Domain-based namespace
56 #define DFS_VOLUME_STATE_OK 0x00000001
57 #define DFS_VOLUME_STATE_INCONSISTENT 0x00000002
58 #define DFS_VOLUME_STATE_OFFLINE 0x00000003
59 #define DFS_VOLUME_STATE_ONLINE 0x00000004
60 #define DFS_VOLUME_STATE_RESYNCHRONIZE 0x00000010
61 #define DFS_VOLUME_STATE_STANDBY 0x00000020
62 #define DFS_VOLUME_STATE_FORCE_SYNC 0x00000040
64 #define DFS_VOLUME_FLAVOR_STANDALONE 0x00000100
65 #define DFS_VOLUME_FLAVOR_AD_BLOB 0x00000200
68 * The following bitmasks is only relevant when reading the volume state, not
71 #define DFS_VOLUME_STATES 0x0000000F
72 #define DFS_VOLUME_FLAVORS 0x00000300
75 * States specified by this mask are used to perform a server operation and are
76 * not persisted to the DFS metadata
78 #define DFS_VOLUME_STATES_SRV_OPS 0x00000070
83 #define DFS_STORAGE_STATE_OFFLINE 1
84 #define DFS_STORAGE_STATE_ONLINE 2
87 * Flags for NetrDfsAdd operation:
89 * 0x00000000 This creates a new link or adds a new target to an
92 * DFS_ADD_VOLUME This creates a new link in the DFS namespace if one does
93 * not already exist or fails if a link already exists.
95 * DFS_RESTORE_VOLUME This adds a target without verifying its existence.
97 #define DFS_CREATE_VOLUME 0x00000000
98 #define DFS_ADD_VOLUME 0x00000001
99 #define DFS_RESTORE_VOLUME 0x00000002
101 #define DFS_MOVE_FLAG_REPLACE_IF_EXISTS 1
104 * See also: dfs_target_pclass_xdr()
107 DfsInvalidPriorityClass
= -1,
108 DfsSiteCostNormalPriorityClass
= 0,
109 DfsGlobalHighPriorityClass
= 1,
110 DfsSiteCostHighPriorityClass
= 2,
111 DfsSiteCostLowPriorityClass
= 3,
112 DfsGlobalLowPriorityClass
= 4
113 } dfs_target_pclass_t
;
115 #define DFS_PRIORITY_RANK_MAX 0x001F
117 #define DFS_PROPERTY_FLAG_INSITE_REFERRALS 0x00000001
118 #define DFS_PROPERTY_FLAG_ROOT_SCALABILITY 0x00000002
119 #define DFS_PROPERTY_FLAG_SITE_COSTING 0x00000004
120 #define DFS_PROPERTY_FLAG_TARGET_FAILBACK 0x00000008
121 #define DFS_PROPERTY_FLAG_CLUSTER_ENABLED 0x00000010
122 #define DFS_PROPERTY_FLAG_ABDE 0x00000020
124 #define DFS_NAME_MAX MAXNAMELEN
125 #define DFS_PATH_MAX MAXPATHLEN
126 #define DFS_COMMENT_MAX 256
127 #define DFS_SRVNAME_MAX MAXNAMELEN
129 #define DFS_REPARSE_SVCTYPE "SMB-DFS"
131 #define DFS_OBJECT_LINK 1
132 #define DFS_OBJECT_ROOT 2
133 #define DFS_OBJECT_ANY 3
136 * Referral Request Types
137 * See also: dfs_reftype_xdr()
140 DFS_REFERRAL_INVALID
= 0,
149 * See also: dfs_target_priority_xdr()
151 typedef struct dfs_target_priority
{
152 dfs_target_pclass_t p_class
;
154 } dfs_target_priority_t
;
157 * t_server a null-terminated Unicode string that specifies the DFS link
160 * t_share a null-terminated Unicode DFS link target share name string.
161 * This may also be a share name with a path relative to the share,
162 * for example, "share1\mydir1\mydir2". When specified this way,
163 * each pathname component MUST be a directory
165 * t_state valid states are online/offline (see DFS_STORAGE_STATE_XXX in
168 * t_priority priority class and rank
170 * See also: dfs_target_xdr()
172 typedef struct dfs_target
{
173 char t_server
[DFS_SRVNAME_MAX
];
174 char t_share
[DFS_NAME_MAX
];
176 dfs_target_priority_t t_priority
;
180 * DFS referral response
181 * See also: dfs_info_xdr()
183 typedef struct dfs_info
{
184 char i_uncpath
[DFS_PATH_MAX
];
185 char i_comment
[DFS_COMMENT_MAX
];
186 char i_guid
[UUID_PRINTABLE_STRING_LENGTH
];
189 uint32_t i_propflag_mask
;
190 uint32_t i_propflags
;
193 dfs_target_t
*i_targets
;
202 #endif /* _SMB_DFS_H */