git add -f bin/default/librpc/gen_ndr/*.[ch] bin/default/source*/librpc/gen_ndr/...
authorStefan Metzmacher <metze@samba.org>
Fri, 30 Aug 2013 13:05:07 +0000 (15:05 +0200)
committerStefan Metzmacher <metze@samba.org>
Tue, 4 Jun 2019 11:15:20 +0000 (13:15 +0200)
bin.gen_ndr/default/librpc/gen_ndr/echo.h
bin.gen_ndr/default/librpc/gen_ndr/ndr_echo.c
bin.gen_ndr/default/librpc/gen_ndr/ndr_echo.h
bin.gen_ndr/default/librpc/gen_ndr/ndr_echo_c.c
bin.gen_ndr/default/librpc/gen_ndr/ndr_echo_c.h
bin.gen_ndr/default/librpc/gen_ndr/ndr_echo_s.c
bin.gen_ndr/default/librpc/gen_ndr/srv_echo.c
bin.gen_ndr/default/librpc/gen_ndr/srv_echo.h

index 14909740767e9b05eefed25cce62a1ea54d40870..09c1934574919066bef6eb38671634485342223e 100644 (file)
@@ -92,6 +92,12 @@ struct echo_Surrounding {
        uint16_t *surrounding;/* [size_is(x)] */
 };
 
