This commit was manufactured by cvs2svn to create branch 'SAMBA_TNG'.
[Samba.git] / source / include / msdfs.h
blob0c2e3c14df2d264caa4ef87c8391dc09d60c63bf
1 /*
2 Unix SMB/Netbios implementation.
3 Version 3.0
4 MSDfs services for Samba
5 Copyright (C) Shirish Kalele 2000
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.
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.
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.
22 #ifndef _MSDFS_H
23 #define _MSDFS_H
25 #define REFERRAL_TTL 600
27 /* Flags used in trans2 Get Referral reply */
28 #define DFSREF_REFERRAL_SERVER 0x1
29 #define DFSREF_STORAGE_SERVER 0x2
32 struct referral
34 pstring alternate_path; /* contains the path referred (UNICODE?) */
35 uint32 proximity;
36 uint32 ttl; /* how long should client cache referral */
39 struct junction_map
41 pstring service_name;
42 pstring volume_name;
43 int referral_count;
44 struct referral* referral_list;
47 struct dfs_path
49 pstring hostname;
50 pstring servicename;
51 pstring volumename;
52 pstring restofthepath;
55 #ifdef MS_DFS
57 #define RESOLVE_DFSPATH(name, conn, inbuf, outbuf) \
58 { if(((SVAL(inbuf,smb_flg2) & FLAGS2_DFS_PATHNAMES)) && \
59 dfs_redirect(name,conn)) \
60 return(dfs_path_error(inbuf,outbuf)); }
62 #define RESOLVE_FINDFIRST_DFSPATH(name, conn, inbuf, outbuf) \
63 { if((SVAL(inbuf,smb_flg2) & FLAGS2_DFS_PATHNAMES) || \
64 get_remote_arch()==RA_WIN95) \
65 if(dfs_findfirst_redirect(directory,conn)) \
66 return(dfs_path_error(inbuf,outbuf)); }
68 #define init_dfsroot(conn, inbuf, outbuf) \
69 { if(*lp_dfsmap(SNUM(conn)) && lp_host_msdfs()) { \
70 SSVAL(outbuf, smb_vwv2, SMB_SHARE_IN_DFS | SMB_SUPPORT_SEARCH_BITS); \
71 if(lp_dfsmap_loaded(SNUM(conn))) \
72 msdfs_open(False); \
73 else { \
74 DEBUG(3,("msdfs map database not initialized!\n")); \
75 pstrcpy(lp_dfsmap(SNUM(conn)),""); \
76 } } }
78 #else
79 /* Stub macros */
80 #define RESOLVE_DFSPATH(name, conn, inbuf, outbuf) ;
81 #define RESOLVE_FINDFIRST_DFSPATH(name, conn, inbuf, outbuf) ;
82 #define init_dfsroot(conn, inbuf, outbuf) ;
84 #endif
86 #endif /* _MSDFS_H */