2 * Unix SMB/Netbios implementation.
4 * RPC Pipe client / server routines for Dfs
5 * Copyright (C) Andrew Tridgell 1992-1997,
6 * Copyright (C) Luke Kenneth Casson Leighton 1996-1997,
7 * Copyright (C) Shirish Kalele 2000.
8 * Copyright (C) Jeremy Allison 2001.
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
25 /* This is the interface to the dfs pipe. */
30 #define MAX_MSDFS_JUNCTIONS 256
32 extern int DEBUGLEVEL;
33 extern pstring global_myname;
37 /**********************************************************************
39 **********************************************************************/
41 static BOOL api_dfs_exist(pipes_struct *p)
45 prs_struct *data = &p->in_data.data;
46 prs_struct *rdata = &p->out_data.rdata;
48 if(!dfs_io_q_dfs_exist("", &q_u, data, 0))
51 r_u.status = _dfs_exist(p, &q_u, &r_u);
53 if (!dfs_io_r_dfs_exist("", &r_u, rdata, 0))
59 /*****************************************************************
61 *****************************************************************/
63 static BOOL api_dfs_add(pipes_struct *p)
67 prs_struct *data = &p->in_data.data;
68 prs_struct *rdata = &p->out_data.rdata;
73 if(!dfs_io_q_dfs_add("", &q_u, data, 0))
76 r_u.status = _dfs_add(p, &q_u, &r_u);
78 if (!dfs_io_r_dfs_add("", &r_u, rdata, 0))
84 /*****************************************************************
86 *****************************************************************/
88 static BOOL api_dfs_remove(pipes_struct *p)
92 prs_struct *data = &p->in_data.data;
93 prs_struct *rdata = &p->out_data.rdata;
98 if(!dfs_io_q_dfs_remove("", &q_u, data, 0))
101 r_u.status = _dfs_remove(p, &q_u, &r_u);
103 if (!dfs_io_r_dfs_remove("", &r_u, rdata, 0))
109 /*******************************************************************
111 *******************************************************************/
113 static BOOL api_dfs_get_info(pipes_struct *p)
115 DFS_Q_DFS_GET_INFO q_u;
116 DFS_R_DFS_GET_INFO r_u;
117 prs_struct *data = &p->in_data.data;
118 prs_struct *rdata = &p->out_data.rdata;
123 if(!dfs_io_q_dfs_get_info("", &q_u, data, 0))
126 r_u.status = _dfs_get_info(p, &q_u, &r_u);
128 if(!dfs_io_r_dfs_get_info("", &r_u, rdata, 0))
134 /*******************************************************************
136 *******************************************************************/
138 static BOOL api_dfs_enum(pipes_struct *p)
142 prs_struct *data = &p->in_data.data;
143 prs_struct *rdata = &p->out_data.rdata;
148 if(!dfs_io_q_dfs_enum("", &q_u, data, 0))
151 r_u.status = _dfs_enum(p, &q_u, &r_u);
153 if(!dfs_io_r_dfs_enum("", &r_u, rdata, 0))
159 /*******************************************************************
160 \pipe\netdfs commands
161 ********************************************************************/
163 struct api_struct api_netdfs_cmds[] =
165 {"DFS_EXIST", DFS_EXIST, api_dfs_exist },
166 {"DFS_ADD", DFS_ADD, api_dfs_add },
167 {"DFS_REMOVE", DFS_REMOVE, api_dfs_remove },
168 {"DFS_GET_INFO", DFS_GET_INFO, api_dfs_get_info },
169 {"DFS_ENUM", DFS_ENUM, api_dfs_enum },
173 /*******************************************************************
174 receives a netdfs pipe and responds.
175 ********************************************************************/
177 BOOL api_netdfs_rpc(pipes_struct *p)
179 return api_rpcTNP(p, "api_netdfs_rpc", api_netdfs_cmds);
184 void dfs_dummy(void) {;} /* So some compilers don't complain. */