+struct echo_BytePipe;
+struct echo_BytePipe_chunk {
+       uint32_t count;
+       uint8_t *array;
+};
+
 
 struct echo_AddOne {
        struct {
@@ -215,5 +221,18 @@ struct echo_TestDoublePointer {
 
 };
 
+
+struct echo_BytePipeIn {
+       struct {
+               uint32_t value;
+               struct echo_BytePipe *bp;/* [ref] */
+       } in;
+
+       struct {
+               uint32_t result;
+       } out;
+
+};
+
 #endif /* _HEADER_rpcecho */
 #endif /* _PIDL_HEADER_rpcecho */
index c70fe33e418cd80b7c0e9af01d7b7eebe691ff62..51681e758977ca07de013f7c5b3cc5a429007664 100644 (file)
@@ -691,6 +691,53 @@ _PUBLIC_ void ndr_print_echo_Surrounding(struct ndr_print *ndr, const char *name
        ndr->depth--;
 }
 
+static enum ndr_err_code ndr_push_echo_BytePipe_chunk(struct ndr_push *ndr, int ndr_flags, const struct echo_BytePipe_chunk *r)
+{
+       NDR_PUSH_CHECK_FLAGS(ndr, ndr_flags);
+       if (ndr_flags & NDR_SCALARS) {
+               NDR_CHECK(ndr_push_align(ndr, 5));
+               NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->count));
+               NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->array, r->count));
+               NDR_CHECK(ndr_push_trailer_align(ndr, 5));
+       }
+       if (ndr_flags & NDR_BUFFERS) {
+       }
+
+       NDR_CHECK(ndr_push_pipe_chunk_trailer(ndr, ndr_flags, r->count));
+
+       return NDR_ERR_SUCCESS;
+}
+
+static enum ndr_err_code ndr_pull_echo_BytePipe_chunk(struct ndr_pull *ndr, int ndr_flags, struct echo_BytePipe_chunk *r)
+{
+       uint32_t size_array_0 = 0;
+       NDR_PULL_CHECK_FLAGS(ndr, ndr_flags);
+       if (ndr_flags & NDR_SCALARS) {
+               NDR_CHECK(ndr_pull_align(ndr, 5));
+               NDR_CHECK(ndr_pull_uint3264(ndr, NDR_SCALARS, &r->count));
+               size_array_0 = r->count;
+               NDR_PULL_ALLOC_N(ndr, r->array, size_array_0);
+               NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->array, size_array_0));
+               NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
+       }
+       if (ndr_flags & NDR_BUFFERS) {
+       }
+
+       NDR_CHECK(ndr_check_pipe_chunk_trailer(ndr, ndr_flags, r->count));
+
+       return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_echo_BytePipe_chunk(struct ndr_print *ndr, const char *name, const struct echo_BytePipe_chunk *r)
+{
+       ndr_print_struct(ndr, name, "echo_BytePipe_chunk");
+       if (r == NULL) { ndr_print_null(ndr); return; }
+       ndr->depth++;
+       ndr_print_uint3264(ndr, "count", r->count);
+       ndr_print_array_uint8(ndr, "array", r->array, r->count);
+       ndr->depth--;
+}
+
 static enum ndr_err_code ndr_push_echo_AddOne(struct ndr_push *ndr, int flags, const struct echo_AddOne *r)
 {
        NDR_PUSH_CHECK_FN_FLAGS(ndr, flags);
@@ -1494,6 +1541,68 @@ _PUBLIC_ void ndr_print_echo_TestDoublePointer(struct ndr_print *ndr, const char
        ndr->depth--;
 }
 
+static enum ndr_err_code ndr_push_echo_BytePipeIn(struct ndr_push *ndr, int flags, const struct echo_BytePipeIn *r)
+{
+       NDR_PUSH_CHECK_FN_FLAGS(ndr, flags);
+       if (flags & NDR_IN) {
+               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.value));
+       }
+       if (flags & NDR_OUT) {
+               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->out.result));
+       }
+       return NDR_ERR_SUCCESS;
+}
+
+static enum ndr_err_code ndr_pull_echo_BytePipeIn(struct ndr_pull *ndr, int flags, struct echo_BytePipeIn *r)
+{
+       NDR_PULL_CHECK_FN_FLAGS(ndr, flags);
+       if (flags & NDR_IN) {
+               NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.value));
+       }
+       if (flags & NDR_OUT) {
+               NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->out.result));
+       }
+       return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_echo_BytePipeIn(struct ndr_print *ndr, const char *name, int flags, const struct echo_BytePipeIn *r)
+{
+       ndr_print_struct(ndr, name, "echo_BytePipeIn");
+       if (r == NULL) { ndr_print_null(ndr); return; }
+       ndr->depth++;
+       if (flags & NDR_SET_VALUES) {
+               ndr->flags |= LIBNDR_PRINT_SET_VALUES;
+       }
+       if (flags & NDR_IN) {
+               ndr_print_struct(ndr, "in", "echo_BytePipeIn");
+               ndr->depth++;
+               ndr_print_uint32(ndr, "value", r->in.value);
+               ndr_print_ptr(ndr, "bp", r->in.bp);
+               ndr->depth++;
+               ndr->depth--;
+               ndr->depth--;
+       }
+       if (flags & NDR_OUT) {
+               ndr_print_struct(ndr, "out", "echo_BytePipeIn");
+               ndr->depth++;
+               ndr_print_uint32(ndr, "result", r->out.result);
+               ndr->depth--;
+       }
+       ndr->depth--;
+}
+
+static const struct ndr_interface_call_pipe echo_BytePipeIn_in_pipes[] = {
+       {
+               "in.bp",
+               "echo_BytePipe_chunk",
+               sizeof(struct echo_BytePipe_chunk),
+               (ndr_push_flags_fn_t) ndr_push_echo_BytePipe_chunk,
+               (ndr_pull_flags_fn_t) ndr_pull_echo_BytePipe_chunk,
+               (ndr_print_fn_t) ndr_print_echo_BytePipe_chunk,
+       },
+       { NULL, NULL, 0, NULL, NULL, NULL }
+};
+
 static const struct ndr_interface_call rpcecho_calls[] = {
        {
                "echo_AddOne",
@@ -1585,6 +1694,15 @@ static const struct ndr_interface_call rpcecho_calls[] = {
                { 0, NULL },
                { 0, NULL },
        },
+       {
+               "echo_BytePipeIn",
+               sizeof(struct echo_BytePipeIn),
+               (ndr_push_flags_fn_t) ndr_push_echo_BytePipeIn,
+               (ndr_pull_flags_fn_t) ndr_pull_echo_BytePipeIn,
+               (ndr_print_function_t) ndr_print_echo_BytePipeIn,
+               { 1, echo_BytePipeIn_in_pipes },
+               { 0, NULL },
+       },
        { NULL, 0, NULL, NULL, NULL }
 };
 
@@ -1616,7 +1734,7 @@ const struct ndr_interface_table ndr_table_rpcecho = {
                NDR_RPCECHO_VERSION
        },
        .helpstring     = NDR_RPCECHO_HELPSTRING,
-       .num_calls      = 10,
+       .num_calls      = 11,
        .calls          = rpcecho_calls,
        .endpoints      = &rpcecho_endpoints,
        .authservices   = &rpcecho_authservices
index 5592569a23bc19261750ca77d29884797874d36d..726ac36c51c8f06784d4b34399cde43f4334464e 100644 (file)
@@ -31,7 +31,9 @@ extern const struct ndr_interface_table ndr_table_rpcecho;
 
 #define NDR_ECHO_TESTDOUBLEPOINTER (0x09)
 
-#define NDR_RPCECHO_CALL_COUNT (10)
+#define NDR_ECHO_BYTEPIPEIN (0x0a)
+
+#define NDR_RPCECHO_CALL_COUNT (11)
 enum ndr_err_code ndr_push_echo_info1(struct ndr_push *ndr, int ndr_flags, const struct echo_info1 *r);
 enum ndr_err_code ndr_pull_echo_info1(struct ndr_pull *ndr, int ndr_flags, struct echo_info1 *r);
 void ndr_print_echo_info1(struct ndr_print *ndr, const char *name, const struct echo_info1 *r);
@@ -47,6 +49,7 @@ void ndr_print_echo_Enum1_32(struct ndr_print *ndr, const char *name, enum echo_
 void ndr_print_echo_Enum2(struct ndr_print *ndr, const char *name, const struct echo_Enum2 *r);
 void ndr_print_echo_Enum3(struct ndr_print *ndr, const char *name, const union echo_Enum3 *r);
 void ndr_print_echo_Surrounding(struct ndr_print *ndr, const char *name, const struct echo_Surrounding *r);
+void ndr_print_echo_BytePipe_chunk(struct ndr_print *ndr, const char *name, const struct echo_BytePipe_chunk *r);
 void ndr_print_echo_AddOne(struct ndr_print *ndr, const char *name, int flags, const struct echo_AddOne *r);
 void ndr_print_echo_EchoData(struct ndr_print *ndr, const char *name, int flags, const struct echo_EchoData *r);
 void ndr_print_echo_SinkData(struct ndr_print *ndr, const char *name, int flags, const struct echo_SinkData *r);
@@ -57,4 +60,5 @@ void ndr_print_echo_TestSleep(struct ndr_print *ndr, const char *name, int flags
 void ndr_print_echo_TestEnum(struct ndr_print *ndr, const char *name, int flags, const struct echo_TestEnum *r);
 void ndr_print_echo_TestSurrounding(struct ndr_print *ndr, const char *name, int flags, const struct echo_TestSurrounding *r);
 void ndr_print_echo_TestDoublePointer(struct ndr_print *ndr, const char *name, int flags, const struct echo_TestDoublePointer *r);
+void ndr_print_echo_BytePipeIn(struct ndr_print *ndr, const char *name, int flags, const struct echo_BytePipeIn *r);
 #endif /* _HEADER_NDR_rpcecho */
index 46821956a11e4d4899738b2bbe979936a9ec5cee..dae482852c2acbe7aecb7ca1e38a352b89c1e01b 100644 (file)
@@ -8,6 +8,170 @@
 
 /* rpcecho - client functions generated by pidl */
 
+struct echo_BytePipe {
+       struct dcerpc_pipe_handle_connection *pc;
+};
+
+struct echo_BytePipe *dcerpc_echo_BytePipe_create(TALLOC_CTX *mem_ctx)
+{
+       struct echo_BytePipe *p;
+
+       p = talloc_zero(mem_ctx, struct echo_BytePipe);
+       if (p == NULL) {
+               return NULL;
+       }
+
+       /* the pipe is disconnected by default */
+       p->pc = dcerpc_pipe_handle_connection_create(p,
+                               "echo_BytePipe_chunk",
+                               sizeof(struct echo_BytePipe_chunk));
+       if (p->pc == NULL) {
+               TALLOC_FREE(p);
+               return NULL;
+       }
+
+       return p;
+}
+
+struct dcerpc_echo_BytePipe_chunk_push_state {
+       uint8_t dummy;
+};
+
+static void dcerpc_echo_BytePipe_chunk_push_done(struct tevent_req *subreq);
+
+struct tevent_req *dcerpc_echo_BytePipe_chunk_push_send(TALLOC_CTX *mem_ctx,
+                                                       struct tevent_context *ev,
+                                                       struct echo_BytePipe *p,
+                                                       const struct echo_BytePipe_chunk *chunk)
+{
+       struct tevent_req *req;
+       struct dcerpc_echo_BytePipe_chunk_push_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct dcerpc_echo_BytePipe_chunk_push_state);
+       if (req == NULL) {
+               return NULL;
+       }
+
+       subreq = dcerpc_pipe_handle_push_send(state, ev,
+                               p->pc, chunk);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, dcerpc_echo_BytePipe_chunk_push_done, req);
+
+       return req;
+}
+
+static void dcerpc_echo_BytePipe_chunk_push_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req =
+               tevent_req_callback_data(subreq,
+               struct tevent_req);
+       NTSTATUS status;
+
+       status = dcerpc_pipe_handle_push_recv(subreq);
+       TALLOC_FREE(subreq);
+       if (tevent_req_nterror(req, status)) {
+               return;
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS dcerpc_echo_BytePipe_chunk_push_recv(struct tevent_req *req)
+{
+       struct dcerpc_echo_BytePipe_chunk_push_state *state =
+               tevent_req_data(req,
+               struct dcerpc_echo_BytePipe_chunk_push_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               /*
+                * We want the tevent_req_data() protection,
+                * but don't need 'state', so just pretend we use it
+                * in order to avoid compiler warnings.
+                */
+               state->dummy = 0;
+               tevent_req_received(req);
+               return status;
+       }
+
+       tevent_req_received(req);
+       return NT_STATUS_OK;
+}
+
+struct dcerpc_echo_BytePipe_chunk_pull_state {
+       struct echo_BytePipe_chunk *chunk;
+};
+
+static void dcerpc_echo_BytePipe_chunk_pull_done(struct tevent_req *subreq);
+
+struct tevent_req *dcerpc_echo_BytePipe_chunk_pull_send(TALLOC_CTX *mem_ctx,
+                                                       struct tevent_context *ev,
+                                                       struct echo_BytePipe *p)
+{
+       struct tevent_req *req;
+       struct dcerpc_echo_BytePipe_chunk_pull_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct dcerpc_echo_BytePipe_chunk_pull_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->chunk = talloc_zero(state, struct echo_BytePipe_chunk);
+       if (tevent_req_nomem(state->chunk, req)) {
+               return tevent_req_post(req, ev);
+       }
+
+       subreq = dcerpc_pipe_handle_pull_send(state, ev,
+                               p->pc, state->chunk, state->chunk);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, dcerpc_echo_BytePipe_chunk_pull_done, req);
+
+       return req;
+}
+
+static void dcerpc_echo_BytePipe_chunk_pull_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req =
+               tevent_req_callback_data(subreq,
+               struct tevent_req);
+       NTSTATUS status;
+
+       status = dcerpc_pipe_handle_pull_recv(subreq);
+       TALLOC_FREE(subreq);
+       if (tevent_req_nterror(req, status)) {
+               return;
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS dcerpc_echo_BytePipe_chunk_pull_recv(struct tevent_req *req,
+                                             TALLOC_CTX *mem_ctx,
+                                             struct echo_BytePipe_chunk **chunk)
+{
+       struct dcerpc_echo_BytePipe_chunk_pull_state *state =
+               tevent_req_data(req,
+               struct dcerpc_echo_BytePipe_chunk_pull_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
+               return status;
+       }
+
+       *chunk = talloc_move(mem_ctx, &state->chunk);
+
+       tevent_req_received(req);
+       return NT_STATUS_OK;
+}
+
 struct dcerpc_echo_AddOne_r_state {
        TALLOC_CTX *out_mem_ctx;
 };
@@ -2066,3 +2230,185 @@ NTSTATUS dcerpc_echo_TestDoublePointer(struct dcerpc_binding_handle *h,
        return NT_STATUS_OK;
 }
 
+struct dcerpc_echo_BytePipeIn_r_state {
+       struct dcerpc_pipe_handle_connection *in_pipes[1];
+       struct dcerpc_binding_handle_call_params params;
+       TALLOC_CTX *out_mem_ctx;
+};
+
+static void dcerpc_echo_BytePipeIn_r_done(struct tevent_req *subreq);
+
+struct tevent_req *dcerpc_echo_BytePipeIn_r_send(TALLOC_CTX *mem_ctx,
+       struct tevent_context *ev,
+       struct dcerpc_binding_handle *h,
+       struct echo_BytePipeIn *r)
+{
+       struct tevent_req *req;
+       struct dcerpc_echo_BytePipeIn_r_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct dcerpc_echo_BytePipeIn_r_state);
+       if (req == NULL) {
+               return NULL;
+       }
+
+       state->out_mem_ctx = NULL;
+
+       if (r->in.bp == NULL) {
+               tevent_req_nterror(req, NT_STATUS_INVALID_PARAMETER_MIX);
+               return tevent_req_post(req, ev);
+       }
+       state->in_pipes[0] = r->in.bp->pc;
+       state->params.r_mem = state;
+       state->params.r_ptr = r;
+       state->params.in.num_pipes = 1;
+       state->params.in.pipes = state->in_pipes;
+       state->params.out.num_pipes = 0;
+       state->params.out.pipes = NULL;
+
+       subreq = dcerpc_binding_handle_call_params_send(state, ev, h,
+                       NULL, &ndr_table_rpcecho,
+                       NDR_ECHO_BYTEPIPEIN, &state->params);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, dcerpc_echo_BytePipeIn_r_done, req);
+
+       return req;
+}
+
+static void dcerpc_echo_BytePipeIn_r_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req =
+               tevent_req_callback_data(subreq,
+               struct tevent_req);
+       NTSTATUS status;
+
+       status = dcerpc_binding_handle_call_params_recv(subreq);
+       TALLOC_FREE(subreq);
+       if (tevent_req_nterror(req, status)) {
+               return;
+       }
+
+       tevent_req_done(req);
+}
+
+NTSTATUS dcerpc_echo_BytePipeIn_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
+{
+       struct dcerpc_echo_BytePipeIn_r_state *state =
+               tevent_req_data(req,
+               struct dcerpc_echo_BytePipeIn_r_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
+               return status;
+       }
+
+       talloc_steal(mem_ctx, state->out_mem_ctx);
+
+       tevent_req_received(req);
+       return NT_STATUS_OK;
+}
+
+struct dcerpc_echo_BytePipeIn_state {
+       struct echo_BytePipeIn orig;
+       struct echo_BytePipeIn tmp;
+       TALLOC_CTX *out_mem_ctx;
+};
+
+static void dcerpc_echo_BytePipeIn_done(struct tevent_req *subreq);
+
+struct tevent_req *dcerpc_echo_BytePipeIn_send(TALLOC_CTX *mem_ctx,
+                                              struct tevent_context *ev,
+                                              struct dcerpc_binding_handle *h,
+                                              uint32_t _value /* [in]  */,
+                                              struct echo_BytePipe *_bp /* [in] [ref] */)
+{
+       struct tevent_req *req;
+       struct dcerpc_echo_BytePipeIn_state *state;
+       struct tevent_req *subreq;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct dcerpc_echo_BytePipeIn_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       state->out_mem_ctx = NULL;
+
+       /* In parameters */
+       state->orig.in.value = _value;
+       state->orig.in.bp = _bp;
+
+       /* Out parameters */
+
+       /* Result */
+       ZERO_STRUCT(state->orig.out.result);
+
+       /* make a temporary copy, that we pass to the dispatch function */
+       state->tmp = state->orig;
+
+       subreq = dcerpc_echo_BytePipeIn_r_send(state, ev, h, &state->tmp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, dcerpc_echo_BytePipeIn_done, req);
+       return req;
+}
+
+static void dcerpc_echo_BytePipeIn_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct dcerpc_echo_BytePipeIn_state *state = tevent_req_data(
+               req, struct dcerpc_echo_BytePipeIn_state);
+       NTSTATUS status;
+       TALLOC_CTX *mem_ctx;
+
+       if (state->out_mem_ctx) {
+               mem_ctx = state->out_mem_ctx;
+       } else {
+               mem_ctx = state;
+       }
+
+       status = dcerpc_echo_BytePipeIn_r_recv(subreq, mem_ctx);
+       TALLOC_FREE(subreq);
+       if (tevent_req_nterror(req, status)) {
+               return;
+       }
+
+       /* Copy out parameters */
+
+       /* Copy result */
+       state->orig.out.result = state->tmp.out.result;
+
+       /* Reset temporary structure */
+       ZERO_STRUCT(state->tmp);
+
+       tevent_req_done(req);
+}
+
+NTSTATUS dcerpc_echo_BytePipeIn_recv(struct tevent_req *req,
+                                    TALLOC_CTX *mem_ctx,
+                                    uint32_t *result)
+{
+       struct dcerpc_echo_BytePipeIn_state *state = tevent_req_data(
+               req, struct dcerpc_echo_BytePipeIn_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
+               return status;
+       }
+
+       /* Steal possible out parameters to the callers context */
+       talloc_steal(mem_ctx, state->out_mem_ctx);
+
+       /* Return result */
+       *result = state->orig.out.result;
+
+       tevent_req_received(req);
+       return NT_STATUS_OK;
+}
+
index 3d163acd9eadd1547a1a919d7f172b8063bdef3a..5fb509cff66bce4b968fd729412c81f36de43781 100644 (file)
@@ -5,6 +5,21 @@
 
 extern const struct ndr_interface_table ndr_table_rpcecho;
 
