summaryrefslogtreecommitdiff
path: root/source4/librpc
diff options
context:
space:
mode:
Diffstat (limited to 'source4/librpc')
-rw-r--r--source4/librpc/idl/wkssvc.idl9
-rw-r--r--source4/librpc/ndr/ndr_wkssvc.c79
-rw-r--r--source4/librpc/ndr/ndr_wkssvc.h12
3 files changed, 21 insertions, 79 deletions
diff --git a/source4/librpc/idl/wkssvc.idl b/source4/librpc/idl/wkssvc.idl
index 3e3471d795..e42e7ae4f0 100644
--- a/source4/librpc/idl/wkssvc.idl
+++ b/source4/librpc/idl/wkssvc.idl
@@ -127,17 +127,12 @@
typedef union {
case(0) wkssvc_TransportInfoArray *array;
- } wkssvc_TransportUnion;
-
- typedef struct {
- uint32 level;
- [switch_is(level)] wkssvc_TransportUnion u;
} wkssvc_TransportInfo;
WERROR wkssvc_TransportEnum (
[in] unistr *server_name,
- [in] uint32 level,
- [in,out,ref] wkssvc_TransportInfo *info,
+ [in,out] uint32 level,
+ [in,out,switch_is(level)] wkssvc_TransportInfo info,
[in] uint32 max_buffer,
[out] uint32 totalentries,
[in,out] uint32 *resume_handle
diff --git a/source4/librpc/ndr/ndr_wkssvc.c b/source4/librpc/ndr/ndr_wkssvc.c
index 07852795a2..40006a5982 100644
--- a/source4/librpc/ndr/ndr_wkssvc.c
+++ b/source4/librpc/ndr/ndr_wkssvc.c
@@ -78,7 +78,7 @@ done:
return NT_STATUS_OK;
}
-NTSTATUS ndr_push_wkssvc_TransportUnion(struct ndr_push *ndr, int ndr_flags, uint16 level, union wkssvc_TransportUnion *r)
+NTSTATUS ndr_push_wkssvc_TransportInfo(struct ndr_push *ndr, int ndr_flags, uint16 level, union wkssvc_TransportInfo *r)
{
if (!(ndr_flags & NDR_SCALARS)) goto buffers;
NDR_CHECK(ndr_push_struct_start(ndr));
@@ -107,23 +107,6 @@ done:
return NT_STATUS_OK;
}
-NTSTATUS ndr_push_wkssvc_TransportInfo(struct ndr_push *ndr, int ndr_flags, struct wkssvc_TransportInfo *r)
-{
- if (!(ndr_flags & NDR_SCALARS)) goto buffers;
- NDR_CHECK(ndr_push_struct_start(ndr));
- NDR_CHECK(ndr_push_align(ndr, 4));
- NDR_CHECK(ndr_push_uint32(ndr, r->level));
- NDR_CHECK(ndr_push_uint32(ndr, r->level));
- NDR_CHECK(ndr_push_wkssvc_TransportUnion(ndr, NDR_SCALARS, r->level, &r->u));
- ndr_push_struct_end(ndr);
-buffers:
- if (!(ndr_flags & NDR_BUFFERS)) goto done;
- NDR_CHECK(ndr_push_uint32(ndr, r->level));
- NDR_CHECK(ndr_push_wkssvc_TransportUnion(ndr, NDR_BUFFERS, r->level, &r->u));
-done:
- return NT_STATUS_OK;
-}
-
NTSTATUS ndr_push_wkssvc_TransportEnum(struct ndr_push *ndr, struct wkssvc_TransportEnum *r)
{
NDR_CHECK(ndr_push_ptr(ndr, r->in.server_name));
@@ -131,7 +114,8 @@ NTSTATUS ndr_push_wkssvc_TransportEnum(struct ndr_push *ndr, struct wkssvc_Trans
NDR_CHECK(ndr_push_unistr(ndr, r->in.server_name));
}
NDR_CHECK(ndr_push_uint32(ndr, r->in.level));
- NDR_CHECK(ndr_push_wkssvc_TransportInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.info));
+ NDR_CHECK(ndr_push_uint32(ndr, r->in.level));
+ NDR_CHECK(ndr_push_wkssvc_TransportInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.level, &r->in.info));
NDR_CHECK(ndr_push_uint32(ndr, r->in.max_buffer));
NDR_CHECK(ndr_push_ptr(ndr, r->in.resume_handle));
if (r->in.resume_handle) {
@@ -654,7 +638,7 @@ done:
return NT_STATUS_OK;
}
-NTSTATUS ndr_pull_wkssvc_TransportUnion(struct ndr_pull *ndr, int ndr_flags, uint16 level, union wkssvc_TransportUnion *r)
+NTSTATUS ndr_pull_wkssvc_TransportInfo(struct ndr_pull *ndr, int ndr_flags, uint16 level, union wkssvc_TransportInfo *r)
{
if (!(ndr_flags & NDR_SCALARS)) goto buffers;
NDR_CHECK(ndr_pull_struct_start(ndr));
@@ -689,35 +673,16 @@ done:
return NT_STATUS_OK;
}
-NTSTATUS ndr_pull_wkssvc_TransportInfo(struct ndr_pull *ndr, int ndr_flags, struct wkssvc_TransportInfo *r)
+NTSTATUS ndr_pull_wkssvc_TransportEnum(struct ndr_pull *ndr, struct wkssvc_TransportEnum *r)
{
- NDR_CHECK(ndr_pull_struct_start(ndr));
- if (!(ndr_flags & NDR_SCALARS)) goto buffers;
- NDR_CHECK(ndr_pull_align(ndr, 4));
- NDR_CHECK(ndr_pull_uint32(ndr, &r->level));
- if ((NDR_SCALARS) & NDR_SCALARS) {
- uint32 _level;
- NDR_CHECK(ndr_pull_uint32(ndr, &_level));
- if (_level != r->level) return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u in u");
- }
- NDR_CHECK(ndr_pull_wkssvc_TransportUnion(ndr, NDR_SCALARS, r->level, &r->u));
- ndr_pull_struct_end(ndr);
-buffers:
- if (!(ndr_flags & NDR_BUFFERS)) goto done;
- if ((NDR_BUFFERS) & NDR_SCALARS) {
+ uint32 _ptr_resume_handle;
+ NDR_CHECK(ndr_pull_uint32(ndr, &r->out.level));
+ if ((NDR_SCALARS|NDR_BUFFERS) & NDR_SCALARS) {
uint32 _level;
NDR_CHECK(ndr_pull_uint32(ndr, &_level));
- if (_level != r->level) return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u in u");
+ if (_level != r->in.level) return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u in info");
}
- NDR_CHECK(ndr_pull_wkssvc_TransportUnion(ndr, NDR_BUFFERS, r->level, &r->u));
-done:
- return NT_STATUS_OK;
-}
-
-NTSTATUS ndr_pull_wkssvc_TransportEnum(struct ndr_pull *ndr, struct wkssvc_TransportEnum *r)
-{
- uint32 _ptr_resume_handle;
- NDR_CHECK(ndr_pull_wkssvc_TransportInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info));
+ NDR_CHECK(ndr_pull_wkssvc_TransportInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.level, &r->out.info));
NDR_CHECK(ndr_pull_uint32(ndr, &r->out.totalentries));
NDR_CHECK(ndr_pull_uint32(ndr, &_ptr_resume_handle));
if (_ptr_resume_handle) {
@@ -1208,9 +1173,9 @@ void ndr_print_wkssvc_TransportInfoArray(struct ndr_print *ndr, const char *name
ndr->depth--;
}
-void ndr_print_wkssvc_TransportUnion(struct ndr_print *ndr, const char *name, uint16 level, union wkssvc_TransportUnion *r)
+void ndr_print_wkssvc_TransportInfo(struct ndr_print *ndr, const char *name, uint16 level, union wkssvc_TransportInfo *r)
{
- ndr_print_union(ndr, name, level, "wkssvc_TransportUnion");
+ ndr_print_union(ndr, name, level, "wkssvc_TransportInfo");
switch (level) {
case 0:
ndr_print_ptr(ndr, "array", r->array);
@@ -1226,15 +1191,6 @@ void ndr_print_wkssvc_TransportUnion(struct ndr_print *ndr, const char *name, ui
}
}
-void ndr_print_wkssvc_TransportInfo(struct ndr_print *ndr, const char *name, struct wkssvc_TransportInfo *r)
-{
- ndr_print_struct(ndr, name, "wkssvc_TransportInfo");
- ndr->depth++;
- ndr_print_uint32(ndr, "level", r->level);
- ndr_print_wkssvc_TransportUnion(ndr, "u", r->level, &r->u);
- ndr->depth--;
-}
-
void ndr_print_wkssvc_TransportEnum(struct ndr_print *ndr, const char *name, int flags, struct wkssvc_TransportEnum *r)
{
ndr_print_struct(ndr, name, "wkssvc_TransportEnum");
@@ -1249,10 +1205,7 @@ void ndr_print_wkssvc_TransportEnum(struct ndr_print *ndr, const char *name, int
}
ndr->depth--;
ndr_print_uint32(ndr, "level", r->in.level);
- ndr_print_ptr(ndr, "info", r->in.info);
- ndr->depth++;
- ndr_print_wkssvc_TransportInfo(ndr, "info", r->in.info);
- ndr->depth--;
+ ndr_print_wkssvc_TransportInfo(ndr, "info", r->in.level, &r->in.info);
ndr_print_uint32(ndr, "max_buffer", r->in.max_buffer);
ndr_print_ptr(ndr, "resume_handle", r->in.resume_handle);
ndr->depth++;
@@ -1265,10 +1218,8 @@ void ndr_print_wkssvc_TransportEnum(struct ndr_print *ndr, const char *name, int
if (flags & NDR_OUT) {
ndr_print_struct(ndr, "out", "wkssvc_TransportEnum");
ndr->depth++;
- ndr_print_ptr(ndr, "info", r->out.info);
- ndr->depth++;
- ndr_print_wkssvc_TransportInfo(ndr, "info", r->out.info);
- ndr->depth--;
+ ndr_print_uint32(ndr, "level", r->out.level);
+ ndr_print_wkssvc_TransportInfo(ndr, "info", r->in.level, &r->out.info);
ndr_print_uint32(ndr, "totalentries", r->out.totalentries);
ndr_print_ptr(ndr, "resume_handle", r->out.resume_handle);
ndr->depth++;
diff --git a/source4/librpc/ndr/ndr_wkssvc.h b/source4/librpc/ndr/ndr_wkssvc.h
index 7c8b1dd317..9a245dfe5f 100644
--- a/source4/librpc/ndr/ndr_wkssvc.h
+++ b/source4/librpc/ndr/ndr_wkssvc.h
@@ -175,26 +175,22 @@ struct wkssvc_TransportInfoArray {
struct wkssvc_TransportInfo0 *transports;
};
-union wkssvc_TransportUnion {
+union wkssvc_TransportInfo {
/* [case(0)] */ struct wkssvc_TransportInfoArray *array;
};
-struct wkssvc_TransportInfo {
- uint32 level;
- union wkssvc_TransportUnion u;
-};
-
struct wkssvc_TransportEnum {
struct {
const char *server_name;
uint32 level;
- struct wkssvc_TransportInfo *info;
+ union wkssvc_TransportInfo info;
uint32 max_buffer;
uint32 *resume_handle;
} in;
struct {
- struct wkssvc_TransportInfo *info;
+ uint32 level;
+ union wkssvc_TransportInfo info;
uint32 totalentries;
uint32 *resume_handle;
WERROR result;