diff options
author | Günther Deschner <gd@samba.org> | 2010-04-29 12:16:17 +0200 |
---|---|---|
committer | Günther Deschner <gd@samba.org> | 2010-04-29 13:47:33 +0200 |
commit | 169b72dce432bc6c5afc6a14ddf80dedcb467178 (patch) | |
tree | 2ef7a82181aca1784cc6cb4621cfd4fcbabcb025 | |
parent | 2a9e8e348a0217fd6fbd41c95a3ed6083a6c4ecc (diff) | |
download | samba-169b72dce432bc6c5afc6a14ddf80dedcb467178.tar.gz samba-169b72dce432bc6c5afc6a14ddf80dedcb467178.tar.bz2 samba-169b72dce432bc6c5afc6a14ddf80dedcb467178.zip |
rap: add rap_NetPrintQGetInfo to IDL.
Guenther
-rw-r--r-- | librpc/gen_ndr/ndr_rap.c | 78 | ||||
-rw-r--r-- | librpc/gen_ndr/ndr_rap.h | 7 | ||||
-rw-r--r-- | librpc/gen_ndr/rap.h | 17 | ||||
-rw-r--r-- | librpc/idl/rap.idl | 10 |
4 files changed, 111 insertions, 1 deletions
diff --git a/librpc/gen_ndr/ndr_rap.c b/librpc/gen_ndr/ndr_rap.c index c6a51954f2..97a530d6e8 100644 --- a/librpc/gen_ndr/ndr_rap.c +++ b/librpc/gen_ndr/ndr_rap.c @@ -2018,3 +2018,81 @@ _PUBLIC_ enum ndr_err_code ndr_pull_rap_NetPrintQEnum(struct ndr_pull *ndr, int return NDR_ERR_SUCCESS; } +_PUBLIC_ enum ndr_err_code ndr_push_rap_NetPrintQGetInfo(struct ndr_push *ndr, int flags, const struct rap_NetPrintQGetInfo *r) +{ + if (flags & NDR_IN) { + if (r->in.PrintQueueName == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.PrintQueueName, CH_DOS))); + NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.PrintQueueName, CH_DOS))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.PrintQueueName, ndr_charset_length(r->in.PrintQueueName, CH_DOS), sizeof(uint8_t), CH_DOS)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->in.level)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->in.bufsize)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->out.status)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->out.convert)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->out.available)); + NDR_CHECK(ndr_push_set_switch_value(ndr, &r->out.info, r->in.level)); + NDR_CHECK(ndr_push_rap_printq_info(ndr, NDR_SCALARS|NDR_BUFFERS, &r->out.info)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_rap_NetPrintQGetInfo(struct ndr_pull *ndr, int flags, struct rap_NetPrintQGetInfo *r) +{ + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.PrintQueueName)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.PrintQueueName)); + if (ndr_get_array_length(ndr, &r->in.PrintQueueName) > ndr_get_array_size(ndr, &r->in.PrintQueueName)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.PrintQueueName), ndr_get_array_length(ndr, &r->in.PrintQueueName)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.PrintQueueName), sizeof(uint8_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.PrintQueueName, ndr_get_array_length(ndr, &r->in.PrintQueueName), sizeof(uint8_t), CH_DOS)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->in.level)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->in.bufsize)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->out.status)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->out.convert)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->out.available)); + NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->out.info, r->in.level)); + NDR_CHECK(ndr_pull_rap_printq_info(ndr, NDR_SCALARS|NDR_BUFFERS, &r->out.info)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_rap_NetPrintQGetInfo(struct ndr_print *ndr, const char *name, int flags, const struct rap_NetPrintQGetInfo *r) +{ + ndr_print_struct(ndr, name, "rap_NetPrintQGetInfo"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "rap_NetPrintQGetInfo"); + ndr->depth++; + ndr_print_ptr(ndr, "PrintQueueName", r->in.PrintQueueName); + ndr->depth++; + ndr_print_string(ndr, "PrintQueueName", r->in.PrintQueueName); + ndr->depth--; + ndr_print_uint16(ndr, "level", r->in.level); + ndr_print_uint16(ndr, "bufsize", r->in.bufsize); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "rap_NetPrintQGetInfo"); + ndr->depth++; + ndr_print_uint16(ndr, "status", r->out.status); + ndr_print_uint16(ndr, "convert", r->out.convert); + ndr_print_uint16(ndr, "available", r->out.available); + ndr_print_set_switch_value(ndr, &r->out.info, r->in.level); + ndr_print_rap_printq_info(ndr, "info", &r->out.info); + ndr->depth--; + } + ndr->depth--; +} diff --git a/librpc/gen_ndr/ndr_rap.h b/librpc/gen_ndr/ndr_rap.h index f940d0e0d7..b4bce71b4e 100644 --- a/librpc/gen_ndr/ndr_rap.h +++ b/librpc/gen_ndr/ndr_rap.h @@ -15,7 +15,9 @@ #define NDR_RAP_NETPRINTQENUM (0x03) -#define NDR_RAP_CALL_COUNT (4) +#define NDR_RAP_NETPRINTQGETINFO (0x04) + +#define NDR_RAP_CALL_COUNT (5) void ndr_print_rap_share_info_0(struct ndr_print *ndr, const char *name, const struct rap_share_info_0 *r); void ndr_print_rap_share_info_1(struct ndr_print *ndr, const char *name, const struct rap_share_info_1 *r); void ndr_print_rap_share_info_2(struct ndr_print *ndr, const char *name, const struct rap_share_info_2 *r); @@ -49,4 +51,7 @@ void ndr_print_rap_WserverGetInfo(struct ndr_print *ndr, const char *name, int f enum ndr_err_code ndr_push_rap_NetPrintQEnum(struct ndr_push *ndr, int flags, const struct rap_NetPrintQEnum *r); enum ndr_err_code ndr_pull_rap_NetPrintQEnum(struct ndr_pull *ndr, int flags, struct rap_NetPrintQEnum *r); void ndr_print_rap_NetPrintQEnum(struct ndr_print *ndr, const char *name, int flags, const struct rap_NetPrintQEnum *r); +enum ndr_err_code ndr_push_rap_NetPrintQGetInfo(struct ndr_push *ndr, int flags, const struct rap_NetPrintQGetInfo *r); +enum ndr_err_code ndr_pull_rap_NetPrintQGetInfo(struct ndr_pull *ndr, int flags, struct rap_NetPrintQGetInfo *r); +void ndr_print_rap_NetPrintQGetInfo(struct ndr_print *ndr, const char *name, int flags, const struct rap_NetPrintQGetInfo *r); #endif /* _HEADER_NDR_rap */ diff --git a/librpc/gen_ndr/rap.h b/librpc/gen_ndr/rap.h index 68a12738e7..78cae37d00 100644 --- a/librpc/gen_ndr/rap.h +++ b/librpc/gen_ndr/rap.h @@ -660,4 +660,21 @@ struct rap_NetPrintQEnum { }; + +struct rap_NetPrintQGetInfo { + struct { + const char *PrintQueueName;/* [ref,charset(DOS)] */ + uint16_t level; + uint16_t bufsize; + } in; + + struct { + uint16_t status; + uint16_t convert; + uint16_t available; + union rap_printq_info info;/* [switch_is(level)] */ + } out; + +}; + #endif /* _HEADER_rap */ diff --git a/librpc/idl/rap.idl b/librpc/idl/rap.idl index c35dcd754e..db65308048 100644 --- a/librpc/idl/rap.idl +++ b/librpc/idl/rap.idl @@ -554,6 +554,16 @@ interface rap [out,switch_is(level)] rap_printq_info *info ); + [public] void rap_NetPrintQGetInfo( + [in] [string,charset(DOS)] uint8 *PrintQueueName, + [in] uint16 level, + [in] uint16 bufsize, + [out] uint16 status, + [out] uint16 convert, + [out] uint16 available, + [out,switch_is(level)] rap_printq_info info + ); + /* Parameter description strings for RAP calls */ /* Names are defined name for RAP call with _REQ */ /* appended to end. */ |