| 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 3 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, see <http://www.gnu.org/licenses/>. | 
|---|
| 19 |  | 
|---|
| 20 | */ | 
|---|
| 21 |  | 
|---|
| 22 | #ifndef _MSDFS_H | 
|---|
| 23 | #define _MSDFS_H | 
|---|
| 24 |  | 
|---|
| 25 | #define REFERRAL_TTL 600 | 
|---|
| 26 |  | 
|---|
| 27 | /* Flags used in trans2 Get Referral reply */ | 
|---|
| 28 | #define DFSREF_REFERRAL_SERVER 0x1 | 
|---|
| 29 | #define DFSREF_STORAGE_SERVER  0x2 | 
|---|
| 30 |  | 
|---|
| 31 | /* Referral sizes */ | 
|---|
| 32 | #define VERSION2_REFERRAL_SIZE 0x16 | 
|---|
| 33 | #define VERSION3_REFERRAL_SIZE 0x22 | 
|---|
| 34 | #define REFERRAL_HEADER_SIZE 0x08 | 
|---|
| 35 |  | 
|---|
| 36 | /* Maximum number of referrals for each Dfs volume */ | 
|---|
| 37 | #define MAX_REFERRAL_COUNT   256 | 
|---|
| 38 | #define MAX_MSDFS_JUNCTIONS 256 | 
|---|
| 39 |  | 
|---|
| 40 | typedef struct _client_referral { | 
|---|
| 41 | uint32 proximity; | 
|---|
| 42 | uint32 ttl; | 
|---|
| 43 | char *dfspath; | 
|---|
| 44 | } CLIENT_DFS_REFERRAL; | 
|---|
| 45 |  | 
|---|
| 46 | struct referral { | 
|---|
| 47 | char *alternate_path; /* contains the path referred */ | 
|---|
| 48 | uint32 proximity; | 
|---|
| 49 | uint32 ttl; /* how long should client cache referral */ | 
|---|
| 50 | }; | 
|---|
| 51 |  | 
|---|
| 52 | struct junction_map { | 
|---|
| 53 | char *service_name; | 
|---|
| 54 | char *volume_name; | 
|---|
| 55 | const char *comment; | 
|---|
| 56 | int referral_count; | 
|---|
| 57 | struct referral* referral_list; | 
|---|
| 58 | }; | 
|---|
| 59 |  | 
|---|
| 60 | struct dfs_path { | 
|---|
| 61 | char *hostname; | 
|---|
| 62 | char *servicename; | 
|---|
| 63 | char *reqpath; | 
|---|
| 64 | bool posix_path; | 
|---|
| 65 | }; | 
|---|
| 66 |  | 
|---|
| 67 | #define init_dfsroot(conn, inbuf, outbuf)                       \ | 
|---|
| 68 | { if (lp_msdfs_root(SNUM(conn)) && lp_host_msdfs()) {           \ | 
|---|
| 69 | DEBUG(2,("Serving %s as a Dfs root\n",                  \ | 
|---|
| 70 | lp_servicename(SNUM(conn)) ));                 \ | 
|---|
| 71 | SSVAL(outbuf, smb_vwv2, SMB_SHARE_IN_DFS                \ | 
|---|
| 72 | | SVAL(outbuf, smb_vwv2));                        \ | 
|---|
| 73 | } } | 
|---|
| 74 |  | 
|---|
| 75 | #endif /* _MSDFS_H */ | 
|---|