| 1 | /*
|
|---|
| 2 | * Unix SMB/CIFS implementation.
|
|---|
| 3 | * RPC Pipe client / server routines
|
|---|
| 4 | *
|
|---|
| 5 | * Copyright (C) Andrew Tridgell 1992-1997,
|
|---|
| 6 | * Copyright (C) Gerald (Jerry) Carter 2006.
|
|---|
| 7 | *
|
|---|
| 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 2 of the License, or
|
|---|
| 11 | * (at your option) any later version.
|
|---|
| 12 | *
|
|---|
| 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.
|
|---|
| 17 | *
|
|---|
| 18 | * You should have received a copy of the GNU General Public License
|
|---|
| 19 | * along with this program; if not, write to the Free Software
|
|---|
| 20 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|---|
| 21 | */
|
|---|
| 22 |
|
|---|
| 23 | /* This is the implementation of the wks interface. */
|
|---|
| 24 |
|
|---|
| 25 | #include "includes.h"
|
|---|
| 26 |
|
|---|
| 27 | #undef DBGC_CLASS
|
|---|
| 28 | #define DBGC_CLASS DBGC_RPC_SRV
|
|---|
| 29 |
|
|---|
| 30 | /*******************************************************************
|
|---|
| 31 | Fill in the valiues for the struct wkssvc_NetWkstaInfo100.
|
|---|
| 32 | ********************************************************************/
|
|---|
| 33 |
|
|---|
| 34 | static void create_wks_info_100(struct wkssvc_NetWkstaInfo100 *info100)
|
|---|
| 35 | {
|
|---|
| 36 | pstring my_name;
|
|---|
| 37 | pstring domain;
|
|---|
| 38 |
|
|---|
| 39 | pstrcpy (my_name, global_myname());
|
|---|
| 40 | strupper_m(my_name);
|
|---|
| 41 |
|
|---|
| 42 | pstrcpy (domain, lp_workgroup());
|
|---|
| 43 | strupper_m(domain);
|
|---|
| 44 |
|
|---|
| 45 | info100->platform_id = 0x000001f4; /* unknown */
|
|---|
| 46 | info100->version_major = lp_major_announce_version();
|
|---|
| 47 | info100->version_minor = lp_minor_announce_version();
|
|---|
| 48 |
|
|---|
| 49 | info100->server_name = talloc_strdup( info100, my_name );
|
|---|
| 50 | info100->domain_name = talloc_strdup( info100, domain );
|
|---|
| 51 |
|
|---|
| 52 | return;
|
|---|
| 53 | }
|
|---|
| 54 |
|
|---|
| 55 | /********************************************************************
|
|---|
| 56 | only supports info level 100 at the moment.
|
|---|
| 57 | ********************************************************************/
|
|---|
| 58 |
|
|---|
| 59 | WERROR _wkssvc_NetWkstaGetInfo( pipes_struct *p, struct wkssvc_NetWkstaGetInfo *r)
|
|---|
| 60 | {
|
|---|
| 61 | struct wkssvc_NetWkstaInfo100 *wks100 = NULL;
|
|---|
| 62 |
|
|---|
| 63 | /* We only support info level 100 currently */
|
|---|
| 64 |
|
|---|
| 65 | if ( r->in.level != 100 ) {
|
|---|
| 66 | return WERR_UNKNOWN_LEVEL;
|
|---|
| 67 | }
|
|---|
| 68 |
|
|---|
| 69 | if ( (wks100 = TALLOC_ZERO_P(p->mem_ctx, struct wkssvc_NetWkstaInfo100)) == NULL ) {
|
|---|
| 70 | return WERR_NOMEM;
|
|---|
| 71 | }
|
|---|
| 72 |
|
|---|
| 73 | create_wks_info_100( wks100 );
|
|---|
| 74 |
|
|---|
| 75 | r->out.info->info100 = wks100;
|
|---|
| 76 |
|
|---|
| 77 | return WERR_OK;
|
|---|
| 78 | }
|
|---|
| 79 |
|
|---|
| 80 | /********************************************************************
|
|---|
| 81 | ********************************************************************/
|
|---|
| 82 |
|
|---|
| 83 | WERROR _wkssvc_NetWkstaSetInfo( pipes_struct *p, struct wkssvc_NetWkstaSetInfo *r)
|
|---|
| 84 | {
|
|---|
| 85 | /* FIXME: Add implementation code here */
|
|---|
| 86 | p->rng_fault_state = True;
|
|---|
| 87 | return WERR_NOT_SUPPORTED;
|
|---|
| 88 | }
|
|---|
| 89 |
|
|---|
| 90 | /********************************************************************
|
|---|
| 91 | ********************************************************************/
|
|---|
| 92 |
|
|---|
| 93 | WERROR _wkssvc_NetWkstaEnumUsers( pipes_struct *p, struct wkssvc_NetWkstaEnumUsers *r)
|
|---|
| 94 | {
|
|---|
| 95 | /* FIXME: Add implementation code here */
|
|---|
| 96 | p->rng_fault_state = True;
|
|---|
| 97 | return WERR_NOT_SUPPORTED;
|
|---|
| 98 | }
|
|---|
| 99 |
|
|---|
| 100 | /********************************************************************
|
|---|
| 101 | ********************************************************************/
|
|---|
| 102 |
|
|---|
| 103 | WERROR _WKSSVC_NETRWKSTAUSERGETINFO( pipes_struct *p, struct WKSSVC_NETRWKSTAUSERGETINFO *r )
|
|---|
| 104 | {
|
|---|
| 105 | /* FIXME: Add implementation code here */
|
|---|
| 106 | p->rng_fault_state = True;
|
|---|
| 107 | return WERR_NOT_SUPPORTED;
|
|---|
| 108 | }
|
|---|
| 109 |
|
|---|
| 110 | /********************************************************************
|
|---|
| 111 | ********************************************************************/
|
|---|
| 112 |
|
|---|
| 113 | WERROR _WKSSVC_NETRWKSTAUSERSETINFO( pipes_struct *p, struct WKSSVC_NETRWKSTAUSERSETINFO *r )
|
|---|
| 114 | {
|
|---|
| 115 | /* FIXME: Add implementation code here */
|
|---|
| 116 | p->rng_fault_state = True;
|
|---|
| 117 | return WERR_NOT_SUPPORTED;
|
|---|
| 118 | }
|
|---|
| 119 |
|
|---|
| 120 | /********************************************************************
|
|---|
| 121 | ********************************************************************/
|
|---|
| 122 |
|
|---|
| 123 | WERROR _wkssvc_NetWkstaTransportEnum( pipes_struct *p, struct wkssvc_NetWkstaTransportEnum *r)
|
|---|
| 124 | {
|
|---|
| 125 | /* FIXME: Add implementation code here */
|
|---|
| 126 | p->rng_fault_state = True;
|
|---|
| 127 | return WERR_NOT_SUPPORTED;
|
|---|
| 128 | }
|
|---|
| 129 |
|
|---|
| 130 | /********************************************************************
|
|---|
| 131 | ********************************************************************/
|
|---|
| 132 |
|
|---|
| 133 | WERROR _WKSSVC_NETRWKSTATRANSPORTADD( pipes_struct *p, struct WKSSVC_NETRWKSTATRANSPORTADD *r )
|
|---|
| 134 | {
|
|---|
| 135 | /* FIXME: Add implementation code here */
|
|---|
| 136 | p->rng_fault_state = True;
|
|---|
| 137 | return WERR_NOT_SUPPORTED;
|
|---|
| 138 | }
|
|---|
| 139 |
|
|---|
| 140 | /********************************************************************
|
|---|
| 141 | ********************************************************************/
|
|---|
| 142 |
|
|---|
| 143 | WERROR _WKSSVC_NETRWKSTATRANSPORTDEL( pipes_struct *p, struct WKSSVC_NETRWKSTATRANSPORTDEL *r )
|
|---|
| 144 | {
|
|---|
| 145 | /* FIXME: Add implementation code here */
|
|---|
| 146 | p->rng_fault_state = True;
|
|---|
| 147 | return WERR_NOT_SUPPORTED;
|
|---|
| 148 | }
|
|---|
| 149 |
|
|---|
| 150 | /********************************************************************
|
|---|
| 151 | ********************************************************************/
|
|---|
| 152 |
|
|---|
| 153 | WERROR _WKSSVC_NETRUSEADD( pipes_struct *p, struct WKSSVC_NETRUSEADD *r )
|
|---|
| 154 | {
|
|---|
| 155 | /* FIXME: Add implementation code here */
|
|---|
| 156 | p->rng_fault_state = True;
|
|---|
| 157 | return WERR_NOT_SUPPORTED;
|
|---|
| 158 | }
|
|---|
| 159 |
|
|---|
| 160 | /********************************************************************
|
|---|
| 161 | ********************************************************************/
|
|---|
| 162 |
|
|---|
| 163 | WERROR _WKSSVC_NETRUSEGETINFO( pipes_struct *p, struct WKSSVC_NETRUSEGETINFO *r )
|
|---|
| 164 | {
|
|---|
| 165 | /* FIXME: Add implementation code here */
|
|---|
| 166 | p->rng_fault_state = True;
|
|---|
| 167 | return WERR_NOT_SUPPORTED;
|
|---|
| 168 | }
|
|---|
| 169 |
|
|---|
| 170 | /********************************************************************
|
|---|
| 171 | ********************************************************************/
|
|---|
| 172 |
|
|---|
| 173 | WERROR _WKSSVC_NETRUSEDEL( pipes_struct *p, struct WKSSVC_NETRUSEDEL *r )
|
|---|
| 174 | {
|
|---|
| 175 | /* FIXME: Add implementation code here */
|
|---|
| 176 | p->rng_fault_state = True;
|
|---|
| 177 | return WERR_NOT_SUPPORTED;
|
|---|
| 178 | }
|
|---|
| 179 |
|
|---|
| 180 | /********************************************************************
|
|---|
| 181 | ********************************************************************/
|
|---|
| 182 |
|
|---|
| 183 | WERROR _WKSSVC_NETRUSEENUM( pipes_struct *p, struct WKSSVC_NETRUSEENUM *r )
|
|---|
| 184 | {
|
|---|
| 185 | /* FIXME: Add implementation code here */
|
|---|
| 186 | p->rng_fault_state = True;
|
|---|
| 187 | return WERR_NOT_SUPPORTED;
|
|---|
| 188 | }
|
|---|
| 189 |
|
|---|
| 190 | /********************************************************************
|
|---|
| 191 | ********************************************************************/
|
|---|
| 192 |
|
|---|
| 193 | WERROR _WKSSVC_NETRMESSAGEBUFFERSEND( pipes_struct *p, struct WKSSVC_NETRMESSAGEBUFFERSEND *r )
|
|---|
| 194 | {
|
|---|
| 195 | /* FIXME: Add implementation code here */
|
|---|
| 196 | p->rng_fault_state = True;
|
|---|
| 197 | return WERR_NOT_SUPPORTED;
|
|---|
| 198 | }
|
|---|
| 199 |
|
|---|
| 200 | /********************************************************************
|
|---|
| 201 | ********************************************************************/
|
|---|
| 202 |
|
|---|
| 203 | WERROR _WKSSVC_NETRWORKSTATIONSTATISTICSGET( pipes_struct *p, struct WKSSVC_NETRWORKSTATIONSTATISTICSGET *r )
|
|---|
| 204 | {
|
|---|
| 205 | /* FIXME: Add implementation code here */
|
|---|
| 206 | p->rng_fault_state = True;
|
|---|
| 207 | return WERR_NOT_SUPPORTED;
|
|---|
| 208 | }
|
|---|
| 209 |
|
|---|
| 210 | /********************************************************************
|
|---|
| 211 | ********************************************************************/
|
|---|
| 212 |
|
|---|
| 213 | WERROR _WKSSVC_NETRLOGONDOMAINNAMEADD( pipes_struct *p, struct WKSSVC_NETRLOGONDOMAINNAMEADD *r )
|
|---|
| 214 | {
|
|---|
| 215 | /* FIXME: Add implementation code here */
|
|---|
| 216 | p->rng_fault_state = True;
|
|---|
| 217 | return WERR_NOT_SUPPORTED;
|
|---|
| 218 | }
|
|---|
| 219 |
|
|---|
| 220 | /********************************************************************
|
|---|
| 221 | ********************************************************************/
|
|---|
| 222 |
|
|---|
| 223 | WERROR _WKSSVC_NETRLOGONDOMAINNAMEDEL( pipes_struct *p, struct WKSSVC_NETRLOGONDOMAINNAMEDEL *r )
|
|---|
| 224 | {
|
|---|
| 225 | /* FIXME: Add implementation code here */
|
|---|
| 226 | p->rng_fault_state = True;
|
|---|
| 227 | return WERR_NOT_SUPPORTED;
|
|---|
| 228 | }
|
|---|
| 229 |
|
|---|
| 230 | /********************************************************************
|
|---|
| 231 | ********************************************************************/
|
|---|
| 232 |
|
|---|
| 233 | WERROR _WKSSVC_NETRJOINDOMAIN( pipes_struct *p, struct WKSSVC_NETRJOINDOMAIN *r )
|
|---|
| 234 | {
|
|---|
| 235 | /* FIXME: Add implementation code here */
|
|---|
| 236 | p->rng_fault_state = True;
|
|---|
| 237 | return WERR_NOT_SUPPORTED;
|
|---|
| 238 | }
|
|---|
| 239 |
|
|---|
| 240 | /********************************************************************
|
|---|
| 241 | ********************************************************************/
|
|---|
| 242 |
|
|---|
| 243 | WERROR _WKSSVC_NETRUNJOINDOMAIN( pipes_struct *p, struct WKSSVC_NETRUNJOINDOMAIN *r )
|
|---|
| 244 | {
|
|---|
| 245 | /* FIXME: Add implementation code here */
|
|---|
| 246 | p->rng_fault_state = True;
|
|---|
| 247 | return WERR_NOT_SUPPORTED;
|
|---|
| 248 | }
|
|---|
| 249 |
|
|---|
| 250 | /********************************************************************
|
|---|
| 251 | ********************************************************************/
|
|---|
| 252 |
|
|---|
| 253 | WERROR _WKSSVC_NETRRENAMEMACHINEINDOMAIN( pipes_struct *p, struct WKSSVC_NETRRENAMEMACHINEINDOMAIN *r )
|
|---|
| 254 | {
|
|---|
| 255 | /* FIXME: Add implementation code here */
|
|---|
| 256 | p->rng_fault_state = True;
|
|---|
| 257 | return WERR_NOT_SUPPORTED;
|
|---|
| 258 | }
|
|---|
| 259 |
|
|---|
| 260 | /********************************************************************
|
|---|
| 261 | ********************************************************************/
|
|---|
| 262 |
|
|---|
| 263 | WERROR _WKSSVC_NETRVALIDATENAME( pipes_struct *p, struct WKSSVC_NETRVALIDATENAME *r )
|
|---|
| 264 | {
|
|---|
| 265 | /* FIXME: Add implementation code here */
|
|---|
| 266 | p->rng_fault_state = True;
|
|---|
| 267 | return WERR_NOT_SUPPORTED;
|
|---|
| 268 | }
|
|---|
| 269 |
|
|---|
| 270 | /********************************************************************
|
|---|
| 271 | ********************************************************************/
|
|---|
| 272 |
|
|---|
| 273 | WERROR _WKSSVC_NETRGETJOININFORMATION( pipes_struct *p, struct WKSSVC_NETRGETJOININFORMATION *r )
|
|---|
| 274 | {
|
|---|
| 275 | /* FIXME: Add implementation code here */
|
|---|
| 276 | p->rng_fault_state = True;
|
|---|
| 277 | return WERR_NOT_SUPPORTED;
|
|---|
| 278 | }
|
|---|
| 279 |
|
|---|
| 280 | /********************************************************************
|
|---|
| 281 | ********************************************************************/
|
|---|
| 282 |
|
|---|
| 283 | WERROR _WKSSVC_NETRGETJOINABLEOUS( pipes_struct *p, struct WKSSVC_NETRGETJOINABLEOUS *r )
|
|---|
| 284 | {
|
|---|
| 285 | /* FIXME: Add implementation code here */
|
|---|
| 286 | p->rng_fault_state = True;
|
|---|
| 287 | return WERR_NOT_SUPPORTED;
|
|---|
| 288 | }
|
|---|
| 289 |
|
|---|
| 290 | /********************************************************************
|
|---|
| 291 | ********************************************************************/
|
|---|
| 292 |
|
|---|
| 293 | WERROR _wkssvc_NetrJoinDomain2(pipes_struct *p, struct wkssvc_NetrJoinDomain2 *r)
|
|---|
| 294 | {
|
|---|
| 295 | /* FIXME: Add implementation code here */
|
|---|
| 296 | p->rng_fault_state = True;
|
|---|
| 297 | return WERR_NOT_SUPPORTED;
|
|---|
| 298 | }
|
|---|
| 299 |
|
|---|
| 300 | /********************************************************************
|
|---|
| 301 | ********************************************************************/
|
|---|
| 302 |
|
|---|
| 303 | WERROR _wkssvc_NetrUnjoinDomain2(pipes_struct *p, struct wkssvc_NetrUnjoinDomain2 *r)
|
|---|
| 304 | {
|
|---|
| 305 | /* FIXME: Add implementation code here */
|
|---|
| 306 | p->rng_fault_state = True;
|
|---|
| 307 | return WERR_NOT_SUPPORTED;
|
|---|
| 308 | }
|
|---|
| 309 |
|
|---|
| 310 | /********************************************************************
|
|---|
| 311 | ********************************************************************/
|
|---|
| 312 |
|
|---|
| 313 | WERROR _wkssvc_NetrRenameMachineInDomain2(pipes_struct *p, struct wkssvc_NetrRenameMachineInDomain2 *r)
|
|---|
| 314 | {
|
|---|
| 315 | /* FIXME: Add implementation code here */
|
|---|
| 316 | p->rng_fault_state = True;
|
|---|
| 317 | return WERR_NOT_SUPPORTED;
|
|---|
| 318 | }
|
|---|
| 319 |
|
|---|
| 320 | /********************************************************************
|
|---|
| 321 | ********************************************************************/
|
|---|
| 322 |
|
|---|
| 323 | WERROR _WKSSVC_NETRVALIDATENAME2( pipes_struct *p, struct WKSSVC_NETRVALIDATENAME2 *r )
|
|---|
| 324 | {
|
|---|
| 325 | /* FIXME: Add implementation code here */
|
|---|
| 326 | p->rng_fault_state = True;
|
|---|
| 327 | return WERR_NOT_SUPPORTED;
|
|---|
| 328 | }
|
|---|
| 329 |
|
|---|
| 330 | /********************************************************************
|
|---|
| 331 | ********************************************************************/
|
|---|
| 332 |
|
|---|
| 333 | WERROR _WKSSVC_NETRGETJOINABLEOUS2( pipes_struct *p, struct WKSSVC_NETRGETJOINABLEOUS2 *r )
|
|---|
| 334 | {
|
|---|
| 335 | /* FIXME: Add implementation code here */
|
|---|
| 336 | p->rng_fault_state = True;
|
|---|
| 337 | return WERR_NOT_SUPPORTED;
|
|---|
| 338 | }
|
|---|
| 339 |
|
|---|
| 340 | /********************************************************************
|
|---|
| 341 | ********************************************************************/
|
|---|
| 342 |
|
|---|
| 343 | WERROR _wkssvc_NetrAddAlternateComputerName(pipes_struct *p, struct wkssvc_NetrAddAlternateComputerName *r )
|
|---|
| 344 | {
|
|---|
| 345 | /* FIXME: Add implementation code here */
|
|---|
| 346 | p->rng_fault_state = True;
|
|---|
| 347 | return WERR_NOT_SUPPORTED;
|
|---|
| 348 | }
|
|---|
| 349 |
|
|---|
| 350 | /********************************************************************
|
|---|
| 351 | ********************************************************************/
|
|---|
| 352 |
|
|---|
| 353 | WERROR _wkssvc_NetrRemoveAlternateComputerName(pipes_struct *p, struct wkssvc_NetrRemoveAlternateComputerName *r)
|
|---|
| 354 | {
|
|---|
| 355 | /* FIXME: Add implementation code here */
|
|---|
| 356 | p->rng_fault_state = True;
|
|---|
| 357 | return WERR_NOT_SUPPORTED;
|
|---|
| 358 | }
|
|---|
| 359 |
|
|---|
| 360 | /********************************************************************
|
|---|
| 361 | ********************************************************************/
|
|---|
| 362 |
|
|---|
| 363 | WERROR _WKSSVC_NETRSETPRIMARYCOMPUTERNAME( pipes_struct *p, struct WKSSVC_NETRSETPRIMARYCOMPUTERNAME *r )
|
|---|
| 364 | {
|
|---|
| 365 | /* FIXME: Add implementation code here */
|
|---|
| 366 | p->rng_fault_state = True;
|
|---|
| 367 | return WERR_NOT_SUPPORTED;
|
|---|
| 368 | }
|
|---|
| 369 |
|
|---|
| 370 | /********************************************************************
|
|---|
| 371 | ********************************************************************/
|
|---|
| 372 |
|
|---|
| 373 | WERROR _WKSSVC_NETRENUMERATECOMPUTERNAMES( pipes_struct *p, struct WKSSVC_NETRENUMERATECOMPUTERNAMES *r )
|
|---|
| 374 | {
|
|---|
| 375 | /* FIXME: Add implementation code here */
|
|---|
| 376 | p->rng_fault_state = True;
|
|---|
| 377 | return WERR_NOT_SUPPORTED;
|
|---|
| 378 | }
|
|---|
| 379 |
|
|---|