#ifndef _MSDFS_H
#define _MSDFS_H
#define REFERRAL_TTL 600
#define DFSREF_REFERRAL_SERVER 0x1
#define DFSREF_STORAGE_SERVER 0x2
#define VERSION2_REFERRAL_SIZE 0x16
#define VERSION3_REFERRAL_SIZE 0x22
#define REFERRAL_HEADER_SIZE 0x08
#define MAX_REFERRAL_COUNT 256
struct referral
{
pstring alternate_path;
uint32 proximity;
uint32 ttl;
};
struct junction_map
{
pstring service_name;
pstring volume_name;
int referral_count;
struct referral* referral_list;
};
struct dfs_path
{
pstring hostname;
pstring servicename;
pstring reqpath;
};
#ifdef WITH_MSDFS
#define RESOLVE_DFSPATH(name, conn, inbuf, outbuf) \
{ if ((SVAL(inbuf,smb_flg2) & FLAGS2_DFS_PATHNAMES) && \
lp_host_msdfs() && dfs_redirect(name,conn,False)) \
return(dfs_path_error(inbuf,outbuf)); }
#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(dfs_path_error(inbuf,outbuf)); }
#define init_dfsroot(conn, inbuf, outbuf) \
{ if (lp_msdfs_root(SNUM(conn)) && lp_host_msdfs()) { \
DEBUG(1,("Serving %s as a Dfs root\n", lp_servicename(SNUM(conn)) )); \
SSVAL(outbuf, smb_vwv2, SMB_SHARE_IN_DFS | SVAL(outbuf, smb_vwv2)); \
} }
#else
#define RESOLVE_DFSPATH(name, conn, inbuf, outbuf) ;
#define RESOLVE_FINDFIRST_DFSPATH(name, conn, inbuf, outbuf) ;
#define init_dfsroot(conn, inbuf, outbuf) ;
#endif
#endif