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

Generated by: LCOV version 1.13