LCOV - code coverage report
Current view: top level - bin/default/librpc/gen_ndr - ndr_named_pipe_auth.c (source / functions) Hit Total Coverage
Test: coverage report for master 70ed9daf Lines: 299 435 68.7 %
Date: 2024-01-11 09:59:51 Functions: 14 23 60.9 %

          Line data    Source code
       1             : /* parser auto-generated by pidl */
       2             : 
       3             : #include "includes.h"
       4             : #include "bin/default/librpc/gen_ndr/ndr_named_pipe_auth.h"
       5             : 
       6             : #include "librpc/gen_ndr/ndr_netlogon.h"
       7             : #include "librpc/gen_ndr/ndr_security.h"
       8             : #include "librpc/gen_ndr/ndr_auth.h"
       9      266560 : _PUBLIC_ enum ndr_err_code ndr_push_named_pipe_auth_req_info8(struct ndr_push *ndr, ndr_flags_type ndr_flags, const struct named_pipe_auth_req_info8 *r)
      10             : {
      11      266560 :         NDR_PUSH_CHECK_FLAGS(ndr, ndr_flags);
      12      266560 :         if (ndr_flags & NDR_SCALARS) {
      13      168918 :                 NDR_CHECK(ndr_push_align(ndr, 5));
      14      168918 :                 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->transport));
      15      168918 :                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->remote_client_name));
      16      168918 :                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->remote_client_addr));
      17      168918 :                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->remote_client_port));
      18      168918 :                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->local_server_name));
      19      168918 :                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->local_server_addr));
      20      168918 :                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->local_server_port));
      21      168918 :                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->session_info));
      22      168918 :                 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
      23             :         }
      24      266560 :         if (ndr_flags & NDR_BUFFERS) {
      25      168918 :                 if (r->remote_client_name) {
      26      168918 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->remote_client_name, CH_UTF8)));
      27      168918 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
      28      168918 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->remote_client_name, CH_UTF8)));
      29      168918 :                         NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->remote_client_name, ndr_charset_length(r->remote_client_name, CH_UTF8), sizeof(uint8_t), CH_UTF8));
      30             :                 }
      31      168918 :                 if (r->remote_client_addr) {
      32      168918 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->remote_client_addr, CH_DOS)));
      33      168918 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
      34      168918 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->remote_client_addr, CH_DOS)));
      35      168918 :                         NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->remote_client_addr, ndr_charset_length(r->remote_client_addr, CH_DOS), sizeof(uint8_t), CH_DOS));
      36             :                 }
      37      168918 :                 if (r->local_server_name) {
      38      168918 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->local_server_name, CH_UTF8)));
      39      168918 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
      40      168918 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->local_server_name, CH_UTF8)));
      41      168918 :                         NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->local_server_name, ndr_charset_length(r->local_server_name, CH_UTF8), sizeof(uint8_t), CH_UTF8));
      42             :                 }
      43      168918 :                 if (r->local_server_addr) {
      44      168918 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->local_server_addr, CH_DOS)));
      45      168918 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
      46      168918 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->local_server_addr, CH_DOS)));
      47      168918 :                         NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->local_server_addr, ndr_charset_length(r->local_server_addr, CH_DOS), sizeof(uint8_t), CH_DOS));
      48             :                 }
      49      168918 :                 if (r->session_info) {
      50      168918 :                         NDR_CHECK(ndr_push_auth_session_info_transport(ndr, NDR_SCALARS|NDR_BUFFERS, r->session_info));
      51             :                 }
      52             :         }
      53      264080 :         return NDR_ERR_SUCCESS;
      54             : }
      55             : 
      56      155788 : _PUBLIC_ enum ndr_err_code ndr_pull_named_pipe_auth_req_info8(struct ndr_pull *ndr, ndr_flags_type ndr_flags, struct named_pipe_auth_req_info8 *r)
      57             : {
      58        1256 :         uint32_t _ptr_remote_client_name;
      59      155788 :         uint32_t size_remote_client_name_1 = 0;
      60      155788 :         uint32_t length_remote_client_name_1 = 0;
      61      155788 :         TALLOC_CTX *_mem_save_remote_client_name_0 = NULL;
      62        1256 :         uint32_t _ptr_remote_client_addr;
      63      155788 :         uint32_t size_remote_client_addr_1 = 0;
      64      155788 :         uint32_t length_remote_client_addr_1 = 0;
      65      155788 :         TALLOC_CTX *_mem_save_remote_client_addr_0 = NULL;
      66        1256 :         uint32_t _ptr_local_server_name;
      67      155788 :         uint32_t size_local_server_name_1 = 0;
      68      155788 :         uint32_t length_local_server_name_1 = 0;
      69      155788 :         TALLOC_CTX *_mem_save_local_server_name_0 = NULL;
      70        1256 :         uint32_t _ptr_local_server_addr;
      71      155788 :         uint32_t size_local_server_addr_1 = 0;
      72      155788 :         uint32_t length_local_server_addr_1 = 0;
      73      155788 :         TALLOC_CTX *_mem_save_local_server_addr_0 = NULL;
      74        1256 :         uint32_t _ptr_session_info;
      75      155788 :         TALLOC_CTX *_mem_save_session_info_0 = NULL;
      76      155788 :         NDR_PULL_CHECK_FLAGS(ndr, ndr_flags);
      77      155788 :         if (ndr_flags & NDR_SCALARS) {
      78      112824 :                 NDR_CHECK(ndr_pull_align(ndr, 5));
      79      112824 :                 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->transport));
      80      112824 :                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_remote_client_name));
      81      112824 :                 if (_ptr_remote_client_name) {
      82      112824 :                         NDR_PULL_ALLOC(ndr, r->remote_client_name);
      83             :                 } else {
      84           0 :                         r->remote_client_name = NULL;
      85             :                 }
      86      112824 :                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_remote_client_addr));
      87      112824 :                 if (_ptr_remote_client_addr) {
      88      112824 :                         NDR_PULL_ALLOC(ndr, r->remote_client_addr);
      89             :                 } else {
      90           0 :                         r->remote_client_addr = NULL;
      91             :                 }
      92      112824 :                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->remote_client_port));
      93      112824 :                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_local_server_name));
      94      112824 :                 if (_ptr_local_server_name) {
      95      112824 :                         NDR_PULL_ALLOC(ndr, r->local_server_name);
      96             :                 } else {
      97           0 :                         r->local_server_name = NULL;
      98             :                 }
      99      112824 :                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_local_server_addr));
     100      112824 :                 if (_ptr_local_server_addr) {
     101      112824 :                         NDR_PULL_ALLOC(ndr, r->local_server_addr);
     102             :                 } else {
     103           0 :                         r->local_server_addr = NULL;
     104             :                 }
     105      112824 :                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->local_server_port));
     106      112824 :                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_session_info));
     107      112824 :                 if (_ptr_session_info) {
     108      112824 :                         NDR_PULL_ALLOC(ndr, r->session_info);
     109             :                 } else {
     110           0 :                         r->session_info = NULL;
     111             :                 }
     112      112824 :                 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
     113             :         }
     114      155788 :         if (ndr_flags & NDR_BUFFERS) {
     115      112824 :                 if (r->remote_client_name) {
     116      112824 :                         _mem_save_remote_client_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
     117      112824 :                         NDR_PULL_SET_MEM_CTX(ndr, r->remote_client_name, 0);
     118      112824 :                         NDR_CHECK(ndr_pull_array_size(ndr, &r->remote_client_name));
     119      112824 :                         NDR_CHECK(ndr_pull_array_length(ndr, &r->remote_client_name));
     120      112824 :                         NDR_CHECK(ndr_steal_array_size(ndr, (void*)&r->remote_client_name, &size_remote_client_name_1));
     121      112824 :                         NDR_CHECK(ndr_steal_array_length(ndr, (void*)&r->remote_client_name, &length_remote_client_name_1));
     122      112824 :                         if (length_remote_client_name_1 > size_remote_client_name_1) {
     123           0 :                                 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %"PRIu32": should exceed array length %"PRIu32"", size_remote_client_name_1, length_remote_client_name_1);
     124             :                         }
     125      112824 :                         NDR_CHECK(ndr_check_string_terminator(ndr, length_remote_client_name_1, sizeof(uint8_t)));
     126      112824 :                         NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->remote_client_name, length_remote_client_name_1, sizeof(uint8_t), CH_UTF8));
     127      112824 :                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_remote_client_name_0, 0);
     128             :                 }
     129      112824 :                 if (r->remote_client_addr) {
     130      112824 :                         _mem_save_remote_client_addr_0 = NDR_PULL_GET_MEM_CTX(ndr);
     131      112824 :                         NDR_PULL_SET_MEM_CTX(ndr, r->remote_client_addr, 0);
     132      112824 :                         NDR_CHECK(ndr_pull_array_size(ndr, &r->remote_client_addr));
     133      112824 :                         NDR_CHECK(ndr_pull_array_length(ndr, &r->remote_client_addr));
     134      112824 :                         NDR_CHECK(ndr_steal_array_size(ndr, (void*)&r->remote_client_addr, &size_remote_client_addr_1));
     135      112824 :                         NDR_CHECK(ndr_steal_array_length(ndr, (void*)&r->remote_client_addr, &length_remote_client_addr_1));
     136      112824 :                         if (length_remote_client_addr_1 > size_remote_client_addr_1) {
     137           0 :                                 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %"PRIu32": should exceed array length %"PRIu32"", size_remote_client_addr_1, length_remote_client_addr_1);
     138             :                         }
     139      112824 :                         NDR_CHECK(ndr_check_string_terminator(ndr, length_remote_client_addr_1, sizeof(uint8_t)));
     140      112824 :                         NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->remote_client_addr, length_remote_client_addr_1, sizeof(uint8_t), CH_DOS));
     141      112824 :                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_remote_client_addr_0, 0);
     142             :                 }
     143      112824 :                 if (r->local_server_name) {
     144      112824 :                         _mem_save_local_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
     145      112824 :                         NDR_PULL_SET_MEM_CTX(ndr, r->local_server_name, 0);
     146      112824 :                         NDR_CHECK(ndr_pull_array_size(ndr, &r->local_server_name));
     147      112824 :                         NDR_CHECK(ndr_pull_array_length(ndr, &r->local_server_name));
     148      112824 :                         NDR_CHECK(ndr_steal_array_size(ndr, (void*)&r->local_server_name, &size_local_server_name_1));
     149      112824 :                         NDR_CHECK(ndr_steal_array_length(ndr, (void*)&r->local_server_name, &length_local_server_name_1));
     150      112824 :                         if (length_local_server_name_1 > size_local_server_name_1) {
     151           0 :                                 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %"PRIu32": should exceed array length %"PRIu32"", size_local_server_name_1, length_local_server_name_1);
     152             :                         }
     153      112824 :                         NDR_CHECK(ndr_check_string_terminator(ndr, length_local_server_name_1, sizeof(uint8_t)));
     154      112824 :                         NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->local_server_name, length_local_server_name_1, sizeof(uint8_t), CH_UTF8));
     155      112824 :                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_local_server_name_0, 0);
     156             :                 }
     157      112824 :                 if (r->local_server_addr) {
     158      112824 :                         _mem_save_local_server_addr_0 = NDR_PULL_GET_MEM_CTX(ndr);
     159      112824 :                         NDR_PULL_SET_MEM_CTX(ndr, r->local_server_addr, 0);
     160      112824 :                         NDR_CHECK(ndr_pull_array_size(ndr, &r->local_server_addr));
     161      112824 :                         NDR_CHECK(ndr_pull_array_length(ndr, &r->local_server_addr));
     162      112824 :                         NDR_CHECK(ndr_steal_array_size(ndr, (void*)&r->local_server_addr, &size_local_server_addr_1));
     163      112824 :                         NDR_CHECK(ndr_steal_array_length(ndr, (void*)&r->local_server_addr, &length_local_server_addr_1));
     164      112824 :                         if (length_local_server_addr_1 > size_local_server_addr_1) {
     165           0 :                                 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %"PRIu32": should exceed array length %"PRIu32"", size_local_server_addr_1, length_local_server_addr_1);
     166             :                         }
     167      112824 :                         NDR_CHECK(ndr_check_string_terminator(ndr, length_local_server_addr_1, sizeof(uint8_t)));
     168      112824 :                         NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->local_server_addr, length_local_server_addr_1, sizeof(uint8_t), CH_DOS));
     169      112824 :                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_local_server_addr_0, 0);
     170             :                 }
     171      112824 :                 if (r->session_info) {
     172      112824 :                         _mem_save_session_info_0 = NDR_PULL_GET_MEM_CTX(ndr);
     173      112824 :                         NDR_PULL_SET_MEM_CTX(ndr, r->session_info, 0);
     174      112824 :                         NDR_CHECK(ndr_pull_auth_session_info_transport(ndr, NDR_SCALARS|NDR_BUFFERS, r->session_info));
     175      112824 :                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_session_info_0, 0);
     176             :                 }
     177             :         }
     178      154532 :         return NDR_ERR_SUCCESS;
     179             : }
     180             : 
     181           0 : static void ndr_print_flags_named_pipe_auth_req_info8(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct named_pipe_auth_req_info8 *r)
     182             : {
     183           0 :         ndr_print_named_pipe_auth_req_info8(ndr, name, r);
     184           0 : }
     185             : 
     186           0 : _PUBLIC_ void ndr_print_named_pipe_auth_req_info8(struct ndr_print *ndr, const char *name, const struct named_pipe_auth_req_info8 *r)
     187             : {
     188           0 :         ndr_print_struct(ndr, name, "named_pipe_auth_req_info8");
     189           0 :         if (r == NULL) { ndr_print_null(ndr); return; }
     190           0 :         ndr->depth++;
     191           0 :         ndr_print_uint8(ndr, "transport", r->transport);
     192           0 :         ndr_print_ptr(ndr, "remote_client_name", r->remote_client_name);
     193           0 :         ndr->depth++;
     194           0 :         if (r->remote_client_name) {
     195           0 :                 ndr_print_string(ndr, "remote_client_name", r->remote_client_name);
     196             :         }
     197           0 :         ndr->depth--;
     198           0 :         ndr_print_ptr(ndr, "remote_client_addr", r->remote_client_addr);
     199           0 :         ndr->depth++;
     200           0 :         if (r->remote_client_addr) {
     201           0 :                 ndr_print_string(ndr, "remote_client_addr", r->remote_client_addr);
     202             :         }
     203           0 :         ndr->depth--;
     204           0 :         ndr_print_uint16(ndr, "remote_client_port", r->remote_client_port);
     205           0 :         ndr_print_ptr(ndr, "local_server_name", r->local_server_name);
     206           0 :         ndr->depth++;
     207           0 :         if (r->local_server_name) {
     208           0 :                 ndr_print_string(ndr, "local_server_name", r->local_server_name);
     209             :         }
     210           0 :         ndr->depth--;
     211           0 :         ndr_print_ptr(ndr, "local_server_addr", r->local_server_addr);
     212           0 :         ndr->depth++;
     213           0 :         if (r->local_server_addr) {
     214           0 :                 ndr_print_string(ndr, "local_server_addr", r->local_server_addr);
     215             :         }
     216           0 :         ndr->depth--;
     217           0 :         ndr_print_uint16(ndr, "local_server_port", r->local_server_port);
     218           0 :         ndr_print_ptr(ndr, "session_info", r->session_info);
     219           0 :         ndr->depth++;
     220           0 :         if (r->session_info) {
     221           0 :                 ndr_print_auth_session_info_transport(ndr, "session_info", r->session_info);
     222             :         }
     223           0 :         ndr->depth--;
     224           0 :         ndr->depth--;
     225             : }
     226             : 
     227      195284 : static enum ndr_err_code ndr_push_named_pipe_auth_req_info(struct ndr_push *ndr, ndr_flags_type ndr_flags, const union named_pipe_auth_req_info *r)
     228             : {
     229        2480 :         uint32_t level;
     230      195284 :         NDR_PUSH_CHECK_FLAGS(ndr, ndr_flags);
     231      195284 :         if (ndr_flags & NDR_SCALARS) {
     232             :                 /* This token is not used again (except perhaps below in the NDR_BUFFERS case) */
     233       97642 :                 NDR_CHECK(ndr_push_steal_switch_value(ndr, r, &level));
     234       97642 :                 NDR_CHECK(ndr_push_union_align(ndr, 5));
     235       97642 :                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, level));
     236       97642 :                 NDR_CHECK(ndr_push_union_align(ndr, 5));
     237       97642 :                 switch (level) {
     238       97642 :                         case 8: {
     239       97642 :                                 NDR_CHECK(ndr_push_named_pipe_auth_req_info8(ndr, NDR_SCALARS, &r->info8));
     240       96402 :                         break; }
     241             : 
     242           0 :                         default:
     243           0 :                                 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %"PRIu32, level);
     244             :                 }
     245             :         }
     246      195284 :         if (ndr_flags & NDR_BUFFERS) {
     247       97642 :                 if (!(ndr_flags & NDR_SCALARS)) {
     248             :                         /* We didn't get it above, and the token is not needed after this. */
     249       97642 :                         NDR_CHECK(ndr_push_steal_switch_value(ndr, r, &level));
     250             :                 }
     251       97642 :                 switch (level) {
     252       97642 :                         case 8:
     253       97642 :                                 NDR_CHECK(ndr_push_named_pipe_auth_req_info8(ndr, NDR_BUFFERS, &r->info8));
     254       96402 :                         break;
     255             : 
     256           0 :                         default:
     257           0 :                                 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %"PRIu32, level);
     258             :                 }
     259             :         }
     260      192804 :         return NDR_ERR_SUCCESS;
     261             : }
     262             : 
     263       85928 : static enum ndr_err_code ndr_pull_named_pipe_auth_req_info(struct ndr_pull *ndr, ndr_flags_type ndr_flags, union named_pipe_auth_req_info *r)
     264             : {
     265        1256 :         uint32_t level;
     266        1256 :         uint32_t _level;
     267       85928 :         NDR_PULL_CHECK_FLAGS(ndr, ndr_flags);
     268       85928 :         if (ndr_flags & NDR_SCALARS) {
     269             :                 /* This token is not used again (except perhaps below in the NDR_BUFFERS case) */
     270       42964 :                 NDR_CHECK(ndr_pull_steal_switch_value(ndr, r, &level));
     271       42964 :                 NDR_CHECK(ndr_pull_union_align(ndr, 5));
     272       42964 :                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &_level));
     273       42964 :                 if (_level != level) {
     274           0 :                         return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %"PRIu32" for r at %s", (uint32_t)_level, __location__);
     275             :                 }
     276       42964 :                 NDR_CHECK(ndr_pull_union_align(ndr, 5));
     277       42964 :                 switch (level) {
     278       42964 :                         case 8: {
     279       42964 :                                 NDR_CHECK(ndr_pull_named_pipe_auth_req_info8(ndr, NDR_SCALARS, &r->info8));
     280       42336 :                         break; }
     281             : 
     282           0 :                         default:
     283           0 :                                 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %"PRIu32" at %s", level, __location__);
     284             :                 }
     285             :         }
     286       85928 :         if (ndr_flags & NDR_BUFFERS) {
     287       42964 :                 if (!(ndr_flags & NDR_SCALARS)) {
     288             :                         /* We didn't get it above, and the token is not needed after this. */
     289       42964 :                         NDR_CHECK(ndr_pull_steal_switch_value(ndr, r, &level));
     290             :                 }
     291       42964 :                 switch (level) {
     292       42964 :                         case 8:
     293       42964 :                                 NDR_CHECK(ndr_pull_named_pipe_auth_req_info8(ndr, NDR_BUFFERS, &r->info8));
     294       42336 :                         break;
     295             : 
     296           0 :                         default:
     297           0 :                                 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %"PRIu32" at %s", level, __location__);
     298             :                 }
     299             :         }
     300       84672 :         return NDR_ERR_SUCCESS;
     301             : }
     302             : 
     303           0 : _PUBLIC_ void ndr_print_named_pipe_auth_req_info(struct ndr_print *ndr, const char *name, const union named_pipe_auth_req_info *r)
     304             : {
     305           0 :         uint32_t level;
     306           0 :         level = ndr_print_steal_switch_value(ndr, r);
     307           0 :         ndr_print_union(ndr, name, level, "named_pipe_auth_req_info");
     308           0 :         switch (level) {
     309           0 :                 case 8:
     310           0 :                         ndr_print_named_pipe_auth_req_info8(ndr, "info8", &r->info8);
     311           0 :                 break;
     312             : 
     313           0 :                 default:
     314           0 :                         ndr_print_bad_level(ndr, name, level);
     315             :         }
     316           0 : }
     317             : 
     318       97642 : _PUBLIC_ enum ndr_err_code ndr_push_named_pipe_auth_req(struct ndr_push *ndr, ndr_flags_type ndr_flags, const struct named_pipe_auth_req *r)
     319             : {
     320       97642 :         NDR_PUSH_CHECK_FLAGS(ndr, ndr_flags);
     321       97642 :         if (ndr_flags & NDR_SCALARS) {
     322       97642 :                 NDR_CHECK(ndr_push_align(ndr, 5));
     323             :                 {
     324       97642 :                         libndr_flags _flags_save_uint32 = ndr->flags;
     325       97642 :                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_BIGENDIAN);
     326       97642 :                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_size_named_pipe_auth_req(r, ndr->flags) - 4));
     327       97642 :                         ndr->flags = _flags_save_uint32;
     328             :                 }
     329       97642 :                 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, NAMED_PIPE_AUTH_MAGIC, 4, sizeof(uint8_t), CH_DOS));
     330       97642 :                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->level));
     331       97642 :                 NDR_CHECK(ndr_push_set_switch_value(ndr, &r->info, r->level));
     332       97642 :                 NDR_CHECK(ndr_push_named_pipe_auth_req_info(ndr, NDR_SCALARS, &r->info));
     333       97642 :                 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
     334             :         }
     335       97642 :         if (ndr_flags & NDR_BUFFERS) {
     336       97642 :                 NDR_CHECK(ndr_push_set_switch_value(ndr, &r->info, r->level));
     337       97642 :                 NDR_CHECK(ndr_push_named_pipe_auth_req_info(ndr, NDR_BUFFERS, &r->info));
     338             :         }
     339       96402 :         return NDR_ERR_SUCCESS;
     340             : }
     341             : 
     342       42964 : _PUBLIC_ enum ndr_err_code ndr_pull_named_pipe_auth_req(struct ndr_pull *ndr, ndr_flags_type ndr_flags, struct named_pipe_auth_req *r)
     343             : {
     344       42964 :         uint32_t size_magic_0 = 0;
     345       42964 :         NDR_PULL_CHECK_FLAGS(ndr, ndr_flags);
     346       42964 :         if (ndr_flags & NDR_SCALARS) {
     347       42964 :                 NDR_CHECK(ndr_pull_align(ndr, 5));
     348             :                 {
     349       42964 :                         libndr_flags _flags_save_uint32 = ndr->flags;
     350       42964 :                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_BIGENDIAN);
     351       42964 :                         NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->length));
     352       42964 :                         ndr->flags = _flags_save_uint32;
     353             :                 }
     354       42964 :                 size_magic_0 = 4;
     355       42964 :                 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->magic, size_magic_0, sizeof(uint8_t), CH_DOS));
     356       42964 :                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->level));
     357       42964 :                 NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->info, r->level));
     358       42964 :                 NDR_CHECK(ndr_pull_named_pipe_auth_req_info(ndr, NDR_SCALARS, &r->info));
     359       42964 :                 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
     360             :         }
     361       42964 :         if (ndr_flags & NDR_BUFFERS) {
     362       42964 :                 NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->info, r->level));
     363       42964 :                 NDR_CHECK(ndr_pull_named_pipe_auth_req_info(ndr, NDR_BUFFERS, &r->info));
     364             :         }
     365       42336 :         return NDR_ERR_SUCCESS;
     366             : }
     367             : 
     368           0 : static void ndr_print_flags_named_pipe_auth_req(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct named_pipe_auth_req *r)
     369             : {
     370           0 :         ndr_print_named_pipe_auth_req(ndr, name, r);
     371           0 : }
     372             : 
     373           0 : _PUBLIC_ void ndr_print_named_pipe_auth_req(struct ndr_print *ndr, const char *name, const struct named_pipe_auth_req *r)
     374             : {
     375           0 :         ndr_print_struct(ndr, name, "named_pipe_auth_req");
     376           0 :         if (r == NULL) { ndr_print_null(ndr); return; }
     377           0 :         ndr->depth++;
     378             :         {
     379           0 :                 libndr_flags _flags_save_uint32 = ndr->flags;
     380           0 :                 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_BIGENDIAN);
     381           0 :                 ndr_print_uint32(ndr, "length", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?ndr_size_named_pipe_auth_req(r, ndr->flags) - 4:r->length);
     382           0 :                 ndr->flags = _flags_save_uint32;
     383             :         }
     384           0 :         ndr_print_string(ndr, "magic", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?NAMED_PIPE_AUTH_MAGIC:r->magic);
     385           0 :         ndr_print_uint32(ndr, "level", r->level);
     386           0 :         ndr_print_set_switch_value(ndr, &r->info, r->level);
     387           0 :         ndr_print_named_pipe_auth_req_info(ndr, "info", &r->info);
     388           0 :         ndr->depth--;
     389             : }
     390             : 
     391       97642 : _PUBLIC_ size_t ndr_size_named_pipe_auth_req(const struct named_pipe_auth_req *r, libndr_flags flags)
     392             : {
     393       97642 :         return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_named_pipe_auth_req);
     394             : }
     395             : 
     396       85928 : static enum ndr_err_code ndr_push_named_pipe_auth_rep_info8(struct ndr_push *ndr, ndr_flags_type ndr_flags, const struct named_pipe_auth_rep_info8 *r)
     397             : {
     398       85928 :         NDR_PUSH_CHECK_FLAGS(ndr, ndr_flags);
     399       85928 :         if (ndr_flags & NDR_SCALARS) {
     400       85928 :                 NDR_CHECK(ndr_push_align(ndr, 8));
     401       85928 :                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->file_type));
     402       85928 :                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->device_state));
     403       85928 :                 NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->allocation_size));
     404       85928 :                 NDR_CHECK(ndr_push_trailer_align(ndr, 8));
     405             :         }
     406       85928 :         if (ndr_flags & NDR_BUFFERS) {
     407        1256 :         }
     408       85928 :         return NDR_ERR_SUCCESS;
     409             : }
     410             : 
     411       48737 : static enum ndr_err_code ndr_pull_named_pipe_auth_rep_info8(struct ndr_pull *ndr, ndr_flags_type ndr_flags, struct named_pipe_auth_rep_info8 *r)
     412             : {
     413       48737 :         NDR_PULL_CHECK_FLAGS(ndr, ndr_flags);
     414       48737 :         if (ndr_flags & NDR_SCALARS) {
     415       48737 :                 NDR_CHECK(ndr_pull_align(ndr, 8));
     416       48737 :                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->file_type));
     417       48737 :                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->device_state));
     418       48737 :                 NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->allocation_size));
     419       48737 :                 NDR_CHECK(ndr_pull_trailer_align(ndr, 8));
     420             :         }
     421       48737 :         if (ndr_flags & NDR_BUFFERS) {
     422         620 :         }
     423       48737 :         return NDR_ERR_SUCCESS;
     424             : }
     425             : 
     426           0 : _PUBLIC_ void ndr_print_named_pipe_auth_rep_info8(struct ndr_print *ndr, const char *name, const struct named_pipe_auth_rep_info8 *r)
     427             : {
     428           0 :         ndr_print_struct(ndr, name, "named_pipe_auth_rep_info8");
     429           0 :         if (r == NULL) { ndr_print_null(ndr); return; }
     430           0 :         ndr->depth++;
     431           0 :         ndr_print_uint16(ndr, "file_type", r->file_type);
     432           0 :         ndr_print_uint16(ndr, "device_state", r->device_state);
     433           0 :         ndr_print_hyper(ndr, "allocation_size", r->allocation_size);
     434           0 :         ndr->depth--;
     435             : }
     436             : 
     437       85928 : static enum ndr_err_code ndr_push_named_pipe_auth_rep_info(struct ndr_push *ndr, ndr_flags_type ndr_flags, const union named_pipe_auth_rep_info *r)
     438             : {
     439        1256 :         uint32_t level;
     440       85928 :         NDR_PUSH_CHECK_FLAGS(ndr, ndr_flags);
     441       85928 :         if (ndr_flags & NDR_SCALARS) {
     442             :                 /* This token is not used again (except perhaps below in the NDR_BUFFERS case) */
     443       85928 :                 NDR_CHECK(ndr_push_steal_switch_value(ndr, r, &level));
     444       85928 :                 NDR_CHECK(ndr_push_union_align(ndr, 8));
     445       85928 :                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, level));
     446       85928 :                 NDR_CHECK(ndr_push_union_align(ndr, 8));
     447       85928 :                 switch (level) {
     448       85928 :                         case 8: {
     449       85928 :                                 NDR_CHECK(ndr_push_named_pipe_auth_rep_info8(ndr, NDR_SCALARS, &r->info8));
     450       84672 :                         break; }
     451             : 
     452           0 :                         default:
     453           0 :                                 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %"PRIu32, level);
     454             :                 }
     455             :         }
     456       85928 :         if (ndr_flags & NDR_BUFFERS) {
     457           0 :                 if (!(ndr_flags & NDR_SCALARS)) {
     458             :                         /* We didn't get it above, and the token is not needed after this. */
     459           0 :                         NDR_CHECK(ndr_push_steal_switch_value(ndr, r, &level));
     460             :                 }
     461           0 :                 switch (level) {
     462           0 :                         case 8:
     463           0 :                         break;
     464             : 
     465           0 :                         default:
     466           0 :                                 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %"PRIu32, level);
     467             :                 }
     468             :         }
     469       84672 :         return NDR_ERR_SUCCESS;
     470             : }
     471             : 
     472       48737 : static enum ndr_err_code ndr_pull_named_pipe_auth_rep_info(struct ndr_pull *ndr, ndr_flags_type ndr_flags, union named_pipe_auth_rep_info *r)
     473             : {
     474         620 :         uint32_t level;
     475         620 :         uint32_t _level;
     476       48737 :         NDR_PULL_CHECK_FLAGS(ndr, ndr_flags);
     477       48737 :         if (ndr_flags & NDR_SCALARS) {
     478             :                 /* This token is not used again (except perhaps below in the NDR_BUFFERS case) */
     479       48737 :                 NDR_CHECK(ndr_pull_steal_switch_value(ndr, r, &level));
     480       48737 :                 NDR_CHECK(ndr_pull_union_align(ndr, 8));
     481       48737 :                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &_level));
     482       48737 :                 if (_level != level) {
     483           0 :                         return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %"PRIu32" for r at %s", (uint32_t)_level, __location__);
     484             :                 }
     485       48737 :                 NDR_CHECK(ndr_pull_union_align(ndr, 8));
     486       48737 :                 switch (level) {
     487       48737 :                         case 8: {
     488       48737 :                                 NDR_CHECK(ndr_pull_named_pipe_auth_rep_info8(ndr, NDR_SCALARS, &r->info8));
     489       48117 :                         break; }
     490             : 
     491           0 :                         default:
     492           0 :                                 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %"PRIu32" at %s", level, __location__);
     493             :                 }
     494             :         }
     495       48737 :         if (ndr_flags & NDR_BUFFERS) {
     496           0 :                 if (!(ndr_flags & NDR_SCALARS)) {
     497             :                         /* We didn't get it above, and the token is not needed after this. */
     498           0 :                         NDR_CHECK(ndr_pull_steal_switch_value(ndr, r, &level));
     499             :                 }
     500           0 :                 switch (level) {
     501           0 :                         case 8:
     502           0 :                         break;
     503             : 
     504           0 :                         default:
     505           0 :                                 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %"PRIu32" at %s", level, __location__);
     506             :                 }
     507             :         }
     508       48117 :         return NDR_ERR_SUCCESS;
     509             : }
     510             : 
     511           0 : _PUBLIC_ void ndr_print_named_pipe_auth_rep_info(struct ndr_print *ndr, const char *name, const union named_pipe_auth_rep_info *r)
     512             : {
     513           0 :         uint32_t level;
     514           0 :         level = ndr_print_steal_switch_value(ndr, r);
     515           0 :         ndr_print_union(ndr, name, level, "named_pipe_auth_rep_info");
     516           0 :         switch (level) {
     517           0 :                 case 8:
     518           0 :                         ndr_print_named_pipe_auth_rep_info8(ndr, "info8", &r->info8);
     519           0 :                 break;
     520             : 
     521           0 :                 default:
     522           0 :                         ndr_print_bad_level(ndr, name, level);
     523             :         }
     524           0 : }
     525             : 
     526       85928 : _PUBLIC_ enum ndr_err_code ndr_push_named_pipe_auth_rep(struct ndr_push *ndr, ndr_flags_type ndr_flags, const struct named_pipe_auth_rep *r)
     527             : {
     528       85928 :         NDR_PUSH_CHECK_FLAGS(ndr, ndr_flags);
     529       85928 :         if (ndr_flags & NDR_SCALARS) {
     530       85928 :                 NDR_CHECK(ndr_push_align(ndr, 8));
     531             :                 {
     532       85928 :                         libndr_flags _flags_save_uint32 = ndr->flags;
     533       85928 :                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_BIGENDIAN);
     534       85928 :                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_size_named_pipe_auth_rep(r, ndr->flags) - 4));
     535       85928 :                         ndr->flags = _flags_save_uint32;
     536             :                 }
     537       85928 :                 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, NAMED_PIPE_AUTH_MAGIC, 4, sizeof(uint8_t), CH_DOS));
     538       85928 :                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->level));
     539       85928 :                 NDR_CHECK(ndr_push_set_switch_value(ndr, &r->info, r->level));
     540       85928 :                 NDR_CHECK(ndr_push_named_pipe_auth_rep_info(ndr, NDR_SCALARS, &r->info));
     541       85928 :                 NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->status));
     542       85928 :                 NDR_CHECK(ndr_push_trailer_align(ndr, 8));
     543             :         }
     544       85928 :         if (ndr_flags & NDR_BUFFERS) {
     545        1256 :         }
     546       85928 :         return NDR_ERR_SUCCESS;
     547             : }
     548             : 
     549       48737 : _PUBLIC_ enum ndr_err_code ndr_pull_named_pipe_auth_rep(struct ndr_pull *ndr, ndr_flags_type ndr_flags, struct named_pipe_auth_rep *r)
     550             : {
     551       48737 :         uint32_t size_magic_0 = 0;
     552       48737 :         NDR_PULL_CHECK_FLAGS(ndr, ndr_flags);
     553       48737 :         if (ndr_flags & NDR_SCALARS) {
     554       48737 :                 NDR_CHECK(ndr_pull_align(ndr, 8));
     555             :                 {
     556       48737 :                         libndr_flags _flags_save_uint32 = ndr->flags;
     557       48737 :                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_BIGENDIAN);
     558       48737 :                         NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->length));
     559       48737 :                         ndr->flags = _flags_save_uint32;
     560             :                 }
     561       48737 :                 size_magic_0 = 4;
     562       48737 :                 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->magic, size_magic_0, sizeof(uint8_t), CH_DOS));
     563       48737 :                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->level));
     564       48737 :                 NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->info, r->level));
     565       48737 :                 NDR_CHECK(ndr_pull_named_pipe_auth_rep_info(ndr, NDR_SCALARS, &r->info));
     566       48737 :                 NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->status));
     567       48737 :                 NDR_CHECK(ndr_pull_trailer_align(ndr, 8));
     568             :         }
     569       48737 :         if (ndr_flags & NDR_BUFFERS) {
     570         620 :         }
     571       48737 :         return NDR_ERR_SUCCESS;
     572             : }
     573             : 
     574           0 : static void ndr_print_flags_named_pipe_auth_rep(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct named_pipe_auth_rep *r)
     575             : {
     576           0 :         ndr_print_named_pipe_auth_rep(ndr, name, r);
     577           0 : }
     578             : 
     579           0 : _PUBLIC_ void ndr_print_named_pipe_auth_rep(struct ndr_print *ndr, const char *name, const struct named_pipe_auth_rep *r)
     580             : {
     581           0 :         ndr_print_struct(ndr, name, "named_pipe_auth_rep");
     582           0 :         if (r == NULL) { ndr_print_null(ndr); return; }
     583           0 :         ndr->depth++;
     584             :         {
     585           0 :                 libndr_flags _flags_save_uint32 = ndr->flags;
     586           0 :                 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_BIGENDIAN);
     587           0 :                 ndr_print_uint32(ndr, "length", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?ndr_size_named_pipe_auth_rep(r, ndr->flags) - 4:r->length);
     588           0 :                 ndr->flags = _flags_save_uint32;
     589             :         }
     590           0 :         ndr_print_string(ndr, "magic", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?NAMED_PIPE_AUTH_MAGIC:r->magic);
     591           0 :         ndr_print_uint32(ndr, "level", r->level);
     592           0 :         ndr_print_set_switch_value(ndr, &r->info, r->level);
     593           0 :         ndr_print_named_pipe_auth_rep_info(ndr, "info", &r->info);
     594           0 :         ndr_print_NTSTATUS(ndr, "status", r->status);
     595           0 :         ndr->depth--;
     596             : }
     597             : 
     598       85928 : _PUBLIC_ size_t ndr_size_named_pipe_auth_rep(const struct named_pipe_auth_rep *r, libndr_flags flags)
     599             : {
     600       85928 :         return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_named_pipe_auth_rep);
     601             : }
     602             : 
     603             : #ifndef SKIP_NDR_TABLE_named_pipe_auth
     604             : static const struct ndr_interface_public_struct named_pipe_auth_public_structs[] = {
     605             :         {
     606             :                 .name = "named_pipe_auth_req_info8",
     607             :                 .struct_size = sizeof(struct named_pipe_auth_req_info8 ),
     608             :                 .ndr_push = (ndr_push_flags_fn_t) ndr_push_named_pipe_auth_req_info8,
     609             :                 .ndr_pull = (ndr_pull_flags_fn_t) ndr_pull_named_pipe_auth_req_info8,
     610             :                 .ndr_print = (ndr_print_function_t) ndr_print_flags_named_pipe_auth_req_info8,
     611             :         },
     612             :         {
     613             :                 .name = "named_pipe_auth_req",
     614             :                 .struct_size = sizeof(struct named_pipe_auth_req ),
     615             :                 .ndr_push = (ndr_push_flags_fn_t) ndr_push_named_pipe_auth_req,
     616             :                 .ndr_pull = (ndr_pull_flags_fn_t) ndr_pull_named_pipe_auth_req,
     617             :                 .ndr_print = (ndr_print_function_t) ndr_print_flags_named_pipe_auth_req,
     618             :         },
     619             :         {
     620             :                 .name = "named_pipe_auth_rep",
     621             :                 .struct_size = sizeof(struct named_pipe_auth_rep ),
     622             :                 .ndr_push = (ndr_push_flags_fn_t) ndr_push_named_pipe_auth_rep,
     623             :                 .ndr_pull = (ndr_pull_flags_fn_t) ndr_pull_named_pipe_auth_rep,
     624             :                 .ndr_print = (ndr_print_function_t) ndr_print_flags_named_pipe_auth_rep,
     625             :         },
     626             :         { .name = NULL }
     627             : };
     628             : 
     629             : static const struct ndr_interface_call named_pipe_auth_calls[] = {
     630             :         { .name = NULL }
     631             : };
     632             : 
     633             : static const char * const named_pipe_auth_endpoint_strings[] = {
     634             :         "ncacn_np:[\\pipe\\named_pipe_auth]", 
     635             : };
     636             : 
     637             : static const struct ndr_interface_string_array named_pipe_auth_endpoints = {
     638             :         .count  = 1,
     639             :         .names  = named_pipe_auth_endpoint_strings
     640             : };
     641             : 
     642             : static const char * const named_pipe_auth_authservice_strings[] = {
     643             :         "host", 
     644             : };
     645             : 
     646             : static const struct ndr_interface_string_array named_pipe_auth_authservices = {
     647             :         .count  = 1,
     648             :         .names  = named_pipe_auth_authservice_strings
     649             : };
     650             : 
     651             : 
     652             : const struct ndr_interface_table ndr_table_named_pipe_auth = {
     653             :         .name           = "named_pipe_auth",
     654             :         .num_calls      = 0,
     655             :         .calls          = named_pipe_auth_calls,
     656             :         .num_public_structs     = 3,
     657             :         .public_structs         = named_pipe_auth_public_structs,
     658             :         .endpoints      = &named_pipe_auth_endpoints,
     659             :         .authservices   = &named_pipe_auth_authservices
     660             : };
     661             : 
     662             : #endif /* SKIP_NDR_TABLE_named_pipe_auth */

Generated by: LCOV version 1.14