summaryrefslogtreecommitdiff
path: root/source4/librpc
diff options
context:
space:
mode:
Diffstat (limited to 'source4/librpc')
-rw-r--r--source4/librpc/config.mk6
-rw-r--r--source4/librpc/idl/dcerpc.idl40
-rw-r--r--source4/librpc/idl/srvsvc.idl10
-rw-r--r--source4/librpc/ndr/ndr_orpc.c173
-rw-r--r--source4/librpc/ndr/ndr_wmi.c90
-rw-r--r--source4/librpc/ndr/ndr_wmi.h3
6 files changed, 27 insertions, 295 deletions
diff --git a/source4/librpc/config.mk b/source4/librpc/config.mk
index 6a0cd00e11..a988dcf420 100644
--- a/source4/librpc/config.mk
+++ b/source4/librpc/config.mk
@@ -10,8 +10,6 @@ PUBLIC_DEPENDENCIES = LIBSAMBA-ERRORS LIBTALLOC LIBSAMBA-UTIL CHARSET \
LIBNDR_OBJ_FILES = $(addprefix $(ndrsrcdir)/, ndr_string.o) ../librpc/ndr/ndr_basic.o ../librpc/ndr/uuid.o ../librpc/ndr/ndr.o
-$(eval $(call proto_header_template,$(ndrsrcdir)/libndr_proto.h,$(LIBNDR_OBJ_FILES:.o=.c)))
-
PC_FILES += ../librpc/ndr.pc
LIBNDR_VERSION = 0.0.1
LIBNDR_SOVERSION = 0
@@ -90,7 +88,7 @@ NDR_DCOM_OBJ_FILES = $(gen_ndrsrcdir)/ndr_dcom.o
[SUBSYSTEM::NDR_WMI]
PUBLIC_DEPENDENCIES = LIBNDR NDR_SECURITY NDR_DCOM
-NDR_WMI_OBJ_FILES = $(gen_ndrsrcdir)/ndr_wmi.o $(ndrsrcdir)/ndr_wmi.o
+NDR_WMI_OBJ_FILES = $(gen_ndrsrcdir)/ndr_wmi.o ../librpc/ndr/ndr_wmi.o
[SUBSYSTEM::NDR_DSBACKUP]
PUBLIC_DEPENDENCIES = LIBNDR
@@ -261,7 +259,7 @@ NDR_PROTECTED_STORAGE_OBJ_FILES = $(gen_ndrsrcdir)/ndr_protected_storage.o
[SUBSYSTEM::NDR_ORPC]
PUBLIC_DEPENDENCIES = LIBNDR
-NDR_ORPC_OBJ_FILES = $(gen_ndrsrcdir)/ndr_orpc.o $(ndrsrcdir)/ndr_orpc.o
+NDR_ORPC_OBJ_FILES = $(gen_ndrsrcdir)/ndr_orpc.o ../librpc/ndr/ndr_orpc.o
[SUBSYSTEM::NDR_OXIDRESOLVER]
PUBLIC_DEPENDENCIES = LIBNDR NDR_ORPC NDR_MISC
diff --git a/source4/librpc/idl/dcerpc.idl b/source4/librpc/idl/dcerpc.idl
index a78329d990..7c0abe6ab8 100644
--- a/source4/librpc/idl/dcerpc.idl
+++ b/source4/librpc/idl/dcerpc.idl
@@ -205,26 +205,26 @@ interface dcerpc
} dcerpc_working;
typedef [enum8bit] enum {
- DCERPC_PKT_REQUEST = 0,
- DCERPC_PKT_PING = 1,
- DCERPC_PKT_RESPONSE = 2,
- DCERPC_PKT_FAULT = 3,
- DCERPC_PKT_WORKING = 4,
- DCERPC_PKT_NOCALL = 5,
- DCERPC_PKT_REJECT = 6,
- DCERPC_PKT_ACK = 7,
- DCERPC_PKT_CL_CANCEL = 8,
- DCERPC_PKT_FACK = 9,
- DCERPC_PKT_CANCEL_ACK = 10,
- DCERPC_PKT_BIND = 11,
- DCERPC_PKT_BIND_ACK = 12,
- DCERPC_PKT_BIND_NAK = 13,
- DCERPC_PKT_ALTER = 14,
- DCERPC_PKT_ALTER_RESP = 15,
- DCERPC_PKT_AUTH3 = 16,
- DCERPC_PKT_SHUTDOWN = 17,
- DCERPC_PKT_CO_CANCEL = 18,
- DCERPC_PKT_ORPHANED = 19
+ DCERPC_PKT_REQUEST = 0, /* Ordinary request. */
+ DCERPC_PKT_PING = 1, /* Connectionless is server alive ? */
+ DCERPC_PKT_RESPONSE = 2, /* Ordinary reply. */
+ DCERPC_PKT_FAULT = 3, /* Fault in processing of call. */
+ DCERPC_PKT_WORKING = 4, /* Connectionless reply to a ping when server busy. */
+ DCERPC_PKT_NOCALL = 5, /* Connectionless reply to a ping when server has lost part of clients call. */
+ DCERPC_PKT_REJECT = 6, /* Refuse a request with a code. */
+ DCERPC_PKT_ACK = 7, /* Connectionless client to server code. */
+ DCERPC_PKT_CL_CANCEL = 8, /* Connectionless cancel. */
+ DCERPC_PKT_FACK = 9, /* Connectionless fragment ack. Both client and server send. */
+ DCERPC_PKT_CANCEL_ACK = 10, /* Server ACK to client cancel request. */
+ DCERPC_PKT_BIND = 11, /* Bind to interface. */
+ DCERPC_PKT_BIND_ACK = 12, /* Server ack of bind. */
+ DCERPC_PKT_BIND_NAK = 13, /* Server nack of bind. */
+ DCERPC_PKT_ALTER = 14, /* Alter auth. */
+ DCERPC_PKT_ALTER_RESP = 15, /* Reply to alter auth. */
+ DCERPC_PKT_AUTH3 = 16, /* not the real name! this is undocumented! */
+ DCERPC_PKT_SHUTDOWN = 17, /* Server to client request to shutdown. */
+ DCERPC_PKT_CO_CANCEL = 18, /* Connection-oriented cancel request. */
+ DCERPC_PKT_ORPHANED = 19 /* Client telling server it's aborting a partially sent request or telling server to stop sending replies. */
} dcerpc_pkt_type;
typedef [nodiscriminant] union {
diff --git a/source4/librpc/idl/srvsvc.idl b/source4/librpc/idl/srvsvc.idl
index 703f3281cf..10807cd6af 100644
--- a/source4/librpc/idl/srvsvc.idl
+++ b/source4/librpc/idl/srvsvc.idl
@@ -65,7 +65,7 @@ import "security.idl", "svcctl.idl";
/******************/
/* Function: 0x01 */
WERROR srvsvc_NetCharDevGetInfo(
- [in,unique] [string,charset(UTF16)] uint16 *server_unc,
+ [in,unique] [string,charset(UTF16)] uint16 *server_unc,
[in] [string,charset(UTF16)] uint16 device_name[],
[in] uint32 level,
[out,switch_is(level)] srvsvc_NetCharDevInfo info
@@ -74,7 +74,7 @@ import "security.idl", "svcctl.idl";
/******************/
/* Function: 0x02 */
WERROR srvsvc_NetCharDevControl(
- [in,unique] [string,charset(UTF16)] uint16 *server_unc,
+ [in,unique] [string,charset(UTF16)] uint16 *server_unc,
[in] [string,charset(UTF16)] uint16 device_name[],
[in] uint32 opcode
);
@@ -131,7 +131,7 @@ import "security.idl", "svcctl.idl";
/******************/
/* Function: 0x04 */
WERROR srvsvc_NetCharDevQGetInfo(
- [in,unique] [string,charset(UTF16)] uint16 *server_unc,
+ [in,unique] [string,charset(UTF16)] uint16 *server_unc,
[in] [string,charset(UTF16)] uint16 queue_name[],
[in] [string,charset(UTF16)] uint16 user[],
[in] uint32 level,
@@ -151,14 +151,14 @@ import "security.idl", "svcctl.idl";
/******************/
/* Function: 0x06 */
WERROR srvsvc_NetCharDevQPurge(
- [in,unique] [string,charset(UTF16)] uint16 *server_unc,
+ [in,unique] [string,charset(UTF16)] uint16 *server_unc,
[in] [string,charset(UTF16)] uint16 queue_name[]
);
/******************/
/* Function: 0x07 */
WERROR srvsvc_NetCharDevQPurgeSelf(
- [in,unique] [string,charset(UTF16)] uint16 *server_unc,
+ [in,unique] [string,charset(UTF16)] uint16 *server_unc,
[in] [string,charset(UTF16)] uint16 queue_name[],
[in] [string,charset(UTF16)] uint16 computer_name[]
);
diff --git a/source4/librpc/ndr/ndr_orpc.c b/source4/librpc/ndr/ndr_orpc.c
deleted file mode 100644
index 6a55048e43..0000000000
--- a/source4/librpc/ndr/ndr_orpc.c
+++ /dev/null
@@ -1,173 +0,0 @@
-/*
- Unix SMB/CIFS implementation.
-
- routines for marshalling/unmarshalling DCOM string arrays
-
- Copyright (C) Jelmer Vernooij 2004
-
- 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_orpc.h"
-
-enum ndr_err_code ndr_pull_DUALSTRINGARRAY(struct ndr_pull *ndr, int ndr_flags, struct DUALSTRINGARRAY *ar)
-{
- uint16_t num_entries, security_offset;
- uint16_t towerid;
- uint32_t towernum = 0, conformant_size;
-
- if (!(ndr_flags & NDR_SCALARS)) {
- return NDR_ERR_SUCCESS;
- }
-
- NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &conformant_size));
- NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &num_entries));
- NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &security_offset));
-
- ar->stringbindings = talloc_array(ndr, struct STRINGBINDING *, num_entries);
- ar->stringbindings[0] = NULL;
-
- do {
- /* 'Peek' */
- NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &towerid));
-
- if (towerid > 0) {
- ndr->offset -= 2;
- ar->stringbindings = talloc_realloc(ndr, ar->stringbindings, struct STRINGBINDING *, towernum+2);
- ar->stringbindings[towernum] = talloc(ndr, struct STRINGBINDING);
- NDR_CHECK(ndr_pull_STRINGBINDING(ndr, ndr_flags, ar->stringbindings[towernum]));
- towernum++;
- }
- } while (towerid != 0);
-
- ar->stringbindings[towernum] = NULL;
- towernum = 0;
-
- ar->securitybindings = talloc_array(ndr, struct SECURITYBINDING *, num_entries);
- ar->securitybindings[0] = NULL;
-
- do {
- /* 'Peek' */
- NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &towerid));
-
- if (towerid > 0) {
- ndr->offset -= 2;
- ar->securitybindings = talloc_realloc(ndr, ar->securitybindings, struct SECURITYBINDING *, towernum+2);
- ar->securitybindings[towernum] = talloc(ndr, struct SECURITYBINDING);
- NDR_CHECK(ndr_pull_SECURITYBINDING(ndr, ndr_flags, ar->securitybindings[towernum]));
- towernum++;
- }
- } while (towerid != 0);
-
- ar->securitybindings[towernum] = NULL;
-
- return NDR_ERR_SUCCESS;
-}
-
-enum ndr_err_code ndr_push_DUALSTRINGARRAY(struct ndr_push *ndr, int ndr_flags, const struct DUALSTRINGARRAY *ar)
-{
- return ndr_push_error(ndr, NDR_ERR_STRING, "ndr_push_DUALSTRINGARRAY not implemented");
-}
-
-/*
- print a dom_sid
-*/
-void ndr_print_DUALSTRINGARRAY(struct ndr_print *ndr, const char *name, const struct DUALSTRINGARRAY *ar)
-{
- int i;
- ndr->print(ndr, "%-25s: DUALSTRINGARRAY", name);
- ndr->depth++;
- ndr->print(ndr, "STRING BINDINGS");
- ndr->depth++;
- for (i=0;ar->stringbindings[i];i++) {
- char *idx = NULL;
- asprintf(&idx, "[%d]", i);
- if (idx) {
- ndr_print_STRINGBINDING(ndr, idx, ar->stringbindings[i]);
- free(idx);
- }
- }
- ndr->depth--;
- ndr->print(ndr, "SECURITY BINDINGS");
- ndr->depth++;
- for (i=0;ar->securitybindings[i];i++) {
- char *idx = NULL;
- asprintf(&idx, "[%d]", i);
- if (idx) {
- ndr_print_SECURITYBINDING(ndr, idx, ar->securitybindings[i]);
- free(idx);
- }
- }
- ndr->depth--;
-}
-
-enum ndr_err_code ndr_pull_STRINGARRAY(struct ndr_pull *ndr, int ndr_flags, struct STRINGARRAY *ar)
-{
- uint16_t towerid;
- uint32_t towernum = 0;
- uint16_t num_entries;
-
- if (!(ndr_flags & NDR_SCALARS)) {
- return NDR_ERR_SUCCESS;
- }
-
- NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &num_entries));
-
- ar->stringbindings = talloc_array(ndr, struct STRINGBINDING *, 1);
- ar->stringbindings[0] = NULL;
-
- do {
- /* 'Peek' */
- NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &towerid));
-
- if (towerid > 0) {
- ndr->offset -= 2;
- ar->stringbindings = talloc_realloc(ndr, ar->stringbindings, struct STRINGBINDING *, towernum+2);
- ar->stringbindings[towernum] = talloc(ndr, struct STRINGBINDING);
- NDR_CHECK(ndr_pull_STRINGBINDING(ndr, ndr_flags, ar->stringbindings[towernum]));
- towernum++;
- }
- } while (towerid != 0);
-
- ar->stringbindings[towernum] = NULL;
- towernum = 0;
-
- return NDR_ERR_SUCCESS;
-}
-
-enum ndr_err_code ndr_push_STRINGARRAY(struct ndr_push *ndr, int ndr_flags, const struct STRINGARRAY *ar)
-{
- return ndr_push_error(ndr, NDR_ERR_STRING, "ndr_push_STRINGARRAY not implemented");
-}
-
-/*
- print a dom_sid
-*/
-void ndr_print_STRINGARRAY(struct ndr_print *ndr, const char *name, const struct STRINGARRAY *ar)
-{
- int i;
- ndr->print(ndr, "%-25s: STRINGARRAY", name);
- ndr->depth++;
- for (i=0;ar->stringbindings[i];i++) {
- char *idx = NULL;
- asprintf(&idx, "[%d]", i);
- if (idx) {
- ndr_print_STRINGBINDING(ndr, idx, ar->stringbindings[i]);
- free(idx);
- }
- }
- ndr->depth--;
-}
diff --git a/source4/librpc/ndr/ndr_wmi.c b/source4/librpc/ndr/ndr_wmi.c
deleted file mode 100644
index 6cf42471f8..0000000000
--- a/source4/librpc/ndr/ndr_wmi.c
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- Unix SMB/CIFS implementation.
-
- routines for marshalling/unmarshalling DCOM string arrays
-
- Copyright (C) Jelmer Vernooij 2004
-
- 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 2 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, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-*/
-//#define NDR_CHECK_DEBUG
-#include "includes.h"
-#include "librpc/gen_ndr/ndr_dcom.h"
-#include "librpc/gen_ndr/ndr_wmi.h"
-#include "librpc/ndr/ndr_wmi.h"
-
-// Just for debugging
-int NDR_CHECK_depth = 0;
-int NDR_CHECK_shift = 0x18;
-
-int get_CIMTYPE_size(int t)
-{
- if (t & CIM_FLAG_ARRAY) return 4;
- t &= 0x1FF;
- switch (t) {
- case CIM_SINT8:
- case CIM_UINT8:
- return 1;
- case CIM_SINT16:
- case CIM_UINT16:
- case CIM_BOOLEAN:
- return 2;
- case CIM_SINT32:
- case CIM_UINT32:
- case CIM_REAL32:
- case CIM_STRING:
- case CIM_DATETIME:
- case CIM_REFERENCE:
- case CIM_OBJECT:
- return 4;
- case CIM_SINT64:
- case CIM_UINT64:
- case CIM_REAL64:
- return 8;
- default:
- DEBUG(0, ("Unknown CIMTYPE size for %04X", t));
- return 4;
- }
-}
-
-enum ndr_err_code ndr_push_BSTR(struct ndr_push *ndr, int ndr_flags, const struct BSTR *r)
-{
- uint32_t len;
- uint32_t flags;
- enum ndr_err_code status;
- len = strlen(r->data);
- if (ndr_flags & NDR_SCALARS) {
- NDR_CHECK(ndr_push_align(ndr, 4));
- NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0x72657355));
- NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, len));
- NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 2*len));
- flags = ndr->flags;
- ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NOTERM | LIBNDR_FLAG_STR_SIZE4);
- status = ndr_push_string(ndr, NDR_SCALARS, r->data);
- ndr->flags = flags;
- return status;
- }
- return NDR_ERR_SUCCESS;
-}
-
-enum ndr_err_code ndr_pull_BSTR(struct ndr_pull *ndr, int ndr_flags, struct BSTR *r)
-{
- return NDR_ERR_BAD_SWITCH;
-}
-
-void ndr_print_BSTR(struct ndr_print *ndr, const char *name, const struct BSTR *r)
-{
- ndr->print(ndr, "%-25s: BSTR(\"%s\")", name, r->data);
-}
diff --git a/source4/librpc/ndr/ndr_wmi.h b/source4/librpc/ndr/ndr_wmi.h
deleted file mode 100644
index 539b9e882b..0000000000
--- a/source4/librpc/ndr/ndr_wmi.h
+++ /dev/null
@@ -1,3 +0,0 @@
-typedef const char *CIMSTRING;
-enum ndr_err_code ndr_pull_CIMSTRING(struct ndr_pull *ndr, int ndr_flags, CIMSTRING *r);
-enum ndr_err_code ndr_push_CIMSTRING(struct ndr_push *ndr, int ndr_flags, const CIMSTRING *r);