source: trunk/samba-3.0.25pre1/source/include/msdfs.h@ 5

Last change on this file since 5 was 1, checked in by Paul Smedley, 18 years ago

Initial code import

File size: 2.9 KB
Line 
1/*
2 Unix SMB/Netbios implementation.
3 Version 3.0
4 MSDfs services for Samba
5 Copyright (C) Shirish Kalele 2000
6
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version.
11
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20
21*/
22
23#ifndef _MSDFS_H
24#define _MSDFS_H
25
26#define REFERRAL_TTL 600
27
28/* Flags used in trans2 Get Referral reply */
29#define DFSREF_REFERRAL_SERVER 0x1
30#define DFSREF_STORAGE_SERVER 0x2
31
32/* Referral sizes */
33#define VERSION2_REFERRAL_SIZE 0x16
34#define VERSION3_REFERRAL_SIZE 0x22
35#define REFERRAL_HEADER_SIZE 0x08
36
37/* Maximum number of referrals for each Dfs volume */
38#define MAX_REFERRAL_COUNT 256
39#define MAX_MSDFS_JUNCTIONS 256
40
41typedef struct _client_referral {
42 uint32 proximity;
43 uint32 ttl;
44 pstring dfspath;
45} CLIENT_DFS_REFERRAL;
46
47struct referral {
48 pstring alternate_path; /* contains the path referred */
49 uint32 proximity;
50 uint32 ttl; /* how long should client cache referral */
51};
52
53struct junction_map {
54 pstring service_name;
55 pstring volume_name;
56 pstring comment;
57 int referral_count;
58 struct referral* referral_list;
59};
60
61struct dfs_path {
62 pstring hostname;
63 pstring servicename;
64 pstring reqpath;
65};
66
67#define RESOLVE_DFSPATH(name, conn, inbuf, outbuf) \
68{ if ((SVAL(inbuf,smb_flg2) & FLAGS2_DFS_PATHNAMES) && \
69 lp_host_msdfs() && lp_msdfs_root(SNUM(conn)) && \
70 dfs_redirect(name, conn, False)) \
71 return ERROR_BOTH(NT_STATUS_PATH_NOT_COVERED, \
72 ERRSRV, ERRbadpath);; }
73
74#define RESOLVE_DFSPATH_STATUS(name, conn, inbuf, outbuf) \
75{ if ((SVAL(inbuf,smb_flg2) & FLAGS2_DFS_PATHNAMES) && \
76 lp_host_msdfs() && lp_msdfs_root(SNUM(conn)) && \
77 dfs_redirect(name, conn, False)) \
78 return NT_STATUS_PATH_NOT_COVERED;; }
79
80#define RESOLVE_DFSPATH_WCARD(name, conn, inbuf, outbuf) \
81{ if ((SVAL(inbuf,smb_flg2) & FLAGS2_DFS_PATHNAMES) && \
82 lp_host_msdfs() && lp_msdfs_root(SNUM(conn)) && \
83 dfs_redirect(name,conn, True)) \
84 return ERROR_BOTH(NT_STATUS_PATH_NOT_COVERED, \
85 ERRSRV, ERRbadpath);; }
86
87#define init_dfsroot(conn, inbuf, outbuf) \
88{ if (lp_msdfs_root(SNUM(conn)) && lp_host_msdfs()) { \
89 DEBUG(2,("Serving %s as a Dfs root\n", \
90 lp_servicename(SNUM(conn)) )); \
91 SSVAL(outbuf, smb_vwv2, SMB_SHARE_IN_DFS \
92 | SVAL(outbuf, smb_vwv2)); \
93} }
94
95#endif /* _MSDFS_H */
Note: See TracBrowser for help on using the repository browser.