+/* echo_BytePipe */
+struct echo_BytePipe;
+struct echo_BytePipe *dcerpc_echo_BytePipe_create(TALLOC_CTX *mem_ctx);
+struct tevent_req *dcerpc_echo_BytePipe_chunk_push_send(TALLOC_CTX *mem_ctx,
+                                                       struct tevent_context *ev,
+                                                       struct echo_BytePipe *p,
+                                                       const struct echo_BytePipe_chunk *chunk);
+NTSTATUS dcerpc_echo_BytePipe_chunk_push_recv(struct tevent_req *req);
+struct tevent_req *dcerpc_echo_BytePipe_chunk_pull_send(TALLOC_CTX *mem_ctx,
+                                                       struct tevent_context *ev,
+                                                       struct echo_BytePipe *p);
+NTSTATUS dcerpc_echo_BytePipe_chunk_pull_recv(struct tevent_req *req,
+                                             TALLOC_CTX *mem_ctx,
+                                             struct echo_BytePipe_chunk **chunk);
+
 struct tevent_req *dcerpc_echo_AddOne_r_send(TALLOC_CTX *mem_ctx,
        struct tevent_context *ev,
        struct dcerpc_binding_handle *h,
@@ -189,4 +204,32 @@ NTSTATUS dcerpc_echo_TestDoublePointer(struct dcerpc_binding_handle *h,
                                       uint16_t ***_data /* [in] [ref] */,
                                       uint16_t *result);
 
+struct tevent_req *dcerpc_echo_BytePipeIn_r_send(TALLOC_CTX *mem_ctx,
+       struct tevent_context *ev,
+       struct dcerpc_binding_handle *h,
+       struct echo_BytePipeIn *r);
+NTSTATUS dcerpc_echo_BytePipeIn_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx);
+/*
+ * The following function is skipped because
+ * it uses pipes:
+ *
+ * dcerpc_echo_BytePipeIn_r()
+ */
+
+struct tevent_req *dcerpc_echo_BytePipeIn_send(TALLOC_CTX *mem_ctx,
+                                              struct tevent_context *ev,
+                                              struct dcerpc_binding_handle *h,
+                                              uint32_t _value /* [in]  */,
+                                              struct echo_BytePipe *_bp /* [in] [ref] */);
+NTSTATUS dcerpc_echo_BytePipeIn_recv(struct tevent_req *req,
+                                    TALLOC_CTX *mem_ctx,
+                                    uint32_t *result);
+/*
+ * The following function is skipped because
+ * it uses pipes:
+ *
+ * dcerpc_echo_BytePipeIn()
+ */
+
+
 #endif /* _HEADER_RPC_rpcecho */
