diff options
author | Richard Sharpe <sharpe@samba.org> | 2003-11-20 04:45:16 +0000 |
---|---|---|
committer | Richard Sharpe <sharpe@samba.org> | 2003-11-20 04:45:16 +0000 |
commit | 4730469cd87b5c19d0c7e8da9194f3c8f6fb8d24 (patch) | |
tree | 55cd1c9ceac4c9e027c5007dd8c5a97bcb6ffea2 /source4/librpc/ndr | |
parent | b2fd4284b6935f93514cd7d165ab481101e92472 (diff) | |
download | samba-4730469cd87b5c19d0c7e8da9194f3c8f6fb8d24.tar.gz samba-4730469cd87b5c19d0c7e8da9194f3c8f6fb8d24.tar.bz2 samba-4730469cd87b5c19d0c7e8da9194f3c8f6fb8d24.zip |
Add a 1004 level for srvsvc.
(This used to be commit 9810e6f180564247dee584d197180d394b208c24)
Diffstat (limited to 'source4/librpc/ndr')
-rw-r--r-- | source4/librpc/ndr/ndr_srvsvc.c | 149 | ||||
-rw-r--r-- | source4/librpc/ndr/ndr_srvsvc.h | 10 |
2 files changed, 159 insertions, 0 deletions
diff --git a/source4/librpc/ndr/ndr_srvsvc.c b/source4/librpc/ndr/ndr_srvsvc.c index 645a5572cc..50aece53a4 100644 --- a/source4/librpc/ndr/ndr_srvsvc.c +++ b/source4/librpc/ndr/ndr_srvsvc.c @@ -877,6 +877,40 @@ done: return NT_STATUS_OK; } +NTSTATUS ndr_push_srvsvc_NetShare1004(struct ndr_push *ndr, int ndr_flags, struct srvsvc_NetShare1004 *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_ptr(ndr, r->comment)); + ndr_push_struct_end(ndr); +buffers: + if (!(ndr_flags & NDR_BUFFERS)) goto done; + if (r->comment) { + NDR_CHECK(ndr_push_unistr(ndr, r->comment)); + } +done: + return NT_STATUS_OK; +} + +NTSTATUS ndr_push_srvsvc_NetShareCtr1004(struct ndr_push *ndr, int ndr_flags, struct srvsvc_NetShareCtr1004 *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->count)); + NDR_CHECK(ndr_push_ptr(ndr, r->array)); + ndr_push_struct_end(ndr); +buffers: + if (!(ndr_flags & NDR_BUFFERS)) goto done; + if (r->array) { + NDR_CHECK(ndr_push_uint32(ndr, r->count)); + NDR_CHECK(ndr_push_array(ndr, NDR_SCALARS|NDR_BUFFERS, r->array, sizeof(r->array[0]), r->count, (ndr_push_flags_fn_t)ndr_push_srvsvc_NetShare1004)); + } +done: + return NT_STATUS_OK; +} + NTSTATUS ndr_push_srvsvc_NetShareCtr(struct ndr_push *ndr, int ndr_flags, uint16 level, union srvsvc_NetShareCtr *r) { if (!(ndr_flags & NDR_SCALARS)) goto buffers; @@ -902,6 +936,10 @@ NTSTATUS ndr_push_srvsvc_NetShareCtr(struct ndr_push *ndr, int ndr_flags, uint16 NDR_CHECK(ndr_push_ptr(ndr, r->ctr502)); break; + case 1004: + NDR_CHECK(ndr_push_ptr(ndr, r->ctr1004)); + break; + default: break; @@ -940,6 +978,12 @@ buffers: } break; + case 1004: + if (r->ctr1004) { + NDR_CHECK(ndr_push_srvsvc_NetShareCtr1004(ndr, NDR_SCALARS|NDR_BUFFERS, r->ctr1004)); + } + break; + default: break; @@ -2646,6 +2690,59 @@ done: return NT_STATUS_OK; } +NTSTATUS ndr_pull_srvsvc_NetShare1004(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetShare1004 *r) +{ + uint32 _ptr_comment; + 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, &_ptr_comment)); + if (_ptr_comment) { + NDR_ALLOC(ndr, r->comment); + } else { + r->comment = NULL; + } + ndr_pull_struct_end(ndr); +buffers: + if (!(ndr_flags & NDR_BUFFERS)) goto done; + if (r->comment) { + NDR_CHECK(ndr_pull_unistr(ndr, &r->comment)); + } +done: + return NT_STATUS_OK; +} + +NTSTATUS ndr_pull_srvsvc_NetShareCtr1004(struct ndr_pull *ndr, int ndr_flags, struct srvsvc_NetShareCtr1004 *r) +{ + uint32 _ptr_array; + 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->count)); + NDR_CHECK(ndr_pull_uint32(ndr, &_ptr_array)); + if (_ptr_array) { + NDR_ALLOC(ndr, r->array); + } else { + r->array = NULL; + } + ndr_pull_struct_end(ndr); +buffers: + if (!(ndr_flags & NDR_BUFFERS)) goto done; + if (r->array) { + { + uint32 _array_size; + NDR_CHECK(ndr_pull_uint32(ndr, &_array_size)); + if (r->count > _array_size) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should be %u", _array_size, r->count); + } + } + NDR_ALLOC_N_SIZE(ndr, r->array, r->count, sizeof(r->array[0])); + NDR_CHECK(ndr_pull_array(ndr, NDR_SCALARS|NDR_BUFFERS, (void **)r->array, sizeof(r->array[0]), r->count, (ndr_pull_flags_fn_t)ndr_pull_srvsvc_NetShare1004)); + } +done: + return NT_STATUS_OK; +} + NTSTATUS ndr_pull_srvsvc_NetShareCtr(struct ndr_pull *ndr, int ndr_flags, uint16 level, union srvsvc_NetShareCtr *r) { if (!(ndr_flags & NDR_SCALARS)) goto buffers; @@ -2701,6 +2798,16 @@ NTSTATUS ndr_pull_srvsvc_NetShareCtr(struct ndr_pull *ndr, int ndr_flags, uint16 } break; } + case 1004: { + uint32 _ptr_ctr1004; + NDR_CHECK(ndr_pull_uint32(ndr, &_ptr_ctr1004)); + if (_ptr_ctr1004) { + NDR_ALLOC(ndr, r->ctr1004); + } else { + r->ctr1004 = NULL; + } + break; } + default: { break; } @@ -2739,6 +2846,12 @@ buffers: } break; + case 1004: + if (r->ctr1004) { + NDR_CHECK(ndr_pull_srvsvc_NetShareCtr1004(ndr, NDR_SCALARS|NDR_BUFFERS, r->ctr1004)); + } + break; + default: break; @@ -4378,6 +4491,33 @@ void ndr_print_srvsvc_NetShareCtr502(struct ndr_print *ndr, const char *name, st ndr->depth--; } +void ndr_print_srvsvc_NetShare1004(struct ndr_print *ndr, const char *name, struct srvsvc_NetShare1004 *r) +{ + ndr_print_struct(ndr, name, "srvsvc_NetShare1004"); + ndr->depth++; + ndr_print_ptr(ndr, "comment", r->comment); + ndr->depth++; + if (r->comment) { + ndr_print_unistr(ndr, "comment", r->comment); + } + ndr->depth--; + ndr->depth--; +} + +void ndr_print_srvsvc_NetShareCtr1004(struct ndr_print *ndr, const char *name, struct srvsvc_NetShareCtr1004 *r) +{ + ndr_print_struct(ndr, name, "srvsvc_NetShareCtr1004"); + ndr->depth++; + ndr_print_uint32(ndr, "count", r->count); + ndr_print_ptr(ndr, "array", r->array); + ndr->depth++; + if (r->array) { + ndr_print_array(ndr, "array", r->array, sizeof(r->array[0]), r->count, (ndr_print_fn_t)ndr_print_srvsvc_NetShare1004); + } + ndr->depth--; + ndr->depth--; +} + void ndr_print_srvsvc_NetShareCtr(struct ndr_print *ndr, const char *name, uint16 level, union srvsvc_NetShareCtr *r) { ndr_print_union(ndr, name, level, "srvsvc_NetShareCtr"); @@ -4427,6 +4567,15 @@ void ndr_print_srvsvc_NetShareCtr(struct ndr_print *ndr, const char *name, uint1 ndr->depth--; break; + case 1004: + ndr_print_ptr(ndr, "ctr1004", r->ctr1004); + ndr->depth++; + if (r->ctr1004) { + ndr_print_srvsvc_NetShareCtr1004(ndr, "ctr1004", r->ctr1004); + } + ndr->depth--; + break; + default: break; diff --git a/source4/librpc/ndr/ndr_srvsvc.h b/source4/librpc/ndr/ndr_srvsvc.h index bae4543254..881ed80c01 100644 --- a/source4/librpc/ndr/ndr_srvsvc.h +++ b/source4/librpc/ndr/ndr_srvsvc.h @@ -425,12 +425,22 @@ struct srvsvc_NetShareCtr502 { struct srvsvc_NetShare502 *array; }; +struct srvsvc_NetShare1004 { + const char *comment; +}; + +struct srvsvc_NetShareCtr1004 { + uint32 count; + struct srvsvc_NetShare1004 *array; +}; + union srvsvc_NetShareCtr { /* [case(0)] */ struct srvsvc_NetShareCtr0 *ctr0; /* [case(1)] */ struct srvsvc_NetShareCtr1 *ctr1; /* [case(2)] */ struct srvsvc_NetShareCtr2 *ctr2; /* [case(501)] */ struct srvsvc_NetShareCtr501 *ctr501; /* [case(502)] */ struct srvsvc_NetShareCtr502 *ctr502; +/* [case(1004)] */ struct srvsvc_NetShareCtr1004 *ctr1004; /* [case(default)] */ }; struct srvsvc_NetShareEnumAll { |