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/>.
23 #include "rpc_server/dcerpc_server.h"
24 #include "librpc/gen_ndr/ndr_wkssvc.h"
25 #include "rpc_server/common/common.h"
26 #include "param/param.h"
29 wkssvc_NetWkstaGetInfo
31 static WERROR
dcesrv_wkssvc_NetWkstaGetInfo(struct dcesrv_call_state
*dce_call
, TALLOC_CTX
*mem_ctx
,
32 struct wkssvc_NetWkstaGetInfo
*r
)
34 struct dcesrv_context
*dce_ctx
= dce_call
->conn
->dce_ctx
;
35 struct dcerpc_server_info
*server_info
= lp_dcerpc_server_info(mem_ctx
, dce_ctx
->lp_ctx
);
38 r
->out
.info
= talloc_zero(mem_ctx
, union wkssvc_NetWkstaInfo
);
39 W_ERROR_HAVE_NO_MEMORY(r
->out
.info
);
41 /* NOTE: win2k3 ignores r->in.server_name completly so we do --metze */
46 struct wkssvc_NetWkstaInfo100
*info100
;
48 info100
= talloc(mem_ctx
, struct wkssvc_NetWkstaInfo100
);
49 W_ERROR_HAVE_NO_MEMORY(info100
);
51 info100
->platform_id
= dcesrv_common_get_platform_id(mem_ctx
, dce_ctx
);
52 info100
->server_name
= dcesrv_common_get_server_name(mem_ctx
, dce_ctx
, NULL
);
53 W_ERROR_HAVE_NO_MEMORY(info100
->server_name
);
54 info100
->domain_name
= talloc_reference(mem_ctx
, server_info
->domain_name
);
55 W_ERROR_HAVE_NO_MEMORY(info100
->domain_name
);
56 info100
->version_major
= server_info
->version_major
;
57 info100
->version_minor
= server_info
->version_minor
;
59 r
->out
.info
->info100
= info100
;
64 struct wkssvc_NetWkstaInfo101
*info101
;
66 info101
= talloc(mem_ctx
, struct wkssvc_NetWkstaInfo101
);
67 W_ERROR_HAVE_NO_MEMORY(info101
);
69 info101
->platform_id
= dcesrv_common_get_platform_id(mem_ctx
, dce_ctx
);
70 info101
->server_name
= dcesrv_common_get_server_name(mem_ctx
, dce_ctx
, NULL
);
71 W_ERROR_HAVE_NO_MEMORY(info101
->server_name
);
72 info101
->domain_name
= talloc_reference(mem_ctx
, server_info
->domain_name
);
73 W_ERROR_HAVE_NO_MEMORY(info101
->domain_name
);
74 info101
->version_major
= server_info
->version_major
;
75 info101
->version_minor
= server_info
->version_minor
;
76 info101
->lan_root
= dcesrv_common_get_lan_root(mem_ctx
, dce_ctx
);
78 r
->out
.info
->info101
= info101
;
83 return WERR_ACCESS_DENIED
;
87 return WERR_ACCESS_DENIED
;
90 return WERR_UNKNOWN_LEVEL
;
93 return WERR_UNKNOWN_LEVEL
;
98 wkssvc_NetWkstaSetInfo
100 static WERROR
dcesrv_wkssvc_NetWkstaSetInfo(struct dcesrv_call_state
*dce_call
, TALLOC_CTX
*mem_ctx
,
101 struct wkssvc_NetWkstaSetInfo
*r
)
103 DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR
);
108 wkssvc_NetWkstaEnumUsers
110 static WERROR
dcesrv_wkssvc_NetWkstaEnumUsers(struct dcesrv_call_state
*dce_call
, TALLOC_CTX
*mem_ctx
,
111 struct wkssvc_NetWkstaEnumUsers
*r
)
113 DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR
);
118 wkssvc_NetrWkstaUserGetInfo
120 static WERROR
dcesrv_wkssvc_NetrWkstaUserGetInfo(struct dcesrv_call_state
*dce_call
, TALLOC_CTX
*mem_ctx
,
121 struct wkssvc_NetrWkstaUserGetInfo
*r
)
123 DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR
);
128 wkssvc_NetrWkstaUserSetInfo
130 static WERROR
dcesrv_wkssvc_NetrWkstaUserSetInfo(struct dcesrv_call_state
*dce_call
, TALLOC_CTX
*mem_ctx
,
131 struct wkssvc_NetrWkstaUserSetInfo
*r
)
133 DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR
);
138 wkssvc_NetWkstaTransportEnum
140 static WERROR
dcesrv_wkssvc_NetWkstaTransportEnum(struct dcesrv_call_state
*dce_call
, TALLOC_CTX
*mem_ctx
,
141 struct wkssvc_NetWkstaTransportEnum
*r
)
143 r
->out
.total_entries
= 0;
144 r
->out
.resume_handle
= NULL
;
146 switch (r
->in
.info
->level
) {
148 r
->out
.info
= talloc(mem_ctx
, struct wkssvc_NetWkstaTransportInfo
);
149 W_ERROR_HAVE_NO_MEMORY(r
->out
.info
);
150 r
->out
.info
->level
= r
->in
.info
->level
;
151 r
->out
.info
->ctr
.ctr0
= talloc(mem_ctx
, struct wkssvc_NetWkstaTransportCtr0
);
152 W_ERROR_HAVE_NO_MEMORY(r
->out
.info
->ctr
.ctr0
);
154 r
->out
.info
->ctr
.ctr0
->count
= 0;
155 r
->out
.info
->ctr
.ctr0
->array
= NULL
;
157 return WERR_NOT_SUPPORTED
;
160 return WERR_UNKNOWN_LEVEL
;
163 return WERR_UNKNOWN_LEVEL
;
168 wkssvc_NetrWkstaTransportAdd
170 static WERROR
dcesrv_wkssvc_NetrWkstaTransportAdd(struct dcesrv_call_state
*dce_call
, TALLOC_CTX
*mem_ctx
,
171 struct wkssvc_NetrWkstaTransportAdd
*r
)
173 DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR
);
178 wkssvc_NetrWkstaTransportDel
180 static WERROR
dcesrv_wkssvc_NetrWkstaTransportDel(struct dcesrv_call_state
*dce_call
, TALLOC_CTX
*mem_ctx
,
181 struct wkssvc_NetrWkstaTransportDel
*r
)
183 DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR
);
190 static WERROR
dcesrv_wkssvc_NetrUseAdd(struct dcesrv_call_state
*dce_call
, TALLOC_CTX
*mem_ctx
,
191 struct wkssvc_NetrUseAdd
*r
)
193 DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR
);
198 wkssvc_NetrUseGetInfo
200 static WERROR
dcesrv_wkssvc_NetrUseGetInfo(struct dcesrv_call_state
*dce_call
, TALLOC_CTX
*mem_ctx
,
201 struct wkssvc_NetrUseGetInfo
*r
)
203 DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR
);
210 static WERROR
dcesrv_wkssvc_NetrUseDel(struct dcesrv_call_state
*dce_call
, TALLOC_CTX
*mem_ctx
,
211 struct wkssvc_NetrUseDel
*r
)
213 DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR
);
220 static WERROR
dcesrv_wkssvc_NetrUseEnum(struct dcesrv_call_state
*dce_call
, TALLOC_CTX
*mem_ctx
,
221 struct wkssvc_NetrUseEnum
*r
)
223 DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR
);
228 wkssvc_NetrMessageBufferSend
230 static WERROR
dcesrv_wkssvc_NetrMessageBufferSend(struct dcesrv_call_state
*dce_call
, TALLOC_CTX
*mem_ctx
,
231 struct wkssvc_NetrMessageBufferSend
*r
)
233 DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR
);
238 wkssvc_NetrWorkstationStatisticsGet
240 static WERROR
dcesrv_wkssvc_NetrWorkstationStatisticsGet(struct dcesrv_call_state
*dce_call
, TALLOC_CTX
*mem_ctx
,
241 struct wkssvc_NetrWorkstationStatisticsGet
*r
)
243 DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR
);
248 wkssvc_NetrLogonDomainNameAdd
250 static WERROR
dcesrv_wkssvc_NetrLogonDomainNameAdd(struct dcesrv_call_state
*dce_call
, TALLOC_CTX
*mem_ctx
,
251 struct wkssvc_NetrLogonDomainNameAdd
*r
)
253 DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR
);
258 wkssvc_NetrLogonDomainNameDel
260 static WERROR
dcesrv_wkssvc_NetrLogonDomainNameDel(struct dcesrv_call_state
*dce_call
, TALLOC_CTX
*mem_ctx
,
261 struct wkssvc_NetrLogonDomainNameDel
*r
)
263 DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR
);
268 wkssvc_NetrJoinDomain
270 static WERROR
dcesrv_wkssvc_NetrJoinDomain(struct dcesrv_call_state
*dce_call
, TALLOC_CTX
*mem_ctx
,
271 struct wkssvc_NetrJoinDomain
*r
)
273 DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR
);
278 wkssvc_NetrUnjoinDomain
280 static WERROR
dcesrv_wkssvc_NetrUnjoinDomain(struct dcesrv_call_state
*dce_call
, TALLOC_CTX
*mem_ctx
,
281 struct wkssvc_NetrUnjoinDomain
*r
)
283 DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR
);
288 wkssvc_NetrRenameMachineInDomain
290 static WERROR
dcesrv_wkssvc_NetrRenameMachineInDomain(struct dcesrv_call_state
*dce_call
, TALLOC_CTX
*mem_ctx
,
291 struct wkssvc_NetrRenameMachineInDomain
*r
)
293 DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR
);
298 wkssvc_NetrValidateName
300 static WERROR
dcesrv_wkssvc_NetrValidateName(struct dcesrv_call_state
*dce_call
, TALLOC_CTX
*mem_ctx
,
301 struct wkssvc_NetrValidateName
*r
)
303 DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR
);
308 wkssvc_NetrGetJoinInformation
310 static WERROR
dcesrv_wkssvc_NetrGetJoinInformation(struct dcesrv_call_state
*dce_call
, TALLOC_CTX
*mem_ctx
,
311 struct wkssvc_NetrGetJoinInformation
*r
)
313 DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR
);
318 wkssvc_NetrGetJoinableOus
320 static WERROR
dcesrv_wkssvc_NetrGetJoinableOus(struct dcesrv_call_state
*dce_call
, TALLOC_CTX
*mem_ctx
,
321 struct wkssvc_NetrGetJoinableOus
*r
)
323 DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR
);
328 WKSSVC_NETRJOINDOMAIN2
330 static WERROR
dcesrv_wkssvc_NetrJoinDomain2(struct dcesrv_call_state
*dce_call
, TALLOC_CTX
*mem_ctx
,
331 struct wkssvc_NetrJoinDomain2
*r
)
333 DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR
);
338 WKSSVC_NETRUNJOINDOMAIN2
340 static WERROR
dcesrv_wkssvc_NetrUnjoinDomain2(struct dcesrv_call_state
*dce_call
, TALLOC_CTX
*mem_ctx
,
341 struct wkssvc_NetrUnjoinDomain2
*r
)
343 DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR
);
348 wkssvc_NetrRenameMachineInDomain2
350 static WERROR
dcesrv_wkssvc_NetrRenameMachineInDomain2(struct dcesrv_call_state
*dce_call
, TALLOC_CTX
*mem_ctx
,
351 struct wkssvc_NetrRenameMachineInDomain2
*r
)
353 DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR
);
358 wkssvc_NetrValidateName2
360 static WERROR
dcesrv_wkssvc_NetrValidateName2(struct dcesrv_call_state
*dce_call
, TALLOC_CTX
*mem_ctx
,
361 struct wkssvc_NetrValidateName2
*r
)
363 DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR
);
368 wkssvc_NetrGetJoinableOus2
370 static WERROR
dcesrv_wkssvc_NetrGetJoinableOus2(struct dcesrv_call_state
*dce_call
, TALLOC_CTX
*mem_ctx
,
371 struct wkssvc_NetrGetJoinableOus2
*r
)
373 DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR
);
378 wkssvc_NetrAddAlternateComputername
380 static WERROR
dcesrv_wkssvc_NetrAddAlternateComputerName(struct dcesrv_call_state
*dce_call
, TALLOC_CTX
*mem_ctx
,
381 struct wkssvc_NetrAddAlternateComputerName
*r
)
383 DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR
);
388 wkssvc_NetrRemoveAlternateComputername
390 static WERROR
dcesrv_wkssvc_NetrRemoveAlternateComputerName(struct dcesrv_call_state
*dce_call
, TALLOC_CTX
*mem_ctx
,
391 struct wkssvc_NetrRemoveAlternateComputerName
*r
)
393 DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR
);
398 wkssvc_NetrSetPrimaryComputername
400 static WERROR
dcesrv_wkssvc_NetrSetPrimaryComputername(struct dcesrv_call_state
*dce_call
, TALLOC_CTX
*mem_ctx
,
401 struct wkssvc_NetrSetPrimaryComputername
*r
)
403 DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR
);
408 wkssvc_NetrEnumerateComputerNames
410 static WERROR
dcesrv_wkssvc_NetrEnumerateComputerNames(struct dcesrv_call_state
*dce_call
, TALLOC_CTX
*mem_ctx
,
411 struct wkssvc_NetrEnumerateComputerNames
*r
)
413 DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR
);
417 /* include the generated boilerplate */
418 #include "librpc/gen_ndr/ndr_wkssvc_s.c"