LCOV - code coverage report
Current view: top level - bin/default/source3/librpc/gen_ndr - ndr_rpc_host.c (source / functions) Hit Total Coverage
Test: coverage report for master 2f515e9b Lines: 79 116 68.1 %
Date: 2024-04-21 15:09:00 Functions: 4 8 50.0 %

          Line data    Source code
       1             : /* parser auto-generated by pidl */
       2             : 
       3             : #include "includes.h"
       4             : #include "bin/default/source3/librpc/gen_ndr/ndr_rpc_host.h"
       5             : 
       6             : #include "librpc/gen_ndr/ndr_named_pipe_auth.h"
       7             : #include "librpc/gen_ndr/ndr_dcerpc.h"
       8       36116 : _PUBLIC_ enum ndr_err_code ndr_push_rpc_host_client(struct ndr_push *ndr, ndr_flags_type ndr_flags, const struct rpc_host_client *r)
       9             : {
      10       36116 :         NDR_PUSH_CHECK_FLAGS(ndr, ndr_flags);
      11       36116 :         if (ndr_flags & NDR_SCALARS) {
      12       36116 :                 NDR_CHECK(ndr_push_align(ndr, 5));
      13       36116 :                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->binding));
      14       36116 :                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->npa_info8));
      15       36116 :                 NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, r->bind_packet));
      16       36116 :                 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
      17             :         }
      18       36116 :         if (ndr_flags & NDR_BUFFERS) {
      19       36116 :                 if (r->binding) {
      20       36116 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->binding, CH_UTF8)));
      21       36116 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
      22       36116 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->binding, CH_UTF8)));
      23       36116 :                         NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->binding, ndr_charset_length(r->binding, CH_UTF8), sizeof(uint8_t), CH_UTF8));
      24             :                 }
      25       36116 :                 if (r->npa_info8) {
      26       36116 :                         NDR_CHECK(ndr_push_named_pipe_auth_req_info8(ndr, NDR_SCALARS|NDR_BUFFERS, r->npa_info8));
      27             :                 }
      28             :         }
      29       36116 :         return NDR_ERR_SUCCESS;
      30             : }
      31             : 
      32       35600 : _PUBLIC_ enum ndr_err_code ndr_pull_rpc_host_client(struct ndr_pull *ndr, ndr_flags_type ndr_flags, struct rpc_host_client *r)
      33             : {
      34             :         uint32_t _ptr_binding;
      35       35600 :         uint32_t size_binding_1 = 0;
      36       35600 :         uint32_t length_binding_1 = 0;
      37       35600 :         TALLOC_CTX *_mem_save_binding_0 = NULL;
      38             :         uint32_t _ptr_npa_info8;
      39       35600 :         TALLOC_CTX *_mem_save_npa_info8_0 = NULL;
      40       35600 :         NDR_PULL_CHECK_FLAGS(ndr, ndr_flags);
      41       35600 :         if (ndr_flags & NDR_SCALARS) {
      42       35600 :                 NDR_CHECK(ndr_pull_align(ndr, 5));
      43       35600 :                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_binding));
      44       35600 :                 if (_ptr_binding) {
      45       35600 :                         NDR_PULL_ALLOC(ndr, r->binding);
      46             :                 } else {
      47           0 :                         r->binding = NULL;
      48             :                 }
      49       35600 :                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_npa_info8));
      50       35600 :                 if (_ptr_npa_info8) {
      51       35600 :                         NDR_PULL_ALLOC(ndr, r->npa_info8);
      52             :                 } else {
      53           0 :                         r->npa_info8 = NULL;
      54             :                 }
      55       35600 :                 NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, &r->bind_packet));
      56       35600 :                 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
      57             :         }
      58       35600 :         if (ndr_flags & NDR_BUFFERS) {
      59       35600 :                 if (r->binding) {
      60       35600 :                         _mem_save_binding_0 = NDR_PULL_GET_MEM_CTX(ndr);
      61       35600 :                         NDR_PULL_SET_MEM_CTX(ndr, r->binding, 0);
      62       35600 :                         NDR_CHECK(ndr_pull_array_size(ndr, &r->binding));
      63       35600 :                         NDR_CHECK(ndr_pull_array_length(ndr, &r->binding));
      64       35600 :                         NDR_CHECK(ndr_steal_array_size(ndr, (void*)&r->binding, &size_binding_1));
      65       35600 :                         NDR_CHECK(ndr_steal_array_length(ndr, (void*)&r->binding, &length_binding_1));
      66       35600 :                         if (length_binding_1 > size_binding_1) {
      67           0 :                                 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %"PRIu32": should exceed array length %"PRIu32"", size_binding_1, length_binding_1);
      68             :                         }
      69       35600 :                         NDR_CHECK(ndr_check_string_terminator(ndr, length_binding_1, sizeof(uint8_t)));
      70       35600 :                         NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->binding, length_binding_1, sizeof(uint8_t), CH_UTF8));
      71       35600 :                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_binding_0, 0);
      72             :                 }
      73       35600 :                 if (r->npa_info8) {
      74       35600 :                         _mem_save_npa_info8_0 = NDR_PULL_GET_MEM_CTX(ndr);
      75       35600 :                         NDR_PULL_SET_MEM_CTX(ndr, r->npa_info8, 0);
      76       35600 :                         NDR_CHECK(ndr_pull_named_pipe_auth_req_info8(ndr, NDR_SCALARS|NDR_BUFFERS, r->npa_info8));
      77       35600 :                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_npa_info8_0, 0);
      78             :                 }
      79             :         }
      80       35600 :         return NDR_ERR_SUCCESS;
      81             : }
      82             : 
      83           0 : static void ndr_print_flags_rpc_host_client(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct rpc_host_client *r)
      84             : {
      85           0 :         ndr_print_rpc_host_client(ndr, name, r);
      86           0 : }
      87             : 
      88           0 : _PUBLIC_ void ndr_print_rpc_host_client(struct ndr_print *ndr, const char *name, const struct rpc_host_client *r)
      89             : {
      90           0 :         ndr_print_struct(ndr, name, "rpc_host_client");
      91           0 :         if (r == NULL) { ndr_print_null(ndr); return; }
      92           0 :         ndr->depth++;
      93           0 :         ndr_print_ptr(ndr, "binding", r->binding);
      94           0 :         ndr->depth++;
      95           0 :         if (r->binding) {
      96           0 :                 ndr_print_string(ndr, "binding", r->binding);
      97             :         }
      98           0 :         ndr->depth--;
      99           0 :         ndr_print_ptr(ndr, "npa_info8", r->npa_info8);
     100           0 :         ndr->depth++;
     101           0 :         if (r->npa_info8) {
     102           0 :                 ndr_print_named_pipe_auth_req_info8(ndr, "npa_info8", r->npa_info8);
     103             :         }
     104           0 :         ndr->depth--;
     105           0 :         ndr_print_DATA_BLOB(ndr, "bind_packet", r->bind_packet);
     106           0 :         ndr->depth--;
     107             : }
     108             : 
     109       36189 : _PUBLIC_ enum ndr_err_code ndr_push_rpc_worker_status(struct ndr_push *ndr, ndr_flags_type ndr_flags, const struct rpc_worker_status *r)
     110             : {
     111             :         {
     112       36189 :                 libndr_flags _flags_save_STRUCT = ndr->flags;
     113       36189 :                 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN);
     114       36189 :                 NDR_PUSH_CHECK_FLAGS(ndr, ndr_flags);
     115       36189 :                 if (ndr_flags & NDR_SCALARS) {
     116       36189 :                         NDR_CHECK(ndr_push_align(ndr, 4));
     117       36189 :                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->server_index));
     118       36189 :                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->worker_index));
     119       36189 :                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_association_groups));
     120       36189 :                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_connections));
     121       36189 :                         NDR_CHECK(ndr_push_trailer_align(ndr, 4));
     122             :                 }
     123       36189 :                 if (ndr_flags & NDR_BUFFERS) {
     124             :                 }
     125       36189 :                 ndr->flags = _flags_save_STRUCT;
     126             :         }
     127       36189 :         return NDR_ERR_SUCCESS;
     128             : }
     129             : 
     130       36701 : _PUBLIC_ enum ndr_err_code ndr_pull_rpc_worker_status(struct ndr_pull *ndr, ndr_flags_type ndr_flags, struct rpc_worker_status *r)
     131             : {
     132             :         {
     133       36701 :                 libndr_flags _flags_save_STRUCT = ndr->flags;
     134       36701 :                 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN);
     135       36701 :                 NDR_PULL_CHECK_FLAGS(ndr, ndr_flags);
     136       36701 :                 if (ndr_flags & NDR_SCALARS) {
     137       36701 :                         NDR_CHECK(ndr_pull_align(ndr, 4));
     138       36701 :                         NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->server_index));
     139       36701 :                         NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->worker_index));
     140       36701 :                         NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_association_groups));
     141       36701 :                         NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_connections));
     142       36701 :                         NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
     143             :                 }
     144       36701 :                 if (ndr_flags & NDR_BUFFERS) {
     145             :                 }
     146       36701 :                 ndr->flags = _flags_save_STRUCT;
     147             :         }
     148       36701 :         return NDR_ERR_SUCCESS;
     149             : }
     150             : 
     151           0 : static void ndr_print_flags_rpc_worker_status(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct rpc_worker_status *r)
     152             : {
     153           0 :         ndr_print_rpc_worker_status(ndr, name, r);
     154           0 : }
     155             : 
     156           0 : _PUBLIC_ void ndr_print_rpc_worker_status(struct ndr_print *ndr, const char *name, const struct rpc_worker_status *r)
     157             : {
     158           0 :         ndr_print_struct(ndr, name, "rpc_worker_status");
     159           0 :         if (r == NULL) { ndr_print_null(ndr); return; }
     160             :         {
     161           0 :                 libndr_flags _flags_save_STRUCT = ndr->flags;
     162           0 :                 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN);
     163           0 :                 ndr->depth++;
     164           0 :                 ndr_print_uint32(ndr, "server_index", r->server_index);
     165           0 :                 ndr_print_uint32(ndr, "worker_index", r->worker_index);
     166           0 :                 ndr_print_uint32(ndr, "num_association_groups", r->num_association_groups);
     167           0 :                 ndr_print_uint32(ndr, "num_connections", r->num_connections);
     168           0 :                 ndr->depth--;
     169           0 :                 ndr->flags = _flags_save_STRUCT;
     170             :         }
     171             : }
     172             : 
     173             : #ifndef SKIP_NDR_TABLE_rpc_host_msg
     174             : static const struct ndr_interface_public_struct rpc_host_msg_public_structs[] = {
     175             :         {
     176             :                 .name = "rpc_host_client",
     177             :                 .struct_size = sizeof(struct rpc_host_client ),
     178             :                 .ndr_push = (ndr_push_flags_fn_t) ndr_push_rpc_host_client,
     179             :                 .ndr_pull = (ndr_pull_flags_fn_t) ndr_pull_rpc_host_client,
     180             :                 .ndr_print = (ndr_print_function_t) ndr_print_flags_rpc_host_client,
     181             :         },
     182             :         {
     183             :                 .name = "rpc_worker_status",
     184             :                 .struct_size = sizeof(struct rpc_worker_status ),
     185             :                 .ndr_push = (ndr_push_flags_fn_t) ndr_push_rpc_worker_status,
     186             :                 .ndr_pull = (ndr_pull_flags_fn_t) ndr_pull_rpc_worker_status,
     187             :                 .ndr_print = (ndr_print_function_t) ndr_print_flags_rpc_worker_status,
     188             :         },
     189             :         { .name = NULL }
     190             : };
     191             : 
     192             : static const struct ndr_interface_call rpc_host_msg_calls[] = {
     193             :         { .name = NULL }
     194             : };
     195             : 
     196             : static const char * const rpc_host_msg_endpoint_strings[] = {
     197             :         "ncacn_np:[\\pipe\\rpc_host_msg]", 
     198             : };
     199             : 
     200             : static const struct ndr_interface_string_array rpc_host_msg_endpoints = {
     201             :         .count  = 1,
     202             :         .names  = rpc_host_msg_endpoint_strings
     203             : };
     204             : 
     205             : static const char * const rpc_host_msg_authservice_strings[] = {
     206             :         "host", 
     207             : };
     208             : 
     209             : static const struct ndr_interface_string_array rpc_host_msg_authservices = {
     210             :         .count  = 1,
     211             :         .names  = rpc_host_msg_authservice_strings
     212             : };
     213             : 
     214             : 
     215             : const struct ndr_interface_table ndr_table_rpc_host_msg = {
     216             :         .name           = "rpc_host_msg",
     217             :         .num_calls      = 0,
     218             :         .calls          = rpc_host_msg_calls,
     219             :         .num_public_structs     = 2,
     220             :         .public_structs         = rpc_host_msg_public_structs,
     221             :         .endpoints      = &rpc_host_msg_endpoints,
     222             :         .authservices   = &rpc_host_msg_authservices
     223             : };
     224             : 
     225             : #endif /* SKIP_NDR_TABLE_rpc_host_msg */

Generated by: LCOV version 1.14