diff options
author | Günther Deschner <gd@samba.org> | 2010-04-28 23:42:00 +0200 |
---|---|---|
committer | Günther Deschner <gd@samba.org> | 2010-04-29 12:05:41 +0200 |
commit | f85a4ab778f693d605301b761596f43092c9d618 (patch) | |
tree | d5d04816080156ad01acc7ea66a622a93cc40e50 | |
parent | 084c8065f871c1aa31f5d157f1843437db449603 (diff) | |
download | samba-f85a4ab778f693d605301b761596f43092c9d618.tar.gz samba-f85a4ab778f693d605301b761596f43092c9d618.tar.bz2 samba-f85a4ab778f693d605301b761596f43092c9d618.zip |
s4-rap: add rap print helpers.
Guenther
-rw-r--r-- | librpc/idl/rap.idl | 5 | ||||
-rw-r--r-- | librpc/ndr/ndr_rap.c | 64 | ||||
-rw-r--r-- | librpc/ndr/ndr_rap.h | 22 | ||||
-rw-r--r-- | source4/librpc/config.mk | 2 | ||||
-rw-r--r-- | source4/librpc/wscript_build | 3 |
5 files changed, 91 insertions, 5 deletions
diff --git a/librpc/idl/rap.idl b/librpc/idl/rap.idl index 9259d4cf2a..4ddb1a6f8d 100644 --- a/librpc/idl/rap.idl +++ b/librpc/idl/rap.idl @@ -5,7 +5,8 @@ */ [ - pointer_default(unique) + pointer_default(unique), + helper("../librpc/ndr/ndr_rap.h") ] interface rap { @@ -541,7 +542,7 @@ interface rap uint16 PrinterNameOffsetHigh; } rap_PrintJobInfo3; - [public] void rap_NetPrintQEnum( + [public,noprint] void rap_NetPrintQEnum( [in] uint16 level, [in] uint16 bufsize, [out] uint16 status, diff --git a/librpc/ndr/ndr_rap.c b/librpc/ndr/ndr_rap.c new file mode 100644 index 0000000000..a7bfb9f750 --- /dev/null +++ b/librpc/ndr/ndr_rap.c @@ -0,0 +1,64 @@ +/* + Unix SMB/CIFS implementation. + + routines for marshalling/unmarshalling special rap types + + Copyright (C) Guenther Deschner 2010 + + 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/ndr_rap.h" + +_PUBLIC_ void ndr_print_rap_NetPrintQEnum(struct ndr_print *ndr, const char *name, int flags, const struct rap_NetPrintQEnum *r) +{ + uint32_t cntr_info_1; + ndr_print_struct(ndr, name, "rap_NetPrintQEnum"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "rap_NetPrintQEnum"); + 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_NetPrintQEnum"); + ndr->depth++; + ndr_print_WERROR(ndr, "status", W_ERROR(r->out.status)); + ndr_print_uint16(ndr, "convert", r->out.convert); + ndr_print_uint16(ndr, "count", r->out.count); + ndr_print_uint16(ndr, "available", r->out.available); + ndr_print_ptr(ndr, "info", r->out.info); + ndr->depth++; + ndr->print(ndr, "%s: ARRAY(%d)", "info", (int)r->out.count); + ndr->depth++; + for (cntr_info_1=0;cntr_info_1<r->out.count;cntr_info_1++) { + char *idx_1=NULL; + if (asprintf(&idx_1, "[%d]", cntr_info_1) != -1) { + ndr_print_set_switch_value(ndr, &r->out.info[cntr_info_1], r->in.level); + ndr_print_rap_printq_info(ndr, "info", &r->out.info[cntr_info_1]); + free(idx_1); + } + } + ndr->depth--; + ndr->depth--; + ndr->depth--; + } + ndr->depth--; +} diff --git a/librpc/ndr/ndr_rap.h b/librpc/ndr/ndr_rap.h new file mode 100644 index 0000000000..3f395fdf60 --- /dev/null +++ b/librpc/ndr/ndr_rap.h @@ -0,0 +1,22 @@ +/* + Unix SMB/CIFS implementation. + + routines for marshalling/unmarshalling special rap types + + Copyright (C) Guenther Deschner 2010 + + 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/>. +*/ + +_PUBLIC_ void ndr_print_rap_NetPrintQEnum(struct ndr_print *ndr, const char *name, int flags, const struct rap_NetPrintQEnum *r); diff --git a/source4/librpc/config.mk b/source4/librpc/config.mk index 78e7d18553..282053afd1 100644 --- a/source4/librpc/config.mk +++ b/source4/librpc/config.mk @@ -578,7 +578,7 @@ RPC_NDR_KEYSVC_OBJ_FILES = ../librpc/gen_ndr/ndr_keysvc_c.o [SUBSYSTEM::NDR_RAP] PUBLIC_DEPENDENCIES = LIBNDR -NDR_RAP_OBJ_FILES = ../librpc/gen_ndr/ndr_rap.o +NDR_RAP_OBJ_FILES = ../librpc/gen_ndr/ndr_rap.o ../librpc/ndr/ndr_rap.o [SUBSYSTEM::NDR_DCERPC] PUBLIC_DEPENDENCIES = LIBNDR diff --git a/source4/librpc/wscript_build b/source4/librpc/wscript_build index 01449bb3c7..d363b8f29b 100644 --- a/source4/librpc/wscript_build +++ b/source4/librpc/wscript_build @@ -264,7 +264,7 @@ bld.SAMBA_SUBSYSTEM('NDR_KEYSVC', ) bld.SAMBA_SUBSYSTEM('NDR_RAP', - source='../../librpc/gen_ndr/ndr_rap.c', + source='../../librpc/gen_ndr/ndr_rap.c ../../librpc/ndr/ndr_rap.c', public_deps='LIBNDR' ) @@ -608,7 +608,6 @@ bld.SAMBA_SUBSYSTEM('NDR_DCERPC', header_path= [ ('*gen_ndr*', 'gen_ndr') ], ) - bld.SAMBA_LIBRARY('dcerpc', source='rpc/dcerpc.c rpc/dcerpc_auth.c rpc/dcerpc_schannel.c rpc/dcerpc_util.c rpc/dcerpc_smb.c rpc/dcerpc_smb2.c rpc/dcerpc_sock.c rpc/dcerpc_connect.c rpc/dcerpc_secondary.c ../../librpc/rpc/binding.c ../../librpc/rpc/dcerpc_error.c', pc_files='dcerpc.pc', |