netapi: add NetShareAdd skeleton.
authorGünther Deschner <gd@samba.org>
Wed, 27 Aug 2008 23:01:11 +0000 (01:01 +0200)
committerGünther Deschner <gd@samba.org>
Fri, 29 Aug 2008 11:58:03 +0000 (13:58 +0200)
Guenther

source/Makefile.in
source/lib/netapi/libnetapi.c
source/lib/netapi/libnetapi.h
source/lib/netapi/share.c [new file with mode: 0644]

index 486d47f5f8d852bad1faa68cbc03fceefe4fca3c..5793b5ef4d4c671c1e4710c1decbe4762941144d 100644 (file)
@@ -1835,7 +1835,8 @@ LIBNETAPI_OBJ0 = lib/netapi/netapi.o \
                 lib/netapi/group.o \
                 lib/netapi/localgroup.o \
                 lib/netapi/samr.o \
-                lib/netapi/sid.o
+                lib/netapi/sid.o \
+                lib/netapi/share.o
 
 LIBNETAPI_OBJ  = $(LIBNETAPI_OBJ0) $(LIBNET_OBJ) \
                 $(LIBSMBCONF_OBJ) \
index 4b87bbcdf484ef47d28bb1f2a9270d2519449709..b4f2bb6ac29f2e7ae16bd7d9e6acbe139260b661 100644 (file)
@@ -1773,3 +1773,49 @@ NET_API_STATUS NetRemoteTOD(const char * server_name /* [in] */,
        return r.out.result;
 }
 
+/****************************************************************
+ NetShareAdd
+****************************************************************/
+
+NET_API_STATUS NetShareAdd(const char * server_name /* [in] */,
+                          uint32_t level /* [in] */,
+                          uint8_t *buffer /* [in] [ref] */,
+                          uint32_t *parm_err /* [out] [ref] */)
+{
+       struct NetShareAdd r;
+       struct libnetapi_ctx *ctx = NULL;
+       NET_API_STATUS status;
+       WERROR werr;
+
+       status = libnetapi_getctx(&ctx);
+       if (status != 0) {
+               return status;
+       }
+
+       /* In parameters */
+       r.in.server_name = server_name;
+       r.in.level = level;
+       r.in.buffer = buffer;
+
+       /* Out parameters */
+       r.out.parm_err = parm_err;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(NetShareAdd, &r);
+       }
+
+       if (LIBNETAPI_LOCAL_SERVER(server_name)) {
+               werr = NetShareAdd_l(ctx, &r);
+       } else {
+               werr = NetShareAdd_r(ctx, &r);
+       }
+
+       r.out.result = W_ERROR_V(werr);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(NetShareAdd, &r);
+       }
+
+       return r.out.result;
+}
+
index 189083cc1fb6820a5bd66456546478e88e56d9b2..9a75b396fe8ddc3d29707aca2825bc5b7cee250d 100644 (file)
@@ -317,4 +317,12 @@ WERROR NetRemoteTOD_r(struct libnetapi_ctx *ctx,
                      struct NetRemoteTOD *r);
 WERROR NetRemoteTOD_l(struct libnetapi_ctx *ctx,
                      struct NetRemoteTOD *r);
+NET_API_STATUS NetShareAdd(const char * server_name /* [in] */,
+                          uint32_t level /* [in] */,
+                          uint8_t *buffer /* [in] [ref] */,
+                          uint32_t *parm_err /* [out] [ref] */);
+WERROR NetShareAdd_r(struct libnetapi_ctx *ctx,
+                    struct NetShareAdd *r);
+WERROR NetShareAdd_l(struct libnetapi_ctx *ctx,
+                    struct NetShareAdd *r);
 #endif /* __LIBNETAPI_LIBNETAPI__ */
diff --git a/source/lib/netapi/share.c b/source/lib/netapi/share.c
new file mode 100644 (file)
index 0000000..182330b
--- /dev/null
@@ -0,0 +1,43 @@
+/*
+ *  Unix SMB/CIFS implementation.
+ *  NetApi Share Support
+ *  Copyright (C) Guenther Deschner 2008
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "includes.h"
+
+#include "librpc/gen_ndr/libnetapi.h"
+#include "lib/netapi/netapi.h"
+#include "lib/netapi/netapi_private.h"
+#include "lib/netapi/libnetapi.h"
+
+/****************************************************************
+****************************************************************/
+
+WERROR NetShareAdd_r(struct libnetapi_ctx *ctx,
+                    struct NetShareAdd *r)
+{
+       return WERR_NOT_SUPPORTED;
+}
+
+/****************************************************************
+****************************************************************/
+
+WERROR NetShareAdd_l(struct libnetapi_ctx *ctx,
+                    struct NetShareAdd *r)
+{
+       LIBNETAPI_REDIRECT_TO_LOCALHOST(ctx, r, NetShareAdd);
+}