0001-01-01 02:30:17 +02:30
/*
0001-01-01 02:30:17 +02:30
Unix SMB / Netbios implementation .
Version 3.0
0001-01-01 02:30:17 +02:30
MSDfs services for Samba
Copyright ( C ) Shirish Kalele 2000
This program is free software ; you can redistribute it and / or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation ; either version 2 of the License , or
( at your option ) any later version .
This program is distributed in the hope that it will be useful ,
but WITHOUT ANY WARRANTY ; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the
GNU General Public License for more details .
You should have received a copy of the GNU General Public License
along with this program ; if not , write to the Free Software
Foundation , Inc . , 675 Mass Ave , Cambridge , MA 0213 9 , USA .
0001-01-01 02:30:17 +02:30
0001-01-01 02:30:17 +02:30
*/
# ifndef _MSDFS_H
# define _MSDFS_H
# define REFERRAL_TTL 600
/* Flags used in trans2 Get Referral reply */
# define DFSREF_REFERRAL_SERVER 0x1
# define DFSREF_STORAGE_SERVER 0x2
0001-01-01 02:30:17 +02:30
/* Referral sizes */
# define VERSION2_REFERRAL_SIZE 0x16
# define VERSION3_REFERRAL_SIZE 0x22
# define REFERRAL_HEADER_SIZE 0x08
/* Maximum number of referrals for each Dfs volume */
# define MAX_REFERRAL_COUNT 256
0001-01-01 02:30:17 +02:30
struct referral
{
0001-01-01 02:30:17 +02:30
pstring alternate_path ; /* contains the path referred */
0001-01-01 02:30:17 +02:30
uint32 proximity ;
uint32 ttl ; /* how long should client cache referral */
} ;
struct junction_map
{
pstring service_name ;
pstring volume_name ;
int referral_count ;
struct referral * referral_list ;
} ;
0001-01-01 02:30:17 +02:30
struct dfs_path
{
0001-01-01 02:30:17 +02:30
pstring hostname ;
pstring servicename ;
pstring reqpath ;
0001-01-01 02:30:17 +02:30
} ;
0001-01-01 02:30:17 +02:30
# define RESOLVE_DFSPATH(name, conn, inbuf, outbuf) \
{ if ( ( SVAL ( inbuf , smb_flg2 ) & FLAGS2_DFS_PATHNAMES ) & & \
lp_host_msdfs ( ) & & lp_msdfs_root ( SNUM ( conn ) ) & & \
dfs_redirect ( name , conn , False ) ) \
return ERROR_BOTH ( NT_STATUS_PATH_NOT_COVERED , \
ERRSRV , ERRbadpath ) ; ; }
# define RESOLVE_FINDFIRST_DFSPATH(name, conn, inbuf, outbuf) \
{ if ( ( SVAL ( inbuf , smb_flg2 ) & FLAGS2_DFS_PATHNAMES ) | | \
( ( get_remote_arch ( ) = = RA_WIN95 ) & & lp_msdfs_root ( SNUM ( conn ) ) ) ) \
if ( lp_host_msdfs ( ) & & dfs_redirect ( name , conn , True ) ) \
return ERROR_BOTH ( NT_STATUS_PATH_NOT_COVERED , \
ERRSRV , ERRbadpath ) ; ; }
0001-01-01 02:30:17 +02:30
0001-01-01 02:30:17 +02:30
# define init_dfsroot(conn, inbuf, outbuf) \
{ if ( lp_msdfs_root ( SNUM ( conn ) ) & & lp_host_msdfs ( ) ) { \
DEBUG ( 2 , ( " Serving %s as a Dfs root \n " , \
lp_servicename ( SNUM ( conn ) ) ) ) ; \
SSVAL ( outbuf , smb_vwv2 , SMB_SHARE_IN_DFS \
| SVAL ( outbuf , smb_vwv2 ) ) ; \
} }
0001-01-01 02:30:17 +02:30
# endif /* _MSDFS_H */