index 757473d1afb6903595e19311eb762f545e724bd8..04f10607c83e9b90143eebae17b8029f697b4d55 100644 (file)
@@ -170,6 +170,17 @@ static NTSTATUS rpcecho__op_dispatch(struct dcesrv_call_state *dce_call, TALLOC_
                }
                break;
        }
+       case 10: {
+               struct echo_BytePipeIn *r2 = (struct echo_BytePipeIn *)r;
+               if (DEBUGLEVEL >= 10) {
+                       NDR_PRINT_FUNCTION_DEBUG(echo_BytePipeIn, NDR_IN, r2);
+               }
+               r2->out.result = dcesrv_echo_BytePipeIn(dce_call, mem_ctx, r2);
+               if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
+                       DEBUG(5,("function echo_BytePipeIn will reply async\n"));
+               }
+               break;
+       }
 
        default:
                dce_call->fault_code = DCERPC_FAULT_OP_RNG_ERROR;
@@ -321,6 +332,19 @@ static NTSTATUS rpcecho__op_reply(struct dcesrv_call_state *dce_call, TALLOC_CTX
                }
                break;
        }
+       case 10: {
+               struct echo_BytePipeIn *r2 = (struct echo_BytePipeIn *)r;
+               if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
+                       DEBUG(5,("function echo_BytePipeIn replied async\n"));
+               }
+               if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
+                       NDR_PRINT_FUNCTION_DEBUG(echo_BytePipeIn, NDR_OUT | NDR_SET_VALUES, r2);
+               }
+               if (dce_call->fault_code != 0) {
+                       DEBUG(2,("dcerpc_fault %s in echo_BytePipeIn\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)));
+               }
+               break;
+       }
 
        default:
                dce_call->fault_code = DCERPC_FAULT_OP_RNG_ERROR;
index 6bbf45c5d8805107efe4a88c6cc39e83b1ce3f44..991880a415b17341ced6c64463adc5f4b316fa61 100644 (file)
@@ -778,6 +778,79 @@ static bool api_echo_TestDoublePointer(struct pipes_struct *p)
        return true;
 }
 
