summaryrefslogtreecommitdiff
path: root/source4/librpc
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2005-06-05 23:05:37 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:17:40 -0500
commit430dc36c1a456607826cedb9610d2a39cb923bd5 (patch)
tree700372c30db1db5c3ccb3b45f7eb827b4dbed378 /source4/librpc
parentba750f50d3f35193f26fa1a6628eaa33afd3c07c (diff)
downloadsamba-430dc36c1a456607826cedb9610d2a39cb923bd5.tar.gz
samba-430dc36c1a456607826cedb9610d2a39cb923bd5.tar.bz2
samba-430dc36c1a456607826cedb9610d2a39cb923bd5.zip
r7312: Add IDL for ncadg packets.
(This used to be commit 2009a430b03c685dd65bd573e70d3618f2e0dd0f)
Diffstat (limited to 'source4/librpc')
-rw-r--r--source4/librpc/idl/dcerpc.idl89
-rw-r--r--source4/librpc/rpc/dcerpc.c27
-rw-r--r--source4/librpc/rpc/dcerpc_util.c6
3 files changed, 102 insertions, 20 deletions
diff --git a/source4/librpc/idl/dcerpc.idl b/source4/librpc/idl/dcerpc.idl
index 584bec0b10..a3949b737f 100644
--- a/source4/librpc/idl/dcerpc.idl
+++ b/source4/librpc/idl/dcerpc.idl
@@ -148,6 +148,50 @@ interface dcerpc
[flag(NDR_REMAINING)] DATA_BLOB auth_info;
} dcerpc_auth3;
+ typedef [public] struct {
+ uint32 _pad;
+ [flag(NDR_REMAINING)] DATA_BLOB auth_info;
+ } dcerpc_orphaned;
+
+ typedef [public] struct {
+ uint32 _pad;
+ [flag(NDR_REMAINING)] DATA_BLOB auth_info;
+ } dcerpc_co_cancel;
+
+ typedef [public] struct {
+ uint32 version;
+ uint32 id;
+ } dcerpc_cl_cancel;
+
+ typedef [public] struct {
+ uint32 version;
+ uint32 id;
+ boolean32 server_is_accepting;
+ } dcerpc_cancel_ack;
+
+ typedef [public] struct {
+ uint32 version;
+ uint8 _pad1;
+ uint16 window_size;
+ uint32 max_tdsu;
+ uint32 max_frag_size;
+ uint16 serial_no;
+ uint16 selack_size;
+ uint32 selack[selack_size];
+ } dcerpc_fack;
+
+ typedef [public] struct {
+ } dcerpc_ack;
+
+ typedef [public] struct {
+ } dcerpc_ping;
+
+ typedef [public] struct {
+ } dcerpc_shutdown;
+
+ typedef [public] struct {
+ } dcerpc_working;
+
typedef [enum8bit] enum {
DCERPC_PKT_REQUEST = 0,
DCERPC_PKT_PING = 1,
@@ -181,8 +225,24 @@ interface dcerpc
[case(DCERPC_PKT_FAULT)] dcerpc_fault fault;
[case(DCERPC_PKT_AUTH3)] dcerpc_auth3 auth3;
[case(DCERPC_PKT_BIND_NAK)] dcerpc_bind_nak bind_nak;
- } dcerpc_payload;
+ [case(DCERPC_PKT_CO_CANCEL)] dcerpc_co_cancel cancel;
+ [case(DCERPC_PKT_ORPHANED)] dcerpc_orphaned orphaned;
+ [case(DCERPC_PKT_SHUTDOWN)] dcerpc_shutdown shutdown;
+ } ncacn_payload;
+ typedef [nodiscriminant] union {
+ [case(DCERPC_PKT_REQUEST)] dcerpc_request request;
+ [case(DCERPC_PKT_PING)] dcerpc_ping ping;
+ [case(DCERPC_PKT_RESPONSE)] dcerpc_response response;
+ [case(DCERPC_PKT_FAULT)] dcerpc_fault fault;
+ [case(DCERPC_PKT_WORKING)] dcerpc_working working;
+ [case(DCERPC_PKT_NOCALL)] dcerpc_fack nocall;
+ [case(DCERPC_PKT_REJECT)] dcerpc_fault reject;
+ [case(DCERPC_PKT_ACK)] dcerpc_ack ack;
+ [case(DCERPC_PKT_CANCEL_ACK)] dcerpc_cancel_ack cancel_ack;
+ [case(DCERPC_PKT_FACK)] dcerpc_fack fack;
+ [case(DCERPC_PKT_CL_CANCEL)] dcerpc_cl_cancel cancel;
+ } ncadg_payload;
/* pfc_flags values */
const uint8 DCERPC_PFC_FLAG_FIRST = 0x01;
@@ -207,6 +267,29 @@ interface dcerpc
uint16 frag_length; /* Total length of fragment */
uint16 auth_length; /* authenticator length */
uint32 call_id; /* Call identifier */
- [switch_is(ptype)] dcerpc_payload u;
- } dcerpc_packet;
+ [switch_is(ptype)] ncacn_payload u;
+ } ncacn_packet;
+
+ typedef [public] struct {
+ uint8 rpc_vers; /* RPC version (4) */
+ uint8 ptype;
+ uint8 pfc_flags;
+ uint8 ncadg_flags;
+ uint8 drep[3];
+ uint8 serial_high;
+ GUID object;
+ GUID iface;
+ GUID activity;
+ uint32 server_boot; /* Server boot time */
+ uint32 iface_version;
+ uint32 seq_num;
+ uint16 opnum;
+ uint16 ihint;
+ uint16 ahint;
+ uint16 len;
+ uint16 fragnum;
+ uint8 auth_proto;
+ uint8 serial_low;
+ [switch_is(ptype)] ncadg_payload u;
+ } ncadg_packet;
}
diff --git a/source4/librpc/rpc/dcerpc.c b/source4/librpc/rpc/dcerpc.c
index 0194decb4a..e3dbd86ca4 100644
--- a/source4/librpc/rpc/dcerpc.c
+++ b/source4/librpc/rpc/dcerpc.c
@@ -182,11 +182,11 @@ static struct ndr_pull *ndr_pull_init_flags(struct dcerpc_connection *c,
}
/*
- parse a data blob into a dcerpc_packet structure. This handles both
+ parse a data blob into a ncacn_packet structure. This handles both
input and output packets
*/
static NTSTATUS dcerpc_pull(struct dcerpc_connection *c, DATA_BLOB *blob, TALLOC_CTX *mem_ctx,
- struct dcerpc_packet *pkt)
+ struct ncacn_packet *pkt)
{
struct ndr_pull *ndr;
@@ -199,7 +199,7 @@ static NTSTATUS dcerpc_pull(struct dcerpc_connection *c, DATA_BLOB *blob, TALLOC
ndr->flags |= LIBNDR_FLAG_BIGENDIAN;
}
- return ndr_pull_dcerpc_packet(ndr, NDR_SCALARS|NDR_BUFFERS, pkt);
+ return ndr_pull_ncacn_packet(ndr, NDR_SCALARS|NDR_BUFFERS, pkt);
}
/*
@@ -233,7 +233,7 @@ static NTSTATUS dcerpc_check_connect_verifier(DATA_BLOB *blob)
*/
static NTSTATUS dcerpc_pull_request_sign(struct dcerpc_connection *c,
DATA_BLOB *blob, TALLOC_CTX *mem_ctx,
- struct dcerpc_packet *pkt)
+ struct ncacn_packet *pkt)
{
struct ndr_pull *ndr;
NTSTATUS status;
@@ -256,7 +256,7 @@ static NTSTATUS dcerpc_pull_request_sign(struct dcerpc_connection *c,
}
/* pull the basic packet */
- status = ndr_pull_dcerpc_packet(ndr, NDR_SCALARS|NDR_BUFFERS, pkt);
+ status = ndr_pull_ncacn_packet(ndr, NDR_SCALARS|NDR_BUFFERS, pkt);
if (!NT_STATUS_IS_OK(status)) {
return status;
}
@@ -350,7 +350,7 @@ static NTSTATUS dcerpc_pull_request_sign(struct dcerpc_connection *c,
*/
static NTSTATUS dcerpc_push_request_sign(struct dcerpc_connection *c,
DATA_BLOB *blob, TALLOC_CTX *mem_ctx,
- struct dcerpc_packet *pkt)
+ struct ncacn_packet *pkt)
{
NTSTATUS status;
struct ndr_push *ndr;
@@ -375,7 +375,7 @@ static NTSTATUS dcerpc_push_request_sign(struct dcerpc_connection *c,
ndr->flags |= LIBNDR_FLAG_OBJECT_PRESENT;
}
- status = ndr_push_dcerpc_packet(ndr, NDR_SCALARS|NDR_BUFFERS, pkt);
+ status = ndr_push_ncacn_packet(ndr, NDR_SCALARS|NDR_BUFFERS, pkt);
if (!NT_STATUS_IS_OK(status)) {
return status;
}
@@ -482,7 +482,7 @@ static NTSTATUS dcerpc_push_request_sign(struct dcerpc_connection *c,
/*
fill in the fixed values in a dcerpc header
*/
-static void init_dcerpc_hdr(struct dcerpc_connection *c, struct dcerpc_packet *pkt)
+static void init_dcerpc_hdr(struct dcerpc_connection *c, struct ncacn_packet *pkt)
{
pkt->rpc_vers = 5;
pkt->rpc_vers_minor = 0;
@@ -581,7 +581,7 @@ NTSTATUS dcerpc_bind(struct dcerpc_pipe *p,
const struct dcerpc_syntax_id *syntax,
const struct dcerpc_syntax_id *transfer_syntax)
{
- struct dcerpc_packet pkt;
+ struct ncacn_packet pkt;
NTSTATUS status;
DATA_BLOB blob;
@@ -652,14 +652,13 @@ NTSTATUS dcerpc_bind(struct dcerpc_pipe *p,
return status;
}
-
/*
perform a continued bind (and auth3)
*/
NTSTATUS dcerpc_auth3(struct dcerpc_connection *c,
TALLOC_CTX *mem_ctx)
{
- struct dcerpc_packet pkt;
+ struct ncacn_packet pkt;
NTSTATUS status;
DATA_BLOB blob;
@@ -721,7 +720,7 @@ static void dcerpc_request_recv_data(struct dcerpc_connection *c,
DATA_BLOB *data,
NTSTATUS status)
{
- struct dcerpc_packet pkt;
+ struct ncacn_packet pkt;
struct rpc_request *req;
uint_t length;
@@ -851,7 +850,7 @@ struct rpc_request *dcerpc_request_send(struct dcerpc_pipe *p,
DATA_BLOB *stub_data)
{
struct rpc_request *req;
- struct dcerpc_packet pkt;
+ struct ncacn_packet pkt;
DATA_BLOB blob;
uint32_t remaining, chunk_size;
BOOL first_packet = True;
@@ -1355,7 +1354,7 @@ NTSTATUS dcerpc_alter_context(struct dcerpc_pipe *p,
const struct dcerpc_syntax_id *syntax,
const struct dcerpc_syntax_id *transfer_syntax)
{
- struct dcerpc_packet pkt;
+ struct ncacn_packet pkt;
NTSTATUS status;
DATA_BLOB blob;
diff --git a/source4/librpc/rpc/dcerpc_util.c b/source4/librpc/rpc/dcerpc_util.c
index 1a0518888d..0265d37f0f 100644
--- a/source4/librpc/rpc/dcerpc_util.c
+++ b/source4/librpc/rpc/dcerpc_util.c
@@ -87,10 +87,10 @@ const struct dcerpc_interface_table *idl_iface_by_uuid(const char *uuid)
/*
- push a dcerpc_packet into a blob, potentially with auth info
+ push a ncacn_packet into a blob, potentially with auth info
*/
NTSTATUS dcerpc_push_auth(DATA_BLOB *blob, TALLOC_CTX *mem_ctx,
- struct dcerpc_packet *pkt,
+ struct ncacn_packet *pkt,
struct dcerpc_auth *auth_info)
{
NTSTATUS status;
@@ -115,7 +115,7 @@ NTSTATUS dcerpc_push_auth(DATA_BLOB *blob, TALLOC_CTX *mem_ctx,
pkt->auth_length = 0;
}
- status = ndr_push_dcerpc_packet(ndr, NDR_SCALARS|NDR_BUFFERS, pkt);
+ status = ndr_push_ncacn_packet(ndr, NDR_SCALARS|NDR_BUFFERS, pkt);
if (!NT_STATUS_IS_OK(status)) {
return status;
}