LCOV - code coverage report
Current view: top level - bin/default/source4/librpc/gen_ndr - ndr_opendb.c (source / functions) Hit Total Coverage
Test: coverage report for master 2f515e9b Lines: 104 164 63.4 %
Date: 2024-04-21 15:09:00 Functions: 6 10 60.0 %

          Line data    Source code
       1             : /* parser auto-generated by pidl */
       2             : 
       3             : #include "includes.h"
       4             : #include "bin/default/source4/librpc/gen_ndr/ndr_opendb.h"
       5             : 
       6             : #include "librpc/gen_ndr/ndr_server_id.h"
       7      240623 : static enum ndr_err_code ndr_push_opendb_entry(struct ndr_push *ndr, ndr_flags_type ndr_flags, const struct opendb_entry *r)
       8             : {
       9      240623 :         NDR_PUSH_CHECK_FLAGS(ndr, ndr_flags);
      10      240623 :         if (ndr_flags & NDR_SCALARS) {
      11      240623 :                 NDR_CHECK(ndr_push_align(ndr, 8));
      12      240623 :                 NDR_CHECK(ndr_push_server_id(ndr, NDR_SCALARS, &r->server));
      13      240623 :                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->stream_id));
      14      240623 :                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->share_access));
      15      240623 :                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->access_mask));
      16      240623 :                 NDR_CHECK(ndr_push_pointer(ndr, NDR_SCALARS, r->file_handle));
      17      240623 :                 NDR_CHECK(ndr_push_pointer(ndr, NDR_SCALARS, r->fd));
      18      240623 :                 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->delete_on_close));
      19      240623 :                 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->allow_level_II_oplock));
      20      240623 :                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->oplock_level));
      21      240623 :                 NDR_CHECK(ndr_push_trailer_align(ndr, 8));
      22             :         }
      23      240623 :         if (ndr_flags & NDR_BUFFERS) {
      24           0 :         }
      25      240623 :         return NDR_ERR_SUCCESS;
      26             : }
      27             : 
      28      318721 : static enum ndr_err_code ndr_pull_opendb_entry(struct ndr_pull *ndr, ndr_flags_type ndr_flags, struct opendb_entry *r)
      29             : {
      30      318721 :         NDR_PULL_CHECK_FLAGS(ndr, ndr_flags);
      31      318721 :         if (ndr_flags & NDR_SCALARS) {
      32      318721 :                 NDR_CHECK(ndr_pull_align(ndr, 8));
      33      318721 :                 NDR_CHECK(ndr_pull_server_id(ndr, NDR_SCALARS, &r->server));
      34      318721 :                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->stream_id));
      35      318721 :                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->share_access));
      36      318721 :                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->access_mask));
      37      318721 :                 NDR_CHECK(ndr_pull_pointer(ndr, NDR_SCALARS, &r->file_handle));
      38      318721 :                 NDR_CHECK(ndr_pull_pointer(ndr, NDR_SCALARS, &r->fd));
      39      318721 :                 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->delete_on_close));
      40      318721 :                 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->allow_level_II_oplock));
      41      318721 :                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->oplock_level));
      42      318721 :                 NDR_CHECK(ndr_pull_trailer_align(ndr, 8));
      43             :         }
      44      318721 :         if (ndr_flags & NDR_BUFFERS) {
      45           0 :         }
      46      318721 :         return NDR_ERR_SUCCESS;
      47             : }
      48             : 
      49           0 : _PUBLIC_ void ndr_print_opendb_entry(struct ndr_print *ndr, const char *name, const struct opendb_entry *r)
      50             : {
      51           0 :         ndr_print_struct(ndr, name, "opendb_entry");
      52           0 :         if (r == NULL) { ndr_print_null(ndr); return; }
      53           0 :         ndr->depth++;
      54           0 :         ndr_print_server_id(ndr, "server", &r->server);
      55           0 :         ndr_print_uint32(ndr, "stream_id", r->stream_id);
      56           0 :         ndr_print_uint32(ndr, "share_access", r->share_access);
      57           0 :         ndr_print_uint32(ndr, "access_mask", r->access_mask);
      58           0 :         ndr_print_pointer(ndr, "file_handle", r->file_handle);
      59           0 :         ndr_print_pointer(ndr, "fd", r->fd);
      60           0 :         ndr_print_uint8(ndr, "delete_on_close", r->delete_on_close);
      61           0 :         ndr_print_uint8(ndr, "allow_level_II_oplock", r->allow_level_II_oplock);
      62           0 :         ndr_print_uint32(ndr, "oplock_level", r->oplock_level);
      63           0 :         ndr->depth--;
      64             : }
      65             : 
      66        2940 : static enum ndr_err_code ndr_push_opendb_pending(struct ndr_push *ndr, ndr_flags_type ndr_flags, const struct opendb_pending *r)
      67             : {
      68        2940 :         NDR_PUSH_CHECK_FLAGS(ndr, ndr_flags);
      69        2940 :         if (ndr_flags & NDR_SCALARS) {
      70        2940 :                 NDR_CHECK(ndr_push_align(ndr, 8));
      71        2940 :                 NDR_CHECK(ndr_push_server_id(ndr, NDR_SCALARS, &r->server));
      72        2940 :                 NDR_CHECK(ndr_push_pointer(ndr, NDR_SCALARS, r->notify_ptr));
      73        2940 :                 NDR_CHECK(ndr_push_trailer_align(ndr, 8));
      74             :         }
      75        2940 :         if (ndr_flags & NDR_BUFFERS) {
      76           0 :         }
      77        2940 :         return NDR_ERR_SUCCESS;
      78             : }
      79             : 
      80        2967 : static enum ndr_err_code ndr_pull_opendb_pending(struct ndr_pull *ndr, ndr_flags_type ndr_flags, struct opendb_pending *r)
      81             : {
      82        2967 :         NDR_PULL_CHECK_FLAGS(ndr, ndr_flags);
      83        2967 :         if (ndr_flags & NDR_SCALARS) {
      84        2967 :                 NDR_CHECK(ndr_pull_align(ndr, 8));
      85        2967 :                 NDR_CHECK(ndr_pull_server_id(ndr, NDR_SCALARS, &r->server));
      86        2967 :                 NDR_CHECK(ndr_pull_pointer(ndr, NDR_SCALARS, &r->notify_ptr));
      87        2967 :                 NDR_CHECK(ndr_pull_trailer_align(ndr, 8));
      88             :         }
      89        2967 :         if (ndr_flags & NDR_BUFFERS) {
      90           0 :         }
      91        2967 :         return NDR_ERR_SUCCESS;
      92             : }
      93             : 
      94           0 : _PUBLIC_ void ndr_print_opendb_pending(struct ndr_print *ndr, const char *name, const struct opendb_pending *r)
      95             : {
      96           0 :         ndr_print_struct(ndr, name, "opendb_pending");
      97           0 :         if (r == NULL) { ndr_print_null(ndr); return; }
      98           0 :         ndr->depth++;
      99           0 :         ndr_print_server_id(ndr, "server", &r->server);
     100           0 :         ndr_print_pointer(ndr, "notify_ptr", r->notify_ptr);
     101           0 :         ndr->depth--;
     102             : }
     103             : 
     104      225093 : _PUBLIC_ enum ndr_err_code ndr_push_opendb_file(struct ndr_push *ndr, ndr_flags_type ndr_flags, const struct opendb_file *r)
     105             : {
     106           0 :         uint32_t cntr_entries_0;
     107           0 :         uint32_t cntr_pending_0;
     108      225093 :         NDR_PUSH_CHECK_FLAGS(ndr, ndr_flags);
     109      225093 :         if (ndr_flags & NDR_SCALARS) {
     110      225093 :                 NDR_CHECK(ndr_push_align(ndr, 8));
     111      225093 :                 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->delete_on_close));
     112      225093 :                 NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->open_write_time));
     113      225093 :                 NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->changed_write_time));
     114             :                 {
     115      225093 :                         libndr_flags _flags_save_string = ndr->flags;
     116      225093 :                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_UTF8|LIBNDR_FLAG_STR_NULLTERM);
     117      225093 :                         NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->path));
     118      225093 :                         ndr->flags = _flags_save_string;
     119             :                 }
     120      225093 :                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_entries));
     121      465716 :                 for (cntr_entries_0 = 0; cntr_entries_0 < (r->num_entries); cntr_entries_0++) {
     122      240623 :                         NDR_CHECK(ndr_push_opendb_entry(ndr, NDR_SCALARS, &r->entries[cntr_entries_0]));
     123             :                 }
     124      225093 :                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_pending));
     125      228033 :                 for (cntr_pending_0 = 0; cntr_pending_0 < (r->num_pending); cntr_pending_0++) {
     126        2940 :                         NDR_CHECK(ndr_push_opendb_pending(ndr, NDR_SCALARS, &r->pending[cntr_pending_0]));
     127             :                 }
     128      225093 :                 NDR_CHECK(ndr_push_trailer_align(ndr, 8));
     129             :         }
     130      225093 :         if (ndr_flags & NDR_BUFFERS) {
     131           0 :         }
     132      225093 :         return NDR_ERR_SUCCESS;
     133             : }
     134             : 
     135      294212 : _PUBLIC_ enum ndr_err_code ndr_pull_opendb_file(struct ndr_pull *ndr, ndr_flags_type ndr_flags, struct opendb_file *r)
     136             : {
     137      294212 :         uint32_t size_entries_0 = 0;
     138           0 :         uint32_t cntr_entries_0;
     139      294212 :         TALLOC_CTX *_mem_save_entries_0 = NULL;
     140      294212 :         uint32_t size_pending_0 = 0;
     141           0 :         uint32_t cntr_pending_0;
     142      294212 :         TALLOC_CTX *_mem_save_pending_0 = NULL;
     143      294212 :         NDR_PULL_CHECK_FLAGS(ndr, ndr_flags);
     144      294212 :         if (ndr_flags & NDR_SCALARS) {
     145      294212 :                 NDR_CHECK(ndr_pull_align(ndr, 8));
     146      294212 :                 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->delete_on_close));
     147      294212 :                 NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->open_write_time));
     148      294212 :                 NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->changed_write_time));
     149             :                 {
     150      294212 :                         libndr_flags _flags_save_string = ndr->flags;
     151      294212 :                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_UTF8|LIBNDR_FLAG_STR_NULLTERM);
     152      294212 :                         NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->path));
     153      294212 :                         ndr->flags = _flags_save_string;
     154             :                 }
     155      294212 :                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_entries));
     156      294212 :                 size_entries_0 = r->num_entries;
     157      294212 :                 NDR_PULL_ALLOC_N(ndr, r->entries, size_entries_0);
     158      294212 :                 _mem_save_entries_0 = NDR_PULL_GET_MEM_CTX(ndr);
     159      294212 :                 NDR_PULL_SET_MEM_CTX(ndr, r->entries, 0);
     160      612933 :                 for (cntr_entries_0 = 0; cntr_entries_0 < (size_entries_0); cntr_entries_0++) {
     161      318721 :                         NDR_CHECK(ndr_pull_opendb_entry(ndr, NDR_SCALARS, &r->entries[cntr_entries_0]));
     162             :                 }
     163      294212 :                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_entries_0, 0);
     164      294212 :                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_pending));
     165      294212 :                 size_pending_0 = r->num_pending;
     166      294212 :                 NDR_PULL_ALLOC_N(ndr, r->pending, size_pending_0);
     167      294212 :                 _mem_save_pending_0 = NDR_PULL_GET_MEM_CTX(ndr);
     168      294212 :                 NDR_PULL_SET_MEM_CTX(ndr, r->pending, 0);
     169      297179 :                 for (cntr_pending_0 = 0; cntr_pending_0 < (size_pending_0); cntr_pending_0++) {
     170        2967 :                         NDR_CHECK(ndr_pull_opendb_pending(ndr, NDR_SCALARS, &r->pending[cntr_pending_0]));
     171             :                 }
     172      294212 :                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_pending_0, 0);
     173      294212 :                 NDR_CHECK(ndr_pull_trailer_align(ndr, 8));
     174             :         }
     175      294212 :         if (ndr_flags & NDR_BUFFERS) {
     176           0 :         }
     177      294212 :         return NDR_ERR_SUCCESS;
     178             : }
     179             : 
     180           0 : static void ndr_print_flags_opendb_file(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct opendb_file *r)
     181             : {
     182           0 :         ndr_print_opendb_file(ndr, name, r);
     183           0 : }
     184             : 
     185           0 : _PUBLIC_ void ndr_print_opendb_file(struct ndr_print *ndr, const char *name, const struct opendb_file *r)
     186             : {
     187           0 :         uint32_t cntr_entries_0;
     188           0 :         uint32_t cntr_pending_0;
     189           0 :         ndr_print_struct(ndr, name, "opendb_file");
     190           0 :         if (r == NULL) { ndr_print_null(ndr); return; }
     191           0 :         ndr->depth++;
     192           0 :         ndr_print_uint8(ndr, "delete_on_close", r->delete_on_close);
     193           0 :         ndr_print_NTTIME(ndr, "open_write_time", r->open_write_time);
     194           0 :         ndr_print_NTTIME(ndr, "changed_write_time", r->changed_write_time);
     195             :         {
     196           0 :                 libndr_flags _flags_save_string = ndr->flags;
     197           0 :                 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_UTF8|LIBNDR_FLAG_STR_NULLTERM);
     198           0 :                 ndr_print_string(ndr, "path", r->path);
     199           0 :                 ndr->flags = _flags_save_string;
     200             :         }
     201           0 :         ndr_print_uint32(ndr, "num_entries", r->num_entries);
     202           0 :         ndr->print(ndr, "%s: ARRAY(%"PRIu32")", "entries", (uint32_t)(r->num_entries));
     203           0 :         ndr->depth++;
     204           0 :         for (cntr_entries_0 = 0; cntr_entries_0 < (r->num_entries); cntr_entries_0++) {
     205           0 :                 ndr_print_opendb_entry(ndr, "entries", &r->entries[cntr_entries_0]);
     206             :         }
     207           0 :         ndr->depth--;
     208           0 :         ndr_print_uint32(ndr, "num_pending", r->num_pending);
     209           0 :         ndr->print(ndr, "%s: ARRAY(%"PRIu32")", "pending", (uint32_t)(r->num_pending));
     210           0 :         ndr->depth++;
     211           0 :         for (cntr_pending_0 = 0; cntr_pending_0 < (r->num_pending); cntr_pending_0++) {
     212           0 :                 ndr_print_opendb_pending(ndr, "pending", &r->pending[cntr_pending_0]);
     213             :         }
     214           0 :         ndr->depth--;
     215           0 :         ndr->depth--;
     216             : }
     217             : 
     218             : #ifndef SKIP_NDR_TABLE_opendb
     219             : static const struct ndr_interface_public_struct opendb_public_structs[] = {
     220             :         {
     221             :                 .name = "opendb_file",
     222             :                 .struct_size = sizeof(struct opendb_file ),
     223             :                 .ndr_push = (ndr_push_flags_fn_t) ndr_push_opendb_file,
     224             :                 .ndr_pull = (ndr_pull_flags_fn_t) ndr_pull_opendb_file,
     225             :                 .ndr_print = (ndr_print_function_t) ndr_print_flags_opendb_file,
     226             :         },
     227             :         { .name = NULL }
     228             : };
     229             : 
     230             : static const struct ndr_interface_call opendb_calls[] = {
     231             :         { .name = NULL }
     232             : };
     233             : 
     234             : static const char * const opendb_endpoint_strings[] = {
     235             :         "ncacn_np:[\\pipe\\opendb]", 
     236             : };
     237             : 
     238             : static const struct ndr_interface_string_array opendb_endpoints = {
     239             :         .count  = 1,
     240             :         .names  = opendb_endpoint_strings
     241             : };
     242             : 
     243             : static const char * const opendb_authservice_strings[] = {
     244             :         "host", 
     245             : };
     246             : 
     247             : static const struct ndr_interface_string_array opendb_authservices = {
     248             :         .count  = 1,
     249             :         .names  = opendb_authservice_strings
     250             : };
     251             : 
     252             : 
     253             : const struct ndr_interface_table ndr_table_opendb = {
     254             :         .name           = "opendb",
     255             :         .num_calls      = 0,
     256             :         .calls          = opendb_calls,
     257             :         .num_public_structs     = 1,
     258             :         .public_structs         = opendb_public_structs,
     259             :         .endpoints      = &opendb_endpoints,
     260             :         .authservices   = &opendb_authservices
     261             : };
     262             : 
     263             : #endif /* SKIP_NDR_TABLE_opendb */

Generated by: LCOV version 1.14