+static bool api_echo_BytePipeIn(struct pipes_struct *p)
+{
+       const struct ndr_interface_call *call;
+       struct ndr_pull *pull;
+       struct ndr_push *push;
+       enum ndr_err_code ndr_err;
+       struct echo_BytePipeIn *r;
+
+       call = &ndr_table_rpcecho.calls[NDR_ECHO_BYTEPIPEIN];
+
+       r = talloc(talloc_tos(), struct echo_BytePipeIn);
+       if (r == NULL) {
+               return false;
+       }
+
+       pull = ndr_pull_init_blob(&p->in_data.data, r);
+       if (pull == NULL) {
+               talloc_free(r);
+               return false;
+       }
+
+       pull->flags |= LIBNDR_FLAG_REF_ALLOC;
+       if (p->endian) {
+               pull->flags |= LIBNDR_FLAG_BIGENDIAN;
+       }
+       ndr_err = call->ndr_pull(pull, NDR_IN, r);
+       if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+               talloc_free(r);
+               return false;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_FUNCTION_DEBUG(echo_BytePipeIn, NDR_IN, r);
+       }
+
+       r->out.result = _echo_BytePipeIn(p, r);
+
+       if (p->fault_state) {
+               talloc_free(r);
+               /* Return true here, srv_pipe_hnd.c will take care */
+               return true;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_FUNCTION_DEBUG(echo_BytePipeIn, NDR_OUT | NDR_SET_VALUES, r);
+       }
+
+       push = ndr_push_init_ctx(r);
+       if (push == NULL) {
+               talloc_free(r);
+               return false;
+       }
+
+       /*
+        * carry over the pointer count to the reply in case we are
+        * using full pointer. See NDR specification for full pointers
+        */
+       push->ptr_count = pull->ptr_count;
+
+       ndr_err = call->ndr_push(push, NDR_OUT, r);
+       if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+               talloc_free(r);
+               return false;
+       }
+
+       p->out_data.rdata = ndr_push_blob(push);
+       talloc_steal(p->mem_ctx, p->out_data.rdata.data);
+
+       talloc_free(r);
+
+       return true;
+}
+
 
 /* Tables */
 static struct api_struct api_rpcecho_cmds[] = 
