librpc: Shorten dcerpc_binding_handle_call a bit
[Samba/gebeck_regimport.git] / source4 / rpc_server / wkssvc / dcesrv_wkssvc.c
blob80a518c17c5b493b247efd1c1ef3566e52ba1b06
1 /*
2 Unix SMB/CIFS implementation.
4 endpoint server for the wkssvc pipe
6 Copyright (C) Stefan (metze) Metzmacher 2004
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 3 of the License, or
11 (at your option) any later version.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program. If not, see <http://www.gnu.org/licenses/>.
22 #include "includes.h"
23 #include "rpc_server/dcerpc_server.h"
24 #include "librpc/gen_ndr/ndr_wkssvc.h"
25 #include "librpc/gen_ndr/ndr_srvsvc.h"
26 #include "rpc_server/common/common.h"
27 #include "rpc_server/common/share.h"
28 #include "param/param.h"
31 wkssvc_NetWkstaGetInfo
33 static WERROR dcesrv_wkssvc_NetWkstaGetInfo(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
34 struct wkssvc_NetWkstaGetInfo *r)
36 struct dcesrv_context *dce_ctx = dce_call->conn->dce_ctx;
37 struct dcerpc_server_info *server_info = lpcfg_dcerpc_server_info(mem_ctx, dce_ctx->lp_ctx);
39 /* NOTE: win2k3 ignores r->in.server_name completly so we do --metze */
41 switch(r->in.level) {
42 case 100:
44 struct wkssvc_NetWkstaInfo100 *info100;
46 info100 = talloc(mem_ctx, struct wkssvc_NetWkstaInfo100);
47 W_ERROR_HAVE_NO_MEMORY(info100);
49 info100->platform_id = dcesrv_common_get_platform_id(mem_ctx, dce_ctx);
50 info100->server_name = dcesrv_common_get_server_name(mem_ctx, dce_ctx, NULL);
51 W_ERROR_HAVE_NO_MEMORY(info100->server_name);
52 info100->domain_name = server_info->domain_name;
53 info100->version_major = server_info->version_major;
54 info100->version_minor = server_info->version_minor;
56 r->out.info->info100 = info100;
57 return WERR_OK;
59 case 101:
61 struct wkssvc_NetWkstaInfo101 *info101;
63 info101 = talloc(mem_ctx, struct wkssvc_NetWkstaInfo101);
64 W_ERROR_HAVE_NO_MEMORY(info101);
66 info101->platform_id = dcesrv_common_get_platform_id(mem_ctx, dce_ctx);
67 info101->server_name = dcesrv_common_get_server_name(mem_ctx, dce_ctx, NULL);
68 W_ERROR_HAVE_NO_MEMORY(info101->server_name);
69 info101->domain_name = server_info->domain_name;
70 info101->version_major = server_info->version_major;
71 info101->version_minor = server_info->version_minor;
72 info101->lan_root = dcesrv_common_get_lan_root(mem_ctx, dce_ctx);
74 r->out.info->info101 = info101;
75 return WERR_OK;
77 case 102:
79 return WERR_ACCESS_DENIED;
81 case 502:
83 return WERR_ACCESS_DENIED;
85 default:
86 return WERR_UNKNOWN_LEVEL;
92 wkssvc_NetWkstaSetInfo
94 static WERROR dcesrv_wkssvc_NetWkstaSetInfo(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
95 struct wkssvc_NetWkstaSetInfo *r)
97 DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR);
102 wkssvc_NetWkstaEnumUsers
104 static WERROR dcesrv_wkssvc_NetWkstaEnumUsers(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
105 struct wkssvc_NetWkstaEnumUsers *r)
107 DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR);
112 wkssvc_NetrWkstaUserGetInfo
114 static WERROR dcesrv_wkssvc_NetrWkstaUserGetInfo(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
115 struct wkssvc_NetrWkstaUserGetInfo *r)
117 DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR);
122 wkssvc_NetrWkstaUserSetInfo
124 static WERROR dcesrv_wkssvc_NetrWkstaUserSetInfo(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
125 struct wkssvc_NetrWkstaUserSetInfo *r)
127 DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR);
132 wkssvc_NetWkstaTransportEnum
134 static WERROR dcesrv_wkssvc_NetWkstaTransportEnum(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
135 struct wkssvc_NetWkstaTransportEnum *r)
137 switch (r->in.info->level) {
138 case 0:
139 r->out.info->ctr.ctr0 = talloc(mem_ctx, struct wkssvc_NetWkstaTransportCtr0);
140 W_ERROR_HAVE_NO_MEMORY(r->out.info->ctr.ctr0);
142 r->out.info->ctr.ctr0->count = 0;
143 r->out.info->ctr.ctr0->array = NULL;
145 return WERR_NOT_SUPPORTED;
147 default:
148 return WERR_UNKNOWN_LEVEL;
154 wkssvc_NetrWkstaTransportAdd
156 static WERROR dcesrv_wkssvc_NetrWkstaTransportAdd(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
157 struct wkssvc_NetrWkstaTransportAdd *r)
159 DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR);
164 wkssvc_NetrWkstaTransportDel
166 static WERROR dcesrv_wkssvc_NetrWkstaTransportDel(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
167 struct wkssvc_NetrWkstaTransportDel *r)
169 DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR);
174 wkssvc_NetrUseAdd
176 static WERROR dcesrv_wkssvc_NetrUseAdd(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
177 struct wkssvc_NetrUseAdd *r)
179 DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR);
184 wkssvc_NetrUseGetInfo
186 static WERROR dcesrv_wkssvc_NetrUseGetInfo(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
187 struct wkssvc_NetrUseGetInfo *r)
189 DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR);
194 wkssvc_NetrUseDel
196 static WERROR dcesrv_wkssvc_NetrUseDel(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
197 struct wkssvc_NetrUseDel *r)
199 DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR);
204 wkssvc_NetrUseEnum
206 static WERROR dcesrv_wkssvc_NetrUseEnum(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
207 struct wkssvc_NetrUseEnum *r)
209 DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR);
214 wkssvc_NetrMessageBufferSend
216 static WERROR dcesrv_wkssvc_NetrMessageBufferSend(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
217 struct wkssvc_NetrMessageBufferSend *r)
219 DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR);
224 wkssvc_NetrWorkstationStatisticsGet
226 static WERROR dcesrv_wkssvc_NetrWorkstationStatisticsGet(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
227 struct wkssvc_NetrWorkstationStatisticsGet *r)
229 DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR);
234 wkssvc_NetrLogonDomainNameAdd
236 static WERROR dcesrv_wkssvc_NetrLogonDomainNameAdd(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
237 struct wkssvc_NetrLogonDomainNameAdd *r)
239 DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR);
244 wkssvc_NetrLogonDomainNameDel
246 static WERROR dcesrv_wkssvc_NetrLogonDomainNameDel(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
247 struct wkssvc_NetrLogonDomainNameDel *r)
249 DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR);
254 wkssvc_NetrJoinDomain
256 static WERROR dcesrv_wkssvc_NetrJoinDomain(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
257 struct wkssvc_NetrJoinDomain *r)
259 DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR);
264 wkssvc_NetrUnjoinDomain
266 static WERROR dcesrv_wkssvc_NetrUnjoinDomain(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
267 struct wkssvc_NetrUnjoinDomain *r)
269 DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR);
274 wkssvc_NetrRenameMachineInDomain
276 static WERROR dcesrv_wkssvc_NetrRenameMachineInDomain(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
277 struct wkssvc_NetrRenameMachineInDomain *r)
279 DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR);
284 wkssvc_NetrValidateName
286 static WERROR dcesrv_wkssvc_NetrValidateName(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
287 struct wkssvc_NetrValidateName *r)
289 DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR);
294 wkssvc_NetrGetJoinInformation
296 static WERROR dcesrv_wkssvc_NetrGetJoinInformation(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
297 struct wkssvc_NetrGetJoinInformation *r)
299 DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR);
304 wkssvc_NetrGetJoinableOus
306 static WERROR dcesrv_wkssvc_NetrGetJoinableOus(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
307 struct wkssvc_NetrGetJoinableOus *r)
309 DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR);
314 WKSSVC_NETRJOINDOMAIN2
316 static WERROR dcesrv_wkssvc_NetrJoinDomain2(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
317 struct wkssvc_NetrJoinDomain2 *r)
319 DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR);
324 WKSSVC_NETRUNJOINDOMAIN2
326 static WERROR dcesrv_wkssvc_NetrUnjoinDomain2(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
327 struct wkssvc_NetrUnjoinDomain2 *r)
329 DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR);
334 wkssvc_NetrRenameMachineInDomain2
336 static WERROR dcesrv_wkssvc_NetrRenameMachineInDomain2(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
337 struct wkssvc_NetrRenameMachineInDomain2 *r)
339 DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR);
344 wkssvc_NetrValidateName2
346 static WERROR dcesrv_wkssvc_NetrValidateName2(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
347 struct wkssvc_NetrValidateName2 *r)
349 DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR);
354 wkssvc_NetrGetJoinableOus2
356 static WERROR dcesrv_wkssvc_NetrGetJoinableOus2(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
357 struct wkssvc_NetrGetJoinableOus2 *r)
359 DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR);
364 wkssvc_NetrAddAlternateComputername
366 static WERROR dcesrv_wkssvc_NetrAddAlternateComputerName(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
367 struct wkssvc_NetrAddAlternateComputerName *r)
369 DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR);
374 wkssvc_NetrRemoveAlternateComputername
376 static WERROR dcesrv_wkssvc_NetrRemoveAlternateComputerName(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
377 struct wkssvc_NetrRemoveAlternateComputerName *r)
379 DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR);
384 wkssvc_NetrSetPrimaryComputername
386 static WERROR dcesrv_wkssvc_NetrSetPrimaryComputername(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
387 struct wkssvc_NetrSetPrimaryComputername *r)
389 DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR);
394 wkssvc_NetrEnumerateComputerNames
396 static WERROR dcesrv_wkssvc_NetrEnumerateComputerNames(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
397 struct wkssvc_NetrEnumerateComputerNames *r)
399 DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR);
403 /* include the generated boilerplate */
404 #include "librpc/gen_ndr/ndr_wkssvc_s.c"