netapi: add NetShareEnum skeleton.
authorGünther Deschner <gd@samba.org>
Fri, 29 Aug 2008 16:58:32 +0000 (18:58 +0200)
committerGünther Deschner <gd@samba.org>
Fri, 5 Sep 2008 10:54:24 +0000 (12:54 +0200)
Guenther
(This used to be commit 0cc604ebc13125daf7e219c63a6ca8f21eda48c6)

source3/lib/netapi/libnetapi.c
source3/lib/netapi/libnetapi.h
source3/lib/netapi/share.c

index 5ff7db0f7fbc4feaf8b42d86444ea85a3a22f0b7..3b203b4bcf5c15f2252512ffeb12e04a81454320 100644 (file)
@@ -1863,3 +1863,56 @@ NET_API_STATUS NetShareDel(const char * server_name /* [in] */,
        return r.out.result;
 }
 
+/****************************************************************
+ NetShareEnum
+****************************************************************/
+
+NET_API_STATUS NetShareEnum(const char * server_name /* [in] */,
+                           uint32_t level /* [in] */,
+                           uint8_t **buffer /* [out] [ref] */,
+                           uint32_t prefmaxlen /* [in] */,
+                           uint32_t *entries_read /* [out] [ref] */,
+                           uint32_t *total_entries /* [out] [ref] */,
+                           uint32_t *resume_handle /* [in,out] [ref] */)
+{
+       struct NetShareEnum 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.prefmaxlen = prefmaxlen;
+       r.in.resume_handle = resume_handle;
+
+       /* Out parameters */
+       r.out.buffer = buffer;
+       r.out.entries_read = entries_read;
+       r.out.total_entries = total_entries;
+       r.out.resume_handle = resume_handle;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(NetShareEnum, &r);
+       }
+
+       if (LIBNETAPI_LOCAL_SERVER(server_name)) {
+               werr = NetShareEnum_l(ctx, &r);
+       } else {
+               werr = NetShareEnum_r(ctx, &r);
+       }
+
+       r.out.result = W_ERROR_V(werr);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(NetShareEnum, &r);
+       }
+
+       return r.out.result;
+}
+
index b20f465f6382c1c7dc92739e4d3373d3a3ae0129..d4d73e6439841385a2e4b8913f76eac2feecb8d6 100644 (file)
@@ -332,4 +332,15 @@ WERROR NetShareDel_r(struct libnetapi_ctx *ctx,
                     struct NetShareDel *r);
 WERROR NetShareDel_l(struct libnetapi_ctx *ctx,
                     struct NetShareDel *r);
+NET_API_STATUS NetShareEnum(const char * server_name /* [in] */,
+                           uint32_t level /* [in] */,
+                           uint8_t **buffer /* [out] [ref] */,
+                           uint32_t prefmaxlen /* [in] */,
+                           uint32_t *entries_read /* [out] [ref] */,
+                           uint32_t *total_entries /* [out] [ref] */,
+                           uint32_t *resume_handle /* [in,out] [ref] */);
+WERROR NetShareEnum_r(struct libnetapi_ctx *ctx,
+                     struct NetShareEnum *r);
+WERROR NetShareEnum_l(struct libnetapi_ctx *ctx,
+                     struct NetShareEnum *r);
 #endif /* __LIBNETAPI_LIBNETAPI__ */
index 2c796046df24c7f541811524af921a16114e9088..d31743200fb0bc7b481418e953c10856fb08da0a 100644 (file)
@@ -184,3 +184,20 @@ WERROR NetShareDel_l(struct libnetapi_ctx *ctx,
        LIBNETAPI_REDIRECT_TO_LOCALHOST(ctx, r, NetShareDel);
 }
 
+/****************************************************************
+****************************************************************/
+
+WERROR NetShareEnum_r(struct libnetapi_ctx *ctx,
+                     struct NetShareEnum *r)
+{
+       return WERR_NOT_SUPPORTED;
+}
+
+/****************************************************************
+****************************************************************/
+
+WERROR NetShareEnum_l(struct libnetapi_ctx *ctx,
+                     struct NetShareEnum *r)
+{
+       LIBNETAPI_REDIRECT_TO_LOCALHOST(ctx, r, NetShareEnum);
+}