@@ -792,6 +865,7 @@ static struct api_struct api_rpcecho_cmds[] =
        {"ECHO_TESTENUM", NDR_ECHO_TESTENUM, api_echo_TestEnum},
        {"ECHO_TESTSURROUNDING", NDR_ECHO_TESTSURROUNDING, api_echo_TestSurrounding},
        {"ECHO_TESTDOUBLEPOINTER", NDR_ECHO_TESTDOUBLEPOINTER, api_echo_TestDoublePointer},
+       {"ECHO_BYTEPIPEIN", NDR_ECHO_BYTEPIPEIN, api_echo_BytePipeIn},
 };
 
 void rpcecho_get_pipe_fns(struct api_struct **fns, int *n_fns)
index 0f5ff2e71b8a84ac9063a2f0e0cb05c649fe3d7a..62e2ec58393393d8ac7b7510f1e7360f53bfef7d 100644 (file)
@@ -11,6 +11,7 @@ uint32 _echo_TestSleep(struct pipes_struct *p, struct echo_TestSleep *r);
 void _echo_TestEnum(struct pipes_struct *p, struct echo_TestEnum *r);
 void _echo_TestSurrounding(struct pipes_struct *p, struct echo_TestSurrounding *r);
 uint16 _echo_TestDoublePointer(struct pipes_struct *p, struct echo_TestDoublePointer *r);
+uint32 _echo_BytePipeIn(struct pipes_struct *p, struct echo_BytePipeIn *r);
 void rpcecho_get_pipe_fns(struct api_struct **fns, int *n_fns);
 struct rpc_srv_callbacks;
 NTSTATUS rpc_rpcecho_init(const struct rpc_srv_callbacks *rpc_srv_cb);