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