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 2b515b7d Lines: 299 435 68.7 %
Date: 2024-02-28 12:06:22 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      287719 : _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      287719 :         NDR_PUSH_CHECK_FLAGS(ndr, ndr_flags);
      12      287719 :         if (ndr_flags & NDR_SCALARS) {
      13      183111 :                 NDR_CHECK(ndr_push_align(ndr, 5));
      14      183111 :                 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->transport));
      15      183111 :                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->remote_client_name));
      16      183111 :                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->remote_client_addr));
      17      183111 :                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->remote_client_port));
      18      183111 :                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->local_server_name));
      19      183111 :                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->local_server_addr));
      20      183111 :                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->local_server_port));
      21      183111 :                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->session_info));
      22      183111 :                 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
      23             :         }
      24      287719 :         if (ndr_flags & NDR_BUFFERS) {
      25      183111 :                 if (r->remote_client_name) {
      26      183111 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->remote_client_name, CH_UTF8)));
      27      183111 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
      28      183111 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->remote_client_name, CH_UTF8)));
      29      183111 :                         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      183111 :                 if (r->remote_client_addr) {
      32      183111 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->remote_client_addr, CH_DOS)));
      33      183111 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
      34      183111 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->remote_client_addr, CH_DOS)));
      35      183111 :                         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      183111 :                 if (r->local_server_name) {
      38      183111 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->local_server_name, CH_UTF8)));
      39      183111 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
      40      183111 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->local_server_name, CH_UTF8)));
      41      183111 :                         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      183111 :                 if (r->local_server_addr) {
      44      183111 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->local_server_addr, CH_DOS)));
      45      183111 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
      46      183111 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->local_server_addr, CH_DOS)));
      47      183111 :                         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      183111 :                 if (r->session_info) {
      50      183111 :                         NDR_CHECK(ndr_push_auth_session_info_transport(ndr, NDR_SCALARS|NDR_BUFFERS, r->session_info));
      51             :                 }
      52             :         }
      53      285239 :         return NDR_ERR_SUCCESS;
      54             : }
      55             : 
      56      169969 : _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      169969 :         uint32_t size_remote_client_name_1 = 0;
      60      169969 :         uint32_t length_remote_client_name_1 = 0;
      61      169969 :         TALLOC_CTX *_mem_save_remote_client_name_0 = NULL;
      62        1256 :         uint32_t _ptr_remote_client_addr;
      63      169969 :         uint32_t size_remote_client_addr_1 = 0;
      64      169969 :         uint32_t length_remote_client_addr_1 = 0;
      65      169969 :         TALLOC_CTX *_mem_save_remote_client_addr_0 = NULL;
      66        1256 :         uint32_t _ptr_local_server_name;
      67      169969 :         uint32_t size_local_server_name_1 = 0;
      68      169969 :         uint32_t length_local_server_name_1 = 0;
      69      169969 :         TALLOC_CTX *_mem_save_local_server_name_0 = NULL;
      70        1256 :         uint32_t _ptr_local_server_addr;
      71      169969 :         uint32_t size_local_server_addr_1 = 0;
      72      169969 :         uint32_t length_local_server_addr_1 = 0;
      73      169969 :         TALLOC_CTX *_mem_save_local_server_addr_0 = NULL;
      74        1256 :         uint32_t _ptr_session_info;
      75      169969 :         TALLOC_CTX *_mem_save_session_info_0 = NULL;
      76      169969 :         NDR_PULL_CHECK_FLAGS(ndr, ndr_flags);
      77      169969 :         if (ndr_flags & NDR_SCALARS) {
      78      123523 :                 NDR_CHECK(ndr_pull_align(ndr, 5));
      79      123523 :                 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->transport));
      80      123523 :                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_remote_client_name));
      81      123523 :                 if (_ptr_remote_client_name) {
      82      123523 :                         NDR_PULL_ALLOC(ndr, r->remote_client_name);
      83             :                 } else {
      84           0 :                         r->remote_client_name = NULL;
      85             :                 }
      86      123523 :                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_remote_client_addr));
      87      123523 :                 if (_ptr_remote_client_addr) {
      88      123523 :                         NDR_PULL_ALLOC(ndr, r->remote_client_addr);
      89             :                 } else {
      90           0 :                         r->remote_client_addr = NULL;
      91             :                 }
      92      123523 :                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->remote_client_port));
      93      123523 :                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_local_server_name));
      94      123523 :                 if (_ptr_local_server_name) {
      95      123523 :                         NDR_PULL_ALLOC(ndr, r->local_server_name);
      96             :                 } else {
      97           0 :                         r->local_server_name = NULL;
      98             :                 }
      99      123523 :                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_local_server_addr));
     100      123523 :                 if (_ptr_local_server_addr) {
     101      123523 :                         NDR_PULL_ALLOC(ndr, r->local_server_addr);
     102             :                 } else {
     103           0 :                         r->local_server_addr = NULL;
     104             :                 }
     105      123523 :                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->local_server_port));
     106      123523 :                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_session_info));
     107      123523 :                 if (_ptr_session_info) {
     108      123523 :                         NDR_PULL_ALLOC(ndr, r->session_info);
     109             :                 } else {
     110           0 :                         r->session_info = NULL;
     111             :                 }
     112      123523 :                 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
     113             :         }
     114      169969 :         if (ndr_flags & NDR_BUFFERS) {
     115      123523 :                 if (r->remote_client_name) {
     116      123523 :                         _mem_save_remote_client_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
     117      123523 :                         NDR_PULL_SET_MEM_CTX(ndr, r->remote_client_name, 0);
     118      123523 :                         NDR_CHECK(ndr_pull_array_size(ndr, &r->remote_client_name));
     119      123523 :                         NDR_CHECK(ndr_pull_array_length(ndr, &r->remote_client_name));
     120      123523 :                         NDR_CHECK(ndr_steal_array_size(ndr, (void*)&r->remote_client_name, &size_remote_client_name_1));
     121      123523 :                         NDR_CHECK(ndr_steal_array_length(ndr, (void*)&r->remote_client_name, &length_remote_client_name_1));
     122      123523 :                         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      123523 :                         NDR_CHECK(ndr_check_string_terminator(ndr, length_remote_client_name_1, sizeof(uint8_t)));
     126      123523 :                         NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->remote_client_name, length_remote_client_name_1, sizeof(uint8_t), CH_UTF8));
     127      123523 :                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_remote_client_name_0, 0);
     128             :                 }
     129      123523 :                 if (r->remote_client_addr) {
     130      123523 :                         _mem_save_remote_client_addr_0 = NDR_PULL_GET_MEM_CTX(ndr);
     131      123523 :                         NDR_PULL_SET_MEM_CTX(ndr, r->remote_client_addr, 0);
     132      123523 :                         NDR_CHECK(ndr_pull_array_size(ndr, &r->remote_client_addr));
     133      123523 :                         NDR_CHECK(ndr_pull_array_length(ndr, &r->remote_client_addr));
     134      123523 :                         NDR_CHECK(ndr_steal_array_size(ndr, (void*)&r->remote_client_addr, &size_remote_client_addr_1));
     135      123523 :                         NDR_CHECK(ndr_steal_array_length(ndr, (void*)&r->remote_client_addr, &length_remote_client_addr_1));
     136      123523 :                         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      123523 :                         NDR_CHECK(ndr_check_string_terminator(ndr, length_remote_client_addr_1, sizeof(uint8_t)));
     140      123523 :                         NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->remote_client_addr, length_remote_client_addr_1, sizeof(uint8_t), CH_DOS));
     141      123523 :                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_remote_client_addr_0, 0);
     142             :                 }
     143      123523 :                 if (r->local_server_name) {
     144      123523 :                         _mem_save_local_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
     145      123523 :                         NDR_PULL_SET_MEM_CTX(ndr, r->local_server_name, 0);
     146      123523 :                         NDR_CHECK(ndr_pull_array_size(ndr, &r->local_server_name));
     147      123523 :                         NDR_CHECK(ndr_pull_array_length(ndr, &r->local_server_name));
     148      123523 :                         NDR_CHECK(ndr_steal_array_size(ndr, (void*)&r->local_server_name, &size_local_server_name_1));
     149      123523 :                         NDR_CHECK(ndr_steal_array_length(ndr, (void*)&r->local_server_name, &length_local_server_name_1));
     150      123523 :                         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      123523 :                         NDR_CHECK(ndr_check_string_terminator(ndr, length_local_server_name_1, sizeof(uint8_t)));
     154      123523 :                         NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->local_server_name, length_local_server_name_1, sizeof(uint8_t), CH_UTF8));
     155      123523 :                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_local_server_name_0, 0);
     156             :                 }
     157      123523 :                 if (r->local_server_addr) {
     158      123523 :                         _mem_save_local_server_addr_0 = NDR_PULL_GET_MEM_CTX(ndr);
     159      123523 :                         NDR_PULL_SET_MEM_CTX(ndr, r->local_server_addr, 0);
     160      123523 :                         NDR_CHECK(ndr_pull_array_size(ndr, &r->local_server_addr));
     161      123523 :                         NDR_CHECK(ndr_pull_array_length(ndr, &r->local_server_addr));
     162      123523 :                         NDR_CHECK(ndr_steal_array_size(ndr, (void*)&r->local_server_addr, &size_local_server_addr_1));
     163      123523 :                         NDR_CHECK(ndr_steal_array_length(ndr, (void*)&r->local_server_addr, &length_local_server_addr_1));
     164      123523 :                         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      123523 :                         NDR_CHECK(ndr_check_string_terminator(ndr, length_local_server_addr_1, sizeof(uint8_t)));
     168      123523 :                         NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->local_server_addr, length_local_server_addr_1, sizeof(uint8_t), CH_DOS));
     169      123523 :                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_local_server_addr_0, 0);
     170             :                 }
     171      123523 :                 if (r->session_info) {
     172      123523 :                         _mem_save_session_info_0 = NDR_PULL_GET_MEM_CTX(ndr);
     173      123523 :                         NDR_PULL_SET_MEM_CTX(ndr, r->session_info, 0);
     174      123523 :                         NDR_CHECK(ndr_pull_auth_session_info_transport(ndr, NDR_SCALARS|NDR_BUFFERS, r->session_info));
     175      123523 :                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_session_info_0, 0);
     176             :                 }
     177             :         }
     178      168713 :         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      209216 : 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      209216 :         NDR_PUSH_CHECK_FLAGS(ndr, ndr_flags);
     231      209216 :         if (ndr_flags & NDR_SCALARS) {
     232             :                 /* This token is not used again (except perhaps below in the NDR_BUFFERS case) */
     233      104608 :                 NDR_CHECK(ndr_push_steal_switch_value(ndr, r, &level));
     234      104608 :                 NDR_CHECK(ndr_push_union_align(ndr, 5));
     235      104608 :                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, level));
     236      104608 :                 NDR_CHECK(ndr_push_union_align(ndr, 5));
     237      104608 :                 switch (level) {
     238      104608 :                         case 8: {
     239      104608 :                                 NDR_CHECK(ndr_push_named_pipe_auth_req_info8(ndr, NDR_SCALARS, &r->info8));
     240      103368 :                         break; }
     241             : 
     242           0 :                         default:
     243           0 :                                 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %"PRIu32, level);
     244             :                 }
     245             :         }
     246      209216 :         if (ndr_flags & NDR_BUFFERS) {
     247      104608 :                 if (!(ndr_flags & NDR_SCALARS)) {
     248             :                         /* We didn't get it above, and the token is not needed after this. */
     249      104608 :                         NDR_CHECK(ndr_push_steal_switch_value(ndr, r, &level));
     250             :                 }
     251      104608 :                 switch (level) {
     252      104608 :                         case 8:
     253      104608 :                                 NDR_CHECK(ndr_push_named_pipe_auth_req_info8(ndr, NDR_BUFFERS, &r->info8));
     254      103368 :                         break;
     255             : 
     256           0 :                         default:
     257           0 :                                 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %"PRIu32, level);
     258             :                 }
     259             :         }
     260      206736 :         return NDR_ERR_SUCCESS;
     261             : }
     262             : 
     263       92892 : 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       92892 :         NDR_PULL_CHECK_FLAGS(ndr, ndr_flags);
     268       92892 :         if (ndr_flags & NDR_SCALARS) {
     269             :                 /* This token is not used again (except perhaps below in the NDR_BUFFERS case) */
     270       46446 :                 NDR_CHECK(ndr_pull_steal_switch_value(ndr, r, &level));
     271       46446 :                 NDR_CHECK(ndr_pull_union_align(ndr, 5));
     272       46446 :                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &_level));
     273       46446 :                 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       46446 :                 NDR_CHECK(ndr_pull_union_align(ndr, 5));
     277       46446 :                 switch (level) {
     278       46446 :                         case 8: {
     279       46446 :                                 NDR_CHECK(ndr_pull_named_pipe_auth_req_info8(ndr, NDR_SCALARS, &r->info8));
     280       45818 :                         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       92892 :         if (ndr_flags & NDR_BUFFERS) {
     287       46446 :                 if (!(ndr_flags & NDR_SCALARS)) {
     288             :                         /* We didn't get it above, and the token is not needed after this. */
     289       46446 :                         NDR_CHECK(ndr_pull_steal_switch_value(ndr, r, &level));
     290             :                 }
     291       46446 :                 switch (level) {
     292       46446 :                         case 8:
     293       46446 :                                 NDR_CHECK(ndr_pull_named_pipe_auth_req_info8(ndr, NDR_BUFFERS, &r->info8));
     294       45818 :                         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       91636 :         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      104608 : _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      104608 :         NDR_PUSH_CHECK_FLAGS(ndr, ndr_flags);
     321      104608 :         if (ndr_flags & NDR_SCALARS) {
     322      104608 :                 NDR_CHECK(ndr_push_align(ndr, 5));
     323             :                 {
     324      104608 :                         libndr_flags _flags_save_uint32 = ndr->flags;
     325      104608 :                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_BIGENDIAN);
     326      104608 :                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_size_named_pipe_auth_req(r, ndr->flags) - 4));
     327      104608 :                         ndr->flags = _flags_save_uint32;
     328             :                 }
     329      104608 :                 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, NAMED_PIPE_AUTH_MAGIC, 4, sizeof(uint8_t), CH_DOS));
     330      104608 :                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->level));
     331      104608 :                 NDR_CHECK(ndr_push_set_switch_value(ndr, &r->info, r->level));
     332      104608 :                 NDR_CHECK(ndr_push_named_pipe_auth_req_info(ndr, NDR_SCALARS, &r->info));
     333      104608 :                 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
     334             :         }
     335      104608 :         if (ndr_flags & NDR_BUFFERS) {
     336      104608 :                 NDR_CHECK(ndr_push_set_switch_value(ndr, &r->info, r->level));
     337      104608 :                 NDR_CHECK(ndr_push_named_pipe_auth_req_info(ndr, NDR_BUFFERS, &r->info));
     338             :         }
     339      103368 :         return NDR_ERR_SUCCESS;
     340             : }
     341             : 
     342       46446 : _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       46446 :         uint32_t size_magic_0 = 0;
     345       46446 :         NDR_PULL_CHECK_FLAGS(ndr, ndr_flags);
     346       46446 :         if (ndr_flags & NDR_SCALARS) {
     347       46446 :                 NDR_CHECK(ndr_pull_align(ndr, 5));
     348             :                 {
     349       46446 :                         libndr_flags _flags_save_uint32 = ndr->flags;
     350       46446 :                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_BIGENDIAN);
     351       46446 :                         NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->length));
     352       46446 :                         ndr->flags = _flags_save_uint32;
     353             :                 }
     354       46446 :                 size_magic_0 = 4;
     355       46446 :                 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->magic, size_magic_0, sizeof(uint8_t), CH_DOS));
     356       46446 :                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->level));
     357       46446 :                 NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->info, r->level));
     358       46446 :                 NDR_CHECK(ndr_pull_named_pipe_auth_req_info(ndr, NDR_SCALARS, &r->info));
     359       46446 :                 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
     360             :         }
     361       46446 :         if (ndr_flags & NDR_BUFFERS) {
     362       46446 :                 NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->info, r->level));
     363       46446 :                 NDR_CHECK(ndr_pull_named_pipe_auth_req_info(ndr, NDR_BUFFERS, &r->info));
     364             :         }
     365       45818 :         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      104608 : _PUBLIC_ size_t ndr_size_named_pipe_auth_req(const struct named_pipe_auth_req *r, libndr_flags flags)
     392             : {
     393      104608 :         return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_named_pipe_auth_req);
     394             : }
     395             : 
     396       92892 : 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       92892 :         NDR_PUSH_CHECK_FLAGS(ndr, ndr_flags);
     399       92892 :         if (ndr_flags & NDR_SCALARS) {
     400       92892 :                 NDR_CHECK(ndr_push_align(ndr, 8));
     401       92892 :                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->file_type));
     402       92892 :                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->device_state));
     403       92892 :                 NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->allocation_size));
     404       92892 :                 NDR_CHECK(ndr_push_trailer_align(ndr, 8));
     405             :         }
     406       92892 :         if (ndr_flags & NDR_BUFFERS) {
     407        1256 :         }
     408       92892 :         return NDR_ERR_SUCCESS;
     409             : }
     410             : 
     411       52217 : 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       52217 :         NDR_PULL_CHECK_FLAGS(ndr, ndr_flags);
     414       52217 :         if (ndr_flags & NDR_SCALARS) {
     415       52217 :                 NDR_CHECK(ndr_pull_align(ndr, 8));
     416       52217 :                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->file_type));
     417       52217 :                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->device_state));
     418       52217 :                 NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->allocation_size));
     419       52217 :                 NDR_CHECK(ndr_pull_trailer_align(ndr, 8));
     420             :         }
     421       52217 :         if (ndr_flags & NDR_BUFFERS) {
     422         620 :         }
     423       52217 :         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       92892 : 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       92892 :         NDR_PUSH_CHECK_FLAGS(ndr, ndr_flags);
     441       92892 :         if (ndr_flags & NDR_SCALARS) {
     442             :                 /* This token is not used again (except perhaps below in the NDR_BUFFERS case) */
     443       92892 :                 NDR_CHECK(ndr_push_steal_switch_value(ndr, r, &level));
     444       92892 :                 NDR_CHECK(ndr_push_union_align(ndr, 8));
     445       92892 :                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, level));
     446       92892 :                 NDR_CHECK(ndr_push_union_align(ndr, 8));
     447       92892 :                 switch (level) {
     448       92892 :                         case 8: {
     449       92892 :                                 NDR_CHECK(ndr_push_named_pipe_auth_rep_info8(ndr, NDR_SCALARS, &r->info8));
     450       91636 :                         break; }
     451             : 
     452           0 :                         default:
     453           0 :                                 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %"PRIu32, level);
     454             :                 }
     455             :         }
     456       92892 :         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       91636 :         return NDR_ERR_SUCCESS;
     470             : }
     471             : 
     472       52217 : 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       52217 :         NDR_PULL_CHECK_FLAGS(ndr, ndr_flags);
     477       52217 :         if (ndr_flags & NDR_SCALARS) {
     478             :                 /* This token is not used again (except perhaps below in the NDR_BUFFERS case) */
     479       52217 :                 NDR_CHECK(ndr_pull_steal_switch_value(ndr, r, &level));
     480       52217 :                 NDR_CHECK(ndr_pull_union_align(ndr, 8));
     481       52217 :                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &_level));
     482       52217 :                 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       52217 :                 NDR_CHECK(ndr_pull_union_align(ndr, 8));
     486       52217 :                 switch (level) {
     487       52217 :                         case 8: {
     488       52217 :                                 NDR_CHECK(ndr_pull_named_pipe_auth_rep_info8(ndr, NDR_SCALARS, &r->info8));
     489       51597 :                         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       52217 :         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       51597 :         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       92892 : _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       92892 :         NDR_PUSH_CHECK_FLAGS(ndr, ndr_flags);
     529       92892 :         if (ndr_flags & NDR_SCALARS) {
     530       92892 :                 NDR_CHECK(ndr_push_align(ndr, 8));
     531             :                 {
     532       92892 :                         libndr_flags _flags_save_uint32 = ndr->flags;
     533       92892 :                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_BIGENDIAN);
     534       92892 :                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_size_named_pipe_auth_rep(r, ndr->flags) - 4));
     535       92892 :                         ndr->flags = _flags_save_uint32;
     536             :                 }
     537       92892 :                 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, NAMED_PIPE_AUTH_MAGIC, 4, sizeof(uint8_t), CH_DOS));
     538       92892 :                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->level));
     539       92892 :                 NDR_CHECK(ndr_push_set_switch_value(ndr, &r->info, r->level));
     540       92892 :                 NDR_CHECK(ndr_push_named_pipe_auth_rep_info(ndr, NDR_SCALARS, &r->info));
     541       92892 :                 NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->status));
     542       92892 :                 NDR_CHECK(ndr_push_trailer_align(ndr, 8));
     543             :         }
     544       92892 :         if (ndr_flags & NDR_BUFFERS) {
     545        1256 :         }
     546       92892 :         return NDR_ERR_SUCCESS;
     547             : }
     548             : 
     549       52217 : _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       52217 :         uint32_t size_magic_0 = 0;
     552       52217 :         NDR_PULL_CHECK_FLAGS(ndr, ndr_flags);
     553       52217 :         if (ndr_flags & NDR_SCALARS) {
     554       52217 :                 NDR_CHECK(ndr_pull_align(ndr, 8));
     555             :                 {
     556       52217 :                         libndr_flags _flags_save_uint32 = ndr->flags;
     557       52217 :                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_BIGENDIAN);
     558       52217 :                         NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->length));
     559       52217 :                         ndr->flags = _flags_save_uint32;
     560             :                 }
     561       52217 :                 size_magic_0 = 4;
     562       52217 :                 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->magic, size_magic_0, sizeof(uint8_t), CH_DOS));
     563       52217 :                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->level));
     564       52217 :                 NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->info, r->level));
     565       52217 :                 NDR_CHECK(ndr_pull_named_pipe_auth_rep_info(ndr, NDR_SCALARS, &r->info));
     566       52217 :                 NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->status));
     567       52217 :                 NDR_CHECK(ndr_pull_trailer_align(ndr, 8));
     568             :         }
     569       52217 :         if (ndr_flags & NDR_BUFFERS) {
     570         620 :         }
     571       52217 :         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       92892 : _PUBLIC_ size_t ndr_size_named_pipe_auth_rep(const struct named_pipe_auth_rep *r, libndr_flags flags)
     599             : {
     600       92892 :         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