00001 /* 00002 Unix SMB/Netbios implementation. 00003 Version 3.0 00004 MSDfs services for Samba 00005 Copyright (C) Shirish Kalele 2000 00006 00007 This program is free software; you can redistribute it and/or modify 00008 it under the terms of the GNU General Public License as published by 00009 the Free Software Foundation; either version 2 of the License, or 00010 (at your option) any later version. 00011 00012 This program is distributed in the hope that it will be useful, 00013 but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 GNU General Public License for more details. 00016 00017 You should have received a copy of the GNU General Public License 00018 along with this program; if not, write to the Free Software 00019 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 00020 00021 */ 00022 00023 #ifndef _MSDFS_H 00024 #define _MSDFS_H 00025 00026 #define REFERRAL_TTL 600 00027 00028 /* Flags used in trans2 Get Referral reply */ 00029 #define DFSREF_REFERRAL_SERVER 0x1 00030 #define DFSREF_STORAGE_SERVER 0x2 00031 00032 /* Referral sizes */ 00033 #define VERSION2_REFERRAL_SIZE 0x16 00034 #define VERSION3_REFERRAL_SIZE 0x22 00035 #define REFERRAL_HEADER_SIZE 0x08 00036 00037 /* Maximum number of referrals for each Dfs volume */ 00038 #define MAX_REFERRAL_COUNT 256 00039 #define MAX_MSDFS_JUNCTIONS 256 00040 00041 typedef struct _client_referral { 00042 uint32 proximity; 00043 uint32 ttl; 00044 pstring dfspath; 00045 } CLIENT_DFS_REFERRAL; 00046 00047 struct referral { 00048 pstring alternate_path; /* contains the path referred */ 00049 uint32 proximity; 00050 uint32 ttl; /* how long should client cache referral */ 00051 }; 00052 00053 struct junction_map { 00054 fstring service_name; 00055 pstring volume_name; 00056 pstring comment; 00057 int referral_count; 00058 struct referral* referral_list; 00059 }; 00060 00061 struct dfs_path { 00062 fstring hostname; 00063 fstring servicename; 00064 pstring reqpath; 00065 BOOL posix_path; 00066 }; 00067 00068 #define init_dfsroot(conn, inbuf, outbuf) \ 00069 { if (lp_msdfs_root(SNUM(conn)) && lp_host_msdfs()) { \ 00070 DEBUG(2,("Serving %s as a Dfs root\n", \ 00071 lp_servicename(SNUM(conn)) )); \ 00072 SSVAL(outbuf, smb_vwv2, SMB_SHARE_IN_DFS \ 00073 | SVAL(outbuf, smb_vwv2)); \ 00074 } } 00075 00076 #endif /* _MSDFS_H */